Reformat existing code. There should be no functional effects.

This includes changes like:
* Attempt to break lines at better positions
* Use "override" in more places, don't use "virtual" with it
* Use {} where the body is more than one line
* Make declaration and definition arg names match
* Eliminate unused code
* EXPECT_EQ(expected, actual) (but use (actual, expected) for e.g. _GT)
* Correct #include order
* Use anonymous namespaces in preference to "static" for file-scoping
* Eliminate unnecessary casts
* Update reference code in comments of ARM assembly sources to match actual current C code
* Fix indenting to be more style-guide compliant
* Use arraysize() in more places
* Use bool instead of int for "boolean" values (0/1)
* Shorten and simplify code
* Spaces around operators
* 80 column limit
* Use const more consistently
* Space goes after '*' in type name, not before
* Remove unnecessary return values
* Use "(var == const)", not "(const == var)"
* Spelling
* Prefer true, typed constants to "enum hack" constants
* Avoid "virtual" on non-overridden functions
* ASSERT(x == y) -> ASSERT_EQ(y, x)

BUG=none
R=andrew@webrtc.org, asapersson@webrtc.org, henrika@webrtc.org, juberti@webrtc.org, kjellander@webrtc.org, kwiberg@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9420}
This commit is contained in:
Peter Kasting
2015-06-11 14:31:38 -07:00
parent b7e5054414
commit 728d9037c0
90 changed files with 416 additions and 490 deletions

View File

@ -114,10 +114,10 @@ int AudioEncoderOpus::NumChannels() const {
size_t AudioEncoderOpus::MaxEncodedBytes() const {
// Calculate the number of bytes we expect the encoder to produce,
// then multiply by two to give a wide margin for error.
int frame_size_ms = num_10ms_frames_per_packet_ * 10;
size_t bytes_per_millisecond =
static_cast<size_t>(bitrate_bps_ / (1000 * 8) + 1);
size_t approx_encoded_bytes = frame_size_ms * bytes_per_millisecond;
static_cast<size_t>(bitrate_bps_ / (1000 * 8) + 1);
size_t approx_encoded_bytes =
num_10ms_frames_per_packet_ * 10 * bytes_per_millisecond;
return 2 * approx_encoded_bytes;
}

View File

@ -46,7 +46,7 @@ class OpusTest : public TestWithParam<::testing::tuple<int, int>> {
int EncodeDecode(WebRtcOpusEncInst* encoder,
const int16_t* input_audio,
const int input_samples,
int input_samples,
WebRtcOpusDecInst* decoder,
int16_t* output_audio,
int16_t* audio_type);
@ -98,7 +98,7 @@ void OpusTest::SetMaxPlaybackRate(WebRtcOpusEncInst* encoder,
int OpusTest::EncodeDecode(WebRtcOpusEncInst* encoder,
const int16_t* input_audio,
const int input_samples,
int input_samples,
WebRtcOpusDecInst* decoder,
int16_t* output_audio,
int16_t* audio_type) {
@ -165,7 +165,7 @@ void OpusTest::TestDtxEffect(bool dtx) {
EXPECT_EQ(0, opus_encoder_->in_dtx_mode);
EXPECT_EQ(0, opus_decoder_->in_dtx_mode);
EXPECT_EQ(0, audio_type); // Speech.
} else if (1 == encoded_bytes_) {
} else if (encoded_bytes_ == 1) {
EXPECT_EQ(1, opus_encoder_->in_dtx_mode);
EXPECT_EQ(1, opus_decoder_->in_dtx_mode);
EXPECT_EQ(2, audio_type); // Comfort noise.