Commit bcf96f35 authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

[strip] LC3PLUS_DEC_ALLOW_DISABLE_CACHING

parent 0b10348c
Loading
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@

ivas_error IVAS_LC3PLUS_DEC_Open(
    const LC3PLUS_CONFIG config, /* i  : LC3plus decoder configuration                        */
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    const int16_t enableCaching, /* i  : if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */
#endif
    IVAS_LC3PLUS_DEC_HANDLE *handle /* o  : decoder handle                                   */
)
{
@@ -70,9 +67,6 @@ ivas_error IVAS_LC3PLUS_DEC_Open(
    {
        return IVAS_ERROR( IVAS_ERR_WRONG_PARAMS, "Invalid lc3plus_frame_duration_us (0)\n" );
    }
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    ( *handle )->cachingEnabled = enableCaching;
#endif
    numLC3plusFramesPerIvasFrame = (int16_t) ( config.ivas_frame_duration_us / config.lc3plus_frame_duration_us );


@@ -100,10 +94,6 @@ ivas_error IVAS_LC3PLUS_DEC_Open(
        ( *handle )->selective_decoding_states[i] = NULL;
    }

#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    if ( enableCaching )
    {
#endif
        if ( ( ( *handle )->bitstream_caches = malloc( config.channels * sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE * ) ) ) == NULL )
        {
            IVAS_LC3PLUS_DEC_Close( handle );
@@ -113,9 +103,6 @@ ivas_error IVAS_LC3PLUS_DEC_Open(
        {
            ( *handle )->bitstream_caches[i] = NULL;
        }
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    }
#endif

    ( *handle )->num_decs = config.channels;
    for ( int32_t iCh = 0; iCh < config.channels; iCh++ )
@@ -173,10 +160,6 @@ ivas_error IVAS_LC3PLUS_DEC_Open(
            ( *handle )->selective_decoding_states[iCh]->frame_actions[lc3plusFrameIdx] = DEC_ACTION_DECODE_AND_USE;
        }

#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
        if ( enableCaching )
        {
#endif
            /* allocate and configure per LC3plus decoder bitstream cache */
            if ( ( ( *handle )->bitstream_caches[iCh] = malloc( sizeof( IVAS_LC3PLUS_DEC_BITSTREAM_CACHE ) ) ) == NULL )
            {
@@ -190,9 +173,6 @@ ivas_error IVAS_LC3PLUS_DEC_Open(
                return IVAS_ERROR( IVAS_ERR_FAILED_ALLOC, "Can not allocate memory for LC3plus decoder\n" );
            }
            ( *handle )->bitstream_caches[iCh]->bitstream_cache_size = 0;
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
        }
#endif
    }

    ( *handle )->config = config;
@@ -323,9 +303,6 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix(

                /* subframe not needed by the user, but might be required to re-initialize a decoder after inactivity */
                if (
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
                    handle->cachingEnabled &&
#endif
                    ( ivasSubframeIdx != actual_num_spatial_subframes - 1 ) && 1 == subframeChannelMatrix[ivasSubframeIdx + 1][decIdx] )
                {
                    /* ... but if the following subframe is required, it needs to be decoded and dropped */
@@ -339,10 +316,6 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix(
        }
    }

#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    if ( handle->cachingEnabled )
    {
#endif
        /* if a decoder was paused before, it needs to either:
         *      - Decode the cached frame (if available) and the first required frame OR
         *      - Decode the previous LC3plus subframe, even if it isn't needed by the user */
@@ -383,9 +356,6 @@ ivas_error IVAS_LC3PLUS_DEC_SetSelectiveDecodingMatrix(
                }
            }
        }
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    }
#endif

    return IVAS_ERR_OK;
}
+0 −6
Original line number Diff line number Diff line
@@ -83,16 +83,10 @@ typedef struct IVAS_LC3PLUS_DEC_HANDLE
    uint32_t num_decs;
    int16_t *pcm_conversion_buffer;
    LC3PLUS_CONFIG config;
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    int16_t cachingEnabled;
#endif
} * IVAS_LC3PLUS_DEC_HANDLE;

ivas_error IVAS_LC3PLUS_DEC_Open(
    const LC3PLUS_CONFIG config, /* i  : decoder configuration                              */
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
    const int16_t enableCaching, /* i  : if set to 0, the decoder will NOT use cached frame to flush algorithmic delay after skipped frames */
#endif
    IVAS_LC3PLUS_DEC_HANDLE *handle /* o  : decoder handle                                  */
);

+0 −3
Original line number Diff line number Diff line
@@ -7435,9 +7435,6 @@ static ivas_error renderSplitBinauralWithPostRot(
        config.samplerate = *splitBinInput->base.ctx.pOutSampleRate;

        if ( ( error = IVAS_LC3PLUS_DEC_Open( config,
#ifdef LC3PLUS_DEC_ALLOW_DISABLE_CACHING
                                              0 /* caching disabled */,
#endif
                                              &splitBinInput->splitPostRendWrapper.hLc3plusDec ) ) != IVAS_ERR_OK )
        {
            return error;