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

Side by Side Diff: webrtc/modules/audio_coding/neteq/normal.h

Issue 2763273003: Changed OLA window for neteq. Old code didnt work well with 48khz (Closed)
Patch Set: Updated after review comments Created 3 years, 8 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
« no previous file with comments | « AUTHORS ('k') | webrtc/modules/audio_coding/neteq/normal.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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_NETEQ_NORMAL_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_NORMAL_H_
12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_NORMAL_H_ 12 #define WEBRTC_MODULES_AUDIO_CODING_NETEQ_NORMAL_H_
13 13
14 #include <string.h> // Access to size_t. 14 #include <string.h> // Access to size_t.
15 15
16 #include <vector> 16 #include <vector>
17 17
18 #include "webrtc/base/checks.h"
18 #include "webrtc/base/constructormagic.h" 19 #include "webrtc/base/constructormagic.h"
19 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h" 20 #include "webrtc/modules/audio_coding/neteq/audio_multi_vector.h"
20 #include "webrtc/modules/audio_coding/neteq/defines.h" 21 #include "webrtc/modules/audio_coding/neteq/defines.h"
21 #include "webrtc/typedefs.h" 22 #include "webrtc/typedefs.h"
22 23
23 namespace webrtc { 24 namespace webrtc {
24 25
25 // Forward declarations. 26 // Forward declarations.
26 class BackgroundNoise; 27 class BackgroundNoise;
27 class DecoderDatabase; 28 class DecoderDatabase;
28 class Expand; 29 class Expand;
29 30
30 // This class provides the "Normal" DSP operation, that is performed when 31 // This class provides the "Normal" DSP operation, that is performed when
31 // there is no data loss, no need to stretch the timing of the signal, and 32 // there is no data loss, no need to stretch the timing of the signal, and
32 // no other "special circumstances" are at hand. 33 // no other "special circumstances" are at hand.
33 class Normal { 34 class Normal {
34 public: 35 public:
35 Normal(int fs_hz, DecoderDatabase* decoder_database, 36 Normal(int fs_hz,
37 DecoderDatabase* decoder_database,
36 const BackgroundNoise& background_noise, 38 const BackgroundNoise& background_noise,
37 Expand* expand) 39 Expand* expand)
38 : fs_hz_(fs_hz), 40 : fs_hz_(fs_hz),
39 decoder_database_(decoder_database), 41 decoder_database_(decoder_database),
40 background_noise_(background_noise), 42 background_noise_(background_noise),
41 expand_(expand) { 43 expand_(expand),
42 } 44 samples_per_ms_(rtc::CheckedDivExact(fs_hz_, 1000)),
45 default_win_slope_Q14_((1 << 14) / samples_per_ms_) {}
hlundin-webrtc 2017/03/28 12:21:04 You get compilation errors here for Win64. SEe htt
43 46
44 virtual ~Normal() {} 47 virtual ~Normal() {}
45 48
46 // Performs the "Normal" operation. The decoder data is supplied in |input|, 49 // Performs the "Normal" operation. The decoder data is supplied in |input|,
47 // having |length| samples in total for all channels (interleaved). The 50 // having |length| samples in total for all channels (interleaved). The
48 // result is written to |output|. The number of channels allocated in 51 // result is written to |output|. The number of channels allocated in
49 // |output| defines the number of channels that will be used when 52 // |output| defines the number of channels that will be used when
50 // de-interleaving |input|. |last_mode| contains the mode used in the previous 53 // de-interleaving |input|. |last_mode| contains the mode used in the previous
51 // GetAudio call (i.e., not the current one), and |external_mute_factor| is 54 // GetAudio call (i.e., not the current one), and |external_mute_factor| is
52 // a pointer to the mute factor in the NetEqImpl class. 55 // a pointer to the mute factor in the NetEqImpl class.
53 int Process(const int16_t* input, size_t length, 56 int Process(const int16_t* input, size_t length,
54 Modes last_mode, 57 Modes last_mode,
55 int16_t* external_mute_factor_array, 58 int16_t* external_mute_factor_array,
56 AudioMultiVector* output); 59 AudioMultiVector* output);
57 60
58 private: 61 private:
59 int fs_hz_; 62 int fs_hz_;
60 DecoderDatabase* decoder_database_; 63 DecoderDatabase* decoder_database_;
61 const BackgroundNoise& background_noise_; 64 const BackgroundNoise& background_noise_;
62 Expand* expand_; 65 Expand* expand_;
66 const size_t samples_per_ms_;
67 const int16_t default_win_slope_Q14_;
63 68
64 RTC_DISALLOW_COPY_AND_ASSIGN(Normal); 69 RTC_DISALLOW_COPY_AND_ASSIGN(Normal);
65 }; 70 };
66 71
67 } // namespace webrtc 72 } // namespace webrtc
68 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NORMAL_H_ 73 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_NORMAL_H_
OLDNEW
« no previous file with comments | « AUTHORS ('k') | webrtc/modules/audio_coding/neteq/normal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698