summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Add explicit container selectionHEADmasterDaniil Cherednik14 days1-3/+43
|
* Multiple fixes related to IO path(#72)Daniil Cherednik2026-05-031-0/+210
| | | | | * Fix UTF-8 input and output paths for Windows * Fix wrong message in case of missed input file * Add test
* Add MSYS2 build support (#70)Daniil Cherednik2026-05-031-5/+9
| | | | | | | | | * 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
* atrac3: reimplement tonal encoding. Use flatness-based tonal extractionnew_psyDaniil Cherednik2026-04-201-0/+1
| | | | | | | | | | | | | - 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.
* Add CalcCurve and TSpectralUpsampler for transient detectionDaniil Cherednik2026-03-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* Add TGainProcessor and frequency-domain gain modulation unit testsDaniil Cherednik2026-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]>
* Disable asan for stable branch. Remove ghasendtool.Daniil Cherednik2025-07-201-1/+1
|
* Bump c++ version to c++17Daniil Cherednik2025-06-221-1/+1
|
* Merge branch 'at3plus-dev'Daniil Cherednik2025-05-311-2/+74
|\ | | | | | | | | | | | | | | | | | | | | 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
| * Minimal implementation of AT3P bitstream for residual signal.Daniil Cherednik2025-04-191-1/+20
| | | | | | | | | | | | | | | | * 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
| * [AT3P] MDCT codeDaniil Cherednik2025-01-251-0/+15
| |
| * Merge branch 'new_psy' into at3plus-devDaniil Cherednik2025-01-041-0/+1
| |\
| * \ Merge branch 'master' into at3plus-devDaniil Cherednik2024-12-241-4/+1
| |\ \
| * | | [AT3P] GHA development:Daniil Cherednik2024-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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)
| * | | [AT3P] Part of naive GHA processorDaniil Cherednik2024-08-111-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
| * | | [AT3P] Add GHA related bitstream codeDaniil Cherednik2024-07-311-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | | Compatibility with modern cmakeDaniil Cherednik2025-04-261-1/+1
| |_|/ |/| |
* | | Merge branch 'master' into new_psyDaniil Cherednik2024-12-221-3/+1
|\ \ \ | | |/ | |/|
| * | [refactoring] Get rid of TFloat parameter. Use float.Daniil Cherednik2024-12-211-4/+0
| | |
| * | [refactoring] Get rid of inheritance from data.Daniil Cherednik2024-12-121-0/+1
| |/
* / [AT3] Introduce energy aware quantizationDaniil Cherednik2024-12-151-0/+2
|/
* Allow to configure atracdenc to use float instead of doubleDaniil Cherednik2024-07-091-0/+4
| | | | | | | | | 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.
* [refactoring] move some libraries in to library directoryDaniil Cherednik2024-06-171-11/+11
|
* [AT3P] Use fast DCT-IV calculation for PQFDaniil Cherednik2024-06-161-0/+2
|
* [AT3P] PQF implementationDaniil Cherednik2024-06-141-0/+1
| | | | M=16 perfect reconstruction polyphase quadrature analysis filter bank
* Simple ipqf test and ref filesDaniil Cherednik2024-06-141-0/+25
| | | | ref files contains samples just before and after ipqf
* Get rid of gtest files. Use system package if available.Daniil Cherednik2023-11-181-25/+4
|
* Run ut via ctestDaniil Cherednik2022-02-211-0/+3
|
* UT refactoringDaniil Cherednik2020-01-041-55/+10
|
* Support for MS Windows platformDaniil Cherednik2019-05-151-0/+2
| | | | | | - VS build (2017 tested) - Media Foundation Framework support to read/write pcm data (instead of libsndfile)
* Refactoring: use normal (previous frame is first) overlap buffer layoutDaniil Cherednik2017-08-051-0/+1
|
* Support of big endian platformsDaniil Cherednik2016-11-271-1/+6
|
* kiss_fft library added, MDCT reimplemented via FFT:Daniil Cherednik2016-09-271-4/+6
| | | | | | - we need fft for some atrac3 features - we need fft to implement better psychoacoustics analysis - use single transform library
* fix compilation errors in case of building without utDaniil Cherednik2016-09-251-0/+16
|
* Dirty implementation of atrac3 encoder:Daniil Cherednik2016-09-021-1/+34
| | | | | | | - no JS mode - constant quantiser for tonal components - gain controll implemented but produces some artifacts with real signals. - etc...
* atracdenc ut added to CMake buildDaniil Cherednik2016-04-021-0/+14
|
* bitstream ut added to CMake buildDaniil Cherednik2016-03-311-0/+7
|
* mdct ut added to CMake buildDaniil Cherednik2016-03-311-0/+8