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

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

Issue 1181693005: Reland remaining bits of "Upconvert various types to int." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Try kwiberg's variations 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 | webrtc/common_audio/signal_processing/cross_correlation_mips.c » ('j') | 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 42000d608d59a05ec8dfede7fde59fe84a2f04b6..6c8f22c41541dbb74ea4f571ec98de77f2d5b2fe 100644
--- a/webrtc/common_audio/signal_processing/cross_correlation.c
+++ b/webrtc/common_audio/signal_processing/cross_correlation.c
@@ -16,16 +16,18 @@ void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
const int16_t* seq2,
int16_t dim_seq,
int16_t dim_cross_correlation,
- int16_t right_shifts,
- int16_t step_seq2) {
+ int right_shifts,
+ int step_seq2) {
int i = 0, j = 0;
for (i = 0; i < dim_cross_correlation; i++) {
- *cross_correlation = 0;
+ int32_t corr = 0;
/* Unrolling doesn't seem to improve performance. */
for (j = 0; j < dim_seq; j++) {
- *cross_correlation += (seq1[j] * seq2[step_seq2 * i + j]) >> right_shifts;
+ // It's not clear why casting |right_shifts| here helps performance.
+ corr += (seq1[j] * seq2[j]) >> (int16_t)right_shifts;
}
- cross_correlation++;
+ seq2 += step_seq2;
+ *cross_correlation++ = corr;
}
}
« no previous file with comments | « no previous file | webrtc/common_audio/signal_processing/cross_correlation_mips.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698