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.
|
|
|
|
|
*/
|
|
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G7221_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G7221_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 G722_1_16_encinst_t_;
|
|
|
|
|
struct G722_1_16_decinst_t_;
|
|
|
|
|
struct G722_1_24_encinst_t_;
|
|
|
|
|
struct G722_1_24_decinst_t_;
|
|
|
|
|
struct G722_1_32_encinst_t_;
|
|
|
|
|
struct G722_1_32_decinst_t_;
|
|
|
|
|
struct G722_1_Inst_t_;
|
|
|
|
|
|
2011-09-01 07:47:31 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-11-03 17:20:10 +00:00
|
|
|
class ACMG722_1: public ACMGenericCodec {
|
|
|
|
|
public:
|
2012-12-13 22:46:43 +00:00
|
|
|
explicit ACMG722_1(WebRtc_Word16 codec_id);
|
2011-11-03 17:20:10 +00:00
|
|
|
~ACMG722_1();
|
2012-12-13 22:46:43 +00:00
|
|
|
|
2011-11-03 17:20:10 +00:00
|
|
|
// for FEC
|
|
|
|
|
ACMGenericCodec* CreateInstance(void);
|
|
|
|
|
|
|
|
|
|
WebRtc_Word16 InternalEncode(WebRtc_UWord8* bitstream,
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16* bitstream_len_byte);
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16 InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16 InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
2011-11-03 17:20:10 +00:00
|
|
|
|
|
|
|
|
protected:
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16 DecodeSafe(WebRtc_UWord8* bitstream,
|
|
|
|
|
WebRtc_Word16 bitstream_len_byte,
|
|
|
|
|
WebRtc_Word16* audio, WebRtc_Word16* audio_samples,
|
|
|
|
|
WebRtc_Word8* speech_type);
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word32 CodecDef(WebRtcNetEQ_CodecDef& codec_def,
|
|
|
|
|
const CodecInst& codec_inst);
|
2011-11-03 17:20:10 +00:00
|
|
|
|
|
|
|
|
void DestructEncoderSafe();
|
|
|
|
|
|
|
|
|
|
void DestructDecoderSafe();
|
|
|
|
|
|
|
|
|
|
WebRtc_Word16 InternalCreateEncoder();
|
|
|
|
|
|
|
|
|
|
WebRtc_Word16 InternalCreateDecoder();
|
|
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
void InternalDestructEncoderInst(void* ptr_inst);
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word32 operational_rate_;
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
G722_1_Inst_t_* encoder_inst_ptr_;
|
|
|
|
|
G722_1_Inst_t_* encoder_inst_ptr_right_; // Used in stereo mode
|
|
|
|
|
G722_1_Inst_t_* decoder_inst_ptr_;
|
2011-11-03 17:20:10 +00:00
|
|
|
|
|
|
|
|
// Only one set of these pointer is valid at any instance
|
2012-12-13 22:46:43 +00:00
|
|
|
G722_1_16_encinst_t_* encoder_inst16_ptr_;
|
|
|
|
|
G722_1_16_encinst_t_* encoder_inst16_ptr_right_;
|
|
|
|
|
G722_1_24_encinst_t_* encoder_inst24_ptr_;
|
|
|
|
|
G722_1_24_encinst_t_* encoder_inst24_ptr_right_;
|
|
|
|
|
G722_1_32_encinst_t_* encoder_inst32_ptr_;
|
|
|
|
|
G722_1_32_encinst_t_* encoder_inst32_ptr_right_;
|
2011-11-03 17:20:10 +00:00
|
|
|
|
|
|
|
|
// Only one of these pointer is valid at any instance
|
2012-12-13 22:46:43 +00:00
|
|
|
G722_1_16_decinst_t_* decoder_inst16_ptr_;
|
|
|
|
|
G722_1_24_decinst_t_* decoder_inst24_ptr_;
|
|
|
|
|
G722_1_32_decinst_t_* decoder_inst32_ptr_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
} // namespace webrtc
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_G7221_H_
|