Commit c4f8d5d9 authored by Michael Niedermayer's avatar Michael Niedermayer

write shorter headers if possible

Originally committed as revision 3494 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent a42c7b07
...@@ -107,7 +107,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) ...@@ -107,7 +107,7 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
put_le16(pb, 2); /* wav_extra_size */ put_le16(pb, 2); /* wav_extra_size */
hdrsize += 2; hdrsize += 2;
put_le16(pb, ((enc->block_align - 4 * enc->channels) / (4 * enc->channels)) * 8 + 1); /* wSamplesPerBlock */ put_le16(pb, ((enc->block_align - 4 * enc->channels) / (4 * enc->channels)) * 8 + 1); /* wSamplesPerBlock */
} else { } else if(enc->extradata_size){
put_le16(pb, enc->extradata_size); put_le16(pb, enc->extradata_size);
put_buffer(pb, enc->extradata, enc->extradata_size); put_buffer(pb, enc->extradata, enc->extradata_size);
hdrsize += enc->extradata_size; hdrsize += enc->extradata_size;
...@@ -115,6 +115,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc) ...@@ -115,6 +115,8 @@ int put_wav_header(ByteIOContext *pb, AVCodecContext *enc)
hdrsize++; hdrsize++;
put_byte(pb, 0); put_byte(pb, 0);
} }
} else {
hdrsize -= 2;
} }
return hdrsize; return hdrsize;
......
...@@ -113,19 +113,19 @@ ccc201054669e94717022bb4f2aea4ce *./data/out.yuv ...@@ -113,19 +113,19 @@ ccc201054669e94717022bb4f2aea4ce *./data/out.yuv
stddev: 10.99 PSNR:27.30 bytes:7602176 stddev: 10.99 PSNR:27.30 bytes:7602176
21f8ff9f1daacd9133683bb4ea0f50a4 *./data/a-mp2.mp2 21f8ff9f1daacd9133683bb4ea0f50a4 *./data/a-mp2.mp2
95712 ./data/a-mp2.mp2 95712 ./data/a-mp2.mp2
624d9789f3ac193bbae4af3bd8cb02b7 *./data/out.wav 91ab1b253cd360037d3fca67b795aba8 *./data/out.wav
1055278 ./data/out.wav 1055276 ./data/out.wav
d056da679e6d6682812fffb28a7f0db6 *./data/a-ac3.rm d056da679e6d6682812fffb28a7f0db6 *./data/a-ac3.rm
97983 ./data/a-ac3.rm 97983 ./data/a-ac3.rm
69526b38166395785eec8ccfb90a105e *./data/a-g726.wav e1aa1d139e8e241cdf9be8ac8252dabb *./data/a-g726.wav
24332 ./data/a-g726.wav 24330 ./data/a-g726.wav
20cb2fcffd33573a60c93d4dceacd1d1 *./data/out.wav 2f1b2fdb2ebdf4250a850fdcc28b50d1 *./data/out.wav
97190 ./data/out.wav 97188 ./data/out.wav
bdc512b78e2ccb1d815aec08794650eb *./data/a-adpcm_ima.wav bdc512b78e2ccb1d815aec08794650eb *./data/a-adpcm_ima.wav
266288 ./data/a-adpcm_ima.wav 266288 ./data/a-adpcm_ima.wav
449ec3854e8b09982302f92ea9cd47ca *./data/out.wav 1316b03da3bdc8df9785c7995e3c9b2a *./data/out.wav
1056686 ./data/out.wav 1056684 ./data/out.wav
5ac5a5ffd680d7880dfb1dd069851691 *./data/a-adpcm_ms.wav d2eee867856d2bdb6d08e936d4ceec0c *./data/a-adpcm_ms.wav
267310 ./data/a-adpcm_ms.wav 267308 ./data/a-adpcm_ms.wav
e4276587e9ffef41a007ac4c12d3fad2 *./data/out.wav 91a84bb4f319a3a0bf0c0441b3d3a529 *./data/out.wav
1056574 ./data/out.wav 1056572 ./data/out.wav
...@@ -43,8 +43,8 @@ c39dd19b88f9e0f03a318b51c37edb61 *./data/b-libav.yuv4mpeg ...@@ -43,8 +43,8 @@ c39dd19b88f9e0f03a318b51c37edb61 *./data/b-libav.yuv4mpeg
3801810 ./data/b-libav.yuv4mpeg 3801810 ./data/b-libav.yuv4mpeg
./data/b-libav%d.pgm CRC=84c09106 ./data/b-libav%d.pgm CRC=84c09106
./data/b-libav%d.ppm CRC=25c06ecf ./data/b-libav%d.ppm CRC=25c06ecf
4b7690747c49e4e8e910359768e4a77e *./data/b-libav.wav b0a8c8063d81921db5d7c8f50a1cc454 *./data/b-libav.wav
89134 ./data/b-libav.wav 89132 ./data/b-libav.wav
./data/b-libav.wav CRC=2a09519c ./data/b-libav.wav CRC=2a09519c
e2a6d6fae17394dfe87cb5bb8ae11837 *./data/b-libav.al e2a6d6fae17394dfe87cb5bb8ae11837 *./data/b-libav.al
44544 ./data/b-libav.al 44544 ./data/b-libav.al
......
...@@ -113,19 +113,19 @@ stddev: 0.00 PSNR:99.99 bytes:7602176 ...@@ -113,19 +113,19 @@ stddev: 0.00 PSNR:99.99 bytes:7602176
stddev: 3.43 PSNR:37.39 bytes:7602176 stddev: 3.43 PSNR:37.39 bytes:7602176
21f8ff9f1daacd9133683bb4ea0f50a4 *./data/a-mp2.mp2 21f8ff9f1daacd9133683bb4ea0f50a4 *./data/a-mp2.mp2
95712 ./data/a-mp2.mp2 95712 ./data/a-mp2.mp2
624d9789f3ac193bbae4af3bd8cb02b7 *./data/out.wav 91ab1b253cd360037d3fca67b795aba8 *./data/out.wav
1055278 ./data/out.wav 1055276 ./data/out.wav
d056da679e6d6682812fffb28a7f0db6 *./data/a-ac3.rm d056da679e6d6682812fffb28a7f0db6 *./data/a-ac3.rm
97983 ./data/a-ac3.rm 97983 ./data/a-ac3.rm
69526b38166395785eec8ccfb90a105e *./data/a-g726.wav e1aa1d139e8e241cdf9be8ac8252dabb *./data/a-g726.wav
24332 ./data/a-g726.wav 24330 ./data/a-g726.wav
20cb2fcffd33573a60c93d4dceacd1d1 *./data/out.wav 2f1b2fdb2ebdf4250a850fdcc28b50d1 *./data/out.wav
97190 ./data/out.wav 97188 ./data/out.wav
bdc512b78e2ccb1d815aec08794650eb *./data/a-adpcm_ima.wav bdc512b78e2ccb1d815aec08794650eb *./data/a-adpcm_ima.wav
266288 ./data/a-adpcm_ima.wav 266288 ./data/a-adpcm_ima.wav
449ec3854e8b09982302f92ea9cd47ca *./data/out.wav 1316b03da3bdc8df9785c7995e3c9b2a *./data/out.wav
1056686 ./data/out.wav 1056684 ./data/out.wav
5ac5a5ffd680d7880dfb1dd069851691 *./data/a-adpcm_ms.wav d2eee867856d2bdb6d08e936d4ceec0c *./data/a-adpcm_ms.wav
267310 ./data/a-adpcm_ms.wav 267308 ./data/a-adpcm_ms.wav
e4276587e9ffef41a007ac4c12d3fad2 *./data/out.wav 91a84bb4f319a3a0bf0c0441b3d3a529 *./data/out.wav
1056574 ./data/out.wav 1056572 ./data/out.wav
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment