[FFmpeg-devel] [PATCH 3/4] opus: Add Special Hybrid Folding (per RFC8251)

Andrew D'Addesio modchipv12 at gmail.com
Fri Dec 8 08:53:29 EET 2017


On Wed Dec 6 21:42:48 EET 2017, James Almer <jamrial at gmail.com>
wrote:
> Valgrind apparently complains about this commit, as i mentioned in
> another reply to this thread

Hi James, thanks for reporting the issue. There's indeed a problem
with patch #3 (use-of-uninitialized-memory in norm[] and norm2[]).

libopus organizes the norm[] variable into bands with *room for* 8
MDCT coefficients in each band (even though the actual number of
coefficients per band is 1, 2, 4, or 8 for 2.5ms, 5ms, 10ms, or 20ms
CELT frames, respectively).

Whereas Libav/FFmpeg changes the organization of norm[] slightly and
packs the bands contiguously (i.e. each band is allocated the
necessary amount of 1 << f->size MDCT coefficients, and no more),
leaving some unused space at the end of norm[].

Hence, every instance of "8 * xxx" in my patch should really be
"xxx << f->size". That got rid of all errors in valgrind/MSAN.

Rostislav has applied the change to master with Commit
4678339e745dac8fa428 ("opus: fix hybrid folding indexing during band
quantization"), so the bug should be fixed now. Thanks for catching
it!

Andrew


More information about the ffmpeg-devel mailing list