From: Kostya Shishkov Date: Wed, 13 Jul 2022 16:13:35 +0000 (+0200) Subject: h264: fix some tables and indices in dsp X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=2b6a8fdcfd39656130fbbc1ff48fd863b13f7daa;p=nihav.git h264: fix some tables and indices in dsp --- diff --git a/nihav-itu/src/codecs/h264/dsp/mod.rs b/nihav-itu/src/codecs/h264/dsp/mod.rs index fa091c6..df5b287 100644 --- a/nihav-itu/src/codecs/h264/dsp/mod.rs +++ b/nihav-itu/src/codecs/h264/dsp/mod.rs @@ -175,35 +175,35 @@ pub fn idct_dc(blk: &mut [i16; 16], qp: u8, quant_dc: bool) { const QMAT_8X8: [[u8; 16]; 6] = [ [ - 20, 19, 25, 24, + 20, 19, 25, 19, 19, 18, 24, 18, 25, 24, 32, 24, - 24, 18, 24, 18 + 19, 18, 24, 18 ], [ - 22, 21, 28, 26, + 22, 21, 28, 21, 21, 19, 26, 19, 28, 26, 35, 26, - 26, 19, 26, 19 + 21, 19, 26, 19 ], [ - 26, 24, 33, 31, + 26, 24, 33, 24, 24, 23, 31, 23, 33, 31, 42, 31, - 31, 23, 31, 23 + 24, 23, 31, 23 ], [ - 28, 26, 35, 33, + 28, 26, 35, 26, 26, 25, 33, 25, 35, 33, 45, 33, - 33, 25, 33, 25 + 26, 25, 33, 25 ], [ - 32, 30, 40, 38, + 32, 30, 40, 30, 30, 28, 38, 28, 40, 38, 51, 38, - 38, 28, 38, 28 + 30, 28, 38, 28 ], [ - 36, 34, 46, 43, + 36, 34, 46, 34, 34, 32, 43, 32, 46, 43, 58, 43, - 43, 32, 43, 32 + 34, 32, 43, 32 ] ]; @@ -644,7 +644,7 @@ fn ipred_y_8x8_ver_right(buf: &mut [u8], stride: usize, ctx: &IPred8Context) { (t[ix - 1] + 2 * t[ix] + t[ix + 1] + 2) >> 2 } } else if zvr == -1 { - (l[1] + 2 * l[0] + t[0] + 2) >> 2 + (l[1] + 2 * l[0] + t[1] + 2) >> 2 } else { let ix = y - 2 * x; (l[ix] + 2 * l[ix - 1] + l[ix - 2] + 2) >> 2 @@ -693,7 +693,7 @@ fn ipred_y_8x8_hor_down(buf: &mut [u8], stride: usize, ctx: &IPred8Context) { (l[ix - 1] + 2 * l[ix] + l[ix + 1] + 2) >> 2 } } else if zhd == -1 { - (l[1] + 2 * l[0] + t[0] + 2) >> 2 + (l[1] + 2 * l[0] + t[1] + 2) >> 2 } else { let ix = x - 2 * y; (t[ix] + 2 * t[ix - 1] + t[ix - 2] + 2) >> 2