Commit 321492f4 authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

use global frame counter instead of function argument

parent 05d0e260
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -756,12 +756,7 @@ int main(
        }

        /* *** Encode one frame *** */
        if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits
#ifdef DBG_BITSTREAM_ANALYSIS
                                                     ,
                                                     frame
#endif
                                                     ) ) != IVAS_ERR_OK )
        if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits ) ) != IVAS_ERR_OK )
        {
            fprintf( stderr, "\nencodeFrame failed: %s\n\n", IVAS_ENC_GetErrorMessage( error ) );
            goto cleanup;
+0 −5
Original line number Diff line number Diff line
@@ -3671,14 +3671,9 @@ static ivas_error write_indices_element(
 *-------------------------------------------------------------------*/

ivas_error write_indices_ivas(

    Encoder_Struct *st_ivas, /* i/o: encoder state structure             */
    uint16_t *bit_stream,    /* i/o: output bitstream                    */
    uint16_t *num_bits       /* i  : number of indices written to output */
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif
)
{
    int16_t i, n;
+2 −2
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@
/* ################### Start DEBUGGING switches ########################### */

#ifndef RELEASE
/*#define DEBUGGING*/                           /* Activate debugging part of the code */
#define DEBUGGING                          /* Activate debugging part of the code */
#endif
/*#define WMOPS*/                               /* Activate complexity and memory counters */
/*#define WMOPS_PER_FRAME*/                     /* Output per-frame complexity (writes one float value per frame to the file "wmops_analysis") */
@@ -57,7 +57,7 @@
/*#define MEM_COUNT_DETAILS*/                   /* Output detailed memory analysis for the worst-case frame (writes to the file "mem_analysis.csv") */

#ifdef DEBUGGING
/*#define DBG_BITSTREAM_ANALYSIS*/              /* Write bitstream with annotations to a text file */
#define DBG_BITSTREAM_ANALYSIS              /* Write bitstream with annotations to a text file */
/*#define DEBUG_MODE_INFO*/                     /* output most important parameters to the subdirectory "res/" */
#ifdef DEBUG_MODE_INFO
/*#define DEBUG_MODE_ACELP*/                    /* output most important ACELP core parameters to the subdirectory "res/" */
+0 −4
Original line number Diff line number Diff line
@@ -609,10 +609,6 @@ ivas_error write_indices_ivas(
    Encoder_Struct *st_ivas, /* i/o: encoder state structure                                       */
    uint16_t *bit_stream,    /* i/o: output bitstream                                              */
    uint16_t *num_bits       /* i/o: number of bits written to output                              */
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif
);

Word16 rate2EVSmode(
+2 −22
Original line number Diff line number Diff line
@@ -1143,11 +1143,6 @@ ivas_error IVAS_ENC_EncodeFrameToSerial(
    int16_t inputBufferSize,   /* i  : total number of samples in the input buffer. Related function: IVAS_ENC_GetInputBufferSize()        */
    uint16_t *outputBitStream, /* o  : pointer to serial output bitstream. The array must already be allocated and be of size at least IVAS_MAX_BITS_PER_FRAME */
    uint16_t *numOutBits       /* o  : number of bits written to output bitstream. Each bit is stored as a single uint16_t value           */
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif

)
{
    Encoder_Struct *st_ivas;
@@ -1351,12 +1346,7 @@ ivas_error IVAS_ENC_EncodeFrameToSerial(
    }

    /* write indices into bitstream buffer */
    write_indices_ivas( st_ivas, outputBitStream, numOutBits
#ifdef DBG_BITSTREAM_ANALYSIS
                        ,
                        frame
#endif
    );
    write_indices_ivas( st_ivas, outputBitStream, numOutBits );

    /* Reset switching flag before next call - can be set to "true" by some setters */
    hIvasEnc->switchingActive = false;
@@ -1377,22 +1367,12 @@ ivas_error IVAS_ENC_EncodeFrameToCompact(
    const int16_t inputBufferSize, /* i  : total number of samples in the input buffer. Related function: IVAS_ENC_GetInputBufferSize()        */
    uint8_t *outputBitStream,      /* o  : pointer to compact output bitstream. The array must already be allocated.                           */
    uint16_t *numOutBits           /* o  : number of bits written to output bitstream                                                          */
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif

)
{
    ivas_error error;
    uint16_t bitstream[IVAS_MAX_BITS_PER_FRAME];

    if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, inputBuffer, inputBufferSize, bitstream, numOutBits
#ifdef DBG_BITSTREAM_ANALYSIS
                                                 ,
                                                 frame
#endif
                                                 ) ) != IVAS_ERR_OK )
    if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, inputBuffer, inputBufferSize, bitstream, numOutBits ) ) != IVAS_ERR_OK )
    {
        return error;
    }
Loading