2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-04-12 11:02:38 +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_PCM16B_H_
|
|
|
|
|
#define WEBRTC_MODULES_AUDIO_CODING_MAIN_SOURCE_ACM_PCM16B_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
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
class ACMPCM16B : public ACMGenericCodec {
|
|
|
|
|
public:
|
2012-12-13 22:46:43 +00:00
|
|
|
explicit ACMPCM16B(WebRtc_Word16 codec_id);
|
2012-11-05 09:35:51 +00:00
|
|
|
~ACMPCM16B();
|
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
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
WebRtc_Word16 InternalEncode(WebRtc_UWord8* bitstream,
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16* bitstream_len_byte);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16 InternalInitEncoder(WebRtcACMCodecParams *codec_params);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16 InternalInitDecoder(WebRtcACMCodecParams *codec_params);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
protected:
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16 DecodeSafe(WebRtc_UWord8* bitstream,
|
|
|
|
|
WebRtc_Word16 bitstream_len_byte,
|
2012-11-05 09:35:51 +00:00
|
|
|
WebRtc_Word16* audio,
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word16* audio_samples,
|
|
|
|
|
WebRtc_Word8* speech_type);
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word32 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-11-03 17:20:10 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
WebRtc_Word16 InternalCreateEncoder();
|
2011-11-03 17:20:10 +00:00
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
WebRtc_Word16 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
|
|
|
|
2012-11-05 09:35:51 +00:00
|
|
|
void SplitStereoPacket(uint8_t* payload, int32_t* payload_length);
|
2012-04-12 11:02:38 +00:00
|
|
|
|
2012-12-13 22:46:43 +00:00
|
|
|
WebRtc_Word32 sampling_freq_hz_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
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_PCM16B_H_
|