]> git.sesse.net Git - nageru/blobdiff - theme.cpp
Switch to BT.601 Y'CbCr coefficients and back to limited range.
[nageru] / theme.cpp
index 1536503adcece94f4ba20b7e2d626eb1604b86c0..2c9af01cf69b36cc150d0f98c6140cefa814b650 100644 (file)
--- a/theme.cpp
+++ b/theme.cpp
@@ -143,8 +143,14 @@ int EffectChain_finalize(lua_State* L)
                // happens in a pass not run by Movit (see Mixer::subsample_chroma()).
                output_ycbcr_format.chroma_subsampling_x = 1;
                output_ycbcr_format.chroma_subsampling_y = 1;
-               output_ycbcr_format.luma_coefficients = YCBCR_REC_709;
-               output_ycbcr_format.full_range = true;
+
+               // Rec. 709 would be the sane thing to do, but it seems many players
+               // (e.g. MPlayer and VLC) just default to BT.601 coefficients no matter
+               // what (see discussions in e.g. https://trac.ffmpeg.org/ticket/4978).
+               // We _do_ set the right flags, though, so that a player that works
+               // properly doesn't have to guess.
+               output_ycbcr_format.luma_coefficients = YCBCR_REC_601;
+               output_ycbcr_format.full_range = false;
                output_ycbcr_format.num_levels = 256;
 
                chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR);