From 6fd343d7f99e53cabb0944f47269b2303215693a Mon Sep 17 00:00:00 2001 From: Frank Leon Rose Date: Mon, 5 Apr 2021 15:56:27 +0100 Subject: [PATCH] Add note about better quality image scaling --- app/src/capture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/capture.c b/app/src/capture.c index 60c3e800..a4805927 100644 --- a/app/src/capture.c +++ b/app/src/capture.c @@ -90,7 +90,11 @@ static bool in_frame_to_png( targetWidth, targetHeight, AV_PIX_FMT_RGB24, - SWS_FAST_BILINEAR, 0, 0, 0); + // NOTE(frankleonrose): These options offer better picture + // quality in case of scaling, according to https://stackoverflow.com/a/46169884 + // SWS_BILINEAR | SWS_FULL_CHR_H_INT | SWS_ACCURATE_RND, + SWS_FAST_BILINEAR, + 0, 0, 0); AVFrame * rgbFrame = av_frame_alloc(); LOGV("Image frame width: %d height: %d scaling to %d x %d", *inframe->linesize, inframe->height, targetWidth, targetHeight);