[FFmpeg-devel] [PATCH v1 2/3] avcodec/bitpacked: add interlace support

Rostislav Pehlivanov atomnuker at gmail.com
Wed Apr 11 15:51:22 EEST 2018


On 10 April 2018 at 22:21, Patrick Keroulas <
patrick.keroulas at savoirfairelinux.com> wrote:

> From: Damien Riegel <damien.riegel at savoirfairelinux.com>
>
> This codec is already capable of depacking some combinations of pixel
> formats and depth as defined in the RFC4175. The only difference between
> progressive and interlace is that either a packet will contain the whole
> frame, or only a field of the frame.
>
> As FFmpeg is not capable of handling fields only and recompose an
> interlaced frame from that, it has to be done by the codec. To achieve
> that, it must use two AVPacket: one for each field (top and bottom).
>
> Signed-off-by: Damien Riegel <damien.riegel at savoirfairelinux.com>
> Signed-off-by: Patrick Keroulas <patrick.keroulas at savoirfairelinux.com>
> ---
>  libavcodec/avcodec.h   |  4 +++
>  libavcodec/bitpacked.c | 76 ++++++++++++++++++++++++++++++
> ++++++++++++--------
>  2 files changed, 68 insertions(+), 12 deletions(-)
>
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index fb0c6fa..350e8d9 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -1480,6 +1480,10 @@ typedef struct AVPacket {
>   */
>  #define AV_PKT_FLAG_DISPOSABLE 0x0010
>
> +/**
> + * The packet contains a top field.
> + */
> +#define AV_PKT_FLAG_TOP_FIELD  0x0010
>

You need a bottom field flag here as well. The decoder should not play with
heuristisc to figure out what's progressive, what's top or bottom. It
should also handle switching between interlaced and progressive at any
point.


More information about the ffmpeg-devel mailing list