Commit 3891a518 authored by vaillancour's avatar vaillancour Committed by Manuel Jander
Browse files

fix during switching

parent a5992c0d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -530,11 +530,12 @@ void reset_indices_enc_fx(
    move16();
    hBstr->nb_bits_tot = 0;
    move16();
#ifndef HARM_PUSH_BIT
    hBstr->next_ind_fx = 0;
    move16();
    hBstr->last_ind_fx = -1;
    move16();

#endif
    FOR( i = 0; i < max_num_indices; i++ )
    {
        hBstr->ind_list[i].nb_bits = -1;
+17 −1
Original line number Diff line number Diff line
@@ -62,7 +62,10 @@ void acelp_core_switch_enc_fx(
    Word16 Aq[2 * ( M + 1 )];
    LPD_state_HANDLE hLPDmem; /* ACELP LPDmem memories */
    BSTR_ENC_HANDLE hBstr = st_fx->hBstr;

#ifdef HARM_PUSH_BIT
    UWord16 value;
    Word16 nb_bits;
#endif
    hLPDmem = st_fx->hLPDmem;

    /* initializations */
@@ -153,6 +156,18 @@ void acelp_core_switch_enc_fx(

    encod_gen_voic_core_switch_fx( st_fx, st_fx->last_L_frame, inp, Aq, A, T_op, exc, cbrate, shift, Q_new );

#ifdef HARM_PUSH_BIT
    i = find_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START, &value, &nb_bits );
#ifdef DEBUGGING
    assert( i >= 0 && "Internal error in ACELP core switching - unable to find ACELP subframe indices!" );
#endif
    while ( hBstr->ind_list[i].id == TAG_ACELP_SUBFR_LOOP_START )
    {
        push_indice( hBstr, IND_CORE_SWITCHING_CELP_SUBFRAME, hBstr->ind_list[i].value, hBstr->ind_list[i].nb_bits );
        i++;
    }
    delete_indice( hBstr, TAG_ACELP_SUBFR_LOOP_START );
#else
    /*----------------------------------------------------------------*
     * bit-stream: modify the layer of sub frame CELP
     *----------------------------------------------------------------*/
@@ -165,6 +180,7 @@ void acelp_core_switch_enc_fx(
        hBstr->ind_list[TAG_ACELP_SUBFR_LOOP_START + i].nb_bits = -1; /* Q0 */
        move16();
    }
#endif
    /*----------------------------------------------------------------*
     * BWE encoding
     *----------------------------------------------------------------*/
+2 −1
Original line number Diff line number Diff line
@@ -92,9 +92,10 @@ typedef struct bitstream_enc_data_structure
    void *st_ivas;                /* IVAS encoder structure */
    // Word16 nb_bits_tot_fx; /* total number of bits already written */
    // Indice *ind_list_fx; /* list of indices */
#ifndef HARM_PUSH_BIT
    Word16 next_ind_fx; /* pointer to the next empty slot in the list of indices */
    Word16 last_ind_fx; /* last written indice */

#endif
} BSTR_ENC_DATA, *BSTR_ENC_HANDLE;

/*----------------------------------------------------------------------------------*