Method and device for the search for a prediction block in predictive video compression

Abstract: The invention relates to a method and a device for the search for a prediction block in predictive video compression. In the method, a desired search area is searched for an image block resembling an image block (B) to be encoded as closely as possible for use as a prediction block for said image block. In order that the best possible prediction block could be located with considerably less calculation than previously, (a) image blocks (A) acting as prediction block candidates within the search area are classified by deriving an identifier (CA) from each image block (A) acting as a prediction block candidate, the identifier describing the image content of the concerned image block, and storing the location of the image block acting as a prediction block candidate in a memory (21) at an address determined by said identifier, whereby the storing takes place such that at least one location data item remains in the memory for each identifier; (b) an identifier (CB) is similarly derived from each image block (B) to be encoded, the identifier describing the image content of said block; and (c) the location of the prediction block for the block (B) to be encoded is fetched from said memory (21) from a memory position determined by the identifier (CB) describing the image content of the block.

Description: The invention relates to a method and a device for the search for a prediction block in connection with predictive video compression, wherein a desired search area is searched for a prediction block resembling as closely as possible to an image block to be encoded. Video compression aims at reducing the number of bits required in the transmission and/or storing of a digitized image. Predictive video compression utilizes a prediction value derived e.g. from previously transmitted image material, and only the difference between the prediction value and an actual value is encoded. Predictive video compression methods presently in use divide the image to be encoded into image blocks each comprising n x m, typically 8 x 8 pixels having the following positions: Previously transmitted images (or fields) are searched for a prediction value for each image block to be transmitted, i.e. a block resembling the image block to be transmitted as closely as possible. In motion-compensation methods, it is assumed that an object in the image moves in a certain direction, whereby the prediction block can be found in the preceding transmitted image in the immediate vicinity of the location of the block to be encoded in the direction of movement. The above-described prior art method is illustrated in Figure 1, where an image block to be encoded (transmitted) in a new image B1 is indicated with the reference B, and a prediction block candidate in an old image A1 is indicated with the reference A. In a so-called full-search motion compensation method the displacement in the old image A1 to the new prediction block candidate A takes place pixel by pixel within the search area, and e.g. a quantity ε is calculated for each pixel position: ε = i,j n,m |pa i,j -pb i,j | , where pa i,j is the intensity value of the pixel of block A, pb i,j is the intensity value of the pixel of block B, and the vertical lines stand for the absolute value of the difference between the intensity values. As used herein, the intensity value means either a grey intensity value or a colour intensity value (even though in practice the search for the prediction block in the motion compensation method, for instance, is performed entirely on the basis of the monochrome image, i.e. the grey intensity value). Block A producing the smallest value of ε is accepted as the prediction block. The greatest allowable value of ε determines the magnitude of the matching error. In place of the sum of the absolute values of the differences between the intensity values, it is possible to calculate e.g. the sum of squared differences. One variation of this basic approach is described in vector quantization term in IEEE International Symposium on Circuits and Systems, Vol. 2 of 4, 1 May 1990, IEEE, New York, US, pages 1003 to 1006, H. Sun et al: "Motion-compensated vector quantization with a dynamic codebook". In this case each image input block is considered as a vector. A dynamic code-book whose codewords consist of the vectors (image blocks) from an area of the previous frame is generated. This codebook establishes the search window. An input vector is compared to the codewords and if the difference between the input vector and the best-matched codeword is smaller than the preset threshold then the index or label of the codeword is transmitted. If no satisfactory codeword is found then the current image block position is encoded as by transform coding the difference between the blocks of consecutive frames. The codebook is considered dynamic as its contents are derived from a moving area from the previous frame. However, according to the method described by Sun et al. prediction blocks are not searched. Instead, found codewords (image blocks) are used as such for the decoded image. The biggest disadvantage of the above-described prior art method is that the search for the prediction block requires plenty of calculation. For this reason, a number of versions have been developed where the direction of decreasing matching error is determined, and the search for the prediction block is performed in this direction. Although these methods require less calculation, they do not necessarily give the best possible end result, but in many cases merely a local minimum is found. This is due to the fact that images mostly do not behave in such a way that the best possible prediction block (the smallest possible matching error) could be found in the selected direction of search. Full search thus always gives the best possible end result but requires a very high calculation capacity, whereas the best possible prediction block is not usually found by the above-mentioned searching methods. This fact is recognized in SPIE - Image Processing Algorithms and Techniques, Vol. 1244, February 1990, Bellingham, US, pages 355 to 366, M. Gilge: "Motion estimation by scene adaptive block matching (SABM) and illumination correction". Gilge proposes that an optimum selection of search positions can be obtained by codebook design algorithm. In fast search methods not all possible search positions are checked. Instead, a smaller number of empirically more probable positions are used. Gilge discloses methods for partitioning the search window into smaller fragments with uneven distribution of search positions. It is further proposed that the codebook containing these search positions could be adaptively updated if the coder would also test some new search positions outside the codebook. Apparently, the methods described by Gilge do not totally dispense with the burden of comparing large numbers of image blocks against each other. The object of the present invention is to dispense with the above disadvantages and to provide a method and a device by means of which the best possible prediction block can be found with considerably less calculation than previously. According to the invention, this object is achieved by a method for the search for a prediction block in connection with predictive video compression, wherein a desired search area is searched for a prediction block resembling as closely as possible to an image block to be encoded, whereby: image blocks acting as prediction block candidates within the search area are subjected to classification by deriving an identifier from each image block acting as a prediction block candidate, the identifier describing the image content of the concerned image block and each class being represented by its own identifier; the location of each image block acting as a prediction block candidate is stored in a memory at an address determined by said identifier, whereby the storing takes place such that at least one location data item remains in the memory for each identifier; the image block to be encoded is also subjected to said classification by deriving an identifier from said image block to be encoded, the identifier describing the image content of said image block to be encoded; and the location of the prediction block for the image block to be encoded is fetched from said memory from a memory position determined by the identifier describing the image content of the image block to be encoded. Further, according to the invention, the above object is achieved by a device for the search for a prediction block in predictive video compression, wherein a desired search area is searched for a prediction block resembling as closely as possible to an image block to be encoded, comprising: memory means for storing the location of each image block acting as a prediction block candidate, and a processing unit for classifying each image block acting as prediction block candidate and the image block to be encoded, each class being represented by its own identifier, thereby deriving from each image block acting as prediction block candidate an identifier being a write address for writing into said memory means and from said image block to be encoded an identifier being a read address for reading from said memory means. The invention is based on the idea that (a) each prediction block candidate within the search area is subjected to unequivocal classification based on the image content of the blocks, and the location of the image block belonging to each class is stored as representing the class, and (b) the image content of the image block to be encoded is subjected to a similar classification, whereby the obtained classification allows the location of the prediction block to be fetched immediately from the memory, which location is the stored location of the image block belonging to the class. According to a preferred embodiment of the invention an identifier describing the class is derived by subsampling and truncation. In this case, no calculation is required in the search for the prediction block. In the following the invention and its preferred embodiments will be described more fully by way of example referring to Figure 2 of the attached drawings, in which drawings Figure 1 illustrates a prior art method for the search of a prediction block; and Figure 2 illustrates a device realizing the method according to the invention. Figure 2 illustrates the principle of a device realizing the method according to the invention. The device comprises a RAM memory 21, and a processing unit such as a filter 22 deriving an identifier according to the invention from the image content of an image block and having an output connected to an address input ADDR in the memory 21. The device further comprises a selector, such as a switch S, which selects the image block to be applied to the input of the processing unit (a prediction block candidate A or a block B to be encoded). In the method according to the invention the displacement to the new prediction block candidate A takes place pixel by pixel, and the displacement operation is preferably performed over the entire image in the same way as in the prior art search methods (the image here also refers to the field in the case of an interlaced video signal). According to the invention the location of each block is stored in the memory 21 at an address derived from the image content of block A in a processing step performed by the processing unit 22. In the figure this address is indicated with the reference CA. The next location data item to be stored at the same address is written over the preceding location data item, so there is only one location data item at a time at the same address (i.e. in each class). The output of the processing unit 22 thus gives the write address at which the location of the concerned image block is stored. Typically the processing step is e.g. filtering or subsampling. The location of the prediction block of block B to be encoded is then obtained immediately from the memory 21 by subjecting image block B to the same processing step (with the switch S in the position "B") and by feeding the image content of the block to be encoded, after the above-mentioned processing, as the read address of the memory 21. In the figure this read address is indicated with the reference CB. According to the invention, image information is thus first classified on the basis of the image content in a processing step covering the entire search area (each class being represented by its own identifier CA). The prediction block of each image block to be encoded is then obtained as simply and rapidly as possible by fetching the address of the image block representing the class of the image block to be encoded from the memory. Location data to be stored in the memory 21 may be encoded in vector form in the same way as in the prior art methods. Location data obtained from the memory may be absolute, but it may also be converted into relative form so as to make it more suitable for further compression. The processing step, such as filtering, determines the maximum matching error. The processing may also be performed in several stages, whereby the search is repeated with a greater matching error if the processing stage with a smaller matching error (such as filtering) did not produce a desired result. As mentioned above, the processing step performed to derive the identifier CA or CB describing the image content of the image block selected as a prediction block candidate and that of the image block to be encoded, respectively, may consist of several possible ways of processing. An essential feature of the processing and the processing unit performing it is that the identifier derived from the image content of the image block classifies the concerned image block unequivocally into a certain class within which the image blocks differ only slightly from each other and which thus represents a larger number of nearly similar blocks. In place of filtering the processing may consist e.g. of a combination of subsampling and truncation (subsampling means that some of the samples are disregarded, while truncation means that the number of bits used per one pixel is reduced). In the method according to the invention considerably less calculation is required than previously as the pixel-by-pixel displacement to the new prediction block candidate A is performed only once on the entire search area, e.g. on an image, instead of repeating it with each block to be encoded as in the prior art methods. Moreover, if the processing step consists e.g. of subsampling and truncation, the method according to the invention requires no calculation. In the method according to the invention the search for the prediction block can be conducted easily over the entire area of the image or field instead of searching e.g. only the immediate vicinity of the block to be encoded. Also, the search for the prediction block may equally well be performed over an arbitrary previous field or image. The search area may thus be very large, which ensures that the end result will be the best possible with the highest possible probability. The prediction block may also be compiled from sub-blocks derived from different locations. The image block is thereby divided into smaller sub-blocks; for instance, an image block having 8 x 8 pixels is divided into four blocks having 4 x 4 pixels, and a prediction block is located for each sub-block as described above (the classification is performed on the basis of the sub-block size). The obtained four prediction blocks are then combined into a single prediction block for the entire image block. It is also possible to perform affine transformation on the image block to be encoded to obtain a number of new image blocks TB, for which prediction blocks are located as described above (the classification is performed on the basis of the transformed image block). A prediction block for the image B to be encoded is derived from the selected prediction block by subjecting it to the inverse transformation of the above-mentioned transformation. Affine transformation is a transformation in which the shape of the image block changes, from a square to a rhombus, for instance. Even though the invention has been described above with reference to the examples of the attached drawings, it is clear that the invention is not limited to them, but it may be varied within the inventive idea disclosed above and in the attached claims. The read and write addresses of the memory, for instance, need not be derived directly as a result of the processing performed by the processing unit, but they may be derived in an additional step on the basis of the identifier obtained from the processing unit and representing a particular class. It is also possible to store more than one location data item per address (class) in the memory, which, however, complicates the device unnecessarily.

Claims: Method for the search for a prediction block in connection with predictive video compression, wherein a desired search area is searched for a prediction block resembling as closely as possible to an image block (B) to be encoded, whereby: image blocks (A) acting as prediction block candidates within the search area are subjected to classification by deriving an identifier (CA) from each image block (A) acting as a prediction block candidate, the identifier describing the image content of the concerned image block and each class being represented by its own identifier; the location of each image block (A) acting as a prediction block candidate is stored in a memory (21) at an address determined by said identifier (CA), whereby the storing takes place such that at least one location data item remains in the memory for each identifier (CA); the image block (B) to be encoded is also subjected to said classification by deriving an identifier (CB) from said image block (B) to be encoded, the identifier describing the image content of said image block (B) to be encoded; and the location of the prediction block for the image block (B) to be encoded is fetched from said memory (21) from a memory position determined by the identifier (CB) describing the image content of the image block (B) to be encoded. Method according to claim 1, characterized in that all image blocks within the search area are subjected to said classification by a pixel-by-pixel displacement to the new prediction block candidate (A). Method according to claim 1 or 2, characterized in that only one location data item remains in the memory for each identifier (CA). Method according to claim 1, characterized in that said identifier (CA) is derived by filtering from the image content of each image block (A) acting as a prediction block candidate. Method according to claim 1, characterized in that said identifier (CA) is derived by subsampling and truncation from the image content of each image block (A) acting as a prediction block candidate. Method according to claim 1, characterized in that the search area consists of the entire area of an image. Method according to claim 1, characterized in that the search area consists of the area of more than one images. Method according to claim 1, characterized in that the image block to be encoded is divided into sub-blocks, a prediction block is located for each sub-block, and the located prediction blocks are then combined into a single prediction block for the entire image block. Method according to claim 1, characterized in that the image block to be encoded is converted by affine transformation into a number of new image blocks, a prediction block is located for each new image block, and a prediction block is derived for the block to be encoded from a prediction block selected from among said prediction blocks for the new image blocks by performing the inverse transformation of said transformation on the selected prediction block. Device for the search for a prediction block in predictive video compression, wherein a desired search area is searched for a prediction block resembling as closely as possible to an image block (B) to be encoded, comprising: memory means (21) for storing the location of each image block (A) acting as a prediction block candidate, and a processing unit (22) for classifying each image block (A) acting as prediction block candidate and the image block (B) to be encoded, each class being represented by its own identifier, thereby deriving from each image block (A) acting as prediction block candidate an identifier (CA) being a write address for writing into said memory means (21) and from said image block (B) to be encoded an identifier (CB) being a read address for reading from said memory means (21). Device according to claim 10, characterized in that said means comprise a filter (22).

Inventors: HAIKONEN PENTTI, HAIKONEN, PENTTI
Applicants: NOKIA OY AB, OY NOKIA AB
Application year: 1994
Main classification: H04N7
IPC codes: H04N7, G06T9