1cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org/*
2cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *
4cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *  Use of this source code is governed by a BSD-style license
5cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *  that can be found in the LICENSE file in the root of the source
6cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *  tree. An additional intellectual property rights grant can be found
7cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *  in the file PATENTS.  All contributing project authors may
8cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org *  be found in the AUTHORS file in the root of the source tree.
9cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org */
10cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
11cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#ifndef WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_OPUS_TEST_H_
12cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#define WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_OPUS_TEST_H_
13cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
14cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#include <math.h>
15cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
16c68f88e9287a1e4e07f7739f39574a203b1c7750henrik.lundin@webrtc.org#include "webrtc/modules/audio_coding/main/acm2/acm_opus.h"
17c68f88e9287a1e4e07f7739f39574a203b1c7750henrik.lundin@webrtc.org#include "webrtc/modules/audio_coding/main/acm2/acm_resampler.h"
18cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#include "webrtc/modules/audio_coding/main/test/ACMTest.h"
19cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#include "webrtc/modules/audio_coding/main/test/Channel.h"
20cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#include "webrtc/modules/audio_coding/main/test/PCMFile.h"
21cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#include "webrtc/modules/audio_coding/main/test/TestStereo.h"
225e3379e47b802f3aaef17b9b34308e057bf39675andrew@webrtc.org#include "webrtc/system_wrappers/interface/scoped_ptr.h"
23cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
24cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.orgnamespace webrtc {
25cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
26cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.orgclass OpusTest : public ACMTest {
27cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org public:
28c68f88e9287a1e4e07f7739f39574a203b1c7750henrik.lundin@webrtc.org  OpusTest();
29cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  ~OpusTest();
30cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
31cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  void Perform();
32ed0b4fb2f28fa291e726fc1cf6852611f2176392turaj@webrtc.org
33cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org private:
34cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  void Run(TestPackStereo* channel, int channels, int bitrate, int frame_length,
35cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org           int percent_loss = 0);
36cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
37cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  void OpenOutFile(int test_number);
38cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
395e3379e47b802f3aaef17b9b34308e057bf39675andrew@webrtc.org  scoped_ptr<AudioCodingModule> acm_receiver_;
40cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  TestPackStereo* channel_a2b_;
41cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  PCMFile in_file_stereo_;
42cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  PCMFile in_file_mono_;
43cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  PCMFile out_file_;
44ea5f28b558ca3893ddcbbb3dad03b2eaf2790660tina.legrand@webrtc.org  PCMFile out_file_standalone_;
45cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  int counter_;
46cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  uint8_t payload_type_;
47cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  int rtp_timestamp_;
48c68f88e9287a1e4e07f7739f39574a203b1c7750henrik.lundin@webrtc.org  acm2::ACMResampler resampler_;
49cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  WebRtcOpusEncInst* opus_mono_encoder_;
50cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org  WebRtcOpusEncInst* opus_stereo_encoder_;
51ea5f28b558ca3893ddcbbb3dad03b2eaf2790660tina.legrand@webrtc.org  WebRtcOpusDecInst* opus_mono_decoder_;
52ea5f28b558ca3893ddcbbb3dad03b2eaf2790660tina.legrand@webrtc.org  WebRtcOpusDecInst* opus_stereo_decoder_;
53cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org};
54cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
55cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org}  // namespace webrtc
56cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org
57cf9ab12db22e50271900386e12d52974f8f455fetina.legrand@webrtc.org#endif  // WEBRTC_MODULES_AUDIO_CODING_MAIN_TEST_OPUS_TEST_H_
58