blob: 548ecb69907ed73a4fb561741ceb515287eedf4c [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
11#ifndef ACM_ISAC_TEST_H
12#define ACM_ISAC_TEST_H
13
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000014#include <string.h>
15
niklase@google.com470e71d2011-07-07 08:21:25 +000016#include "ACMTest.h"
17#include "Channel.h"
18#include "PCMFile.h"
19#include "audio_coding_module.h"
20#include "utility.h"
21#include "common_types.h"
22
23#define MAX_FILE_NAME_LENGTH_BYTE 500
24#define NO_OF_CLIENTS 15
25
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +000026namespace webrtc {
27
niklase@google.com470e71d2011-07-07 08:21:25 +000028struct ACMTestISACConfig
29{
pbos@webrtc.org0946a562013-04-09 00:28:06 +000030 int32_t currentRateBitPerSec;
31 int16_t currentFrameSizeMsec;
32 uint32_t maxRateBitPerSec;
33 int16_t maxPayloadSizeByte;
34 int16_t encodingMode;
35 uint32_t initRateBitPerSec;
36 int16_t initFrameSizeInMsec;
niklase@google.com470e71d2011-07-07 08:21:25 +000037 bool enforceFrameSize;
38};
39
40
41
42class ISACTest : public ACMTest
43{
44public:
45 ISACTest(int testMode);
46 ~ISACTest();
47
48 void Perform();
49private:
pbos@webrtc.org0946a562013-04-09 00:28:06 +000050 int16_t Setup();
51 int16_t SetupConference();
52 int16_t RunConference();
53
niklase@google.com470e71d2011-07-07 08:21:25 +000054
55 void Run10ms();
56
57 void EncodeDecode(
58 int testNr,
59 ACMTestISACConfig& wbISACConfig,
60 ACMTestISACConfig& swbISACConfig);
61
62 void TestBWE(
63 int testNr);
64
65 void SwitchingSamplingRate(
66 int testNr,
67 int maxSampRateChange);
68
69 AudioCodingModule* _acmA;
70 AudioCodingModule* _acmB;
71
72 Channel* _channel_A2B;
73 Channel* _channel_B2A;
74
75 PCMFile _inFileA;
76 PCMFile _inFileB;
77
78 PCMFile _outFileA;
79 PCMFile _outFileB;
80
pbos@webrtc.org0946a562013-04-09 00:28:06 +000081 uint8_t _idISAC16kHz;
82 uint8_t _idISAC32kHz;
niklase@google.com470e71d2011-07-07 08:21:25 +000083 CodecInst _paramISAC16kHz;
84 CodecInst _paramISAC32kHz;
85
tina.legrand@webrtc.orgba468042012-08-17 10:38:28 +000086 std::string file_name_swb_;
niklase@google.com470e71d2011-07-07 08:21:25 +000087
88 ACMTestTimer _myTimer;
89 int _testMode;
90
91 AudioCodingModule* _defaultACM32;
92 AudioCodingModule* _defaultACM16;
93
94 AudioCodingModule* _confACM[NO_OF_CLIENTS];
95 AudioCodingModule* _clientACM[NO_OF_CLIENTS];
96 Channel* _conf2Client[NO_OF_CLIENTS];
97 Channel* _client2Conf[NO_OF_CLIENTS];
98
99 PCMFile _clientOutFile[NO_OF_CLIENTS];
100};
101
tina.legrand@webrtc.org554ae1a2011-12-16 10:09:04 +0000102} // namespace webrtc
niklase@google.com470e71d2011-07-07 08:21:25 +0000103
104#endif