diff options
author | James Almer <jamrial@gmail.com> | 2017-11-08 14:15:16 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-11-08 14:23:48 -0300 |
commit | bc987cf91dd9975b0949bb5f91b9f266ca53e0ff (patch) | |
tree | 576c2374596c851ce3c45a04d52466e7acf3198e | |
parent | 5fd6fa0ca7f32d800a6044d28fb33a88e8de7283 (diff) | |
parent | 45c4bf3df03ef53ae61fa1473424d4ae024f22e4 (diff) | |
download | ffmpeg-bc987cf91dd9975b0949bb5f91b9f266ca53e0ff.tar.gz |
Merge commit '45c4bf3df03ef53ae61fa1473424d4ae024f22e4'
* commit '45c4bf3df03ef53ae61fa1473424d4ae024f22e4':
h264dec: track the last seen value of x264_build
Merged-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavcodec/h264_cabac.c | 2 | ||||
-rw-r--r-- | libavcodec/h264_direct.c | 4 | ||||
-rw-r--r-- | libavcodec/h264_mb.c | 2 | ||||
-rw-r--r-- | libavcodec/h264_slice.c | 7 | ||||
-rw-r--r-- | libavcodec/h264dec.c | 1 | ||||
-rw-r--r-- | libavcodec/h264dec.h | 1 |
6 files changed, 11 insertions, 6 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 345834645c..ec5fc74b9b 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -2347,7 +2347,7 @@ decode_intra_mb: if (CHROMA444(h) && IS_8x8DCT(mb_type)){ int i; uint8_t *nnz_cache = sl->non_zero_count_cache; - if (h->sei.unregistered.x264_build < 151U) { + if (h->x264_build < 151U) { for (i = 0; i < 2; i++){ if (sl->left_type[LEFT(i)] && !IS_8x8DCT(sl->left_type[LEFT(i)])) { nnz_cache[3+8* 1 + 2*8*i]= diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c index a7a107c8c2..ec9fca0350 100644 --- a/libavcodec/h264_direct.c +++ b/libavcodec/h264_direct.c @@ -410,7 +410,7 @@ single_col: (l1ref0[0] < 0 && !l1ref1[0] && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 && - h->sei.unregistered.x264_build > 33U))) { + h->x264_build > 33U))) { a = b = 0; if (ref[0] > 0) a = mv[0]; @@ -445,7 +445,7 @@ single_col: (l1ref0[i8] == 0 || (l1ref0[i8] < 0 && l1ref1[i8] == 0 && - h->sei.unregistered.x264_build > 33U))) { + h->x264_build > 33U))) { const int16_t (*l1mv)[2] = l1ref0[i8] == 0 ? l1mv0 : l1mv1; if (IS_SUB_8X8(sub_mb_type)) { const int16_t *mv_col = l1mv[x8 * 3 + y8 * 3 * b4_stride]; diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c index cb9fe856b2..3cd17b7e4b 100644 --- a/libavcodec/h264_mb.c +++ b/libavcodec/h264_mb.c @@ -637,7 +637,7 @@ static av_always_inline void hl_decode_mb_predict_luma(const H264Context *h, uint8_t *const ptr = dest_y + block_offset[i]; const int dir = sl->intra4x4_pred_mode_cache[scan8[i]]; if (transform_bypass && h->ps.sps->profile_idc == 244 && dir <= 1) { - if (h->sei.unregistered.x264_build < 151U) { + if (h->x264_build < 151U) { h->hpc.pred8x8l_add[dir](ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize); } else h->hpc.pred8x8l_filter_add[dir](ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 35dcabd611..94a1547ad6 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -399,12 +399,12 @@ int ff_h264_update_thread_context(AVCodecContext *dst, h->enable_er = h1->enable_er; h->workaround_bugs = h1->workaround_bugs; + h->x264_build = h1->x264_build; h->droppable = h1->droppable; // extradata/NAL handling h->is_avc = h1->is_avc; h->nal_length_size = h1->nal_length_size; - h->sei.unregistered.x264_build = h1->sei.unregistered.x264_build; memcpy(&h->poc, &h1->poc, sizeof(h->poc)); @@ -545,6 +545,9 @@ static int h264_frame_start(H264Context *h) h->mb_aff_frame = h->ps.sps->mb_aff && (h->picture_structure == PICT_FRAME); + if (h->sei.unregistered.x264_build >= 0) + h->x264_build = h->sei.unregistered.x264_build; + assert(h->cur_pic_ptr->long_ref == 0); return 0; @@ -912,7 +915,7 @@ static int h264_slice_header_init(H264Context *h) if (sps->timing_info_present_flag) { int64_t den = sps->time_scale; - if (h->sei.unregistered.x264_build < 44U) + if (h->x264_build < 44U) den *= 2; av_reduce(&h->avctx->framerate.den, &h->avctx->framerate.num, sps->num_units_in_tick * h->avctx->ticks_per_frame, den, 1 << 30); diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 4216b66684..aed23c4fba 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -315,6 +315,7 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h) h->flags = avctx->flags; h->poc.prev_poc_msb = 1 << 16; h->recovery_frame = -1; + h->x264_build = -1; h->frame_recovered = 0; h->poc.prev_frame_num = -1; h->sei.frame_packing.frame_packing_arrangement_cancel_flag = -1; diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 2106ba077e..b87b947f95 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -365,6 +365,7 @@ typedef struct H264Context { int context_initialized; int flags; int workaround_bugs; + int x264_build; /* Set when slice threading is used and at least one slice uses deblocking * mode 1 (i.e. across slice boundaries). Then we disable the loop filter * during normal MB decoding and execute it serially at the end. |