the method for block coding data , such as video data , via a compression operation includes applying to input - data blocks a discrete - cosine - transform operation and a quantization operation to produce compressed - data blocks . the compressed - data blocks are subjected to a coding operation to obtain compressed output flows ; and an inverse - quantization operation and an inverse - discrete - cosine - transform operation are applied on the compressed - data blocks to obtain reconstructed blocks . the method includes controlling generation of mismatch errors from the input - data blocks by detecting data blocks from the input - data blocks and compressed - data blocks that are liable to cause mismatch errors , and modifying the blocks that are liable to cause mismatch errors prior to the coding operation .