blob: 7d3a77e26918e8ab23e297af0957a8c48754a617 [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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_ISACTEST_H_
12#define WEBRTC_MODULES_AUDIO_CODING_TEST_ISACTEST_H_
niklase@google.com470e71d2011-07-07 08:21:25 +000013
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000014#include <string.h>
15
kwiberg37478382016-02-14 20:40:57 -080016#include <memory>
17
turaj@webrtc.org6ea3d1c2013-10-02 21:44:33 +000018#include "webrtc/common_types.h"
kjellander3e6db232015-11-26 04:44:54 -080019#include "webrtc/modules/audio_coding/include/audio_coding_module.h"
20#include "webrtc/modules/audio_coding/test/ACMTest.h"
21#include "webrtc/modules/audio_coding/test/Channel.h"
22#include "webrtc/modules/audio_coding/test/PCMFile.h"
23#include "webrtc/modules/audio_coding/test/utility.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000024
25#define MAX_FILE_NAME_LENGTH_BYTE 500
26#define NO_OF_CLIENTS 15
27
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000028namespace webrtc {
29
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000030struct ACMTestISACConfig {
31 int32_t currentRateBitPerSec;
32 int16_t currentFrameSizeMsec;
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000033 int16_t encodingMode;
34 uint32_t initRateBitPerSec;
35 int16_t initFrameSizeInMsec;
36 bool enforceFrameSize;
niklase@google.com470e71d2011-07-07 08:21:25 +000037};
38
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000039class ISACTest : public ACMTest {
40 public:
henrik.lundin@webrtc.orgadaf8092014-04-17 08:29:10 +000041 explicit ISACTest(int testMode);
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000042 ~ISACTest();
niklase@google.com470e71d2011-07-07 08:21:25 +000043
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000044 void Perform();
45 private:
tina.legrand@webrtc.orgee92b662013-08-27 07:33:51 +000046 void Setup();
niklase@google.com470e71d2011-07-07 08:21:25 +000047
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000048 void Run10ms();
niklase@google.com470e71d2011-07-07 08:21:25 +000049
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000050 void EncodeDecode(int testNr, ACMTestISACConfig& wbISACConfig,
51 ACMTestISACConfig& swbISACConfig);
pbos@webrtc.org0946a562013-04-09 00:28:06 +000052
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000053 void SwitchingSamplingRate(int testNr, int maxSampRateChange);
niklase@google.com470e71d2011-07-07 08:21:25 +000054
kwiberg37478382016-02-14 20:40:57 -080055 std::unique_ptr<AudioCodingModule> _acmA;
56 std::unique_ptr<AudioCodingModule> _acmB;
niklase@google.com470e71d2011-07-07 08:21:25 +000057
kwiberg37478382016-02-14 20:40:57 -080058 std::unique_ptr<Channel> _channel_A2B;
59 std::unique_ptr<Channel> _channel_B2A;
niklase@google.com470e71d2011-07-07 08:21:25 +000060
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000061 PCMFile _inFileA;
62 PCMFile _inFileB;
niklase@google.com470e71d2011-07-07 08:21:25 +000063
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000064 PCMFile _outFileA;
65 PCMFile _outFileB;
niklase@google.com470e71d2011-07-07 08:21:25 +000066
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000067 uint8_t _idISAC16kHz;
68 uint8_t _idISAC32kHz;
69 CodecInst _paramISAC16kHz;
70 CodecInst _paramISAC32kHz;
niklase@google.com470e71d2011-07-07 08:21:25 +000071
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000072 std::string file_name_swb_;
niklase@google.com470e71d2011-07-07 08:21:25 +000073
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000074 ACMTestTimer _myTimer;
75 int _testMode;
niklase@google.com470e71d2011-07-07 08:21:25 +000076};
77
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000078} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +000079
kjellander3e6db232015-11-26 04:44:54 -080080#endif // WEBRTC_MODULES_AUDIO_CODING_TEST_ISACTEST_H_