2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-05-16 07:11:53 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-11-03 17:20:10 +00:00
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G729_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G729_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
#include "webrtc/modules/audio_coding/main/source/acm_generic_codec.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
// forward declaration
|
|
|
|
|
struct G729_encinst_t_;
|
|
|
|
|
struct G729_decinst_t_;
|
|
|
|
|
|
2011-09-01 07:47:31 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-09-13 23:06:59 +00:00
|
|
|
namespace acm1 {
|
|
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
class ACMG729 : public ACMGenericCodec {
|
|
|
|
|
public:
|
2013-04-09 00:28:06 +00:00
|
|
|
explicit ACMG729(int16_t codec_id);
|
2012-11-05 09:35:51 +00:00
|
|
|
~ACMG729();
|
2012-12-13 22:46:43 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
// for FEC
|
|
|
|
|
ACMGenericCodec* CreateInstance(void);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t InternalEncode(uint8_t* bitstream,
|
|
|
|
|
int16_t* bitstream_len_byte);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
protected:
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t DecodeSafe(uint8_t* bitstream,
|
|
|
|
|
int16_t bitstream_len_byte,
|
|
|
|
|
int16_t* audio,
|
|
|
|
|
int16_t* audio_samples,
|
|
|
|
|
int8_t* speech_type);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int32_t CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
|
|
|
|
const CodecInst& codec_inst);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
void DestructEncoderSafe();
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
void DestructDecoderSafe();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t InternalCreateEncoder();
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t InternalCreateDecoder();
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
void InternalDestructEncoderInst(void* ptr_inst);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t EnableDTX();
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int16_t DisableDTX();
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int32_t ReplaceInternalDTXSafe(const bool replace_internal_dtx);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2013-04-09 00:28:06 +00:00
|
|
|
int32_t IsInternalDTXReplacedSafe(bool* internal_dtx_replaced);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
G729_encinst_t_* encoder_inst_ptr_;
|
|
|
|
|
G729_decinst_t_* decoder_inst_ptr_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
2013-09-13 23:06:59 +00:00
|
|
|
} // namespace acm1
|
|
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-03 17:20:10 +00:00
|
|
|
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G729_H_
|