ClearVideo: Difference between revisions

From MultimediaWiki
Jump to navigation Jump to search
No edit summary
(Update some information)
Line 5: Line 5:
ClearVideo is a video encoder ostensibly based on fractals. Alleged to be the basis of certain [[RealVideo]] codecs. Also alleged to be patented. A patent search with "iterated" as the assignee name indeed turns up over 20 patents, many of which mention "fractals" and "image compression" in the title. The same decoder core is used for VfW, QT and Real decoders.
ClearVideo is a video encoder ostensibly based on fractals. Alleged to be the basis of certain [[RealVideo]] codecs. Also alleged to be patented. A patent search with "iterated" as the assignee name indeed turns up over 20 patents, many of which mention "fractals" and "image compression" in the title. The same decoder core is used for VfW, QT and Real decoders.


=== Bitstream details ===
One of the peculiarities of the codec is that the codebooks are provided to it externally and usually they are stored as the resources in decoder (or encoder) wrapper. Those tables include:
* <code>CVLHUFF</code> — single large codebook for 64x64 tile mode interframes (first 1/5th of it is 8-bit code lengths, next 2/5 is 16-bit code values, the rest is 16-bit code symbols)
* <code>HUFF</code> — codebooks for interframe tree information coding.
* <code>DCT</code> — intraframe coefficients codebooks
* <code>VQ</code> — probably suggested block configurations for the encoder, not used by decoder
 
=== Extradata ===
 
=== Intraframe decoding ===
 
==== Codebooks ====
 
Codebooks are stored in <code>DCT</code> table as the arrays of (32-bit word for code value, 32-bit word for code length) pairs with zero codes for unused entries. There are following tables stored one after another:
* AC table 1, 24 entries
* AC table 2, 100 entries
* AC table 3, 6 entries
* AC table 4, 40 entries
* 112*8 bytes - some lookup table
* 96*8 bytes - some lookup table
* 120*8 bytes - some lookup table
* DC table, 127 entries
 
==== Bitstream ====


Bitreader uses 32-bit little-endian words and reads data from MSB.
Bitreader uses 32-bit little-endian words and reads data from MSB.
Line 11: Line 33:
At least one of the coding methods is based on DCT and works in YUV420 colourspace:
At least one of the coding methods is based on DCT and works in YUV420 colourspace:


   get_bits(8); //???
   ac_quant = get_bits(8); // DC quantisers are always 32
   for (all macroblocks) {
   for (all macroblocks) {
     for (i = 0; i < 6; i++)
     for (i = 0; i < 6; i++)
Line 19: Line 41:
       idx = 0;
       idx = 0;
       while (idx < 64) {
       while (idx < 64) {
         decode <skip, value, last> tuple
         val = get_code();
        if (val != ESCAPE) {
          unpack val into last, value and skip
          if (get_bit())
            value = -value;
        } else {
          last = get_bit();
          skip = get_bits(6);
          value = get_bits(8); // signed value
        }
         blk[idx] = value;
         blk[idx] = value;
         idx += skip;
         idx += skip;
Line 30: Line 61:
     }
     }
   }
   }
=== Interframe decoding ===
==== Codebook description ====
***TODO***
==== Bitstream decoding ====
***TODO***


[[Category:Video Codecs]]
[[Category:Video Codecs]]
[[Category:Undiscovered Video Codecs]]
[[Category:Undiscovered Video Codecs]]

Revision as of 11:07, 30 January 2018

ClearVideo is a video encoder ostensibly based on fractals. Alleged to be the basis of certain RealVideo codecs. Also alleged to be patented. A patent search with "iterated" as the assignee name indeed turns up over 20 patents, many of which mention "fractals" and "image compression" in the title. The same decoder core is used for VfW, QT and Real decoders.

One of the peculiarities of the codec is that the codebooks are provided to it externally and usually they are stored as the resources in decoder (or encoder) wrapper. Those tables include:

  • CVLHUFF — single large codebook for 64x64 tile mode interframes (first 1/5th of it is 8-bit code lengths, next 2/5 is 16-bit code values, the rest is 16-bit code symbols)
  • HUFF — codebooks for interframe tree information coding.
  • DCT — intraframe coefficients codebooks
  • VQ — probably suggested block configurations for the encoder, not used by decoder

Extradata

Intraframe decoding

Codebooks

Codebooks are stored in DCT table as the arrays of (32-bit word for code value, 32-bit word for code length) pairs with zero codes for unused entries. There are following tables stored one after another:

  • AC table 1, 24 entries
  • AC table 2, 100 entries
  • AC table 3, 6 entries
  • AC table 4, 40 entries
  • 112*8 bytes - some lookup table
  • 96*8 bytes - some lookup table
  • 120*8 bytes - some lookup table
  • DC table, 127 entries

Bitstream

Bitreader uses 32-bit little-endian words and reads data from MSB.

At least one of the coding methods is based on DCT and works in YUV420 colourspace:

 ac_quant = get_bits(8); // DC quantisers are always 32
 for (all macroblocks) {
    for (i = 0; i < 6; i++)
      block_coded[i] = get_bit();
    for (i = 0; i < 6; i++) {
      if (!block_coded[i]) continue;
      idx = 0;
      while (idx < 64) {
        val = get_code();
        if (val != ESCAPE) {
          unpack val into last, value and skip
          if (get_bit())
            value = -value;
        } else {
          last = get_bit();
          skip = get_bits(6);
          value = get_bits(8); // signed value
        }
        blk[idx] = value;
        idx += skip;
        if (last)
          break;
      }
      unquantise block (with separate quantiser for DC)
      IDCT();
      put_block_clamped();
    }
 }

Interframe decoding

Codebook description

      • TODO***

Bitstream decoding

      • TODO***