Merge commit '45c4bf3df03ef53ae61fa1473424d4ae024f22e4'

* commit '45c4bf3df03ef53ae61fa1473424d4ae024f22e4':
  h264dec: track the last seen value of x264_build

Merged-by: James Almer <jamrial@gmail.com>
pull/272/head
James Almer 7 years ago
commit bc987cf91d
  1. 2
      libavcodec/h264_cabac.c
  2. 4
      libavcodec/h264_direct.c
  3. 2
      libavcodec/h264_mb.c
  4. 7
      libavcodec/h264_slice.c
  5. 1
      libavcodec/h264dec.c
  6. 1
      libavcodec/h264dec.h

@ -2347,7 +2347,7 @@ decode_intra_mb:
if (CHROMA444(h) && IS_8x8DCT(mb_type)){ if (CHROMA444(h) && IS_8x8DCT(mb_type)){
int i; int i;
uint8_t *nnz_cache = sl->non_zero_count_cache; 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++){ for (i = 0; i < 2; i++){
if (sl->left_type[LEFT(i)] && !IS_8x8DCT(sl->left_type[LEFT(i)])) { if (sl->left_type[LEFT(i)] && !IS_8x8DCT(sl->left_type[LEFT(i)])) {
nnz_cache[3+8* 1 + 2*8*i]= nnz_cache[3+8* 1 + 2*8*i]=

@ -410,7 +410,7 @@ single_col:
(l1ref0[0] < 0 && !l1ref1[0] && (l1ref0[0] < 0 && !l1ref1[0] &&
FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][0]) <= 1 &&
FFABS(l1mv1[0][1]) <= 1 && FFABS(l1mv1[0][1]) <= 1 &&
h->sei.unregistered.x264_build > 33U))) { h->x264_build > 33U))) {
a = b = 0; a = b = 0;
if (ref[0] > 0) if (ref[0] > 0)
a = mv[0]; a = mv[0];
@ -445,7 +445,7 @@ single_col:
(l1ref0[i8] == 0 || (l1ref0[i8] == 0 ||
(l1ref0[i8] < 0 && (l1ref0[i8] < 0 &&
l1ref1[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; const int16_t (*l1mv)[2] = l1ref0[i8] == 0 ? l1mv0 : l1mv1;
if (IS_SUB_8X8(sub_mb_type)) { if (IS_SUB_8X8(sub_mb_type)) {
const int16_t *mv_col = l1mv[x8 * 3 + y8 * 3 * b4_stride]; const int16_t *mv_col = l1mv[x8 * 3 + y8 * 3 * b4_stride];

@ -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]; uint8_t *const ptr = dest_y + block_offset[i];
const int dir = sl->intra4x4_pred_mode_cache[scan8[i]]; const int dir = sl->intra4x4_pred_mode_cache[scan8[i]];
if (transform_bypass && h->ps.sps->profile_idc == 244 && dir <= 1) { 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); h->hpc.pred8x8l_add[dir](ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), linesize);
} else } else
h->hpc.pred8x8l_filter_add[dir](ptr, sl->mb + (i * 16 + p * 256 << pixel_shift), h->hpc.pred8x8l_filter_add[dir](ptr, sl->mb + (i * 16 + p * 256 << pixel_shift),

@ -399,12 +399,12 @@ int ff_h264_update_thread_context(AVCodecContext *dst,
h->enable_er = h1->enable_er; h->enable_er = h1->enable_er;
h->workaround_bugs = h1->workaround_bugs; h->workaround_bugs = h1->workaround_bugs;
h->x264_build = h1->x264_build;
h->droppable = h1->droppable; h->droppable = h1->droppable;
// extradata/NAL handling // extradata/NAL handling
h->is_avc = h1->is_avc; h->is_avc = h1->is_avc;
h->nal_length_size = h1->nal_length_size; 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)); 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); 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); assert(h->cur_pic_ptr->long_ref == 0);
return 0; return 0;
@ -912,7 +915,7 @@ static int h264_slice_header_init(H264Context *h)
if (sps->timing_info_present_flag) { if (sps->timing_info_present_flag) {
int64_t den = sps->time_scale; int64_t den = sps->time_scale;
if (h->sei.unregistered.x264_build < 44U) if (h->x264_build < 44U)
den *= 2; den *= 2;
av_reduce(&h->avctx->framerate.den, &h->avctx->framerate.num, av_reduce(&h->avctx->framerate.den, &h->avctx->framerate.num,
sps->num_units_in_tick * h->avctx->ticks_per_frame, den, 1 << 30); sps->num_units_in_tick * h->avctx->ticks_per_frame, den, 1 << 30);

@ -315,6 +315,7 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h)
h->flags = avctx->flags; h->flags = avctx->flags;
h->poc.prev_poc_msb = 1 << 16; h->poc.prev_poc_msb = 1 << 16;
h->recovery_frame = -1; h->recovery_frame = -1;
h->x264_build = -1;
h->frame_recovered = 0; h->frame_recovered = 0;
h->poc.prev_frame_num = -1; h->poc.prev_frame_num = -1;
h->sei.frame_packing.frame_packing_arrangement_cancel_flag = -1; h->sei.frame_packing.frame_packing_arrangement_cancel_flag = -1;

@ -365,6 +365,7 @@ typedef struct H264Context {
int context_initialized; int context_initialized;
int flags; int flags;
int workaround_bugs; int workaround_bugs;
int x264_build;
/* Set when slice threading is used and at least one slice uses deblocking /* 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 * mode 1 (i.e. across slice boundaries). Then we disable the loop filter
* during normal MB decoding and execute it serially at the end. * during normal MB decoding and execute it serially at the end.

Loading…
Cancel
Save