diff --git a/apps/decoder.c b/apps/decoder.c index 968dc79ec2b69bcff8bc225c0203931c3f9ccb9f..11f85e6d12d932028fcd6486ba2bd940bf6c6ddf 100644 --- a/apps/decoder.c +++ b/apps/decoder.c @@ -70,11 +70,15 @@ static #endif int32_t frame = 0; /* Counter of frames */ -#define MIN_NUM_BITS_ACTIVE_FRAME 56 -#define NUM_BITS_SID_IVAS_4K4 88 -#define NUM_BITS_SID_IVAS_7K8 156 -#define NUM_BITS_SID_IVAS_9K3 186 -#define NUM_BITS_SID_IVAS_10K2 204 +#define MIN_NUM_BITS_ACTIVE_FRAME 56 +#ifdef REMOVE_SID_HARM_LEFTOVERS +#define NUM_BITS_SID_IVAS_5K2 104 +#else +#define NUM_BITS_SID_IVAS_4K4 88 +#define NUM_BITS_SID_IVAS_7K8 156 +#define NUM_BITS_SID_IVAS_9K3 186 +#define NUM_BITS_SID_IVAS_10K2 204 +#endif #define META_LINE_LENGTH 200 #define MAX_FRAME_SIZE ( 48000 / 50 ) #define MAX_NUM_OUTPUT_CHANNELS 16 @@ -350,7 +354,11 @@ int main( fprintf( stderr, "\nError: input bitstream file %s couldn't be read\n\n", arg.inputBitstreamFilename ); goto cleanup; } +#ifdef REMOVE_SID_HARM_LEFTOVERS + } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_5K2 ); +#else } while ( bfi || num_bits < MIN_NUM_BITS_ACTIVE_FRAME || num_bits == NUM_BITS_SID_IVAS_4K4 || num_bits == NUM_BITS_SID_IVAS_7K8 || num_bits == NUM_BITS_SID_IVAS_9K3 || num_bits == NUM_BITS_SID_IVAS_10K2 ); +#endif BS_Reader_Rewind( hBsReader ); diff --git a/lib_com/options.h b/lib_com/options.h index 8e8a24dd2ed01e212a06ede2044a6d8b371b92bb..ad2a3d318718e4bb523eaef450922b42a580a4de 100644 --- a/lib_com/options.h +++ b/lib_com/options.h @@ -149,6 +149,7 @@ #define FIX_MCT_PLC_RECOVERY /* Issue 184: scale the old synthesis part correctly in the first good frame after lost frames in MCT modes - to be activated after previous switch is merged */ #define SBA_BR_SWITCHING /* Issue 114: Changes for sba bit rate switching*/ #define FIX_AGC_WINFUNC_MEMORY /* Issue 62: lower agc_com.winFunc memory consumption */ +#define REMOVE_SID_HARM_LEFTOVERS /* Issue 192: remove leftovers from the SID bitrate harmonization */ /* ################## End DEVELOPMENT switches ######################### */