Commit 6d47e744 authored by Michael Sturm's avatar Michael Sturm
Browse files

Unifies IGFEncWriteBitstream_fx function.

parent 1e8ce785
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -9976,6 +9976,7 @@ void IGFSaveSpectrumForITF_ivas_fx(
    const Word32 *pITFSpectrum,      /* i  : MDCT spectrum                   */
    Word16 exp_pITFSpectrum );

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
Word16 IGFEncWriteBitstream_ivas_fx(
    const IGF_ENC_INSTANCE_HANDLE hIGFEnc, /* i  : instance handle of IGF Encoder                                              */
    BSTR_ENC_HANDLE hBstr,                 /* i/o: encoder bitstream handle                                                    */
@@ -9983,7 +9984,7 @@ Word16 IGFEncWriteBitstream_ivas_fx(
    const Word16 igfGridIdx,               /* i  : igf grid index see declaration of IGF_GRID_IDX for details                  */
    const Word16 isIndepFlag               /* i  : if 1 frame is independent, 0 = frame is coded with data from previous frame */
);

#endif
#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
Word16 IGFSCFEncoderEncode_ivas_fx(
    IGFSCFENC_INSTANCE_HANDLE hPublicData, /* i/o: handle to public data or NULL in case there was no instance created                           */
+12 −0
Original line number Diff line number Diff line
@@ -778,11 +778,19 @@ void enc_prm_fx(
            move16();
            IF( EQ_16( st->last_core, ACELP_CORE ) )
            {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                IGFEncWriteBitstream_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, IGF_GRID_LB_TRAN, 1, st->element_mode );
#else
                IGFEncWriteBitstream_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, IGF_GRID_LB_TRAN, 1 );
#endif
            }
            ELSE
            {
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                IGFEncWriteBitstream_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, IGF_GRID_LB_NORM, 1, st->element_mode );
#else
                IGFEncWriteBitstream_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, IGF_GRID_LB_NORM, 1 );
#endif
            }
        }
        total_nbbits = sub( hBstr->nb_bits_tot, nbits_start ); /* Q0 */
@@ -1265,7 +1273,11 @@ void writeTCXparam_fx(
                    }
                    st->hIGFEnc->infoTotalBitsPerFrameWritten = 0;
                    move16();
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
                    IGFEncWriteBitstream_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, gridIdx, 1, st->element_mode );
#else
                    IGFEncWriteBitstream_ivas_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, gridIdx, 1 );
#endif
                }

                total_nbbits = sub( hBstr->nb_bits_tot, nbits_start ); /* Q0 */
+8 −3
Original line number Diff line number Diff line
@@ -1677,7 +1677,12 @@ Word16 IGFEncWriteBitstream_fx(
    BSTR_ENC_HANDLE hBstr,                   /* i/o: encoder bitstream handle                                                     */
    Word16 *pBitOffset,                      /* i  : ptr to bitOffset counter                                                     */
    const Word16 igfGridIdx,                 /* i  : igf grid index see declaration of IGF_GRID_IDX for details                   */
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    const Word16 isIndepFlag,                /* i  : if 1 frame is independent, 0 = frame is coded with data from previous frame  */
    const Word16 element_mode                /* i  : IVAS element mode type                                                       */
#else
    const Word16 isIndepFlag                 /* i  : if 1 frame is independent, 0 = frame is coded with data from previous frame  */
#endif
)
{
    Word16 igfAllZero;
@@ -1696,7 +1701,7 @@ Word16 IGFEncWriteBitstream_fx(
    }

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    IGF_WriteEnvelope( hInstance, hBstr, pBitOffset, igfGridIdx, isIndepFlag, &igfAllZero, EVS_MONO );
    IGF_WriteEnvelope( hInstance, hBstr, pBitOffset, igfGridIdx, isIndepFlag, &igfAllZero, element_mode );
#else
    IGF_WriteEnvelope( hInstance, hBstr, pBitOffset, igfGridIdx, isIndepFlag, &igfAllZero );
#endif
@@ -4188,7 +4193,7 @@ static Word16 IGF_WriteFlatteningTrigger_ivas_fx(
    return totBitCount;
}
#endif

#ifndef FIX_2346_DUPLICATED_IGF_FUNCTIONS
/*-------------------------------------------------------------------*
 * IGFEncWriteBitstream()
 *
@@ -4244,7 +4249,7 @@ Word16 IGFEncWriteBitstream_ivas_fx(

    return hIGFEnc->infoTotalBitsPerFrameWritten;
}

#endif

/*-------------------------------------------------------------------*
 * IGFEncSetMode()
+4 −0
Original line number Diff line number Diff line
@@ -1096,7 +1096,11 @@ void enc_prm_igf_mdct(
        st->hIGFEnc->infoTotalBitsPerFrameWritten = 0;
        move16();

#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
        IGFEncWriteBitstream_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, ( st->last_core == ACELP_CORE ) ? IGF_GRID_LB_TRAN : IGF_GRID_LB_NORM, 1, st->element_mode );
#else
        IGFEncWriteBitstream_ivas_fx( st->hIGFEnc, hBstr, &st->hIGFEnc->infoTotalBitsPerFrameWritten, ( st->last_core == ACELP_CORE ) ? IGF_GRID_LB_TRAN : IGF_GRID_LB_NORM, 1 );
#endif
    }
    ELSE
    {
+5 −0
Original line number Diff line number Diff line
@@ -2556,7 +2556,12 @@ Word16 IGFEncWriteBitstream_fx(
    BSTR_ENC_HANDLE hBstr,                   /* i/o: encoder bitstream handle       */
    Word16 *pBitOffset,                      /**< in:     | ptr to bitOffset counter                                                     */
    const Word16 igfGridIdx,                 /**< in: Q0  | igf grid index see declaration of IGF_GRID_IDX for details                   */
#ifdef FIX_2346_DUPLICATED_IGF_FUNCTIONS
    const Word16 isIndepFlag,                /**< in: Q0  | if 1 frame is independent, 0 = frame is coded with data from previous frame  */
    const Word16 element_mode                /**< in:     | IVAS element mode type                                                       */
#else
    const Word16 isIndepFlag                 /**< in: Q0  | if 1 frame is independent, 0 = frame is coded with data from previous frame  */
#endif
);

void ACcontextMapping_encode2_no_mem_s17_LC_fx(
Loading