View Single Post
Old 15th February 2003, 16:44   #20  |  Link
MfA
Registered User
 
Join Date: Mar 2002
Posts: 1,075
Quote:
Originally posted by SirDavidGuy
Hmmm.... Don't remember exactly, but the XviD sources have the quant matrices stored as 1 byte, limiting the max quant to 255. This should probably make most values equal to zero, since most things which might be bigger than 510 are in the real upper-left of the DCT-domain array; most other things don't transform back to valid spatial-domain arrays.
Since 0 is not a valid value for a matrix entry we could use it to signify infinity. Since the assembly routines use multiplication to implement the division, division by infinity simply becomes multiplication by 0.

You would simply have to change the set_intra_matrix & set_inter_matrix routines. When an entry is 0 they should change it to 255 for the normal matrix entry and 0 for the fixed matrix entry (also the C version of the quantization routines would have to be updated to use the fixed matrices to implement division rather than use normal division like it does now ... this is a good thing anyway, C and assembly routines should use the same algorithm as much as possible IMO).
MfA is offline   Reply With Quote