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_SPEEX_H_
     12 #define WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_SPEEX_H_
     13 
     14 #include "webrtc/modules/audio_coding/main/acm2/acm_generic_codec.h"
     15 
     16 // forward declaration
     17 struct SPEEX_encinst_t_;
     18 struct SPEEX_decinst_t_;
     19 
     20 namespace webrtc {
     21 
     22 namespace acm2 {
     23 
     24 class ACMSPEEX : public ACMGenericCodec {
     25  public:
     26   explicit ACMSPEEX(int16_t codec_id);
     27   ~ACMSPEEX();
     28 
     29   // For FEC.
     30   ACMGenericCodec* CreateInstance(void);
     31 
     32   int16_t InternalEncode(uint8_t* bitstream, int16_t* bitstream_len_byte);
     33 
     34   int16_t InternalInitEncoder(WebRtcACMCodecParams* codec_params);
     35 
     36  protected:
     37   void DestructEncoderSafe();
     38 
     39   int16_t InternalCreateEncoder();
     40 
     41   int16_t SetBitRateSafe(const int32_t rate);
     42 
     43   int16_t EnableDTX();
     44 
     45   int16_t DisableDTX();
     46 
     47 #ifdef UNUSEDSPEEX
     48   int16_t EnableVBR();
     49 
     50   int16_t DisableVBR();
     51 
     52   int16_t SetComplMode(int16_t mode);
     53 #endif
     54 
     55   SPEEX_encinst_t_* encoder_inst_ptr_;
     56   int16_t compl_mode_;
     57   bool vbr_enabled_;
     58   int32_t encoding_rate_;
     59   int16_t sampling_frequency_;
     60   uint16_t samples_in_20ms_audio_;
     61 };
     62 
     63 }  // namespace acm2
     64 
     65 }  // namespace webrtc
     66 
     67 #endif  // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_ACM_SPEEX_H_
     68