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

Side by Side Diff: webrtc/modules/audio_processing/test/audio_buffer_tools.cc

Issue 1510493004: Bitexactness test for the highpass filter (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Reverted changes to audio_processing_impl.cc Created 4 years, 9 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 | « webrtc/modules/audio_processing/test/audio_buffer_tools.h ('k') | webrtc/modules/modules.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #include "webrtc/modules/audio_processing/test/audio_buffer_tools.h"
12
13 namespace webrtc {
14 namespace test {
15
16 void SetupFrame(StreamConfig stream_config,
17 std::vector<float*>* frame,
18 std::vector<float>* frame_samples) {
19 frame_samples->resize(stream_config.num_channels() *
20 stream_config.num_frames());
21 frame->resize(stream_config.num_channels());
22 for (size_t ch = 0; ch < stream_config.num_channels(); ++ch) {
23 (*frame)[ch] = &(*frame_samples)[ch * stream_config.num_frames()];
24 }
25 }
26
27 void CopyVectorToAudioBuffer(const StreamConfig& stream_config,
28 const std::vector<float>& source,
29 AudioBuffer* destination) {
30 std::vector<float*> input;
31 std::vector<float> input_samples;
32
33 SetupFrame(stream_config, &input, &input_samples);
34
35 RTC_DCHECK_EQ(input_samples.size(), source.size());
36 input_samples = source;
37
38 destination->CopyFrom(&input[0], stream_config);
39 }
40
41 std::vector<float> ExtractVectorFromAudioBuffer(
42 const StreamConfig& stream_config,
43 AudioBuffer* source) {
44 std::vector<float*> output;
45 std::vector<float> output_samples;
46
47 SetupFrame(stream_config, &output, &output_samples);
48
49 source->CopyTo(stream_config, &output[0]);
50
51 return output_samples;
52 }
53
54 } // namespace test
55 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_processing/test/audio_buffer_tools.h ('k') | webrtc/modules/modules.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698