## MMPM/2 Device Driver Reference

[prev][next][parent][TOC]

### Quadrant Encoding Types

Encoding types used when a block is comprised into quadrants are described here. All the quadrants of a block share a single 8-bit chrominance value unless unique chrominance mode is being used, in which case each of the quadrant encodings in a block are preceded by a unique chrominance value.

Unchanged Quadrant

The data for the quadrant is unchanged from the previous frame and no further data is encoded. Note that a block with four unchanged quadrants is the same as an unchanged block which contains no chrominance value. The following figure shows how the encoded data is organized for a block containing one changed quadrant and three unchanged quadrants.

    /-------------------------------\
    |00 00 01 00|CHROMINANCE|QUAD 3 |...
    \-------------------------------/
     Block Header          One Encoded Quadrant

Decoding Tips

To decode an unchanged quadrant:

1.Move pointers in the output data to the next quadrant of the block.
2.Continue processing the next two bits of the block header.

Compression attained with this quadrant encoding is 0.25 bits per pixel, assuming normal chrominance mode, including 2 bits chrominance and 2 bits for the block header, representing a 1/4 share of each for a quadrant. A completely unchanged block (4 unchanged quadrants) will attain a compression level of 0.125 bits per pixel, as no chrominance information is encoded for the block.

Luminance Transition Coding Quadrant

The data for the quadrant is described as an angle of direction of increasing luminance and an index indicating the luminance sample values along that direction. The delta Y values are distributed to provide lower quantization in shallow gradients. The following figure shows how the encoded data is organized for an LTC quadrant.

    /----------------------------------------------------\
    |xx 10 xx xx|CHROMINANCE| QUAD 1 | AAAA YDIST index  |
    \----------------------------------------------------/
    Block Header Shared                Luminance transition
                 Chrominance

The quadrant is encoded as follows:

Four bits representing angle of direction of increasing luminance (0 indicates increasing luminance left to right - 0 degrees - with subsequent angles increasing in a counter-clockwise direction at increments of 22.5 degrees).
4 bits Angle of Direction
0000 0 degrees
0001 22.5 degrees
0010 45 degrees

    .
    .
    .

1111 337.5 (-22.5) degrees
12 bits luminance transition index

Decoding Tips

To decode this quadrant:

1.Determine the luminance values to use for the quadrant by performing a table lookup.
2.Interpret the direction bits and reverse luminance values if angle value is greater than 7.
3.Using the shared chrominance for the block plus the 6 bits of the first luminance, convert the resulting color to the target color space.
4.Using the direction bits as a vector, store the color in the appropriate positions of the quadrant. This can be done with eight output routines that map the luminance values into patterns for the first eight angles. The remaining eight angles are the opposite directions from the first eight, and are covered by reversing the luminance values.
5.Convert the remaining Y values and store in appropriate positions in the quadrant.

Compression attained with this quadrant encoding is 1.25 bits per pixel, assuming normal chrominance mode, including 2 bits chrominance and 2 bits for the block header, representing a 1/4 share of each for a quadrant.

Statistical Pattern/Extended LTC Quadrant

The first bit of the encoding determines whether the data is a statistical pattern or an extended LTC encoding. If the first bit is 0, the data for the quadrant is described as two luminance values Y1 and Y2, and a pattern specifying the distribution of the two luminance values among the pixels in the quadrant. The following figure shows how the encoded data is organized for a statistical quadrant.

    /--------------------------------------------------------\
    |xx 11 xx xx|CHROMINANCE| QUAD 1 | Pattern | 00 Y1 00 Y2 |
    \--------------------------------------------------------/
    Block Header Shared                Pattern  Luminance Values
                 Chrominance

The quadrant is encoded as follows:

16 bits of pattern in raster scan order (MSB = 0)
2 bits undefined (decoder must mask)
6 bits Y1
2 bits undefined (decoder must mask)
6 bits Y2

Decoding Tips

To decode this quadrant:

1.Convert the two luminance values to the output color space using the chrominance for the block or the quadrant, as defined by the current chrominance mode.
2.Output the two colors into pixels in the quadrant as defined by the pattern. The color obtained by converting Y1 is output wherever the corresponding pattern bit is 0, and the color obtained by converting Y2 is output wherever the corresponding pattern bit is 1.

The following figure shows how the encoded data is organized for an Extended LTC quadrant.

    /------------------------------------------------------------------\
    |xx 11 xx xx|CHROMINANCE| QUAD 1 |1| AAA | Y1 | Y2 | 00 Y3 | 00 Y4 |
    \------------------------------------------------------------------/
    Block Header Shared                  Angle    Luminance Values
                 Chrominance

The quadrant is encoded as follows:

1 bit = 1

3 bits angle 0-157.5 degrees ( 000 = 0 degrees, 22.5 degree increments)

6 bits Y1

6 bits Y2

2 bits undefined (decoder must mask)

6 bits Y3

2 bits undefined (decoder must mask)

6 bits Y4

Decoding Tips

To decode this quadrant:

1.Shift the luminance values into the same positions that are obtained by the luminance transition index lookup.
2.Enter the appropriate output routine in the LTC quadrant processing based on the angle specified. (Note that only eight angles are encoded. Because individual Y values are uniquely specified, each angle + 180 degrees is implied by reversing the ordering.)

Format of Homogeneous Quadrant/Shallow Gradient Quadrant

An encoded homogeneous/shallow gradient quadrant is specified by its corresponding two bits in the block header and a luminance value. The following figure shows how the encoded data is organized for a decomposed block whose second quadrant is a homogenous/shallow gradient.

    /--------------------------------------------\
    |xx 01 xx xx|CHROMINANCE| QUAD 1 | ssLL LLLL |
    \--------------------------------------------/
    Block Header Shared                Luminance
                 Chrominance

The quadrant is encoded as follows:

2 bits representing Y delta and angle of direction of increasing luminance (00 indicates constant luminance, and values 01, 10, and 11 specify luminance increasing one level across the quadrant in the specified direction).

2 bits Y delta, Angle of Direction
00 0, N/A
01 1, 45 degrees
10 1, 135 degrees
11 1, 270 degrees

Six bits Y

Decoding Tips

To decode this quadrant:

1.Using the shared chrominance value for the block, use the luminance value Y and convert the YUV color to the target color space.
2.If angle/delta is 0, store the target color in the entire quadrant.
3.If angle/delta is not 0, perform a second color space conversion using Y +1 as the luminance value, and output the two colors with an error diffused density pattern in the direction specified.
4.Increment output pointers to the next quadrant in the block.
5.Move to the next quadrant in the encoded stream.

Compression attained with this quadrant encoding is 2.25 bits per pixel, assuming normal chrominance mode, including 2 bits chrominance and 2 bits for the block header, representing a 1/4 share of each for a quadrant.

Subsampled 4-Luminance Quadrant

An encoded subsampled 4-luminance quadrant is specified by its corresponding two bits in the block header and four luminance values. When decoded to an 8 x 8 block size, this quadrant encoding type results in one color value per 2 x 2 pixel region in the quadrant. The following figure shows how the encoded data is organized for a block whose second quadrant is a Subsampled 4-luminance quadrant.

    /--------------------------------------------------------------------\
    |xx 10 xx xx|CHROMINANCE| QUAD 1 | 1111 1122 | 2222 3333 | 3344 4444 |
    \--------------------------------------------------------------------/
    Block Header Shared                Four Luminance Values
                 Chrominance

The quadrant is encoded as follows:

6 bits Y1

6 bits Y2

6 bits Y3

6 bits Y4

Decoding Tips

To decode this quadrant:

1.Using the shared chrominance value in this quadrant and the first luminance value (Y1), convert the YUV color to the target color space.
2.Store the output color in the corresponding 2 x 2 area of the quadrant.
3.Move output pointers to the next 2 x 2 of the quadrant in the order NW, NE, SW, SE.
4.Repeat the last 3 steps for each luminance in the encoded stream.

Compression attained with this quadrant encoding is 1.75 bits per pixel, assuming normal chrominance mode, including 2 bits chrominance and 2 bits for the block header, representing a 1/4 share of each for a quadrant.

16-Luminance Quadrant

An encoded 16-luminance quadrant is specified by its corresponding two bits in the block header and 16 luminance values. When decoded with an 8 x 8 block size, this quadrant encoding contains one color value per pixel in the quadrant. The following figure shows how the encoded data is organized for a block whose second quadrant is a 16-luminance quadrant.

    /--------------------------------------------------------------------\
    |xx 11 xx xx|CHROMINANCE| QUAD 1 | 1111 1122 | 2222 3333 | 3344 4444 | ....
    \--------------------------------------------------------------------/
    Block Header Shared                16 Luminance Values
                 Chrominance

The quadrant is encoded as follows:

6 bits Y1

6 bits Y2

6 bits Y3

6 bits Y4

           .
           .
           .

6 bits Y16

Decoding Tips

To decode this quadrant:

1.Using the shared chrominance value in this quadrant and the first luminance value (Y1), convert the YUV color to the target color space.
2.Store the output color in the corresponding pixel of the quadrant.
3.Repeat the last two steps for each pixel in the quadrant.

Compression attained with this quadrant encoding is 6.25 bits per pixel, assuming normal chrominance mode, including 2 bits chrominance and 2 bits for the block header, representing a 1/4 share of each for a quadrant.