[FFmpeg-devel] [PATCH] raw audio read block size align

Michael Niedermayer michaelni
Thu Nov 27 22:18:58 CET 2008


On Thu, Nov 27, 2008 at 03:05:21PM +0200, Maksym Veremeyenko wrote:
> Hi!
>
> Originally similar patch was introduced in:
>
> http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-October/055484.html
> http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-November/055683.html
>
> and recently mentioned on looking for solution on recovering truncated PCM 
> packet.
>
> Newer version of patch attached.
>
> It fix "6 channel raw audio input" issue, but cause regression test fail 
> for some files.
>
> Some notes about *a-g726.wav* regression test DID NOT pass:
>
> We perform test transcode by next command:
>
> ffmpeg -ab 128k -ac 2 -f s16le -i 
> /usr/local/src/ffmpeg-r15943/tests/asynth1.sw -ab 32k -ac 1 -ar 8000 
> -acodec g726 -y g726.wav
>
> Without patch resulting file has size *24279* bytes. After applying patch 
> it size become *24082* bytes.
>
> If we just (without applying patch) modify libavformat/raw.c:
> [...]
> -#define RAW_PACKET_SIZE 1024
> +#define RAW_PACKET_SIZE 4096
> [...]
> g726.wav will have *24082* bytes length
>
> If we just (without applying patch) modify libavformat/raw.c:
> [...]
> -#define RAW_PACKET_SIZE 1024
> +#define RAW_PACKET_SIZE 512
> [...]
> g726.wav will have *24858* bytes length
>
> My conclusion: regression test do/did not pass for g726 after applying this 
> patch or patch from original thread, because of buffer/packet length/size 
> dependencies in g726.c
>
> Other files that did not passed regression test also depends (IMHO) on 
> *RAW_PACKET_SIZE* from libavformat/raw.c. Here results:

there is a very significant difference between g726 and pcm in mov.

@@ -177,10 +177,10 @@
  stddev: 4394.71 PSNR: 23.46 bytes:  1053352/  1058444
  aefe11ab5067621a1c674859d6413891 *./tests/data/a-ac3.rm
  98203 ./tests/data/a-ac3.rm
-39878597b1d65cce473639a7d8c93b02 *./tests/data/a-g726.wav
-24279 ./tests/data/a-g726.wav
-888f2f016e608d044a1bacbca5497ed2 *./tests/data/g726.vsynth.out.wav
-stddev: 8364.40 PSNR: 17.87 bytes:    96936/  1058444
+5d8cce28f83dd33c3c7eaf43a5db5294 *./tests/data/a-g726.wav
+24082 ./tests/data/a-g726.wav
+4f1ba1af75dee64625a1c852e6cd01d3 *./tests/data/g726.vsynth.out.wav
+stddev: 8506.46 PSNR: 17.72 bytes:    96148/  1058444
  3b969c43e45582f713e3c35faee9e0cc *./tests/data/a-adpcm_ima.wav
  266300 ./tests/data/a-adpcm_ima.wav
  947196b1739a9d6fe0c29424cf61cd8c
*./tests/data/adpcm_ima_wav.vsynth.out.wav

for g726 the output of the decoder changes, not just the bitstream.
And it doesnt just change, even the number of samples in the file
changes.
There clearly is a bug beyond just some different packetization

[...]

> So, the problem (IMHO) not in patch, i think it just discover other 
> problems....

yes and once the g726 problem has been fixed the patch can be reviewed.
Until then this patch is postponed

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I count him braver who overcomes his desires than him who conquers his
enemies for the hardest victory is over self. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081127/c7688fbd/attachment.pgp>



More information about the ffmpeg-devel mailing list