Revision 5cf08f23 libavcodec/h264.c

View differences:

libavcodec/h264.c
5665 5665
    const int beta  = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )];
5666 5666

  
5667 5667
    if( bS[0] < 4 ) {
5668
        int tc[4];
5668
        int8_t tc[4];
5669 5669
        for(i=0; i<4; i++)
5670 5670
            tc[i] = bS[i] ? tc0_table[index_a][bS[i] - 1] : -1;
5671 5671
        h->s.dsp.h264_h_loop_filter_luma(pix, stride, alpha, beta, tc);
......
5726 5726
    const int beta  = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )];
5727 5727

  
5728 5728
    if( bS[0] < 4 ) {
5729
        int tc[4];
5729
        int8_t tc[4];
5730 5730
        for(i=0; i<4; i++)
5731 5731
            tc[i] = bS[i] ? tc0_table[index_a][bS[i] - 1] + 1 : 0;
5732 5732
        h->s.dsp.h264_h_loop_filter_chroma(pix, stride, alpha, beta, tc);
5733 5733
    } else {
5734
        /* 8px edge length, see filter_mb_edgev */
5735
            for( d = 0; d < 8; d++ ){
5736
                const int p0 = pix[-1];
5737
                const int p1 = pix[-2];
5738
                const int q0 = pix[0];
5739
                const int q1 = pix[1];
5740

  
5741
                if( ABS( p0 - q0 ) < alpha &&
5742
                    ABS( p1 - p0 ) < beta &&
5743
                    ABS( q1 - q0 ) < beta ) {
5744

  
5745
                    pix[-1] = ( 2*p1 + p0 + q1 + 2 ) >> 2;   /* p0' */
5746
                    pix[0]  = ( 2*q1 + q0 + p1 + 2 ) >> 2;   /* q0' */
5747
                    tprintf("filter_mb_edgecv i:%d d:%d\n# bS:4 -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, d, pix[-3], p1, p0, q0, q1, pix[2], p1, pix[-1], pix[0], q1);
5748
                }
5749
                pix += stride;
5750
            }
5734
        h->s.dsp.h264_h_loop_filter_chroma_intra(pix, stride, alpha, beta);
5751 5735
    }
5752 5736
}
5753 5737

  
......
5913 5897
    const int pix_next  = stride;
5914 5898

  
5915 5899
    if( bS[0] < 4 ) {
5916
        int tc[4];
5900
        int8_t tc[4];
5917 5901
        for(i=0; i<4; i++)
5918 5902
            tc[i] = bS[i] ? tc0_table[index_a][bS[i] - 1] : -1;
5919 5903
        h->s.dsp.h264_v_loop_filter_luma(pix, stride, alpha, beta, tc);
......
5970 5954
    const int index_a = clip( qp + h->slice_alpha_c0_offset, 0, 51 );
5971 5955
    const int alpha = alpha_table[index_a];
5972 5956
    const int beta  = beta_table[clip( qp + h->slice_beta_offset, 0, 51 )];
5973
    const int pix_next  = stride;
5974 5957

  
5975 5958
    if( bS[0] < 4 ) {
5976
        int tc[4];
5959
        int8_t tc[4];
5977 5960
        for(i=0; i<4; i++)
5978 5961
            tc[i] = bS[i] ? tc0_table[index_a][bS[i] - 1] + 1 : 0;
5979 5962
        h->s.dsp.h264_v_loop_filter_chroma(pix, stride, alpha, beta, tc);
5980 5963
    } else {
5981
        /* 8px edge length, see filter_mb_edgev */
5982
            for( d = 0; d < 8; d++ ) {
5983
                const int p0 = pix[-1*pix_next];
5984
                const int p1 = pix[-2*pix_next];
5985
                const int q0 = pix[0];
5986
                const int q1 = pix[1*pix_next];
5987

  
5988
                if( ABS( p0 - q0 ) < alpha &&
5989
                    ABS( p1 - p0 ) < beta &&
5990
                    ABS( q1 - q0 ) < beta ) {
5991

  
5992
                    pix[-pix_next] = ( 2*p1 + p0 + q1 + 2 ) >> 2;   /* p0' */
5993
                    pix[0]         = ( 2*q1 + q0 + p1 + 2 ) >> 2;   /* q0' */
5994
                    tprintf("filter_mb_edgech i:%d d:%d, qp:%d, indexA:%d, alpha:%d, beta:%d\n# bS:%d -> [%02x, %02x, %02x, %02x, %02x, %02x] =>[%02x, %02x, %02x, %02x]\n", i, d, qp, index_a, alpha, beta, bS[i], pix[-3*pix_next], p1, p0, q0, q1, pix[2*pix_next], pix[-2*pix_next], pix[-pix_next], pix[0], pix[pix_next]);
5995
                }
5996
                pix++;
5997
            }
5964
        h->s.dsp.h264_v_loop_filter_chroma_intra(pix, stride, alpha, beta);
5998 5965
    }
5999 5966
}
6000 5967

  

Also available in: Unified diff