diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2024-07-08 22:30:14 +0000 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2024-07-08 22:30:14 +0000 |
commit | f8eabde1e1a2fa6bdb2b09dcdee5cecb750beb30 (patch) | |
tree | 37300f12fac0da55063b81e2ff09bc3ef7324521 | |
parent | ecbfad40368b918a91b32165814d4c1567bf9128 (diff) | |
download | atracdenc-f8eabde1e1a2fa6bdb2b09dcdee5cecb750beb30.tar.gz |
[AT3P] Improve accuracy of PQF
-rw-r--r-- | src/atrac/atrac3plus_pqf/atrac3plus_pqf.c | 6 | ||||
-rw-r--r-- | src/atrac/atrac3plus_pqf/ut/ipqf_ut.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/atrac/atrac3plus_pqf/atrac3plus_pqf.c b/src/atrac/atrac3plus_pqf/atrac3plus_pqf.c index 0742469..00e893a 100644 --- a/src/atrac/atrac3plus_pqf/atrac3plus_pqf.c +++ b/src/atrac/atrac3plus_pqf/atrac3plus_pqf.c @@ -78,7 +78,7 @@ static void init(void) } } -static void vectoring(const float* const x, float* y) +static void vectoring(const float* const x, double* y) { for (int i = 0; i < 32; i++) { y[i] = 0; @@ -88,7 +88,7 @@ static void vectoring(const float* const x, float* y) } } -static void matrixing(atde_dct_ctx_t ctx, const float* y, float* samples ) +static void matrixing(atde_dct_ctx_t ctx, const double* y, float* samples ) { float yy[SUBBANDS_NUM]; float res[SUBBANDS_NUM]; @@ -129,7 +129,7 @@ void at3plus_pqf_free_a_ctx(at3plus_pqf_a_ctx_t ctx) void at3plus_pqf_do_analyse(at3plus_pqf_a_ctx_t ctx, const float* in, float* out) { - float y[SUBBANDS_NUM * 2]; + double y[SUBBANDS_NUM * 2]; float* const buf = ctx->buf; diff --git a/src/atrac/atrac3plus_pqf/ut/ipqf_ut.cpp b/src/atrac/atrac3plus_pqf/ut/ipqf_ut.cpp index c7eec07..ee2d75d 100644 --- a/src/atrac/atrac3plus_pqf/ut/ipqf_ut.cpp +++ b/src/atrac/atrac3plus_pqf/ut/ipqf_ut.cpp @@ -260,7 +260,7 @@ TEST(pqf, Chirp_Long) { ff_atrac3p_ipqf(&sctx, &subbands[0], &tmp[0]); ff_atrac3p_ipqf(&sctx, &subbands[2048], &tmp[2048]); - const static float err = 4096.0 / (float)(1<<21); + const static float err = 4096.0 / (float)(1<<22); for (int i = 368; i < 4096; i++) { EXPECT_NEAR(tmp[i], x[i-368], err); } |