Update a ton of audio code to use size_t more correctly and in general reduce

use of int16_t/uint16_t.

This is the upshot of a recommendation by henrik.lundin and kwiberg on an original small change ( https://webrtc-codereview.appspot.com/42569004/#ps1 ) to stop using int16_t just because values could fit in it, and is similar in nature to a previous "mass change to use size_t more" ( https://webrtc-codereview.appspot.com/23129004/ ) which also needed to be split up for review but to land all at once, since, like adding "const", such changes tend to cause a lot of transitive effects.

This was be reviewed and approved in pieces:
https://codereview.webrtc.org/1224093003
https://codereview.webrtc.org/1224123002
https://codereview.webrtc.org/1224163002
https://codereview.webrtc.org/1225133003
https://codereview.webrtc.org/1225173002
https://codereview.webrtc.org/1227163003
https://codereview.webrtc.org/1227203003
https://codereview.webrtc.org/1227213002
https://codereview.webrtc.org/1227893002
https://codereview.webrtc.org/1228793004
https://codereview.webrtc.org/1228803003
https://codereview.webrtc.org/1228823002
https://codereview.webrtc.org/1228823003
https://codereview.webrtc.org/1228843002
https://codereview.webrtc.org/1230693002
https://codereview.webrtc.org/1231713002

The change is being landed as TBR to all the folks who reviewed the above.

BUG=chromium:81439
TEST=none
R=andrew@webrtc.org, pbos@webrtc.org
TBR=aluebs, andrew, asapersson, henrika, hlundin, jan.skoglund, kwiberg, minyue, pbos, pthatcher

Review URL: https://codereview.webrtc.org/1230503003 .

Cr-Commit-Position: refs/heads/master@{#9768}
This commit is contained in:
Peter Kasting
2015-08-24 14:52:23 -07:00
parent b594041ec8
commit dce40cf804
471 changed files with 3716 additions and 3499 deletions

View File

@ -78,9 +78,9 @@ class DspHelper {
// locations and values are written to the arrays |peak_index| and
// |peak_value|, respectively. Both arrays must hold at least |num_peaks|
// elements.
static void PeakDetection(int16_t* data, int data_length,
int num_peaks, int fs_mult,
int* peak_index, int16_t* peak_value);
static void PeakDetection(int16_t* data, size_t data_length,
size_t num_peaks, int fs_mult,
size_t* peak_index, int16_t* peak_value);
// Estimates the height and location of a maximum. The three values in the
// array |signal_points| are used as basis for a parabolic fit, which is then
@ -89,14 +89,15 @@ class DspHelper {
// |peak_index| and |peak_value| is given in the full sample rate, as
// indicated by the sample rate multiplier |fs_mult|.
static void ParabolicFit(int16_t* signal_points, int fs_mult,
int* peak_index, int16_t* peak_value);
size_t* peak_index, int16_t* peak_value);
// Calculates the sum-abs-diff for |signal| when compared to a displaced
// version of itself. Returns the displacement lag that results in the minimum
// distortion. The resulting distortion is written to |distortion_value|.
// The values of |min_lag| and |max_lag| are boundaries for the search.
static int MinDistortion(const int16_t* signal, int min_lag,
int max_lag, int length, int32_t* distortion_value);
static size_t MinDistortion(const int16_t* signal, size_t min_lag,
size_t max_lag, size_t length,
int32_t* distortion_value);
// Mixes |length| samples from |input1| and |input2| together and writes the
// result to |output|. The gain for |input1| starts at |mix_factor| (Q14) and
@ -122,7 +123,7 @@ class DspHelper {
// filters if |compensate_delay| is true. Returns -1 if the input is too short
// to produce |output_length| samples, otherwise 0.
static int DownsampleTo4kHz(const int16_t* input, size_t input_length,
int output_length, int input_rate_hz,
size_t output_length, int input_rate_hz,
bool compensate_delay, int16_t* output);
private: