mirror of
https://github.com/ittiam-systems/libhevc.git
synced 2026-10-02 08:42:42 +07:00
libhevcdec: Unify itrans_res family and remove redundant HBD implementation
Currently, libhevc maintains two separate implementations for inverse
transform residual functions: ihevc_itrans_res_* and ihevc_hbd_itrans_res_*.
Since both 8-bit and HBD inverse transform residual routines output signed
16-bit residuals (WORD16 *pi2_dst), the only algorithmic difference between
8-bit and HBD variants is the 2nd stage shift:
Stage 1 shift: IT_SHIFT_STAGE_1 = 7 (fixed across all bit depths)
Stage 2 shift: shift = 20 - bit_depth
- 8-bit: 20 - 8 = 12 (IT_SHIFT_STAGE_2)
- 10-bit: 20 - 10 = 10
This commit cleans up the entire itrans_res family (4x4_ttype1, 4x4, dc, 8x8,
16x16, 32x32) as follows:
1. common/ihevc_itrans_res.h & common/ihevc_itrans_res.c:
- Add 'UWORD8 bit_depth' parameter to ihevc_itrans_res_* function
signatures and typedefs.
- Replace hardcoded 'shift = IT_SHIFT_STAGE_2;' with 'shift = 20 - bit_depth;'.
- Remove obsolete ihevc_hbd_itrans_res_* prototypes and typedefs.
2. common/ihevc_hbd_itrans_res.c:
- Delete file (~2,335 redundant lines removed).
3. Update tests/common/ihevc_itrans_res_test.cc to test bit depths 8 and 10
This commit is contained in:
parent
96c76d073c
commit
9886db71d3
12 changed files with 62 additions and 2498 deletions
|
|
@ -102,7 +102,6 @@ cc_library_static {
|
|||
"common/ihevc_hbd_inter_pred_filters.c",
|
||||
"common/ihevc_hbd_intra_pred_filters.c",
|
||||
"common/ihevc_hbd_iquant_recon.c",
|
||||
"common/ihevc_hbd_itrans_res.c",
|
||||
"common/ihevc_hbd_itrans_recon.c",
|
||||
"common/ihevc_hbd_itrans_recon_16x16.c",
|
||||
"common/ihevc_hbd_itrans_recon_32x32.c",
|
||||
|
|
|
|||
|
|
@ -64,7 +64,6 @@ cc_library_static {
|
|||
"ihevc_hbd_inter_pred_filters.c",
|
||||
"ihevc_hbd_intra_pred_filters.c",
|
||||
"ihevc_hbd_iquant_recon.c",
|
||||
"ihevc_hbd_itrans_res.c",
|
||||
"ihevc_hbd_itrans_recon.c",
|
||||
"ihevc_hbd_itrans_recon_16x16.c",
|
||||
"ihevc_hbd_itrans_recon_32x32.c",
|
||||
|
|
|
|||
|
|
@ -77,7 +77,6 @@ list(
|
|||
"${HEVC_ROOT}/common/ihevc_hbd_intra_pred_filters.c"
|
||||
"${HEVC_ROOT}/common/ihevc_hbd_iquant_recon.c"
|
||||
"${HEVC_ROOT}/common/ihevc_hbd_itrans_recon.c"
|
||||
"${HEVC_ROOT}/common/ihevc_hbd_itrans_res.c"
|
||||
"${HEVC_ROOT}/common/ihevc_hbd_itrans_recon_16x16.c"
|
||||
"${HEVC_ROOT}/common/ihevc_hbd_itrans_recon_32x32.c"
|
||||
"${HEVC_ROOT}/common/ihevc_hbd_itrans_recon_8x8.c"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -62,7 +62,8 @@ void ihevc_itrans_res_4x4_ttype1(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows)
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth)
|
||||
{
|
||||
WORD32 i, c[4];
|
||||
WORD32 add;
|
||||
|
|
@ -110,7 +111,7 @@ void ihevc_itrans_res_4x4_ttype1(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
|
||||
for(i = 0; i < trans_size; i++)
|
||||
|
|
@ -146,7 +147,8 @@ void ihevc_itrans_res_4x4(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows)
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth)
|
||||
|
||||
{
|
||||
WORD32 j;
|
||||
|
|
@ -202,7 +204,7 @@ void ihevc_itrans_res_4x4(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
|
||||
for(j = 0; j < trans_size; j++)
|
||||
|
|
@ -240,7 +242,8 @@ void ihevc_itrans_res_4x4(WORD16 *pi2_src,
|
|||
void ihevc_itrans_res_dc(WORD16 *pi2_dst,
|
||||
WORD32 dst_strd,
|
||||
WORD32 log2_trans_size,
|
||||
WORD16 i2_coeff_value)
|
||||
WORD16 i2_coeff_value,
|
||||
UWORD8 bit_depth)
|
||||
{
|
||||
WORD32 row, col;
|
||||
WORD32 add, shift;
|
||||
|
|
@ -254,7 +257,7 @@ void ihevc_itrans_res_dc(WORD16 *pi2_dst,
|
|||
shift = IT_SHIFT_STAGE_1;
|
||||
add = 1 << (shift - 1);
|
||||
dc_value = CLIP_S16((quant_out * 64 + add) >> shift);
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
dc_value = CLIP_S16((dc_value * 64 + add) >> shift);
|
||||
|
||||
|
|
@ -271,7 +274,8 @@ void ihevc_itrans_res_8x8(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows)
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth)
|
||||
{
|
||||
WORD32 j, k;
|
||||
WORD32 e[4], o[4];
|
||||
|
|
@ -345,7 +349,7 @@ void ihevc_itrans_res_8x8(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
{
|
||||
|
|
@ -486,7 +490,7 @@ void ihevc_itrans_res_8x8(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
{
|
||||
|
|
@ -575,7 +579,8 @@ void ihevc_itrans_res_16x16(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows)
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth)
|
||||
{
|
||||
WORD32 j, k;
|
||||
WORD32 e[8], o[8];
|
||||
|
|
@ -659,7 +664,7 @@ void ihevc_itrans_res_16x16(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
|
||||
if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
|
|
@ -897,7 +902,7 @@ void ihevc_itrans_res_16x16(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
|
||||
if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
|
|
@ -1159,7 +1164,7 @@ void ihevc_itrans_res_16x16(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
|
||||
if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
|
|
@ -1339,7 +1344,8 @@ void ihevc_itrans_res_32x32(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows)
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth)
|
||||
{
|
||||
WORD32 j, k;
|
||||
WORD32 e[16], o[16];
|
||||
|
|
@ -1435,7 +1441,7 @@ void ihevc_itrans_res_32x32(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
{
|
||||
|
|
@ -1742,7 +1748,7 @@ void ihevc_itrans_res_32x32(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
{
|
||||
|
|
@ -2099,7 +2105,7 @@ void ihevc_itrans_res_32x32(WORD16 *pi2_src,
|
|||
pi2_tmp = pi2_tmp_orig;
|
||||
|
||||
/* Inverse Transform 2nd stage */
|
||||
shift = IT_SHIFT_STAGE_2;
|
||||
shift = 20 - bit_depth;
|
||||
add = 1 << (shift - 1);
|
||||
if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@ typedef void ihevc_itrans_res_4x4_ttype1_ft(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows);
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_itrans_res_4x4_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
|
|
@ -48,12 +49,14 @@ typedef void ihevc_itrans_res_4x4_ft(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows);
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_itrans_res_dc_ft(WORD16 *pi2_dst,
|
||||
WORD32 dst_strd,
|
||||
WORD32 log2_trans_size,
|
||||
WORD16 i2_coeff_value);
|
||||
WORD16 i2_coeff_value,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_itrans_res_8x8_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
|
|
@ -61,7 +64,8 @@ typedef void ihevc_itrans_res_8x8_ft(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows);
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_itrans_res_16x16_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
|
|
@ -69,7 +73,8 @@ typedef void ihevc_itrans_res_16x16_ft(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows);
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_itrans_res_32x32_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
|
|
@ -77,58 +82,8 @@ typedef void ihevc_itrans_res_32x32_ft(WORD16 *pi2_src,
|
|||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows);
|
||||
|
||||
typedef void ihevc_hbd_itrans_res_4x4_ttype1_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
WORD16 *pi2_dst,
|
||||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_hbd_itrans_res_4x4_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
WORD16 *pi2_dst,
|
||||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_hbd_itrans_res_dc_ft(WORD16 *pi2_dst,
|
||||
WORD32 dst_strd,
|
||||
WORD32 log2_trans_size,
|
||||
WORD16 i2_coeff_value,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_hbd_itrans_res_8x8_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
WORD16 *pi2_dst,
|
||||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_hbd_itrans_res_16x16_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
WORD16 *pi2_dst,
|
||||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_hbd_itrans_res_32x32_ft(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
WORD16 *pi2_dst,
|
||||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void ihevc_res_4x4_transform(WORD16 *pi2_src,
|
||||
WORD16 *pi2_dst,
|
||||
|
|
@ -151,13 +106,6 @@ ihevc_itrans_res_8x8_ft ihevc_itrans_res_8x8;
|
|||
ihevc_itrans_res_16x16_ft ihevc_itrans_res_16x16;
|
||||
ihevc_itrans_res_32x32_ft ihevc_itrans_res_32x32;
|
||||
|
||||
ihevc_hbd_itrans_res_4x4_ttype1_ft ihevc_hbd_itrans_res_4x4_ttype1;
|
||||
ihevc_hbd_itrans_res_4x4_ft ihevc_hbd_itrans_res_4x4;
|
||||
ihevc_hbd_itrans_res_dc_ft ihevc_hbd_itrans_res_dc;
|
||||
ihevc_hbd_itrans_res_8x8_ft ihevc_hbd_itrans_res_8x8;
|
||||
ihevc_hbd_itrans_res_16x16_ft ihevc_hbd_itrans_res_16x16;
|
||||
ihevc_hbd_itrans_res_32x32_ft ihevc_hbd_itrans_res_32x32;
|
||||
|
||||
ihevc_res_4x4_transform ihevc_res_4x4_rotate;
|
||||
ihevc_res_nxn_transform ihevc_res_nxn_copy;
|
||||
ihevc_res_nxn_transform ihevc_res_nxn_rdpcm_horz;
|
||||
|
|
|
|||
|
|
@ -1060,14 +1060,6 @@ void ihevcd_update_function_ptr(codec_t *ps_codec)
|
|||
ps_codec->apf_hbd_intra_pred_chroma[9] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_ver_fptr;
|
||||
ps_codec->apf_hbd_intra_pred_chroma[10] = (pf_hbd_intra_pred_chroma)ps_codec->s_func_selector.ihevc_hbd_intra_pred_chroma_mode_27_to_33_fptr;
|
||||
|
||||
ps_codec->apf_hbd_itrans_res[0] = (pf_hbd_itrans_res)ps_codec->s_func_selector.ihevc_hbd_itrans_res_4x4_ttype1_fptr;
|
||||
ps_codec->apf_hbd_itrans_res[1] = (pf_hbd_itrans_res)ps_codec->s_func_selector.ihevc_hbd_itrans_res_4x4_fptr;
|
||||
ps_codec->apf_hbd_itrans_res[2] = (pf_hbd_itrans_res)ps_codec->s_func_selector.ihevc_hbd_itrans_res_8x8_fptr;
|
||||
ps_codec->apf_hbd_itrans_res[3] = (pf_hbd_itrans_res)ps_codec->s_func_selector.ihevc_hbd_itrans_res_16x16_fptr;
|
||||
ps_codec->apf_hbd_itrans_res[4] = (pf_hbd_itrans_res)ps_codec->s_func_selector.ihevc_hbd_itrans_res_32x32_fptr;
|
||||
|
||||
ps_codec->apf_hbd_itrans_res_dc = (pf_hbd_itrans_res_dc)ps_codec->s_func_selector.ihevc_hbd_itrans_res_dc_fptr;
|
||||
|
||||
ps_codec->apf_hbd_itrans_recon[0] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_4x4_ttype1_fptr;
|
||||
ps_codec->apf_hbd_itrans_recon[1] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_4x4_fptr;
|
||||
ps_codec->apf_hbd_itrans_recon[2] = (pf_hbd_itrans_recon)ps_codec->s_func_selector.ihevc_hbd_itrans_recon_8x8_fptr;
|
||||
|
|
|
|||
|
|
@ -194,13 +194,6 @@ typedef struct
|
|||
ihevc_hbd_chroma_itrans_recon_16x16_ft *ihevc_hbd_chroma_itrans_recon_16x16_fptr;
|
||||
ihevc_hbd_chroma_itrans_recon_32x32_ft *ihevc_hbd_chroma_itrans_recon_32x32_fptr;
|
||||
|
||||
ihevc_hbd_itrans_res_4x4_ttype1_ft *ihevc_hbd_itrans_res_4x4_ttype1_fptr;
|
||||
ihevc_hbd_itrans_res_4x4_ft *ihevc_hbd_itrans_res_4x4_fptr;
|
||||
ihevc_hbd_itrans_res_8x8_ft *ihevc_hbd_itrans_res_8x8_fptr;
|
||||
ihevc_hbd_itrans_res_16x16_ft *ihevc_hbd_itrans_res_16x16_fptr;
|
||||
ihevc_hbd_itrans_res_32x32_ft *ihevc_hbd_itrans_res_32x32_fptr;
|
||||
ihevc_hbd_itrans_res_dc_ft *ihevc_hbd_itrans_res_dc_fptr;
|
||||
|
||||
ihevc_hbd_recon_4x4_ttype1_ft *ihevc_hbd_recon_4x4_ttype1_fptr;
|
||||
ihevc_hbd_recon_4x4_ft *ihevc_hbd_recon_4x4_fptr;
|
||||
ihevc_hbd_recon_8x8_ft *ihevc_hbd_recon_8x8_fptr;
|
||||
|
|
|
|||
|
|
@ -212,13 +212,6 @@ void ihevcd_init_function_ptr_generic(func_selector_t *ps_func_selector)
|
|||
ps_func_selector->ihevcd_hbd_itrans_recon_dc_luma_fptr = &ihevcd_hbd_itrans_recon_dc_luma;
|
||||
ps_func_selector->ihevcd_hbd_itrans_recon_dc_chroma_fptr = &ihevcd_hbd_itrans_recon_dc_chroma;
|
||||
|
||||
ps_func_selector->ihevc_hbd_itrans_res_4x4_ttype1_fptr = &ihevc_hbd_itrans_res_4x4_ttype1;
|
||||
ps_func_selector->ihevc_hbd_itrans_res_4x4_fptr = &ihevc_hbd_itrans_res_4x4;
|
||||
ps_func_selector->ihevc_hbd_itrans_res_8x8_fptr = &ihevc_hbd_itrans_res_8x8;
|
||||
ps_func_selector->ihevc_hbd_itrans_res_16x16_fptr = &ihevc_hbd_itrans_res_16x16;
|
||||
ps_func_selector->ihevc_hbd_itrans_res_32x32_fptr = &ihevc_hbd_itrans_res_32x32;
|
||||
ps_func_selector->ihevc_hbd_itrans_res_dc_fptr = &ihevc_hbd_itrans_res_dc;
|
||||
|
||||
ps_func_selector->ihevc_hbd_deblk_luma_vert_fptr = &ihevc_hbd_deblk_luma_vert;
|
||||
ps_func_selector->ihevc_hbd_deblk_luma_horz_fptr = &ihevc_hbd_deblk_luma_horz;
|
||||
ps_func_selector->ihevc_hbd_deblk_chroma_vert_fptr = &ihevc_hbd_deblk_chroma_vert;
|
||||
|
|
|
|||
|
|
@ -809,33 +809,16 @@ static void ihevcd_iquant_itrans_resi_recon_tu_plane(process_ctxt_t *ps_proc,
|
|||
if(0 == ps_pl_tu_ctxt->coeff_type)
|
||||
{
|
||||
WORD32 func_tmp_idx = chroma_plane != NULL_PLANE ? func_idx - 4 : func_idx;
|
||||
if(ps_codec->i4_pixel_size_y > 1) {
|
||||
ps_codec->apf_hbd_itrans_res[func_tmp_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
|
||||
ps_proc->pi2_itrans_intrmd_buf, residue_out,
|
||||
ps_pl_tu_ctxt->tu_coeff_stride, trans_size,
|
||||
ps_pl_tu_ctxt->zero_cols,
|
||||
ps_pl_tu_ctxt->zero_rows, (UWORD8)bit_depth);
|
||||
}
|
||||
else
|
||||
{
|
||||
ps_codec->apf_itrans_res[func_tmp_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
|
||||
ps_proc->pi2_itrans_intrmd_buf, residue_out,
|
||||
ps_pl_tu_ctxt->tu_coeff_stride, trans_size,
|
||||
ps_pl_tu_ctxt->zero_cols,
|
||||
ps_pl_tu_ctxt->zero_rows);
|
||||
}
|
||||
ps_codec->apf_itrans_res[func_tmp_idx](ps_pl_tu_ctxt->pi2_tu_coeff,
|
||||
ps_proc->pi2_itrans_intrmd_buf, residue_out,
|
||||
ps_pl_tu_ctxt->tu_coeff_stride, trans_size,
|
||||
ps_pl_tu_ctxt->zero_cols,
|
||||
ps_pl_tu_ctxt->zero_rows, (UWORD8)bit_depth);
|
||||
}
|
||||
else /* DC only */
|
||||
{
|
||||
if(ps_codec->i4_pixel_size_y > 1) {
|
||||
ps_codec->apf_hbd_itrans_res_dc(residue_out, trans_size, log2_trans_size,
|
||||
ps_pl_tu_ctxt->coeff_value, (UWORD8)bit_depth);
|
||||
}
|
||||
else
|
||||
{
|
||||
ps_codec->apf_itrans_res_dc(residue_out, trans_size, log2_trans_size,
|
||||
ps_pl_tu_ctxt->coeff_value);
|
||||
}
|
||||
ps_codec->apf_itrans_res_dc(residue_out, trans_size, log2_trans_size,
|
||||
ps_pl_tu_ctxt->coeff_value, (UWORD8)bit_depth);
|
||||
}
|
||||
ps_pl_tu_ctxt->zero_cols = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1639,7 +1639,8 @@ typedef void (*pf_itrans_res)(WORD16 *pi2_src,
|
|||
WORD32 i4_src_strd,
|
||||
WORD32 i4_dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows);
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void (*pf_itrans_recon)(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
|
|
@ -1669,7 +1670,8 @@ typedef void (*pf_itrans_recon_dc)(UWORD8 *pu1_pred,
|
|||
typedef void (*pf_itrans_res_dc)(WORD16 *pi2_dst,
|
||||
WORD32 dst_strd,
|
||||
WORD32 log2_trans_size,
|
||||
WORD16 i2_coeff_value);
|
||||
WORD16 i2_coeff_value,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
|
||||
typedef void (*pf_sao_luma)(UWORD8 *,
|
||||
|
|
@ -1716,21 +1718,6 @@ typedef void (*pf_hbd_itrans_recon)(WORD16 *pi2_src,
|
|||
WORD32 i4_zero_rows,
|
||||
UWORD8 u1_bit_depth);
|
||||
|
||||
typedef void (*pf_hbd_itrans_res)(WORD16 *pi2_src,
|
||||
WORD16 *pi2_tmp,
|
||||
WORD16 *pi2_dst,
|
||||
WORD32 src_strd,
|
||||
WORD32 dst_strd,
|
||||
WORD32 zero_cols,
|
||||
WORD32 zero_rows,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void (*pf_hbd_itrans_res_dc)(WORD16 *pi2_dst,
|
||||
WORD32 dst_strd,
|
||||
WORD32 log2_trans_size,
|
||||
WORD16 i2_coeff_value,
|
||||
UWORD8 bit_depth);
|
||||
|
||||
typedef void (*pf_hbd_recon)(WORD16 *pi2_src,
|
||||
UWORD16 *pu2_pred,
|
||||
UWORD16 *pu2_dst,
|
||||
|
|
@ -2442,8 +2429,6 @@ struct _codec_t
|
|||
pf_hbd_sao_luma apf_hbd_sao_luma[4];
|
||||
pf_hbd_sao_chroma apf_hbd_sao_chroma[4];
|
||||
pf_hbd_inter_pred apf_hbd_inter_pred[22];
|
||||
pf_hbd_itrans_res apf_hbd_itrans_res[5];
|
||||
pf_hbd_itrans_res_dc apf_hbd_itrans_res_dc;
|
||||
|
||||
/** Funtion pointers for all the leaf level functions */
|
||||
func_selector_t s_func_selector;
|
||||
|
|
|
|||
|
|
@ -72,11 +72,11 @@ protected:
|
|||
ref = get_ref_func_ptr();
|
||||
}
|
||||
|
||||
template <typename FuncPtr> void RunTest(FuncPtr func_ptr) {
|
||||
template <typename FuncPtr> void RunTest(FuncPtr func_ptr, UWORD8 bit_depth) {
|
||||
(ref->*func_ptr)(src_buf.data(), tmp_buf.data(), dst_buf_ref.data(),
|
||||
src_strd, dst_strd, 0, 0);
|
||||
src_strd, dst_strd, 0, 0, bit_depth);
|
||||
(tst->*func_ptr)(src_buf.data(), tmp_buf.data(), dst_buf_tst.data(),
|
||||
src_strd, dst_strd, 0, 0);
|
||||
src_strd, dst_strd, 0, 0, bit_depth);
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(compare_output<WORD16>(
|
||||
dst_buf_ref, dst_buf_tst, trans_size, trans_size, dst_strd));
|
||||
|
|
@ -95,18 +95,20 @@ protected:
|
|||
};
|
||||
|
||||
TEST_P(ITransResTest, Run) {
|
||||
if (trans_size == 4) {
|
||||
if (ttype == 1) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_4x4_ttype1_fptr);
|
||||
} else {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_4x4_fptr);
|
||||
for (UWORD8 bit_depth : {8, 10}) {
|
||||
if (trans_size == 4) {
|
||||
if (ttype == 1) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_4x4_ttype1_fptr, bit_depth);
|
||||
} else {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_4x4_fptr, bit_depth);
|
||||
}
|
||||
} else if (trans_size == 8) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_8x8_fptr, bit_depth);
|
||||
} else if (trans_size == 16) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_16x16_fptr, bit_depth);
|
||||
} else if (trans_size == 32) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_32x32_fptr, bit_depth);
|
||||
}
|
||||
} else if (trans_size == 8) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_8x8_fptr);
|
||||
} else if (trans_size == 16) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_16x16_fptr);
|
||||
} else if (trans_size == 32) {
|
||||
RunTest(&ihevc_func_selector_t::ihevc_itrans_res_32x32_fptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue