Revision cc4d3dd3 libavcodec/ac3dsp.c

View differences:

libavcodec/ac3dsp.c
50 50
    return v;
51 51
}
52 52

  
53
static void ac3_lshift_int16_c(int16_t *src, int len, unsigned int shift)
54
{
55
    int i;
56

  
57
    if (shift > 0) {
58
        for (i = 0; i < len; i++)
59
            src[i] <<= shift;
60
    }
61
}
62

  
63
static void ac3_shift_int32_c(int32_t *src, int len, int shift)
64
{
65
    int i;
66

  
67
    if (shift > 0) {
68
        for (i = 0; i < len; i++)
69
            src[i] <<= shift;
70
    } else if (shift < 0) {
71
        shift = -shift;
72
        for (i = 0; i < len; i++)
73
            src[i] >>= shift;
74
    }
75
}
76

  
53 77
av_cold void ff_ac3dsp_init(AC3DSPContext *c)
54 78
{
55 79
    c->ac3_exponent_min = ac3_exponent_min_c;
56 80
    c->ac3_max_msb_abs_int16 = ac3_max_msb_abs_int16_c;
81
    c->ac3_lshift_int16 = ac3_lshift_int16_c;
82
    c->ac3_shift_int32  = ac3_shift_int32_c;
57 83

  
58 84
    if (HAVE_MMX)
59 85
        ff_ac3dsp_init_x86(c);

Also available in: Unified diff