Commit 37be0604 authored by vaclav's avatar vaclav
Browse files

define local functions as "static" + correct comments

parent 6d4be006
Loading
Loading
Loading
Loading
Loading
+32 −17
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ struct IVAS_DEC


/*---------------------------------------------------------------------*
 * Local functions
 * Local function declarations
 *---------------------------------------------------------------------*/

static void IVAS_DEC_Close_VoIP( IVAS_DEC_VOIP *hVoIP );
@@ -107,14 +107,8 @@ static void store_JbmData( IVAS_DEC_VOIP *hVoIP, JB4_DATAUNIT_HANDLE dataUnit, c
static ivas_error evs_dec_main( Decoder_Struct *st_ivas, const int16_t nOutSamples, float *floatBuf, int16_t *pcmBuf );
static ivas_error input_format_API_to_internal( IVAS_DEC_INPUT_FORMAT input_format, int16_t *bitstream_format_internal, int16_t *sdp_hf_only, const bool is_voip_enabled );
static void init_decoder_config( DECODER_CONFIG_HANDLE hDecoderConfig );
static int16_t IVAS_DEC_VoIP_GetRenderGranularity( Decoder_Struct *st_ivas );
static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig( IVAS_DEC_HANDLE hIvasDec );
static ivas_error IVAS_DEC_VoIP_reconfigure( IVAS_DEC_HANDLE hIvasDec, const uint16_t nTransportChannels, const uint16_t l_ts );
static ivas_error IVAS_DEC_Setup( IVAS_DEC_HANDLE hIvasDec, uint16_t *nTcBufferGranularity, uint8_t *nTransportChannels, uint8_t *nOutChannels, uint16_t *nSamplesRendered, int16_t *data );
static ivas_error IVAS_DEC_GetTcSamples( IVAS_DEC_HANDLE hIvasDec, float *pcmBuf, int16_t *nOutSamples );
static ivas_error IVAS_DEC_RendererFeedTcSamples( IVAS_DEC_HANDLE hIvasDec, const int16_t nSamplesForRendering, int16_t *nSamplesResidual, float *pcmBuf );
static ivas_error IVAS_DEC_GetRenderedSamples( IVAS_DEC_HANDLE hIvasDec, const uint16_t nSamplesForRendering, uint16_t *nSamplesRendered, uint16_t *nSamplesAvailableNext, int16_t *pcmBuf );
static ivas_error IVAS_DEC_GetBufferedNumberOfSamples( IVAS_DEC_HANDLE hIvasDec, int16_t *nSamplesBuffered );


/*---------------------------------------------------------------------*
 * IVAS_DEC_Open()
@@ -180,6 +174,7 @@ ivas_error IVAS_DEC_Open(

    /* initialize Decoder Config. handle */
    init_decoder_config( hIvasDec->st_ivas->hDecoderConfig );

    /* initialize pointers to handles to NULL */
    ivas_initialize_handles_dec( st_ivas );

@@ -872,7 +867,7 @@ ivas_error IVAS_DEC_GetSamples(
/*---------------------------------------------------------------------*
 * IVAS_DEC_Setup( )
 *
 * Main function to decode to PCM data of the transport channels
 * 
 *---------------------------------------------------------------------*/

static ivas_error IVAS_DEC_Setup(
@@ -940,7 +935,7 @@ static ivas_error IVAS_DEC_Setup(
 * Main function to decode to PCM data of the transport channels
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_GetTcSamples(
static ivas_error IVAS_DEC_GetTcSamples(
    IVAS_DEC_HANDLE hIvasDec, /* i/o: IVAS decoder handle                                                     */
    float *pcmBuf,            /* i/o: buffer for decoded PCM output. The memory must already be allocated and be able to hold the expected number of output samples, based on frame size and number of output channels  */
    int16_t *nOutSamples      /* o  : number of samples per channel written to output buffer                  */
@@ -992,7 +987,7 @@ ivas_error IVAS_DEC_GetTcSamples(
 * Main function to decode to PCM data of the transport channels
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_RendererFeedTcSamples(
static ivas_error IVAS_DEC_RendererFeedTcSamples(
    IVAS_DEC_HANDLE hIvasDec,           /* i/o: IVAS decoder handle                                                                 */
    const int16_t nSamplesForRendering, /* i  : number of TC samples wanted from the renderer                                       */
    int16_t *nSamplesResidual,          /* o  : number of samples not fitting into the renderer grid and buffer for the next call   */
@@ -1024,10 +1019,10 @@ ivas_error IVAS_DEC_RendererFeedTcSamples(
/*---------------------------------------------------------------------*
 * IVAS_DEC_GetRenderedSamples( )
 *
 * Main function to decode to PCM data of the transport channels
 * Main function to render the transport channels to PCM output datat
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_GetRenderedSamples(
static ivas_error IVAS_DEC_GetRenderedSamples(
    IVAS_DEC_HANDLE hIvasDec,            /* i/o: IVAS decoder handle                                        */
    const uint16_t nSamplesForRendering, /* i  : number of TC samples wanted from the renderer              */
    uint16_t *nSamplesRendered,          /* o  : number of samples rendered                                 */
@@ -1057,7 +1052,14 @@ ivas_error IVAS_DEC_GetRenderedSamples(
    return error;
}

ivas_error IVAS_DEC_GetBufferedNumberOfSamples(

/*---------------------------------------------------------------------*
 * IVAS_DEC_GetBufferedNumberOfSamples( )
 *
 * Returns the number of objects available in the decoded bitstream
 *---------------------------------------------------------------------*/

static ivas_error IVAS_DEC_GetBufferedNumberOfSamples(
    IVAS_DEC_HANDLE hIvasDec, /* i/o : IVAS decoder handle                                                     */
    int16_t *nSamplesBuffered /* o   : number of samples still buffered */
)
@@ -1279,6 +1281,7 @@ ivas_error IVAS_DEC_GetMasaMetadata(
    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_FeedHeadTrackData( )
 *
@@ -1341,6 +1344,7 @@ ivas_error IVAS_DEC_FeedHeadTrackData(
    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_FeedRefRotData( )
 *
@@ -1369,6 +1373,7 @@ ivas_error IVAS_DEC_FeedRefRotData(
    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_FeedRefVectorData( )
 *
@@ -1391,9 +1396,11 @@ ivas_error IVAS_DEC_FeedRefVectorData(
    }

    pOtr = hIvasDec->st_ivas->hHeadTrackData->OrientationTracker;

    return ivas_orient_trk_SetReferenceVector( pOtr, listenerPos, refPos );
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_FeedExternalOrientationData( )
 *
@@ -1438,6 +1445,7 @@ ivas_error IVAS_DEC_FeedExternalOrientationData(
    return IVAS_ERR_OK;
}


/*---------------------------------------------------------------------*
 * IVAS_DEC_FeedCustomLsData( )
 *
@@ -3169,6 +3177,13 @@ ivas_error IVAS_DEC_GetSbaDebugParams(

#endif /* DEBUGGING */


/*---------------------------------------------------------------------*
 * input_format_API_to_internal()
 *
 *
 *---------------------------------------------------------------------*/

static ivas_error input_format_API_to_internal(
    IVAS_DEC_INPUT_FORMAT input_format,
    int16_t *bitstream_format_internal,
@@ -3249,7 +3264,7 @@ static JBM_RENDERER_TYPE IVAS_DEC_VoIP_GetRendererConfig(
 *
 *---------------------------------------------------------------------*/

ivas_error IVAS_DEC_VoIP_reconfigure(
static ivas_error IVAS_DEC_VoIP_reconfigure(
    IVAS_DEC_HANDLE hIvasDec,
    const uint16_t nTransportChannels,
    const uint16_t l_ts )