Commit 4263280a authored by vaclav's avatar vaclav
Browse files

Merge branch...

Merge branch '2053-basop-PortMr2078-from-float-unnecessary-allocation-of-memories-for-channels-in-the-jbm-decoder' into 'main'

Port MR2078 from float to BASOP - Unnecessary allocation of memories for channels in the JBM decoder

Closes #2053

See merge request !2289
parents 02ace634 661dc761
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -192,8 +192,13 @@ typedef enum
#define JBM_CLDFB_SLOTS_IN_SUBFRAME_LOG2        2                           /* To be used for shift operation instead of division */
#define MAX_JBM_CLDFB_TIMESLOTS                 32
#define DEFAULT_JBM_CLDFB_TIMESLOTS             16
#ifdef JBM_MEMORY_OPT
#define MAX_JBM_L_FRAME48k                      ( IVAS_MAX_FRAME_SIZE * 2 ) /* 1920:  max. time-scaled frame buffer length (per channel) in samples */
#define MAX_JBM_L_FRAME_NS                      40000000L                   /* 40 ms: time-scaled frame size in ns, proportional to MAX_JBM_L_FRAME48k  */
#else
#define MAX_JBM_L_FRAME48k                      1920
#define MAX_JBM_L_FRAME_NS                      40000000L
#endif
#define MAX_SPAR_INTERNAL_CHANNELS              IVAS_SPAR_MAX_CH
#define MAX_CLDFB_DIGEST_CHANNELS               3                           /* == maximum of ParamISM TCs and ParamMC TCs */

+119 −99

File changed.

Preview size limit exceeded, changes collapsed.

+68 −0
Original line number Diff line number Diff line
@@ -149,6 +149,73 @@ UWord32 ivas_syn_output_fx(
    return noClipping; /*Q0*/
}

#ifdef JBM_MEMORY_OPT

/*-------------------------------------------------------------------*
 * ivas_buffer_interleaved_to_deinterleaved()
 *
 * Convert an interleaved buffer of audio channels to deinterleaved one
 *-------------------------------------------------------------------*/

void ivas_buffer_interleaved_to_deinterleaved_fx(
    Word32 *audio,             /* i/o: audio buffer                    */
    const Word16 n_channels,   /* i  : number of channels              */
    const Word16 frame_length, /* i  : frame length (one channel)      */
    const Word16 n_samp_full   /* i  : full frame length (one channel) */
)
{
    Word16 offset, ch, m;
    Word32 buffer[MAX_TRANSPORT_CHANNELS][MAX_JBM_L_FRAME48k];

    FOR( ch = 0; ch < n_channels; ch++ )
    {
        FOR( m = 0; m < frame_length; m++ )
        {
            buffer[ch][m] = audio[m * n_channels + ch];
            move32();
        }
    }

    offset = 0;
    move16();
    FOR( ch = 0; ch < n_channels; ch++ )
    {
        Copy32( buffer[ch], audio + offset, frame_length );
        offset = add( offset, n_samp_full );
    }

    return;
}


/*-------------------------------------------------------------------*
 * ivas_buffer_deinterleaved_to_interleaved()
 *
 * Convert a deinterleaved buffer of audio channels to interleaved one
 *-------------------------------------------------------------------*/

void ivas_buffer_deinterleaved_to_interleaved_fx(
    Word32 *audio[],           /* i/o: deinterleaved audio buffer      */
    const Word16 n_channels,   /* i  : number of channels              */
    const Word16 frame_length, /* i  : frame length (one channel)      */
    Word32 *audio_out          /* o  : interleaved audio buffer        */
)
{
    Word16 ch, m;

    FOR( ch = 0; ch < n_channels; ch++ )
    {
        FOR( m = 0; m < frame_length; m++ )
        {
            audio_out[m * n_channels + ch] = audio[ch][m];
            move32();
        }
    }

    return;
}

#else

/*-------------------------------------------------------------------*
 * ivas_syn_output_f()
@@ -183,6 +250,7 @@ void ivas_syn_output_f_fx(
    return;
}

#endif

/*-------------------------------------------------------------------*
 * mvr2r_inc()
+2 −0
Original line number Diff line number Diff line
@@ -110,10 +110,12 @@
#define FIX_1288_SPLIT_REND_XSAN                        /* Dlb: Fix asan, msan and usan issues in split rendering mode*/
#define FIX_NCHAN_BUFFERS                               /* VA: issue 1322: Correct the number of float buffers (channels) at the decoder */
#define FIX_RENDERER_STACK                              /* VA: issue 1322: reduction of renderers' buffers size */
#define JBM_MEMORY_OPT                                  /* VA: issue 916: optimization of RAM in the JBM decoder */
#define FIX_1370_EXTERNAL_ORIENTATION_CHECK             /* Nokia: add sanity check for Euler angles for external orientations */
#define FIX_1413_IGF_INIT_PRINTOUT                      /* FhG: use correct variable for IGF initiliazation */
#define CODE_IMPROVEMENTS


// object-editing feature porting
#define TMP_FIX_SPLIT_REND                              // temporary fix to split-rendering (it follows the later state of the framework but it is needed now because of current test-conditions)
#define TMP_FIX_OMASA_SR_BE                             // temporary fix to keep OMASA split-rendering BE
+3 −1
Original line number Diff line number Diff line
@@ -3395,12 +3395,14 @@ void ivas_destroy_dec_fx(
    /* Limiter struct */
    ivas_limiter_close_fx( &( st_ivas->hLimiter ) );

    /* Decoder configuration structure */
    IF( st_ivas->hDecoderConfig != NULL )
    {
        free( st_ivas->hDecoderConfig );
        st_ivas->hDecoderConfig = NULL;
    }

    /* JBM TC buffer structure */
    ivas_jbm_dec_tc_buffer_close_fx( &st_ivas->hTcBuffer );

    IF( st_ivas->hJbmMetadata != NULL )
Loading