atrac3p:serialized_bandlet_quantizers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
atrac3p:serialized_bandlet_quantizers [2009/11/19 18:24] – megadiscman | atrac3p:serialized_bandlet_quantizers [2010/07/23 16:54] (current) – delete renamed page (bandlet -> QU) megadiscman | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Serialized bandlet quantizers ===== | ||
- | The quantizers 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 [[quantizer 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 base table (selected from fixed built-in tables) and some deviation. The final table is obtained by adding the built-in base table 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 quantizer of 5 and a delta of 3 results in an invalid quantizer of 8. The delta table might be shorter than the base table. 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 quantizers are directly encoded as binary numbers | ||
- | |||
- | === 1 (on master channel): Direct encoded delta === | ||
- | One of four [[quantizer base table]]s 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 thenn added to the selected base table, 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 quantizer list is then expanded. The bandlets covered by expansion are **not** related to the master channel. | ||
- | |||
- | === 2 (on master channel): Not yet described === | ||
- | === 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: base + delta encoded delta === | ||
- | A base table 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 base table. | ||
- | |||
- | ==== Expansion Modes ==== | ||
- | |||
- | === 0: No expansion === | ||
- | This mode is straight-forward and means that the delta table covers the whole amount of bandlets used in this frame. | ||
- | |||
- | === 1: Expand with zero === | ||
- | Deltas are only stored for the first //n// bandlets (number is given in the bitstream), the delta table is expanded with zeroes (meaning no change to the base table) | ||
- | |||
- | === 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 bandlets 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 Quantizer Block ==== | ||
- | * 2 bit coding mode | ||
- | |||
- | === Coding mode 0: direct coding === | ||
- | * for each coded bandlet | ||
- | * 3 bits quantizer | ||
- | |||
- | === Coding mode 1 on master channel: base + direct delta === | ||
- | * 2 bit: selection of [[quantizer base table]] | ||
- | * expansion information (see below) | ||
- | * 5 bit: number of bandlets 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 bandlet | ||
- | * 3 bits of delta | ||
- | * for each reduced-precision bandlet | ||
- | * //b// bits of delta. | ||
- | |||
- | === Coding mode 1 on slave channel: delta to first === | ||
- | * expansion information | ||
- | * if number of bandlets with delta > 0 | ||
- | * 2 bit: selection of [[quantizer delta encoding huffman tree]] | ||
- | * for each bandlet with delta: | ||
- | * huffman code for delta (gets added to master channel quantizer, wrapping around) | ||
- | * if expansion mode is 2: | ||
- | * for each bandlet covered by expansion: 1 bit direct quantizer data | ||
- | |||
- | === Coding mode 2 on master channel: sophisticated base + huffman delta === | ||
- | * expansion information (see below) | ||
- | * 1 bit: enables sparse delta on first half | ||
- | * 1 bit: selection of [[quantizer delta encoding huffman tree]] (Only Trees 0 and 1 are selectable) | ||
- | * 3 bit: quantizer for lowest bandlets | ||
- | * 4 bit: quantizer [[mode 2 tables|table]] select | ||
- | * in non-sparse-delta mode: | ||
- | * for each bandlet with delta: one huffman code from selected tree | ||
- | * in sparse-delta mode: | ||
- | * for each pair: one enable bit followed by one huffman code if enable bit set | ||
- | * for each remaining bandlet: on huffman code as delta | ||
- | |||
- | === Coding mode 2 on slave channel: delta encoded delta to first ==== | ||
- | * expansion information | ||
- | * if number of bandlets with delta > 0 | ||
- | * 2 bit: selection of [[quantizer delta encoding huffman tree]] | ||
- | * for each bandlet 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 bandlet covered by expansion: 1 bit direct quantizer data | ||
- | |||
- | === Coding mode 3: base + walking delta === | ||
- | * 2 bit: selection of [[quantizer base table]] | ||
- | * expansion information (see below) | ||
- | * If number of bandlets with delta > 0 | ||
- | * 2 bit: selection of [[quantizer delta encoding huffman tree]] | ||
- | * 3 bit: quantizer for bandlet 0 | ||
- | * for each bandlet with delta | ||
- | * huffman code representing delta between previous and this quantizer index | ||
- | * if slave channel and expansion mode is 2: | ||
- | * for each past-delta bandlet: 1 bit delta info (1 or 0) | ||
- | |||
- | ==== Expansion information ==== | ||
- | * 2 bit: expansion mode | ||
- | * mode 0: no further data | ||
- | * mode 1/2/3: 5 bits: bandlets with deltas (//n//) | ||
- | * mode 3: 2 bits: split point | ||
atrac3p/serialized_bandlet_quantizers.1258655047.txt.gz · Last modified: 2009/11/19 18:24 by megadiscman