CN106375764A - Directional intra prediction and block copy prediction combined video intra coding method - Google Patents

Directional intra prediction and block copy prediction combined video intra coding method Download PDF

Info

Publication number
CN106375764A
CN106375764A CN201610795564.8A CN201610795564A CN106375764A CN 106375764 A CN106375764 A CN 106375764A CN 201610795564 A CN201610795564 A CN 201610795564A CN 106375764 A CN106375764 A CN 106375764A
Authority
CN
China
Prior art keywords
prediction
block
ibc
dip
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610795564.8A
Other languages
Chinese (zh)
Other versions
CN106375764B (en
Inventor
刘�东
李跃
吴枫
李厚强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN201610795564.8A priority Critical patent/CN106375764B/en
Publication of CN106375764A publication Critical patent/CN106375764A/en
Application granted granted Critical
Publication of CN106375764B publication Critical patent/CN106375764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a directional intra prediction and block copy prediction combined video intra coding method. According to the method, a coding block is segmented into two sub-blocks in a flexible block segmentation mode, so prediction content in the same block can contain both local information and non-local information; and prediction of each block with least cost is decided through RDO (Rate Distortion Optimization). Moreover, rapid RDO and complete RDO are combined, and on the premise of not influencing the coding performance, the coding complexity is reduced. The general effect is that the complexity of a decoding side is basically not increased, and the higher compression efficiency is obtained.

Description

Video intra-frame coding method combining direction prediction and block copy prediction
Technical Field
The invention relates to the technical field of video coding, in particular to a video intra-frame coding method combining direction prediction and block copy prediction.
Background
In recent years, with the rapid development of the internet, the application demand for videos in the internet is increasing, and the data volume of the videos is very large, so that the problem that needs to be solved in order to transmit the videos in the internet with limited bandwidth is the problem of video compression coding.
The established video coding standards all belong to the hybrid video coding framework. So-called hybrid video coding, generally consists of the following parts: prediction (Prediction), transformation (Transform), Quantization (Quantization) and Entropy Coding (Entropy Coding). Among them, prediction is generally classified into intra prediction and inter prediction. Video frames that can only use intra-prediction mode are called I-frames, and video frames that can use either intra-prediction mode or inter-prediction mode are called P-frames or B-frames. The intra-frame prediction mode removes spatial redundancy by using pixels which are in the same frame as a current coding block and are reconstructed as a reference. The inter-frame prediction mode removes temporal redundancy by using the reconstructed pixels of other frames as references. Generally, the accuracy of inter-frame prediction is higher, but the first frame of video or a random access frame set for random access must be an I frame, and only intra-frame prediction can be used. Further improving the accuracy of intra-frame prediction, thereby improving the compression efficiency of I-frames, is a very urgent need in video coding.
Currently, the latest standard for general Video Coding is High Efficiency Video Coding (HEVC). Intra prediction of HEVC has 35 modes in common. Where the mode 0 indicates prediction using the Planar method, 1 indicates prediction using the DC method, and 2 to 34 indicate the use of the directional extrapolation mode. A common feature of these modes is extrapolation based on reconstructed pixels in the immediate vicinity of the current coding block, which will be referred to below collectively as Directional Intra Prediction (DIP).
In addition, there are some work that suggests other intra prediction methods, such as:
extrapolation predictions in both directions are combined (Y.Ye and M.Karczewicz, "Improved h.264 encoding based on bi-directional intra prediction, directional transform, and adaptive coherent prediction," Image Processing,2008.ICIP 2008.15th IEEEInternational reference, San Diego, CA,2008, pp.2116-2119.). However, directional prediction in HEVC, or combined two-directionally weighted prediction, only considers local correlation in video frames and not non-local correlation.
Edge (Edge) -based prediction (Liu, d., Sun, x., Wu, f., & Zhang, Y.Q. (2008). Edge-oriented uniform prediction image Processing, IEEE Transactions, 17(10),1827- & 1836.). Prediction based on template matching (template matching) (t.k.tan, c.s.book, and y.suzuki, "Intra prediction byte mapping," in Image Processing,2006ieee international reference, Oct 2006, pp.1693-1696.). However, edge-based prediction or template matching-based prediction has a high complexity at the decoding end.
Prediction based on Intra block copy (Intra block copy) (Siu-Leong Yu and Christos Chrysafis, "Intra-prediction Intra-macroblock motion compensation," Oct.2006, U.S. Pat. No. 7,120,196.). The intra block copy prediction technology finds a most similar reference block as prediction for a current coding block in a reconstructed area of a current frame, and encodes a spatial motion vector between the found most similar reference block and the current block; it is well suited for the case where there are repetitive texture patterns in a frame. This technique is used in subsequent extension versions of HEVC: the Screen Content Coding (SCC) is adopted because some repetitive patterns of regular shapes, such as characters, etc., often appear in such videos. Block copy prediction techniques work well in SCC but not well in natural video. This is mainly because natural video capture angles are complex, noise is large, even if there are repetitive textures, they are largely irregular shapes, and are rarely aligned with square coding units, so that similar reference blocks cannot be searched.
Disclosure of Invention
The invention aims to provide a video intra-frame coding method combining direction prediction and block copy prediction, which can consider local correlation and non-local correlation in a video frame and ensure that the complexity of a decoding end is lower.
The purpose of the invention is realized by the following technical scheme:
a method of video intra-coding combining directional prediction and block copy prediction, comprising:
dividing a current coding block by utilizing a predefined division template containing a plurality of division types, wherein each division type divides the current coding block into two sub-blocks;
intra block copy IBC prediction for all sub-blocks: determining a search range of IBC prediction, performing IBC prediction on all subblocks by using each reference block in the search range, determining an optimal motion vector of each subblock, and recording a prediction error of each subblock, which is obtained by predicting the optimal motion vector;
carrying out DIP prediction on all the subblocks to obtain the optimal prediction direction of each subblock, and recording the prediction error of each subblock, which is obtained by predicting the optimal prediction direction;
after prediction errors of all subblocks under IBC prediction and DIP prediction are obtained, determining optimal division and corresponding prediction combinations in all division types through rapid Rate Distortion Optimization (RDO);
and through complete RDO comparison, the coding cost of IBC prediction on the current coding block, the coding cost of DIP prediction on the current coding block and the coding cost of optimal division and corresponding prediction combination are selected, and the prediction mode with the minimum coding cost is selected as the final prediction mode of the current coding block.
Further, the plurality of partition types include:
the method comprises the following steps of (1) covering 28 division types of a horizontal direction, a vertical direction, a diagonal direction from top right to bottom left and a diagonal direction from top left to bottom right, wherein each direction has 7 division types, the division types of the horizontal direction and the vertical direction are collectively called rectangular division, and the division types of the diagonal direction from top right to bottom left and the diagonal direction from top left to bottom right are collectively called triangular division;
or, the two division modes include 7 division types with an L-shaped upper left and 7 division types with an L-shaped upper right, and both the two division modes divide the current coding block into two sub-blocks: one sub-block is a square block, and the other sub-block is an L-shaped block formed by two adjacent rectangular blocks.
Further, if the plurality of partition types are 28 partition types including a horizontal direction, a vertical direction, a diagonal direction from top right to bottom left, and a diagonal direction from top left to bottom right, determining an optimal motion vector of each sub-block when performing intra block copy IBC prediction on all sub-blocks, and recording a prediction error of each sub-block, which is predicted by the optimal motion vector, includes:
marking 7 divisions in the horizontal direction as H1-H7, and 7 divisions in the vertical direction as V1-V7; 7 types of divisions in the diagonal direction from the upper right to the lower left are marked as T1-T7, and 7 types of divisions in the diagonal direction from the upper left to the lower right are marked as D1-D7;
after the search of each reference block in the search range is completed, the minimum prediction error and the corresponding optimal motion vector of each sub-block in each partition are obtained, and the following marks are carried out:
the optimal motion vectors MV of the upper and lower sub-blocks of the 1 st partition type H1 in the horizontal direction are denoted as MV _ IBC _ H1_1 and MV _ IBC _ H1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ H1_1 and SAD _ IBC _ H1_ 2; by analogy, the optimal motion vectors MV of the upper and lower sub-blocks of the 7 th partition type H7 are respectively denoted as MV _ IBC _ H7_1 and MV _ IBC _ H7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ H7_1 and SAD _ IBC _ H7_ 2;
the optimal motion vectors MV of the left and right sub-blocks of the 1 st partition type V1 in the vertical direction are denoted as MV _ IBC _ V1_1 and MV _ IBC _ V1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ V1_1 and SAD _ IBC _ V1_ 2; by analogy, the optimal motion vectors MV of the left and right sub-blocks of the 7 th partition type V7 are respectively denoted as MV _ IBC _ V7_1 and MV _ IBC _ V7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ V7_1 and SAD _ IBC _ V7_ 2;
the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 1 st partition type T1 in the diagonal direction from the upper right to the lower left are denoted as MV _ IBC _ T1_1 and MV _ IBC _ T1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ T1_1 and SAD _ IBC _ T1_ 2; by analogy, the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 7 th partition type T7 are denoted as MV _ IBC _ T7_1 and MV _ IBC _ T7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ T7_1 and SAD _ IBC _ T7_ 2;
the optimal motion vectors MV of the upper right and lower left sub-blocks of the 1 st partition type D1 in the diagonal direction from top left to bottom right are denoted as MV _ IBC _ D1_1 and MV _ IBC _ D1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ D1_1 and SAD _ IBC _ D1_ 2; by analogy, the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 7 th partition type T7 are denoted as MV _ IBC _ D7_1 and MV _ IBC _ D7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ D7_1 and SAD _ IBC _ D7_ 2.
Further, the performing DIP prediction on all sub-blocks to obtain an optimal prediction direction of each sub-block, and recording a prediction error of each sub-block, which is obtained by predicting the optimal prediction direction, includes:
the DIP prediction is that the optimal prediction direction is determined in 35 kinds of intra-frame prediction of HEVC, and after a predicted value in each direction is generated, the prediction error of each sub-block between a predicted block and a current coding block is calculated; after completing the traversal of 35 prediction directions, the minimum prediction error and corresponding intra prediction direction of each sub-block in each partition are obtained, and the following labels are performed:
the optimal prediction directions of the upper and lower sub-blocks of the 1 st partition type H1 in the horizontal direction are denoted as Mode _ DIP _ H1_1 and Mode _ DIP _ H1_2, respectively, and the corresponding prediction errors are denoted as SAD _ DIP _ H1_1 and SAD _ DIP _ H1_ 2; by analogy, the optimal prediction directions of the upper and lower sub-blocks of the 7 th partition type H7 are respectively denoted as Mode _ DIP _ H7_1 and Mode _ DIP _ H7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ H7_1 and SAD _ DIP _ H7_ 2;
the optimal prediction directions of the left and right sub-blocks of the 1 st partition type V1 in the vertical direction are denoted as Mode _ DIP _ V1_1 and Mode _ DIP _ V1_2, respectively, and the corresponding prediction errors are denoted as SAD _ DIP _ V1_1 and SAD _ DIP _ V1_ 2; by analogy, the optimal prediction directions of the left and right sub-blocks of the 7 th partition type H7 are respectively denoted as Mode _ DIP _ V7_1 and Mode _ DIP _ V7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ V7_1 and SAD _ DIP _ V7_ 2;
the optimal prediction directions of the two sub-blocks at the top left and the bottom right of the 1 st partition type T1 in the diagonal direction from top right to bottom left are respectively denoted as Mode _ DIP _ T1_1 and Mode _ DIP _ T1_2, and the corresponding prediction errors are denoted as SAD _ DIP _ T1_1 and SAD _ DIP _ T1_ 2; by analogy, the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 7 th partition type T7 are respectively denoted as Mode _ DIP _ T7_1 and Mode _ DIP _ T7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ T7_1 and SAD _ DIP _ T7_ 2;
the optimal prediction directions of the upper right and lower left sub-blocks of the 1 st partition type D1 in the diagonal direction from the top left to the bottom right are referred to as Mode _ DIP _ D1_1 and Mode _ DIP _ D1_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ D1_1 and SAD _ DIP _ D1_ 2; by analogy, the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 7 th partition type T7 are respectively denoted as Mode _ DIP _ D7_1 and Mode _ DIP _ D7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ D7_1 and SAD _ DIP _ D7_ 2.
Further, the determining the optimal partition and the corresponding prediction combination in all partition types through the fast rate distortion optimization RDO includes:
determining the partition and prediction combination with the minimum total cost in 7 partition types in the horizontal direction, the vertical direction, the diagonal direction from the top right to the bottom left and the diagonal direction from the top left to the bottom right respectively, wherein the process is as follows:
of the 7 division types in the horizontal directions H1-H7, there are 14 combinations, and the corresponding costs are:
C _ H _ i _ 1 = S A D _ I B C _ H i _ 1 + S A D _ D I P _ H i _ 2 + λ × B i t s ( M V _ I B C _ H i _ 1 , M o d e _ D I P _ H i _ 2 ) C _ H _ i _ 2 = S A D _ I B C _ H i _ 2 + S A D _ D I P _ H i _ 1 + λ × B i t s ( M V _ I B C _ H i _ 2 , M o d e _ D I P _ H i _ 1 ) ;
in the above formula, i is 1, 2.., 7; λ is a lagrange multiplier determined by a parameter specified by the encoder, and the Bits function is an estimate of the number of Bits consumed for entropy coding the MV and DIP directions; finding out the minimum combination of C _ H _ i _1 and C _ H _ i _2, and marking the minimum combination as C _ H _ k1_ p1, and marking the corresponding prediction modes as (k1 and p1), wherein k1 is one number from 1 to 7, and the division type is Hk 1; p1 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the left part carries out IBC prediction, the right part carries out DIP prediction, and 2 is the opposite;
among the 7 division types of the vertical directions V1-V7, there are 14 combinations, and the corresponding costs are:
C _ V _ i _ 1 = S A D _ I B C _ V i _ 1 + S A D _ D I P _ V i _ 2 + λ × B i t s ( M V _ I B C _ V i _ 1 , M o d e _ D I P _ V i _ 2 ) C _ V _ i _ 2 = S A D _ I B C _ V i _ 2 + S A D _ D I P _ V i _ 1 + λ × B i t s ( M V _ I B C _ V i _ 2 , M o d e _ D I P _ V i _ 1 ) ;
finding out the minimum combination of C _ V _ i _1 and C _ V _ i _2 from the above formula, and marking the minimum combination as C _ V _ k2_ p2, and marking the corresponding prediction modes as (k2 and p2), wherein k2 is one number from 1 to 7, which indicates that the partition type is Vk 2; p2 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the upper part carries out IBC prediction, the lower part carries out DIP prediction, and 2 is vice versa;
in 7 divisions from the upper right to the lower left diagonal direction T1 to T7, there are 14 combinations, and the corresponding costs are:
C _ T _ i _ 1 = S A D _ I B C _ T i _ 1 + S A D _ D I P _ T i _ 2 + λ × B i t s ( M V _ I B C _ T i _ 1 , M o d e _ D I P _ T i _ 2 ) C _ T _ i _ 2 = S A D _ I B C _ T i _ 2 + S A D _ D I P _ T i _ 1 + λ × B i t s ( M V _ I B C _ T i _ 2 , M o d e _ D I P _ T i _ 1 ) ;
finding out the minimum combination of C _ T _ i _1 and C _ T _ i _2 from the above formula, and marking the minimum combination as C _ T _ k3_ p3, and marking the corresponding prediction modes as (k3 and p3), wherein k3 is one number from 1 to 7, which indicates that the partition type is Tk 3; p3 is one of 1 to 2, which indicates the prediction combination mode, wherein 1 means that IBC prediction is carried out on the upper left part, DIP prediction is carried out on the lower right part, and the other way is not carried out on 2;
of the 7 divisions in the diagonal directions D1-D7 from top left to bottom right, there are 14 combinations, and the corresponding costs are:
C _ D _ i _ 1 = S A D _ I B C _ D i _ 1 + S A D _ D I P _ D i _ 2 + λ × B i t s ( M V _ I B C _ D i _ 1 , M o d e _ D I P _ D i _ 2 ) C _ D _ i _ 2 = S A D _ I B C _ D i _ 2 + S A D _ D I P _ D i _ 1 + λ × B i t s ( M V _ I B C _ D i _ 2 , M o d e _ D I P _ D i _ 1 )
finding out the minimum combination of C _ D _ i _1 and C _ D _ i _2 from the above formula, and marking the minimum combination as C _ D _ k4_ p4, and marking the corresponding prediction modes as (k4 and p4), wherein k4 is one number from 1 to 7, which indicates that the partition type is Dk 4; p4 is one of numbers 1 to 2 indicating the prediction combination, 1 means IBC prediction in the upper right part and DIP prediction in the lower left part, and 2 is the opposite.
Further, the selecting, through complete RDO comparison, a prediction mode with the minimum coding cost as a final prediction mode of the current coding block includes:
carrying out DIP prediction on a current coding block, and recording the coding cost calculated by complete RDO as C _ DIP;
IBC prediction is carried out on the current coding block, and the coding cost calculated by complete RDO is recorded as C _ IBC;
for the horizontal direction, from the prediction mode (k1, p1), the intra prediction direction is determined according to the corresponding motion vector MV _ IBC _ Hk1_ p1Generating a prediction block of the current block by the partitioning type Hk1, and recording the coding cost calculated by the complete RDO as C _ H; wherein,
for the vertical direction, from the prediction mode (k2, p2), the intra prediction direction is determined according to the corresponding motion vector MV _ IBC _ Vk2_ p2Generating a prediction block of the current block by the division type Vk2, and recording the coding cost calculated by the complete RDO as C _ V; wherein,
for diagonal directions from top right to bottom left, the intra prediction direction is determined by the prediction mode (k3, p3) according to the corresponding motion vector MV _ IBC _ Tk3_ p3And the partition type Tk3 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ T; wherein,
for diagonal directions from top left to bottom right, the intra prediction direction is determined by the prediction mode (k4, p4) according to the corresponding motion vector MV _ IBC _ Dk4_ p4And the partition type Dk4 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ D;
and comparing the sizes of the C _ DIP, the C _ IBC and the C _ H, C _ V, C _ T, C _ D, and taking the prediction mode corresponding to the minimum coding cost as the final prediction mode of the current coding block.
Further, if the multiple partition types include 7 partition types with an L-shape at the top left and 7 partition types with an L-shape at the top right, determining the optimal motion vector of each sub-block when performing intra block copy IBC prediction on all sub-blocks, and recording a prediction error of each sub-block, which is predicted by the optimal motion vector, includes:
recording 7 partition types with L-shaped upper left as L1-L7, and recording 7 partition types with L-shaped upper right as R1-R7;
after the search of each reference block in the search range is completed, the minimum prediction error and the corresponding optimal motion vector of each sub-block in each partition are obtained, and the following marks are carried out:
the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 1 st partition type L1 in the L-type at the upper left are respectively denoted as MV _ IBC _ L1_1 and MV _ IBC _ L1_2, and the corresponding prediction errors are denoted as SAD _ IBC _ L1_1 and SAD _ IBC _ L1_ 2; by analogy, the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 7 th partition type L7 are respectively denoted as MV _ IBC _ L7_1 and MV _ IBC _ L7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ L7_1 and SAD _ IBC _ L7_ 2;
the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 1 st partition type R1 in the L-type at the upper right are respectively denoted as MV _ IBC _ R1_1 and MV _ IBC _ R1_2, and the corresponding prediction errors are denoted as SAD _ IBC _ R1_1 and SAD _ IBC _ R1_ 2; by analogy, the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 7 th partition type R7 are denoted as MV _ IBC _ R7_1 and MV _ IBC _ R7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ R7_1 and SAD _ IBC _ R7_ 2.
Further, the performing DIP prediction on all sub-blocks to obtain an optimal prediction direction of each sub-block, and recording a prediction error of each sub-block, which is obtained by predicting the optimal prediction direction, includes:
the DIP prediction is that the optimal prediction direction is determined in 35 kinds of intra-frame prediction of HEVC, and after a predicted value in each direction is generated, the prediction error of each sub-block between a predicted block and a current coding block is calculated; after completing the traversal of 35 prediction directions, the minimum prediction error and corresponding intra prediction direction of each sub-block in each partition are obtained, and the following labels are performed:
the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 1 st partition type L1 in the L-type at the upper left are respectively denoted as Mode _ DIP _ L1_1 and Mode _ DIP _ L1_2, and the corresponding prediction errors are denoted as SAD _ DIP _ L1_1 and SAD _ DIP _ L1_ 2; by analogy, the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 7 th partition type L7 are respectively denoted as Mode _ DIP _ L7_1 and Mode _ DIP _ L7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ L7_1 and SAD _ DIP _ L7_ 2;
the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 1 st partition type R1 in the upper right sub-block are referred to as Mode _ DIP _ R1_1 and Mode _ DIP _ R1_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ R1_1 and SAD _ DIP _ R1_ 2; by analogy, the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 7 th partition type R7 are referred to as Mode _ DIP _ R7_1 and Mode _ DIP _ R7_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ R7_1 and SAD _ DIP _ R7_ 2.
Further, the determining the optimal partition and the corresponding prediction combination in all partition types through the fast rate distortion optimization RDO includes:
determining the partition and prediction combination with the minimum overall cost in 7 partition types of L-shaped at the upper left and L-shaped at the upper right, wherein the process is as follows:
of the 7 partition types L1-L7 at the top left, there are 14 combinations, and the corresponding costs are:
C _ L _ i _ 1 = S A D _ I B C _ L i _ 1 + S A D _ D I P _ L i _ 2 + λ × B i t s ( M V _ I B C _ L i _ 1 , M o d e _ D I P _ L i _ 2 ) C _ L _ i _ 2 = S A D _ I B C _ L i _ 2 + S A D _ D I P _ L i _ 1 + λ × B i t s ( M V _ I B C _ L i _ 2 , M o d e _ D I P _ L i _ 1 ) ;
in the above formula, i is 1, 2.., 7; the Bits function is an estimate of the number of Bits consumed for entropy coding of MV and DIP directions; finding out the minimum combination of C _ L _ i _1 and C _ L _ i _2, and marking the minimum combination as C _ L _ k1_ p1, and marking the corresponding prediction modes as (k1 and p1), wherein k1 is one number from 1 to 7, and the division type is Lk 1; p1 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the upper left L-shaped part is subjected to IBC prediction, the lower right square part is subjected to DIP prediction, and 2 is the opposite;
in the 7 division types of L-type R1-R7 at the upper right, there are 14 combinations, and the corresponding costs are respectively:
C _ R _ i _ 1 = S A D _ I B C _ R i _ 1 + S A D _ D I P _ R i _ 2 + λ × B i t s ( M V _ I B C _ R i _ 1 , M o d e _ D I P _ R i _ 2 ) C _ R _ i _ 2 = S A D _ I B C _ R i _ 2 + S A D _ D I P _ R i _ 1 + λ × B i t s ( M V _ I B C _ R i _ 2 , M o d e _ D I P _ R i _ 1 ) ;
finding out the minimum combination of C _ R _ i _1 and C _ R _ i _2, which is marked as C _ R _ k2_ p2, and the corresponding prediction modes are marked as (k2 and p2), wherein k2 is a number from 1 to 7, and the division position is Rk 2; p2 is one of numbers 1 to 2 indicating the prediction combination, 1 means that the upper right L-shaped part is subjected to IBC prediction, the lower left square part is subjected to DIP prediction, and 2 is the opposite.
Further, the selecting, through complete RDO comparison, a prediction mode with the minimum coding cost as a final prediction mode of the current coding block includes:
carrying out DIP prediction on a current coding block, and recording the coding cost calculated by complete RDO as C _ DIP;
IBC prediction is carried out on the current coding block, and the coding cost calculated by complete RDO is recorded as C _ IBC;
for the partition type with L-shaped upper left, the prediction mode (k1, p1) is based on the corresponding motion vector MV _ IBC _ Lk1_ p1 and the intra prediction directionAnd dividing the type Lk1 to generate a prediction block of the current block, and recording the coding cost calculated by the complete RDO as C _ L; wherein,
for the partition type with L-shaped upper right, the prediction mode (k2, p)2) According to the corresponding motion vector MV _ IBC _ Rk2_ p2, intra prediction directionAnd the partition type Rk2 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ R; wherein,
and comparing the sizes of the C _ DIP, the C _ IBC and the C _ L, C _ R, and taking the prediction mode corresponding to the minimum coding cost as the final prediction mode of the current coding block.
According to the technical scheme provided by the invention, the coding block is divided into two sub-blocks through a flexible block division mode, so that the prediction content of the same block can simultaneously contain local information and non-local information, and then the RDO determines the prediction with the minimum cost of each block. Meanwhile, the combination of the rapid RDO and the complete RDO is designed, and the coding complexity is reduced on the premise of not influencing the coding performance. The overall effect is to achieve higher compression efficiency without substantially increasing the complexity at the decoding end.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a video intra-coding method combining directional prediction and block copy prediction according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the division of V1, V2, … and V7 in the vertical direction according to the embodiment of the present invention;
FIG. 3 is a schematic diagram of the division of H1, H2, …, H7 in the horizontal direction according to an embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating the division of T1, T2, … and T7 in the diagonal direction from top right to bottom left according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of the division of D1, D2, … and D7 in diagonal directions from top left to bottom right according to an embodiment of the present invention;
FIG. 6 is a schematic illustration of IBC prediction provided by an embodiment of the present invention;
fig. 7 is a schematic diagram of partitions L1, L2, …, and L7 in the partition types with L-shaped upper left according to the embodiment of the present invention;
fig. 8 is a schematic diagram of the divisions R1, R2, … and R7 in the division type with L-shaped upper right according to the embodiment of the present invention;
fig. 9 is a schematic diagram of coding performance after being tested according to the scheme of the first embodiment.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a flowchart of a video intra-coding method combining directional prediction and block copy prediction according to an embodiment of the present invention, as shown in fig. 1, which mainly includes the following steps:
1) the current coding block is divided by utilizing a predefined division template containing a plurality of division types, and each division type divides the current coding block into two sub-blocks.
2) Intra Block Copy (IBC) prediction for all sub-blocks: determining a search range of IBC prediction, performing IBC prediction on all subblocks by using each reference block in the search range, determining an optimal motion vector of each subblock, and recording a prediction error of each subblock, which is obtained by predicting the optimal motion vector.
3) And carrying out DIP prediction (intra-frame direction prediction) on all the sub-blocks to obtain the optimal prediction direction of each sub-block, and recording the prediction error of each sub-block, which is obtained by predicting the optimal prediction direction.
4) After prediction errors of all subblocks under IBC prediction and DIP prediction are obtained, the optimal partition and the corresponding prediction combination are determined in all partition types through fast Rate Distortion Optimization (RDO).
5) And through complete RDO comparison, the coding cost of IBC prediction on the current coding block, the coding cost of DIP prediction on the current coding block and the coding cost of optimal division and corresponding prediction combination are selected, and the prediction mode with the minimum coding cost is selected as the final prediction mode of the current coding block.
The step 2) and the step 3) are not executed in sequence, and in addition, corresponding IBC prediction and DIP prediction can be simultaneously carried out on the whole coding block when the step 2) and the step 3) are executed.
In the embodiment of the present invention, since the number of partition types is related to the types of predictions, that is, the more flexible the partition types are, the more the types of predictions are, but the higher the encoding complexity is, in this embodiment, the encoding performance and the complexity are considered comprehensively, and two forms of partition modes are proposed: the first is 28 division types which cover the horizontal direction, the vertical direction, the diagonal direction from the top right to the bottom left and the diagonal direction from the top left to the bottom right, wherein, each direction has 7 division types, the division types of the horizontal direction and the vertical direction are collectively called as rectangular division, and the division types of the diagonal direction from the top right to the bottom left and the diagonal direction from the top left to the bottom right are collectively called as triangular division; the second type is that 7 partition types with L-shaped upper left and 7 partition types with L-shaped upper right are included, and the two partition modes are that the current coding block is divided into two sub-blocks: one sub-block is a square block, and the other sub-block is an L-shaped block formed by two adjacent rectangular blocks.
For the sake of easy understanding, the following describes the process of performing the above steps 1) to 5) for the above two division modes in detail with reference to two embodiments.
Example one
The video intra-frame coding method combining the direction prediction and the block copy prediction provided by the embodiment comprises the following steps:
firstly, determining a division type.
In this embodiment, the plurality of partition types are 28 partition types in total, which covers the horizontal direction, the vertical direction, the diagonal direction from the top right to the bottom left, and the diagonal direction from the top left to the bottom right.
Marking 7 divisions in the horizontal direction as H1-H7, and 7 divisions in the vertical direction as V1-V7; the 7 kinds of divisions in the diagonal direction from the upper right to the lower left are denoted as T1 to T7, and the 7 kinds of divisions in the diagonal direction from the upper left to the lower right are denoted as D1 to D7.
As shown in fig. 2, the partitions of V1, V2, … and V7 are shown. A square in V1 represents the current coding block, the square is divided into a left rectangle and a right rectangle, the heights of the two rectangles are the same, and the width of the left rectangle accounts for 1/8 of the width of the whole square; 7/8, the width of the right rectangle is the width of the whole square; in V2, a square is divided into a left rectangle and a right rectangle, the heights of the two rectangles are the same, and the width of the left rectangle accounts for 2/8 of the width of the whole square; 6/8, the width of the right rectangle is the width of the whole square; similarly, the width of the left rectangle in V7 accounts for 7/8 of the entire square width; the width of the right rectangle is 1/8 the entire width of the square. H1, H2, …, H7 correspond to V1, V2, …, V7, except that the former is horizontal and the latter is vertical. H1, H2, …, H7 partitions are shown in fig. 3.
Next, describing the diagonal direction division from top right to bottom left in the triangular division, the T1, T2, T3 and T4 divisions divide a square into an isosceles right triangle at the top left corner and the remaining part at the bottom right corner; t5, T6 and T7 divide the left part of an isosceles right triangle that divides a square into a lower right corner and an upper left corner. As shown in fig. 4, in the T1 division, the base side length of an isosceles right triangle is 1/4 of the side length of a square; in the division of T2, the length of the bottom side of an isosceles right triangle is 2/4 of the length of a square side; in the same way, in the division of T4, the base side length of an isosceles right triangle is 4/4 of the side length of a square, that is, equal to the side length of the square. The T5, T6, T7 divisions are similar to the divisions of T1 through T4. The divisions of D1, D2, …, D7 are symmetrical with the divisions T1, T2, …, T7 about the vertical direction as shown in fig. 5.
And secondly, after the current coding block is divided according to the division template of the division type, Intra Block Copy (IBC) prediction needs to be carried out on all the sub blocks.
The search range needs to be determined prior to the search, and may be less than or equal to the reconstructed portion of the current frame. If the search range is set to be larger, the search complexity is higher, and meanwhile, a better prediction value can be found for the current block. The search is started after the search range is determined,
the present embodiment employs a full search, i.e., for each reference block within the search range, a prediction error, e.g., (SAD, sum of absolute differences) is calculated from each sub-block. Since the optimal prediction mode needs to be determined later by RDO (Rate distortion optimization), SAD of different shapes between the reference block and the current encoding block is calculated here.
Fig. 6 is a schematic diagram of a step in the IBC process, where a rectangular area (i.e. a rectangular area where a current coding Block is located) shown by a dotted line is an uncoded part, a peripheral part thereof is a reconstructed part in a current frame, a search range of the current coding Block reaches one of blocks, and an arrow indicates BV (Block Vector, which indicates a coordinate difference between a reference Block and a current Block, and is similar to a Motion Vector during inter-frame Motion estimation, i.e. Motion Vector, where BV is hereinafter indicated by MV, which is a customary expression). As can be seen from the foregoing, there are 28 division modes in the current coding block, each division mode divides the current coding block into two sub-blocks, and the SAD of each sub-block needs to be calculated, so that the SAD of 56 division blocks plus the SAD of the whole coding block needs to be calculated, namely 57 division modes. Since the sum of the two sub-block SADs obtained by each of the 28 kinds of divisions is equal to the SAD of the entire block, 29 SADs are actually calculated (the remaining 28 SADs can be obtained by subtracting the SAD of the corresponding small block from the SAD of the large block).
After the search of each reference block in the search range is completed, the minimum prediction error and the corresponding optimal motion vector of each sub-block in each partition are obtained, and the following marks are carried out:
the optimal motion vectors MV of the upper and lower sub-blocks of the 1 st partition type H1 in the horizontal direction are denoted as MV _ IBC _ H1_1 and MV _ IBC _ H1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ H1_1 and SAD _ IBC _ H1_ 2; by analogy, the optimal motion vectors MV of the upper and lower sub-blocks of the 7 th partition type H7 are respectively denoted as MV _ IBC _ H7_1 and MV _ IBC _ H7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ H7_1 and SAD _ IBC _ H7_ 2;
the optimal motion vectors MV of the left and right sub-blocks of the 1 st partition type V1 in the vertical direction are denoted as MV _ IBC _ V1_1 and MV _ IBC _ V1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ V1_1 and SAD _ IBC _ V1_ 2; by analogy, the optimal motion vectors MV of the left and right sub-blocks of the 7 th partition type V7 are respectively denoted as MV _ IBC _ V7_1 and MV _ IBC _ V7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ V7_1 and SAD _ IBC _ V7_ 2;
the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 1 st partition type T1 in the diagonal direction from the upper right to the lower left are denoted as MV _ IBC _ T1_1 and MV _ IBC _ T1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ T1_1 and SAD _ IBC _ T1_ 2; by analogy, the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 7 th partition type T7 are denoted as MV _ IBC _ T7_1 and MV _ IBC _ T7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ T7_1 and SAD _ IBC _ T7_ 2;
the optimal motion vectors MV of the upper right and lower left sub-blocks of the 1 st partition type D1 in the diagonal direction from top left to bottom right are denoted as MV _ IBC _ D1_1 and MV _ IBC _ D1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ D1_1 and SAD _ IBC _ D1_ 2; by analogy, the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 7 th partition type T7 are denoted as MV _ IBC _ D7_1 and MV _ IBC _ D7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ D7_1 and SAD _ IBC _ D7_ 2.
And thirdly, carrying out DIP prediction on all the subblocks to obtain the optimal prediction direction of each subblock, and recording the prediction error of each subblock, which is obtained by predicting the optimal prediction direction.
The DIP prediction is to determine the optimal prediction direction in 35 intra-frame predictions of HEVC, and because the optimal partition mode of the current coding unit cannot be determined before RDO is performed, we need to find the optimal prediction direction for each part in each partition, and record the SAD of each part in the optimal prediction direction at the same time. Calculating a prediction error (i.e., SAD) of each sub-block between the prediction block and the current coding block after the prediction value of each direction is generated; as can be seen from the foregoing, it is necessary to calculate the SAD of 56 divided sub-blocks plus the SAD of the entire coding block, i.e., 57 kinds.
After completing the traversal of 35 prediction directions, the minimum prediction error and corresponding intra prediction direction of each sub-block in each partition are obtained, and the following labels are performed:
the optimal prediction directions of the upper and lower sub-blocks of the 1 st partition type H1 in the horizontal direction are denoted as Mode _ DIP _ H1_1 and Mode _ DIP _ H1_2, respectively, and the corresponding prediction errors are denoted as SAD _ DIP _ H1_1 and SAD _ DIP _ H1_ 2; by analogy, the optimal prediction directions of the upper and lower sub-blocks of the 7 th partition type H7 are respectively denoted as Mode _ DIP _ H7_1 and Mode _ DIP _ H7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ H7_1 and SAD _ DIP _ H7_ 2;
the optimal prediction directions of the left and right sub-blocks of the 1 st partition type V1 in the vertical direction are denoted as Mode _ DIP _ V1_1 and Mode _ DIP _ V1_2, respectively, and the corresponding prediction errors are denoted as SAD _ DIP _ V1_1 and SAD _ DIP _ V1_ 2; by analogy, the optimal prediction directions of the left and right sub-blocks of the 7 th partition type H7 are respectively denoted as Mode _ DIP _ V7_1 and Mode _ DIP _ V7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ V7_1 and SAD _ DIP _ V7_ 2;
the optimal prediction directions of the two sub-blocks at the top left and the bottom right of the 1 st partition type T1 in the diagonal direction from top right to bottom left are respectively denoted as Mode _ DIP _ T1_1 and Mode _ DIP _ T1_2, and the corresponding prediction errors are denoted as SAD _ DIP _ T1_1 and SAD _ DIP _ T1_ 2; by analogy, the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 7 th partition type T7 are respectively denoted as Mode _ DIP _ T7_1 and Mode _ DIP _ T7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ T7_1 and SAD _ DIP _ T7_ 2;
the optimal prediction directions of the upper right and lower left sub-blocks of the 1 st partition type D1 in the diagonal direction from the top left to the bottom right are referred to as Mode _ DIP _ D1_1 and Mode _ DIP _ D1_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ D1_1 and SAD _ DIP _ D1_ 2; by analogy, the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 7 th partition type T7 are respectively denoted as Mode _ DIP _ D7_1 and Mode _ DIP _ D7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ D7_1 and SAD _ DIP _ D7_ 2.
And fourthly, determining the optimal partition and the corresponding prediction combination in all partition types through the fast Rate Distortion Optimization (RDO).
Determining the partition and prediction combination with the minimum total cost in 7 partition types in the horizontal direction, the vertical direction, the diagonal direction from the top right to the bottom left and the diagonal direction from the top left to the bottom right respectively, wherein the process is as follows:
of the 7 division types in the horizontal directions H1-H7, there are 14 combinations, and the corresponding costs are:
C _ H _ i _ 1 = S A D _ I B C _ H i _ 1 + S A D _ D I P _ H i _ 2 + λ × B i t s ( M V _ I B C _ H i _ 1 , M o d e _ D I P _ H i _ 2 ) C _ H _ i _ 2 = S A D _ I B C _ H i _ 2 + S A D _ D I P _ H i _ 1 + λ × B i t s ( M V _ I B C _ H i _ 2 , M o d e _ D I P _ H i _ 1 ) ;
in the above formula, i is 1, 2.., 7; λ is a lagrange multiplier determined by a parameter specified by the encoder, and the Bits function is an estimate of the number of Bits consumed for entropy coding the MV and DIP directions; finding out the minimum combination of C _ H _ i _1 and C _ H _ i _2, and marking the minimum combination as C _ H _ k1_ p1, and marking the corresponding prediction modes as (k1 and p1), wherein k1 is one number from 1 to 7, and the division type is Hk 1; p1 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the left part carries out IBC prediction, the right part carries out DIP prediction, and 2 is the opposite;
among the 7 division types of the vertical directions V1-V7, there are 14 combinations, and the corresponding costs are:
C _ V _ i _ 1 = S A D _ I B C _ V i _ 1 + S A D _ D I P _ V i _ 2 + λ × B i t s ( M V _ I B C _ V i _ 1 , M o d e _ D I P _ V i _ 2 ) C _ V _ i _ 2 = S A D _ I B C _ V i _ 2 + S A D _ D I P _ V i _ 1 + λ × B i t s ( M V _ I B C _ V i _ 2 , M o d e _ D I P _ V i _ 1 ) ;
finding out the minimum combination of C _ V _ i _1 and C _ V _ i _2 from the above formula, and marking the minimum combination as C _ V _ k2_ p2, and marking the corresponding prediction modes as (k2 and p2), wherein k2 is one number from 1 to 7, which indicates that the partition type is Vk 2; p2 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the upper part carries out IBC prediction, the lower part carries out DIP prediction, and 2 is vice versa;
in 7 divisions from the upper right to the lower left diagonal direction T1 to T7, there are 14 combinations, and the corresponding costs are:
C _ T _ i _ 1 = S A D _ I B C _ T i _ 1 + S A D _ D I P _ T i _ 2 + λ × B i t s ( M V _ I B C _ T i _ 1 , M o d e _ D I P _ T i _ 2 ) C _ T _ i _ 2 = S A D _ I B C _ T i _ 2 + S A D _ D I P _ T i _ 1 + λ × B i t s ( M V _ I B C _ T i _ 2 , M o d e _ D I P _ T i _ 1 ) ;
finding out the minimum combination of C _ T _ i _1 and C _ T _ i _2 from the above formula, and marking the minimum combination as C _ T _ k3_ p3, and marking the corresponding prediction modes as (k3 and p3), wherein k3 is one number from 1 to 7, which indicates that the partition type is Tk 3; p3 is one of 1 to 2, which indicates the prediction combination mode, wherein 1 means that IBC prediction is carried out on the upper left part, DIP prediction is carried out on the lower right part, and the other way is not carried out on 2;
of the 7 divisions in the diagonal directions D1-D7 from top left to bottom right, there are 14 combinations, and the corresponding costs are:
C _ D _ i _ 1 = S A D _ I B C _ D i _ 1 + S A D _ D I P _ D i _ 2 + λ × B i t s ( M V _ I B C _ D i _ 1 , M o d e _ D I P _ D i _ 2 ) C _ D _ i _ 2 = S A D _ I B C _ D i _ 2 + S A D _ D I P _ D i _ 1 + λ × B i t s ( M V _ I B C _ D i _ 2 , M o d e _ D I P _ D i _ 1 )
finding out the minimum combination of C _ D _ i _1 and C _ D _ i _2 from the above formula, and marking the minimum combination as C _ D _ k4_ p4, and marking the corresponding prediction modes as (k4 and p4), wherein k4 is one number from 1 to 7, which indicates that the partition type is Dk 4; p4 is one of numbers 1 to 2 indicating the prediction combination, 1 means IBC prediction in the upper right part and DIP prediction in the lower left part, and 2 is the opposite.
And fifthly, comparing the coding cost of IBC prediction of the current coding block, the coding cost of DIP prediction of the current coding block and the coding cost of optimal division and corresponding prediction combination through complete RDO, and selecting the prediction mode with the minimum coding cost as the final prediction mode of the current coding block.
Carrying out DIP prediction on a current coding block, and recording the coding cost calculated by complete RDO as C _ DIP;
IBC prediction is carried out on the current coding block, and the coding cost calculated by complete RDO is recorded as C _ IBC;
for the horizontal direction, from the prediction mode (k1, p1), the intra prediction direction is determined according to the corresponding motion vector MV _ IBC _ Hk1_ p1Generating a prediction block of the current block by the partitioning type Hk1, and recording the coding cost calculated by the complete RDO as C _ H; wherein,
for the vertical direction, from the prediction mode (k2, p2), the intra prediction direction is determined according to the corresponding motion vector MV _ IBC _ Vk2_ p2Generating a prediction block of the current block by the division type Vk2, and recording the coding cost calculated by the complete RDO as C _ V; wherein,
for diagonal directions from top right to bottom left, the intra prediction direction is determined by the prediction mode (k3, p3) according to the corresponding motion vector MV _ IBC _ Tk3_ p3And the partition type Tk3 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ T; wherein,
for diagonal directions from top left to bottom right, the intra prediction direction is determined by the prediction mode (k4, p4) according to the corresponding motion vector MV _ IBC _ Dk4_ p4And the partition type Dk4 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ D;
and comparing the sizes of the C _ DIP, the C _ IBC and the C _ H, C _ V, C _ T, C _ D, and taking the prediction mode corresponding to the minimum coding cost as the final prediction mode of the current coding block.
Example two
The video intra-frame coding method combining the direction prediction and the block copy prediction provided by the embodiment comprises the following steps:
firstly, determining a division type.
In this embodiment, the plurality of partition types include 7 partition types of L-shaped upper left and 7 partition types of L-shaped upper right.
Recording 7 partition types with L-shaped upper left as L1-L7, and recording 7 partition types with L-shaped upper right as R1-R7;
as shown in fig. 7, the division diagram of L1, L2, … and L7 is shown. In L1, a square is divided into an upper left L shape and a lower right square, and the width of the upper left L shape accounts for 1/8 of the width of the whole square; 7/8, the width of the lower right square accounts for the width of the whole square; in L2, a square is divided into an upper left L shape and a lower right square, and the width of the upper left L shape accounts for 2/8 of the width of the whole square; 6/8, the width of the lower right square accounts for the width of the whole square; similarly, a square in L7 is divided into an upper left L-shape and a lower right square, and the width of the upper left L-shape accounts for 7/8 of the width of the whole square; the width of the lower right square accounts for 1/8 the width of the entire square. The divisions of R1, R2, …, R7 are symmetrical with the divisions of L1, L2, …, L7 about the vertical direction as shown in fig. 8.
And secondly, after the current coding block is divided according to the division template of the division type, Intra Block Copy (IBC) prediction needs to be carried out on all the sub blocks.
The calculation principle of this step is the same as that of the second step in the first embodiment, and therefore, the description is omitted, and the difference between the two steps is mainly that the marks of the sub-blocks are not the same.
In this embodiment, after the search of each reference block in the search range is completed, the minimum prediction error and the corresponding optimal motion vector of each sub-block in each partition are obtained, and the following flags are performed:
the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 1 st partition type L1 in the L-type at the upper left are respectively denoted as MV _ IBC _ L1_1 and MV _ IBC _ L1_2, and the corresponding prediction errors are denoted as SAD _ IBC _ L1_1 and SAD _ IBC _ L1_ 2; by analogy, the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 7 th partition type L7 are respectively denoted as MV _ IBC _ L7_1 and MV _ IBC _ L7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ L7_1 and SAD _ IBC _ L7_ 2;
the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 1 st partition type R1 in the L-type at the upper right are respectively denoted as MV _ IBC _ R1_1 and MV _ IBC _ R1_2, and the corresponding prediction errors are denoted as SAD _ IBC _ R1_1 and SAD _ IBC _ R1_ 2; by analogy, the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 7 th partition type R7 are denoted as MV _ IBC _ R7_1 and MV _ IBC _ R7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ R7_1 and SAD _ IBC _ R7_ 2.
And thirdly, carrying out DIP prediction on all the subblocks to obtain the optimal prediction direction of each subblock, and recording the prediction error of each subblock, which is obtained by predicting the optimal prediction direction.
The calculation principle of this step is the same as that of the second step in the first embodiment, and therefore, the description is omitted, and the difference between the two steps is mainly that the marks of the sub-blocks are not the same.
In this embodiment, after traversing 35 prediction directions, the minimum prediction error and the corresponding intra-frame prediction direction of each sub-block in each partition are obtained, and the following flags are performed:
the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 1 st partition type L1 in the L-type at the upper left are respectively denoted as Mode _ DIP _ L1_1 and Mode _ DIP _ L1_2, and the corresponding prediction errors are denoted as SAD _ DIP _ L1_1 and SAD _ DIP _ L1_ 2; by analogy, the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 7 th partition type L7 are respectively denoted as Mode _ DIP _ L7_1 and Mode _ DIP _ L7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ L7_1 and SAD _ DIP _ L7_ 2;
the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 1 st partition type R1 in the upper right sub-block are referred to as Mode _ DIP _ R1_1 and Mode _ DIP _ R1_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ R1_1 and SAD _ DIP _ R1_ 2; by analogy, the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 7 th partition type R7 are referred to as Mode _ DIP _ R7_1 and Mode _ DIP _ R7_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ R7_1 and SAD _ DIP _ R7_ 2.
And fourthly, determining the optimal partition and the corresponding prediction combination in all partition types through the fast Rate Distortion Optimization (RDO).
The calculation principle of this step is the same as that of the second step in the first embodiment, and therefore, the description is omitted, and the difference between the two steps is mainly that the marks of the sub-blocks are not the same.
In this embodiment, the partition and prediction combination with the minimum overall cost is determined from the 7 partition types of the respective L-type at the top left and the L-type at the top right, and the process is as follows:
of the 7 partition types L1-L7 at the top left, there are 14 combinations, and the corresponding costs are:
C _ L _ i _ 1 = S A D _ I B C _ L i _ 1 + S A D _ D I P _ L i _ 2 + λ × B i t s ( M V _ I B C _ L i _ 1 , M o d e _ D I P _ L i _ 2 ) C _ L _ i _ 2 = S A D _ I B C _ L i _ 2 + S A D _ D I P _ L i _ 1 + λ × B i t s ( M V _ I B C _ L i _ 2 , M o d e _ D I P _ L i _ 1 ) ;
in the above formula, i is 1, 2.., 7; the Bits function is an estimate of the number of Bits consumed for entropy coding of MV and DIP directions; finding out the minimum combination of C _ L _ i _1 and C _ L _ i _2, and marking the minimum combination as C _ L _ k1_ p1, and marking the corresponding prediction modes as (k1 and p1), wherein k1 is one number from 1 to 7, and the division type is Lk 1; p1 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the upper left L-shaped part is subjected to IBC prediction, the lower right square part is subjected to DIP prediction, and 2 is the opposite;
in the 7 division types of L-type R1-R7 at the upper right, there are 14 combinations, and the corresponding costs are respectively:
C _ R _ i _ 1 = S A D _ I B C _ R i _ 1 + S A D _ D I P _ R i _ 2 + λ × B i t s ( M V _ I B C _ R i _ 1 , M o d e _ D I P _ R i _ 2 ) C _ R _ i _ 2 = S A D _ I B C _ R i _ 2 + S A D _ D I P _ R i _ 1 + λ × B i t s ( M V _ I B C _ R i _ 2 , M o d e _ D I P _ R i _ 1 ) ;
finding out the minimum combination of C _ R _ i _1 and C _ R _ i _2, which is marked as C _ R _ k2_ p2, and the corresponding prediction modes are marked as (k2 and p2), wherein k2 is a number from 1 to 7, and the division position is Rk 2; p2 is one of numbers 1 to 2 indicating the prediction combination, 1 means that the upper right L-shaped part is subjected to IBC prediction, the lower left square part is subjected to DIP prediction, and 2 is the opposite.
And fifthly, comparing the coding cost of IBC prediction of the current coding block, the coding cost of DIP prediction of the current coding block and the coding cost of optimal division and corresponding prediction combination through complete RDO, and selecting the prediction mode with the minimum coding cost as the final prediction mode of the current coding block.
The process of this step is the same as the fifth step in the first embodiment, and the difference is only that the marks of some parameters are not consistent; the process of this step is specifically as follows:
carrying out DIP prediction on a current coding block, and recording the coding cost calculated by complete RDO as C _ DIP;
IBC prediction is carried out on the current coding block, and the coding cost calculated by complete RDO is recorded as C _ IBC;
for the partition type with L-shaped upper left, the prediction mode (k1, p1) is based on the corresponding motion vector MV _ IBC _ Lk1_ p1 and the intra prediction directionAnd dividing the type Lk1 to generate a prediction block of the current block, and recording the coding cost calculated by the complete RDO as C _ L; wherein,
for the partition type with L-type at the upper right, the intra prediction direction is determined by the prediction mode (k2, p2) according to the corresponding motion vector MV _ IBC _ Rk2_ p2And the partition type Rk2 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ R; wherein,
and comparing the sizes of the C _ DIP, the C _ IBC and the C _ L, C _ R, and taking the prediction mode corresponding to the minimum coding cost as the final prediction mode of the current coding block.
In the two embodiments of the present invention, the coding block is divided into two sub-blocks by a flexible block division manner, so that the prediction content of the same block can simultaneously include local information and non-local information, and then the RDO determines the prediction with the minimum cost for each block. Meanwhile, the combination of the rapid RDO and the complete RDO is designed, and the coding complexity is reduced on the premise of not influencing the coding performance. The overall effect is to achieve higher compression efficiency without substantially increasing the complexity at the decoding end.
To further illustrate, the effects of the above-described embodiment were also tested based on the first embodiment. The test conditions included: intra Configuration (AI), Quantization Step (QP) is set to {22, 27, 32, 37} and the search range is | mvx|+|mvy|<128, the number of frames tested is 5 frames, the software based is HM12.0, and the test sequence is the generic test sequence of HEVC (not including Class F, since it is a SCC sequence). There are two groups of comparative experiments: the first is the comparison of performance of HM12.0 itself with that of HM12.0 after the IBC technique has been integrated; the second set is a comparison of the performance of the HM12.0 integrated IBC technique with the HM12.0 integrated with our technique. The two sets of experimental results are shown in fig. 9, wherein the first column of fig. 9 is the name of the test sequence, the second column is the first set of experimental results, the third column is the second set of experimental results, and the last two rows are the complexity variation of the encoding side and the decoding side. It can be seen that the scheme proposed by the present invention can obtain a 2.1% code rate saving with respect to the HM, and can obtain a 0.9% code rate saving with respect to the HM integrated with IBC, and the decoding complexity is substantially unchanged.
Through the above description of the embodiments, it is clear to those skilled in the art that the above embodiments can be implemented by software, and can also be implemented by software plus a necessary general hardware platform. With this understanding, the technical solutions of the embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods according to the embodiments of the present invention.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for video intra-coding with combined directional prediction and block copy prediction, comprising:
dividing a current coding block by utilizing a predefined division template containing a plurality of division types, wherein each division type divides the current coding block into two sub-blocks;
intra block copy IBC prediction for all sub-blocks: determining a search range of IBC prediction, performing IBC prediction on all subblocks by using each reference block in the search range, determining an optimal motion vector of each subblock, and recording a prediction error of each subblock, which is obtained by predicting the optimal motion vector;
carrying out DIP prediction on all the subblocks to obtain the optimal prediction direction of each subblock, and recording the prediction error of each subblock, which is obtained by predicting the optimal prediction direction;
after prediction errors of all subblocks under IBC prediction and DIP prediction are obtained, determining optimal division and corresponding prediction combinations in all division types through rapid Rate Distortion Optimization (RDO);
and through complete RDO comparison, the coding cost of IBC prediction on the current coding block, the coding cost of DIP prediction on the current coding block and the coding cost of optimal division and corresponding prediction combination are selected, and the prediction mode with the minimum coding cost is selected as the final prediction mode of the current coding block.
2. The method of claim 1, wherein the plurality of partition types comprise:
the method comprises the following steps of (1) covering 28 division types of a horizontal direction, a vertical direction, a diagonal direction from top right to bottom left and a diagonal direction from top left to bottom right, wherein each direction has 7 division types, the division types of the horizontal direction and the vertical direction are collectively called rectangular division, and the division types of the diagonal direction from top right to bottom left and the diagonal direction from top left to bottom right are collectively called triangular division;
or, the two division modes include 7 division types with an L-shaped upper left and 7 division types with an L-shaped upper right, and both the two division modes divide the current coding block into two sub-blocks: one sub-block is a square block, and the other sub-block is an L-shaped block formed by two adjacent rectangular blocks.
3. The method of claim 2, wherein if the plurality of partition types are 28 partition types including a horizontal direction, a vertical direction, a diagonal direction from top right to bottom left, and a diagonal direction from top left to bottom right, determining an optimal motion vector for each sub-block when performing IBC prediction on all sub-blocks, and recording a prediction error of each sub-block obtained by optimal motion vector prediction comprises:
marking 7 divisions in the horizontal direction as H1-H7, and 7 divisions in the vertical direction as V1-V7; 7 types of divisions in the diagonal direction from the upper right to the lower left are marked as T1-T7, and 7 types of divisions in the diagonal direction from the upper left to the lower right are marked as D1-D7;
after the search of each reference block in the search range is completed, the minimum prediction error and the corresponding optimal motion vector of each sub-block in each partition are obtained, and the following marks are carried out:
the optimal motion vectors MV of the upper and lower sub-blocks of the 1 st partition type H1 in the horizontal direction are denoted as MV _ IBC _ H1_1 and MV _ IBC _ H1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ H1_1 and SAD _ IBC _ H1_ 2; by analogy, the optimal motion vectors MV of the upper and lower sub-blocks of the 7 th partition type H7 are respectively denoted as MV _ IBC _ H7_1 and MV _ IBC _ H7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ H7_1 and SAD _ IBC _ H7_ 2;
the optimal motion vectors MV of the left and right sub-blocks of the 1 st partition type V1 in the vertical direction are denoted as MV _ IBC _ V1_1 and MV _ IBC _ V1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ V1_1 and SAD _ IBC _ V1_ 2; by analogy, the optimal motion vectors MV of the left and right sub-blocks of the 7 th partition type V7 are respectively denoted as MV _ IBC _ V7_1 and MV _ IBC _ V7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ V7_1 and SAD _ IBC _ V7_ 2;
the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 1 st partition type T1 in the diagonal direction from the upper right to the lower left are denoted as MV _ IBC _ T1_1 and MV _ IBC _ T1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ T1_1 and SAD _ IBC _ T1_ 2; by analogy, the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 7 th partition type T7 are denoted as MV _ IBC _ T7_1 and MV _ IBC _ T7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ T7_1 and SAD _ IBC _ T7_ 2;
the optimal motion vectors MV of the upper right and lower left sub-blocks of the 1 st partition type D1 in the diagonal direction from top left to bottom right are denoted as MV _ IBC _ D1_1 and MV _ IBC _ D1_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ D1_1 and SAD _ IBC _ D1_ 2; by analogy, the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 7 th partition type T7 are denoted as MV _ IBC _ D7_1 and MV _ IBC _ D7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ D7_1 and SAD _ IBC _ D7_ 2.
4. The method of claim 3, wherein the DIP prediction is performed on all sub-blocks to obtain an optimal prediction direction of each sub-block, and the recording of the prediction error of each sub-block obtained by the optimal prediction direction prediction comprises:
the DIP prediction is that the optimal prediction direction is determined in 35 kinds of intra-frame prediction of HEVC, and after a predicted value in each direction is generated, the prediction error of each sub-block between a predicted block and a current coding block is calculated; after completing the traversal of 35 prediction directions, the minimum prediction error and corresponding intra prediction direction of each sub-block in each partition are obtained, and the following labels are performed:
the optimal prediction directions of the upper and lower sub-blocks of the 1 st partition type H1 in the horizontal direction are denoted as Mode _ DIP _ H1_1 and Mode _ DIP _ H1_2, respectively, and the corresponding prediction errors are denoted as SAD _ DIP _ H1_1 and SAD _ DIP _ H1_ 2; by analogy, the optimal prediction directions of the upper and lower sub-blocks of the 7 th partition type H7 are respectively denoted as Mode _ DIP _ H7_1 and Mode _ DIP _ H7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ H7_1 and SAD _ DIP _ H7_ 2;
the optimal prediction directions of the left and right sub-blocks of the 1 st partition type V1 in the vertical direction are denoted as Mode _ DIP _ V1_1 and Mode _ DIP _ V1_2, respectively, and the corresponding prediction errors are denoted as SAD _ DIP _ V1_1 and SAD _ DIP _ V1_ 2; by analogy, the optimal prediction directions of the left and right sub-blocks of the 7 th partition type H7 are respectively denoted as Mode _ DIP _ V7_1 and Mode _ DIP _ V7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ V7_1 and SAD _ DIP _ V7_ 2;
the optimal prediction directions of the two sub-blocks at the top left and the bottom right of the 1 st partition type T1 in the diagonal direction from top right to bottom left are respectively denoted as Mode _ DIP _ T1_1 and Mode _ DIP _ T1_2, and the corresponding prediction errors are denoted as SAD _ DIP _ T1_1 and SAD _ DIP _ T1_ 2; by analogy, the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 7 th partition type T7 are respectively denoted as Mode _ DIP _ T7_1 and Mode _ DIP _ T7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ T7_1 and SAD _ DIP _ T7_ 2;
the optimal prediction directions of the upper right and lower left sub-blocks of the 1 st partition type D1 in the diagonal direction from the top left to the bottom right are referred to as Mode _ DIP _ D1_1 and Mode _ DIP _ D1_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ D1_1 and SAD _ DIP _ D1_ 2; by analogy, the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 7 th partition type T7 are respectively denoted as Mode _ DIP _ D7_1 and Mode _ DIP _ D7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ D7_1 and SAD _ DIP _ D7_ 2.
5. The method of claim 4, wherein determining the optimal partition and corresponding prediction combination among all partition types by fast Rate Distortion Optimization (RDO) comprises:
determining the partition and prediction combination with the minimum total cost in 7 partition types in the horizontal direction, the vertical direction, the diagonal direction from the top right to the bottom left and the diagonal direction from the top left to the bottom right respectively, wherein the process is as follows:
of the 7 division types in the horizontal directions H1-H7, there are 14 combinations, and the corresponding costs are:
C _ H _ i _ 1 = S A D _ I B C _ H i _ 1 + S A D _ D I P _ H i _ 2 + &lambda; &times; B i t s ( M V _ I B C _ H i _ 1 , M o d e _ D I P _ H i _ 2 )
C _ H _ i _ 2 = S A D _ I B C _ H i _ 2 + S A D _ D I P _ H i _ 1 + &lambda; &times; B i t s ( M V _ I B C _ H i _ 2 , M o d e _ D I P _ H i _ 1 ) ;
in the above formula, i is 1, 2.., 7; λ is a lagrange multiplier determined by a parameter specified by the encoder, and the Bits function is an estimate of the number of Bits consumed for entropy coding the MV and DIP directions; finding out the minimum combination of C _ H _ i _1 and C _ H _ i _2, and marking the minimum combination as C _ H _ k1_ p1, and marking the corresponding prediction modes as (k1 and p1), wherein k1 is one number from 1 to 7, and the division type is Hk 1; p1 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the left part carries out IBC prediction, the right part carries out DIP prediction, and 2 is the opposite;
among the 7 division types of the vertical directions V1-V7, there are 14 combinations, and the corresponding costs are:
C _ V _ i _ 1 = S A D _ I B C _ V i _ 1 + S A D _ D I P _ V i _ 2 + &lambda; &times; B i t s ( M V _ I B C _ V i _ 1 , M o d e _ D I P _ V i _ 2 )
C _ V _ i _ 2 = S A D _ I B C _ V i _ 2 + S A D _ D I P _ V i _ 1 + &lambda; &times; B i t s ( M V _ I B C _ V i _ 2 , M o d e _ D I P _ V i _ 1 ) ;
finding out the minimum combination of C _ V _ i _1 and C _ V _ i _2 from the above formula, and marking the minimum combination as C _ V _ k2_ p2, and marking the corresponding prediction modes as (k2 and p2), wherein k2 is one number from 1 to 7, which indicates that the partition type is Vk 2; p2 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the upper part carries out IBC prediction, the lower part carries out DIP prediction, and 2 is vice versa;
in 7 divisions from the upper right to the lower left diagonal direction T1 to T7, there are 14 combinations, and the corresponding costs are:
C _ T _ i _ 1 = S A D _ I B C _ T i _ 1 + S A D _ D I P _ T i _ 2 + &lambda; &times; B i t s ( M V _ I B C _ T i _ 1 , M o d e _ D I P _ T i _ 2 )
C _ T _ i _ 2 = S A D _ I B C _ T i _ 2 + S A D _ D I P _ T i _ 1 + &lambda; &times; B i t s ( M V _ I B C _ T i _ 2 , M o d e _ D I P _ T i _ 1 ) ;
finding out the minimum combination of C _ T _ i _1 and C _ T _ i _2 from the above formula, and marking the minimum combination as C _ T _ k3_ p3, and marking the corresponding prediction modes as (k3 and p3), wherein k3 is one number from 1 to 7, which indicates that the partition type is Tk 3; p3 is one of 1 to 2, which indicates the prediction combination mode, wherein 1 means that IBC prediction is carried out on the upper left part, DIP prediction is carried out on the lower right part, and the other way is not carried out on 2;
of the 7 divisions in the diagonal directions D1-D7 from top left to bottom right, there are 14 combinations, and the corresponding costs are:
C _ D _ i _ 1 = S A D _ I B C _ D i _ 1 + S A D _ D I P _ D i _ 2 + &lambda; &times; B i t s ( M V _ I B C _ D i _ 1 , M o d e _ D I P _ D i _ 2 )
C _ D _ i _ 2 = S A D _ I B C _ D i _ 2 + S A D _ D I P _ D i _ 1 + &lambda; &times; B i t s ( M V _ I B C _ D i _ 2 , M o d e _ D I P _ D i _ 1 )
finding out the minimum combination of C _ D _ i _1 and C _ D _ i _2 from the above formula, and marking the minimum combination as C _ D _ k4_ p4, and marking the corresponding prediction modes as (k4 and p4), wherein k4 is one number from 1 to 7, which indicates that the partition type is Dk 4; p4 is one of numbers 1 to 2 indicating the prediction combination, 1 means IBC prediction in the upper right part and DIP prediction in the lower left part, and 2 is the opposite.
6. The method of claim 5, wherein the selecting the prediction mode with the lowest coding cost as the final prediction mode of the current coding block comprises:
carrying out DIP prediction on a current coding block, and recording the coding cost calculated by complete RDO as C _ DIP;
IBC prediction is carried out on the current coding block, and the coding cost calculated by complete RDO is recorded as C _ IBC;
for the horizontal direction, from the prediction mode (k1, p1), the intra prediction direction is determined according to the corresponding motion vector MV _ IBC _ Hk1_ p1Generating a prediction block of the current block by the partitioning type Hk1, and recording the coding cost calculated by the complete RDO as C _ H; wherein,
for the vertical direction, from the prediction mode (k2, p2), the intra prediction direction is determined according to the corresponding motion vector MV _ IBC _ Vk2_ p2Generating a prediction block of the current block by the division type Vk2, and recording the coding cost calculated by the complete RDO as C _ V; wherein,
for diagonal directions from top right to bottom left, the intra prediction direction is determined by the prediction mode (k3, p3) according to the corresponding motion vector MV _ IBC _ Tk3_ p3And the partition type Tk3 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ T; wherein,
for diagonal directions from top left to bottom right, the intra prediction direction is determined by the prediction mode (k4, p4) according to the corresponding motion vector MV _ IBC _ Dk4_ p4And the partition type Dk4 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ D;
and comparing the sizes of the C _ DIP, the C _ IBC and the C _ H, C _ V, C _ T, C _ D, and taking the prediction mode corresponding to the minimum coding cost as the final prediction mode of the current coding block.
7. The method of claim 2, wherein if the plurality of partition types include 7 partition types with an L-shaped upper left and 7 partition types with an L-shaped upper right, determining an optimal motion vector for each sub-block when performing IBC prediction on all sub-blocks, and recording a prediction error of each sub-block, which is predicted by the optimal motion vector, comprises:
recording 7 partition types with L-shaped upper left as L1-L7, and recording 7 partition types with L-shaped upper right as R1-R7;
after the search of each reference block in the search range is completed, the minimum prediction error and the corresponding optimal motion vector of each sub-block in each partition are obtained, and the following marks are carried out:
the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 1 st partition type L1 in the L-type at the upper left are respectively denoted as MV _ IBC _ L1_1 and MV _ IBC _ L1_2, and the corresponding prediction errors are denoted as SAD _ IBC _ L1_1 and SAD _ IBC _ L1_ 2; by analogy, the optimal motion vectors MV of the upper left sub-block and the lower right sub-block of the 7 th partition type L7 are respectively denoted as MV _ IBC _ L7_1 and MV _ IBC _ L7_2, and the corresponding prediction errors are denoted as SAD _ IBC _ L7_1 and SAD _ IBC _ L7_ 2;
the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 1 st partition type R1 in the L-type at the upper right are respectively denoted as MV _ IBC _ R1_1 and MV _ IBC _ R1_2, and the corresponding prediction errors are denoted as SAD _ IBC _ R1_1 and SAD _ IBC _ R1_ 2; by analogy, the optimal motion vectors MV of the upper right sub-block and the lower left sub-block of the 7 th partition type R7 are denoted as MV _ IBC _ R7_1 and MV _ IBC _ R7_2, respectively, and the corresponding prediction errors are denoted as SAD _ IBC _ R7_1 and SAD _ IBC _ R7_ 2.
8. The method of claim 7, wherein the DIP prediction is performed on all sub-blocks to obtain an optimal prediction direction of each sub-block, and the recording of the prediction error of each sub-block obtained by the optimal prediction direction prediction comprises:
the DIP prediction is that the optimal prediction direction is determined in 35 kinds of intra-frame prediction of HEVC, and after a predicted value in each direction is generated, the prediction error of each sub-block between a predicted block and a current coding block is calculated; after completing the traversal of 35 prediction directions, the minimum prediction error and corresponding intra prediction direction of each sub-block in each partition are obtained, and the following labels are performed:
the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 1 st partition type L1 in the L-type at the upper left are respectively denoted as Mode _ DIP _ L1_1 and Mode _ DIP _ L1_2, and the corresponding prediction errors are denoted as SAD _ DIP _ L1_1 and SAD _ DIP _ L1_ 2; by analogy, the optimal prediction directions of the upper left sub-block and the lower right sub-block of the 7 th partition type L7 are respectively denoted as Mode _ DIP _ L7_1 and Mode _ DIP _ L7_2, and the corresponding prediction errors are denoted as SAD _ DIP _ L7_1 and SAD _ DIP _ L7_ 2;
the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 1 st partition type R1 in the upper right sub-block are referred to as Mode _ DIP _ R1_1 and Mode _ DIP _ R1_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ R1_1 and SAD _ DIP _ R1_ 2; by analogy, the optimal prediction directions of the upper right sub-block and the lower left sub-block of the 7 th partition type R7 are referred to as Mode _ DIP _ R7_1 and Mode _ DIP _ R7_2, respectively, and the corresponding prediction errors are referred to as SAD _ DIP _ R7_1 and SAD _ DIP _ R7_ 2.
9. The method of claim 8, wherein determining the optimal partition and corresponding prediction combination among all partition types by fast Rate Distortion Optimization (RDO) comprises:
determining the partition and prediction combination with the minimum overall cost in 7 partition types of L-shaped at the upper left and L-shaped at the upper right, wherein the process is as follows:
of the 7 partition types L1-L7 at the top left, there are 14 combinations, and the corresponding costs are:
C _ L _ i _ 1 = S A D _ I B C _ L i _ 1 + S A D _ D I P _ L i _ 2 + &lambda; &times; B i t s ( M V _ I B C _ L i _ 1 , M o d e _ D I P _ L i _ 2 )
C _ L _ i _ 2 = S A D _ I B C _ L i _ 2 + S A D _ D I P _ L i _ 1 + &lambda; &times; B i t s ( M V _ I B C _ L i _ 2 , M o d e _ D I P _ L i _ 1 ) ;
in the above formula, i is 1, 2.., 7; the Bits function is an estimate of the number of Bits consumed for entropy coding of MV and DIP directions; finding out the minimum combination of C _ L _ i _1 and C _ L _ i _2, and marking the minimum combination as C _ L _ k1_ p1, and marking the corresponding prediction modes as (k1 and p1), wherein k1 is one number from 1 to 7, and the division type is Lk 1; p1 is one of 1 to 2, which indicates the prediction combination mode, 1 means that the upper left L-shaped part is subjected to IBC prediction, the lower right square part is subjected to DIP prediction, and 2 is the opposite;
in the 7 division types of L-type R1-R7 at the upper right, there are 14 combinations, and the corresponding costs are respectively:
C _ R _ i _ 1 = S A D _ I B C _ R i _ 1 + S A D _ D I P _ R i _ 2 + &lambda; &times; B i t s ( M V _ I B C _ R i _ 1 , M o d e _ D I P _ R i _ 2 )
C _ R _ i _ 2 = S A D _ I B C _ R i _ 2 + S A D _ D I P _ R i _ 1 + &lambda; &times; B i t s ( M V _ I B C _ R i _ 2 , M o d e _ D I P _ R i _ 1 ) ;
finding out the minimum combination of C _ R _ i _1 and C _ R _ i _2, which is marked as C _ R _ k2_ p2, and the corresponding prediction modes are marked as (k2 and p2), wherein k2 is a number from 1 to 7, and the division position is Rk 2; p2 is one of numbers 1 to 2 indicating the prediction combination, 1 means that the upper right L-shaped part is subjected to IBC prediction, the lower left square part is subjected to DIP prediction, and 2 is the opposite.
10. The method of claim 9, wherein the selecting the prediction mode with the lowest coding cost as the final prediction mode of the current coding block comprises:
carrying out DIP prediction on a current coding block, and recording the coding cost calculated by complete RDO as C _ DIP;
IBC prediction is carried out on the current coding block, and the coding cost calculated by complete RDO is recorded as C _ IBC;
for the partition type with L-shaped upper left, the prediction mode (k1, p1) is based on the corresponding motion vector MV _ IBC _ Lk1_ p1 and the intra prediction directionAnd dividing the type Lk1 to generate a prediction block of the current block, and recording the coding cost calculated by the complete RDO as C _ L; wherein,
for the partition type with L-type at the upper right, the intra prediction direction is determined by the prediction mode (k2, p2) according to the corresponding motion vector MV _ IBC _ Rk2_ p2And the partition type Rk2 generates a prediction block of the current block, and the coding cost calculated by the complete RDO is recorded as C _ R; wherein,
and comparing the sizes of the C _ DIP, the C _ IBC and the C _ L, C _ R, and taking the prediction mode corresponding to the minimum coding cost as the final prediction mode of the current coding block.
CN201610795564.8A 2016-08-31 2016-08-31 A kind of bonding position prediction and block replicate the video intra-frame encoding method of prediction Active CN106375764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610795564.8A CN106375764B (en) 2016-08-31 2016-08-31 A kind of bonding position prediction and block replicate the video intra-frame encoding method of prediction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610795564.8A CN106375764B (en) 2016-08-31 2016-08-31 A kind of bonding position prediction and block replicate the video intra-frame encoding method of prediction

Publications (2)

Publication Number Publication Date
CN106375764A true CN106375764A (en) 2017-02-01
CN106375764B CN106375764B (en) 2018-04-10

Family

ID=57899784

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610795564.8A Active CN106375764B (en) 2016-08-31 2016-08-31 A kind of bonding position prediction and block replicate the video intra-frame encoding method of prediction

Country Status (1)

Country Link
CN (1) CN106375764B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107155108A (en) * 2017-06-19 2017-09-12 电子科技大学 A kind of intra-frame prediction method changed based on brightness
CN109819255A (en) * 2018-12-28 2019-05-28 杭州海康威视数字技术股份有限公司 A kind of decoding method and its equipment
WO2020182052A1 (en) * 2019-03-11 2020-09-17 Huawei Technologies Co., Ltd. An encoder, a decoder and corresponding methods restricting size of sub-partitions from intra sub-partition coding mode tool
WO2020244503A1 (en) * 2019-06-03 2020-12-10 Beijing Bytedance Network Technology Co., Ltd. Intra block copy with triangular partitions
WO2020244536A1 (en) * 2019-06-03 2020-12-10 Beijing Bytedance Network Technology Co., Ltd. Combined intra and intra-block copy prediction for video coding
WO2020259610A1 (en) * 2019-06-25 2020-12-30 Zhejiang Dahua Technology Co., Ltd. Systems and methods for inter-frame prediction
CN113940082A (en) * 2019-06-06 2022-01-14 北京字节跳动网络技术有限公司 Interaction between sub-block based intra block copying and different coding and decoding tools
CN114365499A (en) * 2020-04-09 2022-04-15 腾讯美国有限责任公司 Intra-frame coding using L-shaped partition trees
WO2022104498A1 (en) * 2020-11-17 2022-05-27 Oppo广东移动通信有限公司 Intra-frame prediction method, encoder, decoder and computer storage medium
CN116569553A (en) * 2021-10-04 2023-08-08 腾讯美国有限责任公司 Method and apparatus for intra block copy prediction using sample padding
US12088786B2 (en) 2019-06-22 2024-09-10 Beijing Bytedance Network Technology Co., Ltd Motion candidate list construction for intra block copy mode

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101715135A (en) * 2009-09-30 2010-05-26 武汉大学 Template matching based method for encoding self-adaption intra-frame prediction filtering
CN102067601A (en) * 2008-04-11 2011-05-18 汤姆森特许公司 Methods and apparatus for template matching prediction (TMP) in video encoding and decoding
CN102595118A (en) * 2011-01-14 2012-07-18 华为技术有限公司 Prediction method and predictor in encoding and decoding
JP2013021507A (en) * 2011-07-11 2013-01-31 Jvc Kenwood Corp Image decoder, image decoding method and image decoding program
CN103609121A (en) * 2011-06-20 2014-02-26 高通股份有限公司 Unified merge mode and adaptive motion vector prediction mode candidates selection
CN103929641A (en) * 2014-05-12 2014-07-16 北京工商大学 Intra-frame encoding method based on virtual reference frame
CN105493507A (en) * 2013-08-27 2016-04-13 高通股份有限公司 Residual prediction for intra block copying

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102067601A (en) * 2008-04-11 2011-05-18 汤姆森特许公司 Methods and apparatus for template matching prediction (TMP) in video encoding and decoding
CN101715135A (en) * 2009-09-30 2010-05-26 武汉大学 Template matching based method for encoding self-adaption intra-frame prediction filtering
CN102595118A (en) * 2011-01-14 2012-07-18 华为技术有限公司 Prediction method and predictor in encoding and decoding
CN103609121A (en) * 2011-06-20 2014-02-26 高通股份有限公司 Unified merge mode and adaptive motion vector prediction mode candidates selection
JP2013021507A (en) * 2011-07-11 2013-01-31 Jvc Kenwood Corp Image decoder, image decoding method and image decoding program
CN105493507A (en) * 2013-08-27 2016-04-13 高通股份有限公司 Residual prediction for intra block copying
CN103929641A (en) * 2014-05-12 2014-07-16 北京工商大学 Intra-frame encoding method based on virtual reference frame

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DO-KYOUNG KWON,MADHUKAR BUDAGAVI: "Fast intra block copy(IntraBC) search for HEVC screen content coding using non-square intra block copy for HEVC", 《CIRCUITS AND SYSTEMS,2014 IEEE INTERNATIONAL SYMPOSIUM ON,DOI:10.1109/ISCAS.2014.6865052》 *
HAOMING CHEN*, YU-SHENG CHEN*, MING-TING SUN*: "Improvements on Intra Block Copy in Natural", 《2015 IEEE INTERNATIONAL SYMPOSIUM ON CIRCUITS AND SYSTEMS》 *

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107155108B (en) * 2017-06-19 2019-07-12 电子科技大学 A kind of intra-frame prediction method based on brightness change
CN107155108A (en) * 2017-06-19 2017-09-12 电子科技大学 A kind of intra-frame prediction method changed based on brightness
US11889072B2 (en) 2018-12-28 2024-01-30 Hangzhou Hikvision Digital Technology Co., Ltd. Video encoding and decoding
CN109819255A (en) * 2018-12-28 2019-05-28 杭州海康威视数字技术股份有限公司 A kind of decoding method and its equipment
WO2020135033A1 (en) * 2018-12-28 2020-07-02 杭州海康威视数字技术股份有限公司 Video encoding and decoding
WO2020182052A1 (en) * 2019-03-11 2020-09-17 Huawei Technologies Co., Ltd. An encoder, a decoder and corresponding methods restricting size of sub-partitions from intra sub-partition coding mode tool
US11973945B2 (en) 2019-03-11 2024-04-30 Huawei Technologies Co., Ltd. Encoder, a decoder and corresponding methods restricting size of sub-partitions from intra sub-partition coding mode tool
WO2020244503A1 (en) * 2019-06-03 2020-12-10 Beijing Bytedance Network Technology Co., Ltd. Intra block copy with triangular partitions
WO2020244536A1 (en) * 2019-06-03 2020-12-10 Beijing Bytedance Network Technology Co., Ltd. Combined intra and intra-block copy prediction for video coding
CN113940082A (en) * 2019-06-06 2022-01-14 北京字节跳动网络技术有限公司 Interaction between sub-block based intra block copying and different coding and decoding tools
US12075031B2 (en) 2019-06-06 2024-08-27 Beijing Bytedance Network Technology Co., Ltd Interactions between sub-block based intra block copy and different coding tools
US12088786B2 (en) 2019-06-22 2024-09-10 Beijing Bytedance Network Technology Co., Ltd Motion candidate list construction for intra block copy mode
WO2020259610A1 (en) * 2019-06-25 2020-12-30 Zhejiang Dahua Technology Co., Ltd. Systems and methods for inter-frame prediction
US12028512B2 (en) 2019-06-25 2024-07-02 Zhejiang Dahua Technology Co., Ltd. Systems and methods for inter-frame prediction
CN114365499A (en) * 2020-04-09 2022-04-15 腾讯美国有限责任公司 Intra-frame coding using L-shaped partition trees
US11523112B2 (en) 2020-04-09 2022-12-06 Tencent America LLC Intra coding with L-type partitioning tree
EP4277273A3 (en) * 2020-04-09 2024-01-24 Tencent America LLC Intra coding with l-type partitioning tree
CN114365499B (en) * 2020-04-09 2024-08-27 腾讯美国有限责任公司 Video encoding method, video encoding device and computer readable medium
WO2022104498A1 (en) * 2020-11-17 2022-05-27 Oppo广东移动通信有限公司 Intra-frame prediction method, encoder, decoder and computer storage medium
CN116569553A (en) * 2021-10-04 2023-08-08 腾讯美国有限责任公司 Method and apparatus for intra block copy prediction using sample padding

Also Published As

Publication number Publication date
CN106375764B (en) 2018-04-10

Similar Documents

Publication Publication Date Title
CN106375764B (en) A kind of bonding position prediction and block replicate the video intra-frame encoding method of prediction
US20200244986A1 (en) Picture prediction method and related apparatus
US8705611B2 (en) Image prediction encoding device, image prediction encoding method, image prediction encoding program, image prediction decoding device, image prediction decoding method, and image prediction decoding program
JP7355894B2 (en) Bit width control method and device for bidirectional optical flow
US11902563B2 (en) Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
CN112385211B (en) Motion compensation for video encoding and decoding
CN110290388B (en) Intra-frame prediction method, video encoding method, computer device and storage device
WO2017005146A1 (en) Video encoding and decoding method and device
WO2017005128A1 (en) Image prediction method and related device
WO2022104498A1 (en) Intra-frame prediction method, encoder, decoder and computer storage medium
CN107925759A (en) Method and apparatus for coding and decoding infra-frame prediction
CN104363451A (en) Image forecasting method and related device
US20080002772A1 (en) Motion vector estimation method
BR112012022951B1 (en) Method and device for predictive video encoding
BR112020025916A2 (en) METHOD FOR DECODING A VIDEO SIGNAL
CN108449599B (en) Video coding and decoding method based on surface transmission transformation
US20210258601A1 (en) Image encoding/decoding method and apparatus
US11245905B2 (en) Method and apparatus for blended intra prediction
CN115996290B (en) Bidirectional optical flow method for decoding video signal, computing device and storage medium
CN112449181B (en) Encoding and decoding method, device and equipment
CN111327901A (en) Video encoding method, video encoding device, storage medium and encoding device
Pakdaman et al. Fast and efficient intra mode decision for HEVC, based on dual-tree complex wavelet
CN112887732B (en) Method and device for inter-frame and intra-frame joint prediction coding and decoding with configurable weight
CN114979631B (en) Method and apparatus for predictive refinement using optical flow, bi-directional optical flow, and decoder-side motion vector refinement
CN110475116B (en) Motion vector deriving method and device and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant