Commit 37313e7f authored by bayers's avatar bayers
Browse files

set framesize always to 20ms for split rendering, add a warning if the asked...

set framesize always to 20ms for split rendering, add a warning if the asked frame size was different in this case, clang-format
parent 3cb937f0
Loading
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -466,11 +466,25 @@ int main(
#ifdef SPLIT_REND_WITH_HEAD_ROT
    if ( arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || arg.outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
    {
#ifdef REMOVE_5MS_FLAG
        IVAS_RENDER_FRAMESIZE asked_frame_size = arg.renderFramesize;
#endif
        if ( ( error = IVAS_DEC_EnableSplitRendering( hIvasDec ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
#ifdef REMOVE_5MS_FLAG
        if ( ( error = IVAS_DEC_GetRenderFramesize( hIvasDec, &arg.renderFramesize ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nConfigure failed: %s\n\n", IVAS_DEC_GetErrorMessage( error ) );
            goto cleanup;
        }
        if ( arg.renderFramesize != asked_frame_size )
        {
            fprintf( stderr, "\nChanged render framesize, only 20ms are allowed for split rendering!\n" );
        }
#endif

        arg.enableHeadRotation = true;
    }
+20 −2
Original line number Diff line number Diff line
@@ -126,6 +126,9 @@ static PCM_RESOLUTION pcm_type_API_to_internal( const IVAS_DEC_PCM_TYPE pcmType
static void *pcm_buffer_offset( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int32_t offset );
static ivas_error set_pcm_buffer_to_zero( void *buffer, const IVAS_DEC_PCM_TYPE pcmType, const int16_t nZeroSamples );
#endif
#ifdef REMOVE_5MS_FLAG
static int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize );
#endif


/*---------------------------------------------------------------------*
@@ -512,6 +515,8 @@ ivas_error IVAS_DEC_EnableSplitRendering(
    hDecoderConfig->Opt_Headrotation = 1;
#ifndef REMOVE_5MS_FLAG
    hDecoderConfig->Opt_5ms = false;
#else
    hDecoderConfig->render_framesize = IVAS_RENDER_FRAMESIZE_20MS;
#endif

    hDecoderConfig->Opt_Limiter = 0;
@@ -564,6 +569,17 @@ ivas_error IVAS_DEC_Get5msFlag(
    return IVAS_ERR_OK;
}
#else
/*---------------------------------------------------------------------*
 * get_render_framesize_ms( )
 *
 * Get the 5ms flag
 *---------------------------------------------------------------------*/

int16_t get_render_frame_size_ms( IVAS_RENDER_FRAMESIZE render_framesize )
{
    return (int16_t) ( render_framesize * ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) );
}

/*---------------------------------------------------------------------*
 * IVAS_DEC_SetRenderFramesize( )
 *
@@ -643,7 +659,7 @@ ivas_error IVAS_DEC_GetRenderFramesizeMs(
        return IVAS_ERR_UNEXPECTED_NULL_POINTER;
    }

    *render_framesize = (int16_t) ( hIvasDec->st_ivas->hDecoderConfig->render_framesize * ( 1000 / ( FRAMES_PER_SEC * IVAS_MAX_PARAM_SPATIAL_SUBFRAMES ) ) );
    *render_framesize = get_render_frame_size_ms( hIvasDec->st_ivas->hDecoderConfig->render_framesize );

    return IVAS_ERR_OK;
}
@@ -3111,7 +3127,9 @@ static ivas_error printConfigInfo_dec(

        get_channel_config( st_ivas->hDecoderConfig->output_config, &config_str[0] );
        fprintf( stdout, "Output configuration:   %s\n", config_str );

#ifdef REMOVE_5MS_FLAG
        fprintf( stdout, "Render framesize:       %dms\n", get_render_frame_size_ms( st_ivas->hDecoderConfig->render_framesize ) );
#endif
        if ( st_ivas->hDecoderConfig->Opt_HRTF_binary )
        {
            fprintf( stdout, "HRIR/BRIR file:         ON\n" );