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

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

Issue 1305983003: Convert some more things to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Support Android's C89 mode 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/min_max_operations_neon.c
diff --git a/webrtc/common_audio/signal_processing/min_max_operations_neon.c b/webrtc/common_audio/signal_processing/min_max_operations_neon.c
index ee8bef1a9c2294691876fcee8169cc80b82a6bfe..6fbbf94ee052092273578b032819953941304eca 100644
--- a/webrtc/common_audio/signal_processing/min_max_operations_neon.c
+++ b/webrtc/common_audio/signal_processing/min_max_operations_neon.c
@@ -9,6 +9,7 @@
*/
#include <arm_neon.h>
+#include <assert.h>
#include <stdlib.h>
#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
@@ -17,9 +18,7 @@
int16_t WebRtcSpl_MaxAbsValueW16Neon(const int16_t* vector, size_t length) {
int absolute = 0, maximum = 0;
- if (vector == NULL || length == 0) {
- return -1;
- }
+ assert(length > 0);
const int16_t* p_start = vector;
size_t rest = length & 7;
@@ -77,9 +76,7 @@ int32_t WebRtcSpl_MaxAbsValueW32Neon(const int32_t* vector, size_t length) {
size_t i = 0;
size_t residual = length & 0x7;
- if (vector == NULL || length == 0) {
- return -1;
- }
+ assert(length > 0);
const int32_t* p_start = vector;
uint32x4_t max32x4_0 = vdupq_n_u32(0);
@@ -131,9 +128,7 @@ int16_t WebRtcSpl_MaxValueW16Neon(const int16_t* vector, size_t length) {
size_t i = 0;
size_t residual = length & 0x7;
- if (vector == NULL || length == 0) {
- return maximum;
- }
+ assert(length > 0);
const int16_t* p_start = vector;
int16x8_t max16x8 = vdupq_n_s16(WEBRTC_SPL_WORD16_MIN);
@@ -171,9 +166,7 @@ int32_t WebRtcSpl_MaxValueW32Neon(const int32_t* vector, size_t length) {
size_t i = 0;
size_t residual = length & 0x7;
- if (vector == NULL || length == 0) {
- return maximum;
- }
+ assert(length > 0);
const int32_t* p_start = vector;
int32x4_t max32x4_0 = vdupq_n_s32(WEBRTC_SPL_WORD32_MIN);
@@ -215,9 +208,7 @@ int16_t WebRtcSpl_MinValueW16Neon(const int16_t* vector, size_t length) {
size_t i = 0;
size_t residual = length & 0x7;
- if (vector == NULL || length == 0) {
- return minimum;
- }
+ assert(length > 0);
const int16_t* p_start = vector;
int16x8_t min16x8 = vdupq_n_s16(WEBRTC_SPL_WORD16_MAX);
@@ -255,9 +246,7 @@ int32_t WebRtcSpl_MinValueW32Neon(const int32_t* vector, size_t length) {
size_t i = 0;
size_t residual = length & 0x7;
- if (vector == NULL || length == 0) {
- return minimum;
- }
+ assert(length > 0);
const int32_t* p_start = vector;
int32x4_t min32x4_0 = vdupq_n_s32(WEBRTC_SPL_WORD32_MAX);

Powered by Google App Engine
This is Rietveld 408576698