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

Issue 1416583003: Lock scheme #5: Applied the render queueing to the agc (Closed)

Created:
5 years, 2 months ago by peah-webrtc
Modified:
5 years, 1 month ago
CC:
webrtc-reviews_webrtc.org, peah-webrtc, Andrew MacDonald, tterriberry_mozilla.com, hlundin-webrtc, kwiberg-webrtc, the sun, aluebs-webrtc, bjornv1
Base URL:
https://chromium.googlesource.com/external/webrtc.git@introduce_queue_CL
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Applied the render queueing to the agc. BUG=webrtc:5099 Committed: https://crrev.com/4d291f7d5e088e3e9f4680dabbe431e62b827f64 Cr-Commit-Position: refs/heads/master@{#10667}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Corrected the sample format when storing the render samples" #

Patch Set 3 : Corrected the expected number of samples for the AGC render side sample queue. #

Patch Set 4 : Changed the render side sample queueing scheme to be atomic over all channels for each frame #

Patch Set 5 : Merge #

Total comments: 4

Patch Set 6 : Replicated what was done for the usage of the render queue in the aec and aecm #

Patch Set 7 : Merge from other Cls in the list #

Total comments: 20

Patch Set 8 : Changes in response to latest reviewer comments #

Total comments: 2

Patch Set 9 : Replaced the AGC specific render queue verifier with the generic template #

Patch Set 10 : Backported proper handling of full render queue and fixed merge build error #

Patch Set 11 : Merge from latest master #

Total comments: 12
Unified diffs Side-by-side diffs Delta from patch set Stats (+146 lines, -41 lines) Patch
M webrtc/modules/audio_processing/agc/legacy/analog_agc.c View 1 chunk +24 lines, -23 lines 0 comments Download
M webrtc/modules/audio_processing/agc/legacy/gain_control.h View 1 2 3 4 5 6 7 1 chunk +14 lines, -0 lines 0 comments Download
M webrtc/modules/audio_processing/audio_processing_impl.cc View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M webrtc/modules/audio_processing/gain_control_impl.h View 1 2 3 4 5 6 7 8 4 chunks +20 lines, -0 lines 0 comments Download
M webrtc/modules/audio_processing/gain_control_impl.cc View 1 2 3 4 5 6 7 8 9 4 chunks +86 lines, -18 lines 12 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 28 (8 generated)
the sun
https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/gain_control_impl.cc File webrtc/modules/audio_processing/gain_control_impl.cc (right): https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/gain_control_impl.cc#newcode81 webrtc/modules/audio_processing/gain_control_impl.cc:81: // once the APM properly checks the sample type ...
5 years, 2 months ago (2015-10-19 14:47:04 UTC) #2
Andrew MacDonald
Drive-by comment. https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { Why ...
5 years, 2 months ago (2015-10-19 16:45:38 UTC) #4
peah-webrtc
Fixing the sample format when storing the render side samples. Will address the feedback in ...
5 years, 2 months ago (2015-10-20 07:09:11 UTC) #5
peah-webrtc
https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { On 2015/10/19 16:45:38, ...
5 years, 1 month ago (2015-10-26 09:09:56 UTC) #8
Andrew MacDonald
https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { On 2015/10/26 09:09:56, ...
5 years, 1 month ago (2015-10-27 00:21:42 UTC) #9
the sun
https://codereview.webrtc.org/1416583003/diff/80001/webrtc/modules/audio_processing/gain_control_impl.cc File webrtc/modules/audio_processing/gain_control_impl.cc (right): https://codereview.webrtc.org/1416583003/diff/80001/webrtc/modules/audio_processing/gain_control_impl.cc#newcode96 webrtc/modules/audio_processing/gain_control_impl.cc:96: void GainControlImpl::ReadQueuedRenderData() { Why do you need this extra ...
5 years, 1 month ago (2015-10-27 16:42:49 UTC) #10
peah-webrtc
https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/1/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { On 2015/10/27 00:21:42, ...
5 years, 1 month ago (2015-10-29 14:05:23 UTC) #11
peah-webrtc
5 years, 1 month ago (2015-11-05 11:45:30 UTC) #12
hlundin-webrtc
See comments. https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { Take ...
5 years, 1 month ago (2015-11-05 13:01:09 UTC) #14
peah-webrtc
https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { On 2015/11/05 13:01:09, ...
5 years, 1 month ago (2015-11-06 07:10:58 UTC) #15
hlundin-webrtc
lgtm https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { On 2015/11/06 ...
5 years, 1 month ago (2015-11-06 07:52:33 UTC) #16
peah-webrtc
https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c File webrtc/modules/audio_processing/agc/legacy/analog_agc.c (right): https://codereview.webrtc.org/1416583003/diff/120001/webrtc/modules/audio_processing/agc/legacy/analog_agc.c#newcode264 webrtc/modules/audio_processing/agc/legacy/analog_agc.c:264: int WebRtcAgc_GetAddFarendError(void *state, size_t samples) { On 2015/11/06 07:52:33, ...
5 years, 1 month ago (2015-11-06 08:10:03 UTC) #17
peah-webrtc
Changed the agc specific render queue verifier to instead use the generic template created in ...
5 years, 1 month ago (2015-11-06 10:45:17 UTC) #18
peah-webrtc
In order to properly handle a full queue, I needed to backport the proper handling ...
5 years, 1 month ago (2015-11-10 12:10:55 UTC) #19
hlundin-webrtc
Still lgtm.
5 years, 1 month ago (2015-11-10 13:28:26 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1416583003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1416583003/200001
5 years, 1 month ago (2015-11-17 06:59:39 UTC) #23
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 1 month ago (2015-11-17 07:52:29 UTC) #24
commit-bot: I haz the power
Patchset 11 (id:??) landed as https://crrev.com/4d291f7d5e088e3e9f4680dabbe431e62b827f64 Cr-Commit-Position: refs/heads/master@{#10667}
5 years, 1 month ago (2015-11-17 07:52:41 UTC) #25
The Sun (google.com)
https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_processing/gain_control_impl.cc File webrtc/modules/audio_processing/gain_control_impl.cc (right): https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_processing/gain_control_impl.cc#newcode38 webrtc/modules/audio_processing/gain_control_impl.cc:38: const size_t GainControlImpl::kAllowedValuesOfSamplesPerFrame1; Why did you need to declare ...
5 years, 1 month ago (2015-11-17 09:34:13 UTC) #27
peah-webrtc
5 years, 1 month ago (2015-11-17 10:18:23 UTC) #28
Message was sent while issue was closed.
Thanks for the comments!!!! I'll upload a fix for the problems in a separate CL.
Sorry for misunderstanding that caused me to commit the CL before this
review!!!!

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
File webrtc/modules/audio_processing/gain_control_impl.cc (right):

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/gain_control_impl.cc:38: const size_t
GainControlImpl::kAllowedValuesOfSamplesPerFrame1;
On 2015/11/17 09:34:13, solenberg wrote:
> Why did you need to declare these in the .cc but not kMaxNumFramesToBuffer ?

(I think) This is needed because the constants are used in a call to a function
where the inputs are reference declared, therefore these needs to be declared in
the .cc. That is not the case for the kMaxNumFramesToBuffer constant.

I order to avoid this inconsistency, I now instead static_cast the constants
before applying them which apparently is a workaround for this issue:
  const size_t max_frame_size = std::max<size_t>(
      static_cast<size_t>(kAllowedValuesOfSamplesPerFrame1),
      static_cast<size_t>(kAllowedValuesOfSamplesPerFrame2));

Then I can remove these declarations.

Please let me know if you think it is ok!
Done.

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/gain_control_impl.cc:56: AllocateRenderQueue();
On 2015/11/17 09:34:13, solenberg wrote:
> Isn't Initialize() always called for processing components? Why do you
> specifically need to allocate the queue here? 

Good point!
Done.

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/gain_control_impl.cc:224:
ReadQueuedRenderData();
On 2015/11/17 09:34:13, solenberg wrote:
> You may want to add a comment here as to why you're doing this. It seems to me
> like a very strange side effect of a function that looks like a simple setter.

Removed it.
Done.

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/gain_control_impl.cc:352: const size_t
max_frame_size = std::max<size_t>(
On 2015/11/17 09:34:13, solenberg wrote:
> Template type should be deduced by the compiler. No need to write <size_t>

Done.

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/gain_control_impl.cc:355: const size_t
new_render_queue_element_max_size = std::max<size_t>(
On 2015/11/17 09:34:12, solenberg wrote:
> is this the queue size, or size of an element in the queue?

This is the size of an element in the queue. The queue size is specified by
kMaxNumFramesToBuffer

https://codereview.webrtc.org/1416583003/diff/200001/webrtc/modules/audio_pro...
webrtc/modules/audio_processing/gain_control_impl.cc:359: std::vector<int16_t>
template_queue_element(render_queue_element_max_size_);
On 2015/11/17 09:34:13, solenberg wrote:
> you're using what looks like the old item size, and never set that to the new
> calculated size. so you will always go this branch?

Fully true, and it worked since the verification broke due to this bug, which
caused all items to be reallocated until the queue item size was achieved. Good
find!

Done.

Powered by Google App Engine
This is Rietveld 408576698