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

Unified Diff: webrtc/modules/include/module_common_types.h

Issue 1830713003: Remove unused stuff from AudioFrame: (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 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/modules/include/module_common_types.h
diff --git a/webrtc/modules/include/module_common_types.h b/webrtc/modules/include/module_common_types.h
index 853b431ebc3b5a73894a462531187023278bdf83..82d87d5c5c721ee694e3e77a420611a9f36277f7 100644
--- a/webrtc/modules/include/module_common_types.h
+++ b/webrtc/modules/include/module_common_types.h
@@ -505,21 +505,17 @@ class AudioFrame {
// contents of |data_|).
void Reset();
- // |interleaved_| is not changed by this method.
void UpdateFrame(int id, uint32_t timestamp, const int16_t* data,
size_t samples_per_channel, int sample_rate_hz,
SpeechType speech_type, VADActivity vad_activity,
size_t num_channels = 1);
- AudioFrame& Append(const AudioFrame& rhs);
-
void CopyFrom(const AudioFrame& src);
void Mute();
AudioFrame& operator>>=(const int rhs);
AudioFrame& operator+=(const AudioFrame& rhs);
- AudioFrame& operator-=(const AudioFrame& rhs);
int id_;
// RTP timestamp of the first sample in the AudioFrame.
@@ -536,7 +532,6 @@ class AudioFrame {
size_t num_channels_;
SpeechType speech_type_;
VADActivity vad_activity_;
- bool interleaved_;
private:
RTC_DISALLOW_COPY_AND_ASSIGN(AudioFrame);
@@ -561,7 +556,6 @@ inline void AudioFrame::Reset() {
num_channels_ = 0;
speech_type_ = kUndefined;
vad_activity_ = kVadUnknown;
- interleaved_ = true;
}
inline void AudioFrame::UpdateFrame(int id,
@@ -601,7 +595,6 @@ inline void AudioFrame::CopyFrom(const AudioFrame& src) {
speech_type_ = src.speech_type_;
vad_activity_ = src.vad_activity_;
num_channels_ = src.num_channels_;
- interleaved_ = src.interleaved_;
const size_t length = samples_per_channel_ * num_channels_;
assert(length <= kMaxDataSizeSamples);
@@ -622,30 +615,6 @@ inline AudioFrame& AudioFrame::operator>>=(const int rhs) {
return *this;
}
-inline AudioFrame& AudioFrame::Append(const AudioFrame& rhs) {
- // Sanity check
- assert((num_channels_ > 0) && (num_channels_ < 3));
- assert(interleaved_ == rhs.interleaved_);
- if ((num_channels_ > 2) || (num_channels_ < 1)) return *this;
- if (num_channels_ != rhs.num_channels_) return *this;
-
- if ((vad_activity_ == kVadActive) || rhs.vad_activity_ == kVadActive) {
- vad_activity_ = kVadActive;
- } else if (vad_activity_ == kVadUnknown || rhs.vad_activity_ == kVadUnknown) {
- vad_activity_ = kVadUnknown;
- }
- if (speech_type_ != rhs.speech_type_) {
- speech_type_ = kUndefined;
- }
-
- size_t offset = samples_per_channel_ * num_channels_;
- for (size_t i = 0; i < rhs.samples_per_channel_ * rhs.num_channels_; i++) {
- data_[offset + i] = rhs.data_[i];
- }
- samples_per_channel_ += rhs.samples_per_channel_;
- return *this;
-}
-
namespace {
inline int16_t ClampToInt16(int32_t input) {
if (input < -0x00008000) {
@@ -661,7 +630,6 @@ inline int16_t ClampToInt16(int32_t input) {
inline AudioFrame& AudioFrame::operator+=(const AudioFrame& rhs) {
// Sanity check
assert((num_channels_ > 0) && (num_channels_ < 3));
- assert(interleaved_ == rhs.interleaved_);
if ((num_channels_ > 2) || (num_channels_ < 1)) return *this;
if (num_channels_ != rhs.num_channels_) return *this;
@@ -698,29 +666,6 @@ inline AudioFrame& AudioFrame::operator+=(const AudioFrame& rhs) {
return *this;
}
-inline AudioFrame& AudioFrame::operator-=(const AudioFrame& rhs) {
- // Sanity check
- assert((num_channels_ > 0) && (num_channels_ < 3));
- assert(interleaved_ == rhs.interleaved_);
- if ((num_channels_ > 2) || (num_channels_ < 1)) return *this;
-
- if ((samples_per_channel_ != rhs.samples_per_channel_) ||
- (num_channels_ != rhs.num_channels_)) {
- return *this;
- }
- if ((vad_activity_ != kVadPassive) || rhs.vad_activity_ != kVadPassive) {
- vad_activity_ = kVadUnknown;
- }
- speech_type_ = kUndefined;
-
- for (size_t i = 0; i < samples_per_channel_ * num_channels_; i++) {
- int32_t wrap_guard =
- static_cast<int32_t>(data_[i]) - static_cast<int32_t>(rhs.data_[i]);
- data_[i] = ClampToInt16(wrap_guard);
- }
- return *this;
-}
-
inline bool IsNewerSequenceNumber(uint16_t sequence_number,
uint16_t prev_sequence_number) {
// Distinguish between elements that are exactly 0x8000 apart.
« no previous file with comments | « webrtc/modules/audio_coding/neteq/sync_buffer.cc ('k') | webrtc/modules/utility/source/audio_frame_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698