Inter prediction method and terminal
By acquiring and utilizing image block motion information, the predicted values of pixel regions are determined and the predicted values of boundary pixels are corrected. This solves the problem of inaccurate prediction values caused by the lack of consideration for motion pattern differences in OBMC technology, and improves video encoding and decoding efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2022-03-10
- Publication Date
- 2026-08-04
AI Technical Summary
During video encoding and decoding, when correcting the predicted values of boundary pixels based on OBMC technology, the differences in motion patterns of image blocks are not fully considered, resulting in inaccurate prediction values and reduced encoding and decoding efficiency.
By acquiring motion information of the first and second image blocks, the predicted values in their associated pixel regions are determined, and the predicted values of boundary pixels are corrected based on target information, including the difference relationship, to take into account the motion differences between image blocks.
This improves the accuracy of boundary pixel prediction values, thereby enhancing video encoding and decoding efficiency.
Smart Images

Figure CN116320428B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of video encoding and decoding technology, specifically relating to an inter-frame prediction method and terminal. Background Technology
[0002] Currently, in the video encoding and decoding process, if the image block boundaries do not fit the image block contours, Overlapped Block Motion Compensation (OBMC) can be used to perform inter-frame prediction processing on the image blocks, correcting the predicted values corresponding to the boundary pixels of the image blocks. In OBMC technology, the predicted values obtained using image block motion information and the predicted values obtained using the motion information of adjacent image blocks are weighted and processed to correct the predicted values of the boundary pixels.
[0003] However, during the process of correcting the predicted values of boundary pixels based on OBMC technology, the corrected predicted values of boundary pixels are prone to inaccuracy, which in turn reduces the efficiency of video encoding and decoding. Summary of the Invention
[0004] This application provides an inter-frame prediction method and terminal that can solve the technical problem of inaccurate correction of predicted values of boundary pixels, thereby reducing the efficiency of video encoding and decoding.
[0005] Firstly, an inter-frame prediction method is provided, which includes:
[0006] Acquire first motion information of a first image block and second motion information of a second image block, wherein the first image block and the second image block are adjacent;
[0007] A first predicted value and a second predicted value are determined for each pixel in a first pixel region associated with the first image block; the first predicted value is determined based on the first motion information and the position information of the first pixel region, and the second predicted value is determined based on the second motion information and the position information of the first pixel region.
[0008] Based on the target information, the target prediction value corresponding to each pixel in the second pixel region of the first image block is determined; the target information includes a first difference and a second difference, the first difference being the difference determined based on the reconstructed value of each pixel in the first pixel region and the first prediction value, and the second difference being the second difference determined based on the reconstructed value of each pixel in the first pixel region and the second prediction value.
[0009] Wherein, the first image block is an image block to be encoded, and the second image block is an encoded image block; or, the first image block is an image block to be decoded, and the second image block is a decoded image block.
[0010] Secondly, an inter-frame prediction apparatus is provided, comprising:
[0011] The acquisition module is used to acquire first motion information of a first image block and second motion information of a second image block, wherein the first image block and the second image block are adjacent to each other.
[0012] The first determining module is used to determine a first predicted value and a second predicted value corresponding to each pixel in the first pixel region associated with the first image block; the first predicted value is determined based on the first motion information and the position information of the first pixel region, and the second predicted value is determined based on the second motion information and the position information of the first pixel region.
[0013] The second determining module is used to determine the target prediction value corresponding to each pixel in the second pixel region of the first image block based on the target information; the target information includes a first difference and a second difference, wherein the first difference is the difference determined based on the reconstructed value of each pixel in the first pixel region and the first prediction value, and the second difference is the second difference determined based on the reconstructed value of each pixel in the first pixel region and the second prediction value;
[0014] Wherein, the first image block is an image block to be encoded, and the second image block is an encoded image block; or, the first image block is an image block to be decoded, and the second image block is a decoded image block.
[0015] Thirdly, a terminal is provided, comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.
[0016] Fourthly, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0017] Fifthly, a chip is provided, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0018] In a sixth aspect, a computer program / program product is provided, the computer program / program product being stored in a storage medium, the computer program / program product being executed by at least one processor to perform the steps of the method as described in the first aspect.
[0019] In this embodiment, first motion information of a first image block and second motion information of a second image block are obtained; a first predicted value and a second predicted value corresponding to each pixel in a first pixel region associated with the first image block are determined; and a target predicted value corresponding to each pixel in the second pixel region of the first image block is determined based on target information. In this embodiment, the first predicted value and the second predicted value are determined, wherein the first predicted value is determined based on the first motion information of the first image block, and the second predicted value is determined based on the second motion information of the second image block; and then the target predicted value of the boundary pixel is determined based on the target information. The target information includes a first difference and a second difference. The magnitude relationship between the first difference and the second difference can characterize the motion difference between the first image block and the second image block, thereby fully considering the motion difference between the first image block and the second image block during the process of correcting the predicted value of the boundary pixel, improving the accuracy of the corrected predicted value of the boundary pixel, and thus improving video encoding and decoding efficiency. Attached Figure Description
[0020] Figure 1 This is one of the application scenarios of existing inter-frame prediction methods;
[0021] Figure 2 This is the second illustration of an application scenario for existing inter-frame prediction methods;
[0022] Figure 3 This is a flowchart of the inter-frame prediction method provided in the embodiments of this application;
[0023] Figure 4 This is one of the application scenario diagrams of the inter-frame prediction method provided in the embodiments of this application;
[0024] Figure 5 This is a second schematic diagram illustrating an application scenario of the inter-frame prediction method provided in this application embodiment;
[0025] Figure 6 This is the third schematic diagram illustrating the application scenario of the inter-frame prediction method provided in the embodiments of this application;
[0026] Figure 7 This is the fourth illustration of an application scenario for the inter-frame prediction method provided in this application embodiment;
[0027] Figure 8 This is the fifth illustration of an application scenario for the inter-frame prediction method provided in this application embodiment;
[0028] Figure 9 This is the sixth illustration of an application scenario for the inter-frame prediction method provided in this application embodiment;
[0029] Figure 10 This is a structural diagram of the inter-frame prediction device provided in the embodiments of this application;
[0030] Figure 11 This is a structural diagram of the communication device provided in the embodiments of this application;
[0031] Figure 12 This is a schematic diagram of the hardware structure of the terminal provided in the embodiments of this application. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0033] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0034] In the embodiments of this application, the attribute decoding device corresponding to the inter-frame prediction method can be a terminal, which can also be called a terminal device or user equipment (UE). The terminal can be a mobile phone, tablet computer, laptop computer, personal digital assistant (PDA), handheld computer, netbook, ultra-mobile personal computer (UMPC), mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device or vehicle-mounted device (VUE), pedestrian terminal (PUE), smart home (home devices with wireless communication functions, such as refrigerators, televisions, washing machines or furniture, etc.), game console, personal computer (PUE). Terminal devices such as computers (PCs), ATMs, or self-service machines; wearable devices include smartwatches, smart bracelets, smart earphones, smart glasses, smart jewelry (smart bracelets, smart necklaces, smart anklets, smart ankle chains, etc.), smart wristbands, smart clothing, etc. It should be noted that the embodiments in this application do not limit the specific type of terminal.
[0035] For ease of understanding, the following describes some aspects of the embodiments of this application:
[0036] When the boundary of an image patch does not fit the contour of the current image patch, the motion of the boundary pixels of the current image patch may be consistent with the current image patch or with adjacent image patches. The predicted values of the boundary pixels determined based on the motion information of the current image patch differ significantly from the actual predicted values, thereby reducing the encoding and decoding efficiency of the video. Here, the current image patch can be a block to be encoded, and adjacent image patches can be already encoded; or, the current image patch can be a block to be decoded, and adjacent image patches can be already decoded.
[0037] Currently, OBMC technology can be used to correct the predicted values of boundary pixels in the current image patch, thus solving the aforementioned technical problems. OBMC is an inter-frame prediction method. The following is a detailed explanation of OBMC technology:
[0038] The first scenario is that the inter-frame prediction modes of all pixels in the current block are the same.
[0039] In this scenario, when adjacent image blocks are in inter-frame prediction mode, not intra-frame block copy mode, and the motion mode of adjacent image blocks is inconsistent with the motion mode of the current image block, motion information of the adjacent image blocks is obtained. Please refer to [link to relevant documentation]. Figure 1 Adjacent image blocks can be the image block above the current image block, or the image block to the left of the current image block.
[0040] The motion pattern of an adjacent image block is inconsistent with the motion pattern of the current image block if any one of the following conditions is met.
[0041] 1. The prediction direction of adjacent image blocks is different from the prediction direction of the current image block.
[0042] 2. The prediction direction of adjacent image blocks is the same as that of the current image block, but the reference frames to which the prediction directions point are different.
[0043] 3. The prediction direction of adjacent image blocks is the same as that of the current image block, and the reference frame to which the prediction direction points is the same, but the motion vector of adjacent image blocks is different from that of the current image block.
[0044] After acquiring motion information from neighboring image blocks, a first predicted value is obtained based on the motion information of the current image block; a second predicted value is obtained based on the motion information of neighboring image blocks. The predicted values of the boundary pixels of the current image block are then corrected using the first and second predicted values.
[0045] Specifically, if the current image block is a brightness sub-block, the first and second predicted values can be weighted and summed using the following formula to obtain the predicted value after boundary pixel correction:
[0046] NewPixel(i,j)=(26×Pixel1(i,j)+6×Pixel2(i,j)+16)>>5
[0047] NewPixel(i,j)=(7×Pixel1(i,j)+Pixel2(i,j)+4)>>3
[0048] NewPixel(i,j)=(15×Pixel1(i,j)+Pixel2(i,j)+8)>>4
[0049] NewPixel(i,j)=(31×Pixel1(i,j)+Pixel2(i,j)+16)>>5
[0050] Where i represents the column coordinate of the boundary pixel in the current image block, j represents the row coordinate of the boundary pixel in the current image block, Pixel1 represents the first predicted value of the boundary pixel, Pixel2 represents the second predicted value of the boundary pixel, and NewPixel represents the corrected predicted value of the boundary pixel.
[0051] If the current image patch is a chroma sub-patch, the first and second predicted values can be weighted and summed using the following formula to obtain the predicted value after boundary pixel correction:
[0052] NewPixel(i,j)=(26×Pixel1(i,j)+6×Pixel2(i,j)+16)>>5
[0053] Among them, NewPixel represents the predicted value after correction of the boundary pixel.
[0054] It should be understood that the above formula is applicable to scenarios where the pixel region of the boundary pixel is 4 rows or 4 columns. In other application scenarios, there is no specific limitation on the pixel region of the boundary pixel.
[0055] The second scenario is if the current image block is a coded block and the inter-frame prediction mode is affine mode, or if the current image block is a decoded block and the inter-frame prediction mode is motion vector correction mode.
[0056] In this case, the motion information of the four adjacent image blocks—the top, bottom, left, and right sides—that are adjacent to the current image block are obtained. Please refer to [link / reference needed]. Figure 2 , Figure 2 This illustrates the positional relationship between adjacent image blocks and the current image block under the above conditions.
[0057] Based on the motion information of the current image block, a first predicted value is obtained; if any of the following conditions are met between the current image block and its neighboring image blocks, a second predicted value is obtained based on the motion information of the neighboring image blocks.
[0058] 1. The prediction direction of adjacent image blocks is different from the prediction direction of the current image block.
[0059] 2. The prediction direction of adjacent image blocks is the same as that of the current image block, but the reference frames to which the prediction directions point are different.
[0060] 3. The prediction direction of adjacent image blocks is the same as that of the current image block, and the reference frame to which the prediction direction points is the same. However, the absolute value of the difference between the motion vector of the adjacent image block and the motion vector of the current image block is greater than a preset threshold.
[0061] The predicted values of the boundary pixels of the current image block are corrected using the first and second predicted values described above. Specifically, the corrected predicted values of the boundary pixels can be obtained by weighted summing the first and second predicted values using the following formula:
[0062] rem_w(i,j)=(32–w(i)–w(width-i)–w(j)–w(height-j))
[0063] subNewPixel(i,j)=(subPixel2 L (i,j)×w(i)+subPixel2 R (i,j)×w(width-1-i)+subPixel2 T (i,j)×w(j)+subPixel2 B (i,j)×w(height-1-j)+subPixel1×rem_w(i,j)+16)>>5
[0064] Where i represents the column coordinate of the boundary pixel in the current image patch, j represents the row coordinate of the boundary pixel in the current image patch, subNewPixel represents the corrected predicted value of the boundary pixel, and subPixel2 represents the corrected predicted value of the boundary pixel. L subPixel2 R subPixel2 T and subPixel2 B The second predicted value is determined based on the motion information of adjacent image blocks. The width represents the number of columns of the adjacent image blocks, the height represents the number of rows of the adjacent image blocks, and w represents the preset weight combination. The weight combination corresponding to the current image block being a luminance block is different from the weight combination corresponding to the current image block being a chrominance block.
[0065] It should be understood that the above formula is applicable to scenarios where the pixel region of the boundary pixel is 4 rows or 4 columns. In other application scenarios, there is no specific limitation on the pixel region of the boundary pixel.
[0066] In the process of correcting the predicted values of boundary pixels using OBMC technology, the difference between the motion mode of the current image block and the motion mode of adjacent image blocks was not taken into account. This resulted in inaccurate predicted values of boundary pixels after correction, which in turn reduced the efficiency of video encoding and decoding.
[0067] Given the above situation, how to improve the accuracy of the predicted values of the corrected boundary pixels, and thus improve the efficiency of video encoding and decoding, is a technical problem that needs to be solved.
[0068] To address the aforementioned potential technical problems, this application provides an inter-frame prediction method. The inter-frame prediction method provided by this application will be described in detail below with reference to the accompanying drawings, through some embodiments and application scenarios.
[0069] Please see Figure 3 , Figure 3 This is a flowchart of the inter-frame prediction method provided in this application. The inter-frame prediction coding method provided in this embodiment includes the following steps:
[0070] S101, acquire the first motion information of the first image block and the second motion information of the second image block.
[0071] The first image block is an image block to be encoded, and the second image block is an adjacent and already encoded image block; or, the first image block is an image block to be decoded, and the second image block is an adjacent and already decoded image block. The first image block is in inter-frame prediction mode, and the first and second image blocks satisfy any one of the following conditions:
[0072] 1. The prediction direction of the first image block is different from that of the second image block.
[0073] 2. The prediction direction of the first image block is the same as that of the second image block, but the reference frames to which the prediction directions point are different.
[0074] 3. The prediction direction of the first image block is the same as that of the second image block, and the reference frame to which the prediction direction points is the same, but the motion vector of the first image block is different from that of the second image block.
[0075] In this step, if the first image block and the second image block meet the above conditions, the first motion information of the first image block and the second motion information of the second image block are obtained.
[0076] S102, determine the first predicted value and the second predicted value corresponding to each pixel in the first pixel region associated with the first image block.
[0077] The aforementioned first pixel region is adjacent to the first image block. The first pixel region can be a portion of the pixel region within the second image block. For example, if the second image block is the upper image block adjacent to the first image block, and the first pixel region is the pixel region above the first image block, then the first pixel region is a portion of the pixel region within the second image block. Alternatively, the first pixel region may not necessarily be a portion of the pixel region within the second image block.
[0078] It should be understood that motion information includes prediction direction, reference frame information, and motion vector. In this step, a first reference pixel can be determined based on the first motion information. This first reference pixel is located in the first reference frame at the same position as the first pixel region. Then, based on the first reference pixel, the reconstructed value of the pixel in the first reference frame pointed to by the first motion vector is determined as the first predicted value. A second reference pixel is determined based on the second motion information. This second reference pixel is located in the second reference frame at the same position as the first pixel region. Then, based on the second reference pixel, the reconstructed value of the pixel in the second reference frame pointed to by the second motion vector is determined as the second predicted value.
[0079] S103, based on the target information, determine the target prediction value corresponding to each pixel in the second pixel region of the first image block.
[0080] The aforementioned target information includes a first difference and a second difference. The first difference is the difference determined based on the reconstructed value and the first predicted value of each pixel in the first pixel region. The second difference is the second difference determined based on the reconstructed value and the second predicted value of each pixel in the first pixel region. Optionally, the first difference can be the sum of the absolute values of the differences between the first predicted value and the reconstructed value of each pixel, and the second difference can be the sum of the absolute values of the differences between the second predicted value and the reconstructed value of each pixel. The first difference is used to characterize the motion pattern of the first image block, and the second difference is used to characterize the motion pattern of the second image block.
[0081] The aforementioned second pixel region is a portion of the pixel region within the first image block, and each pixel within this second pixel region is also referred to as a boundary pixel. For easier understanding, please refer to [link to relevant documentation]. Figure 4 and Figure 5 , Figure 4 The diagram shows the position of the second pixel region when the first pixel region is located above the first image block; Figure 5 The diagram illustrates the position of the second pixel region when the first pixel region is located to the left of the first image block. In other words, in an alternative implementation, the first pixel region in the second image block is adjacent to the second pixel region in the first image block.
[0082] In this step, the first difference and the second difference corresponding to the first pixel region can be used to determine the target predicted value of each boundary pixel. For specific technical solutions, please refer to subsequent embodiments. It should be understood that the target predicted value is the predicted value after correction for the boundary pixels.
[0083] In other embodiments, the inter-frame prediction method provided in this application can also be used to generate prediction values for boundary pixels of sub-blocks within a coding block or decoding block. For this implementation, please refer to... Figure 6The first pixel region is the reconstructed pixel above the coded block corresponding to the column containing the sub-block; or, please refer to [link to relevant documentation]. Figure 7 The first pixel region is the reconstructed pixel to the left of the coded block corresponding to the row where the sub-block is located.
[0084] The inter-frame prediction method provided in this application has higher video coding performance than traditional inter-frame prediction methods. Please refer to Table 1 for a clearer understanding of the technical effects achieved by this application.
[0085] Table 1:
[0086]
[0087] The test sequences in Table 1 are obtained by comparing the inter-frame prediction method provided in this application with the traditional inter-frame prediction method. The Y-channel BD-Rate, U-channel BD-Rate, and V-channel BD-Rate are parameters used to measure coding performance. A negative BD-Rate indicates higher coding performance, and the higher the absolute value of the BD-Rate, the greater the gain in coding performance. Table 1 shows that the inter-frame prediction method provided in this application has higher coding performance for video than the traditional inter-frame prediction method.
[0088] In this embodiment, first motion information of a first image block and second motion information of a second image block are obtained; a first predicted value and a second predicted value corresponding to each pixel in a first pixel region associated with the first image block are determined; and a target predicted value corresponding to each pixel in the second pixel region of the first image block is determined based on target information. In this embodiment, the first predicted value and the second predicted value are determined, wherein the first predicted value is determined based on the first motion information of the first image block, and the second predicted value is determined based on the second motion information of the second image block; and then the target predicted value of the boundary pixel is determined based on the target information. The target information includes a first difference and a second difference. The magnitude relationship between the first difference and the second difference can characterize the motion difference between the first image block and the second image block, thereby fully considering the motion difference between the first image block and the second image block during the process of correcting the predicted value of the boundary pixel, improving the accuracy of the corrected predicted value of the boundary pixel, and thus improving video encoding and decoding efficiency.
[0089] Optionally, the target information further includes a third difference, which is a difference between the first predicted value and the second predicted value and the value corresponding to the first pixel region. For details on how to determine the third difference, please refer to subsequent embodiments.
[0090] Optionally, the first pixel region satisfies at least one of the following:
[0091] The first pixel region is the encoded or decoded pixel region consisting of M1 rows and N1 columns adjacent to the top edge of the first image block;
[0092] The first pixel region is the encoded or decoded pixel region consisting of M2 rows and N2 columns adjacent to the left of the first image block;
[0093] Where M1, M2, N1 and N2 are all positive integers.
[0094] In one optional implementation, the first pixel region is the encoded or decoded pixel region consisting of M1 rows and N1 columns adjacent to the top edge of the first image block. For easier understanding, please refer to [link to relevant documentation]. Figure 8 ,exist Figure 8 In the scenario shown, the first pixel region is the encoded or decoded pixel region consisting of 1 row and 8 columns adjacent to the top of the first image block.
[0095] Another alternative implementation is that the first pixel region is the encoded or decoded pixel region consisting of M2 rows and N2 columns adjacent to the left of the first image block. For clarity, please refer to [link to relevant documentation]. Figure 9 ,exist Figure 9 In the scene shown, the first pixel region is the encoded or decoded pixel region consisting of 8 rows and 1 column adjacent to the left of the first image block.
[0096] Another alternative implementation is that the first pixel region can be an encoded or decoded pixel region composed of some pixels adjacent to the top of the first image block and an encoded or decoded pixel region composed of some pixels adjacent to the left of the first image block. In this case, the first pixel region is "L" shaped.
[0097] In this embodiment, the aforementioned first pixel region can be a portion of the pixel region adjacent to the top of the first image block, a portion of the pixel region adjacent to the left of the first image block, or a portion of the pixel region adjacent to both the top and left of the first image block. This fully considers the motion differences between the first image block and the image blocks adjacent to it, improving the accuracy of the corrected boundary pixel prediction values.
[0098] Optionally, determining the target prediction value corresponding to each pixel in the second pixel region of the first image block based on the target information includes:
[0099] Determine the target weight value combination based on the target information;
[0100] Based on the target weight value combination, the third and fourth predicted values corresponding to each pixel in the second pixel region are weighted and summed to obtain the target predicted value corresponding to each pixel in the second pixel region.
[0101] The aforementioned target weight value combination includes at least one weight reassembly, which includes a first weight value and a second weight value. The first weight value corresponds to a third predicted value for each pixel in the second pixel region, and the second weight value corresponds to a fourth predicted value for each pixel in the second pixel region. The third predicted value is determined based on the first motion information, and the fourth predicted value is determined based on the second motion information.
[0102] Specifically, the motion information includes a prediction direction, reference frame information, and a motion vector. A first reference frame (either an encoded or decoded frame) can be determined based on the first prediction direction and the first reference frame information in the first motion information. The position pointed to by the first motion vector in the first reference frame is then determined, and the reconstructed value of the pixel corresponding to that position is determined as the third prediction value. Similarly, a second reference frame (either an encoded or decoded frame) can be determined based on the second prediction direction and the second reference frame information in the second motion information. The position pointed to by the second motion vector in the second reference frame is then determined, and the reconstructed value of the pixel corresponding to that position is determined as the fourth prediction value.
[0103] In this embodiment, after determining the target weight value combination, the third and fourth predicted values corresponding to each pixel in the second pixel region can be weighted and summed using the following formula to obtain the target predicted value corresponding to each pixel in the second pixel region:
[0104] shift = log2(w11 + w12)
[0105] offset = (w11 + w12) / 2
[0106] Pixel(i,j)=(w11×Pixel3(i,j)+w12×Pixel4(i,j)+offset)>>shift
[0107] In this context, Pixel represents the target predicted value, w11 represents the first weight value, w12 represents the second weight value, Pixel3 represents the third predicted value, and Pixel4 represents the fourth predicted value.
[0108] The following details how to determine the target weight value combination:
[0109] Optionally, determining the target weight value combination based on the target information includes:
[0110] If the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the first weight value combination;
[0111] If the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the second weight value combination, or the target weight value combination is determined based on the first difference and the second difference;
[0112] If the first difference is less than the second difference and the third difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0113] If the second difference is less than the third difference and the first difference, the fourth predicted value of each pixel in the second pixel region is determined as the target predicted value.
[0114] It should be understood that the combination of target weight values is related to the magnitude relationship between the first, second, and third differences.
[0115] In an optional embodiment, if the first difference is greater than the second difference and / or the third difference, that is, if the first difference is not the minimum value, the target weight value combination can be determined as a preset first weight value combination.
[0116] In an optional embodiment, if the third difference is less than the first difference and the second difference, that is, if the third difference is the minimum value, the target weight value combination can be determined as the preset second weight value combination.
[0117] It should be understood that this embodiment does not limit the size relationship between the weight values included in the first weight value combination and the weight values included in the second weight value combination.
[0118] When the first image block is a luminance block and the second pixel region comprises 4 rows with 8 pixels per row, the first weight value combination can be the same as the fifth weight value combination described below. When the first image block is a chroma block and the second pixel region comprises 1 row with 4 pixels per row, the first weight value combination can be the same as the sixth weight value combination described below.
[0119] It should be understood that the above examples of the first weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the first weight value combination.
[0120] When the first image block is a luminance block and the second pixel region comprises two rows of eight pixels each, the second weight value combination can be the same as the seventh weight value combination described below. When the first image block is a chroma block and the second pixel region comprises one row of four pixels each, the second weight value combination can be the same as the eighth weight value combination described below.
[0121] It should be understood that the above examples of the second weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the second weight value combination.
[0122] In an optional embodiment, if the first difference is less than the second difference and the third difference, that is, the first difference is the minimum value, it indicates that the motion pattern of the boundary pixel is more inclined to the first image block, and then the third predicted value of the boundary pixel is determined as the target predicted value.
[0123] In an optional embodiment, if the second difference is less than the first difference and the third difference, that is, the second difference is the minimum value, it indicates that the motion pattern of the boundary pixel is more inclined to the second image block, and then the fourth predicted value of the boundary pixel is determined as the target predicted value.
[0124] In this embodiment, different combinations of weight values are determined based on the magnitude relationship between the first difference, the second difference, and the third difference. The magnitude relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the weight value combination to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and the video encoding and decoding efficiency is improved.
[0125] Optionally, determining the target weight value combination based on the first difference and the second difference includes:
[0126] If the third difference is less than the first difference and the second difference, and the first difference is less than the second difference, then the target weight value combination is determined to be the third weight value combination.
[0127] If the third difference is less than the first difference and the second difference, and the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the fourth weight value combination.
[0128] In this embodiment, when the third difference is the minimum value, the target weight value combination can be further determined based on the magnitude between the first difference and the second difference.
[0129] In one optional implementation, when the third difference is less than the first difference and the second difference, and the first difference is less than the second difference, i.e. the third difference is the smallest and the second difference is the largest, the target weight value combination can be determined as the preset third weight value combination.
[0130] Another alternative implementation is that, if the third difference is less than the first difference and the second difference, and the first difference is greater than or equal to the second difference, the target weight value combination can be determined as a preset fourth weight value combination.
[0131] When the first image block is a luminance block and the second pixel region comprises two rows of eight pixels each, the third weight value combination can be the same as the twelfth weight value combination described below. When the first image block is a chroma block and the second pixel region comprises one row of four pixels each, the third weight value combination can be the same as the thirteenth weight value combination described below.
[0132] It should be understood that the above examples of the third weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the third weight value combination.
[0133] When the first image block is a luminance block and the second pixel region comprises two rows of eight pixels each, the fourth weight value combination can be the same as the fourteenth weight value combination described below. When the first image block is a chroma block and the second pixel region comprises one row of four pixels each, the fourth weight value combination can be the same as the fifteenth weight value combination described below.
[0134] It should be understood that the above examples of the fourth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the fourth weight value combination.
[0135] It should be understood that this embodiment does not limit the size relationship between the weight values included in the third weight value combination and the weight values included in the fourth weight value combination.
[0136] In this embodiment, different combinations of weight values are determined based on the magnitude relationship between the first difference, the second difference, and the third difference. The magnitude relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the weight value combination to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and the video encoding and decoding efficiency is improved.
[0137] Optionally, the target information further includes the type of the first image patch, and determining the target weight value combination based on the target information includes:
[0138] If the type of the first image block is a brightness block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the fifth weight value combination.
[0139] If the type of the first image block is a chroma block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the sixth weight value combination.
[0140] If the type of the first image block is a luminance block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the seventh weight value combination.
[0141] If the type of the first image block is a chroma block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the eighth weight value combination.
[0142] In this embodiment, different combinations of target weight values can also be set based on the type corresponding to the first image block.
[0143] In one optional implementation, if the type of the first image block is a luminance block and the first difference is not the minimum value, the target weight value combination is determined as a preset fifth weight value combination. Here, taking a video sequence image format of 4:2:0 as an example, the chroma block area is one-quarter of the luminance block area; taking the first image luminance block size of 8x8 as an example, the first image chroma block size is 4x4.
[0144] Taking the second pixel region located at the upper boundary of the first image block as an example; when the second pixel region of the first image brightness block includes 4 rows with 8 pixels in each row, the above-mentioned fifth weight value combination can be:
[0145] First row pixel weight values: w5 1,0 =26, w5 2,0 =6
[0146] Second row pixel weight values: w5 1,1 =7, w5 2,1 =1
[0147] Third row pixel weight values: w5 1,2 =15, w5 2,2 =1
[0148] Fourth row pixel weight values: w5 1,3 =31, w5 2,3 =1
[0149] It should be understood that the above examples of the fifth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the fifth weight value combination.
[0150] If the type of the first image block is a chroma block and the first difference is not the minimum value, the target weight value combination is determined as the preset sixth weight value combination.
[0151] For example, if the second pixel region of the first image chroma block comprises one row and that row comprises four pixels, the above-mentioned sixth weight value combination could be:
[0152] w6 1,0 =26, w6 2,0 =6
[0153] It should be understood that the above examples of the sixth weight value combination are only provided for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the sixth weight value combination.
[0154] It should be understood that the number of weight values in the weight value combination corresponding to the chroma block can be less than, or greater than or equal to, the number of weight values in the weight value combination corresponding to the luminance block; no specific limitation is made here. The weight values in the weight value combination corresponding to the chroma block can be some of the weight values in the weight value combination corresponding to the luminance block, or they can be other values; no specific limitation is made here.
[0155] Another alternative implementation is to determine the target weight value combination as a preset seventh weight value combination when the type of the first image block is a luminance block and the third difference is the minimum value.
[0156] For example, if the second pixel region of the first image brightness block comprises two rows of eight pixels each, the above-mentioned seventh weight value combination could be:
[0157] First row pixel weight values: w7 1,0 =15, w7 2,0 =1
[0158] Second row pixel weight values: w7 1,1 =31, w7 2,1 =1
[0159] It should be understood that the above examples of the seventh weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the seventh weight value combination.
[0160] If the type of the first image block is a chroma block and the third difference is the minimum value, the target weight value combination is determined as the preset eighth weight value combination.
[0161] For example, if the second pixel region of the first image chroma block comprises one row with four pixels, the above-mentioned eighth weight value combination could be:
[0162] w8 1,0 =31, w8 2,0 =1
[0163] It should be understood that the above examples of the eighth weight value combination are only for the purpose of elaborating on the technical solution, and there is no limitation on the values included in the eighth weight value combination.
[0164] In other embodiments, when the type of the first image block is a luminance block, the third difference is the minimum value, and the first difference is less than the second difference, the target weight value combination can be determined as the preset twelfth weight value combination.
[0165] For example, if the second pixel region of the first image brightness block comprises two rows, with each row containing eight pixels, the above-mentioned twelfth weight value combination could be:
[0166] First row pixel weight value: w12 1,0 =15, w12 2,0 =1
[0167] Second row pixel weight values: w12 1,1 =31, w12 2,1 =1
[0168] It should be understood that the above examples of the twelfth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the twelfth weight value combination.
[0169] If the first image block is a chroma block, the third difference is the minimum value, and the first difference is less than the second difference, the target weight value combination can be determined as the preset thirteenth weight value combination.
[0170] For example, if the second pixel region of the first image chroma block comprises one row and that row comprises four pixels, the above-mentioned thirteenth weight value combination could be:
[0171] w13 1,0 =31, w13 2,0 =1
[0172] It should be understood that the above examples of the thirteenth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the thirteenth weight value combination.
[0173] In other embodiments, when the type of the first image block is a luminance block, the third difference is the minimum value, and the first difference is greater than or equal to the second difference, the target weight value combination can be determined as the preset fourteenth weight value combination.
[0174] For example, if the second pixel region of the first image brightness block comprises two rows, with each row containing eight pixels, the above-mentioned fourteenth weight value combination could be:
[0175] First row pixel weight value: w14 1,0 =7, w14 2,0 =1
[0176] Second row pixel weight value: w14 1,1 =15, w14 2,1 =1
[0177] Third row pixel weight value: w14 2,1 =31, w14 2,2 =1
[0178] It should be understood that the above examples of the fourteenth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the fourteenth weight value combination.
[0179] If the first image block is a chroma block, the third difference is the minimum value, and the first difference is greater than or equal to the second difference, the target weight value combination can be determined as the preset fifteenth weight value combination.
[0180] For example, if the second pixel region of the first image chroma block comprises one row and that row comprises four pixels, the above-mentioned fifteenth weight value combination could be:
[0181] w15 1,0 =15, w15 2,0 =1
[0182] It should be understood that the above examples of the fifteenth weight value combination are only provided for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the fifteenth weight value combination.
[0183] In other embodiments, the target weight value combinations corresponding to different types of first image blocks can be the same, that is, the fifth weight value combination is the same as the sixth weight value combination, and the seventh weight value combination is the same as the eighth weight value combination.
[0184] In this embodiment, based on the size relationship between the first difference, the second difference, and the third difference, the above-mentioned size relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the weight value combination to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and thus the video encoding and decoding efficiency is improved.
[0185] The following details the technical solution for determining the third difference corresponding to each pixel in the first pixel region:
[0186] Optionally, the method further includes:
[0187] The first and second predicted values corresponding to each pixel in the first pixel region are weighted and summed to obtain the fifth predicted value for each pixel.
[0188] Based on the fifth predicted value of each pixel and the reconstructed value corresponding to each pixel, the third difference corresponding to the first pixel region is determined.
[0189] In this embodiment, for a pixel in the first pixel region, the first predicted value and the second predicted value of the pixel can be weighted and summed using the following formula to obtain the fifth predicted value of the pixel.
[0190] shift = log2(w11 + w12)
[0191] offset = (w11 + w12) / 2
[0192] Pixel5(i,j)=(w11×Pixel1(i,j)+w12×Pixel2(i,j)+offset)>>shift
[0193] Wherein, Pixel5 represents the fifth predicted value, w11 and w12 represent the weight combination, optionally, w11 is 26 and w12 is 6; Pixel1 represents the first predicted value and Pixel2 represents the second predicted value.
[0194] After calculating the fifth predicted value, the third difference corresponding to the first pixel region is determined based on the fifth predicted value and the reconstructed value for each pixel. For specific technical solutions, please refer to subsequent embodiments.
[0195] Optionally, determining the third difference corresponding to the first pixel region based on the fifth predicted value of each pixel and the reconstructed value corresponding to each pixel includes:
[0196] The sum of the absolute values of the target corresponding to each pixel in the first pixel region is determined as the third difference; or...
[0197] The average value of the target absolute value corresponding to each pixel in the first pixel region is determined as the third difference.
[0198] In this embodiment, one optional implementation is to calculate the absolute value of the difference between the fifth predicted value and the reconstructed value of any pixel in the first pixel region, and determine the absolute value as the target absolute value corresponding to the pixel; further, the sum of the target absolute values corresponding to each pixel is determined as the third difference corresponding to the first pixel region.
[0199] Another alternative implementation is to determine the average value of the target absolute value corresponding to each pixel as the third difference corresponding to the first pixel region.
[0200] In this embodiment of the application, the target weight value combination can also be determined based solely on the first difference and the second difference:
[0201] Optionally, determining the target weight value combination based on the target information includes:
[0202] If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0203] If the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the ninth weight value combination.
[0204] In this embodiment, if the first difference is less than the second difference, it means that the motion pattern of the boundary pixel is more similar to that of the first image block, and the third predicted value of the boundary pixel is determined as the target predicted value.
[0205] If the first difference is greater than or equal to the second difference, the target weight value combination can be determined as the preset ninth weight value combination.
[0206] Optionally, taking the case where the second pixel region is located at the upper boundary of the first image block and the first image block is a luminance block, and the second pixel region of the first image block includes 4 rows with 8 pixels in each row, the above-mentioned ninth weight value combination can be the same as the above-mentioned fifth weight value combination.
[0207] Optionally, taking the second pixel region located at the upper boundary of the first image block and the first image block being a chroma block as an example; when the second pixel region of the first image block includes one row and the row includes four pixels, the above-mentioned ninth weight value combination can be the same as the above-mentioned sixth weight value combination.
[0208] It should be understood that the above examples of the ninth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the ninth weight value combination.
[0209] In this embodiment, different combinations of weight values are determined based on the relationship between the first difference and the second difference. The relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the combination of weight values to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and the video encoding and decoding efficiency is improved.
[0210] Optionally, determining the target weight value combination based on the target information includes:
[0211] If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0212] If the first difference is greater than or equal to the second difference, the target weight value combination is determined based on the first difference and the second difference.
[0213] In this embodiment, if the first difference is less than the second difference, it means that the motion pattern of the boundary pixel is more similar to that of the first image block, and the third predicted value of the boundary pixel is determined as the target predicted value.
[0214] If the first difference is greater than or equal to the second difference, the target weight value combination can be determined based on the first difference and the second difference. For details on how to determine the target weight value combination based on the first difference and the second difference, please refer to subsequent embodiments.
[0215] In this embodiment, different combinations of weight values are determined based on the relationship between the first difference and the second difference. The relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the combination of weight values to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and the video encoding and decoding efficiency is improved.
[0216] Optionally, determining the target weight value combination based on the first difference and the second difference includes:
[0217] If the calculation result between the first difference and the second difference is less than or equal to the first threshold, the target weight value combination is determined to be the tenth weight value combination, and the first threshold is a non-negative number;
[0218] If the calculation result between the first difference and the second difference is greater than the first threshold, the target weight value combination is determined to be the eleventh weight value combination.
[0219] In this embodiment, the first difference and the second difference can be calculated according to a preset calculation formula to obtain a calculation result, which is also called a relational parameter, and is used to characterize the difference between the first difference and the second difference. In this embodiment, a first threshold is also preset, which is a non-negative number; optionally, the first threshold is 0. If the calculation result is less than or equal to the first threshold, the target weight value combination can be determined as a preset tenth weight value combination.
[0220] Optionally, taking the case where the second pixel region is located at the upper boundary of the first image block and the first image block is a luminance block, and the second pixel region of the first image block includes 4 rows with 8 pixels in each row, the above-mentioned tenth weight value combination can be the same as the above-mentioned fifth weight value combination.
[0221] Optionally, taking the case where the second pixel region is located at the upper boundary of the first image block, and the first image block is a chroma block; when the second pixel region of the first image block includes one row and that row includes four pixels, the above-mentioned tenth weight value combination can be:
[0222] w10 1,0 =7, w10 2,0 =1
[0223] It should be understood that the above examples of the tenth weight value combination are only for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the tenth weight value combination.
[0224] If the calculation result is greater than the first threshold, the target weight value combination can be determined as the preset eleventh weight value combination.
[0225] Optionally, taking the case where the second pixel region is located at the upper boundary of the first image block and the first image block is a luminance block, and the second pixel region of the first image block includes 4 rows with 8 pixels in each row, the above-mentioned eleventh weight value combination can be the same as the above-mentioned seventh weight value combination.
[0226] Optionally, taking the second pixel region located at the upper boundary of the first image block and the first image block being a chroma block as an example; when the second pixel region of the first image block includes one row and the row includes four pixels, the above-mentioned eleventh weight value combination can be the same as the above-mentioned eighth weight value combination.
[0227] It should be understood that the above examples of the eleventh weight value combination are only provided for the purpose of elaborating on the technical solution in detail, and there is no limitation on the values included in the eleventh weight value combination.
[0228] Optionally, determining the target weight value combination based on the target information includes:
[0229] If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0230] If the first difference equals the second difference, the target weight value combination is determined to be the ninth weight value combination;
[0231] If the first difference is greater than the second difference, the target weight value combination is determined based on the first difference and the second difference.
[0232] In this embodiment, if the first difference is less than the second difference, it means that the motion pattern of the boundary pixel is more similar to that of the first image block, and the third predicted value of the boundary pixel is determined as the target predicted value.
[0233] If the first difference equals the second difference, the target weight value combination can be determined as the preset ninth weight value combination. If the first difference is greater than the second difference, the target weight value combination can be determined based on the first difference and the second difference.
[0234] In this embodiment, different combinations of weight values are determined based on the relationship between the first difference and the second difference. The relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the combination of weight values to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and the video encoding and decoding efficiency is improved.
[0235] Optionally, determining the target weight value combination based on the first difference and the second difference includes:
[0236] If the calculation result between the first difference and the second difference is less than the second threshold, the target weight value combination is determined to be the tenth weight value combination;
[0237] If the calculation result between the first difference and the second difference is greater than or equal to the second threshold, the target weight value combination is determined to be the eleventh weight value combination.
[0238] In this embodiment, the first difference and the second difference can be calculated according to a preset calculation formula to obtain a calculation result, which is also called a relational parameter. This embodiment also presets a second threshold, which can be the same as the first threshold. If the calculation result is less than the second threshold, the target weight value combination can be determined to be a preset tenth weight value combination. As mentioned above, when the first image block is a luminance block, the tenth weight value combination can be the same as the fifth weight value combination.
[0239] If the calculation result is greater than or equal to the second threshold, the target weight value combination can be determined as the preset eleventh weight value combination. As mentioned above, when the first image block is a luminance block, the eleventh weight value combination can be the same as the seventh weight value combination; when the first image block is a chrominance block, the eleventh weight value combination can be the same as the eighth weight value combination.
[0240] Optionally, determining the target weight value combination based on the target information includes:
[0241] The first difference and the second difference are calculated according to the preset calculation formula to obtain the calculation result;
[0242] The target weight value combination is determined based on the calculation results.
[0243] In this embodiment, the first difference and the second difference can be calculated directly according to a preset calculation formula to obtain the calculation result. The calculation formula can be a subtraction operation or a division operation; that is, the calculation result can be the result of a subtraction operation between the first difference and the second difference, or the result of a division operation between the first difference and the second difference, or other types of calculation methods. This embodiment does not specifically limit the calculation.
[0244] After obtaining the calculation results, the target weight value combination is determined based on the calculation results.
[0245] In this embodiment, different combinations of weight values are determined based on the calculation results between the first difference and the second difference. The above-mentioned size relationship can reflect the motion difference between the first image block and the second image block. In this way, when using the weight value combination to correct the predicted value of the boundary pixel, the motion difference between the first image block and the second image block is fully considered, the accuracy of the corrected predicted value of the boundary pixel is improved, and the video encoding and decoding efficiency is improved.
[0246] Optionally, determining the target weight value combination based on the calculation result includes:
[0247] If the calculation result is less than or equal to the third threshold, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0248] If the calculation result is greater than or equal to the fourth threshold, the target weight value combination is determined to be the ninth weight value combination;
[0249] If the calculation result is greater than the third threshold and less than or equal to the fifth threshold, the target weight value combination is determined to be the tenth weight value combination.
[0250] If the calculation result is greater than the fifth threshold and less than the fourth threshold, the target weight value combination is determined to be the eleventh weight value combination.
[0251] In this embodiment, a third threshold, a fourth threshold, and a fifth threshold are preset. All three thresholds are non-negative numbers, and the third threshold is less than the fifth threshold, while the fifth threshold is less than the fourth threshold.
[0252] If the calculated result is less than or equal to the third threshold, the third predicted value of the boundary pixel is determined as the target predicted value.
[0253] If the calculation result is greater than or equal to the fourth threshold, the target weight value combination is determined as the preset ninth weight value combination. As described above, when the first image block is a luminance block, the above-mentioned ninth weight value combination can be the same as the above-mentioned fifth weight value combination; when the first image block is a chrominance block, the above-mentioned ninth weight value combination can be the same as the above-mentioned sixth weight value combination.
[0254] If the calculated result is greater than the third threshold and less than or equal to the fifth threshold, the target weight value combination is determined as the preset tenth weight value combination. As mentioned above, when the first image block is a luminance block, the aforementioned tenth weight value combination can be the same as the aforementioned fifth weight value combination.
[0255] If the calculated result is greater than the fifth threshold and less than the fourth threshold, the target weight value combination is determined as the preset eleventh weight value combination. As mentioned above, when the first image block is a luminance block, the eleventh weight value combination can be the same as the seventh weight value combination; when the first image block is a chrominance block, the eleventh weight value combination can be the same as the eighth weight value combination.
[0256] The inter-frame prediction method provided in this application can be executed by an inter-frame prediction device. This application uses an inter-frame prediction device executing the inter-frame prediction method as an example to illustrate the inter-frame prediction device provided in this application.
[0257] like Figure 10 As shown, the inter-frame prediction device 1000 includes:
[0258] The acquisition module 1001 is used to acquire the first motion information of the first image block and the second motion information of the second image block;
[0259] The first determining module 1002 is used to determine a first predicted value and a second predicted value corresponding to each pixel in the first pixel region associated with the first image block;
[0260] The second determining module 1004 is used to determine the target prediction value corresponding to each pixel in the second pixel region of the first image block based on the target information.
[0261] Optionally, the third determining module 1004 includes:
[0262] The determining unit is used to determine the target weight value combination based on the target information;
[0263] The processing unit is used to perform weighted summation on the third and fourth predicted values corresponding to each pixel in the second pixel region based on the target weight value combination, so as to obtain the target predicted value corresponding to each pixel in the second pixel region.
[0264] Optionally, the determining unit is specifically used for:
[0265] If the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the first weight value combination;
[0266] If the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the second weight value combination, or the target weight value combination is determined based on the first difference and the second difference;
[0267] If the first difference is less than the second difference and the third difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0268] If the second difference is less than the third difference and the first difference, the fourth predicted value of each pixel in the second pixel region is determined as the target predicted value.
[0269] Optionally, the determining unit is further specifically used for:
[0270] If the third difference is less than the first difference and the second difference, and the first difference is less than the second difference, then the target weight value combination is determined to be the third weight value combination.
[0271] If the third difference is less than the first difference and the second difference, and the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the fourth weight value combination.
[0272] Optionally, the determining unit is further specifically used for:
[0273] If the type of the first image block is a brightness block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the fifth weight value combination.
[0274] If the type of the first image block is a chroma block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the sixth weight value combination.
[0275] If the type of the first image block is a luminance block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the seventh weight value combination.
[0276] If the type of the first image block is a chroma block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the eighth weight value combination.
[0277] Optionally, the inter-frame prediction device 1000 further includes a third determining module, the third determining module being used for:
[0278] The first and second predicted values corresponding to each pixel in the first pixel region are weighted and summed to obtain the fifth predicted value for each pixel.
[0279] Based on the fifth predicted value of each pixel and the reconstructed value corresponding to each pixel, the third difference corresponding to the first pixel region is determined.
[0280] Optionally, the third determining module is further specifically used for:
[0281] The sum of the absolute values of the target corresponding to each pixel in the first pixel region is determined as the third difference; or...
[0282] The average value of the target absolute value corresponding to each pixel in the first pixel region is determined as the third difference.
[0283] Optionally, the determining unit is further specifically used for:
[0284] If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0285] If the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the ninth weight value combination.
[0286] Optionally, the determining unit is further specifically used for:
[0287] If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0288] If the first difference is greater than or equal to the second difference, the target weight value combination is determined based on the first difference and the second difference.
[0289] Optionally, the determining unit is further specifically used for:
[0290] If the calculation result between the first difference and the second difference is less than or equal to the first threshold, the target weight value combination is determined to be the tenth weight value combination;
[0291] If the calculation result between the first difference and the second difference is greater than the first threshold, the target weight value combination is determined to be the eleventh weight value combination.
[0292] Optionally, the determining unit is further specifically used for:
[0293] If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0294] If the first difference equals the second difference, the target weight value combination is determined to be the ninth weight value combination;
[0295] If the first difference is greater than the second difference, the target weight value combination is determined based on the first difference and the second difference.
[0296] Optionally, the determining unit is further specifically used for:
[0297] If the calculation result between the first difference and the second difference is less than the second threshold, the target weight value combination is determined to be the tenth weight value combination;
[0298] If the calculation result between the first difference and the second difference is greater than or equal to the second threshold, the target weight value combination is determined to be the eleventh weight value combination.
[0299] Optionally, the determining unit is further specifically used for:
[0300] The first difference and the second difference are calculated according to the preset calculation formula to obtain the calculation result;
[0301] The target weight value combination is determined based on the calculation results.
[0302] Optionally, the determining unit is further specifically used for:
[0303] If the calculation result is less than or equal to the third threshold, the third predicted value of each pixel in the second pixel region is determined as the target predicted value;
[0304] If the calculation result is greater than or equal to the fourth threshold, the target weight value combination is determined to be the ninth weight value combination;
[0305] If the calculation result is greater than the third threshold and less than or equal to the fifth threshold, the target weight value combination is determined to be the tenth weight value combination.
[0306] If the calculation result is greater than the fifth threshold and less than the fourth threshold, the target weight value combination is determined to be the eleventh weight value combination.
[0307] In this embodiment, a first predicted value and a second predicted value are determined. The first predicted value is determined based on the first motion information of a first image block, and the second predicted value is determined based on the second motion information of a second image block. Then, a target predicted value for the boundary pixel is determined based on target information. The target information includes a first difference and a second difference. The relationship between the first difference and the second difference can characterize the motion difference between the first image block and the second image block. This ensures that the motion difference between the first image block and the second image block is fully considered during the process of correcting the predicted value of the boundary pixel, improving the accuracy of the corrected predicted value of the boundary pixel, and thus improving video encoding and decoding efficiency.
[0308] The inter-frame prediction device provided in this application embodiment can achieve... Figure 3 The various processes implemented in the method embodiments achieve the same technical effect, and will not be described again here to avoid repetition.
[0309] The inter-frame prediction device in this application embodiment can be an electronic device, such as an electronic device with an operating system, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices besides a terminal. For example, the terminal can include, but is not limited to, the types of terminals listed above; other devices can be servers, network attached storage (NAS), etc., and this application embodiment does not specifically limit the scope of the device.
[0310] Optionally, such as Figure 11As shown, this application embodiment also provides a communication device 1100, including a processor 1101 and a memory 1102. The memory 1102 stores a program or instructions that can run on the processor 1101. For example, when the communication device 1100 is a terminal, when the program or instructions are executed by the processor 1101, they implement the various steps of the above-described inter-frame prediction method embodiment and can achieve the same technical effect.
[0311] This application embodiment also provides a terminal, including a processor and a communication interface, wherein the processor is used to perform the following operations:
[0312] Acquire the first motion information of the first image block and the second motion information of the second image block;
[0313] Determine a first predicted value and a second predicted value for each pixel in the first pixel region associated with the first image block;
[0314] Based on the target information, the target prediction value corresponding to each pixel in the second pixel region of the first image block is determined.
[0315] This terminal embodiment corresponds to the aforementioned terminal-side method embodiment. All implementation processes and methods of the aforementioned method embodiments can be applied to this terminal embodiment and achieve the same technical effect. Specifically, Figure 12 A schematic diagram of the hardware structure of a terminal to implement an embodiment of this application.
[0316] The terminal 1200 includes, but is not limited to, the following components: radio frequency unit 1201, network module 1202, audio output unit 1203, input unit 1204, sensor 1205, display unit 1206, user input unit 1207, interface unit 1208, memory 1209, and processor 1210.
[0317] Those skilled in the art will understand that the terminal 1200 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 1210 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 12 The terminal structure shown does not constitute a limitation on the terminal. The terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0318] It should be understood that, in this embodiment, the input unit 1204 may include a graphics processing unit (GPU) 12041 and a microphone 12042. The GPU 12041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 1206 may include a display panel 12061, which may be configured as a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1207 includes a touch panel 12071 and at least one of other input devices 12072. The touch panel 12071 is also called a touch screen. The touch panel 12071 may include a touch detection device and a touch controller. Other input devices 12072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0319] In this embodiment, after receiving downlink data from the network-side device, the radio frequency unit 1201 can transmit it to the processor 1210 for processing; the radio frequency unit 1201 can also send uplink data to the network-side device. Typically, the radio frequency unit 1201 includes, but is not limited to, antennas, amplifiers, transceivers, couplers, low-noise amplifiers, and duplexers.
[0320] The memory 1209 can be used to store software programs or instructions and various data. The memory 1209 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback function, image playback function, etc.). Furthermore, the memory 1209 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 1209 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0321] Processor 1210 may include one or more processing units; optionally, processor 1210 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 1210.
[0322] The processor 1210 is used to perform the following operations:
[0323] Acquire the first motion information of the first image block and the second motion information of the second image block;
[0324] Determine a first predicted value and a second predicted value for each pixel in the first pixel region associated with the first image block;
[0325] Based on the target information, the target prediction value corresponding to each pixel in the second pixel region of the first image block is determined.
[0326] In this embodiment, a first predicted value and a second predicted value are determined. The first predicted value is determined based on the first motion information of a first image block, and the second predicted value is determined based on the second motion information of a second image block. Then, a target predicted value for the boundary pixel is determined based on target information. The target information includes a first difference and a second difference. The relationship between the first difference and the second difference can characterize the motion difference between the first image block and the second image block. This ensures that the motion difference between the first image block and the second image block is fully considered during the process of correcting the predicted value of the boundary pixel, improving the accuracy of the corrected predicted value of the boundary pixel, and thus improving video encoding and decoding efficiency.
[0327] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described inter-frame prediction method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0328] The processor is the processor in the terminal described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0329] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described inter-frame prediction method embodiments and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0330] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0331] This application also provides a computer program / program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above-described inter-frame prediction method embodiments, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0332] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0333] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0334] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An inter-frame prediction method, characterized in that, The method includes: Acquire first motion information of a first image block and second motion information of a second image block, wherein the first image block and the second image block are adjacent; A first predicted value and a second predicted value are determined for each pixel in a first pixel region associated with the first image block; the first predicted value is determined based on the first motion information and the position information of the first pixel region, and the second predicted value is determined based on the second motion information and the position information of the first pixel region. Based on the target information, the target prediction value corresponding to each pixel in the second pixel region of the first image block is determined; the target information includes a first difference and a second difference, wherein the first difference is the difference determined based on the reconstructed value and the first prediction value of each pixel in the first pixel region, and the second difference is the difference determined based on the reconstructed value and the second prediction value of each pixel in the first pixel region; Wherein, the first image block is an image block to be encoded, and the second image block is an encoded image block; or, the first image block is an image block to be decoded, and the second image block is a decoded image block; Wherein, the first pixel region satisfies at least one of the following: The first pixel region is the encoded or decoded pixel region consisting of M1 rows and N1 columns adjacent to the top edge of the first image block; The first pixel region is the encoded or decoded pixel region consisting of M2 rows and N2 columns adjacent to the left of the first image block; Where M1, M2, N1 and N2 are all positive integers.
2. The method according to claim 1, characterized in that, The target information also includes a third difference, which is the difference between the first pixel region and the first predicted value, determined based on the first predicted value and the second predicted value.
3. The method according to claim 1 or 2, characterized in that, The step of determining the target prediction value corresponding to each pixel in the second pixel region of the first image block based on the target information includes: A target weight value combination is determined based on the target information; the target weight value combination includes at least one weight recombination, the weight recombination includes a first weight value and a second weight value, the first weight value corresponds to a third predicted value of each pixel in the second pixel region, the second weight value corresponds to a fourth predicted value of each pixel in the second pixel region, the third predicted value is determined based on the first motion information, and the fourth predicted value is determined based on the second motion information; Based on the target weight value combination, the third and fourth predicted values corresponding to each pixel in the second pixel region are weighted and summed to obtain the target predicted value corresponding to each pixel in the second pixel region.
4. The method according to claim 3, characterized in that, The step of determining the target weight value combination based on the target information includes any one of the following: If the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the first weight value combination; If the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the second weight value combination, or the target weight value combination is determined based on the first difference and the second difference; If the first difference is less than the second difference and the third difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the second difference is less than the third difference and the first difference, the fourth predicted value of each pixel in the second pixel region is determined as the target predicted value.
5. The method according to claim 4, characterized in that, Determining the target weight value combination based on the first difference and the second difference includes: If the third difference is less than the first difference and the second difference, and the first difference is less than the second difference, then the target weight value combination is determined to be the third weight value combination. If the third difference is less than the first difference and the second difference, and the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the fourth weight value combination.
6. The method according to claim 3, characterized in that, The target information also includes the type of the first image patch, and the step of determining the target weight value combination based on the target information includes any one of the following: If the type of the first image block is a brightness block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the fifth weight value combination. If the type of the first image block is a chroma block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the sixth weight value combination. If the type of the first image block is a luminance block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the seventh weight value combination. If the type of the first image block is a chroma block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the eighth weight value combination.
7. The method according to claim 2, characterized in that, The method further includes: The first and second predicted values corresponding to each pixel in the first pixel region are weighted and summed to obtain the fifth predicted value for each pixel. Based on the fifth predicted value of each pixel and the reconstructed value corresponding to each pixel, the third difference corresponding to the first pixel region is determined.
8. The method according to claim 7, characterized in that, The step of determining the third difference corresponding to the first pixel region based on the fifth predicted value of each pixel and the reconstructed value corresponding to each pixel includes: The sum of the target absolute values corresponding to each pixel in the first pixel region is determined as the third difference; the target absolute value is the absolute value of the difference between the fifth predicted value and the reconstructed value of each pixel in the first pixel region; or... The average value of the target absolute value corresponding to each pixel in the first pixel region is determined as the third difference.
9. The method according to claim 3, characterized in that, The step of determining the target weight value combination based on the target information includes: If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the ninth weight value combination.
10. The method according to claim 3, characterized in that, The step of determining the target weight value combination based on the target information includes: If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the first difference is greater than or equal to the second difference, the target weight value combination is determined based on the calculation result between the first difference and the second difference, and the calculation result is used to characterize the difference between the first difference and the second difference.
11. The method according to claim 10, characterized in that, The step of determining the target weight value combination based on the calculation result between the first difference and the second difference includes: If the calculation result between the first difference and the second difference is less than or equal to the first threshold, the target weight value combination is determined to be the tenth weight value combination, and the first threshold is a non-negative number; If the calculation result between the first difference and the second difference is greater than the first threshold, the target weight value combination is determined to be the eleventh weight value combination.
12. The method according to claim 3, characterized in that, The step of determining the target weight value combination based on the target information includes: If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the first difference equals the second difference, the target weight value combination is determined to be the ninth weight value combination; If the first difference is greater than the second difference, the target weight value combination is determined based on the calculation result between the first difference and the second difference, and the calculation result is used to characterize the difference between the first difference and the second difference.
13. The method according to claim 12, characterized in that, Determining the target weight value combination based on the first difference and the second difference includes: If the calculation result between the first difference and the second difference is less than the second threshold, the target weight value combination is determined to be the tenth weight value combination; If the calculation result between the first difference and the second difference is greater than or equal to the second threshold, the target weight value combination is determined to be the eleventh weight value combination.
14. The method according to claim 3, characterized in that, The step of determining the target weight value combination based on the target information includes: The first difference and the second difference are calculated to obtain a calculation result, which is used to characterize the difference between the first difference and the second difference; The target weight value combination is determined based on the calculation results.
15. The method according to claim 14, characterized in that, Determining the target weight value combination based on the calculation result includes: If the calculation result is less than or equal to the third threshold, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the calculation result is greater than or equal to the fourth threshold, the target weight value combination is determined to be the ninth weight value combination; If the calculation result is greater than the third threshold and less than or equal to the fifth threshold, the target weight value combination is determined to be the tenth weight value combination. If the calculation result is greater than the fifth threshold and less than the fourth threshold, the target weight value combination is determined to be the eleventh weight value combination. Wherein, the third threshold is less than the fifth threshold, and the fifth threshold is less than the fourth threshold.
16. An inter-frame prediction device, characterized in that, include: The acquisition module is used to acquire first motion information of a first image block and second motion information of a second image block, wherein the first image block and the second image block are adjacent to each other. The first determining module is used to determine a first predicted value and a second predicted value corresponding to each pixel in the first pixel region associated with the first image block; the first predicted value is determined based on the first motion information and the position information of the first pixel region, and the second predicted value is determined based on the second motion information and the position information of the first pixel region. The second determining module is used to determine the target prediction value corresponding to each pixel in the second pixel region of the first image block based on the target information. The target information includes a first difference and a second difference. The first difference is the difference determined based on the reconstructed value and the first predicted value of each pixel in the first pixel region. The second difference is the difference determined based on the reconstructed value and the second predicted value of each pixel in the first pixel region. Wherein, the first image block is an image block to be encoded, and the second image block is an encoded image block; or, the first image block is an image block to be decoded, and the second image block is a decoded image block; Wherein, the first pixel region satisfies at least one of the following: The first pixel region is the encoded or decoded pixel region consisting of M1 rows and N1 columns adjacent to the top edge of the first image block; The first pixel region is the encoded or decoded pixel region consisting of M2 rows and N2 columns adjacent to the left of the first image block; Where M1, M2, N1 and N2 are all positive integers.
17. The apparatus according to claim 16, characterized in that, The second determining module includes: A determining unit is configured to determine a target weight value combination based on the target information; the target weight value combination includes at least one weight recombination, the weight recombination includes a first weight value and a second weight value, the first weight value corresponds to a third predicted value of each pixel in the second pixel region, the second weight value corresponds to a fourth predicted value of each pixel in the second pixel region, the third predicted value is determined based on the first motion information, and the fourth predicted value is determined based on the second motion information; The processing unit is used to perform weighted summation on the third and fourth predicted values corresponding to each pixel in the second pixel region based on the target weight value combination, so as to obtain the target predicted value corresponding to each pixel in the second pixel region.
18. The apparatus according to claim 17, characterized in that, The determining unit is specifically used for any of the following: If the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the first weight value combination; If the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the second weight value combination, or the target weight value combination is determined based on the first difference and the second difference; If the first difference is less than the second difference and the third difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the second difference is less than the third difference and the first difference, the fourth predicted value of each pixel in the second pixel region is determined as the target predicted value.
19. The apparatus according to claim 18, characterized in that, The determining unit is further specifically used for: If the third difference is less than the first difference and the second difference, and the first difference is less than the second difference, then the target weight value combination is determined to be the third weight value combination. If the third difference is less than the first difference and the second difference, and the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the fourth weight value combination.
20. The apparatus according to claim 17, characterized in that, The target information also includes the type of the first image patch, and the determining unit is further specifically used for any one of the following: If the type of the first image block is a brightness block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the fifth weight value combination. If the type of the first image block is a chroma block, and the first difference is greater than the second difference and / or the third difference, the target weight value combination is determined to be the sixth weight value combination. If the type of the first image block is a luminance block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the seventh weight value combination. If the type of the first image block is a chroma block, and the third difference is less than the first difference and the second difference, the target weight value combination is determined to be the eighth weight value combination.
21. The apparatus according to claim 16, characterized in that, The device further includes a third determining module, the third determining module being used for: The first and second predicted values corresponding to each pixel in the first pixel region are weighted and summed to obtain the fifth predicted value for each pixel. Based on the fifth predicted value of each pixel and the reconstructed value corresponding to each pixel, the third difference corresponding to the first pixel region is determined.
22. The apparatus according to claim 21, characterized in that, The third determining module is further specifically used for: The sum of the target absolute values corresponding to each pixel in the first pixel region is determined as the third difference; the target absolute value is the absolute value of the difference between the fifth predicted value and the reconstructed value of each pixel in the first pixel region; or... The average value of the target absolute value corresponding to each pixel in the first pixel region is determined as the third difference.
23. The apparatus according to claim 17, characterized in that, The determining unit is further specifically used for: If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the first difference is greater than or equal to the second difference, the target weight value combination is determined to be the ninth weight value combination.
24. The apparatus according to claim 17, characterized in that, The determining unit is further specifically used for: If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the first difference is greater than or equal to the second difference, the target weight value combination is determined based on the calculation result between the first difference and the second difference, and the calculation result is used to characterize the difference between the first difference and the second difference.
25. The apparatus according to claim 24, characterized in that, The determining unit is further specifically used for: If the calculation result between the first difference and the second difference is less than or equal to the first threshold, the target weight value combination is determined to be the tenth weight value combination, and the first threshold is a non-negative number; If the calculation result between the first difference and the second difference is greater than the first threshold, the target weight value combination is determined to be the eleventh weight value combination.
26. The apparatus according to claim 17, characterized in that, The determining unit is further specifically used for: If the first difference is less than the second difference, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the first difference equals the second difference, the target weight value combination is determined to be the ninth weight value combination; If the first difference is greater than the second difference, the target weight value combination is determined based on the calculation result between the first difference and the second difference, and the calculation result is used to characterize the difference between the first difference and the second difference.
27. The apparatus according to claim 26, characterized in that, The determining unit is further specifically used for: If the calculation result between the first difference and the second difference is less than the second threshold, the target weight value combination is determined to be the tenth weight value combination; If the calculation result between the first difference and the second difference is greater than or equal to the second threshold, the target weight value combination is determined to be the eleventh weight value combination.
28. The apparatus according to claim 17, characterized in that, The determining unit is further specifically used for: The first difference and the second difference are calculated according to the preset calculation formula to obtain the calculation result; The target weight value combination is determined based on the calculation results.
29. The apparatus according to claim 28, characterized in that, The determining unit is further specifically used for: If the calculation result is less than or equal to the third threshold, the third predicted value of each pixel in the second pixel region is determined as the target predicted value; If the calculation result is greater than or equal to the fourth threshold, the target weight value combination is determined to be the ninth weight value combination; If the calculation result is greater than the third threshold and less than or equal to the fifth threshold, the target weight value combination is determined to be the tenth weight value combination. If the calculation result is greater than the fifth threshold and less than the fourth threshold, the target weight value combination is determined to be the eleventh weight value combination. Wherein, the third threshold is less than the fifth threshold, and the fifth threshold is less than the fourth threshold.
30. A terminal, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the inter-frame prediction method as described in any one of claims 1-15.
31. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the inter-frame prediction method as described in any one of claims 1-15.