Loading apps/decoder.c +57 −1 Original line number Diff line number Diff line Loading @@ -144,7 +144,9 @@ typedef struct uint16_t acousticEnvironmentId; int16_t Opt_dpid_on; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; #ifdef ENABLE_OBJECT_EDITING bool objEditEnabled; #endif } DecArguments; Loading @@ -161,6 +163,10 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF #endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #ifdef ENABLE_OBJECT_EDITING static void exampleObjEditFun(IVAS_ISM_METADATA *obj_metas[IVAS_MAX_NUM_OBJECTS], uint16_t n_objs, bool* obj_modified_flag); #endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); Loading Loading @@ -1113,6 +1119,9 @@ static bool parseCmdlIVAS_dec( { arg->directivityPatternId[i] = 65535; } #ifdef ENABLE_OBJECT_EDITING arg->objEditEnabled = false; #endif /*-----------------------------------------------------------------* * Initialization Loading Loading @@ -1539,6 +1548,13 @@ static bool parseCmdlIVAS_dec( i += tmp; } #ifdef ENABLE_OBJECT_EDITING else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 ) { arg->objEditEnabled = true; i++; } #endif /*-----------------------------------------------------------------* * Option not recognized Loading Loading @@ -1740,6 +1756,9 @@ static void usage_dec( void ) fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef ENABLE_OBJECT_EDITING fprintf( stdout, "-obj_edit : enable object editing\n" ); #endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info <folder> : specify subfolder name for debug output\n" ); Loading Loading @@ -1937,6 +1956,16 @@ static ivas_error initOnFirstGoodFrame( free( zeroBuf ); #ifdef ENABLE_OBJECT_EDITING if ( arg.objEditEnabled ) { if ( ( error = IVAS_DEC_SetObjectEditCallback( hIvasDec, exampleObjEditFun ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_SetObjectEditCallback: %s\nContinuing without object editing.\n", IVAS_DEC_GetErrorMessage( error ) ); } } #endif /* Open other output files if EXT output config - now details about ISM or MASA are known */ if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading Loading @@ -3462,4 +3491,31 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( } #endif #ifdef ENABLE_OBJECT_EDITING /*---------------------------------------------------------------------* * exampleObjEditFun() * * An example object editing callback function *---------------------------------------------------------------------*/ static void exampleObjEditFun(IVAS_ISM_METADATA *obj_metas[IVAS_MAX_NUM_OBJECTS], uint16_t n_objs, bool* obj_modified_flag) { uint16_t obj_idx; for ( obj_idx = 0; obj_idx < n_objs; obj_idx++ ) { /* limit azimuth to the front */ if ( obj_metas[obj_idx]->azimuth > 90.0f ) { obj_metas[obj_idx]->azimuth = 90.0f; obj_modified_flag[obj_idx] = true; } else if ( obj_metas[obj_idx]->azimuth < -90.0f ) { obj_metas[obj_idx]->azimuth = -90.0f; obj_modified_flag[obj_idx] = true; } } } #endif #undef WMC_TOOL_SKIP lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,9 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define ENABLE_OBJECT_EDITING /* Nokia: development switch for object editing interface */ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ Loading lib_dec/ivas_ism_renderer.c +26 −0 Original line number Diff line number Diff line Loading @@ -549,14 +549,40 @@ void ivas_omasa_separate_object_render_jbm( if ( single_separated ) { #ifdef ENABLE_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->hMasaIsmData->ism_is_edited[st_ivas->hMasaIsmData->idx_separated_ism] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited[st_ivas->hMasaIsmData->idx_separated_ism]; elevation = st_ivas->hMasaIsmData->elevation_ism_edited[st_ivas->hMasaIsmData->idx_separated_ism]; } else { azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; } #else azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; #endif } else { #ifdef ENABLE_OBJECT_EDITING if ( st_ivas->hMasaIsmData->ism_is_edited[obj] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited[obj]; elevation = st_ivas->hMasaIsmData->elevation_ism_edited[obj]; } else { azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; } #else azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; #endif } if ( st_ivas->hOutSetup.is_planar_setup ) { Loading lib_dec/lib_dec.c +103 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,9 @@ struct IVAS_DEC int16_t sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ int16_t prev_ft_speech; /* RXDTX handler: previous frametype flag for G.192 format AMRWB SID_FIRST detection */ int16_t CNG; /* RXDTX handler: CNG=1, nonCNG=0 */ #ifdef ENABLE_OBJECT_EDITING IvasObjEditCallbackFn hObjectEditCallback; /* object editing callback function */ #endif }; Loading Loading @@ -180,6 +183,9 @@ ivas_error IVAS_DEC_Open( hIvasDec->amrwb_rfc4867_flag = -1; hIvasDec->prev_ft_speech = 1; /* RXDTX handler previous frametype flag for G.192 format AMRWB SID_FIRST detection */ hIvasDec->CNG = 0; /* RXDTX handler CNG = 1, no CNG = 0*/ #ifdef ENABLE_OBJECT_EDITING hIvasDec->hObjectEditCallback = NULL; #endif /*-----------------------------------------------------------------* * Initialize IVAS-codec decoder state Loading Loading @@ -971,6 +977,86 @@ ivas_error IVAS_DEC_GetSamples( nSamplesTcsScaled = hIvasDec->nSamplesFrame; } #ifdef ENABLE_OBJECT_EDITING if ( ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || ( hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT && hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) || ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT && ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) || ( hIvasDec->st_ivas->ivas_format == MASA_FORMAT && hIvasDec->st_ivas->nchan_ism > 0 ) ) && hIvasDec->hObjectEditCallback != NULL ) { uint16_t ism_idx; /* copy object metadata into a simplified structure for providing outside */ IVAS_ISM_METADATA IsmMetadata[IVAS_MAX_NUM_OBJECTS]; IVAS_ISM_METADATA* hIsmMetadata[IVAS_MAX_NUM_OBJECTS]; bool mod_flag[IVAS_MAX_NUM_OBJECTS]; for ( ism_idx = 0; ism_idx < IVAS_MAX_NUM_OBJECTS; ism_idx++ ) { mod_flag[ism_idx] = false; } for ( ism_idx = 0; ism_idx < hIvasDec->st_ivas->nchan_ism; ism_idx++ ) { hIsmMetadata[ism_idx] = &(IsmMetadata[ism_idx]); if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, hIsmMetadata[ism_idx], 0, ism_idx ) ) != IVAS_ERR_OK ) { return error; } } /* execute callback modifying the metadata */ hIvasDec->hObjectEditCallback(hIsmMetadata, hIvasDec->st_ivas->nchan_ism, mod_flag ); /* copy edited data from callback */ for ( ism_idx = 0; ism_idx < hIvasDec->st_ivas->nchan_ism; ism_idx++ ) { if ( mod_flag[ism_idx] ) { IVAS_ISM_METADATA* srcIsmMeta = hIsmMetadata[ism_idx]; ISM_METADATA_HANDLE destIsmMeta = hIvasDec->st_ivas->hIsmMetaData[ism_idx]; destIsmMeta->azimuth = srcIsmMeta->azimuth; destIsmMeta->elevation = srcIsmMeta->elevation; destIsmMeta->radius = srcIsmMeta->radius; destIsmMeta->yaw = srcIsmMeta->yaw; destIsmMeta->pitch = srcIsmMeta->pitch; destIsmMeta->non_diegetic_flag = srcIsmMeta->non_diegetic_flag; if ( hIvasDec->st_ivas->hMasaIsmData != NULL ) { if ( srcIsmMeta->azimuth > 0.0f ) { hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->azimuth + 0.5f ); } else { hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->azimuth - 0.5f ); } if ( srcIsmMeta->elevation > 0.0f ) { hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->elevation + 0.5f ); } else { hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->elevation - 0.5f ); } hIvasDec->st_ivas->hMasaIsmData->ism_is_edited[ism_idx] = 1u; hIvasDec->st_ivas->hMasaIsmData->objectsMoved = 1u; } } else { if ( hIvasDec->st_ivas->hMasaIsmData != NULL ) { /* reset modification flag */ hIvasDec->st_ivas->hMasaIsmData->ism_is_edited[ism_idx] = 0u; } } } } #endif /* Feed decoded transport channels samples to the renderer */ if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) { Loading Loading @@ -2249,6 +2335,23 @@ ivas_error IVAS_DEC_GetPcmFrameSize( return IVAS_ERR_OK; } #ifdef ENABLE_OBJECT_EDITING ivas_error IVAS_DEC_SetObjectEditCallback( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IvasObjEditCallbackFn callbackFn /* i : object editing callback function */ ) { if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) { hIvasDec->hObjectEditCallback = callbackFn; return IVAS_ERR_OK; } else { return IVAS_ERR_WRONG_MODE; } } #endif /*---------------------------------------------------------------------* * isSidFrame( ) Loading lib_dec/lib_dec.h +8 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,14 @@ void IVAS_DEC_PrintConfig( const bool voipMode ); #ifdef ENABLE_OBJECT_EDITING typedef void (*IvasObjEditCallbackFn)(IVAS_ISM_METADATA*[IVAS_MAX_NUM_OBJECTS], uint16_t, bool* ); ivas_error IVAS_DEC_SetObjectEditCallback( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IvasObjEditCallbackFn callbackFn /* i : object editing callback function */ ); #endif #ifdef DEBUGGING void IVAS_DEC_PrintConfigWithBitstream( IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ Loading Loading
apps/decoder.c +57 −1 Original line number Diff line number Diff line Loading @@ -144,7 +144,9 @@ typedef struct uint16_t acousticEnvironmentId; int16_t Opt_dpid_on; uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS]; #ifdef ENABLE_OBJECT_EDITING bool objEditEnabled; #endif } DecArguments; Loading @@ -161,6 +163,10 @@ static ivas_error decodeG192( DecArguments arg, BS_READER_HANDLE hBsReader, RotF #endif static ivas_error decodeVoIP( DecArguments arg, BS_READER_HANDLE hBsReader, RotFileReader *headRotReader, RotFileReader *externalOrientationFileReader, RotFileReader *refRotReader, Vector3PairFileReader *referenceVectorReader, IVAS_DEC_HANDLE hIvasDec ); #ifdef ENABLE_OBJECT_EDITING static void exampleObjEditFun(IVAS_ISM_METADATA *obj_metas[IVAS_MAX_NUM_OBJECTS], uint16_t n_objs, bool* obj_modified_flag); #endif #ifdef DEBUGGING static ivas_error printBitstreamInfoVoip( DecArguments arg, BS_READER_HANDLE hBsReader, IVAS_DEC_HANDLE hIvasDec ); static int16_t app_own_random( int16_t *seed ); Loading Loading @@ -1113,6 +1119,9 @@ static bool parseCmdlIVAS_dec( { arg->directivityPatternId[i] = 65535; } #ifdef ENABLE_OBJECT_EDITING arg->objEditEnabled = false; #endif /*-----------------------------------------------------------------* * Initialization Loading Loading @@ -1539,6 +1548,13 @@ static bool parseCmdlIVAS_dec( i += tmp; } #ifdef ENABLE_OBJECT_EDITING else if ( strcmp( argv_to_upper, "-OBJ_EDIT" ) == 0 ) { arg->objEditEnabled = true; i++; } #endif /*-----------------------------------------------------------------* * Option not recognized Loading Loading @@ -1740,6 +1756,9 @@ static void usage_dec( void ) fprintf( stdout, " Currently, all values default to level 3 (full functionality).\n" ); fprintf( stdout, "-q : Quiet mode, no frame counter\n" ); fprintf( stdout, " default is deactivated\n" ); #ifdef ENABLE_OBJECT_EDITING fprintf( stdout, "-obj_edit : enable object editing\n" ); #endif #ifdef DEBUG_MODE_INFO #ifdef DEBUG_MODE_INFO_TWEAK fprintf( stdout, "-info <folder> : specify subfolder name for debug output\n" ); Loading Loading @@ -1937,6 +1956,16 @@ static ivas_error initOnFirstGoodFrame( free( zeroBuf ); #ifdef ENABLE_OBJECT_EDITING if ( arg.objEditEnabled ) { if ( ( error = IVAS_DEC_SetObjectEditCallback( hIvasDec, exampleObjEditFun ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nError in IVAS_DEC_SetObjectEditCallback: %s\nContinuing without object editing.\n", IVAS_DEC_GetErrorMessage( error ) ); } } #endif /* Open other output files if EXT output config - now details about ISM or MASA are known */ if ( arg.outputConfig == IVAS_AUDIO_CONFIG_EXTERNAL ) { Loading Loading @@ -3462,4 +3491,31 @@ static IVAS_DEC_FORCED_REND_MODE parseForcedRendModeDec( } #endif #ifdef ENABLE_OBJECT_EDITING /*---------------------------------------------------------------------* * exampleObjEditFun() * * An example object editing callback function *---------------------------------------------------------------------*/ static void exampleObjEditFun(IVAS_ISM_METADATA *obj_metas[IVAS_MAX_NUM_OBJECTS], uint16_t n_objs, bool* obj_modified_flag) { uint16_t obj_idx; for ( obj_idx = 0; obj_idx < n_objs; obj_idx++ ) { /* limit azimuth to the front */ if ( obj_metas[obj_idx]->azimuth > 90.0f ) { obj_metas[obj_idx]->azimuth = 90.0f; obj_modified_flag[obj_idx] = true; } else if ( obj_metas[obj_idx]->azimuth < -90.0f ) { obj_metas[obj_idx]->azimuth = -90.0f; obj_modified_flag[obj_idx] = true; } } } #endif #undef WMC_TOOL_SKIP
lib_com/options.h +3 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,9 @@ #define FIX_963_USAN_ERROR /* Eri: Issue 963: USAN error in Stereo CNG, division by zero */ #define FIX_971_LOG2_IDX_GAIN_0 /* VA: prevent -Inf due to log2(ratio==0) */ #define ENABLE_OBJECT_EDITING /* Nokia: development switch for object editing interface */ /* #################### End BE switches ################################## */ /* #################### Start NON-BE switches ############################ */ Loading
lib_dec/ivas_ism_renderer.c +26 −0 Original line number Diff line number Diff line Loading @@ -549,14 +549,40 @@ void ivas_omasa_separate_object_render_jbm( if ( single_separated ) { #ifdef ENABLE_OBJECT_EDITING if ( st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ && st_ivas->hMasaIsmData->ism_is_edited[st_ivas->hMasaIsmData->idx_separated_ism] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited[st_ivas->hMasaIsmData->idx_separated_ism]; elevation = st_ivas->hMasaIsmData->elevation_ism_edited[st_ivas->hMasaIsmData->idx_separated_ism]; } else { azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; } #else azimuth = st_ivas->hMasaIsmData->azimuth_separated_ism[md_idx]; elevation = st_ivas->hMasaIsmData->elevation_separated_ism[md_idx]; #endif } else { #ifdef ENABLE_OBJECT_EDITING if ( st_ivas->hMasaIsmData->ism_is_edited[obj] ) { azimuth = st_ivas->hMasaIsmData->azimuth_ism_edited[obj]; elevation = st_ivas->hMasaIsmData->elevation_ism_edited[obj]; } else { azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; } #else azimuth = st_ivas->hMasaIsmData->azimuth_ism[obj][md_idx]; elevation = st_ivas->hMasaIsmData->elevation_ism[obj][md_idx]; #endif } if ( st_ivas->hOutSetup.is_planar_setup ) { Loading
lib_dec/lib_dec.c +103 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,9 @@ struct IVAS_DEC int16_t sdp_hf_only; /* RTP payload format parameter: only Header-Full format without zero padding for size collision avoidance */ int16_t prev_ft_speech; /* RXDTX handler: previous frametype flag for G.192 format AMRWB SID_FIRST detection */ int16_t CNG; /* RXDTX handler: CNG=1, nonCNG=0 */ #ifdef ENABLE_OBJECT_EDITING IvasObjEditCallbackFn hObjectEditCallback; /* object editing callback function */ #endif }; Loading Loading @@ -180,6 +183,9 @@ ivas_error IVAS_DEC_Open( hIvasDec->amrwb_rfc4867_flag = -1; hIvasDec->prev_ft_speech = 1; /* RXDTX handler previous frametype flag for G.192 format AMRWB SID_FIRST detection */ hIvasDec->CNG = 0; /* RXDTX handler CNG = 1, no CNG = 0*/ #ifdef ENABLE_OBJECT_EDITING hIvasDec->hObjectEditCallback = NULL; #endif /*-----------------------------------------------------------------* * Initialize IVAS-codec decoder state Loading Loading @@ -971,6 +977,86 @@ ivas_error IVAS_DEC_GetSamples( nSamplesTcsScaled = hIvasDec->nSamplesFrame; } #ifdef ENABLE_OBJECT_EDITING if ( ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || ( hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT && hIvasDec->st_ivas->ism_mode == ISM_SBA_MODE_DISC ) || ( hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT && ( hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_PARAM_ONE_OBJ || hIvasDec->st_ivas->ism_mode == ISM_MASA_MODE_DISC ) ) || ( hIvasDec->st_ivas->ivas_format == MASA_FORMAT && hIvasDec->st_ivas->nchan_ism > 0 ) ) && hIvasDec->hObjectEditCallback != NULL ) { uint16_t ism_idx; /* copy object metadata into a simplified structure for providing outside */ IVAS_ISM_METADATA IsmMetadata[IVAS_MAX_NUM_OBJECTS]; IVAS_ISM_METADATA* hIsmMetadata[IVAS_MAX_NUM_OBJECTS]; bool mod_flag[IVAS_MAX_NUM_OBJECTS]; for ( ism_idx = 0; ism_idx < IVAS_MAX_NUM_OBJECTS; ism_idx++ ) { mod_flag[ism_idx] = false; } for ( ism_idx = 0; ism_idx < hIvasDec->st_ivas->nchan_ism; ism_idx++ ) { hIsmMetadata[ism_idx] = &(IsmMetadata[ism_idx]); if ( ( error = IVAS_DEC_GetObjectMetadata( hIvasDec, hIsmMetadata[ism_idx], 0, ism_idx ) ) != IVAS_ERR_OK ) { return error; } } /* execute callback modifying the metadata */ hIvasDec->hObjectEditCallback(hIsmMetadata, hIvasDec->st_ivas->nchan_ism, mod_flag ); /* copy edited data from callback */ for ( ism_idx = 0; ism_idx < hIvasDec->st_ivas->nchan_ism; ism_idx++ ) { if ( mod_flag[ism_idx] ) { IVAS_ISM_METADATA* srcIsmMeta = hIsmMetadata[ism_idx]; ISM_METADATA_HANDLE destIsmMeta = hIvasDec->st_ivas->hIsmMetaData[ism_idx]; destIsmMeta->azimuth = srcIsmMeta->azimuth; destIsmMeta->elevation = srcIsmMeta->elevation; destIsmMeta->radius = srcIsmMeta->radius; destIsmMeta->yaw = srcIsmMeta->yaw; destIsmMeta->pitch = srcIsmMeta->pitch; destIsmMeta->non_diegetic_flag = srcIsmMeta->non_diegetic_flag; if ( hIvasDec->st_ivas->hMasaIsmData != NULL ) { if ( srcIsmMeta->azimuth > 0.0f ) { hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->azimuth + 0.5f ); } else { hIvasDec->st_ivas->hMasaIsmData->azimuth_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->azimuth - 0.5f ); } if ( srcIsmMeta->elevation > 0.0f ) { hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->elevation + 0.5f ); } else { hIvasDec->st_ivas->hMasaIsmData->elevation_ism_edited[ism_idx] = (int16_t) ( srcIsmMeta->elevation - 0.5f ); } hIvasDec->st_ivas->hMasaIsmData->ism_is_edited[ism_idx] = 1u; hIvasDec->st_ivas->hMasaIsmData->objectsMoved = 1u; } } else { if ( hIvasDec->st_ivas->hMasaIsmData != NULL ) { /* reset modification flag */ hIvasDec->st_ivas->hMasaIsmData->ism_is_edited[ism_idx] = 0u; } } } } #endif /* Feed decoded transport channels samples to the renderer */ if ( ( error = IVAS_DEC_RendererFeedTcSamples( hIvasDec, nSamplesTcsScaled, &nResidualSamples, hIvasDec->apaExecBuffer ) ) != IVAS_ERR_OK ) { Loading Loading @@ -2249,6 +2335,23 @@ ivas_error IVAS_DEC_GetPcmFrameSize( return IVAS_ERR_OK; } #ifdef ENABLE_OBJECT_EDITING ivas_error IVAS_DEC_SetObjectEditCallback( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IvasObjEditCallbackFn callbackFn /* i : object editing callback function */ ) { if ( hIvasDec->st_ivas->ivas_format == ISM_FORMAT || hIvasDec->st_ivas->ivas_format == SBA_ISM_FORMAT || hIvasDec->st_ivas->ivas_format == MASA_ISM_FORMAT ) { hIvasDec->hObjectEditCallback = callbackFn; return IVAS_ERR_OK; } else { return IVAS_ERR_WRONG_MODE; } } #endif /*---------------------------------------------------------------------* * isSidFrame( ) Loading
lib_dec/lib_dec.h +8 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,14 @@ void IVAS_DEC_PrintConfig( const bool voipMode ); #ifdef ENABLE_OBJECT_EDITING typedef void (*IvasObjEditCallbackFn)(IVAS_ISM_METADATA*[IVAS_MAX_NUM_OBJECTS], uint16_t, bool* ); ivas_error IVAS_DEC_SetObjectEditCallback( IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle */ IvasObjEditCallbackFn callbackFn /* i : object editing callback function */ ); #endif #ifdef DEBUGGING void IVAS_DEC_PrintConfigWithBitstream( IVAS_DEC_HANDLE hIvasDec, /* i : IVAS decoder handle */ Loading