Commit 0c0c9fd1 authored by Jouni Paulus's avatar Jouni Paulus
Browse files

remove code changes under switches FIX_WB_OMASA and FIX_ACELP_TABLE: these...

remove code changes under switches FIX_WB_OMASA and FIX_ACELP_TABLE: these will be provided separately.
parent 27df9a6c
Loading
Loading
Loading
Loading
Loading
+17 −45
Original line number Diff line number Diff line
@@ -394,9 +394,6 @@ static ivas_error acelp_FCB_allocator(
    int16_t nBits_tmp;
    int16_t *p_fixed_cdk_index;
    ivas_error error;
#ifdef FIX_ACELP_TABLE
    int16_t max_n;
#endif

    error = IVAS_ERR_OK;

@@ -427,31 +424,12 @@ static ivas_error acelp_FCB_allocator(
    }

    /* distribute the bit-budget equally between subframes */
#ifdef FIX_ACELP_TABLE
    if ( L_subfr > L_SUBFR ) /* access fast_FCB_bits_2sfr */
    {
        max_n = 6;
    }
    else
    {
        max_n = ACELP_FIXED_CDK_NB;
    }
    for ( cdbk = 0; cdbk < max_n; cdbk++ )
    {
        if ( fcb_table( cdbk, L_subfr ) * nb_subfr > *nBits )
        {
            break;
        }
    }
    cdbk--;
#else
    cdbk = 0;
    while ( fcb_table( cdbk, L_subfr ) * nb_subfr <= *nBits )
    {
        cdbk++;
    }
    cdbk--;
#endif

#ifdef DEBUGGING
    if ( cdbk < 0 && coder_type != TRANSITION )
@@ -475,10 +453,6 @@ static ivas_error acelp_FCB_allocator(
        nBits_tmp = 0;
    }
    *nBits -= nBits_tmp * nb_subfr;
#ifdef FIX_ACELP_TABLE
    if ( cdbk < ACELP_FIXED_CDK_NB - 1 )
    {
#endif
    /* try to increase the FCB bit-budget of the first subframe(s) */
    step = fcb_table( cdbk + 1, L_subfr ) - nBits_tmp;
    while ( *nBits >= step )
@@ -502,9 +476,7 @@ static ivas_error acelp_FCB_allocator(
            *nBits -= step;
        }
    }
#ifdef FIX_ACELP_TABLE
    }
#endif

    /* TRANSITION coding: allocate highest FCBQ bit-budget to the subframe with the glottal-shape codebook */
    if ( tc_subfr >= L_SUBFR )
    {
+0 −3
Original line number Diff line number Diff line
@@ -230,9 +230,6 @@
#define FIX_663_PARAM_ISM_EXT                           /* FhG: Issue 663: ParamISM EXT output improvement */
#define FIX_673_OMASA_OBJ_MD_SYNC                       /* Nokia: Fix issue 673 by updating metadata in the third subframe to account for audio delay. */

#define FIX_WB_OMASA                                    /* Nokia: fixes OMASA for WB input */
#define FIX_ACELP_TABLE                                 /* Nokia: fixes over-indexing in FCB ACELP in OMASA when the separated object is inactive  */

/* ################## End BE DEVELOPMENT switches ######################### */

/* #################### Start NON-BE CR switches ########################## */
+0 −48
Original line number Diff line number Diff line
@@ -3527,23 +3527,13 @@ static void ivas_encode_masaism_metadata(
    int16_t tmp, rotate;
    int16_t n_ism_tmp, i;
    OMASA_ENCODER_DATA_HANDLE hOmasaData = hMasa->data.hOmasaData;
#ifdef FIX_WB_OMASA
    int16_t nbands_work;
#endif

    /* use the values from hQMetaData */
    numCodingBands = (uint8_t) hQMetaData->q_direction->cfg.nbands;
    numSf = (int8_t) hQMetaData->q_direction->cfg.nblocks;
#ifdef FIX_WB_OMASA
    nbands_work = min( numCodingBands, omasa_nbands );
    if ( numCodingBands == 1 )
#else
    if ( numCodingBands != omasa_nbands )
#endif
    {
#ifndef FIX_WB_OMASA
        assert( numCodingBands == 1 );
#endif
        for ( sf = 0; sf < numSf; sf++ )
        {
            if ( sum_f( hOmasaData->energy_ism[sf], omasa_nbands ) == 0.0f )
@@ -3583,20 +3573,10 @@ static void ivas_encode_masaism_metadata(
            }
        }
    }
#ifdef FIX_WB_OMASA
    else if ( numSf == 1 )
#else
    else if ( numSf != omasa_nblocks )
#endif
    {
#ifndef FIX_WB_OMASA
        assert( numSf == 1 );
#endif
#ifdef FIX_WB_OMASA
        for ( band = 0; band < nbands_work; band++ )
#else
        for ( band = 0; band < numCodingBands; band++ )
#endif
        {
            energy_ism = 0.0f; /* ISM energy for current subband */
            for ( obj = 0; obj < nchan_ism; obj++ )
@@ -3636,28 +3616,12 @@ static void ivas_encode_masaism_metadata(
                hQMetaData->masa_to_total_energy_ratio[0][band] = eneBand / ( eneBand + energy_ism + EPSILON );
            }
        }

#ifdef FIX_WB_OMASA
        for ( band = nbands_work; band < numCodingBands; band++ )
        {
            hQMetaData->masa_to_total_energy_ratio[0][band] = 1.0f;

            for ( obj = 0; obj < nchan_ism; obj++ )
            {
                hOmasaData->energy_ratio_ism[0][band][obj] = hOmasaData->energy_ratio_ism[0][nbands_work - 1][obj];
            }
        }
#endif
    }
    else
    {
        for ( sf = 0; sf < numSf; sf++ )
        {
#ifdef FIX_WB_OMASA
            for ( band = 0; band < nbands_work; band++ )
#else
            for ( band = 0; band < numCodingBands; band++ )
#endif
            {
                if ( hOmasaData->energy_ism[sf][band] == 0.0f )
                {
@@ -3676,18 +3640,6 @@ static void ivas_encode_masaism_metadata(
                    hQMetaData->masa_to_total_energy_ratio[sf][band] = eneBand / ( eneBand + hOmasaData->energy_ism[sf][band] + EPSILON );
                }
            }

#ifdef FIX_WB_OMASA
            for ( band = nbands_work; band < numCodingBands; band++ )
            {
                hQMetaData->masa_to_total_energy_ratio[sf][band] = 1.0f;

                for ( obj = 0; obj < nchan_ism; obj++ )
                {
                    hOmasaData->energy_ratio_ism[sf][band][obj] = hOmasaData->energy_ratio_ism[sf][nbands_work - 1][obj];
                }
            }
#endif
        }
    }