Commit 2d927c83 authored by emerit's avatar emerit
Browse files

Merge branch 'main' into update_crend

parents 4ff08322 b210778c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ variables:
  SCRIPTS_DIR: "/usr/local/scripts"
  EXIT_CODE_NON_BE: 123
  EXIT_CODE_FAIL: 1
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection/test_param_file.py tests/renderer --param_file scripts/config/self_test_ltv.prm"
  LONG_TEST_SUITE: "tests/codec_be_on_mr_nonselection tests/renderer --param_file scripts/config/self_test_ltv.prm"
  SHORT_TEST_SUITE: "tests/codec_be_on_mr_nonselection"
  TEST_SUITE: ""
  DUT_ENCODER_PATH: "./IVAS_cod"
+3 −1
Original line number Diff line number Diff line
@@ -575,7 +575,7 @@ enum
#define FRAMES_PER_SEC                      50
#ifdef IVAS_FLOAT_FIXED
#define MAX_PARAM_SPATIAL_SUB_FRAMES_PER_SEC              200 //(FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES)
#define ONE_BY_FRAMES_PER_SEC               ((Word32)(0x028F5C29))
#define ONE_BY_FRAMES_PER_SEC_Q31           ((Word32)(0x028F5C29))
#define FRAMES_PER_SEC_BY_2                 (FRAMES_PER_SEC >> 1)
#endif
#define INV_FRAME_PER_SEC_Q15               656
@@ -1818,7 +1818,9 @@ typedef enum _DCTTYPE
#define CNA_INIT_NBANDS                     6

#define GAIN_Q_OFFSET_EVS 60.f
#define GAIN_Q_OFFSET_EVS_FX_Q0 60
#define GAIN_Q_OFFSET_IVAS 45.f
#define GAIN_Q_OFFSET_IVAS_FX_Q0 45

/*----------------------------------------------------------------------------------*
 * Bass post-filter constants
+8 −0
Original line number Diff line number Diff line
@@ -343,14 +343,22 @@ typedef enum
#define ISM_AZIMUTH_MAX_FX                      754974720
#define ISM_AZIMUTH_LOW_BORDER                  -140.0f
#define ISM_AZIMUTH_HIGH_BORDER                 135.0f
#define ISM_AZIMUTH_LOW_BORDER_FX               -587202560
#define ISM_AZIMUTH_HIGH_BORDER_FX              566231040

#define ISM_ELEVATION_NBITS                     6
#define ISM_ELEVATION_MIN                       -90.0f
#define ISM_ELEVATION_MAX                       90.0f
#define ISM_ELEVATION_MIN_FX                    -377487360
#define ISM_ELEVATION_MAX_FX                    377487360
#define ISM_ELEVATION_LOW_BORDER                -70.0f
#define ISM_ELEVATION_HIGH_BORDER               65.0f
#define ISM_ELEVATION_LOW_BORDER_FX             -293601280
#define ISM_ELEVATION_HIGH_BORDER_FX            272629760
#define ISM_Q_STEP                              2.5f
#define ISM_Q_STEP_FX                           10485760
#define ISM_Q_STEP_BORDER                       5.0f
#define ISM_Q_STEP_BORDER_FX                    20971520

#define ISM_RADIUS_NBITS                        6 
#define ISM_RADIUS_MIN                          0.0f
+364 −64

File changed.

Preview size limit exceeded, changes collapsed.

+56 −0
Original line number Diff line number Diff line
@@ -838,6 +838,62 @@ void ivas_ism_reset_metadata_API(
 *-------------------------------------------------------------------*/

/*! r: index of the winning codeword */
#ifdef IVAS_FLOAT_FIXED
Word16 ism_quant_meta_fx(
    const Word32 val,              /* i  : scalar value to quantize        Q22 */
    Word32 *valQ,                  /* o  : quantized value                 Q22 */
    const Word32 borders_fx[],     /* i  : level borders                   Q22 */
    const Word32 q_step_fx,        /* i  : quantization step               Q22 */
    const Word32 q_step_border_fx, /* i  : quantization step at the border Q22 */
    const Word16 cbsize            /* i  : codebook size                       */
)
{
    Word16 idx, idx_start;
    Word32 qlow_fx, step_fx;
    Word16 tmp, tmp_e;

    IF( val <= borders_fx[1] )
    {
        qlow_fx = borders_fx[0];
        move32();
        idx_start = 0;
        move32();
        step_fx = q_step_border_fx;
        move32();
    }
    ELSE IF( val <= borders_fx[2] )
    {
        qlow_fx = borders_fx[1];
        move32();
        tmp = BASOP_Util_Divide3232_Scale( L_sub( borders_fx[1], borders_fx[0] ), q_step_border_fx, &tmp_e );
        idx_start = shr( tmp, sub( 15, tmp_e ) );
        step_fx = q_step_fx;
        move32();
    }
    ELSE
    {
        qlow_fx = borders_fx[2];
        move32();
        tmp = BASOP_Util_Divide3232_Scale( L_add( L_sub( borders_fx[3], borders_fx[2] ), L_sub( q_step_border_fx, ONE_IN_Q22 ) ), q_step_border_fx, &tmp_e );
        idx_start = sub( cbsize, add( 1, shr( tmp, sub( 15, tmp_e ) ) ) );
        step_fx = q_step_border_fx;
        move32();
    }


    tmp = BASOP_Util_Divide3232_Scale( L_sub( val, qlow_fx ), step_fx, &tmp_e );
    tmp = shl( tmp, sub( Q1, sub( 15, tmp_e ) ) );
    tmp = add( tmp, 1 );
    tmp = shr( tmp, 1 );
    idx = add( idx_start, s_max( 0, s_min( sub( cbsize, 1 ), tmp ) ) );

    // idx = idx_start + (int16_t) max( 0.f, min( cbsize - 1, ( ( val - qlow_fx ) / step_fx + 0.5f ) ) );
    *valQ = L_add( imult3216( step_fx, sub( idx, idx_start ) ), qlow_fx );

    return idx;
}
#endif

int16_t ism_quant_meta(
    const float val,           /* i  : scalar value to quantize        */
    float *valQ,               /* o  : quantized value                 */
Loading