Commit 63d04438 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

potential fix in crend LFE q factor handling

parent 76ed6d0a
Loading
Loading
Loading
Loading
Loading
+14 −7
Original line number Diff line number Diff line
@@ -2302,9 +2302,8 @@ ivas_error ivas_jbm_dec_render_fx(
                        return error;
                    }

                    // Todo main-pc update: This might be needed also in the split rendering path
                    IF( st_ivas->hDecoderConfig->Opt_tsm )
                    {
                    // ideally only needed for LFE channel to q match LFE ch and binaural output of crend
                    // also only needed if q factor is changed by crend
                    IF( NE_16( exp, *st_ivas->hCrendWrapper->p_io_qfactor ) )
                    {
                        FOR( i = 0; i < nchan_in; i++ )
@@ -2312,7 +2311,6 @@ ivas_error ivas_jbm_dec_render_fx(
                            scale_sig32( p_tc_fx[i], *nSamplesRendered, sub( *st_ivas->hCrendWrapper->p_io_qfactor, exp ) );
                        }
                    }
                    }

                    ivas_binaural_add_LFE_fx( st_ivas, *nSamplesRendered, p_tc_fx, p_output_fx );
                }
@@ -2736,6 +2734,7 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
        {
            IF( EQ_16( mc_mode_old, MC_MODE_MCT ) )
            {
                Word16 i;
                test();
                IF( EQ_16( renderer_type_old, RENDERER_BINAURAL_MIXER_CONV ) || EQ_16( renderer_type_old, RENDERER_BINAURAL_MIXER_CONV_ROOM ) )
                {
@@ -2759,6 +2758,14 @@ ivas_error ivas_jbm_dec_flush_renderer_fx(
                        return error;
                    }

                    IF( NE_16( 11, *st_ivas->hCrendWrapper->p_io_qfactor ) )
                    {
                        FOR( i = 0; i < nchan_in; i++ )
                        {
                            scale_sig32( st_ivas->hTcBuffer->tc_fx[i], hTcBuffer->n_samples_granularity, sub( *st_ivas->hCrendWrapper->p_io_qfactor, 11 ) );
                        }
                    }

                    ivas_binaural_add_LFE_fx( st_ivas, hTcBuffer->n_samples_granularity, st_ivas->hTcBuffer->tc_fx, p_output_fx );
                }
                ELSE IF( EQ_16( renderer_type_old, RENDERER_BINAURAL_OBJECTS_TD ) )
+2 −0
Original line number Diff line number Diff line
@@ -2285,6 +2285,7 @@ ivas_error ivas_rend_crendProcessSubframe(
        ivas_combined_orientation_update_index( hCombinedOrientationData, subframe_len );
    }

    // why is this scaling needed ?
    IF( pCrend->hCrend[0]->hReverb != NULL )
    {
        *pCrend->p_io_qfactor = sub( *pCrend->p_io_qfactor, 2 );
@@ -2293,6 +2294,7 @@ ivas_error ivas_rend_crendProcessSubframe(
        {
            FOR( Word16 j = 0; j < n_samples_to_render; j++ )
            {
                // this seems to be assuming input and output buffers are same. Shouldnt this scaling be happening on input[][] ??
                output[i][j] = L_shr( output[i][j], 2 ); // Q = *pCrend->p_io_qfactor
                move32();
            }