[FFmpeg-devel] [PATCH 3/5] h264dec: add idr_pic_id to slice context

Mark Thompson sw at jkqxz.net
Thu Dec 10 00:23:24 EET 2020


On 09/12/2020 20:25, Jonas Karlman wrote:
> From: Ezequiel Garcia <ezequiel at collabora.com>
> 
> Signed-off-by: Ezequiel Garcia <ezequiel at collabora.com>
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
> ---
>   libavcodec/h264_slice.c | 2 +-
>   libavcodec/h264dec.h    | 1 +
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index fa7a639053..8a3ce1a688 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -1824,7 +1824,7 @@ static int h264_slice_header_parse(const H264Context *h, H264SliceContext *sl,
>       }
>   
>       if (nal->type == H264_NAL_IDR_SLICE)
> -        get_ue_golomb_long(&sl->gb); /* idr_pic_id */
> +        sl->idr_pic_id = get_ue_golomb_long(&sl->gb);
>   
>       if (sps->poc_type == 0) {
>           sl->poc_lsb = get_bits(&sl->gb, sps->log2_max_poc_lsb);
> diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h
> index 29c4d4e42c..2ca9965b41 100644
> --- a/libavcodec/h264dec.h
> +++ b/libavcodec/h264dec.h
> @@ -335,6 +335,7 @@ typedef struct H264SliceContext {
>       int delta_poc[2];
>       int curr_pic_num;
>       int max_pic_num;
> +    int idr_pic_id;
>   } H264SliceContext;
>   
>   /**
> 

This feels very suspicious: idr_pic_id is unrelated to decoding, so a decoder which doesn't ignore must be doing something wrong?  (It's for detecting frame boundaries under packet loss so you don't splice together parts of unrelated intra frames.)

- Mark


More information about the ffmpeg-devel mailing list