Commit d76762fd authored by vaclav's avatar vaclav
Browse files

address comments

parent ba61e9a7
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3379,7 +3379,7 @@ static ivas_error decodeVoIP(
            if ( isSplitRend )
            {
#ifdef SUPPORT_JBM_TRACEFILE
                if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, nOutSamples, (void *) pcmBuf, splitRendBits, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
                if ( ( error = IVAS_DEC_VoIP_GetSplitBinauralBitstream( hIvasDec, (void *) pcmBuf, splitRendBits, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
@@ -3392,7 +3392,7 @@ static ivas_error decodeVoIP(
            {
#endif
#ifdef SUPPORT_JBM_TRACEFILE
                if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
                if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, writeJbmTraceFileFrameWrapper, jbmTraceWriter, &bitstreamReadDone, &nSamplesRendered, &parametersAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#else
            if ( ( error = IVAS_DEC_VoIP_GetSamples( hIvasDec, nOutSamples, IVAS_DEC_PCM_INT16, (void *) pcmBuf, &bitstreamReadDone, &nSamplesRendered, &parameterAvailableForEditing, systemTime_ms ) ) != IVAS_ERR_OK )
#endif
+6 −2
Original line number Diff line number Diff line
@@ -42,9 +42,12 @@
#include "wmc_auto.h"

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
/*---------------------------------------------------------------------*
 * CLDFB ring-buffer functions needed in split-rendering outputs
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*
 * CLDFB_RINGBUF_IsEmpty()
 * ivas_CLDFB_RINGBUF_IsEmpty()
 *
 * Returns 1 if the ring buffer is empty, or 0 otherwise.
 *---------------------------------------------------------------------*/
@@ -55,8 +58,9 @@ static int16_t ivas_CLDFB_RINGBUF_IsEmpty(
    return (int16_t) ( h->read_pos == h->write_pos && !h->is_full );
}


/*---------------------------------------------------------------------*
 * CLDFB_RINGBUF_IsFull()
 * ivas_CLDFB_RINGBUF_IsFull()
 *
 * Returns 1 if the ring buffer is full, or 0 otherwise.
 *---------------------------------------------------------------------*/
+21 −5
Original line number Diff line number Diff line
@@ -4011,6 +4011,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples
ivas_error IVAS_DEC_VoIP_GetSamples(
    IVAS_DEC_HANDLE hIvasDec,        /* i/o: IVAS decoder handle                                                     */
    uint16_t nSamplesPerChannel,     /* i  : number of samples per channel requested to be written to output buffer  */
    const IVAS_DEC_PCM_TYPE pcmType, /* i  : type for the decoded PCM resolution                                     */
    void *pcmBuf,                    /* o  : output synthesis signal                                                 */
#ifdef SUPPORT_JBM_TRACEFILE
    JbmTraceFileWriterFn jbmWriterFn,
@@ -4025,7 +4026,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
    return ivas_dec_voip_get_samples_common(
        hIvasDec,
        nSamplesPerChannel,
        IVAS_DEC_PCM_INT16,
        pcmType,
        pcmBuf,
        NULL,
        NULL,
@@ -4039,10 +4040,17 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
        systemTimestamp_ms );
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_VoIP_GetSplitBinauralBitstream( )
 *
 * Main function to decode one split-rendering frame in VoIP 
 *---------------------------------------------------------------------*/

/*! r: error code */
ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream(
    IVAS_DEC_HANDLE hIvasDec,                 /* i/o: IVAS decoder handle                                                     */
    uint16_t nSamplesPerChannel,              /* i  : number of samples per channel requested to be written to output buffer  */
    /* const IVAS_DEC_PCM_TYPE pcmType, */    /* i  : type for the decoded PCM resolution                                     */
    void *pcmBuf,                             /* o  : output synthesis signal                                                 */
    ISAR_SPLIT_REND_BITS_DATA *splitRendBits, /* o  : output split rendering bits                                             */
#ifdef SUPPORT_JBM_TRACEFILE
@@ -4058,6 +4066,14 @@ ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream(
    int16_t i;
    float head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES][L_FRAME48k];
    float *pp_head_pose_buf[BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES];
    ivas_error error = IVAS_ERR_UNKNOWN;
    int16_t nSamplesPerChannel = 0;

    if ( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nSamplesPerChannel ) ) != IVAS_ERR_OK )
    {
        fprintf( stderr, "\nError getting render frame size in samples\n" );
        return error;
    }

    /* Set pointers to beginning of head pose buffers */
    for ( i = 0; i < BINAURAL_CHANNELS * MAX_HEAD_ROT_POSES; ++i )
+1 −3
Original line number Diff line number Diff line
@@ -311,9 +311,7 @@ ivas_error IVAS_DEC_TSM_SetQuality(
ivas_error IVAS_DEC_VoIP_GetSamples(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    uint16_t nSamplesPerChannel,                /* i  : number of samples per channel requested to be written to output buffer  */
#ifndef FIX_1119_SPLIT_RENDERING_VOIP
    const IVAS_DEC_PCM_TYPE pcmType,            /* i  : type for the decoded PCM resolution                                     */
#endif
    void *pcmBuf,                               /* o  : output synthesis signal                                                 */
#ifdef SUPPORT_JBM_TRACEFILE
    JbmTraceFileWriterFn jbmWriterFn,
@@ -329,7 +327,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples(
/*! r: error code */
ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    uint16_t nSamplesPerChannel,                /* i  : number of samples per channel requested to be written to output buffer  */
    /* const IVAS_DEC_PCM_TYPE pcmType, */      /* i  : type for the decoded PCM resolution                                     */
    void *pcmBuf,                               /* o  : output synthesis signal                                                 */
    ISAR_SPLIT_REND_BITS_DATA *splitRendBits,   /* o  : output split rendering bits                                             */
#ifdef SUPPORT_JBM_TRACEFILE
+2 −11
Original line number Diff line number Diff line
@@ -796,11 +796,7 @@ static void ivas_dirac_dec_binaural_internal(
            for ( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe]; i++ )
            {
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                ivas_CLDFB_RINGBUF_Push(
                    st_ivas->hSplitBinRend->hMultiBinCldfbData[ch],
                    tmp_Cldfb_out_re[ch][i],
                    tmp_Cldfb_out_im[ch][i],
                    CLDFB_NO_CHANNELS_MAX );
                ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[ch], tmp_Cldfb_out_re[ch][i], tmp_Cldfb_out_im[ch][i], CLDFB_NO_CHANNELS_MAX );
#else
                mvr2r( tmp_Cldfb_out_re[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX );
                mvr2r( tmp_Cldfb_out_im[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX );
@@ -861,7 +857,6 @@ static void ivas_dirac_dec_binaural_internal(
                                                                       hCombinedOrientationData && hCombinedOrientationData->enableCombinedOrientation[subframe] > 0,
                                                                       nchanSeparateChannels, st_ivas->hMasaIsmData );


                /* re-use reverb and decorr from main direction for the sides */
                ivas_dirac_dec_binaural_process_output( hDiracDecBin, hSpatParamRendCom, st_ivas->cldfbSynDec, output_f, Cldfb_RealBuffer_in, Cldfb_ImagBuffer_in,
                                                        max_band_decorr, numInChannels, config_data.processReverb, subframe, tmp_Cldfb_out_re, tmp_Cldfb_out_im,
@@ -873,11 +868,7 @@ static void ivas_dirac_dec_binaural_internal(
                    for ( i = 0; i < hSpatParamRendCom->subframe_nbslots[subframe]; i++ )
                    {
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                        ivas_CLDFB_RINGBUF_Push(
                            st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch],
                            tmp_Cldfb_out_re[ch][i],
                            tmp_Cldfb_out_im[ch][i],
                            CLDFB_NO_CHANNELS_MAX );
                        ivas_CLDFB_RINGBUF_Push( st_ivas->hSplitBinRend->hMultiBinCldfbData[pos_idx * BINAURAL_CHANNELS + ch], tmp_Cldfb_out_re[ch][i], tmp_Cldfb_out_im[ch][i], CLDFB_NO_CHANNELS_MAX );
#else
                        mvr2r( tmp_Cldfb_out_re[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_RealBuffer_Binaural[pos_idx * BINAURAL_CHANNELS + ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX );
                        mvr2r( tmp_Cldfb_out_im[ch][i], st_ivas->hSplitBinRend->hMultiBinCldfbData->Cldfb_ImagBuffer_Binaural[pos_idx * BINAURAL_CHANNELS + ch][hSpatParamRendCom->slots_rendered + i], CLDFB_NO_CHANNELS_MAX );