Commit 5f2025b6 authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Merge remote-tracking branch 'origin/main' into...

Merge remote-tracking branch 'origin/main' into 2194_basop_port_float_MR2105_default_reverb_configuration
parents 129fd690 028d6837
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -48,6 +48,9 @@
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'peaq-enc-passthrough'
      variables:
        IVAS_PIPELINE_NAME: 'PEAQ encoder pass-through test: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'ivas-conformance'
      variables:
        IVAS_PIPELINE_NAME: 'IVAS conformance: $CI_COMMIT_BRANCH'
    - if: $CI_PIPELINE_SOURCE == 'schedule' # Scheduled in any branch
      variables:
        IVAS_PIPELINE_NAME: 'Scheduled pipeline: $CI_COMMIT_BRANCH'
+1 −0
Original line number Diff line number Diff line
@@ -105,3 +105,4 @@ variables:
      - 'long-term-logs'
      - 'backup-long-term-logs'
      - 'test-long-self-test'
      - 'ivas-conformance-linux'
+29 −0
Original line number Diff line number Diff line
@@ -129,6 +129,9 @@ typedef struct
    uint16_t directivityPatternId[IVAS_MAX_NUM_OBJECTS];
    bool objEditEnabled;
    char *objEditFileName;
#ifdef FIX_1419_MONO_STEREO_UMX
    bool evsMode;
#endif
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
    IVAS_ROOM_SIZE_T roomSize;
#endif
@@ -843,6 +846,9 @@ static bool parseCmdlIVAS_dec(
    arg->output_Fs = IVAS_MAX_SAMPLING_RATE;
    arg->outputConfig = IVAS_AUDIO_CONFIG_MONO;
    arg->decMode = IVAS_DEC_MODE_IVAS;
#ifdef FIX_1419_MONO_STEREO_UMX
    arg->evsMode = false;
#endif
    arg->quietModeEnabled = false;
    arg->delayCompensationEnabled = true;
    arg->voipMode = false;
@@ -1373,6 +1379,14 @@ static bool parseCmdlIVAS_dec(
            }
            i++;
        }
#ifdef FIX_1419_MONO_STEREO_UMX
        else if ( strcmp( argv_to_upper, "-EVS" ) == 0 )
        {
            arg->evsMode = true;
            arg->decMode = IVAS_DEC_MODE_EVS;
            i++;
        }
#endif
#ifdef FIX_1318_ROOM_SIZE_CMD_LINE
        else if ( strcmp( argv_to_upper, "-ROOM_SIZE" ) == 0 )
        {
@@ -1462,6 +1476,15 @@ static bool parseCmdlIVAS_dec(
            usage_dec();
            return false;
        }
#ifdef FIX_1419_MONO_STEREO_UMX
        else if ( arg->non_diegetic_pan_enabled && arg->outputConfig == IVAS_AUDIO_CONFIG_STEREO && arg->evsMode )
        {
            fprintf( stderr, "Error: Both non-diegetic panning and stereo output specified!\n\n" );
            usage_dec();
            return false;
        }

#endif
        if ( arg->outputMdFilename != NULL && arg->outputConfig != IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        {
            fprintf( stderr, "Error: Output split rendering metadata file is supported for BINAURAL_SPLIT_PCM output config. only\n\n" );
@@ -1553,6 +1576,9 @@ static bool parseCmdlIVAS_dec(
static void usage_dec( void )
{
    fprintf( stdout, "Usage for EVS:   IVAS_dec.exe [Options] Fs bitstream_file output_file\n" );
#ifdef FIX_1419_MONO_STEREO_UMX
    fprintf( stdout, "                 OR usage for IVAS (below) with -evs option and OutputConf\n" );
#endif
    fprintf( stdout, "Usage for IVAS:  IVAS_dec.exe [Options] OutputConf Fs bitstream_file output_file\n\n" );

    fprintf( stdout, "Mandatory parameters:\n" );
@@ -1569,6 +1595,9 @@ static void usage_dec( void )

    fprintf( stdout, "Options:\n" );
    fprintf( stdout, "--------\n" );
#ifdef FIX_1419_MONO_STEREO_UMX
    fprintf( stdout, "-evs                : Specify that the supplied bitstream is an EVS bitstream\n" );
#endif
    fprintf( stdout, "-VOIP               : VoIP mode: RTP in G192\n" );
    fprintf( stdout, "-VOIP_hf_only=0     : VoIP mode: EVS RTP Payload Format hf_only=0 in rtpdump\n" );
    fprintf( stdout, "-VOIP_hf_only=1     : VoIP mode: EVS RTP Payload Format hf_only=1 in rtpdump\n" );
+95 −85
Original line number Diff line number Diff line
@@ -48,8 +48,9 @@
#define N40 ( 20 )
#define N60 ( 30 )

static void
cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs );
static Word16 CLDFB_getNumChannels( const Word32 sampleRate );

static void cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs );

#define cplxMpyS( yr, yi, xr, xi, cr, ci, syr, syi, sxr, sxi, CL_x, CL_z, C_c ) \
    CL_x = CL_form( *xr, *xi );                                                 \
@@ -722,7 +723,7 @@ void cldfbSynthesis_fx(
    scaleLB = limitScale32( sub( scale, scaleFactor->lb_scale ) );
    scaleHB = limitScale32( sub( scale, scaleFactor->hb_scale ) );

    outScale = cldfbBank->synFilterHeadroom;
    outScale = SYN_FILTER_HEADROOM_2_5MS;
    move16();

    scaleMod = sub( add( scale, cldfbBank->outScalefactor ), outScale );
@@ -811,7 +812,6 @@ void cldfbSynthesis_fx(
                        &iBuffer[0], &iBuffer[1], &iAnalysisS[0], &iAnalysisS[m - 1], 2, 2, 2, -2,
                        rRotVctr, iRotVctr, m );


        /* FFT of DST IV */
        scale = 0;
        move16();
@@ -909,25 +909,29 @@ void cldfbSynthesis_fx(
    /* move filter states */
    Copy( &cldfbBank->FilterStates[nTimeSlots * L2], cldfbBank->FilterStates, statesSizeM2 );
    set16_fx( &cldfbBank->FilterStates[statesSizeM2], 0, L2 );

    return;
}


/*-------------------------------------------------------------------*
 * configureClfdb()
 * configureCldfb()
 *
 * configures a CLDFB handle
 *--------------------------------------------------------------------*/

void configureCldfb( HANDLE_CLDFB_FILTER_BANK h_cldfb, /*!< Returns handle */
                     const Word16 no_channels,         /*!< Number of channels (bands) */
                     const Word16 frameSize            /*!< FrameSize */
void configureCldfb(
    HANDLE_CLDFB_FILTER_BANK h_cldfb, /* i/o: Returns handle    */
    const Word32 sampling_rate        /* i  : sampling rate     */
)
{
    Word16 no_channels;
    no_channels = CLDFB_getNumChannels( sampling_rate );

    h_cldfb->no_channels = no_channels;
    h_cldfb->no_channels = extract_l( Mpy_32_32_r( sampling_rate, INV_CLDFB_BANDWIDTH_Q31 ) );
    move16();
    assert( h_cldfb->no_channels >= 10 );
    h_cldfb->no_col = div_l( frameSize, shr( h_cldfb->no_channels, 1 ) );
    h_cldfb->no_col = CLDFB_NO_COL_MAX;
    move16();

    /* was cldfbInitFilterBank()*/
@@ -937,8 +941,6 @@ void configureCldfb( HANDLE_CLDFB_FILTER_BANK h_cldfb, /*!< Returns handle */
    move16();
    h_cldfb->bandsToZero = 0;
    move16();
    h_cldfb->filtermode = 0;
    move16();
    h_cldfb->memory = 0;
    move16();
    h_cldfb->memory_length = 0;
@@ -954,14 +956,13 @@ void configureCldfb( HANDLE_CLDFB_FILTER_BANK h_cldfb, /*!< Returns handle */

    h_cldfb->zeros = 0;
    move16();
    h_cldfb->synFilterHeadroom = SYN_FILTER_HEADROOM_2_5MS;
    move16();

    cldfb_init_proto_and_twiddles( h_cldfb );

    /* the following is related to the EVS implentation only */
    h_cldfb->lsb = no_channels;
    move16();
    h_cldfb->usb = s_min( no_channels, h_cldfb->no_channels ); /* Does this make any sense? in the previous implemenatation lsb, usb and no_channels are all maxCldfbBands */
    h_cldfb->usb = s_min( no_channels, h_cldfb->no_channels );
    move16();

    h_cldfb->FilterStates = (void *) h_cldfb->FilterStates;
@@ -971,19 +972,23 @@ void configureCldfb( HANDLE_CLDFB_FILTER_BANK h_cldfb, /*!< Returns handle */
    return;
}


/*-------------------------------------------------------------------*
 * openClfdb()
 *
 * open and configures a CLDFB handle
 *--------------------------------------------------------------------*/

ivas_error openCldfb(
    HANDLE_CLDFB_FILTER_BANK *h_cldfb, /*!< Returns handle */
    const Word16 type,                 /*!< analysis or synthesis */
    const Word16 maxCldfbBands,        /*!< number of cldfb bands */
    const Word16 frameSize             /*!< FrameSize */
    HANDLE_CLDFB_FILTER_BANK *h_cldfb, /* i/o: Returns handle           */
    const Word16 type,                 /* i  : analysis or synthesis    */
    const Word32 sampling_rate         /* i  : sampling rate            */
)
{
    HANDLE_CLDFB_FILTER_BANK hs;
    Word16 buf_len, maxCldfbBands;

    maxCldfbBands = CLDFB_getNumChannels( sampling_rate );

    hs = (HANDLE_CLDFB_FILTER_BANK) malloc( sizeof( CLDFB_FILTER_BANK ) );
    IF( hs == NULL )
@@ -994,23 +999,31 @@ ivas_error openCldfb(
    hs->type = type;
    move16();

    configureCldfb( hs, sampling_rate );

    IF( type == CLDFB_ANALYSIS )
    {
        hs->FilterStates = (Word16 *) malloc( STATE_BUFFER_SIZE * maxCldfbBands * sizeof( Word16 ) );
        // buf_len = sub( hs->p_filter_length, hs->no_channels );
        buf_len = STATE_BUFFER_SIZE * maxCldfbBands;
    }
    ELSE
    {
        hs->FilterStates = (Word16 *) malloc( 2 * STATE_BUFFER_SIZE * maxCldfbBands * sizeof( Word16 ) );
        // buf_len = hs->p_filter_length;
        buf_len = 2 * STATE_BUFFER_SIZE * maxCldfbBands;
        move16();
    }
    if ( hs->FilterStates == NULL )

    IF( ( hs->FilterStates = (Word16 *) malloc( buf_len * sizeof( Word16 ) ) ) == NULL )
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for CLDFB" );
    }

    hs->flags = s_and( hs->flags, ~CLDFB_FLAG_KEEP_STATES );
    move16();
    configureCldfb( hs, maxCldfbBands, frameSize );

    hs->memory = NULL;
    hs->memory32 = NULL;
    hs->cldfb_state_fx = NULL;
    hs->memory_length = 0;
    move16();

@@ -1019,7 +1032,7 @@ ivas_error openCldfb(
        test();
        IF( ( s_and( hs->flags, CLDFB_FLAG_KEEP_STATES ) == 0 ) && ( hs->FilterStates != 0 ) )
        {
            set16_fx( hs->FilterStates, 0, i_mult( STATE_BUFFER_SIZE, hs->no_channels ) );
            set16_fx( hs->FilterStates, 0, buf_len );
            set16_fx( hs->FilterStates_e, 0, sizeof( hs->FilterStates_e ) / sizeof( hs->FilterStates_e[0] ) );

            hs->FilterStates_eg = 0;
@@ -1032,7 +1045,7 @@ ivas_error openCldfb(
        {
            IF( s_and( hs->flags, CLDFB_FLAG_KEEP_STATES ) == 0 )
            {
                set16_fx( hs->FilterStates, 0, i_mult( shl( STATE_BUFFER_SIZE, 1 ), hs->no_channels ) );
                set16_fx( hs->FilterStates, 0, buf_len );
            }
        }
        hs->FilterStates_eg = 0;
@@ -1053,8 +1066,10 @@ ivas_error openCldfb(
 *
 * Change sample rate of filter bank
 *--------------------------------------------------------------------*/
void resampleCldfb( HANDLE_CLDFB_FILTER_BANK hs,
                    const Word16 newCldfbBands,

void resampleCldfb(
    HANDLE_CLDFB_FILTER_BANK hs,
    const Word32 sampling_rate, /* i  : sampling rate      */
    const Word16 frameSize,
    const Word8 firstFrame )

@@ -1072,7 +1087,7 @@ void resampleCldfb( HANDLE_CLDFB_FILTER_BANK hs,
    move16();

    /* new settings */
    configureCldfb( hs, newCldfbBands, frameSize );
    configureCldfb( hs, sampling_rate );

    /* resample cldfb state buffer */
    timeOffset = sub( sub( hs->p_filter_length, hs->no_channels ), hs->zeros );
@@ -1104,8 +1119,9 @@ void resampleCldfb( HANDLE_CLDFB_FILTER_BANK hs,
    Returns:
       headroom
*/
Word16
AnalysisPostSpectrumScaling_Fx( HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle of cldfbBank  */

Word16 AnalysisPostSpectrumScaling_Fx(
    HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle of cldfbBank  */
    Word32 **rSubband32,                /*!< Real bands Q(cldfbSacle)*/
    Word32 **iSubband32,                /*!< Imaginary bands Q(cldfbSacle)*/
    Word16 **rSubband16,                /*!< Real bands Q(cldfbSacle)*/
@@ -1117,7 +1133,6 @@ AnalysisPostSpectrumScaling_Fx( HANDLE_CLDFB_FILTER_BANK cldfbBank, /*!< Handle
    Word16 j;
    Word16 headRoom;


    headRoom = BASOP_util_norm_l_dim2_cplx(
        (const Word32 *const *) rSubband32,
        (const Word32 *const *) iSubband32,
@@ -1215,7 +1230,9 @@ void analysisCldfbEncoder_fx(
    return;
}

void GetEnergyCldfb( Word32 *energyLookahead,     /*!< o: Q(*sf_energyLookahead) |   pointer to the result in the core look-ahead slot */

void GetEnergyCldfb(
    Word32 *energyLookahead,     /*!< o: Q(*sf_energyLookahead) |   pointer to the result in the core look-ahead slot */
    Word16 *sf_energyLookahead,  /*!< o:         pointer to the scalefactor of the result in the core look-ahead slot  */
    const Word16 numLookahead,   /*!< i: Q0      the number of look-ahead time-slots */
    Word16 **realValues,         /*!< i: Q(sf_Values) |   the real part of the CLDFB subsamples */
@@ -1374,14 +1391,12 @@ void GetEnergyCldfb( Word32 *energyLookahead, /*!< o: Q(*sf_energyLookahead)
}


Word16
CLDFB_getNumChannels( Word32 sampleRate )
static Word16 CLDFB_getNumChannels(
    const Word32 sampleRate )
{

    Word16 nChannels = 0;
    move16();


    SWITCH( sampleRate )
    {
        case 48000:
@@ -1413,13 +1428,15 @@ CLDFB_getNumChannels( Word32 sampleRate )
    return ( nChannels );
}


/*-------------------------------------------------------------------*
 * cldfb_get_memory_length()
 *
 * Return length of filter state for recovery
 *--------------------------------------------------------------------*/
static Word16
cldfb_get_memory_length( HANDLE_CLDFB_FILTER_BANK hs )

static Word16 cldfb_get_memory_length(
    HANDLE_CLDFB_FILTER_BANK hs )
{
    IF( EQ_16( hs->type, CLDFB_ANALYSIS ) )
    {
@@ -1431,39 +1448,21 @@ cldfb_get_memory_length( HANDLE_CLDFB_FILTER_BANK hs )
    }
}

/*-------------------------------------------------------------------*
 * GetEnergyCldfb()
 *
 * Remove handle
 *--------------------------------------------------------------------*/
void deleteCldfb( HANDLE_CLDFB_FILTER_BANK *h_cldfb ) /* i: cldfb handle */
{
    IF( *h_cldfb != NULL )
    {
        IF( ( *h_cldfb )->FilterStates != NULL )
        {
            free( ( *h_cldfb )->FilterStates );
        }
        free( *h_cldfb );
    }
    *h_cldfb = NULL;
}


/*-------------------------------------------------------------------*
 * cldfb_init_proto_and_twiddles()
 *
 * Initializes rom pointer
 *--------------------------------------------------------------------*/
static void
cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ) /* i: cldfb handle */
{

static void cldfb_init_proto_and_twiddles(
    HANDLE_CLDFB_FILTER_BANK hs /* i: cldfb handle */
)
{
    /*find appropriate set of rotVecs*/
    SWITCH( hs->no_channels )
    {
        case 10:

            hs->rRotVctr = rRotVectr_10;
            hs->iRotVctr = iRotVectr_10;
            hs->synGain = cldfb_synGain[0];
@@ -1571,6 +1570,8 @@ cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ) /* i: cldfb handle
            }
            BREAK;
    }

    return;
}


@@ -1581,8 +1582,10 @@ cldfb_init_proto_and_twiddles( HANDLE_CLDFB_FILTER_BANK hs ) /* i: cldfb handle
 *
 * Save the memory of filter; to be restored with cldfb_restore_memory()
 *--------------------------------------------------------------------*/
ivas_error
cldfb_save_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i: cldfb handle */

ivas_error cldfb_save_memory(
    HANDLE_CLDFB_FILTER_BANK hs /* i: cldfb handle */
)
{
    test();
    IF( hs->memory != NULL || hs->memory_length != 0 )
@@ -1603,6 +1606,7 @@ cldfb_save_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i: cldfb handle */
    {
        return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for CLDFB\n" );
    }

    return IVAS_ERR_OK;
}

@@ -1612,12 +1616,14 @@ cldfb_save_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i: cldfb handle */
 *
 * Restores the memory of filter; memory to be save by cldfb_save_memory()
 *--------------------------------------------------------------------*/
void cldfb_restore_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i/o: cldfb handle */

void cldfb_restore_memory(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: cldfb handle */
)

{
    Word16 size;


    size = cldfb_get_memory_length( hs );

    /* read the memory */
@@ -1626,7 +1632,6 @@ void cldfb_restore_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i/o: cldfb handle */
    hs->FilterStates_eg = hs->memory[hs->memory_length + CLDFB_MEM_EXPONENTS];
    move16();


    /* adjust sample rate if it was changed in the meanwhile */
    IF( NE_16( hs->memory_length, size ) )
    {
@@ -1640,12 +1645,16 @@ void cldfb_restore_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i/o: cldfb handle */
    return;
}


/*-------------------------------------------------------------------*
 * cldfb_reset_memory()
 *
 * Resets the memory of filter.
 *--------------------------------------------------------------------*/
void cldfb_reset_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i/o: cldfb handle */

void cldfb_reset_memory(
    HANDLE_CLDFB_FILTER_BANK hs /* i/o: cldfb handle */
)
{
    Word16 length;

@@ -1655,5 +1664,6 @@ void cldfb_reset_memory( HANDLE_CLDFB_FILTER_BANK hs ) /* i/o: cldfb handle */
    set16_fx( hs->FilterStates_e, 0, sizeof( hs->FilterStates_e ) / sizeof( hs->FilterStates_e[0] ) );
    hs->FilterStates_eg = 0;
    move16();

    return;
}
+42 −384

File changed.

Preview size limit exceeded, changes collapsed.

Loading