History log of /external/webrtc/webrtc/common_audio/include/audio_util.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6955870806624479723addfae6dcf5d13968796c 13-Jan-2016 Peter Kasting <pkasting@google.com> Convert channel counts to size_t.

IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.

BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org

Review URL: https://codereview.webrtc.org/1316523002 .

Cr-Commit-Position: refs/heads/master@{#11229}
/external/webrtc/webrtc/common_audio/include/audio_util.h
91d6edef35e7275879c30ce16ecb8b6dc73c6e4a 17-Sep-2015 henrikg <henrikg@webrtc.org> Add RTC_ prefix to (D)CHECKs and related macros.

We must remove dependency on Chromium, i.e. we can't use Chromium's base/logging.h. That means we need to define these macros in WebRTC also when doing Chromium builds. And this causes redefinition.

Alternative solutions:
* Check if we already have defined e.g. CHECK, and don't define them in that case. This makes us depend on include order in Chromium, which is not acceptable.
* Don't allow using the macros in WebRTC headers. Error prone since if someone adds it there by mistake it may compile fine, but later break if a header in added or order is changed in Chromium. That will be confusing and hard to enforce.
* Ensure that headers that are included by an embedder don't include our macros. This would require some heavy refactoring to be maintainable and enforcable.
* Changes in Chromium for this is obviously not an option.

BUG=chromium:468375
NOTRY=true

Review URL: https://codereview.webrtc.org/1335923002

Cr-Commit-Position: refs/heads/master@{#9964}
/external/webrtc/webrtc/common_audio/include/audio_util.h
dce40cf804019a9898b6ab8d8262466b697c56e0 24-Aug-2015 Peter Kasting <pkasting@google.com> Update a ton of audio code to use size_t more correctly and in general reduce
use of int16_t/uint16_t.

This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.

This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002

The change is being landed as TBR to all the folks who reviewed the above.

BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher

Review URL: https://codereview.webrtc.org/1230503003 .

Cr-Commit-Position: refs/heads/master@{#9768}
/external/webrtc/webrtc/common_audio/include/audio_util.h
60d9b332a5391045439bfb6a3a5447973e3d5603 14-Aug-2015 ekmeyerson <ekmeyerson@webrtc.org> Integrate Intelligibility with APM

- Integrates intelligibility into audio_processing.
- Allows modification of reverse stream if intelligibility enabled.
- Makes intelligibility available in audioproc_float test.
- Adds reverse stream processing to audioproc_float.
- (removed) Makes intelligibility toggleable in real time in voe_cmd_test.
- Cleans up intelligibility construction, parameters, constants and dead code.

TBR=pbos@webrtc.org

Review URL: https://codereview.webrtc.org/1234463003

Cr-Commit-Position: refs/heads/master@{#9713}
/external/webrtc/webrtc/common_audio/include/audio_util.h
86c6d33aec684d08189d498912e47cbc17c4d2db 23-Jul-2015 Michael Graczyk <mgraczyk@chromium.org> Allow more than 2 input channels in AudioProcessing.

The number of output channels is constrained to be equal to either 1 or the
number of input channels.

An earlier version of this commit caused a crash on AEC dump.

TBR=aluebs@webrtc.org,pbos@webrtc.org

Review URL: https://codereview.webrtc.org/1248393003 .

Cr-Commit-Position: refs/heads/master@{#9626}
/external/webrtc/webrtc/common_audio/include/audio_util.h
64e753c3998a17429418180b3a947231a9fd98cd 23-Jul-2015 magjed <magjed@webrtc.org> Revert of Allow more than 2 input channels in AudioProcessing. (patchset #13 id:240001 of https://codereview.webrtc.org/1226093007/)

Reason for revert:
Breaks Chromium FYI content_browsertest on all platforms. The testcase that fails is WebRtcAecDumpBrowserTest.CallWithAecDump.

https://build.chromium.org/p/chromium.webrtc.fyi/builders/Linux/builds/19388

Sample output:
[ RUN ] WebRtcAecDumpBrowserTest.CallWithAecDump
Xlib: extension "RANDR" missing on display ":9".
[4:14:0722/211548:1282124453:WARNING:webrtcvoiceengine.cc(472)] Unexpected codec: ISAC/48000/1 (105)
[4:14:0722/211548:1282124593:WARNING:webrtcvoiceengine.cc(472)] Unexpected codec: PCMU/8000/2 (110)
[4:14:0722/211548:1282124700:WARNING:webrtcvoiceengine.cc(472)] Unexpected codec: PCMA/8000/2 (118)
[4:14:0722/211548:1282124815:WARNING:webrtcvoiceengine.cc(472)] Unexpected codec: G722/8000/2 (119)
[19745:19745:0722/211548:1282133667:INFO:CONSOLE(64)] "Looking at video in element remote-view-1", source: http://127.0.0.1:48819/media/webrtc_test_utilities.js (64)
[19745:19745:0722/211548:1282136892:INFO:CONSOLE(64)] "Looking at video in element remote-view-2", source: http://127.0.0.1:48819/media/webrtc_test_utilities.js (64)
../../content/test/webrtc_content_browsertest_base.cc:62: Failure
Value of: ExecuteScriptAndExtractString( shell()->web_contents(), javascript, &result)
Actual: false
Expected: true
Failed to execute javascript call({video: true, audio: true});.
From javascript: (nothing)
When executing 'call({video: true, audio: true});'
../../content/test/webrtc_content_browsertest_base.cc:75: Failure
Failed
../../content/browser/media/webrtc_aecdump_browsertest.cc:26: Failure
Expected: (base::kNullProcessId) != (*id), actual: 0 vs 0
../../content/browser/media/webrtc_aecdump_browsertest.cc:95: Failure
Value of: GetRenderProcessHostId(&render_process_id)
Actual: false
Expected: true
../../content/browser/media/webrtc_aecdump_browsertest.cc:99: Failure
Value of: base::PathExists(dump_file)
Actual: false
Expected: true
../../content/browser/media/webrtc_aecdump_browsertest.cc:101: Failure
Value of: base::GetFileSize(dump_file, &file_size)
Actual: false
Expected: true
../../content/browser/media/webrtc_aecdump_browsertest.cc:102: Failure
Expected: (file_size) > (0), actual: 0 vs 0
[ FAILED ] WebRtcAecDumpBrowserTest.CallWithAecDump, where TypeParam = and GetParam() = (361 ms)

Original issue's description:
> Allow more than 2 input channels in AudioProcessing.
>
> The number of output channels is constrained to be equal to either 1 or the
> number of input channels.
>
> R=aluebs@webrtc.org, andrew@webrtc.org, pbos@webrtc.org
>
> Committed: https://chromium.googlesource.com/external/webrtc/+/c204754b7a0cc801c70e8ce6c689f57f6ce00b3b

TBR=andrew@webrtc.org,aluebs@webrtc.org,ajm@chromium.org,pbos@chromium.org,pbos@webrtc.org,mgraczyk@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.webrtc.org/1253573005

Cr-Commit-Position: refs/heads/master@{#9621}
/external/webrtc/webrtc/common_audio/include/audio_util.h
c204754b7a0cc801c70e8ce6c689f57f6ce00b3b 23-Jul-2015 Michael Graczyk <mgraczyk@chromium.org> Allow more than 2 input channels in AudioProcessing.

The number of output channels is constrained to be equal to either 1 or the
number of input channels.

R=aluebs@webrtc.org, andrew@webrtc.org, pbos@webrtc.org

Review URL: https://codereview.webrtc.org/1226093007 .

Cr-Commit-Position: refs/heads/master@{#9619}
/external/webrtc/webrtc/common_audio/include/audio_util.h
00b8f6b3643332cce1ee711715f7fbb824d793ca 26-Feb-2015 kwiberg@webrtc.org <kwiberg@webrtc.org> Use base/scoped_ptr.h; system_wrappers/interface/scoped_ptr.h is going away

BUG=
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/36229004

Cr-Commit-Position: refs/heads/master@{#8517}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8517 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
8328e7c44d59bb9fcbc7f8a033beb3d073929518 31-Oct-2014 andrew@webrtc.org <andrew@webrtc.org> Revert "Revert part of r7561, "Refactor audio conversion functions.""

This restores the conversion changes to AudioProcessing originally
added in r7561, with minor alterations to ensure it passes all tests.

TBR=kwiberg

Review URL: https://webrtc-codereview.appspot.com/28899004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7574 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
4fc4addc815379c6cc1d04f4853a528390fe09ba 30-Oct-2014 andrew@webrtc.org <andrew@webrtc.org> Refactor audio conversion functions.

Use a consistent naming scheme that can be understood at the callsite
without having to refer to documentation.

Remove hacks in AudioBuffer intended to maintain bit-exactness with the
float path. The conversions etc. are now all natural, and instead we
enforce close but not bit-exact output between the two paths.

Output of ApmTest.Process:
https://paste.googleplex.com/5931055831842816

R=aluebs@webrtc.org, bjornv@webrtc.org, kwiberg@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/13049004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7561 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
17454f79dca728cf036ede2ac95371b3854123b1 08-Sep-2014 andrew@webrtc.org <andrew@webrtc.org> Add ctors to ChannelBuffer to enable copying on construction.

Also:
- Fix the constness of some parameters.
- Add more const overloads.
- Use DCHECK in place of assert.
- Removed an unnecessary memset.

R=claguna@google.com

Review URL: https://webrtc-codereview.appspot.com/24469004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@7107 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
efb81d8d1f6510ff10ca34a2ee243a7ab5fbd2cd 16-Jul-2014 kwiberg@webrtc.org <kwiberg@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> int16<->float conversions: Use size_t for array length argument, not int

size_t is more appropriate for array lengths, since int might
theoretically be too small for a really large array. But more
importantly, if the caller's value is naturally of type size_t and the
function requires an int, VC++ will trigger warning C4267
(http://msdn.microsoft.com/en-us/library/6kck0s93.aspx) because the
implicit cast might be lossy, forcing the caller to do a manual cast.
Typing the function with size_t in the first place resolves the
problem.

R=aluebs@webrtc.org, andrew@webrtc.org, minyue@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/21909004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6702 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
17e40641b30559602e26382e500bd9708bad37e3 04-Mar-2014 andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> Add a deinterleaved float interface to AudioProcessing.

This is mainly to support the native audio format in Chrome. Although
this implementation just moves the float->int conversion under the hood,
we will transition AudioProcessing towards supporting this format
throughout.

- Add a test which verifies we get identical output with the float and
int interfaces.
- The float and int wrappers are tasked with conversion to the
AudioBuffer format. A new shared Process/Analyze method does most of
the work.
- Add a new field to the debug.proto to hold deinterleaved data.
- Add helpers to audio_utils.cc, and start using numeric_limits.
- Note that there was no performance difference between numeric_limits
and a literal value when measured on Linux using gcc or clang.

BUG=2894
R=aluebs@webrtc.org, bjornv@webrtc.org, henrikg@webrtc.org, tommi@webrtc.org, turaj@webrtc.org, xians@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/9179004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5641 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
d4d5be87819307ba88819e86af41b5681c1ee8d7 20-Feb-2014 turaj@webrtc.org <turaj@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> Minor improvement in RoundToInt16 implementation.

R=andrew@webrtc.org, bjornv@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/8959004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5586 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
b159c2e3dd25b67ce064f61024ac831b6661f4c1 06-Sep-2013 andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> Reduce cost of PushSincResampler::Resample().

Ideally, PushSincResampler would have very little overhead on
SincResampler. This gets closer to that ideal.

Replace std::min/max and floor with inline functions. Add a benchmark
test to verify the improvement.

On a MacBook Retina, this results in PushSincResampler::Resample()
accounting for ~1% of CPU usage on voe_cmd_test vs the earlier ~2%
(with ISAC16 and 48 kHz audio devices).

Using the new benchmark, this results in a performance improvement of:
16 -> 44.1 : 1.7x
16 -> 48 : 1.9x
32 -> 44.1 : 1.6x
32 -> 48 : 1.7x
44.1 -> 16 : 1.5x
44.1 -> 32 : 1.7x
44.1 -> 48 : 1.7x
48 -> 16 : 1.5x
48 -> 32 : 1.5x
48 -> 44.1 : 1.8x

R=turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2157005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4695 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h
50b2efef6ecb51a9d5818345c58533c5d236ec29 29-Apr-2013 andrew@webrtc.org <andrew@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> Add a wrapper around PushSincResampler and the old Resampler.

The old resampler is used whenever it supports the requested rates. Otherwise
the sinc resampler is enabled.

Integrated with output_mixer in order to test the change through
output_mixer_unittest. The sinc resampler will not yet be used, since we don't
feed VoE with any rates that trigger it.

BUG=webrtc:1395
R=bjornv@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1355004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3915 4adac7df-926f-26a2-2b94-8c16560cd09d
/external/webrtc/webrtc/common_audio/include/audio_util.h