Commit dc0c2d28 authored by vaclav's avatar vaclav
Browse files

fix split-rendering decoder

parent 1c2c2e4a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2548,6 +2548,16 @@ static ivas_error decodeG192(
                }

#ifdef MEM_ALLOC_APP_DEC
                /* setup ISAR */
                if ( isSplitRend )
                {
                    if ( ( error = IVAS_DEC_split_rend_setup( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK )
                    {
                        fprintf( stderr, "\nIVAS_DEC_split_rend_setup failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
                        goto cleanup;
                    }
                }

                /* Reconfigure IVAS decoder handles and reallocate the memory if IVAS total bitrate has changed */
#ifdef SPLIT_REND_WITH_HEAD_ROT
                if ( ( error = IVAS_DEC_Setup( hIvasDec, NULL, IVAS_DEC_PCM_INT16, pcmBuf + nSamplesRendered * nOutChannels ) ) != IVAS_ERR_OK )
+31 −0
Original line number Diff line number Diff line
@@ -1164,6 +1164,35 @@ ivas_error IVAS_DEC_GetSamples(


#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef MEM_ALLOC_APP_DEC
/*---------------------------------------------------------------------*
 * IVAS_DEC_split_rend_setup( )
 *
 *
 *---------------------------------------------------------------------*/
// VE: todo - this could be moved to isar_lib
ivas_error IVAS_DEC_split_rend_setup(
    IVAS_DEC_HANDLE hIvasDec,                /* i/o: IVAS decoder handle            */
    ISAR_SPLIT_REND_BITS_DATA *splitRendBits /* o  : output split rendering bits    */
)
{
    Decoder_Struct *st_ivas;
    ISAR_DEC_SPLIT_REND_WRAPPER_HANDLE hSplitBinRend;
    ivas_error error;

    st_ivas = hIvasDec->st_ivas;
    hSplitBinRend = st_ivas->hSplitBinRend;

    if ( ( error = isar_set_split_rend_setup( hSplitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hCombinedOrientationData, splitRendBits ) ) != IVAS_ERR_OK )
    {
        return error;
    }

    return error;
}

#endif

/*---------------------------------------------------------------------*
 * IVAS_DEC_GetSplitBinauralBitstream( )
 *
@@ -1206,12 +1235,14 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(

    *needNewFrame = false;
    hSplitBinRend = st_ivas->hSplitBinRend;
#ifndef MEM_ALLOC_APP_DEC

    if ( ( error = isar_set_split_rend_setup( hSplitBinRend, &st_ivas->hRenderConfig->split_rend_config, st_ivas->hCombinedOrientationData, splitRendBits ) ) != IVAS_ERR_OK )
    {
        return error;
    }

#endif
    numPoses = hSplitBinRend->splitrend.multiBinPoseData.num_poses;

    if ( st_ivas->hDecoderConfig->render_framesize != IVAS_RENDER_FRAMESIZE_20MS &&
+7 −0
Original line number Diff line number Diff line
@@ -185,6 +185,13 @@ ivas_error IVAS_DEC_GetSamples(
);

#ifdef SPLIT_REND_WITH_HEAD_ROT
#ifdef MEM_ALLOC_APP_DEC
ivas_error IVAS_DEC_split_rend_setup(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    ISAR_SPLIT_REND_BITS_DATA *splitRendBits    /* o  : output split rendering bits                                             */
);

#endif
ivas_error IVAS_DEC_GetSplitBinauralBitstream(
    IVAS_DEC_HANDLE hIvasDec,                   /* i/o: IVAS decoder handle                                                     */
    void *pcmBuf_out,                           /* o  : output synthesis signal for BINAURAL_SPLIT_PCM                          */