From d6a4cb1dec3dc6386122c6491aba9314800b463d Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Sun, 17 Nov 2019 16:34:50 -0600 Subject: [PATCH] Moving back to SWS_BICUBIC for high quality mode (during export mostly). This provides a sharper image when enlarging images than SWS_LANCZOS, and only has a slight performance disadvantage. --- src/FFmpegReader.cpp | 2 +- src/FFmpegWriter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FFmpegReader.cpp b/src/FFmpegReader.cpp index 8f77cda4..e8ac4af9 100644 --- a/src/FFmpegReader.cpp +++ b/src/FFmpegReader.cpp @@ -1339,7 +1339,7 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) { int scale_mode = SWS_FAST_BILINEAR; if (openshot::Settings::Instance()->HIGH_QUALITY_SCALING) { - scale_mode = SWS_LANCZOS; + scale_mode = SWS_BICUBIC; } SwsContext *img_convert_ctx = sws_getContext(info.width, info.height, AV_GET_CODEC_PIXEL_FORMAT(pStream, pCodecCtx), width, height, PIX_FMT_RGBA, scale_mode, NULL, NULL, NULL); diff --git a/src/FFmpegWriter.cpp b/src/FFmpegWriter.cpp index 0a258284..294ec547 100644 --- a/src/FFmpegWriter.cpp +++ b/src/FFmpegWriter.cpp @@ -2111,7 +2111,7 @@ void FFmpegWriter::OutputStreamInfo() { void FFmpegWriter::InitScalers(int source_width, int source_height) { int scale_mode = SWS_FAST_BILINEAR; if (openshot::Settings::Instance()->HIGH_QUALITY_SCALING) { - scale_mode = SWS_LANCZOS; + scale_mode = SWS_BICUBIC; } // Init software rescalers vector (many of them, one for each thread)