mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-14 19:31:24 +00:00
avcodec/apedec: properly calculate and store absolute value
This commit is contained in:
parent
ed0001482a
commit
ea0972f6dd
@ -1311,7 +1311,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
|
|||||||
int32_t *data, int count, int order, int fracbits)
|
int32_t *data, int count, int order, int fracbits)
|
||||||
{
|
{
|
||||||
int res;
|
int res;
|
||||||
int absres;
|
unsigned absres;
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
/* round fixedpoint scalar product */
|
/* round fixedpoint scalar product */
|
||||||
@ -1335,7 +1335,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
|
|||||||
/* Version 3.98 and later files */
|
/* Version 3.98 and later files */
|
||||||
|
|
||||||
/* Update the adaption coefficients */
|
/* Update the adaption coefficients */
|
||||||
absres = res < 0 ? -(unsigned)res : res;
|
absres = FFABS(res);
|
||||||
if (absres)
|
if (absres)
|
||||||
*f->adaptcoeffs = APESIGN(res) *
|
*f->adaptcoeffs = APESIGN(res) *
|
||||||
(8 << ((absres > f->avg * 3) + (absres > f->avg * 4 / 3)));
|
(8 << ((absres > f->avg * 3) + (absres > f->avg * 4 / 3)));
|
||||||
|
Loading…
Reference in New Issue
Block a user