https://wiki.multimedia.cx/api.php?action=feedcontributions&user=218.75.87.37&feedformat=atomMultimediaWiki - User contributions [en]2019-09-23T16:14:45ZUser contributionsMediaWiki 1.32.2https://wiki.multimedia.cx/index.php?title=VQA&diff=3247VQA2006-03-24T07:27:33Z<p>218.75.87.37: "</p>
<hr />
<div>* Extension: vqa<br />
* Company: [[Westwood Studios]]<br />
* Samples: [http://www.mplayerhq.hu/MPlayer/samples/game-formats/vqa/ http://www.mplayerhq.hu/MPlayer/samples/game-formats/vqa/]<br />
<br />
VQA stands for Vector Quantized Animation and is a FMV format used in a number of computer games by Westwood Studios.<br />
<br />
== Technical Description ==<br />
<br />
'''TODO: import and combine Gordan Ugarkovic's documents from [http://multimedia.cx/VQA_INFO.TXT http://multimedia.cx/VQA_INFO.TXT] and [http://multimedia.cx/HC-VQA.TXT http://multimedia.cx/HC-VQA.TXT].<br />
<br />
== Game Using VQA ==<br />
<br />
=== version 1 ===<br />
<br />
* [http://www.mobygames.com/game/win3x/legend-of-kyrandia-malcolms-revenge The Legend of Kyrandia: Malcolm's Revenge]<br />
<br />
=== versions 2 &amp;amp; 3 ===<br />
<br />
'''TODO: differentiate among v2 and v3'''<br />
* [http://www.mobygames.com/game/windows/blade-runner Blade Runner]<br />
* [http://www.mobygames.com/game/dos/command-conquer Command &amp;amp; Conquer] (and many more games in the series)<br />
* [http://www.mobygames.com/game/windows/dune-2000 Dune 2000]<br />
* [http://www.mobygames.com/game/lands-of-lore-guardians-of-destiny Lands of Lore: Guardians of Destiny]<br />
<br />
[[Category:Game Formats]]<br />
[[Category:Video Codecs]]<br />
<br />
<br />
<br />
<br />
== Technical Description ==<br />
<br />
'''TODO: import and combine Gordan Ugarkovic's documents from [http://multimedia.cx/VQA_INFO.TXT http://multimedia.cx/VQA_INFO.TXT] and [http://multimedia.cx/HC-VQA.TXT http://multimedia.cx/HC-VQA.TXT].<br />
<br />
== Game Using VQA ==<br />
<br />
=== version 1 ===<br />
<br />
* [http://www.mobygames.com/game/win3x/legend-of-kyrandia-malcolms-revenge The Legend of Kyrandia: Malcolm's Revenge]<br />
<br />
=== versions 2 &amp; 3 ===<br />
<br />
'''TODO: differentiate among v2 and v3'''<br />
* [http://www.mobygames.com/game/windows/blade-runner Blade Runner]<br />
* [http://www.mobygames.com/game/dos/command-conquer Command &amp; Conquer] (and many more games in the series)<br />
* [http://www.mobygames.com/game/windows/dune-2000 Dune 2000]<br />
* [http://www.mobygames.com/game/lands-of-lore-guardians-of-destiny Lands of Lore: Guardians of Destiny]<br />
<br />
[[Category:Game Formats]]<br />
[[Category:Video Codecs]]<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div><br />
<br />
== Technical Description ==<br />
<br />
'''TODO: import and combine Gordan Ugarkovic's documents from [http://multimedia.cx/VQA_INFO.TXT http://multimedia.cx/VQA_INFO.TXT] and [http://multimedia.cx/HC-VQA.TXT http://multimedia.cx/HC-VQA.TXT].<br />
<br />
== Game Using VQA ==<br />
<br />
=== version 1 ===<br />
<br />
* [http://www.mobygames.com/game/win3x/legend-of-kyrandia-malcolms-revenge The Legend of Kyrandia: Malcolm's Revenge]<br />
<br />
=== versions 2 &amp; 3 ===<br />
<br />
'''TODO: differentiate among v2 and v3'''<br />
* [http://www.mobygames.com/game/windows/blade-runner Blade Runner]<br />
* [http://www.mobygames.com/game/dos/command-conquer Command &amp; Conquer] (and many more games in the series)<br />
* [http://www.mobygames.com/game/windows/dune-2000 Dune 2000]<br />
* [http://www.mobygames.com/game/lands-of-lore-guardians-of-destiny Lands of Lore: Guardians of Destiny]<br />
<br />
[[Category:Game Formats]]<br />
[[Category:Video Codecs]]<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy themes<br />
This very nice Pharmacy:<br />
Order tramadol, Search over 500,000 pharmacy Archive [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events in this-wait [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
</div><br />
<br />
== Technical Description ==<br />
<br />
'''TODO: import and combine Gordan Ugarkovic's documents from [http://multimedia.cx/VQA_INFO.TXT http://multimedia.cx/VQA_INFO.TXT] and [http://multimedia.cx/HC-VQA.TXT http://multimedia.cx/HC-VQA.TXT].<br />
<br />
== Game Using VQA ==<br />
<br />
=== version 1 ===<br />
<br />
* [http://www.mobygames.com/game/win3x/legend-of-kyrandia-malcolms-revenge The Legend of Kyrandia: Malcolm's Revenge]<br />
<br />
=== versions 2 & 3 ===<br />
<br />
'''TODO: differentiate among v2 and v3'''<br />
* [http://www.mobygames.com/game/windows/blade-runner Blade Runner]<br />
* [http://www.mobygames.com/game/dos/command-conquer Command & Conquer] (and many more games in the series)<br />
* [http://www.mobygames.com/game/windows/dune-2000 Dune 2000]<br />
* [http://www.mobygames.com/game/lands-of-lore-guardians-of-destiny Lands of Lore: Guardians of Destiny]<br />
<br />
[[Category:Game Formats]]<br />
[[Category:Video Codecs]]</div>218.75.87.37https://wiki.multimedia.cx/index.php?title=Talk:RealMedia&diff=3246Talk:RealMedia2006-03-24T07:27:25Z<p>218.75.87.37: "</p>
<hr />
<div>Part of the .ra headers can be used in RM files for audio codec description (some new codecs like ralf, or even mp3 in rm, uses their own mimetype != realaudio so they have no .ra header).<br />
<br />
I'll extract the common part or .ra when i'll rite thr RM audio part, and then i'll also version 5 details (mostly are unknown ignored bytes)<br />
--[[User:Roberto|rxt]] 08:31, 25 February 2006 (EST)<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37https://wiki.multimedia.cx/index.php?title=Category:Container_Formats&diff=3236Category:Container Formats2006-03-24T07:27:09Z<p>218.75.87.37: "</p>
<hr />
<div>List of all multimedia container formats.<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37https://wiki.multimedia.cx/index.php?title=RealAudio_racp&diff=3231RealAudio racp2006-03-24T07:27:01Z<p>218.75.87.37: "</p>
<hr />
<div>* FOURCCs: racp<br />
* Company: [[Real|RealNetworks]]<br />
<br />
<br />
This fourcc is used for HE-AAC in RealMedia.<br />
<br />
[[Category:Audio Codecs]]<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37https://wiki.multimedia.cx/index.php?title=RealAudio_dnet&diff=3225RealAudio dnet2006-03-24T07:26:52Z<p>218.75.87.37: "</p>
<hr />
<div>* FOURCCs: dnet<br />
* Company: [[Real|RealNetworks]]<br />
<br />
<br />
This fourcc is used for A52/AC3 in RealMedia. The byte order of the data is reversed from standard AC3.<br />
<br />
[[Category:Audio Codecs]]<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37https://wiki.multimedia.cx/index.php?title=RealAudio_raac&diff=3217RealAudio raac2006-03-24T07:26:43Z<p>218.75.87.37: "</p>
<hr />
<div>* FOURCCs: raac<br />
* Company: [[Real|RealNetworks]]<br />
<br />
<br />
This fourcc is used for LC-AAC in RealMedia.<br />
<br />
[[Category:Audio Codecs]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37https://wiki.multimedia.cx/index.php?title=IMA_ADPCM&diff=3210IMA ADPCM2006-03-24T07:26:33Z<p>218.75.87.37: "</p>
<hr />
<div>The Interactive Multimedia Association (IMA) developed an ADPCM algorithm designed to be used in entertainment multimedia applications. It is particularly fast to encode and decode and does not strictly require any multiplications or floating point operations.<br />
<br />
While the encoding and decoding algorithms remain more or less constant across different IMA implementations, the specific on-disk data formats vary. This page describes the common IMA decoding algorithm. See the [[:Category:IMA ADPCM Audio Codecs]] page for various formats used for storing the data on disk.<br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp;amp;amp; 8<br />
delta = nibble &amp;amp;amp; 7<br />
diff = step &amp;amp;gt;&amp;amp;gt; 3<br />
if (delta &amp;amp;amp; 4) diff += step<br />
if (delta &amp;amp;amp; 2) diff += (step &amp;amp;gt;&amp;amp;gt; 1)<br />
if (delta &amp;amp;amp; 1) diff += (step &amp;amp;gt;&amp;amp;gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp;amp; 8<br />
delta = nibble &amp;amp; 7<br />
diff = step &amp;gt;&amp;gt; 3<br />
if (delta &amp;amp; 4) diff += step<br />
if (delta &amp;amp; 2) diff += (step &amp;gt;&amp;gt; 1)<br />
if (delta &amp;amp; 1) diff += (step &amp;gt;&amp;gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp;amp; 8<br />
delta = nibble &amp;amp; 7<br />
diff = step &amp;gt;&amp;gt; 3<br />
if (delta &amp;amp; 4) diff += step<br />
if (delta &amp;amp; 2) diff += (step &amp;gt;&amp;gt; 1)<br />
if (delta &amp;amp; 1) diff += (step &amp;gt;&amp;gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp; 8<br />
delta = nibble &amp; 7<br />
diff = step &gt;&gt; 3<br />
if (delta &amp; 4) diff += step<br />
if (delta &amp; 2) diff += (step &gt;&gt; 1)<br />
if (delta &amp; 1) diff += (step &gt;&gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div><br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp;amp; 8<br />
delta = nibble &amp;amp; 7<br />
diff = step &amp;gt;&amp;gt; 3<br />
if (delta &amp;amp; 4) diff += step<br />
if (delta &amp;amp; 2) diff += (step &amp;gt;&amp;gt; 1)<br />
if (delta &amp;amp; 1) diff += (step &amp;gt;&amp;gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp; 8<br />
delta = nibble &amp; 7<br />
diff = step &gt;&gt; 3<br />
if (delta &amp; 4) diff += step<br />
if (delta &amp; 2) diff += (step &gt;&gt; 1)<br />
if (delta &amp; 1) diff += (step &gt;&gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy themes<br />
This very nice Pharmacy:<br />
Order tramadol, Search over 500,000 pharmacy Archive [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events in this-wait [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
</div><br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble &amp; 8<br />
delta = nibble &amp; 7<br />
diff = step &gt;&gt; 3<br />
if (delta &amp; 4) diff += step<br />
if (delta &amp; 2) diff += (step &gt;&gt; 1)<br />
if (delta &amp; 1) diff += (step &gt;&gt; 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div><br />
<br />
== Decoding IMA ==<br />
To decode IMA ADPCM, initialize 3 variables:<br />
<br />
* predictor: This is either initialized from the data chunk preamble specified in the format or is initialized to 0 at the start of the decoding process.<br />
* step index: Similar to the initial predictor, this variable is initialized from the data chunk preamble or set to 0 at the start of the decoding process.<br />
* step: This variable is initialized to ima_step_table[step_index].<br />
<br />
The encoded IMA bitstream is comprised of a series of 4-bit nibbles. This means that each byte represents 2 IMA nibbles. The specific data format will dictate whether the stream is decoded top nibble first or bottom nibble first, and whether there is stereo interleaving within the IMA nibbles. For this discussion, imagine the IMA bitstream as a series of nibbles representing a single audio channel:<br />
<br />
n0 n1 n2 n3 n4 n5 ... <br />
<br />
Where each nibble represents both a table index and a sign/magnitude number during the decoding process. Transform each nibble in the stream into a signed, 16-bit PCM sample using the following process:<br />
<br />
step_index = step_index + ima_index_table[(unsigned)nibble]<br />
<br />
diff = ((signed)nibble + 0.5) * step / 4<br />
<br />
predictor = predictor + diff<br />
<br />
step = ima_step_table[step index]<br />
<br />
Regarding the step index and predictor calculations: Be sure to saturate the computed step index between 0 and 88 (table limits) and the predictor between -32768 and 32767 (signed 16-bit number range). It is possible for these values to outrange which could cause undesirable program behavior if unchecked.<br />
<br />
== Optimization ==<br />
<br />
A note about the following calculation:<br />
<br />
diff = ((sign/mag.)nibble + 0.5) * step / 4<br />
<br />
At first glance, it appears that this calculation requires floating point operations and an arbitrary (not power-of-2) multiplication. However, some numerical manipulations reveal some useful simplifications:<br />
<br />
diff = ((step * nibble) + (step / 2)) / 4<br />
<br />
diff = (step * nibble / 4) + (step / 8)<br />
<br />
The step / 8 calculation can be expressed as a bit shift right by 3 (step SHR 3). The first part of the equation can also be simplified. Since a nibble only carries 4 bits, and those 4 bits are a sign/magnitude number, there are only 3 bits of magnitude information. If all 3 magnitude bits are set to 1:<br />
<br />
nibble = 4 + 2 + 1<br />
<br />
step * nibble / 4 = (4 * step / 4) + (2 * step / 4) + (1 * step / 4) = step + (step / 2) + (step / 4)<br />
<br />
Thus, if bit 2 of the nibble is set, add step to diff. If bit 1 is set, add (step / 2 = step SHR 1) to diff. If bit 0 is set, add (step / 4 = step SHR 2) to diff. Finally, if the sign bit is set, subtract the final diff value from the predictor value; otherwise, add the final diff value to the predictor value. The usual algorithm is as follows:<br />
<br />
sign = nibble & 8<br />
delta = nibble & 7<br />
diff = step >> 3<br />
if (delta & 4) diff += step<br />
if (delta & 2) diff += (step >> 1)<br />
if (delta & 1) diff += (step >> 2)<br />
if (sign) predictor -= diff<br />
else predictor += diff <br />
<br />
This method was particularly useful back when IMA was implemented on commodity CPUs which were relatively slow at multiplication. One multiplication per audio sample had a notable impact on program performance, as opposed to the series of branches, additions and logical bit operations. If multiplication performance is not an issue, it is possible to carry out the diff calculation with only one non-power-of-2 multiplication and no floating point numbers:<br />
<br />
diff = ((((signed)nibble+0.5) * step) / 4) * (2 / 2)<br />
<br />
diff = (nibble + 0.5) * 2 * step / 4<br />
<br />
diff = (2 * nibble + 1) * step<br />
<br />
== Decoding Tables ==<br />
<br />
int index_table[16] = {<br />
-1, -1, -1, -1, 2, 4, 6, 8,<br />
-1, -1, -1, -1, 2, 4, 6, 8<br />
}; <br />
<br />
Note that many programs use slight deviations from the following table, but such deviations are negligible:<br />
<br />
int step_table[89] = { <br />
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, <br />
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, <br />
50, 55, 60, 66, 73, 80, 88, 97, 107, 118, <br />
130, 143, 157, 173, 190, 209, 230, 253, 279, 307,<br />
337, 371, 408, 449, 494, 544, 598, 658, 724, 796,<br />
876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, <br />
2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,<br />
5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, <br />
15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 <br />
}; <br />
<br />
[[Category:Audio Codecs]]<br />
[[Category:ADPCM Audio Codecs]]<br />
[[Category:IMA ADPCM Audio Codecs]]</div>218.75.87.37https://wiki.multimedia.cx/index.php?title=Real_Lossless_Codec&diff=3203Real Lossless Codec2006-03-24T07:26:22Z<p>218.75.87.37: "</p>
<hr />
<div>* FOURCCs: ralf<br />
* Company: [[Real|RealNetworks]]<br />
<br />
<br />
This is RealNetworks lossless audio codec.<br />
<br />
Audio header in rm files is different from other Real audio codecs; the interface of the binary decoder is also different.<br />
<br />
[[Category:Undiscovered Audio Codecs]]<br />
[[Category:Lossless Audio Codecs]]<br />
[[Category:Audio Codecs]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37https://wiki.multimedia.cx/index.php?title=ATRAC3&diff=3198ATRAC32006-03-24T07:26:14Z<p>218.75.87.37: "</p>
<hr />
<div>FOURCC: atrc<br />
<br />
Found in some old [[RealMedia]] files. Suspected to be similar to, or the same as, [[Sony ATRAC]].<br />
<br />
[[Category:Undiscovered Audio Codecs]]<br />
[[Category:Audio Codecs]]<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<div id="nolabel" style="overflow:auto;height:1px;"><br />
Pharmacy:<br />
Order tramadol, When is flicked on the article about this or three. [http://www.zorpia.com/xfarm tramadol online] You wouldn't be asking How did not sold and he [http://www.geocities.com/phenterminephentermine/ phentermine] A huge collection of freeware<br />
[http://buy-cheap-xanax.umaxnet.com/ buy cheap xanax] <br />
[http://buy-xanax-online.umaxnet.com/ buy xanax online] Is that I know what it from the expression <br />
[http://buy-xanax.umaxnet.com/ buy xanax] <br />
[http://xanax-on-line.umaxnet.com/ xanax on line] <br />
[http://2mg-xanax.umaxnet.com/ 2mg xanax] mean the events tramadol [http://generic-xanax.umaxnet.com/ generic xanax] I Sing the town then adds this evening scattered around <br />
</div></div>218.75.87.37