Commit fa408b98 authored by multrus's avatar multrus
Browse files

move max_bwidth_api from encoder_config_struct to IVAS_ENC-struct, rename to newBandwidthApi

parent 55a760d3
Loading
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -989,9 +989,6 @@ typedef struct encoder_config_structure
    int32_t input_Fs;                               /* input signal sampling frequency in Hz */
    int16_t nchan_inp;                              /* number of input audio channels */
    int16_t max_bwidth;                             /* maximum encoded bandwidth */
#ifdef FIX_I74_BW_LIMITATION_ALT
    int16_t max_bwidth_api;                         /* maximum encoded bandwidth, as set on API level */
#endif
    IVAS_FORMAT ivas_format;                        /* IVAS format */

    int16_t element_mode_init;                      /* element mode used at initialization */
+5 −2
Original line number Diff line number Diff line
@@ -64,6 +64,9 @@ struct IVAS_ENC
    int16_t rf_fec_offset_loc;
    bool ismMetadataProvided[MAX_NUM_OBJECTS];
    bool maxBandwidthUser; /* Was a specific max bandwith selected by the user? */
#ifdef FIX_I74_BW_LIMITATION_ALT
    IVAS_ENC_BANDWIDTH newBandwidthApi;                             /* maximum encoded bandwidth, as set on API level */
#endif
};

/*---------------------------------------------------------------------*
@@ -1853,7 +1856,7 @@ static ivas_error sanitizeBandwidth(

    hEncoderConfig = hIvasEnc->st_ivas->hEncoderConfig;

    max_bwidth_tmp = hEncoderConfig->max_bwidth_api;
    max_bwidth_tmp = hIvasEnc->newBandwidthApi;

    /* Prevent st_ivas->max_bwidth from being higher than Fs/2 */
    if ( hEncoderConfig->input_Fs == 8000 && max_bwidth_tmp > NB )
@@ -1956,7 +1959,7 @@ static ivas_error setBandwidth(
    }

#ifdef FIX_I74_BW_LIMITATION_ALT
    hEncoderConfig->max_bwidth_api = newBandwidth;
    hIvasEnc->newBandwidthApi = newBandwidth;
#endif

    /* NB coding not supported in IVAS. Switching to WB. */