Commit 13827795 authored by Rivukanta Bhattacharya's avatar Rivukanta Bhattacharya
Browse files

Merge branch 'main' into 501-address-sanitizer-error-in-first-frame-is-sid-testcases-for-sba

parents c033e0d1 f6ad1220
Loading
Loading
Loading
Loading
Loading

lib_com/bitstream.c

100644 → 100755
+40 −0
Original line number Diff line number Diff line
@@ -772,7 +772,11 @@ int16_t get_ivas_max_num_indices_metadata( /* o
        }
        else if ( ivas_total_brate <= IVAS_256k )
        {
#ifdef FIX_483b
            return 1050;
#else
            return 1000;
#endif
        }
        else if ( ivas_total_brate <= IVAS_384k )
        {
@@ -791,31 +795,59 @@ int16_t get_ivas_max_num_indices_metadata( /* o
        }
        else if ( ivas_total_brate <= IVAS_32k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 125;
#else
            return 110;
#endif
        }
        else if ( ivas_total_brate <= IVAS_48k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 205;
#else
            return 180;
#endif
        }
        else if ( ivas_total_brate <= IVAS_96k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 240;
#else
            return 200;
#endif
        }
        else if ( ivas_total_brate <= IVAS_128k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 305;
#else
            return 250;
#endif
        }
        else if ( ivas_total_brate <= IVAS_160k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 425;
#else
            return 320;
#endif
        }
        else if ( ivas_total_brate <= IVAS_192k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 630;
#else
            return 430;
#endif
        }
        else if ( ivas_total_brate <= IVAS_256k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 850;
#else
            return 600;
#endif
        }
        else if ( ivas_total_brate <= IVAS_384k )
        {
@@ -823,7 +855,11 @@ int16_t get_ivas_max_num_indices_metadata( /* o
        }
        else
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 1750;
#else
            return 1500;
#endif
        }
    }
    else if ( ivas_format == MC_FORMAT )
@@ -838,7 +874,11 @@ int16_t get_ivas_max_num_indices_metadata( /* o
        }
        else if ( ivas_total_brate <= IVAS_64k )
        {
#ifdef FIX_502_IND_LIST_SIZE
            return 210;
#else
            return 200;
#endif
        }
        else if ( ivas_total_brate <= IVAS_96k )
        {
+8 −0
Original line number Diff line number Diff line
@@ -212,9 +212,17 @@
#define FIX_I503_ASAN_ERROR_IND_LIST                    /* VA: fix issue #503: address sanitizer error with IND_LIST_DYN */
#define FIX_473_JITTER_NONDIEGETIC_PANNING              /* FhG,Orange: add missing non-diegetic panning to JITTER */

#define FIX_502_IND_LIST_SIZE                           /* Fix issue #502: insufficient index buffer sizes */

#ifdef HR_METADATA
#define FIX_505_MASA_SPHGRID_REUSE                      /* Nokia: Fix issue #505: MASA spherical grid reuse fix */
#endif

#define FIX_481_UNUSED_VARIABLES                        /* Nokia: Fix issue #481: Unused debug variables */

#define FIX_483                                         /* FhG: fix issue 483, division by zero in nois_est */
#define FIX_483b                                        /* FhG: fix issue 483, uninitialized values in ivas_mct_core_enc */

                                                        /* ################## End DEVELOPMENT switches ######################### */
/* clang-format on */

lib_com/rom_com.c

100644 → 100755
+0 −0

File mode changed from 100644 to 100755.

+66 −4
Original line number Diff line number Diff line
@@ -805,11 +805,23 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
)
{
    int16_t d, b, m;
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
    int16_t bits_diff_sum;
#endif
#else
    int16_t bits_diff_sum;
#endif
    int16_t nbands, start_band;
    IVAS_QDIRECTION *q_direction;
    int16_t start_index_0;
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
    int16_t bits_no_dirs_coh, bits_sur_coherence;
#endif
#else
    int16_t bits_no_dirs_coh, bits_sur_coherence;
#endif
    uint16_t all_coherence_zero;
    int16_t p[MASA_MAXIMUM_CODING_SUBBANDS], dif_p[MASA_MAXIMUM_CODING_SUBBANDS];
#ifdef FIX_HBR_MASAMETA
@@ -892,13 +904,25 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(

#endif
    /*Coherence flag decoding*/
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
    bits_no_dirs_coh = 0;
#endif
#else
    bits_no_dirs_coh = 0;
#endif
    all_coherence_zero = 1;
    if ( hQMetaData->coherence_flag )
    {
        /* read if coherence is zero */
        all_coherence_zero = bitstream[( *index )--];
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
        bits_no_dirs_coh += 1;
#endif
#else
        bits_no_dirs_coh += 1;
#endif
    }

    hQMetaData->all_coherence_zero = (uint8_t) all_coherence_zero;
@@ -934,7 +958,13 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
            p[b] = p[b - 1] + dif_p[b] + 1;
            hQMetaData->twoDirBands[p[b]] = 1;
        }
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
        bits_no_dirs_coh += ( d - *index );
#endif
#else
        bits_no_dirs_coh += ( d - *index );
#endif
    }

#ifdef FIX_HBR_MASAMETA
@@ -947,11 +977,25 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
        }
    }
#endif
    bits_diff_sum = ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[0] ) );
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
    bits_diff_sum =
#endif
#else
    bits_diff_sum =
#endif
        ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[0] ) );

    if ( hQMetaData->no_directions == 2 )
    {
        bits_diff_sum += ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[1] ) );
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
        bits_diff_sum +=
#endif
#else
        bits_diff_sum +=
#endif
            ivas_qmetadata_entropy_decode_diffuseness_hr_512( bitstream, index, &( hQMetaData->q_direction[1] ) );
    }


@@ -1000,11 +1044,24 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(

    if ( all_coherence_zero == 0 )
    {
        bits_sur_coherence = read_surround_coherence_hr( bitstream, index, hQMetaData );
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
        bits_sur_coherence =
#endif
#else
        bits_sur_coherence =
#endif
            read_surround_coherence_hr( bitstream, index, hQMetaData );
    }
    else
    {
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
        bits_sur_coherence = 0;
#endif
#else
        bits_sur_coherence = 0;
#endif
        /*Surround coherence*/
        for ( b = 0; b < hQMetaData->q_direction[0].cfg.nbands; b++ )
        {
@@ -1014,7 +1071,13 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
            }
        }
    }
#ifdef FIX_481_UNUSED_VARIABLES
#ifdef DEBUG_MODE_QMETADATA
    bits_no_dirs_coh += bits_sur_coherence;
#endif
#else
    bits_no_dirs_coh += bits_sur_coherence;
#endif

    for ( d = 0; d < hQMetaData->no_directions; d++ )
    {
@@ -1048,7 +1111,6 @@ int16_t ivas_qmetadata_dec_decode_hr_384_512(
        ivas_qmetadata_raw_decode_dir_512( q_direction, bitstream, index, nbands, start_band, sph_grid16 );

#ifdef DEBUG_MODE_QMETADATA

        fprintf( pF, "frame %d: diff %d  surcoh %d ", frame, bits_diff_sum, bits_sur_coherence );
        fprintf( pF, "dir %d\n", start_index_0 - *index );
        fprintf( pF_azi, "frame %d/dir/ec %d: ", frame, d );

lib_enc/ivas_mct_core_enc.c

100644 → 100755
+9 −0
Original line number Diff line number Diff line
@@ -264,6 +264,11 @@ void ivas_mct_core_enc(

            sp_aud_decision0[i] = hCPE[cpe_id]->hCoreCoder[0]->sp_aud_decision0;

#ifdef FIX_483b
            sts[i]->hTcxEnc->tns_ms_flag[0] = 0;
            sts[i]->hTcxEnc->tns_ms_flag[1] = 0;
#endif

            i++;
        }
    }
@@ -339,7 +344,11 @@ void ivas_mct_core_enc(

        for ( n = 0; n < nSubframes; n++ )
        {
#ifdef FIX_483b
            if ( sts[ch]->hTcxEnc->tns_ms_flag[n] )
#else
            if ( !sts[ch]->hTcxEnc->fUseTns[n] /*!sts[0]->fUseTns[n] && !sts[1]->fUseTns[n]*/ )
#endif
            {
                /* power spectrum: MDCT^2 + MDST^2 */
                for ( i = 0; i < L_subframeTCX; i++ )
Loading