Image encoding method, electronic device and medium

A multi-level search strategy with adaptive parameter adjustment for motion estimation enhances the efficiency and accuracy of inter-frame prediction coding by leveraging previous search results for subsequent blocks, addressing inefficiencies in existing methods.

CN115103196BActive Publication Date: 2024-12-17ARM TECH CHINA CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202210702199.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-21
Publication Date
2024-12-17
Estimated Expiration
2042-06-21

AI Technical Summary

Technical Problem

Existing inter-frame prediction coding methods in video encoding suffer from inefficiencies due to the lack of adaptive adjustment of search parameters for motion vectors, leading to large residual values and reduced coding efficiency when handling high-speed object movements.

Method used

Implement a multi-level search strategy with preset adjustment parameters for motion estimation, where the search process for subsequent blocks utilizes the adjustment parameters from previous blocks, enhancing the accuracy and efficiency of motion vector estimation.

Benefits of technology

The proposed method improves the coding efficiency by utilizing previous search results to adjust parameters for subsequent blocks, reducing motion vector errors and enhancing the accuracy of motion compensation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115103196B_ABST
    Figure CN115103196B_ABST
Patent Text Reader

Abstract

The present application relates to the field of video coding technology, and specifically to an image coding method, an electronic device, and a medium, wherein the method comprises: obtaining an image to be coded, and dividing the image to be coded into a plurality of blocks to be coded; determining target blocks that match the blocks to be coded in the image to be coded from a reference image; determining the motion displacement between the blocks to be coded and the reference image based on the matched target blocks; encoding the image to be coded according to the determined motion displacement, wherein a first preset adjustment parameter preset by a first-level search strategy is used; and in the process of searching for a matching second target block from the reference image for a second block to be coded, the first-level search strategy adopts the first preset adjustment parameter. The image coding method of the present application realizes that the search result of the previous image block can be used to adjust the search process of the next image block, which is beneficial to improving the coding efficiency of the image frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video encoding, and in particular to an image encoding method, electronic equipment and storage medium. Background Art

[0002] In the process of shooting or sending a video, the encoding end of the electronic device usually needs to encode the captured video data into a code stream (i.e., encoded data) and then save or send it, while the decoding end of the electronic device can decode the received code stream and then play the corresponding video. Current video encoding generally adopts inter-frame prediction coding (image coding) technology, and its specific encoding process is: obtain the current frame data to be encoded and the encoded reference frame data in the video data, and encode the residual value between the current frame and the reference frame to obtain the encoded data of the current frame. The reference frame is usually the previous frame or the next frame of image data continuous with the current frame. The image data of the reference frame can be complete image data containing the data of each pixel point, or it can be other parameter data that can describe the reference frame image, such as residual value data determined based on other reference frames with complete image data, etc., which are not limited here.

[0003] In the process of inter-frame prediction coding, motion estimation (ME) technology is usually used to solve problems such as large residual values ​​between two consecutive frames of images due to the high-speed movement of the captured object, a large amount of data that needs to be processed by the encoding end of the electronic device, and low efficiency of inter-frame prediction coding.

[0004] refer to Figure 1 As shown, the motion estimation technology is to convert any image block (e.g. Figure 1 The current block in the current frame shown in the figure) can be searched for a matching block corresponding to the current block in the current frame in a preset search method in the reference frame (for example Figure 1 Then, according to the mapping position of the current block in the reference frame (i.e. Figure 1 The position of the current frame in the reference block shown in the figure) and the position of the matching block in the reference frame are used to estimate the motion vector (MV) that needs to be compensated for the current block, that is, the displacement size and direction (motion change) of the current block relative to the matching block. At this time, the electronic device can perform motion compensation on the current block based on the motion vector and then calculate the residual value between the current block and the matching block, and then encode the motion vector information and the calculated residual value information into the bitstream. The decoding end then performs motion compensation prediction on the current block of the current frame based on the decoded motion vector information and residual value to obtain the complete image data of the current frame for display.

[0005] At present, when inter-frame prediction coding is performed, the search method used for estimating motion vectors is a search method for searching for matching blocks corresponding to image blocks in reference frames, such as a hierarchical search method. Taking the hierarchical search method with a two-level search structure as an example, the first-level search structure is used to determine a first matching result of the image block. The first matching result here may include: in a specific area (search area) of the reference frame, a preset search method, i.e., a rough search, is used to determine a matching block and determine the starting position of the matching block search by the second-level search structure; the second-level search structure is used to search from the first matching result determined by the first-level search structure, i.e., the starting position of the matching block, until a matching block is obtained, i.e., a precise search; the obtained matching block will be sent to a rate-distortion optimization module (RDO), i.e., a decision module, and the decision module determines a final matching block, i.e., a matching block of the optimal result, based on the received matching block and other matching blocks formed after dividing the matching block. For example, the decision module can input the received matching block and the divided matching block into a decision function, and determine the matching block with the smallest cost value of the decision function as the final matching block. It can be seen that for the above-mentioned hierarchical search method, each time the search for the matching block corresponding to an image block is completed and the next search (the search for the matching block corresponding to the next image block, i.e., the adjacent image block) is entered, the first-level search structure in the next search process will still determine the search for the next image block through the preset search method, and will not adjust the search method for the matching block every time. However, the motion changes between the adjacent image blocks in the same current frame and the corresponding matching blocks in the reference frame will not be very different. Therefore, it is necessary to provide a search method so that the search process for the matching block of the adjacent image block next time can refer to the search results of the matching block corresponding to the previous image block, which can improve the accuracy and efficiency of the search for the matching block corresponding to the adjacent image block. Summary of the invention

[0006] Embodiments of the present application provide an image encoding method, an electronic device, and a medium.

[0007] A first aspect of the present application provides an image encoding method, the method comprising:

[0008] Obtaining an image to be encoded, and dividing the image to be encoded into a plurality of blocks to be encoded;

[0009] Determining target blocks that match the blocks to be encoded in the image to be encoded from the reference image;

[0010] Determine the motion displacement between the block to be encoded and the reference image based on the matched target block;

[0011] Encoding the image to be encoded according to the determined motion displacement;

[0012] The step of determining target blocks that match the blocks to be encoded in the image to be encoded from the reference image includes:

[0013] A multi-level search strategy is adopted to search for a first target block matching a first block to be encoded among multiple blocks to be encoded from a reference image, wherein each level of the search strategy is preset with multiple preset adjustment parameters, and in the process of searching for the first target block, a first level of the multi-level search strategy adopts: using a first preset adjustment parameter among the multiple preset adjustment parameters preset by the first level of the search strategy;

[0014] A multi-level search strategy is adopted to search a second target block matching a second block to be encoded among a plurality of blocks to be encoded from a reference image, wherein the second block to be encoded is adjacent to the first block to be encoded, and

[0015] In the process of searching for a matching second target block from a reference image for a second block to be encoded, the first-level search strategy adopts a first preset adjustment parameter.

[0016] That is, in the embodiment of the present application, the image to be encoded here may be the current frame, the reference image here may be the reference frame, and the image to be encoded and the reference image may be the previous or next consecutive frames of images in the video. The block to be encoded here may be an image block in the image to be encoded, that is, an image block in the current frame. The target block here may be a matching block with the smallest cost value corresponding to the block to be encoded determined in the reference image, that is, the best matching block. The motion displacement here may be a motion vector between the block to be encoded and the target block.

[0017] That is, in the embodiment of the present application, a multi-level search strategy is adopted here, but the encoder 200b using the RME module 210b and the FME module 220b performs the first-level search and the second-level search on the reference image respectively (that is, the first-level search strategy and the second-level search strategy). The RME module 210b here can be the first-level search, and the RME module 210b can be preset with the cost function J rme and at least one set of tuning parameters λ rme , for example: adjust the parameter λ rme Including Lambda rme1 To rme10 That is, the index values ​​1 to 10, the FME module 220b can be preset with the cost function J fme and at least one set of tuning parameters λ fme , for example: adjust the parameter λ fme Including Lambda fme1 To fme10 That is, index values ​​1 to 10, adjusting parameter λ rme And adjust the parameter λ fme The index values ​​of can be one-to-one, that is, for example, λrme1 With λ fme1 Correspondingly, rme2 With λ fme2 Corresponding, until λ rme10 With λ fme10 The first preset adjustment parameter here may be λ used by the RME module 210b. rme2 The RME module 210b (first level search) determines the starting position of the FME module 220b (second level search) searching for the first block to be encoded by the first preset adjustment parameter, and the FME module 220b (second level search) adjusts the parameter λ by the second preset adjustment parameter. fme Get multiple matching blocks corresponding to the first block to be encoded. The multiple matching blocks here can be adjusted by the adjustment parameter λ of the FME module 220b (second-level search) fme Corresponding to the index value of, the encoder 200b determines the first target block corresponding to the first block to be encoded from multiple matching blocks through the RDO module 230b, that is, the matching block with the smallest cost value, the best matching block. Corresponding to the first target block and the adjustment parameter λ fme2 Correspondingly, when the encoder 200b searches for the second target block corresponding to the second block to be encoded, the RME module 210b still uses the adjustment parameter λ rme2 , that is, the RDO module 230b can adjust the parameter λ corresponding to the first target block fme2 Sequence number 2 is sent to the RME module 210b, so that the RME module 210b uses the adjustment parameter λ of sequence number 2 rme2 .

[0018] It can be seen that the search structure (i.e., the search process) for performing hierarchical search on the matching blocks corresponding to the image blocks respectively sets the same number of adjustment parameters with the same index value, and after performing matching block search on the first block to be encoded, the matching block with the smallest cost value, i.e., the first target block, is determined; the target adjustment parameter corresponding to the matching block, i.e., the adjustment parameter λ fme2 , so that the search process of the second block to be encoded can directly use the adjustment parameter corresponding to the index value of the target adjustment parameter, that is, the adjustment parameter λ rme2 , it is achieved that the search result of the previous image block can be used to adjust the search process of the next image block, which is beneficial to improving the coding efficiency of the image frame.

[0019] In a possible implementation of the first aspect above, the second-level search strategy in the multi-level search strategy is preset with multiple preset adjustment parameters, wherein the multiple preset adjustment parameters preset in the second-level search strategy correspond one-to-one to the multiple preset adjustment parameters preset in the first-level search strategy.

[0020] That is, in the embodiment of the present application, the RME module 210b may be preset with at least one set of adjustment parameters λ rme , for example: adjust the parameter λ rme Including Lambda rme1 To rme10 That is, the index values ​​1 to 10, the FME module 220b may be preset with at least one set of adjustment parameters λ fme , for example: adjust the parameter λ fme Including Lambda fme1 To fme10 That is, index values ​​1 to 10, adjusting parameter λ rme And adjust the parameter λ fme The index values ​​of can be one-to-one, that is, for example, λ rme1 With λ fme1 Correspondingly, rme2 With λ fme2 Corresponding, until λ rme10 With λ fme10 correspond.

[0021] In a possible implementation of the first aspect, determining target blocks that match the blocks to be encoded in the image to be encoded from the reference image, respectively, further includes:

[0022] In the process of searching for the first target block, the second level search strategy in the multi-level search strategy adopts: using a plurality of preset adjustment parameters preset by the second level search strategy to obtain a plurality of first reference blocks;

[0023] A first target block is determined from a plurality of first reference blocks.

[0024] That is, in the embodiment of the present application, the RME module 210b (first-level search) determines the starting position of the FME module 220b (second-level search) searching for the first block to be encoded by the first preset adjustment parameter, and the FME module 220b (second-level search) adjusts the parameter λ by the second preset adjustment parameter. fme Get a plurality of first reference blocks corresponding to the first block to be encoded, where the plurality of first reference blocks can be adjusted with the adjustment parameter λ of the FME module 220b (second-level search) fme The encoder 200b determines the first target block corresponding to the first block to be encoded, that is, the matching block with the smallest cost value, the best matching block, from multiple first reference blocks through the RDO module 230b, that is, the decision module.

[0025] In a possible implementation of the first aspect, determining a first target block from a plurality of first reference blocks includes:

[0026] Obtaining result values ​​corresponding to the plurality of first reference blocks through a preset decision function;

[0027] The first reference block corresponding to the result value that meets the preset judgment threshold is determined as the first target block, wherein the index value of the preset adjustment parameter used when the second-level search strategy searches for the first target block corresponds to the first preset adjustment parameter among the multiple preset adjustment parameters of the first-level search strategy.

[0028] In a possible implementation of the first aspect above, it also includes: corresponding to the process of searching for a matching second target block from a reference image for a second block to be encoded, sending the index value of the preset adjustment parameter used by the second-level search strategy when searching for the first target block to the first-level search strategy.

[0029] That is, in the embodiment of the present application, corresponding to the first target block and the adjustment parameter λ fme2 Correspondingly, when the encoder 200b searches for the second target block corresponding to the second block to be encoded, the RME module 210b still uses the adjustment parameter λ rme2 , that is, the RDO module 230b can adjust the parameter λ corresponding to the first target block fme2 Sequence number 2 is sent to the RME module 210b, so that the RME module 210b uses the adjustment parameter λ of sequence number 2 rme2 .

[0030] In a possible implementation of the first aspect, searching for a second target block matching a second block to be encoded among the multiple blocks to be encoded from a reference image includes:

[0031] Using a plurality of preset adjustment parameters preset by the second-level search strategy, obtaining a plurality of second reference blocks;

[0032] A second target block is determined from multiple second reference blocks, wherein the index value of the preset adjustment parameter used when the second-level search strategy searches for the second target block corresponds to the second preset adjustment parameter among the multiple preset adjustment parameters of the first-level search strategy.

[0033] That is, in the embodiment of the present application, the FME module 220b (second-level search) adjusts the parameter λ by the second preset adjustment parameter. fme Get a plurality of second reference blocks corresponding to the second block to be encoded, where the plurality of second reference blocks can be adjusted with the adjustment parameter λ of the FME module 220b (second-level search) fme The encoder 200b determines the second target block corresponding to the first block to be encoded, that is, the matching block with the smallest cost value, the best matching block, from multiple second reference blocks through the RDO module 230b, that is, the decision module.

[0034] In a possible implementation of the first aspect, the present invention further includes:

[0035] searching the reference image for a third target block that matches a third block to be encoded among the plurality of blocks to be encoded, wherein the third block to be encoded is adjacent to the second block to be encoded, and

[0036] In the process of searching for a matching third target block from the reference image for the third block to be encoded, the first-level search strategy adopts the second preset adjustment parameter.

[0037] That is, in the embodiment of the present application, corresponding to the second target block and the adjustment parameter λ fme3 Correspondingly, when the encoder 200b searches for the third target block corresponding to the third block to be encoded, the adjustment parameter λ used by the RME module 210b is rme3 , that is, the RDO module 230b can adjust the parameter λ corresponding to the second target block fme3 Sequence number 3 is sent to the RME module 210b, so that the RME module 210b uses the adjustment parameter λ of sequence number 3 rme3 .

[0038] In a possible implementation of the first aspect above, the preset decision function is a cost function, and the result value is an output value of the cost function.

[0039] In a possible implementation of the first aspect, meeting a preset decision threshold includes: a result value corresponding to the first target block is a minimum value among result values ​​corresponding to multiple first reference blocks.

[0040] That is, in the embodiment of the present application, for example, the preset decision threshold here can be the RDO module 230b through the decision function (cost function), that is, J rdo The determined FME module 220b (second level search) adjusts the parameter λ by the second preset adjustment parameter fme A minimum value of cost values ​​among a plurality of first reference blocks corresponding to the first block to be encoded is obtained.

[0041] That is, in the embodiments of the present application,

[0042] A second aspect of the present application provides an image coding system, the system comprising:

[0043] An acquisition module, the acquisition module is used to acquire the image to be encoded and divide the image to be encoded into a plurality of blocks to be encoded;

[0044] A search module, the search module is used to determine target blocks that match the blocks to be encoded in the image to be encoded from the reference image;

[0045] A calculation module, the calculation module is used to determine the motion displacement between the to-be-encoded block and the reference image based on the matched target block;

[0046] An encoding module, the encoding module is used to encode the image to be encoded according to the determined motion displacement;

[0047] The step of determining target blocks that match the blocks to be encoded in the image to be encoded from the reference image includes:

[0048] A multi-level search strategy is adopted to search for a first target block matching a first block to be encoded among multiple blocks to be encoded from a reference image, wherein each level of the search strategy is preset with multiple preset adjustment parameters, and in the process of searching for the first target block, a first level of the multi-level search strategy adopts: using a first preset adjustment parameter among the multiple preset adjustment parameters preset by the first level of the search strategy;

[0049] A multi-level search strategy is adopted to search a second target block matching a second block to be encoded among a plurality of blocks to be encoded from a reference image, wherein the second block to be encoded is adjacent to the first block to be encoded, and

[0050] In the process of searching for a matching second target block from a reference image for a second block to be encoded, the first-level search strategy adopts a first preset adjustment parameter.

[0051] That is, in the embodiment of the present application, the acquisition module, search module, calculation module and encoding module here may be functional modules in the encoder 200b. For example, the search module may be the RME module 210b, the FME module 220b and the RDO module 230b.

[0052] The third aspect of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device, and a processor, which is one of the processors of the electronic device, for executing the image encoding method provided by the aforementioned first aspect.

[0053] The fourth aspect of the present application provides a readable medium, on which instructions are stored. When the instructions are executed on an electronic device, the electronic device executes the image encoding method provided by the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 The figure shows a schematic diagram of a motion estimation scenario provided by an embodiment of the present application;

[0055] Figure 2a FIG. 2 is a schematic diagram of a module structure of an encoder 200a provided in an embodiment of the present application;

[0056] Figure 2b FIG. 1 is a schematic diagram of a search process for searching a reference frame for a matching block corresponding to an image block in a current frame provided by an embodiment of the present application;

[0057] Figure 3aThe figure shows a basic structural diagram of an encoder 200b provided in an embodiment of the present application;

[0058] Figure 3b and Figure 3c FIG. 1 is a schematic diagram of a search process for searching a reference frame for a matching block corresponding to an image block in a current frame provided by an embodiment of the present application;

[0059] Figure 3d FIG. 2 is a schematic diagram of the basic structure of another encoder 200b provided in an embodiment of the present application;

[0060] Figure 4 FIG. 1 is a schematic diagram of a search process for searching a reference frame for a matching block corresponding to an image block in a current frame provided by an embodiment of the present application;

[0061] Figure 5 The figure is a schematic diagram of an implementation flow of an image encoding method provided by an embodiment of the present application;

[0062] Figure 6 The figure is a schematic block diagram of the structure of an electronic device applicable to an image encoding method provided in an embodiment of the present application;

[0063] Figure 7 The figure is a schematic block diagram of the structure of a video encoding system provided by an embodiment of the present application;

[0064] Figure 8 The figure is a schematic block diagram of the structure of a system on chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In order to clearly understand the technical solution provided in the embodiment of the present application, the relevant technical terms involved in the video encoding solution provided in the embodiment of the present application are explained below.

[0066] (1) Image block: a pixel set containing a certain number of pixels obtained by dividing a frame of image. Each image block obtained by division may include 16×16 pixels or 32×32 pixels.

[0067] (2) Cost function: a function used to calculate the amount of data consumed (i.e., cost value) by using each reference block selected from the reference frame to predict the pixel data of the corresponding image block in the current frame during the process of searching for a matching block in the reference frame. The corresponding image block in the current frame is, for example, the image block to be encoded, which may be referred to as the current block.

[0068] (3) Cost value: The function value calculated by the cost function, which is also used to represent the data compression cost (eg, number of bits) consumed by predicting the pixel data of the current block by referencing the selected reference block.

[0069] (4) Adjustment parameter λ: Each level of search structure is provided with a corresponding adjustment parameter λ, which can also be referred to as a Lagrange coefficient. The adjustment parameters λ of each level of search structure are independent of each other, that is, the values ​​of the adjustment parameters λ of each level of search structure can be different. The value of the adjustment parameter λ can affect the matching block corresponding to the image block obtained by each level of search structure. For example, taking the search method of the two-level search structure as an example, for the first level search structure, the value of the adjustment parameter λ can be used to determine a matching block in a specific area of ​​the reference frame for the second level search structure to search, that is, a matching block determined in the specific area of ​​the reference frame is used as the starting position of the second level search structure. For the second level search structure, the value of the adjustment parameter λ can be used to further perform the search in the surrounding area of ​​the starting position determined by the first level search structure until the matching block corresponding to the image block is obtained.

[0070] Combine the following Figure 2a and Figure 2b A hierarchical search method for determining a matching block corresponding to an image block in a reference frame provided in an embodiment of the present application is introduced.

[0071] Figure 2a According to an embodiment of the present application, a schematic structural diagram of an encoder with a two-stage search structure is shown.

[0072] like Figure 2a As shown, the encoder 200a includes a coarse motion estimation (RME) module 210a, a fine motion estimation (FME) module 220a and a rate-distortion optimization (RDO) module 230a, wherein the RDO module 230a is the above-mentioned decision module.

[0073] The RME module 210a is used to determine a matching block from a specific area (search area) in the reference frame according to the current block to be encoded in the input current frame (for example, an image block of size 10*10), which is the starting position for further searching by the FME module 220a, and provide it to the FME module 220a. The RME module 210a may be provided with an adjustment parameter λ rme , for example: rme1 The tuning parameter λ here is rme1 can be used for RME module 210a according to λ rme A matching block is determined in a specific area of ​​the reference frame according to the value of as the starting position of the FME module 220a. It can be understood that the RME module 210a here can be a first-level search structure.

[0074] The FME module 220a can search for a matching block of the current block from the reference frame based on the starting position of the search matching block determined by the RME module 210a. The FME module 220a here also has an adjustment parameter λ fme , for example: fme1 The tuning parameter λ here is fme Can be used for FME module 220a according to λ fme The value of further searches the surrounding area of ​​the starting position of the search matching block sent by the RME module 210a to obtain the matching block corresponding to the image block. The FME module 220a inputs the searched matching block into the RDO module 230a for judgment. It can be understood that the FME module 220a here can be a second-level search structure.

[0075] The RDO module 230a is used to perform a cost evaluation on the matching block determined by the FME module 220a, that is, to verify whether the searched matching block is the optimal matching block corresponding to the current block to be encoded. The RDO module 230a here is provided with a decision function (also called a cost function) for making an optimal decision on the searched matching block, that is, the matching block is input using the decision parameter λ rdo In the decision function, the cost value corresponding to the decision function is obtained, and the decision is made with other matching blocks divided by the RDO module 230a. Here, the other matching blocks can be the matching blocks of smaller sizes that are further divided into the input matching blocks, and the matching block with the smallest cost value is determined as the optimal result, and the motion vector between the matching block with the smallest cost value and the current block is calculated.

[0076] For example, continue to refer to Figure 2a , the encoder 200a sequentially searches the reference frame for matching blocks corresponding to the adjacent image blocks 201 and 202 included in the current frame. For the image block 201, the RME module 210a in the encoder 200a uses a preset adjustment parameter λ rme Similarly, the FME module 220a also uses the preset adjustment parameter λ fme After searching and determining the matching block corresponding to the image block 201 in the reference frame, the optimal matching block 203 is determined by the RDO module 230a. For the image block 202, the RME module 210a and the FME module 220a in the encoder 200a will continue to randomly use the preset adjustment parameter λ rme and the tuning parameter λ fmeContinue to search and determine the matching block 204 corresponding to the image block 202 in the reference frame. That is, when the first-level search structure of the encoder 200a searches for matching blocks for the image blocks 201 and 202, the RME module 210a in the encoder 200a will only use the same adjustment parameters each time it searches for an image block. Since there are differences between different image blocks in the current frame, if only the same adjustment parameters are used during the search of all image blocks in the entire current frame, the search efficiency and accuracy of the encoder 200a will be reduced.

[0077] Reference below Figure 2b The implementation process of determining matching blocks in reference frames by using a hierarchical search method currently used to estimate motion vectors during inter-frame prediction coding is introduced.

[0078] Understandably, in addition to using Figure 2a The two-stage search structure described in the two-stage search method can be used to perform a two-stage search. The process of searching for matching blocks from a reference frame can also be divided into two-stage, three-stage or more-stage searches, and the step size of the first-stage search in the multi-stage search is the largest, the step size of the second-stage search can be 1 / 2 of the step size of the first-stage search, the step size of the third-stage search can be 1 / 2 of the step size of the second-stage search, and so on, thereby gradually improving the search accuracy.

[0079] Figure 2b According to an embodiment of the present application, a schematic diagram of a search process for searching a reference frame for a first image block to be encoded in a current frame using a hierarchical search method is shown.

[0080] Assumptions Figure 2b The chessboard-format image shown represents a reference frame, and each grid on the chessboard represents each image block obtained by dividing the reference frame. Based on this, the process of searching for matching blocks in a reference frame by a hierarchical search method in an electronic device may include the following process, for example:

[0081] First-level search: When an electronic device uses a hierarchical search method to perform a first-level search in a reference frame, for example: Figure 2a The RME module 210a of the encoder 200a searches for the RME module 210a using the adjustment parameter λ rme Perform a search, for example: the RME module 210a can start the search based on a preset starting block and a preset search step of 4, that is, starting from the starting block, searching at intervals of 4 image blocks to obtain multiple reference image blocks (referred to as reference blocks) around the starting block and using adjustment parameters for the reference blocks to calculate the value of the cost function (i.e., cost value), and then use the reference block that minimizes the value of the cost function used in the first-level search as the search result of the first-level search, i.e., the first-level matching block.

[0082] As an example, Figure 2bAs shown, the starting block of the first-level search can be, for example, Figure 2b As shown in R1, the first-level search can start from R1, and search around R1 every 4 image blocks to obtain 8 reference blocks R2 to R9. Then, in the first-level search, the cost values ​​of the 8 reference blocks R2 to R9 are calculated according to the preset first-type cost function, and then the reference block with the smallest cost value is determined as the first-level matching block determined by the first-level search structure. As an example, the first-level matching block obtained by the first-level search can be, for example, Figure 2b Similarly, the first-level search can continue to use R4 as the starting block and the step length is 2 to search, and the 8 reference blocks F1 to F8 around R4 can be searched. Then, according to the preset first-type cost function in the first-level search, the cost values ​​of the 8 reference blocks F1 to F8 are calculated respectively, and then the reference block with the smallest cost value is determined to determine the starting position of the second-level search. As an example, the starting position of the second-level search can be Figure 2b F4 shown.

[0083] Second level search: For example: by Figure 2a The FME module 220a of the encoder 200a searches for the FME module 220a using the adjustment parameter λ fme , continue to refer to Figure 2b As shown, for example: The scope of the second-level search can be Figure 2b The area centered on F4 is shown in the figure, and the search step is 1. The reference block for the second-level search is Figure 2b S1 to S8 shown in FIG. 1 are performed by the FME module 220a using the adjustment parameter λ fme The cost function calculates the cost value for the eight reference blocks S1 to S8 respectively, and obtains Figure 2b The matching block S5 is shown.

[0084] It can be understood that if the hierarchical search method adopted by the electronic device is a two-level search, then S5 obtained by the second-level search can be used as a matching block for the first image block to be encoded, and is used for the RDO module 230a of the encoder 200a to make a decision to further determine the best matching block, which is used to estimate the motion vector between the first image block and the reference frame and perform motion compensation on the first image block, and then encode the estimated motion vector information and the residual value between the first image block and the best matching block into the bitstream to complete the encoding process of the first image block of the current frame in the inter-frame prediction encoding process.

[0085] It can be understood that after the best matching block corresponding to the first image block is determined, the best matching block corresponding to the second image block adjacent to the first image block is continuously searched in the reference frame. At this time, if each search structure in the encoder 200a uses a preset adjustment parameter, that is, for the second image block, the RME module 210a of the encoder 200a continues to use the adjustment parameter λ rme It can be seen that the process of the encoder 200a searching for the best matching block corresponding to the first image block will not affect the process of searching for the best matching block corresponding to the second image block, that is, the first-level search structure will not affect the adjustment parameter λ rme Instead of making adjustments, only the cost function with preset adjustment parameters is used. As mentioned above, the hierarchical search method currently used to estimate motion vectors during inter-frame prediction coding cannot adaptively adjust the adjustment parameters of the cost function used in each level of search, resulting in a lack of correlation between the processes of searching for the corresponding matching blocks of adjacent image blocks in the current frame, that is, it does not take into account the correlation between the positions of the corresponding matching blocks of adjacent image blocks in the reference frame, that is, the motion vectors between the adjacent image blocks in the current frame and the reference frame are similar, and therefore, the motion vector errors between the adjacent image blocks and the reference frame are large, which ultimately leads to a technical problem that the calculated residual value between the current frame and the reference frame is still large and the efficiency of inter-frame prediction coding is also low.

[0086] In order to solve the problem that a large error will occur between the motion vectors between the determined adjacent image blocks and the reference frame when searching for matching blocks corresponding to adjacent image blocks (i.e., the first image block and the second image block) in the current frame in the reference frame, an embodiment of the present application proposes an image encoding method. In the process of searching for matching blocks in the reference frame corresponding to the image blocks in the current frame, since the difference in motion changes between the two adjacent image blocks in the current frame and the corresponding matching blocks in the reference frame is small, that is, the motion vectors between the adjacent image blocks in the current frame and the reference frame are similar, the adjustment parameters used when searching for the matching blocks of the first image block can be used to adjust the search process for the matching blocks of the second image block, that is, the search result of the matching blocks of the first image block is used as a reference for the search process for the matching blocks of the second image block.

[0087] Specifically, using Figure 3a Taking the encoder 200b shown in FIG. 2 as an example, searching for matching blocks corresponding to adjacent first and second image blocks in the current frame, first, the RME module 210b and the FME module 220b in the encoder 200b are respectively pre-set with at least one set of M adjustment parameters λ rme , N tuning parameters λ fme , and adjust the parameter λ rme And adjust the parameter λ fme The corresponding quantities can be the same. For example, adjusting the parameter λrme And adjust the parameter λ fme The number of each is 10, that is, the adjustment parameter λ rme Including Lambda rme1 To rme10 That is, index values ​​1 to 10, and adjust the parameter λ rme And adjust the parameter λ fme The index values ​​of can be one-to-one, that is, for example, λ rme1 With λ fme1 Correspondingly, rme2 With λ fme2 Corresponding, until λ rme10 With λ fme10 Correspondingly, that is, M=N.

[0088] It can be understood that if the first image block is the image block arranged at the first position in the current frame, that is, the first image block in the current frame, when searching for a matching block corresponding to the first image block in the reference frame, the RME module 210b in the encoder 200b may use a preset or random adjustment parameter λ rme , for example, randomly choosing the tuning parameter λ rme2 .

[0089] For example, for the adjacent first image block and the second image block in the current frame, the RME module 210b of the encoder 200b uses the adjustment parameter λ rme2 After searching, the FME module 220b determines 10 first matching blocks and sends them to the RDO module 230b, the RDO module 230b can input the 10 first matching blocks of the first image block into the RDO module 230b using the preset decision parameter λ. rdo In the decision function, the λ corresponding to the first matching block with the smallest cost value is further selected. fme The index value, such as λ fme3 , that is, the index value 3, which can also be called the search result of the first image block. When the search for the matching block of the first image block is completed and the search for the matching block of the second image block begins, the RDO module 230b can filter the filtered index value (λ used by the FME module 220b) fme The index value of the RME module 210b is sent to the RME module 210b, and the RME module 210b can use the adjustment parameter λ corresponding to the above index value. rme3 A search is performed to determine a starting position where the FME module 220b searches for a matching block of the second image block.

[0090] It can be understood that for multiple second matching blocks of the second image block, the RDO module 230b can repeat the above steps, determine the second matching block with the smallest cost value from the second matching blocks, and determine the index value of the adjustment parameter in the search process of the third image block adjacent to the second image block, and send it to the RME module 210b before starting to search for the matching block of the third image block.

[0091] In the method of the embodiment of the present application, the search structure (i.e., the search process) for performing hierarchical search on the matching blocks corresponding to the image blocks respectively sets adjustment parameters with the same number and consistent index values, and after performing matching block search on the first image block (e.g., the current block), the matching block with the smallest cost value is determined, and the target adjustment parameter corresponding to the matching block is obtained, so that the search process for the second image block can directly use the adjustment parameter corresponding to the index value of the target adjustment parameter, that is, the search result of the previous image block can be used to adjust the search process of the next image block, which is beneficial to improving the encoding efficiency of the image frame.

[0092] In the embodiment of the present application, a two-level search structure is taken as an example, wherein the first-level search structure and the second-level search structure respectively preset multiple adjustment parameters of the cost function, and each level of the search structure may include one or more cost functions, refer to Figure 3b As shown, each cost function is preset with an adjustment parameter λ for adjusting the ratio between the data compression cost consumed by distortion (i.e., D in the cost function "J=D+λR" shown in the following formula (1)) and the data compression cost consumed by motion vector. The size of the adjustment parameter can affect the size of the cost value calculated by each cost function for each reference block searched from the reference frame. For example, when the object captured in some images moves at a high speed, the value of the adjustment parameter used by the cost function can be adjusted, so that the matching block with a larger movement can be preferentially selected in the process of searching for matching blocks.

[0093] As an example, refer to Figure 3b As shown, for example, the adjustment parameter λ in the cost function preset by the first-level search structure can be rme The adjustment parameter λ in each cost function preset by the second-level search structure fme Preset a one-to-one correspondence, such as the λ in the function ① preset in the first-level search structure rme1 To rme4 , lambda in function ② rme5 To rme6 , lambda in function ③ rme7 To rme10 , and λ in function 1 in the second-level search structure fme1 To fme4 , lambda in function 2 fme5 To fme6, lambda in function 3 fme7 To fme10 One to one correspondence.

[0094] So, further reference Figure 3c As shown, when searching for the best matching block for the current block to be encoded in the current frame for inter-frame prediction encoding, for example, the best matching block 201 of the current block can be searched in the reference block for the current block. In the process of searching for the best matching block 201 for the current block, the cost function adopted by the first-level search structure (RME module) is, for example, an adjustment parameter λ rme1 Function ①, the cost function used in the second-level search structure (FME module) corresponding to the best matching block 201 is, for example, Figure 3b The tuning parameter shown is λ fme2 It can be understood that if the adjustment parameters of the cost function of the first-level search structure and the second-level search structure are not adjusted when searching for the best matching block for the next image block in the current frame, the result that may be searched is Figure 3c The best matching block 202 of the next image is shown, but the best matching block 202 may not be the matching block that can minimize the encoding cost when inter-frame prediction encoding is performed on the next image block.

[0095] If the adjustment is performed through the solution of the present application, the adjustment parameter used in the first-level search structure based on the best matching block 201 of the current block that has been searched is λ rme1 The function ①, the adjustment parameter used in the second-level search structure is λ fme2 Function 1, when searching for the best matching block for the next image block, the adjustment parameter that the first-level search structure can also adopt is λ rme2 The function of ①, that is, with λ fme2 The corresponding tuning parameter is λ rme2 Function ①, that is, the adjustment parameters corresponding to the best matching block 201 obtained for the current block are used to set the adjustment parameters used in the next image block search.

[0096] That is to say, the inter-frame prediction encoding method provided in the embodiment of the present application can be based on the first image block (reference Figure 3c The adjustment parameters of the cost function of the best matching block determined by the current block shown in the figure are further selected from the adjustment parameters of the cost function preset by the first-level search structure of the next adjacent image block, and the adjustment parameters corresponding to the adjustment parameters of the best matching block that have been determined are selected, so that the next adjacent image block to be encoded (reference Figure 3c When searching for the next image block shown in the figure, the search is performed based on the adjustment parameters of the last best matching block, that is, it is convenient to achieve adaptive optimization when searching for the matching block next time.

[0097] Understandably, Figure 3a The first-level search structure and the second-level search structure (RME module 210b and FME module 220b) shown in the figure can both preset a cost function and multiple adjustment parameters. If the first-level search structure and the second-level search structure also include other search structures, multiple optional cost functions and multiple adjustment parameters can also be preset in the above search structures. The electronic device will select the adjustment parameter of the next image block to be encoded in the current frame corresponding to the index value of the adjustment parameter corresponding to the determined best matching block. No limitation is made here.

[0098] It can be understood that the cost functions adopted by the first-level search structure and the second-level search structure in searching for matching blocks for each image block to be encoded in the current frame may be the same or different.

[0099] Based on the above scheme, the adjustment parameters of the cost function used in the search process of the second image block adjacent to the first image block can be adjusted according to the search result of the best matching block corresponding to the first image block. In the process of encoding each image block in the current frame to be encoded, the adjustment parameters of the cost function used when searching for the matching blocks corresponding to each image block can be continuously optimized and dynamically adjusted, thereby improving the search accuracy.

[0100] It can be understood that if in the inter-frame prediction coding process, the following can be used Figure 3a In some embodiments, a multi-level search structure may be used, such as a three-level search structure, and so on, which will not be described in detail here.

[0101] It can be understood that, returning to the reference figure 2b above, the inter-frame prediction coding method provided by the embodiment of the present application can dynamically adjust the adjustment parameters of the cost function adopted by the first-level search structure to optimize the accuracy of the matching results obtained by the first-level search structure in the next round of search. For example, after optimization, the most matching block of the first-level search structure may change from R4 to R6 with a smaller cost value, so that the accuracy of the match is improved. Correspondingly, the second-level search can be searched with R6 as the starting block, that is, the improvement of the accuracy of the first-level search structure will also promote the improvement of the accuracy of the second-level search structure.

[0102] It can be understood that the electronic devices to which the embodiments of the present application are applicable include, but are not limited to, desktop, laptop, handheld and other computers, mobile phones, tablet computers, digital cameras, drones, and augmented reality (AR) and virtual reality (VR) devices, smart TVs, smart watches and other electronic devices configured with encoders or encoding devices used in video encoding systems, and are not limited here.

[0103] It can be understood that the first-level search structure described above can also be referred to as rough motion estimation (RME) in the embodiment of the present application, that is, Figure 2b The process of searching R2 to R9 in the first level search structure. Accordingly, the module in the encoder or encoding device that performs the first level search structure can be described as an RME module. The purpose of RME is to perform a rough search in the target search area for the purpose of saving computation or bandwidth. RME can determine the general direction of motion estimation to determine the starting block of the next level search structure.

[0104] The second-level search structure described above may also be referred to as Fine Motion Estimation (FME) in the embodiment of the present application, that is, Figure 2b The process of searching S1 to S8 in the encoder or encoding device. Accordingly, the module that executes the second-level search structure or the third-level search structure in the encoder or encoding device can be described as an FME module. The purpose of FME is to use the search result of the previous search structure (i.e., RME) as the starting block, and to reduce the step size to continue a new round of search to determine the process of multiple matching blocks corresponding to the current block.

[0105] Taking the hierarchical search method including a two-stage search structure adopted by the encoder when performing inter-frame prediction coding as an example, the specific implementation process of the image coding method provided in the embodiment of the present application is introduced in combination with the corresponding drawings.

[0106] Continue to refer to Figure 2a The encoder shown has a two-stage search structure.

[0107] In the embodiment of the present application, the RME module 210a, the FME module 220a and the RDO module 230a of the encoder 200a can respectively preset cost functions of different accuracy levels as cost functions for determining a rough matching block (the starting position of the FME module 220a), an accurate matching block and an optimal matching block. The basic form of the cost function can refer to formula (1), that is:

[0108] J=D+λR (1)

[0109] Among them, J represents the cost value obtained, D represents the distortion between the current block and the corresponding reference block, R represents the motion vector (MV) between the current block and the reference block corresponding to the encoding and the number of bits (Bits) consumed by the encoding mode, and λ is a preset adjustment parameter.

[0110] It can be understood that the essence of the cost value represented by J refers to the joint cost of data compression consumed and data distortion introduced by predicting the current block to be encoded by referencing the reference block.

[0111] The essence of D in the above formula (1) refers to the similarity between the current block and the reference block. Therefore, the purpose of calculating the cost value J can be understood as finding a matching block in the reference frame that has a high similarity with the current block of the current frame and consumes fewer bits to predict the current block.

[0112] The coding mode corresponding to R in the above formula (1) can be one of the multiple coding modes preset in the coding protocol, for example, it can be intra-frame coding, inter-frame coding and other modes, wherein the adjustment of the coding mode is an indirect adjustment result based on the coding protocol within the encoder, which will not be elaborated here.

[0113] Referring to the above cost formula (1), the cost functions preset in the RME module 210a, the FME module 220a and the RDO module 230a in the encoder 200a can be respectively:

[0114] J rme =D rme +λ rme R rme (2)

[0115] J fme =D fme +λ fme R fme (3)

[0116] J rdo =D rdo +λ rdo R rdo (4)

[0117] The calculation accuracy of each cost function may depend on the accuracy of the estimation algorithm used to calculate D in the corresponding formula and the accuracy of the bit estimation algorithm used to calculate R. For example, in the RME module 210a, D rme The sum of absolute differences (SAD), which is the mean absolute deviation, can be used, which has lower precision. rme The FME module 220a calculates D fme SAD, or the sum of squared differences (SSD) or mean squared error (MSE) with higher accuracy can also be used; R fme You can also use Rrme The same simple binarization bit estimation algorithm is used to calculate it.

[0118] However, in the RDO module 230a, the calculation of D rdo and R rdo It is necessary to use a more accurate estimation algorithm. For example, the RDO module 230a can perform a series of encoding preprocessing operations such as transformation, quantization, inverse quantization and inverse transformation on the multiple fine matching blocks output by the FME module 220a, and then calculate D by using the SSE or MSE algorithm. rdo ; Calculate R rdo A complex bit estimation algorithm such as entropy coding may be used, which is not limited here.

[0119] That is to say, in the encoder 200a adopting the hierarchical search method, when executing the first-level search structure or the second-level search structure, the accuracy of the estimation algorithm used to calculate D or R can be the same or can be gradually improved; and the decision module that performs the decision function to determine the optimal matching block based on the matching block determined by the cost function using the adjustment parameter obtained by the second-level search structure generally needs to use an estimation algorithm with higher calculation accuracy or higher accuracy to calculate the values ​​of D and R in the cost function used by the decision module, even if the calculation complexity of the estimation algorithm used by the decision module is higher, it is necessary to ensure the accuracy of the decision result of the decision module. In this way, the decision result of the decision module can help promote the first-level search structure to achieve adaptive optimization when searching for matching blocks next time.

[0120] In the above Figure 2a The encoder 200b shown is based on the structure of Figure 3a According to an embodiment of the present application, a schematic diagram of the structure of another encoder 200b is shown. It can be understood that the encoder 200b applies the image encoding method provided in the embodiment of the present application.

[0121] and Figure 2a Compared to the encoder 200a shown, Figure 3a The structure of the encoder 200b shown is different in that a plurality of adjustment parameters are preset in the RME module 210b and the FME module 220b of the encoder 200b, respectively, and a plurality of cost functions may also be preset.

[0122] The M adjustment parameters λ preset in the RME module 210b rme1 To rmeM As well as the M cost functions and the corresponding index values, please refer to the following Table 1:

[0123] M cost functions Index value <![CDATA[J rme1 =D rme1 +λ rme1 R rme1 ]]> * <![CDATA[J rme2 =D rme2 +λ rme2 R rme2 ]]> * …… …… <![CDATA[J rmeM =D rmeM +λ rmeM R rmeM ]]> *

[0124] Table 1

[0125] Among them, the various cost functions shown in Table 1 can be adjusted according to the parameter λ rme1 …λ rme2 To rmeM Sort from small to large or from large to small, corresponding index value a1 * to a M * It can represent the sequence position of each adjustment parameter. It can be understood that when the number of adjustment parameters is the same as the number of cost functions, the index value can also represent the sequence position of the adjustment parameter. It can be understood that D in Table 1 above rme1 To D rmeM can be the same or different. Similarly, R rme1 To R rmeM They can also be the same or different.

[0126] Referring to the cost function formula (3) in the above FME module 220a, the N λ preset in the FME module 220b fme1 To fmeN As well as the N cost functions and the index values ​​of the adjustment parameters, please refer to the following Table 2:

[0127] N cost functions Index value <![CDATA[J fme1 =D fme1 +λ fme1 R fme1 ]]> <![CDATA[b1 * ]]> <![CDATA[J fme2 =D fme2 +λ fme2 R fme2 ]]> <![CDATA[b2 * ]]> …… …… <![CDATA[J fmeN =D fmeN +λ fmeN R fmeN ]]> <![CDATA[b N * ]]>

[0128] Table 2

[0129] Among them, the various cost functions shown in Table 2 can also be adjusted according to the parameter λ fme1 …λ fme2 To fmeN Sort from small to large or from large to small, and the corresponding index value is b1 * To b N * It can represent the sequence position of each adjustment parameter. It can be understood that D in the above Table 2 fme1 To D fmeN can be the same or different, R fme1 To R fmeN They can also be the same or different.

[0130] In order to facilitate the description of the differences between the cost functions used in the search structures at each level, the multiple cost functions preset in the RME module 210b can also be described as the first type of cost functions; the multiple cost functions preset in the FME module 220b can be described as the second type of cost functions; and the decision function preset in the RDO module 230b for determining the best matching block can be described as the third type of cost function.

[0131] When the FME module 220b sends the searched multiple matching blocks to the RDO module 230b, the index values ​​of the adjustment parameters of the second type of cost function corresponding to the multiple matching blocks can also be passed to the RDO module 230b, and the RDO module 230b can determine the index value of the adjustment parameter of the second type of cost function corresponding to the best matching block, and further determine the corresponding relationship between the adjustment parameters of the second type of cost function and the adjustment parameters of the first type of cost function. That is, the index value a1 in Table 1 above can be established in the RDO module 230b. * to a M * , and the index value b1 in Table 2 * To b N * For example, when M=N, the index values ​​in Table 1 and the index values ​​in Table 2 may correspond one to one. For example, when M<N, the index values ​​in Table 1 and the index values ​​in Table 2 may include a partial one-to-many and a partial one-to-one correspondence, such as a1 * Can correspond to b1 * and b2 * 、a2 * Can correspond to b3 * Etc. No restrictions are imposed here. At this time, refer to Figure 3d , the RDO module 230b may set the index value of the adjustment parameter of the second type cost function corresponding to the best matching block (ie, the adjustment parameter λ fme The index value of the parameter λ is first sent to the FME module 220b, and the FME module 220b can adjust the parameter λ fme With the adjustment parameter λ rme The corresponding relationship between them determines the adjustment parameter λ rme The index value is then sent to the RME module 210b, and the RME module 210b can use the adjustment parameter λ corresponding to the above index value rme The search for the next image block is performed.

[0132] Refer to Table 1 and Table 2 above, and Figure 3a or Figure 3d As shown in the structure of the encoder 200b, when the encoder 200b is used to encode each image block of the current frame, for example, when the first image block (ie, the current block) is encoded, the adjustment parameters of the first type of cost function are used in the RME module 210b, such as the index value a1 * The corresponding adjustment parameters are used to calculate the cost values ​​corresponding to the searched reference blocks, and the reference block with the smallest cost value is determined as the rough matching block. Figure 4 R4 shown.

[0133] Next, the FME module 220b in the encoder 200b respectively uses the preset second type cost function, such as the index value b1 * To b N * Correspondingly, the second type cost function with N adjustment parameters is used to search for a reference block starting from the rough matching block determined by the RME module 210b, wherein the reference blocks obtained by the second type cost function can all be used as candidate accurate matching blocks. For example, if N=3, then the reference blocks Figure 4 F3, F4, F5 shown.

[0134] Then, the FME module 220b inputs multiple candidate exact matching blocks determined based on the preset second type cost function into the RDO module 230b, and the RDO module 230b can calculate the cost value corresponding to each candidate exact matching block based on the preset third type cost function, and determine the exact matching block with the smallest cost value as the optimal solution output, that is, determine the best matching block that can be used to predict the current block to be encoded so as to encode the current block. The third type cost function used by the RDO module 230b, for example, can refer to the above cost function formula (3).

[0135] refer to Figure 4 As shown, for example, the best matching block determined by the RDO module 230b from the candidate exact matching blocks F3, F4, and F5 is F4, then the RDO module 230b can determine F4 as the index value of the adjustment parameter of the second type cost function of the exact matching block based on the FME module 220b, for example, b4 * , find the RME module 210b with the index value b4 * The index value of the adjustment parameter of the corresponding first-class cost function, for example, a4 * Then, the RDO module 230b can use the index value a4 * The RME module 210b is passed to the RME module 210b, so that the RME module 210b chooses to use the abbreviation value a4 * Thus, when searching for a reference block for the next image block (ie, the next continuous image block of the current block), the RME module 210b can use the updated index value a4 * The first type of cost function with adjustment parameters is used to search for image patches.

[0136] It can be understood that the updated usage index value a4 in the RME module 210b * The first type of cost function corresponding to the adjustment parameters is more suitable for the encoding process of the current frame image, that is, based on the updated use index value a4 *The first type of cost function corresponding to the adjustment parameter calculates the cost value to determine the rough matching block, and the accuracy is relative to the initial index value a1 * The accuracy of the first type of cost function with corresponding adjustment parameters will be higher. As a result, the accuracy of the search results of the subsequent FME module 220b will also be improved. In addition, in each round of image block matching, the FME module 220b can calculate multiple candidate exact matching blocks based on the preset second type of cost function, and the RDO module 230b can determine the best matching block from them, which can also improve the accuracy of the search results of the FME module 220b.

[0137] Based on the above Figure 3a The structure of the encoder 200b is shown, and the specific implementation process of the inter-frame prediction encoding method provided in the embodiment of the present application is described below in conjunction with the flow chart.

[0138] Figure 5 According to the embodiment of the present application, a schematic diagram of an implementation flow of an inter-frame prediction coding method is shown. It can be understood that Figure 5 The execution entities of each step of the process shown can be Figure 3a The encoder 200b shown will not repeat the execution subject of each step in the description of each step below.

[0139] like Figure 5 As shown, the process includes the following steps:

[0140] 501: Obtain the current frame image data to be encoded and determine the current block to be encoded.

[0141] Exemplarily, when encoding the current frame image to be encoded, the encoder 200b may obtain the current frame image data. The image data may be, for example, pixel value data of each pixel point on the current frame image. In the embodiment of the present application, the encoder 200b may perform the encoding process in units of image blocks, wherein each image block may include, for example, 16×16 pixels, or 32×32 pixels, which is not limited here.

[0142] The encoder 200b may determine the pixel value data of each pixel point included in the current block to be encoded based on the acquired current frame image data.

[0143] 502: Based on the image data of the reference frame, as well as the preset starting block of the first-level search structure, the step size of the first-level search structure, and the cost function adopted by the first-level search structure in this round of search, a rough search is performed to determine a rough matching block.

[0144] Exemplarily, the image data of the reference frame may be, for example, the image data of the previous frame continuous with the current frame, or the image data of the reference frame based on which the previous frame image continuous with the current frame is encoded, etc., and no limitation is made here. The RME module 210b in the encoder 200b may search according to the starting block and step size of the preset first-level search structure, and calculate the cost value corresponding to the current block to be encoded based on each reference block in the encoded reference frame based on the cost function adopted by the first-level search structure in this round of search. The adjustment parameter corresponding to the cost function of the RME module 210b here may be one of the N adjustment parameters pre-set by the RME module 210b. The RME module 210b may use the reference block with the smallest cost value as the roughly matched block obtained by the search, and input it into the FME module 220b of the next-level search structure (second-level search structure) as the starting position of the FME module 220b. The algorithm implementation process of predicting the image data of the current frame by using the image data of the previous frame as the forward reference may refer to the forward algorithm in the hidden Markov model, for example, and will not be described in detail here.

[0145] Optionally, in other embodiments, the image data used as the reference frame may be, for example, image data of a subsequent frame that is continuous with the current frame, or image data of a reference frame based on which the subsequent frame image is predicted, etc., which is not limited here. The algorithm implementation process of using the image data of the previous frame as a forward reference to predict the image data of the current frame may refer to, for example, the backward algorithm in the hidden Markov model, which is not described in detail here.

[0146] As described above, multiple adjustment parameters of the first-class cost function can be preset in the RME module 210b in the encoder 200b. It can be understood that the number of the first-class cost functions here can be the same as or less than the number of adjustment parameters. The cost function adopted by the first-level search structure in this round of search process can be one of the multiple first-class cost functions preset in the RME module 210b.

[0147] It can be understood that when encoding the first image block of the current frame, the first-level search structure used can adopt the adjustment parameters of the initially preset first-type cost function; and when encoding the second image block of the current frame and other subsequent image blocks, the first-type cost function with the adjustment parameters updated based on the index value fed back in the previous round of image block encoding can be used. For details, please refer to the relevant description in the following step 507, which will not be repeated here.

[0148] 503: Based on the rough matching block obtained by the rough search, the step size of the second-level search structure, and the preset second-type cost function, a precise search is performed to obtain N candidate precise matching blocks.

[0149] Exemplarily, the RME module 210b of the encoder 200b inputs the rough matching block into the FME module 220b as the starting position of the second-level search structure of the FME module 220b. Furthermore, the FME module 220b can perform the second-level search according to the preset step size of the second-level search structure. During the second-level search process, the FME module 220b can calculate the corresponding cost value of each reference block obtained by the search through a preset second-type cost function using N adjustment parameters. The FME module 220b determines the reference block calculated by the second-type cost function as an alternative precise reference block. Therefore, based on the preset second-type cost function using N adjustment parameters, the FME module 220b can determine N precise matching blocks from each reference block searched.

[0150] It can be understood that the index values ​​between the N adjustment parameters of the FME module 220 b and the N adjustment parameters preset by the RME module 210 b in step 502 may correspond one to one.

[0151] The FME module 220b in the encoder 200b continues to input the N exact matching blocks obtained by the search into the RDO module 230b for decision making, which is the process performed in the following step 504.

[0152] 504: For the N exact matching blocks obtained by the exact search, a preset third-category cost function is used to calculate the corresponding cost values, and the exact matching block with the smallest cost value is determined as the best matching block of the current block.

[0153] Exemplarily, the third type of cost function here can also be called a decision function, and the RDO module 230b in the encoder 200b can calculate the cost value corresponding to each of the N exact matching blocks searched by the FME module 220b. The RDO module 230b makes a decision based on the calculated cost values ​​corresponding to each of the exact matching blocks, and determines the exact matching block with the smallest cost value as the best matching block of the current block.

[0154] 505: Calculate a motion vector based on the determined best matching block to perform motion compensation on the current block, calculate a residual value between the current block and the best matching block, and then encode the motion vector and the residual value into a bitstream to complete encoding of the current block.

[0155] Exemplarily, the encoder 200b calculates and estimates the motion vector between the image block corresponding to the position of the current block in the reference frame and the best matching block according to the best matching block determined by the RDO module 230b, and then performs motion compensation on the current block to be encoded based on the motion vector. Then, the encoder 200b can calculate the residual value between the current block and the best matching block, and encode the estimated motion vector and the calculated residual value into the bitstream to complete the encoding process of the current block.

[0156] 506: Determine the adjustment parameter used by the first type of cost function according to the index value of the adjustment parameter of the second type of cost function corresponding to the selected best matching block.

[0157] Exemplarily, the RDO module 230b in the encoder 200b can determine the index value of the adjustment parameter of the second type of cost function used in the FME module 220b to calculate the cost value corresponding to the best matching block based on the determined best matching block, and then the RDO module 230b can determine the index value of the adjustment parameter of the corresponding first type of cost function based on the correspondence between the index value of the adjustment parameter of the first type of cost function and the index value of the adjustment parameter of the second type of cost function, and feed it back to the RME module 210b.

[0158] It can be understood that the RDO module 230b can directly return the index value of the determined adjustment parameter of the first type of cost function to the RME module 210b, or can feed back the index value of the determined adjustment parameter of the first type of cost function to the RME module 210b through the FME module 220b, or can also notify the FME module 220b when feeding back the index value of the determined adjustment parameter of the first type of cost function to the RME module 210b, etc., and there is no limitation here.

[0159] 507: Adjust the adjustment parameters of the first type of cost function. After executing step 507, the encoder 200b may continue to execute the above step 502 to perform the encoding process of the next image block of the current frame.

[0160] Exemplarily, after the RDO module 230b in the encoder 200b feeds back the determined index value of the adjustment parameter of the first type of cost function to the RME module 210b, the RME module 210b can use the adjustment parameter of the first type of cost function corresponding to the index value as the adjustment parameter of the cost function adopted by the first-level search structure in the next image block encoding process to calculate the cost value corresponding to each reference block obtained by the first-level search structure. It can be understood that the process of the RME module 210b updating the adjustment parameter of the cost function adopted in the first-level search process based on the index value of the adjustment parameter of the first type of cost function fed back by the RDO module 230b realizes a one-time optimization of the search accuracy of the RME module 210b, so that the RME module 210b can better adapt to the image data characteristics and corresponding complexity of the current frame, and can further obtain more accurate search results in the subsequent search process of each image block.

[0161] It can be understood that this accuracy optimization effect can be continuously superimposed in the subsequent encoding process of each image block and each frame of the image, etc., which can ultimately improve the restoration degree of each frame of the encoded video after decoding, and reduce and improve the video distortion.

[0162] It can be understood that in some embodiments, the hierarchical search process adopted by the inter-frame prediction coding method provided in the embodiments of the present application can be applied to inter-frame prediction coding in pixels. The search process of FME relative to RME can be reduced from a process of searching with a step size of multiple pixels to a process of searching with a step size of a single integer pixel, or can be reduced from a process of searching with a step size of a single integer pixel to a process of searching with a step size of 1 / 2 pixel or smaller.

[0163] In other embodiments, the hierarchical search process used in the inter-frame prediction coding method provided in the embodiments of the present application can also be applied to inter-frame prediction coding in units of image blocks. Among them, the search process of FME relative to RME can be reduced from a process of searching with a step size of multiple image blocks to a step size of one image block, or can be reduced from a step size of one image block to a step size of 1 / 2 image block or smaller.

[0164] In other embodiments, the hierarchical search process adopted by the inter-frame prediction coding method provided in the embodiments of the present application can also be applied to the inter-frame prediction coding process in units of images. Among them, the search process of FME relative to RME can be reduced from a process of searching with multiple frames of images as the step size to a process of searching with a single frame of images as the step size. Or in the inter-frame prediction coding process in units of image groups, the search process of FME relative to RME can be reduced from a process of searching with multiple groups of images as the step size to a process of searching with a group of images as the step size, or it can be a process of searching with a group of image blocks as the step size to a process of searching with multiple frames or a single frame or a smaller step size. There is no limitation here.

[0165] Figure 6 According to an embodiment of the present application, a schematic block diagram of the structure of a computer 600 applicable to an inter-frame prediction encoding method is shown.

[0166] like Figure 6 As shown, the computer 600 may include a processor 610, a wireless communication module 620, a mobile communication module 630, a power module 640, an audio module 650, an interface module 660, a camera 670, a memory 680, a sensor module 690, a button 601, and a display screen 602, etc.

[0167] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the computer 600. In other embodiments of the present application, the computer 600 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0168] The processor 610 may include one or more processing units, for example, a processing module or processing circuit including a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), a microprocessor (MCU), an AI (Artificial Intelligence) processor, or a programmable logic device (FPGA) (Field Programmable Gate Array). Different processing units may be independent devices or integrated into one or more processors. A storage unit may be provided in the processor 610, for example, a memory 680 for storing instructions and data. In some embodiments, the storage unit in the processor 610 is a cache memory.

[0169] The wireless communication module 620 may include an antenna, and transmit and receive electromagnetic waves via the antenna. The wireless communication module 620 may provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc., applied to the computer 600. The computer 600 may communicate with the network and other devices through wireless communication technology.

[0170] The mobile communication module 630 may include, but is not limited to, an antenna, a power amplifier, a filter, a low noise amplifier (LNA), etc. The mobile communication module 630 may provide a solution for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the computer 600. The mobile communication module 630 may receive electromagnetic waves by an antenna, filter, amplify, and process the received electromagnetic waves, and transmit them to a modulation and demodulation processor for demodulation. The mobile communication module 630 may also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some of the functional modules of the mobile communication module 630 may be disposed in the processor 610. In some embodiments, at least some of the functional modules of the mobile communication module 630 may be disposed in the same device as at least some of the modules of the processor 610.

[0171] In some embodiments, the mobile communication module 630 and the wireless communication module 620 of the computer 600 may also be located in the same module.

[0172] The power module 640 may include a power source, a power management component, etc. The power source may be a battery. The power management component is used to manage the charging of the power source and the supply of power to other modules.

[0173] The audio module 650 is used to convert digital audio information into a predicted audio signal output, or convert predicted audio input into a digital audio signal. The audio module 650 can also be used to encode and decode audio signals.

[0174] The interface module 660 includes an external memory interface, a universal serial bus (USB) interface, a subscriber identification module (SIM) card interface, and the like.

[0175] The camera 670 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP (Image Signal Processing) to convert it into a digital image signal. The computer 600 can realize the shooting function through the ISP, the camera 670, the video codec, the GPU (Graphic Processing Unit), the display screen 602 and the application processor.

[0176] The sensor module 690 may include a proximity light sensor, a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0177] The display screen 602 is used to display a human-computer interaction interface, images, videos, etc. The display screen 602 includes a display panel.

[0178] In some embodiments, the computer 600 further includes a button 601, a motor, and an indicator. The button 601 may include a volume button, an on / off button, etc. The motor is used to make the computer 600 vibrate, for example, vibrate when the user's computer 600 is called, so as to prompt the user to answer the call of the computer 600. The indicator may include a laser indicator, a radio frequency indicator, an LED indicator, etc.

[0179] Figure 7 According to an embodiment of the present application, a structural schematic block diagram of a video encoding system 700 is shown.

[0180] like Figure 7 As shown, the system 700 may include one or more processors 704, a system control logic 708 connected to at least one of the processors 704, a system memory 712 connected to the system control logic 708, a non-volatile memory (NVM) 716 connected to the system control logic 708, and a network interface 720 connected to the system control logic 708.

[0181] In some embodiments, the processor 704 may include one or more single-core or multi-core processors. In some embodiments, the processor 704 may include any combination of a general-purpose processor and a dedicated processor (e.g., a graphics processor, an application processor, a baseband processor, etc.). The processor 704 may be configured to execute various embodiments, for example, the embodiments described with reference to the above-mentioned Figures 2-5.

[0182] In some embodiments, system control logic 708 may include any suitable interface controller to provide any suitable interface to at least one of processors 704 and / or any suitable device or component in communication with system control logic 708 .

[0183] In some embodiments, the system control logic 708 may include one or more memory controllers to provide an interface to a system memory 712. The system memory 712 may be used to load and store data and / or instructions. In some embodiments, the memory 712 of the system 700 may include any suitable volatile memory, such as a suitable dynamic random access memory (DRAM).

[0184] NVM / memory 716 may include one or more tangible, non-transitory computer storage media for storing data and / or instructions. In some embodiments, NVM / memory 716 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as at least one of a HDD (Hard Disk Drive), a CD (Compact Disc) drive, and a DVD (Digital Versatile Disc) drive. NVM / memory 716 may include a portion of storage resources on the device on which system 700 is installed, or it may be accessed by the device but is not necessarily a part of the device. For example, NVM / storage 716 may be accessed over a network via network interface 720.

[0185] In particular, system memory 77 and NVM / storage 716 may include, respectively, a temporary copy and a permanent copy of instructions 724. Instructions 724 may include instructions that, when executed by at least one of processors 704, cause system 700 to implement the above Figure 3a Instructions for the functionality of the illustrated encoder architecture. In some embodiments, instructions 724, hardware, firmware, and / or software components thereof may additionally / alternatively be placed in system control logic 708, network interface 720, and / or processor 704.

[0186] The network interface 720 may include a transceiver for providing a radio interface for the system 700 to communicate with any other suitable devices (such as a front-end module, an antenna, etc.) through one or more networks. In some embodiments, the network interface 720 may be integrated with other components of the system 700. For example, the network interface 720 may be integrated with at least one of the processor 704, the system memory 712, the NVM / storage 716, and a firmware device (not shown) having instructions. When at least one of the processors 704 executes the instructions, the system 700 implements the following. Figure 5 Functions shown.

[0187] The network interface 720 may further include any suitable hardware and / or firmware to provide a multiple-input multiple-output radio interface. For example, the network interface 720 may be a network adapter, a wireless network adapter, a telephone modem and / or a wireless modem.

[0188] In one embodiment, at least one of the processors 704 may be packaged together with logic for one or more controllers of the system control logic 708 to form a system in package (SiP). In one embodiment, at least one of the processors 704 may be integrated on the same die with logic for one or more controllers of the system control logic 708 to form a system on a chip (SoC).

[0189] The system 700 may further include an input / output (I / O) device 732. The I / O device 732 may include a user interface to enable a user to interact with the system 700; and a peripheral component interface design to enable peripheral components to interact with the system 700. In some embodiments, the system 700 further includes a sensor for determining at least one of an environmental condition and location information related to the system 700.

[0190] Figure 8 According to an embodiment of the present application, a structural schematic block diagram of a SoC (System on Chip) 800 is shown. Figure 8 In the FIG, similar components have the same reference numerals. In addition, the dashed boxes are optional features of more advanced SoCs. Figure 8 In the embodiment, SoC 800 includes: an interconnect unit 850, which is coupled to an application processor 810; a system agent unit 870; a bus controller unit 880; an integrated memory controller unit 840; a group or one or more coprocessors 820, which may include integrated graphics logic, image processors, audio processors, and video processors; a static random access memory (SRAM) unit 830; and a direct memory access (DMA) unit 860. In one embodiment, the coprocessor 820 includes a special-purpose processor, such as, for example, a network or communication processor, a compression engine, a GPGPU, a high-throughput MIC processor, or an embedded processor.

[0191] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware, software, firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device and at least one output device.

[0192] Program code can be applied to input instructions to perform each function described in the present application and generate output information. Output information can be applied to one or more output devices in a known manner. For the purpose of the present application, the processing system includes any system with a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application specific integrated circuit (ASIC) or a microprocessor. The program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. When necessary, the program code can also be implemented with assembly language or machine language. In fact, the mechanism described in the present application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.

[0193] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer storage media. Therefore, machine storage media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, floppy disks, optical disks, optical disks, read-only memories (CD-ROMs), magneto-optical disks, read-only memories (ROMs), random access memories (RAMs), erasable programmable read-only memories (EPROMs), electrically erasable programmable read-only memories (EEPROMs), magnetic or optical cards, flash memory, or a tangible machine-readable memory for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in electrical, optical, acoustic, or other forms of propagation signals. Therefore, machine storage media include any type of machine storage media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.

[0194] References to "one embodiment" or "an embodiment" in the specification mean that the specific features, structures, or characteristics described in conjunction with the embodiment are included in at least one exemplary implementation or technology disclosed according to the embodiment of the present application. The appearance of the phrase "in one embodiment" in various places in the specification does not necessarily all refer to the same embodiment.

[0195] In addition, the language used in this specification has been primarily selected for readability and instructional purposes and may not be selected to describe or limit the disclosed subject matter. Therefore, the present application embodiment disclosure is intended to illustrate rather than limit the scope of the concepts discussed herein.

Claims

1. A method for encoding an image, Features , the method comprises: Acquire an image to be encoded, and divide the image to be encoded into a plurality of blocks to be encoded; Determining target blocks that match the blocks to be encoded in the image to be encoded from the reference image; Determine the motion displacement between the block to be encoded and the reference image based on the matched target block; encoding the image to be encoded according to the determined motion displacement; The step of determining, from the reference image, target blocks that match the blocks to be encoded in the image to be encoded, respectively, includes: A multi-level search strategy is adopted to search for a first target block matching a first block to be encoded among the multiple blocks to be encoded from the reference image, wherein each level of the search strategy is preset with multiple preset adjustment parameters, and in the process of searching for the first target block, a first level of the multi-level search strategy adopts: using a first preset adjustment parameter among the multiple preset adjustment parameters preset by the first level of the search strategy, Furthermore, in the process of searching for the first target block, the second level search strategy in the multi-level search strategy adopts: using a second preset adjustment parameter among a plurality of preset adjustment parameters preset by the second level search strategy; Adopting the multi-stage search strategy, searching the reference image for a second target block that matches a second block to be encoded among the plurality of blocks to be encoded, wherein the second block to be encoded is adjacent to the first block to be encoded, and In the process of searching for a matching second target block from the reference image for the second block to be encoded, the first-level search strategy adopts: a third preset adjustment parameter among a plurality of preset adjustment parameters preset by the first-level search strategy, and the third preset adjustment parameter corresponds to the second preset adjustment parameter; The plurality of preset adjustment parameters preset by the first-level search strategy are adjustment parameters in the plurality of cost functions corresponding to the first-level search strategy, and are used to adjust the ratio between the data compression cost amount consumed by the distortion and the data compression cost amount consumed by the motion vector; The multiple preset adjustment parameters preset by the second-level search strategy are adjustment parameters in the multiple cost functions corresponding to the second-level search strategy, which are used to adjust the ratio between the data compression cost amount consumed by distortion and the data compression cost amount consumed by motion vector.

2. The method according to claim 1, It is characterized in that The second-level search strategy in the multi-level search strategy is preset with multiple preset adjustment parameters, wherein the multiple preset adjustment parameters preset in the second-level search strategy correspond one-to-one to the multiple preset adjustment parameters preset in the first-level search strategy.

3. The method according to claim 2, It is characterized in that The step of determining target blocks that match the blocks to be encoded in the image to be encoded from the reference image also includes: In the process of searching for the first target block, the second level search strategy in the multi-level search strategy adopts: using a plurality of preset adjustment parameters preset by the second level search strategy to obtain a plurality of first reference blocks; The first target block is determined from multiple first reference blocks.

4. The method according to claim 3, It is characterized in that The step of determining the first target block from the plurality of first reference blocks comprises: Obtaining result values ​​corresponding to a plurality of the first reference blocks through a preset decision function; The first reference block corresponding to the result value that meets the preset judgment threshold is determined as the first target block, wherein the index value of the second preset adjustment parameter used when the second-level search strategy searches for the first target block corresponds to the third preset adjustment parameter among the multiple preset adjustment parameters of the first-level search strategy.

5. The method according to claim 4, It is characterized in that Also includes: Corresponding to the process of searching for a matching second target block from the reference image for the second block to be encoded, the index value of the second preset adjustment parameter used by the second-level search strategy when searching for the first target block is sent to the first-level search strategy.

6. The method according to claim 2, It is characterized in that Searching the reference image for a second target block that matches a second block to be encoded among the multiple blocks to be encoded includes: Using a plurality of preset adjustment parameters preset by the second-level search strategy, obtaining a plurality of second reference blocks; The second target block is determined from multiple second reference blocks, wherein the index value of the fourth preset adjustment parameter used when the second-level search strategy searches for the second target block corresponds to the fifth preset adjustment parameter among the multiple preset adjustment parameters of the first-level search strategy.

7. The method according to claim 6, It is characterized in that Also includes: searching the reference image for a third target block that matches a third block to be encoded among the plurality of blocks to be encoded, wherein the third block to be encoded is adjacent to the second block to be encoded, and In the process of searching the reference image for the third target block that matches the third block to be encoded, the first-level search strategy adopts the fifth preset adjustment parameter.

8. The method according to claim 4, It is characterized in that The preset decision function is a cost function, and the result value is an output value of the cost function.

9. The method according to claim 8, It is characterized in that Meeting a preset decision threshold includes: a result value corresponding to the first target block is a minimum value among result values ​​corresponding to multiple first reference blocks.

10. An image coding system, Features , the system comprises: An acquisition module, the acquisition module is used to acquire an image to be encoded and divide the image to be encoded into a plurality of blocks to be encoded; A search module, the search module is used to determine target blocks that match the blocks to be encoded in the image to be encoded from the reference image; A calculation module, the calculation module is used to determine the motion displacement between the block to be encoded and the reference image based on the matched target block; An encoding module, the encoding module being used to encode the image to be encoded according to the determined motion displacement; The step of determining, from the reference image, target blocks that match the blocks to be encoded in the image to be encoded, respectively, includes: A multi-level search strategy is adopted to search for a first target block matching a first block to be encoded among the multiple blocks to be encoded from the reference image, wherein each level of the search strategy is preset with multiple preset adjustment parameters, and in the process of searching for the first target block, a first level of the multi-level search strategy adopts: using a first preset adjustment parameter among the multiple preset adjustment parameters preset by the first level of the search strategy, Furthermore, in the process of searching for the first target block, the second level search strategy in the multi-level search strategy adopts: using a second preset adjustment parameter among a plurality of preset adjustment parameters preset by the second level search strategy; Adopting the multi-stage search strategy, searching the reference image for a second target block that matches a second block to be encoded among the plurality of blocks to be encoded, wherein the second block to be encoded is adjacent to the first block to be encoded, and In the process of searching for a matching second target block from the reference image for the second block to be encoded, the first-level search strategy adopts: a third preset adjustment parameter among a plurality of preset adjustment parameters preset by the first-level search strategy, and the third preset adjustment parameter corresponds to the second preset adjustment parameter; The plurality of preset adjustment parameters preset by the first-level search strategy are adjustment parameters in the plurality of cost functions corresponding to the first-level search strategy, and are used to adjust the ratio between the data compression cost amount consumed by the distortion and the data compression cost amount consumed by the motion vector; The multiple preset adjustment parameters preset by the second-level search strategy are adjustment parameters in the multiple cost functions corresponding to the second-level search strategy, which are used to adjust the ratio between the data compression cost amount consumed by distortion and the data compression cost amount consumed by motion vector.

11. An electronic device, It is characterized in that include: A memory for storing instructions executed by one or more processors of an electronic device, and a processor, which is one of the processors of the electronic device, for executing the image encoding method according to any one of claims 1 to 9.

12. A readable medium, It is characterized in that The readable medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the image encoding method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Motion vector derivation device, moving image decoding device, and moving image encoding device

    CN111886867A

  • Non-uniform multilayer hexaploid lattice full pixel kinematic search method

    CN1440200A

  • Method and apparatus for adaptive multiple-dimentional signal sequences encoding / decoding

    CN1809839A

  • Adaptive picture section encoding mode decision control

    US20160088299A1

  • Method and system for block matching based motion estimation

    US20160219297A1