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

Issue 1177993003: iSAC: Move global trig tables into the codec instance (Closed)

Created:
5 years, 6 months ago by kwiberg-webrtc
Modified:
5 years, 6 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, hlundin-webrtc, tlegrand-webrtc
Base URL:
https://chromium.googlesource.com/external/webrtc.git@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

iSAC: Move global trig tables into the codec instance These tables are constant, so it makes sense for all encoders to share one copy---but it was initialized in a racy way, and there's no appealing way to fix that without adding dependencies on locking functions. So we simply give each codec instance its own copy, which costs 8 * (240 + 240 + 120 + 120) = 5760 bytes apiece. As noted in the TODO comment, the size of the tables could be reduced, and they could be filled in at compile-time, but that would make the encoder output slightly different, which would mess with our tests. R=henrik.lundin@webrtc.org, solenberg@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/ac81163011c586fda1e74fd9d53a7156856dfd8c

Patch Set 1 : #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+113 lines, -75 lines) Patch
M webrtc/modules/audio_coding/codecs/isac/main/source/codec.h View 6 chunks +35 lines, -19 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/decode.c View 6 chunks +12 lines, -7 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/encode.c View 6 chunks +12 lines, -6 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c View 1 chunk +0 lines, -4 lines 2 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/isac.c View 7 chunks +16 lines, -8 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/structs.h View 2 chunks +13 lines, -0 lines 0 comments Download
M webrtc/modules/audio_coding/codecs/isac/main/source/transform.c View 6 chunks +25 lines, -31 lines 5 comments Download

Messages

Total messages: 19 (8 generated)
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1177993003/20001
5 years, 6 months ago (2015-06-15 14:05:57 UTC) #4
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
5 years, 6 months ago (2015-06-15 14:05:59 UTC) #6
hlundin-webrtc
lgtm
5 years, 6 months ago (2015-06-15 14:45:16 UTC) #9
the sun
lgtm https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c File webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c (left): https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c#oldcode46 webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c:46: I don't know this code. What about the ...
5 years, 6 months ago (2015-06-15 15:08:51 UTC) #10
kwiberg-webrtc
https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c File webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c (left): https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c#oldcode46 webrtc/modules/audio_coding/codecs/isac/main/source/intialize.c:46: On 2015/06/15 15:08:51, the sun wrote: > I don't ...
5 years, 6 months ago (2015-06-15 21:57:28 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1177993003/20001
5 years, 6 months ago (2015-06-15 22:00:03 UTC) #13
commit-bot: I haz the power
No LGTM from a valid reviewer yet. Only full committers are accepted. Even if an ...
5 years, 6 months ago (2015-06-15 22:00:05 UTC) #15
kwiberg-webrtc
Committed patchset #1 (id:20001) manually as ac81163011c586fda1e74fd9d53a7156856dfd8c (presubmit successful).
5 years, 6 months ago (2015-06-15 22:02:51 UTC) #16
the sun
https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/transform.c File webrtc/modules/audio_coding/codecs/isac/main/source/transform.c (right): https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/transform.c#newcode56 webrtc/modules/audio_coding/codecs/isac/main/source/transform.c:56: tmp1r = tables->costab1[k]; On 2015/06/15 21:57:28, kwiberg1 wrote: > ...
5 years, 6 months ago (2015-06-16 08:19:54 UTC) #17
kwiberg-webrtc
https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/transform.c File webrtc/modules/audio_coding/codecs/isac/main/source/transform.c (right): https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_coding/codecs/isac/main/source/transform.c#newcode56 webrtc/modules/audio_coding/codecs/isac/main/source/transform.c:56: tmp1r = tables->costab1[k]; On 2015/06/16 08:19:54, the sun wrote: ...
5 years, 6 months ago (2015-06-16 08:31:44 UTC) #18
the sun
5 years, 6 months ago (2015-06-16 08:46:36 UTC) #19
Message was sent while issue was closed.
https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_codi...
File webrtc/modules/audio_coding/codecs/isac/main/source/transform.c (right):

https://codereview.webrtc.org/1177993003/diff/20001/webrtc/modules/audio_codi...
webrtc/modules/audio_coding/codecs/isac/main/source/transform.c:56: tmp1r =
tables->costab1[k];
On 2015/06/16 08:31:44, kwiberg1 wrote:
> On 2015/06/16 08:19:54, the sun wrote:
> > So I guess with f32 we should also see auto-vectorization kick in with
clang.
> > Why didn't it do it in the double case? Not enough gain? Target only SSE1?
> 
> I know just enough assembly to decrypt what code like the above is doing. In
> order to be able to write it, I'd have to spend a few weeks with instruction
set
> reference manuals and running benchmarks. So I don't really have an idea if
> vectorization is inherently harder with doubles than with ints, or if clang's
> optimizer just isn't general enough. Or whether float code is more like int or
> double code in this regard.

I was just thinking that it did auto-vectorization in the int case because it
could fit 4 ints in a register, but maybe the overhead wasn't deemed a good
tradeoff when only 2 doubles per register was possible.

Since it would be able to fit 4 f32:s too, hopefully it would do auto-vec there
as well. I don't see that the compiler would have a harder time doing it with
floats, especially since it is already using SSE for fp ops.

Powered by Google App Engine
This is Rietveld 408576698