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

Unified Diff: webrtc/common_audio/signal_processing/cross_correlation.c

Issue 1206683002: Reland mysterious cast that improves performance. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_audio/signal_processing/cross_correlation.c
diff --git a/webrtc/common_audio/signal_processing/cross_correlation.c b/webrtc/common_audio/signal_processing/cross_correlation.c
index c14ce4c3220a53bb19f8b8530a7fd2d2a8e11ecd..898d934f2739be65ae64207d02db7b57e5af8746 100644
--- a/webrtc/common_audio/signal_processing/cross_correlation.c
+++ b/webrtc/common_audio/signal_processing/cross_correlation.c
@@ -22,9 +22,11 @@ void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
for (i = 0; i < dim_cross_correlation; i++) {
int32_t corr = 0;
- /* Unrolling doesn't seem to improve performance. */
+ // Linux 64-bit performance is improved by the int16_t cast below.
+ // Presumably this is some sort of compiler bug, as there's no obvious
+ // reason why that should result in better code.
for (j = 0; j < dim_seq; j++)
- corr += (seq1[j] * seq2[j]) >> right_shifts;
+ corr += (seq1[j] * seq2[j]) >> (int16_t)right_shifts;
seq2 += step_seq2;
*cross_correlation++ = corr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698