Commit 5d41507f authored by SmilingWolf's avatar SmilingWolf Committed by Luca Barbato

Port default_nmv_context to rust

Second part of #650
parent 17f8e1bb
......@@ -591,7 +591,6 @@ pub fn uv_intra_mode_to_tx_type_context(pred: PredictionMode) -> TxType {
}
#[derive(Clone,Copy)]
#[repr(C)]
pub struct NMVComponent {
classes_cdf: [u16; MV_CLASSES + 1],
class0_fp_cdf: [[u16; MV_FP_SIZE + 1]; CLASS0_SIZE],
......@@ -604,7 +603,6 @@ pub struct NMVComponent {
}
#[derive(Clone,Copy)]
#[repr(C)]
pub struct NMVContext {
joints_cdf: [u16; MV_JOINTS + 1],
comps: [NMVComponent; 2],
......@@ -612,11 +610,63 @@ pub struct NMVContext {
extern "C" {
//static av1_scan_orders: [[SCAN_ORDER; TX_TYPES]; TxSize::TX_SIZES_ALL];
// lv_map
static default_nmv_context: NMVContext;
}
// lv_map
static default_nmv_context: NMVContext = {
NMVContext {
joints_cdf: cdf!(4096, 11264, 19328),
comps: [
NMVComponent {
classes_cdf: cdf!(
28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767
),
class0_fp_cdf: [cdf!(16384, 24576, 26624), cdf!(12288, 21248, 24128)],
fp_cdf: cdf!(8192, 17408, 21248),
sign_cdf: cdf!(128 * 128),
class0_hp_cdf: cdf!(160 * 128),
hp_cdf: cdf!(128 * 128),
class0_cdf: cdf!(216 * 128),
bits_cdf: [
cdf!(128 * 136),
cdf!(128 * 140),
cdf!(128 * 148),
cdf!(128 * 160),
cdf!(128 * 176),
cdf!(128 * 192),
cdf!(128 * 224),
cdf!(128 * 234),
cdf!(128 * 234),
cdf!(128 * 240)
]
},
NMVComponent {
classes_cdf: cdf!(
28672, 30976, 31858, 32320, 32551, 32656, 32740, 32757, 32762, 32767
),
class0_fp_cdf: [cdf!(16384, 24576, 26624), cdf!(12288, 21248, 24128)],
fp_cdf: cdf!(8192, 17408, 21248),
sign_cdf: cdf!(128 * 128),
class0_hp_cdf: cdf!(160 * 128),
hp_cdf: cdf!(128 * 128),
class0_cdf: cdf!(216 * 128),
bits_cdf: [
cdf!(128 * 136),
cdf!(128 * 140),
cdf!(128 * 148),
cdf!(128 * 160),
cdf!(128 * 176),
cdf!(128 * 192),
cdf!(128 * 224),
cdf!(128 * 234),
cdf!(128 * 234),
cdf!(128 * 240)
]
}
]
}
};
#[derive(Clone)]
pub struct CandidateMV {
pub this_mv: MotionVector,
......
......@@ -20,13 +20,13 @@ extern crate num_traits;
pub mod ec;
pub mod partition;
pub mod plane;
pub mod context;
pub mod transform;
pub mod quantize;
pub mod predict;
pub mod rdo;
#[macro_use]
pub mod util;
pub mod context;
pub mod entropymode;
pub mod token_cdfs;
pub mod deblock;
......
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