Commit fcb218d1 authored by David Michael Barr's avatar David Michael Barr

Optimize chroma quantizer offsets for subset3

Numeric analysis indicated 1089 +/- 5 in Q12.
parent 8058856a
...@@ -435,10 +435,9 @@ const Q57_SQUARE_EXP_SCALE: f64 = ...@@ -435,10 +435,9 @@ const Q57_SQUARE_EXP_SCALE: f64 =
// Daala style log-offset for chroma quantizers // Daala style log-offset for chroma quantizers
fn chroma_offset(log_target_q: i64) -> (i64, i64) { fn chroma_offset(log_target_q: i64) -> (i64, i64) {
let blog64_40 = 0xAA4_D3C2_5E68_DC58i64; let x = log_target_q.max(0);
let x = log_target_q.max(0).min(blog64_40); // Gradient 0.266 optimized for CIEDE2000+PSNR on subset3
// m = (blog64(16) - blog64(5)) / blog64(40) let y = (x >> 2) + (x >> 6);
let y = 1291i64 * (x >> 12);
// blog64(7) - blog64(4); blog64(5) - blog64(4) // blog64(7) - blog64(4); blog64(5) - blog64(4)
(0x19D_5D9F_D501_0B37 - y, 0xA4_D3C2_5E68_DC58 - y) (0x19D_5D9F_D501_0B37 - y, 0xA4_D3C2_5E68_DC58 - y)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment