added 16000hz test, changed downsampling to at least 2 * pixel freq

master
Ahmet Inan 2011-09-26 15:26:48 +02:00
rodzic bf05c488aa
commit e73d00a09b
4 zmienionych plików z 11 dodań i 4 usunięć

3
.gitignore vendored
Wyświetl plik

@ -5,6 +5,9 @@ debug
11025.ppm
11025.wav
11025.dat
16000.ppm
16000.wav
16000.dat
40000.ppm
40000.wav
40000.dat

Wyświetl plik

@ -1,5 +1,5 @@
CFLAGS = -DUP=1 -DDN=1 -D_GNU_SOURCE=1 -W -Wall -O3 -std=c99 -ffast-math
CFLAGS = -DUP=0 -DDN=1 -D_GNU_SOURCE=1 -W -Wall -O3 -std=c99 -ffast-math
LDFLAGS = -lm -lasound
all: encode decode debug
@ -7,11 +7,13 @@ all: encode decode debug
test: all
./encode smpte.ppm 8000.wav 8000
./encode smpte.ppm 11025.wav 11025
./encode smpte.ppm 16000.wav 16000
./encode smpte.ppm 40000.wav 40000
./encode smpte.ppm 44100.wav 44100
./encode smpte.ppm 48000.wav 48000
./decode 8000.wav 8000.ppm
./decode 11025.wav 11025.ppm
./decode 16000.wav 16000.ppm
./decode 40000.wav 40000.ppm
./decode 44100.wav 44100.ppm
./decode 48000.wav 48000.ppm
@ -19,17 +21,19 @@ test: all
fun: all
./encode smpte.ppm 8000.wav 8000
./encode smpte.ppm 11025.wav 11025
./encode smpte.ppm 16000.wav 16000
./encode smpte.ppm 40000.wav 40000
./encode smpte.ppm 44100.wav 44100
./encode smpte.ppm 48000.wav 48000
./debug 8000.wav 8000.ppm > 8000.dat
./debug 11025.wav 11025.ppm > 11025.dat
./debug 16000.wav 16000.ppm > 16000.dat
./debug 40000.wav 40000.ppm > 40000.dat
./debug 44100.wav 44100.ppm > 44100.dat
./debug 48000.wav 48000.ppm > 48000.dat
clean:
rm -f encode decode debug *.o {8000,11025,40000,44100,48000}.{ppm,wav,dat}
rm -f encode decode debug *.o {8000,11025,16000,40000,44100,48000}.{ppm,wav,dat}
encode: encode.o mmap_file.o pcm.o wav.o alsa.o yuv.o

Wyświetl plik

@ -92,7 +92,7 @@ int main(int argc, char **argv)
#if DN && !UP
int64_t factor_L = 1;
// factor_M * step should be smaller than pixel length
int64_t factor_M = rate * 0.088 / 320.0;
int64_t factor_M = rate * 0.088 / 320.0 / 2;
#endif
#if !DN
int64_t factor_L = 1;

Wyświetl plik

@ -121,7 +121,7 @@ int main(int argc, char **argv)
#if DN && !UP
int64_t factor_L = 1;
// factor_M * step should be smaller than pixel length
int64_t factor_M = rate * 0.088 / 320.0;
int64_t factor_M = rate * 0.088 / 320.0 / 2;
#endif
#if !DN
int64_t factor_L = 1;