Commit 038bbadb authored by sagnowski's avatar sagnowski
Browse files

Replace leftover == and != with EQ and NE macros

parent 953487ed
Loading
Loading
Loading
Loading
Loading
+26 −18
Original line number Diff line number Diff line
@@ -1248,7 +1248,7 @@ static ivas_error isar_render_poses(
    }

    /* render */
    IF( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesAsked, pcmBuf, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK )
    IF( NE_32 ( ( error = IVAS_DEC_GetSamplesRenderer( hIvasDec, nSamplesAsked, pcmBuf, nOutSamples, needNewFrame ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
@@ -1422,7 +1422,7 @@ static ivas_error isar_generate_metadata_and_bitstream(
        move16();
    }

    IF( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend,
    IF( NE_32( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( &hSplitBinRend->splitrend,
                                                         Quaternion,
                                                         st_ivas->hRenderConfig->split_rend_config.splitRendBitRate,
                                                         st_ivas->hRenderConfig->split_rend_config.codec,
@@ -1431,7 +1431,7 @@ static ivas_error isar_generate_metadata_and_bitstream(
                                                         splitRendBits,
                                                         p_Cldfb_RealBuffer_Binaural,
                                                         p_Cldfb_ImagBuffer_Binaural,
                                                         max_band, p_head_pose_buf, 1, cldfb_in_flag, pcm_out_flag, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK )
                                                         max_band, p_head_pose_buf, 1, cldfb_in_flag, pcm_out_flag, ro_md_flag, Q_buff, &Q_out[0] ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
@@ -1611,7 +1611,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(

    st_ivas = hIvasDec->st_ivas;

    IF( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ) == 0 )
    IF( EQ_16( is_split_rendering_enabled( st_ivas->hDecoderConfig, st_ivas->hRenderConfig ), 0 ) )
    {
        return IVAS_ERR_WRONG_PARAMS;
    }
@@ -1626,7 +1626,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        move16();
    }

    IF( ( error = isar_render_poses( hIvasDec, numSamplesPerChannelToOutput, nOutSamples, needNewFrame ) ) != IVAS_ERR_OK )
    IF( NE_32( ( error = isar_render_poses( hIvasDec, numSamplesPerChannelToOutput, nOutSamples, needNewFrame ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
@@ -1641,7 +1641,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        p_head_pose_buf[i] = head_pose_buf[i];
    }

    IF( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nOutSamples, splitRendBits, Q_out ) ) != IVAS_ERR_OK )
    IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nOutSamples, splitRendBits, Q_out ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
@@ -1653,7 +1653,7 @@ ivas_error IVAS_DEC_GetSplitBinauralBitstream(
        {
            scale_sig32( p_head_pose_buf[i], numSamplesPerChannelToOutput, sub( Q11, Q_out[i] ) ); // Q11
        }
        IF( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS )
        IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) )
        {
#ifndef DISABLE_LIMITER
            ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, numSamplesPerChannelToOutput, st_ivas->BER_detect, Q11 );
@@ -2002,7 +2002,7 @@ static ivas_error ivas_dec_setup_all(

        test();
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
        IF( st_ivas->ini_frame == 0 && splitRendBits != NULL )
        IF( EQ_16( st_ivas->ini_frame, 0 ) && splitRendBits != NULL )
#else
        IF( st_ivas->ini_frame == 0 && isSplitRend )
#endif
@@ -3851,7 +3851,7 @@ ivas_error IVAS_DEC_GetSamplesDecoder(
         *-----------------------------------------------------------------*/

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
        IF( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, splitRendBits ) ) != IVAS_ERR_OK )
        IF( NE_32( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, splitRendBits ) ), IVAS_ERR_OK ) )
#else
        IF( ( error = ivas_dec_setup_all( hIvasDec, &nTransportChannels, isSplitRend, splitRendBits ) ) != IVAS_ERR_OK )
#endif
@@ -4816,7 +4816,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples
                IF( hIvasDec->nSamplesAvailableNext == 0 || EQ_16( hIvasDec->nSamplesAvailableNext, hIvasDec->nSamplesFrame ) )
                {
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
                    IF( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ) != IVAS_ERR_OK )
                    IF( NE_32( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, splitRendBits ) ), IVAS_ERR_OK ) )
#else
                    IF( ( error = IVAS_DEC_GetSamplesDecoder( hIvasDec, 0, 0 ) ) != IVAS_ERR_OK )
#endif
@@ -4847,7 +4847,7 @@ ivas_error IVAS_DEC_VoIP_GetSamples
            IF( splitRendBits != NULL )
            {
                /* Render head poses from time-scaled transport channels */
                IF( ( error = isar_render_poses( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &tmp ) ) != IVAS_ERR_OK )
                IF( NE_32( ( error = isar_render_poses( hIvasDec, nSamplesToRender, &nSamplesRendered_loop, &tmp ) ), IVAS_ERR_OK ) )
                {
                    return error;
                }
@@ -4876,20 +4876,20 @@ ivas_error IVAS_DEC_VoIP_GetSamples
        Word16 i;

        /* Analyse head poses over entire frame, generate ISAR metadata and maybe encode if split coded */
        IF( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ) != IVAS_ERR_OK )
        IF( NE_32( ( error = isar_generate_metadata_and_bitstream( st_ivas, p_head_pose_buf, *nSamplesRendered, splitRendBits, Q_out ) ), IVAS_ERR_OK ) )
        {
            return error;
        }

        /* Synthesise PCM output if split PCM */
        IF( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM )
        IF( EQ_32( st_ivas->hDecoderConfig->output_config, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) )
        {
            FOR( i = 0; i < BINAURAL_CHANNELS; i++ )
            {
                scale_sig32( p_head_pose_buf[i], *nSamplesRendered, sub( Q11, Q_out[i] ) ); // Q11
            }

            IF( st_ivas->hDecoderConfig->render_framesize == IVAS_RENDER_FRAMESIZE_5MS )
            IF( EQ_32( st_ivas->hDecoderConfig->render_framesize, IVAS_RENDER_FRAMESIZE_5MS ) )
            {
#ifndef DISABLE_LIMITER
                ivas_limiter_dec_fx( st_ivas->hLimiter, p_head_pose_buf, st_ivas->hDecoderConfig->nchan_out, *nSamplesRendered, st_ivas->BER_detect, Q11 );
@@ -4977,7 +4977,7 @@ ivas_error IVAS_DEC_VoIP_GetSplitBinauralBitstream(
    ivas_error error = IVAS_ERR_UNKNOWN;
    Word16 nSamplesPerChannel = 0;

    IF( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nSamplesPerChannel ) ) != IVAS_ERR_OK )
    IF( NE_32( ( error = IVAS_DEC_GetRenderFramesizeSamples( hIvasDec, &nSamplesPerChannel ) ), IVAS_ERR_OK ) )
    {
        return error;
    }
@@ -6185,6 +6185,7 @@ static ivas_error ivas_dec_init_split_rend(
    Word16 mixed_td_cldfb_flag;
#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    Word16 i, num_poses;
    ISAR_SPLIT_REND_ROT_AXIS head_rot_axis;
#endif

    pcm_out_flag = ( st_ivas->hDecoderConfig->output_config == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0;
@@ -6214,7 +6215,14 @@ static ivas_error ivas_dec_init_split_rend(
#endif

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
    ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, ( st_ivas->hHeadTrackData != NULL ) ? st_ivas->hHeadTrackData->sr_pose_pred_axis : DEFAULT_AXIS );
    head_rot_axis = DEFAULT_AXIS;
    move32();
    if ( st_ivas->hHeadTrackData != NULL )
    {
        head_rot_axis = st_ivas->hHeadTrackData->sr_pose_pred_axis;
        move32();
    }
    ISAR_PRE_REND_GetMultiBinPoseData( &st_ivas->hRenderConfig->split_rend_config, &st_ivas->hSplitBinRend->splitrend.multiBinPoseData, head_rot_axis );

    num_poses = st_ivas->hSplitBinRend->splitrend.multiBinPoseData.num_poses;
    move16();
@@ -6225,7 +6233,7 @@ static ivas_error ivas_dec_init_split_rend(
        FOR( i = 0; i < num_poses * BINAURAL_CHANNELS; ++i )
        {
            /* note: this is intra-frame heap memory */
            IF( ( error = ivas_CLDFB_RINGBUF_Open( &st_ivas->hSplitBinRend->hMultiBinCldfbData[i], CLDFB_NO_COL_MAX ) ) != IVAS_ERR_OK )
            IF( NE_32( ( error = ivas_CLDFB_RINGBUF_Open( &st_ivas->hSplitBinRend->hMultiBinCldfbData[i], CLDFB_NO_COL_MAX ) ), IVAS_ERR_OK ) )
            {
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" );
            }
@@ -6233,7 +6241,7 @@ static ivas_error ivas_dec_init_split_rend(
    }
    ELSE
    {
        IF( ( error = ivas_TD_RINGBUF_Open( &st_ivas->hSplitBinRend->hMultiBinTdData, get_render_frame_size_samples( st_ivas->hDecoderConfig ), i_mult( num_poses, BINAURAL_CHANNELS ) ) ) != IVAS_ERR_OK )
        IF( NE_32( ( error = ivas_TD_RINGBUF_Open( &st_ivas->hSplitBinRend->hMultiBinTdData, get_render_frame_size_samples( st_ivas->hDecoderConfig ), i_mult( num_poses, BINAURAL_CHANNELS ) ) ), IVAS_ERR_OK ) )
        {
            return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Cannot allocate memory for split rendering structure" );
        }
+3 −5
Original line number Diff line number Diff line
@@ -9043,19 +9043,17 @@ static ivas_error getSamplesInternal(
        }

#ifdef FIX_1119_SPLIT_RENDERING_VOIP
        IF( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec,
        IF( NE_32( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec,
                                                             hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms,
                                                             hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms,
                                                             &bits,
                                                             p_Cldfb_RealBuffer_Binaural, p_Cldfb_ImagBuffer_Binaural,
                                                             extract_l( Mpy_32_32( hIvasRend->sampleRateOut, 2684355 /*(BINAURAL_MAXBANDS / 48000) in Q31*/ ) ), tmpBinaural, 1, cldfb_in_flag, extract_l( EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ), ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK )
                                                             extract_l( Mpy_32_32( hIvasRend->sampleRateOut, 2684355 /*(BINAURAL_MAXBANDS / 48000) in Q31*/ ) ), tmpBinaural, 1, cldfb_in_flag, extract_l( EQ_32( hIvasRend->outputConfig, IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ), ro_md_flag, Q_buff, &Q_out[0] ) ), IVAS_ERR_OK ) )
#else
        IF( ( error = ISAR_PRE_REND_MultiBinToSplitBinaural( hIvasRend->splitRendWrapper, hIvasRend->headRotData.headPositions[0], hIvasRend->hRendererConfig->split_rend_config.splitRendBitRate, hIvasRend->hRendererConfig->split_rend_config.codec,
                                                             hIvasRend->hRendererConfig->split_rend_config.isar_frame_size_ms,
                                                             hIvasRend->hRendererConfig->split_rend_config.codec_frame_size_ms,
                                                             &bits,
                                                             Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural,
                                                             extract_l( Mpy_32_32( hIvasRend->sampleRateOut, 2684355 /*(BINAURAL_MAXBANDS / 48000) in Q31*/ ) ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK )
                                                             &bits, Cldfb_RealBuffer_Binaural, Cldfb_ImagBuffer_Binaural, extract_l( Mpy_32_32( hIvasRend->sampleRateOut, 2684355 /*(BINAURAL_MAXBANDS / 48000) in Q31*/ ) ), tmpBinaural, 1, cldfb_in_flag, ( hIvasRend->outputConfig == IVAS_AUDIO_CONFIG_BINAURAL_SPLIT_PCM ) ? 1 : 0, ro_md_flag, Q_buff, &Q_out[0] ) ) != IVAS_ERR_OK )
#endif
        {
            return error;