diff options
author | Anton Khirnov <anton@khirnov.net> | 2015-01-18 00:28:46 +0300 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2015-03-21 13:27:13 +0300 |
commit | ed451a08a46b2b07fd2dba3e55ffddd18ae6e3d6 (patch) | |
tree | 151e633149b373656c8119b058efb6d6083f3386 /libavcodec/h264.h | |
parent | 56febc993b928ccc039a32158ca60b234c311875 (diff) |
h264: move sub_mb_type into the per-slice context
Diffstat (limited to 'libavcodec/h264.h')
-rw-r--r-- | libavcodec/h264.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h index c94b818156..6cd30e8663 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -366,6 +366,8 @@ typedef struct H264SliceContext { */ DECLARE_ALIGNED(16, int16_t, mv_cache)[2][5 * 8][2]; DECLARE_ALIGNED(8, int8_t, ref_cache)[2][5 * 8]; + + DECLARE_ALIGNED(8, uint16_t, sub_mb_type)[4]; } H264SliceContext; /** @@ -438,9 +440,6 @@ typedef struct H264Context { int picture_structure; int first_field; - DECLARE_ALIGNED(8, uint16_t, sub_mb_type)[4]; - - int direct_spatial_mv_pred; int col_parity; int col_fieldoff; @@ -1027,21 +1026,21 @@ static av_always_inline void write_back_motion(H264Context *h, if (sl->slice_type_nos == AV_PICTURE_TYPE_B && CABAC(h)) { if (IS_8X8(mb_type)) { uint8_t *direct_table = &h->direct_table[4 * h->mb_xy]; - direct_table[1] = h->sub_mb_type[1] >> 1; - direct_table[2] = h->sub_mb_type[2] >> 1; - direct_table[3] = h->sub_mb_type[3] >> 1; + direct_table[1] = sl->sub_mb_type[1] >> 1; + direct_table[2] = sl->sub_mb_type[2] >> 1; + direct_table[3] = sl->sub_mb_type[3] >> 1; } } } -static av_always_inline int get_dct8x8_allowed(H264Context *h) +static av_always_inline int get_dct8x8_allowed(H264Context *h, H264SliceContext *sl) { if (h->sps.direct_8x8_inference_flag) - return !(AV_RN64A(h->sub_mb_type) & + return !(AV_RN64A(sl->sub_mb_type) & ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8) * 0x0001000100010001ULL)); else - return !(AV_RN64A(h->sub_mb_type) & + return !(AV_RN64A(sl->sub_mb_type) & ((MB_TYPE_16x8 | MB_TYPE_8x16 | MB_TYPE_8x8 | MB_TYPE_DIRECT2) * 0x0001000100010001ULL)); } |