Quote:
Originally Posted by Procrastinating
So 16bpp output is storing 10-bit data in 16-bit variables? I'm guessing there isn't any redundancy/that x264 also does something similar?
|
The smallest
addressable unit of memory (aka "Byte") is 8-Bit on pretty much any modern computer. So if you store a value
in memory, you need to use at least one byte (8-Bit). Even booleans usually take one byte! But if the data is bigger than one byte, you will need to use
two bytes (16-Bit) to store the value - even if the value is only 10, 12 or 14 bits in size. The "unused" bits will usually be padded with zero's. For values bigger than 16-Bit you'd use 24-Bit or even 32-Bit. And so on...
Surely, one could "pack", for example, 4 values à 10-Bit into 5 consecutive bytes, in order to eliminate that overhead. But then these values won't be addressable directly anymore. You would need to use some bit-operation magic to store/read your values, which usually is too complex and too slow. So, most of the time, you simply accept the overhead of storing a 10-Bit (12-Bit, 14-Bit) value in a 16-Bit variable.