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 21 matching lines...) Expand all Loading... |
32 int frame_size_ms, | 32 int frame_size_ms, |
33 int16_t enforce_frame_size) { | 33 int16_t enforce_frame_size) { |
34 return WebRtcIsac_ControlBwe(inst, rate_bps, frame_size_ms, | 34 return WebRtcIsac_ControlBwe(inst, rate_bps, frame_size_ms, |
35 enforce_frame_size); | 35 enforce_frame_size); |
36 } | 36 } |
37 static inline int16_t Create(instance_type** inst) { | 37 static inline int16_t Create(instance_type** inst) { |
38 return WebRtcIsac_Create(inst); | 38 return WebRtcIsac_Create(inst); |
39 } | 39 } |
40 static inline int DecodeInternal(instance_type* inst, | 40 static inline int DecodeInternal(instance_type* inst, |
41 const uint8_t* encoded, | 41 const uint8_t* encoded, |
42 int16_t len, | 42 size_t len, |
43 int16_t* decoded, | 43 int16_t* decoded, |
44 int16_t* speech_type) { | 44 int16_t* speech_type) { |
45 return WebRtcIsac_Decode(inst, encoded, len, decoded, speech_type); | 45 return WebRtcIsac_Decode(inst, encoded, len, decoded, speech_type); |
46 } | 46 } |
47 static inline int16_t DecodePlc(instance_type* inst, | 47 static inline size_t DecodePlc(instance_type* inst, |
48 int16_t* decoded, | 48 int16_t* decoded, |
49 int16_t num_lost_frames) { | 49 size_t num_lost_frames) { |
50 return WebRtcIsac_DecodePlc(inst, decoded, num_lost_frames); | 50 return WebRtcIsac_DecodePlc(inst, decoded, num_lost_frames); |
51 } | 51 } |
52 | 52 |
53 static inline int16_t DecoderInit(instance_type* inst) { | 53 static inline int16_t DecoderInit(instance_type* inst) { |
54 return WebRtcIsac_DecoderInit(inst); | 54 return WebRtcIsac_DecoderInit(inst); |
55 } | 55 } |
56 static inline int Encode(instance_type* inst, | 56 static inline int Encode(instance_type* inst, |
57 const int16_t* speech_in, | 57 const int16_t* speech_in, |
58 uint8_t* encoded) { | 58 uint8_t* encoded) { |
59 return WebRtcIsac_Encode(inst, speech_in, encoded); | 59 return WebRtcIsac_Encode(inst, speech_in, encoded); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 uint16_t sample_rate_hz) { | 95 uint16_t sample_rate_hz) { |
96 WebRtcIsac_SetEncSampRateInDecoder(inst, sample_rate_hz); | 96 WebRtcIsac_SetEncSampRateInDecoder(inst, sample_rate_hz); |
97 } | 97 } |
98 static inline void SetInitialBweBottleneck( | 98 static inline void SetInitialBweBottleneck( |
99 instance_type* inst, | 99 instance_type* inst, |
100 int bottleneck_bits_per_second) { | 100 int bottleneck_bits_per_second) { |
101 WebRtcIsac_SetInitialBweBottleneck(inst, bottleneck_bits_per_second); | 101 WebRtcIsac_SetInitialBweBottleneck(inst, bottleneck_bits_per_second); |
102 } | 102 } |
103 static inline int16_t UpdateBwEstimate(instance_type* inst, | 103 static inline int16_t UpdateBwEstimate(instance_type* inst, |
104 const uint8_t* encoded, | 104 const uint8_t* encoded, |
105 int32_t packet_size, | 105 size_t packet_size, |
106 uint16_t rtp_seq_number, | 106 uint16_t rtp_seq_number, |
107 uint32_t send_ts, | 107 uint32_t send_ts, |
108 uint32_t arr_ts) { | 108 uint32_t arr_ts) { |
109 return WebRtcIsac_UpdateBwEstimate(inst, encoded, packet_size, | 109 return WebRtcIsac_UpdateBwEstimate(inst, encoded, packet_size, |
110 rtp_seq_number, send_ts, arr_ts); | 110 rtp_seq_number, send_ts, arr_ts); |
111 } | 111 } |
112 static inline int16_t SetMaxPayloadSize(instance_type* inst, | 112 static inline int16_t SetMaxPayloadSize(instance_type* inst, |
113 int16_t max_payload_size_bytes) { | 113 int16_t max_payload_size_bytes) { |
114 return WebRtcIsac_SetMaxPayloadSize(inst, max_payload_size_bytes); | 114 return WebRtcIsac_SetMaxPayloadSize(inst, max_payload_size_bytes); |
115 } | 115 } |
(...skipping 22 matching lines...) Expand all Loading... |
138 size_t max_decoded_bytes, | 138 size_t max_decoded_bytes, |
139 int16_t* decoded, | 139 int16_t* decoded, |
140 SpeechType* speech_type) override; | 140 SpeechType* speech_type) override; |
141 int DecodeRedundant(const uint8_t* encoded, | 141 int DecodeRedundant(const uint8_t* encoded, |
142 size_t encoded_len, | 142 size_t encoded_len, |
143 int sample_rate_hz, | 143 int sample_rate_hz, |
144 size_t max_decoded_bytes, | 144 size_t max_decoded_bytes, |
145 int16_t* decoded, | 145 int16_t* decoded, |
146 SpeechType* speech_type) override; | 146 SpeechType* speech_type) override; |
147 bool HasDecodePlc() const override; | 147 bool HasDecodePlc() const override; |
148 int DecodePlc(int num_frames, int16_t* decoded) override; | 148 size_t DecodePlc(size_t num_frames, int16_t* decoded) override; |
149 int Init() override; | 149 int Init() override; |
150 int IncomingPacket(const uint8_t* payload, | 150 int IncomingPacket(const uint8_t* payload, |
151 size_t payload_len, | 151 size_t payload_len, |
152 uint16_t rtp_sequence_number, | 152 uint16_t rtp_sequence_number, |
153 uint32_t rtp_timestamp, | 153 uint32_t rtp_timestamp, |
154 uint32_t arrival_timestamp) override; | 154 uint32_t arrival_timestamp) override; |
155 int ErrorCode() override; | 155 int ErrorCode() override; |
156 int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; | 156 int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; |
157 int PacketDurationRedundant(const uint8_t* encoded, | 157 int PacketDurationRedundant(const uint8_t* encoded, |
158 size_t encoded_len) const override; | 158 size_t encoded_len) const override; |
159 bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override; | 159 bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override; |
160 size_t Channels() const override; | 160 size_t Channels() const override; |
161 }; | 161 }; |
162 | 162 |
163 } // namespace webrtc | 163 } // namespace webrtc |
164 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_AUDIO_ENCODER_
ISAC_H_ | 164 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_MAIN_INTERFACE_AUDIO_ENCODER_
ISAC_H_ |
OLD | NEW |