Commit cad2671f authored by reutelhuber's avatar reutelhuber
Browse files

add FIX_483b which fixes use of uninitialized values in ivas_mct_core_enc

parent b6028550
Loading
Loading
Loading
Loading
Loading

lib_com/bitstream.c

100644 → 100755
+4 −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 )
        {

lib_com/options.h

100644 → 100755
+2 −1
Original line number Diff line number Diff line
@@ -206,7 +206,8 @@

#define FIX_485_STATIC_BUFFERS                          /* FhG: move static buffers in DirAC parameter estimator to the DirAC struct */

#define FIX_483                                         /* FhG: fix usse 483, division by zero in nois_est */
#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
+4 −0
Original line number Diff line number Diff line
@@ -21643,7 +21643,11 @@ const int16_t igf_tile_offset_table[IGF_BITRATE_UNKNOWN][2*IGF_MAX_TILES+1] = {
        { 4,  1, 0, 2, 40, 3, 80, 4, 140 },                                                 /* 48000  FB (stereo TCX10) */
        { 5,  2, 80, 4, 128, 6, 144, 7, 212, 9, 160 },                                      /* 64000  FB (stereo) */
        { 3,  2, 212, 4, 280, 6, 200 },                                                     /* 80000  FB (stereo) */
#if 1
        { 2,  3, 200, 5, 240},                                                              /* 96000  FB (stereo) */
#else
        { 2,  3, 320, 5, 240},                                                              /* 96000  FB (stereo) */
#endif
        { 1,  2, 416}                                                                       /*128000  FB (stereo) */
};

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++ )
+4 −0
Original line number Diff line number Diff line
@@ -430,6 +430,10 @@ void stereo_coder_tcx(

                if ( !sts[0]->hTcxEnc->fUseTns[k] && !sts[1]->hTcxEnc->fUseTns[k] )
                {
#ifdef FIX_483b
                    sts[0]->hTcxEnc->tns_ms_flag[k] = 1;
                    sts[1]->hTcxEnc->tns_ms_flag[k] = 1;
#endif
                    ms_inv_mask_processing( hStereoMdct, sts, ms_mask, k, mdst_spectrum[0][k], mdst_spectrum[1][k], inv_mdst_spectrum[0][k], inv_mdst_spectrum[1][k], -1 );
                    ms_processing( hStereoMdct, sts, ms_mask, k, mdst_spectrum[0][k], mdst_spectrum[1][k], sfbConf->sfbCnt );
                }