diff mbox series

[FFmpeg-devel,v2,4/4] lavc/hevcdec: respect the value of no_output_of_prior_pics_flag

Message ID 20220614012302.2808428-4-fei.w.wang@intel.com
State New
Headers show
Series [FFmpeg-devel,v2,1/4] lavc/hevc_refs: fix dpb logical for IRAP | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Wang, Fei W June 14, 2022, 1:23 a.m. UTC
From: Xu Guangxin <guangxin.xu@intel.com>

Even resolution or number of picture stores changes, we still need
follow no_output_of_prior_pics_flag in next IDR.

Tested-by: Fei Wang <fei.w.wang@intel.com>
Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
---
 libavcodec/hevcdec.c | 7 -------
 1 file changed, 7 deletions(-)

Comments

Xiang, Haihao July 14, 2022, 6:16 a.m. UTC | #1
On Tue, 2022-06-14 at 09:23 +0800, Fei Wang wrote:
> From: Xu Guangxin <guangxin.xu@intel.com>
> 
> Even resolution or number of picture stores changes, we still need
> follow no_output_of_prior_pics_flag in next IDR.
> 
> Tested-by: Fei Wang <fei.w.wang@intel.com>
> Signed-off-by: Xu Guangxin <guangxin.xu@intel.com>
> ---
>  libavcodec/hevcdec.c | 7 -------
>  1 file changed, 7 deletions(-)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 99785aa5d1..b0317339a2 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -594,15 +594,8 @@ static int hls_slice_header(HEVCContext *s)
>  
>      if (s->ps.sps != (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data) {
>          const HEVCSPS *sps = (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]-
> >data;
> -        const HEVCSPS *last_sps = s->ps.sps;
>          enum AVPixelFormat pix_fmt;
>  
> -        if (last_sps && IS_IRAP(s) && s->nal_unit_type != HEVC_NAL_CRA_NUT) {
> -            if (sps->width != last_sps->width || sps->height != last_sps-
> >height ||
> -                sps->temporal_layer[sps->max_sub_layers -
> 1].max_dec_pic_buffering !=
> -                last_sps->temporal_layer[last_sps->max_sub_layers -
> 1].max_dec_pic_buffering)
> -                sh->no_output_of_prior_pics_flag = 0;
> -        }
>          ff_hevc_clear_refs(s);
>  
>          ret = set_sps(s, sps, sps->pix_fmt);

From the context, sh->no_output_of_prior_pics_flag is NoOutputOfPriorPicsFlag in
the spec. According to C.5.2.2, the decoder may set NoOutputOfPriorPicsFlag to
no_output_of_prior_pics_flag or 1, but it is not allowed to set 0 in this case.

This patch LGTM.

Thanks
Haihao
diff mbox series

Patch

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 99785aa5d1..b0317339a2 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -594,15 +594,8 @@  static int hls_slice_header(HEVCContext *s)
 
     if (s->ps.sps != (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data) {
         const HEVCSPS *sps = (HEVCSPS*)s->ps.sps_list[s->ps.pps->sps_id]->data;
-        const HEVCSPS *last_sps = s->ps.sps;
         enum AVPixelFormat pix_fmt;
 
-        if (last_sps && IS_IRAP(s) && s->nal_unit_type != HEVC_NAL_CRA_NUT) {
-            if (sps->width != last_sps->width || sps->height != last_sps->height ||
-                sps->temporal_layer[sps->max_sub_layers - 1].max_dec_pic_buffering !=
-                last_sps->temporal_layer[last_sps->max_sub_layers - 1].max_dec_pic_buffering)
-                sh->no_output_of_prior_pics_flag = 0;
-        }
         ff_hevc_clear_refs(s);
 
         ret = set_sps(s, sps, sps->pix_fmt);