Revision 19fb234e libavcodec/h264idct.c

View differences:

libavcodec/h264idct.c
216 216
            ff_h264_idct_dc_add_c(dest[(i&4)>>2] + block_offset[i], block + i*16, stride);
217 217
    }
218 218
}
219
/**
220
 * IDCT transforms the 16 dc values and dequantizes them.
221
 * @param qp quantization parameter
222
 */
223
void ff_h264_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qmul){
224
#define stride 16
225
    int i;
226
    int temp[16];
227
    static const uint8_t x_offset[4]={0, 2*stride, 8*stride, 10*stride};
228

  
229
    for(i=0; i<4; i++){
230
        const int z0= input[4*i+0] + input[4*i+1];
231
        const int z1= input[4*i+0] - input[4*i+1];
232
        const int z2= input[4*i+2] - input[4*i+3];
233
        const int z3= input[4*i+2] + input[4*i+3];
234

  
235
        temp[4*i+0]= z0+z3;
236
        temp[4*i+1]= z0-z3;
237
        temp[4*i+2]= z1-z2;
238
        temp[4*i+3]= z1+z2;
239
    }
240

  
241
    for(i=0; i<4; i++){
242
        const int offset= x_offset[i];
243
        const int z0= temp[4*0+i] + temp[4*2+i];
244
        const int z1= temp[4*0+i] - temp[4*2+i];
245
        const int z2= temp[4*1+i] - temp[4*3+i];
246
        const int z3= temp[4*1+i] + temp[4*3+i];
247

  
248
        output[stride* 0+offset]= ((((z0 + z3)*qmul + 128 ) >> 8));
249
        output[stride* 1+offset]= ((((z1 + z2)*qmul + 128 ) >> 8));
250
        output[stride* 4+offset]= ((((z1 - z2)*qmul + 128 ) >> 8));
251
        output[stride* 5+offset]= ((((z0 - z3)*qmul + 128 ) >> 8));
252
    }
253
}

Also available in: Unified diff