Inter-frame prediction value construction method for decoder or encoder

By decomposing the encoding blocks and adjusting the prediction weight in video encoding technology, the accuracy of the inter-frame prediction value is improved, and the inefficiency problem in the inter-frame joint prediction mode is solved, and the video encoding efficiency is improved.

CN119031127APending Publication Date: 2024-11-26XIDIAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310596103.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-24
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

In the existing video encoding technology, the prediction value construction accuracy in the inter-intra-intra-joint prediction mode is not high, resulting in low video encoding efficiency.

Method used

By obtaining the intra/inter prediction encoding mode information of the current coded block, the intra and inter prediction values ​​are obtained based on the prediction mode and parameter information, and the coded block is divided into multiple sub-block areas, and the intra and inter prediction are calculated respectively. Weights, weighted using template matching cost or template matching optimal filter design method, adjust the weights to improve prediction accuracy.

Benefits of technology

The accuracy of inter-frame prediction values ​​and video encoding efficiency are improved, and the BD-rate encoding gain of -0.01 to -0.12% compared with the most advanced video encoding software model ECM8.0 is achieved under different test sequences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119031127A_ABST
    Figure CN119031127A_ABST
Patent Text Reader

Abstract

The invention discloses an inter-frame prediction value construction method for a decoder or an encoder, which comprises the following steps of: obtaining intra-frame / inter-frame prediction coding mode information of a current coding block, and obtaining an intra-frame prediction value and an inter-frame prediction value according to the prediction mode information and corresponding parameter information; and when the intra-frame prediction coding mode of the weighted weight is a direction mode, dividing the current coding block into a plurality of sub-block regions, respectively obtaining intra-frame prediction weights and inter-frame prediction weights for different sub-block regions, and weighting each sub-block region under different weights to determine a prediction sampling value, and the sub-block areas are rectangular, triangular and / or L-shaped. According to the invention, improvement is carried out on a weight setting rule in which the spatial distance between adjacent intra-frame prediction pixels of various directivity angles and pixels in a current coding block is inversely proportional to the correlation, and intra-frame and inter-frame prediction weights in the CIIP technology are refined, so that the prediction accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video coding, and in particular relates to a method for constructing an inter-frame prediction value for a decoder or an encoder. Background Art

[0002] The current H.266 (next generation video coding standard) / VVC (Versatile Video Coding) standard and the next generation video coding standard model ECM under research are similar to previous international video coding standards and still use a hybrid coding framework, such as Figure 1 and Figure 2 As shown, it includes modules such as transformation, quantization, entropy coding, intra-frame prediction, inter-frame prediction and loop filtering.

[0003] The technology in the current mainstream coding standards adopts a coding unit division structure based on Coding Tree Unit (CTU) and Coding Tree Block (CTB). The image to be encoded is divided into square CTUs of equal size. A CTU consists of a luminance CTB and two chrominance CTBs. Video encoding is based on CTUs and all CTUs are traversed in order. Quadtrees, binary trees, and ternary trees are used to recursively divide CTUs into coding units (CUs) of different sizes. CU is the basic unit of video encoding.

[0004] When encoding each CU, first remove the spatial and temporal correlation of the image through intra-frame prediction or inter-frame prediction, then directly entropy encode the prediction difference, or send it to the transform module to generate transform coefficients with more concentrated energy; then send the transform coefficients to the quantization module to achieve many-to-one mapping; then send it to the entropy coding module to output the bitstream. The signal obtained after inverse quantization, inverse transformation and summing with the prediction value is the reconstructed signal, which can be directly used as a reference for intra-frame prediction; the reconstructed signal is sent to the decoded image cache after loop filtering for subsequent inter-frame prediction reference.

[0005] When decoding each CU, the bitstream is first parsed, and multiple syntax elements are obtained through entropy coding. The residual information is dequantized and inversely transformed, added to the prediction signal, and the corresponding reconstructed signal is obtained after loop filtering. The filtered reconstructed signal is sent to the decoded image cache as a reference for subsequent inter-frame prediction.

[0006] In current technology, when performing intra-frame or inter-frame prediction on a CU, a variety of different prediction modes can be used. In the intra-frame prediction coding mode, a direct current prediction mode, a gradient plane prediction mode, an angle prediction mode, or an intra-frame block copy prediction mode can be used; in the inter-frame prediction coding mode, a unidirectional inter-frame motion prediction, a bidirectional inter-frame motion prediction, a geometric partition inter-frame prediction, or an inter-frame and intra-frame joint prediction can be used.

[0007] Combined Inter and Intra Prediction (CIIP) is a prediction mode that combines inter-frame and intra-frame, or different intra-frame prediction coding modes. In the prior art, there are two methods for deriving prediction values ​​in the CIIP mode, one is a fixed weight and the other is a sub-block-based weight. However, both weight setting schemes are relatively rough, and the corresponding prediction value construction accuracy is not high, so the video coding efficiency is not high. Summary of the invention

[0008] In order to solve the above problems existing in the prior art, the present invention provides a method for constructing an inter-frame prediction value for a decoder or an encoder. The technical problem to be solved by the present invention is achieved by the following technical solution:

[0009] The present invention provides a method for constructing an inter-frame prediction value for a decoder or an encoder, comprising:

[0010] Obtaining intra / inter prediction coding mode information of the current coding block, and obtaining intra prediction values ​​and inter prediction values ​​according to the prediction mode information and corresponding parameter information;

[0011] When the weighted weight is a directional mode in the intra-frame prediction coding mode, the current coding block is divided into multiple sub-block areas, and the intra-frame prediction weights and inter-frame prediction weights are obtained for different sub-block areas respectively. The predicted sampling value is determined by weighting each sub-block area under the corresponding weight, wherein the sub-block area is rectangular, triangular and / or L-shaped.

[0012] In one embodiment of the present invention, obtaining intra / inter prediction coding mode information of a current coding block, and obtaining an intra prediction value and an inter prediction value according to the prediction mode information and corresponding parameter information, includes:

[0013] When the prediction mode of the current coding block is an inter-frame and intra-frame joint prediction mode, obtaining parameter information corresponding to the intra-frame prediction coding mode, wherein when the intra-frame prediction coding mode adopts an angle intra-frame prediction mode, the angle intra-frame prediction mode is derived by a template-based intra-frame mode derivation method or a decoding-end intra-frame mode derivation method, wherein the decoding-end intra-frame mode derivation method uses reconstructed pixels of a template area adjacent to the current coding block to derive an intra-frame angle mode;

[0014] According to the inter-frame and intra-frame joint prediction mode and corresponding parameter information, a prediction signal under the inter-frame and intra-frame joint prediction mode is obtained.

[0015] In one embodiment of the present invention, obtaining intra-frame prediction weights and inter-frame prediction weights for different sub-block regions respectively includes:

[0016] Using the template matching cost or the template matching optimal filter design method, consistent weights are selected for different sub-block areas of the current coding block; or different weights are obtained for different sub-block areas according to the directionality of the intra-frame prediction mode.

[0017] In one embodiment of the present invention, selecting consistent weights for different sub-block regions of the current coding block includes:

[0018] For the template of the current coding block, calculate the inter-frame template matching cost and the intra-frame template matching cost respectively;

[0019] The intra-frame prediction weight and the inter-frame prediction weight of the current coding block are obtained by using the inter-frame template matching cost and the intra-frame template matching cost.

[0020] In one embodiment of the present invention, different weights are obtained for different sub-block regions according to the directionality of the intra-frame prediction mode, including:

[0021] The weights of different sub-block areas are obtained according to the correspondence between the preset angle mode serial numbers and the weights.

[0022] In one embodiment of the present invention, different weights are obtained for different sub-block regions according to the directionality of the intra-frame prediction mode, including:

[0023] Setting initial weights, or obtaining initial weights using template matching cost or template matching optimal filter design method;

[0024] The intra-frame prediction weight and inter-frame prediction weight corresponding to each sub-block area are adjusted around the initial weight.

[0025] In one embodiment of the present invention, adjusting the intra-frame prediction weight and the inter-frame prediction weight corresponding to each sub-block region around the initial weight includes:

[0026] Based on the initial weights, the intra-frame prediction weights corresponding to each sub-block area are adjusted, wherein the intra-frame prediction weights corresponding to each sub-block area are adjusted, including: increasing or decreasing the intra-frame prediction weights corresponding to each sub-block area one by one in sequence, wherein the parameters used for increasing or decreasing the intra-frame prediction weights one by one in sequence are predefined parameters or are determined according to the coding block size, the sub-region size or the number of sub-regions.

[0027] In one embodiment of the present invention, adjusting the intra-frame prediction weight and the inter-frame prediction weight corresponding to each sub-block region around the initial weight includes:

[0028] The adjustment parameters are used to increase or decrease the intra-frame prediction weights corresponding to some or all sub-block regions as a whole.

[0029] In one embodiment of the present invention, the intra-frame prediction weights corresponding to some or all sub-block regions are overall increased or decreased by adjusting the parameters, including:

[0030] The intra-frame prediction weights and / or inter-frame prediction weights corresponding to part or all of the sub-block regions are adaptively adjusted according to the corresponding information of spatially adjacent or neighboring pixels of the current coding block.

[0031] In one embodiment of the present invention, the intra-frame prediction weights corresponding to some or all sub-block regions are overall increased or decreased by adjusting the parameters, including:

[0032] The intra-frame prediction weights and / or inter-frame prediction weights corresponding to part or all of the sub-block regions are adaptively adjusted according to the coding mode of the surrounding reference pixels of the current coding block.

[0033] Compared with the prior art, the present invention has the following beneficial effects:

[0034] 1. The present invention discloses a method for constructing inter-frame prediction values ​​for a decoder or encoder, improves the weight setting rule that the spatial distance between neighboring intra-frame prediction pixels at various directional angles and pixels in the current coding block is inversely proportional to the correlation, refines the intra-frame and inter-frame prediction weights in the CIIP technology, thereby improving the prediction accuracy. The method is used in a video decoder or encoder to effectively improve the video coding efficiency.

[0035] 2. Under common test conditions (CTC) and random access (RA) configuration, the inter-frame prediction value construction method of the present invention can obtain BD-rate coding gains ranging from -0.01% to -0.12% for different test sequences relative to the most advanced video coding software model ECM8.0.

[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 is a video encoder block diagram;

[0038] Figure 2 is a video decoder block diagram;

[0039] Figure 3 It is a flowchart of a method for constructing an inter-frame prediction value for a decoder or an encoder provided by an embodiment of the present invention;

[0040] Figure 4 is a flow chart of obtaining an intra-frame / inter-frame prediction signal provided by an embodiment of the present invention;

[0041] Figure 5 It is a schematic diagram of reference direction of an angle intra-frame prediction coding mode provided by an embodiment of the present invention;

[0042] Figure 6 is a schematic diagram of various templates provided by an embodiment of the present invention;

[0043] Figure 7 It is a schematic diagram of a Sobel operator filter template calculation area provided by an embodiment of the present invention;

[0044] Figure 8 It is a schematic diagram of a flow chart of weighting different sub-block areas according to an intra-frame prediction coding mode provided by an embodiment of the present invention;

[0045] Fig. 9 This is a schematic diagram of derivation of CIIP coding weights in H.266 / VVC provided by an embodiment of the present invention;

[0046] Fig.10 is a schematic diagram of an angle mode segmentation method provided by an embodiment of the present invention;

[0047] Fig.11 is a schematic diagram of another angle mode segmentation method provided by an embodiment of the present invention;

[0048] Fig.12 is a schematic diagram of another angle mode segmentation method provided by an embodiment of the present invention;

[0049] Fig.13 The present invention provides an adaptive weight reference pixel position diagram. DETAILED DESCRIPTION

[0050] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined purpose of the invention, the inter-frame prediction value construction method for a decoder or encoder proposed in accordance with the present invention is described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0051] The above and other technical contents, features and effects of the present invention are clearly presented in the following detailed description of the specific implementation modes in conjunction with the accompanying drawings. Through the description of the specific implementation modes, the technical means and effects adopted by the present invention to achieve the predetermined purpose can be more deeply and specifically understood. However, the attached drawings are only for reference and explanation purposes and are not used to limit the technical solutions of the present invention.

[0052] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants are intended to cover non-exclusive inclusion, so that an article or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed. In the absence of more restrictions, the elements defined by the statement "including one..." do not exclude the existence of other identical elements in the article or device including the elements.

[0053] See also Figure 3 , Figure 3 1 is a flowchart of a method for constructing an inter-frame prediction value for a decoder or encoder provided by an embodiment of the present invention. The method for constructing an inter-frame prediction value includes:

[0054] S1: Obtain intra / inter prediction coding mode information of a current coding block, and obtain intra prediction values ​​and inter prediction values ​​according to the prediction mode information and corresponding parameter information.

[0055] At the decoding end, the bit stream is first parsed to obtain the intra-frame / inter-frame prediction coding mode information and corresponding parameters of the current coding block, and then the corresponding prediction value construction process is implemented according to the obtained mode information and corresponding parameters; at the encoding end, the intra-frame / inter-frame prediction coding mode information and corresponding parameters of the current coding block are first determined in the mode selection process, and then the corresponding prediction value construction process is implemented according to the mode information and corresponding parameters.

[0056] In this embodiment, if the prediction mode of the current coding block is an inter-frame and intra-frame joint prediction mode, parameter information corresponding to the intra-frame prediction coding mode is obtained, wherein when the intra-frame prediction coding mode adopts an angle intra-frame prediction mode, the angle intra-frame prediction mode is derived by a template-based intra-frame mode derivation method or a decoding-end intra-frame mode derivation method, wherein the decoding-end intra-frame mode derivation method uses reconstructed pixels of a template area adjacent to the current coding block to derive an intra-frame angle mode, and then obtains a prediction signal under the inter-frame and intra-frame joint prediction mode according to the inter-frame and intra-frame joint prediction mode and the corresponding parameter information.

[0057] Specifically, see Figure 4 , Figure 4 A flowchart of obtaining an intra-frame / inter-frame prediction signal provided by an embodiment of the present invention specifically includes the following steps:

[0058] S101: Obtaining intra / inter prediction coding mode information of a current coding block;

[0059] S102: determining whether the prediction mode of the current coding block is an inter-frame prediction coding mode or an intra-frame block copy prediction mode, if it is an inter-frame prediction coding mode, executing step S105, if it is an intra-frame prediction coding mode, executing step S103;

[0060] S103: Obtain parameter information corresponding to the intra-frame prediction coding mode;

[0061] S104: acquiring an intra-frame prediction signal through operations such as copying and / or filtering according to the intra-frame prediction coding mode and corresponding parameter information;

[0062] S105: Obtain parameter information corresponding to the inter-frame prediction coding mode;

[0063] S106: acquiring an inter-frame prediction signal through operations such as motion compensation according to the inter-frame prediction coding mode and corresponding parameter information;

[0064] S107: Determine whether it is an inter-frame and intra-frame joint prediction mode, if so, execute step S108;

[0065] S108: Obtain parameter information corresponding to the intra-frame prediction coding mode;

[0066] S109: According to the inter-frame and intra-frame joint prediction mode and corresponding parameter information, a prediction signal under the inter-frame and intra-frame joint prediction mode is obtained through operations such as interpolation and / or copying.

[0067] The corresponding inter-frame prediction coding mode and prediction signal in steps S105 and S106 may come from the common inter-frame merge mode or CIIP TM mode. The corresponding intra-frame prediction coding mode and prediction signal in steps S103 and S104 may come from the IBC mode, IntraTMP mode, etc. The corresponding intra-frame prediction coding mode and prediction signal in steps S108 and S109 may use the angle intra-frame prediction coding mode. Figure 5 , Figure 5 It is a schematic diagram of reference directions of an angle intra-frame prediction coding mode provided by an embodiment of the present invention.

[0068] In other embodiments of the present invention, the corresponding intra-frame prediction coding mode and prediction signal in steps S108 and S109 can also be obtained by using a direct current (DC) mode, a progressive plane (Planar) mode, or by performing a position dependent intra prediction combination (PDPC) process after an angle mode. These angle modes, DC modes or Planar modes can be specified, obtained from a bitstream, or derived by a template-based intra mode derivation (TIMD) method or a decoder-side Intra Mode Derivation (DIMD) method. It is worth noting that the IBC mode or IntraTMP mode is actually an intra-frame prediction coding mode, but in CIIP, they correspond to the inter-frame part; the angle mode or Planar mode corresponds to the intra-frame part in the CIIP name.

[0069] Furthermore, the method of TIMD mode is: firstly establish the most likely mode list (MPMlist) for each coding block, and then detect the difference between the predicted value and the reconstructed value of each item in the MPM list, such as SATD (Sum of Absolute Transformed Difference). The modes in the MPM list are compared or sorted according to the SATD size of the template, and the smallest SATD value is selected and mapped to one of the 67 conventional intra-frame prediction coding modes.

[0070] The merge mode refers to a candidate list constructed through spatial and temporal waiting options, in which each candidate can be reordered by the matching cost of the template.

[0071] CIIP TM mode refers to performing local search refinement based on template matching on the candidate items in the merge mode list, and taking the refined MV (Motion Vector) as the candidate. There can be more than one candidate, and multiple candidates can be constructed into a candidate list.

[0072] There are many types of templates, including but not limited to Figure 6They can be effective at the same time, selected by the syntax element, or used alone (for example, only type (a) is used), and can also be divided into multiple regions and used flexibly in combination or alone, as shown in (h). The size of the template is related to the size of the coding block. For example, the width of the upper template is usually related to the width of the current coding block, and the height of the left template is usually related to the height of the current coding block. The height of the upper template and the width of the left template can be fixed values, such as 1, 3, 4, etc., or can be adaptively taken as values ​​related to the coding block size or calculation purpose:

[0073] The preset template matching cost function can be absolute error and SAD, absolute transformation difference and SATD, mean square error MSE, error square sum SSD, mean absolute difference MAD, mean error square sum MSD, normalized correlation coefficient NCC, etc.

[0074] For example, the absolute error and SAD cost functions are:

[0075]

[0076] Among them, T i is the template in the search process, M represents the number of pixels in the template, T i,m Represents the pixel sampling value in the search template, T m Represents the pixel sample value in the current coding block template.

[0077] The SATD cost function is to perform Hadamard transformation on the residual signal (the difference between the predicted signal and the reconstructed signal) and then calculate the sum of the absolute values ​​of each element.

[0078] The above cost functions are all calculated directly based on the template pixel values.

[0079] Furthermore, the method of the DIMD mode is: using the reconstructed pixels of the template area adjacent to the current coding block to derive the intra-frame angle mode.

[0080] For example, using Figure 7 The pixels at the center of the 3x3 horizontal Sobel filter and vertical Sobel filter template (i.e., yellow pixels) are used to calculate the horizontal gradient G x And the vertical gradient Gy:

[0081]

[0082]

[0083] Among them, A represents the 3x3 pixel matrix used to calculate the gradient in the template.

[0084] Then, the angle of the corresponding pixel can be calculated by arctan(Gy / Gx) and converted into one of the 65 angle modes IPM in VVC. Then, the sum of the absolute values ​​of Gx and Gy is calculated as the cumulative amplitude value G of the angle.

[0085] G=|G x |+|G y |

[0086] Orient=G x / G y

[0087] Among them, Orient represents the direction of the gradient.

[0088] Finally, the above process is repeated for all pixels in the center of the template area to obtain the intra-frame angle mode gradient histogram. In the gradient histogram, the higher the amplitude value corresponding to the angle, the more likely the prediction direction of the current coding block is related to the angle.

[0089] In one embodiment of the present invention, the inter-frame prediction value P is obtained by using the Merge mode in the inter-frame prediction. inter , and obtain the intra-frame prediction value P through the Planar mode in intra-frame prediction intra ;

[0090] When deriving the prediction value in CIIP mode, the inter-frame prediction value P is first obtained through the Merge mode in inter-frame prediction. inter , and obtain the intra-frame prediction value P through the Planar mode in intra-frame prediction intra , and then weighted to get the predicted value of CIIP mode:

[0091] P CIIP =[w inter ×P inter +w intra ×P intra +1<<(shift1-1)]>>shift1

[0092] Among them, P CIIP represents the weighted prediction value obtained under CIIP mode, P inter represents the inter-frame prediction value, w inter Represents the weight of the inter-frame prediction value, P intra represents the intra-frame prediction value, w intra represents the weight of the intra-frame prediction value, w inter +w intra =1<<shift1, shift1 is the parameter corresponding to the process data amplification to improve the accuracy under fixed-point operation conditions. inter and w intraIt is derived through information of neighboring blocks of the current coding block and / or the position of the current pixel within the current coding block.

[0093] S2: When the weighted weight is a directional mode in the intra-frame prediction coding mode, the current coding block is divided into multiple sub-block areas, and the intra-frame prediction weight and the inter-frame prediction weight are obtained for different sub-block areas respectively. The predicted sampling value is determined by weighting each sub-block area under the corresponding weight, wherein the sub-block area is rectangular, triangular and / or L-shaped.

[0094] In this embodiment, the weighted values ​​generate different schemes according to different intra-frame prediction coding modes, such as Figure 8 S2 specifically includes the following steps:

[0095] S201: Obtaining intra-frame prediction coding mode;

[0096] S202: Determine whether the intra-frame prediction coding mode is an angle mode, if yes, execute step S205, if no, execute step S203;

[0097] S203: Determine an intra-frame prediction weight and an inter-frame prediction weight that are consistent with the entire coding block corresponding to the intra-frame prediction coding mode;

[0098] S204: Determine a prediction sampling value by weighting according to the intra-frame prediction weight and the inter-frame prediction weight;

[0099] S205: Determine a weighted sub-block segmentation mode to obtain multiple sub-block regions;

[0100] S206: Determine an intra-frame prediction weight and an inter-frame prediction weight corresponding to each sub-block region;

[0101] S207: Determine a predicted sampling value by weighting each sub-block region under different weights.

[0102] Specifically, when the intra-frame prediction coding mode is a non-directional mode (such as a DC prediction (DC) or a planar prediction (Planar) mode), corresponding to Figure 8 The N branches of the S202 module (ie, step S203 and step S204) can determine the consistent intra-frame prediction weights (weighted weights) of the entire coding block, and then perform weighted prediction based on them.

[0103] In one embodiment of the present invention, the execution process of step S203 and step S204 is consistent with the existing H.266 / VVC solution, which is as follows:

[0104] S203: Obtaining the inter-frame prediction value P through the Merge mode in the inter-frame prediction inter , and obtain the intra-frame prediction value P through the intra-frame prediction Planar modeintra , derived from the coding modes of the adjacent CUs above and to the left of the current CU, such as Fig. 9 As shown:

[0105] (1) If both coding blocks are available and intra-coded, the weight w t Equals 3.

[0106] (2) If there is only one intra-coded block available, the weight w t Equals 2.

[0107] (3) If (1) and (2) are not satisfied, the weight w t Equal to 1.

[0108] S204: Weighted to obtain the predicted value of the CIIP model:

[0109] P CIIP =[(4-w t )×P inter +w t ×P intra +2]>>2.

[0110] In another embodiment of the present invention, obtaining intra-frame prediction weights and inter-frame prediction weights for different sub-block regions respectively includes:

[0111] The template matching cost or the template matching optimal filter design method is used to select consistent weights for different sub-block areas of the current coding block.

[0112] Specifically, the execution process of step S203 and step S204 may also be as follows:

[0113] S203': Use the template of the current coding block to derive weights. For example, Figure 6 The templates in (a) or (i) calculate the inter-frame template matching cost costModeInter and the intra-frame template matching cost costModeIntra respectively. When calculating the inter-frame template matching cost costModeInter, the Inter mode in the acquired CIIP is used to predict and derive the template pixels, and then the difference between the template prediction value and the template reconstruction value is calculated. When calculating the intra-frame template matching cost costModeIntra, the Intra mode in the acquired CIIP is used to predict and derive the template pixels, and then the difference between the prediction value and the template reconstruction value is calculated.

[0114] The intra prediction weight and inter prediction weight of the current coding block are obtained by using the inter-frame template matching cost costModeInter and the intra-frame template matching cost costModeIntra, which are:

[0115]

[0116]

[0117] S204': Calculate the CIIP prediction value:

[0118] P CIIP =[w inter ×P inter +w intra ×P intra +1<<(shift1-1)]>>shift1.

[0119] Further, when the intra-frame prediction coding mode is a directional mode, corresponding to Figure 8 The Y branch of the S202 module (i.e., steps S205, S206, and S207) can determine the sub-block division of the current coding block and the weights corresponding to each sub-block according to the directional characteristics of the current mode, and then implement CIIP weighted prediction based on the sub-block division and the different weights of the sub-blocks.

[0120] In one embodiment of the present invention, step S205 specifically includes:

[0121] The weighted value is used when the intra-frame prediction coding mode is a directional mode, such as Figure 5 In the near horizontal prediction mode (2 <= angular mode index < 28), the current coding block will be vertically split to obtain multiple sub-blocks, such as Fig.10 (a) As shown; for the near vertical prediction mode (40 <= angular mode index <= 66), the current coding block will be horizontally split to obtain multiple sub-blocks, such as Fig.10 (b) As shown; for the near diagonal mode (29 <= angular modeindex < 39), the current coding block will be L-shaped segmented to obtain multiple sub-blocks, such as Fig.10 (c) as shown.

[0122] In another embodiment of the present invention, step S205 specifically includes:

[0123] When the intra-frame prediction coding mode is a directional mode, for the lower left diagonal mode (2 <= angular mode index <= 7), the current coding block will be fan-shaped divided to obtain multiple sub-blocks, such as Fig.10 (d) As shown; for the near horizontal prediction mode (8 <= angular mode index < 28), the current coding block will be vertically split to obtain multiple sub-blocks, such as Fig.10(a) As shown; for the near upper left diagonal mode (28 <= angular mode index <= 39), the current coding block is L-split to obtain multiple sub-blocks, such as Fig.10 (c) As shown; for the near vertical prediction mode (40 <= angular mode index <= 60), the current coding block will be horizontally split to obtain multiple sub-blocks, such as Fig.10 (b) As shown; for the upper right diagonal mode (61 <= angular mode index <= 66), the current coding block will be fan-shaped divided to obtain multiple sub-blocks, such as Fig.10 (e) as shown.

[0124] Among them, the corresponding coordinate calculation formula for sector segmentation is:

[0125] for Fig.10 (d) Yes, in area 0, y>=2*x*blockH / blockW;

[0126] In area 1, y>=x*blockH / blockW and y<2*x*blockH / blockW;

[0127] In area 2, y>=x*blockH / blockW / 2 and y <x*blockH / blockW;

[0128] In area 3, y <x*blockH / blockW / 2。

[0129] Among them, x represents the horizontal coordinate of the pixel point in the block, y represents the vertical coordinate of the pixel point in the block, blockH represents the height of the coding block, and blockW represents the width of the coding block.

[0130] right Fig.10 (e), region 0 corresponds to Fig.10 (d) Area 3, corresponding to Area 1 Fig.10 (d) Area 2, corresponding to Fig.10 (d) Area 1, corresponding to Area 3 Fig.10 (d) Area 0.

[0131] In another embodiment of the present invention, for the lower left or upper right diagonal mode, the sub-block area can also be divided in the following manner: Fig.10 (d) is replaced by Fig.11 (a) There are:

[0132] In area 0, y>=2*x*blockH / blockW;

[0133] In area 1, y>=x*blockH / blockW and y<2*x*blockH / blockW;

[0134] In area 2, y>=(2*x*blockH / blockW-blockH) and y <x*blockH / blockW;

[0135] In area 3, y<(2*x*blockH / blockW-blockH).

[0136] Will Fig.10 (e) is replaced by Fig.11 (b) Fig.11 Region 0 of (b) corresponds to Fig.11 (a) Area 3, corresponding to Area 1 Fig.11 (a) Area 2, corresponding to Area 2 Fig.11 (a) Area 1, corresponding to Area 3 Fig.11 (a) Area 0.

[0137] In some embodiments, wide angle modes may also be taken into account.

[0138] Corresponding Figure 6 When the angles are -14 to -1, 67 to 80, the solution of the embodiment of the present invention can also be implemented. Specifically,

[0139] (-14 <= ​​angular mode index <= -6) is considered as a near vertical division;

[0140] (-5 <= angular mode index <= -1) is considered as a near lower left diagonal division;

[0141] (72 <= angular mode index <= 80) is considered as a near horizontal division;

[0142] For (67<=angular mode index<=71), it is regarded as a near upper right diagonal division.

[0143] In another embodiment of the present invention, it can be divided into 8 sub-areas. Accordingly, Fig.10 The five angle mode segmentation methods in are modified accordingly: Fig.12 The segmentation method in:

[0144] Among them, the corresponding coordinate calculation formula for sector division is:

[0145] right Fig.12 (d) Yes, in area 0, y>=4*x*blockH / blockW;

[0146] In area 1, y>=2*x*blockH / blockW and y<4*x*blockH / blockW;

[0147] In area 2, y*3>=4*x*blockH / blockW and y<2*x*blockH / blockW;

[0148] In area 3, y>=x*blockH / blockW and y<3*x*blockH / blockW / 2;

[0149] In area 4, y>=3*x*blockH / blockW / 4 and y <x*blockH / blockW;

[0150] In area 5, y>=x*blockH / blockW / 2 and y<3*x*blockH / blockW / 4;

[0151] In area 6, y>=x*blockH / blockW / 4 and y <x*blockH / blockW / 2;

[0152] In area 7, y <x*blockH / blockW / 4。

[0153] right Fig.12 (e), region 0 corresponds to Fig.12 (d) Area 7, corresponding to Area 1 Fig.12 (d) Area 6, corresponding to Area 2 Fig.12 (d) Area 5, corresponding to Area 3 Fig.12 (d) Area 4, Area 4 corresponds to Fig.12 (d) Area 3, corresponding to Area 5 Fig.12 (d) Area 2, corresponding to Area 6 Fig.12 (d) Area 1, corresponding to Area 7 Fig.12 (d) Area 0.

[0154] In addition, only two cases, namely, the near horizontal prediction mode and the near vertical prediction mode, can be used, corresponding to Fig.12 (a) and (b) are two sub-block segmentation methods; three situations of near horizontal prediction mode, near vertical prediction mode, and near diagonal prediction mode can also be used, corresponding to Fig.12 (a), (b), and (c) are three sub-block segmentation methods; you can also use the near horizontal prediction mode, near vertical prediction mode, near diagonal prediction mode, near lower left diagonal mode, and near upper right diagonal mode, corresponding to Fig.12 (a), (b), (c), (d), and (e) Five sub-block segmentation methods.

[0155] Furthermore, a variety of different angle and segmentation methods can be used, in some cases divided into 8 sub-block areas, in other cases divided into 4 sub-block areas. For example, using a near horizontal prediction mode, a near vertical prediction mode, a near diagonal prediction mode, a near lower left diagonal mode, and a near upper right diagonal mode, respectively corresponding to Fig.12 (a) Fig.12 (b) Fig.12 (c) Fig.12 (d) Fig.12 (e) Five sub-block segmentation methods.

[0156] It should be noted that Fig.10 , 11 The angle intervals corresponding to 12 are not the only division method. For example, the specific boundary angle can be fine-tuned within a certain range, and the opening and closing direction can also be adjusted. At the same time, the degree of detail of the angle division (for example, the above 64 division directions can be divided into 128, 256, etc. through more intensive division) will also affect the corresponding angle sequence number of each direction.

[0157] Further, in one embodiment of the present invention, different weights are obtained for different sub-block regions according to the directionality of the intra-frame prediction mode, including: obtaining the weights of different sub-block regions according to the correspondence between the preset angle mode sequence number and the weight. Specifically, for the weights of each sub-block region, the corresponding weights of each sub-block region (w intra ,w inter ) value will be determined by the weights shown in the preset table. In the case of four sub-blocks, the weights specified in Table 1 can be selected.

[0158] In another embodiment, the four sub-blocks may be further divided into eight sub-blocks. The sub-block weights corresponding to the eight sub-blocks are shown in Table 2.

[0159] Table 1. Sub-block weights corresponding to the four sub-block divisions in angle mode

[0160] The sub-block index <![CDATA[(w intra ,In inter )]]> 0 (6,2) 1 (5,3) 2 (3,5) 3 (2,6)

[0161] Note: The corresponding shift1 in this table is 3.

[0162] Table 2. Sub-block weights corresponding to eight sub-block divisions in angle mode

[0163] Sub-block number Inter-frame weight / 16 Intra-frame weight / 16 0 3 13 1 5 11 2 6 10 3 7 9 4 9 7 5 10 6 6 11 5 7 13 3

[0164] Note: The corresponding shift1 in this table is 4.

[0165] In addition, different weights are obtained for different sub-block areas according to the directionality of the intra-frame prediction mode, including: setting initial weights, or using template matching cost or template matching optimal filter design method to obtain initial weights; adjusting the intra-frame prediction weights and inter-frame prediction weights corresponding to each sub-block area around the initial weights. Specifically, it is necessary to first obtain the initial weights: such as setting the initial weights to (1 / 2, 1 / 2); or using other weight calculation methods, such as using template matching cost or template matching optimal filter design method to obtain a pair of initial weights (w intra , w inter ).

[0166] In this embodiment, adjusting the intra prediction weights and / or inter prediction weights corresponding to some or all sub-block regions around the initial weights includes: adjusting the intra prediction weights and / or inter prediction weights corresponding to each sub-block region based on the initial weights. The sub-block region weight adjustment method of this embodiment includes overall increase or decrease, and / or increase or decrease one by one in sequence.

[0167] Furthermore, the intra-frame prediction weights corresponding to some or all sub-block areas are overall increased or decreased by using adjustment parameters, specifically including: adaptively adjusting the intra-frame prediction weights and / or inter-frame prediction weights corresponding to some or all sub-block areas according to the corresponding information of spatially adjacent or neighboring pixels of the current coding block, or adaptively adjusting the intra-frame prediction weights and / or inter-frame prediction weights corresponding to each sub-block area according to the coding mode of the surrounding reference pixels of the current coding block.

[0168] For example, an adjustment parameter t is set, then for the four-partition method, the intra-frame weight of partition 1 is w intra -t, the intra-frame weight of partition 0 is w intra -3*t, the intra-frame weight of partition 2 is w intra +t, the intra-frame weight of partition 3 is w intra +3*t.

[0169] For the eight-partition method, the intra-frame weight of partition 3 is w intra -t, the intra-frame weight of partition 2 is w intra -3*t, the intra-frame weight of partition 1 is w intra -5*t, the intra-frame weight of partition 0 is w intra -7*t, the intra-frame weight of partition 4 is w intra +t, the intra-frame weight of partition 5 is w intra +3*t, the intra-frame weight of partition 6 is w intra +5*t, the intra-frame weight of partition 7 is w intra +7*t.

[0170] The inter-frame weight of each sub-block area is 1< <shift1-w’ intra , where w' intra Represents the intra-frame weight after adjustment.

[0171] In another specific embodiment, adaptive coding is added based on the sub-block area division. When the four-partition division is performed, the weights of the sub-block areas 0 and 3 are adaptively adjusted according to the coding mode of the surrounding reference pixels; or when the eight-partition division is performed, the weights of the sub-block areas 0, 1, 6, and 7 are adaptively adjusted according to the coding mode of the surrounding reference pixels:

[0172] if Fig.13 When the reference blocks corresponding to the four reference pixels in CIIP are all intra-frame predictions, the inter-frame weights of the above sub-block regions are increased by 1 / 8 (in the case of four sub-blocks) or 1 / 16 (in the case of eight sub-blocks), and the intra-frame weights are correspondingly reduced by 1 / 8 (in the case of four sub-blocks) or 1 / 16 (in the case of eight sub-blocks). If the four reference pixels in CIIP are all inter-frame predictions, the intra-frame weights of the above sub-block regions are increased by 1 / 8 (in the case of four sub-blocks) or 1 / 16 (in the case of eight sub-blocks), and the inter-frame weights are correspondingly reduced by 1 / 8 (in the case of four sub-blocks) or 1 / 16 (in the case of eight sub-blocks). The above values ​​of 1 / 8 or 1 / 16 are only examples, and may also be other similar values ​​between 0 and 1. Fig.13 The four reference pixels are spatially adjacent or neighboring (not adjacent but close in distance) pixels of the current coding block.

[0173] In another embodiment of the present invention, the initial weights are calculated based on surrounding templates. Figure 6 The template in (a) calculates the inter-frame template matching cost costModeInter and the intra-frame template matching cost costModeIntra respectively: when calculating the inter-frame template matching cost costModeInter, the Inter mode in the acquired CIIP is used to predict and derive the template pixels, and then the difference between the template prediction value and the template reconstruction value is calculated; when calculating the intra-frame template matching cost costModeIntra, the Intra mode in the acquired CIIP is used to predict and derive the template pixels, and then the difference between the template prediction value and the template reconstruction value is calculated.

[0174] The intra prediction weight and inter prediction weight of the current coding block are obtained by using the inter-frame template matching cost costModeInter and the intra-frame template matching cost costModeIntra, which are:

[0175]

[0176]

[0177] Based on the weight, an adjustment parameter t is set.

[0178] Furthermore, adjusting the intra-frame prediction weight corresponding to each sub-block area can also include: increasing or decreasing the intra-frame prediction weight corresponding to each sub-block area one by one in sequence, wherein the parameters used for increasing or decreasing one by one in sequence are predefined parameters or are determined according to the coding block size, sub-region size or number of sub-regions.

[0179] For example, for the four-partition method, the intra-frame weight of partition 0 is w intra -t, the intra-frame weight of partition 1 is w intra -2*t, the intra-frame weight of partition 2 is w intra -3*t, the intra-frame weight of partition 3 is w intra -4*t. Or, the intra-frame weight of partition 0 is w intra , the intra-frame weight of partition 1 is w intra -t, the intra-frame weight of partition 2 is w intra -2*t, the intra-frame weight of partition 3 is w intra -3*t.

[0180] For the eight-partition method, the intra-frame weight of partition 0 is w intra -t, the intra-frame weight of partition 1 is w intra -2*t, the intra-frame weight of partition 2 is w intra -3*t, the intra-frame weight of partition 3 is w intra -4*t, the intra-frame weight of partition 4 is w intra -5*t, the intra-frame weight of partition 5 is w intra -6*t, the intra-frame weight of partition 6 is w intra -7*t, the intra-frame weight of partition 7 is w intra -8*t. Or, the intra-frame weight of partition 0 is w intra , the intra-frame weight of partition 1 is w intra -t, the intra-frame weight of partition 2 is w intra -2*t, the intra-frame weight of partition 3 is w intra -3*t, the intra-frame weight of partition 4 is w intra -4*t, the intra-frame weight of partition 5 is w intra -5*t, the intra-frame weight of partition 6 is w intra -6*t, the intra-frame weight of partition 7 is w intra -7*t.

[0181] The value of t can be customized, such as 1 / 4, 1 / 8, 1 / 16, etc., or can be adaptively selected, for example, it can be related to the coding block size or sub-block area size, or the number of sub-areas. The inter-frame weight of each partition is 1< <shift1-w’ intra , where w' intra Represents the intra-frame weight after adjustment.

[0182] In addition, in another embodiment of the present invention, the initial weights can also be calculated based on surrounding templates. For the template of the current coding block, different templates are used for subsets in different directions to calculate the initial weights. For example, the near horizontal prediction mode uses Figure 6 The left sub-template T in (h) l According to the previous example (i.e. the method of using template matching cost to calculate the initial weight), the initial (w intra ,w inter ), the near vertical prediction mode uses Figure 6 (h) The upper sub-template T t According to the previous example, calculate the initial (w intra ,w inter ), the prediction mode near the upper left corner adopts Figure 6 Left, top, and top-left sub-templates T in (h) l , T t , T tl The initial (w intra ,w inter ), the prediction mode near the upper right corner adopts Figure 6 (h) The upper and upper right sub-templates T t , T tr The initial (w intra ,w inter ), the prediction mode near the lower left corner adopts Figure 6 The left and lower left sub-templates T in (h) l , T bl The initial (w intra ,w inter ), and based on the weight, set an adjustment parameter t.

[0183] For the four-partition method, the intra-frame weight of partition 0 is w intra -t, the intra-frame weight of partition 1 is w intra -2*t, the intra-frame weight of partition 2 is w intra -3*t, the intra-frame weight of partition 3 is w intra -4*t. Or, the intra-frame weight of partition 0 is w intra , the intra-frame weight of partition 1 is wintra -t, the intra-frame weight of partition 2 is w intra -2*t, the intra-frame weight of partition 3 is w intra -3*t.

[0184] For the eight-partition method, the intra-frame weight of partition 0 is w intra -t, the intra-frame weight of partition 1 is w intra -2*t, the intra-frame weight of partition 2 is w intra -3*t, the intra-frame weight of partition 3 is w intra -4*t, the intra-frame weight of partition 4 is w intra -5*t, the intra-frame weight of partition 5 is w intra -6*t, the intra-frame weight of partition 6 is w intra -7*t, the intra-frame weight of partition 7 is w intra -8*t. Or, the intra-frame weight of partition 0 is w intra , the intra-frame weight of partition 1 is w intra -t, the intra-frame weight of partition 2 is w intra -2*t, the intra-frame weight of partition 3 is w intra -3*t, the intra-frame weight of partition 4 is w intra -4*t, the intra-frame weight of partition 5 is w intra -5*t, the intra-frame weight of partition 6 is w intra -6*t, the intra-frame weight of partition 7 is w intra -7*t.

[0185] The value of t can be customized, such as 1 / 4, 1 / 8, 1 / 16, etc., or can be adaptively selected, for example, it can be related to the coding block size or sub-block size, and the number of sub-regions. The inter-frame weight of each partition is 1< <shift1-w intra .

[0186] It should be noted that the above increasing or decreasing the intra-frame prediction weight corresponding to each sub-block area one by one in sequence and increasing or decreasing the intra-frame prediction weight corresponding to some or all sub-block areas by adjusting parameters can be implemented separately or simultaneously.

[0187] Subsequently, the predicted value of CIIP was calculated.

[0188] P CIIP =[w inter ×P inter +w intra ×P intra +1<<(shift1-1)]>>shift1.

[0189] The inter-frame prediction value construction method of the embodiment of the present invention improves the weight setting rule that the spatial distance between the neighboring intra-frame prediction pixels and the pixels in the current coding block at various directional angles is inversely proportional to the correlation, and refines the intra-frame and inter-frame prediction weights in the CIIP technology, thereby improving the prediction accuracy, and is used in a video decoder or encoder to effectively improve the video coding efficiency. Under the general test condition random access configuration, the inter-frame prediction value construction method of the present invention can obtain BD-rate coding gains ranging from -0.01 to -0.12% for different test sequences relative to the most advanced video coding software model ECM8.0.

[0190] Another embodiment of the present invention provides a storage medium, wherein a computer program is stored in the storage medium, and the computer program is used to execute the steps of the inter-frame prediction value construction method described in the above embodiment. Another aspect of the present invention provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps of the inter-frame prediction value construction method described in the above embodiment are implemented. Specifically, the above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including several instructions for enabling an electronic device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.

[0191] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the scope of protection of the present invention.

Claims

1. A method for constructing an inter-frame prediction value for a decoder or an encoder, characterized in that: include: Obtaining intra / inter prediction coding mode information of the current coding block, and obtaining intra prediction values ​​and inter prediction values ​​according to the prediction mode information and corresponding parameter information; When the weighted weight is a directional mode in the intra-frame prediction coding mode, the current coding block is divided into multiple sub-block areas, and the intra-frame prediction weights and inter-frame prediction weights are obtained for different sub-block areas respectively. The predicted sampling value is determined by weighting each sub-block area under the corresponding weight, wherein the sub-block area is rectangular, triangular and / or L-shaped.

2. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 1, characterized in that: Obtaining intra / inter prediction coding mode information of a current coding block, and obtaining an intra prediction value and an inter prediction value according to the prediction mode information and corresponding parameter information, including: When the prediction mode of the current coding block is an inter-frame and intra-frame joint prediction mode, obtaining parameter information corresponding to the intra-frame prediction coding mode, wherein when the intra-frame prediction coding mode adopts an angle intra-frame prediction mode, the angle intra-frame prediction mode is derived by a template-based intra-frame mode derivation method or a decoding-end intra-frame mode derivation method, wherein the decoding-end intra-frame mode derivation method uses reconstructed pixels of a template area adjacent to the current coding block to derive an intra-frame angle mode; According to the inter-frame and intra-frame joint prediction mode and corresponding parameter information, a prediction signal under the inter-frame and intra-frame joint prediction mode is obtained.

3. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 1, characterized in that: The intra-frame prediction weights and inter-frame prediction weights are obtained for different sub-block areas, including: Using the template matching cost or the template matching optimal filter design method, consistent weights are selected for different sub-block areas of the current coding block; or different weights are obtained for different sub-block areas according to the directionality of the intra-frame prediction mode.

4. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 3, characterized in that: Select consistent weights for different sub-block areas of the current coding block, including: For the template of the current coding block, calculate the inter-frame template matching cost and the intra-frame template matching cost respectively; The intra-frame prediction weight and the inter-frame prediction weight of the current coding block are obtained by using the inter-frame template matching cost and the intra-frame template matching cost.

5. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 3, characterized in that: Different weights are obtained for different sub-block areas according to the directionality of the intra prediction mode, including: The weights of different sub-block areas are obtained according to the correspondence between the preset angle mode serial numbers and the weights.

6. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 3, characterized in that: Different weights are obtained for different sub-block areas according to the directionality of the intra prediction mode, including: Setting initial weights, or obtaining initial weights using template matching cost or template matching optimal filter design method; The intra-frame prediction weight and inter-frame prediction weight corresponding to each sub-block area are adjusted around the initial weight.

7. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 6, characterized in that: The intra-frame prediction weight and inter-frame prediction weight corresponding to each sub-block area are adjusted around the initial weight, including: Based on the initial weights, the intra-frame prediction weights corresponding to each sub-block area are adjusted, wherein the intra-frame prediction weights corresponding to each sub-block area are adjusted, including: increasing or decreasing the intra-frame prediction weights corresponding to each sub-block area one by one in sequence, wherein the parameters used for increasing or decreasing the intra-frame prediction weights one by one in sequence are predefined parameters or are determined according to the coding block size, the sub-region size or the number of sub-regions.

8. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 6, characterized in that: The intra-frame prediction weight and inter-frame prediction weight corresponding to each sub-block area are adjusted around the initial weight, including: The adjustment parameters are used to increase or decrease the intra-frame prediction weights corresponding to some or all sub-block regions as a whole.

9. The method for constructing an inter-frame prediction value for a decoder or encoder according to claim 8, characterized in that: The intra-frame prediction weights corresponding to some or all sub-block regions are overall increased or decreased by adjusting the parameters, including: The intra-frame prediction weights and / or inter-frame prediction weights corresponding to part or all of the sub-block regions are adaptively adjusted according to the corresponding information of spatially adjacent or neighboring pixels of the current coding block.

10. The method for constructing inter-frame prediction values ​​for a decoder or encoder according to claim 8, characterized in that: The intra-frame prediction weights corresponding to some or all sub-block regions are overall increased or decreased by adjusting the parameters, including: The intra-frame prediction weights and / or inter-frame prediction weights corresponding to part or all of the sub-block regions are adaptively adjusted according to the coding mode of the surrounding reference pixels of the current coding block.