# A High Efficiency Multistage Coder for Lossless Audio Compression using OLS+ and CDCCR Method
## 1 Introduction  
The compression of audio and video signals is getting increasing attention as the transmission bandwidth is getting wider, storage media is getting cheaper and the requirement for better quality is growing. This has been proven by the dynamic work of the MPEG Group, operating from 1988 to today, and its impressive portfolio [1]. Among the developed standards and technologies, the lossless compression algorithms deserve special attention, which enables the conversion of the raw data into a compressed form and reconversion without losing any information. Important purposes of lossless audio compression include recording storage, saving of records with high-quality sound on commercial media (e.g., DVDs, Blu-Ray, and CD (44100 sample/16 bit)) and selling songs in an online music stores for more demanding customers who are not satisfied with the quality of mp3 format [2]. Moreover, lossless mode is often required at the stage of music processing in a studio, advertising materials and in the production of radio and television programs, films, (post-production [3]) etc. In such cases, no lossy coding is used, which, at each iteration of sound editing, may cumulate additional distortions. The motivation for our work is to improve the seemingly complete solution, in which we see areas of further development opportunities. We hope that through this research in the future the archiving and transmission of audio data in lossless form will become even better and more popular. Our solution is designed for target to use in static long-term archiving, such as the music database, source distribution of high-quality audio samples, where it is not required too often encoding but only distribution of coded files and encoding on client side. However, our solution does not give up and is also suitable for online encoding and decoding. Our solution is time symmetric, and is explained in more detail in Section 8. Some popular examples of lossless audio compression codecs are APE (Monkey's Audio) [4], Free Lossless Audio Coding (FLAC) [5], Shorten [6], WavPack [7], Nanozip [8], True Audio (TTA) [9],Tom's verlustfreier Audiokompressor (TAK) [10], Lossless Audio (LA) [11] and the most often scientifically published one among lossless coders--MP4-ALS-RM23--which was published as a standard ISO/IEC 14496-3:2009 with the last revision in 2015 [12]. MP4-ALS-RM23 has many switches to customise the operation of the algorithm. Therefore, in the further part of the work, we distinguish two modes: default mode and the best mode, where default mode is used without any parameters, whereas the best mode uses switches in such a way as to obtain the best results for the tested base. Lossless audio coders usually have two characteristic stages: modelling and fast compression, where the linear prediction is usually used for modelling, and entropy coders for fast compression [13]. Usually the modelling consists in replacing the current sample \(x(n)\) with its difference from the expected value \(\hat{x}(n)\) rounded to the nearest integer number:  
\[e(n)=x(n)-\lfloor\hat{x}(n)+0.5\rfloor. \tag{1}\]  
The error signal \(e(n)\) has a distribution similar to the Laplace distribution, but because of the use of integers, in practice, the geometric distribution is used (see the Golomb code in Section 7). The simplest constant prediction model is DPCM using the previous sample \(\hat{x}(n)=x(n-1)\). The basic predictive models are those with \(r\)-fixed coefficients (linear prediction in more detail is described in Section 2, see Formula (2)). A fixed predictor with a fixed set of \(r\) prediction coefficients can be used to efficiently encode various categories of audio data. The basic assumption of its universality is the fact that the sum of the coefficients should be 1 (this is a condition of the unbiased prediction estimator). The prediction order for the universal predictor (not associated with a specific audio signal) should not be too large (\(r\leq 4\)).