From: Zhao Zhili <zhiliz...@tencent.com> --- libavcodec/hevc/hevcdec.c | 1 + libavcodec/hevc/sei.c | 16 ++++++++++++++++ libavcodec/hevc/sei.h | 7 +++++++ 3 files changed, 24 insertions(+)
diff --git a/libavcodec/hevc/hevcdec.c b/libavcodec/hevc/hevcdec.c index 3655ed0039..79dd63092c 100644 --- a/libavcodec/hevc/hevcdec.c +++ b/libavcodec/hevc/hevcdec.c @@ -4009,6 +4009,7 @@ static int hevc_update_thread_context(AVCodecContext *dst, s->sei.common.display_orientation = s0->sei.common.display_orientation; s->sei.common.alternative_transfer = s0->sei.common.alternative_transfer; s->sei.tdrdi = s0->sei.tdrdi; + s->sei.recovery_point = s0->sei.recovery_point; return 0; } diff --git a/libavcodec/hevc/sei.c b/libavcodec/hevc/sei.c index e11a33773c..9c3594ac2f 100644 --- a/libavcodec/hevc/sei.c +++ b/libavcodec/hevc/sei.c @@ -79,6 +79,20 @@ static int decode_nal_sei_pic_timing(HEVCSEI *s, GetBitContext *gb, return 0; } +static int decode_nal_sei_recovery_point(HEVCSEI *s, GetBitContext *gb) +{ + HEVCSEIRecoveryPoint *rec = &s->recovery_point; + int recovery_poc_cnt = get_se_golomb(gb); + + if (recovery_poc_cnt > INT16_MAX || recovery_poc_cnt < INT16_MIN) + return AVERROR_INVALIDDATA; + rec->recovery_poc_cnt = recovery_poc_cnt; + rec->exact_match_flag = get_bits1(gb); + rec->broken_link_flag = get_bits1(gb); + + return 0; +} + static int decode_nal_sei_active_parameter_sets(HEVCSEI *s, GetBitContext *gb, void *logctx) { int num_sps_ids_minus1; @@ -212,6 +226,8 @@ static int decode_nal_sei_prefix(GetBitContext *gb, GetByteContext *gbyte, return decode_nal_sei_decoded_picture_hash(&s->picture_hash, gbyte); case SEI_TYPE_PIC_TIMING: return decode_nal_sei_pic_timing(s, gb, ps, logctx); + case SEI_TYPE_RECOVERY_POINT: + return decode_nal_sei_recovery_point(s, gb); case SEI_TYPE_ACTIVE_PARAMETER_SETS: return decode_nal_sei_active_parameter_sets(s, gb, logctx); case SEI_TYPE_TIME_CODE: diff --git a/libavcodec/hevc/sei.h b/libavcodec/hevc/sei.h index ee640003bc..7e1a2b0756 100644 --- a/libavcodec/hevc/sei.h +++ b/libavcodec/hevc/sei.h @@ -95,6 +95,12 @@ typedef struct HEVCSEITDRDI { uint8_t three_dimensional_reference_displays_extension_flag; } HEVCSEITDRDI; +typedef struct HEVCSEIRecoveryPoint { + int16_t recovery_poc_cnt; + uint8_t exact_match_flag; + uint8_t broken_link_flag; +} HEVCSEIRecoveryPoint; + typedef struct HEVCSEI { H2645SEI common; HEVCSEIPictureHash picture_hash; @@ -102,6 +108,7 @@ typedef struct HEVCSEI { int active_seq_parameter_set_id; HEVCSEITimeCode timecode; HEVCSEITDRDI tdrdi; + HEVCSEIRecoveryPoint recovery_point; } HEVCSEI; struct HEVCParamSets; -- 2.46.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".