From 9a110b6c529ceaeba58b3e7dd8f4c902df6a2083 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 4 Mar 2022 12:18:09 +0100 Subject: [PATCH] vp7enc: remove duplicate tables --- nihav-duck/src/codecs/vp7enc/coder.rs | 2 -- nihav-duck/src/codecs/vp7enc/frame_coder.rs | 14 +------------- nihav-duck/src/codecs/vp7enc/models.rs | 6 +----- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/nihav-duck/src/codecs/vp7enc/coder.rs b/nihav-duck/src/codecs/vp7enc/coder.rs index fcd885a..f8664b5 100644 --- a/nihav-duck/src/codecs/vp7enc/coder.rs +++ b/nihav-duck/src/codecs/vp7enc/coder.rs @@ -596,6 +596,4 @@ pub fn estimate_subblock_nits(blk: &[i16; 16], ctype: usize, pctx: u8, probs: &[ nits } -const COEF_BANDS: [usize; 16] = [ 0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7 ]; const VP6_COEF_ADD_BITS: [u8; 6] = [ 1, 2, 3, 4, 5, 11 ]; -const LONG_VECTOR_ORDER: [usize; 7] = [ 0, 1, 2, 7, 6, 5, 4 ]; diff --git a/nihav-duck/src/codecs/vp7enc/frame_coder.rs b/nihav-duck/src/codecs/vp7enc/frame_coder.rs index 336eb06..b9ba73e 100644 --- a/nihav-duck/src/codecs/vp7enc/frame_coder.rs +++ b/nihav-duck/src/codecs/vp7enc/frame_coder.rs @@ -2,6 +2,7 @@ use nihav_core::codecs::*; use nihav_codec_support::codecs::ZERO_MV; use super::super::vp78::PredMode; use super::super::vp78dsp::*; +use super::super::vp7data::HIGH_EDGE_VAR_THR; use super::super::vp7dsp::*; use super::blocks::*; use super::coder::*; @@ -544,19 +545,6 @@ impl FrameEncoder { } fn loop_filter_mb(dframe: &mut NASimpleVideoFrame, mb_x: usize, mb_y: usize, loop_str: u8, loop_params: &LoopParams, is_intra: bool) { - const HIGH_EDGE_VAR_THR: [[u8; 64]; 2] = [ - [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 - ], [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 - ]]; - let edge_thr = i16::from(loop_str) + 2; let luma_thr = i16::from(loop_str); let chroma_thr = i16::from(loop_str) * 2; diff --git a/nihav-duck/src/codecs/vp7enc/models.rs b/nihav-duck/src/codecs/vp7enc/models.rs index cc716b0..8b83301 100644 --- a/nihav-duck/src/codecs/vp7enc/models.rs +++ b/nihav-duck/src/codecs/vp7enc/models.rs @@ -1,3 +1,4 @@ +use super::super::vp7data::DEFAULT_MV_PROBS; use super::super::vp78data::*; pub use crate::codecs::vpenc::models::*; @@ -13,11 +14,6 @@ pub struct VP7Models { pub feature_tree_probs: [[u8; 3]; 4], } -const DEFAULT_MV_PROBS: [[u8; 17]; 2] = [ - [ 162, 128, 225, 146, 172, 147, 214, 39, 156, 247, 210, 135, 68, 138, 220, 239, 246 ], - [ 164, 128, 204, 170, 119, 235, 140, 230, 228, 244, 184, 201, 44, 173, 221, 239, 253 ] -]; - impl VP7Models { pub fn new() -> Self { let mut obj: Self = unsafe { std::mem::zeroed() }; -- 2.39.5