Commit 881a5703 authored by stoutjesdijk's avatar stoutjesdijk 🎧
Browse files

Merge remote-tracking branch 'origin/main' into 196-refactor-renderer-output-configuration-cleanup

parents eb4c0559 1d5adce5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -690,7 +690,7 @@ clang-format-check:
# ---------------------------------------------------------------

# check bitexactness to EVS windows binaries
be-2-evs-windows:
.be-2-evs-windows: # Temporarily disabled -- Ericsson Windows runner used for HL activities which the reduces capacity for this job. To be resumed after selection
  extends:
    - .rules-main-push
  tags:
+80 −1
Original line number Diff line number Diff line
@@ -907,16 +907,22 @@ int16_t get_ivas_max_num_indices_metadata( /* o
 * Move indices inside the buffer or among two buffers
 *-------------------------------------------------------------------*/

#ifdef FIX_545_ASSERT
void move_indices(
#else
ivas_error move_indices(
#endif
    INDICE_HANDLE old_ind_list, /* i/o: old location of indices */
    INDICE_HANDLE new_ind_list, /* i/o: new location of indices */
    const int16_t nb_indices    /* i  : number of moved indices */
)
{
    int16_t i;
#ifndef FIX_545_ASSERT
    ivas_error error;

    error = IVAS_ERR_OK;
#endif

    if ( new_ind_list < old_ind_list )
    {
@@ -941,7 +947,11 @@ ivas_error move_indices(
        }
    }

#ifdef FIX_545_ASSERT
    return;
#else
    return error;
#endif
}

#endif
@@ -969,13 +979,24 @@ ivas_error check_ind_list_limits(
    if ( ( &hBstr->ind_list[hBstr->nb_ind_tot] - ivas_ind_list_zero ) >= *( hBstr->ivas_max_num_indices ) )
    {
#ifdef DEBUGGING
#ifdef FIX_545_ASSERT
        fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame );
#else
        /* TODO: replace with the warning message below before the finalization of the IVAS codec */
        /* fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); */
        assert( 0 && "The maximum number of indices has been exceeded! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata()." );
#endif
#endif

        /* reallocate the buffer of indices with increased limit */
#ifdef FIX_545_ASSERT
        if ( ( error = ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ) ) != IVAS_ERR_OK )
        {
            return error;
        }
#else
        ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES );
#endif
    }

    /* check, if we will not overwrite an existing indice */
@@ -996,13 +1017,24 @@ ivas_error check_ind_list_limits(
            if ( hBstr->ind_list >= ivas_ind_list_last )
            {
#ifdef DEBUGGING
#ifdef FIX_545_ASSERT
                fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame );
#else
                /* TODO: replace with the warning message below before the finalization of the IVAS codec */
                /* fprintf( stderr, "Warning: The maximum number of indices %d has been exceeded in frame %d! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata().\n", *( hBstr->ivas_max_num_indices ), frame ); */
                assert( 0 && "The maximum number of indices has been exceeded! Increase the limits in get_ivas_max_num_indices() or get_max_num_indices_metadata()." );
#endif
#endif

                /* no available empty slot -> need to re-allocate the buffer */
#ifdef FIX_545_ASSERT
                if ( ( error = ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES ) ) != IVAS_ERR_OK )
                {
                    return error;
                }
#else
                ind_list_realloc( hBstr, *( hBstr->ivas_max_num_indices ) + STEP_MAX_NUM_INDICES );
#endif
            }
        }
        else
@@ -1080,8 +1112,15 @@ ivas_error push_indice(

#ifdef IND_LIST_DYN
    /* check the limits of the list of indices */
#ifdef FIX_545_ASSERT
    if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
    {
        return IVAS_ERROR( error, "Error occured in push_indice() while re-allocating the list of indices (frame %d) !\n", frame );
    }
#else
    error = check_ind_list_limits( hBstr );
#endif
#endif

#ifdef IND_LIST_DYN
    /* find the location in the list of indices based on ID */
@@ -1203,8 +1242,15 @@ ivas_error push_next_indice(

#ifdef IND_LIST_DYN
    /* check the limits of the list of indices */
#ifdef FIX_545_ASSERT
    if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
    {
        return error;
    }
#else
    error = check_ind_list_limits( hBstr );
#endif
#endif

#ifdef IND_LIST_DYN
    /* get the id of the previous indice -> it will be re-used */
@@ -1246,9 +1292,17 @@ ivas_error push_next_indice(
 *-------------------------------------------------------------------*/

#ifdef DEBUG_BS_READ_WRITE
#ifdef FIX_545_ASSERT
ivas_error push_next_bits_(
#else
void push_next_bits_(
#endif
#else
#ifdef FIX_545_ASSERT
ivas_error push_next_bits(
#else
void push_next_bits(
#endif
#endif
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle                     */
    const uint16_t bits[], /* i  : bit buffer to pack, sequence of single bits  */
@@ -1265,6 +1319,11 @@ void push_next_bits(
    Indice *ptr;
#ifdef IND_LIST_DYN
    int16_t prev_id;
#ifdef FIX_545_ASSERT
    ivas_error error;

    error = IVAS_ERR_OK;
#endif
#endif
#ifdef DEBUG_BS_READ_WRITE
    printf( "%s: %d: %d\n", func, line, nb_bits );
@@ -1293,7 +1352,14 @@ void push_next_bits(

#ifdef IND_LIST_DYN
        /* check the limits of the list of indices */
#ifdef FIX_545_ASSERT
        if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
        {
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
        }
#else
        check_ind_list_limits( hBstr );
#endif
        ptr = &hBstr->ind_list[hBstr->nb_ind_tot];
#endif

@@ -1313,7 +1379,14 @@ void push_next_bits(
    {
#ifdef IND_LIST_DYN
        /* check the limits of the list of indices */
#ifdef FIX_545_ASSERT
        if ( ( error = check_ind_list_limits( hBstr ) ) != IVAS_ERR_OK )
        {
            return IVAS_ERROR( error, "Error occured in push_next_bits() while re-allocating the list of indices (frame %d) !\n", frame );
        }
#else
        check_ind_list_limits( hBstr );
#endif
        ptr = &hBstr->ind_list[hBstr->nb_ind_tot];
#endif

@@ -1334,7 +1407,11 @@ void push_next_bits(
#endif
    hBstr->nb_bits_tot = hBstr->nb_bits_tot + nb_bits;

#ifdef FIX_545_ASSERT
    return error;
#else
    return;
#endif
}


@@ -1535,10 +1612,12 @@ uint16_t get_indice(
{
    uint16_t value;
    int16_t i;
    int32_t nbits_total;

    assert( nb_bits <= 16 );
    int32_t nbits_total;

    nbits_total = st->total_brate / FRAMES_PER_SEC;

    /* detect corrupted bitstream */
    if ( pos + nb_bits > nbits_total )
    {
+4 −0
Original line number Diff line number Diff line
@@ -230,6 +230,9 @@
#define FIX_510                                         /* FhG: fix issue 510, misleading error message for invalid input format */
#define FIX_509                                         /* FhG: fix issue 509, too low number of bitsream indices in SBA */
#define FIX_519_JBM_ACCESS_NULL_TC_BUFFER               /* FhG: fix issue 519, accessing a yet uninitialized TC Buffer in frame 0*/
#ifdef IND_LIST_DYN
#define FIX_545_ASSERT                                  /* VA: fix issue 545, replace assert() with warning message when hitting memory limit in the buffer of indices */
#endif

#define FIX_TODO_NON_DIEGETIC_PAN_NOT_IMPLELENTED_IN_RENDERER /* ..\apps\renderer.c(240):  .... (todo: implementation)",*/
#define REMOVE_OBS_CODE                                 /* FhG: Remove unnecessary assignement after LFE cleanup (Issue #451)*/
@@ -237,6 +240,7 @@
#define ENHANCED_STEREO_DMX                             /* Orange : Contribution 48 - Enhanced stereo downmix. */

#define BINAURAL_AUDIO_CMDLINE
#define FIX_570_TCX_LPC_WRITE                           /* FhG: fix issue 570: LPC bitstream writer in TCX */

/* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */
+12 −0
Original line number Diff line number Diff line
@@ -505,9 +505,17 @@ ivas_error push_next_indice(

#ifdef DEBUG_BS_READ_WRITE
#define push_next_bits( ... ) push_next_bits_( __VA_ARGS__, __LINE__, __func__ )
#ifdef FIX_545_ASSERT
ivas_error push_next_bits_(
#else
void push_next_bits_(
#endif
#else
#ifdef FIX_545_ASSERT
ivas_error push_next_bits(
#else
void push_next_bits(
#endif
#endif
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle               */
    const uint16_t bits[], /* i  : bit buffer to pack, sequence of single bits */
@@ -548,7 +556,11 @@ ivas_error check_ind_list_limits(
    BSTR_ENC_HANDLE hBstr /* i/o: encoder bitstream handle                    */
);

#ifdef FIX_545_ASSERT
void move_indices(
#else
ivas_error move_indices(
#endif
    INDICE_HANDLE old_ind_list, /* i/o: old location of indices */
    INDICE_HANDLE new_ind_list, /* i/o: new location of indices */
    const int16_t nb_indices    /* i  : number of moved indices */
+0 −2
Original line number Diff line number Diff line
@@ -329,8 +329,6 @@ ivas_error ivas_init_encoder(
#ifndef IND_LIST_DYN
    ,
    Indice ind_list[][MAX_NUM_INDICES] /* o  : bitstream indices           */
#endif
#ifndef IND_LIST_DYN
    ,
    Indice ind_list_metadata[][MAX_BITS_METADATA] /* o  : bitstream indices metadata  */
#endif
Loading