aboutsummaryrefslogtreecommitdiffstats
path: root/src/atracdenc_ut.cpp
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2016-06-19 02:58:23 +0300
committerDaniil Cherednik <dan.cherednik@gmail.com>2016-06-19 03:31:55 +0300
commit1151d5831f19a9f24dd0c545a4968606712a62d2 (patch)
treec978c1b9a3fc86fef531dd412fe6b7668b7c0567 /src/atracdenc_ut.cpp
parent8d65a0bd0774e03b3d10354e15f2f3361a2ce26a (diff)
downloadatracdenc-atrac3.tar.gz
some improvements of ATRAC3 implementation:atrac3
- simple (ATRAC1 like) psychoacoustic added - possibility to encode tonal components - simple tonal component extractor - refactoring
Diffstat (limited to 'src/atracdenc_ut.cpp')
-rw-r--r--src/atracdenc_ut.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/atracdenc_ut.cpp b/src/atracdenc_ut.cpp
index 5370e9e..5d5f5eb 100644
--- a/src/atracdenc_ut.cpp
+++ b/src/atracdenc_ut.cpp
@@ -1,16 +1,16 @@
-#include "atracdenc.h"
+#include "atrac1denc.h"
#include <gtest/gtest.h>
#include <vector>
using std::vector;
using namespace NAtracDEnc;
-void CheckResult128(const vector<double>& a, const vector<double>& b) {
+void CheckResult128(const vector<TFloat>& a, const vector<TFloat>& b) {
for (int i = 0; i < 96; ++i ) {
EXPECT_NEAR(a[i], 4 * b[i+32], 0.0000001);
}
}
-void CheckResult256(const vector<double>& a, const vector<double>& b) {
+void CheckResult256(const vector<TFloat>& a, const vector<TFloat>& b) {
for (int i = 0; i < 192; ++i ) {
EXPECT_NEAR(a[i], 2 * b[i+32], 0.0000001);
}
@@ -19,14 +19,14 @@ void CheckResult256(const vector<double>& a, const vector<double>& b) {
TEST(TAtrac1MDCT, TAtrac1MDCTLongEncDec) {
TAtrac1MDCT mdct;
- vector<double> low(128 * 2);
- vector<double> mid(128 * 2);
- vector<double> hi(256 * 2);
- vector<double> specs(512 * 2);
-
- vector<double> lowRes(128 * 2);
- vector<double> midRes(128 * 2);
- vector<double> hiRes(256 * 2);
+ vector<TFloat> low(128 * 2);
+ vector<TFloat> mid(128 * 2);
+ vector<TFloat> hi(256 * 2);
+ vector<TFloat> specs(512 * 2);
+
+ vector<TFloat> lowRes(128 * 2);
+ vector<TFloat> midRes(128 * 2);
+ vector<TFloat> hiRes(256 * 2);
for (int i = 0; i < 128; i++) {
low[i] = mid[i] = i;
@@ -48,25 +48,25 @@ TEST(TAtrac1MDCT, TAtrac1MDCTLongEncDec) {
TEST(TAtrac1MDCT, TAtrac1MDCTShortEncDec) {
TAtrac1MDCT mdct;
- vector<double> low(128 * 2);
- vector<double> mid(128 * 2);
- vector<double> hi(256 * 2);
- vector<double> specs(512 * 2);
-
- vector<double> lowRes(128 * 2);
- vector<double> midRes(128 * 2);
- vector<double> hiRes(256 * 2);
+ vector<TFloat> low(128 * 2);
+ vector<TFloat> mid(128 * 2);
+ vector<TFloat> hi(256 * 2);
+ vector<TFloat> specs(512 * 2);
+
+ vector<TFloat> lowRes(128 * 2);
+ vector<TFloat> midRes(128 * 2);
+ vector<TFloat> hiRes(256 * 2);
for (int i = 0; i < 128; i++) {
low[i] = mid[i] = i;
}
- const vector<double> lowCopy = low; //in case of short wondow AtracMDCT changed input buffer during calculation
- const vector<double> midCopy = mid;
+ const vector<TFloat> lowCopy = low; //in case of short wondow AtracMDCT changed input buffer during calculation
+ const vector<TFloat> midCopy = mid;
for (int i = 0; i < 256; i++) {
hi[i] = i;
}
- const vector<double> hiCopy = hi;
+ const vector<TFloat> hiCopy = hi;
const TBlockSize blockSize(true, true, true); //short