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

Side by Side Diff: webrtc/modules/audio_processing/aec3/render_delay_buffer.h

Issue 2784023002: Major AEC3 render pipeline changes (Closed)
Patch Set: Disabled one more DEATH test that caused issues due to bug on bots 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2017 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_PROCESSING_AEC3_RENDER_DELAY_BUFFER_H_ 11 #ifndef WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_BUFFER_H_
12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_BUFFER_H_ 12 #define WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_BUFFER_H_
13 13
14 #include <stddef.h> 14 #include <stddef.h>
15 #include <array>
15 #include <vector> 16 #include <vector>
16 17
18 #include "webrtc/base/array_view.h"
19 #include "webrtc/modules/audio_processing/aec3/aec3_common.h"
20 #include "webrtc/modules/audio_processing/aec3/downsampled_render_buffer.h"
21 #include "webrtc/modules/audio_processing/aec3/fft_data.h"
22 #include "webrtc/modules/audio_processing/aec3/render_buffer.h"
23
17 namespace webrtc { 24 namespace webrtc {
18 25
19 // Class for buffering the incoming render blocks such that these may be 26 // Class for buffering the incoming render blocks such that these may be
20 // extracted with a specified delay. 27 // extracted with a specified delay.
21 class RenderDelayBuffer { 28 class RenderDelayBuffer {
22 public: 29 public:
23 static RenderDelayBuffer* Create(size_t size_blocks, 30 static RenderDelayBuffer* Create(size_t num_bands);
24 size_t num_bands,
25 size_t max_api_jitter_blocks);
26 virtual ~RenderDelayBuffer() = default; 31 virtual ~RenderDelayBuffer() = default;
27 32
28 // Swaps a block into the buffer (the content of block is destroyed) and 33 // Resets the buffer data.
29 // returns true if the insert is successful. 34 virtual void Reset() = 0;
30 virtual bool Insert(std::vector<std::vector<float>>* block) = 0;
31 35
32 // Gets a reference to the next block (having the specified buffer delay) to 36 // Inserts a block into the buffer and returns true if the insert is
33 // read in the buffer. This method can only be called if a block is 37 // successful.
34 // available which means that that must be checked prior to the call using 38 virtual bool Insert(const std::vector<std::vector<float>>& block) = 0;
35 // the method IsBlockAvailable().
36 virtual const std::vector<std::vector<float>>& GetNext() = 0;
37 39
38 // Sets the buffer delay. The delay set must be lower than the delay reported 40 // Updates the buffers one step based on the specified buffer delay. Returns
39 // by MaxDelay(). 41 // true if there was no overrun, otherwise returns false.
42 virtual bool UpdateBuffers() = 0;
43
44 // Sets the buffer delay.
40 virtual void SetDelay(size_t delay) = 0; 45 virtual void SetDelay(size_t delay) = 0;
41 46
42 // Gets the buffer delay. 47 // Gets the buffer delay.
43 virtual size_t Delay() const = 0; 48 virtual size_t Delay() const = 0;
44 49
45 // Returns the maximum allowed buffer delay increase. 50 // Returns the render buffer for the echo remover.
46 virtual size_t MaxDelay() const = 0; 51 virtual const RenderBuffer& GetRenderBuffer() const = 0;
47 52
48 // Returns whether a block is available for reading. 53 // Returns the downsampled render buffer.
49 virtual bool IsBlockAvailable() const = 0; 54 virtual const DownsampledRenderBuffer& GetDownsampledRenderBuffer() const = 0;
50
51 // Returns the maximum allowed api call jitter in blocks.
52 virtual size_t MaxApiJitter() const = 0;
53 }; 55 };
54 56
55 } // namespace webrtc 57 } // namespace webrtc
56 58
57 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_BUFFER_H_ 59 #endif // WEBRTC_MODULES_AUDIO_PROCESSING_AEC3_RENDER_DELAY_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698