From ddd339bcc3cb7ec3aee790deeecc7411a973177e Mon Sep 17 00:00:00 2001 From: vaclav Date: Sat, 9 Aug 2025 16:21:04 +0200 Subject: [PATCH] port MR --- lib_com/bitstream.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/lib_com/bitstream.c b/lib_com/bitstream.c index 41f6814c2..c22700aee 100644 --- a/lib_com/bitstream.c +++ b/lib_com/bitstream.c @@ -3286,7 +3286,6 @@ uint16_t get_indice_1( return st->bit_stream[pos]; } -#define WMC_TOOL_SKIP /*-------------------------------------------------------------------* * reset_indices_enc() @@ -4719,8 +4718,9 @@ ivas_error preview_indices( /*-------------------------------------------------------------------* * read_indices() * - * Read indices from an ITU-T G.192 bitstream to the buffer - * Simulate packet losses by inserting frame erasures + * Detect SID, NO_DATA, BFI, etc. and set bitstream pointers + * Set ivas_total_brate + * Note: each bit is represented in bitsream buffer as a uint16_t of value 0 or 1 *-------------------------------------------------------------------*/ /*! r: 1 = reading OK, 0 = problem */ @@ -4765,8 +4765,8 @@ ivas_error read_indices( /* convert the frame length to total bitrate */ total_brate = (int32_t) ( num_bits * FRAMES_PER_SEC ); - /* verify that a valid num bits value is present in the G.192 file */ - /* only AMRWB, EVS or IVAS bitrates or 0(NO DATA) are allowed in G.192 file frame reading */ + /* verify that a valid num bits value is present */ + /* only AMRWB, EVS or IVAS bitrates or 0 (NO DATA) are allowed */ if ( st_ivas->ivas_format != MONO_FORMAT ) { k = 0; @@ -4785,7 +4785,7 @@ ivas_error read_indices( } else if ( k == SIZE_IVAS_BRATE_TBL ) { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error, illegal bitrate (%d) in the G.192 frame ! Exiting ! \n", total_brate ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error, illegal bitrate (%d) detected! Exiting ! \n", total_brate ); } else { @@ -4798,12 +4798,12 @@ ivas_error read_indices( if ( rate2EVSmode( total_brate, NULL ) < 0 ) /* negative value means that a valid rate was not found */ { - return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error, illegal bitrate (%d) in the G.192 frame ! Exiting ! \n", total_brate ); + return IVAS_ERROR( IVAS_ERR_INTERNAL_FATAL, "Error, illegal bitrate (%d) detected! Exiting ! \n", total_brate ); } } - /* G.192 RX DTX handler*/ - /* handle SID_FIRST, SID_BAD, SPEECH_LOST, NO_DATA as properly as possible for the ITU-T G.192 format */ + /* RX DTX handler*/ + /* handle SID_FIRST, SID_BAD, SPEECH_LOST, NO_DATA */ /* (total_brate, bfi , st_CNG) = rx_handler(received frame type, [previous frame type], past CNG state, past core) */ curr_ft_good_sp = 0; curr_ft_bad_sp = 0; @@ -4977,6 +4977,7 @@ ivas_error read_indices( return error; } + /*-------------------------------------------------------------------* * get_rfFrameType() * @@ -5003,6 +5004,7 @@ static void get_rfFrameType( return; } + /*-------------------------------------------------------------------* * get_rfFlag() * @@ -5058,6 +5060,7 @@ static void get_rfFlag( return; } + /*-------------------------------------------------------------------* * get_rf_fec_offset() * @@ -5093,6 +5096,7 @@ static void get_rf_fec_offset( return; } + /*-------------------------------------------------------------------* * get_rfTargetBits() * @@ -5141,6 +5145,7 @@ static void get_rfTargetBits( return; } + /*-------------------------------------------------------------------* * berCheck() * @@ -5168,6 +5173,7 @@ static void berCheck( return; } + /*-------------------------------------------------------------------* * getPartialCopyInfo() * @@ -5394,5 +5400,3 @@ void dtx_read_padding_bits( return; } - -#undef WMC_TOOL_SKIP -- GitLab