[FFmpeg-devel] [PATCH] Select cubic and lanczos as alternative where super-sampling is not supported

Sven C. Dack sven.c.dack at sky.com
Sun Sep 11 21:04:39 EEST 2016


On 11/09/16 18:55, Moritz Barsnick wrote:
> Moin Sven,
>
> On Fri, Sep 09, 2016 at 11:13:55 +0100, Sven C. Dack wrote:
>
> I may be missing something, but my excuse is that I can't test, but just
> inspect by looking at it:
>
>> +       if (s->interp_algo == NPPI_INTER_SUPER &&
>> +           (out_width > in_width && out_height > in_height)) {
>> +           s->interp_algo = NPPI_INTER_LANCZOS;
>> +           av_log(ctx, AV_LOG_WARNING, "super-sampling not supported for output dimensions, using lanczos instead.\n");
>> +       }
>> +       if (s->interp_algo == NPPI_INTER_SUPER &&
>> +           !(out_width < in_width && out_height < in_height)) {
>> +           s->interp_algo = NPPI_INTER_CUBIC;
>> +           av_log(ctx, AV_LOG_WARNING, "super-sampling not supported for output dimensions, using cubic instead.\n");
>> +       }
>> +    }

The value s->interp_algo gets change in each body. There is no way it can enter 
the second body if it entered the first, because the value is part of both the 
conditions.

I thought about some neat logic at first, but decided to do it this way for more 
readability. Now you've put me on the spot... Your call.

Sven



More information about the ffmpeg-devel mailing list