Loading apps/decoder.c +35 −7 Original line number Diff line number Diff line Loading @@ -1942,6 +1942,9 @@ static ivas_error initOnFirstGoodFrame( #endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t isSplitRend, isSplitCoded; #endif ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ Loading @@ -1952,7 +1955,19 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } if ( isSplitRend ) { pFullDelayNumSamples[0] = 0; } Loading @@ -1979,7 +1994,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; Loading Loading @@ -2008,7 +2023,7 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) ) if ( isSplitCoded ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) Loading Loading @@ -2040,7 +2055,7 @@ static ivas_error initOnFirstGoodFrame( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif /* Open audio writer and write all previously skipped bad frames now that frame size is known */ Loading Loading @@ -2278,6 +2293,19 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; #ifdef SPLIT_REND_WITH_HEAD_ROT SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } #endif #ifdef FIX_1053_REVERB_RECONFIGURATION Loading Loading @@ -2601,7 +2629,7 @@ static ivas_error decodeG192( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { Loading Loading @@ -2681,7 +2709,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { Loading @@ -2690,7 +2718,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif if ( delayNumSamples < nOutSamples ) Loading lib_dec/ivas_jbm_dec.c +3 −4 Original line number Diff line number Diff line Loading @@ -1827,12 +1827,11 @@ ivas_error ivas_jbm_dec_flush_renderer( #ifdef DEBUGGING st_ivas->noClipping += #endif ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, #ifdef SPLIT_REND_WITH_HEAD_ROT (int16_t *) ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (int16_t *) data ); #else ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, data ); #endif data ); #ifdef SPLIT_REND_WITH_HEAD_ROT break; case PCM_FLOAT32: Loading lib_dec/lib_dec.c +20 −21 Original line number Diff line number Diff line Loading @@ -1147,7 +1147,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numSamplesPerChannelToDecode *= (int16_t) st_ivas->hDecoderConfig->render_framesize; } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) == 0 ) if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig->split_rend_config.dof ) == 0 ) { return IVAS_ERR_WRONG_PARAMS; } Loading Loading @@ -3540,6 +3540,7 @@ static ivas_error evs_dec_main( st_ivas->noClipping += #endif ivas_syn_output( p_output, nOutSamples, st_ivas->hDecoderConfig->nchan_out, pcm_buf_local ); mvs2r( pcm_buf_local, floatBuf, nOutSamples * st_ivas->hDecoderConfig->nchan_out ); } else Loading Loading @@ -4099,28 +4100,24 @@ static void ivas_destroy_handle_isar( * *---------------------------------------------------------------------*/ /*! r: flag to indicate if split rendering is enabled */ int16_t IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitRend /* o : flag to indicate if split rendering is enabled */ ) { Decoder_Struct *st_ivas; int16_t isSplitRend; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hRenderConfig == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } st_ivas = hIvasDec->st_ivas; isSplitRend = 0; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) { isSplitRend = 1; } *isSplitRend = is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig->split_rend_config.dof ); return isSplitRend; return IVAS_ERR_OK; } Loading Loading @@ -4308,27 +4305,29 @@ static ivas_error ivas_dec_init_split_rend( * *---------------------------------------------------------------------*/ /*! r: flag to indicate if split rendering coded output is enabled */ int16_t IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitCoded /* o : flag to indicate if split rendering is enabled */ ) { Decoder_Struct *st_ivas; int16_t isSplitCoded; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hRenderConfig == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } st_ivas = hIvasDec->st_ivas; isSplitCoded = 0; *isSplitCoded = 0; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) { isSplitCoded = 1; *isSplitCoded = 1; } return isSplitCoded; return IVAS_ERR_OK; } #endif lib_dec/lib_dec.h +8 −6 Original line number Diff line number Diff line Loading @@ -200,14 +200,16 @@ ivas_error IVAS_DEC_GetCldfbSamples( int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ ); /*! r: flag to indicate if split rendering is enabled */ int16_t IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec /* i : IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitRend /* o : flag to indicate if split rendering is enabled */ ); /*! r: flag to indicate if split rendering coded output is enabled */ int16_t IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitCoded /* o : flag to indicate if split rendering is enabled */ ); #endif Loading lib_rend/ivas_output_init.c +26 −0 Original line number Diff line number Diff line Loading @@ -466,3 +466,29 @@ ivas_error ivas_output_buff_dec( return IVAS_ERR_OK; } #ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * is_split_rendering_enabled() * * *---------------------------------------------------------------------*/ /*! r: flag to indicate if split rendering is enabled */ int16_t is_split_rendering_enabled( const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ const int16_t dof /* i : flag to specify if pose correction is needed */ ) { if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->Opt_non_diegetic_pan && dof == 0 ) ) { return 1; } else { return 0; } } #endif Loading
apps/decoder.c +35 −7 Original line number Diff line number Diff line Loading @@ -1942,6 +1942,9 @@ static ivas_error initOnFirstGoodFrame( #endif ) { #ifdef SPLIT_REND_WITH_HEAD_ROT int16_t isSplitRend, isSplitCoded; #endif ivas_error error = IVAS_ERR_UNKNOWN; /* Now delay, number of output channels and frame size are known */ Loading @@ -1952,7 +1955,19 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } if ( isSplitRend ) { pFullDelayNumSamples[0] = 0; } Loading @@ -1979,7 +1994,7 @@ static ivas_error initOnFirstGoodFrame( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { /* Open split rendering metadata writer */ int16_t delayNumSamples_temp[3]; Loading Loading @@ -2008,7 +2023,7 @@ static ivas_error initOnFirstGoodFrame( return error; } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) ) if ( isSplitCoded ) { #ifdef ISAR_BITSTREAM_UPDATE_LC3PLUS if ( ( error = split_rend_writer_open( splitRendWriter, arg.outputWavFilename, delayNumSamples_temp[0], delayTimeScale_temp, splitRendCodec, poseCorrection, splitRendCodecFrameSizeMs, splitRendIsarFrameSizeMs, arg.output_Fs, lc3plusHighRes ) ) != IVAS_ERR_OK ) Loading Loading @@ -2040,7 +2055,7 @@ static ivas_error initOnFirstGoodFrame( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif /* Open audio writer and write all previously skipped bad frames now that frame size is known */ Loading Loading @@ -2278,6 +2293,19 @@ static ivas_error decodeG192( int16_t vec_pos_update, vec_pos_len; #ifdef SPLIT_REND_WITH_HEAD_ROT SplitFileReadWrite *splitRendWriter = NULL; int16_t isSplitRend, isSplitCoded; if ( ( error = IVAS_DEC_is_split_rendering_enabled( hIvasDec, &isSplitRend ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_enabled, code: %d\n", error ); return error; } if ( ( error = IVAS_DEC_is_split_rendering_coded_out( hIvasDec, &isSplitCoded ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_is_split_rendering_coded_out, code: %d\n", error ); return error; } #endif #ifdef FIX_1053_REVERB_RECONFIGURATION Loading Loading @@ -2601,7 +2629,7 @@ static ivas_error decodeG192( } #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( ( error = IVAS_DEC_GetSplitBinauralBitstream( hIvasDec, (void *) ( pcmBuf + nOutChannels * nSamplesRendered ), splitRendBits, &nSamplesRendered_loop, &needNewFrame ) ) != IVAS_ERR_OK ) { Loading Loading @@ -2681,7 +2709,7 @@ static ivas_error decodeG192( if ( decodedGoodFrame ) { #ifdef SPLIT_REND_WITH_HEAD_ROT if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) ) if ( isSplitRend ) { if ( split_rend_write_bitstream_to_file( splitRendWriter, splitRendBits->bits_buf, &splitRendBits->bits_read, &splitRendBits->bits_written ) != IVAS_ERR_OK ) { Loading @@ -2690,7 +2718,7 @@ static ivas_error decodeG192( } } if ( IVAS_DEC_is_split_rendering_coded_out( hIvasDec ) == 0 ) if ( !isSplitCoded ) { #endif if ( delayNumSamples < nOutSamples ) Loading
lib_dec/ivas_jbm_dec.c +3 −4 Original line number Diff line number Diff line Loading @@ -1827,12 +1827,11 @@ ivas_error ivas_jbm_dec_flush_renderer( #ifdef DEBUGGING st_ivas->noClipping += #endif ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, #ifdef SPLIT_REND_WITH_HEAD_ROT (int16_t *) ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, (int16_t *) data ); #else ivas_syn_output( p_output, *nSamplesRendered, st_ivas->hDecoderConfig->nchan_out, data ); #endif data ); #ifdef SPLIT_REND_WITH_HEAD_ROT break; case PCM_FLOAT32: Loading
lib_dec/lib_dec.c +20 −21 Original line number Diff line number Diff line Loading @@ -1147,7 +1147,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream( numSamplesPerChannelToDecode *= (int16_t) st_ivas->hDecoderConfig->render_framesize; } if ( IVAS_DEC_is_split_rendering_enabled( hIvasDec ) == 0 ) if ( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig->split_rend_config.dof ) == 0 ) { return IVAS_ERR_WRONG_PARAMS; } Loading Loading @@ -3540,6 +3540,7 @@ static ivas_error evs_dec_main( st_ivas->noClipping += #endif ivas_syn_output( p_output, nOutSamples, st_ivas->hDecoderConfig->nchan_out, pcm_buf_local ); mvs2r( pcm_buf_local, floatBuf, nOutSamples * st_ivas->hDecoderConfig->nchan_out ); } else Loading Loading @@ -4099,28 +4100,24 @@ static void ivas_destroy_handle_isar( * *---------------------------------------------------------------------*/ /*! r: flag to indicate if split rendering is enabled */ int16_t IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitRend /* o : flag to indicate if split rendering is enabled */ ) { Decoder_Struct *st_ivas; int16_t isSplitRend; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hRenderConfig == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } st_ivas = hIvasDec->st_ivas; isSplitRend = 0; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) { isSplitRend = 1; } *isSplitRend = is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig->split_rend_config.dof ); return isSplitRend; return IVAS_ERR_OK; } Loading Loading @@ -4308,27 +4305,29 @@ static ivas_error ivas_dec_init_split_rend( * *---------------------------------------------------------------------*/ /*! r: flag to indicate if split rendering coded output is enabled */ int16_t IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitCoded /* o : flag to indicate if split rendering is enabled */ ) { Decoder_Struct *st_ivas; int16_t isSplitCoded; if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL ) if ( hIvasDec == NULL || hIvasDec->st_ivas == NULL || hIvasDec->st_ivas->hRenderConfig == NULL ) { return IVAS_ERR_UNEXPECTED_NULL_POINTER; } st_ivas = hIvasDec->st_ivas; isSplitCoded = 0; *isSplitCoded = 0; if ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && st_ivas->hDecoderConfig->Opt_non_diegetic_pan && st_ivas->hRenderConfig->split_rend_config.dof == 0 ) ) { isSplitCoded = 1; *isSplitCoded = 1; } return isSplitCoded; return IVAS_ERR_OK; } #endif
lib_dec/lib_dec.h +8 −6 Original line number Diff line number Diff line Loading @@ -200,14 +200,16 @@ ivas_error IVAS_DEC_GetCldfbSamples( int16_t *nOutSamples /* o : number of samples per channel written to output buffer */ ); /*! r: flag to indicate if split rendering is enabled */ int16_t IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec /* i : IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_enabled( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitRend /* o : flag to indicate if split rendering is enabled */ ); /*! r: flag to indicate if split rendering coded output is enabled */ int16_t IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec /* i/o: IVAS decoder handle */ /*! r: decoder error code */ ivas_error IVAS_DEC_is_split_rendering_coded_out( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ int16_t *isSplitCoded /* o : flag to indicate if split rendering is enabled */ ); #endif Loading
lib_rend/ivas_output_init.c +26 −0 Original line number Diff line number Diff line Loading @@ -466,3 +466,29 @@ ivas_error ivas_output_buff_dec( return IVAS_ERR_OK; } #ifdef SPLIT_REND_WITH_HEAD_ROT /*---------------------------------------------------------------------* * is_split_rendering_enabled() * * *---------------------------------------------------------------------*/ /*! r: flag to indicate if split rendering is enabled */ int16_t is_split_rendering_enabled( const DECODER_CONFIG_HANDLE hDecoderConfig, /* i : configuration structure */ const int16_t dof /* i : flag to specify if pose correction is needed */ ) { if ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_CODED || hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM || ( hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_STEREO && hDecoderConfig->Opt_non_diegetic_pan && dof == 0 ) ) { return 1; } else { return 0; } } #endif