Loading apps/encoder.c +17 −3 Original line number Diff line number Diff line Loading @@ -190,13 +190,19 @@ int main( /*------------------------------------------------------------------------------------------* * Open and initialize IVAS encoder *------------------------------------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED if ((error = IVAS_ENC_Open_fx(&hIvasEnc)) != IVAS_ERR_OK) { fprintf(stderr, "Opening IVAS encoder failed: %s\n", IVAS_ENC_GetErrorMessage(error)); goto cleanup; } #else if ( ( error = IVAS_ENC_Open( &hIvasEnc ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Opening IVAS encoder failed: %s\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; } #endif /*------------------------------------------------------------------------------------------* * Open output bitstream file *------------------------------------------------------------------------------------------*/ Loading Loading @@ -364,13 +370,21 @@ int main( } break; case IVAS_ENC_INPUT_SBA: #if 0 if ((error = IVAS_ENC_ConfigureForAmbisonics_fx(hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.pca)) != IVAS_ERR_OK) { fprintf(stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage(error)); goto cleanup; } #else if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.pca ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; } #endif break; case IVAS_ENC_INPUT_MASA: if ( ( error = IVAS_ENC_ConfigureForMasa( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masaVariant ) ) != IVAS_ERR_OK ) Loading lib_com/bits_alloc.c +13 −12 Original line number Diff line number Diff line Loading @@ -1428,6 +1428,7 @@ static int16_t allocate_unused( *--------------------------------------------------------------------*/ /*! r: ACELP16k flag */ #ifndef IVAS_FLOAT_FIXED int16_t set_ACELP_flag_IVAS( const int16_t element_mode, /* i : element mode */ Loading @@ -1439,49 +1440,49 @@ int16_t set_ACELP_flag_IVAS( const int16_t cng_type /* i : CNG type */ ) { if ( element_mode == IVAS_CPE_DFT && idchan == 0 && total_brate <= SID_2k40 && bwidth == WB && cng_type == LP_CNG ) IF ( EQ_16(element_mode, IVAS_CPE_DFT) && EQ_16(idchan, 0) && LE_32(total_brate, SID_2k40) && EQ_16(bwidth, WB) && EQ_16(cng_type, LP_CNG )) { return 1; } else if ( element_mode == IVAS_CPE_TD ) ELSE IF (EQ_16(element_mode, IVAS_CPE_TD )) { if ( element_brate >= IVAS_24k4 && idchan == 0 && ( tdm_LRTD_flag == 0 || element_brate > IVAS_24k4 ) ) IF ( GE_32(element_brate, IVAS_24k4) && EQ_16(idchan, 0) && (EQ_16(tdm_LRTD_flag, 0 )|| GT_32(element_brate, IVAS_24k4 )) ) { return 1; } else ELSE { return 0; } } else if ( element_mode == IVAS_CPE_DFT ) ELSE IF (EQ_16(element_mode, IVAS_CPE_DFT )) { if ( element_brate >= IVAS_24k4 ) IF (GE_32(element_brate, IVAS_24k4) ) { return 1; } else ELSE { return 0; } } else if ( element_mode == IVAS_SCE ) ELSE IF (EQ_16(element_mode, IVAS_SCE )) { if ( element_brate >= SCE_CORE_16k_LOW_LIMIT ) IF (GE_32(element_brate, SCE_CORE_16k_LOW_LIMIT )) { return 1; } else ELSE { return 0; } } else if ( total_brate >= ACELP_16k_LOW_LIMIT ) /* EVS_MONO */ ELSE IF (GE_32(total_brate, ACELP_16k_LOW_LIMIT) ) /* EVS_MONO */ { return 1; } else ELSE { return 0; } Loading lib_com/bitstream.c +452 −4 Original line number Diff line number Diff line Loading @@ -560,7 +560,276 @@ int16_t get_ivas_max_num_indices( return 2450; } Word16 get_ivas_max_num_indices_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word32 ivas_total_brate /* i : IVAS total bitrate */ ) { IF(EQ_16(ivas_format, STEREO_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 450; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 950; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1350; } ELSE { return 1650; } } ELSE IF(EQ_16(ivas_format, ISM_FORMAT) || EQ_16(ivas_format, MONO_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 250; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 350; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 450; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 550; } ELSE IF(LE_32(ivas_total_brate, IVAS_64k)) { return 620; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 670; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 780; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 880; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 950; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1100; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1300; } ELSE { return 1650; } } ELSE IF(EQ_16(ivas_format, SBA_FORMAT) || EQ_16(ivas_format, SBA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 250; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 350; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 1020; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 1160; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 1220; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1300; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1720; } ELSE { return 2000; } } ELSE IF(EQ_16(ivas_format, MASA_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 950; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1150; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1450; } ELSE { return 1650; } } ELSE IF(EQ_16(ivas_format, MASA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 1150; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 1250; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1400; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1650; } ELSE { return 1850; } } ELSE IF(EQ_16(ivas_format, MC_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 250; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 350; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_64k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 1150; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 1420; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 2120; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 2250; } ELSE { return 2450; } } return 2450; } /*-----------------------------------------------------------------------* * get_BWE_max_num_indices() * Loading Loading @@ -771,6 +1040,185 @@ int16_t get_ivas_max_num_indices_metadata( return 50; } Word16 get_ivas_max_num_indices_metadata_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word32 ivas_total_brate /* i : IVAS total bitrate */ ) { /* set the maximum required number of metadata indices */ IF(EQ_16(ivas_format, MONO_FORMAT)) { return 0; } ELSE IF(EQ_16(ivas_format, STEREO_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 60; } ELSE { return 80; } } ELSE IF(EQ_16(ivas_format, ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 20; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 65; } ELSE { return 80; } } ELSE IF(EQ_16(ivas_format, SBA_FORMAT) || EQ_16(ivas_format, SBA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 200; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 500; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1050; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 2000; } ELSE { return 2500; } } ELSE IF(EQ_16(ivas_format, MASA_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 80; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 125; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 205; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 240; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 305; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 425; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 630; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1000; } ELSE { return 1750; } } ELSE IF(EQ_16(ivas_format, MASA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 80; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 125 + 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 205 + 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 240 + 150; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 305 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 425 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 630 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 850 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1000 + 30; } ELSE { return 1750 + 30; } } ELSE IF(EQ_16(ivas_format, MC_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_13k2)) { return 80; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_64k)) { return 210; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 220; } ELSE { return 300; } } return 50; } /*-------------------------------------------------------------------* * move_indices() * Loading Loading @@ -1313,15 +1761,15 @@ uint16_t get_indice_1( void reset_indices_enc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t max_num_indices /* i : max number of indices */ const Word16 max_num_indices /* i : max number of indices */ ) { int16_t i; Word16 i; hBstr->nb_bits_tot = 0; hBstr->nb_ind_tot = 0; for ( i = 0; i < max_num_indices; i++ ) FOR ( i = 0; i < max_num_indices; i++ ) { hBstr->ind_list[i].nb_bits = -1; } Loading lib_com/common_api_types.h +2 −2 Original line number Diff line number Diff line Loading @@ -110,9 +110,9 @@ typedef enum _IVAS_ENC_FEC_INDICATOR typedef struct _IVAS_ENC_CHANNEL_AWARE_CONFIG { int16_t channelAwareModeEnabled; Word16 channelAwareModeEnabled; IVAS_ENC_FEC_INDICATOR fec_indicator; int16_t fec_offset; Word16 fec_offset; } IVAS_ENC_CHANNEL_AWARE_CONFIG; Loading lib_com/ivas_cnst.h +1 −0 Original line number Diff line number Diff line Loading @@ -569,6 +569,7 @@ typedef enum #define STEREO_DFT_BITDIFF_LP_FAC (0.06f) /* Low-pass filter coefficient for filtering bit difference between absolute and differential coding */ #define STEREO_DFT_BITDIFF_ABS_SELECT (0.8f) /* Constant to set tendency for selecting absolute coding mode */ #define STEREO_DFT_BITDIFF_INIT (12.0f) /* Init value for low-pass bit difference */ #define STEREO_DFT_BITDIFF_INIT_FX (12288) /* Init value for low-pass bit difference in Q10*/ #define STEREO_DFT_SIDE_GAIN_NBITS 5 #define STEREO_DFT_IPD_NBITS 3 Loading Loading
apps/encoder.c +17 −3 Original line number Diff line number Diff line Loading @@ -190,13 +190,19 @@ int main( /*------------------------------------------------------------------------------------------* * Open and initialize IVAS encoder *------------------------------------------------------------------------------------------*/ #ifdef IVAS_FLOAT_FIXED if ((error = IVAS_ENC_Open_fx(&hIvasEnc)) != IVAS_ERR_OK) { fprintf(stderr, "Opening IVAS encoder failed: %s\n", IVAS_ENC_GetErrorMessage(error)); goto cleanup; } #else if ( ( error = IVAS_ENC_Open( &hIvasEnc ) ) != IVAS_ERR_OK ) { fprintf( stderr, "Opening IVAS encoder failed: %s\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; } #endif /*------------------------------------------------------------------------------------------* * Open output bitstream file *------------------------------------------------------------------------------------------*/ Loading Loading @@ -364,13 +370,21 @@ int main( } break; case IVAS_ENC_INPUT_SBA: #if 0 if ((error = IVAS_ENC_ConfigureForAmbisonics_fx(hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.pca)) != IVAS_ERR_OK) { fprintf(stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage(error)); goto cleanup; } #else if ( ( error = IVAS_ENC_ConfigureForAmbisonics( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.sba.order, arg.inputFormatConfig.sba.isPlanar, arg.pca ) ) != IVAS_ERR_OK ) { fprintf( stderr, "\nIVAS_ENC_ConfigureForAmbisonics failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) ); goto cleanup; } #endif break; case IVAS_ENC_INPUT_MASA: if ( ( error = IVAS_ENC_ConfigureForMasa( hIvasEnc, arg.inputFs, totalBitrate, arg.max_bwidth_user, bandwidth, arg.dtxConfig, arg.inputFormatConfig.masaVariant ) ) != IVAS_ERR_OK ) Loading
lib_com/bits_alloc.c +13 −12 Original line number Diff line number Diff line Loading @@ -1428,6 +1428,7 @@ static int16_t allocate_unused( *--------------------------------------------------------------------*/ /*! r: ACELP16k flag */ #ifndef IVAS_FLOAT_FIXED int16_t set_ACELP_flag_IVAS( const int16_t element_mode, /* i : element mode */ Loading @@ -1439,49 +1440,49 @@ int16_t set_ACELP_flag_IVAS( const int16_t cng_type /* i : CNG type */ ) { if ( element_mode == IVAS_CPE_DFT && idchan == 0 && total_brate <= SID_2k40 && bwidth == WB && cng_type == LP_CNG ) IF ( EQ_16(element_mode, IVAS_CPE_DFT) && EQ_16(idchan, 0) && LE_32(total_brate, SID_2k40) && EQ_16(bwidth, WB) && EQ_16(cng_type, LP_CNG )) { return 1; } else if ( element_mode == IVAS_CPE_TD ) ELSE IF (EQ_16(element_mode, IVAS_CPE_TD )) { if ( element_brate >= IVAS_24k4 && idchan == 0 && ( tdm_LRTD_flag == 0 || element_brate > IVAS_24k4 ) ) IF ( GE_32(element_brate, IVAS_24k4) && EQ_16(idchan, 0) && (EQ_16(tdm_LRTD_flag, 0 )|| GT_32(element_brate, IVAS_24k4 )) ) { return 1; } else ELSE { return 0; } } else if ( element_mode == IVAS_CPE_DFT ) ELSE IF (EQ_16(element_mode, IVAS_CPE_DFT )) { if ( element_brate >= IVAS_24k4 ) IF (GE_32(element_brate, IVAS_24k4) ) { return 1; } else ELSE { return 0; } } else if ( element_mode == IVAS_SCE ) ELSE IF (EQ_16(element_mode, IVAS_SCE )) { if ( element_brate >= SCE_CORE_16k_LOW_LIMIT ) IF (GE_32(element_brate, SCE_CORE_16k_LOW_LIMIT )) { return 1; } else ELSE { return 0; } } else if ( total_brate >= ACELP_16k_LOW_LIMIT ) /* EVS_MONO */ ELSE IF (GE_32(total_brate, ACELP_16k_LOW_LIMIT) ) /* EVS_MONO */ { return 1; } else ELSE { return 0; } Loading
lib_com/bitstream.c +452 −4 Original line number Diff line number Diff line Loading @@ -560,7 +560,276 @@ int16_t get_ivas_max_num_indices( return 2450; } Word16 get_ivas_max_num_indices_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word32 ivas_total_brate /* i : IVAS total bitrate */ ) { IF(EQ_16(ivas_format, STEREO_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 450; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 950; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1350; } ELSE { return 1650; } } ELSE IF(EQ_16(ivas_format, ISM_FORMAT) || EQ_16(ivas_format, MONO_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 250; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 350; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 450; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 550; } ELSE IF(LE_32(ivas_total_brate, IVAS_64k)) { return 620; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 670; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 780; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 880; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 950; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1100; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1300; } ELSE { return 1650; } } ELSE IF(EQ_16(ivas_format, SBA_FORMAT) || EQ_16(ivas_format, SBA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 250; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 350; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 1020; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 1160; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 1220; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1300; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1720; } ELSE { return 2000; } } ELSE IF(EQ_16(ivas_format, MASA_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 950; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1150; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1450; } ELSE { return 1650; } } ELSE IF(EQ_16(ivas_format, MASA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 1150; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 1250; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1400; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1650; } ELSE { return 1850; } } ELSE IF(EQ_16(ivas_format, MC_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 250; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 350; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 400; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 650; } ELSE IF(LE_32(ivas_total_brate, IVAS_64k)) { return 750; } ELSE IF(LE_32(ivas_total_brate, IVAS_80k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 1150; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 1420; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 2120; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 2250; } ELSE { return 2450; } } return 2450; } /*-----------------------------------------------------------------------* * get_BWE_max_num_indices() * Loading Loading @@ -771,6 +1040,185 @@ int16_t get_ivas_max_num_indices_metadata( return 50; } Word16 get_ivas_max_num_indices_metadata_fx( const IVAS_FORMAT ivas_format, /* i : IVAS format */ const Word32 ivas_total_brate /* i : IVAS total bitrate */ ) { /* set the maximum required number of metadata indices */ IF(EQ_16(ivas_format, MONO_FORMAT)) { return 0; } ELSE IF(EQ_16(ivas_format, STEREO_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 60; } ELSE { return 80; } } ELSE IF(EQ_16(ivas_format, ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 20; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 65; } ELSE { return 80; } } ELSE IF(EQ_16(ivas_format, SBA_FORMAT) || EQ_16(ivas_format, SBA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 200; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 300; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 500; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 1050; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 2000; } ELSE { return 2500; } } ELSE IF(EQ_16(ivas_format, MASA_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 80; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 125; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 205; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 240; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 305; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 425; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 630; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 850; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1000; } ELSE { return 1750; } } ELSE IF(EQ_16(ivas_format, MASA_ISM_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_16k4)) { return 80; } ELSE IF(LE_32(ivas_total_brate, IVAS_32k)) { return 125 + 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_48k)) { return 205 + 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 240 + 150; } ELSE IF(LE_32(ivas_total_brate, IVAS_128k)) { return 305 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_160k)) { return 425 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_192k)) { return 630 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_256k)) { return 850 + 30; } ELSE IF(LE_32(ivas_total_brate, IVAS_384k)) { return 1000 + 30; } ELSE { return 1750 + 30; } } ELSE IF(EQ_16(ivas_format, MC_FORMAT)) { IF(LE_32(ivas_total_brate, IVAS_13k2)) { return 80; } ELSE IF(LE_32(ivas_total_brate, IVAS_24k4)) { return 100; } ELSE IF(LE_32(ivas_total_brate, IVAS_64k)) { return 210; } ELSE IF(LE_32(ivas_total_brate, IVAS_96k)) { return 220; } ELSE { return 300; } } return 50; } /*-------------------------------------------------------------------* * move_indices() * Loading Loading @@ -1313,15 +1761,15 @@ uint16_t get_indice_1( void reset_indices_enc( BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */ const int16_t max_num_indices /* i : max number of indices */ const Word16 max_num_indices /* i : max number of indices */ ) { int16_t i; Word16 i; hBstr->nb_bits_tot = 0; hBstr->nb_ind_tot = 0; for ( i = 0; i < max_num_indices; i++ ) FOR ( i = 0; i < max_num_indices; i++ ) { hBstr->ind_list[i].nb_bits = -1; } Loading
lib_com/common_api_types.h +2 −2 Original line number Diff line number Diff line Loading @@ -110,9 +110,9 @@ typedef enum _IVAS_ENC_FEC_INDICATOR typedef struct _IVAS_ENC_CHANNEL_AWARE_CONFIG { int16_t channelAwareModeEnabled; Word16 channelAwareModeEnabled; IVAS_ENC_FEC_INDICATOR fec_indicator; int16_t fec_offset; Word16 fec_offset; } IVAS_ENC_CHANNEL_AWARE_CONFIG; Loading
lib_com/ivas_cnst.h +1 −0 Original line number Diff line number Diff line Loading @@ -569,6 +569,7 @@ typedef enum #define STEREO_DFT_BITDIFF_LP_FAC (0.06f) /* Low-pass filter coefficient for filtering bit difference between absolute and differential coding */ #define STEREO_DFT_BITDIFF_ABS_SELECT (0.8f) /* Constant to set tendency for selecting absolute coding mode */ #define STEREO_DFT_BITDIFF_INIT (12.0f) /* Init value for low-pass bit difference */ #define STEREO_DFT_BITDIFF_INIT_FX (12288) /* Init value for low-pass bit difference in Q10*/ #define STEREO_DFT_SIDE_GAIN_NBITS 5 #define STEREO_DFT_IPD_NBITS 3 Loading