[go: up one dir, main page]

HK1095461B - Moving picture signal coding method, decoding method, coding apparatus, and decoding apparatus - Google Patents

Moving picture signal coding method, decoding method, coding apparatus, and decoding apparatus Download PDF

Info

Publication number
HK1095461B
HK1095461B HK07102503.9A HK07102503A HK1095461B HK 1095461 B HK1095461 B HK 1095461B HK 07102503 A HK07102503 A HK 07102503A HK 1095461 B HK1095461 B HK 1095461B
Authority
HK
Hong Kong
Prior art keywords
motion vector
encoding
shift
block
coding
Prior art date
Application number
HK07102503.9A
Other languages
Chinese (zh)
Other versions
HK1095461A1 (en
Inventor
铃木芳典
Original Assignee
株式会社日立制作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立制作所 filed Critical 株式会社日立制作所
Publication of HK1095461A1 publication Critical patent/HK1095461A1/en
Publication of HK1095461B publication Critical patent/HK1095461B/en

Links

Description

Moving image encoding method, moving image decoding method, moving image encoding device, and moving image decoding device
The present application is a divisional application entitled "moving picture encoding method, decoding method, encoding device, and decoding device" with application number 200610084483.3 and application date of 24/1/2003.
Technical Field
The present invention relates to a moving picture encoding method, a moving picture decoding method, an encoding device, and a decoding device, and more particularly to a technique for encoding and decoding a motion vector.
Background
An outline of the moving image encoding/decoding process will be described. The coding device of fig. 13 generally performs coding of a moving image. As shown in fig. 3, 1 frame of a moving image to be encoded is composed of 1 luminance signal (Y signal: 61) and 2 color difference signals (Cr:62, Cb signal: 63), and the image size of each color difference signal is 1/2 of the luminance signal in both vertical and horizontal directions. In a general video standard, each frame of a moving image is divided into small blocks, and a reproduction process is performed in units of blocks called macroblocks.
As shown in fig. 5, the macroblock is composed of 1Y signal block 30 of 16 × 16 pixels, a Cr signal block 31 of 8 × 8 pixels spatially aligned with the Y signal block 30, and a Cb signal block 31. The encoding of the image signal is processed in units of the above-described macroblocks. The encoding is roughly classified into intra coding (intra coding) and predictive coding (inter coding).
In the image signal encoding apparatus of fig. 13, in the case of intra-frame encoding, an input macroblock image 201 to be encoded is divided into DCT encoded blocks, and is directly DCT203 by a DCT converter 203 and converted into DCT coefficients. Each transform coefficient is quantized by a quantizer 204 and encoded by a multiplexer 206.
The DCT Coding block size is generally 8 × 8 pixels in the conventional Coding scheme, but DCT transformation using a size of 4 × 4 pixels has recently been studied in MPEG-4 Part10(Advanced Video Coding) and the like.
As shown in fig. 6, each macroblock is divided into 24 4 × 4 pixel blocks, and each block is converted into 16 DCT coefficients by the DCT converter 203. A part of the quantized DCT coefficients is decoded into an input macroblock by the inverse quantizer 207 and the inverse DCT 208 of the local decoder 220 and synthesized into the frame memory 210. The local decoder 220 generates a decoded image similar to a decoding device described later. The image stored in the frame memory 210 is used for prediction in the time direction described later. The intra-frame coding is arranged in a macroblock (including the 1 st coded frame) having no similar portion to the previous frame, or a portion where a memory operation error accompanying DCT is to be eliminated.
In the case of inter (predictive coding), motion compensation processing between the input macroblock image 201 and the decoded image (reference frame) of the already coded frame stored in the frame memory 210 is performed by the motion compensator 211. Motion compensation is a temporal compression technique for retrieving a portion similar to the content of a target macroblock from a reference frame (generally, a portion in which the sum of the absolute value or the sum of the square errors of prediction error signals in a block is selected to be small) and encoding the motion amount (motion vector) of the portion.
The processing configuration for motion compensation is shown in fig. 4. Fig. 4 is a diagram showing a prediction block 75 and a motion vector 76 on a previous frame 73 (reference frame) with respect to a luminance signal block 72 of a current frame 71 surrounded by a thick frame. The motion vector 76 indicates the amount of movement from a block (broken line) 74 on the previous frame spatially corresponding to the same position as the coarse block of the current frame to the prediction block 75 region on the current frame (the length of the motion vector for the color difference signal is half of the luminance signal, and encoding is not performed). The detected motion vector is subjected to difference processing with a predicted motion vector (predicted from a motion vector of an adjacent block) obtained from the MV predictor 215, and then encoded by the multiplexer 206. A difference between a predicted macroblock image 213 extracted from a previous frame by motion compensation and an input macroblock image 201 of a current frame is processed by a differentiator 202, and a difference macroblock image is generated.
As shown in fig. 6, the differential macroblock image is divided into 24 4 × 4 pixel blocks, and each block is converted into 16 DCT coefficients by a DCT converter 203. Each DCT coefficient is quantized by a quantizer 204 and encoded by a multiplexer 206. In the case of inter-frame coding, the quantized DCT coefficients are decoded into a differential macroblock image by the inverse quantizer 207 and the inverse DCT 208 of the local decoder 220, added to the predicted macroblock image by the adder 209, and then combined into the frame memory 210. Here, the number of motion vectors to be encoded in 1 macroblock is set to 1, but in general, a macroblock is further divided into small blocks, and a motion vector is calculated for each small block and encoded. For example, in MPEG-4 Part10(Advanced Video Coding), a macroblock division type (luminance component) at the time of motion compensation is considered as fig. 7. Basically 4 types 51 to 54. The type 54 is selected from 48 × 8 blocks 54-0 to 54-3, respectively, and further from 5 types of types 54a, 54b, 54c, and 54d and intra coding.
Further, as a motion compensation method of the predictive coding, there are divided into a forward predictive coding for performing motion compensation using information of a temporally past frame and a bidirectional predictive coding for performing motion compensation using information of temporally past and future frames. In the motion compensation of the forward predictive coding, only forward prediction is performed, but in the motion compensation of the bidirectional coding, backward prediction, bidirectional prediction, and direct prediction from both directions using motion vector information in a temporally future frame are processed in addition to the forward prediction.
The encoding accuracy of a motion vector is generally set to an accuracy of an integer pixel or less. For example, in the Advanced Simple Profile of MPEG-4 Part 2, 1/2 pixel precision and 1/4 pixel precision may be selected for each bit of data. With respect to the method of calculating the predicted value of the integer pixel precision or less, the explanation is omitted, and a 2-tap linear filter is used adaptively according to the pixel position in 1/2 pixel precision, and an 8-tap filter and a 2-tap filter are used adaptively according to the pixel position in 1/4 pixel precision. In addition, MPEG-4 Part10 also studies to express a motion vector with 1/4 pixel accuracy and calculate a prediction value using a 6-tap filter and a 2-tap filter. Thus, the prediction performance is improved by using a filter with a long number of taps.
A frame obtained by applying intra-coding to all macroblocks is referred to as I-Picture, a frame formed by forward predictive coding or intra-coding is referred to as P-Picture, and a frame formed by bidirectional coding or intra-coding is referred to as B-Picture. In P-Picture or B-Picture, which of predictive coding and INTRA coding is performed for each macroblock is decided by the INTRA/INTER decider 214 of fig. 13, and the decision result 218 is encoded by the multiplexer 206.
Decoding of a coded signal of a moving image is performed in a reverse procedure to the coding. This is generally performed by the decoding apparatus of fig. 14.
The code decoding unit 501 analyzes the input encoded data, divides the motion vector-related information and macroblock type information into the MV predictor 508, and divides the quantized DCT coefficient information into the inverse quantizer 502. When the macroblock type is intra-coded, the inverse quantizer 502 and the inverse DCT 503 perform inverse quantization/inverse DCT processing on the decoded quantized DCT coefficient information for each 4 × 4 pixel block, and reproduce a macroblock image. When the prediction method of the macroblock is prediction encoding, a decoded motion vector is calculated from the decoded differential motion vector and the predicted motion vector by the MV predictor 508, and is input to the motion compensator 504. The motion compensator 504 extracts a prediction macroblock image from the frame memory 507 storing a decoded image of the previous frame according to the motion amount.
Next, the inverse quantizer 502 and the inverse DCT 503 perform inverse quantization and inverse DCT processing on the encoded data on the prediction error signal for each 4 × 4 pixel block, thereby reproducing a differential macroblock image. Then, the adder 505 adds the prediction macroblock image and the difference macroblock image, and reproduces the macroblock image. The reproduced macroblock images are synthesized into a decoded frame image by the synthesizer 506. The decoded frame image is stored in the frame memory 507 for prediction of the next frame.
A patent publication (Japanese patent laid-open No. H11-46364) is known as a document relating to the present invention. This document describes that, in a moving image encoding/decoding method for performing encoding/decoding processing on a block basis, a plurality of types of motion vector precisions are prepared, and a means for switching the encoding precision of a motion vector on a block basis is provided.
In the conventionally known motion compensation coding of a moving picture, a plurality of coding methods have been studied in which the number of motion vectors included in a block is prepared, and the coding accuracy of the motion vectors is as high as 1/8 pixel accuracy. However, due to the code amount of the motion vector, even when a block includes a plurality of motions, a method of encoding with a small number of motion vectors tends to be selected. Further, when a prediction pixel having an integer pixel accuracy or less is generated using a filter having a long number of taps, there is a problem of memory access in which the number of pixels in a reference image used for generating 1 prediction block is increased. This problem becomes a problem particularly when motion compensation is performed.
Accordingly, an object of the present invention is to provide a moving image signal encoding method, a moving image signal decoding method, a moving image signal encoding device, and a moving image signal decoding device that can reduce the amount of motion vector codes and can reduce prediction error information caused by an increase in the number of blocks in a block to be encoded.
Another object of the present invention is to reduce the memory access range in motion compensation in an encoding apparatus and a decoding apparatus.
Disclosure of Invention
The invention provides a moving picture coding method, comprising the following steps,
dividing an image into a plurality of encoding blocks, predicting a motion vector of an encoding block by a motion vector of an adjacent block as a predicted motion vector, encoding a differential motion vector calculated from the motion vector to be encoded and the predicted motion vector thereof in units of blocks as a motion vector of the encoding block by adding the differential motion vector to the motion vector of the adjacent block,
the method is characterized in that: the method also has the step of,
a plurality of kinds of precision of differential motion vectors are prepared, the precision of the differential motion vector is selected for each encoding block, and information on the selected precision and the differential motion vector of the precision are encoded.
The invention provides a moving picture coding method, comprising the following steps,
dividing an image into a plurality of encoding blocks, predicting a motion vector of an encoding block by a motion vector of an adjacent block as a predicted motion vector, encoding a differential motion vector calculated from the motion vector to be encoded and the predicted motion vector thereof in units of blocks as a motion vector of the encoding block by adding the differential motion vector to the motion vector of the adjacent block,
the method is characterized in that: the method also has the step of,
a plurality of kinds of motion vector precisions are prepared, the motion vector precision is selected for each coding block, and the information of the selected precision and a differential motion vector calculated by a predicted motion vector corrected to the selected precision and the motion vector of the selected precision are encoded.
The present invention provides a method for decoding a moving picture, comprising the steps of,
dividing an image into a plurality of decoded blocks, predicting a motion vector of a decoded block from a decoded motion vector of an adjacent block, calculating a decoded motion vector from a decoded differential motion vector and the predicted motion vector,
the method is characterized in that: the method also has the step of,
the accuracy of a plurality of types of differential motion vectors is prepared, the accuracy information of the differential motion vectors and the differential motion vectors of the accuracy are decoded for each decoded block, the accuracy of the decoded differential motion vectors is corrected to the same accuracy as that of the predicted motion vectors, and then the motion vectors of the decoded blocks are calculated from the decoded differential motion vectors and the predicted motion vectors, which have been subjected to the accuracy correction.
The present invention provides a method for decoding a moving picture, comprising the steps of,
dividing an image into a plurality of decoded blocks, predicting a motion vector of a decoded block from a decoded motion vector of an adjacent block, calculating a decoded motion vector from a decoded differential motion vector and the predicted motion vector,
the method is characterized in that: also comprises the following steps:
the accuracy of a plurality of types of motion vectors is prepared, the accuracy information of the motion vectors and the difference motion vectors of the accuracy are decoded for each decoded block, the accuracy of the predicted motion vector is corrected to the same accuracy as the decoding accuracy information, and then the motion vector of the decoded block is calculated from the decoded difference motion vector and the predicted motion vector subjected to the accuracy correction.
In order to achieve the above object, the present invention provides a moving picture encoding method including a step of dividing an image into a plurality of encoding blocks, predicting a motion vector in an encoding block from a motion vector at an adjacent position, and encoding a differential motion vector calculated from a motion vector to be encoded and the predicted motion vector thereof on a block-by-block basis, the method including: (1) preparing the precision of a plurality of types of differential motion vectors, selecting the precision of the differential motion vector for each coding block, and coding the information of the selected precision and the differential motion vector of the precision; or (2) a step of preparing a plurality of kinds of motion vector precisions, selecting the motion vector precision for each coding block, and coding the information of the selected precision and a differential motion vector calculated from the predicted motion vector corrected to the selected precision and the motion vector of the selected precision.
Here, the cases (1) and (2) include a case where the determination of the precision value (hereinafter, abbreviated as mv _ shift value) and the encoding process associated with the encoding of the differential motion vector are performed in all macroblocks, and the encoding of the mv _ shift value of a specific macroblock is omitted by using the type of macroblock (for example, the size of the number of encoded motion vectors) or the surrounding situation (for example, the situation of adjacent macroblocks).
In the case of (2) above, different accuracies may be assigned to the horizontal component and the vertical component of the motion vector, and a difference vector calculated from the motion vector of the assigned accuracy may be encoded for each component.
The decoding of a moving picture according to the present invention uses a code encoded by a moving picture according to the present invention, and performs image reproduction of an encoded block by a procedure reverse to the encoding procedure. That is, a plurality of motion vector accuracies are prepared, different accuracies are assigned to the horizontal component and the vertical component of the motion vector, each component is corrected to the assigned accuracy, and a differential motion vector calculated from the corrected predicted motion vector and the motion vector with the assigned accuracy is encoded.
Further, in the case of decoding, the setting of the mv _ shift value is performed according to the processing procedure of encoding the decoded code. For example, when a code in which the mv _ shift value is not encoded is reproduced in the case of the type of macroblock in encoding or the surrounding, the mv _ shift value is determined and processed in the case of the type of macroblock in decoding or the surrounding.
The object, features, and configurations of the encoding device and the decoding device of the present invention will be further apparent from the following description of the embodiments with reference to the drawings.
Drawings
Fig. 1 is a diagram showing an example of data syntax of a forward predicted frame.
Fig. 2 is a diagram showing an example of data syntax of a bidirectional predicted frame.
Fig. 3 is a diagram illustrating macroblock partitioning.
Fig. 4 is a diagram illustrating the principle of motion compensation.
Fig. 5 is a diagram showing a block structure used when encoding the presence or absence of a significant DCT coefficient included in a macroblock.
Fig. 6 is a diagram showing a macroblock structure in units of blocks on which DCT processing and encoding processing are performed.
Fig. 7 is a diagram showing a structure of a luminance block in a block unit for performing motion compensation.
Fig. 8 is a diagram illustrating generation of a prediction motion vector.
Fig. 9 is a diagram showing an example of a code table of motion vector accuracy.
Fig. 10 is a diagram illustrating a prediction method of motion vector accuracy.
Fig. 11 is a diagram showing a code table of macroblock types and a code table of 8 × 8partition types in P-Picture according to an embodiment of the present invention.
Fig. 12 is a diagram representing a code table of a macroblock type and a code table of an 8 × 8partition type in B-Picture according to an embodiment of the present invention.
Fig. 13 is a block diagram showing a general configuration of a moving image encoding device.
Fig. 14 is a block diagram showing a general configuration of the moving picture decoding apparatus.
Fig. 15 is a diagram illustrating an example of a macroblock type code table in the conventional method.
Fig. 16 is a diagram showing a configuration example of a general code table.
Fig. 17 is a diagram showing an example of the structure of a macroblock having a frame structure in a domain signal.
Fig. 18 is a flowchart of a process of switching the encoding accuracy of a motion vector by block size.
Fig. 19 is a flowchart of a process of switching the encoding accuracy of a motion vector according to the components of the motion vector in the embodiment of the present invention.
Fig. 20 is a flowchart of a process of switching the encoding precision of a motion vector according to the components of the motion vector and the macroblock structure in the embodiment of the present invention.
Fig. 21 is a flowchart of a process of switching the encoding precision of a motion vector according to the block size, the composition of the motion vector, and the macroblock structure in the embodiment of the present invention.
Fig. 22 is another example of a flowchart of a process of switching the encoding accuracy of a motion vector according to the block size, the component of the motion vector, and the macroblock structure in the embodiment of the present invention.
Fig. 23 is an example of a flowchart of a process of switching the encoding accuracy of a motion vector by the block size and the component of the motion vector in the embodiment of the present invention.
Fig. 24 is another example of a flowchart of a process of switching the encoding accuracy of a motion vector according to the block size and the component of the motion vector in the embodiment of the present invention.
Fig. 25 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 26 is a structural diagram of an embodiment of a motion vector decoding unit of the moving picture decoding apparatus according to the present invention.
Fig. 27 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 28 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 29 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 30 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 31 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 32 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 33 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 34 is a structural diagram of an embodiment of a motion vector decoding unit of a moving picture decoding apparatus according to the present invention.
Fig. 35 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 36 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 37 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 38 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 39 is a block diagram of an embodiment of a motion vector encoding unit of a moving picture encoding apparatus according to the present invention.
Fig. 40 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 41 is a block diagram of an embodiment of a motion vector encoding unit of a moving image encoding device according to the present invention.
Fig. 42 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 43 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 44 is a structural diagram of an embodiment of a motion vector decoding unit of a moving picture decoding apparatus according to the present invention.
Fig. 45 is a structural diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 46 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Fig. 47 is a block diagram of an embodiment of a motion vector encoding section of a moving image encoding apparatus according to the present invention.
Fig. 48 is a structural diagram of an embodiment of a motion vector decoding section of a moving picture decoding apparatus according to the present invention.
Detailed Description
Before describing the embodiments of the present invention, a description will be given of a data syntax of code data created by a multiplexer of a coding apparatus in order to facilitate understanding of the following description.
Fig. 1 shows a part of the data syntax of P-Picture, and fig. 2 shows a part of the data syntax of B-Picture (CBP 15 is omitted since it is the same as fig. 1 from now on). Note that, here, data (motion vector precision information) 13 is provided, and description will not be given while appearing in the data syntax. Note that the I-Picture is not described since it is not included in the features of the present invention.
The picture header10 contains data relating to the reproduction information of the frame, such as the image size and the reproduction time. The Picture type11 is frame type information, and the types of I-Picture, P-Picture, and B-Picture are encoded therein. The macroblock data is repeated for each macroblock from MB type12 to Tcoeff chroma17 by the number of macroblocks in the frame. In the MB type12, one macroblock is selected from the macroblock schemes shown in table 95(P-Picture) or table 96(B-Picture) in fig. 15 and encoded.
The SKIP method means that a macroblock image spatially corresponding to the same position is separated from a decoded image of a previous frame and copied. M, N for IntraM N in the table indicates the tile size when spatial prediction is performed. M × N represents a small block unit when motion compensation is performed, and corresponds to each of modes 1 to 4 in fig. 7.
Direct means Direct prediction. Blcok1 and Block2 identify 2 small blocks in the mode 2 or mode 3 of fig. 7, and indicate whether the prediction direction of each small Block is Forward (Forward prediction), Backward (Backward prediction), or Bi-directional (Bi-directional prediction). Regarding the macroblock with 8 × 8(split) selected in MB type12, 8 × 8Partition18 is generated. In the other macroblock scheme, 8 × 8Partition18 is not generated. In the 8 × 8Partition18, one scheme is selected for each 8 × 8Partition from the 8 × 8Partition schemes shown in the table 92(P-Picture) in fig. 11 or the table 94(B-Picture) in fig. 12, and encoding is performed. Intra in the table represents spatial prediction. M × N represents a small block unit when motion compensation is performed, and corresponds to the partitions 1 to 4 in fig. 7. Direct means Direct prediction.
The Prediction direction indicates which of Forward Prediction, Backward Prediction, and Bi-directional Prediction is the Prediction direction of each small block. The MVD14 represents encoded data of a differential motion vector in P-Picture. Thus, in the case where MB type12 is IntraM × N, this data is not generated. When the MB type12 is M × N, the MVD14 performs encoding repeatedly by the number of vectors indicated by the MB type and 8 × 8 Partition. For example, in the case of 16 × 8, the number of differential motion vectors to be encoded is 2, each motion vector is composed of 2 horizontal and vertical components, and 4 MVDs are successively encoded. MVDFW23 and MVDBW24 represent encoded data of differential motion vectors in B-Picture. The MVDFW23 is generated in the case of a macroblock containing motion vectors accompanying forward prediction (including also bi-directional prediction) as shown in MB type12 and 8 × 8Partition 18. Similarly, the MVDBW24 is generated in the case of a macroblock including a motion vector accompanying backward prediction (including also bidirectional prediction) shown in MB type12 and 8 × 8Partition 18. Thus, if MB type12 is IntraM × N or Direct, this data is not generated. When the MB type12 is M × N and a motion vector associated with forward prediction (including bidirectional prediction) exists, the MVDFW23 performs encoding repeatedly for the number of vectors (the number of differential motion vectors × 2, horizontal/vertical power) associated with forward prediction (including bidirectional prediction) indicated by the MB type and 8 × 8 Partition. Similarly, when the MB type12 is M × N and motion vectors associated with backward prediction (including bidirectional prediction) exist, the MVDBW24 repeatedly performs encoding for the number of vectors (the number of differential motion vectors × 2, horizontal/vertical power) associated with forward prediction (including bidirectional prediction) indicated by the MB type and 8 × 8 Partition.
CBP15 is coded data indicating whether or not quantized DCT coefficients (significant coefficients) other than 0 are included in 16 coefficients with respect to the 24 DCT blocks shown in fig. 6. However, since additional information increases when the information on the presence or absence of a significant coefficient is encoded for each of the 24 DCT blocks, the presence or absence of a significant coefficient is encoded in units of 8 × 8 blocks in which 4 DCT blocks are grouped as shown in fig. 6.
Tcoeff luma16 represents the encoded data of the quantized DCT coefficients in luminance block 40. The coding is performed from 4 x 4 block 40-0 to 4 x 4 block 40-15, and 16 quantized coefficients are coded in order of small number. However, the encoding process is omitted for 8 × 8 blocks where no significant coefficient is represented by CBP.
Tcoeff chroma17 represents the encoded data of the quantized DCT coefficients in luminance block 40. The encoding is to encode 16 quantization coefficients in the order of 4 x 4 blocks 41-0, 41-2, 41-3, 42-0, 42-1, 42-3, respectively. However, the encoding process is omitted for signal components represented by CBP15 without significant coefficients.
Regarding the coding method of coded data at the macroblock level shown in fig. 1 and 2, Universal VLC (UVLC) using only 1 type of variable length code table, a coding method combining fixed length coding and variable length coding (preparing a code table different for each coding element), arithmetic coding (for example, see non-patent document 1), and the like are considered. Table 83 in fig. 16 shows the structure of UVLC, and Xn has a value of "0" or "1". An example of an actual variable-length code table is shown in table 84. As a specific method of arithmetic coding, a method is considered in which the meaning of each code is replaced with binary data of several bits, and each bit is coded in accordance with an occurrence probability model indicating the occurrence probability of each 0 and 1. This method is called CABAC (Context-based Binary analytical Coding) (Witten et al, "analytical Coding for Data Compression", Comm. of the ACM, 30(6), 1987, pp. 520-541).
The present invention is particularly characterized in an encoding unit and a decoding unit for a motion vector. That is, the processing performed by the MVD prediction13 unit in the data MVD syntax of fig. 1 and 2, the MV prediction unit 215 and the motion compensation unit 211 of the encoding apparatus of fig. 13, and the MV unit 508 and the motion compensation unit 504 of the decoding apparatus of fig. 14 are characterized by their configurations and information processing methods. The configurations of other parts and the signal processing method are substantially the same as those of the conventional apparatuses and methods, and embodiments of the characteristic parts of the present invention will be described below.
< example 1>
In the present embodiment, in moving picture coding (hereinafter, simply referred to as motion compensation coding of a moving picture) in which an image is divided into a plurality of coding blocks in a motion vector coding unit, a motion vector in the coding block and an image signal of the coding block are predicted from a motion vector at an adjacent position, and a differential motion vector calculated from a motion vector to be coded and the predicted motion vector is coded on a block-by-block basis, a plurality of types of precisions of the differential motion vector are prepared, the precision of the differential motion vector is selected for each decoding block, and information on the selected precision and the differential motion vector of the precision information are coded.
First, the generation of the above-described predicted motion vector will be described with reference to fig. 8. Here, the small block to be coded is set to 50. In each of the small blocks 50, the median value of the motion vectors of the 3 blocks located at the adjacent position A, B, C is calculated as a candidate for the horizontal and vertical components of the motion vector, and the motion vector of the median value is set as a predicted motion vector. However, when the block at position C is not coded or is located outside the image in the relationship between the coding order and the macroblock position, the motion vector of the block at position D is used as one of the candidate motion vectors instead of position C. When the block at position A, B, C, D does not have a motion vector, the prediction process is performed with the motion vector set to 0 vector. At this time, when 2 of the 3 candidate blocks do not have a motion vector, the remaining one candidate motion vector is set as a predicted motion vector. The same prediction method is used for the blocks 51-0 of the mode 1(51) and the small blocks 54a-0, 54b-1, 54c-0, 54c-2, and 54d-0 to 54d-3 of the mode 4(54) in fig. 7.
Regarding the 2 small blocks (52-0, 52-1) of the mode 2(52) and the 2 small blocks (53-0, 53-1) of the mode 3(53), the motion vector of the block located at the arrow root shown in fig. 8 is set as a prediction value. In either method, the motion vector for the color difference component is not encoded, and the motion vector for the luminance component is divided by 2 or the like.
In embodiment 1, first, 3 kinds of candidates of the precision of the differential motion vector are 1/4-pixel precision, 1/2-pixel precision, and 1-pixel precision. Assuming that MV is a value obtained by multiplying a motion vector component expressed with 1/4 pixel accuracy by 4 and PWV is a value obtained by multiplying a predicted motion vector component expressed with 1/4 pixel accuracy by 4, the MV values for each accuracy candidate in this expression are limited as follows.
1 pixel precision: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 4.
1/2 pixel accuracy: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 2.
1/4 pixel accuracy: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 1.
Therefore, in order to reflect the effect of the present embodiment to the coding characteristics, an evaluation function is prepared for estimating the motion vector by adding the influence of the code amount of the motion vector to the absolute value or the sum of squared errors of the prediction error signal. At this time, the optimum evaluation value of each small block is calculated for each precision of (MV-PMV), and after the motion vector estimation processing of all small blocks in the macroblock is completed, the sum of the average values of the small blocks is calculated for each precision, and the precision with which the sum of the average values is small is determined as the precision of the differential motion vector. The differential motion vector MVD to be encoded is calculated by formula (1).
MVD=(MV-PMV)>>mv_shift......(1)
Mv _ shift in formula (1) is a value shown in table 81 of fig. 9. Equation (1) shows that the value obtained by subtracting the prediction motion vector component PMV from the motion vector component MV is arithmetically shifted to the right by the number shown by MV _ shift, and the value is the differential motion vector component MVD. Here, the value obtained by subtracting the prediction motion vector component PMV from the motion vector component MV is a multiple of 1< < MV _ shift, and the differential motion vector component MVD subjected to the arithmetic right shift processing becomes a value of a multiple of 1.
In the case where the Picture type is P-Picture, mv _ shift is encoded as an encoded data element shown by data MVD precision13 of fig. 1, and MVDs are encoded as an encoded element shown by data MVD 14. In the case of Picture type B-Picture, mv _ shift is encoded as an encoded data element shown in data MVD precision13 of fig. 2, and MVDs are encoded as encoded data elements shown in data MVDFW23 (in the case of MVDs being differential motion vectors for forward prediction) or data MVDBW24 (in the case of MVDs being differential motion vectors for backward prediction). In addition, encoding of MVD precision is omitted in macroblocks where the encoded data of differential motion vectors (MVD14 or MVDFW23 and MVDBW24) are not generated. Specifically, it is P-Picture: the case where MB type is IntraM N or 8 × 8 partitions with MB type of 8 × 8(split)4 tiles are all Intra, B-Picture: the MB type is IntraM × N or Direct, and further, the MB type is 8 × 8(split)4 small blocks, and all of the 8 × 8 partitions are Intra or Direct.
As shown in the conventional example, UVLC, arithmetic coding, or the like is used as a coding method. The scheme shown in table 81 of fig. 9 is an example of the coding scheme in the case of using UVLC. In the case of arithmetic coding, for example, a generated value of a prediction motion vector of a coded MB (7C in fig. 10) is coded in accordance with a generation probability table calculated from mv _ shift values of an immediate left MB (7A in fig. 10) and an immediate upper MB (7B in fig. 10).
On the decoding side, from decoding the mv _ shift value and decoding the MVD and PMV, according to the following formula,
MV=(MVD<<mv_shift)+PMV......(2)
decoding of each motion vector component, i.e., reproduction (decoding) of MV values, is performed. Equation (2) shows that the decoded motion vector component MV is obtained by adding the predicted motion vector component PMV to the value obtained by arithmetically shifting the differential motion vector component MVD to the left by the number indicated by MV _ shift. By this arithmetic left-shift processing, the decoded differential motion vector component MVD changes from a multiple of 1 to a multiple of 1< < MV _ shift (corresponding to MV-PMV on the encoding side). The motion vector component MV is decoded by adding PMV to this value, and the original precision value is restored.
Next, a case where the accuracy candidates of the differential motion vector are 4 types of accuracy, i.e., 1/8 pixel accuracy, 1/4 pixel accuracy, 1/2 pixel accuracy, and 1 pixel accuracy will be described. When MV is a value obtained by multiplying 8 times the motion vector component expressed with 1/8-pixel accuracy and PWV is a value obtained by multiplying 8 times the predicted motion vector component expressed with 1/8-pixel accuracy, the MV values for each accuracy candidate in this expression are limited as follows.
1 pixel precision: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 8.
1/2 pixel accuracy: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 4.
1/4 pixel accuracy: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 2.
1/8 pixel accuracy: the values of (MV-PMV) in all the small blocks within a macro block are MVs whose horizontal and vertical components are multiples of 1.
The method of motion estimation is the same as the case of 3 types of motion estimation of 1/4 pixel accuracy, 1/2 pixel accuracy, and 1 pixel accuracy, and therefore, the description thereof is omitted. The differential motion vector MVD is calculated by formula (1). Here, the value obtained by subtracting the predicted motion vector component PMV from the motion vector component MV is a multiple of 1< < MV _ shift, and the differential motion vector component MVD subjected to the arithmetic right shift processing is a value obtained by multiplying 1, and is calculated by the above equation (1). Mv _ shift in equation (1) is a value shown in table 82 of fig. 9.
Since the coding methods of mv _ shift and MVD are the same as those in the case where the candidates for the precision of the differential motion vector are 3 types, i.e., 1/4-pixel precision, 1/2-pixel precision, and 1-pixel precision, the description thereof is omitted, and the coding code in the case where UVLC is used is in accordance with table 82 instead of table 81.
In the decoding side, similarly to the case where the precision candidates of the differential motion vector are 3 types of precision, i.e., 1/4 pixel precision, 1/2 pixel precision, and 1 pixel precision, the decoded MV value of each motion vector component is reproduced from the decoded MV _ shift value and the decoded MVDs and PMVs according to the above formula (2). Equation (2) shows that the decoded motion vector component MV is obtained by adding the value of the predicted motion vector component PMV to the value obtained by arithmetically shifting the differential motion vector component MVD to the left by the number indicated by MV _ shift. By this arithmetic left-shift processing, the decoded differential motion vector component MVD changes from a multiple of 1 to a multiple of 1< < MV _ shift (corresponding to MV-PMV on the encoding side). The motion vector component MV is decoded by adding PMV to this value, and the original precision value is restored.
< example 2>
In the present embodiment 2, in the motion compensation coding of a moving picture, a plurality of kinds of motion vector precisions are prepared, the motion vector precision is selected for each macroblock, and the selected precision information and a differential motion vector calculated from a prediction motion vector corrected to the selected precision and a coding motion vector corrected to the selected precision are coded.
First, the accuracy candidates of the prediction motion vector and the encoding motion vector are 3 types of accuracy, i.e., 1/4-pixel accuracy, 1/2-pixel accuracy, and 1-pixel accuracy. Assuming that MV is a value obtained by multiplying a motion vector component expressed with 1/4 pixel accuracy by 4 and PWV is a value obtained by multiplying a predicted motion vector component expressed with 1/4 pixel accuracy by 4, the MV values for each accuracy candidate in this expression are limited as follows.
1 pixel precision: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 4.
1/2 pixel accuracy: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 2.
1/4 pixel accuracy: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 1.
Therefore, in order to reflect the effect of the present embodiment to the coding characteristics, an evaluation function is prepared for estimating the motion vector by adding the influence of the code amount of the motion vector to the absolute value or the sum of squared errors of the prediction error signal. In this case, the optimum evaluation value of each small block is calculated for each precision of MV, and after the motion vector estimation processing of all small blocks in the macroblock is completed, the sum of the average values of the small blocks is calculated for each precision, whereby the precision with which the sum of the average values is small can be determined as the precision of the differential motion vector. The differential motion vector MVD to be encoded is calculated by equation (3).
MVD=(MV-((PMV>>mv_shift)<<mv_shift))>>mv_shift......(3)
Mv _ shift in formula (3) is a value shown in table 81 of fig. 9. Equation (3) shows that the difference motion vector component MVD is obtained by subtracting the predicted motion vector component PMV from the motion vector component MV, arithmetically shifting the predicted motion vector component PMV by a number shown by MV _ shift to the right, then arithmetically shifting the predicted motion vector component PMV to the left immediately after the right arithmetically shifting the predicted motion vector component PMV by a number shown by MV _ shift, and further arithmetically shifting the predicted motion vector component PMV by a number shown by MV _ shift to the right by 2. Here, the successive right-shift processing and left-shift processing of the predicted motion vector component play a role of converting the value of the predicted motion vector component PMV into a value of a multiple of 1< < MV _ shift, which is the same as MV. In addition, the differential motion vector component MVD becomes a value of a multiple of 1by the 2 nd arithmetic right shift processing.
In this way, in the method of switching the accuracy of the coded motion vector, it is not necessary to consider the accuracy of the PMV at the time of motion estimation, but it is necessary to perform processing of reducing the accuracy of the PMV predicted motion vector to the accuracy of mv _ shift at the time of MVD generation processing. However, the equation (3) can reduce the number of calculation steps by simplifying the equation as described below. It is effective in the implementation of circuit design and the like. In this equation, the motion vector component MV and the prediction motion vector component PMV are converted into values of multiples of 1, and then difference processing is performed. "the prediction vector component converted into a multiple of 1 is set to a value of 1< < MV _ shift times" is equivalent to the "prediction motion vector component converted into a value of 1< < MV _ shift times" in the above expression, and since the motion vector component MV is a multiple of 1< < MV _ shift, information loss due to the use of the following expression does not occur.
MVD=(MV>>mv_shift)-(PMMV>>mv_shift)......(4)
Regarding the assignment and encoding methods of mv _ shift and MVD to fig. 1 and 2, the same method as the method of switching the precision of the differential motion vector is used, and therefore, the description thereof is omitted.
On the decoding side, from decoding the mv _ shift value and decoding the MVD and PMV, according to the following formula,
MV=(MVD<<mv_shift)+((PMV>>mv_shift)<<mv_shift)......(5)
the decoded MV values of the respective motion vector components are reproduced. This expression (5) indicates that the decoded motion vector component MV is obtained by adding the difference motion vector component MVD to the value obtained by arithmetically shifting the difference motion vector component MVD by the number MV _ shift to the left, and arithmetically shifting the prediction motion vector component PMV by the number MV _ shift to the right, and then to the left. Here, the successive right-shift processing and left-shift processing of the predicted motion vector component and the processing of arithmetically shifting the differential motion vector component MVD to the left by a number indicated by mv _ shift play function to convert each component into a value of a multiple of 1< < mv _ shift. Accordingly, the decoded motion vector component MV becomes a multiple of 1< < MV _ shift. The equation (5) can reduce the number of calculation steps by simplifying the following. It is effective in the implementation of circuit design and the like. Equation (5) shows that the decoded differential motion vector DMV is added to the predicted motion vector component PMV converted to a value of a multiple of 1, and a value obtained by applying a left arithmetic shift by a number indicated by MV _ shift is used as the decoded motion vector component MV. "the value of 1< < mv _ shift times of the prediction vector component converted into 1" is equivalent to "the prediction motion vector component converted into 1< < mv _ shift times" in the above expression, and since the differential motion vector component DMV is a multiple of 1, information loss due to the use of the following expression (6) does not occur.
MV=(MVD+(PMV>>mv_shift))<<mv_shift......(6)
Next, a case where the accuracy candidates of the differential motion vector are 4 types of accuracy, i.e., 1/8 pixel accuracy, 1/4 pixel accuracy, 1/2 pixel accuracy, and 1 pixel accuracy will be described. When MV is a value obtained by multiplying 8 times the motion vector component expressed with 1/8-pixel accuracy and PWV is a value obtained by multiplying 8 times the predicted motion vector component expressed with 1/8-pixel accuracy, the MV values for each accuracy candidate in this expression are limited as follows.
1 pixel precision: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 8.
1/2 pixel accuracy: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 4.
1/4 pixel accuracy: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 2.
1/8 pixel accuracy: the values of MVs in all the small blocks in the macro block are MVs whose horizontal and vertical components are multiples of 1.
The method of motion estimation is the same as the case of 3 types of motion estimation of 1/4 pixel accuracy, 1/2 pixel accuracy, and 1 pixel accuracy, and therefore, the description thereof is omitted. The differential motion vector MVD to be encoded is calculated by the following formula.
MVD=(MV-((PMV>>mv_shift)<<mv_shift))>>mv_shift......(3)
Mv _ shift in the formula is a value shown in table 82 of fig. 9. This formula shows that the value obtained by subtracting the predicted motion vector component PMV from the motion vector component MV and arithmetically shifting the predicted motion vector component PMV to the right by a number shown by MV _ shift is arithmetically shifted to the left immediately after the right arithmetic shift, and the value obtained by arithmetically right shifting the predicted motion vector component PMV by a number shown by MV _ shift is further arithmetically shifted to the left by 2 is the differential motion vector component MVD. Here, the successive right-shift processing and left-shift processing of the predicted motion vector component play a role of converting the value of the predicted motion vector component PMV into a value of a multiple of 1< < MV _ shift, which is the same as MV.
In addition, the differential motion vector component MVD becomes a value of a multiple of 1by the 2 nd arithmetic right shift processing.
Since the coding methods of mv _ shift and MVD are the same as those in the case where the candidates for the precision of the differential motion vector are 3 types, i.e., 1/4-pixel precision, 1/2-pixel precision, and 1-pixel precision, the description thereof is omitted, and the coding code in the case where UVLC is used is in accordance with table 82 instead of table 81. However, the above formula can reduce the number of calculation steps by simplifying the formula as described below. It is effective in the implementation of circuit design and the like. In this equation, the motion vector component MV and the prediction motion vector component PMV are converted into values of multiples of 1, and then difference processing is performed. "a prediction vector component converted into a multiple of 1 is set to a value of 1< < MV _ shift times" is equivalent to the "prediction motion vector component converted into a multiple of 1< < MV _ shift" in the above equation, and since the motion vector component MV is a multiple of 1< < MV _ shift, information loss due to the use of the following equation does not occur.
MVD=(MV>>mv_shift)-(PMV>>mv_shift)......(4)
The decoding side also decodes the MVD and PMV from the decoded mv _ shift value and the decoded MVD and PMV in the same manner as when the candidates for the precision of the differential motion vector are 3 types of precision 1/4 pixels, 1/2 pixels and 1 pixel, according to the following formulas,
MV=(MVD<<mv_shift)+((PMV>>mv_shift)<<mv_shift)......(5)
the decoded MV values of each motion vector component are reproduced. This formula shows that the decoded motion vector component MV is obtained by adding the value obtained by arithmetically shifting the differential motion vector component MVD to the left by the number shown by MV _ shift, and arithmetically shifting the predicted motion vector component PMV to the left by the number shown by MV _ shift immediately after arithmetically shifting the predicted motion vector component PMV to the right. Here, the successive right-shift processing and left-shift processing of the predicted motion vector component and the processing of arithmetically shifting the differential motion vector component MVD to the left by a number indicated by mv _ shift play function to convert each component into a value of a multiple of 1< < mv _ shift. Accordingly, the decoded motion vector component MV becomes a multiple of 1< < MV _ shift. This formula can be simplified as described below, and the number of calculation steps can be reduced. It is effective in the implementation of circuit design and the like. In this equation, the decoded differential motion vector DMV is added to the predicted motion vector component PMV converted to a value of a multiple of 1, and the value obtained by applying a left arithmetic shift by a number indicated by MV _ shift is referred to as the decoded motion vector component MV. "the value of 1< < mv _ shift times of the prediction vector component converted into 1" is equivalent to "the prediction motion vector component converted into mv _ shift times" in the above expression, and since the differential motion vector component DMV is a multiple of 1, information loss due to the use of the following expression does not occur.
MV=(MVD+(PMV>>mv_shift))<<mv_shift......(6)
Comparing the above embodiments 1 and 2, embodiment 1 actually adjusts the accuracy of the differential motion vector to be encoded, and therefore, the calculation is simpler than embodiment 2. In contrast, since the precision of the motion vector to be encoded is adjusted in embodiment 2, the search pixel in the case where each precision is assumed does not depend on the prediction vector. Thus, while embodiment 1 is effective when only the encoding performance is sought, embodiment 2 is effective in a memory access reduction method described later.
< example 3>
Embodiment 3 is a method for preventing an increase in the code amount of an mv _ shift value in an area where the macroblock selection rate is high, by using a coding method and a decoding method which are determined in advance in accordance with the block scheme without performing coding of the mv _ shift value as much as possible. That is, in a mode in which the number of motion vectors associated with a macroblock is small, the differential motion vector encoding and decoding processes are performed with a default motion vector accuracy that is predetermined in advance. By this processing, encoding and decoding processing of motion vector precision information is omitted.
For example, the encoding side and the decoding side perform settings such that encoding and decoding processes are performed with 1/4 pixel accuracy or 1/8 pixel accuracy in a macroblock having an MB type of 16 × 16, and encoding and decoding processes of accuracy information are omitted in these types of macroblocks. Here, only a macroblock having an MB type of 16 × 16 is set as a method of omitting the encoding/decoding process of the precision information, but the target can be further expanded. For example, it is also effective to set the encoding side and the decoding side so that the encoding and decoding processes are performed on macroblocks having MB types of 16 × 16, 16 × 8, and 8 × 16 at 1/4 pixel accuracy or 1/8 pixel accuracy. In addition, in P-Picture, only macroblocks having an MB type of 16 × 16 are set as a method of omitting encoding/decoding processing of precision information, and in B-Picture having a large number of motion vectors to be encoded, macroblocks up to MB types of 16 × 16, 16 × 8, and 8 × 16 may be set as a method of omitting encoding/decoding processing of precision information.
Similarly to mv _ shift, the default value of the motion vector precision can be set in the range of 0 to 3 (0 to 2 in the case of 1/4MC type), and switching can be performed in bit stream units or frame units. At this time, a default value code is included in the header part at the head of the data in the case of a bitstream unit, and is included in the picture header data in the case of a frame unit. In the case of a bitstream unit, if it is determined in advance on the encoding side and the decoding side, it is not necessary to include encoded data.
Further, by preparing macroblock types defining mv _ shift values shown in table 91 of fig. 11 and table 93 of fig. 12 instead of table 95 and table 96 of fig. 15, it is possible to reduce additional information accompanying coding of mv _ shift values. In addition, when arithmetically encoding the mv _ shift value, the encoding efficiency can be improved by adaptively switching the probability model used for encoding based on the number of motion vectors contained in the macroblock. Note that, although switching units of mv _ shift are assumed to be macroblock units, switching may be performed every 8 × 8. Such processing can be realized by setting a scheme of processing every 8 × 8 and a scheme of processing every 16 × 16 in the MB type. Further, a method of encoding 4 mv _ shift values for 8 × 8 can be realized by providing a switching scheme for every 8 × 8 in table 81 or table 82.
Further, the selection switching unit of the differential motion vector or the motion vector accuracy may be fixed in the entire frame or fixed in the entire sequence. The selection of the switching unit with a fixed precision will simplify the encoding/decoding process. Accordingly, in a simple encoding/decoding scheme in which implementation cost is taken into consideration, it is effective to fix the switching unit of accuracy in a frame unit or a sequence unit.
< example 4>
Embodiment 4 is a method for uniquely determining a shift value from a surrounding situation. That is, the code amount of the mv _ shift value is reduced by predicting the mv _ shift value of the macroblock to be encoded from the adjacent macroblocks. For example, the mv _ shift value of the macroblock to be encoded (macroblock 7C in fig. 10) is predicted from the mv _ shift values of the macroblock immediately to the left (7A) and the macroblock immediately above (7B). As a prediction method, there is a method of predicting from an added value of mv _ shift values of 7A and 7B. As a specific utilization means, there is a control means that omits encoding of an mv _ shift value (MVD precison) when an MB type with an addition value of 0, 7C is 16 × 16, uses 1/8 pixel accuracy or 1/4 pixel accuracy as a predetermined value for both encoding and decoding sides, and encodes the mv _ shift value when a combination of an MB type and an addition value other than that is used. This specific example is an example, and there are a plurality of combinations of the type of adjacent macroblock used for prediction, the prediction method, the type of MB type to be controlled, the case classification type at the time of control, and the like. For example, by extending the MB type for control to 2 or less differential motion vectors, or extending the control point of the addition value to 2 or less 2, the reduction amount of the code amount of the mv _ shift value increases. Further, there is a method of predicting an mv _ shift value of a current MB from mv _ shift values of adjacent MBs by a method such as motion vector prediction, and encoding a difference value thereof.
The motion vector encoding accuracy switching means of the above embodiment further includes the following modifications.
In the present embodiment, the candidates of the encoding accuracy of the motion vector are 1/8-pixel accuracy, 1/4-pixel accuracy, 1/2-pixel accuracy, and 1-pixel accuracy, but the present invention is not limited to this. For example, the case where the pixel precision is included up to 1/16 pixels or the case where the pixel precision is 1/2 pixels or 1 pixel precision is 2 pixels is adopted.
In addition, although in the above-described embodiment, encoding of encoding accuracy information of a motion vector is performed on a macroblock basis, there is also a method of switching encoding accuracy information of a motion vector for each of a plurality of macroblock groups.
Further, in the above-described embodiment, the division method of the motion compensation block in the macroblock is set to 4 types as shown in fig. 7, but the motion vector encoding method of the present specification can be implemented even if the type and number of the division methods of the motion compensation block are changed, and therefore the encoding block structure of the motion vector is not limited.
In the above embodiment, UVLC and arithmetic coding have been described as the coding method of coded data, but the motion vector coding method in the present specification can be implemented without being limited to the type of entropy coding. Further, the structure of the UVLC code table and the structure method of arithmetic coding/decoding are not limited to the tables of the embodiments. Further, although in the present embodiment, the default value of the mv _ shift value is used for the 16 × 16, 16 × 8, and 8 × 16 systems, this default value can be applied to a partial system of 8 × 8 (split). In addition, although the default value is set to be a bit stream unit or a frame unit in the embodiment, different values may be assigned to each macroblock unit. For example, there is a method in which the default value is set to 1 in the 16 × 16 scheme and 0 in the 16 × 8 and 8 × 16 schemes. In summary, regarding the macroblock scheme and the 8 × 8Partition scheme, the encoding accuracy of the differential motion vector (or motion vector) to be applied to each of the macroblock scheme and the 8 × 8Partition scheme may be defined in units of a frame or a sequence, and encoding and transmission may be performed (in the case of a sequence unit, if the encoding accuracy in each scheme is determined in advance on the encoding side and the decoding side, encoding of accuracy information is not necessary). As described above, fixing the selection switching unit of the encoding accuracy simplifies the encoding/decoding process. By increasing the specified default value, further cost reductions are realized. In the encoding/decoding system requiring a simpler configuration, it is effective to fix the switching unit of the encoding accuracy for more systems.
The above describes an embodiment of a moving image encoding method and a moving image decoding method according to the present invention. According to the coding apparatus and decoding apparatus for moving pictures of the present invention, the coding apparatus of fig. 13, which is an embodiment of the method, is added to the motion compensator 211, first, a decision process of on/off coding of mv _ shift value according to a combination of MB type and 8 × 8Partition, a motion estimation process considering mv _ shift value, a calculation process of MVD, MVDFW, MVDBW accompanying mv _ shift, and a process of passing mv _ shift value to the multiplexer 206. In addition, the multiplexer 206 adds a process of encoding the mv _ shift value as mvdpreparation. The decoding apparatus shown in fig. 14 includes a processing section provided in the code decoder 501, which adds a decision process of turning on/off decoding of the MV _ shift value in accordance with the decoded values of MB type and 8 × 8Partition, a process of decoding MVD precision as the MV _ shift value, and a process of transmitting the MV _ shift value to the MV predictor 508. The MV predictor 508 is provided with a processing unit for reproducing MVDs, MVDFWs, and MVDBWs associated with MV _ shift into MVs.
Fig. 25, 27, 29, 31, 33, 35, 37, 39, and 41 are block diagrams each showing a configuration of a main part (a motion vector encoding unit) of an embodiment of a moving image encoding device according to the present invention. Fig. 26, 28, 30, 32, 34, 36, 38, 40, and 42 show block diagrams of configurations of main portions (motion vector decoding units) of an embodiment of a moving image coding apparatus according to the present invention, which correspond to the coding apparatuses of fig. 25, 27, 29, 31, 33, 35, 37, 39, and 41, respectively.
In the drawings, substantially the same functional blocks are denoted by the same reference numerals. The configuration and operation of the apparatus in each figure can be easily realized by the description of the above embodiments 1 to 4, and therefore, only the correspondence with the above embodiments is shown, and detailed description is omitted.
The devices in fig. 25 and 26 are each configured by a circuit that executes expressions (1) and (2) in embodiment 1, and the determination of the shift (mv _ shift) value is controlled only by an external input (obtained at the time of motion vector detection). The MV predictor 215 generates a prediction motion vector PMV using the memory 101 in which the motion vector MV of each block is stored. The subtractor 102 takes the difference MV-PMV between them. The right shift processing unit 103 performs right shift on the MV-PMV. On the decoding side, since the inverse process on the encoding side is performed, the memory 101 storing the motion vector MV, the left shift processing unit 113, and the adder 112 are provided.
The devices in fig. 27 and 28 are each configured by a circuit that executes expressions (1) and (2) in embodiment 1, and the determination of the shift (mv _ shift) value is determined and controlled in accordance with any of conditions such as an external input (obtained at the time of motion vector detection) and the type of macroblock. When a specific block type is selected by the shift value selection section 104, an mv _ shift value is selected, and the right shift processing section 103 is processed by the control circuit 105 with an mv _ shift value corresponding to the block type from the mv _ shift value from the section.
The apparatuses in fig. 29 and 30 are each configured by a circuit that executes each of the expressions (1) and (2) in embodiment 1, and the determination of the shift (mv _ shift) value is determined and controlled only in accordance with conditions such as the type of macroblock.
The devices in fig. 31 and 32 are each configured by a circuit that executes expressions (3) and (5) in example 2, and the determination of the shift (mv _ shift) value is controlled only by an external input (obtained at the time of motion vector detection). The precision correction processing unit 106 performs processing of (PMV > > mv _ shift) < < mv _ shift in expression (3).
The devices in fig. 33 and 34 are each configured by a circuit that executes expressions (3) and (5) in example 2, and the determination of the shift (mv _ shift) value is determined and controlled in accordance with any of conditions such as an external input (obtained at the time of motion vector detection) and the type of macroblock.
The apparatuses of fig. 35 and 36 are respectively constituted by circuits that execute the expressions (3) and (5) of embodiment 2, and the decision of the shift (mv _ shift) value is controlled only according to the type of macroblock or the like.
The devices in fig. 37 and 38 are each configured by a circuit that executes expressions (4) and (6) in embodiment 2, and the determination of the shift (mv _ shift) value is controlled only by an external input (obtained at the time of motion vector detection).
The devices in fig. 39 and 40 are each configured by a circuit that executes expressions (4) and (6) in example 2, and the determination of the shift (mv _ shift) value is determined and controlled in accordance with any of conditions such as an external input (obtained at the time of motion vector detection) and the type of macroblock.
The apparatuses in fig. 41 and 42 are each configured by a circuit that executes each of the expressions (4) and (6) in example 2, and the determination of the shift (mv _ shift) value is determined and controlled in accordance with any one of conditions such as the type of macroblock.
< example 5>
FIG. 18 is a process flow chart of an encoding method of embodiment 5.
Embodiment 5 is an encoding/decoding method for switching the accuracy of a coded motion vector in order to solve the problem of an enlarged memory access area in motion compensation using a filter with a long number of taps.
The predicted values generated using the long filter are only predicted pixels at or below pixel precision. Therefore, by limiting the encoding accuracy of the motion vector to integer pixels, the memory access area can be reduced. However, limiting the encoding accuracy of the motion vector to integer pixels degrades the prediction performance. Therefore, in the present embodiment 5, the pixel accuracy is limited in accordance with the degree to which the expansion of the memory access range affects the device implementation or the software implementation. In particular, only when the block size is small at the time of motion compensation, the encoding accuracy of the motion vector is limited.
The smaller the block size becomes, the larger the influence of the enlargement of the memory access area becomes. Smaller blocks have fewer pixels to access. Therefore, when a large block and a small block are compared, the smaller the block size, the larger the ratio of the access area to the original access area.
In the encoding apparatus method according to the present embodiment, when motion compensation with 1/4 pixel accuracy is performed on the block division in fig. 7, first, as in fig. 18, block size determination is performed (processing 801), and an mv _ shift value is selected. In the case of the present embodiment, 1/2-pixel precision is selected in 8 × 8Partition 2(8 × 4) and 8 × 8Partition 3(4 × 8) (processing 811), integer-pixel precision is selected in 8 × 8Partition 3(4 × 4) (processing 812), 1/4-pixel precision is selected in 8 × 8 pixels and a block having a large size above this (processing 813 of fig. 18), and the right shift processing section 103 is driven with the selected mv _ shift for motion compensation. In encoding a motion vector, mv _ shift is set to 1 in blocks of 8 × 4 and 4 × 8 pixels, mv _ shift is set to 2 in blocks of 4 × 4 pixels, and mv _ shift is set to 0 in other blocks of pixel sizes.
In the scheme using P-picture and B-picture, the above-described switching of precision may be applied only to B-picture, and motion compensation may be performed at 1/4 pixel precision in P-picture regardless of the block size. Further, although only the block size for motion compensation with integer pixel precision is set to 4 × 4 here, it may be extended to 8 × 4 and 4 × 8. In this case, mv _ shift is set to 2 in blocks of 8 × 4, 4 × 8, and 4 × 4 pixel sizes, and mv _ shift is set to 0 in blocks of other pixel sizes.
The motion vector encoding unit and the motion vector decoding unit in the moving image encoding device and the moving image decoding device according to the present embodiment are configured in the same manner as in fig. 41 and 42, respectively.
< example 6>
Fig. 19, 45 and 46 are a processing flow chart of an encoding method, a configuration diagram of a main part of an encoding apparatus and a configuration diagram of a main part of a decoding apparatus according to embodiment 6 of the present invention, respectively.
In order to solve the problem of the expansion of the memory access area in the motion compensation using the filter with a long number of taps, the present embodiment also limits the memory access range by encoding each of the vertical and horizontal components of the motion vector with different encoding accuracies.
As shown in fig. 19, the shift selection unit 124 of the encoding apparatus determines whether or not the motion vector is a vertical component (step 801), and selects mv _ shift. The type adaptation unit 124 drives the right shift processing unit 103 with the selected mv _ shift to perform motion compensation. In this embodiment, motion compensation with 1/4 pixel accuracy is performed to set the vertical component of a motion vector to integer pixel accuracy (step 812), the horizontal component to 1/4 pixel accuracy (step 813), mv _ shift when encoding/decoding the vertical component to 2, and mv _ shift when encoding/decoding the horizontal component to 0.
The method of limiting the encoding accuracy of the vertical component of the motion vector, which has a large influence on the expansion of the memory access range, of the present embodiment is effective. The image data is typically stored in memory in raster scan order from left to right. For this reason, in the case where the access range is expanded for the adjacent pixels from a certain pixel, 1 pixel in the horizontal direction means 1 pixel level, and 1 pixel in the vertical direction means 1 line level. Therefore, the number of work involved in memory access in the vertical direction is larger than that in the horizontal direction. Furthermore, in the method of storing 1-pixel 1-byte pixel data not in byte units (1 pixel) but in word units (2 pixels) or dword units (4 pixels), the expansion of the memory access range in the horizontal direction occurs in word units or dword units, and therefore the influence thereof is not so large. On the other hand, even if the access is on the order of 1 pixel in the vertical direction, the memory access range inevitably increases. Therefore, a method of limiting the encoding accuracy of the motion vector in the vertical direction is effective in terms of reducing the memory access range.
Further, the processes of example 5 and example 6 may be combined to perform the processing shown in fig. 23. That is, the shift selector 124 limits the vertical component of the motion vector to integer pixels only for blocks having sizes of 8 × 4, 4 × 8, and 4 × 4 pixels. Further, a means of switching the vector component that limits the range according to the block size is also effective.
As described above, the smaller the block size, the larger the block size, which is also referred to as the block aspect ratio, due to the influence of the expansion of the memory access area. That is, in the case where the ratio of the vertical and horizontal sizes of the blocks is different, the influence of the expansion of the access range of the component becomes larger as the size is smaller. Considering the block division in fig. 7, it can be said that it is effective to impose a restriction on a component having a size of 4 pixels.
< example 7>
Fig. 24, 43 and 44 are a processing flow chart of an encoding method, a main part configuration diagram of an encoding device and a main part configuration diagram of a decoding device according to embodiment 7 of the present invention, respectively.
In the present embodiment, as shown in the processing flowchart of fig. 24, the shift value selection unit 124 of the encoding device (fig. 43) and the decoding device (fig. 44) sets the horizontal component to integer pixel accuracy (mv _ shift ═ 2) and the vertical component to 1/4 pixel accuracy (mv _ shift ═ 0) when the block size is 8 × 4 (vertical × horizontal), sets the horizontal component to 1/4 pixel accuracy (mv _ shift ═ 0) and the vertical component to integer pixel accuracy (mv _ shift ═ 2) when the block size is 4 × 8 (vertical × horizontal), and sets both the horizontal and vertical components to integer pixel accuracy (mv _ shift ═ 2) when the block size is 4 × 4 (vertical × horizontal). In addition, from the viewpoint of predictive performance, the processing of the horizontal/vertical components of the 8 × 4 and 4 × 8 systems may be replaced. This is due to the concept that the smaller the size, the more efficient the prediction method with high component accuracy. Which method is applied is determined according to the application such as the necessity of memory access restriction, encoding performance, bit rate, and the like.
< example 8>
Fig. 20, 47 and 48 are a processing flow chart of an encoding method, a main part configuration diagram of an encoding device and a main part configuration diagram of a decoding device according to embodiment 8 of the present invention, respectively. This embodiment is a method of limiting the vertical component of a motion vector to even-pixel accuracy in embodiment 7 when an input image is an interlaced signal and a macroblock has a frame structure.
Fig. 17 shows a macroblock in the case of encoding/decoding an interlaced signal in a frame structure. The solid lines on the figure mean the odd fields (top fields) and the dashed lines mean the even fields (bottom fields). As can be seen from fig. 17, the motion vector of the odd value is a motion vector in which a predicted value in the odd field is generated from the even field in the parameter image and a predicted value in the even field is generated from the odd field in the parameter image. In the interlaced signal, the odd-numbered field and the even-numbered field are displayed at different timings, so that the vertical component vector of the odd-numbered value is not actually generated.
Therefore, in the present embodiment, in the case where the input image is an interlaced signal and the macroblock has a frame structure, the vertical component of the motion vector is limited to even-pixel accuracy. In the encoding/decoding apparatus, mv _ shift when vertical components are encoded/decoded is set to 3 (processing 803, 814 in fig. 20), and mv _ shift when horizontal components are encoded/decoded is set to 0 (processing 813 in fig. 20). Even in the case of this frame structure of the interlaced signal, as shown in the flowcharts of fig. 21 and 22, the vertical component of the motion vector can be limited to integer pixels only for blocks having sizes of 8 × 4, 4 × 8, and 4 × 4 pixels (process 801 of fig. 21) in combination with the method of embodiment 7. Further, as a coding method of an interlaced signal, there are a frame structure, a field structure, and an adaptation method of the frame structure and the field structure for each macroblock, and a selection method of coding accuracy of a motion vector may be changed according to this method. For example, in a coding standard for processing an interlaced signal and a progressive signal, a coding method of a frame structure may be the same regardless of signal scanning. In this case, a method may be used in which encoding/decoding is performed on a block having a small size with the encoding accuracy of a motion vector in the vertical direction limited to integer-pixel accuracy in the frame structure and the field structure (processing 812 in fig. 20, 21, and 22), and encoding/decoding is performed on a block having a small size with the encoding accuracy of a motion vector in the vertical direction limited to even-pixel accuracy in the frame structure (processing 814 in fig. 20 and 21) and with the encoding/decoding is performed on a block having a small size limited to integer-pixel accuracy in the field structure (processing 812 in fig. 20 and 21) in an adaptive scheme in which the frame structure and the field structure are switched for each macroblock. In this case, the encoding accuracy of the motion vector in the vertical direction may be limited to the even-pixel accuracy regardless of the block size in the frame structure (processing 814 in fig. 22), and the encoding/decoding may be performed by limiting the block having a small size to the integer-pixel accuracy in the field structure (processing 801 and processing 812 in fig. 22).
In the memory access range reduction modes of embodiments 7 and 8, the encoding/decoding process of the mv _ shift value is not required. Thus, the MVD Prediction13 in fig. 1 and 2 and mv _ shift in fig. 11 and 12 are not required. In addition, the process of passing the mv _ shift value from motion compensator 211 to multiplexer 206 is not required in fig. 13. Further, in fig. 14, the process of transferring the MV _ shift value from the code interpreter 501 to the MV predictor 508 is not required. The MV _ shift value is determined by the MV predictor 508 in a prediction manner.
The memory access range reduction method of embodiment 8 is not limited to the above-described embodiments, but uses means for switching the accuracy of the encoded motion vector and the accuracy of the predictive-encoded motion vector, "the encoding accuracy of the motion vector is limited to integer pixels in accordance with the block size," the encoding accuracy of the vertical component of the motion vector is limited to integer pixels or even pixels, "and the accuracy of the motion compensation, the type of the prepared encoding accuracy of the motion vector, and the block size for switching the encoding accuracy of the motion vector. In the motion compensation method in which the memory access range is reduced by limiting the accuracy of the motion vector to 1/2 pixel accuracy, the method of limiting the accuracy of the motion vector to 1/2 pixel accuracy, instead of integer pixel accuracy, can be realized by the present invention.
The present invention is used in an industrial field where a technique for encoding image information into a digital signal with a smaller code amount is required in a device or system for transmitting, storing, and displaying a moving image.

Claims (2)

1. A moving picture encoding method having:
a step of dividing an image into a plurality of coding blocks, predicting a motion vector in a coding block from a motion vector at an adjacent position, and coding a differential motion vector calculated from the motion vector to be coded and the predicted motion vector on a block-by-block basis,
the moving picture encoding method is characterized by further comprising:
and a step of preparing a plurality of kinds of motion vector precisions, wherein the data length of the motion vector and the bit string of the predicted motion vector is a length capable of expressing a vector value with the highest precision among the prepared precisions, selecting the motion vector precision, calculating a corrected motion vector and a bit string of the corrected predicted motion vector, which are obtained by right arithmetic shifting the bit string of the motion vector and the bit string of the predicted motion vector by a bit size indicating a numerical value with a precision higher than the selected precision, and encoding a differential motion vector calculated from the corrected predicted motion vector and the corrected motion vector.
2. A moving picture encoding method having:
a step of dividing an image into a plurality of coding blocks, predicting a motion vector in a coding block from a motion vector at an adjacent position, and coding a differential motion vector calculated from the motion vector to be coded and the predicted motion vector on a block-by-block basis,
characterized in that the moving picture coding method further comprises:
preparing a plurality of kinds of motion vector precisions, the data length of the motion vector and the bit string of the predicted motion vector being a length capable of expressing a vector value with the highest precision among the prepared precisions, preparing a plurality of kinds of block types different in the number of motion vectors to be encoded as the kind of the encoding block, further, each block type includes identification information specifying the accuracy of the motion vector, a block type corresponding to a combination of the accuracy of the motion vector and the number of motion vectors in the block is selected, a corrected motion vector and a bit string of the corrected predicted motion vector are calculated by right arithmetic shifting the bit string of the motion vector and the bit string of the predicted motion vector by a bit size indicating a numerical value with accuracy higher than the selected accuracy, and encoding the block type and a differential motion vector calculated from the corrected predicted motion vector and the corrected motion vector.
HK07102503.9A 2002-01-24 2007-03-07 Moving picture signal coding method, decoding method, coding apparatus, and decoding apparatus HK1095461B (en)

Applications Claiming Priority (10)

Application Number Priority Date Filing Date Title
JP2002014974 2002-01-24
JP2002-14974 2002-01-24
JP2002036130 2002-02-14
JP2002-36130 2002-02-14
JP2002093541 2002-03-29
JP2002-93541 2002-03-29
JP2002-267555 2002-09-13
JP2002267555 2002-09-13
JP2002-330209 2002-11-14
JP2002330209 2002-11-14

Publications (2)

Publication Number Publication Date
HK1095461A1 HK1095461A1 (en) 2007-05-04
HK1095461B true HK1095461B (en) 2010-04-09

Family

ID=

Similar Documents

Publication Publication Date Title
JP4401783B2 (en) Video encoding method
US7567617B2 (en) Predicting motion vectors for fields of forward-predicted interlaced video frames
JP4724351B2 (en) Image encoding apparatus, image encoding method, image decoding apparatus, image decoding method, and communication apparatus
US8175159B2 (en) Moving picture signal coding method, decoding method, coding apparatus, and decoding apparatus
US20050053298A1 (en) Four motion vector coding and decoding in bi-directionally predicted interlaced pictures
KR100272812B1 (en) Video signal coder
JP4355319B2 (en) Video decoding method
CN100508615C (en) Encoding method, decoding method, encoding device, and decoding device of moving image
JP2004048522A (en) Moving image encoding method and decoding method
HK1095461B (en) Moving picture signal coding method, decoding method, coding apparatus, and decoding apparatus
JP2002232892A (en) Image coding device
JP2020025308A (en) Image encoding method and image decoding method
HK1155017A (en) Predicting motion vectors for fields of forward-predicted interlaced video frames
HK1149658A1 (en) Coding and decoding for interlaced video
HK1149658B (en) Coding and decoding for interlaced video
HK1149405B (en) Coding and decoding for interlaced video