vp7enc: remove duplicate tables
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 4 Mar 2022 11:18:09 +0000 (12:18 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 4 Mar 2022 11:18:09 +0000 (12:18 +0100)
nihav-duck/src/codecs/vp7enc/coder.rs
nihav-duck/src/codecs/vp7enc/frame_coder.rs
nihav-duck/src/codecs/vp7enc/models.rs

index fcd885ac2d749b1a937ee874e6713e3793c0c2a4..f8664b5f16ce0829a09fd29257e17ecb6c8e807e 100644 (file)
@@ -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 ];
index 336eb06d49524730dcdfa921a4642de1d9215ac8..b9ba73edaf8208eefc0c2aed4e33eb26a1131c46 100644 (file)
@@ -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<u8>, 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;
index cc716b0c59456a6bc785b2c616917464dc91afa6..8b83301d418049a265ef111b61dcab5d6042d50a 100644 (file)
@@ -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() };