aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAndri Yngvason <andri@yngvason.is>2024-08-22 21:26:59 +0000
committerLinn Mattsson <linma@cendio.se>2024-10-22 12:41:33 +0200
commitfdbc92f8cc59e5ae59949d68319c8a61e270b701 (patch)
treeea53097f52fc201b203913a254129ce5844a65dc /common
parent2c4b0385a1b6138e8c28ebf1d656bfd5e8c05aa3 (diff)
downloadtigervnc-fdbc92f8cc59e5ae59949d68319c8a61e270b701.tar.gz
tigervnc-fdbc92f8cc59e5ae59949d68319c8a61e270b701.zip
H264Libav: Use nearest-neighbour sampling in scaler
sws_getCachedContext will set a default sampling method if 0 is passed to the flags argument. This means that when it is called again, the flags argument will not match the flags in the context, so a new one will be allocated every time. To get around this problem, we assign an explicit sampling method, one that also happens to be more efficient and just as good for this use-case as the default one, which is bicubic interpolation. (cherry picked from commit c68714aee15f1e6c75d53c398ea9b9178f64fcfb)
Diffstat (limited to 'common')
-rw-r--r--common/rfb/H264LibavDecoderContext.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/rfb/H264LibavDecoderContext.cxx b/common/rfb/H264LibavDecoderContext.cxx
index a7c817bf..789d0228 100644
--- a/common/rfb/H264LibavDecoderContext.cxx
+++ b/common/rfb/H264LibavDecoderContext.cxx
@@ -215,7 +215,7 @@ void H264LibavDecoderContext::decode(const uint8_t* h264_in_buffer,
sws = sws_getCachedContext(sws, frame->width, frame->height, avctx->pix_fmt,
frame->width, frame->height, AV_PIX_FMT_RGB32,
- 0, NULL, NULL, NULL);
+ SWS_POINT, NULL, NULL, NULL);
int inFull, outFull, brightness, contrast, saturation;
const int* inTable;