From 31cb7d6a54410bcd8dad01cebebaf7e0f416766e Mon Sep 17 00:00:00 2001 From: vaclav Date: Wed, 9 Nov 2022 12:12:09 +0100 Subject: [PATCH] Issue 192: remove leftovers from the SID bitrate harmonization; under REMOVE_SID_HARM_LEFTOVERS --- apps/decoder.c | 18 +++++++++++++----- lib_com/options.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/apps/decoder.c b/apps/decoder.c index 968dc79ec2..11f85e6d12 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 8e8a24dd2e..ad2a3d3187 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 ######################### */ -- GitLab