User Tools

Site Tools


atrac3p:serialized_quantization_unit_quantization_precisions

Serialized quantization unit quantization precisions

The quantization precision to load are numbers between 0 and 7, where 7 indicates highest precision and 1 means lowest precision and zero means no data at all (see quantization precision table).

There are 4 different encoding modes to choose from for each channel. The modes 1 and 2 mean different things on the master and the slave channel. Many encoding modes work with the combination of a prediction vector (selected from fixed built-in prediction vectors) and the residual deviation. The final table is obtained by summing the built-in vectors and the deltas. The deltas for this are in the range of 0..7, but no wrap-around is performed on overflow, so a base precision of 5 and a delta of 3 results in an invalid precision of 8. The delta table might contain fewer entries than quantization units present. In this case, the delta table is expanded before delta application. (Note that modes 1 and 2 on the slave channel do not use the standard delta/base model and work differently!)

Encoding Modes

0: Directly encoded

All quantization precisions are directly encoded as binary numbers

1 (on master channel): Direct encoded delta

One of four precision prediction vectors is selected and a delta list is stored. The first n deltas are stored in full precision (3 bits), all later deltas are stored with only b bits. The b-bit number from the file is added to a base delta c to obtain the later entries in the delta table. The expanded delta table is then added to the selected vector, no wraparound.

1 (on slave channel): Difference to master channel

A delta table (stored huffman encoded by one of four different Huffman trees) like in the other delta modes is used, but it is not expanded before the master channel is added to it. This addition is with wraparound, so a 7 in the delta table is essentially a -1. The resulting precion list is then expanded. The quantization unit covered by expansion are not related to the master channel.

2 (on master channel): Huffman encoded delta on one of many many prediction vectors

In this mode, one out of 127 mode 2 precision prediction vectors is selected. The delta to this vector can be encoded either per-unit or pairwise with codes from one of the first two precision delta encoding huffman trees. In case of pairwise coding, for each pair of quantization units one bit is stored indicating whether the delta for both of the quantization units is zero. In that case, the huffman codes for the deltas are ommited. If the pair disable bit is clear, it is followed by two huffman codes for the two quantization units. If pairwise delta disabling is disabled, all deltas are simply huffman encoded. Finally (after delta processing), expansion is applied.

2 (on slave channel): Delta-encoded difference to master channel

This mode is (like mode 1 on the slave channel) a mode where the difference to the master channel is encoded. Only as many codes as are encoded in the difference table are taken from the master channel. After summing the master codes and the deltas, the final result is expanded.

In this mode, the differences are themselves delta-encoded. The first difference value is encoded plain, all following values as difference to the previous difference value. All difference processing wraps around.

3: prediction vector + delta encoded delta

A prediction vector and a delta table are combined just like in mode 1 for the master channel, but only the first entry of the delta table is directly encoded. All later entries of the delta table are huffman encoded differences to the previous entry of the delta table. The difference is stored modulo 8 (so a wrapping addition is used), resulting in a delta table containing the numbers 0 to 7. This delta table is then added after expansion to the prediction vector.

Expansion Modes

0: No expansion

This mode is straight-forward and means that the delta table covers the whole amount of quantization units used in this frame.

1: Expand with zero

Deltas are only stored for the first n quantization units (number is given in the bitstream), the delta table is expanded with zeroes (meaning no change to the prediction vector)

2 (on master channel): Expand with one

Works like mode 1, but instead of zeroes, all non-present deltas are assumed to be one.

2 (on slave channel): Expand with given bits

For all quantization unit not given by the delta table, read a one bit that directly is the delta (zero or one).

3: Split expansion

This mode expands with a number of ones followed by a number of zeroes. The split point between the ones and the zeroes is given by a two bit number. The number is interpreted differently for the master and the slave channel. On the master channel, add one to that number to obtain the number of zeroes. On the slave channel, ad three to that number to obtain the number of ones.

Encoding

Serialized Quantization precision Block

  • 2 bit coding mode

Coding mode 0: direct coding

  • for each coded quantization unit
    • 3 bits quantization precision

Coding mode 1 on master channel: base + direct delta

  • 2 bit: selection of precision prediction vector
  • expansion information (see below)
  • 5 bit: number of quantization units with full precision delta (n)
  • 2 bit: bits of non-full-precision deltas (b)
  • 3 bit: base value for non-full-precision deltas (c)
  • for each full-precision quantization unit
    • 3 bits of delta
  • for each reduced-precision quantization unit
    • b bits of delta.

Coding mode 1 on slave channel: delta to first

  • expansion information
  • if number of quantization units with delta > 0
  • for each quantization unit with delta:
    • huffman code for delta (gets added to master channel precision, wrapping around)
  • if expansion mode is 2:
    • for each quantization unit covered by expansion: 1 bit direct precision data

Coding mode 2 on master channel: sophisticated base + huffman delta

  • expansion information (see below)
  • 1 bit: enables quantization unit pairing
  • 1 bit: selection of precision delta encoding huffman tree (Only Trees 0 and 1 are selectable)
  • 7 bit: quantization precision prediction vector select
  • in non-pairing mode:
    • for each quantization unit with delta: one huffman code from selected tree
  • in pairing mode:
    • for each pair: one disable bit followed by two huffman codes if disabled bit is cleared
    • if number of delta quantization unit is odd: one last huffman code as delta

Coding mode 2 on slave channel: delta encoded delta to first

  • expansion information
  • if number of quantization unit with delta > 0
  • for each quantization unit with delta:
    • huffman code for delta (being a difference to previous delta value except for the first one which is absolute)
  • if expansion mode is 2:
    • for each quantization unit covered by expansion: 1 bit direct precision data

Coding mode 3: base + walking delta

  • 2 bit: selection of precision prediction vector
  • expansion information (see below)
  • If number of quantization unit with delta > 0
  • for each quantization unit with delta
    • huffman code representing delta between previous and this precisions deviation to the prediction vector
  • if slave channel and expansion mode is 2:
    • for each past-delta quantization unit: 1 bit delta info (1 or 0)

Expansion information

  • 2 bit: expansion mode
    • mode 0: no further data
    • mode 1/2/3: 5 bits: quantization units with deltas (n)
    • mode 3: 2 bits: split point
atrac3p/serialized_quantization_unit_quantization_precisions.txt · Last modified: 2010/07/23 18:08 by megadiscman

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki