[Ffmpeg-devel] [PATCH] fix 2 ac3 bit allocation bugs

Justin Ruggles jruggle
Sun Sep 3 00:28:51 CEST 2006


Hello,

In my attempts to adjust AC3 bit allocation parameters, I have come
across 2 bugs.  They do not currently affect FFmpeg's output since they
only involves table values which are not used right now, but I think
they should be fixed anyway...especially since the tables could be
reused in an FFmpeg AC-3 decoder.

bug #1:
I ran into problems when increasing the bandwidth setting.  I found the
issue to be the last table entry in bndtab.  It should be set to the
next starting bin number, not zero.

bug #2:
The floorcod table entries are copied directly from the spec, but when
using floorcod of 7 it gives buggy output.  Also, the value of 63488
doesn't make sense (it makes the masking curve flat...i think).  Anyway,
I found the answer in the spec.

A/52A page 60, last paragraph:
"...each step is definied exactly in terms of fixed-point integer
operations and table lookups.  Throughout the discussion below, signed
two's complement arithmetic is employed..."

So the table needs to be changed to signed 16-bit.  This makes
floorcod[7] = -2048, which encodes and decodes properly.

Thanks,
Justin
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ffmpeg-ac3_bitalloc_bugs.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060902/5b2322a7/attachment.txt>



More information about the ffmpeg-devel mailing list