diff options
author | Sven C. Dack <sven.c.dack@sky.com> | 2016-10-19 12:51:21 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2016-10-19 12:51:59 +0200 |
commit | 1aa8fa418a82211df447099a61c50bacde97be09 (patch) | |
tree | d0ffb85655a2251c878d4122c1968694c8b01965 /libavfilter | |
parent | aebbcb2706ab0bc5ca4feec8e7ae1e91c57cd67a (diff) | |
download | ffmpeg-1aa8fa418a82211df447099a61c50bacde97be09.tar.gz |
avfilter/vf_scale_npp: select cubic and lanczos as alternative where super-sampling is not supported
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_scale_npp.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libavfilter/vf_scale_npp.c b/libavfilter/vf_scale_npp.c index 68cee3929b..35abe39a94 100644 --- a/libavfilter/vf_scale_npp.c +++ b/libavfilter/vf_scale_npp.c @@ -294,9 +294,21 @@ static int init_processing_chain(AVFilterContext *ctx, int in_width, int in_heig /* figure out which stages need to be done */ if (in_width != out_width || in_height != out_height || - in_deinterleaved_format != out_deinterleaved_format) + in_deinterleaved_format != out_deinterleaved_format) { s->stages[STAGE_RESIZE].stage_needed = 1; + 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"); + } + } + if (!s->stages[STAGE_RESIZE].stage_needed && in_format == out_format) s->passthrough = 1; |