onducted for content in the current frame using a shifted block from the previous frame. When the point of lowest error has been found, the x and y offsets represent the motion vectors for the particular block. With reference to Figure 3.12 for the Mean Squared Error (MSE), this can be formalized (3.3) m=1n=1 Chapter 3 Digital Video Transmission N + 2w (N X N) block (m, n) in current frame N + 2w (m + i, n+ j) Search window in previous frame (Nx N) block under search in previous Fig. 3.12 Block search estimation. frame, shifted by i, j In other words, search up, down, left, and right by the width of the search block. The point with the lowest error is the best match. Motion Compensation When the motion has been determined for each individual block, it can be used to make a prediction of the next picture. Not all macroblocks within a picture will use motion com- pensation. A decision is made as to whether the prediction significantly lowers the error between a pair of frames. If it does, then motion compensation will be used; otherwise, DCT coding will be used. Note that this can be coded with respect to the current frame (intra) and with respect to the previous frame (inter). The motion vectors are coded and sent as side information (ITU-T, 1998). Statistical Redundancy Having exploited the spatial and temporal redundancy contained in the image, there are still further economies to be had in the redundancy contained inside the stream of data generated from the coding process. The transform coefficients and the motion vectors are subjected to a type of coding that assigns short codewords to frequently occurring values and long codewords to infrequent one. The earliest example of this was Morse code. There- fore, for a data source the minimum average number of bits required per codeword or the entropy H(x) can be calculated as H(x)=->pilog2pi (3.4) Assigning different-length codewords to data is known as Variable-Length Coding (VLC). There are two types of VLC used in video: Huffman coding and arithmetic coding. Sp