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

Unified Diff: webrtc/modules/audio_coding/main/test/opus_test.cc

Issue 1179953003: Revert "Upconvert various types to int." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 6 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/audio_coding/main/test/opus_test.cc
diff --git a/webrtc/modules/audio_coding/main/test/opus_test.cc b/webrtc/modules/audio_coding/main/test/opus_test.cc
index ad7e2f9be8a002dd4506d2b5b9f8a73148ee77f9..09301df51c3e6992985e717f035c82a4cab6d857 100644
--- a/webrtc/modules/audio_coding/main/test/opus_test.cc
+++ b/webrtc/modules/audio_coding/main/test/opus_test.cc
@@ -273,11 +273,17 @@ void OpusTest::Run(TestPackStereo* channel, int channels, int bitrate,
int16_t bitstream_len_byte;
uint8_t bitstream[kMaxBytes];
for (int i = 0; i < loop_encode; i++) {
- int bitstream_len_byte_int = WebRtcOpus_Encode(
- (channels == 1) ? opus_mono_encoder_ : opus_stereo_encoder_,
- &audio[read_samples], frame_length, kMaxBytes, bitstream);
- ASSERT_GT(bitstream_len_byte_int, -1);
- bitstream_len_byte = static_cast<int16_t>(bitstream_len_byte_int);
+ if (channels == 1) {
+ bitstream_len_byte = WebRtcOpus_Encode(
+ opus_mono_encoder_, &audio[read_samples],
+ frame_length, kMaxBytes, bitstream);
+ ASSERT_GT(bitstream_len_byte, -1);
+ } else {
+ bitstream_len_byte = WebRtcOpus_Encode(
+ opus_stereo_encoder_, &audio[read_samples],
+ frame_length, kMaxBytes, bitstream);
+ ASSERT_GT(bitstream_len_byte, -1);
+ }
// Simulate packet loss by setting |packet_loss_| to "true" in
// |percent_loss| percent of the loops.
« no previous file with comments | « webrtc/modules/audio_coding/codecs/opus/opus_interface.c ('k') | webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698