blob: 93c9ffb2635f08d6670b04c0d18664151497aeea [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
kjellander3e6db232015-11-26 04:44:54 -080011#ifndef WEBRTC_MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_
12#define WEBRTC_MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000013
14#include <math.h>
15
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +000016#include "webrtc/base/scoped_ptr.h"
kjellander@webrtc.org3c652b62015-11-18 23:07:57 +010017#include "webrtc/modules/audio_coding/codecs/opus/opus_interface.h"
kjellander3e6db232015-11-26 04:44:54 -080018#include "webrtc/modules/audio_coding/acm2/acm_resampler.h"
19#include "webrtc/modules/audio_coding/test/ACMTest.h"
20#include "webrtc/modules/audio_coding/test/Channel.h"
21#include "webrtc/modules/audio_coding/test/PCMFile.h"
22#include "webrtc/modules/audio_coding/test/TestStereo.h"
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000023
24namespace webrtc {
25
26class OpusTest : public ACMTest {
27 public:
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000028 OpusTest();
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000029 ~OpusTest();
30
31 void Perform();
turaj@webrtc.org48af6522013-09-13 23:06:59 +000032
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000033 private:
pkasting25702cb2016-01-08 13:50:27 -080034 void Run(TestPackStereo* channel,
Peter Kasting69558702016-01-12 16:26:35 -080035 size_t channels,
pkasting25702cb2016-01-08 13:50:27 -080036 int bitrate,
37 size_t frame_length,
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000038 int percent_loss = 0);
39
40 void OpenOutFile(int test_number);
41
kwiberg@webrtc.org00b8f6b2015-02-26 14:34:55 +000042 rtc::scoped_ptr<AudioCodingModule> acm_receiver_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000043 TestPackStereo* channel_a2b_;
44 PCMFile in_file_stereo_;
45 PCMFile in_file_mono_;
46 PCMFile out_file_;
tina.legrand@webrtc.orgbd21fb52013-08-08 11:01:07 +000047 PCMFile out_file_standalone_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000048 int counter_;
49 uint8_t payload_type_;
pkasting25702cb2016-01-08 13:50:27 -080050 uint32_t rtp_timestamp_;
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000051 acm2::ACMResampler resampler_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000052 WebRtcOpusEncInst* opus_mono_encoder_;
53 WebRtcOpusEncInst* opus_stereo_encoder_;
tina.legrand@webrtc.orgbd21fb52013-08-08 11:01:07 +000054 WebRtcOpusDecInst* opus_mono_decoder_;
55 WebRtcOpusDecInst* opus_stereo_decoder_;
tina.legrand@webrtc.org73222cf2013-03-15 13:29:17 +000056};
57
58} // namespace webrtc
59
kjellander3e6db232015-11-26 04:44:54 -080060#endif // WEBRTC_MODULES_AUDIO_CODING_TEST_OPUS_TEST_H_