X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=theme.cpp;h=e5002bca3b0a0499ed73ea654b5f57cf18505dba;hb=7297850cec443cb0c02f82d7301a30583744627d;hp=7bb187714e6f2ef0041a777ce864a4402525b78b;hpb=0556d8cb8416bdc7b432a432c3d58239a94358d2;p=nageru diff --git a/theme.cpp b/theme.cpp index 7bb1877..e5002bc 100644 --- a/theme.cpp +++ b/theme.cpp @@ -274,11 +274,13 @@ int EffectChain_finalize(lua_State* L) } output_ycbcr_format.full_range = false; - output_ycbcr_format.num_levels = 256; + output_ycbcr_format.num_levels = 1 << global_flags.x264_bit_depth; - chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR); - chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_INTERLEAVED); // Add a copy where we'll only be using the Y component. - chain->set_dither_bits(8); + GLenum type = global_flags.x264_bit_depth > 8 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_BYTE; + + chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_SPLIT_Y_AND_CBCR, type); + chain->add_ycbcr_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED, output_ycbcr_format, YCBCR_OUTPUT_INTERLEAVED, type); // Add a copy where we'll only be using the Y component. + chain->set_dither_bits(global_flags.x264_bit_depth > 8 ? 16 : 8); chain->set_output_origin(OUTPUT_ORIGIN_TOP_LEFT); } else { chain->add_output(inout_format, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED);