CN116074519A - Intra-frame prediction method, encoding method, decoding method and device - Google Patents

Intra-frame prediction method, encoding method, decoding method and device Download PDF

Info

Publication number
CN116074519A
CN116074519A CN202211462464.5A CN202211462464A CN116074519A CN 116074519 A CN116074519 A CN 116074519A CN 202211462464 A CN202211462464 A CN 202211462464A CN 116074519 A CN116074519 A CN 116074519A
Authority
CN
China
Prior art keywords
prediction mode
prediction
current block
block
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.)
Pending
Application number
CN202211462464.5A
Other languages
Chinese (zh)
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202211462464.5A priority Critical patent/CN116074519A/en
Publication of CN116074519A publication Critical patent/CN116074519A/en
Pending legal-status Critical Current

Links

Images

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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • 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/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/88Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving rearrangement of data among different coding units, e.g. shuffling, interleaving, scrambling or permutation of pixel data or permutation of transform coefficient data among different blocks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The application discloses an intra-frame prediction method, a method for encoding video or image, a method and a device for decoding video or image code stream. The intra prediction method includes: constructing an intra prediction mode candidate list of the current block; dividing the current block based on a division mode corresponding to each prediction mode in the candidate list to obtain a division result of the current block corresponding to each prediction mode; predicting all sub-blocks in the division result of each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode; the best prediction mode of the current block is determined based on the prediction blocks of the current block corresponding to all prediction modes. The method and the device can improve the intra-frame prediction effect.

Description

Intra-frame prediction method, encoding method, decoding method and device
Technical Field
The present invention relates to the field of image encoding and decoding technologies, and in particular, to an intra-frame prediction method, a method for encoding a video or an image, and a method and apparatus for decoding a video or an image code stream.
Background
Because the video image data volume is relatively large, it is usually required to encode and compress the video image data, the compressed data is called a video code stream, and the video code stream is transmitted to a user terminal through a wired or wireless network and then decoded and watched.
The whole video coding flow comprises the processes of prediction, transformation, quantization, entropy coding and the like. Wherein the prediction is divided into two parts, intra prediction and inter prediction. In the long-term research and development process, the inventor of the application finds that the current intra-frame prediction method has certain limitation and influences the intra-frame prediction effect to a certain extent.
Disclosure of Invention
The application provides an intra-frame prediction method, a method for encoding video or image, a method and a device for decoding video or image code stream, which can improve the prediction effect.
To achieve the above object, the present application provides an intra prediction method, including:
constructing an intra prediction mode candidate list of the current block;
dividing the current block based on a division mode corresponding to each prediction mode in the candidate list to obtain a division result of the current block corresponding to each prediction mode;
predicting all sub-blocks in the division result of each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode;
the best prediction mode of the current block is determined based on the prediction blocks of the current block corresponding to all prediction modes.
In an embodiment, dividing the current block based on a division mode corresponding to each prediction mode in the candidate list to obtain a division result of the current block corresponding to each prediction mode;
Determining a partition direction corresponding to each prediction mode;
the current block is divided into at least two sub-blocks along a division direction.
In an embodiment, dividing the current block into at least two sub-blocks along the dividing direction includes:
dividing the current block into at least two sub-blocks according to a preset proportion along the dividing direction.
In an embodiment, predicting all sub-blocks in the division result of each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode includes:
determining a prediction mode of each sub-block based on gradient information of adjacent reconstructed pixels of each sub-block in at least part of sub-blocks in a division result of each prediction mode;
each sub-block is predicted in a prediction mode of each sub-block to obtain a prediction block of the current block corresponding to each prediction mode.
In an embodiment, determining a prediction mode for each sub-block based on gradient information of neighboring reconstructed pixels of each sub-block in at least some of the sub-blocks in the division result of each prediction mode includes:
calculating the horizontal gradient and the vertical gradient of each adjacent reconstructed pixel of each sub-block;
deriving a gradient angle and an amplitude value of each adjacent reconstructed pixel based on the horizontal gradient and the vertical gradient of each adjacent reconstructed pixel;
Converting the gradient angle into a corresponding prediction mode to determine a prediction mode corresponding to each adjacent reconstructed pixel;
and counting the prediction modes corresponding to all adjacent reconstructed pixels of each sub-block, determining the prediction mode with the highest amplitude of each sub-block, and taking the prediction mode with the highest amplitude of each sub-block as the prediction mode of each sub-block.
In an embodiment, predicting all sub-blocks in the division result of each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode includes:
gradually shifting a plurality of angles on each prediction mode according to the sequence of the sub-blocks in the division result of each prediction mode so as to determine the prediction mode corresponding to each sub-block in the division result of each prediction mode; predicting each sub-block by using a prediction mode corresponding to each sub-block to obtain a prediction block of the current block corresponding to each prediction mode; or alternatively, the first and second heat exchangers may be,
and predicting each sub-block according to each prediction mode and based on adjacent reference pixels of each sub-block in the division result of each prediction mode, so as to obtain a prediction block of the current block corresponding to each prediction mode.
In an embodiment, constructing an intra prediction mode candidate list of a current block includes:
An intra prediction mode candidate list is constructed based on the MPM tool, the TIMD tool, and/or the DIMD tool.
In one embodiment, constructing the intra prediction mode candidate list based on the MPM tool, the TIMD tool, and/or the DIMD tool includes:
at least one intermediate prediction mode of the current block determined by each of the MPM tool, the TIMD tool and/or the DIMD tool is added to the candidate list, and/or at least one final mode of the current block determined by each of the MPM tool, the TIMD tool and/or the DIMD tool is added to the candidate list to obtain an intra-prediction mode candidate list of the current block.
To achieve the above object, the present application further provides a method of encoding video or image, the method comprising:
determining a final prediction block of a current block in the image based on the above prediction method;
the current block is encoded based on the final prediction block.
In an embodiment, encoding the current block based on the final prediction block includes:
values of preset syntax elements are set in the encoded bitstream, wherein different values of the preset syntax elements represent whether a prediction method is enabled.
In an embodiment, encoding the current block based on the final prediction block includes:
And encoding index information of a prediction mode corresponding to the final prediction block in the intra-frame prediction mode candidate list to obtain an encoded code stream.
To achieve the above object, the present application further provides a method for decoding a video or image bitstream, the method comprising:
determining a final prediction block of a current block in the image based on the above prediction method;
the current block is decoded based on the final prediction block.
To achieve the above object, the present application also provides a decoder including a processor; the processor is configured to execute instructions to implement the steps of the above-described method.
To achieve the above object, the present application also provides an encoder including a processor; the processor is configured to execute instructions to implement the steps of the above-described method.
To achieve the above object, the present application also provides a computer readable storage medium storing instructions/program data capable of being executed to implement the above method.
The intra-frame prediction method comprises the steps of dividing a current block based on a division mode corresponding to each prediction mode in a candidate list, and obtaining a division result of the current block corresponding to each prediction mode; then, predicting each sub-block in the division result of the current block corresponding to each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode; and then determining the optimal prediction mode of the current block based on all prediction blocks of the current block. In this way, in the embodiment, when the prediction mode in the prediction mode candidate list is traversed, the current block is divided by using the division mode corresponding to each prediction mode, so that the division mode of the current block is more flexible and changeable, and is convenient to better adapt to the actual image content, thereby being convenient to improve the compression efficiency; and the prediction mode is corresponding to the division mode, and when the prediction is performed in the corresponding prediction mode, the current block can be divided in the division mode which is adaptive to the prediction mode, so that the prediction effect is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a schematic diagram of a partitioning method used by an intra prediction method;
FIG. 2 is a schematic diagram of another partitioning method used by an intra prediction method;
FIG. 3 is a flow chart of an embodiment of an intra prediction method of the present application;
FIG. 4 is a schematic diagram of a partitioning method used by the intra prediction method of the present application;
FIG. 5 is a schematic diagram of another partitioning method used by the intra prediction method of the present application;
FIG. 6 is a schematic diagram of yet another partitioning method used by the intra prediction method of the present application;
FIG. 7 is a schematic diagram of yet another partitioning method used by the intra prediction method of the present application;
FIG. 8 is a schematic diagram of another partitioning method used by the intra prediction method of the present application;
FIG. 9 is a flow chart of an embodiment of a method of encoding video or images according to the present application;
FIG. 10 is a flow chart of an embodiment of a method of decoding a video or image bitstream according to the present application;
FIG. 11 is a schematic diagram of an embodiment of an encoder of the present application;
FIG. 12 is a schematic diagram of an embodiment of a decoder of the present application;
fig. 13 is a schematic structural view of an embodiment of the computer readable storage medium of the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure. In addition, the term "or" as used herein refers to a non-exclusive "or" (i.e., "and/or") unless otherwise indicated (e.g., "or otherwise" or in the alternative "). Also, the various embodiments described herein are not necessarily mutually exclusive, as some embodiments may be combined with one or more other embodiments to form new embodiments.
An intra prediction method includes two processes of prediction mode candidate list construction and prediction mode decision.
(1) Prediction mode candidate list construction
An empty candidate list is first constructed, then candidate prediction modes are added in three stages, namely primary roughing, secondary roughing and MPM (Most Probable Mode ) addition.
Primary roughing stage: the hadamard costs of 0, 1 and even numbered prediction modes are calculated, and the candidate list only retains the lowest 3 prediction modes in the order of the hadamard costs from low to high.
And (3) a secondary roughing stage: and calculating the Hadamard cost of the adjacent angle prediction modes of the first roughing angle prediction modes (the mode numbers are more than 0 and less than 66), and only reserving 3 prediction modes with the lowest Hadamard cost in the first roughing stage and the second roughing stage according to the sequence of the Hadamard cost from low to high.
MPM addition stage: an MPM list is constructed by adjacent encoded blocks, and prediction modes in the MPM list are added to the candidate list. If the prediction mode in the MPM list is already in the candidate list, no addition is performed.
(2) Prediction mode decision
The prediction mode with the lowest rate-distortion cost is selected as the final prediction mode by comparing the rate-distortion costs of the prediction modes in the candidate list.
In addition, in the prediction mode decision process, the current coding block needs to be divided into a plurality of sub-blocks. The dividing rule comprises dividing conditions, dividing directions and modes, and is specifically as follows:
1) Dividing conditions: only the coded blocks with sizes between 4x4 and 64x64 are sub-block divided, and no sub-block division is performed for other sizes. Wherein for 4x8 and 8x4 coding blocks are divided into 2 sub-blocks, the other size coding blocks are divided into 4 sub-blocks.
2) Dividing direction and mode: as shown in fig. 1 and 2, the division direction and the division manner in which CU blocks of different sizes are divided into sub-blocks are respectively described. The dividing direction is divided into vertical and horizontal directions, and the dividing mode is uniform division. Each coding block can be divided only once, vertical and horizontal division cannot be performed simultaneously under the same division, and each sub-block has the same size, and each sub-block contains 16 pixels at least, i.e., width×height > =16.
In particular, each sub-block uses the same prediction mode.
It can be seen that the above intra prediction method has a relatively simple dividing manner of the current block, and has a limitation on the size of the application, which is disadvantageous in terms of improvement of coding efficiency.
Based on the above, the present application proposes a new intra-frame prediction method, which divides a current block based on a division mode corresponding to each prediction mode in a candidate list, so as to obtain a division result of the current block corresponding to each prediction mode; then, predicting each sub-block in the division result of the current block corresponding to each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode; and then determining the optimal prediction mode of the current block based on all prediction blocks of the current block. In this way, in the embodiment, when the prediction mode in the prediction mode candidate list is traversed, the current block is divided by using the division mode corresponding to each prediction mode, so that the division mode of the current block is more flexible and changeable, and is convenient to better adapt to the actual image content, thereby being convenient to improve the compression efficiency; and the prediction mode is corresponding to the division mode, and when the prediction is performed in the corresponding prediction mode, the current block can be divided in the division mode which is adaptive to the prediction mode, so that the prediction effect is improved.
Specifically, as shown in fig. 3, a new intra prediction method proposed in the present application specifically includes the following steps. It should be noted that the following step numbers are only for simplifying the description, and are not intended to limit the execution order of the steps, and the execution order of the steps of the present embodiment may be arbitrarily changed without departing from the technical idea of the present application.
S101: an intra prediction mode candidate list of the current block is constructed.
An intra prediction mode candidate list of the current block may be constructed so that each prediction mode in the prediction mode candidate list is subsequently traversed, and then the optimal prediction mode of the current block is determined based on the traversing result.
Among them, there are various methods of constructing the intra prediction mode candidate list of the current block, and no specific limitation is made herein.
In a first possible manner, the intra-prediction mode candidate list of the current block may be constructed based on tools such as MPM, TIMD, and/or DIMD, so that a more flexible and complex manner is used in constructing the prediction mode candidate list, diversity of prediction modes may be enriched, and prior information is introduced in constructing the candidate list (for example, using existing modes in existing intra-frame tools), so that compression efficiency may be effectively improved. Specifically, at least one intermediate prediction mode and/or at least one final mode of the MPM, TIMD, DIMD, or the like may be added to the candidate list to obtain an intra-prediction mode candidate list for the current block. Wherein the order of addition of the tools is not limited. Preferably, when constructing the candidate list, redundant modes between tools may be removed to avoid multiple identical prediction modes in the candidate list.
Preferably, in the case that a part of modes in the intermediate prediction mode/final mode of the current block determined by a tool (e.g., MPM tool, DIMD tool, or TIMD tool) is added to the candidate list, the part of modes added to the candidate list is at least one mode ordered before the intermediate prediction mode/final mode of the current block determined by the tool, so that the better prediction mode determined by each tool is added to the candidate list, so as to improve prediction efficiency and effect. For example, when a partial mode in the intermediate prediction mode of the current block determined by the DIMD tool is added to the candidate list, the gradient magnitudes of the partial mode added to the candidate list are all greater than those of the remaining partial modes not added to the candidate list.
In a first specific example, the final mode of the MPM tool of the current block may be added to the prediction mode candidate list. Assuming that the final mode of the MPM tool of the current block is 16, the candidate list constructed in step S101 may be {16}.
In a second specific example, the final modes of the MPM, TIMD, and DIMD tools of the current block may be added to the prediction mode candidate list. Assuming that the final mode of the MPM tool of the current block is 16, the final mode of the TIMD tool of the current block is 12, 14, and the final mode of the DIMD tool of the current block is 36, 50, the candidate list constructed in step S101 may be {16, 12, 14, 36, 50}.
In a third specific example, the final mode of the MPM of the current block, the first final mode of the TIMD, and the final mode of the DIMD tool may be added to the prediction mode candidate list. Assuming that the final mode of the MPM tool of the current block is 16, the final mode of the TIMD tool of the current block is 12, 14, and the final mode of the DIMD tool of the current block is 36, 50, the candidate list constructed in step S101 may be {16, 12, 36, 50}.
In a fourth specific example, the inter prediction mode of the MPM tool, the first 6 inter prediction modes of the TIMD tool, and the first 6 inter prediction modes of the DIMD tool of the current block may be added to the prediction mode candidate list. Assuming that the intermediate prediction modes of the MPM tools of the current block are {12, 16, 32, 18, 0, 1}, the first 6 intermediate prediction modes of the TIMD tools of the current block are {12, 16, 32, 19, 20, 22}, and the first 6 intermediate prediction modes of the DIMD tools of the current block are {36, 50, 20, 14, 24, 0}, the candidate list constructed in step S101 may be {12, 16, 32, 18, 0, 1, 19, 20, 22, 36, 50, 14, 24}.
In a fifth specific example, the first 3 intermediate prediction modes of the MPM tool and the first 3 intermediate prediction modes of the DIMD tool of the current block may be added to the prediction mode candidate list. Assuming that the first 3 intermediate prediction modes of the MPM tool of the current block are {12, 16, 32}, the first 3 intermediate prediction modes of the DIMD tool of the current block are {36, 50, 20}, the candidate list constructed in step S101 may be {12, 16, 32, 36, 50, 20}.
In a sixth specific example, all intermediate prediction modes of the MPM tool, all final modes of the TIMD, and all final modes of the DIMD of the current block may be added to the candidate list. Assuming that the intermediate prediction mode of the MPM tool of the current block is {12, 16, 32, 18, 0, 1}, the final mode of the TIMD tool of the current block is 12, 14, and the final mode of the DIMD tool of the current block is 36, 50, the candidate list constructed in step S101 may be {12, 16, 32, 18, 0, 1, 19, 20, 22, 36, 50, 14, 24}.
Alternatively, the MPM tool may construct an MPM list by neighboring encoded blocks to determine intermediate prediction modes and final modes of the MPM. Alternatively, intra prediction modes of adjacent encoded blocks may be added to an MPM list of the current block, wherein an intermediate prediction mode of the MPM refers to all intra prediction modes in the MPM list of the current block, and a final mode of the MPM refers to at least one intra prediction mode selected from all intra prediction modes in the MPM list by cost or index or the like.
Illustratively, the cost of each intra-prediction mode in the MPM list may be calculated, and the intra-prediction mode with the smallest cost is selected from all the intra-prediction modes in the MPM list as the final mode of the MPM tool.
And the index order of the intra-prediction modes in the MPM list is related to the cost of the intra-prediction modes. Preferably, the index of the intra-frame prediction mode in the MPM list is positively correlated with the cost of the intra-frame prediction mode, that is, the smaller the cost of one intra-frame prediction mode is, the smaller the index of the intra-frame prediction mode in the MPM list is, so that the intra-frame prediction mode with the minimum index in the MPM list can be directly used as the final mode of the MPM tool.
While the TIMD tool may generate several prediction modes from the template cost. Alternatively, the intermediate prediction modes of the TIMD tool may refer to all prediction modes generated by the TIMD. And the final mode of the TIMD tool may refer to at least one intra-prediction mode selected from all intermediate prediction modes of the TIMD by template cost or the like. Illustratively, when the TIMD generates several prediction modes according to the template cost, the prediction modes may be called as the TIMD modes from low to high according to the template cost, and the TIMD tool may take the first TIMD mode and the second TIMD mode as the final modes thereof. Details of the determination of the intermediate prediction mode and the final mode of the TIMD tool may refer to the TIMD prediction mode and are not described herein.
In addition, the DIMD tool may derive several prediction modes from the gradient magnitude. Alternatively, the intermediate prediction modes of the DIMD tool may refer to all prediction modes generated by the DIMD. And the final mode of the DIMD tool may refer to at least one intra-prediction mode selected from all intermediate prediction modes of the DIMD by cost or gradient magnitude, etc. Illustratively, when the DIMD generates a plurality of prediction modes according to the gradient magnitude, the prediction modes may be referred to as a number of DIMD modes from high to low, and the DIMD tool may have the first DIMD mode and the second DIMD mode as its final modes. Details of the determination of the intermediate prediction mode and the final mode of the DIMD tool may refer to the DIMD prediction mode, and will not be described herein.
In a second possible manner, the prediction mode candidate list of the current block may be determined through the steps of primary roughing, secondary roughing, and the like.
Wherein, the primary roughing step can be: the costs of 0, 1 and even numbered prediction modes are calculated, and the candidate list only retains the lowest 3 prediction modes in order of low cost to high.
And (3) a secondary roughing stage: and calculating the cost of adjacent angle prediction modes of the first roughing angle prediction modes (the mode numbers are larger than 0 and smaller than 66), and keeping the candidate list only for 3 prediction modes with the lowest cost in the first roughing stage and the second roughing stage according to the order of the cost from low to high.
Alternatively, the cost of the prediction mode in the primary roughing and the secondary roughing may be the hadamard cost of the prediction mode, or may be the rate distortion cost of the prediction mode, which is not limited herein.
In a third possible manner, the prediction mode candidate list of the current block may be constructed by means of primary roughing, secondary roughing, and MPM, DIMD, and/or TIMD tool addition.
S102: and dividing the current block based on the division mode corresponding to each prediction mode in the candidate list to obtain the division result of the current block corresponding to each prediction mode.
After the intra-prediction mode candidate list of the current block is constructed, all intra-prediction modes in the intra-prediction mode candidate list may be traversed to determine a prediction block of the current block corresponding to each intra-prediction mode. Alternatively, in the process of traversing each intra-frame prediction mode in the intra-frame prediction mode candidate list, the current block may be divided based on the division mode corresponding to each prediction mode in the candidate list, so as to predict each sub-block in the division result of the current block corresponding to each intra-frame prediction mode, thereby obtaining the prediction block of the current block corresponding to each intra-frame prediction mode.
In an implementation manner, the prediction modes have a corresponding relationship with the partition directions, so in step S102, the partition direction corresponding to each prediction mode may be determined first, and then the current block may be partitioned along the partition direction corresponding to each prediction mode.
It is understood that there may be a case where the partition mode corresponding to at least one prediction mode is not partitioned, and in this case, the at least one prediction mode does not have a corresponding partition direction. In step S102, since the partition mode corresponding to the at least one prediction mode is not partition, when the currently traversed prediction mode is one of the at least one prediction mode, the current block does not need to be partitioned, and only one sub-block (i.e. the current block itself) exists in the partition result of the current block corresponding to the currently traversed prediction mode.
For example, a partition direction corresponding to a mode in which the prediction mode is biased toward the vertical direction (e.g., an intra-prediction mode in which the mode number is in the range of 2-33) is the vertical direction; the partition direction corresponding to the mode in which the prediction mode is biased to the horizontal direction (for example, the intra-frame prediction mode in which the mode number is within the range of 34-66) is the horizontal direction; the division mode corresponding to the DC mode is not division, namely the DC mode does not have a corresponding division direction; the division directions corresponding to Planar mode are the horizontal direction and the vertical direction.
For another example, the partition direction corresponding to a mode in which the prediction mode is biased to the vertical direction (e.g., an intra-frame prediction mode in which the mode number is in the range of 2 to 33) is the horizontal direction; the partition direction corresponding to the mode in which the prediction mode is biased to the horizontal direction (for example, the intra-frame prediction mode in which the mode number is within the range of 34-66) is the vertical direction; the division mode corresponding to the Planar mode is not division, namely the Planar mode does not have a corresponding division direction; the division directions corresponding to the DC mode are a horizontal direction and a vertical direction.
In this implementation manner, the above-mentioned dividing the current block along the dividing direction corresponding to each prediction mode may refer to: the current block is divided in the division direction, obtaining a preset number of sub-blocks. The preset number may be a fixed value, for example, 2 or 4. Alternatively, the preset number may be set according to the actual situation such as the size of the current block, which is not limited herein. For example, when the size of the current block is 16×8, the preset number may be 2. For another example, the current block size is 32×16, and the preset number may be 4.
In this implementation manner, the above-mentioned dividing the current block along the dividing direction corresponding to each prediction mode may also refer to: and dividing the current block into at least two sub-blocks according to a preset proportion along the dividing direction. The preset ratio may be a fixed value, for example, 1:1. 1: 2. or 1:3, etc. Alternatively, the preset ratio may be set according to the actual situation such as the size of the current block, and is not limited herein. For example, when the size of the current block is 16×8, the preset number may be 1:1. for another example, the current block size is 32×8, and the preset number may be 1:1:1:1.
alternatively, the preset ratio in the horizontal direction and the preset ratio in the vertical direction may be the same or different, and are not limited herein. For example, in the case that the partition direction corresponding to the currently traversed prediction mode includes a vertical direction and a horizontal direction, assuming that the preset ratio of the horizontal direction is 1:1 and the preset ratio of the vertical direction is also 1:1, the current block may be divided into 2 blocks according to the ratio of 1:1 in the horizontal direction, and then the current block may be further divided into four sub-blocks according to the ratio of 1:1 in the vertical direction. For another example, in the case that the partition direction corresponding to the currently traversed prediction mode includes a vertical direction and a horizontal direction, assuming that the preset ratio of the horizontal direction is 1:2 and the preset ratio of the vertical direction is also 1:1:1:1, the current block may be divided into 4 blocks in the vertical direction and according to the ratio of 1:1:1:1, and then the current block may be further divided into eight sub-blocks in the horizontal direction according to the ratio of 1:2.
In a specific example, the current block is a 16×16 coding block, the prediction mode traversed currently is Planar, the partition directions corresponding to Planar are horizontal and vertical directions, and the number and the proportion of the partition sub-blocks in the horizontal and vertical directions are 2 and 1:1, respectively; the current block is divided according to the preset proportion along the dividing direction corresponding to the prediction mode traversed currently, and the dividing result shown in fig. 4 can be obtained.
In another specific example, the current block is a 16×16 coding block, the prediction mode traversed currently is 18 (biased towards the horizontal direction), the partition direction corresponding to 18 is the horizontal direction, and the number and the proportion of the partition sub-blocks in the horizontal direction are respectively 4 and 1:1:1:1; the current block is divided according to the preset proportion along the dividing direction corresponding to the prediction mode traversed currently, and the dividing result shown in fig. 5 can be obtained.
In yet another implementation manner, the prediction modes and the partition ratios have a corresponding relationship, so in step S102, the partition ratio corresponding to each prediction mode may be determined first, and then the current block may be partitioned according to the partition ratio corresponding to each prediction mode.
It is understood that there may be a case where the partition mode corresponding to at least one prediction mode is not partitioned, and in this case, the at least one prediction mode does not have a corresponding partition ratio. In step S102, since the partition mode corresponding to the at least one prediction mode is not partition, when the currently traversed prediction mode is one of the at least one prediction mode, the current block does not need to be partitioned, and only one sub-block (i.e. the current block itself) exists in the partition result of the current block corresponding to the currently traversed prediction mode.
Illustratively, a mode in which the prediction mode is biased in the vertical direction (e.g., an intra prediction mode having a mode number in the range of 2-33) corresponds to a partition ratio of 1:1, a step of; the prediction mode is biased to the horizontal direction (e.g., intra prediction mode with mode number in the range of 34-66) corresponds to a partition ratio of 1:3, a step of; the division mode corresponding to the DC mode is not division, namely the DC mode has no corresponding division proportion; the Planar mode corresponds to a division ratio of 2:1.
in another example, the division ratio in the horizontal direction corresponding to the mode in which the prediction mode is biased in the vertical direction (for example, the intra prediction mode having a mode number in the range of 2 to 33) is 1:1:1:1, the division ratio in the vertical direction is 1:2; the division ratio of the horizontal direction and the vertical direction corresponding to the mode in which the prediction mode is biased to the horizontal direction (for example, the intra-frame prediction mode in which the mode number is in the range of 34 to 66) is 1:2:1, a step of; the horizontal division ratio corresponding to the DC mode is 3:1, vertical division ratio is 1:2:1, a step of; the Planar mode is divided into no division modes, i.e. the Planar mode has no corresponding division ratio.
In addition, before the current block is divided according to the division ratio corresponding to each prediction mode, the division direction of the current block may be determined.
Alternatively, the division direction of the current block may be fixed, such as a horizontal direction, a vertical direction, or both.
Alternatively, the division direction of the current block may be set according to the size of the current block. For example, when the size of the current block is 16×8, the division direction may be a vertical direction. For another example, when the size of the current block is 16×16, the division direction may be a horizontal direction and a vertical direction. For another example, when the size of the current block is 32×32, the division direction is the horizontal direction.
Alternatively, the dividing direction of the current block may be set according to the comparison result of the width and the height of the current block. For example, when the width of the current block is greater than high, the dividing direction may be a vertical direction. For another example, when the height of the current block is greater than the width, the division direction may be a horizontal direction. For another example, when the width and the height of the current block are equal, the division direction may be a horizontal direction and a vertical direction.
After determining the partition ratio corresponding to the intra-prediction mode traversed currently and the partition direction of the current block, the current block may be partitioned along the partition direction of the current block and according to the partition ratio corresponding to the intra-prediction mode traversed currently.
In a specific example, the current block is a 16×16 encoded block, the preset ratio corresponding to the currently traversed prediction mode is 1:1:1:1, and the dividing direction is a fixed vertical direction, so that the current block is divided along the vertical direction and according to the preset ratio corresponding to the currently traversed prediction mode, and the division result shown in fig. 6 can be obtained.
In another specific example, the current block is a 16×16 encoded block, the preset ratio of the horizontal direction corresponding to the currently traversed prediction mode is 1:3, the preset ratio of the vertical direction corresponding to the currently traversed prediction mode is 1:1, and the dividing direction is a fixed horizontal direction, so that the current block is divided along the horizontal direction and according to the preset ratio of the horizontal direction corresponding to the currently traversed prediction mode, and the dividing result shown in fig. 7 can be obtained.
In another implementation manner, the prediction mode has a corresponding relationship with the partition ratio, and the prediction mode also has a corresponding relationship with the partition direction, so in step S102, the partition ratio and the partition direction corresponding to each prediction mode may be determined first, and then the current block is partitioned along the partition direction corresponding to each prediction mode and according to the partition ratio corresponding to each prediction mode, so as to obtain the partition result of the current block corresponding to each prediction mode.
It is understood that there may be a case where the partition mode corresponding to at least one prediction mode is not partitioned, and in this case, the at least one prediction mode does not have a corresponding partition ratio and partition direction. In step S102, since the partition mode corresponding to the at least one prediction mode is not partition, when the currently traversed prediction mode is one of the at least one prediction mode, the current block does not need to be partitioned, and only one sub-block (i.e. the current block itself) exists in the partition result of the current block corresponding to the currently traversed prediction mode.
In a specific example, the current block is a 16×16 encoded block, and the partition mode corresponding to the prediction mode traversed currently is 1:1 partition along the horizontal direction and 3:1 partition along the vertical direction, so that the current block may be partitioned by 1:1 partition along the horizontal direction and 3:1 partition along the vertical direction, so as to obtain the partition result shown in fig. 8.
S103: and predicting all the sub-blocks in the division result to obtain a prediction block of the current block corresponding to each prediction mode.
After obtaining the division result of the current block corresponding to the prediction mode traversed by the current block in step S102, all sub-blocks in the division result may be predicted to obtain a prediction block of the current block corresponding to the prediction mode traversed by the current block, so as to determine the optimal prediction mode and the final prediction block of the current block based on the prediction block of the current block corresponding to all the prediction modes in the candidate list.
In one embodiment, each sub-block in the partitioning result may be predicted using the prediction mode currently traversed.
In the process, each sub-block in the division result is predicted according to the prediction mode traversed by the current block and based on the adjacent reference pixels of each sub-block, so as to obtain the prediction result of each sub-block, and further obtain the prediction block of the current block corresponding to the prediction mode traversed currently.
That is, in this embodiment, each sub-block is predicted using the same prediction mode. Of course, in other embodiments, each sub-block may also be predicted using a different prediction mode.
In another embodiment, the current traversed prediction mode may be sequentially shifted by several angles, and the corresponding sub-block is predicted based on the shifted prediction mode. Specifically, according to the sequence of the sub-blocks, a plurality of angles are gradually shifted on the currently traversed prediction mode to determine the prediction mode corresponding to each sub-block in the division result, and then each sub-block is predicted according to the prediction mode corresponding to each sub-block, so that each sub-block can use different prediction modes, and the sub-block has more flexible prediction modes, so that the prediction effect is improved.
Illustratively, the sub-blocks may be ordered from left to right, top to bottom, such that in the partitioning result shown in fig. 4, the ordering of all sub-blocks may be a→b→c→d. Alternatively, the sub-blocks may be sorted from right to left and from bottom to top, so in the division result shown in fig. 4, the sorting of all the sub-blocks may be d→c→b→a.
The above "gradually shifting by a few degrees over the prediction mode traversed at present" may mean: the current traversed prediction mode is used as the prediction mode of the first subblock in the dividing result, the prediction mode corresponding to the current traversed prediction mode after being increased by a preset angle is used as the prediction mode of the second subblock, the prediction mode corresponding to the current traversed prediction mode after being increased by two times of the preset angle is used as the prediction mode of the third subblock, and … …, the prediction mode corresponding to the current traversed prediction mode after being increased by N times of the preset angle is used as the prediction mode of the Nth subblock. For example, if the number of the currently traversed prediction mode is 18, in the division result shown in fig. 4, the mode numbers corresponding to A, B, C and D sub-blocks may be 18, 19, 20, 21, respectively.
Alternatively, the above-mentioned "gradually shifting by a few degrees over the prediction mode currently traversed" may refer to: the current traversed prediction mode is used as the prediction mode of the first subblock in the dividing result, the prediction mode corresponding to the current traversed prediction mode reduced by a preset angle is used as the prediction mode of the second subblock, the prediction mode corresponding to the current traversed prediction mode reduced by two times by the preset angle is used as the prediction mode of the third subblock, … …, and the prediction mode corresponding to the current traversed prediction mode reduced by N times by the preset angle is used as the prediction mode of the Nth subblock.
Alternatively still, the above-mentioned "gradually shifting by a few degrees over the prediction mode currently traversed" may refer to: the prediction mode corresponding to the current traversed prediction mode after being reduced by a preset angle is used as the prediction mode of the first subblock in the dividing result, the prediction mode corresponding to the current traversed prediction mode after being reduced by two times of the preset angle is used as the prediction mode of the second subblock, the prediction mode corresponding to the current traversed prediction mode after being reduced by three times of the preset angle is used as the prediction mode of the third subblock, … …, and the prediction mode corresponding to the current traversed prediction mode after being reduced by N+1 times of the preset angle is used as the prediction mode of the Nth subblock.
The preset angle may be set according to the actual situation such as the size of the current block, and is not limited herein. For example, the preset angle may be 2 °, 4 °, 5 °, or the like.
In yet another embodiment, the prediction mode of each sub-block may be determined based on gradient information of neighboring reconstructed pixels of each sub-block of at least part of the sub-blocks in the division result; predicting each sub-block by using the prediction mode of each sub-block to obtain a prediction block of the current block corresponding to each prediction mode, so that each sub-block can use different prediction modes, and the sub-block has more flexible prediction modes; and the prediction mode of the sub-block is determined in a gradient derivation mode, so that the prediction mode can be more suitable for the content of the sub-block, and the prediction effect is improved.
Illustratively, in the division result shown in fig. 4, the prediction mode of the sub-block a may be determined based on the gradient information of the neighboring reconstructed pixels of the sub-block a, the prediction mode of the sub-block B may be determined based on the gradient information of the neighboring reconstructed pixels of the sub-block B, the prediction mode of the sub-block C may be determined based on the gradient information of the neighboring reconstructed pixels of the sub-block C, and the prediction mode of the sub-block D may be determined based on the gradient information of the neighboring reconstructed pixels of the sub-block D.
In another example, in the division result shown in fig. 4, the prediction mode currently traversed may be taken as the prediction mode of the sub-block a; after predicting and reconstructing the sub-block A by using the currently traversed prediction mode, determining the prediction mode of the sub-block B based on gradient information of adjacent reconstructed pixels (including reconstructed pixels in the sub-block A) of the sub-block B; after the prediction and reconstruction of the sub-block B are carried out according to the prediction mode of the sub-block B, the prediction mode of the sub-block C is determined based on the gradient information of the adjacent reconstructed pixels (including the reconstructed pixels in the sub-block A and possibly including the reconstructed pixels in the sub-block B) of the sub-block C; the prediction mode of sub-block D is determined with gradient information of neighboring reconstructed pixels of sub-block D (including reconstructed pixels in sub-block C and reconstructed pixels in sub-block B, possibly including reconstructed pixels in sub-block a).
Wherein, determining the prediction mode of a sub-block with gradient information of neighboring reconstructed pixels of the sub-block may include: calculating horizontal gradients and vertical gradients of each adjacent reconstructed pixel of the sub-block; deriving gradient angles and magnitudes for each adjacent reconstructed pixel based on the horizontal and vertical gradients for each adjacent reconstructed pixel; converting the gradient angle into a corresponding prediction mode to determine the prediction mode corresponding to each adjacent reconstructed pixel; and counting the prediction modes corresponding to all the adjacent reconstructed pixels, determining the prediction mode with the highest amplitude, and taking the prediction mode with the highest amplitude as the prediction mode of the sub-block. The selection of the adjacent reconstructed pixels of the sub-block may refer to the DIMD prediction mode, which is not described herein.
S104: the best prediction mode of the current block is determined based on the prediction blocks of the current block corresponding to all prediction modes.
After the above steps are completed for all prediction modes in the candidate list, the best prediction mode and the final prediction block of the current block can be determined based on the prediction blocks of the current block corresponding to all prediction modes.
Alternatively, before step S104, a cost of the current block corresponding to the currently traversed prediction mode may be determined based on the prediction block of the current block corresponding to the currently traversed prediction mode. As such, in step S104, the best prediction mode of the current block may be determined based on the costs of the current block corresponding to all prediction modes, and the prediction block of the current block corresponding to the best prediction mode may be taken as the final prediction block of the current block. Preferably, the prediction mode with the smallest cost among all the prediction modes can be used as the optimal prediction mode of the current block.
In this embodiment, the current block is divided based on the division mode corresponding to each prediction mode in the candidate list, so as to obtain the division result of the current block corresponding to each prediction mode; then, predicting each sub-block in the division result of the current block corresponding to each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode; and then determining the optimal prediction mode of the current block based on all prediction blocks of the current block. In this way, in the embodiment, when the prediction mode in the prediction mode candidate list is traversed, the current block is divided by using the division mode corresponding to each prediction mode, so that the division mode of the current block is more flexible and changeable, and is convenient to better adapt to the actual image content, thereby being convenient to improve the compression efficiency; and the prediction mode is corresponding to the division mode, and when the prediction is performed in the corresponding prediction mode, the current block can be divided in the division mode which is adaptive to the prediction mode, so that the prediction effect is improved.
Alternatively, the intra-frame prediction method proposed in the present application may be used as a new intra-frame prediction tool in the intra-frame prediction process. In this case, the best tool and prediction mode among the tools such as the intra-frame prediction method and MPM, DIMD, TIMD, ISP proposed in the present application may be selected by some means, such as comparing rate-distortion costs and hadamard costs.
In other embodiments, the intra prediction methods presented herein may be used to replace existing intra prediction tools. For example, the intra prediction method proposed herein may be used to replace at least one of the existing ISP, MPM, TIMD, DIMD intra tools.
Referring to fig. 9, fig. 9 is a flowchart illustrating an embodiment of a method for encoding a video or an image according to the present application. The method of encoding video or images may be applied to video encoding. It should be noted that, if there are substantially the same results, the present embodiment is not limited to the flow sequence shown in fig. 9. In this embodiment, a method of encoding a video or an image includes the steps of:
s201: a final prediction block for a current block in the image is determined based on any of the prediction methods described above.
S202: the current block is encoded based on the final prediction block.
Optionally, when the current block is encoded, a value of a preset syntax element may be set in the encoded bitstream, where different values of the preset syntax element represent whether the prediction method of the present application is enabled, i.e. a switch syntax is set for marking a use state of the prediction method of the present application. For example, whether the prediction method of the present application is used in the encoding and decoding process may be expressed by the switch syntax aisp_flag. Where isp_flag=0 indicates that the prediction method of the present application is turned off, and aisp_flag=1 indicates that the prediction method of the present application is turned on.
Of course, in the case where the prediction method of the present application is forcedly used, the value of the preset syntax element may not be set in the encoded bitstream.
In addition, when multiple schemes or modes are involved in the codec flow, scheme syntax may be used to express the final selected scheme or mode. For example, the scheme syntax is used to express the tool, the partitioning scheme, the prediction mode, the subblock mode determination scheme, and the like that are ultimately used when a plurality of tools (e.g., MPM, DIMD, and/or TIMD, etc.), the partitioning scheme, the prediction mode, and/or the subblock mode determination scheme are involved in the codec flow.
In a specific example, the switch syntax aisp_flag is used to FLAG whether the intra-prediction method proposed in the present application is enabled or disabled, and aisp_flag=0 indicates that the intra-prediction method proposed in the present application is disabled, and aisp_flag=1 indicates that the intra-prediction method proposed in the present application is enabled.
When aisp_flag=1, aisp_idx is used to mark the position of the best prediction mode in the intra prediction method proposed in the present application in the intra prediction mode candidate list, for example, the candidate list is {16, 12, 14, 18, 20}, the best prediction mode is 16, and aisp_idx=0.
In another specific example, the present application proposes an intra prediction method as a new intra prediction tool for a current coded block. Firstly, constructing a prediction mode candidate list, and supposing that the candidate list is determined to be {12, 16, 32, 18, 0, 1, 14, 36, 50}; then traversing each prediction mode in the candidate list and obtaining the rate distortion cost of each prediction mode, wherein in the traversing process, the current block is required to be subjected to block division and mode derivation, the division direction is determined based on the prediction mode, the division mode is divided into 4 sub-blocks based on uniform proportion, the divided sub-blocks adopt the same prediction mode, and the rate distortion cost of each prediction mode in the final candidate list is assumed to be {600, 560, 700, 480, 800, 760, 780, 640, 730}; finally, the prediction mode with the lowest cost is taken as the optimal prediction mode of the intra-frame prediction method proposed by the application, namely, the fourth prediction mode 18 in the candidate list, and at this time, the switch syntax aisp_flag=1 indicates that the intra-frame prediction method proposed by the application is turned on, and aisp_idx=4 indicates that the optimal prediction mode of the intra-frame prediction method proposed by the application is the fourth mode in the candidate list.
Referring to fig. 10, fig. 10 is a flowchart illustrating an embodiment of a method for decoding a video or image bitstream according to the present application. The method of decoding a video or image code stream can be applied to video decoding. It should be noted that, if there are substantially the same results, the present embodiment is not limited to the flow sequence shown in fig. 10. In this embodiment, the method for decoding a video or image code stream includes the steps of:
s301: determining a final prediction block of a current block in the image based on any one of the prediction methods described above;
s302: the current block is decoded based on the final prediction block.
Referring to fig. 11, fig. 11 is a schematic structural diagram of an embodiment of an encoder of the present application. The present encoder 10 includes a processor 12, the processor 12 for executing instructions to implement the above-described prediction method and method of encoding video or images. The specific implementation process is described in the above embodiments, and will not be described herein.
The processor 12 may also be referred to as a CPU (Central Processing Unit ). The processor 12 may be an integrated circuit chip having signal processing capabilities. Processor 12 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 12 may be any conventional processor or the like.
Encoder 10 may further include a memory 11 for storing instructions and data necessary for processor 12 to operate.
The processor 12 is configured to execute instructions to implement the methods provided by any of the embodiments of the prediction methods and methods of encoding video or images described above, and any non-conflicting combination.
Referring to fig. 12, fig. 12 is a schematic diagram illustrating a decoder according to an embodiment of the present application. The present decoder 20 includes a processor 22, the processor 22 being configured to execute instructions to implement the prediction method described above and the method of decoding a video or image bitstream. The specific implementation process is described in the above embodiments, and will not be described herein.
The processor 22 may also be referred to as a CPU (Central Processing Unit ). The processor 22 may be an integrated circuit chip having signal processing capabilities. Processor 22 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The general purpose processor may be a microprocessor or the processor 22 may be any conventional processor or the like.
Decoder 20 may further include a memory 21 for storing instructions and data required for processor 22 to operate.
The processor 22 is configured to execute instructions to implement the methods provided by any of the embodiments of the prediction methods and methods of decoding video or image streams and any non-conflicting combinations described above.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a computer readable storage medium according to an embodiment of the present application. The computer readable storage medium 30 of the present embodiment stores instruction/program data 31, which when executed, implements the method provided by any embodiment of the present prediction method, method of decoding a video or image code stream, and method of encoding a video or image, and any non-conflicting combination. Wherein the instructions/program data 31 may be stored in the storage medium 30 as a software product to enable a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium 30 includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes, or a terminal device such as a computer, a server, a mobile phone, a tablet, or the like.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
The foregoing is only the embodiments of the present application, and not the patent scope of the present application is limited by the foregoing description, but all equivalent structures or equivalent processes using the contents of the present application and the accompanying drawings, or directly or indirectly applied to other related technical fields, which are included in the patent protection scope of the present application.

Claims (15)

1. An intra prediction method, the method comprising:
constructing an intra prediction mode candidate list of the current block;
dividing the current block based on a division mode corresponding to each prediction mode in the candidate list to obtain a division result of the current block corresponding to each prediction mode;
predicting all sub-blocks in the division result of each prediction mode to obtain a prediction block of the current block corresponding to each prediction mode;
and determining the optimal prediction mode of the current block based on the prediction blocks of the current block corresponding to all prediction modes.
2. The method according to claim 1, wherein the dividing the current block based on the dividing manner corresponding to each prediction mode in the candidate list, and obtaining the dividing result of the current block corresponding to each prediction mode;
Determining the dividing direction corresponding to each prediction mode;
and dividing the current block into at least two sub-blocks along the dividing direction.
3. The method of intra prediction according to claim 2, wherein the dividing the current block into at least two sub-blocks along the dividing direction comprises:
and dividing the current block into at least two sub-blocks according to a preset proportion along the dividing direction.
4. The method according to claim 1, wherein predicting all sub-blocks in the division result of each prediction mode to obtain the prediction block of the current block corresponding to each prediction mode comprises:
determining a prediction mode of each sub-block based on gradient information of adjacent reconstructed pixels of each sub-block in at least part of the sub-blocks in the division result of each prediction mode;
and predicting the sub-blocks in the prediction modes of the sub-blocks to obtain the prediction block of the current block corresponding to each prediction mode.
5. The method according to claim 4, wherein the determining the prediction mode of each of the sub-blocks based on gradient information of adjacent reconstructed pixels of the respective sub-blocks in at least part of the division result of each of the prediction modes includes:
Calculating the horizontal gradient and the vertical gradient of each adjacent reconstructed pixel of each sub-block;
deriving a gradient angle and an amplitude value of each adjacent reconstructed pixel based on the horizontal gradient and the vertical gradient of each adjacent reconstructed pixel;
converting the gradient angle into a corresponding prediction mode to determine the prediction mode corresponding to each adjacent reconstructed pixel;
and counting the prediction modes corresponding to all adjacent reconstructed pixels of each sub-block, determining the prediction mode with the highest amplitude of each sub-block, and taking the prediction mode with the highest amplitude of each sub-block as the prediction mode of each sub-block.
6. The method according to claim 1, wherein predicting all sub-blocks in the division result of each prediction mode to obtain the prediction block of the current block corresponding to each prediction mode comprises:
gradually shifting a plurality of angles on each prediction mode according to the sequence of the sub-blocks in the division result of each prediction mode so as to determine the prediction mode corresponding to each sub-block in the division result of each prediction mode; predicting each sub-block according to the prediction mode corresponding to each sub-block to obtain a prediction block of the current block corresponding to each prediction mode; or alternatively, the first and second heat exchangers may be,
And predicting each sub-block according to each prediction mode and based on adjacent reference pixels of each sub-block in the division result of each prediction mode, so as to obtain a prediction block of the current block corresponding to each prediction mode.
7. The method of intra prediction according to claim 1, wherein said constructing the intra prediction mode candidate list of the current block comprises:
the intra prediction mode candidate list is constructed based on an MPM tool, a TIMD tool, and/or a DIMD tool.
8. The method according to claim 7, wherein constructing the intra prediction mode candidate list based on the MPM tool, the TIMD tool, and/or the DIMD tool includes:
adding at least one intermediate prediction mode of the current block determined by each of the MPM tool, the TIMD tool and/or the DIMD tool to a candidate list, and/or adding at least one final mode of the current block determined by each of the MPM tool, the TIMD tool and/or the DIMD tool to a candidate list to obtain an intra-prediction mode candidate list of the current block.
9. A method of encoding video or images, the method comprising:
Determining a final prediction block of a current block in an image based on the prediction method of any one of claims 1-8;
the current block is encoded based on the final prediction block.
10. The method of encoding video or image according to claim 9, wherein said encoding the current block based on the final prediction block comprises:
and setting values of preset syntax elements in the coded code stream, wherein different values of the preset syntax elements represent whether the prediction method is started or not.
11. The method of encoding video or image according to claim 9, wherein said encoding the current block based on the final prediction block comprises:
and coding index information of a prediction mode corresponding to the final prediction block in an intra-frame prediction mode candidate list to obtain a coded code stream.
12. A method of decoding a video or image bitstream, the method comprising:
determining a final prediction block of a current block in an image based on the prediction method of any one of claims 1-8;
the current block is decoded based on the final prediction block.
13. An encoder, the encoder comprising a processor; the processor is configured to execute instructions to implement the steps of the method according to any one of claims 1-11.
14. A decoder, the decoder comprising a processor; the processor is configured to execute instructions to implement the steps of the method according to any one of claims 1-8 and 12.
15. A computer readable storage medium having stored thereon instructions/program data, which when executed, implement the steps of the method of any of claims 1-12.
CN202211462464.5A 2022-11-21 2022-11-21 Intra-frame prediction method, encoding method, decoding method and device Pending CN116074519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211462464.5A CN116074519A (en) 2022-11-21 2022-11-21 Intra-frame prediction method, encoding method, decoding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211462464.5A CN116074519A (en) 2022-11-21 2022-11-21 Intra-frame prediction method, encoding method, decoding method and device

Publications (1)

Publication Number Publication Date
CN116074519A true CN116074519A (en) 2023-05-05

Family

ID=86170663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211462464.5A Pending CN116074519A (en) 2022-11-21 2022-11-21 Intra-frame prediction method, encoding method, decoding method and device

Country Status (1)

Country Link
CN (1) CN116074519A (en)

Similar Documents

Publication Publication Date Title
JP6995952B2 (en) Inter-prediction method and its device
JP6646019B2 (en) Video encoding method and apparatus
US9351008B2 (en) Encoding / decoding method and apparatus using a tree structure
US9462279B2 (en) Image encoding/decoding method and device
CN104768011B (en) Image coding/decoding method and relevant apparatus
CN102970526B (en) A kind of method obtaining transform block size and module
KR101479129B1 (en) Video Coding Method and Apparatus Using Variable size Macroblock
EP1619901A2 (en) Context adaptive binary arithmetic coding with reduced complexity
US20110292999A1 (en) Super macro block based intra coding method and apparatus
WO2013058473A1 (en) Adaptive transform method based on in-screen prediction and apparatus using the method
KR100813958B1 (en) Method of lossless encoding and decoding, and apparatus thereof
CN105357540A (en) Method and apparatus for decoding video
CN103109530A (en) Method and apparatus for encoding video using adjustable loop filtering, and method and apparatus for decoding video using adjustable loop filtering
CN111263144B (en) Motion information determination method and equipment
CN108353175A (en) The method and apparatus of prediction processing vision signal caused by coefficient of utilization
CN102215392B (en) Intra-frame predicting method or device for estimating pixel value
TWI559751B (en) Methods, systems, and computer program products for assessing a macroblock candidate for conversion to a skipped macroblock
WO2016116984A1 (en) Moving image encoding device, moving image encoding method, and moving image encoding program
CN116074519A (en) Intra-frame prediction method, encoding method, decoding method and device
CN116567232A (en) Image block dividing method, video coding method, device and equipment
KR20140031974A (en) Image coding method, image decoding method, image coding device, image decoding device, image coding program, and image decoding program
CN111669592B (en) Encoding and decoding method, device and equipment
CN112565750B (en) Video coding method, electronic equipment and storage medium
KR20130054981A (en) Video coding method and apparatus using variable size macroblock
KR101366088B1 (en) Method and apparatus for encoding and decoding based on intra prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination