From e9d95ce4a55271499bb8ca07d72a897540f43bb4 Mon Sep 17 00:00:00 2001 From: Yandong Lin Date: Fri, 6 Sep 2024 15:25:54 +0800 Subject: [PATCH] fix[h265d]: fix output err causeby refs cleard fix issue cause by the following commit: 233940: fix[h265d]: fix infochange loss when two sps continuous Change-Id: Ie0047cbb7f02ef78e46f6980acfb20532af12dee Signed-off-by: Yandong Lin --- mpp/codec/dec/h265/h265d_parser.c | 3 ++- mpp/codec/dec/h265/h265d_parser.h | 1 + mpp/codec/dec/h265/h265d_ps.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mpp/codec/dec/h265/h265d_parser.c b/mpp/codec/dec/h265/h265d_parser.c index e61975c7..28bef264 100644 --- a/mpp/codec/dec/h265/h265d_parser.c +++ b/mpp/codec/dec/h265/h265d_parser.c @@ -750,11 +750,12 @@ static RK_S32 hls_slice_header(HEVCContext *s) } s->pps = (HEVCPPS*)s->pps_list[sh->pps_id]; - if (s->ps_need_upate || s->sps != (HEVCSPS*)s->sps_list[s->pps->sps_id]) { + if (s->sps_need_upate || s->sps != (HEVCSPS*)s->sps_list[s->pps->sps_id]) { s->sps = (HEVCSPS*)s->sps_list[s->pps->sps_id]; mpp_hevc_clear_refs(s); s->ps_need_upate = 1; + s->sps_need_upate = 0; ret = set_sps(s, s->sps); if (ret < 0) return ret; diff --git a/mpp/codec/dec/h265/h265d_parser.h b/mpp/codec/dec/h265/h265d_parser.h index e74c75f9..342af849 100644 --- a/mpp/codec/dec/h265/h265d_parser.h +++ b/mpp/codec/dec/h265/h265d_parser.h @@ -645,6 +645,7 @@ typedef struct HEVCContext { RK_U8 miss_ref_flag; RK_U8 pre_pps_id; RK_U8 ps_need_upate; + RK_U8 sps_need_upate; /*temporary storage for slice_cut_param*/ RK_U32 start_bit; diff --git a/mpp/codec/dec/h265/h265d_ps.c b/mpp/codec/dec/h265/h265d_ps.c index 28e64709..4de665eb 100644 --- a/mpp/codec/dec/h265/h265d_ps.c +++ b/mpp/codec/dec/h265/h265d_ps.c @@ -1880,7 +1880,7 @@ RK_S32 mpp_hevc_decode_nal_sps(HEVCContext *s) if (s->sps_list[sps_id] != NULL) mpp_mem_pool_put(s->sps_pool, s->sps_list[sps_id]); s->sps_list[sps_id] = sps_buf; - s->ps_need_upate = 1; + s->sps_need_upate = 1; } if (s->sps_list[sps_id])