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

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

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 4 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
Index: webrtc/common_audio/signal_processing/vector_scaling_operations.c
diff --git a/webrtc/common_audio/signal_processing/vector_scaling_operations.c b/webrtc/common_audio/signal_processing/vector_scaling_operations.c
index 9ae7480eb781178408136ebbd6120f7229ddef55..fdefd0676079ad0ec409aa589ea459bb7afdc85e 100644
--- a/webrtc/common_audio/signal_processing/vector_scaling_operations.c
+++ b/webrtc/common_audio/signal_processing/vector_scaling_operations.c
@@ -22,10 +22,10 @@
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
-void WebRtcSpl_VectorBitShiftW16(int16_t *res, int16_t length,
+void WebRtcSpl_VectorBitShiftW16(int16_t *res, size_t length,
const int16_t *in, int16_t right_shifts)
{
- int i;
+ size_t i;
if (right_shifts > 0)
{
@@ -43,11 +43,11 @@ void WebRtcSpl_VectorBitShiftW16(int16_t *res, int16_t length,
}
void WebRtcSpl_VectorBitShiftW32(int32_t *out_vector,
- int16_t vector_length,
+ size_t vector_length,
const int32_t *in_vector,
int16_t right_shifts)
{
- int i;
+ size_t i;
if (right_shifts > 0)
{
@@ -64,9 +64,9 @@ void WebRtcSpl_VectorBitShiftW32(int32_t *out_vector,
}
}
-void WebRtcSpl_VectorBitShiftW32ToW16(int16_t* out, int length,
+void WebRtcSpl_VectorBitShiftW32ToW16(int16_t* out, size_t length,
const int32_t* in, int right_shifts) {
- int i;
+ size_t i;
int32_t tmp_w32;
if (right_shifts >= 0) {
@@ -84,11 +84,11 @@ void WebRtcSpl_VectorBitShiftW32ToW16(int16_t* out, int length,
}
void WebRtcSpl_ScaleVector(const int16_t *in_vector, int16_t *out_vector,
- int16_t gain, int16_t in_vector_length,
+ int16_t gain, size_t in_vector_length,
int16_t right_shifts)
{
// Performs vector operation: out_vector = (gain*in_vector)>>right_shifts
- int i;
+ size_t i;
const int16_t *inptr;
int16_t *outptr;
@@ -102,11 +102,11 @@ void WebRtcSpl_ScaleVector(const int16_t *in_vector, int16_t *out_vector,
}
void WebRtcSpl_ScaleVectorWithSat(const int16_t *in_vector, int16_t *out_vector,
- int16_t gain, int16_t in_vector_length,
+ int16_t gain, size_t in_vector_length,
int16_t right_shifts)
{
// Performs vector operation: out_vector = (gain*in_vector)>>right_shifts
- int i;
+ size_t i;
const int16_t *inptr;
int16_t *outptr;
@@ -120,10 +120,10 @@ void WebRtcSpl_ScaleVectorWithSat(const int16_t *in_vector, int16_t *out_vector,
void WebRtcSpl_ScaleAndAddVectors(const int16_t *in1, int16_t gain1, int shift1,
const int16_t *in2, int16_t gain2, int shift2,
- int16_t *out, int vector_length)
+ int16_t *out, size_t vector_length)
{
// Performs vector operation: out = (gain1*in1)>>shift1 + (gain2*in2)>>shift2
- int i;
+ size_t i;
const int16_t *in1ptr;
const int16_t *in2ptr;
int16_t *outptr;
@@ -146,12 +146,12 @@ int WebRtcSpl_ScaleAndAddVectorsWithRoundC(const int16_t* in_vector1,
int16_t in_vector2_scale,
int right_shifts,
int16_t* out_vector,
- int length) {
- int i = 0;
+ size_t length) {
+ size_t i = 0;
int round_value = (1 << right_shifts) >> 1;
if (in_vector1 == NULL || in_vector2 == NULL || out_vector == NULL ||
- length <= 0 || right_shifts < 0) {
+ length == 0 || right_shifts < 0) {
return -1;
}

Powered by Google App Engine
This is Rietveld 408576698