blob: 3c4ca5facea19969231339d560a5441d482492a5 [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
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000028struct ACMTestISACConfig {
29 int32_t currentRateBitPerSec;
30 int16_t currentFrameSizeMsec;
31 uint32_t maxRateBitPerSec;
32 int16_t maxPayloadSizeByte;
33 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:
41 ISACTest(int testMode);
42 ~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
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000055 AudioCodingModule* _acmA;
56 AudioCodingModule* _acmB;
niklase@google.com470e71d2011-07-07 08:21:25 +000057
tina.legrand@webrtc.orgd5726a12013-05-03 07:34:12 +000058 Channel* _channel_A2B;
59 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
80#endif