-
Notifications
You must be signed in to change notification settings - Fork 4
Home
The master branch is a mirror of git://git.ffmpeg.org/ffmpeg.
The alsenc branch contains the ALS encoder.
git clone git://github.com/justinruggles/FFmpeg-alsenc.git ffmpeg
cd ffmpeg
git clone git://git.ffmpeg.org/libswscale
git checkout -b alsenc
git pull git://github.com/justinruggles/FFmpeg-alsenc.git alsenc
mkdir build
cd build
../configure
make
MPEG-4 ALS is an international standard that defines a lossless audio format. The most recently published document is ISO/IEC 14496-3:2005/Amd.2:2006. There is also a more recent unpublished final draft of the next (4th) edition of 14496-3 that contains some changes to ALS. The NUe Group ALS homepage contains a lot of information regarding the history of ALS, as well as related publications.
The basic process of ALS encoding is block partitioning, prediction, channel differencing, and entropy coding. Each step in the process has some choices as to the algorithm used.
The audio stream is divided into frames with an equal number of samples (except for the last frame). Each frame can then optionally be sub-divided into blocks to improve compression.
The core prediction algorithm can be forward-adaptive LPC prediction or backward-adaptive RLS-LMS prediction. For LPC prediction, the PARCOR coefficients are quantized and coded in the bitstream using Rice coding. The specification defines a lossless conversion between LPC and PARCOR coefficients. An optional long-term prediction can also be applied in addition to the core short-term prediction. LTP is a form of pitch-lag prediction, similar to that used in some speech codecs.
There are 2 kinds of channel differencing used. Joint stereo coding pairs together groups of 2 channels and encodes one of them as a difference signal. MCC (multi-channel coding) uses weighted channel differencing for multiple channels.
Entropy coding is done using either Rice or BGMC (arithmetic) coding. The arithmetic coding compresses more, but is slower for both encoding and decoding.
Some of the functions used in the ALS encoder can be shared with FFmpeg’s FLAC encoder.
- Rice coding : Determining entropy partitioning and optimal Rice parameters.
- Joint channel coding : Possible sharing of joint coding mode estimation.
- LPC : Windowing, Autocorrelation, and Levinson-Durbin