diff options
author | Anton Khirnov <anton@khirnov.net> | 2024-06-01 16:17:57 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2024-06-11 17:39:35 +0200 |
commit | 01b379a93e05d86f7d889a848741f7e235560630 (patch) | |
tree | d645d0db3ef6e7d9817d18027ce9b40def03c5d3 /libavcodec/hevc/hevcdec.c | |
parent | 5e438511abb28097e73ac8d5c4dd97a8ad6d9908 (diff) | |
download | ffmpeg-01b379a93e05d86f7d889a848741f7e235560630.tar.gz |
lavc/hevcdec: move pocTid0 computation to hevc_frame_start()
It is only done once per frame. Also, rename the variable to poc_tid0 to
be consistent with our naming conventions.
Diffstat (limited to 'libavcodec/hevc/hevcdec.c')
-rw-r--r-- | libavcodec/hevc/hevcdec.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 960a06c773..dd3c188418 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -711,7 +711,7 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) int poc, pos; sh->pic_order_cnt_lsb = get_bits(gb, sps->log2_max_poc_lsb); - poc = ff_hevc_compute_poc(sps, s->pocTid0, sh->pic_order_cnt_lsb, s->nal_unit_type); + poc = ff_hevc_compute_poc(sps, s->poc_tid0, sh->pic_order_cnt_lsb, s->nal_unit_type); if (!sh->first_slice_in_pic_flag && poc != s->poc) { av_log(s->avctx, AV_LOG_WARNING, "Ignoring POC change between slices: %d -> %d\n", s->poc, poc); @@ -766,17 +766,6 @@ static int hls_slice_header(HEVCContext *s, GetBitContext *gb) sh->slice_temporal_mvp_enabled_flag = 0; } - /* 8.3.1 */ - if (sh->first_slice_in_pic_flag && s->temporal_id == 0 && - s->nal_unit_type != HEVC_NAL_TRAIL_N && - s->nal_unit_type != HEVC_NAL_TSA_N && - s->nal_unit_type != HEVC_NAL_STSA_N && - s->nal_unit_type != HEVC_NAL_RADL_N && - s->nal_unit_type != HEVC_NAL_RADL_R && - s->nal_unit_type != HEVC_NAL_RASL_N && - s->nal_unit_type != HEVC_NAL_RASL_R) - s->pocTid0 = s->poc; - if (sps->sao_enabled) { sh->slice_sample_adaptive_offset_flag[0] = get_bits1(gb); if (sps->chroma_format_idc) { @@ -2942,6 +2931,17 @@ static int hevc_frame_start(HEVCContext *s) s->no_rasl_output_flag = IS_IDR(s) || IS_BLA(s) || (s->nal_unit_type == HEVC_NAL_CRA_NUT && s->last_eos); + /* 8.3.1 */ + if (s->temporal_id == 0 && + s->nal_unit_type != HEVC_NAL_TRAIL_N && + s->nal_unit_type != HEVC_NAL_TSA_N && + s->nal_unit_type != HEVC_NAL_STSA_N && + s->nal_unit_type != HEVC_NAL_RADL_N && + s->nal_unit_type != HEVC_NAL_RADL_R && + s->nal_unit_type != HEVC_NAL_RASL_N && + s->nal_unit_type != HEVC_NAL_RASL_R) + s->poc_tid0 = s->poc; + if (pps->tiles_enabled_flag) s->local_ctx[0].end_of_tiles_x = pps->column_width[0] << sps->log2_ctb_size; @@ -3623,7 +3623,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->seq_decode = s0->seq_decode; s->seq_output = s0->seq_output; - s->pocTid0 = s0->pocTid0; + s->poc_tid0 = s0->poc_tid0; s->max_ra = s0->max_ra; s->eos = s0->eos; s->no_rasl_output_flag = s0->no_rasl_output_flag; |