摘要 |
During Motion Picture Experts Group (MPEG) video encoding a two- dimensional discrete cosine transform (DCT) is performed on data representing an original image. The resulting coefficients are then quantized, which typically results in many zero coefficients. Because of the nature of most video data, most higher- order coefficients are typically zero and the lower-order coefficients (i.e., those grouped towards the upper left of the matrix) are more likely to be non-zero. To reduce the lengths of runs among the lower-order coefficients, the coefficients can be encoded in a zig-zag pattern. In one embodiment, the zig-zag pattern is maintained and one or more masks are generated based on the output of the quantization phase. The one or more masks are used to identify the coefficients within the matrix that are non-zero. This reduces the number of accesses to memory required to encode the non-zero coefficients and runs of zero coefficients. |