diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-21 15:50:18 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-21 15:50:18 +0400 |
commit | bf4d0f8328c8f64611ca44a6ffdc30ca4f028249 (patch) | |
tree | e37df66f9571e2753a827c23ba8c075a8af5d323 /libavcodec/h264_loopfilter.c | |
parent | e168b508163d7dc05176d81e6b5ea73ac23eb38b (diff) | |
parent | 7fa00653a550c0d24b3951c0f9fed6350ecf5ce4 (diff) |
Merge commit '7fa00653a550c0d24b3951c0f9fed6350ecf5ce4'
* commit '7fa00653a550c0d24b3951c0f9fed6350ecf5ce4':
h264: add a parameter to the FIELD_PICTURE macro.
h264: add a parameter to the FRAME_MBAFF macro.
Conflicts:
libavcodec/h264.c
libavcodec/h264_loopfilter.c
libavcodec/h264_refs.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_loopfilter.c')
-rw-r--r-- | libavcodec/h264_loopfilter.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index 4ff9204e48..f383bc17eb 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -268,7 +268,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, if( IS_INTRA(mb_type) ) { static const int16_t bS4[4] = {4,4,4,4}; static const int16_t bS3[4] = {3,3,3,3}; - const int16_t *bSH = FIELD_PICTURE ? bS3 : bS4; + const int16_t *bSH = FIELD_PICTURE(h) ? bS3 : bS4; if(left_type) filter_mb_edgev( &img_y[4*0<<pixel_shift], linesize, bS4, qp0, a, b, h, 1); if( IS_8x8DCT(mb_type) ) { @@ -369,12 +369,12 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, int step = 1+(mb_type>>24); //IS_8x8DCT(mb_type) ? 2 : 1; edges = 4 - 3*((mb_type>>3) & !(h->cbp & 15)); //(mb_type & MB_TYPE_16x16) && !(h->cbp & 15) ? 1 : 4; h->h264dsp.h264_loop_filter_strength( bS, h->non_zero_count_cache, h->ref_cache, h->mv_cache, - h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE); + h->list_count==2, edges, step, mask_edge0, mask_edge1, FIELD_PICTURE(h)); } if( IS_INTRA(left_type) ) AV_WN64A(bS[0][0], 0x0004000400040004ULL); if( IS_INTRA(top_type) ) - AV_WN64A(bS[1][0], FIELD_PICTURE ? 0x0003000300030003ULL : 0x0004000400040004ULL); + AV_WN64A(bS[1][0], FIELD_PICTURE(h) ? 0x0003000300030003ULL : 0x0004000400040004ULL); #define FILTER(hv,dir,edge,intra)\ if(AV_RN64A(bS[dir][edge])) { \ @@ -414,7 +414,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, } void ff_h264_filter_mb_fast( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize) { - av_assert2(!FRAME_MBAFF); + av_assert2(!FRAME_MBAFF(h)); if(!h->h264dsp.h264_loop_filter_strength || h->pps.chroma_qp_diff) { ff_h264_filter_mb(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize); return; @@ -479,7 +479,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u if(mbm_type && !first_vertical_edge_done){ - if (FRAME_MBAFF && (dir == 1) && ((mb_y&1) == 0) + if (FRAME_MBAFF(h) && (dir == 1) && ((mb_y&1) == 0) && IS_INTERLACED(mbm_type&~mb_type) ) { // This is a special case in the norm where the filtering must @@ -535,14 +535,14 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u if( IS_INTRA(mb_type|mbm_type)) { AV_WN64A(bS, 0x0003000300030003ULL); if ( (!IS_INTERLACED(mb_type|mbm_type)) - || ((FRAME_MBAFF || (h->picture_structure != PICT_FRAME)) && (dir == 0)) + || ((FRAME_MBAFF(h) || (h->picture_structure != PICT_FRAME)) && (dir == 0)) ) AV_WN64A(bS, 0x0004000400040004ULL); } else { int i; int mv_done; - if( dir && FRAME_MBAFF && IS_INTERLACED(mb_type ^ mbm_type)) { + if( dir && FRAME_MBAFF(h) && IS_INTERLACED(mb_type ^ mbm_type)) { AV_WN64A(bS, 0x0001000100010001ULL); mv_done = 1; } @@ -712,7 +712,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint int a = h->slice_alpha_c0_offset - qp_bd_offset; int b = h->slice_beta_offset - qp_bd_offset; - if (FRAME_MBAFF + if (FRAME_MBAFF(h) // and current and left pair do not have the same interlaced type && IS_INTERLACED(mb_type^h->left_type[LTOP]) // and left mb is in available to us |