Simplify txfm table Instead of listing all possible stage_range, we use set_fwd_txfm_non_scale_range() to generate 2d stage_range from 1d stage_range. This will reduce the complexity of txfm table significantly. This is a lossless change. The coding performance isn't changed. The txfm config is exactly the same as it was before. Change-Id: Ibd1d9e53772bb928faaeecc98d81cbc8f38b27ed
diff --git a/av1/common/av1_inv_txfm1d_cfg.h b/av1/common/av1_inv_txfm1d_cfg.h index ebf3628..4211b41 100644 --- a/av1/common/av1_inv_txfm1d_cfg.h +++ b/av1/common/av1_inv_txfm1d_cfg.h
@@ -42,603 +42,6 @@ #endif }; -// ---------------- 4x4 1D config ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_4[4] = { 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_dct_4[4] = { 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_4[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_adst_4[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_idx_4[1] = { 0 }; -static const int8_t inv_stage_range_col_idx_4[1] = { 0 }; - -// ---------------- 8x8 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_8[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_dct_8[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_8[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_adst_8[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_idx_8[1] = { 0 }; -static const int8_t inv_stage_range_col_idx_8[1] = { 0 }; - -// ---------------- 4x8 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_4x8[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_4x8[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -// ---------------- 8x4 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_8x4[4] = { 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_8x4[6] = { 0, 0, 0, 0, 0, 0 }; - -// ---------------- 16x16 1D constants ----------------------- - -// stage range -static const int8_t inv_stage_range_col_dct_16[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_dct_16[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_16[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_adst_16[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_idx_16[1] = { 0 }; -static const int8_t inv_stage_range_col_idx_16[1] = { 0 }; - -// ---------------- 8x16 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_row_dct_8x16[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_adst_8x16[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; -static const int8_t inv_stage_range_col_dct_8x16[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; -static const int8_t inv_stage_range_col_adst_8x16[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -// ---------------- 16x8 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_16x8[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_16x8[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -// ---------------- 32x32 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_32[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_dct_32[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_32[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_adst_32[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_idx_32[1] = { 0 }; -static const int8_t inv_stage_range_col_idx_32[1] = { 0 }; - -// ---------------- 16x32 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_16x32[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_16x32[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -// ---------------- 32x16 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_32x16[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; -static const int8_t inv_stage_range_col_adst_32x16[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -// ---------------- 64x64 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_64[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_dct_64[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; - -static const int8_t inv_stage_range_row_idx_64[1] = { 0 }; -static const int8_t inv_stage_range_col_idx_64[1] = { 0 }; - -// ---------------- 32x64 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_32x64[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -// ---------------- 64x32 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_64x32[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -// ---------------- 4x16 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_4x16[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; -static const int8_t inv_stage_range_col_adst_4x16[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -// ---------------- 16x4 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_16x4[4] = { 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_16x4[6] = { 0, 0, 0, 0, 0, 0 }; - -// ---------------- 8x32 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_row_dct_8x32[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_row_adst_8x32[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; -static const int8_t inv_stage_range_col_dct_8x32[10] = { 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_8x32[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -// ---------------- 32x8 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_32x8[6] = { 0, 0, 0, 0, 0, 0 }; -static const int8_t inv_stage_range_col_adst_32x8[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; - -// ---------------- 16x64 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_16x64[12] = { 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0 }; -// ---------------- 64x16 1D constants ----------------------- -// stage range -static const int8_t inv_stage_range_col_dct_64x16[8] = { - 0, 0, 0, 0, 0, 0, 0, 0 -}; -// ---------------- row config inv_dct_4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_4 = { - 4, // .txfm_size - 4, // .stage_num - inv_stage_range_row_dct_4, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -// ---------------- row config inv_dct_8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_8 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_row_dct_8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; -// ---------------- row config inv_dct_16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_16 = { - 16, // .txfm_size - 8, // .stage_num - inv_stage_range_row_dct_16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- row config inv_dct_32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_32 = { - 32, // .txfm_size - 10, // .stage_num - inv_stage_range_row_dct_32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -#if CONFIG_TX64X64 -// ---------------- row config inv_dct_64 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_64 = { - 64, // .txfm_size - 12, // .stage_num - inv_stage_range_row_dct_64, // .stage_range - TXFM_TYPE_DCT64, // .txfm_type_col -}; -#endif // CONFIG_TX64X64 - -// ---------------- row config inv_adst_4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_adst_4 = { - 4, // .txfm_size - 6, // .stage_num - inv_stage_range_row_adst_4, // .stage_range - TXFM_TYPE_ADST4, // .txfm_type -}; - -// ---------------- row config inv_adst_8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_adst_8 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_row_adst_8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- row config inv_adst_16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_adst_16 = { - 16, // .txfm_size - 10, // .stage_num - inv_stage_range_row_adst_16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -// ---------------- row config inv_adst_32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_adst_32 = { - 32, // .txfm_size - 12, // .stage_num - inv_stage_range_row_adst_32, // .stage_range - TXFM_TYPE_ADST32, // .txfm_type -}; - -// ---------------- col config inv_dct_4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_4 = { - 4, // .txfm_size - 4, // .stage_num - inv_stage_range_col_dct_4, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -// ---------------- col config inv_dct_8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_8 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_col_dct_8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -// ---------------- col config inv_dct_16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_16 = { - 16, // .txfm_size - 8, // .stage_num - inv_stage_range_col_dct_16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- col config inv_dct_32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_32 = { - 32, // .txfm_size - 10, // .stage_num - inv_stage_range_col_dct_32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -// ---------------- col config inv_dct_64 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_64 = { - 64, // .txfm_size - 12, // .stage_num - inv_stage_range_col_dct_64, // .stage_range - TXFM_TYPE_DCT64, // .txfm_type_col -}; - -// ---------------- col config inv_adst_4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_4 = { - 4, // .txfm_size - 6, // .stage_num - inv_stage_range_col_adst_4, // .stage_range - TXFM_TYPE_ADST4, // .txfm_type -}; - -// ---------------- col config inv_adst_8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_8 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_col_adst_8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- col config inv_adst_16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_16 = { - 16, // .txfm_size - 10, // .stage_num - inv_stage_range_col_adst_16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -// ---------------- col config inv_adst_32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_32 = { - 32, // .txfm_size - 12, // .stage_num - inv_stage_range_col_adst_32, // .stage_range - TXFM_TYPE_ADST32, // .txfm_type -}; - -// ---------------- col config inv_identity_4 ---------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_identity_4 = { - 4, // .txfm_size - 1, // .stage_num - inv_stage_range_col_idx_4, // .stage_range - TXFM_TYPE_IDENTITY4, // .txfm_type -}; - -// ---------------- row config inv_identity_4 ---------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_identity_4 = { - 4, // .txfm_size - 1, // .stage_num - inv_stage_range_row_idx_4, // .stage_range - TXFM_TYPE_IDENTITY4, // .txfm_type -}; - -// ---------------- col config inv_identity_8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_identity_8 = { - 8, // .txfm_size - 1, // .stage_num - inv_stage_range_col_idx_8, // .stage_range - TXFM_TYPE_IDENTITY8, // .txfm_type -}; - -// ---------------- row config inv_identity_8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_identity_8 = { - 8, // .txfm_size - 1, // .stage_num - inv_stage_range_row_idx_8, // .stage_range - TXFM_TYPE_IDENTITY8, // .txfm_type -}; - -// ---------------- col config inv_identity_16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_identity_16 = { - 16, // .txfm_size - 1, // .stage_num - inv_stage_range_col_idx_16, // .stage_range - TXFM_TYPE_IDENTITY16, // .txfm_type -}; - -// ---------------- row config inv_identity_16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_identity_16 = { - 16, // .txfm_size - 1, // .stage_num - inv_stage_range_row_idx_16, // .stage_range - TXFM_TYPE_IDENTITY16, // .txfm_type -}; - -// ---------------- col config inv_identity_32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_identity_32 = { - 32, // .txfm_size - 1, // .stage_num - inv_stage_range_col_idx_32, // .stage_range - TXFM_TYPE_IDENTITY32, // .txfm_type -}; - -// ---------------- row config inv_identity_32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_identity_32 = { - 32, // .txfm_size - 1, // .stage_num - inv_stage_range_row_idx_32, // .stage_range - TXFM_TYPE_IDENTITY32, // .txfm_type -}; - -#if CONFIG_TX64X64 -// ---------------- col config inv_identity_64 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_identity_64 = { - 64, // .txfm_size - 1, // .stage_num - inv_stage_range_col_idx_64, // .stage_range - TXFM_TYPE_IDENTITY64, // .txfm_type -}; - -// ---------------- row config inv_identity_64 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_identity_64 = { - 64, // .txfm_size - 1, // .stage_num - inv_stage_range_row_idx_64, // .stage_range - TXFM_TYPE_IDENTITY64, // .txfm_type -}; -#endif // CONFIG_TX64X64 - -// ---------------- col config inv_dct_8x4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_8x4 = { - 4, // .txfm_size - 4, // .stage_num - inv_stage_range_col_dct_8x4, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -// ---------------- col config inv_adst_8x4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_8x4 = { - 4, // .txfm_size - 6, // .stage_num - inv_stage_range_col_adst_8x4, // .stage_range - TXFM_TYPE_ADST4, // .txfm_type -}; - -// ---------------- col config inv_dct_16x4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_16x4 = { - 4, // .txfm_size - 4, // .stage_num - inv_stage_range_col_dct_16x4, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -// ---------------- col config inv_adst_16x4 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_16x4 = { - 4, // .txfm_size - 6, // .stage_num - inv_stage_range_col_adst_16x4, // .stage_range - TXFM_TYPE_ADST4, // .txfm_type -}; - -// ---------------- col config inv_dct_4x8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_4x8 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_col_dct_4x8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -// ---------------- col config inv_adst_16x8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_4x8 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_col_adst_4x8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- col config inv_dct_16x8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_16x8 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_col_dct_16x8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -// ---------------- col config inv_adst_16x8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_16x8 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_col_adst_16x8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- col config inv_dct_32x8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_32x8 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_col_dct_32x8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -// ---------------- col config inv_adst_32x8 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_32x8 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_col_adst_32x8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- col config inv_dct_4x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_4x16 = { - 16, // .txfm_size - 8, // .stage_num - inv_stage_range_col_dct_4x16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- col config inv_adst_4x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_4x16 = { - 16, // .txfm_size - 10, // .stage_num - inv_stage_range_col_adst_4x16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -// ---------------- row config inv_dct_8x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_8x16 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_row_dct_8x16, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -// ---------------- col config inv_dct_8x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_8x16 = { - 16, // .txfm_size - 8, // .stage_num - inv_stage_range_col_dct_8x16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- row config inv_adst_8x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_adst_8x16 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_row_adst_8x16, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type -}; - -// ---------------- col config inv_adst_8x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_8x16 = { - 16, // .txfm_size - 10, // .stage_num - inv_stage_range_col_adst_8x16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -// ---------------- col config inv_dct_32x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_32x16 = { - 16, // .txfm_size - 8, // .stage_num - inv_stage_range_col_dct_32x16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- col config inv_adst_32x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_32x16 = { - 16, // .txfm_size - 10, // .stage_num - inv_stage_range_col_adst_32x16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -#if CONFIG_TX64X64 -// ---------------- col config inv_dct_64x16 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_64x16 = { - 16, // .txfm_size - 8, // .stage_num - inv_stage_range_col_dct_64x16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; -#endif // CONFIG_TX64X64 - -// ---------------- row config inv_dct_8x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_dct_8x32 = { - 8, // .txfm_size - 6, // .stage_num - inv_stage_range_row_dct_8x32, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -// ---------------- col config inv_dct_8x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_8x32 = { - 32, // .txfm_size - 10, // .stage_num - inv_stage_range_col_dct_8x32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -// ---------------- row config inv_adst_8x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_row_cfg_adst_8x32 = { - 8, // .txfm_size - 8, // .stage_num - inv_stage_range_row_adst_8x32, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type -}; - -// ---------------- col config inv_adst_8x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_8x32 = { - 32, // .txfm_size - 12, // .stage_num - inv_stage_range_col_adst_8x32, // .stage_range - TXFM_TYPE_ADST32, // .txfm_type -}; - -// ---------------- col config inv_dct_16x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_16x32 = { - 32, // .txfm_size - 10, // .stage_num - inv_stage_range_col_dct_16x32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -// ---------------- col config inv_adst_16x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_adst_16x32 = { - 32, // .txfm_size - 12, // .stage_num - inv_stage_range_col_adst_16x32, // .stage_range - TXFM_TYPE_ADST32, // .txfm_type -}; - -#if CONFIG_TX64X64 -// ---------------- col config inv_dct_64x32 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_64x32 = { - 32, // .txfm_size - 10, // .stage_num - inv_stage_range_col_dct_64x32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -// ---------------- col config inv_dct_16x64 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_16x64 = { - 64, // .txfm_size - 12, // .stage_num - inv_stage_range_col_dct_16x64, // .stage_range - TXFM_TYPE_DCT64, // .txfm_type_col -}; - -// ---------------- col config inv_dct_32x64 ---------------- -static const TXFM_1D_CFG inv_txfm_1d_col_cfg_dct_32x64 = { - 64, // .txfm_size - 12, // .stage_num - inv_stage_range_col_dct_32x64, // .stage_range - TXFM_TYPE_DCT64, // .txfm_type_col -}; -#endif // CONFIG_TX64X64 - extern const int8_t *inv_txfm_shift_ls[TX_SIZES_ALL]; extern const int8_t inv_cos_bit_col[5 /*row*/][5 /*col*/]; extern const int8_t inv_cos_bit_row[5 /*row*/][5 /*col*/];
diff --git a/av1/common/av1_inv_txfm2d.c b/av1/common/av1_inv_txfm2d.c index 04c1397..bc9d01f 100644 --- a/av1/common/av1_inv_txfm2d.c +++ b/av1/common/av1_inv_txfm2d.c
@@ -51,200 +51,6 @@ } } -static const TXFM_1D_CFG *inv_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES_ALL] = { - // DCT - { - &inv_txfm_1d_col_cfg_dct_4, &inv_txfm_1d_col_cfg_dct_8, - &inv_txfm_1d_col_cfg_dct_16, &inv_txfm_1d_col_cfg_dct_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_dct_64, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_dct_4x8, &inv_txfm_1d_col_cfg_dct_8x4, - &inv_txfm_1d_col_cfg_dct_8x16, &inv_txfm_1d_col_cfg_dct_16x8, - &inv_txfm_1d_col_cfg_dct_16x32, &inv_txfm_1d_col_cfg_dct_32x16, -#if CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_dct_32x64, &inv_txfm_1d_col_cfg_dct_64x32, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_dct_4x16, &inv_txfm_1d_col_cfg_dct_16x4, - &inv_txfm_1d_col_cfg_dct_8x32, &inv_txfm_1d_col_cfg_dct_32x8, -#if CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_dct_16x64, &inv_txfm_1d_col_cfg_dct_64x16, -#endif // CONFIG_TX64X64 - }, - // ADST - { - &inv_txfm_1d_col_cfg_adst_4, - &inv_txfm_1d_col_cfg_adst_8, - &inv_txfm_1d_col_cfg_adst_16, - &inv_txfm_1d_col_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_adst_4x8, - &inv_txfm_1d_col_cfg_adst_8x4, - &inv_txfm_1d_col_cfg_adst_8x16, - &inv_txfm_1d_col_cfg_adst_16x8, - &inv_txfm_1d_col_cfg_adst_16x32, - &inv_txfm_1d_col_cfg_adst_32x16, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_adst_4x16, - &inv_txfm_1d_col_cfg_adst_16x4, - &inv_txfm_1d_col_cfg_adst_8x32, - &inv_txfm_1d_col_cfg_adst_32x8, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - }, - // FLIPADST - { - &inv_txfm_1d_col_cfg_adst_4, - &inv_txfm_1d_col_cfg_adst_8, - &inv_txfm_1d_col_cfg_adst_16, - &inv_txfm_1d_col_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_adst_4x8, - &inv_txfm_1d_col_cfg_adst_8x4, - &inv_txfm_1d_col_cfg_adst_8x16, - &inv_txfm_1d_col_cfg_adst_16x8, - &inv_txfm_1d_col_cfg_adst_16x32, - &inv_txfm_1d_col_cfg_adst_32x16, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_adst_4x16, - &inv_txfm_1d_col_cfg_adst_16x4, - &inv_txfm_1d_col_cfg_adst_8x32, - &inv_txfm_1d_col_cfg_adst_32x8, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - }, - // IDENTITY - { - &inv_txfm_1d_col_cfg_identity_4, &inv_txfm_1d_col_cfg_identity_8, - &inv_txfm_1d_col_cfg_identity_16, &inv_txfm_1d_col_cfg_identity_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_identity_64, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_identity_8, &inv_txfm_1d_col_cfg_identity_4, - &inv_txfm_1d_col_cfg_identity_16, &inv_txfm_1d_col_cfg_identity_8, - &inv_txfm_1d_col_cfg_identity_32, &inv_txfm_1d_col_cfg_identity_16, -#if CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_identity_64, &inv_txfm_1d_col_cfg_identity_32, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_identity_16, &inv_txfm_1d_col_cfg_identity_4, - &inv_txfm_1d_col_cfg_identity_32, &inv_txfm_1d_col_cfg_identity_8, -#if CONFIG_TX64X64 - &inv_txfm_1d_col_cfg_identity_64, &inv_txfm_1d_col_cfg_identity_16, -#endif // CONFIG_TX64X64 - }, -}; - -static const TXFM_1D_CFG *inv_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES_ALL] = { - // DCT - { - &inv_txfm_1d_row_cfg_dct_4, &inv_txfm_1d_row_cfg_dct_8, - &inv_txfm_1d_row_cfg_dct_16, &inv_txfm_1d_row_cfg_dct_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_dct_64, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_dct_4, &inv_txfm_1d_row_cfg_dct_8, - &inv_txfm_1d_row_cfg_dct_8x16, &inv_txfm_1d_row_cfg_dct_16, - &inv_txfm_1d_row_cfg_dct_16, &inv_txfm_1d_row_cfg_dct_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_dct_32, &inv_txfm_1d_row_cfg_dct_64, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_dct_4, &inv_txfm_1d_row_cfg_dct_16, - &inv_txfm_1d_row_cfg_dct_8x32, &inv_txfm_1d_row_cfg_dct_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_dct_16, &inv_txfm_1d_row_cfg_dct_64, -#endif // CONFIG_TX64X64 - }, - // ADST - { - &inv_txfm_1d_row_cfg_adst_4, - &inv_txfm_1d_row_cfg_adst_8, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_4, - &inv_txfm_1d_row_cfg_adst_8, - &inv_txfm_1d_row_cfg_adst_8x16, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_32, - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_4, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_8x32, - &inv_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_16, - NULL, -#endif // CONFIG_TX64X64 - }, - // FLIPADST - { - &inv_txfm_1d_row_cfg_adst_4, - &inv_txfm_1d_row_cfg_adst_8, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_4, - &inv_txfm_1d_row_cfg_adst_8, - &inv_txfm_1d_row_cfg_adst_8x16, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_32, - NULL, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_4, - &inv_txfm_1d_row_cfg_adst_16, - &inv_txfm_1d_row_cfg_adst_8x32, - &inv_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_adst_16, - NULL, -#endif // CONFIG_TX64X64 - }, - // IDENTITY - { - &inv_txfm_1d_row_cfg_identity_4, &inv_txfm_1d_row_cfg_identity_8, - &inv_txfm_1d_row_cfg_identity_16, &inv_txfm_1d_row_cfg_identity_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_identity_64, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_identity_4, &inv_txfm_1d_row_cfg_identity_8, - &inv_txfm_1d_row_cfg_identity_8, &inv_txfm_1d_row_cfg_identity_16, - &inv_txfm_1d_row_cfg_identity_16, &inv_txfm_1d_row_cfg_identity_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_identity_32, &inv_txfm_1d_row_cfg_identity_64, -#endif // CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_identity_4, &inv_txfm_1d_row_cfg_identity_16, - &inv_txfm_1d_row_cfg_identity_8, &inv_txfm_1d_row_cfg_identity_32, -#if CONFIG_TX64X64 - &inv_txfm_1d_row_cfg_identity_16, &inv_txfm_1d_row_cfg_identity_64, -#endif // CONFIG_TX64X64 - }, -}; - static const int8_t inv_shift_4x4[2] = { 0, -4 }; static const int8_t inv_shift_8x8[2] = { -1, -4 }; static const int8_t inv_shift_16x16[2] = { -2, -4 }; @@ -302,16 +108,22 @@ void av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size, TXFM_2D_FLIP_CFG *cfg) { assert(cfg != NULL); + cfg->tx_size = tx_size; set_flip_cfg(tx_type, cfg); - const TX_TYPE_1D tx_type_col = vtx_tab[tx_type]; - const TX_TYPE_1D tx_type_row = htx_tab[tx_type]; - cfg->col_cfg = inv_txfm_col_cfg_ls[tx_type_col][tx_size]; - cfg->row_cfg = inv_txfm_row_cfg_ls[tx_type_row][tx_size]; + av1_zero(cfg->stage_range_col); + av1_zero(cfg->stage_range_row); + set_flip_cfg(tx_type, cfg); + const TX_TYPE_1D tx_type_1d_col = vtx_tab[tx_type]; + const TX_TYPE_1D tx_type_1d_row = htx_tab[tx_type]; cfg->shift = inv_txfm_shift_ls[tx_size]; const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; cfg->cos_bit_col = inv_cos_bit_col[txw_idx][txh_idx]; cfg->cos_bit_row = inv_cos_bit_row[txw_idx][txh_idx]; + cfg->txfm_type_col = av1_txfm_type_ls[txh_idx][tx_type_1d_col]; + cfg->txfm_type_row = av1_txfm_type_ls[txw_idx][tx_type_1d_row]; + cfg->stage_num_col = av1_txfm_stage_num_list[cfg->txfm_type_col]; + cfg->stage_num_row = av1_txfm_stage_num_list[cfg->txfm_type_row]; } void av1_gen_inv_stage_range(int8_t *stage_range_col, int8_t *stage_range_row, @@ -320,13 +132,13 @@ const int fwd_shift = inv_start_range[tx_size]; const int8_t *shift = cfg->shift; // i < MAX_TXFM_STAGE_NUM will mute above array bounds warning - for (int i = 0; i < cfg->row_cfg->stage_num && i < MAX_TXFM_STAGE_NUM; ++i) { - stage_range_row[i] = cfg->row_cfg->stage_range[i] + fwd_shift + bd + 1; + for (int i = 0; i < cfg->stage_num_row && i < MAX_TXFM_STAGE_NUM; ++i) { + stage_range_row[i] = cfg->stage_range_row[i] + fwd_shift + bd + 1; } // i < MAX_TXFM_STAGE_NUM will mute above array bounds warning - for (int i = 0; i < cfg->col_cfg->stage_num && i < MAX_TXFM_STAGE_NUM; ++i) { + for (int i = 0; i < cfg->stage_num_col && i < MAX_TXFM_STAGE_NUM; ++i) { stage_range_col[i] = - cfg->col_cfg->stage_range[i] + fwd_shift + shift[0] + bd + 1; + cfg->stage_range_col[i] + fwd_shift + shift[0] + bd + 1; } } @@ -340,21 +152,21 @@ // rectangular, the number of columns will be the same as the // txfm_size stored in the row cfg struct. It will make no difference // for square transforms. - const int txfm_size_col = cfg->row_cfg->txfm_size; - const int txfm_size_row = cfg->col_cfg->txfm_size; + const int txfm_size_col = tx_size_wide[cfg->tx_size]; + const int txfm_size_row = tx_size_high[cfg->tx_size]; // Take the shift from the larger dimension in the rectangular case. const int8_t *shift = cfg->shift; const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row); int8_t stage_range_row[MAX_TXFM_STAGE_NUM]; int8_t stage_range_col[MAX_TXFM_STAGE_NUM]; - assert(cfg->row_cfg->stage_num <= MAX_TXFM_STAGE_NUM); - assert(cfg->col_cfg->stage_num <= MAX_TXFM_STAGE_NUM); + assert(cfg->stage_num_row <= MAX_TXFM_STAGE_NUM); + assert(cfg->stage_num_col <= MAX_TXFM_STAGE_NUM); av1_gen_inv_stage_range(stage_range_col, stage_range_row, cfg, tx_size, bd); const int8_t cos_bit_col = cfg->cos_bit_col; const int8_t cos_bit_row = cfg->cos_bit_row; - const TxfmFunc txfm_func_col = inv_txfm_type_to_func(cfg->col_cfg->txfm_type); - const TxfmFunc txfm_func_row = inv_txfm_type_to_func(cfg->row_cfg->txfm_type); + const TxfmFunc txfm_func_col = inv_txfm_type_to_func(cfg->txfm_type_col); + const TxfmFunc txfm_func_row = inv_txfm_type_to_func(cfg->txfm_type_row); // txfm_buf's length is txfm_size_row * txfm_size_col + 2 * // AOMMAX(txfm_size_row, txfm_size_col)
diff --git a/av1/common/av1_txfm.c b/av1/common/av1_txfm.c index 345339d..50b3787 100644 --- a/av1/common/av1_txfm.c +++ b/av1/common/av1_txfm.c
@@ -28,3 +28,29 @@ } } } + +const TXFM_TYPE av1_txfm_type_ls[5][TX_TYPES_1D] = { + { TXFM_TYPE_DCT4, TXFM_TYPE_ADST4, TXFM_TYPE_ADST4, TXFM_TYPE_IDENTITY4 }, + { TXFM_TYPE_DCT8, TXFM_TYPE_ADST8, TXFM_TYPE_ADST8, TXFM_TYPE_IDENTITY8 }, + { TXFM_TYPE_DCT16, TXFM_TYPE_ADST16, TXFM_TYPE_ADST16, TXFM_TYPE_IDENTITY16 }, + { TXFM_TYPE_DCT32, TXFM_TYPE_ADST32, TXFM_TYPE_ADST32, TXFM_TYPE_IDENTITY32 }, + { TXFM_TYPE_DCT64, TXFM_TYPE_INVALID, TXFM_TYPE_INVALID, + TXFM_TYPE_IDENTITY64 } +}; + +const int8_t av1_txfm_stage_num_list[TXFM_TYPES] = { + 4, // TXFM_TYPE_DCT4 + 6, // TXFM_TYPE_DCT8 + 8, // TXFM_TYPE_DCT16 + 10, // TXFM_TYPE_DCT32 + 12, // TXFM_TYPE_DCT64 + 6, // TXFM_TYPE_ADST4 + 8, // TXFM_TYPE_ADST8 + 10, // TXFM_TYPE_ADST16 + 12, // TXFM_TYPE_ADST32 + 1, // TXFM_TYPE_IDENTITY4 + 1, // TXFM_TYPE_IDENTITY8 + 1, // TXFM_TYPE_IDENTITY16 + 1, // TXFM_TYPE_IDENTITY32 + 1, // TXFM_TYPE_IDENTITY64 +};
diff --git a/av1/common/av1_txfm.h b/av1/common/av1_txfm.h index 9781361..01c2d99 100644 --- a/av1/common/av1_txfm.h +++ b/av1/common/av1_txfm.h
@@ -122,24 +122,23 @@ TXFM_TYPE_IDENTITY16, TXFM_TYPE_IDENTITY32, TXFM_TYPE_IDENTITY64, + TXFM_TYPES, + TXFM_TYPE_INVALID, } TXFM_TYPE; -typedef struct TXFM_1D_CFG { - const int txfm_size; - const int stage_num; - - const int8_t *stage_range; - const TXFM_TYPE txfm_type; -} TXFM_1D_CFG; - typedef struct TXFM_2D_FLIP_CFG { + TX_SIZE tx_size; int ud_flip; // flip upside down int lr_flip; // flip left to right const int8_t *shift; int8_t cos_bit_col; int8_t cos_bit_row; - const TXFM_1D_CFG *col_cfg; - const TXFM_1D_CFG *row_cfg; + int8_t stage_range_col[MAX_TXFM_STAGE_NUM]; + int8_t stage_range_row[MAX_TXFM_STAGE_NUM]; + TXFM_TYPE txfm_type_col; + TXFM_TYPE txfm_type_row; + int stage_num_col; + int stage_num_row; } TXFM_2D_FLIP_CFG; static INLINE void set_flip_cfg(TX_TYPE tx_type, TXFM_2D_FLIP_CFG *cfg) { @@ -260,6 +259,8 @@ TXFM_2D_FLIP_CFG *cfg); void av1_get_inv_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size, TXFM_2D_FLIP_CFG *cfg); +extern const TXFM_TYPE av1_txfm_type_ls[5][TX_TYPES_1D]; +extern const int8_t av1_txfm_stage_num_list[TXFM_TYPES]; #ifdef __cplusplus } #endif // __cplusplus
diff --git a/av1/common/idct.c b/av1/common/idct.c index 53bcea5..f82b0e9 100644 --- a/av1/common/idct.c +++ b/av1/common/idct.c
@@ -86,6 +86,10 @@ } #if CONFIG_TX64X64 && (!CONFIG_DAALA_TX32 || !CONFIG_DAALA_TX64) +static const int8_t inv_stage_range_col_dct_64[12] = { 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 }; +static const int8_t inv_stage_range_row_dct_64[12] = { 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0 }; static void idct64_col_c(const tran_low_t *input, tran_low_t *output) { int32_t in[64], out[64]; const int txw_idx = tx_size_wide_log2[TX_64X64] - tx_size_wide_log2[0];
diff --git a/av1/encoder/av1_fwd_txfm1d_cfg.h b/av1/encoder/av1_fwd_txfm1d_cfg.h index 516609a..174689a 100644 --- a/av1/encoder/av1_fwd_txfm1d_cfg.h +++ b/av1/encoder/av1_fwd_txfm1d_cfg.h
@@ -13,658 +13,6 @@ #define AV1_FWD_TXFM2D_CFG_H_ #include "av1/common/enums.h" #include "av1/encoder/av1_fwd_txfm1d.h" - -// ---------------- 4x4 1D constants ----------------------- -// stage range -static const int8_t fwd_stage_range_col_dct_4[4] = { 0, 1, 2, 2 }; -static const int8_t fwd_stage_range_row_dct_4[4] = { 2, 3, 3, 3 }; -static const int8_t fwd_stage_range_col_adst_4[6] = { 0, 0, 1, 2, 2, 2 }; -static const int8_t fwd_stage_range_row_adst_4[6] = { 2, 2, 2, 3, 3, 3 }; -static const int8_t fwd_stage_range_col_idx_4[1] = { 1 }; -static const int8_t fwd_stage_range_row_idx_4[1] = { 2 }; - -// ---------------- 8x8 1D constants ----------------------- -// stage range -static const int8_t fwd_stage_range_col_dct_8[6] = { 0, 1, 2, 3, 3, 3 }; -static const int8_t fwd_stage_range_row_dct_8[6] = { 3, 4, 5, 5, 5, 5 }; -static const int8_t fwd_stage_range_col_adst_8[8] = { 0, 0, 1, 2, 2, 3, 3, 3 }; -static const int8_t fwd_stage_range_row_adst_8[8] = { 3, 3, 3, 4, 4, 5, 5, 5 }; -static const int8_t fwd_stage_range_col_idx_8[1] = { 1 }; -static const int8_t fwd_stage_range_row_idx_8[1] = { 4 }; - -// ---------------- 16x16 1D constants ----------------------- -// stage range -static const int8_t fwd_stage_range_col_dct_16[8] = { 0, 1, 2, 3, 4, 4, 4, 4 }; -static const int8_t fwd_stage_range_row_dct_16[8] = { 4, 5, 6, 7, 7, 7, 7, 7 }; -static const int8_t fwd_stage_range_col_adst_16[10] = { 0, 0, 1, 2, 2, - 3, 3, 4, 4, 4 }; -static const int8_t fwd_stage_range_row_adst_16[10] = { - 4, 4, 4, 5, 5, 6, 6, 7, 7, 7, -}; - -static const int8_t fwd_stage_range_col_idx_16[1] = { 2 }; - -static const int8_t fwd_stage_range_row_idx_16[1] = { 6 }; - -// ---------------- 32x32 1D constants ----------------------- -// stage range -static const int8_t fwd_stage_range_col_dct_32[10] = { 0, 1, 2, 3, 4, - 5, 5, 5, 5, 5 }; -static const int8_t fwd_stage_range_row_dct_32[10] = { 5, 6, 7, 8, 9, - 9, 9, 9, 9, 9 }; -static const int8_t fwd_stage_range_col_adst_32[12] = { 0, 0, 1, 2, 2, 3, - 3, 4, 4, 5, 5, 5 }; -static const int8_t fwd_stage_range_row_adst_32[12] = { 5, 5, 5, 6, 6, 7, - 7, 8, 8, 9, 9, 9 }; -static const int8_t fwd_stage_range_col_idx_32[1] = { 2 }; -static const int8_t fwd_stage_range_row_idx_32[1] = { 7 }; - -// ---------------- 64x64 1D constants ----------------------- -// stage range -static const int8_t fwd_stage_range_col_dct_64[12] = { 0, 1, 2, 3, 4, 5, - 6, 6, 6, 6, 6, 6 }; -static const int8_t fwd_stage_range_row_dct_64[12] = { 6, 7, 8, 9, 10, 11, - 11, 11, 11, 11, 11, 11 }; -static const int8_t fwd_stage_range_col_idx_64[1] = { 3 }; -static const int8_t fwd_stage_range_row_idx_64[1] = { 9 }; - -// ---------------- 4x8 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_4x8[4] = { 3, 4, 4, 4 }; -static const int8_t fwd_stage_range_row_adst_4x8[6] = { 3, 3, 3, 4, 4, 4 }; -static const int8_t fwd_stage_range_row_idx_4x8[1] = { 4 }; - -// ---------------- 8x4 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_8x4[6] = { 2, 3, 4, 4, 4, 4 }; -static const int8_t fwd_stage_range_row_adst_8x4[8] = { - 2, 2, 2, 3, 3, 4, 4, 4 -}; -static const int8_t fwd_stage_range_row_idx_8x4[1] = { 3 }; - -// ---------------- 8x16 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_8x16[6] = { 4, 5, 6, 6, 6, 6 }; -static const int8_t fwd_stage_range_row_adst_8x16[8] = { - 4, 4, 4, 5, 5, 6, 6, 6 -}; -static const int8_t fwd_stage_range_row_idx_8x16[1] = { 5 }; - -// ---------------- 16x8 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_16x8[8] = { - 3, 4, 5, 6, 6, 6, 6, 6 -}; -static const int8_t fwd_stage_range_row_adst_16x8[10] = { 3, 3, 3, 4, 4, - 5, 5, 6, 6, 6 }; -static const int8_t fwd_stage_range_row_idx_16x8[1] = { 5 }; - -// ---------------- 16x32 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_16x32[8] = { - 5, 6, 7, 8, 8, 8, 8, 8 -}; -static const int8_t fwd_stage_range_row_adst_16x32[10] = { 5, 5, 5, 6, 6, - 7, 7, 8, 8, 8 }; -static const int8_t fwd_stage_range_row_idx_16x32[1] = { 7 }; - -// ---------------- 32x16 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_32x16[10] = { 4, 5, 6, 7, 8, - 8, 8, 8, 8, 8 }; -static const int8_t fwd_stage_range_row_adst_32x16[12] = { 4, 4, 4, 5, 5, 6, - 6, 7, 7, 8, 8, 8 }; -static const int8_t fwd_stage_range_row_idx_32x16[1] = { 6 }; - -// ---------------- 32x64 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_32x64[10] = { 6, 7, 8, 9, 10, - 10, 10, 10, 10, 10 }; -static const int8_t fwd_stage_range_row_idx_32x64[1] = { 8 }; - -// ---------------- 64x32 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_64x32[12] = { - 5, 6, 7, 8, 9, 10, 10, 10, 10, 10, 10, 10 -}; -static const int8_t fwd_stage_range_row_idx_64x32[1] = { 8 }; - -// ---------------- 4x16 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_4x16[4] = { 4, 5, 5, 5 }; -static const int8_t fwd_stage_range_row_adst_4x16[6] = { 4, 4, 4, 5, 5, 5 }; -static const int8_t fwd_stage_range_row_idx_4x16[1] = { 5 }; - -// ---------------- 16x4 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_16x4[8] = { - 2, 3, 4, 5, 5, 5, 5, 5 -}; -static const int8_t fwd_stage_range_row_adst_16x4[10] = { 2, 2, 2, 3, 3, - 4, 4, 5, 5, 5 }; -static const int8_t fwd_stage_range_row_idx_16x4[1] = { 4 }; - -// ---------------- 8x32 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_8x32[6] = { 5, 6, 7, 7, 7, 7 }; -static const int8_t fwd_stage_range_row_adst_8x32[8] = { - 5, 5, 5, 6, 6, 7, 7, 7 -}; -static const int8_t fwd_stage_range_row_idx_8x32[1] = { 6 }; - -// ---------------- 32x8 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_32x8[10] = { 3, 4, 5, 6, 7, - 7, 7, 7, 7, 7 }; -static const int8_t fwd_stage_range_row_adst_32x8[12] = { 3, 3, 3, 4, 4, 5, - 5, 6, 6, 7, 7, 7 }; -static const int8_t fwd_stage_range_row_idx_32x8[1] = { 5 }; - -// ---------------- 16x64 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_16x64[8] = { - 6, 7, 8, 9, 9, 9, 9, 9 -}; -static const int8_t fwd_stage_range_row_idx_16x64[1] = { 8 }; - -// ---------------- 64x16 1D constants ----------------------- -static const int8_t fwd_stage_range_row_dct_64x16[12] = { 4, 5, 6, 7, 8, 9, - 9, 9, 9, 9, 9, 9 }; -static const int8_t fwd_stage_range_row_idx_64x16[1] = { 7 }; - -// -// ---------------- row config fwd_dct_4 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_4 = { - 4, // .txfm_size - 4, // .stage_num - // 0, // .log_scale - fwd_stage_range_row_dct_4, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -// ---------------- row config fwd_dct_8 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_8 = { - 8, // .txfm_size - 6, // .stage_num - // 0, // .log_scale - fwd_stage_range_row_dct_8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; -// ---------------- row config fwd_dct_16 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_16 = { - 16, // .txfm_size - 8, // .stage_num - // 0, // .log_scale - fwd_stage_range_row_dct_16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- row config fwd_dct_32 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_32 = { - 32, // .txfm_size - 10, // .stage_num - // 1, // .log_scale - fwd_stage_range_row_dct_32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -// ---------------- row config fwd_dct_64 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_64 = { - 64, // .txfm_size - 12, // .stage_num - fwd_stage_range_row_dct_64, // .stage_range - TXFM_TYPE_DCT64, // .txfm_type_col -}; - -// ---------------- row config fwd_adst_4 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_4 = { - 4, // .txfm_size - 6, // .stage_num - // 0, // .log_scale - fwd_stage_range_row_adst_4, // .stage_range - TXFM_TYPE_ADST4, // .txfm_type -}; - -// ---------------- row config fwd_adst_8 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_8 = { - 8, // .txfm_size - 8, // .stage_num - // 0, // .log_scale - fwd_stage_range_row_adst_8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- row config fwd_adst_16 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_16 = { - 16, // .txfm_size - 10, // .stage_num - // 0, // .log_scale - fwd_stage_range_row_adst_16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -// ---------------- row config fwd_adst_32 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_32 = { - 32, // .txfm_size - 12, // .stage_num - // 1, // .log_scale - fwd_stage_range_row_adst_32, // .stage_range - TXFM_TYPE_ADST32, // .txfm_type -}; - -// ---------------- col config fwd_dct_4 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_dct_4 = { - 4, // .txfm_size - 4, // .stage_num - // 0, // .log_scale - fwd_stage_range_col_dct_4, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -// ---------------- col config fwd_dct_8 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_dct_8 = { - 8, // .txfm_size - 6, // .stage_num - // 0, // .log_scale - fwd_stage_range_col_dct_8, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; -// ---------------- col config fwd_dct_16 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_dct_16 = { - 16, // .txfm_size - 8, // .stage_num - // 0, // .log_scale - fwd_stage_range_col_dct_16, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -// ---------------- col config fwd_dct_32 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_dct_32 = { - 32, // .txfm_size - 10, // .stage_num - // 1, // .log_scale - fwd_stage_range_col_dct_32, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -// ---------------- col config fwd_dct_64 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_dct_64 = { - 64, // .txfm_size - 12, // .stage_num - fwd_stage_range_col_dct_64, // .stage_range - TXFM_TYPE_DCT64, // .txfm_type_col -}; - -// ---------------- col config fwd_adst_4 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_adst_4 = { - 4, // .txfm_size - 6, // .stage_num - fwd_stage_range_col_adst_4, // .stage_range - TXFM_TYPE_ADST4, // .txfm_type -}; - -// ---------------- col config fwd_adst_8 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_adst_8 = { - 8, // .txfm_size - 8, // .stage_num - fwd_stage_range_col_adst_8, // .stage_range - TXFM_TYPE_ADST8, // .txfm_type_col -}; - -// ---------------- col config fwd_adst_16 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_adst_16 = { - 16, // .txfm_size - 10, // .stage_num - fwd_stage_range_col_adst_16, // .stage_range - TXFM_TYPE_ADST16, // .txfm_type -}; - -// ---------------- col config fwd_adst_32 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_adst_32 = { - 32, // .txfm_size - 12, // .stage_num - fwd_stage_range_col_adst_32, // .stage_range - TXFM_TYPE_ADST32, // .txfm_type -}; - -// ---------------- col config fwd_identity_4 ---------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_identity_4 = { - 4, // .txfm_size - 1, // .stage_num - fwd_stage_range_col_idx_4, // .stage_range - TXFM_TYPE_IDENTITY4, // .txfm_type -}; - -// ---------------- row config fwd_identity_4 ---------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_4 = { - 4, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_4, // .stage_range - TXFM_TYPE_IDENTITY4, // .txfm_type -}; - -// ---------------- col config fwd_identity_8 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_identity_8 = { - 8, // .txfm_size - 1, // .stage_num - fwd_stage_range_col_idx_8, // .stage_range - TXFM_TYPE_IDENTITY8, // .txfm_type -}; - -// ---------------- row config fwd_identity_8 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_8 = { - 8, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_8, // .stage_range - TXFM_TYPE_IDENTITY8, // .txfm_type -}; - -// ---------------- col config fwd_identity_16 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_identity_16 = { - 16, // .txfm_size - 1, // .stage_num - fwd_stage_range_col_idx_16, // .stage_range - TXFM_TYPE_IDENTITY16, // .txfm_type -}; - -// ---------------- row config fwd_identity_16 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_16 = { - 16, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_16, // .stage_range - TXFM_TYPE_IDENTITY16, // .txfm_type -}; - -// ---------------- col config fwd_identity_32 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_identity_32 = { - 32, // .txfm_size - 1, // .stage_num - fwd_stage_range_col_idx_32, // .stage_range - TXFM_TYPE_IDENTITY32, // .txfm_type -}; - -// ---------------- row config fwd_identity_32 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_32 = { - 32, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_32, // .stage_range - TXFM_TYPE_IDENTITY32, // .txfm_type -}; - -#if CONFIG_TX64X64 -// ---------------- col config fwd_identity_64 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_col_cfg_identity_64 = { - 64, // .txfm_size - 1, // .stage_num - fwd_stage_range_col_idx_64, // .stage_range - TXFM_TYPE_IDENTITY64, // .txfm_type -}; - -// ---------------- row config fwd_identity_64 ---------------- -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_64 = { - 64, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_64, // .stage_range - TXFM_TYPE_IDENTITY64, // .txfm_type -}; -#endif // CONFIG_TX64X64 - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_4x8 = { - 4, // .txfm_size - 4, // .stage_num - fwd_stage_range_row_dct_4x8, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_4x8 = { - 4, // .txfm_size - 6, // .stage_num - fwd_stage_range_row_adst_4x8, // .stage_range - TXFM_TYPE_ADST4 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_4x8 = { - 4, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_4x8, // .stage_range - TXFM_TYPE_IDENTITY4 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_8x4 = { - 8, // .txfm_size - 6, // .stage_num - fwd_stage_range_row_dct_8x4, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_8x4 = { - 8, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_adst_8x4, // .stage_range - TXFM_TYPE_ADST8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_8x4 = { - 8, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_8x4, // .stage_range - TXFM_TYPE_IDENTITY8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_8x16 = { - 8, // .txfm_size - 6, // .stage_num - fwd_stage_range_row_dct_8x16, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_8x16 = { - 8, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_adst_8x16, // .stage_range - TXFM_TYPE_ADST8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_8x16 = { - 8, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_8x16, // .stage_range - TXFM_TYPE_IDENTITY8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_16x8 = { - 16, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_dct_16x8, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_16x8 = { - 16, // .txfm_size - 10, // .stage_num - fwd_stage_range_row_adst_16x8, // .stage_range - TXFM_TYPE_ADST16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_16x8 = { - 16, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_16x8, // .stage_range - TXFM_TYPE_IDENTITY16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_16x32 = { - 16, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_dct_16x32, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_16x32 = { - 16, // .txfm_size - 10, // .stage_num - fwd_stage_range_row_adst_16x32, // .stage_range - TXFM_TYPE_ADST16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_16x32 = { - 16, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_16x32, // .stage_range - TXFM_TYPE_IDENTITY16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_32x16 = { - 32, // .txfm_size - 10, // .stage_num - fwd_stage_range_row_dct_32x16, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_32x16 = { - 32, // .txfm_size - 12, // .stage_num - fwd_stage_range_row_adst_32x16, // .stage_range - TXFM_TYPE_ADST32 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_32x16 = { - 32, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_32x16, // .stage_range - TXFM_TYPE_IDENTITY32 // .txfm_type -}; - -#if CONFIG_TX64X64 -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_32x64 = { - 32, // .txfm_size - 10, // .stage_num - fwd_stage_range_row_dct_32x64, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_32x64 = { - 32, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_32x64, // .stage_range - TXFM_TYPE_IDENTITY32 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_64x32 = { - 64, // .txfm_size - 12, // .stage_num - fwd_stage_range_row_dct_64x32, // .stage_range - TXFM_TYPE_DCT64 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_64x32 = { - 64, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_64x32, // .stage_range - TXFM_TYPE_IDENTITY64 // .txfm_type -}; -#endif // CONFIG_TX64X64 - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_4x16 = { - 4, // .txfm_size - 4, // .stage_num - fwd_stage_range_row_dct_4x16, // .stage_range - TXFM_TYPE_DCT4 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_4x16 = { - 4, // .txfm_size - 6, // .stage_num - fwd_stage_range_row_adst_4x16, // .stage_range - TXFM_TYPE_ADST4 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_4x16 = { - 4, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_4x16, // .stage_range - TXFM_TYPE_IDENTITY4 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_16x4 = { - 16, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_dct_16x4, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_16x4 = { - 16, // .txfm_size - 10, // .stage_num - fwd_stage_range_row_adst_16x4, // .stage_range - TXFM_TYPE_ADST16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_16x4 = { - 16, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_16x4, // .stage_range - TXFM_TYPE_IDENTITY16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_8x32 = { - 8, // .txfm_size - 6, // .stage_num - fwd_stage_range_row_dct_8x32, // .stage_range - TXFM_TYPE_DCT8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_8x32 = { - 8, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_adst_8x32, // .stage_range - TXFM_TYPE_ADST8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_8x32 = { - 8, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_8x32, // .stage_range - TXFM_TYPE_IDENTITY8 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_32x8 = { - 32, // .txfm_size - 10, // .stage_num - fwd_stage_range_row_dct_32x8, // .stage_range - TXFM_TYPE_DCT32 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_adst_32x8 = { - 32, // .txfm_size - 12, // .stage_num - fwd_stage_range_row_adst_32x8, // .stage_range - TXFM_TYPE_ADST32 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_32x8 = { - 32, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_32x8, // .stage_range - TXFM_TYPE_IDENTITY32 // .txfm_type -}; - -#if CONFIG_TX64X64 -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_16x64 = { - 16, // .txfm_size - 8, // .stage_num - fwd_stage_range_row_dct_16x64, // .stage_range - TXFM_TYPE_DCT16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_16x64 = { - 16, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_16x64, // .stage_range - TXFM_TYPE_IDENTITY16 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_dct_64x16 = { - 64, // .txfm_size - 12, // .stage_num - fwd_stage_range_row_dct_64x16, // .stage_range - TXFM_TYPE_DCT64 // .txfm_type -}; - -static const TXFM_1D_CFG fwd_txfm_1d_row_cfg_identity_64x16 = { - 64, // .txfm_size - 1, // .stage_num - fwd_stage_range_row_idx_64x16, // .stage_range - TXFM_TYPE_IDENTITY64 // .txfm_type -}; -#endif // CONFIG_TX64X64 extern const int8_t *fwd_txfm_shift_ls[TX_SIZES_ALL]; extern const int8_t fwd_cos_bit_col[5][5]; extern const int8_t fwd_cos_bit_row[5][5];
diff --git a/av1/encoder/av1_fwd_txfm2d.c b/av1/encoder/av1_fwd_txfm2d.c index f82f9e3..158c9f4 100644 --- a/av1/encoder/av1_fwd_txfm2d.c +++ b/av1/encoder/av1_fwd_txfm2d.c
@@ -50,14 +50,13 @@ // Take the shift from the larger dimension in the rectangular case. const int8_t *shift = cfg->shift; // i < MAX_TXFM_STAGE_NUM will mute above array bounds warning - for (int i = 0; i < cfg->col_cfg->stage_num && i < MAX_TXFM_STAGE_NUM; ++i) { - stage_range_col[i] = cfg->col_cfg->stage_range[i] + shift[0] + bd + 1; + for (int i = 0; i < cfg->stage_num_col && i < MAX_TXFM_STAGE_NUM; ++i) { + stage_range_col[i] = cfg->stage_range_col[i] + shift[0] + bd + 1; } // i < MAX_TXFM_STAGE_NUM will mute above array bounds warning - for (int i = 0; i < cfg->row_cfg->stage_num && i < MAX_TXFM_STAGE_NUM; ++i) { - stage_range_row[i] = - cfg->row_cfg->stage_range[i] + shift[0] + shift[1] + bd + 1; + for (int i = 0; i < cfg->stage_num_row && i < MAX_TXFM_STAGE_NUM; ++i) { + stage_range_row[i] = cfg->stage_range_row[i] + shift[0] + shift[1] + bd + 1; } } @@ -71,21 +70,21 @@ // rectangular, the number of columns will be the same as the // txfm_size stored in the row cfg struct. It will make no difference // for square transforms. - const int txfm_size_col = cfg->row_cfg->txfm_size; - const int txfm_size_row = cfg->col_cfg->txfm_size; + const int txfm_size_col = tx_size_wide[cfg->tx_size]; + const int txfm_size_row = tx_size_high[cfg->tx_size]; // Take the shift from the larger dimension in the rectangular case. const int8_t *shift = cfg->shift; const int rect_type = get_rect_tx_log_ratio(txfm_size_col, txfm_size_row); int8_t stage_range_col[MAX_TXFM_STAGE_NUM]; int8_t stage_range_row[MAX_TXFM_STAGE_NUM]; - assert(cfg->col_cfg->stage_num <= MAX_TXFM_STAGE_NUM); - assert(cfg->row_cfg->stage_num <= MAX_TXFM_STAGE_NUM); + assert(cfg->stage_num_col <= MAX_TXFM_STAGE_NUM); + assert(cfg->stage_num_row <= MAX_TXFM_STAGE_NUM); av1_gen_fwd_stage_range(stage_range_col, stage_range_row, cfg, bd); const int8_t cos_bit_col = cfg->cos_bit_col; const int8_t cos_bit_row = cfg->cos_bit_row; - const TxfmFunc txfm_func_col = fwd_txfm_type_to_func(cfg->col_cfg->txfm_type); - const TxfmFunc txfm_func_row = fwd_txfm_type_to_func(cfg->row_cfg->txfm_type); + const TxfmFunc txfm_func_col = fwd_txfm_type_to_func(cfg->txfm_type_col); + const TxfmFunc txfm_func_row = fwd_txfm_type_to_func(cfg->txfm_type_row); // use output buffer as temp buffer int32_t *temp_in = output; @@ -422,200 +421,6 @@ } #endif // CONFIG_TX64X64 -static const TXFM_1D_CFG *fwd_txfm_col_cfg_ls[TX_TYPES_1D][TX_SIZES_ALL] = { - // DCT - { - &fwd_txfm_1d_col_cfg_dct_4, &fwd_txfm_1d_col_cfg_dct_8, - &fwd_txfm_1d_col_cfg_dct_16, &fwd_txfm_1d_col_cfg_dct_32, -#if CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_dct_64, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_dct_8, &fwd_txfm_1d_col_cfg_dct_4, - &fwd_txfm_1d_col_cfg_dct_16, &fwd_txfm_1d_col_cfg_dct_8, - &fwd_txfm_1d_col_cfg_dct_32, &fwd_txfm_1d_col_cfg_dct_16, -#if CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_dct_64, &fwd_txfm_1d_col_cfg_dct_32, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_dct_16, &fwd_txfm_1d_col_cfg_dct_4, - &fwd_txfm_1d_col_cfg_dct_32, &fwd_txfm_1d_col_cfg_dct_8, -#if CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_dct_64, &fwd_txfm_1d_col_cfg_dct_16, -#endif // CONFIG_TX64X64 - }, - // ADST - { - &fwd_txfm_1d_col_cfg_adst_4, - &fwd_txfm_1d_col_cfg_adst_8, - &fwd_txfm_1d_col_cfg_adst_16, - &fwd_txfm_1d_col_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_adst_8, - &fwd_txfm_1d_col_cfg_adst_4, - &fwd_txfm_1d_col_cfg_adst_16, - &fwd_txfm_1d_col_cfg_adst_8, - &fwd_txfm_1d_col_cfg_adst_32, - &fwd_txfm_1d_col_cfg_adst_16, -#if CONFIG_TX64X64 - NULL, - &fwd_txfm_1d_col_cfg_adst_32, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_adst_16, - &fwd_txfm_1d_col_cfg_adst_4, - &fwd_txfm_1d_col_cfg_adst_32, - &fwd_txfm_1d_col_cfg_adst_8, -#if CONFIG_TX64X64 - NULL, - &fwd_txfm_1d_col_cfg_adst_16, -#endif // CONFIG_TX64X64 - }, - // FLIPADST - { - &fwd_txfm_1d_col_cfg_adst_4, - &fwd_txfm_1d_col_cfg_adst_8, - &fwd_txfm_1d_col_cfg_adst_16, - &fwd_txfm_1d_col_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_adst_8, - &fwd_txfm_1d_col_cfg_adst_4, - &fwd_txfm_1d_col_cfg_adst_16, - &fwd_txfm_1d_col_cfg_adst_8, - &fwd_txfm_1d_col_cfg_adst_32, - &fwd_txfm_1d_col_cfg_adst_16, -#if CONFIG_TX64X64 - NULL, - &fwd_txfm_1d_col_cfg_adst_32, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_adst_16, - &fwd_txfm_1d_col_cfg_adst_4, - &fwd_txfm_1d_col_cfg_adst_32, - &fwd_txfm_1d_col_cfg_adst_8, -#if CONFIG_TX64X64 - NULL, - &fwd_txfm_1d_col_cfg_adst_16, -#endif // CONFIG_TX64X64 - }, - // IDENTITY - { - &fwd_txfm_1d_col_cfg_identity_4, &fwd_txfm_1d_col_cfg_identity_8, - &fwd_txfm_1d_col_cfg_identity_16, &fwd_txfm_1d_col_cfg_identity_32, -#if CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_identity_64, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_identity_8, &fwd_txfm_1d_col_cfg_identity_4, - &fwd_txfm_1d_col_cfg_identity_16, &fwd_txfm_1d_col_cfg_identity_8, - &fwd_txfm_1d_col_cfg_identity_32, &fwd_txfm_1d_col_cfg_identity_16, -#if CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_identity_64, &fwd_txfm_1d_col_cfg_identity_32, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_identity_16, &fwd_txfm_1d_col_cfg_identity_4, - &fwd_txfm_1d_col_cfg_identity_32, &fwd_txfm_1d_col_cfg_identity_8, -#if CONFIG_TX64X64 - &fwd_txfm_1d_col_cfg_identity_64, &fwd_txfm_1d_col_cfg_identity_16, -#endif // CONFIG_TX64X64 - }, -}; - -static const TXFM_1D_CFG *fwd_txfm_row_cfg_ls[TX_TYPES_1D][TX_SIZES_ALL] = { - // DCT - { - &fwd_txfm_1d_row_cfg_dct_4, &fwd_txfm_1d_row_cfg_dct_8, - &fwd_txfm_1d_row_cfg_dct_16, &fwd_txfm_1d_row_cfg_dct_32, -#if CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_dct_64, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_dct_4x8, &fwd_txfm_1d_row_cfg_dct_8x4, - &fwd_txfm_1d_row_cfg_dct_8x16, &fwd_txfm_1d_row_cfg_dct_16x8, - &fwd_txfm_1d_row_cfg_dct_16x32, &fwd_txfm_1d_row_cfg_dct_32x16, -#if CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_dct_32x64, &fwd_txfm_1d_row_cfg_dct_64x32, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_dct_4x16, &fwd_txfm_1d_row_cfg_dct_16x4, - &fwd_txfm_1d_row_cfg_dct_8x32, &fwd_txfm_1d_row_cfg_dct_32x8, -#if CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_dct_16x64, &fwd_txfm_1d_row_cfg_dct_64x16, -#endif // CONFIG_TX64X64 - }, - // ADST - { - &fwd_txfm_1d_row_cfg_adst_4, - &fwd_txfm_1d_row_cfg_adst_8, - &fwd_txfm_1d_row_cfg_adst_16, - &fwd_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_adst_4x8, - &fwd_txfm_1d_row_cfg_adst_8x4, - &fwd_txfm_1d_row_cfg_adst_8x16, - &fwd_txfm_1d_row_cfg_adst_16x8, - &fwd_txfm_1d_row_cfg_adst_16x32, - &fwd_txfm_1d_row_cfg_adst_32x16, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_adst_4x16, - &fwd_txfm_1d_row_cfg_adst_16x4, - &fwd_txfm_1d_row_cfg_adst_8x32, - &fwd_txfm_1d_row_cfg_adst_32x8, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - }, - // FLIPADST - { - &fwd_txfm_1d_row_cfg_adst_4, - &fwd_txfm_1d_row_cfg_adst_8, - &fwd_txfm_1d_row_cfg_adst_16, - &fwd_txfm_1d_row_cfg_adst_32, -#if CONFIG_TX64X64 - NULL, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_adst_4x8, - &fwd_txfm_1d_row_cfg_adst_8x4, - &fwd_txfm_1d_row_cfg_adst_8x16, - &fwd_txfm_1d_row_cfg_adst_16x8, - &fwd_txfm_1d_row_cfg_adst_16x32, - &fwd_txfm_1d_row_cfg_adst_32x16, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_adst_4x16, - &fwd_txfm_1d_row_cfg_adst_16x4, - &fwd_txfm_1d_row_cfg_adst_8x32, - &fwd_txfm_1d_row_cfg_adst_32x8, -#if CONFIG_TX64X64 - NULL, - NULL, -#endif // CONFIG_TX64X64 - }, - // IDENTITY - { - &fwd_txfm_1d_row_cfg_identity_4, &fwd_txfm_1d_row_cfg_identity_8, - &fwd_txfm_1d_row_cfg_identity_16, &fwd_txfm_1d_row_cfg_identity_32, -#if CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_identity_64, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_identity_4x8, &fwd_txfm_1d_row_cfg_identity_8x4, - &fwd_txfm_1d_row_cfg_identity_8x16, &fwd_txfm_1d_row_cfg_identity_16x8, - &fwd_txfm_1d_row_cfg_identity_16x32, &fwd_txfm_1d_row_cfg_identity_32x16, -#if CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_identity_32x64, &fwd_txfm_1d_row_cfg_identity_64x32, -#endif // CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_identity_4x16, &fwd_txfm_1d_row_cfg_identity_16x4, - &fwd_txfm_1d_row_cfg_identity_8x32, &fwd_txfm_1d_row_cfg_identity_32x8, -#if CONFIG_TX64X64 - &fwd_txfm_1d_row_cfg_identity_16x64, &fwd_txfm_1d_row_cfg_identity_64x16, -#endif // CONFIG_TX64X64 - }, -}; - static const int8_t fwd_shift_4x4[3] = { 2, 0, 0 }; static const int8_t fwd_shift_8x8[3] = { 2, -1, 0 }; static const int8_t fwd_shift_16x16[3] = { 2, -2, 0 }; @@ -670,17 +475,86 @@ { 0, 12, 13, 12, 11 }, { 0, 0, 12, 11, 10 } }; +const int8_t fdct4_range_mult2[4] = { 0, 2, 3, 3 }; +const int8_t fdct8_range_mult2[6] = { 0, 2, 4, 5, 5, 5 }; +const int8_t fdct16_range_mult2[8] = { 0, 2, 4, 6, 7, 7, 7, 7 }; +const int8_t fdct32_range_mult2[10] = { 0, 2, 4, 6, 8, 9, 9, 9, 9, 9 }; +const int8_t fdct64_range_mult2[12] = { 0, 2, 4, 6, 8, 10, + 11, 11, 11, 11, 11, 11 }; + +const int8_t fadst4_range_mult2[6] = { 0, 0, 1, 3, 3, 3 }; +const int8_t fadst8_range_mult2[8] = { 0, 0, 1, 3, 3, 5, 5, 5 }; +const int8_t fadst16_range_mult2[10] = { 0, 0, 1, 3, 3, 5, 5, 7, 7, 7 }; +const int8_t fadst32_range_mult2[12] = { 0, 0, 1, 3, 3, 5, 5, 7, 7, 9, 9, 9 }; + +const int8_t max_fwd_range_mult2_col[5] = { 3, 5, 7, 9, 11 }; + +const int8_t fidtx4_range_mult2[1] = { 1 }; +const int8_t fidtx8_range_mult2[1] = { 2 }; +const int8_t fidtx16_range_mult2[1] = { 3 }; +const int8_t fidtx32_range_mult2[1] = { 4 }; +const int8_t fidtx64_range_mult2[1] = { 5 }; + +const int8_t fwd_idtx_range_row[5 /*row*/][5 /*col*/] = { { 2, 4, 5, 0, 0 }, + { 3, 4, 5, 6, 0 }, + { 4, 5, 6, 7, 8 }, + { 0, 5, 6, 7, 8 }, + { 0, 0, 7, 8, 9 } }; + +const int8_t *fwd_txfm_range_mult2_list[TXFM_TYPES] = { + fdct4_range_mult2, fdct8_range_mult2, fdct16_range_mult2, + fdct32_range_mult2, fdct64_range_mult2, fadst4_range_mult2, + fadst8_range_mult2, fadst16_range_mult2, fadst32_range_mult2, + fidtx4_range_mult2, fidtx8_range_mult2, fidtx16_range_mult2, + fidtx32_range_mult2, fidtx64_range_mult2 +}; + +static INLINE void set_fwd_txfm_non_scale_range(TXFM_2D_FLIP_CFG *cfg) { + const int txw_idx = tx_size_wide_log2[cfg->tx_size] - tx_size_wide_log2[0]; + const int txh_idx = tx_size_high_log2[cfg->tx_size] - tx_size_high_log2[0]; + av1_zero(cfg->stage_range_col); + av1_zero(cfg->stage_range_row); + + if (cfg->txfm_type_col != TXFM_TYPE_INVALID) { + int stage_num_col = cfg->stage_num_col; + const int8_t *range_mult2_col = + fwd_txfm_range_mult2_list[cfg->txfm_type_col]; + for (int i = 0; i < stage_num_col; ++i) + cfg->stage_range_col[i] = (range_mult2_col[i] + 1) >> 1; + } + + if (cfg->txfm_type_row != TXFM_TYPE_INVALID) { + int stage_num_row = cfg->stage_num_row; + const int8_t *range_mult2_row = + fwd_txfm_range_mult2_list[cfg->txfm_type_row]; + if (stage_num_row > 1) { + // non identity + for (int i = 0; i < stage_num_row; ++i) + cfg->stage_range_row[i] = + (max_fwd_range_mult2_col[txh_idx] + range_mult2_row[i] + 1) >> 1; + } else { + // identity + // TODO(angiebird): check if this config is correct + cfg->stage_range_row[0] = fwd_idtx_range_row[txw_idx][txh_idx]; + } + } +} + void av1_get_fwd_txfm_cfg(TX_TYPE tx_type, TX_SIZE tx_size, TXFM_2D_FLIP_CFG *cfg) { assert(cfg != NULL); + cfg->tx_size = tx_size; set_flip_cfg(tx_type, cfg); - const TX_TYPE_1D tx_type_col = vtx_tab[tx_type]; - const TX_TYPE_1D tx_type_row = htx_tab[tx_type]; - cfg->col_cfg = fwd_txfm_col_cfg_ls[tx_type_col][tx_size]; - cfg->row_cfg = fwd_txfm_row_cfg_ls[tx_type_row][tx_size]; + const TX_TYPE_1D tx_type_1d_col = vtx_tab[tx_type]; + const TX_TYPE_1D tx_type_1d_row = htx_tab[tx_type]; + const int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; + const int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; cfg->shift = fwd_txfm_shift_ls[tx_size]; - int txw_idx = tx_size_wide_log2[tx_size] - tx_size_wide_log2[0]; - int txh_idx = tx_size_high_log2[tx_size] - tx_size_high_log2[0]; cfg->cos_bit_col = fwd_cos_bit_col[txw_idx][txh_idx]; cfg->cos_bit_row = fwd_cos_bit_row[txw_idx][txh_idx]; + cfg->txfm_type_col = av1_txfm_type_ls[txh_idx][tx_type_1d_col]; + cfg->txfm_type_row = av1_txfm_type_ls[txw_idx][tx_type_1d_row]; + cfg->stage_num_col = av1_txfm_stage_num_list[cfg->txfm_type_col]; + cfg->stage_num_row = av1_txfm_stage_num_list[cfg->txfm_type_row]; + set_fwd_txfm_non_scale_range(cfg); }
diff --git a/av1/encoder/dct.c b/av1/encoder/dct.c index 07d7e60..3e40a4d 100644 --- a/av1/encoder/dct.c +++ b/av1/encoder/dct.c
@@ -2281,7 +2281,11 @@ fdct32(inputhalf, output); // Note overall scaling factor is 2 times unitary } - +// stage range +static const int8_t fwd_stage_range_col_dct_64[12] = { 0, 1, 2, 3, 4, 5, + 6, 6, 6, 6, 6, 6 }; +static const int8_t fwd_stage_range_row_dct_64[12] = { 6, 7, 8, 9, 10, 11, + 11, 11, 11, 11, 11, 11 }; static void fdct64_col(const tran_low_t *input, tran_low_t *output) { int32_t in[64], out[64]; int i;
diff --git a/av1/encoder/x86/av1_fwd_txfm2d_sse4.c b/av1/encoder/x86/av1_fwd_txfm2d_sse4.c index 5262707..8938dcb 100644 --- a/av1/encoder/x86/av1_fwd_txfm2d_sse4.c +++ b/av1/encoder/x86/av1_fwd_txfm2d_sse4.c
@@ -45,17 +45,15 @@ // Rectangular transforms use c code only, so it should be ok for now. // It will be corrected when there are sse implementations for rectangular // transforms. - assert(cfg->row_cfg->txfm_size == cfg->col_cfg->txfm_size); - const int txfm_size = cfg->row_cfg->txfm_size; + assert(cfg->tx_size < TX_SIZES); + const int txfm_size = tx_size_wide[cfg->tx_size]; const int8_t *shift = cfg->shift; - const int8_t *stage_range_col = cfg->col_cfg->stage_range; - const int8_t *stage_range_row = cfg->row_cfg->stage_range; + const int8_t *stage_range_col = cfg->stage_range_col; + const int8_t *stage_range_row = cfg->stage_range_row; const int8_t cos_bit_col = cfg->cos_bit_col; const int8_t cos_bit_row = cfg->cos_bit_row; - const TxfmFuncSSE2 txfm_func_col = - fwd_txfm_type_to_func(cfg->col_cfg->txfm_type); - const TxfmFuncSSE2 txfm_func_row = - fwd_txfm_type_to_func(cfg->row_cfg->txfm_type); + const TxfmFuncSSE2 txfm_func_col = fwd_txfm_type_to_func(cfg->txfm_type_col); + const TxfmFuncSSE2 txfm_func_row = fwd_txfm_type_to_func(cfg->txfm_type_row); __m128i *buf_128 = (__m128i *)txfm_buf; __m128i *out_128 = (__m128i *)output;