Slide title 48 pt Texture Compression

Slide subtitle Jacob Ström, Ericsson Research Slide title 32 pt Overview

Text 24 pt › Benefits of texture compression

Bullets level 2-5 › Differences from ordinary image compression 20 pt › Texture compression algorithms – BTC – The mother of all texture compression systems – S3TC – used in desktops/laptops (PCs, Macs) – BC6 BC7 – High bit rate texture compression on desktops/laptops – PACKMAN, ETC – used in Android 2.2

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt is a Bandwidth Hog

Text › For each pixel drawn in the image, eight pixels from the 24 pt texture (texels) are usually read.

Bullets level 2-5 20 pt drawn image

texture levels

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Texturing 32 pt and the bus

Text 24 pt BUS Bullets level 2-5 GPU 20 pt

Memory

Problems: •Bus can get full (performance bottleneck)

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Texture Compression helps Slide title 32 pt

Text 24 pt BUS Texture Bullets level 2-5 20 pt decom- presor Memory GPU

Benefits: • Less traffic on bus = higher performance • Less traffic on bus = lower power consumption

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Power Savings

Text › Especially good for mobile devices 24 pt

Bullets level 2-5 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt good for battery life

Text 24 pt

Bullets level 2-5 20 pt

... unless you want to carry an extra battery.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Benefits of Texture Compression

Text 24 pt › Higher Performance – Bandwidth is usually the factor limiting Bullets level 2-5 performance in rasterization-based graphics 20 pt hardware. – Texture Compression reduces texturing bandwidth with a factor of up to 6 – Spare bandwidth can be used for higher performance, or lower power consumption (mobile case) › Higher Quality! (Yes, really…) – Even a huge video memory gets full. – With a compression ratio of 6, you can increase the resolution one mipmap level and still save memory

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Benefits of Texture Compression

with texture compression, Text 128x128 pix, 8192 bytes 24 pt › Higher Performance – Bandwidth is usually the factor limiting Bullets level 2-5 performance in rasterization-based graphics 20 pt hardware. – Texture Compression reduces texturing bandwidth with a factor of up to 6 – Spare bandwidth can be used for higher performance, or lower power consumption (mobile case) › Higher Quality! (Yes, really…) – Even a huge video memory gets full. – With a compression ratio of 6, you can increase the resolution one mipmap level and still save memory

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Benefits of Texture Compression

with texture compression, Text 128x128 pix, 8192 bytes 24 pt › Higher Performance – Bandwidth is usually the factor limiting Bullets level 2-5 performance in rasterization-based graphics 20 pt hardware. – Texture Compression reduces texturing bandwidth with a factor of up to 6 – Spare bandwidth can be used for higher performance, or lower power consumption (mobile case) › Higher Quality! (Yes, really…) – Even a huge video memory gets full.

– With a compression ratio of 6, you can no texture compression, increase the resolution one mipmap level and downsampled to 64x64, still save memory 12288 bytes

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Benefits of Texture Compression

with texture compression, Text 128x128 pix, 8192 bytes 24 pt

Bullets level 2-5 20 pt

no texture compression, downsampled to 64x64, 12288 bytes

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Caches Slide title 32 pt

Text 24 pt BUS Texture Bullets level 2-5 20 pt $ decom- presor Memory GPU

If the on-chip cache stores compressed data: • More blocks can fit in cache = better hit rate • Mobile case: a smaller cache (less silicon) can hold the same number of blocks

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › First a short recap on how JPEG compresses images 24 pt

Bullets level 2-5 20 pt

JPEG bits image

Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › First a short recap on how JPEG compresses images 24 pt – The image is first divided into 8x8 blocks.

Bullets level 2-5 20 pt

JPEG bits image

Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › First a short recap on how JPEG compresses images 24 pt – The image is first divided into 8x8 blocks.

Bullets level 2-5 20 pt

JPEG bits image

Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › First a short recap on how JPEG compresses images 24 pt – The image is first divided into 8x8 blocks.

Bullets level 2-5 – Each block is then encoded and put into the file 20 pt

JPEG bits image

Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › First a short recap on how JPEG compresses images 24 pt – The image is first divided into 8x8 blocks.

Bullets level 2-5 – Each block is then encoded and put into the file 20 pt

JPEG bits image

Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Most image compression algorithms, such as JPEG, uses 24 pt variable bit length coding (VLC). Bullets level 2-5 › A block that is hard to code is allowed to occupy more bits 20 pt than a block that is, for instance, just black.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Most image compression algorithms, such as JPEG, uses 24 pt variable bit length coding (VLC). Bullets level 2-5 › A block that is hard to code is allowed to occupy more bits 20 pt than a block that is, for instance, just black.

JPEG bits image Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Most image compression algorithms, such as JPEG, uses 24 pt variable bit length coding (VLC). Bullets level 2-5 › A block that is hard to code is allowed to occupy more bits 20 pt than a block that is, for instance, just black.

simple area few bits

JPEG bits image Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Most image compression algorithms, such as JPEG, uses 24 pt variable bit length coding (VLC). Bullets level 2-5 › A block that is hard to code is allowed to occupy more bits 20 pt than a block that is, for instance, just black.

simple area few bits

complex area many bits

JPEG bits image Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › However, variable bit rate also means that you cannot 24 pt calculate the address for a pixel in the JPEG bits. Bullets level 2-5 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › However, variable bit rate also means that you cannot 24 pt calculate the address for a pixel in the JPEG bits. Bullets level 2-5 20 pt

? ? ? JPEG bits Do not add image objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › However, variable bit rate also means that you cannot 24 pt calculate the address for a pixel in the JPEG bits. Bullets level 2-5 › In order to know the address for a particular pixel, you have 20 pt to parse the entire file.

? ? ? JPEG bits Do not add image objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › However, variable bit rate also means that you cannot 24 pt calculate the address for a pixel in the JPEG bits. Bullets level 2-5 › In order to know the address for a particular pixel, you have 20 pt to parse the entire file. › During rendering, you would have to parse the entire file for every texel! Not feasible.

? ? ? JPEG bits Do not add image objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

› Therefore, most texture compression coders are fixed rate coders, Text 24 pt which means that each block in the image occupies the same number of bits, for instance 64 bits per 4x4 block. Bullets level 2-5 20 pt › In this way, it is simple to calculate the address for a particular block in the compressed texture bit stream.

? ? ? JPEG bits Do not add image objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

› Therefore, most texture compression coders are fixed rate coders, Text 24 pt which means that each block in the image occupies the same number of bits, for instance 64 bits per 4x4 block. Bullets level 2-5 20 pt › In this way, it is simple to calculate the address for a particular block in the compressed texture bit stream.

JPEG bits Do not add image objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Note, that there is only one rate that will guarantee error 24 pt free coding, and that is to have no compression at all! Bullets level 2-5 › Thus, for fixed rate coding, one has to allow error 20 pt (distortion) in the image. The goal is to make this error as small as possible.

~

original compressed and decompressed Do not add objects or text in left image courtesy of Henrik Wann Jensen the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Decompression should be of low complexity. 24 pt › Up to eight texels must be decompressed for each pixel. Bullets level 2-5 20 pt › If we are unlucky, all eight texels can be in different blocks.

drawn image

texture mipmap levels

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Difference to Image Compression 32 pt why not just use JPEG?

Text › Decompression should be of low complexity. 24 pt › Up to eight texels must be decompressed for each pixel. Bullets level 2-5 20 pt › If we are unlucky, all eight texels can be in different blocks.

› This means that we have to have texture mipmap levels eight parallel block decompressors on the chip to deliver one filtered pixel per clock.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Differences to Image Compression 32 pt Summary

Text 1. Random access is needed – a fixed rate coder makes 24 pt this possible. Bullets level 2-5 2. Several parallel units needed – low hardware 20 pt decompression complexity necessary. (Long compression times OK though!) 3. Indirect addressing due to use of palettes or other global, texture depending data should be avoided.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 48 pt Texture Compression Formats

Slide subtitle Slide title 48 pt Block Truncation Coding

Slide subtitle Predecessor to texture compression techniques Slide title 32 pt BTC – Block Truncation Coding

Text › Image is divided into 4x4 blocks 24 pt › Two 8-bit gray shades are encoded per block Bullets level 2-5 20 pt

col 0 col 1

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BTC – Block Truncation Coding

Text › Image is divided into 4x4 blocks 24 pt › Two 8-bit gray shades are encoded per block Bullets level 2-5 20 pt › A bit mask of 16 bits is also used.

col 0 0 0 0 0 col 1 0 0 0 0 1 1 0 1 1 1 1 1

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BTC – Block Truncation Coding

Text › Image is divided into 4x4 blocks 24 pt › Two 8-bit gray shades are encoded per block Bullets level 2-5 20 pt › A bit mask of 16 bits is also used.

col 0 0 0 0 0 col 1 0 0 0 0 1 1 0 1 1 1 1 1

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BTC – Block Truncation Coding

Text › Image is divided into 4x4 blocks 24 pt › Two 8-bit gray shades are encoded per block Bullets level 2-5 20 pt › A bit mask of 16 bits is also used.

col 0 0 0 0 0 col 1 0 0 0 0 1 1 0 1 1 1 1 1

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date BTC – Block Truncation Coding Slide title 32 pt

Text › Bit rate equals 8+8+16 = 32 bits per block, i.e., 2 bits per 24 pt pixel (bpp). Bullets level 2-5 › Everything is contained in the codeword, no “global data” or 20 pt color palette needs to be read.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title BTC – Block Truncation Coding 32 pt Compression

Text › To compress a block, you need to find a pair of base 24 pt colors and the bitmask. Bullets level 2-5 20 pt › If you have the base colors, it is simple to get the bitmask: Just try each pixel and see which color is best. › Since there are only 256*256 such pairs, you can try all pairs.

0 0 0 0 0 0 0 0 col 0 + col 1 1 1 0 1 1 1 1 1 Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title BTC – Block Truncation Coding 32 pt Quality

Text › However, having only two shades of gray gives rise to 24 pt banding artifacts. Bullets level 2-5 20 pt

original BTC

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title BTC – Block Truncation Coding 32 pt Quality

Text 24 pt

Bullets level 2-5 20 pt

original BTC

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 48 pt S3TC

Slide subtitle Used on PCs (Windows, Mac) Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt

col 0

col 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt › Two more colors are interpolated between the stored ones.

col 0 col 1 col 2 col 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt › Two more colors are interpolated between the stored ones.

col 0 col 1 = 2/3 * ( col 0 ) + 1/3 * ( col 3 ) col 2 = 1/3 * ( col 0 ) + 2/3 * ( col 3 ) col 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt › Two more colors are interpolated between the stored ones. › Bit mask must now be 2 bits per pixel.

col 0 col 1 col 2 col 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt › Two more colors are interpolated between the stored ones. › Bit mask must now be 2 bits per pixel.

col 0 00 10 11 11 col 1 01 11 11 11 col 2 10 11 11 11 11 11 11 11 col 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt › Two more colors are interpolated between the stored ones. › Bit mask must now be 2 bits per pixel.

col 0 00 10 11 11 0 2 3 3 col 1 01 11 11 11 1 3 3 3 col 2 10 11 11 11 2 3 3 3 11 11 11 11 col 3 3 3 3 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt also called DXT1

Text › S3TC can be seen as an extension of BTC. 24 pt › Instead of two gray scales, two colors are stored per block Bullets level 2-5 in RGB565. 20 pt › Two more colors are interpolated between the stored ones. › Bit mask must now be 2 bits per pixel.

col 0 00 10 11 11 0 2 3 3 col 1 01 11 11 11 1 3 3 3 col 2 10 11 11 11 2 3 3 3 11 11 11 11 col 3 3 3 3 3

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt quality

Text › In this way, four colors per 4x4 block can be used instead 24 pt of two gray scales – quality increases tremendously. Bullets level 2-5 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt quality

Text › In this way, four colors per 4x4 block can be used instead 24 pt of two gray scales – quality increases tremendously. Bullets level 2-5 20 pt

original S3TC

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt quality

Text › In this way, four colors per 4x4 block can be used instead 24 pt of two gray scales – quality increases tremendously. Bullets level 2-5 › S3TC was adopted by Direct 3D under the name DXT1 and 20 pt is now the industry standard in the desktop space.

original S3TC

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title S3TC – S3 Texture Compression 32 pt quality

Text › In this way, four colors per 4x4 block can be used instead 24 pt of two gray scales – very decent quality! Bullets level 2-5 › S3TC was adopted by Direct 3D under the name DXT1 and 20 pt is now the industry standard in the desktop space.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt S3TC – S3 Texture Compression

Text › The two base colors are stored in RGB565 (16 bits). 24 pt Together with the 32 bits of pixel bits we get 64 bits per Bullets level 2-5 block, or 4 bpp. Compression ratio is thus 6:1. 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt S3TC – S3 Texture Compression

Text › The two base colors are stored in RGB565 (16 bits). 24 pt Together with the 32 bits of pixel bits we get 64 bits per Bullets level 2-5 block, or 4 bpp. Compression ratio is thus 6:1. 20 pt › Decompression includes multiplication of 1/3 and 2/3.

col 0 col1 1 pixel bits 2 bits

multiplexor which pixel 4 bits 2 bits blend blend

multiplexor Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt S3TC – S3 Texture Compression

Text › Due to the way the intermediate colors are interpolated, 24 pt the four colors of the block will lie on a straight line in Bullets level 2-5 RGB space. 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt S3TC – S3 Texture Compression

Text › Due to the way the intermediate colors are interpolated, 24 pt the four colors of the block will lie on a straight line in Bullets level 2-5 RGB space. 20 pt

G

R Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt S3TC – S3 Texture Compression

Text › Due to the way the intermediate colors are interpolated, 24 pt the four colors of the block will lie on a straight line in Bullets level 2-5 RGB space. 20 pt › For many natural images, this is a rather good approximation.

G

R Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt RGBA TEXTURES

Text › The S3TC/DXT1 method only encodes RGB textures using 24 pt 64 bits per 4x4 block. Bullets level 2-5 › For RGBA textures, the alpha channel is encoded 20 pt separately using another 64 bits in a similar manner.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt RGBA TEXTURES

Text › The S3TC/DXT1 method only encodes RGB textures using 24 pt 64 bits per 4x4 block. Bullets level 2-5 › For RGBA textures, the alpha channel is encoded 20 pt separately using another 64 bits in a similar manner. › Two gray colors are stored using 8 bit per gray level. › Six more are interpolated in between. col 0

Do not add col 7 objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt RGBA TEXTURES

Text › The S3TC/DXT1 method only encodes RGB textures using 24 pt 64 bits per 4x4 block. Bullets level 2-5 › For RGBA textures, the alpha channel is encoded 20 pt separately using another 64 bits in a similar manner. › Two gray color are stored using 8 bit per gray level. › Six more are interpolated in between. col 0 000 000 001 011 0 0 1 3 010 011 011 100 2 3 3 4 011 100 101 110 3 4 5 6 100 101 110 111 4 5 6 7

Do not add col 7 objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt RGBA TEXTURES

Text › In DirectX, RGBA textures are stored by interleaving 64 bits 24 pt of RGB data with 64 bits of alpha-data. Bullets level 2-5 › This format is called DXT5. 20 pt

64 bits 64 bits 64 bits 64 bits 64 bits 64 bits

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 48 pt BC7 and BC6h

Slide subtitle High bit rate texture compression for PCs

In OpenGL 4.2 they are called BPTC Slide title 32 pt BC7

Text › In DXT5, 128 bits are spent per 4x4 pixels: 8 bits per pixel. 24 pt › This is unevenly distributed per channel: 4 bpp for RGB Bullets level 2-5 (compression rate 6:1) and 4 bpp for alpha (compression 20 pt rate only 2:1) › In BC7, 8 modes makes it possible to change this balance: – Mode 4: 50% of bits RGB, 50% alpha (similar to DXT5) – Mode 5: 60% of bits RGB, 40% alpha (better color quality) › Sometimes alpha and color are correlated – Mode 6: 16 interpolated RGBA colors to choose from

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BC7

Text › Some blocks in the texture have no alpha, then 100% of 24 pt the bits can be used for RGB! Bullets level 2-5 › Instead of having just 1 interpolated color sequence, up to 20 pt 3 are possible in BC7:

col 0 col 4 col 8

col 3 col 7 col 11

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BC7

Text › Some blocks in the texture have no alpha, then 100% of 24 pt the bits can be used for RGB! Bullets level 2-5 › Instead of having just 1 interpolated color sequence, up to 20 pt 3 are possible in BC7:

col 0 col 4 col 8 col 1 col 5 col 9 col 2 col 6 col 10 col 3 col 7 col 11

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BC7

Text › Some blocks in the texture have no alpha, then 100% of 24 pt the bits can be used for RGB! Bullets level 2-5 › Instead of having just 1 interpolated color sequence, up to 20 pt 3 are possible in BC7:

col 0 col 4 col 8 col 1 col 5 col 9 col 2 col 6 col 10 col 3 col 7 col 11

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BC7

Text › We need some way of telling from which color subset the 24 pt pixel should fetch its color. Bullets level 2-5 20 pt

col 0 col 4 col 8 col 1 col 5 col 9 col 2 col 6 col 10 col 3 col 7 col 11

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BC7

Text › We need some way of telling from which color subset the 24 pt pixel should fetch its color. Bullets level 2-5 › There are 3^16 = 43 046 721 possible block partitionings, 20 pt which would require 25 bits to describe (2^25 > 3^16) › BC7 chooses the 64 most common and selects from those using 6 bits.

col 0 col 4 col 8 col 1 col 5 col 9 col 2 col 6 col 10 col 3 col 7 col 11

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt 64 most common patterns

Text 24 pt

Bullets level 2-5 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Patterns

Text › The different modes have different number of color 24 pt subsets: Bullets level 2-5 – Mode 0: 3 color subsets, 16 patterns 20 pt – Mode 1: 2 color subsets, 64 patterns – Mode 2: 3 color subsets, 64 patterns – Mode 3: 2 color subsets, 64 patterns – Mode 4-7 color + alpha › Mode can be selected per block

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt BC6H

Text › BC7 is a RGBA8888 format, but with 128 bits per pixel it is 24 pt possible to also compress high dynamic range data (HDR) Bullets level 2-5 › BC6H decompresses to 16-bit floats (halfs) using the same 20 pt principles as BC7: – One or two color sequences – 32 patterns to tell which color sequence to be used – Only RGB (no alpha).

col 0 col 4 col 1 col 5 col 2 col 6 col 3 col 7 Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 48 pt PACKMAN

Slide subtitle Predecessor to Ericsson texture compression (ETC), which is used in android 2.2 Slide title 32 pt Basic Idea PACKMAN

Text › The model that colors are along a line in RGB space has 24 pt worked well for S3TC. Bullets level 2-5 › Maybe we can pre-specify a specific direction in RGB 20 pt space and thus save one color? › The most common direction should be (1,1,1), that is, going from dark to bright.

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Basic Idea PACKMAN

Text › The model that colors are along a line in RGB space has 24 pt worked well for S3TC. Bullets level 2-5 › Maybe we can pre-specify a specific direction in RGB 20 pt space and thus save one color? › The most common direction should be (1,1,1), that is, going from dark to bright.

G direction (1,1,1)

R Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Basic Idea PACKMAN

Text › In addition, the Human Visual System is more sensitive to 24 pt luminance (grey scale) than to chrominance (color) Bullets level 2-5 › In video and still image coding, chrominance information is 20 pt most often subsampled in the x- and y- direction (MPEG, JPEG, H263, H264 etc). Loosely speaking, chrominance is defined per 2x2 block. › PACKMAN has basically only one color per 2x4 block. The rest is luminance information › Code each 2x4 block using 32 bits

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Basic Idea PACKMAN

Text 24 pt › Use only 12 bits to specify a “base color” for a 2x4 block

Bullets level 2-5 20 pt

12-bit “base Do not add color” objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Basic Idea PACKMAN

Text 24 pt › Use only 12 bits to specify a “base color” for a 2x4 block

Bullets level 2-5 › Modify the luminance for each pixel in the block 20 pt

+

12-bit “base per-pixel Do not add color” luminance objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Basic Idea PACKMAN

Text 24 pt › Use only 12 bits to specify a “base color” for a 2x4 block

Bullets level 2-5 › Modify the luminance for each pixel in the block 20 pt

+ =

12-bit “base per-pixel resulting image Do not add color” luminance objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date ETC

Slide title 48 pt Ericsson Texture Compression (Used in Android 2.2)

Slide subtitle Slide title 32 pt PACKMAN Flaws

Text › PACKMAN was of very low complexity, but 24 pt – 2 dB worse than S3TC/DXT1 in terms of Peak Signal to Noise

Bullets level 2-5 Ratio (PSNR) 20 pt – Suffered from chrominance banding / block artifacts due to low color resolution (RGB444)

Do not add objects or text in original PACKMAN the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt PACKMAN Flaws

Text › PACKMAN was of very low complexity, but 24 pt – 2 dB worse than S3TC/DXT1 in terms of Peak Signal to Noise

Bullets level 2-5 Ratio (PSNR) 20 pt – Suffered from chrominance banding / block artifacts due to low color resolution (RGB444)

Do not add objects or text in original PACKMAN the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Enhancing the Chrominance 32 pt …would increasing the block size help?

Text 24 pt › By coding 4x4 blocks instead of 2x4 blocks, spatial Bullets level 2-5 redundancy could be better exploited. 20 pt

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Neighboring Base Colors 32 pt Quite Similar

Text 24 pt

Bullets level 2-5 20 pt

max(|R1-R2|, |G1-G2|, |B1-B2|) (in RGB555) 88% within interval [-4, 3]

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block Text › Instead of coding the left block with 24 pt RGB444… Bullets level 2-5 20 pt

left block R G B table

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › Instead of coding the left block with 24 pt RGB444… and the right with RGB444… Bullets level 2-5 20 pt

left block right block R G B table R G B table

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › Instead of coding the left block with 24 pt RGB444… and the right with RGB444… Bullets level 2-5 › We code the left with RGB555… 20 pt

left block right block R G B table R G B table

R G B table bits

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › Instead of coding the left block with 24 pt RGB444… and the right with RGB444… Bullets level 2-5 › We code the left with RGB555… and the right 20 pt with dR dG dB 333.

left block right block R G B table R G B table

R dR G dG B dB table bits

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › However, in 10% of the cases, the left and 24 pt right blocks will differ too much in color for Bullets level 2-5 differential coding. 20 pt

R dR G dG B dB table bits

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › However, in 10% of the cases, the left and 24 pt right blocks will differ too much in color for Bullets level 2-5 differential coding. 20 pt

R dR G dG B dB table bits

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › However, in 10% of the cases, the left and 24 pt right blocks will differ too much in color for Bullets level 2-5 20 pt differential coding. › For these blocks, we fall black to individual coding.

R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › However, in 10% of the cases, the left and 24 pt right blocks will differ too much in color for Bullets level 2-5 20 pt differential coding. › For these blocks, we fall black to individual coding. › We thus need an extra bit to signal if we are in differential mode or not.

555differential or 444

R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding left block right block Text › However, in 10% of the cases, the left and 24 pt right blocks will differ too much in color for Bullets level 2-5 20 pt differential coding. › For these blocks, we fall black to individual coding. › We thus need an extra bit to signal if we are in differential mode or not. › We must take that bit from somewhere.

555differential or 444

R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding -8 -2 2 8 -12 -4 4 12 -16 -4 4 16 Text › By shrinking the codebook from 16 entries 24 pt -24 -8 8 24 to 8, we can save one bit on each of the -31 -6 6 31 Bullets level 2-5 table code words. -34 -12 12 34 20 pt -47 -19 19 47 › The Codebook contains the base color -50 -8 8 50 modifier values. -62 -12 12 62 -68 -24 24 68 –One “code” is chosen for the block, then each -80 -28 28 80 pixel choses one of the 4 values -94 -38 38 94 -100 -16 16 100 -127 -42 42 127 -160 -56 56 160 -254 -84 84 254

R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding -8 -2 2 8 -17 -5 5 17 -29 -9 9 29 Text › By shrinking the codebook from 16 entries 24 pt -42 -13 13 42 to 8, we can save one bit on each of the -60 -18 18 60 Bullets level 2-5 table code words. -80 -24 24 80 20 pt -106 -33 33 106 -183 -47 47 183

R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding -8 -2 2 8 -17 -5 5 17 -29 -9 9 29 Text › By shrinking the codebook from 16 entries 24 pt -42 -13 13 42 to 8, we can save one bit on each of the -60 -18 18 60 Bullets level 2-5 table code words. -80 -24 24 80 20 pt -106 -33 33 106 -183 -47 47 183

R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding -8 -2 2 8 -17 -5 5 17 -29 -9 9 29 Text › By shrinking the codebook from 16 entries 24 pt -42 -13 13 42 to 8, we can save one bit on each of the -60 -18 18 60 Bullets level 2-5 table code words. -80 -24 24 80 20 pt -106 -33 33 106 › That creates room for an extra bit. -183 -47 47 183

flipped or non flipped R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt Differential Encoding

Text › By shrinking the codebook from 16 entries 24 pt to 8, we can save one bit on each of the Bullets level 2-5 20 pt table code words. › That creates room for an extra bit. › The new bit determines if the 2x4 blocks are vertically or horizontally oriented.

flipped or non flipped R dR G dG B dB table bits

Do not add objects or text in R R G G B B table bits the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Results “improved PACKMAN” 32 pt or Ericsson Texture Compression (ETC)

Text › Much less chrominance banding 24 pt › Jumps 2.5 dB in PSNR overall Bullets level 2-5 20 pt

Do not add PACKMAN ETC objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt ETC2

Text › An updated version of ETC was presented: 24 pt –J. Ström and M. Pettersson ”ETC2: Texture Compression Using Invalid Combinations”, Graphics Hardware 2007 Bullets level 2-5 20 pt › It is backwards compatible to ETC and brings a 1.0 dB increase in quality compared to ETC. (0.8 dB compared to S3TC/DXTC) › It fixes mostly blocks that ETC has problems with

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Results ETC1 32 pt T-mode original S3TC/DXTC ETC1 ETC2 H-mode Planar

Text 24 pt

Bullets level 2-5 20 pt

Do not add objects or text in original S3TC/DXTC ETC 1 ETC2 the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title Results ETC1 32 pt cont. T-mode original S3TC/DXTC ETC1 ETC2 H-mode Planar

Text 24 pt

Bullets level 2-5 20 pt

Do not add objects or text in original S3TC/DXTC ETC1 ETC2 the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date Slide title 32 pt summary

Text 24 pt › When creating a texture compression system, remember Bullets level 2-5 20 pt – Random access is needed – Low hardware decompression complexity – Avoid indirect addressing › Texture Compression benefits – Lower memory bandwidth = higher performance – Lower memory bandwidth = lower power consumption – Smaller memory footprint = more hires textures possible – Smaller memory footprint = more blocks fit in cache

Do not add objects or text in the footer area © Ericsson AB 2009 | Ericsson Internal | X (X) | Date