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

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

Issue 2934833002: G722 implementation of the AudioEncoderFactoryTemplate API (Closed)
Patch Set: rebase Created 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 }; 397 };
398 398
399 class AudioDecoderG722Test : public AudioDecoderTest { 399 class AudioDecoderG722Test : public AudioDecoderTest {
400 protected: 400 protected:
401 AudioDecoderG722Test() : AudioDecoderTest() { 401 AudioDecoderG722Test() : AudioDecoderTest() {
402 codec_input_rate_hz_ = 16000; 402 codec_input_rate_hz_ = 16000;
403 frame_size_ = 160; 403 frame_size_ = 160;
404 data_length_ = 10 * frame_size_; 404 data_length_ = 10 * frame_size_;
405 decoder_ = new AudioDecoderG722Impl; 405 decoder_ = new AudioDecoderG722Impl;
406 assert(decoder_); 406 assert(decoder_);
407 AudioEncoderG722::Config config; 407 AudioEncoderG722Config config;
408 config.frame_size_ms = 10; 408 config.frame_size_ms = 10;
409 config.payload_type = payload_type_;
410 config.num_channels = 1; 409 config.num_channels = 1;
411 audio_encoder_.reset(new AudioEncoderG722(config)); 410 audio_encoder_.reset(new AudioEncoderG722Impl(config, payload_type_));
412 } 411 }
413 }; 412 };
414 413
415 class AudioDecoderG722StereoTest : public AudioDecoderTest { 414 class AudioDecoderG722StereoTest : public AudioDecoderTest {
416 protected: 415 protected:
417 AudioDecoderG722StereoTest() : AudioDecoderTest() { 416 AudioDecoderG722StereoTest() : AudioDecoderTest() {
418 channels_ = 2; 417 channels_ = 2;
419 codec_input_rate_hz_ = 16000; 418 codec_input_rate_hz_ = 16000;
420 frame_size_ = 160; 419 frame_size_ = 160;
421 data_length_ = 10 * frame_size_; 420 data_length_ = 10 * frame_size_;
422 decoder_ = new AudioDecoderG722Stereo; 421 decoder_ = new AudioDecoderG722Stereo;
423 assert(decoder_); 422 assert(decoder_);
424 AudioEncoderG722::Config config; 423 AudioEncoderG722Config config;
425 config.frame_size_ms = 10; 424 config.frame_size_ms = 10;
426 config.payload_type = payload_type_;
427 config.num_channels = 2; 425 config.num_channels = 2;
428 audio_encoder_.reset(new AudioEncoderG722(config)); 426 audio_encoder_.reset(new AudioEncoderG722Impl(config, payload_type_));
429 } 427 }
430 }; 428 };
431 429
432 class AudioDecoderOpusTest : public AudioDecoderTest { 430 class AudioDecoderOpusTest : public AudioDecoderTest {
433 protected: 431 protected:
434 AudioDecoderOpusTest() : AudioDecoderTest() { 432 AudioDecoderOpusTest() : AudioDecoderTest() {
435 codec_input_rate_hz_ = 48000; 433 codec_input_rate_hz_ = 48000;
436 frame_size_ = 480; 434 frame_size_ = 480;
437 data_length_ = 10 * frame_size_; 435 data_length_ = 10 * frame_size_;
438 decoder_ = new AudioDecoderOpus(1); 436 decoder_ = new AudioDecoderOpus(1);
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb)); 687 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGnb));
690 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb)); 688 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGwb));
691 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz)); 689 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb32kHz));
692 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz)); 690 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderCNGswb48kHz));
693 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary)); 691 EXPECT_TRUE(CodecSupported(NetEqDecoder::kDecoderArbitrary));
694 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus)); 692 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus));
695 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch)); 693 EXPECT_EQ(has_opus, CodecSupported(NetEqDecoder::kDecoderOpus_2ch));
696 } 694 }
697 695
698 } // namespace webrtc 696 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/g722/audio_encoder_g722.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698