Home | History | Annotate | Download | only in acm2
      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
     17 struct G722_1_16_encinst_t_;
     18 struct G722_1_16_decinst_t_;
     19 struct G722_1_24_encinst_t_;
     20 struct G722_1_24_decinst_t_;
     21 struct G722_1_32_encinst_t_;
     22 struct G722_1_32_decinst_t_;
     23 struct G722_1_Inst_t_;
     24 
     25 namespace webrtc {
     26 
     27 namespace acm2 {
     28 
     29 class 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   int32_t operational_rate_;
     47 
     48   G722_1_Inst_t_* encoder_inst_ptr_;
     49   G722_1_Inst_t_* encoder_inst_ptr_right_;  // Used in stereo mode
     50 
     51   // Only one set of these pointer is valid at any instance
     52   G722_1_16_encinst_t_* encoder_inst16_ptr_;
     53   G722_1_16_encinst_t_* encoder_inst16_ptr_right_;
     54   G722_1_24_encinst_t_* encoder_inst24_ptr_;
     55   G722_1_24_encinst_t_* encoder_inst24_ptr_right_;
     56   G722_1_32_encinst_t_* encoder_inst32_ptr_;
     57   G722_1_32_encinst_t_* encoder_inst32_ptr_right_;
     58 };
     59 
     60 }  // namespace acm2
     61 
     62 }  // namespace webrtc
     63 
     64 #endif  // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_G7221_H_
     65