aboutsummaryrefslogtreecommitdiffstats
path: root/src/atrac3denc.h
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2024-11-30 13:32:34 +0100
committerDaniil Cherednik <dan.cherednik@gmail.com>2024-12-01 22:28:26 +0100
commit2ca3d7fb3cfdc0b311bb20426d53782910dee64e (patch)
tree3db4ea83192bf999e0afb5039e9d1441069a259b /src/atrac3denc.h
parent4be2e387a494b1c02d2ca0747dd64b6ba8980d21 (diff)
downloadatracdenc-2ca3d7fb3cfdc0b311bb20426d53782910dee64e.tar.gz
Tiny quality improvements for ATRAC3 compatible mode:
* Use adaptive ATH, but efficient is limited due to qmf aliasing. * Use loudness instead of energy to split M/S frame size.
Diffstat (limited to 'src/atrac3denc.h')
-rw-r--r--src/atrac3denc.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/atrac3denc.h b/src/atrac3denc.h
index 1aea07e..50f2df0 100644
--- a/src/atrac3denc.h
+++ b/src/atrac3denc.h
@@ -82,11 +82,13 @@ protected:
class TAtrac3Encoder : public IProcessor<TFloat>, public TAtrac3MDCT {
TCompressedOutputPtr Oma;
const NAtrac3::TAtrac3EncoderSettings Params;
+ const std::vector<float> LoudnessCurve;
TDelayBuffer<TFloat, 8, 256> PcmBuffer; //8 = 2 channels * 4 bands
TFloat PrevPeak[2][4]; //2 channel, 4 band - peak level (after windowing), used to check overflow during scalling
Atrac3AnalysisFilterBank<TFloat> AnalysisFilterBank[2];
+
TScaler<TAtrac3Data> Scaler;
std::vector<NAtrac3::TAtrac3BitStreamWriter::TSingleChannelElement> SingleChannelElements;
public:
@@ -100,6 +102,8 @@ public:
};
private:
std::vector<std::vector<TTransientParam>> TransientParamsHistory;
+ static constexpr float LoudFactor = 0.006;
+ float Loudness = LoudFactor;
#ifdef ATRAC_UT_PUBLIC
public:
#endif