tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_ |
| 12 | #define MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_ |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 13 | |
| 14 | #include <math.h> |
| 15 | |
kwiberg | 3747838 | 2016-02-14 20:40:57 -0800 | [diff] [blame] | 16 | #include <memory> |
| 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "modules/audio_coding/acm2/acm_resampler.h" |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 19 | #include "modules/audio_coding/codecs/opus/opus_interface.h" |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 20 | #include "modules/audio_coding/test/PCMFile.h" |
| 21 | #include "modules/audio_coding/test/TestStereo.h" |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 22 | |
| 23 | namespace webrtc { |
| 24 | |
Karl Wiberg | 3ff52ff | 2018-10-01 12:31:22 +0200 | [diff] [blame] | 25 | class OpusTest { |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 26 | public: |
henrik.lundin@webrtc.org | adaf809 | 2014-04-17 08:29:10 +0000 | [diff] [blame] | 27 | OpusTest(); |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 28 | ~OpusTest(); |
| 29 | |
| 30 | void Perform(); |
turaj@webrtc.org | 48af652 | 2013-09-13 23:06:59 +0000 | [diff] [blame] | 31 | |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 32 | private: |
pkasting | 25702cb | 2016-01-08 13:50:27 -0800 | [diff] [blame] | 33 | void Run(TestPackStereo* channel, |
Peter Kasting | 6955870 | 2016-01-12 16:26:35 -0800 | [diff] [blame] | 34 | size_t channels, |
pkasting | 25702cb | 2016-01-08 13:50:27 -0800 | [diff] [blame] | 35 | int bitrate, |
| 36 | size_t frame_length, |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 37 | int percent_loss = 0); |
| 38 | |
| 39 | void OpenOutFile(int test_number); |
| 40 | |
kwiberg | 3747838 | 2016-02-14 20:40:57 -0800 | [diff] [blame] | 41 | std::unique_ptr<AudioCodingModule> acm_receiver_; |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 42 | TestPackStereo* channel_a2b_; |
| 43 | PCMFile in_file_stereo_; |
| 44 | PCMFile in_file_mono_; |
| 45 | PCMFile out_file_; |
tina.legrand@webrtc.org | bd21fb5 | 2013-08-08 11:01:07 +0000 | [diff] [blame] | 46 | PCMFile out_file_standalone_; |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 47 | int counter_; |
| 48 | uint8_t payload_type_; |
pkasting | 25702cb | 2016-01-08 13:50:27 -0800 | [diff] [blame] | 49 | uint32_t rtp_timestamp_; |
henrik.lundin@webrtc.org | adaf809 | 2014-04-17 08:29:10 +0000 | [diff] [blame] | 50 | acm2::ACMResampler resampler_; |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 51 | WebRtcOpusEncInst* opus_mono_encoder_; |
| 52 | WebRtcOpusEncInst* opus_stereo_encoder_; |
tina.legrand@webrtc.org | bd21fb5 | 2013-08-08 11:01:07 +0000 | [diff] [blame] | 53 | WebRtcOpusDecInst* opus_mono_decoder_; |
| 54 | WebRtcOpusDecInst* opus_stereo_decoder_; |
tina.legrand@webrtc.org | 73222cf | 2013-03-15 13:29:17 +0000 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace webrtc |
| 58 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 59 | #endif // MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_ |