| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
| |
* Fix UTF-8 input and output paths for Windows
* Fix wrong message in case of missed input file
* Add test
|
| |
|
|
|
|
|
|
|
| |
* Add MSYS2 build support
Add a selectable PCM I/O backend so MSVC builds can keep Media Foundation while MSYS2/MinGW builds use libsndfile.
Teach the libsndfile finder about MINGW_PREFIX and add a Windows MSYS2 CI job that builds the libsndfile backend.
Fix and enable tests for MSYS2 builds
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- Add shared CalcSpectralFlatnessPerBfu helper in atrac_psy_common
with BFU-table mapping.
- Implement ATRAC3 tonal extraction: compute MDCT energy, estimate
per-BFU flatness, extract up to 5-bin strongest tonal run in
low-flatness BFUs, and zero extracted bins in residual.
- Map extracted tonal bins into TTonalBlocks and integrate them into
bitstream coding.
- Update ATRAC3 bit allocation - reduce residual bits for BFUs with tonal
blocks, and increase tonal quantizer selection.
- Restore --notonal CLI option in main.cpp for A/B comparison.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CalcCurve (transient_detector.cpp/h):
- Recursive divide-and-conquer FindTransients scans the gain vector for
monotonic 3-subframe windows (rising or falling); kMinScore=2.0 filters
out oscillations smaller than a factor of 2 (no-op at Level 4).
- RelationToIdx maps an amplitude ratio to an ATRAC3 gain Level index.
- TCurveBuilderCtx carries LastLevel across frames; CalcCurve prepends it
as a virtual boundary element to detect Location=0 attacks.
- budget=8 matches ATRAC3 SubbandInfo::MaxGainPointsNum.
TSpectralUpsampler (transient_spectral_upsampler.cpp/h):
- Applies a Planck-taper window (ε=0.15) to a 512-sample context window,
forward-FFTs, applies a 3-bin raised-cosine HPF, zero-pads to 4096 bins,
and inverse-FFTs to give an 8× upsampled output.
- Returns highFreqRatio = Σ|X[k]·H[k]|²/Σ|X[k]|²; callers skip CalcCurve
when this is below kHighFreqThreshold=0.05, preventing false transients
from Planck noise-floor variation in sub-cutoff frames.
Tests:
- gain_processor_ut: upsampled-path blocks added to all FreqDomain tests;
CalcCurve negative tests (NegativeTests suite).
- transient_spectral_upsampler_ut: OutputSize, DCIsRemovedByLowCutFilter,
HighFreqSinePreservesRMS (parametrised), ChirpNoTransient (0→5510 Hz
sweep at 689 Hz low-cut, Len1024/16384/262144).
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gain_processor_ut.cpp covers three test suites:
TGainProcessor_Modulate (5 tests):
- Empty gain returns null op
- Single-point constant/transition/remainder regions
- Two-point and three-point envelopes
TGainProcessor_Demodulate (5 tests):
- Empty gain returns null op
- Single-point constant/transition/remainder regions
- Two-point envelope
TGainProcessor_Mirror (6 tests):
- Round-trip Modulate->Demodulate algebraic identity
- Constant, transition, remainder, and asymmetric-scale cases
TGainProcessor_FreqDomain (6 tests):
Each test builds a 3-frame signal, runs MDCT with Modulate, checks
HF energy reduction vs unmodulated, and verifies perfect signal
reconstruction via MDCT(Modulate)->MIDCT(Demodulate) with 1e-5 tolerance.
Test signals and gain envelopes (mirroring atrac3denc_ut.cpp reference tests):
| Test name | Frame 1 gain | Frame 2 comp gain |
|-------------------------------------------------------|-----------------------|-------------------|
| GainModulation_ReducesSpectralEnergy | {{7,0}} | none |
| GainModulation_ReducesSpectralEnergy_TransientInFrame | {{4,8},{7,31}} | {{1,1}} |
| GainModulation_ReducesSpectralEnergy_AttackAndRelease | {{7,4},{4,12},{7,31}} | {{1,1}} |
| GainModulation_ReducesSpectralEnergy_DcSignal | {{7,1}} | {{1,1}} |
| GainModulation_ReducesSpectralEnergy_DcSignal2 | {{7,1}} | {{1,0}} |
| GainModulation_ReducesSpectralEnergy_2PointsWithoutScaleDc2 | {{4,0},{1,31}} | none |
Round-trip Demodulate mapping (siCur -> siNext at frame 2 MIDCT):
| Test name | siCur | siNext |
|-------------------------------------------------------|-----------------------|---------|
| GainModulation_ReducesSpectralEnergy | {{7,0}} | empty |
| GainModulation_ReducesSpectralEnergy_TransientInFrame | {{4,8},{7,31}} | {{1,1}} |
| GainModulation_ReducesSpectralEnergy_AttackAndRelease | {{7,4},{4,12},{7,31}} | {{1,1}} |
| GainModulation_ReducesSpectralEnergy_DcSignal | {{7,1}} | {{1,1}} |
| GainModulation_ReducesSpectralEnergy_DcSignal2 | {{7,1}} | {{1,0}} |
| GainModulation_ReducesSpectralEnergy_2PointsWithoutScaleDc2 | {{4,0},{1,31}} | empty |
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It looks like we are able to encode ATRAC3PLUS compatible bitstream so we can merge at3p development branch in to the main branch.
Current limitation for AT3P mode:
- Only 352 Kbps (proper bit allocation and some psychoacoustic must be implemented)
- GHA sometime works with error (but huge bitrate hide it)
- No VLC, VQ, delta encoding
- No noise substitution
- No gain control
- No window shape switching
|
| | |
| |
| |
| |
| |
| |
| |
| | |
* Write scale factor index, wordlen, codetable directly (without VLC)
* Use huffman tables for mantisas
* Some draft of the library to simplify bit allocation code
* Tonal encoding teporary disabled
* Allow c++14
|
| | | |
|
| | |\ |
|
| | |\ \ |
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* Multidimensional gha, rework residual check
* Possibility to look into the next frame during GHA
* Possibility to pass envelope into bitstream
* Tool to create oma file from tsv gha description (to test envelope processing)
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* extract sinusoids parameters one by one. It is simple and fast but
probably will not work well on the real musical signals
* envelope is not passed to the output. Envelope handling must be improved
|
| | | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
* borrow Huffman table from FFmpeg
* code (with ut) to pack frequency part of GHA block
* some related data structures
* bitstrem modification to write correct GHA block
* switch compile flag to use float data type
|
| | |_|/
|/| | |
|
| |\ \ \
| | |/
| |/| |
|
| | | | |
|
| | |/ |
|
| |/ |
|
| |
|
|
|
|
|
|
|
| |
The default is double for hystorical reason.
Actually no any reason to use double precision float point
calculation for all processing. AT3P encoding will use float
except places were we really need double precision.
So this default will be changed to float in near future and
this option will be removed.
|
| | |
|
| | |
|
| |
|
|
| |
M=16 perfect reconstruction polyphase quadrature analysis filter bank
|
| |
|
|
| |
ref files contains samples just before and after ipqf
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
- VS build (2017 tested)
- Media Foundation Framework support to read/write pcm data (instead of
libsndfile)
|
| | |
|
| | |
|
| |
|
|
|
|
| |
- we need fft for some atrac3 features
- we need fft to implement better psychoacoustics analysis
- use single transform library
|
| | |
|
| |
|
|
|
|
|
| |
- no JS mode
- constant quantiser for tonal components
- gain controll implemented but produces some artifacts with real signals.
- etc...
|
| | |
|
| | |
|
| |
|