1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avfilter/vf_scale_npp: select cubic and lanczos as alternative where super-sampling is not supported

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
Sven C. Dack 2016-10-19 12:51:21 +02:00 committed by Timo Rothenpieler
parent aebbcb2706
commit 1aa8fa418a

View File

@ -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;