blob: c69f922adb18e6f5dc234f65b1db214422ee777f [file] [log] [blame]
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +00001/*
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 Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_
12#define MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000013
14#include <math.h>
15
kwiberg37478382016-02-14 20:40:57 -080016#include <memory>
17
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020018#include "modules/audio_coding/acm2/acm_resampler.h"
Yves Gerey665174f2018-06-19 15:03:05 +020019#include "modules/audio_coding/codecs/opus/opus_interface.h"
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020020#include "modules/audio_coding/test/PCMFile.h"
21#include "modules/audio_coding/test/TestStereo.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000022
23namespace webrtc {
24
Karl Wiberg3ff52ff2018-10-01 12:31:22 +020025class OpusTest {
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000026 public:
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000027 OpusTest();
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000028 ~OpusTest();
29
30 void Perform();
turaj@webrtc.org48af6522013-09-13 23:06:59 +000031
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000032 private:
pkasting25702cb2016-01-08 13:50:27 -080033 void Run(TestPackStereo* channel,
Peter Kasting69558702016-01-12 16:26:35 -080034 size_t channels,
pkasting25702cb2016-01-08 13:50:27 -080035 int bitrate,
36 size_t frame_length,
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000037 int percent_loss = 0);
38
39 void OpenOutFile(int test_number);
40
kwiberg37478382016-02-14 20:40:57 -080041 std::unique_ptr<AudioCodingModule> acm_receiver_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000042 TestPackStereo* channel_a2b_;
43 PCMFile in_file_stereo_;
44 PCMFile in_file_mono_;
45 PCMFile out_file_;
tina.legrand@webrtc.orgbd21fb52013-08-08 11:01:07 +000046 PCMFile out_file_standalone_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000047 int counter_;
48 uint8_t payload_type_;
pkasting25702cb2016-01-08 13:50:27 -080049 uint32_t rtp_timestamp_;
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000050 acm2::ACMResampler resampler_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000051 WebRtcOpusEncInst* opus_mono_encoder_;
52 WebRtcOpusEncInst* opus_stereo_encoder_;
tina.legrand@webrtc.orgbd21fb52013-08-08 11:01:07 +000053 WebRtcOpusDecInst* opus_mono_decoder_;
54 WebRtcOpusDecInst* opus_stereo_decoder_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000055};
56
57} // namespace webrtc
58
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020059#endif // MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_