Revision 19fb234e libavcodec/svq3.c

View differences:

libavcodec/svq3.c
126 126
};
127 127

  
128 128

  
129
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *block, int qp)
129
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp)
130 130
{
131 131
    const int qmul = svq3_dequant_coeff[qp];
132 132
#define stride 16
133 133
    int i;
134 134
    int temp[16];
135 135
    static const int x_offset[4] = {0, 1*stride, 4* stride,  5*stride};
136
    static const int y_offset[4] = {0, 2*stride, 8* stride, 10*stride};
137 136

  
138 137
    for (i = 0; i < 4; i++){
139
        const int offset = y_offset[i];
140
        const int z0 = 13*(block[offset+stride*0] +    block[offset+stride*4]);
141
        const int z1 = 13*(block[offset+stride*0] -    block[offset+stride*4]);
142
        const int z2 =  7* block[offset+stride*1] - 17*block[offset+stride*5];
143
        const int z3 = 17* block[offset+stride*1] +  7*block[offset+stride*5];
138
        const int z0= 13*(input[4*i+0] +    input[4*i+1]);
139
        const int z1= 13*(input[4*i+0] -    input[4*i+1]);
140
        const int z2=  7* input[4*i+2] - 17*input[4*i+3];
141
        const int z3= 17* input[4*i+2] +  7*input[4*i+3];
144 142

  
145 143
        temp[4*i+0] = z0+z3;
146 144
        temp[4*i+1] = z1+z2;
......
155 153
        const int z2 =  7* temp[4*1+i] - 17*temp[4*3+i];
156 154
        const int z3 = 17* temp[4*1+i] +  7*temp[4*3+i];
157 155

  
158
        block[stride*0 +offset] = ((z0 + z3)*qmul + 0x80000) >> 20;
159
        block[stride*2 +offset] = ((z1 + z2)*qmul + 0x80000) >> 20;
160
        block[stride*8 +offset] = ((z1 - z2)*qmul + 0x80000) >> 20;
161
        block[stride*10+offset] = ((z0 - z3)*qmul + 0x80000) >> 20;
156
        output[stride*0 +offset] = ((z0 + z3)*qmul + 0x80000) >> 20;
157
        output[stride*2 +offset] = ((z1 + z2)*qmul + 0x80000) >> 20;
158
        output[stride*8 +offset] = ((z1 - z2)*qmul + 0x80000) >> 20;
159
        output[stride*10+offset] = ((z0 - z3)*qmul + 0x80000) >> 20;
162 160
    }
163 161
}
164 162
#undef stride

Also available in: Unified diff