Commit e8d677c0 authored by fotopoulou's avatar fotopoulou
Browse files

create branch for contribution Low bitrate SBA Core Coder Tuning

parent ccef3d57
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -2157,6 +2157,10 @@ void splitAvailableBits(
    const int16_t split_ratio,                                  /* i  : split ratio                             */
    int16_t *bits_ch0,                                          /* o  : bits for channel 0                      */
    int16_t *bits_ch1                                           /* o  : bits for channel 1                      */
#ifdef LBR_SBA_CORE_CODING_TUNING
    ,
    const int16_t sba_mode                                      /* i  : signal core coding for sba              */
#endif
);

int16_t write_stereo_to_bitstream
@@ -2174,6 +2178,10 @@ void parse_stereo_from_bitstream(
    const int16_t mct_on,                                       /* i  : flag mct block (1) or stereo (0)        */
    Decoder_State *st0,                                         /* i/o: decoder state structure for Bstr        */
    int16_t ms_mask[NB_DIV][MAX_SFB]                            /* o  : bandwise MS mask                        */
#ifdef LBR_SBA_CORE_CODING_TUNING
    ,
    const int16_t sba_mode /* i: flag core coding for sba         */
#endif
);

void FindSplitRatio(
+16 −2
Original line number Diff line number Diff line
@@ -48,12 +48,26 @@ void splitAvailableBits(
    const int16_t split_ratio, /* i  : split ratio                           */
    int16_t *bits_ch0,         /* o  : bits for channel 0                    */
    int16_t *bits_ch1          /* o  : bits for channel 1                    */
#ifdef LBR_SBA_CORE_CODING_TUNING
    ,
    const int16_t sba_mode /* i  : signal core coding for sba            */
#endif
)
{
    assert( split_ratio >= 1 && split_ratio < SMDCT_BITRATE_RATIO_RANGE );

#ifdef LBR_SBA_CORE_CODING_TUNING
    *bits_ch0 = split_ratio * total_bits / SMDCT_BITRATE_RATIO_RANGE;
    /* for SBA mode bias the distribution towards the W channel */
    if ( split_ratio < 7 && sba_mode )
    {
        *bits_ch0 += (int16_t) ( 0.2 * *bits_ch0 );
    }
#else
    *bits_ch0 = split_ratio * total_bits / SMDCT_BITRATE_RATIO_RANGE;
    *bits_ch1 = total_bits + 0 - *bits_ch0;
#endif


    *bits_ch1 = total_bits - *bits_ch0;

    return;
}
+3 −2
Original line number Diff line number Diff line
@@ -60,14 +60,14 @@

/*#define MEM_COUNT_DETAILS*/                   /* RAM counting tool: print per sub-structure details */

/*#define DEBUG_MODE_INFO*/                     /* output most important parameters to the subdirectory "res/" */
//#define DEBUG_MODE_INFO                     /* output most important parameters to the subdirectory "res/" */
#ifdef DEBUG_MODE_INFO
/*#define DEBUG_MODE_ACELP*/                    /* output most important ACELP core parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_TCX*/                      /* output most important TCX core parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_DFT*/                      /* output most important DFT stereo parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_TD*/                       /* output most important TD stereo parameters to the subdirectory "res/ */
/*#define DEBUG_MODE_DIRAC*/                    /* output most important DIRAC parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_MDCT*/                     /* output most important MDCT parameters to the subdirectory "res/" */
#define DEBUG_MODE_MDCT                     /* output most important MDCT parameters to the subdirectory "res/" */
/*#define DEBUG_MODE_PARAM_MC */                /* output Parametric MC paramters to the subdirectory "res/" */
/*#define DEBUG_MODE_PARAM_ISM*/                /* output Parametric ISM paramters to the subdirectory "res/" */
#define DEBUG_MODE_INFO_TWEAK                   /* enable command line switch to specify subdirectory for debug info output inside "./res/" */
@@ -158,6 +158,7 @@
#define ORDER_BITS_ADDITION                             /* issue 14: Transmit SBA order and planar bits at all bitrates */


#define LBR_SBA_CORE_CODING_TUNING
/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
#endif
+12 −1
Original line number Diff line number Diff line
@@ -362,7 +362,12 @@ ivas_error ivas_cpe_dec(

    if ( hCPE->element_mode != IVAS_CPE_DFT || ( hCPE->nchan_out == 1 && hCPE->hStereoDft->hConfig->res_cod_mode == STEREO_DFT_RES_COD_OFF ) )
    {
        if ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) )
#ifndef LBR_SBA_CORE_CODING_TUNING
        if ( ( st_ivas->renderer_type == RENDERER_MC_PARAMMC && ( st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_MONO || st_ivas->hDecoderConfig->output_config == AUDIO_CONFIG_STEREO ) )
#ifdef LBR_SBA_CORE_CODING_TUNING
             || ( st_ivas->ivas_format == SBA_FORMAT && hCPE->element_brate == IVAS_48k )
#endif
        )
        {
            if ( ( error = ivas_core_dec( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB, NULL, 0 ) ) != IVAS_ERR_OK )
            {
@@ -376,6 +381,12 @@ ivas_error ivas_cpe_dec(
                return error;
            }
        }
#else
        if ( ( error = ivas_core_dec( st_ivas, NULL, hCPE, st_ivas->hMCT, n_channels, output, outputHB, NULL, 0 ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#endif
    }

    if ( st_ivas->hMCT )
+6 −1
Original line number Diff line number Diff line
@@ -147,7 +147,12 @@ void ivas_mct_dec_mct(
        p_st[0] = sts[hBlock->ch1];
        p_st[1] = sts[hBlock->ch2];

        parse_stereo_from_bitstream( hBlock->hStereoMdct, p_st, 1, sts[0], hBlock->mask );
        parse_stereo_from_bitstream( hBlock->hStereoMdct, p_st, 1, sts[0], hBlock->mask
#ifdef LBR_SBA_CORE_CODING_TUNING
                                     ,
                                     0
#endif
        );
    }

    return;
Loading