From ffc393eb77eee1d1ca1f275466c6ed16de5275c2 Mon Sep 17 00:00:00 2001 From: Sandesh Venkatesh Date: Fri, 13 Jun 2025 20:19:16 +0530 Subject: [PATCH] HRTF rend optimization - Bit exact changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes made under macro OPT_HEAD_ROT_REND_V1_BE Function and corresponding WMOPS gain: rotateFrame_shd_cldfb 7.9 Command: ./IVAS_dec -t headrot.csv BINAURAL 48  bit mc.wav --- lib_com/options.h | 1 + lib_rend/ivas_rotation_fx.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib_com/options.h b/lib_com/options.h index 7e3799ffc..f734ff624 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -76,6 +76,7 @@ /* Note: each compile switch (FIX_1101_...) is independent from the other ones */ #define OPT_SBA_REND_V1_BE +#define OPT_HEAD_ROT_REND_V1_BE #define OPT_SBA_ENC_V1_BE #define OPT_BIN_RENDERER_V1 #define OPT_BIN_RENDERER_V2 diff --git a/lib_rend/ivas_rotation_fx.c b/lib_rend/ivas_rotation_fx.c index b9403e7da..d65dab4c1 100644 --- a/lib_rend/ivas_rotation_fx.c +++ b/lib_rend/ivas_rotation_fx.c @@ -1046,7 +1046,9 @@ void rotateFrame_shd_cldfb( Word16 l = 0, m1 = 0, m2 = 0; Word32 realRot[2 * HEADROT_ORDER + 1], imagRot[2 * HEADROT_ORDER + 1]; Word16 SHrotmat[HEADROT_SHMAT_DIM][HEADROT_SHMAT_DIM]; +#ifndef OPT_HEAD_ROT_REND_V1_BE Word32 temp1, temp2; +#endif /* OPT_HEAD_ROT_REND_V1_BE */ move16(); move16(); move16(); @@ -1095,12 +1097,19 @@ void rotateFrame_shd_cldfb( move32(); FOR( m = m1; m < m2; m++ ) { +#ifdef OPT_HEAD_ROT_REND_V1_BE + realRot[n - m1] = Madd_32_16_r( realRot[n - m1], Cldfb_RealBuffer[m][i][iBand], SHrotmat[n][m] ); // Q(x + 14 - 15) + move32(); + imagRot[n - m1] = Madd_32_16_r( imagRot[n - m1], Cldfb_ImagBuffer[m][i][iBand], SHrotmat[n][m] ); // Q(x + 14 - 15) + move32(); +#else /* OPT_HEAD_ROT_REND_V1_BE */ temp1 = Mpy_32_16_r( Cldfb_RealBuffer[m][i][iBand], SHrotmat[n][m] ); // Q(x + 14 - 15) temp2 = Mpy_32_16_r( Cldfb_ImagBuffer[m][i][iBand], SHrotmat[n][m] ); // Q(x + 14 - 15) realRot[n - m1] = L_add( temp1, realRot[n - m1] ); // Q(x + 14 - 15) move32(); imagRot[n - m1] = L_add( temp2, imagRot[n - m1] ); // Q(x + 14 - 15) move32(); +#endif /* OPT_HEAD_ROT_REND_V1_BE */ } } /* write back the result */ -- GitLab