| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // in nonadaptive mode.) | 48 // in nonadaptive mode.) |
| 49 bool enforce_frame_size; | 49 bool enforce_frame_size; |
| 50 }; | 50 }; |
| 51 | 51 |
| 52 explicit AudioEncoderIsacT(const Config& config); | 52 explicit AudioEncoderIsacT(const Config& config); |
| 53 ~AudioEncoderIsacT() override; | 53 ~AudioEncoderIsacT() override; |
| 54 | 54 |
| 55 int SampleRateHz() const override; | 55 int SampleRateHz() const override; |
| 56 int NumChannels() const override; | 56 int NumChannels() const override; |
| 57 size_t MaxEncodedBytes() const override; | 57 size_t MaxEncodedBytes() const override; |
| 58 int Num10MsFramesInNextPacket() const override; | 58 size_t Num10MsFramesInNextPacket() const override; |
| 59 int Max10MsFramesInAPacket() const override; | 59 size_t Max10MsFramesInAPacket() const override; |
| 60 int GetTargetBitrate() const override; | 60 int GetTargetBitrate() const override; |
| 61 EncodedInfo EncodeInternal(uint32_t rtp_timestamp, | 61 EncodedInfo EncodeInternal(uint32_t rtp_timestamp, |
| 62 const int16_t* audio, | 62 const int16_t* audio, |
| 63 size_t max_encoded_bytes, | 63 size_t max_encoded_bytes, |
| 64 uint8_t* encoded) override; | 64 uint8_t* encoded) override; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 // This value is taken from STREAM_SIZE_MAX_60 for iSAC float (60 ms) and | 67 // This value is taken from STREAM_SIZE_MAX_60 for iSAC float (60 ms) and |
| 68 // STREAM_MAXW16_60MS for iSAC fix (60 ms). | 68 // STREAM_MAXW16_60MS for iSAC fix (60 ms). |
| 69 static const size_t kSufficientEncodeBufferSizeBytes = 400; | 69 static const size_t kSufficientEncodeBufferSizeBytes = 400; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 template <typename T> | 89 template <typename T> |
| 90 class AudioDecoderIsacT final : public AudioDecoder { | 90 class AudioDecoderIsacT final : public AudioDecoder { |
| 91 public: | 91 public: |
| 92 AudioDecoderIsacT(); | 92 AudioDecoderIsacT(); |
| 93 explicit AudioDecoderIsacT(LockedIsacBandwidthInfo* bwinfo); | 93 explicit AudioDecoderIsacT(LockedIsacBandwidthInfo* bwinfo); |
| 94 ~AudioDecoderIsacT() override; | 94 ~AudioDecoderIsacT() override; |
| 95 | 95 |
| 96 bool HasDecodePlc() const override; | 96 bool HasDecodePlc() const override; |
| 97 int DecodePlc(int num_frames, int16_t* decoded) override; | 97 size_t DecodePlc(size_t num_frames, int16_t* decoded) override; |
| 98 int Init() override; | 98 int Init() override; |
| 99 int IncomingPacket(const uint8_t* payload, | 99 int IncomingPacket(const uint8_t* payload, |
| 100 size_t payload_len, | 100 size_t payload_len, |
| 101 uint16_t rtp_sequence_number, | 101 uint16_t rtp_sequence_number, |
| 102 uint32_t rtp_timestamp, | 102 uint32_t rtp_timestamp, |
| 103 uint32_t arrival_timestamp) override; | 103 uint32_t arrival_timestamp) override; |
| 104 int ErrorCode() override; | 104 int ErrorCode() override; |
| 105 size_t Channels() const override; | 105 size_t Channels() const override; |
| 106 int DecodeInternal(const uint8_t* encoded, | 106 int DecodeInternal(const uint8_t* encoded, |
| 107 size_t encoded_len, | 107 size_t encoded_len, |
| 108 int sample_rate_hz, | 108 int sample_rate_hz, |
| 109 int16_t* decoded, | 109 int16_t* decoded, |
| 110 SpeechType* speech_type) override; | 110 SpeechType* speech_type) override; |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 typename T::instance_type* isac_state_; | 113 typename T::instance_type* isac_state_; |
| 114 LockedIsacBandwidthInfo* bwinfo_; | 114 LockedIsacBandwidthInfo* bwinfo_; |
| 115 int decoder_sample_rate_hz_; | 115 int decoder_sample_rate_hz_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(AudioDecoderIsacT); | 117 DISALLOW_COPY_AND_ASSIGN(AudioDecoderIsacT); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace webrtc | 120 } // namespace webrtc |
| 121 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ | 121 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ |
| OLD | NEW |