Browse Source

avcodec/apedec: properly calculate and store absolute value

tags/n4.4
Paul B Mahol 5 years ago
parent
commit
ea0972f6dd
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/apedec.c

+ 2
- 2
libavcodec/apedec.c View File

@@ -1311,7 +1311,7 @@ static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
int32_t *data, int count, int order, int fracbits)
{
int res;
int absres;
unsigned absres;

while (count--) {
/* 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 */

/* Update the adaption coefficients */
absres = res < 0 ? -(unsigned)res : res;
absres = FFABS(res);
if (absres)
*f->adaptcoeffs = APESIGN(res) *
(8 << ((absres > f->avg * 3) + (absres > f->avg * 4 / 3)));


Loading…
Cancel
Save