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

Issue 2655783004: Decode entire in-memory file for WebAudio (Closed)

Created:
3 years, 11 months ago by Raymond Toy
Modified:
3 years, 10 months ago
Reviewers:
DaleCurtis, hongchan
CC:
chromium-reviews, darin-cc_chromium.org, feature-media-reviews_chromium.org, jam, mlamouri+watch-content_chromium.org, posciak+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Decode entire in-memory file for WebAudio DecodeAudioFileData assumed that any in-memory file to be decoded had a known duration that could be estimated without reading the entire file. For webm files produced by MediaRecorder, this can be false. Read and decode the entire file, ignoring any estimated duration. This will result in increased memory consumption because the final output is built up in pieces before finally copying it to the final destination. Add tests for decoding webm files and WAV files using float32 samples. Vorbis tests need to be updated because the resulting outputs were previously truncated. BUG=673782 TEST=codec-tests/webm/webm-decode.html, codec-tests/wav/f32-44khz.html Review-Url: https://codereview.chromium.org/2655783004 Cr-Commit-Position: refs/heads/master@{#449662} Committed: https://chromium.googlesource.com/chromium/src/+/3489b2812bf4e670cc27627ee9a7a1fd1919f399

Patch Set 1 #

Patch Set 2 : Implement streaming read and add test #

Patch Set 3 : Clean up implementation. #

Total comments: 3

Patch Set 4 : WIP: always read entire file #

Patch Set 5 : WIP: cleanup, add tests #

Total comments: 5

Patch Set 6 : WIP: update unit tests #

Patch Set 7 : Remove old implmenetation and update tests #

Total comments: 31

Patch Set 8 : Address review comments #

Patch Set 9 : Address review comments #

Total comments: 3

Patch Set 10 : Use int, not size_t. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+190 lines, -146 lines) Patch
M content/renderer/media/audio_decoder.cc View 1 2 3 4 5 6 7 8 3 chunks +33 lines, -38 lines 0 comments Download
M media/filters/audio_file_reader.h View 1 2 3 4 5 6 7 8 2 chunks +14 lines, -8 lines 0 comments Download
M media/filters/audio_file_reader.cc View 1 2 3 4 5 6 7 8 9 5 chunks +35 lines, -57 lines 0 comments Download
M media/filters/audio_file_reader_unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +30 lines, -26 lines 0 comments Download
M third_party/WebKit/LayoutTests/webaudio/codec-tests/vorbis/vbr-128kbps-44khz-expected.wav View 1 2 3 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/webaudio/codec-tests/vorbis/vbr-70kbps-44khz-expected.wav View 1 2 3 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/webaudio/codec-tests/vorbis/vbr-96kbps-44khz-expected.wav View 1 2 3 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/codec-tests/wav/f32-44khz.html View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/codec-tests/wav/f32-44khz-expected.wav View 1 2 3 4 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/test-webm.webm View 1 Binary file 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html View 1 2 3 4 5 6 1 chunk +61 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode-expected.wav View 1 Binary file 0 comments Download
M third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic.html View 1 2 chunks +0 lines, -16 lines 0 comments Download
M third_party/WebKit/LayoutTests/webaudio/decodeAudioData/decode-audio-data-basic-expected.txt View 1 1 chunk +0 lines, -1 line 0 comments Download
A third_party/WebKit/LayoutTests/webaudio/resources/media/f32-44khz.wav View 1 2 3 4 Binary file 0 comments Download

Messages

Total messages: 58 (10 generated)
Raymond Toy
PTAL at this general approach. Instead of implementing a streaming reader, I implemented a method ...
3 years, 11 months ago (2017-01-24 22:38:57 UTC) #2
DaleCurtis
Is this worth doing? It's extremely inefficient. I think instead you might want to change ...
3 years, 11 months ago (2017-01-24 22:47:13 UTC) #3
Raymond Toy
On 2017/01/24 22:47:13, DaleCurtis wrote: > Is this worth doing? It's extremely inefficient. I think ...
3 years, 11 months ago (2017-01-24 22:54:43 UTC) #4
DaleCurtis
On 2017/01/24 at 22:54:43, rtoy wrote: > On 2017/01/24 22:47:13, DaleCurtis wrote: > > Is ...
3 years, 11 months ago (2017-01-24 22:59:33 UTC) #5
Raymond Toy
On 2017/01/24 22:59:33, DaleCurtis wrote: > On 2017/01/24 at 22:54:43, rtoy wrote: > > On ...
3 years, 11 months ago (2017-01-24 23:03:02 UTC) #6
DaleCurtis
On 2017/01/24 at 23:03:02, rtoy wrote: > On 2017/01/24 22:59:33, DaleCurtis wrote: > > On ...
3 years, 11 months ago (2017-01-24 23:07:17 UTC) #7
Raymond Toy
On 2017/01/24 23:07:17, DaleCurtis wrote: > On 2017/01/24 at 23:03:02, rtoy wrote: > > On ...
3 years, 11 months ago (2017-01-24 23:18:36 UTC) #8
DaleCurtis
On 2017/01/24 at 23:18:36, rtoy wrote: > On 2017/01/24 23:07:17, DaleCurtis wrote: > > On ...
3 years, 11 months ago (2017-01-24 23:21:06 UTC) #9
Raymond Toy
On 2017/01/24 23:21:06, DaleCurtis wrote: > On 2017/01/24 at 23:18:36, rtoy wrote: > > On ...
3 years, 11 months ago (2017-01-24 23:25:10 UTC) #10
DaleCurtis
On 2017/01/24 at 23:25:10, rtoy wrote: > On 2017/01/24 23:21:06, DaleCurtis wrote: > > On ...
3 years, 11 months ago (2017-01-24 23:59:31 UTC) #11
Raymond Toy
On 2017/01/24 23:59:31, DaleCurtis wrote: > On 2017/01/24 at 23:25:10, rtoy wrote: > > On ...
3 years, 11 months ago (2017-01-25 00:12:14 UTC) #12
Raymond Toy
Dale, I've implemented the streaming reader. PTAL at the general approach.
3 years, 11 months ago (2017-01-25 19:21:56 UTC) #16
DaleCurtis
I wouldn't call this the streaming approach, but it should work. The streaming approach is ...
3 years, 11 months ago (2017-01-25 22:42:25 UTC) #17
Raymond Toy
On 2017/01/25 22:42:25, DaleCurtis wrote: > I wouldn't call this the streaming approach, but it ...
3 years, 11 months ago (2017-01-25 23:55:28 UTC) #18
hongchan
The layout test looks good. Are you going to address Dale's feedback?
3 years, 11 months ago (2017-01-26 21:34:55 UTC) #19
Raymond Toy
On 2017/01/26 21:34:55, hongchan wrote: > The layout test looks good. Are you going to ...
3 years, 11 months ago (2017-01-26 21:55:57 UTC) #20
Raymond Toy
On 2017/01/26 21:55:57, Raymond Toy wrote: > On 2017/01/26 21:34:55, hongchan wrote: > > The ...
3 years, 10 months ago (2017-02-07 20:04:29 UTC) #21
DaleCurtis
On 2017/02/07 at 20:04:29, rtoy wrote: > On 2017/01/26 21:55:57, Raymond Toy wrote: > > ...
3 years, 10 months ago (2017-02-07 20:51:52 UTC) #22
Raymond Toy
On 2017/02/07 20:51:52, DaleCurtis wrote: > On 2017/02/07 at 20:04:29, rtoy wrote: > > On ...
3 years, 10 months ago (2017-02-07 21:34:12 UTC) #23
DaleCurtis
On 2017/02/07 at 21:34:12, rtoy wrote: > On 2017/02/07 20:51:52, DaleCurtis wrote: > > On ...
3 years, 10 months ago (2017-02-07 21:48:58 UTC) #24
Raymond Toy
On 2017/02/07 21:48:58, DaleCurtis wrote: > On 2017/02/07 at 21:34:12, rtoy wrote: > > On ...
3 years, 10 months ago (2017-02-07 22:08:58 UTC) #25
DaleCurtis
Yes, AudioFileReader lives in media/filters whereas blink stuff is only available in media/blink; we could ...
3 years, 10 months ago (2017-02-07 22:11:32 UTC) #26
Raymond Toy
On 2017/02/07 22:11:32, DaleCurtis wrote: > Yes, AudioFileReader lives in media/filters whereas blink stuff is ...
3 years, 10 months ago (2017-02-07 22:14:12 UTC) #27
Raymond Toy
dalecurtis: Not quite ready for review, but I have a couple of questions on what ...
3 years, 10 months ago (2017-02-08 21:30:45 UTC) #28
DaleCurtis
https://codereview.chromium.org/2655783004/diff/80001/media/filters/audio_file_reader.cc File media/filters/audio_file_reader.cc (right): https://codereview.chromium.org/2655783004/diff/80001/media/filters/audio_file_reader.cc#newcode283 media/filters/audio_file_reader.cc:283: break; On 2017/02/08 at 21:30:45, Raymond Toy wrote: > ...
3 years, 10 months ago (2017-02-08 21:47:52 UTC) #29
Raymond Toy
https://codereview.chromium.org/2655783004/diff/80001/media/filters/audio_file_reader.cc File media/filters/audio_file_reader.cc (right): https://codereview.chromium.org/2655783004/diff/80001/media/filters/audio_file_reader.cc#newcode283 media/filters/audio_file_reader.cc:283: break; On 2017/02/08 21:47:52, DaleCurtis wrote: > On 2017/02/08 ...
3 years, 10 months ago (2017-02-08 22:08:35 UTC) #30
Raymond Toy
dalecurtis: I'm updating some of the unit tests now and there are three failures. InfiniteDuration ...
3 years, 10 months ago (2017-02-08 23:55:23 UTC) #31
DaleCurtis
On 2017/02/08 at 23:55:23, rtoy wrote: > dalecurtis: I'm updating some of the unit tests ...
3 years, 10 months ago (2017-02-09 01:07:51 UTC) #32
Raymond Toy
On 2017/02/09 01:07:51, DaleCurtis wrote: > On 2017/02/08 at 23:55:23, rtoy wrote: > > dalecurtis: ...
3 years, 10 months ago (2017-02-09 17:13:34 UTC) #33
Raymond Toy
PTAL at ps#7
3 years, 10 months ago (2017-02-09 18:32:14 UTC) #36
DaleCurtis
https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc File content/renderer/media/audio_decoder.cc (right): https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode9 content/renderer/media/audio_decoder.cc:9: #include <iomanip> ? https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode58 content/renderer/media/audio_decoder.cc:58: std::vector<std::unique_ptr<AudioBus>> decodedAudioPackets; decoded_audio_packets. https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode59 ...
3 years, 10 months ago (2017-02-09 18:47:36 UTC) #37
Raymond Toy
https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc File content/renderer/media/audio_decoder.cc (right): https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode9 content/renderer/media/audio_decoder.cc:9: #include <iomanip> On 2017/02/09 18:47:36, DaleCurtis wrote: > ? ...
3 years, 10 months ago (2017-02-09 18:56:13 UTC) #38
Raymond Toy
https://codereview.chromium.org/2655783004/diff/120001/media/filters/audio_file_reader_unittest.cc File media/filters/audio_file_reader_unittest.cc (right): https://codereview.chromium.org/2655783004/diff/120001/media/filters/audio_file_reader_unittest.cc#newcode110 media/filters/audio_file_reader_unittest.cc:110: EXPECT_EQ(reader_->HasKnownDuration(), false); On 2017/02/09 18:47:36, DaleCurtis wrote: > If ...
3 years, 10 months ago (2017-02-09 19:56:06 UTC) #39
Raymond Toy
https://codereview.chromium.org/2655783004/diff/120001/media/filters/audio_file_reader.cc File media/filters/audio_file_reader.cc (right): https://codereview.chromium.org/2655783004/diff/120001/media/filters/audio_file_reader.cc#newcode206 media/filters/audio_file_reader.cc:206: std::unique_ptr<AudioBus> audio_bus = On 2017/02/09 18:47:36, DaleCurtis wrote: > ...
3 years, 10 months ago (2017-02-09 19:59:29 UTC) #40
DaleCurtis
https://codereview.chromium.org/2655783004/diff/120001/media/filters/audio_file_reader.cc File media/filters/audio_file_reader.cc (right): https://codereview.chromium.org/2655783004/diff/120001/media/filters/audio_file_reader.cc#newcode206 media/filters/audio_file_reader.cc:206: std::unique_ptr<AudioBus> audio_bus = On 2017/02/09 at 19:59:29, Raymond Toy ...
3 years, 10 months ago (2017-02-09 20:29:38 UTC) #41
Raymond Toy
https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc File content/renderer/media/audio_decoder.cc (right): https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode58 content/renderer/media/audio_decoder.cc:58: std::vector<std::unique_ptr<AudioBus>> decodedAudioPackets; On 2017/02/09 18:47:36, DaleCurtis wrote: > decoded_audio_packets. ...
3 years, 10 months ago (2017-02-09 21:45:07 UTC) #42
DaleCurtis
https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc File content/renderer/media/audio_decoder.cc (right): https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode9 content/renderer/media/audio_decoder.cc:9: #include <iomanip> On 2017/02/09 at 18:56:12, Raymond Toy wrote: ...
3 years, 10 months ago (2017-02-09 22:42:20 UTC) #43
Raymond Toy
https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc File content/renderer/media/audio_decoder.cc (right): https://codereview.chromium.org/2655783004/diff/120001/content/renderer/media/audio_decoder.cc#newcode9 content/renderer/media/audio_decoder.cc:9: #include <iomanip> On 2017/02/09 22:42:20, DaleCurtis wrote: > On ...
3 years, 10 months ago (2017-02-09 23:09:28 UTC) #44
DaleCurtis
lgtm, nice work! Did you see how this performs on http://www.scirra.com/labs/bugs/webaudiodecode/ from http://crbug.com/424174 ? https://codereview.chromium.org/2655783004/diff/160001/media/filters/audio_file_reader.cc ...
3 years, 10 months ago (2017-02-09 23:24:43 UTC) #45
Raymond Toy
On 2017/02/09 23:24:43, DaleCurtis wrote: > lgtm, nice work! Did you see how this performs ...
3 years, 10 months ago (2017-02-09 23:32:46 UTC) #46
Raymond Toy
https://codereview.chromium.org/2655783004/diff/160001/media/filters/audio_file_reader.cc File media/filters/audio_file_reader.cc (right): https://codereview.chromium.org/2655783004/diff/160001/media/filters/audio_file_reader.cc#newcode144 media/filters/audio_file_reader.cc:144: size_t total_frames = 0; On 2017/02/09 23:24:43, DaleCurtis wrote: ...
3 years, 10 months ago (2017-02-10 16:36:02 UTC) #47
Raymond Toy
On 2017/02/09 23:32:46, Raymond Toy wrote: > On 2017/02/09 23:24:43, DaleCurtis wrote: > > lgtm, ...
3 years, 10 months ago (2017-02-10 16:36:31 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2655783004/180001
3 years, 10 months ago (2017-02-10 16:37:50 UTC) #51
DaleCurtis
On 2017/02/09 at 23:32:46, rtoy wrote: > On 2017/02/09 23:24:43, DaleCurtis wrote: > > lgtm, ...
3 years, 10 months ago (2017-02-10 17:48:34 UTC) #52
Raymond Toy
On 2017/02/10 17:48:34, DaleCurtis wrote: > On 2017/02/09 at 23:32:46, rtoy wrote: > > On ...
3 years, 10 months ago (2017-02-10 17:54:00 UTC) #53
DaleCurtis
On 2017/02/10 at 17:54:00, rtoy wrote: > On 2017/02/10 17:48:34, DaleCurtis wrote: > > On ...
3 years, 10 months ago (2017-02-10 18:10:06 UTC) #54
commit-bot: I haz the power
Committed patchset #10 (id:180001) as https://chromium.googlesource.com/chromium/src/+/3489b2812bf4e670cc27627ee9a7a1fd1919f399
3 years, 10 months ago (2017-02-10 18:16:45 UTC) #57
Raymond Toy
3 years, 10 months ago (2017-02-10 22:30:53 UTC) #58
Message was sent while issue was closed.
On 2017/02/09 23:24:43, DaleCurtis wrote:
> lgtm, nice work! Did you see how this performs on
> http://www.scirra.com/labs/bugs/webaudiodecode/  from http://crbug.com/424174
?

Ran these tests on a Nexus 9 (Android 6.0)

Chrome 55:
Ogg: 3.02 (avg of 3)
AAC: 2.46

ToT:
Ogg: 3.12
AAC: 2.79

While the averages look slower, I don't think they're statistically significant.
 The results from M55 seem to have a lot of variability (min = 2.18, max = 3.29
for ogg).

So probably no change or at most 5-10% slower.

Powered by Google App Engine
This is Rietveld 408576698