This CL contains some refactoring. Spectrum coding is main place that is affected. Therefore, I have bit-exactness test, test_spectrum_

coding.c, to be sure about the changelist. You can go through the test to be sure the changes are tested. However, I don't intend to commi
t the test, as it would be a source of confusion and requires hack to iSAC to be able to run the test. It is basically a one-time test. 

The part which not covered in this test is where we limit payload for super-wideband bit-stream. I'll add a test for that as well. 

I kept format changes at minimum in all files except isac.c, which was in bad shape, and coding changes were minimum. I'm planning to uplo
ad following patches to this CL where I try to address formatting issues. But I don't intend to change variable names, for the moment. 

The refactoring is not yet finished, so you would find part of the code which could be cleaned up, especially KLT transforms in entropy_co
ding.c
Review URL: https://webrtc-codereview.appspot.com/580004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2359 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
turaj@webrtc.org
2012-06-04 20:04:58 +00:00
parent 2cc55096d5
commit ba108aee21
7 changed files with 2666 additions and 4116 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
* *
* Use of this source code is governed by a BSD-style license * Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source * that can be found in the LICENSE file in the root of the source
@@ -21,57 +21,39 @@
#include "structs.h" #include "structs.h"
int WebRtcIsac_EstimateBandwidth(
BwEstimatorstr* bwest_str,
Bitstr* streamdata,
WebRtc_Word32 packet_size,
WebRtc_UWord16 rtp_seq_number,
WebRtc_UWord32 send_ts,
WebRtc_UWord32 arr_ts,
enum IsacSamplingRate encoderSampRate,
enum IsacSamplingRate decoderSampRate);
int WebRtcIsac_DecodeLb( void WebRtcIsac_ResetBitstream(Bitstr* bit_stream);
float* signal_out,
ISACLBDecStruct* ISACdec_obj,
WebRtc_Word16* current_framesamples,
WebRtc_Word16 isRCUPayload);
int WebRtcIsac_DecodeRcuLb( int WebRtcIsac_EstimateBandwidth(BwEstimatorstr* bwest_str, Bitstr* streamdata,
float* signal_out, WebRtc_Word32 packet_size,
ISACLBDecStruct* ISACdec_obj, WebRtc_UWord16 rtp_seq_number,
WebRtc_Word16* current_framesamples); WebRtc_UWord32 send_ts, WebRtc_UWord32 arr_ts,
enum IsacSamplingRate encoderSampRate,
enum IsacSamplingRate decoderSampRate);
int WebRtcIsac_EncodeLb( int WebRtcIsac_DecodeLb(float* signal_out, ISACLBDecStruct* ISACdec_obj,
float* in, WebRtc_Word16* current_framesamples,
ISACLBEncStruct* ISACencLB_obj, WebRtc_Word16 isRCUPayload);
WebRtc_Word16 codingMode,
WebRtc_Word16 bottleneckIndex);
int WebRtcIsac_EncodeStoredDataLb( int WebRtcIsac_DecodeRcuLb(float* signal_out, ISACLBDecStruct* ISACdec_obj,
const ISAC_SaveEncData_t* ISACSavedEnc_obj, WebRtc_Word16* current_framesamples);
Bitstr* ISACBitStr_obj,
int BWnumber,
float scale);
int WebRtcIsac_EncodeLb(float* in, ISACLBEncStruct* ISACencLB_obj,
WebRtc_Word16 codingMode, WebRtc_Word16
bottleneckIndex);
int WebRtcIsac_EncodeStoredDataUb12( int WebRtcIsac_EncodeStoredDataLb(const ISAC_SaveEncData_t* ISACSavedEnc_obj,
const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, Bitstr* ISACBitStr_obj, int BWnumber,
Bitstr* bitStream, float scale);
WebRtc_Word32 jitterInfo,
float scale);
int WebRtcIsac_EncodeStoredDataUb16(
const ISACUBSaveEncDataStruct* ISACSavedEnc_obj,
Bitstr* bitStream,
WebRtc_Word32 jitterInfo,
float scale);
int WebRtcIsac_EncodeStoredDataUb(
const ISACUBSaveEncDataStruct* ISACSavedEnc_obj, Bitstr* bitStream,
WebRtc_Word32 jitterInfo, float scale, enum ISACBandwidth bandwidth);
WebRtc_Word16 WebRtcIsac_GetRedPayloadUb( WebRtc_Word16 WebRtcIsac_GetRedPayloadUb(
const ISACUBSaveEncDataStruct* ISACSavedEncObj, const ISACUBSaveEncDataStruct* ISACSavedEncObj, Bitstr* bitStreamObj,
Bitstr* bitStreamObj, enum ISACBandwidth bandwidth);
enum ISACBandwidth bandwidth);
/****************************************************************************** /******************************************************************************
* WebRtcIsac_RateAllocation() * WebRtcIsac_RateAllocation()
* Internal function to perform a rate-allocation for upper and lower-band, * Internal function to perform a rate-allocation for upper and lower-band,
@@ -90,12 +72,10 @@ WebRtc_Word16 WebRtcIsac_GetRedPayloadUb(
* -1 if failed to allocate rates. * -1 if failed to allocate rates.
*/ */
WebRtc_Word16 WebRtc_Word16 WebRtcIsac_RateAllocation(WebRtc_Word32 inRateBitPerSec,
WebRtcIsac_RateAllocation( double* rateLBBitPerSec,
WebRtc_Word32 inRateBitPerSec, double* rateUBBitPerSec,
double* rateLBBitPerSec, enum ISACBandwidth* bandwidthKHz);
double* rateUBBitPerSec,
enum ISACBandwidth* bandwidthKHz);
/****************************************************************************** /******************************************************************************
@@ -113,10 +93,8 @@ WebRtcIsac_RateAllocation(
* Return value : >0 number of decoded bytes. * Return value : >0 number of decoded bytes.
* <0 if an error occurred. * <0 if an error occurred.
*/ */
int WebRtcIsac_DecodeUb16( int WebRtcIsac_DecodeUb16(float* signal_out, ISACUBDecStruct* ISACdec_obj,
float* signal_out, WebRtc_Word16 isRCUPayload);
ISACUBDecStruct* ISACdec_obj,
WebRtc_Word16 isRCUPayload);
/****************************************************************************** /******************************************************************************
@@ -134,10 +112,8 @@ int WebRtcIsac_DecodeUb16(
* Return value : >0 number of decoded bytes. * Return value : >0 number of decoded bytes.
* <0 if an error occurred. * <0 if an error occurred.
*/ */
int WebRtcIsac_DecodeUb12( int WebRtcIsac_DecodeUb12(float* signal_out, ISACUBDecStruct* ISACdec_obj,
float* signal_out, WebRtc_Word16 isRCUPayload);
ISACUBDecStruct* ISACdec_obj,
WebRtc_Word16 isRCUPayload);
/****************************************************************************** /******************************************************************************
@@ -155,10 +131,8 @@ int WebRtcIsac_DecodeUb12(
* Return value : >0 number of encoded bytes. * Return value : >0 number of encoded bytes.
* <0 if an error occurred. * <0 if an error occurred.
*/ */
int WebRtcIsac_EncodeUb16( int WebRtcIsac_EncodeUb16(float* in, ISACUBEncStruct* ISACenc_obj,
float* in, WebRtc_Word32 jitterInfo);
ISACUBEncStruct* ISACenc_obj,
WebRtc_Word32 jitterInfo);
/****************************************************************************** /******************************************************************************
@@ -176,117 +150,68 @@ int WebRtcIsac_EncodeUb16(
* Return value : >0 number of encoded bytes. * Return value : >0 number of encoded bytes.
* <0 if an error occurred. * <0 if an error occurred.
*/ */
int WebRtcIsac_EncodeUb12( int WebRtcIsac_EncodeUb12(float* in, ISACUBEncStruct* ISACenc_obj,
float* in, WebRtc_Word32 jitterInfo);
ISACUBEncStruct* ISACenc_obj,
WebRtc_Word32 jitterInfo);
/************************** initialization functions *************************/ /************************** initialization functions *************************/
void WebRtcIsac_InitMasking(MaskFiltstr *maskdata); void WebRtcIsac_InitMasking(MaskFiltstr* maskdata);
void WebRtcIsac_InitPreFilterbank(PreFiltBankstr *prefiltdata); void WebRtcIsac_InitPreFilterbank(PreFiltBankstr* prefiltdata);
void WebRtcIsac_InitPostFilterbank(PostFiltBankstr *postfiltdata); void WebRtcIsac_InitPostFilterbank(PostFiltBankstr* postfiltdata);
void WebRtcIsac_InitPitchFilter(PitchFiltstr *pitchfiltdata); void WebRtcIsac_InitPitchFilter(PitchFiltstr* pitchfiltdata);
void WebRtcIsac_InitPitchAnalysis(PitchAnalysisStruct *State); void WebRtcIsac_InitPitchAnalysis(PitchAnalysisStruct* State);
/**************************** transform functions ****************************/ /**************************** transform functions ****************************/
void WebRtcIsac_InitTransform(); void WebRtcIsac_InitTransform();
void WebRtcIsac_Time2Spec(double *inre1, void WebRtcIsac_Time2Spec(double* inre1, double* inre2, WebRtc_Word16* outre,
double *inre2, WebRtc_Word16* outim, FFTstr* fftstr_obj);
WebRtc_Word16 *outre,
WebRtc_Word16 *outim,
FFTstr *fftstr_obj);
void WebRtcIsac_Spec2time(double *inre, void WebRtcIsac_Spec2time(double* inre, double* inim, double* outre1,
double *inim, double* outre2, FFTstr* fftstr_obj);
double *outre1,
double *outre2,
FFTstr *fftstr_obj);
/******************************* filter functions ****************************/ /******************************* filter functions ****************************/
void WebRtcIsac_AllPoleFilter(double *InOut, void WebRtcIsac_AllPoleFilter(double* InOut, double* Coef, int lengthInOut,
double *Coef, int orderCoef);
int lengthInOut,
int orderCoef);
void WebRtcIsac_AllZeroFilter(double *In, void WebRtcIsac_AllZeroFilter(double* In, double* Coef, int lengthInOut,
double *Coef, int orderCoef, double* Out);
int lengthInOut,
int orderCoef,
double *Out);
void WebRtcIsac_ZeroPoleFilter(double *In, void WebRtcIsac_ZeroPoleFilter(double* In, double* ZeroCoef, double* PoleCoef,
double *ZeroCoef, int lengthInOut, int orderCoef, double* Out);
double *PoleCoef,
int lengthInOut,
int orderCoef,
double *Out);
/***************************** filterbank functions **************************/ /***************************** filterbank functions **************************/
void WebRtcIsac_SplitAndFilter(double *in, void WebRtcIsac_SplitAndFilterFloat(float* in, float* LP, float* HP,
double *LP, double* LP_la, double* HP_la,
double *HP, PreFiltBankstr* prefiltdata);
double *LP_la,
double *HP_la,
PreFiltBankstr *prefiltdata);
void WebRtcIsac_FilterAndCombine(double *InLP, void WebRtcIsac_FilterAndCombineFloat(float* InLP, float* InHP, float* Out,
double *InHP, PostFiltBankstr* postfiltdata);
double *Out,
PostFiltBankstr *postfiltdata);
void WebRtcIsac_SplitAndFilterFloat(float *in,
float *LP,
float *HP,
double *LP_la,
double *HP_la,
PreFiltBankstr *prefiltdata);
void WebRtcIsac_FilterAndCombineFloat(float *InLP,
float *InHP,
float *Out,
PostFiltBankstr *postfiltdata);
/************************* normalized lattice filters ************************/ /************************* normalized lattice filters ************************/
void WebRtcIsac_NormLatticeFilterMa(int orderCoef, void WebRtcIsac_NormLatticeFilterMa(int orderCoef, float* stateF, float* stateG,
float *stateF, float* lat_in, double* filtcoeflo,
float *stateG, double* lat_out);
float *lat_in,
double *filtcoeflo,
double *lat_out);
void WebRtcIsac_NormLatticeFilterAr(int orderCoef, void WebRtcIsac_NormLatticeFilterAr(int orderCoef, float* stateF, float* stateG,
float *stateF, double* lat_in, double* lo_filt_coef,
float *stateG, float* lat_out);
double *lat_in,
double *lo_filt_coef,
float *lat_out);
void WebRtcIsac_Dir2Lat(double *a, void WebRtcIsac_Dir2Lat(double* a, int orderCoef, float* sth, float* cth);
int orderCoef,
float *sth,
float *cth);
void WebRtcIsac_AutoCorr(double *r, void WebRtcIsac_AutoCorr(double* r, const double* x, int N, int order);
const double *x,
int N,
int order);
#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ */ #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_CODEC_H_ */

View File

@@ -35,13 +35,9 @@
* function to decode the bitstream * function to decode the bitstream
* returns the total number of bytes in the stream * returns the total number of bytes in the stream
*/ */
int int WebRtcIsac_DecodeLb(float* signal_out, ISACLBDecStruct* ISACdecLB_obj,
WebRtcIsac_DecodeLb( WebRtc_Word16* current_framesamples,
float* signal_out, WebRtc_Word16 isRCUPayload) {
ISACLBDecStruct* ISACdecLB_obj,
WebRtc_Word16* current_framesamples,
WebRtc_Word16 isRCUPayload)
{
int k; int k;
int len, err; int len, err;
WebRtc_Word16 bandwidthInd; WebRtc_Word16 bandwidthInd;
@@ -53,8 +49,8 @@ WebRtcIsac_DecodeLb(
double HPw[FRAMESAMPLES_HALF]; double HPw[FRAMESAMPLES_HALF];
double LPw_pf[FRAMESAMPLES_HALF]; double LPw_pf[FRAMESAMPLES_HALF];
double lo_filt_coef[(ORDERLO+1)*SUBFRAMES]; double lo_filt_coef[(ORDERLO + 1)*SUBFRAMES];
double hi_filt_coef[(ORDERHI+1)*SUBFRAMES]; double hi_filt_coef[(ORDERHI + 1)*SUBFRAMES];
double real_f[FRAMESAMPLES_HALF]; double real_f[FRAMESAMPLES_HALF];
double imag_f[FRAMESAMPLES_HALF]; double imag_f[FRAMESAMPLES_HALF];
@@ -68,104 +64,98 @@ WebRtcIsac_DecodeLb(
float gain; float gain;
int frame_nb; /* counter */ int frame_nb; /* counter */
int frame_mode; /* 0 for 20ms and 30ms, 1 for 60ms */ int frame_mode; /* 0 30ms, 1 for 60ms */
int processed_samples; /* Processed_samples: 480 (30, 60 ms). Cannot take other values. */
(ISACdecLB_obj->bitstr_obj).W_upper = 0xFFFFFFFF; WebRtcIsac_ResetBitstream(&(ISACdecLB_obj->bitstr_obj));
(ISACdecLB_obj->bitstr_obj).streamval = 0;
(ISACdecLB_obj->bitstr_obj).stream_index = 0;
len = 0; len = 0;
/* decode framelength and BW estimation - not used, /* Decode framelength and BW estimation - not used,
only for stream pointer*/ only for stream pointer*/
err = WebRtcIsac_DecodeFrameLen(&ISACdecLB_obj->bitstr_obj, err = WebRtcIsac_DecodeFrameLen(&ISACdecLB_obj->bitstr_obj,
current_framesamples); current_framesamples);
if (err < 0) { // error check if (err < 0) {
return err; return err;
} }
/* frame_mode: 0, or 1 */ /* Frame_mode:
frame_mode = *current_framesamples/MAX_FRAMESAMPLES; * 0: indicates 30 ms frame (480 samples)
/* processed_samples: either 320 (20ms) or 480 (30, 60 ms) */ * 1: indicates 60 ms frame (960 samples) */
processed_samples = *current_framesamples/(frame_mode+1); frame_mode = *current_framesamples / MAX_FRAMESAMPLES;
err = WebRtcIsac_DecodeSendBW(&ISACdecLB_obj->bitstr_obj, &bandwidthInd); err = WebRtcIsac_DecodeSendBW(&ISACdecLB_obj->bitstr_obj, &bandwidthInd);
if (err < 0) { // error check if (err < 0) {
return err; return err;
} }
/* one loop if it's one frame (20 or 30ms), 2 loops if 2 frames /* One loop if it's one frame (20 or 30ms), 2 loops if 2 frames
bundled together (60ms) */ bundled together (60ms). */
for (frame_nb = 0; frame_nb <= frame_mode; frame_nb++) { for (frame_nb = 0; frame_nb <= frame_mode; frame_nb++) {
/* decode & dequantize pitch parameters */ /* Decode & de-quantize pitch parameters */
err = WebRtcIsac_DecodePitchGain(&(ISACdecLB_obj->bitstr_obj), err = WebRtcIsac_DecodePitchGain(&ISACdecLB_obj->bitstr_obj,
PitchGains_Q12); PitchGains_Q12);
if (err < 0) { // error check if (err < 0) {
return err; return err;
} }
err = WebRtcIsac_DecodePitchLag(&ISACdecLB_obj->bitstr_obj, err = WebRtcIsac_DecodePitchLag(&ISACdecLB_obj->bitstr_obj, PitchGains_Q12,
PitchGains_Q12, PitchLags); PitchLags);
if (err < 0) { // error check if (err < 0) {
return err; return err;
} }
AvgPitchGain_Q12 = (PitchGains_Q12[0] + PitchGains_Q12[1] + AvgPitchGain_Q12 = (PitchGains_Q12[0] + PitchGains_Q12[1] +
PitchGains_Q12[2] + PitchGains_Q12[3])>>2; PitchGains_Q12[2] + PitchGains_Q12[3]) >> 2;
/* decode & dequantize FiltCoef */ /* Decode & de-quantize filter coefficients. */
err = WebRtcIsac_DecodeLpc(&ISACdecLB_obj->bitstr_obj, err = WebRtcIsac_DecodeLpc(&ISACdecLB_obj->bitstr_obj, lo_filt_coef,
lo_filt_coef,hi_filt_coef); hi_filt_coef);
if (err < 0) { // error check if (err < 0) {
return err; return err;
} }
/* decode & dequantize spectrum */ /* Decode & de-quantize spectrum. */
len = WebRtcIsac_DecodeSpecLb(&ISACdecLB_obj->bitstr_obj, len = WebRtcIsac_DecodeSpec(&ISACdecLB_obj->bitstr_obj, AvgPitchGain_Q12,
real_f, imag_f, AvgPitchGain_Q12); kIsacLowerBand, real_f, imag_f);
if (len < 0) { // error check if (len < 0) {
return len; return len;
} }
/* inverse transform */ /* Inverse transform. */
WebRtcIsac_Spec2time(real_f, imag_f, LPw, HPw, WebRtcIsac_Spec2time(real_f, imag_f, LPw, HPw,
&ISACdecLB_obj->fftstr_obj); &ISACdecLB_obj->fftstr_obj);
/* convert PitchGains back to FLOAT for pitchfilter_post */ /* Convert PitchGains back to float for pitchfilter_post */
for (k = 0; k < 4; k++) { for (k = 0; k < 4; k++) {
PitchGains[k] = ((float)PitchGains_Q12[k])/4096; PitchGains[k] = ((float)PitchGains_Q12[k]) / 4096;
} }
if (isRCUPayload) {
if(isRCUPayload)
{
for (k = 0; k < 240; k++) { for (k = 0; k < 240; k++) {
LPw[k] *= RCU_TRANSCODING_SCALE_INVERSE; LPw[k] *= RCU_TRANSCODING_SCALE_INVERSE;
HPw[k] *= RCU_TRANSCODING_SCALE_INVERSE; HPw[k] *= RCU_TRANSCODING_SCALE_INVERSE;
} }
} }
/* inverse pitch filter */ /* Inverse pitch filter. */
WebRtcIsac_PitchfilterPost(LPw, LPw_pf, WebRtcIsac_PitchfilterPost(LPw, LPw_pf, &ISACdecLB_obj->pitchfiltstr_obj,
&ISACdecLB_obj->pitchfiltstr_obj, PitchLags, PitchGains); PitchLags, PitchGains);
/* convert AvgPitchGain back to FLOAT for computation of gain */ /* Convert AvgPitchGain back to float for computation of gain. */
AvgPitchGain = ((float)AvgPitchGain_Q12)/4096; AvgPitchGain = ((float)AvgPitchGain_Q12) / 4096;
gain = 1.0f - 0.45f * (float)AvgPitchGain; gain = 1.0f - 0.45f * (float)AvgPitchGain;
for (k = 0; k < FRAMESAMPLES_HALF; k++) { for (k = 0; k < FRAMESAMPLES_HALF; k++) {
/* reduce gain to compensate for pitch enhancer */ /* Reduce gain to compensate for pitch enhancer. */
LPw_pf[ k ] *= gain; LPw_pf[k] *= gain;
} }
if(isRCUPayload) if (isRCUPayload) {
{
for (k = 0; k < FRAMESAMPLES_HALF; k++) { for (k = 0; k < FRAMESAMPLES_HALF; k++) {
/* compensation for transcoding gain changes*/ /* Compensation for transcoding gain changes. */
LPw_pf[k] *= RCU_TRANSCODING_SCALE; LPw_pf[k] *= RCU_TRANSCODING_SCALE;
HPw[k] *= RCU_TRANSCODING_SCALE; HPw[k] *= RCU_TRANSCODING_SCALE;
} }
} }
/* Perceptual post-filtering (using normalized lattice filter). */
/* perceptual post-filtering (using normalized lattice filter) */
WebRtcIsac_NormLatticeFilterAr( WebRtcIsac_NormLatticeFilterAr(
ORDERLO, ISACdecLB_obj->maskfiltstr_obj.PostStateLoF, ORDERLO, ISACdecLB_obj->maskfiltstr_obj.PostStateLoF,
(ISACdecLB_obj->maskfiltstr_obj).PostStateLoG, LPw_pf, lo_filt_coef, (ISACdecLB_obj->maskfiltstr_obj).PostStateLoG, LPw_pf, lo_filt_coef,
@@ -175,12 +165,11 @@ WebRtcIsac_DecodeLb(
(ISACdecLB_obj->maskfiltstr_obj).PostStateHiG, HPw, hi_filt_coef, (ISACdecLB_obj->maskfiltstr_obj).PostStateHiG, HPw, hi_filt_coef,
HP_dec_float); HP_dec_float);
/* recombine the 2 bands */ /* Recombine the 2 bands. */
WebRtcIsac_FilterAndCombineFloat(LP_dec_float, HP_dec_float, WebRtcIsac_FilterAndCombineFloat(LP_dec_float, HP_dec_float,
signal_out + frame_nb * processed_samples, signal_out + frame_nb * FRAMESAMPLES,
&ISACdecLB_obj->postfiltbankstr_obj); &ISACdecLB_obj->postfiltbankstr_obj);
} }
return len; return len;
} }
@@ -192,63 +181,56 @@ WebRtcIsac_DecodeLb(
* Contrary to lower-band, the upper-band (8-16 kHz) is not split in * Contrary to lower-band, the upper-band (8-16 kHz) is not split in
* frequency, but split to 12 sub-frames, i.e. twice as lower-band. * frequency, but split to 12 sub-frames, i.e. twice as lower-band.
*/ */
int int WebRtcIsac_DecodeUb16(float* signal_out, ISACUBDecStruct* ISACdecUB_obj,
WebRtcIsac_DecodeUb16( WebRtc_Word16 isRCUPayload) {
float* signal_out,
ISACUBDecStruct* ISACdecUB_obj,
WebRtc_Word16 isRCUPayload)
{
int len, err; int len, err;
double halfFrameFirst[FRAMESAMPLES_HALF]; double halfFrameFirst[FRAMESAMPLES_HALF];
double halfFrameSecond[FRAMESAMPLES_HALF]; double halfFrameSecond[FRAMESAMPLES_HALF];
double percepFilterParam[(UB_LPC_ORDER+1) * (SUBFRAMES<<1) + double percepFilterParam[(UB_LPC_ORDER + 1) * (SUBFRAMES << 1) +
(UB_LPC_ORDER+1)]; (UB_LPC_ORDER + 1)];
double real_f[FRAMESAMPLES_HALF]; double real_f[FRAMESAMPLES_HALF];
double imag_f[FRAMESAMPLES_HALF]; double imag_f[FRAMESAMPLES_HALF];
const WebRtc_Word16 kAveragePitchGain = 0; /* No pitch-gain for upper-band. */
len = 0; len = 0;
/* decode & dequantize FiltCoef */ /* Decode & de-quantize filter coefficients. */
memset(percepFilterParam, 0, sizeof(percepFilterParam)); memset(percepFilterParam, 0, sizeof(percepFilterParam));
err = WebRtcIsac_DecodeInterpolLpcUb(&ISACdecUB_obj->bitstr_obj, err = WebRtcIsac_DecodeInterpolLpcUb(&ISACdecUB_obj->bitstr_obj,
percepFilterParam, isac16kHz); percepFilterParam, isac16kHz);
if (err < 0) { // error check if (err < 0) {
return err; return err;
} }
/* decode & dequantize spectrum */ /* Decode & de-quantize spectrum. */
len = WebRtcIsac_DecodeSpecUB16(&ISACdecUB_obj->bitstr_obj, real_f, len = WebRtcIsac_DecodeSpec(&ISACdecUB_obj->bitstr_obj, kAveragePitchGain,
imag_f); kIsacUpperBand16, real_f, imag_f);
if (len < 0) { // error check if (len < 0) {
return len; return len;
} }
if(isRCUPayload) if (isRCUPayload) {
{
int n; int n;
for(n = 0; n < 240; n++) for (n = 0; n < 240; n++) {
{
real_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; real_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE;
imag_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; imag_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE;
} }
} }
/* Inverse transform. */
/* inverse transform */
WebRtcIsac_Spec2time(real_f, imag_f, halfFrameFirst, halfFrameSecond, WebRtcIsac_Spec2time(real_f, imag_f, halfFrameFirst, halfFrameSecond,
&ISACdecUB_obj->fftstr_obj); &ISACdecUB_obj->fftstr_obj);
/* perceptual post-filtering (using normalized lattice filter) */ /* Perceptual post-filtering (using normalized lattice filter). */
WebRtcIsac_NormLatticeFilterAr( WebRtcIsac_NormLatticeFilterAr(
UB_LPC_ORDER, ISACdecUB_obj->maskfiltstr_obj.PostStateLoF, UB_LPC_ORDER, ISACdecUB_obj->maskfiltstr_obj.PostStateLoF,
(ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, halfFrameFirst, (ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, halfFrameFirst,
&percepFilterParam[(UB_LPC_ORDER+1)], signal_out); &percepFilterParam[(UB_LPC_ORDER + 1)], signal_out);
WebRtcIsac_NormLatticeFilterAr( WebRtcIsac_NormLatticeFilterAr(
UB_LPC_ORDER, ISACdecUB_obj->maskfiltstr_obj.PostStateLoF, UB_LPC_ORDER, ISACdecUB_obj->maskfiltstr_obj.PostStateLoF,
(ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, halfFrameSecond, (ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, halfFrameSecond,
&percepFilterParam[(UB_LPC_ORDER + 1) * SUBFRAMES + (UB_LPC_ORDER+1)], &percepFilterParam[(UB_LPC_ORDER + 1) * SUBFRAMES + (UB_LPC_ORDER + 1)],
&signal_out[FRAMESAMPLES_HALF]); &signal_out[FRAMESAMPLES_HALF]);
return len; return len;
@@ -263,12 +245,8 @@ WebRtcIsac_DecodeUb16(
* reconstructed and 12-16 kHz replaced with zeros. Then two bands * reconstructed and 12-16 kHz replaced with zeros. Then two bands
* are combined, to reconstruct the upperband 8-16 kHz. * are combined, to reconstruct the upperband 8-16 kHz.
*/ */
int int WebRtcIsac_DecodeUb12(float* signal_out, ISACUBDecStruct* ISACdecUB_obj,
WebRtcIsac_DecodeUb12( WebRtc_Word16 isRCUPayload) {
float* signal_out,
ISACUBDecStruct* ISACdecUB_obj,
WebRtc_Word16 isRCUPayload)
{
int len, err; int len, err;
float LP_dec_float[FRAMESAMPLES_HALF]; float LP_dec_float[FRAMESAMPLES_HALF];
@@ -277,54 +255,45 @@ WebRtcIsac_DecodeUb12(
double LPw[FRAMESAMPLES_HALF]; double LPw[FRAMESAMPLES_HALF];
double HPw[FRAMESAMPLES_HALF]; double HPw[FRAMESAMPLES_HALF];
double percepFilterParam[(UB_LPC_ORDER+1)*SUBFRAMES]; double percepFilterParam[(UB_LPC_ORDER + 1)*SUBFRAMES];
double real_f[FRAMESAMPLES_HALF]; double real_f[FRAMESAMPLES_HALF];
double imag_f[FRAMESAMPLES_HALF]; double imag_f[FRAMESAMPLES_HALF];
const WebRtc_Word16 kAveragePitchGain = 0; /* No pitch-gain for upper-band. */
len = 0; len = 0;
/* decode & dequantize FiltCoef */ /* Decode & dequantize filter coefficients. */
err = WebRtcIsac_DecodeInterpolLpcUb(&ISACdecUB_obj->bitstr_obj, err = WebRtcIsac_DecodeInterpolLpcUb(&ISACdecUB_obj->bitstr_obj,
percepFilterParam, isac12kHz); percepFilterParam, isac12kHz);
if(err < 0) { // error check if (err < 0) {
return err; return err;
} }
/* decode & dequantize spectrum */ /* Decode & de-quantize spectrum. */
len = WebRtcIsac_DecodeSpecUB12(&ISACdecUB_obj->bitstr_obj, len = WebRtcIsac_DecodeSpec(&ISACdecUB_obj->bitstr_obj, kAveragePitchGain,
real_f, imag_f); kIsacUpperBand12, real_f, imag_f);
if(len < 0) { // error check if (len < 0) {
return len; return len;
} }
if(isRCUPayload) if (isRCUPayload) {
{
int n; int n;
for(n = 0; n < 240; n++) for (n = 0; n < 240; n++) {
{
real_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; real_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE;
imag_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE; imag_f[n] *= RCU_TRANSCODING_SCALE_UB_INVERSE;
} }
} }
/* Inverse transform. */
/* inverse transform */
WebRtcIsac_Spec2time(real_f, imag_f, LPw, HPw, &ISACdecUB_obj->fftstr_obj); WebRtcIsac_Spec2time(real_f, imag_f, LPw, HPw, &ISACdecUB_obj->fftstr_obj);
/* perceptual post-filtering (using normalized lattice filter) */ /* perceptual post-filtering (using normalized lattice filter) */
WebRtcIsac_NormLatticeFilterAr(UB_LPC_ORDER, WebRtcIsac_NormLatticeFilterAr(UB_LPC_ORDER,
ISACdecUB_obj->maskfiltstr_obj.PostStateLoF, ISACdecUB_obj->maskfiltstr_obj.PostStateLoF,
(ISACdecUB_obj->maskfiltstr_obj).PostStateLoG, (ISACdecUB_obj->maskfiltstr_obj).PostStateLoG,
LPw, percepFilterParam, LP_dec_float); LPw, percepFilterParam, LP_dec_float);
/* Zero for 12-16 kHz. */
/* Zerro for upper-band */
memset(HP_dec_float, 0, sizeof(float) * (FRAMESAMPLES_HALF)); memset(HP_dec_float, 0, sizeof(float) * (FRAMESAMPLES_HALF));
/* Recombine the 2 bands. */
/* recombine the 2 bands */
WebRtcIsac_FilterAndCombineFloat(HP_dec_float, LP_dec_float, signal_out, WebRtcIsac_FilterAndCombineFloat(HP_dec_float, LP_dec_float, signal_out,
&ISACdecUB_obj->postfiltbankstr_obj); &ISACdecUB_obj->postfiltbankstr_obj);
return len; return len;
} }

File diff suppressed because it is too large Load Diff

View File

@@ -19,18 +19,12 @@
#ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_
#define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_
#include "settings.h"
#include "structs.h" #include "structs.h"
/* decode complex spectrum (return number of bytes in stream) */
int WebRtcIsac_DecodeSpecLb(Bitstr *streamdata,
double *fr,
double *fi,
WebRtc_Word16 AvgPitchGain_Q12);
/****************************************************************************** /******************************************************************************
* WebRtcIsac_DecodeSpecUB16() * WebRtcIsac_DecodeSpec()
* Decode real and imaginary part of the DFT coefficients, given a bit-stream. * Decode real and imaginary part of the DFT coefficients, given a bit-stream.
* This function is called when the codec is in 0-16 kHz bandwidth.
* The decoded DFT coefficient can be transformed to time domain by * The decoded DFT coefficient can be transformed to time domain by
* WebRtcIsac_Time2Spec(). * WebRtcIsac_Time2Spec().
* *
@@ -38,68 +32,37 @@ int WebRtcIsac_DecodeSpecLb(Bitstr *streamdata,
* - streamdata : pointer to a stucture containg the encoded * - streamdata : pointer to a stucture containg the encoded
* data and theparameters needed for entropy * data and theparameters needed for entropy
* coding. * coding.
* - AvgPitchGain_Q12 : average pitch-gain of the frame. This is only
* relevant for 0-4 kHz band, and the input value is
* not used in other bands.
* - band : specifies which band's DFT should be decoded.
* *
* Output: * Output:
* -*fr : pointer to a buffer where the real part of DFT * - *fr : pointer to a buffer where the real part of DFT
* coefficients are written to. * coefficients are written to.
* -*fi : pointer to a buffer where the imaginary part * - *fi : pointer to a buffer where the imaginary part
* of DFT coefficients are written to. * of DFT coefficients are written to.
* *
* Return value : < 0 if an error occures * Return value : < 0 if an error occures
* 0 if succeeded. * 0 if succeeded.
*/ */
int WebRtcIsac_DecodeSpecUB16( int WebRtcIsac_DecodeSpec(Bitstr* streamdata, WebRtc_Word16 AvgPitchGain_Q12,
Bitstr* streamdata, enum ISACBand band, double* fr, double* fi);
double* fr,
double* fi);
/****************************************************************************** /******************************************************************************
* WebRtcIsac_DecodeSpecUB12() * WebRtcIsac_EncodeSpec()
* Decode real and imaginary part of the DFT coefficients, given a bit-stream. * Encode real and imaginary part of the DFT coefficients into the given
* This function is called when the codec is in 0-12 kHz bandwidth. * bit-stream.
* The decoded DFT coefficient can be transformed to time domain by
* WebRtcIsac_Time2Spec().
* *
* Input: * Input:
* - streamdata : pointer to a stucture containg the encoded * - *fr : pointer to a buffer where the real part of DFT
* data and theparameters needed for entropy
* coding.
*
* Output:
* -*fr : pointer to a buffer where the real part of DFT
* coefficients are written to. * coefficients are written to.
* -*fi : pointer to a buffer where the imaginary part * - *fi : pointer to a buffer where the imaginary part
* of DFT coefficients are written to. * of DFT coefficients are written to.
* * - AvgPitchGain_Q12 : average pitch-gain of the frame. This is only
* Return value : < 0 if an error occures * relevant for 0-4 kHz band, and the input value is
* 0 if succeeded. * not used in other bands.
*/ * - band : specifies which band's DFT should be decoded.
int WebRtcIsac_DecodeSpecUB12(
Bitstr* streamdata,
double* fr,
double* fi);
/* encode complex spectrum */
int WebRtcIsac_EncodeSpecLb(const WebRtc_Word16* fr,
const WebRtc_Word16* fi,
Bitstr* streamdata,
WebRtc_Word16 AvgPitchGain_Q12);
/******************************************************************************
* WebRtcIsac_EncodeSpecUB16()
* Quantize and encode real and imaginary part of the DFT coefficients.
* This function is called when the codec is in 0-16 kHz bandwidth.
* The real and imaginary part are computed by calling WebRtcIsac_Time2Spec().
*
*
* Input:
* -*fr : pointer to a buffer where the real part of DFT
* coefficients are stored.
* -*fi : pointer to a buffer where the imaginary part
* of DFT coefficients are stored.
* *
* Output: * Output:
* - streamdata : pointer to a stucture containg the encoded * - streamdata : pointer to a stucture containg the encoded
@@ -109,55 +72,25 @@ int WebRtcIsac_EncodeSpecLb(const WebRtc_Word16* fr,
* Return value : < 0 if an error occures * Return value : < 0 if an error occures
* 0 if succeeded. * 0 if succeeded.
*/ */
int WebRtcIsac_EncodeSpecUB16( int WebRtcIsac_EncodeSpec(const WebRtc_Word16* fr, const WebRtc_Word16* fi,
const WebRtc_Word16* fr, WebRtc_Word16 AvgPitchGain_Q12, enum ISACBand band,
const WebRtc_Word16* fi, Bitstr* streamdata);
Bitstr* streamdata);
/******************************************************************************
* WebRtcIsac_EncodeSpecUB12()
* Quantize and encode real and imaginary part of the DFT coefficients.
* This function is called when the codec is in 0-12 kHz bandwidth.
* The real and imaginary part are computed by calling WebRtcIsac_Time2Spec().
*
*
* Input:
* -*fr : pointer to a buffer where the real part of DFT
* coefficients are stored.
* -*fi : pointer to a buffer where the imaginary part
* of DFT coefficients are stored.
*
* Output:
* - streamdata : pointer to a stucture containg the encoded
* data and theparameters needed for entropy
* coding.
*
* Return value : < 0 if an error occures
* 0 if succeeded.
*/
int WebRtcIsac_EncodeSpecUB12(
const WebRtc_Word16* fr,
const WebRtc_Word16* fi,
Bitstr* streamdata);
/* decode & dequantize LPC Coef */ /* decode & dequantize LPC Coef */
int WebRtcIsac_DecodeLpcCoef(Bitstr *streamdata, double *LPCCoef); int WebRtcIsac_DecodeLpcCoef(Bitstr* streamdata, double* LPCCoef);
int WebRtcIsac_DecodeLpcCoefUB( int WebRtcIsac_DecodeLpcCoefUB(Bitstr* streamdata, double* lpcVecs,
Bitstr* streamdata, double* percepFilterGains,
double* lpcVecs, WebRtc_Word16 bandwidth);
double* percepFilterGains,
WebRtc_Word16 bandwidth);
int WebRtcIsac_DecodeLpc(Bitstr *streamdata, double *LPCCoef_lo, int WebRtcIsac_DecodeLpc(Bitstr* streamdata, double* LPCCoef_lo,
double *LPCCoef_hi); double* LPCCoef_hi);
/* quantize & code LPC Coef */ /* quantize & code LPC Coef */
void WebRtcIsac_EncodeLpcLb(double *LPCCoef_lo, double *LPCCoef_hi, void WebRtcIsac_EncodeLpcLb(double* LPCCoef_lo, double* LPCCoef_hi,
Bitstr *streamdata, ISAC_SaveEncData_t* encData); Bitstr* streamdata, ISAC_SaveEncData_t* encData);
void WebRtcIsac_EncodeLpcGainLb(double *LPCCoef_lo, double *LPCCoef_hi,
Bitstr *streamdata, void WebRtcIsac_EncodeLpcGainLb(double* LPCCoef_lo, double* LPCCoef_hi,
Bitstr* streamdata,
ISAC_SaveEncData_t* encData); ISAC_SaveEncData_t* encData);
/****************************************************************************** /******************************************************************************
@@ -175,8 +108,8 @@ void WebRtcIsac_EncodeLpcGainLb(double *LPCCoef_lo, double *LPCCoef_hi,
* or 0-16 kHz mode. * or 0-16 kHz mode.
* *
* Input/output: * Input/output:
* - streamdata : pointer to a stucture containg the encoded * - streamdata : pointer to a structure containing the encoded
* data and theparameters needed for entropy * data and the parameters needed for entropy
* coding. * coding.
* *
* Output: * Output:
@@ -193,12 +126,10 @@ void WebRtcIsac_EncodeLpcGainLb(double *LPCCoef_lo, double *LPCCoef_hi,
* Return value : 0 if encoding is successful, * Return value : 0 if encoding is successful,
* <0 if failed to encode. * <0 if failed to encode.
*/ */
WebRtc_Word16 WebRtcIsac_EncodeLpcUB( WebRtc_Word16 WebRtcIsac_EncodeLpcUB(double* lpcCoeff, Bitstr* streamdata,
double* lpcCoeff, double* interpolLPCCoeff,
Bitstr* streamdata, WebRtc_Word16 bandwidth,
double* interpolLPCCoeff, ISACUBSaveEncDataStruct* encData);
WebRtc_Word16 bandwidth,
ISACUBSaveEncDataStruct* encData);
/****************************************************************************** /******************************************************************************
* WebRtcIsac_DecodeInterpolLpcUb() * WebRtcIsac_DecodeInterpolLpcUb()
@@ -228,22 +159,21 @@ WebRtc_Word16 WebRtcIsac_EncodeLpcUB(
* Return value : 0 if encoding is successful, * Return value : 0 if encoding is successful,
* <0 if failed to encode. * <0 if failed to encode.
*/ */
WebRtc_Word16 WebRtcIsac_DecodeInterpolLpcUb( WebRtc_Word16 WebRtcIsac_DecodeInterpolLpcUb(Bitstr* streamdata,
Bitstr* streamdata, double* percepFilterParam,
double* percepFilterParam, WebRtc_Word16 bandwidth);
WebRtc_Word16 bandwidth);
/* decode & dequantize RC */ /* Decode & dequantize RC */
int WebRtcIsac_DecodeRc(Bitstr *streamdata, WebRtc_Word16 *RCQ15); int WebRtcIsac_DecodeRc(Bitstr* streamdata, WebRtc_Word16* RCQ15);
/* quantize & code RC */ /* Quantize & code RC */
void WebRtcIsac_EncodeRc(WebRtc_Word16 *RCQ15, Bitstr *streamdata); void WebRtcIsac_EncodeRc(WebRtc_Word16* RCQ15, Bitstr* streamdata);
/* decode & dequantize squared Gain */ /* Decode & dequantize squared Gain */
int WebRtcIsac_DecodeGain2(Bitstr *streamdata, WebRtc_Word32 *Gain2); int WebRtcIsac_DecodeGain2(Bitstr* streamdata, WebRtc_Word32* Gain2);
/* quantize & code squared Gain (input is squared gain) */ /* Quantize & code squared Gain (input is squared gain) */
int WebRtcIsac_EncodeGain2(WebRtc_Word32 *gain2, Bitstr *streamdata); int WebRtcIsac_EncodeGain2(WebRtc_Word32* gain2, Bitstr* streamdata);
void WebRtcIsac_EncodePitchGain(WebRtc_Word16* PitchGains_Q12, void WebRtcIsac_EncodePitchGain(WebRtc_Word16* PitchGains_Q12,
Bitstr* streamdata, Bitstr* streamdata,
@@ -252,24 +182,24 @@ void WebRtcIsac_EncodePitchGain(WebRtc_Word16* PitchGains_Q12,
void WebRtcIsac_EncodePitchLag(double* PitchLags, WebRtc_Word16* PitchGain_Q12, void WebRtcIsac_EncodePitchLag(double* PitchLags, WebRtc_Word16* PitchGain_Q12,
Bitstr* streamdata, ISAC_SaveEncData_t* encData); Bitstr* streamdata, ISAC_SaveEncData_t* encData);
int WebRtcIsac_DecodePitchGain(Bitstr *streamdata, int WebRtcIsac_DecodePitchGain(Bitstr* streamdata,
WebRtc_Word16 *PitchGain_Q12); WebRtc_Word16* PitchGain_Q12);
int WebRtcIsac_DecodePitchLag(Bitstr *streamdata, WebRtc_Word16 *PitchGain_Q12, int WebRtcIsac_DecodePitchLag(Bitstr* streamdata, WebRtc_Word16* PitchGain_Q12,
double *PitchLag); double* PitchLag);
int WebRtcIsac_DecodeFrameLen(Bitstr *streamdata, WebRtc_Word16 *framelength); int WebRtcIsac_DecodeFrameLen(Bitstr* streamdata, WebRtc_Word16* framelength);
int WebRtcIsac_EncodeFrameLen(WebRtc_Word16 framelength, Bitstr *streamdata); int WebRtcIsac_EncodeFrameLen(WebRtc_Word16 framelength, Bitstr* streamdata);
int WebRtcIsac_DecodeSendBW(Bitstr *streamdata, WebRtc_Word16 *BWno); int WebRtcIsac_DecodeSendBW(Bitstr* streamdata, WebRtc_Word16* BWno);
void WebRtcIsac_EncodeReceiveBw(int *BWno, Bitstr *streamdata); void WebRtcIsac_EncodeReceiveBw(int* BWno, Bitstr* streamdata);
/* step-down */ /* Step-down */
void WebRtcIsac_Poly2Rc(double *a, int N, double *RC); void WebRtcIsac_Poly2Rc(double* a, int N, double* RC);
/* step-up */ /* Step-up */
void WebRtcIsac_Rc2Poly(double *RC, int N, double *a); void WebRtcIsac_Rc2Poly(double* RC, int N, double* a);
void WebRtcIsac_TranscodeLPCCoef(double *LPCCoef_lo, double *LPCCoef_hi, void WebRtcIsac_TranscodeLPCCoef(double* LPCCoef_lo, double* LPCCoef_hi,
int *index_g); int* index_g);
/****************************************************************************** /******************************************************************************
@@ -288,10 +218,8 @@ void WebRtcIsac_TranscodeLPCCoef(double *LPCCoef_lo, double *LPCCoef_hi,
* - lpcGainIndex : quantization indices for lpc gains, these will * - lpcGainIndex : quantization indices for lpc gains, these will
* be stored to be used for FEC. * be stored to be used for FEC.
*/ */
void WebRtcIsac_EncodeLpcGainUb( void WebRtcIsac_EncodeLpcGainUb(double* lpGains, Bitstr* streamdata,
double* lpGains, int* lpcGainIndex);
Bitstr* streamdata,
int* lpcGainIndex);
/****************************************************************************** /******************************************************************************
@@ -307,9 +235,7 @@ void WebRtcIsac_EncodeLpcGainUb(
* coding. * coding.
* *
*/ */
void WebRtcIsac_StoreLpcGainUb( void WebRtcIsac_StoreLpcGainUb(double* lpGains, Bitstr* streamdata);
double* lpGains,
Bitstr* streamdata);
/****************************************************************************** /******************************************************************************
@@ -327,9 +253,7 @@ void WebRtcIsac_StoreLpcGainUb(
* Return value : 0 if succeeded. * Return value : 0 if succeeded.
* <0 if failed. * <0 if failed.
*/ */
WebRtc_Word16 WebRtcIsac_DecodeLpcGainUb( WebRtc_Word16 WebRtcIsac_DecodeLpcGainUb(double* lpGains, Bitstr* streamdata);
double* lpGains,
Bitstr* streamdata);
/****************************************************************************** /******************************************************************************
@@ -348,9 +272,8 @@ WebRtc_Word16 WebRtcIsac_DecodeLpcGainUb(
* Return value : 0 if succeeded. * Return value : 0 if succeeded.
* <0 if failed. * <0 if failed.
*/ */
WebRtc_Word16 WebRtcIsac_EncodeBandwidth( WebRtc_Word16 WebRtcIsac_EncodeBandwidth(enum ISACBandwidth bandwidth,
enum ISACBandwidth bandwidth, Bitstr* streamData);
Bitstr* streamData);
/****************************************************************************** /******************************************************************************
@@ -370,9 +293,8 @@ WebRtc_Word16 WebRtcIsac_EncodeBandwidth(
* Return value : 0 if succeeded. * Return value : 0 if succeeded.
* <0 if failed. * <0 if failed.
*/ */
WebRtc_Word16 WebRtcIsac_DecodeBandwidth( WebRtc_Word16 WebRtcIsac_DecodeBandwidth(Bitstr* streamData,
Bitstr* streamData, enum ISACBandwidth* bandwidth);
enum ISACBandwidth* bandwidth);
/****************************************************************************** /******************************************************************************
@@ -392,9 +314,8 @@ WebRtc_Word16 WebRtcIsac_DecodeBandwidth(
* Return value : 0 if succeeded. * Return value : 0 if succeeded.
* <0 if failed. * <0 if failed.
*/ */
WebRtc_Word16 WebRtcIsac_EncodeJitterInfo( WebRtc_Word16 WebRtcIsac_EncodeJitterInfo(WebRtc_Word32 jitterIndex,
WebRtc_Word32 jitterIndex, Bitstr* streamData);
Bitstr* streamData);
/****************************************************************************** /******************************************************************************
@@ -414,8 +335,7 @@ WebRtc_Word16 WebRtcIsac_EncodeJitterInfo(
* Return value : 0 if succeeded. * Return value : 0 if succeeded.
* <0 if failed. * <0 if failed.
*/ */
WebRtc_Word16 WebRtcIsac_DecodeJitterInfo( WebRtc_Word16 WebRtcIsac_DecodeJitterInfo(Bitstr* streamData,
Bitstr* streamData, WebRtc_Word32* jitterInfo);
WebRtc_Word32* jitterInfo);
#endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ */ #endif /* WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_SOURCE_ENTROPY_CODING_H_ */

File diff suppressed because it is too large Load Diff

View File

@@ -81,7 +81,7 @@
#define UB16_INTERPOL_SEGMENTS 3 #define UB16_INTERPOL_SEGMENTS 3
#define LB_TOTAL_DELAY_SAMPLES 48 #define LB_TOTAL_DELAY_SAMPLES 48
enum ISACBandwidth {isac8kHz = 8, isac12kHz = 12, isac16kHz = 16}; enum ISACBandwidth {isac8kHz = 8, isac12kHz = 12, isac16kHz = 16};
enum ISACBand{isacLowerBand = 0, isacUpperBand = 1}; enum ISACBand {kIsacLowerBand = 0, kIsacUpperBand12 = 1, kIsacUpperBand16 = 2};
#define UB_LPC_GAIN_DIM SUBFRAMES #define UB_LPC_GAIN_DIM SUBFRAMES
#define FB_STATE_SIZE_WORD32 6 #define FB_STATE_SIZE_WORD32 6