Quantization (image processing): Difference between revisions

Content deleted Content added
Line 17:
=== Quantization matrices ===
 
A typical video codec works by breaking the picture into discrete blocks (8×8 pixels in the case of MPEG<ref name="wiseman"/>). These blocks can then be subjected to [[discrete cosine transform]] (DCT) to separate outcalculate the low frequency and high frequency components in, both the horizontalhorizontally and vertical directionvertically.<ref name="wiseman"/> The resulting block (the same size as the original block) is then pre-multiplied by the quantisation scale code and divided element-wise by the quantization matrix, and rounding each entryresultant roundedelement. The coefficientsquantization ofmatrix quantizationis matricesdesigned areto oftenprovide specificallymore designedresolution to keepmore certainperceivable frequency components over less perceivable components (usually lower frequencies over high frequencies) in theaddition sourceto transforming as many components to avoid0, which can be encoded losingwith imagegreatest qualityefficiency. Many video encoders (such as [[DivX]], [[Xvid]], and [[3ivx]]) and compression standards (such as [[MPEG-2]] and [[H.264/AVC]]) allow custom matrices to be used. Alternatively, theThe extent of the reduction may be varied by multiplyingchanging the quantizer matrixscale bycode, ataking scalingup factor,much theless quantizerbandwidth scalethan code,a priorfull toquantizer performing the divisionmatrix.<ref name="wiseman"/>
 
This is an example of DCT coefficient matrix: <!--NOTE: this matrix was generated using random numbers and the other two matricies. It may not actually work well with an iDCT. -->