Revision b1159ad9 libavcodec/apedec.c

View differences:

libavcodec/apedec.c
648 648
    do_init_filter(&f[1], buf + order * 3 + HISTORY_SIZE, order);
649 649
}
650 650

  
651
static inline void do_apply_filter(APEContext * ctx, int version, APEFilter *f, int32_t *data, int count, int order, int fracbits)
651
static void do_apply_filter(APEContext * ctx, int version, APEFilter *f, int32_t *data, int count, int order, int fracbits)
652 652
{
653 653
    int res;
654 654
    int absres;
655 655

  
656 656
    while (count--) {
657 657
        /* round fixedpoint scalar product */
658
        res = (ctx->dsp.scalarproduct_int16(f->delay - order, f->coeffs, order, 0) + (1 << (fracbits - 1))) >> fracbits;
659

  
660
        if (*data < 0)
661
            ctx->dsp.add_int16(f->coeffs, f->adaptcoeffs - order, order);
662
        else if (*data > 0)
663
            ctx->dsp.sub_int16(f->coeffs, f->adaptcoeffs - order, order);
664

  
658
        res = ctx->dsp.scalarproduct_and_madd_int16(f->coeffs, f->delay - order, f->adaptcoeffs - order, order, APESIGN(*data));
659
        res = (res + (1 << (fracbits - 1))) >> fracbits;
665 660
        res += *data;
666

  
667 661
        *data++ = res;
668 662

  
669 663
        /* Update the output history */

Also available in: Unified diff