Commit fec0f74d authored by bayers's avatar bayers
Browse files

fix tc offset for some cases

parent 2c374d03
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -160,7 +160,7 @@
#define FIX_575_LOW_OVERLAP_PLC_RECOVERY                /* FhG: Issue 575 fix for PLC and transistion to TCX5*/
#define ISM_FB_16k4                                     /* VA: Issue: 579: change BW from SWB to FB in NxISM conditions to match the EVS codec */
#define FIX_580_PARAMMC_ENER_BURSTS                     /* FhG: issue 580: energy bursts due to ILD holding when energy relations change too much */

#define NONBE_FIX_589_JBM_TC_OFFSETS                    /* FhG: issue 589: wrong offset into the TC buffers is used in some rendering paths in the JBM main rendering function */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+18 −2
Original line number Diff line number Diff line
@@ -701,8 +701,13 @@ ivas_error ivas_jbm_dec_render(
                *nSamplesRendered = min( st_ivas->hTcBuffer->n_samples_available, nSamplesAskedLocal );
                pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f;
                pan_right = 1.f - pan_left;
#ifdef NONBE_FIX_589_JBM_TC_OFFSETS
                v_multc( p_tc[0], pan_right, output[1], *nSamplesRendered );
                v_multc( p_tc[0], pan_left, output[0], *nSamplesRendered );
#else
                v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], *nSamplesRendered );
                v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], *nSamplesRendered );
#endif
            }
            else if ( st_ivas->renderer_type == RENDERER_PARAM_ISM || st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC )
            {
@@ -729,8 +734,13 @@ ivas_error ivas_jbm_dec_render(
            {
                pan_left = ( st_ivas->hDecoderConfig->non_diegetic_pan_gain + 1.f ) * 0.5f;
                pan_right = 1.f - pan_left;
#ifdef NONBE_FIX_589_JBM_TC_OFFSETS
                v_multc( p_tc[0], pan_right, output[1], *nSamplesRendered );
                v_multc( p_tc[0], pan_left, output[0], *nSamplesRendered );
#else
                v_multc( st_ivas->hTcBuffer->tc[0], pan_right, output[1], *nSamplesRendered );
                v_multc( st_ivas->hTcBuffer->tc[0], pan_left, output[0], *nSamplesRendered );
#endif
            }
            else if ( st_ivas->renderer_type == RENDERER_SBA_LINEAR_ENC || st_ivas->renderer_type == RENDERER_BINAURAL_FASTCONV )
            {
@@ -816,8 +826,11 @@ ivas_error ivas_jbm_dec_render(
                {
                    return error;
                }

#ifdef NONBE_FIX_589_JBM_TC_OFFSETS
                ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_tc, p_output );
#else
                ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->tc, p_output );
#endif
            }
            else if ( st_ivas->renderer_type == RENDERER_MC )
            {
@@ -834,8 +847,11 @@ ivas_error ivas_jbm_dec_render(
                {
                    return error;
                }

#ifdef NONBE_FIX_589_JBM_TC_OFFSETS
                ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, p_tc, p_output );
#else
                ivas_binaural_add_LFE( st_ivas, *nSamplesRendered, st_ivas->hTcBuffer->tc, p_output );
#endif
            }
        }
        else if ( st_ivas->mc_mode == MC_MODE_PARAMMC )