Revision af0b2d67

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
428 428
#undef xStride
429 429
#undef stride
430 430

  
431
static void chroma_dc_dequant_idct_c(DCTELEM *block, int qmul){
432
    const int stride= 16*2;
433
    const int xStride= 16;
434
    int a,b,c,d,e;
435

  
436
    a= block[stride*0 + xStride*0];
437
    b= block[stride*0 + xStride*1];
438
    c= block[stride*1 + xStride*0];
439
    d= block[stride*1 + xStride*1];
440

  
441
    e= a-b;
442
    a= a+b;
443
    b= c-d;
444
    c= c+d;
445

  
446
    block[stride*0 + xStride*0]= ((a+c)*qmul) >> 7;
447
    block[stride*0 + xStride*1]= ((e+b)*qmul) >> 7;
448
    block[stride*1 + xStride*0]= ((a-c)*qmul) >> 7;
449
    block[stride*1 + xStride*1]= ((e-b)*qmul) >> 7;
450
}
451

  
452 431
#if 0
453 432
static void chroma_dc_dct_c(DCTELEM *block){
454 433
    const int stride= 16*2;
......
1712 1691
            }else{
1713 1692
                if(is_h264){
1714 1693
                    if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+0] ])
1715
                        chroma_dc_dequant_idct_c(h->mb + 16*16     , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
1694
                        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]);
1716 1695
                    if(h->non_zero_count_cache[ scan8[CHROMA_DC_BLOCK_INDEX+1] ])
1717
                        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]);
1696
                        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]);
1718 1697
                    h->h264dsp.h264_idct_add8(dest, block_offset,
1719 1698
                                              h->mb, uvlinesize,
1720 1699
                                              h->non_zero_count_cache);
1721 1700
                }
1722 1701
#if CONFIG_SVQ3_DECODER
1723 1702
                else{
1724
                    chroma_dc_dequant_idct_c(h->mb + 16*16     , h->dequant4_coeff[IS_INTRA(mb_type) ? 1:4][h->chroma_qp[0]][0]);
1725
                    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]);
1703
                    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]);
1704
                    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]);
1726 1705
                    for(i=16; i<16+8; i++){
1727 1706
                        if(h->non_zero_count_cache[ scan8[i] ] || h->mb[i*16]){
1728 1707
                            uint8_t * const ptr= dest[(i&4)>>2] + block_offset[i];
libavcodec/h264dsp.c
283 283
    c->h264_idct_add8      = ff_h264_idct_add8_c;
284 284
    c->h264_idct_add16intra= ff_h264_idct_add16intra_c;
285 285
    c->h264_luma_dc_dequant_idct= ff_h264_luma_dc_dequant_idct_c;
286
    c->h264_chroma_dc_dequant_idct= ff_h264_chroma_dc_dequant_idct_c;
286 287

  
287 288
    c->weight_h264_pixels_tab[0]= weight_h264_pixels16x16_c;
288 289
    c->weight_h264_pixels_tab[1]= weight_h264_pixels16x8_c;
libavcodec/h264dsp.h
68 68
    void (*h264_idct_add8)(uint8_t **dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
69 69
    void (*h264_idct_add16intra)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
70 70
    void (*h264_luma_dc_dequant_idct)(DCTELEM *output, DCTELEM *input/*align 16*/, int qmul);
71
    void (*h264_chroma_dc_dequant_idct)(DCTELEM *block, int qmul);
71 72
}H264DSPContext;
72 73

  
73 74
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