Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: webrtc/modules/audio_coding/codecs/isac/fix/interface/audio_encoder_isacfix.h

Issue 1179953003: Revert "Upconvert various types to int." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_FIX_INTERFACE_AUDIO_ENCODER_ISAC FIX_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_ISAC FIX_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_ISAC FIX_H_ 12 #define WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_ISAC FIX_H_
13 13
14 #include "webrtc/base/checks.h" 14 #include "webrtc/base/checks.h"
15 #include "webrtc/base/scoped_ptr.h" 15 #include "webrtc/base/scoped_ptr.h"
16 #include "webrtc/modules/audio_coding/codecs/audio_encoder_mutable_impl.h" 16 #include "webrtc/modules/audio_coding/codecs/audio_encoder_mutable_impl.h"
17 #include "webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t.h" 17 #include "webrtc/modules/audio_coding/codecs/isac/audio_encoder_isac_t.h"
18 #include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h" 18 #include "webrtc/modules/audio_coding/codecs/isac/fix/interface/isacfix.h"
19 19
20 namespace webrtc { 20 namespace webrtc {
21 21
22 struct IsacFix { 22 struct IsacFix {
23 typedef ISACFIX_MainStruct instance_type; 23 typedef ISACFIX_MainStruct instance_type;
24 static const bool has_swb = false; 24 static const bool has_swb = false;
25 static const uint16_t kFixSampleRate = 16000; 25 static const uint16_t kFixSampleRate = 16000;
26 static inline int16_t Control(instance_type* inst, 26 static inline int16_t Control(instance_type* inst,
27 int32_t rate, 27 int32_t rate,
28 int framesize) { 28 int16_t framesize) {
29 return WebRtcIsacfix_Control(inst, rate, framesize); 29 return WebRtcIsacfix_Control(inst, rate, framesize);
30 } 30 }
31 static inline int16_t ControlBwe(instance_type* inst, 31 static inline int16_t ControlBwe(instance_type* inst,
32 int32_t rate_bps, 32 int32_t rate_bps,
33 int frame_size_ms, 33 int16_t frame_size_ms,
34 int16_t enforce_frame_size) { 34 int16_t enforce_frame_size) {
35 return WebRtcIsacfix_ControlBwe(inst, rate_bps, frame_size_ms, 35 return WebRtcIsacfix_ControlBwe(inst, rate_bps, frame_size_ms,
36 enforce_frame_size); 36 enforce_frame_size);
37 } 37 }
38 static inline int16_t Create(instance_type** inst) { 38 static inline int16_t Create(instance_type** inst) {
39 return WebRtcIsacfix_Create(inst); 39 return WebRtcIsacfix_Create(inst);
40 } 40 }
41 static inline int DecodeInternal(instance_type* inst, 41 static inline int16_t DecodeInternal(instance_type* inst,
42 const uint8_t* encoded, 42 const uint8_t* encoded,
43 int16_t len, 43 int16_t len,
44 int16_t* decoded, 44 int16_t* decoded,
45 int16_t* speech_type) { 45 int16_t* speech_type) {
46 return WebRtcIsacfix_Decode(inst, encoded, len, decoded, speech_type); 46 return WebRtcIsacfix_Decode(inst, encoded, len, decoded, speech_type);
47 } 47 }
48 static inline int16_t DecodePlc(instance_type* inst, 48 static inline int16_t DecodePlc(instance_type* inst,
49 int16_t* decoded, 49 int16_t* decoded,
50 int16_t num_lost_frames) { 50 int16_t num_lost_frames) {
51 return WebRtcIsacfix_DecodePlc(inst, decoded, num_lost_frames); 51 return WebRtcIsacfix_DecodePlc(inst, decoded, num_lost_frames);
52 } 52 }
53 static inline int16_t DecoderInit(instance_type* inst) { 53 static inline int16_t DecoderInit(instance_type* inst) {
54 return WebRtcIsacfix_DecoderInit(inst); 54 return WebRtcIsacfix_DecoderInit(inst);
55 } 55 }
56 static inline int Encode(instance_type* inst, 56 static inline int16_t 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 WebRtcIsacfix_Encode(inst, speech_in, encoded); 59 return WebRtcIsacfix_Encode(inst, speech_in, encoded);
60 } 60 }
61 static inline int16_t EncoderInit(instance_type* inst, int16_t coding_mode) { 61 static inline int16_t EncoderInit(instance_type* inst, int16_t coding_mode) {
62 return WebRtcIsacfix_EncoderInit(inst, coding_mode); 62 return WebRtcIsacfix_EncoderInit(inst, coding_mode);
63 } 63 }
64 static inline uint16_t EncSampRate(instance_type* inst) { 64 static inline uint16_t EncSampRate(instance_type* inst) {
65 return kFixSampleRate; 65 return kFixSampleRate;
66 } 66 }
67 67
68 static inline int16_t Free(instance_type* inst) { 68 static inline int16_t Free(instance_type* inst) {
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 int ErrorCode() override; 141 int ErrorCode() override;
142 int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override; 142 int PacketDuration(const uint8_t* encoded, size_t encoded_len) const override;
143 int PacketDurationRedundant(const uint8_t* encoded, 143 int PacketDurationRedundant(const uint8_t* encoded,
144 size_t encoded_len) const override; 144 size_t encoded_len) const override;
145 bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override; 145 bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override;
146 size_t Channels() const override; 146 size_t Channels() const override;
147 }; 147 };
148 148
149 } // namespace webrtc 149 } // namespace webrtc
150 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_I SACFIX_H_ 150 #endif // WEBRTC_MODULES_AUDIO_CODING_CODECS_ISAC_FIX_INTERFACE_AUDIO_ENCODER_I SACFIX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698