1 /* 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_ 12 #define MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_ 13 14 #include <math.h> 15 16 #include <memory> 17 18 #include "modules/audio_coding/acm2/acm_resampler.h" 19 #include "modules/audio_coding/codecs/opus/opus_interface.h" 20 #include "modules/audio_coding/test/PCMFile.h" 21 #include "modules/audio_coding/test/TestStereo.h" 22 23 namespace webrtc { 24 25 class OpusTest { 26 public: 27 OpusTest(); 28 ~OpusTest(); 29 30 void Perform(); 31 32 private: 33 void Run(TestPackStereo* channel, 34 size_t channels, 35 int bitrate, 36 size_t frame_length, 37 int percent_loss = 0); 38 39 void OpenOutFile(int test_number); 40 41 std::unique_ptr<AudioCodingModule> acm_receiver_; 42 TestPackStereo* channel_a2b_; 43 PCMFile in_file_stereo_; 44 PCMFile in_file_mono_; 45 PCMFile out_file_; 46 PCMFile out_file_standalone_; 47 int counter_; 48 uint8_t payload_type_; 49 uint32_t rtp_timestamp_; 50 acm2::ACMResampler resampler_; 51 WebRtcOpusEncInst* opus_mono_encoder_; 52 WebRtcOpusEncInst* opus_stereo_encoder_; 53 WebRtcOpusDecInst* opus_mono_decoder_; 54 WebRtcOpusDecInst* opus_stereo_decoder_; 55 }; 56 57 } // namespace webrtc 58 59 #endif // MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_ 60