opus_test.h (1742B)
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 <cstddef> 17 #include <cstdint> 18 #include <memory> 19 20 #include "api/neteq/neteq.h" 21 #include "common_audio/resampler/include/push_resampler.h" 22 #include "modules/audio_coding/acm2/acm_resampler.h" 23 #include "modules/audio_coding/codecs/opus/opus_inst.h" 24 #include "modules/audio_coding/test/PCMFile.h" 25 #include "modules/audio_coding/test/TestStereo.h" 26 27 namespace webrtc { 28 29 class OpusTest { 30 public: 31 OpusTest(); 32 ~OpusTest(); 33 34 void Perform(); 35 36 private: 37 void Run(TestPackStereo* channel, 38 size_t channels, 39 int bitrate, 40 size_t frame_length, 41 int percent_loss = 0); 42 43 void OpenOutFile(int test_number); 44 45 std::unique_ptr<NetEq> neteq_; 46 acm2::ResamplerHelper resampler_helper_; 47 TestPackStereo* channel_a2b_; 48 PCMFile in_file_stereo_; 49 PCMFile in_file_mono_; 50 PCMFile out_file_; 51 PCMFile out_file_standalone_; 52 int counter_; 53 uint8_t payload_type_; 54 uint32_t rtp_timestamp_; 55 PushResampler<int16_t> resampler_; 56 WebRtcOpusEncInst* opus_mono_encoder_; 57 WebRtcOpusEncInst* opus_stereo_encoder_; 58 WebRtcOpusDecInst* opus_mono_decoder_; 59 WebRtcOpusDecInst* opus_stereo_decoder_; 60 }; 61 62 } // namespace webrtc 63 64 #endif // MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_