[FFmpeg-devel] [PATCH 1/2] avfilter: steps to ditch YUVJ formats

Michael Niedermayer michael at niedermayer.cc
Fri Dec 8 22:39:38 EET 2017


On Fri, Dec 08, 2017 at 12:12:57PM +0100, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  fftools/ffmpeg.c         |  1 +
>  fftools/ffmpeg.h         |  2 ++
>  fftools/ffmpeg_filter.c  | 18 +++++++++++++++---
>  libavcodec/avcodec.h     |  1 +
>  libavcodec/utils.c       |  2 ++
>  libavfilter/avfilter.c   |  2 ++
>  libavfilter/avfilter.h   |  2 ++
>  libavfilter/buffersink.c |  1 +
>  libavfilter/buffersink.h |  1 +
>  libavfilter/buffersrc.c  | 13 +++++++++++++
>  libavfilter/buffersrc.h  |  5 +++++
>  libavfilter/vf_scale.c   |  9 +++++++++
>  libavfilter/video.c      |  8 +++++++-
>  13 files changed, 61 insertions(+), 4 deletions(-)
[...]

> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 5db6a81320..4ff5fe8aa1 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -3376,6 +3376,7 @@ typedef struct AVCodec {
>      uint8_t max_lowres;                     ///< maximum value for lowres supported by the decoder
>      const AVClass *priv_class;              ///< AVClass for the private context
>      const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
> +    const int color_range;                  ///< value of color range encoder supports, 0 if all is supported
>  
>      /*****************************************************************
>       * No fields below this line are part of the public API. They

Looking just at libavcodec (i didnt look indepth at the rest)

the API looks ok i think

an alternative may be a list similar to others that lists supported
ranges and we would have differen values for 8bit and 10bit full and
subset ranges. That way codecs could list support for one without the
other. But that may be overkill 


> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index baf09119fe..aa81c21ef3 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -879,6 +879,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>                  avctx->codec->pix_fmts[i] == AV_PIX_FMT_YUVJ444P)
>                  avctx->color_range = AVCOL_RANGE_JPEG;
>          }
> +        if (avctx->codec->color_range)
> +            avctx->color_range = avctx->codec->color_range;
>          if (avctx->codec->supported_samplerates) {
>              for (i = 0; avctx->codec->supported_samplerates[i] != 0; i++)
>                  if (avctx->sample_rate == avctx->codec->supported_samplerates[i])

If the user did set a avctx->color_range for an encoder then this
should warn and or fail if its unsupported instead of overriding
at least at higher strict_std_compliance

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171208/52bc65dc/attachment.sig>


More information about the ffmpeg-devel mailing list