IP Library Granted Patent US 12671822
Granted Patent B2
US 12671822 · App. 18/747,121 · Granted Jun 30, 2026

Intra-frame, inter-frame prediction and combined inter-intra prediction mode, video coding method and apparatus

Inventor: Jian Zou (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
H04N19/159H04N19/147H04N19/176
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12671822
App. No.
18/747,121
Granted
Jun 30, 2026
Kind
B2
Abstract

A method for determining a prediction mode in video coding are provided. A method comprises: determining picture evaluation information of a to-be-encoded current block and a plurality of picture evaluation information of a plurality of encoded reference blocks; calculating, based on the picture evaluation information determined, the correlation between the current block and each of the plurality of reference blocks, respectively, and determining a target reference block in the plurality of reference blocks; performing a prediction search based on a first intra prediction mode of the target reference block, and determining a second intra prediction mode corresponding to the current block. This second intra prediction mode may then be compared with an inter prediction mode to select a final prediction mode for encoding the current block. Based on the final prediction mode, the current block is encoded, and subsequently, the encoded current blocks are stitched to obtain a complete frame.

Claims (109)

1 . A method, comprising:

determining picture evaluation information of a current block to be encoded, wherein the picture evaluation information comprises gradient evaluation information, wherein the determining the picture evaluation information of the current block to be encoded comprises:

calculating single-frame gradient information of the current block in each single-frame of multiple frames, respectively; and

generating a set as the gradient evaluation information of the current block based on the single-frame gradient information of the current block in each single-frame of the multiple frames;

determining, for each reference block of a plurality of reference blocks that are encoded, picture evaluation information of the reference block, wherein pixel positions of the plurality of reference blocks are adjacent to a pixel position of the current block, wherein the determining, for each reference block of the plurality of reference blocks that are encoded, the picture evaluation information of the reference block comprises:

for each reference block in the plurality of reference blocks, calculating single-frame gradient information of the reference block in each single-frame of the multiple frames, respectively; and

generating a set as the gradient evaluation information of the reference block based on the single-frame gradient information of the plurality of reference blocks in each single-frame of the multiple frames;

calculating, based on the picture evaluation information of the current block and the picture evaluation information of the plurality of reference blocks, a correlation between the current block and each reference block of the plurality of reference blocks, respectively;

determining a target reference block in the plurality of reference blocks based on the calculating the correlation between the current block and each reference block of the plurality of reference blocks, respectively; and

performing a prediction search based on a first intra prediction mode of the target reference block, and determining a second intra prediction mode corresponding to the current block based on a result of performing the prediction search, wherein the performing the prediction search based on the first intra prediction mode of the target reference block, and determining the second intra prediction mode corresponding to the current block based on the result of performing the prediction search comprises:

determining a plurality of intra prediction modes whose corresponding prediction directions are closest to a search reference direction as a plurality of candidate intra prediction modes, wherein a prediction direction corresponding to the first intra prediction mode of the target reference block is the search reference direction; and

selecting, from the plurality of candidate intra prediction modes, the candidate intra prediction mode with a lowest rate distortion cost as the second intra prediction mode corresponding to the current block.

2 . The method of claim 1 ,

wherein the calculating the single-frame gradient information of the current block in each single-frame of the multiple frames, respectively, comprises:

for the current block in each single-frame of the multiple frames,

determining, for each pixel in the current block, a first pixel gradient direction and a first pixel gradient modulus value of the pixel;

determining a first average gradient direction based on an average direction of the first pixel gradient directions of the pixels in the current block, and determining a first average gradient modulus value based on an average value of the first pixel gradient modulus values of the pixels in the current block; and

determining the single-frame gradient information of the current block in the single-frame based on the first average gradient direction and the first average gradient modulus value; and

wherein the calculating, for each reference block in the plurality of reference blocks, the single-frame gradient information of the reference block in each single-frame of the multiple frames, respectively, comprises:

for the reference block in each single-frame of the multiple frames,

determining, for each pixel in the reference block, a second pixel gradient direction and a second pixel gradient modulus value of the pixel;

determining a second average gradient direction based on an average direction of the second pixel gradient directions of the pixels in the reference block, and determining a second average gradient modulus value based on an average value of the second pixel gradient modulus values of the pixels in the reference block; and

determining the single-frame gradient information of the reference block in the single-frame based on the second average gradient direction and the second average gradient modulus value.

3 . The method of claim 2 ,

wherein the determining the single-frame gradient information of the current block in the single-frame based on the first average gradient direction and the first average gradient modulus value comprises:

performing a normalization calculation based on the first average gradient direction and the first average gradient modulus value; and

performing a weighted calculation based on the normalized first average gradient direction and the normalized first average gradient modulus value to obtain a weighted gradient value as the single-frame gradient information of the current block in the single-frame; and

wherein the determining the single-frame gradient information of the reference block in the single-frame based on the second average gradient direction and the second average gradient modulus value comprises:

performing a normalization calculation based on the second average gradient direction and the second average gradient modulus value; and

performing a weighted calculation based on the normalized second average gradient direction and the normalized second average gradient modulus value to obtain a weighted gradient value as the single-frame gradient information of the reference block in the single-frame.

4 . The method of claim 1 ,

wherein the calculating the correlation between the current block and each reference block of the plurality of reference blocks, respectively, comprises:

calculating, for each reference block of the plurality of reference blocks, a Pearson correlation coefficient based on the picture evaluation information of the current block and the picture evaluation information of the reference block; and

wherein the determining the target reference block in the plurality of reference blocks comprises:

determining the reference block with a largest value of the Pearson correlation coefficient as the target reference block.

5 . The method of claim 4 , wherein the calculating, for each reference block of the plurality of reference blocks, the Pearson correlation coefficient based on the picture evaluation information of the current block and the picture evaluation information of the reference block comprises:

obtaining a covariance based on the picture evaluation information of the current block and the picture evaluation information of the reference block;

obtaining a first standard deviation of the current block based on the picture evaluation information of the current block;

obtaining a second standard deviation of the reference block based on the picture evaluation information of the reference block; and

calculating the Pearson correlation coefficient between the current block and the reference block based on the covariance, the first standard deviation, and the second standard deviation.

6 . The method of claim 1 ,

wherein a number reference blocks in the plurality of reference blocks is four reference blocks; and

wherein the four reference blocks are located at a left, a top, a left-top, and a right-top of the current block, respectively.

7 . A video coding method, comprising:

for each current block to be encoded of a plurality of current blocks to be encoded in a frame:

determining a second intra prediction mode of the current block to be encoded;

determining a final prediction mode of the current block to be encoded based on the second intra prediction mode; and

encoding the current block based on the final prediction mode to obtain an encoded current block; and

stitching the encoded current blocks in the frame to obtain a complete frame;

wherein the second intra prediction mode of the current block to be encoded is determined based on:

determining picture evaluation information of a current block to be encoded, wherein the picture evaluation information comprises gradient evaluation information, wherein the determining the picture evaluation information of the current block to be encoded comprises:

calculating single-frame gradient information of the current block in each single-frame of multiple frames, respectively; and

generating a set as the gradient evaluation information of the current block based on the single-frame gradient information of the current block in each single-frame of the multiple frames;

determining, for each reference block of a plurality of reference blocks that are encoded, picture evaluation information of the reference block, wherein pixel positions of the plurality of reference blocks are adjacent to a pixel position of the current block, wherein the determining, for each reference block of the plurality of reference blocks that are encoded, the picture evaluation information of the reference block comprises:

for each reference block in the plurality of reference blocks, calculating single-frame gradient information of the reference block in each single-frame of the multiple frames, respectively; and

generating a set as the gradient evaluation information of the reference block based on the single-frame gradient information of the plurality of reference blocks in each single-frame of the multiple frames;

calculating, based on the picture evaluation information of the current block and the picture evaluation information of the plurality of reference blocks, a correlation between the current block and each reference block of the plurality of reference blocks, respectively;

determining a target reference block in the plurality of reference blocks based on the calculating the correlation between the current block and each reference block of the plurality of reference blocks, respectively; and

performing a prediction search based on a first intra prediction mode of the target reference block, and determining a second intra prediction mode corresponding to the current block based on a result of performing the prediction search, wherein the performing the prediction search based on the first intra prediction mode of the target reference block, and determining the second intra prediction mode corresponding to the current block based on the result of performing the prediction search comprises:

determining a plurality of intra prediction modes whose corresponding prediction directions are closest to a search reference direction as a plurality of candidate intra prediction modes, wherein a prediction direction corresponding to the first intra prediction mode of the target reference block is the search reference direction; and

selecting, from the plurality of candidate intra prediction modes, the candidate intra prediction mode with a lowest rate distortion cost as the second intra prediction mode corresponding to the current block.

8 . The method of claim 7 , wherein the determining the final prediction mode of the current block to be encoded based on the second intra prediction mode comprises:

determining an inter prediction mode corresponding to the current block to be encoded; and

determining one of the second intra prediction mode and the inter prediction mode corresponding to the current block to be encoded as the final prediction mode of the current block to be encoded by comparing a rate distortion cost of the second intra prediction mode and the inter prediction mode.

9 . An electronic device, comprising:

at least one processor; and

a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions executed by the at least one processor enable the at least one processor to execute operations comprising:

determining picture evaluation information of a current block to be encoded, wherein the picture evaluation information comprises gradient evaluation information, wherein the determining the picture evaluation information of the current block to be encoded comprises:

calculating single-frame gradient information of the current block in each single-frame of multiple frames, respectively; and

generating a set as the gradient evaluation information of the current block based on the single-frame gradient information of the current block in each single-frame of the multiple frames;

determining, for each reference block of a plurality of reference blocks that are encoded, picture evaluation information of the reference block, wherein pixel positions of the plurality of reference blocks are adjacent to a pixel position of the current block, wherein the determining, for each reference block of the plurality of reference blocks that are encoded, the picture evaluation information of the reference block comprises:

for each reference block in the plurality of reference blocks, calculating single-frame gradient information of the reference block in each single-frame of the multiple frames, respectively; and

generating a set as the gradient evaluation information of the reference block based on the single-frame gradient information of the plurality of reference blocks in each single-frame of the multiple frames;

calculating, based on the picture evaluation information of the current block and the picture evaluation information of the plurality of reference blocks, a correlation between the current block and each reference block of the plurality of reference blocks, respectively;

determining a target reference block in the plurality of reference blocks based on the calculating the correlation between the current block and each reference block of the plurality of reference blocks, respectively; and

performing a prediction search based on a first intra prediction mode of the target reference block, and determining a second intra prediction mode corresponding to the current block based on a result of performing the prediction search, wherein the performing the prediction search based on the first intra prediction mode of the target reference block, and determining the second intra prediction mode corresponding to the current block based on the result of performing the prediction search comprises:

determining a plurality of intra prediction modes whose corresponding prediction directions are closest to a search reference direction as a plurality of candidate intra prediction modes, wherein a prediction direction corresponding to the first intra prediction mode of the target reference block is the search reference direction; and

selecting, from the plurality of candidate intra prediction modes, the candidate intra prediction mode with a lowest rate distortion cost as the second intra prediction mode corresponding to the current block.

10 . The electronic device of claim 9 ,

wherein the calculating the single-frame gradient information of the current block in each single-frame of the multiple frames, respectively, comprises:

for the current block in each single-frame of the multiple frames,

determining, for each pixel in the current block, a first pixel gradient direction and a first pixel gradient modulus value of the pixel;

determining a first average gradient direction based on an average direction of the first pixel gradient directions of the pixels in the current block, and determining a first average gradient modulus value based on an average value of the first pixel gradient modulus values of the pixels in the current block; and

determining the single-frame gradient information of the current block in the single-frame based on the first average gradient direction and the first average gradient modulus value; and

wherein the calculating, for each reference block in the plurality of reference blocks, the single-frame gradient information of the reference block in each single-frame of the multiple frames, respectively, comprises:

for the reference block in each single-frame of the multiple frames,

determining, for each pixel in the reference block, a second pixel gradient direction and a second pixel gradient modulus value of the pixel;

determining a second average gradient direction based on an average direction of the second pixel gradient directions of the pixels in the reference block, and determining a second average gradient modulus value based on an average value of the second pixel gradient modulus values of the pixels in the reference block; and

determining the single-frame gradient information of the reference block in the single-frame based on the second average gradient direction and the second average gradient modulus value.

11 . The electronic device of claim 10 ,

wherein the determining the single-frame gradient information of the current block in the single-frame based on the first average gradient direction and the first average gradient modulus value comprises:

performing a normalization calculation based on the first average gradient direction and the first average gradient modulus value; and

performing a weighted calculation based on the normalized first average gradient direction and the normalized first average gradient modulus value to obtain a weighted gradient value as the single-frame gradient information of the current block in the single-frame; and

wherein the determining the single-frame gradient information of the reference block in the single-frame based on the second average gradient direction and the second average gradient modulus value comprises:

performing a normalization calculation based on the second average gradient direction and the second average gradient modulus value; and

performing a weighted calculation based on the normalized second average gradient direction and the normalized second average gradient modulus value to obtain a weighted gradient value as the single-frame gradient information of the reference block in the single-frame.

12 . The electronic device of claim 9 ,

wherein the calculating the correlation between the current block and each reference block of the plurality of reference blocks, respectively, comprises:

calculating, for each reference block of the plurality of reference blocks, a Pearson correlation coefficient based on the picture evaluation information of the current block and the picture evaluation information of the reference block; and

 wherein the determining the target reference block in the plurality of reference blocks comprises:

determining the reference block with a largest value of the Pearson correlation coefficient as the target reference block.

13 . The electronic device of claim 12 , wherein the calculating, for each reference block of the plurality of reference blocks, the Pearson correlation coefficient based on the picture evaluation information of the current block and the picture evaluation information of the reference block comprises:

obtaining, a covariance based on the picture evaluation information of the current block and the picture evaluation information of the reference block;

obtaining a first standard deviation of the current block based on the picture evaluation information of the current block;

obtaining a second standard deviation of the reference block based on the picture evaluation information of the reference block; and

calculating the Pearson correlation coefficient between the current block and the reference block based on the covariance, the first standard deviation, and the second standard deviation.

14 . The electronic device of claim 9 ,

wherein a number reference blocks in the plurality of reference blocks is four reference blocks; and

wherein the four reference blocks are located at a left, a top, a left-top, and a right-top of the current block, respectively.