摘要 |
An encoding method comprises: obtaining blocks Bk of quantized coefficients corresponding to blocks of a first image; obtaining alphabets Ai of values, each defining the possible values am of an associated quantized coefficient; associating 2110 a respective flag (fMB: Figure 23) with each block of quantized coefficients, specifying a magnitude, for example a maximum magnitude n of the quantized coefficient values in the respective block; restricting 2120 alphabets corresponding to the quantized coefficients of each block, based on the magnitude specified in the flag associated with that block; generating binary entropy codes for the possible values of each restricted alphabet, and encoding the quantized coefficients using the generated binary codes. Thus, the mean length of binary entropy codes is reduced, improving compression efficiency. Flags may be selected from a set of flags, restricted from a larger flag set, with each flag having an associated occurrence probability, which may be used to entropy-encode the flag. Flag occurrence probability may be based on the probability that a quantized coefficient block has a maximum magnitude equal to the flag magnitude. |