[FFmpeg-devel] [PATCH] avcodec/h264_parser: export sei recovery frame count as side data

Yusuke Nakamura muken.the.vfrmaniac at gmail.com
Thu May 15 08:14:10 CEST 2014


2014-05-15 6:17 GMT+09:00 Michael Niedermayer <michaelni at gmx.at>:

> TODO: split between API addition and h264 parser change
>
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/avcodec.h     |   13 +++++++++++++
>  libavcodec/h264_parser.c |    2 ++
>  libavcodec/parser.c      |    1 +
>  libavformat/utils.c      |    6 ++++++
>  4 files changed, 22 insertions(+)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 9a24c96..61176be 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1115,6 +1115,12 @@ enum AVPacketSideDataType {
>       * side data includes updated metadata which appeared in the stream.
>       */
>      AV_PKT_DATA_METADATA_UPDATE,
> +
> +    AV_PKT_DATA_DECODER_RECOVERY,
> +    /**
> +     * signed LE 32bit integer specifying the number of codec specific
> units
> +     * (frames(h264) or POC(HEVC)) until the decoder output is clear or
> artifacts
> +     */
>  };
>
>  typedef struct AVPacketSideData {
> @@ -4263,6 +4269,13 @@ typedef struct AVCodecParserContext {
>       * For example, this corresponds to H.264 PicOrderCnt.
>       */
>      int output_picture_number;
> +
> +    /**
> +     * Number of frames or POC units until decoding is practically clear
> of artifacts.
> +     * The exact unit depends on the video standard, H.264 stores frame
> count,
> +     * HEVC, POC.
> +     */
> +    int recovery_frame_cnt;
>  } AVCodecParserContext;
>
>
Wrong.
H.264/AVC doesn't store frame count.
frame_num is not always increased monotonously.
If picture is disposable, frame_num of that picture won't be increased.
Disposable pictures are useless for recovery.


More information about the ffmpeg-devel mailing list