An inter-frame prediction method, apparatus, system, device, and storage medium
By obtaining and updating the MVP index value and initial MVD of the PU block on the encoding side, the problem of low encoding performance on the encoding side is solved, and the number of information is reduced and the encoding performance is improved.
Patent Information
- Application Number
- CN202211180688.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-27
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-09-27
AI Technical Summary
In the existing inter prediction method, the encoding end needs to encode and transmit the motion vector difference (MVD) and the predicted motion vector index value (MVP index value), resulting in lower encoding performance.
The encoding end obtains the MVP index value and the initial MVD of the PU block, determines whether the corresponding relationship is satisfied, and if it is not satisfied, updates the initial MVD until the corresponding relationship is satisfied, and determines the target MVD and encodes the target MVD. The decoding end performs decoding processing to obtain the corresponding MVP index value.
Reduce the amount of encoding and transmission of information, and improve the overall encoding performance of the encoding end.
Smart Images

Figure CN115643412B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and in particular to an inter-frame prediction method, apparatus, system, device, and storage medium. Background Art
[0002] Inter-frame prediction uses the correlation between video frames to determine the motion vector (MV) of the prediction unit (PU) block based on the encoded reference image block. The motion of the PU block is then determined based on the MV. This can reduce the process of encoding the motion information of each PU block in the video image one by one, thus removing video redundancy and achieving the purpose of image compression.
[0003] Currently, in advanced motion vector prediction (AMVP), the encoder needs to determine and encode the motion vector difference (MVD) and motion vector prediction (MVP) index of the PU block, and then transmit the MVD and MVP index values to the decoder via the bitstream. The decoder can determine the MVP based on the MVP index value transmitted in the bitstream and then use the quantitative relationship between the MVD, MVP, and MV to determine the MV of the PU block.
[0004] However, in the general inter-frame prediction method, the encoder needs to encode and transmit the MVD and MVP index values, which results in low overall encoding performance at the encoder and is not conducive to the continued development of inter-frame prediction technology. Summary of the Invention
[0005] The present disclosure provides an inter-frame prediction method, apparatus, system, device, and storage medium for solving the problem of low overall encoding performance at the encoding end.
[0006] The technical solutions of the embodiments of the present disclosure are as follows:
[0007] According to a first aspect of an embodiment of the present disclosure, an inter-frame prediction method is provided, which is applied to an encoding end; the inter-frame prediction method includes: obtaining a predicted motion vector MVP index value and an initial motion vector difference MVD of a prediction unit PU block; when the MVP index value and the initial MVD satisfy a corresponding relationship, determining the initial MVD as a target MVD; when the MVP index value and the initial MVD do not satisfy a corresponding relationship, updating the initial MVD until the updated initial MVD satisfies a corresponding relationship with the MVP index value, and determining the updated initial MVD as a target MVD; encoding the target MVD to obtain an encoded target MVD, and sending the encoded target MVD to a decoding end, so that the decoding end decodes the encoded target MVD to obtain the target MVD, and obtains an MVP index value that satisfies a corresponding relationship with the target MVD, and determines a target motion vector MV of the PU block according to the MVP index value and the target MVD; determining a prediction result of inter-frame motion of the PU block based on the target MV.
[0008] Optionally, the inter-frame prediction method also includes: determining that the sum of the absolute value of the first component and the absolute value of the second component is a first absolute value sum; the first component is the component of the initial MVD in the first direction; the second component is the component of the initial MVD in the second direction; the first direction is perpendicular to the second direction; when the modulus obtained by performing a modulus operation on the first absolute value sum and a preset value is the same as the MVP index value, determining that the MVP index value and the initial MVD satisfy a corresponding relationship; when the modulus is different from the MVP index value, determining that the MVP index value and the initial MVD do not satisfy a corresponding relationship.
[0009] Optionally, the method for updating the initial MVD includes: adjusting the initial motion vector MV corresponding to the initial MVD in at least one direction by a target value to obtain at least one candidate MV corresponding one-to-one to the at least one direction; the target value is less than a preset value; the at least one direction includes: at least one of the first direction, the opposite direction of the first direction, the second direction and the opposite direction of the second direction; when the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, and the MVD corresponding to the target candidate MV satisfies the corresponding relationship with the MVP index value, the initial MVD is updated to the MVD corresponding to the target candidate MV; the target candidate MV is any one of the at least one candidate MVs.
[0010] Optionally, the method for obtaining the MVP index value and initial MVD of the PU block includes: performing MV prediction on the inter-frame motion of the PU block to determine the MVP, MVP index value and initial MV; and determining the difference between the initial MV and the MVP as the initial MVD.
[0011] Optionally, the method for determining the MVP includes: determining at least one reference MV corresponding to the PU block based on a preset inter-frame prediction mode; when the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is less than the target disparity, determining the target reference MV as the MVP; the target disparity is the disparity between the predicted image of the PU block corresponding to other reference MVs in at least one reference MV and the original image of the PU block.
[0012] Optionally, a method for determining at least one reference MV corresponding to a PU block based on a preset inter-frame prediction mode includes: determining multiple MVs in a reference domain as initial MV references, and merging the same MVs in the multiple MVs; the reference domain includes: at least one domain in the spatial domain and the time domain; when the number of merged MVs is less than the preset number of at least one reference MV, the preset number is filled with the preset MV, and the preset MV and the merged MV are determined as at least one reference MV; when the number of merged MVs is greater than the preset number, the MV corresponding to the preset number after sorting the merged MVs according to the preset sorting rules is determined as at least one reference MV.
[0013] Optionally, determining the initial MV includes: determining a reference block having an image similarity with the PU block greater than a preset similarity; and determining the MV of the reference block as the initial MV.
[0014] According to the second aspect of the embodiment of the present disclosure, an inter-frame prediction method is provided, which is applied to the decoding end; the inter-frame prediction method includes: decoding the received encoded target MVD to obtain the target MVD; the target MVD is determined by the encoding end based on the MVP index value and the initial MVD of the PU block; the target MVD and the MVP index value satisfy a corresponding relationship; the MVP index value that satisfies the corresponding relationship with the target MVD is determined; based on the target MVD and the MVP index value, the target MV of the PU block is determined; and the prediction result of the inter-frame motion of the PU block is determined based on the target MVD.
[0015] Optionally, a method for determining an MVP index value that satisfies a corresponding relationship with a target MVD includes: determining the sum of the absolute value of the third component and the absolute value of the fourth component as the second absolute value sum; the third component is the component of the target MVD in the first direction; the fourth component is the component of the target MVD in the second direction; the first direction is perpendicular to the second direction; and determining the modulus obtained by performing a modulus operation on the second absolute value sum and a preset value as the MVP index value.
[0016] Optionally, the method for determining the target MV of the PU block according to the target MVD and the MVP index value includes: determining the MVP corresponding to the MVP index value; and determining the sum of the MVP and the target MVD as the target MV.
[0017] According to a third aspect of an embodiment of the present disclosure, an inter-frame prediction device is provided, which is applied to an encoding end; the inter-frame prediction device includes: a processing unit and an encoding unit; the processing unit is configured to execute acquisition of an MVP index value and an initial MVD of a PU block; the processing unit is further configured to execute, when the MVP index value and the initial MVD satisfy a corresponding relationship, determining the initial MVD as a target MVD; the processing unit is further configured to execute, when the MVP index value and the initial MVD do not satisfy a corresponding relationship, updating the initial MVD until the updated initial MVD satisfies a corresponding relationship with the MVP index value, and determining the updated initial MVD as the target MVD; the encoding unit is configured to execute encoding processing on the target MVD obtained by the processing unit to obtain an encoded target MVD, and send the encoded target MVD to a decoding end, so that the decoding end decodes the encoded target MVD to obtain the target MVD, and obtains an MVP index value that satisfies a corresponding relationship with the target MVD, and determines a target motion vector MV of the PU block according to the MVP index value and the target MVD; and determines a prediction result of inter-frame motion of the PU block based on the target MVD.
[0018] Optionally, the processing unit is further configured to determine that the sum of the absolute value of the first component and the absolute value of the second component is a first absolute value sum; the first component is the component of the initial MVD in the first direction; the second component is the component of the initial MVD in the second direction; the first direction is perpendicular to the second direction; when the modulus obtained by performing a modulus operation on the first absolute value sum and a preset value is the same as the MVP index value, it is determined that the MVP index value and the initial MVD satisfy the corresponding relationship; when the modulus is different from the MVP index value, it is determined that the MVP index value and the initial MVD do not satisfy the corresponding relationship.
[0019] Optionally, the processing unit is specifically configured to adjust the initial motion vector MV corresponding to the initial MVD to a target value in at least one direction to obtain at least one candidate MV corresponding one-to-one to at least one direction; the target value is less than a preset value; the at least one direction includes: at least one of the first direction, the opposite direction of the first direction, the second direction and the opposite direction of the second direction; when the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, and the MVD corresponding to the target candidate MV satisfies the corresponding relationship with the MVP index value, the initial MVD is updated to the MVD corresponding to the target candidate MV; the target candidate MV is any one of the at least one candidate MVs.
[0020] Optionally, the processing unit is specifically configured to perform MV prediction on the inter-frame motion of the PU block, determine the MVP, the MVP index value and the initial MV; and determine the difference between the initial MV and the MVP as the initial MVD.
[0021] Optionally, the processing unit is specifically configured to execute based on a preset inter-frame prediction mode to determine at least one reference MV corresponding to the PU block; when the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is less than the target disparity, the target reference MV is determined as the MVP; the target disparity is the disparity between the predicted image of the PU block corresponding to other reference MVs in at least one reference MV and the original image of the PU block.
[0022] Optionally, the processing unit is specifically configured to determine multiple MVs in the reference domain as initial MV references, and merge the same MVs in the multiple MVs; the reference domain includes: at least one domain in the spatial domain and the time domain; when the number of merged MVs is less than the preset number of at least one reference MV, the preset MV is used to fill the preset number, and the preset MV and the merged MV are determined as at least one reference MV; when the number of merged MVs is greater than the preset number, the MV corresponding to the preset number after the merged MV is sorted according to the preset sorting rules is determined as at least one reference MV.
[0023] Optionally, the processing unit is specifically configured to determine a reference block having an image similarity with the PU block greater than a preset similarity; and determine the MV of the reference block as the initial MV.
[0024] According to the fourth aspect of the embodiments of the present disclosure, an inter-frame prediction device is provided, which is applied to a decoding end; the inter-frame prediction device includes: a decoding unit and a processing unit; the decoding unit is configured to perform decoding processing on the received encoded target MVD to obtain a target MVD; the target MVD is determined by the encoding end according to the MVP index value and the initial MVD of the PU block; the target MVD and the MVP index value satisfy a corresponding relationship; the processing unit is configured to execute determination of an MVP index value that satisfies a corresponding relationship with the target MVD obtained by the decoding unit; the processing unit is further configured to determine the target MV of the PU block according to the target MVD and the MVP index value; and determine the prediction result of the inter-frame motion of the PU block based on the target MVD.
[0025] Optionally, the processing unit is specifically configured to determine the sum of the absolute value of the third component and the absolute value of the fourth component as the second absolute value sum; the third component is the component of the target MVD in the first direction; the fourth component is the component of the target MVD in the second direction; the first direction is perpendicular to the second direction; and the modulus obtained by performing a modulus operation on the second absolute value sum and a preset value is determined as the MVP index value.
[0026] Optionally, the processing unit is specifically configured to determine an MVP corresponding to the MVP index value; and determine a sum of the MVP and the target MVD as the target MV.
[0027] According to the fifth aspect of the embodiment of the present disclosure, an inter-frame prediction system is provided, including: an encoding end and a decoding end; the encoding end is used to execute any one of the optional inter-frame prediction methods in the above-mentioned first aspect; the decoding end is used to execute any one of the optional inter-frame prediction methods in the above-mentioned second aspect.
[0028] According to the sixth aspect of an embodiment of the present disclosure, an inter-frame prediction device is provided, which may include: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute instructions to implement any one of the above-mentioned first aspects, or any one of the optional inter-frame prediction methods in the second aspect.
[0029] According to the seventh aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by the processor of the inter-frame prediction device, the inter-frame prediction device is enabled to perform any one of the above-mentioned first aspects, or any one of the optional inter-frame prediction methods in the second aspect.
[0030] According to an eighth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising instructions, which, when executed on a processor of an electronic device, enables the electronic device to execute any one of the above-mentioned first aspects, or any one of the optional inter-frame prediction methods of the second aspect.
[0031] The technical solution provided by the present disclosure brings at least the following beneficial effects:
[0032] Based on any of the above aspects, in the present disclosure, the encoding end can obtain the MVP index value and initial MVD of the PU block. When the MVP index value and the initial MVD satisfy the corresponding relationship, the encoding end can determine the initial MVD as the target MVD. When the MVP index value and the initial MVD do not satisfy the corresponding relationship, the encoding end can update the initial MVD, and when the updated initial MVD and the MVP index value satisfy the corresponding relationship, the encoding end can determine the updated initial MVD as the target MVD. Subsequently, the encoding end can encode the target MVD to obtain the encoded target MVD, and send the encoded target MVD to the decoding end. The decoding end can decode the encoded target MVD to obtain the target MVD and obtain the MVP index value that satisfies the corresponding relationship with the target MVD. Then, the decoding end can determine the target motion vector MV of the PU block based on the MVP index value and the target MVD, and determine the prediction result of the inter-frame motion of the PU block based on the target MV.
[0033] Because the target MVD and MVP index values in this disclosure correspond to each other, the decoder can determine the MVP index value corresponding to the target MVD based on this correspondence. Therefore, the encoder only needs to encode and transmit the target MVD. Compared to conventional techniques, where the encoder needs to encode both the MVD and the MVP index value, this disclosure effectively reduces the amount of information that needs to be encoded and transmitted, effectively improving the overall encoding performance of the encoder. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0035] Figure 1 A schematic diagram of a spatial reference block provided in an embodiment of the present disclosure;
[0036] Figure 2 A schematic diagram of a time domain reference block provided in an embodiment of the present disclosure;
[0037] Figure 3 A schematic diagram of establishing a candidate MV list provided in an embodiment of the present disclosure;
[0038] Figure 4 A schematic diagram of motion estimation provided by an embodiment of the present disclosure;
[0039] Figure 5 A schematic diagram of an inter-frame prediction system provided by an embodiment of the present disclosure;
[0040] Figure 6 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 1 ;
[0041] Figure 7 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 2 ;
[0042] Figure 8 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 3 ;
[0043] Figure 9 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 4 ;
[0044] Figure 10 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 5 ;
[0045] Figure 11The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 6 ;
[0046] Figure 12 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 7 ;
[0047] Figure 13 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 8 ;
[0048] Figure 14 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 9 ;
[0049] Figure 15 The following is a flow chart of an inter-frame prediction method provided by an embodiment of the present disclosure. Figure 10 ;
[0050] Figure 16 The structure of an inter-frame prediction device provided by the embodiment of the present disclosure is shown as follows Figure 1 ;
[0051] Figure 17 The structure of an inter-frame prediction device provided by the embodiment of the present disclosure is shown as follows Figure 2 ;
[0052] Figure 18 The structure of an inter-frame prediction device provided by the embodiment of the present disclosure is shown as follows Figure 3 . DETAILED DESCRIPTION
[0053] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0054] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0055] It will also be understood that the term “comprising” indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements and / or components.
[0056] The data involved in this disclosure may be data authorized by the user or fully authorized by all parties.
[0057] The prior art related to the present disclosure is explained below.
[0058] 1. Video Information and Compression Coding
[0059] As civilization evolved, people weren't content simply to record what they saw orally; instead, they sought to capture it in a more intuitive way. After years of development, video has become the most efficient way to record and reproduce information, capable of conveying vast amounts of information in a relatively short period of time, and the most intuitive way of presenting information.
[0060] Videos express information through the images in each frame, the audio they contain, the movement of the images, and the changes in scenes.
[0061] 1. Video information
[0062] The basic structure of a video is a series of continuous, interrelated images. A frame of an image consists of pixels tightly packed in a plane. A pixel represents a single colored point in the image. The color of a pixel is composed of different components of the three primary colors.
[0063] The reason why there is a lot of space that can be compressed in video information is that there is a lot of data redundancy in it. The main types are:
[0064] (1) Temporal redundancy: The content of two adjacent frames in a video is similar and there is a motion relationship between them.
[0065] (2) Spatial redundancy: There is similarity between adjacent pixels within a certain frame of the video.
[0066] (3) Coding redundancy: Different data in a video have different probabilities of appearing.
[0067] (4) Visual redundancy: The viewer’s visual system has different sensitivities to different parts of the video.
[0068] 2. Video compression encoding
[0069] Coding is the process of representing and transmitting information using a certain form of code stream according to certain rules. Common information that needs to be encoded includes: text, voice, video, and control information.
[0070] Since the amount of data represented by pixels of dynamic images is extremely large, the storage space and transmission bandwidth are completely unable to meet the needs of storage and transmission, and video encoding is required to achieve data compression.
[0071] 3. Basic technologies of video compression coding
[0072] In order to specifically deal with the various redundancies in video information, video compression coding uses a variety of technologies to improve the compression ratio of the video, among which the most common ones are predictive coding, transform coding and entropy coding.
[0073] (1) Predictive coding: This method transmits the difference between the predicted pixel and the actual pixel, and uses the strong correlation between adjacent pixels in time or space to process the temporal and spatial redundancy in the video. Predictive coding includes intra-frame prediction and inter-frame prediction.
[0074] In intra-frame prediction, the predicted value and the actual value are located in the same frame, which is used to eliminate spatial redundancy of the image. The characteristic of intra-frame prediction is that the compression rate is relatively low, but it can be decoded independently without relying on data from other frames. Usually, key frames in the video use intra-frame prediction.
[0075] Inter-frame prediction uses the actual value of the current frame and the predicted value of the reference frame to eliminate temporal redundancy in the image. Inter-frame prediction offers a higher compression rate than intra-frame prediction, but it cannot be decoded independently. The current frame must be reconstructed after obtaining the reference frame data.
[0076] (2) Transform coding is used to transform image information from the spatial domain to the frequency domain through transform coding, and calculate its transform coefficients for subsequent encoding.
[0077] (3) Entropy coding is a compression coding method that uses the statistical characteristics of the source.
[0078] 2. Inter prediction
[0079] Inter-frame prediction uses the correlation between video frames to determine the motion vector (MV) of the prediction unit (PU) block based on the encoded reference image block, and then determines the motion of the PU block based on the MV. This can reduce the process of encoding the motion information of each PU block in the video image one by one, and can achieve the purpose of removing video redundancy and achieving the purpose of image compression.
[0080] Inter-frame prediction can be divided into two processes: motion estimation and motion compensation. Motion estimation (ME) extracts motion information from the current image. It searches for the optimal prediction block for the current coding block among the coded blocks, minimizing the residual between the predicted block and the current block, and calculates the offset (MV) of the current block. Motion compensation (MC) uses the motion vector and inter-frame prediction method to obtain an estimated value for the current frame.
[0081] 3. MV Prediction Technology
[0082] The MVs of adjacent blocks in the spatial domain are highly correlated; they also have a certain degree of correlation in the temporal domain. The MVs of adjacent blocks in the spatial or temporal domain can be used to predict the MV of the current block, and only the prediction residual is encoded, significantly saving the number of MV encoding bits.
[0083] The High Efficiency Video Coding (HEVC) standard proposes the advanced motion vector prediction (AMVP) mode, which uses spatial and temporal MV prediction ideas. By establishing a list of candidate MVs, the one with the best performance is selected as the predicted motion vector (MVP) of the current PU.
[0084] 4. AMVP Model
[0085] The AMVP mode uses the correlation of motion vectors in the spatial and temporal domains to create a list of candidate MVs for the current PU. The encoder selects the optimal MVP from this list for differential encoding. The decoder, by creating the same list, only needs the motion vector difference (MVD) and the MVP's sequence number in the list (i.e., the predicted motion vector (MVP) index) to calculate the MV of the current PU. The AMVP candidate list is 2 in length.
[0086] 1. Create a list of candidate MVs
[0087] (1) Establishment of airspace list:
[0088] AMVP generates a candidate MV on the left and above of the current PU, such as Figure 1 As shown, Figure 1Figure 1 shows a schematic diagram of spatial reference blocks. The selection order on the left is A0-A1, and the selection order above is B0-B1-B2. For MV selection above, scaling is performed only when both PUs on the left are unavailable or both are in intra prediction mode. When the first available MV is detected on the left or above, it is directly used as the candidate MV for the current PU, and the remaining steps are terminated. A candidate MV is marked as available only if its corresponding reference image is the same as the current PU; otherwise, scaling is performed accordingly.
[0089] (2) Establishment of time domain list:
[0090] The motion information of the corresponding PU (co-located PU) in the adjacent coded image is used to calculate the current PU. Unlike the spatial domain, the temporal candidate list cannot directly use the motion information of the candidate blocks, but needs to be scaled accordingly based on the positional relationship of the reference image.
[0091] HEVC stipulates that only one candidate MV can be provided in the time domain, such as Figure 2 As shown, Figure 2 The candidate MV is obtained by scaling the MV of the co-located PU at position H. If the co-located PU at position H is unavailable, the co-located PU at position C3 is used as a replacement.
[0092] (3) Establishment of candidate MV list:
[0093] like Figure 3 As shown in the figure, after selecting two candidate MVs from the five MVs in the spatial domain list, the two identical candidate MVs are merged to obtain one or two spatial domain candidate MVs. One temporal domain candidate MV is selected from the two MVs in the temporal domain list. If the number of candidate MVs is greater than two, the first two are retained. The spatial domain candidate MV precedes the temporal domain candidate MV. If the number of candidate MVs is less than two, the candidate MVs are padded with (0,0) to obtain two candidate MVs, defined as MV0 and MV1.
[0094] Finally, AMVP constructs a candidate MV list containing at most two MVs {MV0, MV1} through the corresponding positions in the spatial domain and the temporal domain.
[0095] 2. MVP Selection
[0096] Common matching criteria include minimum mean squared error (MSE), minimum mean absolute error (MAD), and maximum matching pixel count (MPC). To simplify calculations, the sum of absolute differences (SAD) is often used instead of MAD. The encoder calculates the Lagrangian cost for each candidate MV and selects the candidate with the lowest cost as the MVP for the current block.
[0097] (1) The specific process of the method of selecting MVP using SAD includes: using MV0 to construct the predicted pixel block Y1 of the current PU block, and using MV1 to construct the predicted pixel block Y2 of the current PU block, and at the same time calculating the SAD with the original pixel block Z corresponding to the current PU block. The calculation formula (a) is as follows:
[0098]
[0099] Among them, Y represents the predicted pixel block, Z represents the original pixel block corresponding to the current PU block, W and H are the width and height of the current PU block respectively, and (i, j) is the coordinate of the pixel point in the current PU block.
[0100] Formula (a) calculates SAD1 for Y1 and SAD2 for Y2. When SAD1 is less than SAD2, MV0 is selected as the MVP. When SAD1 is greater than SAD2, MV1 is selected as the MVP. The MVP index value is used on the encoder to represent the selection result. For example, if MV0 is selected, the MVP index value is 0, and if MV1 is selected, the MVP index value is 1.
[0101] 3. Motion Estimation
[0102] In most video sequences, the contents of adjacent images are very similar, and the background images change very little. Therefore, there is no need to encode all the information of each image. Instead, it is only necessary to transmit the motion information of the moving objects in the current image to the decoder, and the current image can be restored using the content of the previous image and the motion information of the current image. This can effectively save bit rate.
[0103] In the HEVC coding standard, motion estimation involves searching for motion vectors at the granularity of PU blocks. A previously encoded image is generally considered a reference frame, while the image being encoded is called the current frame. The main task of motion estimation is to compare reference blocks within a certain range in the reference frame with the PU blocks in the current frame, finding the block that best matches the PU block. The vector pointing from the best matching block in the reference frame to the PU block in the current frame is the optimal MV for the PU block. The search range for the best matching block in the reference frame is called the motion estimation search interval.
[0104] like Figure 4 As shown in the figure, the PU block in the current frame is located at coordinates (x, y), and the image content in the PU block is A. In the search interval of the reference frame, a reference block with the same image content can be found. When the initial coordinates of the reference block are set to (x, y), the target coordinates of the reference block after movement are (x', y'), so the optimal MV of the PU block is
[0105] 4. Determination of MVD
[0106] After determining the MV and MVP of the PU block, the MVD can be determined based on the quantitative relationship among MVD, MV, and MVP. MVD, MV, and MVP satisfy the following quantitative relationship:
[0107] MVD=MV-MVP
[0108] 5. In order to further reduce the amount of transmitted data, the encoder encodes the MVD and MVP index values of the PU block, and then writes the encoded MVD and MVP index values into the bitstream.
[0109] As described in the background technology, in the general inter-frame prediction method, the encoder needs to encode and transmit the MVD and MVP index values at the same time, resulting in low overall encoding performance at the encoder, which is not conducive to the continued development of inter-frame prediction technology.
[0110] Based on this, an embodiment of the present disclosure provides an inter-frame prediction method, in which the encoding end can obtain the MVP index value and initial MVD of the PU block. When the MVP index value and the initial MVD satisfy the corresponding relationship, the encoding end can determine the initial MVD as the target MVD. When the MVP index value and the initial MVD do not satisfy the corresponding relationship, the encoding end can update the initial MVD. When the updated initial MVD satisfies the corresponding relationship with the MVP index value, the encoding end can determine the updated initial MVD as the target MVD. Subsequently, the encoding end can encode the target MVD to obtain the encoded target MVD and send the encoded target MVD to the decoding end. The decoding end can decode the encoded target MVD to obtain the target MVD and obtain the MVP index value that satisfies the corresponding relationship with the target MVD. Then, the decoding end can determine the target motion vector MV of the PU block based on the MVP index value and the target MVD, and determine the prediction result of the inter-frame motion of the PU block based on the target MV.
[0111] Because the target MVD and MVP index values in this disclosure correspond to each other, the decoder can determine the MVP index value corresponding to the target MVD based on this correspondence. Therefore, the encoder only needs to encode and transmit the target MVD. Compared to conventional techniques, where the encoder needs to encode both the MVD and the MVP index value, this disclosure effectively reduces the amount of information that needs to be encoded and transmitted, effectively improving the overall encoding performance of the encoder.
[0112] The following is an exemplary description of the inter-frame prediction method provided by the embodiment of the present disclosure with reference to the accompanying drawings:
[0113] Figure 5 A schematic diagram of an inter-frame prediction system provided by an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the inter-frame prediction system may include: an encoding end 501 and a decoding end 502. The encoding end 501 and the decoding end 502 are connected to each other.
[0114] Optionally, the inter-frame prediction system may include at least one encoding end and at least one decoding end. Any one of the at least one encoding end may be connected to any one of the at least one decoding end via a wireless or wired connection for communication. For ease of understanding, the disclosed embodiment is described using "a connection between an encoding end 501 and a decoding end 502" as an example.
[0115] The encoder 501 may encode the inter-frame prediction information of the PU block of the video frame to obtain encoded data, and then send the encoded data to the decoder 502. The decoder 502 receives the encoded data and decodes the encoded data to obtain the inter-frame prediction information of the PU block.
[0116] The encoding end 501 and the decoding end 502 can both be devices such as mobile phones or computers.
[0117] In some embodiments, the encoding end 501 and the decoding end 502 may be devices for video processing, chips within the devices, or systems on a chip within the devices. The devices may be mobile phones, tablet computers, PDAs, personal computers (PCs), wearable devices, smart TVs, and the like.
[0118] It should be noted that the encoding end 501 and the decoding end 502 can both be referred to as electronic devices.
[0119] The inter-frame prediction method provided by the embodiment of the present disclosure can be applied to the aforementioned Figure 1 The encoding end 501 and the decoding end 502 in the application scenario are shown.
[0120] like Figure 6 As shown, when the inter-frame prediction method is applied to the encoding end, it may include:
[0121] S601: The encoder obtains the MVP index value and initial MVD of the PU block.
[0122] Optionally, the PU block may be any uncoded area in the video frame to be predicted.
[0123] In one achievable method, the method for the encoding end to obtain the MVP index value and initial MVD of the PU block may include: the encoding end may perform MV prediction on the inter-frame motion of the PU block, determine the MVP, MVP index value and initial MV, and then determine the difference between the initial MV and the MVP as the initial MVD.
[0124] S602: When the MVP index value and the initial MVD satisfy a corresponding relationship, the encoder determines the initial MVD as the target MVD.
[0125] It is easy to understand that when the MVP index value and the initial MVD satisfy a corresponding relationship, it can be said that after obtaining any one of the MVP index value and the initial MVD, another data satisfying the corresponding relationship can be determined based on the data.
[0126] Optionally, the corresponding relationship may represent a functional relationship between the MVP index value and the initial MVD. For example, the MVP index value is a function of the initial MVD, that is, there is only one MVP index value corresponding to each initial MVD.
[0127] Optionally, the corresponding relationship may include: the parity correlation between the MVP index value and the sum of the absolute values of the components of the initial MVD in multiple directions, or the vector modulus correlation between the MVP index value and the initial MVD, and any other corresponding relationship.
[0128] S603: When the MVP index value and the initial MVD do not satisfy the corresponding relationship, the encoder updates the initial MVD until the updated initial MVD and the MVP index value satisfy the corresponding relationship, and determines the updated initial MVD as the target MVD.
[0129] It is easy to understand that when the MVP index value and the initial MVD do not satisfy the corresponding relationship, the data of one cannot be determined based on the other. Since the AMVP mode stipulates that the MVP index value can only be 0 or 1, and the MVP index value corresponds to the MV with the smallest disparity (that is, the smallest Lagrangian cost), adjusting the MVP index value will increase the disparity, resulting in a decrease in the accuracy of inter-frame prediction, so the initial MVD is updated.
[0130] In one achievable manner, the method for the encoder to update the initial MVD may include: the encoder may adjust the initial MV corresponding to the initial MVD to a target value in any direction.
[0131] S604. The encoding end encodes the target MVD to obtain the encoded target MVD, and sends the encoded target MVD to the decoding end, so that the decoding end decodes the encoded target MVD to obtain the target MVD, and obtains the MVP index value that corresponds to the target MVD, and determines the target motion vector MV of the PU block according to the MVP index value and the target MVD.
[0132] The target MV is used to determine the prediction result of the inter-frame motion of the PU block.
[0133] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S601-S605, the encoding end can obtain the MVP index value and initial MVD of the PU block. When the MVP index value and the initial MVD satisfy the corresponding relationship, the encoding end can determine the initial MVD as the target MVD. When the MVP index value and the initial MVD do not satisfy the corresponding relationship, the encoding end can update the initial MVD. When the updated initial MVD and the MVP index value satisfy the corresponding relationship, the encoding end can determine the updated initial MVD as the target MVD. Subsequently, the encoding end can encode the target MVD to obtain the encoded target MVD and send the encoded target MVD to the decoding end. The decoding end can decode the encoded target MVD to obtain the target MVD and obtain the MVP index value that satisfies the corresponding relationship with the target MVD. Then, the decoding end can determine the target motion vector MV of the PU block based on the MVP index value and the target MVD, and determine the prediction result of the inter-frame motion of the PU block based on the target MV.
[0134] Because the target MVD and MVP index values in this disclosure correspond to each other, the decoder can determine the MVP index value corresponding to the target MVD based on this correspondence. Therefore, the encoder only needs to encode and transmit the target MVD. Compared to conventional techniques, where the encoder needs to encode both the MVD and the MVP index value, this disclosure effectively reduces the amount of information that needs to be encoded and transmitted, effectively improving the overall encoding performance of the encoder.
[0135] In an optional embodiment, Figure 6 Based on the method embodiment shown, this embodiment provides a possible implementation method. Figure 6 ,like Figure 7 As shown, the inter-frame prediction method further includes:
[0136] S701: The encoding end determines that the sum of the absolute value of the first component and the absolute value of the second component is a first absolute value sum.
[0137] The first component is the component of the initial MVD in the first direction. The second component is the component of the initial MVD in the second direction. The first direction is perpendicular to the second direction.
[0138] Optionally, one of the first direction and the second direction is a horizontal direction, and the other is a vertical direction.
[0139] The first component of the initial MVD in the horizontal direction is defined as x, the second component of the initial MVD in the vertical direction is defined as y, and the first absolute value is defined as absSum. x, y, and absSum satisfy the function:
[0140] absSum=abs(x)+abs(y).
[0141] S702: When a modulus obtained by performing a modulo operation on the sum of the first absolute value and the preset value is the same as the MVP index value, the encoder determines that the MVP index value and the initial MVD satisfy a corresponding relationship.
[0142] It is easy to understand that when the preset value is 2, since the first absolute value sum is any natural number, that is, the first absolute value must be an odd number or an even number. Among them, even numbers can divide 2 evenly, so the modulus obtained by performing a modulo operation on an even number and 2 is always 0. Odd numbers cannot divide 2 evenly, so the modulus obtained by performing a modulo operation on an odd number and 2 is always 1. Therefore, the modulus obtained by performing a modulo operation on the first absolute value sum and the preset value has only two results, namely 0 or 1.
[0143] According to the existing technology, it is stipulated in the AMVP mode that the MVP index value can only be 0 or 1. Therefore, there are two situations: the modulus is the same as the MVP index value, and the modulus is different from the MVP index value.
[0144] When the preset value is 2, the modulus obtained by performing a modulo operation on the first absolute value sum and the preset value is the same as the MVP index value, that is, the first absolute value sum (absSum) and the MVP index value (MVP idx) satisfy the following function:
[0145] absSum%2=MVP idx.
[0146] S703: When the modulus is different from the MVP index value, the encoder determines that the MVP index value and the initial MVD do not satisfy a corresponding relationship.
[0147] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S701-S703, after the encoding end determines that the sum of the absolute value of the first component and the absolute value of the second component is the first absolute value sum, when the modulus obtained by performing a modulo operation on the first absolute value sum and a preset value is the same as the MVP index value, the encoding end can determine that the MVP index value and the initial MVD satisfy a corresponding relationship. When the modulus is different from the MVP index value, the encoding end determines that the MVP index value and the initial MVD do not satisfy a corresponding relationship. In this way, the encoding end can determine whether the MVP index value and the initial MVD satisfy a corresponding relationship, and thereby determine the target MVD that satisfies the corresponding relationship with the MVP index value based on the MVP index value and the initial MVD, thereby achieving the effect of only encoding and transmitting the target MVD.
[0148] In an optional embodiment, Figure 7 Based on the method embodiment shown in FIG, this embodiment provides a possible implementation method for updating the initial MVD at the encoding end. Figure 8 As shown, in S603, the method for the encoder to update the initial MVD includes:
[0149] S801: The encoder adjusts the target value of an initial MV corresponding to an initial MVD in at least one direction to obtain at least one candidate MV corresponding to the at least one direction.
[0150] The target value is less than a preset value. The at least one direction includes at least one of a first direction, a direction opposite to the first direction, a second direction, and a direction opposite to the second direction.
[0151] S802. When the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, and the MVD corresponding to the target candidate MV satisfies the corresponding relationship with the MVP index value, the encoder updates the initial MVD to the MVD corresponding to the target candidate MV.
[0152] The target candidate MV is any one of the at least one candidate MV.
[0153] It is easy to understand that when the preset value is 2, if the modulus obtained by performing a modulo operation on the first absolute value and the preset value is different from the MVP index value, the following two situations are indicated:
[0154] Case 1: The first absolute value sum is an even number, and the MVP index value is 1. In this case, the first absolute value sum can be adjusted to an odd number.
[0155] Case 2: The first absolute value sum is an odd number, and the MVP index value is 0. In this case, the first absolute value sum can be adjusted to an even number.
[0156] Since the exchange between odd and even numbers only requires an increase or decrease of 1, the first absolute value sum may be increased or decreased by 1, that is, the first component or the second component of the initial MVD may be increased or decreased by 1.
[0157] Because the initial MVD is the difference between the initial MV and the MVP index value, and since the MVP index value does not change, the initial MVD changes with the initial MV. Therefore, increasing or decreasing the first component or the second component of the initial MVD by 1 can be achieved by adjusting the initial MV by 1 in any one of the first direction, the opposite direction of the first direction, the second direction, and the opposite direction of the second direction.
[0158] When the first direction and the second direction are the horizontal direction and the vertical direction respectively, the encoding end adjusts the target value of the initial MV corresponding to the initial MVD in any direction, that is, adds the initial MV to any one of the vectors (1, 0), (-1, 0), (0, 1), (0, -1) to obtain the corresponding candidate MV.
[0159] It should be noted that since the MVP index value and the updated initial MVD can be matched by adjusting the initial MV in any direction to a target value, at least one candidate MV can be selected. To ensure the accuracy of inter-frame prediction, the encoder can determine a target candidate MV from the at least one candidate MV, where the disparity between the predicted image of the corresponding PU block and the original image of the PU block is less than or equal to a preset disparity.
[0160] Optionally, the preset disparity may be the minimum disparity among at least one disparity in a one-to-one correspondence between at least one candidate MV. In this case, the encoder determines, from the at least one candidate MV, a target candidate MV whose predicted image for the corresponding PU block has a disparity with the original image of the PU block that is less than or equal to the preset disparity. This means that the encoder selects, from the at least one candidate MV, the target candidate MV corresponding to the predicted image having the minimum disparity with the original image of the PU block.
[0161] Alternatively, the disparity can be determined based on the Lagrangian cost.
[0162] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S801-S802, the encoding end can adjust the initial MV corresponding to the initial MVD to a target value in at least one direction to obtain at least one candidate MV corresponding to at least one direction. When the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, and the MVD corresponding to the target candidate MV satisfies the corresponding relationship with the MVP index value, the encoding end updates the initial MVD to the MVD corresponding to the target candidate MV. In this way, since the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, the present disclosure can obtain an updated initial MVD that satisfies the corresponding relationship with the MVP index value while ensuring the accuracy of inter-frame prediction.
[0163] In an optional embodiment, Figure 8 Based on the method embodiment shown, this embodiment provides a possible implementation method for an encoder to obtain the MVP index value and initial MVD of a PU block. Figure 9 As shown, in S601, the method for the encoder to obtain the MVP index value and initial MVD of the PU block includes:
[0164] S901: The encoder performs MV prediction on the inter-frame motion of the PU block to determine the MVP, MVP index value and initial MV.
[0165] The encoder creates a spatial list and a temporal list corresponding to the PU block, and then determines a candidate MV list including two candidate MVs based on the spatial list and the temporal list. The encoder calculates the SAD for each candidate MV, selects the candidate MV with the smallest SAD as the MVP of the current block, and determines the MVP index value of the MVP.
[0166] The encoding end may also determine the optimal MV of the PU block as the initial MV through motion estimation.
[0167] S902: The encoder determines the difference between the initial MV and the MVP as the initial MVD.
[0168] According to the quantitative relationship among MVD, MV and MVP, after the encoder determines the initial MV and MVP, the difference between the initial MV and MVP can be determined as the initial MVD.
[0169] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S901-S902, the encoder performs MV prediction on the inter-frame motion of the PU block to determine the MVP, MVP index value, and initial MV. The encoder determines the difference between the initial MV and the MVP as the initial MVD. In this way, the encoder can obtain the MVP index value and initial MVD of the PU block, and then proceed to determine the target MVD corresponding to the MVP index value based on the MVP index value and the initial MVD.
[0170] In an optional embodiment, Figure 9 Based on the method embodiment shown, this embodiment provides a possible implementation method for determining MVP at the encoding end. Figure 10 As shown, in S901, the method for the encoding end to determine the MVP includes:
[0171] S1001: The encoder determines at least one reference MV corresponding to a PU block based on a preset inter-frame prediction mode.
[0172] Optionally, the inter-frame prediction mode may be AMVP.
[0173] S1002: When the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is smaller than the target disparity, the encoder determines the target reference MV as the MVP.
[0174] The target disparity is the disparity between the predicted image of the PU block corresponding to other reference MVs in at least one reference MV and the original image of the PU block.
[0175] It is easy to understand that the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is smaller than the target disparity, which means that the MV with the smallest disparity is selected from at least one reference MV.
[0176] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S1001-S1002, the encoder can determine at least one reference MV corresponding to the PU block based on a preset inter-frame prediction mode. When the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is less than the target disparity, the encoder can determine the target reference MV as the MVP. This disclosure provides a method for the encoder to determine the MVP, so that the MVP index value can be subsequently determined based on the MVP.
[0177] In an optional embodiment, Figure 10 Based on the method embodiment shown, this embodiment provides a possible implementation method for an encoding end to determine at least one reference MV. Figure 10 ,like Figure 11 As shown, in S1001, the method in which the encoder determines at least one reference MV corresponding to the PU block based on a preset inter-frame prediction mode includes:
[0178] S1101: The encoding end determines multiple MVs in a reference domain as references for initial MVs, and merges the same MVs among the multiple MVs.
[0179] The reference domain includes at least one of a spatial domain and a temporal domain.
[0180] S1102: When the number of merged MVs is less than the preset number of at least one reference MV, the encoder uses preset MVs to fill the preset number, and determines the preset MVs and the merged MV as at least one reference MV.
[0181] Optionally, when the inter-frame prediction mode is AMVP, the preset number is 2.
[0182] S1103: When the number of merged MVs is greater than a preset number, the encoder determines, according to a preset sorting rule, MVs corresponding to the preset number after sorting the merged MVs as at least one reference MV.
[0183] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S1101-S1103, the encoding end can determine multiple MVs in the reference domain as references for the initial MV, and merge the same MVs in the multiple MVs. When the number of merged MVs is less than the preset number of at least one reference MV, the encoding end can use the preset MVs to fill the preset number, and determine the preset MV and the merged MV as at least one reference MV. When the number of merged MVs is greater than the preset number, the encoding end can determine the MV corresponding to the preset number after sorting the merged MVs according to the preset sorting rules as at least one reference MV. The present disclosure provides a method for the encoding end to determine at least one reference MV, so that the MVP can be determined based on at least one reference MV subsequently.
[0184] In an optional embodiment, Figure 9 Based on the method embodiment shown in FIG, this embodiment provides a possible implementation method for determining the initial MV at the encoding end. Figure 12 As shown, in S901, the method for the encoder to determine the initial MV includes:
[0185] S1201: The encoder determines a reference block whose image similarity with the PU block is greater than a preset similarity.
[0186] S1202: The encoding end determines the MV of the reference block as the initial MV.
[0187] The technical solution provided by the above embodiment brings at least the following beneficial effects: As can be seen from S1201-S1202, the encoder can determine a reference block whose image similarity with the PU block is greater than a preset similarity, and then determine the MV of the reference block as the initial MV. This disclosure provides a method for the encoder to determine the initial MV.
[0188] like Figure 13 As shown, when the inter-frame prediction method is applied to the decoding end, it may include:
[0189] S1301: The decoding end decodes the received encoded target MVD to obtain the target MVD.
[0190] The target MVD is determined by the encoder based on the MVP index value of the PU block and the initial MVD. The target MVD and the MVP index value satisfy a corresponding relationship.
[0191] Optionally, the corresponding relationship may include: the sum of the absolute values of the components of the target MVD in multiple directions and the modulus obtained by performing a modulo operation on the preset value are the same as the MVP index value.
[0192] S1302: The decoding end determines an MVP index value that satisfies a corresponding relationship with the target MVD.
[0193] It is easy to understand that since the target MVD and the MVP index value satisfy the corresponding relationship, it means that after the decoder obtains any data of the MVP index value and the initial MVD, it can determine the other data that satisfies the corresponding relationship based on the data. Therefore, the decoder can determine the MVP index value that satisfies the corresponding relationship with the target MVD.
[0194] S1303: The decoding end determines the target MV of the PU block according to the target MVD and the MVP index value.
[0195] S1304: The decoding end determines the prediction result of the inter-frame motion of the PU block based on the target MV.
[0196] The technical solution provided by the above embodiment brings at least the following beneficial effects: It can be seen from S1301-S1304 that the decoding end decodes the received encoded target MVD, and after obtaining the target MVD, it can determine the MVP index value that satisfies the corresponding relationship with the target MVD, and then determine the target MV of the PU block based on the target MVD and the MVP index value.
[0197] Because the target MVD and MVP index values in this disclosure correspond to each other, the decoder can determine the MVP index value corresponding to the target MVD based on this correspondence. Therefore, the encoder only needs to encode and transmit the target MVD. Compared to conventional techniques, where the encoder needs to encode both the MVD and the MVP index value, this disclosure effectively reduces the amount of information that needs to be encoded and transmitted, effectively improving the overall encoding performance of the encoder.
[0198] In an optional embodiment, Figure 13 Based on the method embodiment shown, this embodiment provides a possible implementation method. Figure 13 ,like Figure 14 As shown, in S1302, the method for the decoding end to determine the MVP index value that satisfies the corresponding relationship with the target MVD includes:
[0199] S1401: The decoding end determines the sum of the absolute value of the third component and the absolute value of the fourth component as a second absolute value sum.
[0200] The third component is the component of the target MVD in the first direction, and the fourth component is the component of the target MVD in the second direction. The first direction is perpendicular to the second direction.
[0201] Optionally, one of the first direction and the second direction is a horizontal direction, and the other is a vertical direction.
[0202] Define the third component of the target MVD in the horizontal direction as x, the fourth component of the target MVD in the vertical direction as y, and the second absolute value as absSum. x, y, and absSum satisfy the function:
[0203] absSum=abs(x)+abs(y).
[0204] S1402: The decoding end determines a modulus obtained by performing a modulo operation on the second absolute value and a preset value as an MVP index value.
[0205] Because the corresponding relationship includes: the modulus obtained by performing a modulo operation on the sum of the absolute value of the component of the target MVD in the first direction and the absolute value of the component of the target MVD in the second direction with the preset value is the same as the MVP index value, the decoding end can determine the modulus obtained by performing a modulo operation on the sum of the second absolute value and the preset value as the MVP index value.
[0206] The technical solution provided by the above embodiment provides at least the following beneficial effects: As can be seen from S1401-S1402, after the decoder determines the sum of the absolute values of the third component and the fourth component as the second absolute value sum, it can determine the modulus obtained by performing a modulo operation on the second absolute value sum and a preset value as the MVP index value. In this way, the decoder can determine the MVP index value based on the target MVD, so the encoder only needs to encode and transmit the target MVD, effectively reducing the amount of information required for encoding and transmission and effectively improving the overall encoding performance of the encoder.
[0207] In an optional embodiment, combined with Figure 14 ,like Figure 15 As shown, in S1303, the method for the decoder to determine the target MV of the PU block according to the target MVD and the MVP index value includes:
[0208] S1501: The decoding end determines the MVP corresponding to the MVP index value.
[0209] According to the mapping relationship between the MVP index value and the MVP agreed in AMVP, when the MVP index value is 0, the corresponding MVP is MV0, and when the MVP index value is 1, the corresponding MVP is MV1.
[0210] S1502: The decoding end determines the sum of the MVP and the target MVD as the target MV.
[0211] According to the quantitative relationship between MVD, MV and MVP, after the encoding end determines the target MVD and MVP, the sum of MVP and target MVD can be determined as the target MV.
[0212] The technical solution provided by the above embodiment provides at least the following beneficial effects: As can be seen from S1501-S1502, after the decoder determines the MVP corresponding to the MVP index value, it can determine the target MV by summing the MVP and the target MVD. In this way, the decoder can determine the target MV for the PU block based on the target MVD and the MVP index value, and further determine the inter-frame motion prediction result for the PU block.
[0213] It can be understood that, in actual implementation, the inter-frame prediction device described in the embodiment of the present disclosure may include one or more hardware structures and / or software modules for implementing the aforementioned corresponding inter-frame prediction method, and these execution hardware structures and / or software modules may constitute an electronic device. It should be easy for those skilled in the art to realize that, in combination with the algorithm steps of each example described in the embodiment disclosed herein, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.
[0214] Based on this understanding, the embodiments of the present disclosure also provide an inter-frame prediction device. Figure 16 The structure of the inter-frame prediction device provided by the embodiment of the present disclosure is shown as follows Figure 1 .like Figure 16 As shown, it is applied to the encoding end; the inter-frame prediction device includes: a processing unit 1601 and an encoding unit 1602.
[0215] The processing unit 1601 is configured to obtain the MVP index value and initial MVD of the PU block.
[0216] The processing unit 1601 is further configured to determine the initial MVD as the target MVD when the MVP index value and the initial MVD satisfy a corresponding relationship.
[0217] The processing unit 1601 is further configured to update the initial MVD when the MVP index value and the initial MVD do not satisfy the corresponding relationship, until the updated initial MVD and the MVP index value satisfy the corresponding relationship, and determine the updated initial MVD as the target MVD.
[0218] The encoding unit 1602 is configured to perform encoding processing on the target MVD obtained by the processing unit 1601 to obtain the encoded target MVD, and send the encoded target MVD to the decoding end, so that the decoding end decodes the encoded target MVD to obtain the target MVD, and obtains the MVP index value that satisfies the corresponding relationship with the target MVD, and determines the target motion vector MV of the PU block according to the MVP index value and the target MVD; and determines the prediction result of the inter-frame motion of the PU block based on the target MV.
[0219] Optionally, the processing unit 1601 is further configured to determine that the sum of the absolute value of the first component and the absolute value of the second component is a first absolute value sum; the first component is the component of the initial MVD in the first direction; the second component is the component of the initial MVD in the second direction; the first direction is perpendicular to the second direction; when the modulus obtained by performing a modulus operation on the first absolute value sum and a preset value is the same as the MVP index value, it is determined that the MVP index value and the initial MVD satisfy the corresponding relationship; when the modulus is different from the MVP index value, it is determined that the MVP index value and the initial MVD do not satisfy the corresponding relationship.
[0220] Optionally, the processing unit 1601 is specifically configured to adjust the initial motion vector MV corresponding to the initial MVD to a target value in at least one direction to obtain at least one candidate MV corresponding one-to-one to the at least one direction; the target value is less than a preset value; the at least one direction includes: at least one of the first direction, the opposite direction of the first direction, the second direction and the opposite direction of the second direction; when the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, and the MVD corresponding to the target candidate MV satisfies the corresponding relationship with the MVP index value, the initial MVD is updated to the MVD corresponding to the target candidate MV; the target candidate MV is any one of the at least one candidate MVs.
[0221] Optionally, the processing unit 1601 is specifically configured to perform MV prediction on the inter-frame motion of the PU block, determine the MVP, the MVP index value and the initial MV; and determine the difference between the initial MV and the MVP as the initial MVD.
[0222] Optionally, the processing unit 1601 is specifically configured to execute based on a preset inter-frame prediction mode to determine at least one reference MV corresponding to the PU block; when the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is less than the target disparity, the target reference MV is determined as the MVP; the target disparity is the disparity between the predicted image of the PU block corresponding to other reference MVs in at least one reference MV and the original image of the PU block.
[0223] Optionally, the processing unit 1601 is specifically configured to determine multiple MVs in the reference domain as initial MV references, and merge the same MVs in the multiple MVs; the reference domain includes: at least one domain in the spatial domain and the time domain; when the number of merged MVs is less than the preset number of at least one reference MV, the preset MV is used to fill the preset number, and the preset MV and the merged MV are determined as at least one reference MV; when the number of merged MVs is greater than the preset number, the MV corresponding to the preset number after the merged MV is sorted according to the preset sorting rules is determined as at least one reference MV.
[0224] Optionally, the processing unit 1601 is specifically configured to determine a reference block having an image similarity with the PU block greater than a preset similarity; and determine the MV of the reference block as the initial MV.
[0225] In addition, the embodiment of the present disclosure also provides an inter-frame prediction device. Figure 17 The structure of the inter-frame prediction device provided by the embodiment of the present disclosure is shown as follows Figure 2 .like Figure 17 As shown, it is applied to the decoding end; the inter-frame prediction device includes: a decoding unit 1701 and a processing unit 1702.
[0226] The decoding unit 1701 is configured to perform decoding processing on the received encoded target MVD to obtain a target MVD; the target MVD is determined by the encoder according to the MVP index value of the PU block and the initial MVD; the target MVD and the MVP index value satisfy a corresponding relationship.
[0227] The processing unit 1702 is configured to determine an MVP index value that satisfies a corresponding relationship with the target MVD obtained by the decoding unit 1701 .
[0228] The processing unit 1702 is further configured to determine a target MV of the PU block according to the target MVD and the MVP index value; and determine a prediction result of inter-frame motion of the PU block based on the target MV.
[0229] Optionally, the processing unit 1702 is specifically configured to determine the sum of the absolute value of the third component and the absolute value of the fourth component as the second absolute value sum; the third component is the component of the target MVD in the first direction; the fourth component is the component of the target MVD in the second direction; the first direction is perpendicular to the second direction; and the modulus obtained by performing a modulus operation on the second absolute value sum and a preset value is determined as the MVP index value.
[0230] Optionally, the processing unit 1702 is specifically configured to determine an MVP corresponding to the MVP index value; and determine a sum of the MVP and the target MVD as the target MV.
[0231] As described above, the embodiments of the present disclosure can divide the target device / target service node into functional modules according to the above-mentioned method examples. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. Furthermore, it should be noted that the division of modules in the embodiments of the present disclosure is illustrative and merely represents a logical functional division. In actual implementation, other division methods may be used. For example, functional modules may be divided according to their respective functions, or two or more functions may be integrated into a single processing module.
[0232] Regarding the inter-frame prediction device in the above embodiment, the specific manner in which each module performs operations and the beneficial effects thereof have been described in detail in the aforementioned method embodiment and will not be repeated here.
[0233] The embodiment of the present disclosure also provides an inter-frame prediction device. Figure 18 The structure of the inter-frame prediction device provided by the embodiment of the present disclosure is shown as follows Figure 3 The inter-frame prediction apparatus may include at least one processor 221 , a communication bus 222 , a memory 223 and at least one communication interface 224 .
[0234] The processor 221 may be a central processing unit (CPU), a microprocessor unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the disclosed solution. Figure 16 and Figure 17 The processor 221 is used to execute the operations performed by the processing unit 1601 and the encoding unit 1602, or the decoding unit 1701 and the processing unit 1702.
[0235] The communication bus 222 may include a pathway for transmitting information between the aforementioned components.
[0236] The communication interface 224 uses any transceiver or other device for communicating with other devices or communication networks, such as electronic devices, Ethernet, radio access networks (RAN), wireless local area networks (WLAN), etc.
[0237] The memory 223 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit via a bus. The memory may also be integrated with the processing unit.
[0238] The memory 223 is used to store application code for executing the solution of the present disclosure, and the execution is controlled by the processor 221. The processor 221 is used to execute the application code stored in the memory 223, thereby realizing the functions of the method of the present disclosure.
[0239] In a specific implementation, as an embodiment, the processor 221 may include one or more central processing units, such as Figure 17 CPU 0 and CPU 1 in.
[0240] In a specific implementation, as an embodiment, the inter-frame prediction device may include multiple processors, such as Figure 18 2 and 2. Each of these processors may be a single-CPU processor or a multi-CPU processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0241] In a specific implementation, as an embodiment, the inter-frame prediction apparatus may further include an input device 226 and an output device 227. The input device 226 communicates with the output device 227 and can accept user input in various ways. For example, the input device 226 may be a mouse, keyboard, touch screen device, or sensor device. The output device 227 communicates with the processor 221 and can display information in various ways. For example, the output device 227 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, or the like.
[0242] Those skilled in the art will understand that Figure 18 The structure shown in the figure does not constitute a limitation to the inter-frame prediction device, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.
[0243] The present disclosure also provides an inter-frame prediction system, which includes an encoding end and a decoding end;
[0244] Encoding end, used to execute the above Figure 6 、 Figure 7 、 Figure 8 、 Figure 9 、 Figure 10 、 Figure 11 、 Figure 12 The inter-frame prediction method shown.
[0245] Decoding end, used to execute the above Figure 13 、 Figure 14 、 Figure 15 The inter-frame prediction method shown.
[0246] The present disclosure further provides a computer-readable storage medium including instructions. The computer-readable storage medium stores the instructions. When the instructions in the computer-readable storage medium are executed by a processor of an inter-frame prediction device, the inter-frame prediction device is enabled to perform the inter-frame prediction method provided in the above-described embodiments. For example, the computer-readable storage medium may be memory 223 including instructions. The instructions may be executed by processor 221 of the inter-frame prediction device to perform the above-described method.
[0247] Optionally, the computer-readable storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be a ROM, RAM, CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
[0248] The present disclosure also provides a computer program product including instructions, which, when executed on an electronic device, enables the electronic device to execute the inter-frame prediction method provided by the above-mentioned embodiment.
[0249] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0250] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An inter-frame prediction method, characterized in that: Applied to the encoding end, the method includes: Get the predicted motion vector MVP index value and initial MVD of the prediction unit PU block; When the MVP index value and the initial MVD satisfy a corresponding relationship, determining the initial MVD as a target MVD; When the MVP index value and the initial MVD do not satisfy the corresponding relationship, updating the initial MVD until the updated initial MVD and the MVP index value satisfy the corresponding relationship, and determining the updated initial MVD as the target MVD; The target MVD is encoded to obtain an encoded target MVD, and the encoded target MVD is sent to a decoding end so that the decoding end decodes the encoded target MVD to obtain the target MVD, obtains the MVP index value that satisfies the correspondence with the target MVD, and determines the target MV of the PU block according to the MVP index value and the target MVD; the target MV is used to determine the prediction result of the inter-frame motion of the PU block.
2. The inter-frame prediction method according to claim 1, wherein: Also includes: Determine the sum of the absolute value of the first component and the absolute value of the second component as a first absolute value sum; The first component is the component of the initial MVD in the first direction; The second component is a component of the initial MVD in a second direction; the first direction is perpendicular to the second direction; When the modulus obtained by performing a modulo operation between the sum of the first absolute value and a preset value is the same as the MVP index value, determining that the MVP index value and the initial MVD satisfy the corresponding relationship; When the modulus is different from the MVP index value, it is determined that the MVP index value and the initial MVD do not satisfy the corresponding relationship.
3. The inter-frame prediction method according to claim 2, wherein: The updating of the initial MVD includes: Adjusting an initial motion vector MV corresponding to the initial MVD by a target value in at least one direction to obtain at least one candidate MV corresponding to the at least one direction; the target value is less than the preset value; the at least one direction includes at least one of the first direction, the opposite direction of the first direction, the second direction, and the opposite direction of the second direction; When the disparity between the predicted image of the PU block corresponding to the target candidate MV and the original image of the PU block is less than or equal to the preset disparity, and the MVD corresponding to the target candidate MV and the MVP index value satisfy the correspondence, the initial MVD is updated to the MVD corresponding to the target candidate MV; the target candidate MV is any one of the at least one candidate MVs.
4. The inter-frame prediction method according to claim 3, wherein: Get the MVP index value and initial MVD of the PU block, including: Performing MV prediction on the inter-frame motion of the PU block to determine the MVP, the MVP index value and the initial MV; The difference between the initial MV and the MVP is determined as the initial MVD.
5. The inter-frame prediction method according to claim 4, wherein: Determine the MVP, including: Determine at least one reference MV corresponding to the PU block based on a preset inter prediction mode; When the disparity between the predicted image of the PU block corresponding to the target reference MV and the original image of the PU block is less than the target disparity, the target reference MV is determined as the MVP; the target disparity is the disparity between the predicted image of the PU block corresponding to other reference MVs in the at least one reference MV and the original image of the PU block.
6. The inter-frame prediction method according to claim 5, wherein: The determining, based on a preset inter-frame prediction mode, at least one reference MV corresponding to the PU block includes: Determine a plurality of MVs in a reference domain as references for the initial MV, and merge identical MVs in the plurality of MVs; the reference domain includes at least one of a spatial domain and a temporal domain; When the number of the merged MVs is less than the preset number of the at least one reference MV, the preset number is filled with preset MVs, and the preset MVs and the merged MV are determined as the at least one reference MV; When the number of the merged MVs is greater than the preset number, the MVs corresponding to the preset number after sorting the merged MVs are determined as the at least one reference MV according to a preset sorting rule.
7. The inter-frame prediction method according to claim 4, wherein: Determining the initial MV includes: Determine a reference block having an image similarity with the PU block greater than a preset similarity; The MV of the reference block is determined as the initial MV.
8. An inter-frame prediction method, characterized in that: Applied to a decoding end, the method includes: Decoding the received encoded target MVD to obtain a target MVD; the target MVD is determined by the encoder according to the MVP index value of the PU block and the initial MVD; the target MVD and the MVP index value satisfy a corresponding relationship; Determine the MVP index value that satisfies the corresponding relationship with the target MVD; Determine a target MV of the PU block according to the target MVD and the MVP index value; A prediction result of inter-frame motion of the PU block is determined based on the target MV.
9. The inter-frame prediction method according to claim 8, wherein: The determining the MVP index value that satisfies the corresponding relationship with the target MVD includes: Determine the sum of the absolute value of the third component and the absolute value of the fourth component as the second absolute value sum; the third component is the component of the target MVD in the first direction; the fourth component is the component of the target MVD in the second direction; the first direction is perpendicular to the second direction; A modulus obtained by performing a modulo operation on the sum of the second absolute value and a preset value is determined as the MVP index value.
10. The inter-frame prediction method according to claim 9, wherein: The determining, according to the target MVD and the MVP index value, a target MV of the PU block includes: Determine the MVP corresponding to the MVP index value; The sum of the MVP and the target MVD is determined as the target MV.
11. An inter-frame prediction device, characterized in that: Applied to the encoding end, including: processing unit and encoding unit; The processing unit is configured to obtain the MVP index value and the initial MVD of the PU block; The processing unit is further configured to determine the initial MVD as a target MVD when the MVP index value and the initial MVD satisfy a corresponding relationship; The processing unit is further configured to update the initial MVD when the MVP index value and the initial MVD do not satisfy the corresponding relationship until the updated initial MVD and the MVP index value satisfy the corresponding relationship, and determine the updated initial MVD as the target MVD; The encoding unit is configured to perform encoding processing on the target MVD obtained by the processing unit to obtain the encoded target MVD, and send the encoded target MVD to the decoding end, so that the decoding end decodes the encoded target MVD to obtain the target MVD, and obtains the MVP index value that satisfies the correspondence with the target MVD, and determines the target MV of the PU block according to the MVP index value and the target MVD; the target MV is used to determine the prediction result of the inter-frame motion of the PU block.
12. An inter-frame prediction device, characterized in that: Applied to the decoding end, including: a decoding unit and a processing unit; The decoding unit is configured to perform decoding processing on the received encoded target MVD to obtain a target MVD; the target MVD is determined by the encoder according to the MVP index value of the PU block and the initial MVD; the target MVD and the MVP index value satisfy a corresponding relationship; The processing unit is configured to determine the MVP index value that satisfies the corresponding relationship with the target MVD obtained by the decoding unit; The processing unit is further configured to determine a target MV of the PU block according to the target MVD and the MVP index value; The processing unit is further configured to determine a prediction result of inter-frame motion of the PU block based on the target MV.
13. An inter-frame prediction system, characterized in that The inter-frame prediction system includes: an encoding end and a decoding end; The encoding end is configured to perform the inter-frame prediction method according to any one of claims 1 to 7; The decoding end is used to perform the inter-frame prediction method according to any one of claims 8 to 10.
14. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the inter-frame prediction method according to any one of claims 1 to 7 or any one of claims 8 to 10.
15. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the inter-frame prediction method according to any one of claims 1 to 7 or any one of claims 8 to 10.
Citation Information
Patent Citations
Video encoding method and device, electronic equipment and storage medium
CN110611820A
Method and apparatus for adaptively predicting image using threshold value in image coding system
WO2017082443A1