Color distortion when video size does not match the virtual screen size (patch suggestion included)

Bug #1032970 reported by David Hart
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ren'Py
Fix Released
Medium
Unassigned

Bug Description

Videos encoded at a different resolution to the Ren'Py virtual screen size result in color distortion of the video (looks too "green"). For example, playing a video encoded at 1920x1080 with config.screen_width = 1366 and config.screen_height = 768 results in this distortion, but playing the same video with config.screen_width = 1920 and config.screen_height = 1080 does not.

This issue appears to be caused by the flags supplied to libswscale. The file module/ffdecode.c enables a "fast bilinear" scaling algorithm which appears to cause the color distortion. Switching to a different scaling method (e.g. bicubic filtering) appears to fix the issue. A suggested fix is therefore to change the line:

static int sws_flags = 1;

to:

static int sws_flags = SWS_BICUBIC;

Issue observed on Ren'Py 6.12.2, 6.13.12 and 6.14.0 for Linux and Windows. Fix tested on 6.13.12 for Linux only.

David Hart (davey3000)
summary: Color distortion when video size does not match the virtual screen size
+ (patch suggestion included)
Revision history for this message
Tom Rothamel (renpytom) wrote :

I've made this change, although I chose to use SWS_BILINEAR instead of SWS_BICUBIC, for speed reasons.

Changed in renpy:
milestone: none → 6.14
importance: Undecided → Medium
status: New → Fix Committed
Revision history for this message
David Hart (davey3000) wrote :

Thanks, I'll test the change in the next 6.14.0 build.

For reference, the 6.14.0 build that the issue was still present in was 6.14.0.313.

Revision history for this message
David Hart (davey3000) wrote :

Verified that this is issue is fixed in build 6.14.0.329 (tested on Ubuntu 12.04 LTS 32-bit and Windows 7 64-bit).

Tom Rothamel (renpytom)
Changed in renpy:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.