Commit 062deef1 authored by BOHMRR's avatar BOHMRR
Browse files

ORDER_BITS_ADDITION: added SBA planar and order bits for bitrates from 24.4 kbps to 192 kbps

parent 3d886cfc
Loading
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -1975,19 +1975,22 @@ ivas_error preview_indices(
        }
        else if ( st_ivas->ivas_format == SBA_FORMAT )
        {
#ifndef ORDER_BITS_ADDITION
            if ( ( st_ivas->sba_mode != SBA_MODE_SPAR ) || ( ( st_ivas->sba_mode == SBA_MODE_SPAR ) && ( total_brate >= IVAS_256k ) ) )
            {
#endif
                /* Read SBA planar flag and SBA order */
                st_ivas->sba_planar = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA] == 1 );
                st_ivas->sba_order = ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 2] == 1 );
                st_ivas->sba_order += 2 * ( bit_stream[IVAS_FORMAT_SIGNALING_NBITS_SBA + 1] == 1 );
#ifndef ORDER_BITS_ADDITION
            }
            else
            {
                st_ivas->sba_planar = 0;
                st_ivas->sba_order = 1;
            }

#endif
            ivas_sba_config( total_brate, st_ivas->sba_order, -1, &( st_ivas->nchan_transport ), st_ivas->sba_planar, &( st_ivas->nSCE ), &( st_ivas->nCPE ), &( st_ivas->element_mode_init ), st_ivas->sba_mode );
        }
    }
+4 −1
Original line number Diff line number Diff line
@@ -2586,8 +2586,11 @@ void ivas_mct_core_enc(
    const int16_t nChannels,                                    /* i  : number of channels to be coded      */
    const int32_t ivas_total_brate,                             /* i  : IVAS total bitrate                  */
    const int16_t switch_bw,                                    /* i  : flag bandwidth switch occurance     */
    const int16_t lfe_bits,                                     /* i  : bits spent for LFE                  */
    const int16_t lfe_bits                                      /* i  : bits spent for LFE                  */
#ifndef ORDER_BITS_ADDITION
    ,
    const SBA_MODE sba_mode                                     /* i  : SBA mode                            */
#endif
#ifdef FIX_I1_113
    ,
    const int16_t sba_order
+6 −1
Original line number Diff line number Diff line
@@ -903,7 +903,12 @@ const ivas_spar_br_table_t ivas_spar_br_table_consts[IVAS_SPAR_BR_TABLE_LEN] =
{
/* When AGC is ON additional (AGC_BITS_PER_CH+1) bits may be taken from each EVS channel
   so minimum EVS bitrate per channel can be min EVS bitrates as per the table - AGC_BITS_PER_CH */
    { 24400, 0, 1, FB, 24000, 1, WYXZ, 1, 0,{ { 16400, 15200, 24350 } },
    { 24400, 0, 1, FB, 24000, 1, WYXZ, 1, 0,
#ifndef ORDER_BITS_ADDITION
    { { 16400, 15200, 24350 } },
#else
    { { 16400, 14850, 24350 } },
#endif
    { { 15, 1, 5, 1 },{ 15, 1, 3, 1 },{ 7, 1, 3, 1 } }, 0, 0, 0 },

    { 32000, 0, 1, FB, 24000, 1, WYXZ, 1, 0,{{ 24000, 20450, 31950 }},{ { 21, 1, 5, 1 },{ 15, 1, 5, 1 },{ 15, 1, 3, 1 } }, 0, 0, 0 },
+8 −6
Original line number Diff line number Diff line
@@ -2148,13 +2148,14 @@ void ivas_spar_set_bitrate_config(
        total_bits += ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][0] / FRAMES_PER_SEC );
        max_bits += ( int16_t )( ivas_spar_br_table_consts[table_idx].evs_brs[i][1] / FRAMES_PER_SEC );
    }
#ifndef ORDER_BITS_ADDITION
    if ( ivas_total_brate >= IVAS_256k )
    {
#endif
        pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - total_bits;

        pSpar_md_cfg->max_bits_per_blk = (int16_t) ( ivas_total_brate / FRAMES_PER_SEC ) - IVAS_FORMAT_SIGNALING_NBITS_SBA - SBA_PLANAR_BITS - SBA_ORDER_BITS - length - max_bits;

        // TODO : do this for lower bitrates as well once order/planar bits are added
        md_coding_bits_header = SPAR_NUM_CODING_STRAT_BITS + pSpar_md_cfg->quant_strat_bits;
        pSpar_md_cfg->tgt_bits_per_blk -= md_coding_bits_header;
        pSpar_md_cfg->max_bits_per_blk -= md_coding_bits_header;
@@ -2164,6 +2165,7 @@ void ivas_spar_set_bitrate_config(

        pSpar_md_cfg->tgt_bits_per_blk += md_coding_bits_header;
        pSpar_md_cfg->max_bits_per_blk += md_coding_bits_header;
#ifndef ORDER_BITS_ADDITION
    }
    else
    {
@@ -2174,7 +2176,7 @@ void ivas_spar_set_bitrate_config(
        pSpar_md_cfg->tgt_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->tgt_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS );
        pSpar_md_cfg->max_bits_per_blk = (int16_t) ceilf( ( 1.0f * pSpar_md_cfg->max_bits_per_blk * num_bands ) / IVAS_MAX_NUM_BANDS );
    }

#endif
    return;
}

+2 −0
Original line number Diff line number Diff line
@@ -151,6 +151,8 @@
#define SIMPLIFY_SBA_RENDERING_LOGIC                    /* SBA rendering maintenance related to ticket #45 */
#define SBA_CLEANING                                    /* SBA maintenance related to ticket #45 */ 

#define ORDER_BITS_ADDITION                             /* Adding order and planar bits to more spar bitrates */

#define DIRAC_DRCT_GAIN_TUNING

#define FIX_34                                          /* Nokia: Fix bug in MASA format EXT output spherical indexing */
Loading