Commit 4a39e3c4 authored by vaclav's avatar vaclav
Browse files

FIX_2425_REMOVE_RC_DUPLICATES

parent f4896dcb
Loading
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@
#define FIX_2404_HARM_SIGNAL_CLAS                       /* VA: basop-2404, harmonize signal_clas and signa_ivas_clas */
#define HARMONIZE_ACELP_ENC                             /* VA: basop issue 2400: Remove duplicated main ACELP encoder function */
#define FIX_2392_MSAN_DESTROY_DEC                       /* VA: basop issue 2392: fix MSAN in ivas_destroy_dec_fx() */
#define FIX_2425_REMOVE_RC_DUPLICATES                   /* VA: basop issue 2425: Remove duplicated RC encoder functions */

/* #################### End BE switches ################################## */

+6 −3
Original line number Diff line number Diff line
@@ -4212,12 +4212,13 @@ void rc_enc_finish_fx(
    PVQ_ENC_HANDLE hPVQ    /* i/o: PVQ encoder handle     */
);

#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_enc_finish_ivas_fx(
    BSTR_ENC_HANDLE hBstr,
    PVQ_ENC_HANDLE hPVQ /* i/o: PVQ encoder handle     */

);

#endif
void rc_encode_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle               */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                     */
@@ -4226,6 +4227,7 @@ void rc_encode_fx(
    UWord32 tot            /* i  : Total cumulative frequency           Q0*/
);

#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_encode_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle               */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                     */
@@ -4240,7 +4242,7 @@ void rc_enc_uniform_ivas_fx(
    UWord32 value,         /* i  : Value to encode                     Q0*/
    UWord32 tot            /* i  : Maximum value                       Q0*/
);

#endif
void rc_enc_uniform_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle              */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                    */
@@ -4255,13 +4257,14 @@ void rc_enc_bits_fx(
    Word16 bits            /* i  : Number of bits used                Q0*/
);

#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_enc_bits_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle             */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                   */
    UWord32 value,         /* i  : Value to encode                    Q0*/
    Word16 bits            /* i  : Number of bits used                Q0*/
);

#endif
void re8_compute_base_index_fx(
    const Word16 *x, /* i  : Elemen of Q2, Q3 or Q4                          */
    const Word16 ka, /* i  : Identifier of the absolute leader related to x  */
+12 −0
Original line number Diff line number Diff line
@@ -351,7 +351,11 @@ void pvq_encode_frame_ivas_fx(
        }
    }

#ifdef FIX_2425_REMOVE_RC_DUPLICATES
    rc_enc_finish_fx( hBstr, hPVQ );
#else
    rc_enc_finish_ivas_fx( hBstr, hPVQ );
#endif

    return;
}
@@ -977,7 +981,11 @@ static void densityIndexSymbolEncode_ivas_fx(
            }
        }

#ifdef FIX_2425_REMOVE_RC_DUPLICATES
        rc_encode_fx( hBstr, hPVQ, cum_freq, sym_freq, tot );
#else
        rc_encode_ivas_fx( hBstr, hPVQ, cum_freq, sym_freq, tot );
#endif
    }

    return;
@@ -1146,7 +1154,11 @@ static Word16 calc_pvq_splits_ivas_fx( /* o : Number of
                tmp = 1;
                move16();
            }
#ifdef FIX_2425_REMOVE_RC_DUPLICATES
            rc_enc_bits_fx( hBstr, hPVQ, tmp, 1 );
#else
            rc_enc_bits_ivas_fx( hBstr, hPVQ, tmp, 1 );
#endif
            Np = add( Np, tmp );
        }
    }
+9 −0
Original line number Diff line number Diff line
@@ -365,10 +365,19 @@ void pvq_encode_ivas_fx(
    entry = mpvq_encode_vec_fx( y, dim, pulses );

    /* send the short codeword(s) to the range encoder */
#ifdef FIX_2425_REMOVE_RC_DUPLICATES
    rc_enc_bits_fx( hBstr, hPVQ, UL_deposit_l( entry.lead_sign_ind ), 1 ); /* 0 or 1 */
#else
    rc_enc_bits_ivas_fx( hBstr, hPVQ, UL_deposit_l( entry.lead_sign_ind ), 1 ); /* 0 or 1 */
#endif

    IF( NE_16( dim, 1 ) )
    {
#ifdef FIX_2425_REMOVE_RC_DUPLICATES
        rc_enc_uniform_fx( hBstr, hPVQ, entry.index, entry.size );
#else
        rc_enc_uniform_ivas_fx( hBstr, hPVQ, entry.index, entry.size );
#endif
    }

    return;
+27 −3
Original line number Diff line number Diff line
@@ -11,10 +11,16 @@
#include "prot_fx_enc.h" /* Function prototypes                    */


/*-------------------------------------------------------------------*
 * Local funtions declarations
 *-------------------------------------------------------------------*/

static void rc_enc_shift_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ );
static void rc_enc_write_fx( BSTR_ENC_HANDLE hBstr, Word16 byte, Word16 bits );
#ifndef FIX_2425_REMOVE_RC_DUPLICATES
static void rc_enc_shift_ivas_fx( BSTR_ENC_HANDLE hBstr, PVQ_ENC_HANDLE hPVQ );
static void rc_enc_write_ivas_fx( BSTR_ENC_HANDLE hBstr, Word16 byte, Word16 bits );
#endif

/*-------------------------------------------------------------------*
 * rc_enc_init()
@@ -51,6 +57,7 @@ void rc_enc_init_fx(
 *
 *  Encode symbol with range coder
 *-------------------------------------------------------------------*/
#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_encode_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle              */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                    */
@@ -89,6 +96,8 @@ void rc_encode_ivas_fx(

    return;
}
#endif

void rc_encode_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle                */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                      */
@@ -131,10 +140,11 @@ void rc_encode_fx(
 *
 *  Finalize range coder
 *-------------------------------------------------------------------*/

#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_enc_finish_ivas_fx(
    BSTR_ENC_HANDLE hBstr,
    PVQ_ENC_HANDLE hPVQ /* i/o: PVQ encoder handle     */

)
{
    UWord32 val, mask, high;
@@ -215,6 +225,8 @@ void rc_enc_finish_ivas_fx(

    return;
}
#endif

void rc_enc_finish_fx(
    BSTR_ENC_HANDLE hBstr,
    PVQ_ENC_HANDLE hPVQ /* i/o: PVQ encoder handle     */
@@ -304,6 +316,7 @@ void rc_enc_finish_fx(
 *
 *  Shift a byte out to bitstream
 *-------------------------------------------------------------------*/
#ifndef FIX_2425_REMOVE_RC_DUPLICATES
static void rc_enc_shift_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle */
    PVQ_ENC_HANDLE hPVQ    /* i/o: PVQ encoder handle       */
@@ -338,6 +351,8 @@ static void rc_enc_shift_ivas_fx(
    move32();
    return;
}
#endif

static void rc_enc_shift_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle       */
    PVQ_ENC_HANDLE hPVQ    /* i/o: PVQ encoder handle     */
@@ -376,6 +391,7 @@ static void rc_enc_shift_fx(
 *
 *
 *-------------------------------------------------------------------*/
#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_enc_bits_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle             */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                   */
@@ -409,6 +425,8 @@ void rc_enc_bits_ivas_fx(

    return;
}
#endif

void rc_enc_bits_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle             */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                   */
@@ -445,6 +463,7 @@ void rc_enc_bits_fx(
 *
 * Encode with uniform distribution
 *-------------------------------------------------------------------*/
#ifndef FIX_2425_REMOVE_RC_DUPLICATES
void rc_enc_uniform_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle           */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                 */
@@ -469,6 +488,8 @@ void rc_enc_uniform_ivas_fx(

    return;
}
#endif

void rc_enc_uniform_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle           */
    PVQ_ENC_HANDLE hPVQ,   /* i/o: PVQ encoder handle                 */
@@ -499,6 +520,7 @@ void rc_enc_uniform_fx(
 *
 *  Write a byte to bitstream
 *-------------------------------------------------------------------*/
#ifndef FIX_2425_REMOVE_RC_DUPLICATES
static void rc_enc_write_ivas_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle           */
    Word16 byte,           /* i  : Byte to write                    Q0*/
@@ -509,6 +531,8 @@ static void rc_enc_write_ivas_fx(

    return;
}
#endif

static void rc_enc_write_fx(
    BSTR_ENC_HANDLE hBstr, /* i/o: encoder bitstream handle           */
    Word16 byte,           /* i  : Byte to write                    Q0*/