From da6be8fcec16a94d8084bda8bb8a0a411a96bcf7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 9 Mar 2013 20:37:11 +0100 Subject: h264: add a parameter to the MB_FIELD macro. This way it does not look like a constant. --- libavcodec/h264_mvpred.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libavcodec/h264_mvpred.h') diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h index a61ad20f66..b0f60343f6 100644 --- a/libavcodec/h264_mvpred.h +++ b/libavcodec/h264_mvpred.h @@ -61,11 +61,11 @@ static av_always_inline int fetch_diagonal_mv(H264Context *h, const int16_t **C, AV_ZERO32(h->mv_cache[list][scan8[0] - 2]); *C = h->mv_cache[list][scan8[0] - 2]; - if (!MB_FIELD && IS_INTERLACED(h->left_type[0])) { + if (!MB_FIELD(h) && IS_INTERLACED(h->left_type[0])) { SET_DIAG_MV(* 2, >> 1, h->left_mb_xy[0] + h->mb_stride, (h->mb_y & 1) * 2 + (i >> 5)); } - if (MB_FIELD && !IS_INTERLACED(h->left_type[0])) { + if (MB_FIELD(h) && !IS_INTERLACED(h->left_type[0])) { // left shift will turn LIST_NOT_USED into PART_NOT_AVAILABLE, but that's OK. SET_DIAG_MV(/ 2, << 1, h->left_mb_xy[i >= 36], ((i >> 2)) & 3); } @@ -232,7 +232,7 @@ static av_always_inline void pred_8x16_motion(H264Context *const h, #define FIX_MV_MBAFF(type, refn, mvn, idx) \ if (FRAME_MBAFF) { \ - if (MB_FIELD) { \ + if (MB_FIELD(h)) { \ if (!IS_INTERLACED(type)) { \ refn <<= 1; \ AV_COPY32(mvbuf[idx], mvn); \ @@ -360,7 +360,7 @@ static void fill_decode_neighbors(H264Context *h, int mb_type) h->topleft_partition = -1; - top_xy = mb_xy - (h->mb_stride << MB_FIELD); + top_xy = mb_xy - (h->mb_stride << MB_FIELD(h)); /* Wow, what a mess, why didn't they simplify the interlacing & intra * stuff, I can't imagine that these complex rules are worth it. */ @@ -761,7 +761,7 @@ static void fill_decode_caches(H264Context *h, int mb_type) MAP_F2F(scan8[0] - 1 + 3 * 8, left_type[LBOT]) if (FRAME_MBAFF) { - if (MB_FIELD) { + if (MB_FIELD(h)) { #define MAP_F2F(idx, mb_type) \ if (!IS_INTERLACED(mb_type) && h->ref_cache[list][idx] >= 0) { \ @@ -801,7 +801,7 @@ static void av_unused decode_mb_skip(H264Context *h) memset(h->non_zero_count[mb_xy], 0, 48); - if (MB_FIELD) + if (MB_FIELD(h)) mb_type |= MB_TYPE_INTERLACED; if (h->slice_type_nos == AV_PICTURE_TYPE_B) { -- cgit v1.2.3