From 3176217c60ca7828712985092d9102d331ea4f3d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 22 Mar 2016 13:31:21 +0100 Subject: h264: decouple h264_ps from the h264 decoder Make the SPS/PPS parsing independent of the H264Context, to allow decoupling the parser from the decoder. The change is modelled after the one done earlier for HEVC. Move the dequant buffers to the PPS to avoid complex checks whether they changed and an expensive copy for frame threads. --- libavcodec/h264_direct.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavcodec/h264_direct.c') diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index a7966e15e9..391f8f1d6a 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -310,7 +310,7 @@ single_col: *mb_type |= MB_TYPE_DIRECT2 | (mb_type_col[0] & (MB_TYPE_16x8 | MB_TYPE_8x16)); } else { - if (!h->sps.direct_8x8_inference_flag) { + if (!h->ps.sps->direct_8x8_inference_flag) { /* FIXME: Save sub mb types from previous frames (or derive * from MVs) so we know exactly what block size to use. */ sub_mb_type += (MB_TYPE_8x8 - MB_TYPE_16x16); /* B_SUB_4x4 */ @@ -533,7 +533,7 @@ single_col: *mb_type |= MB_TYPE_L0L1 | MB_TYPE_DIRECT2 | (mb_type_col[0] & (MB_TYPE_16x8 | MB_TYPE_8x16)); } else { - if (!h->sps.direct_8x8_inference_flag) { + if (!h->ps.sps->direct_8x8_inference_flag) { /* FIXME: save sub mb types from previous frames (or derive * from MVs) so we know exactly what block size to use */ sub_mb_type = MB_TYPE_8x8 | MB_TYPE_P0L0 | MB_TYPE_P0L1 | @@ -574,7 +574,7 @@ single_col: if (IS_INTERLACED(*mb_type) != IS_INTERLACED(mb_type_col[0])) { int y_shift = 2 * !IS_INTERLACED(*mb_type); - assert(h->sps.direct_8x8_inference_flag); + assert(h->ps.sps->direct_8x8_inference_flag); for (i8 = 0; i8 < 4; i8++) { const int x8 = i8 & 1; -- cgit v1.2.3