Vidvox / hap

A codec for fast video playback
BSD 2-Clause "Simplified" License
388 stars 39 forks source link

Decoding of Non Multiple of 4 Resolutions #31

Closed ttoinou closed 6 years ago

ttoinou commented 6 years ago

Hello

I was wondering since DXT are 4x4 pixel blocks based, how does the decoding of non multiple by 4 dimensions happens ? Is the DXT texture (whose dimensions are multiple of 4) decoding into a bitmap with personalized resolution an extra step that takes extra time (compared to having a multiple by 4 resolution right from the beginning) ?{

Thanks !

bangnoise commented 6 years ago

No extra step. This is detailed in the specification, which is referenced from the Hap spec: https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_compression_s3tc.txt

mrvux commented 5 years ago

As a side note, please notice that it's true for OpenGL 2.0+ (which I suppose every player nowadays is supporting), but DirectX requires a multiple of 4 .

So it should still be recommended to have a multiple of 4 from the beginning to enable gpu decoding without extra steps if you play on window.

As a side note codec wise exporter should likely export with multiple of 4 anyway, and maybe add a flag to report that (like many codecs if you try to export 2323 resolution would pad to 2424)