Deleting all NetEq3 files

NetEq3 is deprecated and replaced by NetEq4
(webrtc/modules/audio_coding/neteq4/).

BUG=2996
R=turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14469007

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6118 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrik.lundin@webrtc.org
2014-05-13 10:40:52 +00:00
parent 4d363ae305
commit c3e8abda7c
78 changed files with 0 additions and 26952 deletions

View File

@ -1,230 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* 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
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
/*
* This is the main API for NetEQ. Helper macros are located in webrtc_neteq_help_macros.h,
* while some internal API functions are found in webrtc_neteq_internal.h.
*/
#include "typedefs.h"
#ifndef WEBRTC_NETEQ_H
#define WEBRTC_NETEQ_H
#ifdef __cplusplus
extern "C"
{
#endif
/**********************************************************
* Definitions
*/
enum WebRtcNetEQDecoder
{
kDecoderReservedStart,
kDecoderPCMu,
kDecoderPCMa,
kDecoderPCMu_2ch,
kDecoderPCMa_2ch,
kDecoderILBC,
kDecoderISAC,
kDecoderISACswb,
kDecoderISACfb,
kDecoderPCM16B,
kDecoderPCM16Bwb,
kDecoderPCM16Bswb32kHz,
kDecoderPCM16Bswb48kHz,
kDecoderPCM16B_2ch,
kDecoderPCM16Bwb_2ch,
kDecoderPCM16Bswb32kHz_2ch,
kDecoderG722,
kDecoderG722_2ch,
kDecoderRED,
kDecoderAVT,
kDecoderCNG,
kDecoderArbitrary,
kDecoderG729,
kDecoderG729_1,
kDecoderG726_16,
kDecoderG726_24,
kDecoderG726_32,
kDecoderG726_40,
kDecoderG722_1_16,
kDecoderG722_1_24,
kDecoderG722_1_32,
kDecoderG722_1C_24,
kDecoderG722_1C_32,
kDecoderG722_1C_48,
kDecoderOpus,
kDecoderSPEEX_8,
kDecoderSPEEX_16,
kDecoderCELT_32,
kDecoderCELT_32_2ch,
kDecoderGSMFR,
kDecoderAMR,
kDecoderAMRWB,
kDecoderReservedEnd
};
enum WebRtcNetEQNetworkType
{
kUDPNormal,
kUDPVideoSync,
kTCPNormal,
kTCPLargeJitter,
kTCPXLargeJitter
};
enum WebRtcNetEQOutputType
{
kOutputNormal,
kOutputPLC,
kOutputCNG,
kOutputPLCtoCNG,
kOutputVADPassive
};
enum WebRtcNetEQPlayoutMode
{
kPlayoutOn, kPlayoutOff, kPlayoutFax, kPlayoutStreaming
};
/* Available modes for background noise (inserted after long expands) */
enum WebRtcNetEQBGNMode
{
kBGNOn, /* default "normal" behavior with eternal noise */
kBGNFade, /* noise fades to zero after some time */
kBGNOff
/* background noise is always zero */
};
/*************************************************
* Definitions of decoder calls and the default
* API function calls for each codec
*/
typedef int16_t (*WebRtcNetEQ_FuncDecode)(void* state, int16_t* encoded,
int16_t len, int16_t* decoded,
int16_t* speechType);
typedef int16_t (*WebRtcNetEQ_FuncDecodePLC)(void* state, int16_t* decoded,
int16_t frames);
typedef int16_t (*WebRtcNetEQ_FuncDecodeInit)(void* state);
typedef int16_t (*WebRtcNetEQ_FuncAddLatePkt)(void* state, int16_t* encoded,
int16_t len);
typedef int16_t (*WebRtcNetEQ_FuncGetMDinfo)(void* state);
typedef int16_t (*WebRtcNetEQ_FuncGetPitchInfo)(void* state, int16_t* encoded,
int16_t* length);
typedef int16_t (*WebRtcNetEQ_FuncUpdBWEst)(void* state, const uint16_t *encoded,
int32_t packet_size,
uint16_t rtp_seq_number,
uint32_t send_ts,
uint32_t arr_ts);
typedef int (*WebRtcNetEQ_FuncDurationEst)(void* state, const uint8_t* payload,
int payload_length_bytes);
typedef int16_t (*WebRtcNetEQ_FuncGetErrorCode)(void* state);
/**********************************************************
* Structures
*/
typedef struct
{
enum WebRtcNetEQDecoder codec;
int16_t payloadType;
WebRtcNetEQ_FuncDecode funcDecode;
WebRtcNetEQ_FuncDecode funcDecodeRCU;
WebRtcNetEQ_FuncDecodePLC funcDecodePLC;
WebRtcNetEQ_FuncDecodeInit funcDecodeInit;
WebRtcNetEQ_FuncAddLatePkt funcAddLatePkt;
WebRtcNetEQ_FuncGetMDinfo funcGetMDinfo;
WebRtcNetEQ_FuncGetPitchInfo funcGetPitch;
WebRtcNetEQ_FuncUpdBWEst funcUpdBWEst;
WebRtcNetEQ_FuncDurationEst funcDurationEst;
WebRtcNetEQ_FuncGetErrorCode funcGetErrorCode;
void* codec_state;
uint16_t codec_fs;
} WebRtcNetEQ_CodecDef;
typedef struct
{
uint16_t fraction_lost;
uint32_t cum_lost;
uint32_t ext_max;
uint32_t jitter;
} WebRtcNetEQ_RTCPStat;
/**********************************************************
* NETEQ Functions
*/
/* Info functions */
#define WEBRTC_NETEQ_MAX_ERROR_NAME 40
int WebRtcNetEQ_GetErrorCode(void *inst);
int WebRtcNetEQ_GetErrorName(int errorCode, char *errorName, int maxStrLen);
/* Instance memory assign functions */
int WebRtcNetEQ_AssignSize(int *sizeinbytes);
int WebRtcNetEQ_Assign(void **inst, void *NETEQ_inst_Addr);
int WebRtcNetEQ_GetRecommendedBufferSize(void *inst, const enum WebRtcNetEQDecoder *codec,
int noOfCodecs, enum WebRtcNetEQNetworkType nwType,
int *MaxNoOfPackets, int *sizeinbytes,
int* per_packet_overhead_bytes);
int WebRtcNetEQ_AssignBuffer(void *inst, int MaxNoOfPackets, void *NETEQ_Buffer_Addr,
int sizeinbytes);
/* Init functions */
int WebRtcNetEQ_Init(void *inst, uint16_t fs);
int WebRtcNetEQ_SetAVTPlayout(void *inst, int PlayoutAVTon);
int WebRtcNetEQ_SetExtraDelay(void *inst, int DelayInMs);
int WebRtcNetEQ_SetPlayoutMode(void *inst, enum WebRtcNetEQPlayoutMode playoutMode);
int WebRtcNetEQ_SetBGNMode(void *inst, enum WebRtcNetEQBGNMode bgnMode);
int WebRtcNetEQ_GetBGNMode(const void *inst, enum WebRtcNetEQBGNMode *bgnMode);
/* Codec Database functions */
int WebRtcNetEQ_CodecDbReset(void *inst);
int WebRtcNetEQ_CodecDbAdd(void *inst, WebRtcNetEQ_CodecDef *codecInst);
int WebRtcNetEQ_CodecDbRemove(void *inst, enum WebRtcNetEQDecoder codec);
int WebRtcNetEQ_CodecDbGetSizeInfo(void *inst, int16_t *UsedEntries,
int16_t *MaxEntries);
int WebRtcNetEQ_CodecDbGetCodecInfo(void *inst, int16_t Entry,
enum WebRtcNetEQDecoder *codec);
/* Real-time functions */
int WebRtcNetEQ_RecIn(void *inst, int16_t *p_w16datagramstart, int16_t w16_RTPlen,
uint32_t uw32_timeRec);
int WebRtcNetEQ_RecOut(void *inst, int16_t *pw16_outData, int16_t *pw16_len);
int WebRtcNetEQ_GetRTCPStats(void *inst, WebRtcNetEQ_RTCPStat *RTCP_inst);
int WebRtcNetEQ_GetRTCPStatsNoReset(void *inst, WebRtcNetEQ_RTCPStat *RTCP_inst);
int WebRtcNetEQ_GetSpeechTimeStamp(void *inst, uint32_t *timestamp);
int WebRtcNetEQ_DecodedRtpInfo(const void* inst,
int* sequence_number,
uint32_t* timestamp);
int WebRtcNetEQ_GetSpeechOutputType(void *inst, enum WebRtcNetEQOutputType *outputType);
/* VQmon related functions */
int WebRtcNetEQ_VQmonRecOutStatistics(void *inst, uint16_t *validVoiceDurationMs,
uint16_t *concealedVoiceDurationMs,
uint8_t *concealedVoiceFlags);
int WebRtcNetEQ_VQmonGetConfiguration(void *inst, uint16_t *absMaxDelayMs,
uint8_t *adaptationRate);
int WebRtcNetEQ_VQmonGetRxStatistics(void *inst, uint16_t *avgDelayMs,
uint16_t *maxDelayMs);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,454 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* 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
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
/*
* This file contains some helper macros that can be used when loading the
* NetEQ codec database.
*/
#ifndef WEBRTC_NETEQ_HELP_MACROS_H
#define WEBRTC_NETEQ_HELP_MACROS_H
#ifndef NULL
#define NULL 0
#endif
/**********************************************************
* Help macros for NetEQ initialization
*/
#define SET_CODEC_PAR(inst,decoder,pt,state,fs) \
inst.codec=decoder; \
inst.payloadType=pt; \
inst.codec_state=state; \
inst.codec_fs=fs;
#define SET_PCMU_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG711_DecodeU; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=WebRtcG711_DurationEst; \
inst.funcGetErrorCode=NULL;
#define SET_PCMA_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG711_DecodeA; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=WebRtcG711_DurationEst; \
inst.funcGetErrorCode=NULL;
#define SET_ILBC_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcIlbcfix_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcIlbcfix_NetEqPlc; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcIlbcfix_Decoderinit30Ms; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_ISAC_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcIsac_Decode; \
inst.funcDecodeRCU=(WebRtcNetEQ_FuncDecode)WebRtcIsac_DecodeRcu; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcIsac_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=(WebRtcNetEQ_FuncUpdBWEst)WebRtcIsac_UpdateBwEstimate; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=(WebRtcNetEQ_FuncGetErrorCode)WebRtcIsac_GetErrorCode;
#define SET_ISACfix_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcIsacfix_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcIsacfix_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=(WebRtcNetEQ_FuncUpdBWEst)WebRtcIsacfix_UpdateBwEstimate; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=(WebRtcNetEQ_FuncGetErrorCode)WebRtcIsacfix_GetErrorCode;
#define SET_ISACSWB_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcIsac_Decode; \
inst.funcDecodeRCU=(WebRtcNetEQ_FuncDecode)WebRtcIsac_DecodeRcu; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcIsac_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=(WebRtcNetEQ_FuncUpdBWEst)WebRtcIsac_UpdateBwEstimate; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=(WebRtcNetEQ_FuncGetErrorCode)WebRtcIsac_GetErrorCode;
#define SET_ISACFB_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcIsac_Decode; \
inst.funcDecodeRCU=(WebRtcNetEQ_FuncDecode)WebRtcIsac_DecodeRcu; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcIsac_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=(WebRtcNetEQ_FuncUpdBWEst)WebRtcIsac_UpdateBwEstimate; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=(WebRtcNetEQ_FuncGetErrorCode)WebRtcIsac_GetErrorCode;
#define SET_G729_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG729_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG729_DecodePlc; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG729_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G729_1_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7291_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7291_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=(WebRtcNetEQ_FuncUpdBWEst)WebRtcG7291_DecodeBwe; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_PCM16B_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcPcm16b_DecodeW16; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_PCM16B_WB_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcPcm16b_DecodeW16; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_PCM16B_SWB32_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcPcm16b_DecodeW16; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_PCM16B_SWB48_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcPcm16b_DecodeW16; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG722_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG722_DecoderInit;\
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_1_16_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7221_Decode16; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG7221_DecodePlc16; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7221_DecoderInit16; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_1_24_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7221_Decode24; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG7221_DecodePlc24; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7221_DecoderInit24; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_1_32_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7221_Decode32; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG7221_DecodePlc32; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7221_DecoderInit32; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_1C_24_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7221C_Decode24; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG7221C_DecodePlc24; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7221C_DecoderInit24; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_1C_32_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7221C_Decode32; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG7221C_DecodePlc32; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7221C_DecoderInit32; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G722_1C_48_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG7221C_Decode48; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcG7221C_DecodePlc48; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG7221C_DecoderInit48; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_AMR_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcAmr_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcAmr_DecodePlc; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcAmr_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_AMRWB_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcAmrWb_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcAmrWb_DecodePlc; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcAmrWb_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_GSMFR_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcGSMFR_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcGSMFR_DecodePlc; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcGSMFR_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G726_16_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG726_decode16; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG726_decoderinit16; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G726_24_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG726_decode24; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG726_decoderinit24; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G726_32_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG726_decode32; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG726_decoderinit32; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_G726_40_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcG726_decode40; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcG726_decoderinit40; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_OPUS_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcOpus_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcOpus_DecodePlcMaster; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcOpus_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=(WebRtcNetEQ_FuncDurationEst)WebRtcOpus_DurationEst; \
inst.funcGetErrorCode=NULL;
#define SET_OPUSSLAVE_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcOpus_DecodeSlave; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcOpus_DecodePlcSlave; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcOpus_DecoderInitSlave; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=(WebRtcNetEQ_FuncDurationEst)WebRtcOpus_DurationEst; \
inst.funcGetErrorCode=NULL;
#define SET_SPEEX_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcSpeex_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=(WebRtcNetEQ_FuncDecodePLC)WebRtcSpeex_DecodePlc; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcSpeex_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_CELT_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcCelt_Decode; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcCelt_DecoderInit; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_CELTSLAVE_FUNCTIONS(inst) \
inst.funcDecode=(WebRtcNetEQ_FuncDecode)WebRtcCelt_DecodeSlave; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=(WebRtcNetEQ_FuncDecodeInit)WebRtcCelt_DecoderInitSlave; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_RED_FUNCTIONS(inst) \
inst.funcDecode=NULL; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_AVT_FUNCTIONS(inst) \
inst.funcDecode=NULL; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#define SET_CNG_FUNCTIONS(inst) \
inst.funcDecode=NULL; \
inst.funcDecodeRCU=NULL; \
inst.funcDecodePLC=NULL; \
inst.funcDecodeInit=NULL; \
inst.funcAddLatePkt=NULL; \
inst.funcGetMDinfo=NULL; \
inst.funcGetPitch=NULL; \
inst.funcUpdBWEst=NULL; \
inst.funcDurationEst=NULL; \
inst.funcGetErrorCode=NULL;
#endif /* WEBRTC_NETEQ_HELP_MACROS_H */

View File

@ -1,336 +0,0 @@
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* 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
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
/*
* This file contains the internal API functions.
*/
#include "typedefs.h"
#ifndef WEBRTC_NETEQ_INTERNAL_H
#define WEBRTC_NETEQ_INTERNAL_H
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct
{
uint8_t payloadType;
uint16_t sequenceNumber;
uint32_t timeStamp;
uint32_t SSRC;
uint8_t markerBit;
} WebRtcNetEQ_RTPInfo;
/****************************************************************************
* WebRtcNetEQ_RecInRTPStruct(...)
*
* Alternative RecIn function, used when the RTP data has already been
* parsed into an RTP info struct (WebRtcNetEQ_RTPInfo).
*
* Input:
* - inst : NetEQ instance
* - rtpInfo : Pointer to RTP info
* - payloadPtr : Pointer to the RTP payload (first byte after header)
* - payloadLenBytes : Length (in bytes) of the payload in payloadPtr
* - timeRec : Receive time (in timestamps of the used codec)
*
* Return value : 0 - Ok
* -1 - Error
*/
int WebRtcNetEQ_RecInRTPStruct(void *inst, WebRtcNetEQ_RTPInfo *rtpInfo,
const uint8_t *payloadPtr, int16_t payloadLenBytes,
uint32_t timeRec);
/****************************************************************************
* WebRtcNetEQ_GetMasterSlaveInfoSize(...)
*
* Get size in bytes for master/slave struct msInfo used in
* WebRtcNetEQ_RecOutMasterSlave.
*
* Return value : Struct size in bytes
*
*/
int WebRtcNetEQ_GetMasterSlaveInfoSize();
/****************************************************************************
* WebRtcNetEQ_RecOutMasterSlave(...)
*
* RecOut function for running several NetEQ instances in master/slave mode.
* One master can be used to control several slaves.
* The MasterSlaveInfo struct must be allocated outside NetEQ.
* Use function WebRtcNetEQ_GetMasterSlaveInfoSize to get the size needed.
*
* Input:
* - inst : NetEQ instance
* - isMaster : Non-zero indicates that this is the master channel
* - msInfo : (slave only) Information from master
*
* Output:
* - inst : Updated NetEQ instance
* - pw16_outData : Pointer to vector where output should be written
* - pw16_len : Pointer to variable where output length is returned
* - msInfo : (master only) Information to slave(s)
*
* Return value : 0 - Ok
* -1 - Error
*/
int WebRtcNetEQ_RecOutMasterSlave(void *inst, int16_t *pw16_outData,
int16_t *pw16_len, void *msInfo,
int16_t isMaster);
typedef struct
{
uint16_t currentBufferSize; /* Current jitter buffer size in ms. */
uint16_t preferredBufferSize; /* Preferred buffer size in ms. */
uint16_t jitterPeaksFound; /* 1 if adding extra delay due to peaky
* jitter; 0 otherwise. */
uint16_t currentPacketLossRate; /* Loss rate (network + late) (Q14). */
uint16_t currentDiscardRate; /* Late loss rate (Q14). */
uint16_t currentExpandRate; /* Fraction (of original stream) of
* synthesized speech inserted through
* expansion (in Q14). */
uint16_t currentPreemptiveRate; /* Fraction of data inserted through
* pre-emptive expansion (in Q14). */
uint16_t currentAccelerateRate; /* Fraction of data removed through
* acceleration (in Q14). */
int32_t clockDriftPPM; /* Average clock-drift in parts-per-
* million (positive or negative). */
int addedSamples; /* Number of zero samples added in off
* mode */
} WebRtcNetEQ_NetworkStatistics;
/*
* Get the "in-call" statistics from NetEQ.
* The statistics are reset after the query.
*/
int WebRtcNetEQ_GetNetworkStatistics(void *inst, WebRtcNetEQ_NetworkStatistics *stats);
typedef struct {
/* Samples removed from background noise only segments. */
int accelerate_bgn_samples;
/* Samples removed from normal audio segments. */
int accelerate_normal_samples;
/* Number of samples synthesized during background noise only segments. */
int expand_bgn_sampels;
/* Number of samples synthesized during normal audio segments. */
int expand_normal_samples;
/* Number of samples synthesized during background noise only segments,
* in preemptive mode. */
int preemptive_expand_bgn_samples;
/* Number of samples synthesized during normal audio segments, in preemptive
* mode. */
int preemptive_expand_normal_samples;
/* Number of samples synthesized during background noise only segments,
* while merging. */
int merge_expand_bgn_samples;
/* Number of samples synthesized during normal audio segments, while
* merging. */
int merge_expand_normal_samples;
} WebRtcNetEQ_ProcessingActivity;
/*
* Get the processing activities from NetEQ.
* The statistics are reset after the query.
* This API is meant to obtain processing activities in high granularity,
* e.g. per RecOut() call.
*/
void WebRtcNetEQ_GetProcessingActivity(void* inst,
WebRtcNetEQ_ProcessingActivity* stat);
/*
* Get the raw waiting times for decoded frames. The function writes the last
* recorded waiting times (from frame arrival to frame decoding) to the memory
* pointed to by waitingTimeMs. The number of elements written is in the return
* value. No more than maxLength elements are written. Statistics are reset on
* each query.
*/
int WebRtcNetEQ_GetRawFrameWaitingTimes(void *inst,
int max_length,
int* waiting_times_ms);
/***********************************************/
/* Functions for post-decode VAD functionality */
/***********************************************/
/* NetEQ must be compiled with the flag NETEQ_VAD enabled for these functions to work. */
/*
* VAD function pointer types
*
* These function pointers match the definitions of webrtc VAD functions WebRtcVad_Init,
* WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in webrtc_vad.h.
*/
typedef int (*WebRtcNetEQ_VADInitFunction)(void *VAD_inst);
typedef int (*WebRtcNetEQ_VADSetmodeFunction)(void *VAD_inst, int mode);
typedef int (*WebRtcNetEQ_VADFunction)(void *VAD_inst, int fs,
int16_t *frame, int frameLen);
/****************************************************************************
* WebRtcNetEQ_SetVADInstance(...)
*
* Provide a pointer to an allocated VAD instance. If function is never
* called or it is called with NULL pointer as VAD_inst, the post-decode
* VAD functionality is disabled. Also provide pointers to init, setmode
* and VAD functions. These are typically pointers to WebRtcVad_Init,
* WebRtcVad_set_mode and WebRtcVad_Process, respectively, all found in the
* interface file webrtc_vad.h.
*
* Input:
* - NetEQ_inst : NetEQ instance
* - VADinst : VAD instance
* - initFunction : Pointer to VAD init function
* - setmodeFunction : Pointer to VAD setmode function
* - VADfunction : Pointer to VAD function
*
* Output:
* - NetEQ_inst : Updated NetEQ instance
*
* Return value : 0 - Ok
* -1 - Error
*/
int WebRtcNetEQ_SetVADInstance(void *NetEQ_inst, void *VAD_inst,
WebRtcNetEQ_VADInitFunction initFunction,
WebRtcNetEQ_VADSetmodeFunction setmodeFunction,
WebRtcNetEQ_VADFunction VADFunction);
/****************************************************************************
* WebRtcNetEQ_SetVADMode(...)
*
* Pass an aggressiveness mode parameter to the post-decode VAD instance.
* If this function is never called, mode 0 (quality mode) is used as default.
*
* Input:
* - inst : NetEQ instance
* - mode : mode parameter (same range as WebRtc VAD mode)
*
* Output:
* - inst : Updated NetEQ instance
*
* Return value : 0 - Ok
* -1 - Error
*/
int WebRtcNetEQ_SetVADMode(void *NetEQ_inst, int mode);
/****************************************************************************
* WebRtcNetEQ_RecOutNoDecode(...)
*
* Special RecOut that does not do any decoding.
*
* Input:
* - inst : NetEQ instance
*
* Output:
* - inst : Updated NetEQ instance
* - pw16_outData : Pointer to vector where output should be written
* - pw16_len : Pointer to variable where output length is returned
*
* Return value : 0 - Ok
* -1 - Error
*/
int WebRtcNetEQ_RecOutNoDecode(void *inst, int16_t *pw16_outData,
int16_t *pw16_len);
/****************************************************************************
* WebRtcNetEQ_FlushBuffers(...)
*
* Flush packet and speech buffers. Does not reset codec database or
* jitter statistics.
*
* Input:
* - inst : NetEQ instance
*
* Output:
* - inst : Updated NetEQ instance
*
* Return value : 0 - Ok
* -1 - Error
*/
int WebRtcNetEQ_FlushBuffers(void *inst);
/*****************************************************************************
* void WebRtcNetEq_EnableAVSync(...)
*
* Enable AV-sync. If Enabled, NetEq will screen for sync payloads. For
* each sync payload a silence frame is generated.
*
* Input:
* - inst : NetEQ instance
* - enable : non-zero to enable, otherwise disabled.
*
* Output:
* - inst : Updated NetEQ instance
*
*/
void WebRtcNetEQ_EnableAVSync(void* inst, int enable);
/****************************************************************************
* WebRtcNetEQ_RecInSyncRTP(...)
*
* Insert a sync packet with the given RTP specification.
*
* Input:
* - inst : NetEQ instance
* - rtpInfo : Pointer to RTP info
* - receive_timestamp : Receive time (in timestamps of the used codec)
*
* Output:
* - inst : Updated NetEQ instance
*
* Return value : if succeeded it returns the number of bytes pushed
* in, otherwise returns -1.
*/
int WebRtcNetEQ_RecInSyncRTP(void* inst,
WebRtcNetEQ_RTPInfo* rtp_info,
uint32_t receive_timestamp);
/*
* Set a minimum latency for the jitter buffer. The overall delay is the max of
* |minimum_delay_ms| and the latency that is internally computed based on the
* inter-arrival times.
*/
int WebRtcNetEQ_SetMinimumDelay(void *inst, int minimum_delay_ms);
/*
* Set a maximum latency for the jitter buffer. The overall delay is the min of
* |maximum_delay_ms| and the latency that is internally computed based on the
* inter-arrival times.
*/
int WebRtcNetEQ_SetMaximumDelay(void *inst, int maximum_delay_ms);
/*
* Get the least required delay in milliseconds given inter-arrival times
* and playout mode.
*/
int WebRtcNetEQ_GetRequiredDelayMs(const void* inst);
#ifdef __cplusplus
}
#endif
#endif