Commit 7ba8a754 authored by vaclav's avatar vaclav
Browse files

simplifications

parent 9e99e2a9
Loading
Loading
Loading
Loading
+0 −9
Original line number Original line Diff line number Diff line
@@ -149,20 +149,11 @@ uint32_t ivas_syn_output(
}
}




#ifdef UNIFIED_DECODING_PATHS_LEFTOVERS
/*-------------------------------------------------------------------*
/*-------------------------------------------------------------------*
 * ivas_syn_output_f()
 * ivas_syn_output_f()
 *
 *
 * Copy IVAS synthesis signals into a linear buffer
 * Copy IVAS synthesis signals into a linear buffer
 *-------------------------------------------------------------------*/
 *-------------------------------------------------------------------*/
#else
/*-------------------------------------------------------------------*
 * ivas_syn_output_f()
 *
 * Output ivas synthesis signal with compensation for saturation
 * returns number of clipped samples
 *-------------------------------------------------------------------*/
#endif


/*! r: number of clipped samples */
/*! r: number of clipped samples */
void ivas_syn_output_f(
void ivas_syn_output_f(
+14 −13
Original line number Original line Diff line number Diff line
@@ -737,9 +737,9 @@ ivas_error ivas_dec(
     * Write IVAS transport channels
     * Write IVAS transport channels
     *----------------------------------------------------------------*/
     *----------------------------------------------------------------*/


    if ( st_ivas->hDecoderConfig->Opt_tsm )
    if ( st_ivas->hDecoderConfig->Opt_tsm == 1 )
    {
    {
        ivas_syn_output_f( p_output, output_frame, nchan_out, data );
        ivas_syn_output_f( p_output, output_frame, st_ivas->hTcBuffer->nchan_transport_jbm, data );
    }
    }
    else
    else
    {
    {
@@ -832,7 +832,7 @@ void ivas_dec_feed_tc_to_renderer(
            mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available );
            mvr2r( hTcBuffer->tc[ch] + hTcBuffer->n_samples_rendered, hTcBuffer->tc[ch] + hTcBuffer->n_samples_discard, n_samples_still_available );
            for ( m = 0; m < nSamplesForRendering; m++ )
            for ( m = 0; m < nSamplesForRendering; m++ )
            {
            {
                hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * st_ivas->hTcBuffer->nchan_transport_rend + ch];
                hTcBuffer->tc[ch][n_samples_still_available + hTcBuffer->n_samples_discard + m] = data[m * hTcBuffer->nchan_transport_rend + ch];
            }
            }
        }
        }


@@ -850,7 +850,7 @@ void ivas_dec_feed_tc_to_renderer(
            }
            }
        }
        }


        n_render_timeslots = st_ivas->hTcBuffer->n_samples_available / st_ivas->hTcBuffer->n_samples_granularity;
        n_render_timeslots = hTcBuffer->n_samples_available / hTcBuffer->n_samples_granularity;
    }
    }
    else
    else
    {
    {
@@ -861,7 +861,7 @@ void ivas_dec_feed_tc_to_renderer(


        for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
        for ( n = 0; n < ivas_get_nchan_buffers_dec( st_ivas, st_ivas->sba_analysis_order, st_ivas->hDecoderConfig->ivas_total_brate ); n++ )
        {
        {
            st_ivas->hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */
            hTcBuffer->tc[n] = st_ivas->p_output_f[n]; /* note: buffers needed in the TD decorellator */
        }
        }


        hTcBuffer->n_samples_buffered = nSamplesForRendering;
        hTcBuffer->n_samples_buffered = nSamplesForRendering;
@@ -876,7 +876,7 @@ void ivas_dec_feed_tc_to_renderer(
    {
    {
        ivas_param_ism_dec_digest_tc( st_ivas, n_render_timeslots, p_data_f );
        ivas_param_ism_dec_digest_tc( st_ivas, n_render_timeslots, p_data_f );
    }
    }
    else if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC && st_ivas->hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_RENDERER )
    else if ( st_ivas->ivas_format == MC_FORMAT && st_ivas->mc_mode == MC_MODE_PARAMMC && hTcBuffer->tc_buffer_mode == TC_BUFFER_MODE_RENDERER )
    {
    {
        ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f );
        ivas_param_mc_dec_digest_tc( st_ivas, (uint8_t) n_render_timeslots, p_data_f );
    }
    }
@@ -1643,7 +1643,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
                    mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size );
                    mvr2r( st_ivas->hMasaIsmData->delayBuffer[ch_idx], tc_local[ch_idx], st_ivas->hMasaIsmData->delayBuffer_size );
                }
                }


                if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, hTcBuffer->n_samples_granularity ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_td_binaural_renderer_sf( st_ivas, p_output, n_samples_granularity ) ) != IVAS_ERR_OK )
                {
                {
                    return error;
                    return error;
                }
                }
@@ -1663,6 +1663,7 @@ ivas_error ivas_jbm_dec_flush_renderer(
                ISM_MODE ism_mode_orig;
                ISM_MODE ism_mode_orig;
                RENDERER_TYPE renderer_type_orig;
                RENDERER_TYPE renderer_type_orig;
                int32_t ivas_total_brate;
                int32_t ivas_total_brate;

                ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
                ivas_total_brate = st_ivas->hDecoderConfig->ivas_total_brate;
                renderer_type_orig = st_ivas->renderer_type;
                renderer_type_orig = st_ivas->renderer_type;
                ism_mode_orig = st_ivas->ism_mode;
                ism_mode_orig = st_ivas->ism_mode;
@@ -1709,12 +1710,12 @@ ivas_error ivas_jbm_dec_flush_renderer(
                set_s( st_ivas->hSpar->render_to_md_map, last_spar_md_idx, n_slots_still_available );
                set_s( st_ivas->hSpar->render_to_md_map, last_spar_md_idx, n_slots_still_available );
                set_s( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available );
                set_s( st_ivas->hSpatParamRendCom->render_to_md_map, last_dirac_md_idx, n_slots_still_available );


                if ( ( error = ivas_osba_dirac_td_binaural( st_ivas, (uint16_t) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK )
                /* render the last subframe */
                /* render the last subframe */
                    if ( ( error = ivas_osba_dirac_td_binaural( st_ivas, (uint16_t) hTcBuffer->n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK )
                if ( ( error = ivas_osba_dirac_td_binaural( st_ivas, (uint16_t) n_samples_granularity, nSamplesRendered, &nSamplesAvailableNext, p_output ) ) != IVAS_ERR_OK )
                {
                {
                    return error;
                    return error;
                }
                }

#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
#ifdef NONBE_FIX_1297_SPAR_JBM_MEM_SAN
                st_ivas->ism_mode = ism_mode_orig;
                st_ivas->ism_mode = ism_mode_orig;
                st_ivas->renderer_type = renderer_type_orig;
                st_ivas->renderer_type = renderer_type_orig;