According to what I have read:
- DC coefficient per block, we create a byte storing difference magnitude category as shown in Annex F Table F.1 of ITU-T T.81. The actual DC coefficient which stores a difference is stored in raw bits following this huffman coded magnitude category information byte.
Similarly for AC coefficients,
- AC coefficients are first encoded to contain zero-run-lengths. Then, we huffman encode these bytes where upper 4 bits are zero-run-length and lower 4 bits are the AC coefficient magnitude category as shown in Annex F Table F.2 of ITU-T T.81. The huffman encoded byte that contains zero-length and magnitude category data is followed by raw bits that contain the actual AC coefficient magnitude.
My question is fundamentally this, in both cases, why do we store unencoded-uncompressed raw bits for the coefficients but the magnitude category information is huffman encoded? WHY? This makes no sense.