Commit 038ca4d2 authored by gaoyuy's avatar gaoyuy
Browse files

Update ivas sba mp 768kbps

parent 2e2e08be
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -215,6 +215,7 @@
    <ClCompile Include="..\lib_enc\ivas_lfe_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_mc_param_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_mp_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_mp_metadata_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_pca_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_range_uni_enc.c" />
    <ClCompile Include="..\lib_enc\ivas_spar_encoder.c" />
+3 −0
Original line number Diff line number Diff line
@@ -590,6 +590,9 @@
    <ClCompile Include="..\lib_enc\ivas_mp_enc.c">
      <Filter>enc_ivas_c</Filter>
    </ClCompile>
    <ClCompile Include="..\lib_enc\ivas_mp_metadata_enc.c">
      <Filter>enc_ivas_c</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="..\lib_enc\ivas_stat_enc.h">
+6 −3
Original line number Diff line number Diff line
@@ -1155,6 +1155,7 @@ typedef enum
#define MP_DELAY_ENC_NS                         1000000L
#define MP_DIRAC_DELAY_CMP_ENC_NS               500000L
#define MP_OVERLAP_5MS_NS                       5000000L
#define MP_PROJ_ENC_NS                          2000000L

#define MP_CHANNELS_ZOA                         MP_ORDER2CH( SBA_FOA_ORDER - 1 )
#define MP_CHANNELS_FOA                         MP_ORDER2CH( SBA_FOA_ORDER )
@@ -1164,11 +1165,10 @@ typedef enum
#define MP_MAX_CHANNELS                         MAX_INPUT_CHANNELS
#define MP_MAX_CHANNELS_TRANSPORT               MP_CHANNELS_HOA2
#define MP_MAX_NBANDS                           DIRAC_MAX_NBANDS
#define MP_VL_NBANDS                            45
#define MP_DELAY_PARAM_DEC_SFR                  1
#define MP_MAX_AVERG_ENERGY_SLOTS               32
#define MP_MAX_AVERG_DIRS                       10
#define MP_MAX_GROUP_TRANSPORT_CFG              ( 3 * 4 )
#define MP_MAX_GROUP_TRANSPORT_CFG              3
#define MP_MAX_GROUP_TRANSPORT                  2

#define MP_MIN_DIRECTIONS                       2
@@ -1194,14 +1194,17 @@ typedef enum
#define MP_FLC_MODE                             1
#define MP_MIN_Q_GAIN                           -75.f
#define MP_MAX_Q_GAIN                           15.f
#define MP_MAX_GAIN_LIMIT                       5.47722578f             
#define MP_DELTA_Q_GAIN                         0.1f
#define MP_MAX_HUFFMAN_BITS                     20
#define MP_Q_GAIN_TABLE_SIZE                    ( ( 15 + 1 ) * 2)
#define MP_DIFF_HUFFMAN_SIZE                    ( 2 * MP_Q_GAIN_TABLE_SIZE - 1 )
#define MP_MAX_HUFFMAN_GROUP                    19
#define MP_MAX_HUFFMAN_GROUP_CODEWORD           11
#define MP_HUFFMAN_CODEBOOK_OFFSET              2

#define MP_MAX_CHANNELS_DECORR                  4
#define MP_MAX_DECORR_CONFIG                    ( 3 * 4 )
#define MP_FREQ_DECORRELATION_COEFF             ( 0.282094777f )
#endif

/*----------------------------------------------------------------------------------*
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@
#define MIN_SAFETY_BITS_MC  5

#ifdef IVAS_SBA_MP_768KBPS
void splitAvailableBitsSBA(
void splitAvailableBitsMP(
    void **sts,                                  /* i/o: encoder/decoder state structure         */
    const int16_t total_bits,                    /* i  : total number of available bits          */
    const int16_t split_ratio[MCT_MAX_CHANNELS], /* i  : ratio for splitting the bits            */
+45 −4
Original line number Diff line number Diff line
@@ -209,9 +209,11 @@ void ivas_mp_config_open(
    const int16_t nchan_input,
    const int32_t total_bitrate,
    const int16_t sba_order_input,
    const int32_t sr )
    const int32_t sr,
    const int16_t enc_dec
)
{
    int16_t i;
    int16_t i, ch, ch_idx;

    hConfig->nchan_transport = ivas_mp_get_transport_channels( total_bitrate, sba_order_input );
    hConfig->nchan_reconstruction = nchan_input - hConfig->nchan_transport;
@@ -259,11 +261,29 @@ void ivas_mp_config_open(
        }
    }

    for ( ch_idx = 0, ch = 0; ch < nchan_input; ch++ )
    {
        if ( !ivas_mp_check_TCs_index( hConfig->transport_channels_map, ch, hConfig->nchan_transport ) )
        {
            hConfig->recovery_channels_map[ch_idx] = ch;
            ch_idx++;
        }
    }

    /* Huffman coding */
    hConfig->q_gain_table_size = MP_Q_GAIN_TABLE_SIZE;
    hConfig->q_gain_table = ivas_mp_q_gain_table;
    hConfig->huffman_codebook_table = ivas_diff_huffman_codebook_table;

    if ( enc_dec == ENC )
    {
        hConfig->huffman_codebook_table = ivas_mp_huffman_codebook_table;
        hConfig->huffman_codebook_table_size = 2 * MP_Q_GAIN_TABLE_SIZE - 1;
    }
    else
    {
        hConfig->nb_group_codebook = MP_MAX_HUFFMAN_GROUP;
        hConfig->huffman_codebook_model = ivas_mp_huffman_codebook_model;
    }

    return;
}
@@ -465,4 +485,25 @@ int16_t ivas_mp_check_TCs_index(
    return FALSE;
}

void ivas_mp_compute_reference_power(
    const float *real_part_buffer,
    const float *imag_part_buffer,
    int16_t *band_grouping,
    const int16_t nb_bands,
    float *reference_power_w )
{
    int16_t i, b;

    set_f( reference_power_w, 0.f, nb_bands );

    for ( b = 0; b < nb_bands; b++ )
    {
        for ( i = band_grouping[b]; i < band_grouping[b + 1]; i++ )
        {
            reference_power_w[b] += ( real_part_buffer[i] * real_part_buffer[i] ) + ( imag_part_buffer[i] * imag_part_buffer[i] );
        }
    }

    return;
}
#endif /* IVAS_SBA_MP_768KBPS */
 No newline at end of file
Loading