diff --git a/Workspace_msvc/lib_com.vcxproj b/Workspace_msvc/lib_com.vcxproj index d11b9087ee8167fc0c476be9c0122e0b5c3c5d7d..1081724287c50a9cfdbee4ec27bcf278dd2e8c42 100644 --- a/Workspace_msvc/lib_com.vcxproj +++ b/Workspace_msvc/lib_com.vcxproj @@ -308,4 +308,4 @@ - + \ No newline at end of file diff --git a/apps/encoder.c b/apps/encoder.c index b00f4f75fdc85f3dc72e6ad1a0a9568e70e2a60d..8ca293719fcf4b18dd81923b1649c4c16fd59b89 100644 --- a/apps/encoder.c +++ b/apps/encoder.c @@ -131,6 +131,9 @@ typedef struct const char *ca_config_file; bool mimeOutput; IVAS_ENC_COMPLEXITY_LEVEL complexityLevel; +#ifdef NONBE_FIX_ISM_XOVER_BR + bool lbr_disc_obj; +#endif #ifdef DEBUGGING IVAS_ENC_FORCED_MODE forcedMode; const char *forcedModeFile; @@ -431,7 +434,13 @@ int main( } break; case IVAS_ENC_INPUT_SBA_ISM: - if ( ( error = IVAS_ENC_ConfigureForSBAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba_ism.numObjects, arg.inputFormatConfig.sba_ism.order, arg.inputFormatConfig.sba_ism.isPlanar, arg.pca ) ) != IVAS_ERR_OK ) + if ( ( error = IVAS_ENC_ConfigureForSBAObjects( hIvasEnc, arg.inputFs, totalBitrate, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba_ism.numObjects, arg.inputFormatConfig.sba_ism.order, arg.inputFormatConfig.sba_ism.isPlanar, arg.pca +#ifdef NONBE_FIX_ISM_XOVER_BR + , + arg.lbr_disc_obj +#endif + + ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_ConfigureForSBAObjects failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); exit( -1 ); @@ -882,6 +891,9 @@ static void initArgStruct( EncArguments *arg ) arg->is_binaural = false; arg->inputFormatConfig.stereoToMonoDownmix = false; arg->max_bwidth_user = false; +#ifdef NONBE_FIX_ISM_XOVER_BR + arg->lbr_disc_obj = false; +#endif arg->maxBandwidth = IVAS_ENC_BANDWIDTH_UNDEFINED; arg->bandwithProfileFile = NULL; arg->dtxConfig = IVAS_ENC_GetDefaultDtxConfig(); @@ -1183,6 +1195,14 @@ static bool parseCmdlIVAS_enc( } } +#ifdef NONBE_FIX_ISM_XOVER_BR + else if ( strcmp( argv_to_upper, "-LBR_DISC_OBJ" ) == 0 ) + { + arg->lbr_disc_obj = true; + fprintf( stdout, "Encoding objects separately\n" ); + ++i; + } +#endif /*-----------------------------------------------------------------* * MIME output file format *-----------------------------------------------------------------*/ diff --git a/lib_com/ivas_cnst.h b/lib_com/ivas_cnst.h index 4960db4712d21ea43b05909befe931db6481ec88..a23d3105d30dbbb09be841bd8531619f43258e9e 100755 --- a/lib_com/ivas_cnst.h +++ b/lib_com/ivas_cnst.h @@ -1150,6 +1150,9 @@ enum #define MASA_TRANSP_BITS 1 #define NO_BITS_MASA_ISM_NO_OBJ 2 +#ifdef NONBE_FIX_ISM_XOVER_BR +#define NO_BITS_SBA_ISM_NO_OBJ 3 +#endif #define MASA2TOTAL_THR 0.98f #define BITS_MASA2TOTTAL_DCT0 6 #define STEP_M2T 0.1f diff --git a/lib_com/ivas_prot.h b/lib_com/ivas_prot.h index 0902af55301ed2963861d8bc94d602a795667af1..26f049920eae60cf044a8bf83da20d5e70d2523f 100755 --- a/lib_com/ivas_prot.h +++ b/lib_com/ivas_prot.h @@ -3016,6 +3016,11 @@ void ivas_mct_core_enc( const int16_t switch_bw, /* i : flag bandwidth switch occurance */ const int16_t lfe_bits, /* i : bits spent for LFE */ const int16_t sba_order /* i : Ambisonic (SBA) order */ +#ifdef NONBE_FIX_ISM_XOVER_BR + , + const int16_t nchan_ism, /* i : number of input ISM's */ + const int16_t lbr_disc_obj /* i : flag to enable discrete objects ats bitrates < 256 kbps */ +#endif ); void ivas_mdct_quant_coder( @@ -5619,6 +5624,13 @@ void ivas_osba_data_close( SBA_ISM_DATA_HANDLE *hSbaIsmData /* i/o: OSBA rendering handle */ ); +#ifdef NONBE_FIX_ISM_XOVER_BR +int16_t ivas_osba_ism_mode_select( + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t nchan_ism, /* i : number of input ISM's */ + const int16_t lbr_disc_obj /* i : flag to enable discrete objects at BRs lower than 256 kbps */ +); +#endif /*----------------------------------------------------------------------------------* * OMASA prototypes diff --git a/lib_com/options.h b/lib_com/options.h index 6e9f3d7710b7e2b0f06a5a7622e2ba97f5bd9260..773fff235512ea27c5d2ce752913c41491c197e5 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -168,10 +168,14 @@ /* any switch which is non-be wrt selection floating point code */ /* all switches in this category should start with "NONBE_" */ + +#define NONBE_FIX_ISM_XOVER_BR /* FhG: select coding method for OSBA ojects depending on the number of objects and bitrate */ + #define NONBE_FIX_987_PARAMC_BINAURAL_REVERB_RENDERING /* FhG: issue 987: solution b: downmix HOA3 to stereo a input for the reverberator */ #define NONBE_FIX_1006_PAST_DMX_NRG_ERROR /* Eri/FhG: Issue 1006: Bug fix in ivas_stereo_dft_dec not replicated in ivas_stereo_dft_dec_dmx */ #define NONBE_FIX_1010_STEREO_CNG_DIV_BY_ZERO /* Eri: Issue 1010: Division by zero in Stereo CNG */ + /* ##################### End NON-BE switches ########################### */ /* ################## End DEVELOPMENT switches ######################### */ diff --git a/lib_dec/ivas_init_dec.c b/lib_dec/ivas_init_dec.c index b92dc19ded7ef196f99d67780c825c4ed31b047b..9c41e749650ff22c76cd45e30ecf41a88e416905 100644 --- a/lib_dec/ivas_init_dec.c +++ b/lib_dec/ivas_init_dec.c @@ -465,10 +465,23 @@ ivas_error ivas_dec_setup( } else if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { + +#ifdef NONBE_FIX_ISM_XOVER_BR + st_ivas->osba_mode_bit = st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 1]; +#endif + /* the number of objects is written at the end of the bitstream, in the SBA metadata */ +#ifdef NONBE_FIX_ISM_XOVER_BR + st_ivas->nchan_ism = 2 * st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 2] + st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 3] + 1; +#else st_ivas->nchan_ism = 2 * st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 1] + st_ivas->bit_stream[ivas_total_brate / FRAMES_PER_SEC - 2] + 1; +#endif +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( ivas_total_brate < IVAS_24k4 || st_ivas->osba_mode_bit ) +#else if ( ivas_total_brate < IVAS_24k4 || ivas_total_brate >= IVAS_256k ) +#endif { /* read Ambisonic (SBA) planar flag */ st_ivas->sba_planar = st_ivas->bit_stream[num_bits_read]; @@ -480,7 +493,11 @@ ivas_error ivas_dec_setup( num_bits_read += SBA_ORDER_BITS; /* read Ambisonic (SBA) order */ +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( !st_ivas->osba_mode_bit ) +#else if ( ivas_total_brate < IVAS_256k ) +#endif { st_ivas->sba_order = 3; } @@ -506,11 +523,23 @@ ivas_error ivas_dec_setup( /*correct number of CPEs for discrete ISM coding*/ if ( st_ivas->ini_frame > 0 && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n; + + n = st_ivas->nchan_transport + st_ivas->nchan_ism; + st_ivas->nCPE = ( n / 2 ) + ( n % 2 ); + } +#else st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; +#endif } } - +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( st_ivas->osba_mode_bit ) +#else if ( ivas_total_brate >= IVAS_256k ) +#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -1587,7 +1616,16 @@ ivas_error ivas_init_decoder( if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n_all; + + n_all = st_ivas->nchan_transport + st_ivas->nchan_ism; + st_ivas->nCPE = ( n_all / 2 ) + ( n_all % 2 ); + } +#else st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; +#endif st_ivas->element_mode_init = IVAS_CPE_MDCT; } diff --git a/lib_dec/ivas_ism_metadata_dec.c b/lib_dec/ivas_ism_metadata_dec.c index a6f145d6b579251f5ebe3b9151e79ebc55202100..027f23c4ac5dd4d6d0992a96d889a98993b8e89e 100644 --- a/lib_dec/ivas_ism_metadata_dec.c +++ b/lib_dec/ivas_ism_metadata_dec.c @@ -208,7 +208,7 @@ ivas_error ivas_ism_metadata_dec( if ( ism_mode == ISM_SBA_MODE_DISC ) { /* number of objects was read in ivas_dec_setup() */ - st0->next_bit_pos += NO_BITS_MASA_ISM_NO_OBJ; + st0->next_bit_pos += NO_BITS_SBA_ISM_NO_OBJ; } else if ( ism_mode != ISM_MASA_MODE_DISC && ism_mode != ISM_MASA_MODE_MASA_ONE_OBJ ) { diff --git a/lib_dec/ivas_jbm_dec.c b/lib_dec/ivas_jbm_dec.c index c7ad64a60afbba35711ec1cc73babb9a64489e9f..ad2f56c5d12d098813b9b77e325edc4e450aacfe 100644 --- a/lib_dec/ivas_jbm_dec.c +++ b/lib_dec/ivas_jbm_dec.c @@ -433,7 +433,7 @@ ivas_error ivas_jbm_dec_tc( } else { - nb_bits_metadata[1] += NO_BITS_MASA_ISM_NO_OBJ; + nb_bits_metadata[1] += NO_BITS_SBA_ISM_NO_OBJ; sba_ch_idx = 0; } diff --git a/lib_dec/ivas_sba_dec.c b/lib_dec/ivas_sba_dec.c index af102dd96e23b38bb32d0f3491da4104a056bc15..8a5939d4aad3d374c4d8485ce0636267c9d1beeb 100644 --- a/lib_dec/ivas_sba_dec.c +++ b/lib_dec/ivas_sba_dec.c @@ -143,7 +143,11 @@ ivas_error ivas_sba_dec_reconfigure( if ( st_ivas->ivas_format == SBA_ISM_FORMAT ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( st_ivas->osba_mode_bit ) +#else if ( ivas_total_brate >= IVAS_256k ) +#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -511,7 +515,16 @@ ivas_error ivas_sba_dec_reconfigure( return error; } +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n_all; + + n_all = st_ivas->nchan_transport + st_ivas->nchan_ism; + st_ivas->nCPE = ( n_all / 2 ) + ( n_all % 2 ); + } +#else st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; +#endif } else if ( ism_mode_old == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -534,7 +547,16 @@ ivas_error ivas_sba_dec_reconfigure( } else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n_all; + + n_all = st_ivas->nchan_transport + st_ivas->nchan_ism; + st_ivas->nCPE = ( n_all / 2 ) + ( n_all % 2 ); + } +#else st_ivas->nCPE += ( st_ivas->nchan_ism + 1 ) >> 1; +#endif nCPE_old = st_ivas->nCPE; nchan_transport_old = st_ivas->nchan_transport; nchan_transport_old += st_ivas->nchan_ism; diff --git a/lib_dec/ivas_stat_dec.h b/lib_dec/ivas_stat_dec.h index 4deb6748e23019654759c758b08596e121c0d95b..0a954431cacc0f38b5f4d054b03662c5d5342bcf 100644 --- a/lib_dec/ivas_stat_dec.h +++ b/lib_dec/ivas_stat_dec.h @@ -1102,6 +1102,9 @@ typedef struct Decoder_Struct int16_t sba_planar; /* Ambisonic (SBA) planar flag */ int16_t sba_analysis_order; /* Ambisonic (SBA) order used for analysis and coding */ int16_t sba_dirac_stereo_flag; /* flag indicating stereo output for SBA DirAC modes with 1 TC */ +#ifdef NONBE_FIX_ISM_XOVER_BR + int16_t osba_mode_bit; +#endif /* rendering modules */ RENDERER_TYPE renderer_type; /* renderer type */ diff --git a/lib_enc/ivas_init_enc.c b/lib_enc/ivas_init_enc.c index a394f1609011619c4f1f25eea95279f8646622f2..c62b26fbe34f6b6969f1e53561939759099ccc83 100644 --- a/lib_enc/ivas_init_enc.c +++ b/lib_enc/ivas_init_enc.c @@ -674,7 +674,11 @@ ivas_error ivas_init_encoder( { st_ivas->ism_mode = ISM_MODE_NONE; +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism, st_ivas->hEncoderConfig->lbr_disc_obj ) ) +#else if ( ivas_total_brate >= IVAS_256k ) +#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -732,8 +736,16 @@ ivas_error ivas_init_encoder( else { /* allocate and initialize MCT core coder */ - st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n_all; + n_all = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; + st_ivas->nCPE = ( n_all / 2 ) + ( n_all % 2 ); + } +#else + st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; +#endif for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) { if ( ( error = create_cpe_enc( st_ivas, cpe_id, ( ivas_total_brate / st_ivas->nchan_transport ) * CPE_CHANNELS ) ) != IVAS_ERR_OK ) diff --git a/lib_enc/ivas_mct_core_enc.c b/lib_enc/ivas_mct_core_enc.c index 8705d94c64ab5562916c9ce9cdf7c63b27919ac6..2420b91889b3d72dd7ed46b8498b99c418eef32f 100644 --- a/lib_enc/ivas_mct_core_enc.c +++ b/lib_enc/ivas_mct_core_enc.c @@ -191,6 +191,11 @@ void ivas_mct_core_enc( const int16_t switch_bw, /* i : flag bandwidth switch occurance */ const int16_t lfe_bits, /* i : bits spent for LFE */ const int16_t sba_order /* i : Ambisonic (SBA) order */ +#ifdef NONBE_FIX_ISM_XOVER_BR + , + const int16_t nchan_ism, /* i : number of input ISM's */ + const int16_t lbr_disc_obj /* i : flag to enable discrete objects ats bitrates < 256 kbps */ +#endif ) { int16_t ch, ch_core, nSubframes, L_subframeTCX; @@ -497,7 +502,11 @@ void ivas_mct_core_enc( { nAvailBits -= IVAS_FORMAT_SIGNALING_NBITS_EXTENDED; nAvailBits -= SBA_ORDER_BITS + SBA_PLANAR_BITS; +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( ivas_format == SBA_ISM_FORMAT && ( ivas_osba_ism_mode_select( ivas_total_brate, nchan_ism, lbr_disc_obj ) || ivas_total_brate < IVAS_24k4 ) ) +#else if ( ivas_format == SBA_ISM_FORMAT && nChannels > 4 ) +#endif { nAvailBits -= IVAS_COMBINED_FORMAT_SIGNALLING_BITS; } diff --git a/lib_enc/ivas_mct_enc.c b/lib_enc/ivas_mct_enc.c index 83c5f57c17e46b72e685477ea354e87ab2e46207..c614242563258175ce4ae15b660ecdd19ad08d84 100755 --- a/lib_enc/ivas_mct_enc.c +++ b/lib_enc/ivas_mct_enc.c @@ -248,7 +248,13 @@ ivas_error ivas_mct_enc( } /* joint MCT encoding */ - ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE, ivas_total_brate, switch_bw, ( ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order ); + ivas_mct_core_enc( ivas_format, hMCT, st_ivas->hCPE, hMCT->nchan_out_woLFE, ivas_total_brate, switch_bw, ( ivas_format == MC_FORMAT && ( st_ivas->mc_mode == MC_MODE_MCT || st_ivas->mc_mode == MC_MODE_PARAMUPMIX ) ) ? (int16_t) st_ivas->hLFE->lfe_bits : 0, st_ivas->hEncoderConfig->sba_order +#ifdef NONBE_FIX_ISM_XOVER_BR + , + st_ivas->hEncoderConfig->nchan_ism, + st_ivas->hEncoderConfig->lbr_disc_obj +#endif + ); /* Spectrum quantization and coding */ for ( cpe_id = 0; cpe_id < st_ivas->nCPE; cpe_id++ ) diff --git a/lib_enc/ivas_osba_enc.c b/lib_enc/ivas_osba_enc.c index a2b857b9d8558a72b5bbc8ed74de1a8d864f9bcb..14e21c770631f59074ed45db15d5636f45460081 100644 --- a/lib_enc/ivas_osba_enc.c +++ b/lib_enc/ivas_osba_enc.c @@ -197,7 +197,11 @@ ivas_error ivas_osba_enc_reconfig( spar_reconfig_flag = 0; old_ism_mode = st_ivas->ism_mode; +#ifdef NONBE_FIX_ISM_XOVER_BR + if ( ivas_osba_ism_mode_select( ivas_total_brate, st_ivas->hEncoderConfig->nchan_ism, st_ivas->hEncoderConfig->lbr_disc_obj ) ) +#else if ( ivas_total_brate >= IVAS_256k ) +#endif { st_ivas->ism_mode = ISM_SBA_MODE_DISC; } @@ -336,7 +340,16 @@ ivas_error ivas_osba_enc_reconfig( if ( old_ism_mode == ISM_MODE_NONE && st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n_all; + + n_all = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; + st_ivas->nCPE = ( n_all / 2 ) + ( n_all % 2 ); + } +#else st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; +#endif } else if ( old_ism_mode == ISM_SBA_MODE_DISC && st_ivas->ism_mode == ISM_MODE_NONE ) { @@ -344,7 +357,16 @@ ivas_error ivas_osba_enc_reconfig( } else if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + { + int16_t n_all; + + n_all = st_ivas->nchan_transport + st_ivas->hEncoderConfig->nchan_ism; + st_ivas->nCPE = ( n_all / 2 ) + ( n_all % 2 ); + } +#else st_ivas->nCPE += ( st_ivas->hEncoderConfig->nchan_ism + 1 ) >> 1; +#endif nCPE_old = st_ivas->nCPE; nchan_transport_old = st_ivas->nchan_transport; nchan_transport_old += st_ivas->hEncoderConfig->nchan_ism; @@ -480,3 +502,51 @@ static void ivas_osba_render_ism_to_sba( return; } + +#ifdef NONBE_FIX_ISM_XOVER_BR +/*! r : ISM format mode */ +int16_t ivas_osba_ism_mode_select( + const int32_t ivas_total_brate, /* i : IVAS total bitrate */ + const int16_t nchan_ism, /* i : number of input ISM's */ + const int16_t lbr_disc_obj /* i : flag to enable discrete objects at BRs lower than 256 kbps */ +) +{ + int16_t ism_mode = 0; + + if ( !lbr_disc_obj && ivas_total_brate < IVAS_256k ) + { + return 0; + } + + switch ( nchan_ism ) + { + case 1: + if ( ivas_total_brate >= IVAS_96k ) + { + ism_mode = 1; + } + break; + case 2: + if ( ivas_total_brate >= IVAS_128k ) + { + ism_mode = 1; + } + break; + case 3: + if ( ivas_total_brate >= IVAS_128k ) + { + ism_mode = 1; + } + break; + case 4: + if ( ivas_total_brate >= IVAS_128k ) + { + ism_mode = 1; + } + break; + } + + return ism_mode; +} + +#endif diff --git a/lib_enc/ivas_spar_encoder.c b/lib_enc/ivas_spar_encoder.c index d3ff38062aa496c10ea462c3b966f7b876a9276e..54b6a6fd9006666138293e95f03dc41a5f43d319 100644 --- a/lib_enc/ivas_spar_encoder.c +++ b/lib_enc/ivas_spar_encoder.c @@ -366,8 +366,21 @@ ivas_error ivas_spar_enc( if ( hEncoderConfig->ivas_format == SBA_ISM_FORMAT ) { +#ifdef NONBE_FIX_ISM_XOVER_BR + int16_t i1; + + i1 = hEncoderConfig->nchan_ism - 1; + + if ( st_ivas->ism_mode == ISM_SBA_MODE_DISC ) + { + i1 |= ( 1 << 2 ); + } + /* write the number of objects in ISM_SBA format*/ - push_indice( hMetaData, IND_ISM_NUM_OBJECTS, hEncoderConfig->nchan_ism - 1, NO_BITS_MASA_ISM_NO_OBJ ); + push_indice( hMetaData, IND_ISM_NUM_OBJECTS, i1, NO_BITS_SBA_ISM_NO_OBJ ); +#else + push_indice( hMetaData, IND_ISM_NUM_OBJECTS, hEncoderConfig->nchan_ism, NO_BITS_SBA_ISM_NO_OBJ ); +#endif } /* front VAD */ diff --git a/lib_enc/ivas_stat_enc.h b/lib_enc/ivas_stat_enc.h index 3962ac055f232389b780a957c227cd5a3bd203be..b62a6d507dfc2792e920e1ce5d1729909937bbd8 100644 --- a/lib_enc/ivas_stat_enc.h +++ b/lib_enc/ivas_stat_enc.h @@ -1175,6 +1175,10 @@ typedef struct encoder_config_structure IVAS_FORMAT ivas_format; /* IVAS format */ int16_t is_binaural; /* flag indicating if input is binaural audio */ +#ifdef NONBE_FIX_ISM_XOVER_BR + int16_t lbr_disc_obj; +#endif + int16_t element_mode_init; /* element mode used at initialization */ int16_t stereo_dmx_evs; /* flag to indicate that stereo downmix for EVS encoder */ int16_t nchan_ism; /* number of ISM channels */ diff --git a/lib_enc/lib_enc.c b/lib_enc/lib_enc.c index 4a4be817345a9cedb37036c02ebdc5a9f0b66992..f3d4e3dc66d443aa2a34f9edea33d5f48893d046 100644 --- a/lib_enc/lib_enc.c +++ b/lib_enc/lib_enc.c @@ -548,6 +548,10 @@ ivas_error IVAS_ENC_ConfigureForSBAObjects( const IVAS_ENC_SBA_ORDER order, /* i : order of the Ambisonics input */ const bool isPlanar, /* i : if true, input is treated as planar Ambisonics */ const bool Opt_PCA_ON /* i : PCA option flag */ +#ifdef NONBE_FIX_ISM_XOVER_BR + , + const bool lbr_disc_obj /* i : Code objects separately in OSBA */ +#endif ) { Encoder_Struct *st_ivas; @@ -568,6 +572,10 @@ ivas_error IVAS_ENC_ConfigureForSBAObjects( st_ivas->hEncoderConfig->sba_planar = isPlanar; st_ivas->hEncoderConfig->sba_order = order; +#ifdef NONBE_FIX_ISM_XOVER_BR + st_ivas->hEncoderConfig->lbr_disc_obj = lbr_disc_obj; +#endif + /* Input in ACN/SN3D in all cases (3D and planar): get number of channels */ /*Input file will always contain all channels for a given order irrespective of planar flag*/ st_ivas->hEncoderConfig->nchan_inp = ivas_sba_get_nchan( st_ivas->hEncoderConfig->sba_order, 0 ) + numObjects; diff --git a/lib_enc/lib_enc.h b/lib_enc/lib_enc.h index 2f40c1ab1beda5b883618dbd755b2a68076989f0..bf116152eb2518e8f5f894fe526c6d4e18249529 100644 --- a/lib_enc/lib_enc.h +++ b/lib_enc/lib_enc.h @@ -223,6 +223,10 @@ ivas_error IVAS_ENC_ConfigureForSBAObjects( const IVAS_ENC_SBA_ORDER order, /* i : order of the Ambisonics input */ const bool isPlanar, /* i : if true, input is treated as planar Ambisonics */ const bool Opt_PCA_ON /* i : PCA option flag */ +#ifdef NONBE_FIX_ISM_XOVER_BR + , + const bool lbr_disc_obj /* i : Code objects separately in OSBA */ +#endif ); /*! r: error code */