OSDN Git Service

adpcmenc: Calculate the IMA_QT predictor without overflow
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 4 Sep 2012 11:02:30 +0000 (14:02 +0300)
committerMartin Storsjö <martin@martin.st>
Tue, 4 Sep 2012 12:30:58 +0000 (15:30 +0300)
commitaa264da5bf6a3d82a47abba4cfcfa629dd1f3daa
tree5dcb4dbbede4e1a77f7cf72fc894c9dc50a0c009
parentf82c4fb27fa7f8afbe8411c9d37e85facbbc87ae
adpcmenc: Calculate the IMA_QT predictor without overflow

Previously, the value given to put_bits was 10 bits long for positive
predictors, even though 9 bits were to be written. The extra bit could
in some cases overwrite existing bits in the bitstream writer cache.

This fixes a failed assert in put_bits.h, when running a version
built with -DDEBUG.

The fate test result gets slightly improved, thanks to getting rid
of the overwritten bits in the bitstream writer cache.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/adpcmenc.c
tests/ref/fate/acodec-adpcm-ima_qt