Commit c001690b authored by Dominik Weckbecker's avatar Dominik Weckbecker 💬
Browse files

move the new define to the DEBUGGING section

parent 21d52032
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -786,7 +786,7 @@ int main(

        /* *** Encode one frame *** */
        if ( ( error = IVAS_ENC_EncodeFrameToSerial( hIvasEnc, pcmBuf, pcmBufSize, bitStream, &numBits
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
                                                     ,
                                                     frame
#endif
+21 −21
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@
#include "ivas_cnst.h"
#include "ivas_rom_com.h"
#include "wmc_auto.h"
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
#include <string.h>
#endif

@@ -212,7 +212,7 @@ ivas_error ind_list_realloc(
        {
            new_ind_list[i].id = old_ind_list[i].id;
            new_ind_list[i].value = old_ind_list[i].value;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
            strncpy( new_ind_list[i].function_name, old_ind_list[i].function_name, 100 );
#endif
        }
@@ -223,7 +223,7 @@ ivas_error ind_list_realloc(
    for ( ; i < max_num_indices; i++ )
    {
        new_ind_list[i].nb_bits = -1;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
        sprintf( new_ind_list[i].function_name, "RESET in ind_list_realloc" );
#endif
    }
@@ -812,7 +812,7 @@ void move_indices(
            new_ind_list[i].value = old_ind_list[i].value;
            new_ind_list[i].nb_bits = old_ind_list[i].nb_bits;

#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
            strncpy( new_ind_list[i].function_name, old_ind_list[i].function_name, 100 );
#endif
            old_ind_list[i].nb_bits = -1;
@@ -825,12 +825,12 @@ void move_indices(
            new_ind_list[i].id = old_ind_list[i].id;
            new_ind_list[i].value = old_ind_list[i].value;
            new_ind_list[i].nb_bits = old_ind_list[i].nb_bits;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
            strncpy( new_ind_list[i].function_name, old_ind_list[i].function_name, 100 );
#endif

            old_ind_list[i].nb_bits = -1;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
            sprintf( old_ind_list[i].function_name, "RESET in move_indices" );
#endif
        }
@@ -909,7 +909,7 @@ ivas_error check_ind_list_limits(
    return error;
}

#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
const char *named_indices_table[] = {
    "IND_IVAS_FORMAT",
    "IND_SMODE_OMASA",
@@ -2837,7 +2837,7 @@ ivas_error push_indice(
            hBstr->ind_list[j].id = hBstr->ind_list[j - 1].id;
            hBstr->ind_list[j].nb_bits = hBstr->ind_list[j - 1].nb_bits;
            hBstr->ind_list[j].value = hBstr->ind_list[j - 1].value;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
            strncpy( hBstr->ind_list[j].function_name, hBstr->ind_list[j - 1].function_name, 100 );
#endif
        }
@@ -2848,7 +2848,7 @@ ivas_error push_indice(
    hBstr->ind_list[i].id = id;
    hBstr->ind_list[i].value = value;
    hBstr->ind_list[i].nb_bits = nb_bits;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    strncpy( hBstr->ind_list[i].function_name, named_indices_table[id], 100 );
#endif

@@ -2866,7 +2866,7 @@ ivas_error push_indice(
 *-------------------------------------------------------------------*/

ivas_error push_next_indice_(
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    const char *caller,
#endif
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle                    */
@@ -2913,7 +2913,7 @@ ivas_error push_next_indice_(
    hBstr->ind_list[hBstr->nb_ind_tot].value = value;
    hBstr->ind_list[hBstr->nb_ind_tot].nb_bits = nb_bits;

#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    strncpy( hBstr->ind_list[hBstr->nb_ind_tot].function_name, caller, 100 );
#endif

@@ -2932,7 +2932,7 @@ ivas_error push_next_indice_(


ivas_error push_next_bits_(
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    const char *caller,
#endif
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle                     */
@@ -2975,7 +2975,7 @@ ivas_error push_next_bits_(
        ptr->value = code;
        ptr->nb_bits = 16;
        ptr->id = prev_id;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
        strncpy( ptr->function_name, caller, 100 );
#endif
        hBstr->nb_ind_tot++;
@@ -2994,7 +2994,7 @@ ivas_error push_next_bits_(
        ptr->value = bits[i];
        ptr->nb_bits = 1;
        ptr->id = prev_id;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
        strncpy( ptr->function_name, caller, 100 );
#endif
        hBstr->nb_ind_tot++;
@@ -3066,7 +3066,7 @@ uint16_t delete_indice(
            hBstr->ind_list[j].id = hBstr->ind_list[i].id;
            hBstr->ind_list[j].value = hBstr->ind_list[i].value;
            hBstr->ind_list[j].nb_bits = hBstr->ind_list[i].nb_bits;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
            strncpy( hBstr->ind_list[j].function_name, hBstr->ind_list[i].function_name, 100 );
#endif
        }
@@ -3080,7 +3080,7 @@ uint16_t delete_indice(
    {
        /* reset the shifted indices at the end of the list */
        hBstr->ind_list[j].nb_bits = -1;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
        sprintf( hBstr->ind_list[j].function_name, "RESET in delete_indice" );
#endif
    }
@@ -3385,7 +3385,7 @@ static ivas_error write_indices_element(
    uint16_t **pt_stream,    /* i  : pointer to bitstream buffer                                     */
    const int16_t is_SCE,    /* i  : flag to distingusih SCE and CPE                                 */
    const int16_t element_id /* i  : id of the SCE or CPE                                            */
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif
@@ -3510,7 +3510,7 @@ static ivas_error write_indices_element(
    }


#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    if ( is_SCE ) /* EVS and SCE */
    {
        static FILE *f1 = 0;
@@ -3622,7 +3622,7 @@ 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 BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif
@@ -3692,7 +3692,7 @@ ivas_error write_indices_ivas(
    for ( n = 0; n < st_ivas->nSCE; n++ )
    {
        write_indices_element( st_ivas, &pt_stream, 1, n
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
                               ,
                               frame
#endif
@@ -3702,7 +3702,7 @@ ivas_error write_indices_ivas(
    for ( n = 0; n < st_ivas->nCPE; n++ )
    {
        write_indices_element( st_ivas, &pt_stream, 0, n
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
                               ,
                               frame
#endif
+2 −1
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@
/*#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 DISABLE_DFT_STEREO_ASSERT               /* This assert is hit for -10 dB tests/codec_be_on_mr_nonselection/test_param_file.py::test_param_file_tests[stv-stereo at 32 kbps, 48kHz in, 48kHz out, DTX on, random FER at 5%, bandwidth switching] */

/*#define DEBUG_MODE_INFO*/                         /* output most important parameters to the subdirectory "res/" */
@@ -144,7 +146,6 @@

/* #################### End FIXES switches ############################ */

#define BITSTREAM_ANALYSIS

/* clang-format on */

+4 −4
Original line number Diff line number Diff line
@@ -473,7 +473,7 @@ ivas_error push_indice(
    int16_t nb_bits        /* i  : number of bits used to quantize the indice  */
);

#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
#define push_next_indice( ... ) push_next_indice_( __func__, __VA_ARGS__ )
#define push_next_bits( ... )   push_next_bits_( __func__, __VA_ARGS__ );
#else
@@ -482,7 +482,7 @@ ivas_error push_indice(
#endif

ivas_error push_next_indice_(
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    const char *caller,
#endif
    BSTR_ENC_HANDLE hBstr,
@@ -491,7 +491,7 @@ ivas_error push_next_indice_(
);

ivas_error push_next_bits_(
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    const char *caller,
#endif
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle               */
@@ -588,7 +588,7 @@ 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 BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
    ,
    int32_t frame
#endif
+4 −4
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@
#include <assert.h>
#endif
#include "wmc_auto.h"
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
#include <string.h>
#endif

@@ -170,7 +170,7 @@ ivas_error ivas_corecoder_enc_reconfig(
                temp_ind_list[i].id = hBstr->ind_list[i].id;
                temp_ind_list[i].value = hBstr->ind_list[i].value;
                temp_ind_list[i].nb_bits = hBstr->ind_list[i].nb_bits;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
                strncpy( temp_ind_list[i].function_name, hBstr->ind_list[i].function_name, 100 );
#endif
                hBstr->ind_list[i].nb_bits = -1;
@@ -376,7 +376,7 @@ ivas_error ivas_corecoder_enc_reconfig(
                    st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id;
                    st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value;
                    st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
                    strncpy( st_ivas->hSCE[0]->hCoreCoder[0]->hBstr->ind_list[i].function_name, temp_ind_list[i].function_name, 100 );
#endif
                }
@@ -396,7 +396,7 @@ ivas_error ivas_corecoder_enc_reconfig(
                    st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].id = temp_ind_list[i].id;
                    st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].value = temp_ind_list[i].value;
                    st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].nb_bits = temp_ind_list[i].nb_bits;
#ifdef BITSTREAM_ANALYSIS
#ifdef DBG_BITSTREAM_ANALYSIS
                    strncpy( st_ivas->hCPE[0]->hCoreCoder[0]->hBstr->ind_list[i].function_name, temp_ind_list[i].function_name, 100 );
#endif
                }
Loading