Commit cc1543e1 authored by vaclav's avatar vaclav
Browse files

use extract_l() instead of data casting

parent 93f259db
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2859,7 +2859,7 @@ ivas_error ivas_jbm_dec_set_discard_samples_fx(

    /* render first frame with front zero padding and discarding those samples */
    /* nMaxSlotsPerSubframe = (Word16)(st_ivas->hDecoderConfig->output_Fs / (FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES)) / st_ivas->hTcBuffer->n_samples_granularity; */
    temp = (Word16) Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
    temp = extract_l( Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));
    temp = BASOP_Util_Divide1616_Scale( temp, st_ivas->hTcBuffer->n_samples_granularity, &temp_e );
    nMaxSlotsPerSubframe = shr( temp, sub( 15, temp_e ) ); /* Q0 */
    nSlotsInFirstSubframe = sub( nMaxSlotsPerSubframe, st_ivas->hTcBuffer->subframe_nbslots[st_ivas->hTcBuffer->nb_subframes - 1] );
@@ -3538,7 +3538,7 @@ ivas_error ivas_jbm_dec_tc_buffer_open_fx(
    move16();

    /* nMaxSlotsPerSubframe = (Word16)(st_ivas->hDecoderConfig->output_Fs / (FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES)) / st_ivas->hTcBuffer->n_samples_granularity; */
    tmp = (Word16) Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
    tmp = extract_l( Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));
    tmp = BASOP_Util_Divide1616_Scale( tmp, hTcBuffer->n_samples_granularity, &tmp_e );
    nMaxSlotsPerSubframe = shr( tmp, sub( 15, tmp_e ) ); /* Q0 */

@@ -3609,7 +3609,7 @@ ivas_error ivas_jbm_dec_tc_buffer_reconfigure_fx(
        Word16 tmp, tmp_e;

        /* nMaxSlotsPerSubframeNew = (int16_t) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ) / n_samples_granularity; */
        tmp = (Word16) Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
        tmp = extract_l( Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));
        tmp = BASOP_Util_Divide1616_Scale( tmp, n_samples_granularity, &tmp_e );
        nMaxSlotsPerSubframeNew = shr( tmp, sub( 15, tmp_e ) ); /* Q0 */

@@ -3748,7 +3748,7 @@ void ivas_jbm_dec_td_renderers_adapt_subframes(
    UWord16 nSlotsInLastSubframe, nSlotsInFirstSubframe;

    /* nMaxSlotsPerSubframe = (Word16) ( st_ivas->hDecoderConfig->output_Fs / ( FRAMES_PER_SEC * MAX_PARAM_SPATIAL_SUBFRAMES ) ) / st_ivas->hTcBuffer->n_samples_granularity; */
    tmp = (Word16) Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
    tmp = extract_l( Mpy_32_16_1( st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));
    tmp = BASOP_Util_Divide1616_Scale( tmp, st_ivas->hTcBuffer->n_samples_granularity, &tmp_e );
    nMaxSlotsPerSubframe = shr( tmp, sub( 15, tmp_e ) ); /* Q0 */

+1 −1
Original line number Diff line number Diff line
@@ -1422,7 +1422,7 @@ static ivas_error init_lfe_synth_data_fx(
        /* Ring buffer for the filterbank of the LFE synthesis.
         * The filterbank is using moving average lowpass filter with the crossover of 120 Hz. */
        /* bufferSize = (int16_t) ( ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES ); */
        bufferSize = (Word16) Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
        bufferSize = extract_l( Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));

        IF( ( hMasa->hMasaLfeSynth->lfeSynthRingBuffer_fx = (Word32 *) malloc( bufferSize * sizeof( Word32 ) ) ) == NULL )
        {
+1 −1
Original line number Diff line number Diff line
@@ -4396,7 +4396,7 @@ void stereo_dft_dec_read_BS_fx(
    test();
    IF( EQ_32( ivas_total_brate, IVAS_SID_5k2 ) && NE_16( ivas_format, MASA_FORMAT ) )
    {
        *nb_bits = (Word16) Mult_32_16( L_sub( element_brate, SID_2k40 ), INV_FRAME_PER_SEC_Q15 ); /* => hCPE->hCoreCoder[0]->total_brate = SID_2k40;    Q0*/
        *nb_bits = extract_l( Mult_32_16( L_sub( element_brate, SID_2k40 ), INV_FRAME_PER_SEC_Q15 )); /* => hCPE->hCoreCoder[0]->total_brate = SID_2k40;    Q0*/
        move16();
    }
    {
+5 −4
Original line number Diff line number Diff line
@@ -826,7 +826,8 @@ static Word16 get_render_frame_size_samples(
)
{
    Word16 tmp;
    tmp = (Word16) Mpy_32_16_1( hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
    
    tmp = extract_l( Mpy_32_16_1( hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));

    IF( EQ_16( hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) )
    {
@@ -875,7 +876,7 @@ ivas_error IVAS_DEC_GetRenderFramesizeSamples(
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    *render_framesize = get_render_frame_size_samples( hIvasDec->st_ivas->hDecoderConfig );
#else
    tmp = (Word16) Mpy_32_16_1( hIvasDec->st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
    tmp = extract_l( Mpy_32_16_1( hIvasDec->st_ivas->hDecoderConfig->output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));

    IF( EQ_16( hIvasDec->st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) )
    {
@@ -1230,12 +1231,12 @@ static Word16 isar_get_frame_size(
        ( EQ_32( st_ivas->hRenderConfig->split_rend_config.poseCorrectionMode, ISAR_SPLIT_REND_POSE_CORRECTION_MODE_NONE ) ||
          EQ_32( st_ivas->hRenderConfig->split_rend_config.dof, 0 ) ) )
    {
        nSamplesPerChannel = (Word16) Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
        nSamplesPerChannel = extract_l( Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ));
        nSamplesPerChannel = imult1616( nSamplesPerChannel, st_ivas->hDecoderConfig->render_framesize );
    }
    ELSE
    {
        nSamplesPerChannel = (Word16) Mpy_32_16_1( output_Fs, INV_FRAME_PER_SEC_Q15 );
        nSamplesPerChannel = extract_l( Mpy_32_16_1( output_Fs, INV_FRAME_PER_SEC_Q15 ));
    }

    return nSamplesPerChannel;
+1 −1
Original line number Diff line number Diff line
@@ -1862,7 +1862,7 @@ static ivas_error ivas_rend_crendConvolver_fx(
    }

    /* subframe_length = (int16_t) ( output_Fs / FRAMES_PER_SEC ) / MAX_PARAM_SPATIAL_SUBFRAMES; */
    subframe_length = (Word16) Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 );
    subframe_length = extract_l( Mpy_32_16_1( output_Fs, ONE_BY_SUBFR_PER_SEC_Q15 ) );

    lfe_idx_in = -1;
    move16();
Loading