diff --git a/.gitignore b/.gitignore index 28c58b9..adc7fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ debug 11025.ppm 11025.wav 11025.dat +16000.ppm +16000.wav +16000.dat 40000.ppm 40000.wav 40000.dat diff --git a/Makefile b/Makefile index f0a2d0d..6c7e261 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/debug.c b/debug.c index 05be10e..63a79b0 100644 --- a/debug.c +++ b/debug.c @@ -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; diff --git a/decode.c b/decode.c index c65ff56..60668d4 100644 --- a/decode.c +++ b/decode.c @@ -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;