User Tools

Site Tools


atrac3p:serialized_tone_data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
atrac3p:serialized_tone_data [2010/07/24 09:49] – Encoding info up to tone count megadiscmanatrac3p:serialized_tone_data [2010/10/25 22:28] (current) – Fix tree name megadiscman
Line 48: Line 48:
  
 === 1: variable-length-encoded difference-to-master === === 1: variable-length-encoded difference-to-master ===
-The slave pitch is encoded as difference to the master pitch with the same tone index (if present) or the master tone with the highest index that is present, or, if there are no master tones at all, as difference to 0. Difference application wraps at 1024.+In each band, the slave pitches of all tones are encoded as difference to the master pitch with the same tone index in that band (if present) or the master tone with the highest index that is present, or, if there are no master tones at all, as difference to 0. Difference application wraps at 1024.
  
  
 ===== Tone Linking ===== ===== Tone Linking =====
-For the compression of level and phase information in the slave channel, tones in the slave channel are linked to tones in the master channel based on their pitch. The linking algorithm is like this:+For the compression of level information in the slave channel, tones in the slave channel are linked to tones in the master channel based on their pitch. The linking algorithm is like this:
  
   * Look for the tone(s) in the master channel which have the lowest absolute deviation in pitch from the current slave tone. If more than one tone with the same absolute deviation is found, pick the first one. If the absolute deviation in pitch is less then 8, link to that tone.   * Look for the tone(s) in the master channel which have the lowest absolute deviation in pitch from the current slave tone. If more than one tone with the same absolute deviation is found, pick the first one. If the absolute deviation in pitch is less then 8, link to that tone.
Line 61: Line 61:
 In high-dynamic range mode, the level of each tone is stored on a logarithmic scale. The value between 0 and 63 can be encoded in one of four modes, the last two only being available on the slave channel (as they refer linked tones). In high-dynamic range mode, the level of each tone is stored on a logarithmic scale. The value between 0 and 63 can be encoded in one of four modes, the last two only being available on the slave channel (as they refer linked tones).
  
-==== Mode 0: direct encoding ====+==== Encoding Modes ==== 
 + 
 +=== 0: direct encoding ===
 The level of each tone in each band is encoded as a plain 6-bit number. The level of each tone in each band is encoded as a plain 6-bit number.
  
-==== Mode 1: variable-length encoding ====+=== 1: variable-length encoding ===
 The level of each tone in each band is stored using a variable-length code. The possible level values range between 20 and 51 in this case. The level of each tone in each band is stored using a variable-length code. The possible level values range between 20 and 51 in this case.
  
-==== Mode 2 (only in slave channel): variable-length encoded difference to master ===+=== 2 (only in slave channel): variable-length encoded difference to master ===
 The level of each tone in each band is stored as variable-length-encoded difference to the level of the linked tone in the master channel, which is assumed as 34 if there is no linked tone. The difference application does not wrap. The level of each tone in each band is stored as variable-length-encoded difference to the level of the linked tone in the master channel, which is assumed as 34 if there is no linked tone. The difference application does not wrap.
  
-==== Mode 3 (only in slave channel): clone master channel data ====+=== 3 (only in slave channel): clone master channel data ===
 The level of each tone that is linked to a master tone is copied from the master tone level, unlinked tones get a default level of 32. The level of each tone that is linked to a master tone is copied from the master tone level, unlinked tones get a default level of 32.
  
Line 76: Line 78:
 In low-dynamic range mode, the base level of all tones in a band is described by one common value on an logarithmic scale, with each individual tone having a linear scaled additional level. This allows a more fine-grained level control if all tones in a band have approximately the same level. The encoding modes are similar, but not equivalent to the level info of the HDR mode: In low-dynamic range mode, the base level of all tones in a band is described by one common value on an logarithmic scale, with each individual tone having a linear scaled additional level. This allows a more fine-grained level control if all tones in a band have approximately the same level. The encoding modes are similar, but not equivalent to the level info of the HDR mode:
  
-==== Mode 0: direct encoding ====+==== Encoding Modes ==== 
 + 
 +=== 0: direct encoding ===
 The base level of each band is encoded as a plain 6-bit number. The base level of each band is encoded as a plain 6-bit number.
  
-==== Mode 1: variable-length encoding ====+=== 1: variable-length encoding ===
 The base level of each band is stored using a variable-length code. The possible level values range between 24 and 55 in this case. The base level of each band is stored using a variable-length code. The possible level values range between 24 and 55 in this case.
  
-==== Mode 2 (only in slave channel): variable-length encoded difference to master ====+=== 2 (only in slave channel): variable-length encoded difference to master ===
 The base level of each band is stored as variable-lenght-encoded difference to the master level of base level of the corresponding band in the master channel, which is assumed as 44 if the master channel has no tones. Difference application does not wrap. The base level of each band is stored as variable-lenght-encoded difference to the master level of base level of the corresponding band in the master channel, which is assumed as 44 if the master channel has no tones. Difference application does not wrap.
  
-==== Mode 3 (only in slave channel): clone master channel data ====+=== 3 (only in slave channel): clone master channel data ===
 The base level of each band is copied from the corresponding master base level; Bands without tones in the master channel get a base level of 49. The base level of each band is copied from the corresponding master base level; Bands without tones in the master channel get a base level of 49.
  
Line 91: Line 95:
 The individual linearly-scaled tone levels (on a scale between 0 and 15) in LDR mode are stored similar to the logarithmic tone levels in HDR mode: The individual linearly-scaled tone levels (on a scale between 0 and 15) in LDR mode are stored similar to the logarithmic tone levels in HDR mode:
  
-==== Mode 0: direct encoding ====+==== Encoding Modes ==== 
 + 
 +=== 0: direct encoding ===
 The level of each tone is encoded as a plain 4-bit number The level of each tone is encoded as a plain 4-bit number
  
-==== Mode 1: variable-lenght encoding ====+=== 1: variable-lenght encoding ===
 The level of each tone is encoded using a variable-lenght code. Bands with just one tone use a different code than other bands, probably because the coarse scaling using the logarithmically coded base level can be adjusted more precisely to match the tone level. The level of each tone is encoded using a variable-lenght code. Bands with just one tone use a different code than other bands, probably because the coarse scaling using the logarithmically coded base level can be adjusted more precisely to match the tone level.
  
-==== Mode 2 (only in slave channel): variable-length encoded difference to master ====+=== 2 (only in slave channel): variable-length encoded difference to master ===
 The level of each tone in each band is stored as variable-lenght-encoded difference to the level of the linked tone in the master channel, which is assumed as 12 if there is no linked tone. Difference applications wraps around. The level of each tone in each band is stored as variable-lenght-encoded difference to the level of the linked tone in the master channel, which is assumed as 12 if there is no linked tone. Difference applications wraps around.
  
-==== Mode 3 (only in slave channel): clone master channel data ====+=== 3 (only in slave channel): clone master channel data ===
 The level of each tone that is linked to a master tone is copied from the master tone level, unlinked tones get a default level of 14. The level of each tone that is linked to a master tone is copied from the master tone level, unlinked tones get a default level of 14.
  
Line 107: Line 113:
  
 ===== Encoding ===== ===== Encoding =====
-==== Tone info ====+==== Tone info header ====
   * 1 bit: Chooses high-dynamic-range mode if set, low-dynamic-range mode if clear   * 1 bit: Chooses high-dynamic-range mode if set, low-dynamic-range mode if clear
-  * symbol from [[tone info trees#bands with tones tree]]: The number of bands tonal data is stored for.+  * symbol from [[tone info trees#bands with tones tree]] (in the range 1..16 bands).
   * in two-channel substreams:   * in two-channel substreams:
-    * 1 bit: If clear, clone information from master to slave for all bands otherwise +    * 1 bit: If clear, never clone information from master to slave for any band otherwise 
-      * 1 bit: If clear, never clone information from master to slave, otherwise+      * 1 bit: If clear, clone information from master to slave for all bands, otherwise
         * 1 bit per band with tone data: If set, clone data for this band         * 1 bit per band with tone data: If set, clone data for this band
     * 1 bit: If clear, master channel is the left channel for all bands     * 1 bit: If clear, master channel is the left channel for all bands
Line 129: Line 135:
   * per-tone data:   * per-tone data:
     * pitches     * pitches
-    * level+    * if in HDR mode 
 +      * tone levels (HDR) 
 +    * otherwise 
 +      * band base levels (LDR) 
 +      * tone levels (LDR)
     * phase     * phase
  
Line 149: Line 159:
   * on slave channel   * on slave channel
     * 2 bits: coding mode     * 2 bits: coding mode
 +  * encoded tone counts (see directly below)
  
 === Coding Mode 0: direct encoding === === Coding Mode 0: direct encoding ===
Line 164: Line 175:
 === Coding Mode 3 (slave only): clone master === === Coding Mode 3 (slave only): clone master ===
   * no data   * no data
 +
 +==== Tone pitches ====
 +  * On slave channel only:
 +    * 1 bit: coding mode (master always uses mode 0)
 +  * encoded pitch info (see directly below)
 +
 +=== Coding mode 0: near-direct encoding ===
 +  * for each band that has a non-zero tone count:
 +    * if the tone count is bigger than 1:
 +      * 1 bit, chooses "decreasing" mode if set, or "increasing" mode if clear. (for only one tone, order doesn't matter)
 +    * for each tone in that band:
 +      * up to ten bits: near-direct encoded pitch. In ascending mode, leading 1 bits of the current tone pitch that were already set in the previous pitch are omitted (note that the count if leading one bits is monotonically increasing). Analogously, in descending mode, leading 0 bits of the current tone pitch that were already clear in the previous pitch are omitted.
 +
 +=== Coding mode 1: difference-to-master ===
 +  * for each tone in each band that has a non-zero tone count:
 +    * symbol from [[tone info trees#tone pitch delta tree]].
 +
 +==== Tone levels (HDR) ====
 +  * on master channel
 +    * 1 bit: coding mode
 +  * on slave channel
 +    * 2 bits: coding mode
 +  * encoded level info (see directly below)
 +
 +=== Coding mode 0: direct encoding ===
 +  * for each tone in each band:
 +    * 6 bits: binary encoded tone level
 +
 +=== Coding mode 1: variable-length encoding ===
 +  * for each tone in each band:
 +    * symbol from [[tone info trees#HDR level tree]].
 +
 +=== Coding mode 2 (slave only): variable-lenght encoded difference to master ===
 +  * for each tone in each band:
 +    * symbol from [[tone info trees#HDR level difference tree]]. Use linked tone level or 34 (if not linked) as base.
 +
 +=== Coding mode 3 (slave only): clone master ===
 +  * no data
 +
 +==== Band base levels (LDR) ====
 +  * on master channel
 +    * 1 bit: coding mode
 +  * on slave channel
 +    * 2 bits: coding mode
 +  * encoded level info (see directly below)
 +
 +=== Coding mode 0: direct encoding ===
 +  * for each band:
 +    * 6 bits: binary encoded base level
 +
 +=== Coding mode 1: variable-length encoding ===
 +  * for each band:
 +    * symbol from [[tone info trees#LDR band level tree]]. Add **24** to the symbol number to obtain the real level.
 +
 +=== Coding mode 2 (slave only): variable-lenght encoded difference to master ===
 +  * for each band:
 +    * symbol from [[tone info trees#logarithmic level difference tress]]. Use master band level or (if no tones in that band) **44** as base.
 +
 +=== Coding mode 3 (slave only): clone master ===
 +  * no data
 +
 +==== Tone levels (LDR) ====
 +  * on master channel
 +    * 1 bit: coding mode
 +  * on slave channel
 +    * 2 bits: coding mode
 +  * encoded level info (see directly below)
 +
 +=== Coding mode 0: direct encoding ===
 +  * for each tone in each band:
 +    * 4 bits: binary encoded tone level
 +
 +=== Coding mode 1: variable-length encoding ===
 +  * for each band:
 +    * if that band has one tone:
 +      * symbol from [[tone info trees#single-tone LDR level tree]].
 +    * otherwise for each tone in that band
 +      * symbol from [[tone info trees#LDR level tree]].
 +
 +=== Coding mode 2 (slave only): variable-lenght encoded difference to master ===
 +  * for each tone in each band:
 +    * symbol from [[tone info trees#HDR level difference tree]]. Use linked tone level or 34 (if not linked) as base.
 +
 +=== Coding mode 3 (slave only): clone master ===
 +  * no data
 +
 +===== Tone phase =====
 +  * for each tone in each band:
 +    * 5 bit phase value
atrac3p/serialized_tone_data.1279964971.txt.gz · Last modified: 2010/07/24 09:49 by megadiscman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki