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 |
11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ | 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ |
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ | 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" | 16 #include "webrtc/modules/audio_coding/codecs/audio_encoder.h" |
17 #include "webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h" | 17 #include "webrtc/modules/audio_coding/codecs/isac/locked_bandwidth_info.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 struct CodecInst; | 21 struct CodecInst; |
22 | 22 |
23 template <typename T> | 23 template <typename T> |
24 class AudioEncoderIsacT final : public AudioEncoder { | 24 class AudioEncoderIsacT final : public AudioEncoder { |
25 public: | 25 public: |
26 // Allowed combinations of sample rate, frame size, and bit rate are | 26 // Allowed combinations of sample rate, frame size, and bit rate are |
27 // - 16000 Hz, 30 ms, 10000-32000 bps | 27 // - 16000 Hz, 30 ms, 10000-32000 bps |
28 // - 16000 Hz, 60 ms, 10000-32000 bps | 28 // - 16000 Hz, 60 ms, 10000-32000 bps |
29 // - 32000 Hz, 30 ms, 10000-56000 bps (if T has super-wideband support) | 29 // - 32000 Hz, 30 ms, 10000-56000 bps (if T has super-wideband support) |
30 // - 48000 Hz, 30 ms, 10000-56000 bps (if T has super-wideband support) | |
31 struct Config { | 30 struct Config { |
32 bool IsOk() const; | 31 bool IsOk() const; |
33 | 32 |
34 LockedIsacBandwidthInfo* bwinfo = nullptr; | 33 LockedIsacBandwidthInfo* bwinfo = nullptr; |
35 | 34 |
36 int payload_type = 103; | 35 int payload_type = 103; |
37 int sample_rate_hz = 16000; | 36 int sample_rate_hz = 16000; |
38 int frame_size_ms = 30; | 37 int frame_size_ms = 30; |
39 int bit_rate = kDefaultBitRate; // Limit on the short-term average bit | 38 int bit_rate = kDefaultBitRate; // Limit on the short-term average bit |
40 // rate, in bits/s. | 39 // rate, in bits/s. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 88 |
90 // Timestamp of the previously encoded packet. | 89 // Timestamp of the previously encoded packet. |
91 uint32_t last_encoded_timestamp_; | 90 uint32_t last_encoded_timestamp_; |
92 | 91 |
93 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderIsacT); | 92 RTC_DISALLOW_COPY_AND_ASSIGN(AudioEncoderIsacT); |
94 }; | 93 }; |
95 | 94 |
96 } // namespace webrtc | 95 } // namespace webrtc |
97 | 96 |
98 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ | 97 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_AUDIO_ENCODER_ISAC_T_H_ |
OLD | NEW |