Commit 77cdf116 authored by Yushin Cho's avatar Yushin Cho Committed by Yushin Cho

Add tx_size_cdf to CDFContext and init its counters

parent cdf5356f
......@@ -724,6 +724,7 @@ pub struct CDFContext {
intra_tx_cdf:
[[[[u16; TX_TYPES + 1]; INTRA_MODES]; TX_SIZE_SQR_CONTEXTS]; TX_SETS_INTRA],
inter_tx_cdf: [[[u16; TX_TYPES + 1]; TX_SIZE_SQR_CONTEXTS]; TX_SETS_INTER],
tx_size_cdf: [[[u16; MAX_TX_DEPTH + 1 + 1]; TX_SIZE_CONTEXTS]; MAX_TX_CATS],
skip_cdfs: [[u16; 3]; SKIP_CONTEXTS],
intra_inter_cdfs: [[u16; 3]; INTRA_INTER_CONTEXTS],
angle_delta_cdf: [[u16; 2 * MAX_ANGLE_DELTA + 1 + 1]; DIRECTIONAL_MODES],
......@@ -785,6 +786,7 @@ impl CDFContext {
refmv_cdf: default_refmv_cdf,
intra_tx_cdf: default_intra_ext_tx_cdf,
inter_tx_cdf: default_inter_ext_tx_cdf,
tx_size_cdf: default_tx_size_cdf,
skip_cdfs: default_skip_cdfs,
intra_inter_cdfs: default_intra_inter_cdf,
angle_delta_cdf: default_angle_delta_cdf,
......@@ -864,6 +866,11 @@ impl CDFContext {
self.inter_tx_cdf[3][i][2] = 0;
}
for i in 0..TX_SIZE_CONTEXTS { self.tx_size_cdf[0][i][MAX_TX_DEPTH] = 0; }
reset_2d!(self.tx_size_cdf[1]);
reset_2d!(self.tx_size_cdf[2]);
reset_2d!(self.tx_size_cdf[3]);
reset_2d!(self.skip_cdfs);
reset_2d!(self.intra_inter_cdfs);
reset_2d!(self.angle_delta_cdf);
......
......@@ -19,7 +19,7 @@ const PALETTE_COLOR_INDEX_CONTEXTS: usize = 5;
const CDFMAX: u16 = 32768;
const BLOCK_SIZE_GROUPS: usize = 4;
const RESTORE_SWITCHABLE_TYPES: usize = 3;
const TX_SIZE_CONTEXTS: usize = 3;
pub const TX_SIZE_CONTEXTS: usize = 3;
// from seg_common.h
const MAX_SEGMENTS: usize = 8;
......@@ -29,8 +29,8 @@ const SEG_TEMPORAL_PRED_CTXS: usize = 3;
// enums.h
const TX_SIZE_LUMA_MIN: usize = TxSize::TX_4X4 as usize;
const TX_SIZE_CTX_MIN: usize = (TX_SIZE_LUMA_MIN + 1);
const MAX_TX_CATS: usize = (TxSize::TX_SIZES - TX_SIZE_CTX_MIN);
const MAX_TX_DEPTH: usize = 2;
pub const MAX_TX_CATS: usize = (TxSize::TX_SIZES - TX_SIZE_CTX_MIN);
pub const MAX_TX_DEPTH: usize = 2;
// LUTS ---------------------
......
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