2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_AUDIO_PROCESSING_AUDIO_BUFFER_H_
|
|
|
|
|
#define MODULES_AUDIO_PROCESSING_AUDIO_BUFFER_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-10-23 12:03:01 +02:00
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2016-02-19 07:04:49 -08:00
|
|
|
#include <memory>
|
2016-03-31 10:24:26 -07:00
|
|
|
#include <vector>
|
2016-02-19 07:04:49 -08:00
|
|
|
|
2018-04-12 22:44:09 +02:00
|
|
|
#include "api/audio/audio_frame.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "common_audio/channel_buffer.h"
|
|
|
|
|
#include "modules/audio_processing/include/audio_processing.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
|
2014-05-15 11:17:21 +00:00
|
|
|
class IFChannelBuffer;
|
2018-10-23 12:03:01 +02:00
|
|
|
class PushSincResampler;
|
|
|
|
|
class SplittingFilter;
|
2014-04-22 21:00:04 +00:00
|
|
|
|
2014-12-03 01:06:35 +00:00
|
|
|
enum Band { kBand0To8kHz = 0, kBand8To16kHz = 1, kBand16To24kHz = 2 };
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
class AudioBuffer {
|
|
|
|
|
public:
|
2014-04-22 21:00:04 +00:00
|
|
|
// TODO(ajm): Switch to take ChannelLayouts.
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
AudioBuffer(size_t input_num_frames,
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_input_channels,
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
size_t process_num_frames,
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_process_channels,
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
size_t output_num_frames);
|
2011-07-07 08:21:25 +00:00
|
|
|
virtual ~AudioBuffer();
|
|
|
|
|
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_channels() const;
|
|
|
|
|
void set_num_channels(size_t num_channels);
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
size_t num_frames() const;
|
|
|
|
|
size_t num_frames_per_band() const;
|
|
|
|
|
size_t num_keyboard_frames() const;
|
|
|
|
|
size_t num_bands() const;
|
2011-09-19 15:28:51 +00:00
|
|
|
|
2015-02-26 21:52:20 +00:00
|
|
|
// Returns a pointer array to the full-band channels.
|
|
|
|
|
// Usage:
|
|
|
|
|
// channels()[channel][sample].
|
|
|
|
|
// Where:
|
|
|
|
|
// 0 <= channel < |num_proc_channels_|
|
|
|
|
|
// 0 <= sample < |proc_num_frames_|
|
2014-11-14 22:18:10 +00:00
|
|
|
int16_t* const* channels();
|
2014-12-03 01:06:35 +00:00
|
|
|
const int16_t* const* channels_const() const;
|
2015-02-26 21:52:20 +00:00
|
|
|
float* const* channels_f();
|
|
|
|
|
const float* const* channels_const_f() const;
|
|
|
|
|
|
|
|
|
|
// Returns a pointer array to the bands for a specific channel.
|
|
|
|
|
// Usage:
|
|
|
|
|
// split_bands(channel)[band][sample].
|
|
|
|
|
// Where:
|
|
|
|
|
// 0 <= channel < |num_proc_channels_|
|
|
|
|
|
// 0 <= band < |num_bands_|
|
|
|
|
|
// 0 <= sample < |num_split_frames_|
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
int16_t* const* split_bands(size_t channel);
|
|
|
|
|
const int16_t* const* split_bands_const(size_t channel) const;
|
|
|
|
|
float* const* split_bands_f(size_t channel);
|
|
|
|
|
const float* const* split_bands_const_f(size_t channel) const;
|
2015-02-26 21:52:20 +00:00
|
|
|
|
|
|
|
|
// Returns a pointer array to the channels for a specific band.
|
|
|
|
|
// Usage:
|
|
|
|
|
// split_channels(band)[channel][sample].
|
|
|
|
|
// Where:
|
|
|
|
|
// 0 <= band < |num_bands_|
|
|
|
|
|
// 0 <= channel < |num_proc_channels_|
|
|
|
|
|
// 0 <= sample < |num_split_frames_|
|
2014-12-03 01:06:35 +00:00
|
|
|
int16_t* const* split_channels(Band band);
|
|
|
|
|
const int16_t* const* split_channels_const(Band band) const;
|
2015-02-26 21:52:20 +00:00
|
|
|
float* const* split_channels_f(Band band);
|
|
|
|
|
const float* const* split_channels_const_f(Band band) const;
|
|
|
|
|
|
|
|
|
|
// Returns a pointer to the ChannelBuffer that encapsulates the full-band
|
|
|
|
|
// data.
|
|
|
|
|
ChannelBuffer<int16_t>* data();
|
|
|
|
|
const ChannelBuffer<int16_t>* data() const;
|
|
|
|
|
ChannelBuffer<float>* data_f();
|
|
|
|
|
const ChannelBuffer<float>* data_f() const;
|
|
|
|
|
|
|
|
|
|
// Returns a pointer to the ChannelBuffer that encapsulates the split data.
|
|
|
|
|
ChannelBuffer<int16_t>* split_data();
|
|
|
|
|
const ChannelBuffer<int16_t>* split_data() const;
|
|
|
|
|
ChannelBuffer<float>* split_data_f();
|
|
|
|
|
const ChannelBuffer<float>* split_data_f() const;
|
2014-12-03 01:06:35 +00:00
|
|
|
|
2014-07-17 08:27:39 +00:00
|
|
|
// Returns a pointer to the low-pass data downmixed to mono. If this data
|
|
|
|
|
// isn't already available it re-calculates it.
|
|
|
|
|
const int16_t* mixed_low_pass_data();
|
2014-04-30 16:44:13 +00:00
|
|
|
const int16_t* low_pass_reference(int channel) const;
|
2014-05-15 11:17:21 +00:00
|
|
|
|
2014-04-24 18:28:56 +00:00
|
|
|
const float* keyboard_data() const;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-09-19 15:28:51 +00:00
|
|
|
void set_activity(AudioFrame::VADActivity activity);
|
2011-11-15 16:57:56 +00:00
|
|
|
AudioFrame::VADActivity activity() const;
|
|
|
|
|
|
2014-03-04 20:58:13 +00:00
|
|
|
// Use for int16 interleaved data.
|
2011-07-07 08:21:25 +00:00
|
|
|
void DeinterleaveFrom(AudioFrame* audioFrame);
|
2011-11-15 16:57:56 +00:00
|
|
|
// If |data_changed| is false, only the non-audio data members will be copied
|
|
|
|
|
// to |frame|.
|
2017-03-14 03:10:07 -07:00
|
|
|
void InterleaveTo(AudioFrame* frame, bool data_changed) const;
|
2014-03-04 20:58:13 +00:00
|
|
|
|
|
|
|
|
// Use for float deinterleaved data.
|
2015-07-23 11:41:39 -07:00
|
|
|
void CopyFrom(const float* const* data, const StreamConfig& stream_config);
|
|
|
|
|
void CopyTo(const StreamConfig& stream_config, float* const* data);
|
2011-07-07 08:21:25 +00:00
|
|
|
void CopyLowPassToReference();
|
|
|
|
|
|
2014-11-14 22:18:10 +00:00
|
|
|
// Splits the signal into different bands.
|
|
|
|
|
void SplitIntoFrequencyBands();
|
|
|
|
|
// Recombine the different bands into one signal.
|
|
|
|
|
void MergeFrequencyBands();
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
private:
|
2016-06-30 15:33:37 -07:00
|
|
|
FRIEND_TEST_ALL_PREFIXES(AudioBufferTest,
|
|
|
|
|
SetNumChannelsSetsChannelBuffersNumChannels);
|
2014-03-04 20:58:13 +00:00
|
|
|
// Called from DeinterleaveFrom() and CopyFrom().
|
2014-04-22 21:00:04 +00:00
|
|
|
void InitForNewData();
|
2014-03-04 20:58:13 +00:00
|
|
|
|
2014-12-11 17:09:21 +00:00
|
|
|
// The audio is passed into DeinterleaveFrom() or CopyFrom() with input
|
|
|
|
|
// format (samples per channel and number of channels).
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t input_num_frames_;
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
const size_t num_input_channels_;
|
2014-12-11 17:09:21 +00:00
|
|
|
// The audio is stored by DeinterleaveFrom() or CopyFrom() with processing
|
|
|
|
|
// format.
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t proc_num_frames_;
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
const size_t num_proc_channels_;
|
2014-12-11 17:09:21 +00:00
|
|
|
// The audio is returned by InterleaveTo() and CopyTo() with output samples
|
|
|
|
|
// per channels and the current number of channels. This last one can be
|
|
|
|
|
// changed at any time using set_num_channels().
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
const size_t output_num_frames_;
|
Convert channel counts to size_t.
IIRC, this was originally requested by ajm during review of the other size_t conversions I did over the past year, and I agreed it made sense, but wanted to do it separately since those changes were already gargantuan.
BUG=chromium:81439
TEST=none
R=henrik.lundin@webrtc.org, henrika@webrtc.org, kjellander@webrtc.org, minyue@webrtc.org, perkj@webrtc.org, solenberg@webrtc.org, stefan@webrtc.org, tina.legrand@webrtc.org
Review URL: https://codereview.webrtc.org/1316523002 .
Cr-Commit-Position: refs/heads/master@{#11229}
2016-01-12 16:26:35 -08:00
|
|
|
size_t num_channels_;
|
2014-12-11 17:09:21 +00:00
|
|
|
|
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}
2015-08-24 14:52:23 -07:00
|
|
|
size_t num_bands_;
|
|
|
|
|
size_t num_split_frames_;
|
2014-07-17 08:27:39 +00:00
|
|
|
bool mixed_low_pass_valid_;
|
2011-07-07 08:21:25 +00:00
|
|
|
bool reference_copied_;
|
2011-09-19 15:28:51 +00:00
|
|
|
AudioFrame::VADActivity activity_;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2014-04-24 18:28:56 +00:00
|
|
|
const float* keyboard_data_;
|
2016-02-19 07:04:49 -08:00
|
|
|
std::unique_ptr<IFChannelBuffer> data_;
|
|
|
|
|
std::unique_ptr<IFChannelBuffer> split_data_;
|
|
|
|
|
std::unique_ptr<SplittingFilter> splitting_filter_;
|
|
|
|
|
std::unique_ptr<ChannelBuffer<int16_t>> mixed_low_pass_channels_;
|
|
|
|
|
std::unique_ptr<ChannelBuffer<int16_t>> low_pass_reference_channels_;
|
|
|
|
|
std::unique_ptr<IFChannelBuffer> input_buffer_;
|
|
|
|
|
std::unique_ptr<IFChannelBuffer> output_buffer_;
|
|
|
|
|
std::unique_ptr<ChannelBuffer<float>> process_buffer_;
|
2016-03-31 10:24:26 -07:00
|
|
|
std::vector<std::unique_ptr<PushSincResampler>> input_resamplers_;
|
|
|
|
|
std::vector<std::unique_ptr<PushSincResampler>> output_resamplers_;
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2014-04-22 21:00:04 +00:00
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
} // namespace webrtc
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_AUDIO_PROCESSING_AUDIO_BUFFER_H_
|