Compile-out functions only used by the bit-exact test.

Causes errors on platforms where the test is unused.

TBR=bjornv

Review URL: https://webrtc-codereview.appspot.com/4869004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5207 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2013-12-03 23:39:16 +00:00
parent d3865e9124
commit d7696c4ed1

View File

@ -113,21 +113,6 @@ void SetFrameTo(AudioFrame* frame, int16_t left, int16_t right) {
}
}
template <class T>
T AbsValue(T a) {
return a > 0 ? a: -a;
}
int16_t MaxAudioFrame(const AudioFrame& frame) {
const int length = frame.samples_per_channel_ * frame.num_channels_;
int16_t max_data = AbsValue(frame.data_[0]);
for (int i = 1; i < length; i++) {
max_data = std::max(max_data, AbsValue(frame.data_[i]));
}
return max_data;
}
bool FrameDataAreEqual(const AudioFrame& frame1, const AudioFrame& frame2) {
if (frame1.samples_per_channel_ !=
frame2.samples_per_channel_) {
@ -145,6 +130,23 @@ bool FrameDataAreEqual(const AudioFrame& frame1, const AudioFrame& frame2) {
return true;
}
#ifdef WEBRTC_AUDIOPROC_BIT_EXACT
// These functions are only used by the bit-exact test.
template <class T>
T AbsValue(T a) {
return a > 0 ? a: -a;
}
int16_t MaxAudioFrame(const AudioFrame& frame) {
const int length = frame.samples_per_channel_ * frame.num_channels_;
int16_t max_data = AbsValue(frame.data_[0]);
for (int i = 1; i < length; i++) {
max_data = std::max(max_data, AbsValue(frame.data_[i]));
}
return max_data;
}
void TestStats(const AudioProcessing::Statistic& test,
const webrtc::audioproc::Test::Statistic& reference) {
EXPECT_EQ(reference.instant(), test.instant);
@ -196,6 +198,7 @@ void ReadMessageLiteFromFile(const std::string filename,
delete [] array;
fclose(file);
}
#endif // WEBRTC_AUDIOPROC_BIT_EXACT
struct ThreadData {
ThreadData(int thread_num_, AudioProcessing* ap_)