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

Issue 10803003: Add SSE optimizations to SincResampler. (Closed)

Created:
8 years, 5 months ago by DaleCurtis
Modified:
8 years, 4 months ago
CC:
chromium-reviews, feature-media-reviews_chromium.org
Visibility:
Public.

Description

Add SSE optimizations to SincResampler. These are not the same optimizations in the WebKit version of SincResampler. The WebKit version focuses on aligning the input vector, resulting in at worst two unaligned loads on each kernel index; or 2 * kKernelSize / 4 unaligned loads per call. Instead I chose to focus on keeping the kernel vectors aligned and eating at worst a single unaligned load on the input vector; or kKernelSize / 4 unaligned loads per call. Performance results from SincResamplerTest.ConvolveBenchmark: clang version 3.2 (trunk 159409): Convolve_C took 2100ms for 50000000 iterations. Convolve_SSE (aligned) took 677ms for 50000000 iterations. Convolve_SSE (unaligned) took 717ms for 50000000 iterations. gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3 Convolve_C took 2183ms for 50000000 iterations. Convolve_SSE (aligned) took 806ms for 50000000 iterations. Convolve_SSE (unaligned) took 844ms for 50000000 iterations. For reference, the original WebKit optimizations: clang version 3.2 (trunk 159409): Convolve_C took 2132ms for 50000000 iterations. Convolve_SSE (aligned) took 1146ms for 50000000 iterations. Convolve_SSE (unaligned) took 1797ms for 50000000 iterations. gcc (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3: Convolve_C took 2209ms for 50000000 iterations. Convolve_SSE (aligned) took 1450ms for 50000000 iterations. Convolve_SSE (unaligned) took 4415ms for 50000000 iterations. In summary, SSE provides an ~2.6x to ~3x speedup on GCC and clang respectively. BUG=133637 TEST=media_unittests + SincResampler/* tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=149569

Patch Set 1 #

Total comments: 14

Patch Set 2 : Fischman Fixes! #

Total comments: 8

Patch Set 3 : Switch to AlignedAlloc. Add runtime switch for benchmark. #

Patch Set 4 : Reduce error checks to 2 decimal places of precision. #

Patch Set 5 : Docs. #

Patch Set 6 : Fix compile error. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+227 lines, -37 lines) Patch
M media/base/audio_renderer_mixer_unittest.cc View 1 2 3 1 chunk +3 lines, -3 lines 0 comments Download
M media/base/sinc_resampler.h View 1 2 3 chunks +19 lines, -2 lines 0 comments Download
M media/base/sinc_resampler.cc View 1 2 3 4 6 chunks +100 lines, -29 lines 0 comments Download
M media/base/sinc_resampler_unittest.cc View 1 2 3 4 5 4 chunks +105 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
DaleCurtis
PTAL. You seemed most interested in this discussion at lunch, so you get to review ...
8 years, 5 months ago (2012-07-18 03:42:19 UTC) #1
Ami GONE FROM CHROMIUM
This needs either a microbenchmark or a detailed note about how to repro your numbers ...
8 years, 5 months ago (2012-07-18 04:40:35 UTC) #2
DaleCurtis
http://codereview.chromium.org/10803003/diff/1/media/base/sinc_resampler.cc File media/base/sinc_resampler.cc (right): http://codereview.chromium.org/10803003/diff/1/media/base/sinc_resampler.cc#newcode72 media/base/sinc_resampler.cc:72: #define CONVOLVE_ONE_SAMPLE \ On 2012/07/18 04:40:35, Ami Fischman wrote: ...
8 years, 5 months ago (2012-07-21 02:35:13 UTC) #3
Ami GONE FROM CHROMIUM
LGTM http://codereview.chromium.org/10803003/diff/7004/media/base/sinc_resampler.cc File media/base/sinc_resampler.cc (right): http://codereview.chromium.org/10803003/diff/7004/media/base/sinc_resampler.cc#newcode266 media/base/sinc_resampler.cc:266: m_input = _mm_loadu_ps(input_ptr + i); CL description says ...
8 years, 5 months ago (2012-07-21 17:25:09 UTC) #4
DaleCurtis
http://codereview.chromium.org/10803003/diff/7004/media/base/sinc_resampler.cc File media/base/sinc_resampler.cc (right): http://codereview.chromium.org/10803003/diff/7004/media/base/sinc_resampler.cc#newcode266 media/base/sinc_resampler.cc:266: m_input = _mm_loadu_ps(input_ptr + i); On 2012/07/21 17:25:09, Ami ...
8 years, 5 months ago (2012-07-24 00:13:07 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/10803003/16001
8 years, 5 months ago (2012-07-24 00:18:30 UTC) #6
commit-bot: I haz the power
Try job failure for 10803003-16001 (retry) on linux_rel for step "media_unittests". It's a second try, ...
8 years, 5 months ago (2012-07-24 01:06:42 UTC) #7
DaleCurtis
On 2012/07/24 01:06:42, I haz the power (commit-bot) wrote: > Try job failure for 10803003-16001 ...
8 years, 5 months ago (2012-07-24 01:34:02 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/10803003/4005
8 years, 5 months ago (2012-07-26 03:47:48 UTC) #9
commit-bot: I haz the power
Try job failure for 10803003-4005 (retry) on win_rel for step "compile" (clobber build). It's a ...
8 years, 5 months ago (2012-07-26 05:11:16 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/10803003/4005
8 years, 5 months ago (2012-07-26 19:40:39 UTC) #11
commit-bot: I haz the power
Try job failure for 10803003-4005 (retry) on linux_clang for step "compile" (clobber build). It's a ...
8 years, 5 months ago (2012-07-26 20:04:57 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/10803003/22004
8 years, 4 months ago (2012-08-02 01:01:01 UTC) #13
commit-bot: I haz the power
Try job failure for 10803003-22004 (retry) on mac_rel for step "compile" (clobber build). It's a ...
8 years, 4 months ago (2012-08-02 01:17:29 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/dalecurtis@chromium.org/10803003/22009
8 years, 4 months ago (2012-08-02 01:51:40 UTC) #15
commit-bot: I haz the power
8 years, 4 months ago (2012-08-02 02:59:47 UTC) #16
Change committed as 149569

Powered by Google App Engine
This is Rietveld 408576698