1/* 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7221_H_ 12#define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7221_H_ 13 14#include "webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h" 15 16// forward declaration 17struct G722_1_16_encinst_t_; 18struct G722_1_16_decinst_t_; 19struct G722_1_24_encinst_t_; 20struct G722_1_24_decinst_t_; 21struct G722_1_32_encinst_t_; 22struct G722_1_32_decinst_t_; 23struct G722_1_Inst_t_; 24 25namespace webrtc { 26 27namespace acm2 { 28 29class ACMG722_1 : public ACMGenericCodec { 30 public: 31 explicit ACMG722_1(int16_t codec_id); 32 ~ACMG722_1(); 33 34 // for FEC 35 ACMGenericCodec* CreateInstance(void); 36 37 int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte); 38 39 int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params); 40 41 protected: 42 void DestructEncoderSafe(); 43 44 int16_t InternalCreateEncoder(); 45 46 void InternalDestructEncoderInst(void* ptr_inst); 47 48 int32_t operational_rate_; 49 50 G722_1_Inst_t_* encoder_inst_ptr_; 51 G722_1_Inst_t_* encoder_inst_ptr_right_; // Used in stereo mode 52 53 // Only one set of these pointer is valid at any instance 54 G722_1_16_encinst_t_* encoder_inst16_ptr_; 55 G722_1_16_encinst_t_* encoder_inst16_ptr_right_; 56 G722_1_24_encinst_t_* encoder_inst24_ptr_; 57 G722_1_24_encinst_t_* encoder_inst24_ptr_right_; 58 G722_1_32_encinst_t_* encoder_inst32_ptr_; 59 G722_1_32_encinst_t_* encoder_inst32_ptr_right_; 60}; 61 62} // namespace acm2 63 64} // namespace webrtc 65 66#endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7221_H_ 67