[FFmpeg-devel] [PATCHv2] vf_colorspace: Interpret unspecified color range as limited range

Clément Bœsch u at pkh.me
Fri Sep 16 16:27:16 EEST 2016


On Fri, Sep 16, 2016 at 03:20:49PM +0200, Vittorio Giovara wrote:
> This is the assumption that is made in pixel format conversion do
> throughout the code (in particular swscale), and BT-specifications
> mandate.
> 
> Add a warning to inform the user that an automatic selection is being
> made.
> 
> Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
> ---
>  libavfilter/vf_colorspace.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/libavfilter/vf_colorspace.c b/libavfilter/vf_colorspace.c
> index e69be50..41d1692 100644
> --- a/libavfilter/vf_colorspace.c
> +++ b/libavfilter/vf_colorspace.c
> @@ -518,10 +518,13 @@ static int convert(AVFilterContext *ctx, void *data, int job_nr, int n_jobs)
>      return 0;
>  }
>  
> -static int get_range_off(int *off, int *y_rng, int *uv_rng,
> +static int get_range_off(AVFilterContext *ctx, int *off,
> +                         int *y_rng, int *uv_rng,
>                           enum AVColorRange rng, int depth)
>  {
>      switch (rng) {
> +    case AVCOL_RANGE_UNSPECIFIED:
> +        av_log(ctx, AV_LOG_WARNING, "Input range not set, assuming tv/mpeg\n");

nit: I think coverity likes a "// Fall-through" below this line in these
cases.

[...]

-- 
Clément B.


More information about the ffmpeg-devel mailing list