summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-02-12 23:47:02 +0000
committerCarl Hetherington <cth@carlh.net>2018-02-12 23:47:02 +0000
commitb17a5963f9c79e3e99890f32129105dd49fb0c29 (patch)
tree2dbcc5a254a3ae2b6e2e23c2dd3159c2657cb43f /src
parent9a663d3f2e467f65dd7a364ed8631107fed5182d (diff)
Add SWS_ACCURATE_RND to sws flags. Without this, conversions to RGB in
crop_scale_window_test leave the 6 pixels at the right side of the image uninitialised (sws_scale doesn't fill them in with anything) so you get garbage in the output. SWS_ACCURATE_RND fixes it. There are whisperings that this is slow, so the impact of this patch may need to be measured in some "real" situations.
Diffstat (limited to 'src')
-rw-r--r--src/lib/image.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/image.cc b/src/lib/image.cc
index c3795dfa2..158bce1d9 100644
--- a/src/lib/image.cc
+++ b/src/lib/image.cc
@@ -246,7 +246,7 @@ Image::scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_fo
struct SwsContext* scale_context = sws_getContext (
size().width, size().height, pixel_format(),
out_size.width, out_size.height, out_format,
- fast ? SWS_FAST_BILINEAR : SWS_BICUBIC, 0, 0, 0
+ (fast ? SWS_FAST_BILINEAR : SWS_BICUBIC) | SWS_ACCURATE_RND, 0, 0, 0
);
DCPOMATIC_ASSERT (yuv_to_rgb < dcp::YUV_TO_RGB_COUNT);