4.0.0 (2026-11-29)
=====
New:
* A psychoacoustic model (`doc/psy/`) behind a quality setting:
  `mpeg.quality`, 0 to `SHINE_QUALITY_MAX` (1), default 1; `shineenc -Q`;
  `quality` in the JavaScript package. Quality 1 adds masking thresholds,
  noise allocation, the bit reservoir, short blocks, M/S per frame, and a
  lowpass at low bitrates. At quality 1 a call returns zero or more whole
  frames, and the encoder delay is 784 samples. Quality 0 runs none of it.
  (#26, #27)
* Opt-in resampling at low bitrates, which the model is tuned for:
  `shine_recommended_samplerate()` with `shine_initialise_at()`,
  `shineenc -r`, `resample` in the JavaScript package.
  `shine_initialise()` keeps the input's samplerate; `shine_samplerate()`
  gives the stream's.
* `shine_flush()` drains the filterbank: streams no longer end 1057 samples
  short. `shine_encoder_delay()` gives the delay. A second call writes
  nothing.
* The returned data pointer is never NULL, and `written` is -1 on every call
  once the encoder has failed (out of memory), where it was 0.
* Gapless playback: `shine_info_frame()` returns an Info frame in the LAME
  format (a Xing header with LAME's extension), the one FFmpeg, GStreamer
  and Firefox read the encoder delay, length and end padding from. shineenc
  writes it to files; `-T` sets another format name.
* Faster: fast transforms for the filterbank and MDCT, with arm64 NEON and
  x86-64 AVX2 kernels chosen at run time, identical output
  (`SHINE_KERNELS=plain|neon|avx2` forces a set).
* The library uses no floating point and no libm. Its tables are
  precomputed and shared between encoders, about 50 KB less per encoder.

Breaking changes (API and ABI):
* The header is `shine/shine.h`. `shine/layer3.h` keeps the 3.x names
  below, deprecated: 3.x code compiles unchanged, with a warning at each
  use under GCC and clang, but must be recompiled.
* Public names are prefixed and config fields spelled out:
  - `MONO`, `STEREO`, `JOINT_STEREO`, `DUAL_CHANNEL` (`enum modes`):
    `SHINE_MONO`, `SHINE_STEREO`, `SHINE_JOINT_STEREO`,
    `SHINE_DUAL_CHANNEL` (`enum shine_mode`).
  - `NONE`, `MU50_15`, `CITT` (`enum emph`): `SHINE_EMPHASIS_NONE`,
    `SHINE_EMPHASIS_50_15`, `SHINE_EMPHASIS_CCITT` (`enum shine_emphasis`).
  - `MPEG_I`, `MPEG_II`, `MPEG_25` (`enum mpeg_versions`): `SHINE_MPEG_I`,
    `SHINE_MPEG_II`, `SHINE_MPEG_25` (`enum shine_mpeg_version`).
  - `shine_mpeg_t.bitr` and `.emph`: `.bitrate` and `.emphasis`.
  - `PCM_MONO`, `PCM_STEREO` and `LAYER_III` are removed:
    `shine_wave_t.channels` is an int, 1 or 2.
* `shine_mpeg_t` has a `quality` field.
* Input is const: `shine_initialise()` takes a const config,
  `shine_encode_buffer()` samples as `int16_t *const *`,
  `shine_encode_buffer_interleaved()` as `const int16_t *`.
* `shine_initialise()` returns NULL unless `wave.channels` is 1 or 2 and
  `mpeg.mode` is `SHINE_MONO` exactly when it is 1.
* `shine.h` can be included from C++.

Fixed:
* Invalid streams: the padding bit at 8, 16 and 32 kHz (#39), stuffing bits
  at high bitrate mono, stuffing counted as coefficients in
  `part2_3_length`, and Huffman bits miscounted when big values end in the
  first two scalefactor bands.
* `shine_flush()` dropping the last bytes of the stream (#37).
* Output 1 dB too loud (a gain of 9/8), and distortion on full scale input:
  the MDCT has headroom instead of saturating (#24).
* Scalefactor band tables at 16 kHz (two typos) and 24 kHz (band 18), and
  the end of region 0 in short granules at 8 kHz.
* Huffman tables 1 to 12 never chosen, and region addresses carried over
  from the previous granule.
* Quantizer rounding before the 3/4 power, and out-of-bounds reads at low
  bitrates that quantized every coefficient to zero.
* Architectures with assembly multiplies (ARM, MIPS) now produce the same
  output as every other; the assembly is removed.

shineenc:
* Two channels are coded as joint stereo by default; `-s` asks for plain
  stereo. `-m` downmixes stereo input.
* WAV reading: big endian machines (#34), the end of the data chunk,
  files with no channels or a zero byte rate.
* Fix crashes on command lines made only of options.

JavaScript:
* Built to WebAssembly with clang (`make wasm`) instead of Emscripten, as
  an ES module (#36).
* `close()` encodes the samples still buffered, `StereoMode.STEREO` means
  plain stereo, and `encode()` rejects channels of different lengths.

Build:
* The Android ndk-build files are removed: use `configure --host` with the
  NDK's clang.

3.1.1 (2017-07-28)
=====
* Remove invalid MPEG 2.5 bitrates.

3.1.0 (2014-08-01):
=====
* Fixed WAV file parsing.
* Explicitely unroll some loops
  to enhance encoding speed. Thanks
  to @ckthomas on github for these
  changes!
* Add -funroll-loops to CFLAGS
* Major code cleanup by @zhaoxiu-zeng
  on `LingYunZhi/shine`.
* Added interleaved API, also contributed
  by @zhaoxiu-zeng
* Bumped ABI to 3.1.0

3.0.0 (2013-07-21):
======
* Added support for MPEG-II and 2.5
* Added Javascript build and API.

2.0.0 (2013-04-07):
======
* Prefix symbols to avoid name clash
  with libmp3lame.
* Rename public API from L3_ to shine_
  to also avoid name clash.

1.0.0 (2013-02-02):
======
* Initial release
