Commit ee2fab9c authored by advasila's avatar advasila
Browse files

alternative solution to issue 913

parent 89e6337c
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@
#define NONBE_UNIFIED_DECODING_PATHS                          /* FhG: unify decoding paths   */
#define NONBE_FIX_871_ACELP_CRASH_IN_OSBA                     /* FhG: isse 871: crash in ACELP core encoder with OSBA */
#define NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION               /* VA: issue 913: Resolve "Crash in OMASA encoder - DFT-Stereo bit-budget violated" */

#define NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION_ALT           /* Mokia: issue 913: Alternative complementary colution to crash */
/* ##################### End NON-BE switches ########################### */

/* ################## End DEVELOPMENT switches ######################### */
+9 −1
Original line number Diff line number Diff line
@@ -260,8 +260,16 @@ ivas_error ivas_cpe_dec(
                if ( st_ivas->ivas_format == MASA_FORMAT || st_ivas->ivas_format == MASA_ISM_FORMAT )
                {
                    nb_bits -= nb_bits_metadata;
#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION_ALT  
                    if ( hCPE->brate_surplus < 0 )
                    {
#endif
                        nb_bits += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC );
#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION_ALT
                    }
#else
                    nb_bits = min( nb_bits, 800 - 32 );
#endif
                }
#endif

+9 −1
Original line number Diff line number Diff line
@@ -656,9 +656,17 @@ ivas_error ivas_cpe_enc(
            if ( ivas_format == MASA_FORMAT || ivas_format == MASA_ISM_FORMAT )
            {
                max_bits -= nb_bits_metadata;
#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION_ALT  
                if ( hCPE->brate_surplus < 0 )
                {
#endif
                    max_bits += (int16_t) ( hCPE->brate_surplus / FRAMES_PER_SEC );
#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION_ALT
                }
#else
#ifdef NONBE_FIX_913_OMASA_BITBUDGET_VIOLATION
                max_bits = min( max_bits, 800 - 32 );
#endif
#endif
            }