<feed xmlns='http://www.w3.org/2005/Atom'>
<title>atracdenc/src/atrac/at3/atrac3_bitstream.cpp, branch fix_input_file_path</title>
<subtitle>OpenSource ATRAC1 ATRAC3 Encoder</subtitle>
<id>https://code.mastervirt.ru/atracdenc/atom?h=fix_input_file_path</id>
<link rel='self' href='https://code.mastervirt.ru/atracdenc/atom?h=fix_input_file_path'/>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/atracdenc/'/>
<updated>2026-04-19T22:27:45Z</updated>
<entry>
<title>atrac3: reimplement tonal encoding. Use flatness-based tonal extraction</title>
<updated>2026-04-19T22:27:45Z</updated>
<author>
<name>Daniil Cherednik</name>
<email>dan.cherednik@gmail.com</email>
</author>
<published>2026-04-18T14:51:23Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/atracdenc/commit/?id=e784b79cfef682059cf5cc8cf9bed635e714c439'/>
<id>urn:sha1:e784b79cfef682059cf5cc8cf9bed635e714c439</id>
<content type='text'>
- 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.
</content>
</entry>
<entry>
<title>[AT3] refactor bitstream allocation loop to bs_encode</title>
<updated>2026-04-11T21:20:06Z</updated>
<author>
<name>Daniil Cherednik</name>
<email>dan.cherednik@gmail.com</email>
</author>
<published>2026-04-11T21:18:36Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/atracdenc/commit/?id=a958b27a43f0a436406dc51b942ca2f3a417e7a7'/>
<id>urn:sha1:a958b27a43f0a436406dc51b942ca2f3a417e7a7</id>
<content type='text'>
</content>
</entry>
<entry>
<title>atrac3: ratio-scored transients, per-band gain boost, pre-echo reduction</title>
<updated>2026-03-15T20:13:24Z</updated>
<author>
<name>Daniil Cherednik</name>
<email>dan.cherednik@gmail.com</email>
</author>
<published>2026-03-15T20:13:24Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/atracdenc/commit/?id=34aee45f701cd49824a83cc3781b0c12976eca2f'/>
<id>urn:sha1:34aee45f701cd49824a83cc3781b0c12976eca2f</id>
<content type='text'>
Rewrites the ATRAC3 gain control pipeline to eliminate noise flashes
and substantially reduce pre-echo artifacts:

Transient detection &amp; curve building (transient_detector.cpp/h):
- Replace legacy heuristic detector with ratio-scored DetectTransients:
  score = peak/floor for rising (c/a) or falling (a/c) triplets, scored
  and ranked, top-N kept, sorted by location
- Add explicit point0 derived from windowed-RMS match between bufCur and
  the curve-modulated bufNext (CalcWindowedRmsAfterCurve)
- Replace RegionMax with RegionRMS for smoother region amplitude estimate
- Add per-band detection thresholds kMinScorePerBand[4] = {1.9,1.9,2.1,2.2}
- Dynamic minScore: scale threshold by min(1.5, max(1.0, overlapRatio)) to
  suppress false-positive curves when previous frame dominates
- Scale constraint: curve[0].Level &gt;= 3 to cap cross-frame amplification at 2x

Bit allocation (atrac3_bitstream.cpp/h):
- Add GainBoostPerBand[NumQMF] to TSingleChannelElement, computed in
  CreateSubbandInfo and applied in CalcBitsAllocation
- levelBoost: compensate for Demodulate's GainLevel[minLevel] attenuation
- scaleBoost: compensate for next-frame cross-frame scale via lookahead
- Both capped (kLevelBoostCap=1, kScaleBoostCap=2) to avoid bit starvation

Upsampler (atrac3denc.cpp):
- Raise cutoff from 600 Hz to 800 Hz for tighter band separation

Tests (gain_processor_ut.cpp):
- Relax fixed curve shape assertions to ExpectCurveReasonable (bounds checks)
- Relax quantization error bound for dense-event spacing (&lt;=128 samples)

Results (branch new_psy vs original baseline):
  riddler: pre-echo worse 43-&gt;15/479 frames, 0 flashes
  spine:   pre-echo worse 192-&gt;107/1804 frames, 0 flashes

Co-Authored-By: Claude Sonnet 4.6 &lt;noreply@anthropic.com&gt;
</content>
</entry>
<entry>
<title>Fix energy calculation for quantization units</title>
<updated>2025-09-05T20:08:03Z</updated>
<author>
<name>Daniil Cherednik</name>
<email>dan.cherednik@gmail.com</email>
</author>
<published>2025-08-23T19:59:46Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/atracdenc/commit/?id=65b8ae4337ad68ae0c10f609a11e77d96e5ad8e2'/>
<id>urn:sha1:65b8ae4337ad68ae0c10f609a11e77d96e5ad8e2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move implementation details into corresponding dirs (#52)</title>
<updated>2025-07-22T20:54:21Z</updated>
<author>
<name>Daniil Cherednik</name>
<email>dan.cherednik@gmail.com</email>
</author>
<published>2025-07-22T20:54:21Z</published>
<link rel='alternate' type='text/html' href='https://code.mastervirt.ru/atracdenc/commit/?id=61045345fa43e54fb4fc3eee0e05b25451af9ca5'/>
<id>urn:sha1:61045345fa43e54fb4fc3eee0e05b25451af9ca5</id>
<content type='text'>
</content>
</entry>
</feed>
