Commit 9173eff4 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

fix for SPLIT PCM output cases, save 32 bit bin outputs

parent 56ff332d
Loading
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2686,14 +2686,13 @@ ivas_error ivas_jbm_dec_render_fx(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    IF( EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED ) || EQ_32( output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
    {
        nchan_out_syn_output = i_mult( BINAURAL_CHANNELS, st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses );
        move16();
    }
    ELSE
        FOR( i = 0; i < st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses * BINAURAL_CHANNELS; i++ )
        {
            Copy32( p_output_fx[i], st_ivas->hSplitBinRend->hMultiBinCldfbData->output_fx[i], *nSamplesRendered );
        }
    }
    nchan_out_syn_output = nchan_out;
    move16();
    }

    IF( st_ivas->hDecoderConfig->Opt_Limiter )
#endif
+1 −0
Original line number Diff line number Diff line
@@ -896,6 +896,7 @@ typedef struct
{
    Word32 Cldfb_RealBuffer_Binaural_fx[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_Binaural_fx[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    Word32 output_fx[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k];

} ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA, *ISAR_DEC_SPLIT_REND_MULTI_BIN_CLDFB_DATA_HANDLE;

+9 −16
Original line number Diff line number Diff line
@@ -1324,8 +1324,6 @@ IVAS_DEC_GetSplitBinauralBitstream(
    AUDIO_CONFIG output_config;
    Word32 output_Fs;
    Word32 *pOutput[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES];
    Word32 output[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k];
    Word16 pcmBuf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES * L_FRAME48k];
    Word32 Cldfb_RealBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    Word32 Cldfb_ImagBuffer_Binaural[MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS][CLDFB_NO_COL_MAX][CLDFB_NO_CHANNELS_MAX];
    FOR( Word32 i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; i++ )
@@ -1413,24 +1411,15 @@ IVAS_DEC_GetSplitBinauralBitstream(


    /* Decode and render */
    if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_DEC_GetSamples( hIvasDec, numSamplesPerChannelToDecode, pcmBuf_out, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    /* change buffer layout */
    FOR( i = 0; i < numSamplesPerChannelToDecode; ++i )
    {
        FOR( j = 0; j < BINAURAL_CHANNELS * numPoses; ++j )
        {
            output[j][i] = (Word32) pcmBuf[add( i_mult( i, i_mult( BINAURAL_CHANNELS, numPoses ) ), j )];
            move32();
        }
    }

    FOR( i = 0; i < BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; ++i )
    {
        pOutput[i] = output[i];
        pOutput[i] = hSplitBinRend->hMultiBinCldfbData->output_fx[i];
        move32();
    }

@@ -1510,7 +1499,7 @@ IVAS_DEC_GetSplitBinauralBitstream(
            scale_sig32( Cldfb_ImagBuffer_Binaural[i][j], CLDFB_NO_CHANNELS_MAX, Q_buff );
        }
    }
    Q_buff = Q_buff + Q6;
    Q_buff = add( Q_buff, Q6 );

    IF( NE_16( td_input, 0 ) )
    {
@@ -1521,14 +1510,17 @@ IVAS_DEC_GetSplitBinauralBitstream(

        FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i )
        {
            Q_out[0] = s_min( Q_out[0], L_norm_arr( output[i], L_FRAME48k ) );
            Q_out[0] = s_min( Q_out[0], L_norm_arr( pOutput[i], L_FRAME48k ) );
        }

        FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i )
        {
            scale_sig32( output[i], L_FRAME48k, Q_out[0] );
            scale_sig32( pOutput[i], L_FRAME48k, Q_out[0] );
        }
        Q_out[0] = add( Q_out[0], Q11 );
        Q_out[1] = Q_out[0];
    }

    if ( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend,
                                                          Quaternion,
                                                          st_ivas->hRenderConfig->split_rend_config.splitRendBitRate,
@@ -1546,6 +1538,7 @@ IVAS_DEC_GetSplitBinauralBitstream(
        return error;
    }


    /* convert to int16 with limiting for BINAURAL_SPLIT_PCM */
    IF( pcm_out_flag )
    {
+2 −2
Original line number Diff line number Diff line
@@ -3250,7 +3250,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
        /*scaling to max Q*/
        Word16 scale_factor = 31;
        move32();
        FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; i++ )
        FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; i++ )
        {
            FOR( Word16 j = 0; j < CLDFB_NO_COL_MAX; j++ )
            {
@@ -3258,7 +3258,7 @@ ivas_error isar_renderMultiTDBinToSplitBinaural(
            }
        }
        scale_factor = sub( scale_factor, 2 );
        FOR( i = 0; i < MAX_HEAD_ROT_POSES * BINAURAL_CHANNELS; i++ )
        FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; i++ )
        {
            FOR( Word16 j = 0; j < CLDFB_NO_COL_MAX; j++ )
            {