<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Bit_Rate_Reduction</id>
	<title>Bit Rate Reduction - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://debianws.lexgopc.com/wiki143/index.php?action=history&amp;feed=atom&amp;title=Bit_Rate_Reduction"/>
	<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Bit_Rate_Reduction&amp;action=history"/>
	<updated>2026-05-05T20:24:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>http://debianws.lexgopc.com/wiki143/index.php?title=Bit_Rate_Reduction&amp;diff=2942905&amp;oldid=prev</id>
		<title>134.97.179.171: fixed link</title>
		<link rel="alternate" type="text/html" href="http://debianws.lexgopc.com/wiki143/index.php?title=Bit_Rate_Reduction&amp;diff=2942905&amp;oldid=prev"/>
		<updated>2023-08-25T08:35:27Z</updated>

		<summary type="html">&lt;p&gt;fixed link&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
{{about|the compression scheme used on the SPC-700|other methods of bit-rate reduction|data compression}}&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Bit Rate Reduction&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;&amp;#039;BRR&amp;#039;&amp;#039;&amp;#039;, also called &amp;#039;&amp;#039;&amp;#039;Bit Rate Reduced&amp;#039;&amp;#039;&amp;#039;, is a name given to&lt;br /&gt;
an [[audio data compression|audio compression]] method used on the [[SPC700]] sound coprocessor used in the [[Super Nintendo Entertainment System|SNES]], as well as the audio processors of the [[Philips CD-i]], the [[PlayStation (console)|PlayStation]], and the [[Apple Inc.|Apple]] [[Macintosh Quadra]] series.&amp;lt;ref&amp;gt;{{Cite web|url=https://68kmla.org/bb/index.php?threads/found-a-sound-in-quadra-700-900-rom-but-cant-extract.25588/post-281940|title = 68kMLA}}&amp;lt;/ref&amp;gt;  The method is a form of [[ADPCM]].&lt;br /&gt;
&lt;br /&gt;
BRR compresses each consecutive sequence of sixteen 16-bit [[pulse-code modulation|PCM]] samples into a block of 9 [[byte]]s.  From most to least significant, the first byte of each block consists of four bits indicating the &amp;#039;&amp;#039;range&amp;#039;&amp;#039; of the block (see below) which controls the size of steps between the 16 possible values such that minute changes can be recorded if the 16 values are closer together but minute changes are lost if the 16 values are far apart, two bits indicating the &amp;#039;&amp;#039;filter&amp;#039;&amp;#039; (see below), and  two bits of control information for the SPC700. The remaining eight bytes consist of 16 signed 4-bit nibbles which correspond to the 16 samples, packed in a [[endianness|big-endian]] manner.  As 32 bytes of input become 9 bytes of output, the BRR algorithm yields a 3.56:1 compression ratio.&lt;br /&gt;
&lt;br /&gt;
==Decompression algorithm==&lt;br /&gt;
A nibble &amp;#039;&amp;#039;n&amp;#039;&amp;#039; in a block with filter &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; and range &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; should be decoded into a PCM sample &amp;lt;math&amp;gt;s_t&amp;lt;/math&amp;gt; using the following second-order [[linear prediction]] equation:&lt;br /&gt;
:&amp;lt;math&amp;gt;s_t = 2^r n + k_1 s_{t-1} - k_2 s_{t-2}&amp;lt;/math&amp;gt;&lt;br /&gt;
Here, &amp;lt;math&amp;gt;s_{t-1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;s_{t-2}&amp;lt;/math&amp;gt; are the last-output and next-to-last-output PCM samples, respectively. The filter type &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt; is translated into [[infinite impulse response|IIR]] prediction coefficients &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; using the following table:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Filter &amp;#039;&amp;#039;f&amp;#039;&amp;#039; || &amp;#039;&amp;#039;k&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; || &amp;#039;&amp;#039;k&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15/16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 61/32 || 15/16&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 115/64 || 13/16&lt;br /&gt;
|}&lt;br /&gt;
These calculations are all done in signed 16.16 [[fixed-point arithmetic]].&lt;br /&gt;
&lt;br /&gt;
Or in words:&lt;br /&gt;
&lt;br /&gt;
* Filter 0 linearly decodes the &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; bit downquantized version of the samples.&lt;br /&gt;
* Filter 1 adds an &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; bit downquantized version of the samples to a lowered previous input (delta pack or differential coding).&lt;br /&gt;
* Filters 2 and 3 add an &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; bit downquantized version of the samples to the linear extrapolation from the last two samples (2nd order differential coding).&lt;br /&gt;
&lt;br /&gt;
The coefficients of the above filters are specified as slightly less than 1 or 2 in order to realize a [[leaky integrator]] that is more resilient to errors in the encoded bitstream. Otherwise, any errors could propagate infinitely, as an [[impulse response]] of an ideal integrator is a [[Heaviside_step_function#Discrete_form|step function]]. The denominators are powers of 2 to facilitate implementation with bit shifts as opposed to a more expensive hardware multiplier.&lt;br /&gt;
&lt;br /&gt;
The PlayStation APU and the Philips CD-i CDIC add another set of coefficients to the above and reorders them, for five unique of 8 filters total (these come from the [[Green Book (CD standard)|Green Book]] and [[CD-ROM|Yellow Book]] specifications):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Filter &amp;#039;&amp;#039;f&amp;#039;&amp;#039; || &amp;#039;&amp;#039;k&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;1&amp;lt;/sub&amp;gt; || &amp;#039;&amp;#039;k&amp;#039;&amp;#039;&amp;lt;sub&amp;gt;2&amp;lt;/sub&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 0 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 15/16 || 0&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 115/64 || 13/16&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 49/32 || 55/64&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 61/32 || 15/16&lt;br /&gt;
|}&lt;br /&gt;
These calculations are all done in signed 16.16 [[fixed-point arithmetic]].&lt;br /&gt;
&lt;br /&gt;
== References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
* [http://emureview.ztnet.com/developerscorner/SoundCPU/spc.htm SPC 700 Documentation]&lt;br /&gt;
* US Patent 4,685,115 [beginnings of system which became BRR]&lt;br /&gt;
* US Patent 4,783,792 [further development toward BRR]&lt;br /&gt;
* US Patent 4,797,902 [BRR; example coefficients can be seen on page 21]&lt;br /&gt;
* US Patent 4,829,522 [BRR with error correction-aware interpolation for reading from a disc medium such as a [[MiniDisc]]; the final MiniDisc implementation did not use BRR]&lt;br /&gt;
* US Patent 5,041,830 [BRR shifting/quantization]&lt;br /&gt;
* US Patent 5,070,515 [BRR encoding/noise shaping; example coefficients can be seen on page 23]&lt;br /&gt;
* US Patent 5,086,475 [BRR Looping, pitch/frequency detection for encoding]&lt;br /&gt;
* US Patent 5,111,530 [Rather specific patent on the workings of the DSP in the [[SNES]] and [[PlayStation]] APU]&lt;br /&gt;
* US Patent 5,128,963 [a later patent on the system which became BRR]&lt;br /&gt;
* US Patent 5,166,981 [Using LPC analysis for assisting in encoding BRR]&lt;br /&gt;
* US Patent 5,303,374 [Predictive error generator for assisting in encoding BRR; coefficients can be seen on page 6]&lt;br /&gt;
* US Patent 5,430,241 [BRR Looping, pitch/frequency detection for encoding, similar to 5,086,475]&lt;br /&gt;
* US Patent 5,519,166 [BRR Looping, pitch/frequency detection for encoding, continuation of 5,430,241]&lt;br /&gt;
* US Patent 5,978,492 [BRR in the context of CD-XA on [[Sony]] [[PlayStation]] ]&lt;br /&gt;
&lt;br /&gt;
[[Category:Digital audio]]&lt;br /&gt;
[[Category:Super Nintendo Entertainment System]]&lt;/div&gt;</summary>
		<author><name>134.97.179.171</name></author>
	</entry>
</feed>