WO2020001591A1 - Decoding and encoding methods and apparatus thereof - Google Patents
Decoding and encoding methods and apparatus thereof Download PDFInfo
- Publication number
- WO2020001591A1 WO2020001591A1 PCT/CN2019/093574 CN2019093574W WO2020001591A1 WO 2020001591 A1 WO2020001591 A1 WO 2020001591A1 CN 2019093574 W CN2019093574 W CN 2019093574W WO 2020001591 A1 WO2020001591 A1 WO 2020001591A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image block
- motion vector
- template
- candidate
- current image
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/573—Motion compensation with multiple frame prediction using two or more reference frames in a given prediction direction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/103—Selection of coding mode or of prediction mode
- H04N19/107—Selection of coding mode or of prediction mode between spatial and temporal predictive coding, e.g. picture refresh
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
- H04N19/12—Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
- H04N19/122—Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/567—Motion estimation based on rate distortion criteria
Definitions
- the present application relates to the technical field of video encoding and decoding, and in particular, to a decoding and encoding method and a device thereof.
- a complete video encoding method may include prediction, transformation, quantization, entropy encoding, and filtering.
- predictive coding includes intra coding and inter coding.
- Inter-frame coding uses the correlation of the video time domain to predict the pixels of the current image by using the pixels adjacent to the encoded image to effectively remove the video time domain redundancy.
- the coding process is performed on a block-by-block basis.
- a template refers to decoding information of a fixed shape around the current image block (adjacent regions in the time or space domain).
- the template is exactly the same at the encoding and decoding ends. Therefore, some operations performed by the template on the encoding side can obtain completely consistent results on the decoding side. In other words, the information derived by the encoder based on the template can be recovered losslessly at the decoder without the need to pass additional information, which can further reduce the number of transmitted bits.
- the traditional template generation method has problems such as low decoding efficiency and large decoding delay.
- the application provides a decoding and encoding method and a device thereof, which can help improve decoding efficiency, reduce decoding delay, and improve encoding and decoding performance.
- This application provides a decoding method, which is applied to a decoding end.
- the method includes: acquiring motion information of a candidate image block of a current image block; acquiring a template of the current image block according to the motion information of the candidate image block; The template of the current image block decodes the current image block.
- the present application provides an encoding method, which is applied to an encoding end.
- the method includes: acquiring motion information of a candidate image block of a current image block; acquiring a template of the current image block according to the motion information of the candidate image block; The template of the current image block encodes the current image block to obtain an encoded bit stream corresponding to the current image block; and sends the encoded bit stream to a decoding end.
- This application provides a decoding device, which includes a processor and a machine-readable storage medium.
- the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is configured to execute the machine-executable instructions to implement the foregoing method steps.
- This application provides an encoding end device, which includes a processor and a machine-readable storage medium.
- the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; the processor is configured to execute the machine-executable instructions to implement the foregoing method steps.
- a template of the current image block may be obtained according to the motion information of the candidate image block of the current image block, and the current image block may be decoded according to the template of the current image block.
- the above method can quickly obtain the template of the current image block, which can effectively improve decoding efficiency, reduce decoding delay, and improve encoding and decoding performance.
- FIG. 1 is a flowchart of an encoding method according to an embodiment of the present application.
- 2A-2O are schematic diagrams of a template of a target image block in an embodiment of the present application.
- 3A-3D are flowcharts of an encoding method in another embodiment of the present application.
- FIG. 4 is a flowchart of a decoding method according to an embodiment of the present application.
- FIG. 5 is a flowchart of a decoding method in another embodiment of the present application.
- FIG. 6 is a structural diagram of a decoding device according to an embodiment of the present application.
- FIG. 7 is a block diagram of an encoding device according to an embodiment of the present application.
- FIG. 8 is a hardware structural diagram of a decoder device in an embodiment of the present application.
- FIG. 9 is a hardware structural diagram of an encoding end device in an embodiment of the present application.
- first, second, third, etc. may be used to describe various information in the embodiments of the present application, these terms are only used to distinguish the same type of information from each other.
- first information may also be referred to as the second information
- second information may also be referred to as the first information.
- word “if” can be interpreted as “at” or “at " or "in response to a determination”.
- a method for decoding and encoding is proposed in the embodiment of the present application.
- the method may involve the following concepts:
- Motion Vector In inter-frame coding, a motion vector is used to represent a relative displacement between a current image block of a current frame image and a reference image block of a reference frame image. For example, there is a strong time-domain correlation between image A of the current frame and image B of the reference frame.
- image block A1 current image block
- image block B1 reference image block
- This relative displacement is also the motion vector of the image block A1.
- each image block has a corresponding motion vector transmitted to the decoding end.
- the motion vector of each image block is independently encoded and transmitted, it consumes a considerable number of bits.
- the spatial correlation between adjacent image blocks can be used to predict the motion vector of the current image block to be encoded according to the motion vector of the adjacent encoded image block, and then the prediction difference is For encoding.
- Motion information In order to accurately point to an image block, in addition to acquiring motion vectors, index information of a reference frame image is required to indicate which reference frame image is used. For the current frame image, a reference frame image list can usually be established. The reference frame index indicates that the current image block uses the reference frame image in the reference frame image list. Motion-related information such as motion vectors and reference frame indexes can be collectively referred to as motion information.
- Template In video coding technology, the coding process is performed on an image-by-image block basis. When encoding the current image block, reconstruction information of the surrounding coded image blocks is available.
- the template refers to the encoding / decoding information of a fixed shape around the current image block (adjacent areas in the time domain or the spatial domain).
- the template is exactly the same at the encoding and decoding ends. Therefore, some operations performed by the template on the encoding end can be used to obtain completely consistent results on the decoding end. In other words, the information derived by the encoder based on the template can be recovered losslessly at the decoder without the need to pass additional information, which can further reduce the number of transmitted bits.
- Rate-Distortion Optimized There are two major indicators for evaluating coding efficiency: bit rate (also known as Bit Rate, Second, BPS) and PSNR (Peak Signal to Noise Ratio, peak signal-to-noise ratio). For the same video, the smaller the encoded bitstream, the greater the compression ratio; the larger the PSNR, the better the reconstructed image quality. In the mode selection, the discrimination formula is essentially a comprehensive evaluation of the two. For example, the cost of the model:
- D Distortion
- D Distortion
- SSE Sud-Square Error index
- ⁇ the Lagrange multiplier
- R the actual number of bits required for image block coding in this mode, including the sum of the bits required for coding mode information, motion information, and residuals.
- Intra prediction refers to the use of reconstructed pixel values of spatially adjacent image blocks of the current image block (that is, in the same frame image as the current image block) for predictive encoding.
- Inter prediction refers to the use of reconstructed pixel values of time-domain neighboring image blocks of the current image block (in a different frame image from the current image block) for predictive coding.
- the method may include the following steps:
- Step 101 The encoder obtains motion information of a candidate image block of the current image block.
- the candidate image block of the current image block may include, but is not limited to, a spatial-domain candidate image block of the current image block; or a time-domain candidate image block of the current image block. There are no restrictions on this candidate image block.
- the encoder can directly obtain the motion information of the candidate image block, such as the candidate image block.
- the motion vector and reference frame index are not limited.
- Step 102 The encoder obtains a template of the current image block according to the motion information of the candidate image block.
- Step 103 The encoding end encodes the current image block according to the template of the current image block to obtain an encoded bit stream corresponding to the current image block.
- Encoding the current image block according to the template of the current image block to obtain the encoded bit stream corresponding to the current image block may include, but is not limited to: obtaining the original mode information of the current image block; obtaining based on the template and original mode information of the current image block, obtaining Target mode information of the current image block; encoding the current image block according to the target mode information to obtain a coded bit stream corresponding to the current image block.
- the original mode information is the original motion vector
- the target mode information is the target motion vector.
- the original mode information is the original motion vector and the original reference frame
- the target mode information is the target motion vector and the target reference frame.
- the original mode information is The original prediction image block
- the target mode information is the target prediction image block.
- Step 104 The encoding end sends the encoded bit stream to the decoding end.
- the encoding bit stream corresponding to the current image block sent by the encoding end to the decoding end may carry first instruction information, where the first instruction information is used to instruct the decoding end to base on the current image
- the template and original mode information of the block obtain the target mode information of the current image block.
- the bit stream corresponding to the current image block sent by the encoding end to the decoding end may carry second instruction information, and the second instruction information is used to instruct the decoding end to pair the original image information based on the original mode information. Decode the current image block.
- the first instruction information or the second instruction information is notified in an explicit manner.
- the notification may also be performed in an implicit manner, that is, the first indication information or the second indication information is not carried in the encoded bit stream corresponding to the current image block.
- the encoding end and the decoding end may also negotiate a decision strategy or define a decision strategy in a standard, and store the decision strategies on the encoding end and the decoding end, respectively.
- the decision strategy may agree on first strategy information, and the first strategy information is used to indicate that target mode information of the current image block is obtained based on a template of the current image block and original mode information.
- the decision strategy may agree on the second strategy information, and the second strategy information is used to instruct the current image block to be decoded based on the original mode information.
- the decision strategy may agree on the third strategy information, and the third strategy information is the same strategy information as the candidate image block of the current image block.
- the encoded bit stream corresponding to the current image block may not carry the first indication information and the second indication information.
- the encoded bit stream corresponding to the current image block may not carry the first indication information and the second indication information.
- the encoded bit stream corresponding to the current image block may not carry the first indication information and The second instruction information.
- the encoded bit stream corresponding to the current image block may not carry the first indication information and The second instruction information.
- the template of the current image block can be obtained according to the motion information of the candidate image block of the current image block, and the current image block is encoded according to the template of the current image block to obtain the encoded bit stream corresponding to the current image block.
- the above method can quickly obtain the template of the current image block, which can effectively improve encoding efficiency, reduce encoding delay, and improve encoding performance.
- each image block of each frame of image is encoded one by one.
- the encoding information of the adjacent image blocks can be used. Reconstruct the current image block.
- the encoding information of the neighboring image blocks of the current image block can be used to obtain the template of the current image block.
- the encoding information may include, but is not limited to, reconstruction information and / or prediction information of neighboring image blocks.
- the reconstruction information may include, but is not limited to, a luminance value, a chrominance value, and the like.
- the prediction information may be an intermediate value capable of obtaining reconstruction information. For example, if a luminance value can be obtained using the intermediate value, the intermediate value is prediction information, and the present disclosure does not limit the prediction information.
- the generation of the template of the current image block needs to wait until the reconstruction stage, which greatly reduces the efficiency of encoding and decoding, and brings the delay of encoding and decoding.
- the encoding information includes prediction information
- the generation of the template of the current image block also needs to wait until the reconstruction stage, which greatly reduces the efficiency of encoding and decoding and brings about the delay of encoding and decoding. Therefore, the above-mentioned method will greatly affect the parallelism of encoding and decoding.
- a template that can acquire a current image block according to the motion information (such as a motion vector and a reference frame index) of a candidate image block of the current image block is proposed.
- both the encoding end and the decoding end can apply the method for obtaining a template of the current image block according to the motion information of the candidate image block.
- Obtaining a template of the current image block according to the motion information of the candidate image block may include: when the motion information of the candidate image block includes a motion vector of the candidate image block and a reference frame index, determining the candidate image block ’s A reference frame image; obtaining a reference image block of the candidate image block from the reference frame image according to the motion vector, and obtaining a template of the current image block according to the reference image block.
- image block A1 is the current image block
- image blocks A2 and A3 are candidate image blocks of image block A1.
- the reference frame index of the image block A2 is the index of the image B
- the image block B2 corresponding to the image block A2 is selected from the image B ( As shown by the dashed arrows in the figure), the position of image block B2 in image B is the same as the position of image block A2 in image A; then, image block B2 can be moved according to the motion vector of image block A2, such as using The motion vector (3, 3) moves the image block B2 to obtain the image block B2 'corresponding to the image block B2 (such as moving 3 pixels to the right and 3 pixels upward), and the image block B2' is the image block A2.
- Reference image block Similarly, it can be determined that the reference image block of the image block A3 is the image block B3 '(as shown by the dotted arrow in the figure). Further, the template of the image block A1 may be determined according to the image blocks B2 'and B3', as shown in FIG. 2A.
- the candidate image block may include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is greater than or A natural number equal to 0, and N is a natural number greater than or equal to 1.
- the first candidate image block is a candidate image block on the upper side of the current image block
- the second candidate image block is a candidate image block on the left side of the current image block.
- acquiring the template of the current image block according to the motion information of the candidate image block may include, but is not limited to: determining the first template according to the motion vector prediction mode and the motion information of the M first candidate image blocks; A second template is determined based on the motion vector prediction mode and motion information of each second candidate image block; then, a template for the current image block is determined based on the first template and the second module.
- determining the template of the current image block based on the first template and the second template may include, but is not limited to: determining the first template as the template of the current image block; or determining the second template as the template of the current image block; or , Determine the template of the current image block after stitching the first template and the second template.
- a first template may be determined according to the motion vector prediction mode and motion information of the M first candidate image blocks, and the first template may be determined as a template of the current image block. If N is a natural number greater than or equal to 1, and M is 0, a second template may be determined according to the motion vector prediction mode and motion information of the N second candidate image blocks, and the second template may be determined as a template of the current image block.
- the first template may be determined according to the motion vector prediction mode and motion information of the M first candidate image blocks, and according to the N second candidate image blocks Determine the second template based on the motion vector prediction mode and motion information, and determine the template of the current image block according to the first template and the second template, which may specifically include determining the first template as the template of the current image block, or determining the second template A template of the current image block, or a template of the current image block determined after stitching the first template and the second template.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block.
- the prediction mode of the adjacent image block is an inter mode or an intra mode
- the prediction mode of the next adjacent image block is an inter mode.
- the first candidate image block may include at least one adjacent image block whose prediction mode is inter mode, for example, all adjacent image blocks on the upper side of the current image block, or the first adjacent image block on the upper side of the current image block, Or any one or more adjacent image blocks on the upper side of the current image block.
- the first candidate image block may further include at least one second neighboring image block whose prediction mode is the inter mode, for example, the upper side of the current image block All second-neighbor image blocks, or the first second-neighbor image block above the current image block, or any one or more second-neighbor image blocks above the current image block.
- the first candidate image block may further include adjacent image blocks in the intra mode, for example, the first intra mode on the upper side of the current image block. Adjacent image blocks of all images, adjacent image blocks of all intra-modes above the current image block, and so on.
- the above is only an example of the first candidate image block, which is not limited thereto.
- the second candidate image block includes a neighboring image block and / or a next-neighbor image block on the left side of the current image block.
- the prediction mode of the adjacent image block is an inter mode or an intra mode
- the prediction mode of the next adjacent image block is an inter mode.
- the second candidate image block may include at least one adjacent image block whose prediction mode is inter mode, for example, all adjacent image blocks to the left of the current image block, or the first adjacent image block to the left of the current image block, Or any one or more adjacent image blocks to the left of the current image block.
- the second candidate image block may further include at least one second-neighbor image block whose prediction mode is the inter mode, for example, the left side of the current image block All second-neighbor image blocks, or the first second-neighbor image block to the left of the current image block, or any one or more second-neighbor image blocks to the left of the current image block.
- the second candidate image block may also include adjacent image blocks in the intra mode, for example, the first intra mode on the left side of the current image block. Adjacent image blocks of, the adjacent image blocks of all intra-modes to the left of the current image block, and so on.
- the above is only an example of the second candidate image block, which is not limited.
- the adjacent image blocks of the current image block include, but are not limited to: spatially adjacent image blocks of the current image block (that is, adjacent image blocks in the same frame of image); or, temporal image adjacent blocks of the current image block (that is, different Adjacent image blocks in a frame image).
- the second-neighbor image block of the current image block includes, but is not limited to, the spatially-neighbor image block of the current image block (that is, the second-neighbor image block in the same frame image); or the time-domain next-neighbor image block of the current image block (that is, different The next-most neighboring image block in the frame image).
- the first template when M is greater than 1, the first template may include M sub-templates or P sub-templates, and is composed of M sub-templates or P sub-templates, and P may be the first candidate image block of the inter-frame mode. Quantity, P is less than or equal to M. For example, if the M first candidate image blocks are all candidate image blocks of the inter-mode, the first template may include M sub-templates and be formed by splicing the M sub-templates.
- the first template may include M sub-templates (that is, each candidate image block (Corresponding to a sub-template), and is composed of M sub-templates; or, the first template may include P sub-templates (that is, P sub-templates corresponding to P inter-mode candidate image blocks), and P sub-templates to make.
- the first template may include a first sub-template, and the first sub-template may be determined according to a motion vector prediction mode and motion information of any candidate image block on the upper side of the current image block.
- the first candidate image block includes at least one neighboring image block or a second neighboring image block whose prediction mode is the inter mode
- the first template includes the neighboring image blocks of the inter mode or The first sub-template corresponding to the next neighboring image block.
- the motion information may include a motion vector and a reference frame index of the first candidate image block.
- the first template is determined according to the motion vector prediction mode and motion information of the M first candidate image blocks, which may include, but not Limited to:
- Case 1 For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, the reference frame of the i-th candidate image block is used The index determines the reference frame image of the i-th candidate image block; according to the motion vector of the i-th candidate image block, the reference image block of the i-th candidate image block is determined from the reference frame image, and the reference image block and the i-th candidate image block The relative displacement of the candidate image block matches the motion vector of the ith candidate image block; then, according to the determined reference image block, an image block having a size of the first horizontal length and the first vertical length can be obtained as the first template.
- the i-th child template For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, the reference frame of the i-th candidate image block is used The index determines the reference frame image of the
- Case 2 For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is set to a default value (Such as the default pixel value, which can be a brightness value that is pre-configured based on experience) padding, based on the image blocks filled with the default values, to obtain image blocks of the first horizontal length and the first vertical length as the i-th included in the first template Child templates.
- a default value Such as the default pixel value, which can be a brightness value that is pre-configured based on experience
- Case 3 For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, according to the reference frame corresponding to the i-th candidate image block The index determines the reference frame image corresponding to the i-th candidate image block; according to the motion vector corresponding to the i-th candidate image block, a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the reference image block and The relative displacement of the i-th candidate image block matches the motion vector corresponding to the i-th candidate image block (including equal or approximately equal); according to the determined reference image block, the size of the first horizontal length and the first vertical length is obtained
- the image block includes the i-th sub-template included in the first template.
- the reference frame index and motion vector corresponding to the i-th candidate image block may be reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- the first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship (such as 1: 1, 1: 2, 2: 1, etc., which is not limited), or the horizontal length of the current image block Meet the second proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the first preset length (configurable according to experience).
- a first proportional relationship such as 1: 1, 1: 2, 2: 1, etc., which is not limited
- the horizontal length of the current image block Meet the second proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the first preset length (configurable according to experience).
- the first vertical length and the vertical length of the first candidate image block satisfy a third proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or the vertical length of the current image block satisfies a fourth proportional relationship ( (Such as 1: 1, 1: 2, 2: 1, etc.), or equal to a second preset length (that is, a length configured according to experience).
- a third proportional relationship such as 1: 1, 1: 2, 2: 1, etc.
- a fourth proportional relationship (Such as 1: 1, 1: 2, 2: 1, etc.), or equal to a second preset length (that is, a length configured according to experience).
- the first proportional relationship, the second proportional relationship, the third proportional relationship, and the fourth proportional relationship may be set to be the same or different.
- the first preset length and the second preset length may be set to be the same or different.
- the second template may include N sub-templates or R sub-templates, and is formed by splicing N sub-templates or R sub-templates, where R may be the second candidate for the inter-frame mode.
- the number of image blocks, R is less than or equal to N.
- the second template may include N sub-templates and be spliced from the N sub-templates.
- the second template may include N sub-templates (that is, each candidate image block (Corresponding to one sub-template), and is formed by splicing N sub-templates; or, the second template may include R sub-templates (that is, R sub-templates corresponding to R inter-mode candidate image blocks), and R sub-templates to make.
- the second template may include a second sub-template, and the second sub-template may be determined according to a motion vector prediction mode and motion information of any candidate image block on the left side of the current image block.
- the second candidate image block includes at least one neighboring image block or the next neighboring image block whose prediction mode is the inter mode
- the second template includes the neighboring image blocks of the inter mode or The second sub-template corresponding to the next-neighbor image block.
- the motion information may include a motion vector and a reference frame index of the second candidate image block.
- the second template is determined according to the motion vector prediction mode and motion information of the N second candidate image blocks, which may include but not Limited to:
- Case 1 For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, the reference frame of the i-th candidate image block The index determines the reference frame image of the i-th candidate image block; according to the motion vector of the i-th candidate image block, the reference image block of the i-th candidate image block is determined from the reference frame image, and the reference image block and the i-th candidate image block The relative displacement of the candidate image block matches the motion vector of the i-th candidate image block; then, according to the determined reference image block, an image block having a size of the second horizontal length and the second vertical length can be obtained as a second template including I-th child template.
- Case 2 For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is set to a default value (Such as the default pixel value, which can be a brightness value pre-configured according to experience) padding, based on the image blocks filled with the default values, to obtain image blocks of the second horizontal length and the second vertical length as the i-th included in the second template Child templates.
- a default value Sud as the default pixel value, which can be a brightness value pre-configured according to experience
- Case 3 For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, according to the reference frame corresponding to the i-th candidate image block The index determines the reference frame image corresponding to the i-th candidate image block; according to the motion vector corresponding to the i-th candidate image block, a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the reference image block and The relative displacement of the i-th candidate image block matches the motion vector corresponding to the i-th candidate image block (including equal or approximately equal); according to the determined reference image block, the size of the second horizontal length and the second vertical length is obtained
- the image block serves as an ith sub-template included in the second template.
- the reference frame index and motion vector corresponding to the i-th candidate image block may be reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- the second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship (such as 1: 1, 1: 2, 2: 1, etc., which is not limited), or the horizontal length of the current image block Meet the sixth proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the third preset length (configured according to experience).
- a fifth proportional relationship such as 1: 1, 1: 2, 2: 1, etc., which is not limited
- the horizontal length of the current image block Meet the sixth proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the third preset length (configured according to experience).
- the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or the vertical length of the current image block satisfies an eighth proportional relationship ( (Such as 1: 1, 1: 2, 2: 1, etc.), or equal to the fourth preset length (that is, a length configured according to experience).
- the fifth proportional relationship, the sixth proportional relationship, the seventh proportional relationship, and the eighth proportional relationship may be set to be the same or different.
- the third preset length and the fourth preset length may be set to be the same or different.
- acquiring a template of the current image block according to the motion information of the candidate image block may further include but is not limited to: when the current image block corresponds to multiple motion information, acquiring a template corresponding to each motion information, and For the obtaining method, refer to the foregoing embodiment; then, obtain the weight corresponding to each motion information, and obtain the template of the current image block according to the weight corresponding to each motion information and the template corresponding to the motion information. For example, based on the weight corresponding to each motion information and the template corresponding to the motion information, a template of the current image block may be obtained in a weighted average manner.
- the motion information corresponding to the current image block may include original motion information of the current image block.
- the current image block corresponds to the motion information A and the motion information B
- the template TA corresponding to the motion information A is obtained by using the foregoing embodiment
- the template TB corresponding to the motion information B is obtained by using the foregoing embodiment.
- the weight W1 of the motion information A and the weight W2 of the motion information B can be obtained.
- the template of the current image block can be (TA * W1 + TB * W2) / 2.
- the candidate image block may include adjacent image blocks of all inter-modes on the upper side of the current image block, and adjacent image blocks of all inter-modes on the left side of the current image block.
- the image blocks A3 and A4 may be determined as the second candidate image block of the current image block A1. .
- the image block A2 may be determined as the first candidate image block of the current image block A1.
- the technical solution of this embodiment is no longer adopted, but a conventional method is adopted. If the current image block A1 has candidate image blocks, such as the left candidate image block and / or the upper candidate image block, the technical solution of this embodiment is adopted.
- the template of the current image block A1 can be obtained according to the respective motion information of the image blocks A2, A3, and A4.
- a reference frame image of the image block A2 may be determined according to the reference frame index
- an image block B2 corresponding to the image block A2 is selected from the reference frame image
- the image block B2 is moved according to the motion vector of the image block A2 to obtain an image block.
- A2's reference image block B2 ' the reference image block B3 'of the image block A3 and the reference image block B4' of the image block A4 can be obtained, as shown in FIG. 2C.
- a template of the current image block A1 can be obtained from the reference image blocks B2 ', B3', and B4 '.
- the horizontal length of the upper template of the current image block A1 is W and the vertical length is S.
- the value of W can be configured based on experience, the value of S can be configured according to experience, and the values of W and S are both No restrictions.
- the horizontal length W of the upper template may be the horizontal length of the current image block A1, or the horizontal length of the candidate image block A2, or twice the horizontal length of the current image block A1, and the like
- the vertical length S of the upper template It may be the vertical length of the candidate image block A2, or 1/3 of the vertical length of the candidate image block A2, or the like. Referring to FIG.
- the horizontal length W of the template is the horizontal length of the candidate image block A2, that is, the horizontal length of the reference image block B2';
- the vertical length S of the template It is 1/3 of the vertical length of the candidate image block A2, that is, 1/3 of the vertical length of the reference image block B2 '.
- the horizontal length of the template on the left side of the current image block A1 is R and the vertical length is H.
- the value of R can be configured based on experience, and the value of H can be configured based on experience.
- the vertical length H of the left template may be the vertical length of the current image block A1 or the vertical length of the candidate image block A3
- the horizontal length R of the left template may be the horizontal length of the candidate image block A3 or the candidate image.
- the lateral length of the block A3 is 1/3 and so on.
- the vertical length H of the template is the vertical length of the candidate image block A3
- the horizontal length R of the template is 1 / of the horizontal length of the candidate image block A3.
- the horizontal length of the i-th candidate image block is w i
- the vertical length is S
- the corresponding sub-template is no longer generated; or, it is filled according to the default value (such as the default pixel value, which can be a brightness value pre-configured according to experience), as the i-th sub-template on the upper side.
- the default value such as the default pixel value, which can be a brightness value pre-configured according to experience
- the motion information (such as a motion vector and a reference frame index) of the i-th candidate image block is obtained, and a template with a horizontal length w i and a vertical length S is generated based on the motion vector and the reference frame index.
- a template with a horizontal length w i and a vertical length S is generated based on the motion vector and the reference frame index.
- the i-th sub-template on the upper side Specifically, if the motion vector is MV and the reference frame index is idx, a rectangular block with a relative displacement of MV and a horizontal length of w i and a vertical length of S is found in the idx reference image of the current frame as the upper side. i child templates.
- the current left image block has N candidate image block, the longitudinal length of the i-th candidate image blocks as H i, the lateral length is R, the determined prediction mode candidate image block.
- the corresponding sub-template is no longer generated; or, it is filled according to the default value (such as the default pixel value, which can be a brightness value pre-configured according to experience), as the i-th sub-template on the left.
- the default value such as the default pixel value, which can be a brightness value pre-configured according to experience
- the motion information is acquired i-th candidate image blocks (e.g., motion vector and reference frame index, etc.), to generate a transverse length R based on the motion vector and the reference frame index, the longitudinal length of template h i As the i-th sub-template on the left.
- the motion vector is MV
- the reference frame index idx find the relative displacement of the lateral length of the MV R, a longitudinal length of a rectangular block of idx h i in the reference image of the current frame, a second left-side i child templates.
- the upper template can be stitched from all the sub templates on the upper side
- the left template can be stitched from all the sub templates on the left
- the upper template and the left template are stitched into the template of the current image block.
- the candidate image block may include a neighboring image block of the first inter mode on the upper side of the current image block, and a neighboring image block of the first inter mode on the left of the current image block.
- the image block A3 may be determined as a candidate image block of the current image block A1. If the first image block A2 on the upper side is in an inter mode, the image block A2 may be determined as a candidate image block of the current image block A1.
- the current image block A1 has no candidate image blocks.
- the technical solution of this embodiment is no longer adopted, but a conventional method is adopted. If the current image block A1 has candidate image blocks, such as the left candidate image block and / or the upper candidate image block, the technical solution of this embodiment is adopted.
- a template of the current image block A1 can be obtained according to the respective motion information of the image blocks A2 and A3.
- the reference frame image of the image block A2 can be determined according to the reference frame index
- the image block B2 corresponding to the image block A2 is selected from the reference frame image
- the image block B2 is moved according to the motion vector of the image block A2 to obtain the image block A2 Reference picture block B2 '.
- a reference image block B3 'of the image block A3 can be obtained.
- a template of the current image block A1 can be obtained from the reference image block B2 'and the reference image block B3'.
- the horizontal length of the upper template of the current image block A1 is W and the vertical length is S.
- the value of W can be configured based on experience, the value of S can be configured according to experience, and the values of W and S are both No restrictions.
- the horizontal length W of the upper template may be the horizontal length of the current image block A1 or the horizontal length of the candidate image block A2
- the vertical length S of the upper template may be the vertical length of the candidate image block A2 or the candidate image.
- the length A3 of the block A2 is equal to 1/3.
- FIG. 2F it is a schematic diagram of a template corresponding to the reference image block B2 '.
- the horizontal length of the template on the left side of the current image block A1 is R and the vertical length is H.
- the value of R can be configured based on experience, and the value of H can be configured based on experience.
- the vertical length H of the left template can be the vertical length of the current image block A1 or the vertical length of the candidate image block A3
- the horizontal length R of the left template can be the horizontal length of the candidate image block A3 or a candidate.
- the horizontal length of the image block A3 is 1/3 and so on.
- the prediction mode of the candidate image block is determined. If it is in the intra mode, the corresponding template is no longer generated; or, it is filled according to the default value (such as the default pixel value, which may be a brightness value pre-configured according to experience), and is used as the corresponding upper template. If it is in the inter mode, the motion information (such as the motion vector and the reference frame index) of the candidate image block is obtained, and a template with a horizontal length of w and a vertical length of S is generated based on the motion vector and the reference frame index, as the corresponding upper Side template.
- the default value such as the default pixel value, which may be a brightness value pre-configured according to experience
- the prediction mode of the candidate image block is determined. If it is in the intra mode, the corresponding template is no longer generated; or it is filled according to the default value and used as the corresponding left template. If it is in the inter mode, obtain the motion information (such as the motion vector and reference frame index) of the candidate image block, and generate a template with a horizontal length R and a vertical length h based on the motion vector and the reference frame index, as the corresponding left template .
- the motion information such as the motion vector and reference frame index
- the candidate image block may include a neighboring image block of the first inter mode on the upper side of the current picture block, and a neighboring image block of the first inter mode on the left of the current picture block.
- the horizontal length W of the upper template of the current image block A1 is taken as the horizontal length of the current image block A1
- the vertical length H is taken as the vertical length of the current image block A1
- the candidate image block may include the adjacent image block in the inter mode on the upper side of the current image block, and the next adjacent image block in the inter mode on the upper side of the current image block (that is, when the adjacent image block is in the intra mode, select The adjacent image block corresponds to the current image block that is the second-neighboring image block), the adjacent image block in the inter mode on the left side of the current image block, and the second-neighbor image block in the inter-frame mode on the left side of the current image block.
- the image blocks A3 and A4 in the inter mode can be determined as candidate images of the current image block A1.
- the image block A2 in the inter mode can be determined as a candidate image block of the current image block A1.
- the image block A8 in the inter mode is the next-to-adjacent image block on the left of the current image block A1.
- the next neighboring image block A8 in the inter mode is determined as a candidate image block of the current image block A1.
- the next neighboring image block A6 in the inter mode may be determined as a candidate image block of the current image block A1.
- a template of the current image block A1 is obtained. For details, please refer to the situation First, it is more to obtain sub-templates according to the respective motion information of image blocks A6 and A8. The template is finally shown in FIG. 2I.
- the candidate image block may include the current image block The next neighboring image block in the inter mode.
- the candidate image block may include the current image block left The next neighboring image block of the inter-frame mode.
- the second-neighboring image block A4 in the inter mode can be determined as a candidate image block of the current image block A1.
- the image block A5 is the next-neighbor image block on the left of the current image block A1, so ,
- the next neighboring image block A5 in the inter mode may be determined as a candidate image block of the current image block A1.
- a template of the current image block A1 can be obtained according to the respective motion information of the image blocks A4 and A5.
- the candidate image block may include an adjacent image block in an inter mode on the upper side of the current image block, an adjacent image block in an intra mode on the upper side of the current image block, and an adjacent inter mode in the left side of the current image block.
- the image blocks A3 and A4 in the inter mode can be determined as candidate images of the current image block A1.
- the image block A2 in the inter mode can be determined as a candidate image block of the current image block A1.
- a template of the current image block A1 is obtained.
- a template is obtained according to the respective motion information of the image blocks A5 and A7.
- the template is finally shown in FIG. 2J.
- the motion information of the adjacent image block A6 of the image block A5 can be determined as the motion information of the image block A5.
- the corresponding sub-template can be obtained by using the motion information of the image block A5.
- the motion information of the adjacent image block A8 of the image block A7 can be determined as the image block A7. Motion information, and use the motion information of image block A7 to obtain the corresponding template.
- the candidate image block may include the current image block Adjacent image blocks of the first intra mode on the upper side.
- the candidate image block may include the current image block left Adjacent image blocks of the first intra mode on the side.
- the image block A2 is determined as a candidate image block of the current image block A1. If the first image block A3 on the left side is in the intra mode, even if an image block A5 in the inter mode exists on the left side of the image block A3, the image block A3 in the intra mode can be determined as a candidate image block of the current image block A1.
- a template of the current image block A1 can be obtained according to the respective motion information of the image blocks A2 and A3.
- the motion information of the adjacent image block A4 of the image block A2 can be determined as the motion corresponding to the image block A2 Information, and use the motion information corresponding to the image block A2 to obtain the corresponding template.
- the motion information of the adjacent image block A5 of image block A3 can be determined as the motion information corresponding to image block A3. And use the motion information corresponding to the image block A3 to obtain the corresponding template.
- a motion vector may be used to represent a relative displacement between a current image block in a current frame image and a reference image block in a reference frame image.
- image A is the current frame image
- image block A1 is the current image block
- image B is the reference frame image of image A
- image block B1 is the reference image block of image block A1.
- a motion search can be performed in image B to find image block B1 that best matches image block A1 and determine the image
- the relative displacement between the block A1 and the image block B1, and the relative displacement is also the motion vector of the image block A1.
- the motion vector is (-6, 4), which indicates that the image block B1 moves 6 pixels to the left in the horizontal direction and 4 pixels upwards in the vertical direction compared to the image block A1.
- the encoded bit stream carries the motion vector (-6, 4) of the image block A1, instead of the reconstruction information and / or prediction information of the image block A1.
- the decoder can obtain the motion vector (-6, 4) of image block A1.
- the reference frame image B To determine the position of the reference image block B1, that is, to move 6 pixels to the left and 4 pixels upward at the position of the current image block A1, the position of the reference image block B1 is obtained. The position reads the reference image block B1, and reconstructs the image block A1 by using the reference image block B1.
- the motion vector is carried in the encoded bit stream corresponding to the current image block A1 instead of the reconstruction information of the image block A1. And / or prediction information, thereby saving a lot of bits.
- the motion vector of each image block also occupies more bits. Therefore, in order to further save the number of bits, the motion vector of the adjacent image block can also be used to determine the current image block A1.
- Motion vector For example, in the current frame image A, the image block adjacent to the current image block A1 may include image blocks A2 and A3, and the motion vector list of the current image block A1 may include the motion vector A21 and image block A3 of the image block A2 Motion vector A31.
- the encoded bit stream carries the index value of the original motion vector (for example, the index value of the motion vector A21 in the motion vector list) instead of the image block A1
- the motion vector (-6, 4) is not the reconstruction information and / or prediction information of the image block A1.
- the decoding end can obtain the index value of the original motion vector, and obtain the original motion vector A21 from the motion vector list according to the index value. Since the number of bits occupied by the index value is less than the number of bits occupied by the motion vector, further bits can be saved.
- a target motion vector different from the original motion vector A21 is obtained according to the original motion vector A21, and the target motion vector is used as the image block A1.
- Final motion vector since the target motion vector is the closest to the motion vector of the image block A1, compared with the method of “using the original motion vector A21 as the final motion vector of the image block A1 directly”, the above “taking the target motion vector as The method of "final motion vector of image block A1" can solve problems such as low prediction quality and prediction error.
- the original mode information is the original motion vector of the current image block
- the target mode information is the target motion vector of the current image block.
- the encoding end can obtain the original motion vector of the current image block, and according to the original motion vector and the obtained
- the template obtains the target motion vector of the current image block, which is different from the original motion vector.
- the current image block is encoded according to the target motion vector to obtain an encoded bit stream corresponding to the current image block.
- the encoder can send the encoded bit stream to the decoder.
- the encoding end may first obtain the original motion vector of the current image block. Assuming that the motion vector list of the current image block A1 at the encoding end includes motion vectors A21, A31, A41, and A51 in turn, then select a motion from the motion vector list. The vector serves as the original motion vector of the image block A1.
- the above manner is only an example, and there is no limitation on this.
- the default motion vector may be directly determined as the original motion vector.
- the encoding end selects a motion vector from the motion vector list, which may include: the encoding end selects the first motion vector from the motion vector list; or, selects the last motion vector from the motion vector list; or, selects the motion vector from the motion vector list.
- a motion vector is randomly selected in the method; or a motion vector is selected from the motion vector list using a hash algorithm.
- the above method is only a few examples, and there is no limitation on this, as long as the motion vector can be selected from the motion vector list.
- the motion vector list is used to record a motion vector of an image block adjacent to the current image block. For example, after obtaining the motion vector A21 of the image block A2, the motion vector A21 may be recorded in the motion vector list, and after obtaining the motion vector A31 of the image block A3, the motion vector A31 may be recorded in the motion vector list, so as to By analogy, the motion vector list of the image block A1 can finally be obtained.
- the process of the coding end obtaining the target motion vector according to the original motion vector and the obtained template can be referred to the following fourth and fifth embodiments.
- the original motion vector A21 can be used to obtain the target motion vector of the image block A1
- the target motion vector can be used as the final motion vector of the image block A1.
- the process of encoding the current image block according to the target motion vector to obtain the encoded bit stream corresponding to the current image block and sending the encoded bit stream to the decoding end may include: after obtaining the target motion vector, The current image block can be encoded by using the target motion vector, and there is no limitation on this encoding method. After encoding is completed, an encoded bit stream corresponding to the current image block can be obtained, and the encoded bit stream is sent to the decoding end.
- the encoding end may send an encoded bit stream to the decoding end according to the original motion vector and the target motion vector.
- the encoding performance of the original motion vector and the encoding performance of the target motion vector can be obtained.
- the encoded bit stream sent to the decoding end carries the first indication information.
- the encoded bit stream sent to the decoding end carries the second indication information.
- the above method is to notify the first instruction information or the second instruction information explicitly. In practical applications, the notification may also be performed implicitly, that is, the first instruction information or the second instruction information is not carried in the encoded bit stream corresponding to the current image block. Instructions.
- the encoding end and the decoding end may also negotiate a decision strategy or define a decision strategy in a standard, and store the decision strategies at the encoding end and the decoding end, respectively.
- the decision strategy may agree on the first strategy information, or agree on the second strategy information, or agree on the third strategy information.
- the third policy information is the same policy information as the candidate image block of the current image block.
- the encoded bitstream corresponding to the current image block may not carry the first indication information and the second indication information.
- the encoded bit stream corresponding to the current image block may not carry the first instruction information and the second instruction information.
- Information and second instruction information When the decision strategy agrees with the third strategy information, and the candidate image block uses the second strategy information, and the coding performance of the original motion vector is better than the coding performance of the target motion vector, the coding bitstream corresponding to the current image block may not carry the first indication.
- Information and second instruction information When the decision strategy agrees with the third strategy information, and the candidate image block uses the second strategy information, and the coding performance of the original motion vector is better than the coding performance of the target motion vector, the coding bitstream corresponding to the current image block may not carry the first indication.
- Information and second instruction information When the decision strategy agrees with the third strategy information, and the candidate image block uses the second strategy information, and the coding performance of the original motion vector is better than the coding performance of the target motion vector, the coding bitstream corresponding to the current image block may not carry the first indication.
- the encoding end sends the encoded bit stream to the decoding end according to the original motion vector and the target motion vector, and may further include: obtaining an index value of the original motion vector in the motion vector list; corresponding to the current image block sent to the decoding end
- the indexed value is carried in the encoded bitstream of. For example, if the original motion vector is motion vector A21 and motion vector A21 is the first motion vector in the motion vector list, the index value may be 1.
- the target motion vector can be obtained based on the original motion vector and the final motion vector of the current image block can be determined based on the target motion vector, instead of directly determining the final motion vector of the current image block based on the original motion vector, thereby effectively improving the motion vector.
- Accuracy which in turn improves encoding performance.
- the above method can quickly obtain the template of the current image block, and then obtain the target motion vector of the current image block according to the template, thereby effectively improving the encoding and decoding efficiency and reducing the encoding and decoding delay.
- a template of the current image block can be obtained, and a target motion vector of the current image block can be obtained according to the template of the current image block.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- the process of the encoder obtaining the target motion vector according to the original motion vector and the obtained template can be seen in FIG. 3A.
- the process may include:
- Step 311 The encoding end determines the original motion vector as a central motion vector.
- Step 312 The encoding end determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- Determining the edge motion vector corresponding to the central motion vector may include: moving the central motion vector (x, y) by an offset St in different directions to obtain edge motion vectors (x-St, y) in different directions, ( x + St, y), (x, y + St), (x, y-St).
- the center motion vector (x, y) can be shifted to the left by an offset St to obtain an edge motion vector (x-St, y), and the center motion vector (x, y) can be shifted to the right by an offset Get the edge motion vector (x + St, y) by St; in the vertical direction, you can move the center motion vector (x, y) up by the offset St to get the edge motion vector (x, y + St) and move the center The vector (x, y) is moved downward by the offset St to obtain the edge motion vector (x, y-St).
- the initial value of the offset St can be configured according to experience, for example, it can be 2, 4, 8, 16, and so on.
- Step 313 The encoder obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
- the encoding end obtains the encoding performance of the central motion vector according to the template of the current image block, which may include, but is not limited to, determining the encoding of the central motion vector according to the parameter information of the template of the current image block and the parameter information of the first target reference block. performance.
- the first target reference block may be an image block obtained after the reference image block corresponding to the template is offset based on the central motion vector.
- the encoding end may determine the prediction performance of the central motion vector according to the parameter information of the template and the parameter information of the first target reference block, and determine the encoding performance of the central motion vector according to the prediction performance of the central motion vector.
- the encoding performance of the central motion vector may be determined based on the prediction performance and the actual number of bits required for encoding.
- the above parameter information may be a brightness value, or a brightness value and a chrominance value.
- the brightness value of the template of the current image block and the brightness value of the first target reference block may be obtained first. After obtaining the template of the current image block, the brightness value of each pixel of the template can be obtained, and the reference image block corresponding to the template can be obtained.
- the reference image block can be moved by using the central motion vector (3, 3) to obtain the image block X corresponding to the reference image block (for example, the reference image block is moved to the right by 3 3 pixels, move up 3 pixels, and mark the processed image block as image block X), and the image block X is the first target reference block, and the brightness value of each pixel point of the image block X can be obtained.
- the prediction performance of the central motion vector can be determined using the following formula:
- SAD is the sum of available absolute differences used to represent the prediction performance of the central motion vector.
- TM i represents the brightness value of the i-th pixel of the template
- TMP i represents the brightness value of the i-th pixel of the image block X
- M represents the total number of pixels.
- the parameter information is a luminance value and a chrominance value
- the following formula is used to determine the brightness value prediction performance SAD of the central motion vector
- the average of the luma value prediction performance SAD and the chroma value prediction performance CSAD is the prediction performance of the center motion vector.
- CSAD is the sum of the available absolute differences, which is used to represent the chrominance value prediction performance of the central motion vector
- CTM i represents the chrominance value of the i-th pixel point of the template
- CTMP i represents the chrominance of the i-th pixel point of the image block X Value
- M c represents the total number of pixels.
- the encoding performance of the center motion vector may be determined according to the prediction performance and the actual number of bits required for encoding.
- RDO Rate Distortion Optimized, Rate-Distortion Principle
- RDO usually uses the following formula to determine the coding performance of the central motion vector:
- J encoding performance
- D prediction performance
- ⁇ is a Lagrangian multiplier, which is a numerical value configured according to experience
- R is an actual number of bits required for image block encoding, that is, a sum of bits of information carried by an encoded bit stream.
- the encoding end obtains the encoding performance of the edge motion vector according to the template of the current image block, which may include but is not limited to: determining the encoding of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of the second target reference block performance.
- the second target reference block may be an image block obtained after the reference image block corresponding to the template is offset based on the edge motion vector.
- the encoding end may determine the prediction performance of the edge motion vector according to the parameter information of the template and the parameter information of the second target reference block, and determine the encoding performance of the center motion vector according to the prediction performance of the edge motion vector.
- the encoding performance of the edge motion vector may be determined based on the prediction performance and the actual number of bits required for encoding.
- the above parameter information may be a brightness value, or a brightness value and a chrominance value.
- Case 2 is similar to Case 1, except that in Case 2, the reference image block of the template is moved using the edge motion vector to obtain the second target reference block, and the encoding performance of the edge motion vector is obtained using the second target reference block.
- the reference image block of the template is moved using the central motion vector to obtain a first target reference block, and the coding performance of the central motion vector is obtained using the first target reference block.
- Step 314 The encoding end determines a target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the respective coding performance of the edge motion vector.
- the coding end may select a motion vector with the best coding performance from the center motion vector and the edge motion vector.
- the motion vector with the best coding performance can be determined as the target motion vector.
- a motion vector with the second best coding performance can be selected from the center motion vector and the edge motion vector as the target motion vector.
- the encoding end may determine the edge motion vector (7, 3) as the target motion vector. If the motion vector with the best encoding performance is the center motion vector as (3, 3), that is, the original motion vector, the encoding end can also use the edge motion vector (such as edge motion vector (7, 3), etc.) with the best encoding performance. ) Is determined as the target motion vector.
- Embodiment 5 is a diagrammatic representation of Embodiment 5:
- the process of the encoder obtaining the target motion vector according to the original motion vector and the obtained template can be seen in FIG. 3B.
- the process may include:
- Step 321 The encoding end determines the original motion vector as a central motion vector.
- Step 322 The encoding end determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- Step 323 The encoder obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
- Step 324 The encoder determines whether the iteration end condition of the target motion vector is satisfied. If yes, go to step 326; if no, go to step 325.
- the iteration end condition may include, but is not limited to, the number of iterations reaching the number threshold, or the execution time reaching the time threshold, or the offset parameter St has been modified to a preset value, such as 1.
- step 325 the encoder selects a motion vector with the best coding performance from the center motion vector and the edge motion vector as a new center motion vector, and returns to step 322.
- the edge motion vector (7, 3) may be determined as the new central motion vector, and step 322 is performed again, and so on.
- the value of the offset parameter St may be an initial value, such as 16.
- the value of the offset parameter St is adjusted first, for example, adjusted to the last offset parameter St minus 2, or adjusted to half of the last offset parameter St. This article does not limit this, as long as the adjusted offset parameter St is smaller than the last offset parameter St, and subsequent adjustments are made to half of the last offset parameter St as an example. Therefore, when step 322 is performed a second time, the value of the offset parameter St is 8; when step 322 is performed a third time, the value of the offset parameter St is 4; and so on.
- step 322 may be performed based on the adjusted offset parameter St. If so, the value of the offset parameter St can be set to 1, and step 322 is performed based on the offset parameter St (that is, the value 1), and when the execution proceeds to step 324, the judgment result is that the end of the iteration is satisfied condition.
- Step 326 The encoding end determines the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the encoding performance of the edge motion vector.
- Embodiment 6 is a diagrammatic representation of Embodiment 6
- the encoding end can obtain the encoding performance of the original motion vector and the encoding performance of the target motion vector.
- the encoding end obtaining the encoding performance of the original motion vector may include: determining the encoding performance of the original motion vector according to the parameter information of the template of the current image block and the parameter information of the third target reference block.
- the third target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the original motion vector.
- the prediction performance of the original motion vector may be determined according to the parameter information of the template and the parameter information of the third target reference block, and the encoding performance of the original motion vector may be determined according to the prediction performance.
- the encoding performance of the original motion vector is determined based on the prediction performance and the actual number of bits required for encoding.
- the above parameter information may be a brightness value, or a brightness value and a chrominance value.
- the encoding end acquiring the encoding performance of the target motion vector may include, but is not limited to, determining the encoding performance of the target motion vector according to the parameter information of the template of the current image block and the parameter information of the fourth target reference block.
- the fourth target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the target motion vector.
- the prediction performance of the target motion vector may be determined according to the parameter information of the template and the parameter information of the fourth target reference block, and the encoding performance of the target motion vector may be determined according to the prediction performance. For example, based on the predictive performance and the actual number of bits required for encoding, the encoding performance of the target motion vector is determined.
- the above parameter information may be a brightness value, or a brightness value and a chrominance value.
- the above process is similar to the fourth embodiment, except that when the third target reference block or the fourth target reference block is obtained, the reference image block corresponding to the template is moved based on the original motion vector or the target motion vector, rather than as in the third embodiment.
- the reference image block corresponding to the template is moved based on the center motion vector.
- Embodiment 7 is a diagrammatic representation of Embodiment 7:
- the original mode information is the original motion vector and the original reference frame of the current image block
- the target mode information is the target motion vector and the target reference frame of the current image block.
- the encoder can obtain the original motion vector and the original reference frame of the current image block, and obtain the target motion vector (which can be different from the original motion vector) and the target reference according to the original motion vector, the original reference frame, and the obtained template. frame.
- the current image block may be encoded according to the target motion vector and the target reference frame to obtain an encoded bit stream corresponding to the current image block, and the encoded bit stream is sent to the decoding end.
- the encoding end may first obtain the original motion vector of the current image block. Assuming that the motion vector list of the current image block A1 at the encoding end includes motion vectors A21, A31, A41, and A51 in turn, then select a motion from the motion vector list. The vector serves as the original motion vector of the image block A1.
- the above manner is only an example, and there is no limitation on this.
- the default motion vector may be directly determined as the original motion vector.
- the process of obtaining the original reference frame of the current image block by the encoder there can be one or more reference frames (video frames with strong time-domain correlation), and one of them can be The reference frame is used as the original reference frame, and the remaining reference frames are candidate reference frames.
- a target reference frame needs to be selected from the original reference frame and all candidate reference frames, and the target reference frame is the final reference frame of the current image block, and the target reference frame is used for subsequent processing.
- the process for the encoder to obtain the target motion vector and the target reference frame according to the original motion vector, the original reference frame, and the obtained template can refer to the subsequent embodiments.
- the motion vector A21 is determined as the original motion vector
- the reference frame 1 is determined as the original reference frame
- the reference frame 2 and the reference frame 3 are determined as candidate reference frames
- the original motion vector A21, the reference frame 1, and the reference frame 2 are used.
- reference frame 3 to obtain a target motion vector and a target reference frame.
- the target motion vector may be used as the final motion vector of the current image block.
- the target reference frame may be a reference frame in reference frame 1, reference frame 2, and reference frame 3.
- the target reference frame is used as the final reference of the current image block. frame.
- the process of encoding the current image block according to the target motion vector and the target reference frame to obtain an encoded bit stream corresponding to the current image block and sending the encoded bit stream to the decoding end may include, but is not limited to: After the encoder obtains the target motion vector and the target reference frame, it can use the target motion vector and the target reference frame to encode the current image block, and there is no limitation on this encoding method. After the encoding is completed, the encoding end can obtain the encoded bit stream corresponding to the current image block, and sends the encoded bit stream to the decoding end.
- the encoding end may send an encoded bit stream to the decoding end according to the original motion vector and the target motion vector. Specifically, the encoding performance of the original motion vector and the encoding performance of the target motion vector can be obtained.
- the encoded bit stream corresponding to the current image block sent to the decoding end carries the first indication information.
- the encoded bit stream corresponding to the current image block sent to the decoding end carries the second indication information.
- the above method is to notify the first instruction information or the second instruction information explicitly.
- the first instruction information or the second instruction information may also be notified implicitly, that is, the encoded bit stream corresponding to the current image block is not included.
- the first instruction information or the second instruction information is carried.
- the encoding end and the decoding end may also negotiate a decision strategy or define a decision strategy in a standard, and store the decision strategy on the encoding end and the decoding end respectively.
- the decision strategy may agree on the first policy information or agree on the second policy information.
- Strategy information, or contracted third strategy information are the same policy information as the candidate image block of the current image block. Then, it can be determined based on the decision strategy in which case the first indication information or the second indication information may not be carried in the encoded bit stream corresponding to the current image block.
- the third embodiment refer to the third embodiment.
- the encoding end sends the encoded bit stream to the decoding end according to the original motion vector and the target motion vector, and may further include: obtaining an index value of the original motion vector in the motion vector list; corresponding to the current image block sent to the decoding end
- the indexed value is carried in the encoded bitstream of. For example, if the original motion vector is motion vector A21 and motion vector A21 is the first motion vector in the motion vector list, the index value may be 1.
- the target motion vector and the target reference frame can be obtained according to the original motion vector and the original reference frame, and the final motion vector of the current image block is determined according to the target motion vector, and the final reference frame of the current image block is determined according to the target reference frame.
- the original reference frame is used to determine the final reference frame of the current image block, which can effectively improve the accuracy of the motion vector and improve coding performance.
- the template of the current image block can be quickly obtained according to the motion information of the candidate image block, the codec efficiency can be effectively improved and the codec delay can be reduced.
- the template of the current image block can be obtained before the reconstruction phase.
- Embodiment 8 is a diagrammatic representation of Embodiment 8
- the encoder obtains the target motion vector and the target reference frame according to the original motion vector, the original reference frame, and the template.
- the implementation process can be shown in FIG. 3C.
- Step 331 The encoder obtains a candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector.
- the candidate motion vector may be different from the original motion vector.
- the encoding end obtains candidate motion vectors of the original reference frame based on the template of the current image block and the original motion vector, which may include, but is not limited to, the encoding end determines the original motion vector as the center motion vector, and determines the center motion vector.
- the edge motion vector is different from the center motion vector; the encoding end obtains the encoding performance of the center motion vector according to the template of the current image block, and obtains the encoding performance of each edge motion vector according to the template of the current image block; then, encoding The end may determine the candidate motion vector of the original reference frame from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of each edge motion vector.
- Step 332 The encoder obtains the initial motion vector of each candidate reference frame according to the original motion vector.
- the encoder obtains the initial motion vector of the candidate reference frame according to the original motion vector, which may include: according to the distance between the frame where the current image block is located and the original reference frame (such as the frame between the frame where the current image block is located and the original reference frame). Number), the distance between the frame where the current image block is located and the candidate reference frame, and the original motion vector to obtain the initial motion vector of the candidate reference frame.
- the original motion vector is motion vector 1
- the candidate reference frame is reference frame 2 and reference frame 3
- the distance between the frame where the current image block is located (hereinafter referred to as the current frame) and reference frame 1
- the distance between the current frame and the reference frame 2 is d2
- the distance between the current frame and the reference frame 3 is d3
- the initial motion vector of the reference frame 2 is the motion vector 1 * (d2 / d1)
- the initial motion vector of the reference frame 3 is the motion vector 1 * (d3 / d1)
- the subsequent motion vector is referred to as the motion vector 3.
- Step 333 The encoder obtains the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame.
- the encoding end obtains the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame, which may include, but is not limited to, determining the initial motion vector of the candidate reference frame as the center motion vector, and determining the center motion
- the edge motion vector corresponding to the vector, which is different from the center motion vector obtain the encoding performance of the center motion vector according to the template of the current image block, and obtain the encoding performance of each edge motion vector according to the template of the current image block; then, According to the coding performance of the central motion vector and the coding performance of each edge motion vector, a candidate motion vector of the candidate reference frame is determined from the central motion vector and the edge motion vector.
- the candidate motion vector of the candidate reference frame can be obtained according to the initial motion vector of the candidate reference frame, that is, each candidate reference frame corresponds to one candidate motion vector.
- the process of the encoder obtaining the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame may refer to the fourth embodiment or the fifth embodiment, but replaces the target motion vector in the fourth or the fifth embodiment.
- the original motion vector in the fourth or fifth embodiment may be replaced with the initial motion vector of the candidate reference frame.
- step 334 the encoder selects the candidate motion vector with the best coding performance as the target motion vector from the candidate motion vectors of the original reference frame and the candidate motion vectors of each candidate reference frame.
- the encoding end can obtain the coding performance of each candidate motion vector.
- the motion vector may be replaced with a candidate motion vector.
- the coding end obtains the coding performance of each candidate motion vector, it can select the candidate motion vector with the best coding performance as the target motion vector.
- Step 335 The encoding end determines the reference frame corresponding to the target motion vector as the target reference frame.
- the encoding end may determine the original reference frame as the target reference frame, and when the target motion vector corresponds to the candidate reference frame, the encoding end may determine the candidate reference frame as the target reference frame.
- a target reference frame is selected from the original reference frame and all candidate reference frames, and the target reference frame is the final reference frame of the current image block.
- Select the target motion vector that is, the candidate motion vector with the best coding performance from the candidate motion vectors of the original reference frame and the candidate motion vectors of all candidate reference frames.
- the target motion vector is the final motion vector of the current image block, and select The reference frame corresponding to the target motion vector is used as the target reference frame.
- the original mode information may be the original prediction image block
- the target mode information may be the target prediction image block
- the encoding end may obtain the target prediction image block according to the original prediction image block.
- the reference frame image of the current image block in order to transmit the current image block of the current frame image, can be queried first, that is, the reference frame image can be queried through the reference frame index, and then, from the reference A predicted image block matching the current image block is found in the frame image, and the current image block is encoded based on the difference between the current image block and the predicted image block, thereby reducing the bit transmission amount.
- the predicted image block in the reference frame image is referred to as the original predicted image block
- the target predicted image block is obtained according to the original predicted image block
- the current image block is encoded based on the difference between the current image block and the target predicted image block.
- the target prediction image block is an image block obtained by using a local illumination compensation algorithm
- the brightness difference between the original prediction image block and the current image block can be eliminated, so that the current image block is processed based on the difference between the current image block and the target prediction image block.
- the encoding end may obtain the original prediction image block of the current image block, and obtain the target prediction image block according to the original prediction image block and the obtained template. Encode the current image block according to the target predicted image block to obtain an encoded bit stream corresponding to the current image block, and send the encoded bit stream to the decoding end.
- the process of obtaining the original predicted image block of the current image block by the encoding end may include, but is not limited to: the encoding end first obtains the reference frame index of the current image block, and queries the reference of the current image block through the reference frame index. A frame image, from which the original predicted image block matching the current image block is queried from the reference frame image.
- the process of obtaining the target predicted image block by the encoding end according to the original predicted image block and the obtained template can refer to the subsequent embodiments.
- the process of encoding the current image block according to the target predicted image block to obtain the encoded bit stream corresponding to the current image block and sending the encoded bit stream to the decoding end may include: obtaining the target predicted image block After that, the current image block can be encoded based on the difference between the current image block and the target predicted image block. There is no restriction on this encoding method. After encoding is completed, the encoded bit stream corresponding to the current image block is obtained, and the encoded bit stream is sent to Decoding end.
- the encoding end uses the target prediction image block to encode the current image block (that is, to encode the current image block based on the difference between the current image block and the target prediction image block)
- the encoding end sends the encoding bit corresponding to the current image block to the decoding end.
- the stream carries first indication information; when the encoding end uses the original prediction image block to encode the current image block (that is, to encode the current image block based on the difference between the current image block and the original prediction image block), the encoding end sends to the decoding end
- the coded bit stream corresponding to the current image block of the second image carries second indication information.
- the first indication information or the second indication information is notified explicitly.
- the first indication information or the second indication information may also be notified implicitly, that is, the encoded bit stream corresponding to the current image block is not included.
- the first instruction information or the second instruction information is carried.
- the encoding end and the decoding end may also negotiate a decision strategy or define a decision strategy in a standard, and store the decision strategies at the encoding end and the decoding end, respectively.
- the decision strategy may agree on the first strategy information, or agree on the second strategy information, or agree on the third strategy information.
- the third policy information is the same policy information as the candidate image block of the current image block.
- the first indication information or the second indication information may not be carried in the encoded bit stream corresponding to the current image block. If the decision strategy agrees with the second strategy information, and the encoding end uses the original predicted image block to encode the current image block, the first indication information or the second indication information may not be carried in the encoded bit stream corresponding to the current image block. If the decision strategy agrees with the third strategy information, and the candidate image block of the current image block uses the first policy information, and the encoding end uses the target prediction image block to encode the current image block, it may not be carried in the encoded bit stream corresponding to the current image block.
- the first instruction information or the second instruction information may be carried in the encoded bit stream corresponding to the current image block.
- the decision strategy agrees with the third strategy information, and the candidate image block of the current image block uses the second strategy information, and the encoding end uses the original predicted image block to encode the current image block, it may not be carried in the encoded bit stream corresponding to the current image block.
- Embodiment 10 is a diagrammatic representation of Embodiment 10:
- the process of obtaining the target predicted image block by the encoding end according to the original predicted image block and the obtained template can be shown in FIG. 3D.
- Step 341 The encoder obtains a motion vector of the current image block and a reference frame index corresponding to the motion vector.
- the motion vector of the current image block may be the original motion vector in the foregoing embodiment, or the target motion vector in the foregoing embodiment, or may be the final motion vector in the foregoing embodiment, which is not limited as long as The motion vector of the current image block can be obtained.
- the reference frame index corresponding to the motion vector is also the index of the reference frame of the current image block.
- Step 342 The encoder obtains the reference block corresponding to the template according to the motion vector and the reference frame index of the current image block. For example, a reference frame image is queried by using the reference frame index, and a reference image block matching the current image block is queried from the reference frame image. Then, the reference image block is moved by using the motion vector of the current image block. It is the reference block corresponding to the template, which will be referred to as TMP.
- Step 343 The encoding end obtains a transform coefficient according to a template of the current image block and a reference block corresponding to the template. Specifically, the encoding end may obtain a transformation coefficient according to parameter information of each pixel of a template of the current image block and parameter information of each pixel of a reference block corresponding to the template.
- the parameter information may include, but is not limited to, a brightness value.
- TM i represents the brightness value of the i-th pixel in the template of the current image block
- TMP i represents the brightness value of the i-th pixel in the reference block corresponding to the template
- M represents the total number of pixels of the template
- a and b are transformation coefficients.
- Step 344 The encoding end performs illumination compensation on the original prediction image block according to the transform coefficient to obtain the target prediction image block.
- the target prediction image block may be aX + b, where X represents the original prediction image block.
- Embodiment 11 is a diagrammatic representation of Embodiment 11:
- FIG. 4 is a schematic flowchart of a decoding method, which is applied to a decoding end, the method may include the following steps:
- Step 401 The decoder obtains motion information of a candidate image block of the current image block.
- the candidate image block of the current image block may include, but is not limited to, a spatial-domain candidate image block of the current image block; or a time-domain candidate image block of the current image block.
- Step 402 The decoder obtains a template of the current image block according to the motion information of the candidate image block.
- the method for the decoder to obtain the template of the current image block according to the motion information of the candidate image block is the same as that of the encoder. For details, refer to the related content in the second embodiment.
- Step 403 The decoding end decodes the current image block according to the template of the current image block.
- the decoding end decodes the current image block according to the template of the current image block, which may include but is not limited to: obtaining the original mode information of the current image block; obtaining the current image block based on the template of the current image block and the original mode information
- the target mode information of; the current image block is decoded according to the target mode information.
- the original mode information is the original motion vector
- the target mode information is the target motion vector.
- the original mode information is the original motion vector and the original reference frame
- the target mode information is the target motion vector and the target reference frame.
- the original mode information is The original prediction image block
- the target mode information is the target prediction image block.
- the decoding end may also obtain a coded bit stream corresponding to the current image block, which may be sent by the encoding end. Yes, it can also be obtained after the decoding end encodes the current image block.
- the decoding end may receive the encoded bit stream corresponding to the current image block from the encoding end. If the encoded bit stream carries first indication information, the first indication information is used to instruct to obtain the current image block based on the current image block template and the original mode information.
- the target mode information of the target image block, the motion information of the candidate image block of the current image block is obtained according to the first instruction information, and the template of the current image block is obtained according to the motion information of the candidate image block.
- the decoding end may receive the encoded bit stream corresponding to the current image block from the encoding end. If the encoded bit stream carries second instruction information, the second instruction information is used to indicate that the encoded bit stream is based on the original mode information corresponding to the current image block. When decoding is performed, the original mode information of the current image block is obtained according to the second instruction information, and the current image block is decoded based on the original mode information.
- the above manner is to notify the first indication information or the second indication information in an explicit manner.
- the encoding end may also notify the strategy corresponding to the first indication information or the second indication information in an implicit manner, that is, the current image.
- the encoded bitstream corresponding to the block does not carry the first indication information or the second indication information.
- the decoding end may also obtain the motion information of the candidate image block of the current image block according to the locally preset first policy information, and obtain the template of the current image block according to the motion information of the candidate image block;
- the second strategy information is set to obtain the original mode information, and the current image block is decoded based on the original mode information; or, the strategy of the candidate image block of the current image block may also be obtained according to the locally preset third policy information, and based on the The obtained strategy decodes the current image block.
- the first policy information is used to indicate that target mode information of the current image block is obtained based on the template and original mode information of the current image block; the second policy information is used to indicate that the current image block is decoded based on the original mode information of the current image block;
- the third policy information is used to indicate that the same policy information as the neighboring image blocks of the current image block is adopted.
- the encoding end and the decoding end may also negotiate a decision strategy or define a decision strategy in a standard, and store the decision strategy on the encoding end and the decoding end respectively.
- the decision strategy may agree on the first policy information or agree on the second policy information.
- the first indication information and the second indication information are not carried in the encoded bit stream corresponding to the current image block, when the decision policy agrees with the first policy information, the current image block is obtained according to the locally preset first policy information.
- the template of the current image block can be obtained according to the motion information of the candidate image block of the current image block, and the current image block is decoded according to the template of the current image block. Because the above method can quickly obtain the template of the current image block, it can effectively improve decoding efficiency, reduce decoding delay, and improve decoding performance.
- Embodiment 12 is a diagrammatic representation of Embodiment 12
- a template of the current image block may be obtained according to motion information (such as a motion vector and a reference frame index) of a candidate image block of the current image block.
- the decoding end may then determine a reference frame image of the candidate image block according to the reference frame index, obtain a reference image block of the candidate image block from the reference frame image according to the motion vector, and obtain the reference image block according to the reference image block.
- the template of the current image block may be obtained according to motion information (such as a motion vector and a reference frame index) of a candidate image block of the current image block.
- the candidate image block may include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a greater than or equal to 0 Natural numbers, N is a natural number greater than or equal to 1.
- the first candidate image block is a candidate image block on the upper side of the current image block
- the second candidate image block is a candidate image block on the left side of the current image block.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the next-neighbor image block is inter mode.
- the second candidate image block includes a neighboring image block and / or a next-neighbor image block on the left side of the current image block.
- the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the next adjacent image block is an inter mode.
- Obtaining a template of the current image block according to the motion information of the candidate image block may include, but is not limited to: determining the first template according to the motion vector prediction mode and the motion information of the M first candidate image blocks; Determine the second template according to the motion vector prediction mode and motion information; then, determine the template of the current image block according to the first template and the second template. Specifically, it may be: determining the first template as a template of the current image block; or determining the second template as the template of the current image block; or determining the current image block after splicing the first template and the second template. template.
- the above first template may include M sub-templates or P sub-templates, and is composed of M sub-templates or P sub-templates, where P is the number of first candidate image blocks in the inter mode; when M When equal to 1, the first template may include a first sub-template, and the first sub-template is determined according to a motion vector prediction mode and motion information of a candidate image block on the upper side of the current image block.
- the second template may include N sub-templates or R sub-templates, and is formed by concatenating N sub-templates or R sub-templates, where R is the number of second candidate image blocks in the inter mode; when N is equal to At 1, the second template may include a second sub-template, and the second sub-template is determined according to a motion vector prediction mode and motion information of a candidate image block on the left side of the current image block.
- acquiring a template of the current image block according to the motion information of the candidate image block may further include, but is not limited to, when the current image block corresponds to multiple motion information, acquiring a template corresponding to each motion information and acquiring each motion The weight corresponding to the information, and obtain the template of the current image block according to the weight corresponding to each motion information and the template corresponding to the motion information.
- the motion information corresponding to the current image block may include original motion information of the current image block.
- the processing procedure of the twelfth embodiment is similar to that of the second embodiment.
- Embodiment 13 is a diagrammatic representation of Embodiment 13:
- the original mode information is the original motion vector of the current image block
- the target mode information is the target motion vector of the current image block.
- the decoder can obtain the original motion vector of the current image block, and obtain a target motion vector according to the original motion vector and the obtained template, and the target motion vector is different from the original motion vector.
- the decoding end decodes the current image block according to the target motion vector.
- the decoding end determines the target motion vector as the final motion vector of the current image block, and uses the final motion vector of the current image block to decode the current image block. There is no restriction on this decoding process.
- the process of obtaining the original motion vector of the current image block by the decoding end may further include: receiving an encoded bit stream corresponding to the current image block from the encoding end, where the encoded bit stream carries the index value of the original motion vector;
- the motion vector corresponding to the index value is selected from the list as the original motion vector of the current image block. If the index value is 1, the first motion vector in the motion vector list is obtained as the original motion vector of the current image block.
- the motion vector list is used to record the motion vectors of image blocks adjacent to the current image block.
- the motion vector list maintained by the decoder is the same as the motion vector list maintained by the encoder.
- the above manner is only an example.
- the motion vector of the candidate image block of the current image block may be determined as the original motion vector of the current image block, or the default motion vector is determined as the original motion vector.
- the decoding end may also parse the first indication information or the second indication information from the encoded bit stream corresponding to the current image block.
- the encoded bitstream carries the first instruction information
- the target motion vector of the current image block can be obtained according to the original motion vector and the obtained template, and the current image block is decoded by using the target motion vector;
- the encoded bitstream carries the second instruction information At this time, the current image block can be decoded according to the original motion vector.
- the target motion vector can be obtained based on the original motion vector and the final motion vector of the current image block can be determined based on the target motion vector, instead of directly determining the final motion vector of the current image block based on the original motion vector, thereby effectively improving the motion vector.
- Accuracy improving decoding performance.
- a template of the current image block may be acquired according to the motion information of the candidate image block, and a target motion vector may be acquired based on the template of the current image block and the original motion vector. Since the above method can quickly obtain a template of the current image block, and then obtain a target motion vector based on the template, it can effectively improve decoding efficiency and reduce decoding delay. For example, before the decoding reconstruction phase, a template of the current image block can be obtained, and a target motion vector can be obtained according to the template.
- Embodiment 14 is a diagrammatic representation of Embodiment 14:
- the process for the decoder to obtain the target motion vector according to the original motion vector and the obtained template is shown in FIG. 5 and may include:
- Step 501 The decoding end determines the original motion vector as a central motion vector.
- Step 502 The decoder determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- Determining the edge motion vector corresponding to the central motion vector may include: moving the central motion vector (x, y) in different directions by an offset St to obtain edge motion vectors (x-St, y) in different directions, ( x + St, y), (x, y + St), (x, y-St).
- Step 503 The decoder obtains the coding performance of the central motion vector according to the template of the current image block, and obtains the coding performance of each edge motion vector according to the template of the current image block.
- the decoding end obtains the encoding performance of the central motion vector according to the template of the current image block, which may include, but is not limited to, the decoding end may determine the central motion vector according to the parameter information of the template of the current image block and the parameter information of the first target reference block. Encoding performance.
- the first target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the central motion vector.
- the decoding end obtains the encoding performance of the edge motion vector according to the template of the current image block, which may include, but is not limited to, the decoding end may determine the edge motion vector according to the parameter information of the template of the current image block and the parameter information of the second target reference block. Encoding performance.
- the second target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the edge motion vector.
- Step 504 The decoding end determines a target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of each edge motion vector.
- the decoding end may select a motion vector with the best coding performance from the center motion vector and the edge motion vector.
- the motion vector with the best coding performance can be determined as the target motion vector.
- a motion vector with the second best coding performance can be selected from the center motion vector and the edge motion vector as the target motion vector.
- Embodiment 5 For the decoding end to obtain the target motion vector according to the original motion vector and the obtained template, Embodiment 5 can also be adopted, but the execution subject is changed from the encoding end to the decoding end.
- the original mode information is the original motion vector and the original reference frame of the current image block
- the target mode information is the target motion vector and the target reference frame of the current image block.
- the decoder can obtain the original motion vector and original reference frame of the current image block, and obtain the target motion vector of the current image block based on the template, original motion vector, and original reference frame of the current image block (the target motion vector can be compared with the original motion Vector is different) and the target reference frame, and the current image block is decoded according to the target motion vector and the target reference frame.
- the decoding end obtains the target motion vector and the target reference frame of the current image block based on the template, the original motion vector, and the original reference frame of the current image block, which may include, but is not limited to, obtaining the target image based on the template and the original motion vector of the current image block.
- the initial motion vector of the candidate reference frame according to the original motion vector may include, but is not limited to, the distance between the frame where the current image block is located and the original reference frame, the distance between the frame where the current image block is located and the candidate reference frame, and the original motion vector. To obtain the initial motion vector of the candidate reference frame.
- obtaining a candidate motion vector of the original reference frame based on a template of the current image block and the original motion vector may include, but is not limited to, determining the original motion vector as a central motion vector and determining that the central motion vector corresponds to the central motion vector.
- the edge motion vector is different from the center motion vector; then, obtain the encoding performance of the center motion vector according to the template of the current image block, and obtain the encoding performance of each edge motion vector according to the template of the current image block; Then, according to the coding performance of the central motion vector and the coding performance of each edge motion vector, a candidate motion vector of the original reference frame may be determined from the central motion vector and the edge motion vector.
- obtaining the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame may include, but is not limited to, determining the initial motion vector of the candidate reference frame as a center motion vector, and determining a motion with the center.
- Vector corresponding edge motion vector which is different from the center motion vector; obtain the coding performance of the center motion vector and the coding performance of each edge motion vector according to the template of the current image block; according to the coding performance of the center motion vector and each edge motion
- the coding performance of the vector is to determine the candidate motion vector of the candidate reference frame from the center motion vector and the edge motion vector.
- the original mode information may be an original prediction image block
- the target mode information may be a target prediction image block.
- the decoder can obtain the original predicted image block of the current image block, obtain the target predicted image block of the current image block based on the template of the current image block and the original predicted image block, and decode the current image block according to the target predicted image block .
- the decoding end obtains the target predicted image block of the current image block based on the template of the current image block and the original predicted image block, which may include, but is not limited to, the decoding end obtains the transformation coefficient according to the template of the current image block and the reference block corresponding to the template. ; Then, perform illumination compensation on the original predicted image block according to the transform coefficient to obtain the target predicted image block of the current image block.
- the decoding end may also obtain the motion vector of the current image block and the reference frame index corresponding to the motion vector; then, A reference block corresponding to the template is obtained according to the motion vector of the current image block and the reference frame index.
- the decoding end obtains the transformation coefficient according to the template of the current image block and the reference block corresponding to the template, which may include but is not limited to: according to parameter information of each pixel of the template of the current image block, and the reference block corresponding to the template
- the parameter information of each pixel is used to obtain the transformation coefficient.
- the parameter information may include a brightness value.
- Embodiment 17 is a diagrammatic representation of Embodiment 17:
- an embodiment of the present application further provides a decoding device, which is applied to the decoding end.
- FIG. 6 it is a structural diagram of the device.
- the device includes: an obtaining module 61, configured to: Acquiring motion information of a candidate image block of the current image block, and acquiring a template of the current image block according to the motion information of the candidate image block; a decoding module 62, configured to perform current analysis on the current image according to the template of the current image block The block is decoded.
- the decoding module 62 When the decoding module 62 decodes the current image block according to the template of the current image block, the decoding module 62 is specifically configured to: obtain original mode information of the current image block; based on the template and the current image block The original mode information acquires target mode information of the current image block; and decodes the current image block according to the target mode information.
- the decoding device further includes a receiving module for receiving an encoded bit stream corresponding to a current image block from an encoding end. If the encoded bitstream carries first indication information, the first indication information is used to instruct to obtain target mode information of the current image block based on the template of the current image block and the original mode information, the obtaining The module 61 is further configured to acquire motion information of a candidate image block of the current image block according to the first instruction information, and acquire a template of the current image block according to the motion information of the candidate image block.
- the decoding module 62 is further configured to use the second indication information according to the second indication information. To obtain the original mode information, and decode the current image block based on the original mode information.
- the obtaining module 61 is further configured to obtain the motion information of the candidate image block of the current image block according to the locally preset first policy information, and obtain the template of the current image block according to the motion information of the candidate image block.
- the first policy information is used to instruct to obtain target mode information of the current image block based on a template of the current image block and the original mode information.
- the decoding module 62 is further configured to obtain the original mode information according to the locally preset second policy information, and decode the current image block based on the original mode information.
- the second policy information is used to instruct to decode a current image block based on the original mode information.
- the decoding module 62 is further configured to decode the current image block according to the locally preset third policy information.
- the third policy information is the same policy information as the candidate image block of the current image block.
- the decoding module 62 is based on the template and The obtaining of the target mode information of the current image block by the original mode information is specifically used to determine the original motion vector as a central motion vector; determine an edge motion vector corresponding to the central motion vector, and the edge motion vector Different from the central motion vector; obtaining the coding performance of the central motion vector and the coding performance of each of the edge motion vectors according to the template; the coding performance of the central motion vector and the coding of each of the edge motion vectors according to the template Performance, determining the target motion vector from the center motion vector and each of the edge motion vectors.
- the decoding module 62 is based on the When obtaining the target mode information of the current image block by using the template and the original mode information of the current image block, the method is specifically configured to obtain the original reference frame based on the template of the current image block and the original motion vector.
- the candidate motion vector of the candidate obtain the initial motion vector of each candidate reference frame according to the original motion vector; obtain the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame; Among the motion vectors and the candidate motion vectors of each of the candidate reference frames, a candidate motion vector with the best coding performance is selected as the target motion vector, and a reference frame corresponding to the target motion vector is determined as the target reference frame.
- the decoding module 62 When the decoding module 62 obtains an initial motion vector of a candidate reference frame according to the original motion vector, the decoding module 62 is specifically configured to: according to a distance between a frame where the current image block is located and the original reference frame, a frame where the current image block is located, and the candidate reference frame And the original motion vector to obtain the initial motion vector of the candidate reference frame.
- the decoding module 62 When the decoding module 62 obtains the candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector, the decoding module 62 is specifically configured to: determine the original motion vector as a center motion vector; An edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector; obtaining the encoding performance of the center motion vector and the encoding performance of each of the edge motion vectors according to the template; The coding performance of the central motion vector and the coding performance of each of the edge motion vectors are described, and a candidate motion vector of the original reference frame is determined from the central motion vector and the edge motion vector.
- the decoding module 62 When the decoding module 62 obtains the candidate motion vector of the candidate reference frame according to the initial motion vector, the decoding module 62 is specifically configured to: determine the initial motion vector of the candidate reference frame as a central motion vector; and determine that the initial motion vector corresponds to the central motion vector.
- the edge motion vector is different from the center motion vector; obtains the encoding performance of the center motion vector and the encoding performance of each of the edge motion vectors according to the template; and the encoding according to the center motion vector Performance and coding performance of each of the edge motion vectors, and determining the candidate motion vector corresponding to the candidate reference frame from the center motion vector and the edge motion vector.
- the decoding module 62 acquires the current image based on the template of the current image block and the original mode information
- the target mode information of the block is specifically used to: obtain a transform coefficient according to the template and a reference block corresponding to the template; perform illumination compensation on the original predicted image block according to the transform coefficient to obtain the target predicted image block .
- the decoding module 62 is further configured to: obtain a motion vector of the current image block and a reference frame index corresponding to the motion vector; and obtain a corresponding one of the templates according to the motion vector of the current image block and the reference frame index. Reference block.
- the decoding module 62 obtains the transform coefficients according to the template and the reference block corresponding to the template, and is specifically configured to: according to parameter information of each pixel of the template, and each pixel of the reference block corresponding to the template. Parameter information to obtain the transformation coefficient.
- the parameter information includes a brightness value.
- the candidate image blocks include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is greater than Or a natural number of 0, N is a natural number greater than or equal to 1;
- the first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is the left side of the current image block
- the obtaining module 61 is specifically configured to determine the motion vector prediction mode and motion information of the M first candidate image blocks A first template; determining a second template according to a motion vector prediction mode and motion information of N second candidate image blocks; determining the first template as a template of the current image block, or determining the second template Determine the template of the current image block, or determine the template of the current image block after stitching the first template and the second template.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; and the prediction mode of the adjacent image block is an inter mode or an intra mode.
- the prediction mode of the second neighboring image block is an inter mode; the second candidate image block includes a neighboring image block on the left side of the current image block and / or a second neighboring image block.
- the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the next adjacent image block is an inter mode.
- the first template When M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or P sub-templates, where P is the first candidate for the inter-frame mode
- the motion information includes a motion vector and a reference frame index of the first candidate image block
- the obtaining module 61 determines the first according to the motion vector prediction mode and motion information of the M first candidate image blocks.
- the template is specifically used for: for the ith candidate image block of the M first candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an inter mode, according to the reference A frame index determines a reference frame image of the i-th candidate image block; and determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, The relative displacement between the reference image block and the i-th candidate image block matches the motion vector of the i-th candidate image block; according to the reference image block, the size is obtained as a first horizontal length and a first vertical
- the image block of length is used as the ith sub-template included in the first template.
- the obtaining module 61 is specifically configured to determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks, and for the i-th candidate image block among the M first candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a first horizontal length and a first vertical length is obtained The block serves as an ith sub-template included in the first template.
- a reference frame corresponding to the i-th candidate image block is determined according to a reference frame index corresponding to the i-th candidate image block An image; determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of the image block matches the motion vector corresponding to the i-th candidate image block; and according to the reference image block, obtaining an image block with a size of a first horizontal length and a first vertical length as the first template includes: I-th child template.
- the reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- the first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship, or the horizontal length of the current image block satisfies a second proportional relationship, or is equal to a first preset length;
- a longitudinal length satisfies a third proportional relationship with the longitudinal length of the first candidate image block, or satisfies a fourth proportional relationship with the longitudinal length of the current image block, or is equal to a second preset length.
- the second template When N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or R sub-templates, and R is the second candidate of the inter-frame mode.
- the motion information includes a motion vector and a reference frame index of the second candidate image block
- the acquisition module 61 determines a second vector based on the motion vector prediction mode and motion information of the N second candidate image blocks.
- the template is specifically used for: for the ith candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an inter mode, according to the reference A frame index determines a reference frame image of the i-th candidate image block; and determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block,
- the relative displacement between the reference image block and the i-th candidate image block matches the motion vector of the i-th candidate image block; according to the reference image block, the size is obtained as a second horizontal length and a second vertical
- the image block of length is used as the ith sub-template included in the second template.
- the obtaining module 61 is specifically configured to determine the second template according to the motion vector prediction mode and the motion information of the N second candidate image blocks: for the ith candidate image block of the N second candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a second horizontal length and a second vertical length is obtained The block serves as an ith sub-template included in the second template.
- a reference frame corresponding to the i-th candidate image block is determined according to a reference frame index corresponding to the i-th candidate image block An image; determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of the image block matches the motion vector corresponding to the i-th candidate image block; according to the determined reference image block, an image block having a second horizontal length and a second vertical length is obtained as the first
- the template includes the i-th child template.
- the reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- the second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship, or the horizontal length of the current image block satisfies a sixth proportional relationship, or is equal to a third preset length;
- the two vertical lengths satisfy a seventh proportional relationship with the vertical length of the second candidate image block, or satisfy an eighth proportional relationship with the vertical length of the current image block, or are equal to a fourth preset length.
- the acquiring module 61 is specifically configured to acquire a template of the current image block according to the motion information of the candidate image block: when the current image block corresponds to multiple motion information, acquire a template corresponding to each motion information, and acquire A weight corresponding to each motion information, and obtaining a template of the current image block according to the weight corresponding to each motion information and a template corresponding to the motion information.
- an embodiment of the present application further proposes an encoding device, which is applied to the encoding end.
- an encoding device which is applied to the encoding end.
- FIG. 7 it is a structural diagram of the device.
- the device includes:
- An obtaining module 71 is configured to obtain motion information of a candidate image block of the current image block, and obtain a template of the current image block according to the motion information of the candidate image block; an encoding module 72 is configured to obtain a template according to the current image block. The template encodes the current image block to obtain an encoded bit stream corresponding to the current image block; and a sending module 73 is configured to send the encoded bit stream to a decoding end.
- the encoding module 72 encodes the current image block according to the template of the current image block to obtain an encoded bit stream corresponding to the current image block, and is specifically configured to: obtain original mode information of the current image block; based on the Obtaining the target mode information of the current image block by using the template and the original mode information of the current image block; encoding the current image block according to the target mode information to obtain an encoded bit stream corresponding to the current image block.
- the sending module 73 When the current image block is encoded according to the target mode information, the sending module 73 carries the first instruction information to the encoded bit stream corresponding to the current image block sent by the decoding end, where the first instruction information is used to indicate The template of the current image block and the original mode information obtain target mode information of the current image block.
- the sending module 73 carries second instruction information to the encoded bit stream corresponding to the current image block sent by the decoding end, where the second instruction information is used to indicate The original mode information is used to decode the current image block.
- the encoding module 72 is based on the template and The obtaining of the target mode information of the current image block by the original mode information is specifically used to determine the original motion vector as a central motion vector; determine an edge motion vector corresponding to the central motion vector, and the edge motion vector Different from the central motion vector; obtaining the coding performance of the central motion vector and the coding performance of each of the edge motion vectors according to the template; the coding performance of the central motion vector and the coding of each of the edge motion vectors according to the template Performance, determining the target motion vector from the center motion vector and the edge motion vector.
- the encoding module 72 is based on the When obtaining the target mode information of the current image block by using the template and the original mode information of the current image block, the method is specifically configured to obtain the original reference frame based on the template of the current image block and the original motion vector.
- the candidate motion vector of the candidate obtain the initial motion vector of each candidate reference frame according to the original motion vector; obtain the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame; A candidate motion vector with the best coding performance is selected from the motion vectors and the candidate motion vectors of each of the candidate reference frames as the target motion vector, and a reference frame corresponding to the target motion vector is determined as the target reference frame.
- the encoding module 72 When the encoding module 72 obtains the initial motion vector of each candidate reference frame according to the original motion vector, the encoding module 72 is specifically configured to: according to the distance between the frame where the current image block is located and the original reference frame, the frame where the current image block is located, and the candidate reference The distance of the frame and the original motion vector are used to obtain the initial motion vector of the candidate reference frame.
- the encoding module 72 When the encoding module 72 obtains the candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector, the encoding module 72 is specifically configured to: determine the original motion vector as a center motion vector; An edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector; obtaining the encoding performance of the center motion vector and the encoding performance of each of the edge motion vectors according to the template; The coding performance of the central motion vector and the coding performance of each of the edge motion vectors are described, and a candidate motion vector of the original reference frame is determined from the central motion vector and the edge motion vector.
- the encoding module 72 When the encoding module 72 obtains the candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame, the encoding module 72 is specifically configured to: determine the initial motion vector of the candidate reference frame as a central motion vector; The edge motion vector corresponding to the central motion vector; the edge motion vector is different from the central motion vector; obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template; according to the center The coding performance of a motion vector and the coding performance of each of the edge motion vectors are determined from the center motion vector and the edge motion vector, and the candidate motion vector corresponding to the candidate reference frame.
- the encoding module 72 obtains the current image based on the template of the current image block and the original mode information
- the target mode information of the block is specifically used to: obtain a transform coefficient according to the template and a reference block corresponding to the template; perform illumination compensation on the original predicted image block according to the transform coefficient to obtain the target predicted image block .
- the encoding module 72 is further configured to: obtain a motion vector of the current image block and a reference frame index corresponding to the motion vector; and obtain a corresponding one of the templates according to the motion vector of the current image block and the reference frame index. Reference block.
- the encoding module 72 obtains the transform coefficients according to the template and the reference block corresponding to the template, and is specifically configured to: according to parameter information of each pixel of the template and each pixel of the reference block corresponding to the template. Parameter information to obtain the transformation coefficient.
- the parameter information includes a brightness value.
- the candidate image block includes M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 , N is a natural number greater than or equal to 1.
- the first candidate image block is a candidate image block on the upper side of the current image block
- the second candidate image block is a candidate image block on the left side of the current image block.
- the acquiring module 71 is specifically configured to: determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks; Determine a second template of the motion vector prediction mode and motion information of the N second candidate image blocks; determine the first template as a template of the current image block, or determine the second template as the current image A template of the block, or a template of the current image block determined after stitching the first template and the second template.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; and the prediction mode of the adjacent image block is an inter mode or an intra mode.
- the prediction mode of the second neighboring image block is an inter mode; the second candidate image block includes a neighboring image block on the left side of the current image block and / or a second neighboring image block.
- the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the next adjacent image block is an inter mode.
- the first template When M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or P sub-templates, where P is the first candidate for the inter-frame mode
- the motion information includes a motion vector and a reference frame index of the first candidate image block
- the obtaining module 71 is specifically configured to determine the first template according to the motion vector prediction modes and motion information of the M first candidate image blocks. : For the ith candidate image block of the M first candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an inter mode, determine the reference frame index according to the reference frame index A reference frame image of the i-th candidate image block; and determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the reference image block The relative displacement with the i-th candidate image block matches the motion vector of the i-th candidate image block; according to the reference image block, an image block having a size of a first horizontal length and a first vertical length is obtained as
- the first template includes an i-th sub-template.
- the obtaining module 71 is specifically configured to determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks, and for the i-th candidate image block of the M first candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a first horizontal length and a first vertical length is obtained The block serves as an ith sub-template included in the first template.
- a reference frame corresponding to the i-th candidate image block is determined according to a reference frame index corresponding to the i-th candidate image block An image; determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of the image block matches the motion vector corresponding to the i-th candidate image block; and according to the reference image block, obtaining an image block with a size of a first horizontal length and a first vertical length as the first template includes: I-th child template.
- the reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- the first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship, or the horizontal length of the current image block satisfies a second proportional relationship, or is equal to a first preset length;
- the first longitudinal length and the longitudinal length of the first candidate image block satisfy a third proportional relationship, or the longitudinal length of the current image block satisfies a fourth proportional relationship, or is equal to a second preset length.
- the second template When N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or R sub-templates, and R is the second candidate of the inter-frame mode.
- the motion information includes a motion vector and a reference frame index of the second candidate image block
- the obtaining module 71 is specifically configured to determine the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks. : For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, determine the according to the reference frame index A reference frame image of the i-th candidate image block; and determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the reference image block The relative displacement with the i-th candidate image block is matched with the motion vector of the i-th candidate image block; according to the reference image block, an image block having a size of a second horizontal length and a second vertical length is obtained as
- the second template includes an i-th sub-template.
- the obtaining module 71 is specifically configured to determine the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks: for the ith candidate image block of the N second candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a second horizontal length and a second vertical length is obtained The block serves as an ith sub-template included in the second template.
- a reference frame corresponding to the i-th candidate image block is determined according to a reference frame index corresponding to the i-th candidate image block An image; determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of the image block matches the motion vector corresponding to the i-th candidate image block; obtaining, according to the reference image block, an image block with a size of a second horizontal length and a second vertical length as the first template includes: I-th child template.
- the reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- the second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship, or the horizontal length of the current image block satisfies a sixth proportional relationship, or is equal to a third preset length;
- the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or the vertical length of the current image block satisfies an eighth proportional relationship, or is equal to a fourth preset length.
- the acquiring module 71 is specifically configured to acquire the template of the current image block according to the motion information of the candidate image block: when the current image block corresponds to multiple motion information, acquire a template corresponding to each motion information, and acquire A weight corresponding to each motion information, and a template of the current image block is obtained according to a weight corresponding to each motion information and a template corresponding to the motion information.
- the processor 81 includes a processor 81 and a machine-readable storage medium 82.
- the machine-readable storage medium 82 stores machine-executable instructions that can be executed by the processor 81.
- the processor 81 is configured to execute a machine-executable instruction. Instructions to implement the decoding method disclosed in the above examples of this application.
- an embodiment of the present application further provides a machine-readable storage medium.
- the machine-readable storage medium stores a number of computer instructions.
- the present invention can be implemented. Apply for the decoding method disclosed in the above example.
- the processor 91 includes a processor 91 and a machine-readable storage medium 92.
- the machine-readable storage medium 92 stores machine-executable instructions that can be executed by the processor 91.
- the processor 91 is configured to execute machine-executable instructions. Instructions to implement the encoding method disclosed in the above example of this application.
- an embodiment of the present application further provides a machine-readable storage medium.
- the machine-readable storage medium stores a number of computer instructions.
- the present invention can be implemented. Apply for the encoding method disclosed in the above example.
- the machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device, and may contain or store information, such as executable instructions, data, and so on.
- the machine-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard drive), solid state hard disk, any type of storage disk (Such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
- the system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function.
- a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or a combination of any of these devices.
- these computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device,
- the instruction device implements the functions specified in a flowchart or a plurality of processes and / or a block or a plurality of blocks in the block diagram.
- these computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of operating steps can be performed on the computer or other programmable device to produce a computer-implemented process, thereby being on the computer or other programmable device
- the executed instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
Abstract
Description
Claims (49)
- 一种解码方法,应用于解码端,所述方法包括:A decoding method applied to a decoding end, the method includes:获取所述当前图像块的候选图像块的运动信息;Acquiring motion information of a candidate image block of the current image block;根据所述候选图像块的运动信息获取所述当前图像块的模板;Obtaining a template of the current image block according to the motion information of the candidate image block;根据所述当前图像块的所述模板对所述当前图像块进行解码。Decoding the current image block according to the template of the current image block.
- 根据权利要求1所述的方法,其特征在于,根据所述当前图像块的所述模板对所述当前图像块进行解码,包括:The method according to claim 1, wherein decoding the current image block according to the template of the current image block comprises:获取所述当前图像块的所述原始模式信息;Acquiring the original mode information of the current image block;基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的所述目标模式信息;Acquiring the target mode information of the current image block based on the template of the current image block and the original mode information;根据所述目标模式信息对所述当前图像块进行解码。Decoding the current image block according to the target mode information.
- 根据权利要求1所述的方法,其特征在于,The method according to claim 1, wherein:在基于所述当前图像块的所述模板,根据所述原始模式信息获取所述当前图像块的目标模式信息之前,所述方法还包括:Before acquiring the target mode information of the current image block based on the template of the current image block and according to the original mode information, the method further includes:接收来自编码端的所述当前图像块对应的编码比特流;Receiving an encoded bit stream corresponding to the current image block from an encoding end;响应于所述编码比特流携带第一指示信息,其中,所述第一指示信息用于指示基于所述当前图像块的模板和所述原始模式信息获取所述当前图像块的目标模式信息;Responsive to the encoded bitstream carrying first indication information, wherein the first indication information is used to instruct to obtain target mode information of the current image block based on a template of the current image block and the original mode information;根据所述第一指示信息,获取当前图像块的候选图像块的运动信息;根据所述候选图像块的运动信息获取所述当前图像块的模板。Acquiring motion information of a candidate image block of the current image block according to the first instruction information; and acquiring a template of the current image block according to the motion information of the candidate image block.
- 根据权利要求1所述的方法,其特征在于,在基于所述当前图像块的所述模板,根据所述原始模式信息获取所述当前图像块的目标模式信息之前,所述方法还包括:The method according to claim 1, wherein before obtaining the target mode information of the current image block based on the template of the current image block and according to the original mode information, the method further comprises:接收来自编码端的编码比特流;Receive the encoded bit stream from the encoding end;响应于所述编码比特流携带第二指示信息,其中,所述第二指示信息用于指示基于所述原始模式信息对所述当前图像块进行解码;In response to the encoded bit stream carrying second indication information, wherein the second indication information is used to instruct to decode the current image block based on the original mode information;根据所述第二指示信息,获取所述原始模式信息,基于所述原始模式信息对所述当前图像块进行解码。Acquiring the original mode information according to the second instruction information, and decoding the current image block based on the original mode information.
- 根据权利要求1所述的方法,其特征在于,在基于所述当前图像块的所述模板,根据所述原始模式信息获取所述当前图像块的目标模式信息之前,所述方法还包括:The method according to claim 1, wherein before obtaining the target mode information of the current image block based on the template of the current image block and according to the original mode information, the method further comprises:根据本地预设的第一策略信息,获取当前图像块的候选图像块的运动信息;根据所述候选图像块的运动信息获取所述当前图像块的所述模板,其中,所述第一策略信息用于指示基于所述当前图像块的模板,根据所述原始模式信息获取所述当前图像块的所述目标模式信息;或者,Acquiring the motion information of the candidate image block of the current image block according to the first preset policy information locally; acquiring the template of the current image block according to the motion information of the candidate image block, wherein the first policy information For instructing to acquire a target mode information of the current image block based on the template of the current image block according to the original mode information; or根据本地预设的第二策略信息,获取所述原始模式信息,基于所述原始模式信息对所述当前图像块进行解码,其中,所述第二策略信息用于指示基于所述原始模式信息对所述当前图像块进行解码;或者,Acquiring the original mode information according to locally preset second policy information, and decoding the current image block based on the original mode information, wherein the second policy information is used to indicate that the Decoding the current image block; or,根据本地预设的第三策略信息,参考所述当前图像块的候选图像块所采用的策略信息,对所述当前图像块进行解码;其中,所述第三策略信息表示采用与所述当前图像块的候选图像块相同的策略信息。Decoding the current image block according to locally preset third policy information with reference to the policy information used by the candidate image block of the current image block; wherein the third policy information indicates that Candidate image blocks have the same policy information.
- 根据权利要求2所述的方法,其特征在于,The method according to claim 2, wherein:所述原始模式信息为所述当前图像块的原始运动矢量,The original mode information is an original motion vector of the current image block,所述目标模式信息为所述当前图像块的目标运动矢量;The target mode information is a target motion vector of the current image block;基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的所述目标模式信息,具体包括:Obtaining the target mode information of the current image block based on the template and the original mode information of the current image block specifically includes:将所述原始运动矢量确定为中心运动矢量;Determining the original motion vector as a central motion vector;确定与所述中心运动矢量对应的边缘运动矢量,所述边缘运动矢量与所述中心运动矢量不同;Determining an edge motion vector corresponding to the central motion vector, the edge motion vector being different from the central motion vector;根据所述模板获得所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能;Obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template;根据所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量。The target motion vector is determined from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of each of the edge motion vectors.
- 根据权利要求2所述的方法,其特征在于,The method according to claim 2, wherein:所述原始模式信息为所述当前图像块的原始运动矢量和原始参考帧,The original mode information is an original motion vector and an original reference frame of the current image block,所述目标模式信息为所述当前图像块的目标运动矢量和目标参考帧;The target mode information is a target motion vector and a target reference frame of the current image block;基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的所述目标模式信息,具体包括:Obtaining the target mode information of the current image block based on the template and the original mode information of the current image block specifically includes:基于所述当前图像块的所述模板和所述原始运动矢量获取所述原始参考帧的候选运动矢量;Obtaining a candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector;针对多个候选帧中的每个候选帧,For each candidate frame among multiple candidate frames,根据所述原始运动矢量获取所述候选参考帧的初始运动矢量;Obtaining an initial motion vector of the candidate reference frame according to the original motion vector;根据所述候选参考帧的所述初始运动矢量获取所述候选参考帧的候选运动矢量;Obtaining a candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame;从所述原始参考帧的候选运动矢量以及所述多个候选参考帧各自的候选运动矢量中,选择编码性能最优的候选运动矢量作为所述目标运动矢量;Selecting, from the candidate motion vectors of the original reference frame and the candidate motion vectors of the plurality of candidate reference frames, the candidate motion vector with the best coding performance as the target motion vector;将所述目标运动矢量对应的参考帧确定为所述目标参考帧。A reference frame corresponding to the target motion vector is determined as the target reference frame.
- 根据权利要求7所述的方法,其特征在于,根据所述原始运动矢量获取所述候选参考帧对应的所述初始运动矢量,包括:The method according to claim 7, wherein acquiring the initial motion vector corresponding to the candidate reference frame according to the original motion vector comprises:根据所述当前图像块所在帧与所述原始参考帧的距离、所述当前图像块所在帧与所述候选参考帧的距离和所述原始运动矢量,获取所述候选参考帧的所述初始运动矢量。Obtaining the initial motion of the candidate reference frame according to the distance between the frame where the current image block is located and the original reference frame, the distance between the frame where the current image block is located and the candidate reference frame, and the original motion vector Vector.
- 根据权利要求7所述的方法,其特征在于,基于所述当前图像块的所述模板和所述原始运动矢量获取所述原始参考帧的候选运动矢量,包括:The method according to claim 7, wherein obtaining the candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector comprises:将所述原始运动矢量确定为中心运动矢量;Determining the original motion vector as a central motion vector;确定与所述中心运动矢量对应的边缘运动矢量,所述边缘运动矢量与所述中心运动矢量不同;Determining an edge motion vector corresponding to the central motion vector, the edge motion vector being different from the central motion vector;根据所述模板获得所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能;Obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template;根据所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述原始参考帧的候选运动矢量。According to the coding performance of the central motion vector and the coding performance of each of the edge motion vectors, a candidate motion vector of the original reference frame is determined from the central motion vector and the edge motion vector.
- 根据权利要求7或8所述的方法,其特征在于,根据所述候选参考帧的所述初始运动矢量获取所述候选参考帧对应的所述候选运动矢量,包括:The method according to claim 7 or 8, wherein acquiring the candidate motion vector corresponding to the candidate reference frame according to the initial motion vector of the candidate reference frame comprises:将所述候选参考帧的所述初始运动矢量确定为中心运动矢量;Determining the initial motion vector of the candidate reference frame as a central motion vector;确定与所述中心运动矢量对应的边缘运动矢量;所述边缘运动矢量与所述中心运动矢量不同;Determining an edge motion vector corresponding to the central motion vector; the edge motion vector is different from the central motion vector;根据所述模板获得所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能;Obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template;根据所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述候选参考帧对应的所述候选运动矢量。According to the coding performance of the central motion vector and the coding performance of each of the edge motion vectors, the candidate motion vector corresponding to the candidate reference frame is determined from the central motion vector and the edge motion vector.
- 根据权利要求2所述的方法,其特征在于,The method according to claim 2, wherein:所述原始模式信息为原始预测图像块,The original mode information is an original predicted image block,所述目标模式信息为目标预测图像块,The target mode information is a target prediction image block,基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的所述目标模式信息,具体包括:Obtaining the target mode information of the current image block based on the template and the original mode information of the current image block specifically includes:根据所述模板和所述模板对应的参考块,获取变换系数;Obtaining transform coefficients according to the template and a reference block corresponding to the template;根据所述变换系数对所述原始预测图像块进行光照补偿,得到所述目标预测图像块。Illumination compensation is performed on the original prediction image block according to the transform coefficient to obtain the target prediction image block.
- 根据权利要求11所述的方法,其特征在于,根据所述模板和所述模板对应的参考块,获取所述变换系数之前,还包括:The method according to claim 11, wherein before acquiring the transform coefficient according to the template and a reference block corresponding to the template, further comprising:获取所述当前图像块的运动矢量和所述运动矢量对应的参考帧索引;Acquiring a motion vector of the current image block and a reference frame index corresponding to the motion vector;根据所述当前图像块的所述运动矢量和所述参考帧索引获得所述模板对应的参考块。Obtaining a reference block corresponding to the template according to the motion vector and the reference frame index of the current image block.
- 根据权利要求11所述的方法,其特征在于,根据所述模板和所述模板对应的参考块,获取所述变换系数,包括:The method according to claim 11, wherein obtaining the transform coefficient according to the template and a reference block corresponding to the template comprises:根据所述模板的各像素的参数信息、所述模板对应的参考块的各像素的参数信息,获取所述变换系数;Obtaining the transformation coefficient according to parameter information of each pixel of the template and parameter information of each pixel of a reference block corresponding to the template;其中,所述参数信息包括亮度值。The parameter information includes a brightness value.
- 根据权利要求1至13中任一项所述的方法,其特征在于,The method according to any one of claims 1 to 13, characterized in that:所述候选图像块包括M个第一候选图像块和N个第二候选图像块,M为大于或等于1的自然数,N为大于或等于0的自然数,或者,M为大于或等于0的自然数,N为大于或等于1的自然数;The candidate image block includes M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 , N is a natural number greater than or equal to 1;所述第一候选图像块为所述当前图像块上侧的候选图像块,The first candidate image block is a candidate image block above the current image block,所述第二候选图像块为所述当前图像块左侧的候选图像块;The second candidate image block is a candidate image block to the left of the current image block;根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:Obtaining a template of the current image block according to the motion information of the candidate image block includes:根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板;Determining a first template according to a motion vector prediction mode and motion information of the M first candidate image blocks;根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板;Determine a second template according to the motion vector prediction mode and motion information of the N second candidate image blocks;将所述第一模板确定为所述当前图像块的模板,或者将所述第二模板确定为所述当前图像块的模板,或者将所述第一模板和所述第二模板拼接之后确定为所述当前图像块的模板。Determining the first template as a template of the current image block, or determining the second template as a template of the current image block, or stitching the first template and the second template as A template of the current image block.
- 根据权利要求14所述的方法,其特征在于,The method according to claim 14, wherein:所述第一候选图像块包括所述当前图像块上侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式;The first candidate image block includes an adjacent image block and / or a second-neighbor image block on the upper side of the current image block; a prediction mode of the adjacent image block is an inter mode or an intra mode; and the second neighbor The prediction mode of the image block is an inter mode;所述第二候选图像块包括所述当前图像块左侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式。The second candidate image block includes an adjacent image block and / or a second-neighbor image block to the left of the current image block; a prediction mode of the adjacent image block is an inter mode or an intra mode; and the second neighbor The prediction mode of an image block is an inter mode.
- 根据权利要求14所述的方法,其特征在于,The method according to claim 14, wherein:当所述M大于1时,所述第一模板包括M个子模板或者P个子模板,且由所述M个子模板或所述P个子模板拼接而成,所述P为帧间模式的第一候选图像块的数量;When M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or P sub-templates, where P is the first candidate for the inter-frame mode The number of image blocks;当所述M等于1时,所述第一模板包括第一子模板,所述第一子模板是根据所述当前图像块上侧的一个候选图像块的运动矢量预测模式和运动信息确定的。When M is equal to 1, the first template includes a first sub-template, and the first sub-template is determined according to a motion vector prediction mode and motion information of a candidate image block on an upper side of the current image block.
- 根据权利要求16所述的方法,其特征在于,The method according to claim 16, wherein:所述运动信息包括所述第一候选图像块的运动矢量和参考帧索引,The motion information includes a motion vector and a reference frame index of the first candidate image block,根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:Determining the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks includes:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode,根据所述参考帧索引确定所述第i个候选图像块的参考帧图像;Determining a reference frame image of the i-th candidate image block according to the reference frame index;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块的运动矢量相匹配;Determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the relative of the reference image block and the i-th candidate image block The displacement matches the motion vector of the i-th candidate image block;根据所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板。According to the reference image block, an image block having a first horizontal length and a first vertical length is obtained as an i-th sub-template included in the first template.
- 根据权利要求16所述的方法,其特征在于,根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:The method according to claim 16, wherein determining the first template according to a motion vector prediction mode and motion information of the M first candidate image blocks comprises:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,将所述第i个候选图像块按照默认值填充,并Fill the i-th candidate image block with a default value, and获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;Acquiring an image block having a first horizontal length and a first vertical length as an i-th sub-template included in the first template;或者,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,Alternatively, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;Determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块对应的运动矢量相匹配;Determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of is matched with the motion vector corresponding to the i-th candidate image block;根据所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;Obtaining, according to the reference image block, an image block having a first horizontal length and a first vertical length as an i-th sub-template included in the first template;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。The reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- 根据权利要求17或18所述的方法,其特征在于,The method according to claim 17 or 18, wherein:所述第一横向长度与所述第一候选图像块的横向长度满足第一比例关系,或者与所述当前图像块的横向长度满足第二比例关系,或者等于第一预设长度;The first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship, or the horizontal length of the current image block satisfies a second proportional relationship, or is equal to a first preset length;所述第一纵向长度与所述第一候选图像块的纵向长度满足第三比例关系,或者与所 述当前图像块的纵向长度满足第四比例关系,或者等于第二预设长度。The first vertical length satisfies a third proportional relationship with the vertical length of the first candidate image block, or satisfies a fourth proportional relationship with the vertical length of the current image block, or is equal to a second preset length.
- 根据权利要求14所述的方法,其特征在于,The method according to claim 14, wherein:当所述N大于1时,所述第二模板包括N个子模板或者R个子模板,且由所述N个子模板或所述R个子模板拼接而成,所述R为帧间模式的第二候选图像块的数量;When N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or R sub-templates, and R is the second candidate of the inter-frame mode. The number of image blocks;当所述N等于1时,所述第二模板包括第二子模板,所述第二子模板是根据所述当前图像块左侧的一个候选图像块的运动矢量预测模式和运动信息确定的。When N is equal to 1, the second template includes a second sub-template, and the second sub-template is determined according to a motion vector prediction mode and motion information of a candidate image block on the left side of the current image block.
- 根据权利要求20所述的方法,其特征在于,The method according to claim 20, wherein:所述运动信息包括所述第二候选图像块的运动矢量和参考帧索引,The motion information includes a motion vector and a reference frame index of the second candidate image block,根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,包括:Determining the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks, including:针对所述N个第二候选图像块中的第i个候选图像块,For the ith candidate image block among the N second candidate image blocks,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,根据所述参考帧索引确定所述第i个候选图像块的参考帧图像;When it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, determining a reference frame image of the i-th candidate image block according to the reference frame index;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块的运动矢量相匹配;Determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the The displacement matches the motion vector of the i-th candidate image block;根据所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板。According to the reference image block, an image block having a second horizontal length and a second vertical length is obtained as an i-th sub-template included in the second template.
- 根据权利要求21所述的方法,其特征在于,根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,还包括:The method according to claim 21, wherein determining the second template according to a motion vector prediction mode and motion information of the N second candidate image blocks further comprises:当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,将所述第i个候选图像块按照默认值填充,并Fill the i-th candidate image block with a default value, and获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板;Acquiring an image block having a second horizontal length and a second vertical length as an i-th sub-template included in the second template;或者,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,Alternatively, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;Determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块对应的运动矢量相匹配;Determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of is matched with the motion vector corresponding to the i-th candidate image block;根据所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第一模板包括的第i个子模板;Obtaining, according to the reference image block, an image block having a second horizontal length and a second vertical length as an i-th sub-template included in the first template;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。The reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- 根据权利要求21或22所述的方法,其特征在于,The method according to claim 21 or 22, wherein:所述第二横向长度与所述第二候选图像块的横向长度满足第五比例关系,或者与所述当前图像块的横向长度满足第六比例关系,或者等于第三预设长度;The second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship, or the horizontal length of the current image block satisfies a sixth proportional relationship, or is equal to a third preset length;所述第二纵向长度与所述第二候选图像块的纵向长度满足第七比例关系,或者与所述当前图像块的纵向长度满足第八比例关系,或者等于第四预设长度。The second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or the vertical length of the current image block satisfies an eighth proportional relationship, or is equal to a fourth preset length.
- 根据权利要求14至23中任一项所述的方法,其特征在于,根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:The method according to any one of claims 14 to 23, wherein acquiring a template of the current image block according to the motion information of the candidate image block comprises:当所述当前图像块对应多个运动信息时,获取每个运动信息对应的模板,其中,当前图像块对应的运动信息可包括当前图像块的原始运动信息;When the current image block corresponds to a plurality of motion information, obtaining a template corresponding to each motion information, wherein the motion information corresponding to the current image block may include the original motion information of the current image block;获取每个运动信息对应的权重,并Obtain the weight corresponding to each sport information, and根据每个运动信息对应的权重以及所述运动信息对应的模板获取所述当前图像块的模板。A template of the current image block is obtained according to a weight corresponding to each motion information and a template corresponding to the motion information.
- 一种编码方法,应用于编码端,所述方法包括:An encoding method applied to an encoding end, the method including:获取当前图像块的候选图像块的运动信息;Acquiring motion information of a candidate image block of the current image block;根据所述候选图像块的运动信息获取所述当前图像块的模板;Obtaining a template of the current image block according to the motion information of the candidate image block;根据所述当前图像块的所述模板对所述当前图像块进行编码。Encoding the current image block according to the template of the current image block.
- 根据权利要求25所述的方法,其特征在于,根据所述当前图像块的所述模板对所述当前图像块进行编码,包括:The method according to claim 25, wherein encoding the current image block according to the template of the current image block comprises:获取所述当前图像块的原始模式信息;Acquiring original mode information of the current image block;基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的目标模式信息;Acquiring target mode information of the current image block based on the template of the current image block and the original mode information;根据所述目标模式信息对所述当前图像块进行编码,得到所述当前图像块对应的编码比特流。Encode the current image block according to the target mode information to obtain an encoded bit stream corresponding to the current image block.
- 根据权利要求26所述的方法,其特征在于,所述方法还包括:The method according to claim 26, further comprising:当根据所述目标模式信息对所述当前图像块进行编码时,向解码端发送的所述当前图像块对应的编码比特流携带第一指示信息,所述第一指示信息用于指示基于所述当前图像块的模板和所述原始模式信息获取所述当前图像块的目标模式信息。When the current image block is encoded according to the target mode information, the encoded bitstream corresponding to the current image block sent to the decoding end carries first indication information, where the first indication information is used to indicate The template of the current image block and the original mode information acquire target mode information of the current image block.
- 根据权利要求26所述的方法,其特征在于,所述方法还包括:The method according to claim 26, further comprising:当根据所述原始模式信息对所述当前图像块进行编码时,向解码端发送的所述当前图像块对应的编码比特流携带第二指示信息的编码比特流,所述第二指示信息用于指示基于所述原始模式信息对所述当前图像块进行解码。When the current image block is encoded according to the original mode information, the encoded bit stream corresponding to the current image block sent to the decoding end carries the encoded bit stream of the second instruction information, where the second instruction information is used for And instructing to decode the current image block based on the original mode information.
- 根据权利要求26所述的方法,其特征在于,The method according to claim 26, wherein:所述原始模式信息为所述当前图像块的原始运动矢量,The original mode information is an original motion vector of the current image block,所述目标模式信息为所述当前图像块的目标运动矢量;The target mode information is a target motion vector of the current image block;基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的目标模式信息,具体包括:Obtaining target mode information of the current image block based on the template and the original mode information of the current image block specifically includes:将所述原始运动矢量确定为中心运动矢量;Determining the original motion vector as a central motion vector;确定与所述中心运动矢量对应的边缘运动矢量,所述边缘运动矢量与所述中心运动矢量不同;Determining an edge motion vector corresponding to the central motion vector, the edge motion vector being different from the central motion vector;根据所述模板获得所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能;Obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template;根据所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量。The target motion vector is determined from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the coding performance of each of the edge motion vectors.
- 根据权利要求26所述的方法,其特征在于,The method according to claim 26, wherein:所述原始模式信息为所述当前图像块的原始运动矢量和原始参考帧,The original mode information is an original motion vector and an original reference frame of the current image block,所述目标模式信息为所述当前图像块的目标运动矢量和目标参考帧;The target mode information is a target motion vector and a target reference frame of the current image block;基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的目标模式信息,具体包括:Obtaining target mode information of the current image block based on the template and the original mode information of the current image block specifically includes:基于所述当前图像块的所述模板和所述原始运动矢量获取所述原始参考帧的候选运动矢量;Obtaining a candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector;针对多个候选帧中的每个候选帧,For each candidate frame among multiple candidate frames,根据所述原始运动矢量获取所述候选参考帧的初始运动矢量;Obtaining an initial motion vector of the candidate reference frame according to the original motion vector;根据所述候选参考帧的所述初始运动矢量获取所述候选参考帧的候选运动矢量;Obtaining a candidate motion vector of the candidate reference frame according to the initial motion vector of the candidate reference frame;从所述原始参考帧的候选运动矢量以及所述多个候选参考帧各自的候选运动矢量中,选择编码性能最优的候选运动矢量作为所述目标运动矢量;Selecting, from the candidate motion vectors of the original reference frame and the candidate motion vectors of the plurality of candidate reference frames, the candidate motion vector with the best coding performance as the target motion vector;将所述目标运动矢量对应的参考帧确定为所述目标参考帧。A reference frame corresponding to the target motion vector is determined as the target reference frame.
- 根据权利要求30所述的方法,其特征在于,根据所述原始运动矢量获取所述候选参考帧对应的所述初始运动矢量,包括:The method according to claim 30, wherein acquiring the initial motion vector corresponding to the candidate reference frame according to the original motion vector comprises:根据当前图像块所在帧与所述原始参考帧的距离、当前图像块所在帧与所述候选参考帧的距离和所述原始运动矢量,获取所述候选参考帧的所述初始运动矢量。Obtaining the initial motion vector of the candidate reference frame according to the distance between the frame where the current image block is located and the original reference frame, the distance between the frame where the current image block is located and the candidate reference frame, and the original motion vector.
- 根据权利要求30所述的方法,其特征在于,基于所述当前图像块的所述模板和所述原始运动矢量获取所述原始参考帧的候选运动矢量,包括:The method according to claim 30, wherein obtaining a candidate motion vector of the original reference frame based on the template of the current image block and the original motion vector comprises:将所述原始运动矢量确定为中心运动矢量;Determining the original motion vector as a central motion vector;确定与所述中心运动矢量对应的边缘运动矢量,所述边缘运动矢量与所述中心运动矢量不同;Determining an edge motion vector corresponding to the central motion vector, the edge motion vector being different from the central motion vector;根据所述模板获得所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能;Obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template;根据所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述原始参考帧的候选运动矢量。According to the coding performance of the central motion vector and the coding performance of each of the edge motion vectors, a candidate motion vector of the original reference frame is determined from the central motion vector and the edge motion vector.
- 根据权利要求30或31所述的方法,其特征在于,根据所述候选参考帧的所述初始运动矢量获取所述候选参考帧对应的所述候选运动矢量,包括:The method according to claim 30 or 31, wherein acquiring the candidate motion vector corresponding to the candidate reference frame according to the initial motion vector of the candidate reference frame comprises:将所述候选参考帧的初始运动矢量确定为中心运动矢量;Determining an initial motion vector of the candidate reference frame as a central motion vector;确定与所述中心运动矢量对应的边缘运动矢量;所述边缘运动矢量与所述中心运动矢量不同;Determining an edge motion vector corresponding to the central motion vector; the edge motion vector is different from the central motion vector;根据所述模板获得所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能;Obtaining the encoding performance of the central motion vector and the encoding performance of each of the edge motion vectors according to the template;根据所述中心运动矢量的编码性能和各个所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述候选参考帧对应的所述候选运动矢量。According to the coding performance of the central motion vector and the coding performance of each of the edge motion vectors, the candidate motion vector corresponding to the candidate reference frame is determined from the central motion vector and the edge motion vector.
- 根据权利要求26所述的方法,其特征在于,The method according to claim 26, wherein:所述原始模式信息为原始预测图像块,The original mode information is an original predicted image block,所述目标模式信息为目标预测图像块,The target mode information is a target prediction image block,基于所述当前图像块的所述模板和所述原始模式信息获取所述当前图像块的所述目标模式信息,具体包括:Obtaining the target mode information of the current image block based on the template and the original mode information of the current image block specifically includes:根据所述模板和所述模板对应的参考块,获取变换系数;Obtaining transform coefficients according to the template and a reference block corresponding to the template;根据所述变换系数对所述原始预测图像块进行光照补偿,得到所述目标预测图 像块。Illumination compensation is performed on the original prediction image block according to the transform coefficient to obtain the target prediction image block.
- 根据权利要求34所述的方法,其特征在于,根据所述模板和所述模板对应的参考块,获取所述变换系数之前,还包括:The method according to claim 34, wherein before acquiring the transform coefficient according to the template and a reference block corresponding to the template, further comprising:获取所述当前图像块的运动矢量和所述运动矢量对应的参考帧索引;Acquiring a motion vector of the current image block and a reference frame index corresponding to the motion vector;根据所述当前图像块的所述运动矢量和所述参考帧索引获得所述模板对应的参考块。Obtaining a reference block corresponding to the template according to the motion vector and the reference frame index of the current image block.
- 根据权利要求34所述的方法,其特征在于,根据所述模板和所述模板对应的参考块,获取所述变换系数,包括:The method according to claim 34, wherein obtaining the transformation coefficient according to the template and a reference block corresponding to the template comprises:根据所述模板的各像素的参数信息、所述模板对应的参考块的各像素的参数信息,获取所述变换系数;Obtaining the transformation coefficient according to parameter information of each pixel of the template and parameter information of each pixel of a reference block corresponding to the template;其中,所述参数信息包括亮度值。The parameter information includes a brightness value.
- 根据权利要求26至36中任一项所述的方法,其特征在于,The method according to any one of claims 26 to 36, wherein所述候选图像块包括M个第一候选图像块和N个第二候选图像块,M为大于或等于1的自然数,N为大于或等于0的自然数,或者,M为大于或等于0的自然数,N为大于或等于1的自然数;The candidate image block includes M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 , N is a natural number greater than or equal to 1;所述第一候选图像块为所述当前图像块上侧的候选图像块,The first candidate image block is a candidate image block above the current image block,所述第二候选图像块为所述当前图像块左侧的候选图像块;The second candidate image block is a candidate image block to the left of the current image block;根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:Obtaining a template of the current image block according to the motion information of the candidate image block includes:根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板;Determining a first template according to a motion vector prediction mode and motion information of the M first candidate image blocks;根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板;Determine a second template according to the motion vector prediction mode and motion information of the N second candidate image blocks;将所述第一模板确定为所述当前图像块的模板,或者将所述第二模板确定为所述当前图像块的模板,或者将所述第一模板和所述第二模板拼接之后确定为所述当前图像块的模板。Determining the first template as a template of the current image block, or determining the second template as a template of the current image block, or stitching the first template and the second template as A template of the current image block.
- 根据权利要求37所述的方法,其特征在于,The method according to claim 37, wherein:所述第一候选图像块包括所述当前图像块上侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式;The first candidate image block includes an adjacent image block and / or a second-neighbor image block on the upper side of the current image block; a prediction mode of the adjacent image block is an inter mode or an intra mode; and the second neighbor The prediction mode of the image block is an inter mode;所述第二候选图像块包括所述当前图像块左侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式。The second candidate image block includes an adjacent image block and / or a second-neighbor image block to the left of the current image block; a prediction mode of the adjacent image block is an inter mode or an intra mode; and the second neighbor The prediction mode of an image block is an inter mode.
- 根据权利要求37所述的方法,其特征在于,The method according to claim 37, wherein:当所述M大于1时,所述第一模板包括M个子模板或者P个子模板,且由所述M个子模板或所述P个子模板拼接而成,所述P为帧间模式的第一候选图像块的数量;When M is greater than 1, the first template includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or P sub-templates, where P is the first candidate for the inter-frame mode The number of image blocks;当所述M等于1时,所述第一模板包括第一子模板,所述第一子模板是根据所述当前图像块上侧的一个候选图像块的运动矢量预测模式和运动信息确定的。When M is equal to 1, the first template includes a first sub-template, and the first sub-template is determined according to a motion vector prediction mode and motion information of a candidate image block on an upper side of the current image block.
- 根据权利要求39所述的方法,其特征在于,The method according to claim 39, wherein:所述运动信息包括所述第一候选图像块的运动矢量和参考帧索引,The motion information includes a motion vector and a reference frame index of the first candidate image block,根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:Determining the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks includes:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode,根据所述参考帧索引确定所述第i个候选图像块的参考帧图像;Determining a reference frame image of the i-th candidate image block according to the reference frame index;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块的运动矢量相匹配;Determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the relative of the reference image block and the i-th candidate image block The displacement matches the motion vector of the i-th candidate image block;根据所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板。According to the reference image block, an image block having a first horizontal length and a first vertical length is obtained as an i-th sub-template included in the first template.
- 根据权利要求40所述的方法,其特征在于,根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,还包括:The method according to claim 40, wherein determining the first template according to a motion vector prediction mode and motion information of the M first candidate image blocks further comprises:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,将所述第i个候选图像块按照默认值填充,并Fill the i-th candidate image block with a default value, and获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;Acquiring an image block having a first horizontal length and a first vertical length as an i-th sub-template included in the first template;或者,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,Alternatively, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;Determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块对应的运动矢量相匹配;Determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of is matched with the motion vector corresponding to the i-th candidate image block;根据所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;Obtaining, according to the reference image block, an image block having a first horizontal length and a first vertical length as an i-th sub-template included in the first template;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。The reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- 根据权利要求40或41所述的方法,其特征在于,The method according to claim 40 or 41, wherein:所述第一横向长度与所述第一候选图像块的横向长度满足第一比例关系,或者与所述当前图像块的横向长度满足第二比例关系,或者等于第一预设长度;The first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship, or the horizontal length of the current image block satisfies a second proportional relationship, or is equal to a first preset length;所述第一纵向长度与所述第一候选图像块的纵向长度满足第三比例关系,或者与所述当前图像块的纵向长度满足第四比例关系,或者等于第二预设长度。The first longitudinal length and the longitudinal length of the first candidate image block satisfy a third proportional relationship, or the longitudinal length of the current image block satisfies a fourth proportional relationship, or is equal to a second preset length.
- 根据权利要求37所述的方法,其特征在于,The method according to claim 37, wherein:当所述N大于1时,所述第二模板包括N个子模板或者R个子模板,且由所述N个子模板或所述R个子模板拼接而成,所述R为帧间模式的第二候选图像块的数量;When N is greater than 1, the second template includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or R sub-templates, and R is the second candidate of the inter-frame mode. The number of image blocks;当所述N等于1时,所述第二模板包括第二子模板,所述第二子模板是根据所述当前图像块左侧的一个候选图像块的运动矢量预测模式和运动信息确定的。When N is equal to 1, the second template includes a second sub-template, and the second sub-template is determined according to a motion vector prediction mode and motion information of a candidate image block on the left side of the current image block.
- 根据权利要求43所述的方法,其特征在于,The method according to claim 43, wherein:所述运动信息包括所述第二候选图像块的运动矢量和参考帧索引,The motion information includes a motion vector and a reference frame index of the second candidate image block,根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,包括:Determining the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks, including:针对所述N个第二候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,For the ith candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an inter mode,根据所述参考帧索引确定所述第i个候选图像块的参考帧图像;Determining a reference frame image of the i-th candidate image block according to the reference frame index;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第 i个候选图像块的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块的运动矢量相匹配;Determining a reference image block of the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the relative of the reference image block and the i-th candidate image block The displacement matches the motion vector of the i-th candidate image block;根据所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板。According to the reference image block, an image block having a second horizontal length and a second vertical length is obtained as an i-th sub-template included in the second template.
- 根据权利要求43所述的方法,其特征在于,根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,还包括:The method according to claim 43, wherein determining the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks further comprises:针对所述N个第二候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,For the ith candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an intra mode,将所述第i个候选图像块按照默认值填充,并Fill the i-th candidate image block with a default value, and获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板;Acquiring an image block having a second horizontal length and a second vertical length as an i-th sub-template included in the second template;或者,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,Alternatively, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;Determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位移与所述第i个候选图像块对应的运动矢量相匹配;Determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector corresponding to the i-th candidate image block, the reference image block and the i-th candidate image block The relative displacement of is matched with the motion vector corresponding to the i-th candidate image block;根据所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第一模板包括的第i个子模板;Obtaining, according to the reference image block, an image block having a second horizontal length and a second vertical length as an i-th sub-template included in the first template;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。The reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indexes and motion vectors of neighboring image blocks of the i-th candidate image block.
- 根据权利要求44或45所述的方法,其特征在于,The method according to claim 44 or 45, wherein:所述第二横向长度与所述第二候选图像块的横向长度满足第五比例关系,或者与所述当前图像块的横向长度满足第六比例关系,或者等于第三预设长度;The second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship, or the horizontal length of the current image block satisfies a sixth proportional relationship, or is equal to a third preset length;所述第二纵向长度与所述第二候选图像块的纵向长度满足第七比例关系,或者与所述当前图像块的纵向长度满足第八比例关系,或者等于第四预设长度。The second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or the vertical length of the current image block satisfies an eighth proportional relationship, or is equal to a fourth preset length.
- 根据权利要求37至46中任一项所述的方法,其特征在于,根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:The method according to any one of claims 37 to 46, wherein obtaining a template of the current image block according to the motion information of the candidate image block comprises:当所述当前图像块对应多个运动信息时,获取每个运动信息对应的模板,其中,当前图像块对应的运动信息可包括当前图像块的原始运动信息;When the current image block corresponds to a plurality of motion information, obtaining a template corresponding to each motion information, wherein the motion information corresponding to the current image block may include the original motion information of the current image block;获取每个运动信息对应的权重,并Obtain the weight corresponding to each sport information, and根据每个运动信息对应的权重以及所述运动信息对应的模板获取所述当前图像块的模板。A template of the current image block is obtained according to a weight corresponding to each motion information and a template corresponding to the motion information.
- 一种解码端设备,包括:A decoding device includes:处理器;和Processor; and机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;A machine-readable storage medium storing machine-executable instructions executable by the processor;其中,所述处理器用于执行所述机器可执行指令,以实现权利要求1-24任一所述的方法步骤。The processor is configured to execute the machine-executable instructions to implement the method steps of any one of claims 1-24.
- 一种编码端设备,包括:An encoding end device includes:处理器;和Processor; and机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;A machine-readable storage medium storing machine-executable instructions executable by the processor;其中,所述处理器用于执行机器可执行指令,以实现权利要求25-47任一所述的方法步骤。The processor is configured to execute machine-executable instructions to implement the method steps of any one of claims 25-47.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810692041.X | 2018-06-28 | ||
CN201810692041.XA CN110662033B (en) | 2018-06-28 | 2018-06-28 | Decoding and encoding method and device thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020001591A1 true WO2020001591A1 (en) | 2020-01-02 |
Family
ID=68984489
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/093574 WO2020001591A1 (en) | 2018-06-28 | 2019-06-28 | Decoding and encoding methods and apparatus thereof |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110662033B (en) |
WO (1) | WO2020001591A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023044916A1 (en) * | 2021-09-27 | 2023-03-30 | Oppo广东移动通信有限公司 | Intra prediction method, encoder, decoder, and encoding and decoding system |
CN116800956A (en) * | 2022-01-07 | 2023-09-22 | 杭州海康威视数字技术股份有限公司 | Image encoding and decoding method, device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5818969A (en) * | 1995-05-12 | 1998-10-06 | Intel Corporation | Intelligent start for motion estimation search |
CN1497981A (en) * | 2002-07-16 | 2004-05-19 | ���ǵ�����ʽ���� | Method and device for code and decode motion vector |
KR100928325B1 (en) * | 2007-10-15 | 2009-11-25 | 세종대학교산학협력단 | Image encoding and decoding method and apparatus |
CN101895675A (en) * | 2010-07-26 | 2010-11-24 | 杭州海康威视软件有限公司 | Motion detection method and device |
CN102177716A (en) * | 2008-10-09 | 2011-09-07 | 株式会社Ntt都科摩 | Moving image encoding device, moving image decoding device, moving image encoding method, moving image decoding method, moving image encoding program, moving image decoding program, moving image processing system and moving image processing method |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5869493B2 (en) * | 2009-12-08 | 2016-02-24 | トムソン ライセンシングThomson Licensing | Method and apparatus for adaptive residual update of template matching prediction for video encoding and decoding |
CN102215386B (en) * | 2010-04-09 | 2013-03-27 | 华为技术有限公司 | Video image block processing method and device |
KR101456499B1 (en) * | 2010-07-09 | 2014-11-03 | 삼성전자주식회사 | Method and apparatus for encoding and decoding motion vector |
EP3301919A1 (en) * | 2016-10-03 | 2018-04-04 | Thomson Licensing | Method and apparatus for encoding and decoding motion information |
CN108134939B (en) * | 2016-12-01 | 2020-08-07 | 北京金山云网络技术有限公司 | Motion estimation method and device |
CN106604035B (en) * | 2017-01-22 | 2019-10-18 | 北京君泊网络科技有限责任公司 | A method of the estimation for Video coding and compression |
-
2018
- 2018-06-28 CN CN201810692041.XA patent/CN110662033B/en active Active
-
2019
- 2019-06-28 WO PCT/CN2019/093574 patent/WO2020001591A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5818969A (en) * | 1995-05-12 | 1998-10-06 | Intel Corporation | Intelligent start for motion estimation search |
CN1497981A (en) * | 2002-07-16 | 2004-05-19 | ���ǵ�����ʽ���� | Method and device for code and decode motion vector |
KR100928325B1 (en) * | 2007-10-15 | 2009-11-25 | 세종대학교산학협력단 | Image encoding and decoding method and apparatus |
CN102177716A (en) * | 2008-10-09 | 2011-09-07 | 株式会社Ntt都科摩 | Moving image encoding device, moving image decoding device, moving image encoding method, moving image decoding method, moving image encoding program, moving image decoding program, moving image processing system and moving image processing method |
CN101895675A (en) * | 2010-07-26 | 2010-11-24 | 杭州海康威视软件有限公司 | Motion detection method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110662033B (en) | 2021-11-23 |
CN110662033A (en) | 2020-01-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5937717B2 (en) | Video decoding method and apparatus | |
US8098731B2 (en) | Intraprediction method and apparatus using video symmetry and video encoding and decoding method and apparatus | |
US8554001B2 (en) | Image encoding/decoding system using graph based pixel prediction and encoding system and method | |
TWI639330B (en) | Method and apparatus of video coding with interpolated reference pictures | |
WO2020057559A1 (en) | Decoding and encoding method and device therefor | |
US9591313B2 (en) | Video encoder with transform size preprocessing and methods for use therewith | |
US20160057444A1 (en) | Method and apparatus for encoding or decoding an image with inter layer motion information prediction according to motion information compression scheme | |
US9294765B2 (en) | Video encoder with intra-prediction pre-processing and methods for use therewith | |
US9979976B2 (en) | Light-weight video coding system and decoder for light-weight video coding system | |
KR20220098284A (en) | Limited memory access window for motion vector refinement | |
CN111698500B (en) | Encoding and decoding method, device and equipment | |
TWI790662B (en) | Encoding and decoding method, apparatus and device thereof | |
WO2019080892A1 (en) | Method and device for determining motion vector of affine coding block | |
WO2020001591A1 (en) | Decoding and encoding methods and apparatus thereof | |
WO2020001624A1 (en) | Method and apparatus for determining motion vector | |
WO2020010741A1 (en) | Video encoder, video decoder, and corresponding method | |
WO2020253728A1 (en) | Encoding method and device | |
WO2020007306A1 (en) | Decoding and encoding method and device | |
TWI748522B (en) | Video encoder, video decoder, and related methods | |
WO2020063598A1 (en) | A video encoder, a video decoder and corresponding methods | |
Jubran et al. | Sequence-level reference frames in video coding | |
WO2010061515A1 (en) | Dynamic image encoding device, encoding method, dynamic image decoding device, and decoding method | |
WO2019196650A1 (en) | Method and apparatus for determining motion vector, and device thereof | |
Ates | Enhanced low bitrate H. 264 video coding using decoder-side super-resolution and frame interpolation | |
KR101525325B1 (en) | Intra prediction mode determination method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19825547 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19825547 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19825547 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19825547 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22/06/2021) |