From a26d0fadd72966813eb0ef291ec9ec8a9fa470ba Mon Sep 17 00:00:00 2001 From: Ding Wei Date: Fri, 29 May 2020 10:43:40 +0800 Subject: [PATCH] [h265d]: fix issue for pps header slice_header_extension_present_flag has missing in parse. Signed-off-by: Ding Wei Change-Id: I479b7f0b67eb998c2a33791828488b37384d446a --- mpp/codec/dec/h265/h265d_parser.h | 1 + mpp/codec/dec/h265/h265d_parser2_syntax.c | 1 + mpp/codec/dec/h265/h265d_ps.c | 7 +++++++ 3 files changed, 9 insertions(+) diff --git a/mpp/codec/dec/h265/h265d_parser.h b/mpp/codec/dec/h265/h265d_parser.h index 74f2b1e2..3606e017 100644 --- a/mpp/codec/dec/h265/h265d_parser.h +++ b/mpp/codec/dec/h265/h265d_parser.h @@ -329,6 +329,7 @@ typedef struct HEVCPPS { RK_U8 slice_header_extension_present_flag; RK_U8 pps_extension_flag; + RK_U8 pps_range_extensions_flag; RK_U8 pps_extension_data_flag; // Inferred parameters RK_U32 *column_width; ///< ColumnWidth diff --git a/mpp/codec/dec/h265/h265d_parser2_syntax.c b/mpp/codec/dec/h265/h265d_parser2_syntax.c index bc0678f4..6d4ed3a0 100644 --- a/mpp/codec/dec/h265/h265d_parser2_syntax.c +++ b/mpp/codec/dec/h265/h265d_parser2_syntax.c @@ -158,6 +158,7 @@ static void fill_picture_parameters(const HEVCContext *h, pp->pps_beta_offset_div2 = pps->beta_offset / 2; pp->pps_tc_offset_div2 = pps->tc_offset / 2; pp->log2_parallel_merge_level_minus2 = pps->log2_parallel_merge_level - 2; + pp->slice_segment_header_extension_present_flag = pps->slice_header_extension_present_flag; pp->CurrPicOrderCntVal = h->poc; for (i = 0; i < 32; i++) { diff --git a/mpp/codec/dec/h265/h265d_ps.c b/mpp/codec/dec/h265/h265d_ps.c index 8e3b662b..e21a75ed 100644 --- a/mpp/codec/dec/h265/h265d_ps.c +++ b/mpp/codec/dec/h265/h265d_ps.c @@ -2065,6 +2065,13 @@ int mpp_hevc_decode_nal_pps(HEVCContext *s) ret = MPP_ERR_STREAM; goto err; } + READ_ONEBIT(gb, &pps->slice_header_extension_present_flag); + READ_ONEBIT(gb, &pps->pps_extension_flag); + h265d_dbg(H265D_DBG_PPS, "pps_extension_flag %d", pps->pps_extension_flag); + if (pps->pps_extension_flag) { + READ_ONEBIT(gb, &pps->pps_range_extensions_flag); + SKIP_BITS(gb, 7); // pps_extension_7bits + } if (s->h265dctx->compare_info != NULL) { CurrentFameInf_t *info = (CurrentFameInf_t *)s->h265dctx->compare_info;