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

Side by Side Diff: webrtc/modules/audio_coding/neteq/audio_decoder_unittest.cc

Issue 2950453002: Opus implementation of the AudioDecoderFactoryTemplate API (Closed)
Patch Set: rebase Created 3 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 audio_encoder_.reset(new AudioEncoderG722Impl(config, payload_type_)); 425 audio_encoder_.reset(new AudioEncoderG722Impl(config, payload_type_));
426 } 426 }
427 }; 427 };
428 428
429 class AudioDecoderOpusTest : public AudioDecoderTest { 429 class AudioDecoderOpusTest : public AudioDecoderTest {
430 protected: 430 protected:
431 AudioDecoderOpusTest() : AudioDecoderTest() { 431 AudioDecoderOpusTest() : AudioDecoderTest() {
432 codec_input_rate_hz_ = 48000; 432 codec_input_rate_hz_ = 48000;
433 frame_size_ = 480; 433 frame_size_ = 480;
434 data_length_ = 10 * frame_size_; 434 data_length_ = 10 * frame_size_;
435 decoder_ = new AudioDecoderOpus(1); 435 decoder_ = new AudioDecoderOpusImpl(1);
436 AudioEncoderOpusConfig config; 436 AudioEncoderOpusConfig config;
437 config.frame_size_ms = static_cast<int>(frame_size_) / 48; 437 config.frame_size_ms = static_cast<int>(frame_size_) / 48;
438 config.application = AudioEncoderOpusConfig::ApplicationMode::kVoip; 438 config.application = AudioEncoderOpusConfig::ApplicationMode::kVoip;
439 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_); 439 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_);
440 } 440 }
441 }; 441 };
442 442
443 class AudioDecoderOpusStereoTest : public AudioDecoderOpusTest { 443 class AudioDecoderOpusStereoTest : public AudioDecoderOpusTest {
444 protected: 444 protected:
445 AudioDecoderOpusStereoTest() : AudioDecoderOpusTest() { 445 AudioDecoderOpusStereoTest() : AudioDecoderOpusTest() {
446 channels_ = 2; 446 channels_ = 2;
447 delete decoder_; 447 delete decoder_;
448 decoder_ = new AudioDecoderOpus(2); 448 decoder_ = new AudioDecoderOpusImpl(2);
449 AudioEncoderOpusConfig config; 449 AudioEncoderOpusConfig config;
450 config.frame_size_ms = static_cast<int>(frame_size_) / 48; 450 config.frame_size_ms = static_cast<int>(frame_size_) / 48;
451 config.num_channels = 2; 451 config.num_channels = 2;
452 config.application = AudioEncoderOpusConfig::ApplicationMode::kAudio; 452 config.application = AudioEncoderOpusConfig::ApplicationMode::kAudio;
453 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_); 453 audio_encoder_ = AudioEncoderOpus::MakeAudioEncoder(config, payload_type_);
454 } 454 }
455 }; 455 };
456 456
457 TEST_F(AudioDecoderPcmUTest, EncodeDecode) { 457 TEST_F(AudioDecoderPcmUTest, EncodeDecode) {
458 int tolerance = 251; 458 int tolerance = 251;
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb)); 684 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb));
685 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb)); 685 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb));
686 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz)); 686 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz));
687 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz)); 687 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz));
688 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary)); 688 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary));
689 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus)); 689 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus));
690 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch)); 690 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch));
691 } 691 }
692 692
693 } // namespace webrtc 693 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/opus/audio_decoder_opus.cc ('k') | webrtc/test/fuzzers/audio_decoder_opus_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698