Revision e39e3aba

View differences:

libavcodec/dsputil.h
64 64
void ff_h264_idct8_add4_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
65 65
void ff_h264_idct_add8_c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
66 66

  
67
void ff_h264_chroma_dc_dequant_idct_c(DCTELEM *block, int qmul);
67 68
void ff_h264_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qmul);
68 69
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp);
69 70
void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc);
libavcodec/h264.c
288 288
#undef xStride
289 289
#undef stride
290 290

  
291
static void chroma_dc_dequant_idct_c(DCTELEM *block, int qmul){
292
    const int stride= 16*2;
293
    const int xStride= 16;
294
    int a,b,c,d,e;
295

  
296
    a= block[stride*0 + xStride*0];
297
    b= block[stride*0 + xStride*1];
298
    c= block[stride*1 + xStride*0];
299
    d= block[stride*1 + xStride*1];
300

  
301
    e= a-b;
302
    a= a+b;
303
    b= c-d;
304
    c= c+d;
305

  
306
    block[stride*0 + xStride*0]= ((a+c)*qmul) >> 7;
307
    block[stride*0 + xStride*1]= ((e+b)*qmul) >> 7;
308
    block[stride*1 + xStride*0]= ((a-c)*qmul) >> 7;
309
    block[stride*1 + xStride*1]= ((e-b)*qmul) >> 7;
310
}
311

  
312 291
#if 0
313 292
static void chroma_dc_dct_c(DCTELEM *block){
314 293
    const int stride= 16*2;
......
1286 1265
            }else{
1287 1266
                if(is_h264){
1288 1267
                    if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+0] ])
1289
                        chroma_dc_dequant_idct_c(h->mb + 16*16     , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
1268
                        h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16     , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
1290 1269
                    if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+1] ])
1291
                        chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
1270
                        h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16+4*16, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
1292 1271
                    h->h264dsp.h264_idct_add8(dest, block_offset,
1293 1272
                                              h->mb, uvlinesize,
1294 1273
                                              h->non_zero_count_cache);
1295 1274
                }else{
1296
                    chroma_dc_dequant_idct_c(h->mb + 16*16     , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
1297
                    chroma_dc_dequant_idct_c(h->mb + 16*16+4*16, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
1275
                    h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16     , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
1276
                    h->h264dsp.h264_chroma_dc_dequant_idct(h->mb + 16*16+4*16, h->dequant4_coeff[IS_INTRA(mb_type) ? 2:5][h->chroma_qp[1]][0]);
1298 1277
                    for(i=16; i<16+8; i++){
1299 1278
                        if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
1300 1279
                            uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
libavcodec/h264dsp.c
299 299
    c->h264_idct_add8      = ff_h264_idct_add8_c;
300 300
    c->h264_idct_add16intra= ff_h264_idct_add16intra_c;
301 301
    c->h264_luma_dc_dequant_idct= ff_h264_luma_dc_dequant_idct_c;
302
    c->h264_chroma_dc_dequant_idct= ff_h264_chroma_dc_dequant_idct_c;
302 303

  
303 304
    c->weight_h264_pixels_tab[0]= weight_h264_pixels16x16_c;
304 305
    c->weight_h264_pixels_tab[1]= weight_h264_pixels16x8_c;
libavcodec/h264dsp.h
72 72
    void (*h264_idct_add8)(uint8_t **dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
73 73
    void (*h264_idct_add16intra)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
74 74
    void (*h264_luma_dc_dequant_idct)(DCTELEM *output, DCTELEM *input/*align 16*/, int qmul);
75
    void (*h264_chroma_dc_dequant_idct)(DCTELEM *block, int qmul);
75 76
}H264DSPContext;
76 77

  
77 78
void ff_h264dsp_init(H264DSPContext *c);
libavcodec/h264idct.c
250 250
        output[stride* 4+offset]= ((((z1 - z2)*qmul + 128 ) >> 8));
251 251
        output[stride* 5+offset]= ((((z0 - z3)*qmul + 128 ) >> 8));
252 252
    }
253
#undef stride
254
}
255

  
256
void ff_h264_chroma_dc_dequant_idct_c(DCTELEM *block, int qmul){
257
    const int stride= 16*2;
258
    const int xStride= 16;
259
    int a,b,c,d,e;
260

  
261
    a= block[stride*0 + xStride*0];
262
    b= block[stride*0 + xStride*1];
263
    c= block[stride*1 + xStride*0];
264
    d= block[stride*1 + xStride*1];
265

  
266
    e= a-b;
267
    a= a+b;
268
    b= c-d;
269
    c= c+d;
270

  
271
    block[stride*0 + xStride*0]= ((a+c)*qmul) >> 7;
272
    block[stride*0 + xStride*1]= ((e+b)*qmul) >> 7;
273
    block[stride*1 + xStride*0]= ((a-c)*qmul) >> 7;
274
    block[stride*1 + xStride*1]= ((e-b)*qmul) >> 7;
253 275
}

Also available in: Unified diff