CN112601081A - Adaptive partition multi-prediction method and device - Google Patents

Adaptive partition multi-prediction method and device Download PDF

Info

Publication number
CN112601081A
CN112601081A CN202011403779.3A CN202011403779A CN112601081A CN 112601081 A CN112601081 A CN 112601081A CN 202011403779 A CN202011403779 A CN 202011403779A CN 112601081 A CN112601081 A CN 112601081A
Authority
CN
China
Prior art keywords
current
sub
prediction
block
flag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011403779.3A
Other languages
Chinese (zh)
Other versions
CN112601081B (en
Inventor
方瑞东
林聚财
江东
粘春湄
陈瑶
张政腾
殷俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202011403779.3A priority Critical patent/CN112601081B/en
Publication of CN112601081A publication Critical patent/CN112601081A/en
Application granted granted Critical
Publication of CN112601081B publication Critical patent/CN112601081B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/182Methods 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 a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors

Abstract

The invention provides a method and a device for predicting multiple times of self-adaptive partitions, wherein the method comprises the following steps: acquiring the sample characteristics of a current prediction unit, wherein the sample characteristics of sub-blocks or pixels of the current prediction unit are not completely the same; whether sub-blocks or pixels of the current prediction unit are partitioned and subjected to multiple prediction processing is determined based on the sample characteristics, if so, the sub-blocks or the pixels are partitioned and subjected to multiple prediction processing, the problem that affine quadratic prediction in the related art determines whether filtering in the horizontal direction or the vertical direction or the horizontal plus vertical direction is performed on the current prediction unit according to the motion vector deviation condition inside the sub-blocks, the motion vector deviation condition of each sub-block is the same, and the condition of each sub-block or each pixel in the current prediction unit is not fully considered can be solved, whether filtering is performed on each sub-block or each pixel can be determined, filtering is performed on the sub-blocks or the pixels with the determined results, and the coding efficiency is further improved.

Description

Adaptive partition multi-prediction method and device
Technical Field
The invention relates to the field of coding and decoding, in particular to a method and a device for multi-time prediction of self-adaptive partitions.
Background
The video image data volume is large, and usually the video pixel data needs to be compressed, the compressed data is called a video code stream, and the video code stream is transmitted to a user end through a wired or wireless network and then decoded for viewing. The whole video coding flow comprises the processes of prediction, transformation, quantization, entropy coding and the like.
Video is formed by the sequential playing of a number of still images, each of which can be viewed as a frame. Since the pixel values of the similar pixels in the adjacent frames are usually relatively close and the color does not change suddenly, the temporal correlation can be used for compression, which is the inter-frame prediction. The inter prediction is to search a block that is the closest match to the current block in the reference frame image of the current block to predict the current block.
The existing affine secondary prediction technology is to perform point-based secondary prediction on the basis of an affine prediction result based on a sub-block, and the deviation between a motion vector of each point in the sub-block and a motion vector of the sub-block can be obtained by calculation according to an affine model.
Whether the current prediction unit carries out filtering in the horizontal direction or the vertical direction or the horizontal direction plus the vertical direction is determined only according to the motion vector deviation condition inside the sub-block (in the current affine quadratic prediction technology, the motion vector deviation condition of each sub-block is the same for the same prediction unit), but the condition of each sub-block in the current prediction unit is not fully considered to determine whether each independent sub-block inside the current prediction unit carries out filtering in the horizontal direction or the vertical direction or the horizontal direction plus the vertical direction.
Whether the current prediction unit performs filtering in the horizontal or vertical or horizontal plus vertical direction is determined only according to the motion vector deviation condition inside the sub-block (in the current affine quadratic prediction technology, the motion vector deviation condition of each sub-block is the same for the same prediction unit), but the condition that each pixel in the current prediction unit is in the current sub-block or in the current prediction unit is not fully considered to determine whether each pixel inside the current prediction unit performs filtering in the horizontal or vertical or horizontal plus vertical direction.
For affine quadratic prediction in the related art, whether filtering is performed in a horizontal or vertical or horizontal plus vertical direction by a current prediction unit is determined according to the motion vector deviation condition inside a sub-block, the motion vector deviation condition of each sub-block is the same, the problem that the condition of each sub-block or each pixel in the current prediction unit is not fully considered is not solved, and a solution is not provided.
Disclosure of Invention
The embodiment of the invention provides a method and a device for multiple times of self-adaptive partitioning prediction, which are used for solving the problems that affine secondary prediction in the related technology determines whether a current prediction unit carries out filtering in the horizontal or vertical or horizontal plus vertical direction according to the motion vector deviation condition in a sub-block, the motion vector deviation condition of each sub-block is the same, and the condition of each sub-block or each pixel in the current prediction unit is not fully considered.
According to an embodiment of the present invention, there is provided an adaptive partition multi-prediction method, including:
acquiring sample characteristics of a current prediction unit, wherein the sample characteristics of sub-blocks or pixels of the current prediction unit are not identical;
determining whether to perform partition multi-time prediction processing on each sub-block or each pixel of the current prediction unit based on the sample characteristics to obtain a determination result;
and if so, performing partition multiple prediction processing on the sub-blocks or the pixels.
Optionally, determining whether to partition the sub-blocks or pixels of the current prediction unit for multiple prediction processing based on the sample features comprises:
determining a condition threshold according to the sample characteristics;
performing the following steps for each sub-block or each pixel of the current prediction unit, wherein the currently executed sub-block or pixel is called as a current sub-block or a current pixel:
setting a first mark for judging whether the current sub-block or the current pixel is partitioned and predicted for multiple times according to the condition threshold;
and determining whether to perform partition multi-time prediction processing on the current sub-block or the current pixel according to the first mark.
Optionally, setting a first flag whether the current sub-block or the current pixel is partitioned for multiple predictions according to the condition threshold includes:
if the average value of the prediction samples of the current sub-block is larger than the condition threshold, setting the first flag to be 1;
and if the average value of the prediction samples of the current sub-block is less than or equal to the condition threshold value, setting the first flag to be 0.
Optionally, determining whether to partition the current sub-block or the current pixel for multiple prediction processing according to the first flag includes:
if the first flag is equal to 1, determining whether a second flag of the current prediction unit for partitioning and multi-time prediction in the horizontal direction is equal to 1 and whether a third flag of the current prediction unit for partitioning and multi-time prediction in the vertical direction is equal to 1, and performing partitioning and multi-time prediction processing on the current sub-block or the current pixel in the horizontal direction and the vertical direction;
if the first flag is equal to 1, the second flag is equal to 1 and the third flag is equal to 0, determining to perform partition multiple prediction processing on the current sub-block or the current pixel in the horizontal direction;
if the first flag is equal to 1, the second flag is equal to 0 and the third flag is equal to 1, determining to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction;
and if the first flag is equal to 0, the second flag is equal to 0 and the third flag is equal to 0, determining not to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction.
Optionally, the method further comprises:
determining a first mean of the sample features;
determining a second mean value of sample characteristics of a co-located Coding Unit (Coding Unit, abbreviated as CU) of the current prediction Unit;
and updating the condition threshold according to the first average value and the second average value to obtain the updated condition threshold.
Optionally, updating the condition threshold according to the first average value and the second average value, and obtaining the updated condition threshold includes:
determining a difference between the first mean and the second mean;
determining a sum of the conditional threshold and the difference as the updated conditional threshold.
Optionally, determining a condition threshold from the sample features comprises:
determining a mean of the sample features as a conditional threshold;
determining a maximum value of the sample feature as a conditional threshold; or
Determining a minimum value of the sample feature as a conditional threshold;
optionally, partitioning the sub-blocks or the pixels for multiple prediction comprises:
performing affine quadratic prediction processing on the sub-blocks or the pixels;
performing intra prediction processing on the sub-blocks or the pixels;
coding unit block division is performed on the subblocks or the pixels.
Optionally, the obtaining of the sample characteristic of the current prediction unit includes:
obtaining an affine prediction sample of the current prediction unit;
acquiring a texture of the current Prediction unit, wherein the texture is an absolute error and Affine quadratic Prediction (ASP) of a current subblock and a collocated subblock;
acquiring a deviation matrix of the current prediction unit;
wherein the sample characteristics include one of: affine prediction samples, textures, bias matrices.
According to another embodiment of the present invention, there is also provided an adaptive partition multi-prediction apparatus including:
the device comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring the sample characteristics of a current prediction unit, and the sample characteristics of sub-blocks or pixels of the current prediction unit are not completely the same;
the first determining module is used for determining whether to perform partition multi-time prediction processing on sub-blocks or pixels of the current prediction unit based on the sample characteristics to obtain a determination result;
and the partitioning multi-prediction module is used for performing partitioning multi-prediction processing on the sub-blocks or the pixels if the determination result is positive.
Optionally, the first determining module includes:
a determining submodule for determining a condition threshold from the sample features;
an execution sub-module, configured to perform the following steps for each sub-block or each pixel of the current prediction unit, where a currently executed sub-block or pixel is referred to as a current sub-block or a current pixel:
setting a first mark for judging whether the current sub-block or the current pixel is partitioned and predicted for multiple times according to the condition threshold;
and determining whether to perform partition multi-time prediction processing on the current sub-block or the current pixel according to the first mark.
Optionally, the execution submodule includes:
a first setting unit, configured to set the first flag to 1 if the mean of the prediction samples of the current sub-block is greater than the conditional threshold;
a second setting unit, configured to set the first flag to 0 if the mean of the prediction samples of the current sub-block is less than or equal to the conditional threshold.
Optionally, the execution submodule includes:
a first processing unit, configured to determine to perform partition multi-prediction processing on the current sub-block or the current pixel in the horizontal direction and the vertical direction if the first flag is equal to 1, and a second flag of whether the current prediction unit performs partition multi-prediction in the horizontal direction is equal to 1 and a third flag of whether the current prediction unit performs partition multi-prediction in the vertical direction is equal to 1;
a second processing unit, configured to determine to perform partition multiple prediction processing on the current sub-block or the current pixel in the horizontal direction if the first flag is equal to 1, the second flag is equal to 1, and the third flag is equal to 0;
a third processing unit, configured to determine to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction if the first flag is equal to 1, the second flag is equal to 0, and the third flag is equal to 1;
and if the first flag is equal to 0, the second flag is equal to 0 and the third flag is equal to 0, determining not to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction.
Optionally, the apparatus further comprises:
a second determination module for determining a first mean of the sample features;
a third determining module, configured to determine a second mean of sample characteristics of co-located coding units, CUs, of the current prediction unit;
and the updating module is used for updating the condition threshold according to the first average value and the second average value to obtain the updated condition threshold.
Optionally, the updating module is further configured to determine a difference between the first average value and the second average value; determining a sum of the conditional threshold and the difference as the updated conditional threshold.
Optionally, the determining sub-module is further configured to determine a mean of the sample features as a conditional threshold; determining a maximum value of the sample feature as a conditional threshold; or determining the minimum value of the sample characteristic as a condition threshold value;
optionally, the partition multi-prediction module comprises:
the secondary prediction processing module is used for carrying out affine secondary prediction processing on the subblocks or the pixels;
an intra-frame prediction module, configured to perform intra-frame prediction processing on the sub-blocks or the pixels;
and the coding unit block dividing module is used for carrying out coding unit block division on the sub-blocks or the pixels.
Optionally, the obtaining module is further configured to
Obtaining an affine prediction sample of the current prediction unit;
acquiring texture of the current prediction unit, wherein the texture is the ASP and the absolute error of a current subblock and a collocated subblock;
acquiring a deviation matrix of the current prediction unit;
wherein the sample characteristics include one of: affine prediction samples, textures, bias matrices.
According to a further embodiment of the present invention, a computer-readable storage medium is also provided, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above-described method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
The invention can solve the problem that the partition multi-prediction in the related technology determines whether the current prediction unit carries out filtering in the horizontal or vertical or horizontal plus vertical direction according to the motion vector deviation condition in the sub-block, the motion vector deviation condition of each sub-block is the same, and the condition of each sub-block or each pixel in the current prediction unit is not fully considered.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of an adaptive partition multi-prediction method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of an adaptive partition multi-prediction method according to an embodiment of the invention;
fig. 3 is a schematic diagram of motion compensation according to the present embodiment;
FIG. 4 is a first diagram illustrating a current encoding block in affine mode according to the present embodiment;
FIG. 5 is a second diagram of the current encoding block in affine mode according to the present embodiment;
FIG. 6 is a third diagram of the current encoding block in affine mode according to the present embodiment;
FIG. 7 is a fourth schematic diagram of a current encoding block in affine mode according to the present embodiment;
FIG. 8 is a fifth schematic diagram of a current encoding block in affine mode according to the present embodiment;
FIG. 9 is a schematic diagram of a partitioned multi-prediction technique according to the present embodiment;
fig. 10 is a block diagram of an adaptive partition multi-prediction apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a mobile terminal, a computer terminal, or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal of the adaptive partition multi-prediction method according to the embodiment of the present invention, and as shown in fig. 1, the mobile terminal may include one or more processors 102 (only one is shown in fig. 1) (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data, and optionally, the mobile terminal may further include a transmission device 106 for communication function and an input/output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of an application software, such as a computer program corresponding to the adaptive partitioning multi-prediction method in the embodiment of the present invention, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and road surface emergency determination, i.e., to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, an adaptive partition multi-prediction method operating in the mobile terminal or the network architecture is provided, and fig. 2 is a flowchart of the adaptive partition multi-prediction method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, obtaining the sample characteristics of the current prediction unit, wherein the sample characteristics of the sub-blocks or pixels of the current prediction unit are not completely the same;
in an embodiment of the present invention, the step S202 may specifically include: acquiring texture of the current prediction unit, wherein the texture is the ASP and the absolute error of a current subblock and a collocated subblock; obtaining a deviation matrix of the current prediction unit, wherein the sample characteristic comprises one of: affine prediction samples, textures, bias matrices.
Step S204, determining whether to perform partition multi-time prediction processing on the sub-blocks or pixels of the current prediction unit based on the sample characteristics;
in an embodiment of the present invention, the step S204 may specifically include:
s2041, determining a condition threshold according to the sample features, specifically, determining a mean of the sample features as the condition threshold, determining a maximum of the sample features as the condition threshold, or determining a minimum of the sample features as the condition threshold;
s2042, performing the following steps for each sub-block or each pixel of the current prediction unit, wherein the currently executed sub-block or pixel is called as a current sub-block or a current pixel:
setting a first flag indicating whether the current sub-block or the current pixel is subjected to partition multi-time prediction according to the condition threshold, and further setting the first flag to be 1 if the average value of prediction samples of the current sub-block is greater than the condition threshold; setting the first flag to 0 if the mean of the prediction samples of the current sub-block is less than or equal to the condition threshold;
determining whether to perform partition multi-prediction processing on the current sub-block or the current pixel according to the first flag, specifically, if the first flag is equal to 1, determining whether a second flag of the current prediction unit for performing partition multi-prediction in the horizontal direction is equal to 1 and whether a third flag of the current prediction unit for performing partition multi-prediction in the vertical direction is equal to 1, and determining to perform partition multi-prediction processing on the current sub-block or the current pixel in the horizontal direction and the vertical direction; if the first flag is equal to 1, the second flag is equal to 1 and the third flag is equal to 0, determining to perform partition multiple prediction processing on the current sub-block or the current pixel in the horizontal direction; if the first flag is equal to 1, the second flag is equal to 0 and the third flag is equal to 1, determining to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction; and if the first flag is equal to 0, the second flag is equal to 0 and the third flag is equal to 0, determining not to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction.
In step S206, if the determination result is yes, the subblock or the pixel is subjected to partition multi-prediction processing.
In an embodiment of the present invention, the step S206 may specifically include: performing affine quadratic prediction processing on the sub-blocks or the pixels; performing intra prediction processing on the sub-blocks or the pixels; coding unit block division is performed on the subblocks or the pixels.
Through the above steps S202 to S206, the problem that in the related art, the partition multi-prediction determines whether the current prediction unit performs filtering in the horizontal or vertical or horizontal plus vertical direction according to the motion vector deviation condition inside the sub-block, the motion vector deviation condition of each sub-block is the same, and the condition of each sub-block or each pixel in the current prediction unit is not fully considered can be solved, each sub-block or each pixel is subjected to partition multi-prediction based on the sample characteristic of the current prediction unit, and because the sample characteristic of each sub-block or each pixel of the current prediction unit is different, whether each sub-block or each pixel is subjected to filtering can be determined, the sub-block or pixel with the determined result being yes is subjected to filtering, and the coding efficiency is further improved.
In an alternative embodiment, a first mean of the sample features is determined; determining a second mean of sample characteristics of co-located Coding Units (CUs) of the current prediction unit; updating the condition threshold according to the first average value and the second average value to obtain the updated condition threshold, and specifically determining a difference value between the first average value and the second average value; determining a sum of the conditional threshold and the difference as the updated conditional threshold. The condition threshold is improved so as to achieve the purpose of adaptively judging whether ASP technology is adopted or not according to the self rule of the image, and further improve the coding efficiency.
A new prediction tool affine prediction (affine) is proposed in AVS3 inter-frame prediction, and the scenes of rotation, scaling and the like are simulated by dividing a current block into a plurality of 4x4 or 8x8 sub-blocks with the same size, generating different MVs for each sub-block and respectively performing motion compensation. Fig. 3 is a schematic diagram of motion compensation according to the present embodiment, and as shown in fig. 3, affine prediction divides a 16 × 16 coded block into 16 4 × 4 sub-blocks, each sub-block performing motion compensation with a different MV.
FIG. 4 is a schematic diagram of a current encoding block in affine mode according to the present embodiment, as shown in FIG. 4And the MV of each sub-block in the CU is obtained by the MV of a CP (control point) point according to the position relation in a weighting mode. The 3 CPs are three points of the upper left, the upper right and the lower left of the current coding block, and the positions are shown in fig. 4. The MVs (v0, v1, v2) of the sub-blocks to which each CP belongs are referred to as CPMVs. The affine mode can be divided into 4-parameter affine and 6-parameter affine, the 4-parameter affine computing each sub-block MV with CPMV weighting of v0 and v1, and the 6-parameter affine computing each sub-block MV with CPMV weighting of v0, v1 and v2, i.e., (v)x,vy)。
When the number of CPMVs is 2:
Figure BDA0002817945900000111
when the number of CPMVs is 3:
Figure BDA0002817945900000121
where w and h denote the width and height of the neighboring CU, and x and y denote the horizontal and vertical distances from the current block upper-left CP point to the neighboring CU upper-left CP point, respectively.
Affine prediction can be divided into an affine _ inter mode and an affine _ MERGE mode, the application conditions and the candidate list construction methods of the two modes are different, the affine _ inter mode adds one MVD to each CPMV, and the CPMVs of the affine _ MERGE mode have no MVD.
Constructing an affine _ merge CPMV group candidate list, wherein the affine merge constructs a candidate list storing at most 5 CPMVs, and then selects a group of CPMVs from the candidate list as an optimal CPMV group prediction. The constructed CPMV group may be filled into the candidate list in the following order until 5 groups are filled, and the construction process is ended:
2.1 constructing the CPMV by using the motion information of the adjacent blocks in the affine mode, comprising:
2.1.1 check neighboring CU availability, checking neighboring minimum Coding Unit (SCU) blocks F- > G- > C- > A- > D in order. If a neighboring block is already encoded and the affine mode is used, the CU to which the neighboring SCU block belongs is considered to be available.
2.1.2 removing the same available neighboring CU, and obtaining the SCU position of the upper left corner in all the available neighboring CUs, thereby removing the same neighboring CU according to the removal. For example, G and B may be in the same CU, and a and F may be in the same CU. The remaining available neighboring CUs are reserved.
2.1.3 deriving the CPMV group from the available neighboring CUs, the specific method comprises:
and traversing available adjacent CUs in F- > G- > C- > A- > D in sequence twice. There are several CPMVs in the adjacent CU, there are several CPMVs in the CPMV group obtained this time, and the number of CPMVs in the list0 direction and the list1 direction is the same. Firstly, deriving a list0 direction CPMV, and then deriving a list1 direction CPMV;
acquiring MVs of SCUs (substation configuration units) to which LT, RT, LB and RB belong of 4 vertexes of adjacent CUs, and acquiring a CPMV group according to an affine model;
when the number of CPMVs is 2:
Figure BDA0002817945900000131
when the number of CPMVs is 3:
Figure BDA0002817945900000132
where w and h represent the width and height of a neighboring CU, and x and y represent the horizontal and vertical distances from the current block upper left CP Point to the upper left Control Point (CP) Point of a neighboring Coding Unit (Coding Unit, abbreviated as CU), respectively.
Fig. 5 is a schematic diagram of a current coding block in affine mode according to the present embodiment, where as shown in fig. 5, when an adjacent CU is adjacent to an upper boundary of the current CU, the number of Control Point Motion vectors (CPMV for short) is set to 2, v'0And v'1MV for the lower left and lower right SCU of the neighboring block, respectively.
FIG. 6 is a schematic diagram III of the current coding block in affine mode according to the present embodiment, as shown in FIG. 6, otherwise, v'0、v′1And v'2Motion Vectors (MVs) for the top left, top right, and bottom left SCU of the neighboring blocks, respectively.
2.1.4 adding the obtained CPMV group to the CPMV candidate list. If only the CPMV group in one direction can be acquired, the other direction cannot be acquired. The CPMV of the other direction is filled with null MVs (reference index-1).
2.2 obtaining motion information from a time-space domain to construct a candidate CPMV group, comprising:
when the method of section 2.1 fails to fill the candidate list, the method of section is adopted to continue to construct the CPMV group and fill the candidate list.
2.2.1 obtaining the MV of LT, RT, LB and RB position, fig. 7 is a diagram of the current coding block in affine mode according to the present embodiment, as shown in fig. 7, the MV of LT, RT, LB position is obtained from spatial neighboring blocks (coded and not intra-predicted), and the MV of RB position is obtained from temporal domain.
MV at LT, RT, LB positions the first obtainable MV as MV at that position in the following order:
the obtaining sequence of the LT.MV is A- > B- > D;
the obtaining sequence of the RT.MV is G- > C;
mv is obtained only from the neighboring block F;
and if the RB co-located SCU has the available MV, scaling the MV of the RB co-located SCU, and taking the scaled MV as the RB.
Fig. 8 is a schematic diagram of a current encoding block in affine mode according to the fifth embodiment, where as shown in fig. 8, cur _ CU represents a current CU, and col _ CU represents its co-located CU. cur _ rb _ SCU represents the lower right SCU of the current CU, col _ rb _ SCU represents the lower right SCU of its co-located CU. td and tb respectively represent the POC distances between the current picture cur _ pic, the co-located picture col _ pic and both reference pictures cur _ ref, col _ ref. Then the MV of RB position taken from time domain can be calculated by:
RB.MV=td/tb*col_rb_SCUMV;
wherein col _ rb _ SCUMV is the MV of col _ rb _ SCU.
The positions where no MV can be obtained will be set as unavailable and filled with invalid MVs (reference index-1).
2. The CPMV is constructed by adopting 6 modes from the MVs at the four positions of LT, RT, LB and RB, and comprises the following steps:
combination 0, MV at the position of LT RT LB is present and the reference index is the same, wherein v0 ═ lt.mv, v1 ═ rt.mv, v2 ═ lb.mv;
combination 1, the MV at the position of LT RT RB is present and the reference index is the same, wherein v0 ═ lt.mv, v1 ═ rt.mv, v2 ═ rb.mv + lt.mv-rt.mv;
combination 2, the MV at the position of LT LB RB is present and the reference index is the same, wherein v0 ═ lt.mv, v1 ═ rb.mv + lt.mv-lb.mv, v2 ═ lb.mv;
combination 3, the MV at the location of RT LB RB is present and the reference index is the same, wherein v0 ═ rt.mv + lb.mv-rb.mv, v1 ═ rt.mv, v2 ═ lb.mv;
combination 4, the MV at the position of LT RT is present and the reference index is the same, where v0 ═ lt.mv, v1 ═ rt.mv;
and (3) combination 5: the MV at the location of LT LB exists and the reference index is all 0, wherein,
v0=LT.MV,
v1.MV.x=LT.MV.x+((LB.MV.x-LT.MV.x)<<(Log2[Width]-Log2[Height])),
v1.MV.y=LT.MV.y-((LB.MV.y-LT.MV.y)<<(Log2[Width]-Log2[Height])),
wherein, Width and Height represent the Width and Height of the current block.
The constructable CPMV groups are filled into the candidate list in the order of combination 0 to combination 5, and the filling is stopped when full.
2.3 fill zero MVs, when the CPMV candidate list is not yet full, add several sets of zero CPMVs to the candidate list until 5 sets are full. There are 2 single forward zero MVs in the zero CPMV group, and their reference frame indexes are all 0. But the subsequent CPMVP selection process does not traverse the zero MVs.
3. Affine secondary prediction, performing point-based secondary prediction on the basis of an affine prediction result based on the sub-block, wherein the deviation of the motion vector of each point in the sub-block and the motion vector of the sub-block can be obtained by calculation according to an affine model.
Fig. 9 is a schematic diagram of the affine quadratic prediction technique according to the present embodiment, as shown in fig. 9, including:
(1) for the current prediction unit, the prediction unit may, among others,
and (2) width: a width of a current prediction unit;
height: the height of the current prediction unit;
(xE, yE): the current prediction unit luma predicts the position of the top left sample in the luma sample matrix of the current picture.
(2) For a sub-block in the current prediction unit, wherein,
a: the current prediction unit luminance predicts a sub-block where the upper left corner sample of the sample matrix is located;
b: the current prediction unit luminance predicts a subblock where the upper-right corner sample of the sample matrix is located;
c: the current prediction unit luma predicts the subblock where the lower left corner sample of the sample matrix is located;
subwidth: the width of each sub-block;
height: the height of each sub-block;
(x, y): coordinates of the position of the upper left corner of the current sub-block;
(i, j): the value range of i is 0 to (sub-width-1) and the value range of j is 0 to (sub-1) of the coordinates of the pixels in the luminance sub-block.
(3) For the affine quadratic prediction technique, wherein,
the motion vector deviation matrix of the current sub-block is dMv;
PredMatrixTemp: a prediction sample matrix based on the sub-blocks;
PredMatrix [ x + i ] [ y + j ]: prediction samples for quadratic prediction of (x + i, y + j) positions.
Then, the affine quadratic prediction technique can be briefly summarized as: deriving a motion vector array of the sub-block of the affine motion unit, deriving a pixel motion vector deviation matrix in the sub-block of the affine motion unit, and deriving a prediction sample of affine quadratic prediction. As described in detail below.
3.1 derivation of the motion vector array of the affine motion unit subblock, if there are 3 motion vectors in the motion vector group of the affine control point, the motion vector group is represented as mvsAffine (mv0, mv1, mv 2); otherwise (there are 2 motion vectors in the affine control point motion vector group), the motion vector group is denoted as mvsAffine (mv0, mv 1).
(1) Calculating variables dHorX, dVerX, dHorY and dVerY:
dHorX=(mv1_x-mv0_x)<<(7-Log(width));
dHorY=(mv1_y-mv0_y)<<(7-Log(width))。
(2) if there are 3 motion vectors in mvsAffine:
dVerX=(mv2_x-mv0_x)<<(7-Log(height));
dVerY=(mv2_y-mv0_y)<<(7-Log(height))。
(3) otherwise (2 motion vectors in mvaffine):
dVerX=-dHorY;
dVerY=dHorX。
(4) if the prediction reference mode of the current prediction unit is 'Pred _ List 01' or affinity deblocking sizeflag is equal to 1, then both subwidth and subweight are equal to 8, (x, y) are the coordinates of the upper left corner position of the 8 × 8 subblocks, and the motion vector of each 8 × 8 luma subblock is calculated:
a, if the current subblock is A, both xPos and yPos are equal to 0;
b, otherwise, if the current sub-block is B, xPos is equal to width, and yPos is equal to 0;
c, otherwise, if the current subblock is C and 3 motion vectors exist in mvsAffine, xPos is equal to 0, and yPos is equal to height;
d, otherwise, xPos equals (x-xE) +4, yPos equals (y-yE) + 4;
e, motion vector mvE of the current 8 × 8 sub-block:
mvE_x=Clip3(-131072,131071,Rounding((mv0_x<<7)+dHorX*xPos+dVerX*yPos,7));
mvE_y=Clip3(-131072,131071,Rounding((mv0_y<<7)+dHorY*xPos+dVerY*yPos,7))。
(5) if the prediction reference mode of the current prediction unit is 'Pred _ List 0' or 'Pred _ List 1' and affinesblocksizeflag is equal to 0, then both subwidth and subweight are equal to 4, (x, y) is the coordinate of the upper left corner position of the 4 × 4 subblock, and the motion vector of each 4 × 4 luma subblock is calculated:
a, if the current subblock is A, both xPos and yPos are equal to 0;
b, otherwise, if the current sub-block is B, xPos is equal to width, and yPos is equal to 0;
c, otherwise, if the current subblock is C and 3 motion vectors exist in the mvAffinine, xPos is equal to 0, and height such as yPos is equal to 0;
d, otherwise, xPos equals (x-xE) +2, yPos equals (y-yE) + 2;
e, motion vector mvE of the current 4 × 4 sub-block:
mvE_x=Clip3(-131072,131071,Rounding((mv0_x<<7)+dHorX*xPos+dVerX*yPos,7));
mvE_y=Clip3(-131072,131071,Rounding((mv0_y<<7)+dHorY*xPos+dVerY*yPos,7))。
3.2 derivation of the affine motion unit sub-block internal pixel motion vector deviation matrix, the affine quadratic prediction of the current predictor allows the flag affinescappredflag to be initialized to 1.
(1) If there are 2 motion vectors in mvAffinine and dHorX (i.e., mv1_ x-mv0_ x) is equal to 0 and dHorY (i.e., mv1_ y-mv0_ y) is equal to 0, then AffiniSecredFlag is set to 0 and the pixel motion vector bias array derivation process ends. Otherwise, continuing the subsequent steps.
(2) If there are 3 motion vectors in mvAffinine and dHorX equals 0 and dHorY equals 0 and dVerX (i.e., mv2_ x-mv0_ x) equals 0 and dVerY (i.e., mv2_ y-mv0_ y) equals 0, then AffiniSeccaddFlag is set to 0 and the pixel motion vector bias array derivation process ends. Otherwise, continuing the subsequent steps.
(3) Calculating motion vector deviations dMv [ k ] [ i ] [ j ] of each pixel (i, j) position inside 4 kinds of luminance predictor blocks (k ═ 0 to 3), wherein: dMv [ k ] [ i ] [ j ] [0] denotes the value of the horizontal component, dMv [ k ] [ i ] [ j ] [1] denotes the value of the vertical component.
a, if the current sub-block is A, k equals 1, the motion vector offset dMv [ k ] [ i ] [ j ] for the current pixel:
dMv[1][i][j][0]=dHorX*4*i+dVerX*4*j;
dMv[1][i][j][1]=dHorY*4*I+dVerY*4*j。
b, otherwise, if the current sub-block is B, k equals 2, the motion vector offset dMv [ k ] [ i ] [ j ] for the current pixel:
dMv[2][i][j][0]=dHorX*4*(i+1-subwidth)+dVerX*4*j;
dMv[2][i][j][1]=dHorY*4*(i+1-subwidth)+dVerY*4*j。
otherwise, if the current subblock is C and there are 3 motion vectors in mvAffinine, then k equals 3, the motion vector offset for the current pixel dMv [ k ] [ i ] [ j ]:
dMv[3][i][j][0]=dHorX*4*i+dVerX*4*(j+1-subheight);
dMv[3][i][j][1]=dHorY*4*i+dVerY*4*(j+1-subheight)。
d, otherwise, if the current subblock is C and there are 2 motion vectors in mvAffinine, then k equals 3, the motion vector offset for the current pixel dMv [ k ] [ i ] [ j ]:
dMv[3][i][j][0]=dHorX*(2+4*i–2*subwidth)+dVerX*(2+4*j–2*subheight);
dMv[3][i][j][1]=dHorY*(2+4*i–2*subwidth)+dVerY*(2+4*j–2*subheight).
e, otherwise, the current sub-block is other sub-blocks, k is equal to 0, and the motion vector offset dMv [ k ] [ i ] [ j ] of the current pixel:
dMv[0][i][j][0]=dHorX*(2+4*i–2*subwidth)+dVerX*(2+4*j–2*subheight);
dMv[0][i][j][1]=dHorY*(2+4*i–2*subwidth)+dVerY*(2+4*j–2*subheight).
(4) calculating variables dmvhhorabmax, dmverabmax and dMvThresh:
dMvHorAbsMax=max(max(abs(dMv[0][0][0][0]),abs(dMv[0][subwidth-1][0][0])),max(abs(dMv[0][0][subheight-1][0]),abs(dMv[0][subwidth-1][subheight-1][0])));
dMvVerAbsMax=max(max(abs(dMv[0][0][0][1]),abs(dMv[0][subwidth-1][0][1])),max(abs(dMv[0][0][subheight-1][1]),abs(dMv[0][subwidth-1][subheight-1][1])));
dMvThresh=((1<<5)*10)。
(5) initializing AffiniSecPredHorFlag and AffiniSecPredVerFlag to 1, comparing dMvHorAbsMax and dMvVerAbsMax with dMvThresh respectively:
if dMvHorAbsMax is less than dMvThresh and dMvVerAbsMax is less than dMvThresh, AffiniSecredFlag is set to 0 and the pixel motion vector deviant array derivation process ends.
Otherwise, if dMvHorAbsMax is less than dMvThresh, AffiniSecredHorFlag is set to 0;
otherwise, if dMvVerAbsMax is less than dMvThresh, AffiniSecpeddVerflag is set to 0.
If affineselecpredhorflag is 1, the nearest integer-pixel reference pixel is used for expanding pixels in a row and a column at the periphery of a prediction block based on a subblock of one subblock. The extended sub-block-based prediction block is 6x6 if the sub-block is 4x4, and 10x10 if the sub-block is 8x 8. Sub-pixel motion vector vs noting the horizontal component of the block motion vectorxSub-pixel motion vector vs of the vertical component of the sub-block motion vectory
If vsx≤1/2pelandvs y1/2pel is not more than, and integer pixels adjacent to the upper left corner are used;
otherwise, if vsx≤1/2pelandvsy> 1/2pel, using integer pixels adjacent to the bottom left corner;
otherwise, if vsx>1/2pelandvs y1/2pel or less, and using integer pixels adjacent to the upper right corner;
otherwise, the integer pixel adjacent to the lower right corner is used.
(6) If AffiniSecPredHorFlag is greater than 0, for each pixel position in the four luminance sub-blocks, k is 0-3, i is 0-0 (subwidth-1), and j is 0-0 (subwight-1), the following operations are performed:
dMv[k][i][j][0]=Clip3(-31,31,Rounding(dMv[k][i][j][0],8))。
(7) if AffiniSecPredVerFlag is greater than 0, for each pixel position in the four luminance sub-blocks, k is 0-3, i is 0-0 (subwidth-1), and j is 0-0 (subwight-1), the following operations are performed:
dMv[k][i][j][1]=Clip3(-31,31,Rounding(dMv[k][i][j][1],8))。
3.3 prediction sample derivation for affine quadratic prediction, comprising:
(1) for each sub-block in the current prediction unit, keeping the motion vector deviation matrix of the current sub-block as dMv, the following operations are performed:
a, if the current subblock is A, dMv equals dMv [1 ];
b, otherwise, if the current sub-block is B, dMv equals dMv [2 ];
otherwise, if the current subblock is C and there are 3 motion vectors in mvAffinine, dMv equals dMv [3 ];
d, otherwise, dMv equals dMv [0 ].
Wherein (x, y) is the coordinate of the position of the upper left corner of the current subblock, note that (i, j) is the coordinate of the pixel inside the luminance subblock, the range of value of i is 0 to (subwidth-1), the range of value of j is 0 to (subweight-1), and the prediction sample matrix based on the subblock is PredMatrix temp, and calculates the prediction sample PredMatrix [ x + i ] [ y + j ] of the quadratic prediction of (x + i, y + j):
(2) if AffiniSecPredHorFlag equals 1 and AffiniSecPredVerFlag equals 1:
PredMatrix[x+i][y+j]=(
PredMatrixTemp(x+i,y+j)*(-dMv[i][j][0]-dMv[i][j][1])+
PredMatrixTemp(x+i+1,y+j)*((-dMv[i][j][1])<<3)+
PredMatrixTemp(x+i+2,y+j)*(dMv[i][j][0]-dMv[i][j][1])+
PredMatrixTemp(x+i,y+j+1)*((-dMv[i][j][0])<<3)+
PredMatrixTemp(x+i+1,y+j+1)*(1<<9)+
PredMatrixTemp(x+i+2,y+j+1)*(dMv[i][j][0]<<3)+
PredMatrixTemp(x+i,y+j+2)*(-dMv[i][j][0]+dMv[i][j][1])+
PredMatrixTemp(x+i+1,y+j+2)*(dMv[i][j][1]<<3)+
PredMatrixTemp(x+i+2,y+j+2)*(dMv[i][j][0]+dMv[i][j][1])+
(1<<8))>>9。
namely: a 3x3 rectangular filter was used as shown in graph 1.
TABLE 1
-dMv[i][j][0]-dMv[i][j][1] -(dMv[i][j][1])<<3 dMv[i][j][0]-dMv[i][j][1]
(-dMv[i][j][0])<<3 16 dMv[i][j][0]<<3
-dMv[i][j][0]+dMv[i][j][1] dMv[i][j][1]<<3 dMv[i][j][0]+dMv[i][j][1]
(3) Otherwise, if AffiniSecPredHorFlag is equal to 1:
PredMatrix[x+i][y+j]=(
PredMatrixTemp(x+i,y+j+1)*((-dMv[i][j][0]))+
PredMatrixTemp(x+i+1,y+j+1)*(1<<6)+
PredMatrixTemp(x+i+2,y+j+1)*(dMv[i][j][0])+
(1<<5))>>6。
namely: a 3-tap horizontal one-dimensional filter is used as shown in table 2.
TABLE 2
-dMv[i][j][0] 2 dMv[i][j][0]
(4) Otherwise:
PredMatrix[x+i][y+j]=(
PredMatrixTemp(x+i+1,y+j)*(-dMv[i][j][1])+
PredMatrixTemp(x+i+1,y+j+1)*(1<<6)+
PredMatrixTemp(x+i+1,y+j+2)*(dMv[i][j][1])+
(1<<5))>>6。
namely: a 3-tap vertical one-dimensional filter is used as shown in table 3.
(5) The prediction sample for finally obtaining the secondary prediction is as follows:
PredMatrixS[x+i][y+j]=Clip3(0,(1<<BitDepth)-1,PredMatrixS[x+i][y+j])。
TABLE 3
-dMv[i][j][1]
2
dMv[i][j][1]
The embodiment of the invention provides an affine quadratic prediction improvement method, which aims at solving the problem that whether each independent subblock in a current prediction unit is subjected to filtering in the horizontal or vertical or horizontal plus vertical direction or not is determined by not fully considering the respective condition of each subblock in the current prediction unit and not considering the condition of each pixel in the current prediction unit in the current ASP technology, and can further improve the coding efficiency.
The following describes the present embodiment in detail by taking the sample characteristics as affine prediction samples (i.e., prediction sample cases) and performing affine quadratic prediction processing based on the affine prediction samples as an example.
And judging whether each subblock is filtered in the horizontal or vertical or horizontal plus vertical direction or not according to the prediction sample condition of the subblock. Based on affine quadratic prediction, AffineSecPredHorFlag (corresponding to the second flag described above) and AffineSecPredVerFlag (corresponding to the third flag described above) are initialized to 1, and dmvhhorabmax and dmvvverabsmax are compared with dMvThresh, respectively. If dMvHorAbsMax is less than dMvThresh and dMvVerAbsMax is less than dMvThresh, the AffiniSecpredflag is set to 0, and the pixel motion vector deviation array derivation process is ended; otherwise, if dMvHorAbsMax is less than dMvThresh, AffiniSecredHorFlag is set to 0; otherwise, if dMvVerAbsMax is less than dMvThresh, AffineSecPredVerFlag (corresponding to the first flag above) is set to 0.
Suppose PredSubBlockMatrix is a prediction sample matrix based on sub-blocks; width is the width of the current prediction unit; height is the height of the current prediction unit; subwidth is the width of each subblock; height is the height of each subblock; (x, y) is the coordinates of the position of the upper left corner of the current sub-block; the AffiniSecPredSubBlockFlag is a mark for judging whether the current subblock is ASP or not; subblockackthresh is the decision threshold.
Then subblockackthresh equals the mean of the predicted samples for all sub-blocks; if the predicted sample mean of the current subblock is greater than SubBlockThresh, AffineSecPredSubBlockFlag is 1, otherwise AffineSecPredSubBlockFlag is 0.
And finally, judging whether each subblock is subjected to filtering in the horizontal or vertical or horizontal plus vertical direction according to conditions:
if AffiniSecPredHorFlag is equal to 1, AffiniSecPredVerFlag is equal to 1 and AffiniSecPredSubBlockFlag is equal to 1, filtering in the horizontal and vertical directions is carried out on the current subblock;
if AffiniSecPredHorFlag is equal to 1 and AffiniSecPredSubBlockFlag is equal to 1, filtering in the horizontal direction is carried out on the current subblock;
if AffiniSecPredVerFlag is equal to 1 and AffiniSecPredSubBlockFlag is equal to 1, filtering in the vertical direction is carried out on the current subblock;
otherwise, the sub-block is not filtered.
Whether each pixel is filtered in the horizontal or vertical or horizontal plus vertical direction is judged according to the prediction sample condition of the sub-blocks. Based on affine quadratic prediction, AffiniSecPredHorFlag and AffiniSecPredVerFlag are initialized to 1, and dMvHorAbsMax and dMvVerAbsMax are respectively compared with dMvThresh. If dMvHorAbsMax is less than dMvThresh and dMvVerAbsMax is less than dMvThresh, the AffiniSecpredflag is set to 0, and the pixel motion vector deviation array derivation process is ended; otherwise, if dMvHorAbsMax is less than dMvThresh, AffiniSecredHorFlag is set to 0; otherwise, if dMvVerAbsMax is less than dMvThresh, AffiniSecpeddVerflag is set to 0.
Suppose PredSubBlockMatrix is a prediction sample matrix based on sub-blocks; width is the width of the current prediction unit; height is the height of the current prediction unit; subwidth is the width of each subblock; height is the height of each subblock; (x, y) is the coordinates of the position of the upper left corner of the current sub-block; the AffiniSecPredSubBlockFlag is a mark for judging whether the current pixel is ASP or not; subblockackthresh is the decision threshold.
Then SubBlockThresh is equal to the mean of the predicted samples for the current sub-block; if the current predicted pixel value is greater than SubBlockThresh, then AffineSecPredSubBlockFlag is 1, otherwise AffineSecPredSubBlockFlag is 0.
And finally, judging whether each predicted pixel value is subjected to filtering in the horizontal or vertical or horizontal plus vertical direction according to conditions:
if AffiniSecPredHorFlag is equal to 1, AffiniSecPredVerFlag is equal to 1 and AffiniSecPredSubBlockFlag is equal to 1, filtering in the horizontal and vertical directions is carried out on the current prediction pixel value;
if AffiniSecPredHorFlag is equal to 1 and AffiniSecPredSubBlockFlag is equal to 1, filtering in the horizontal direction is carried out on the current prediction pixel value;
if AffiniSecPredVerFlag is equal to 1 and AffiniSecPredSubBlockFlag is equal to 1, filtering in the vertical direction is carried out on the current prediction pixel value;
otherwise, the current predicted pixel value is not filtered.
And (4) self-adaptive adjustment is carried out according to the pixel rule, and whether the threshold value of filtering in the horizontal direction or the vertical direction can be judged to be suitable for more scenes so as to further improve the coding efficiency. Based on the affine quadratic prediction process, it determines whether the threshold value made by the ASP is fixed (let it be: dMvThreshOld). Calculating the average value of prediction samples of all sub-blocks of the current prediction unit, wherein the average value is equal to CurBlockAvg; the average of the prediction samples of the current prediction unit co-located CU is calculated to be equal to LastBlockAvg, then the current threshold dMvThresh ═ dMvThreshOld + CurBlockAvg — LastBlockAvg.
If the sample features are texture or a bias matrix (i.e., the motion vector bias matrix), the specific process is similar to the affine prediction sample, and is not described herein again.
The embodiment of the invention judges whether each subblock is filtered in the horizontal direction or the vertical direction or the horizontal and vertical directions based on the prediction samples of the subblocks, thereby further improving the coding efficiency; and judging whether each pixel is filtered in the horizontal direction or the vertical direction or the horizontal and vertical directions based on the prediction samples of the subblocks, so as to further improve the coding efficiency. And (3) adaptively adjusting and judging whether the threshold value of filtering in the horizontal direction or the vertical direction can be carried out according to the pixel rule so as to be suitable for more scenes and further improve the coding efficiency.
Example 2
According to another embodiment of the present invention, there is also provided an adaptive partitioned multi-prediction apparatus, and fig. 10 is a block diagram of the adaptive partitioned multi-prediction apparatus according to the embodiment of the present invention, as shown in fig. 10, including:
an obtaining module 102, configured to obtain sample characteristics of a current prediction unit, where sample characteristics of sub-blocks or pixels of the current prediction unit are not identical;
a first determining module 104, configured to determine whether to perform partition multiple prediction processing on sub-blocks or pixels of the current prediction unit based on the sample characteristics;
and a partition multi-prediction module 106, configured to perform partition multi-prediction processing on the sub-block or the pixel if the determination result is yes.
Optionally, the first determining module 104 includes:
a determining submodule for determining a condition threshold from the sample features;
an execution sub-module, configured to perform the following steps for each sub-block or each pixel of the current prediction unit, where a currently executed sub-block or pixel is referred to as a current sub-block or a current pixel:
setting a first mark for judging whether the current sub-block or the current pixel is partitioned and predicted for multiple times according to the condition threshold;
and determining whether to perform partition multi-time prediction processing on the current sub-block or the current pixel according to the first mark.
Optionally, the execution submodule includes:
a first setting unit, configured to set the first flag to 1 if the mean of the prediction samples of the current sub-block is greater than the conditional threshold;
a second setting unit, configured to set the first flag to 0 if the mean of the prediction samples of the current sub-block is less than or equal to the conditional threshold.
Optionally, the execution submodule includes:
a first processing unit, configured to determine to perform partition multi-prediction processing on the current sub-block or the current pixel in the horizontal direction and the vertical direction if the first flag is equal to 1, and a second flag of whether the current prediction unit performs partition multi-prediction in the horizontal direction is equal to 1 and a third flag of whether the current prediction unit performs partition multi-prediction in the vertical direction is equal to 1;
a second processing unit, configured to determine to perform partition multiple prediction processing on the current sub-block or the current pixel in the horizontal direction if the first flag is equal to 1, the second flag is equal to 1, and the third flag is equal to 0;
a third processing unit, configured to determine to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction if the first flag is equal to 1, the second flag is equal to 0, and the third flag is equal to 1;
and if the first flag is equal to 0, the second flag is equal to 0 and the third flag is equal to 0, determining not to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction.
Optionally, the apparatus further comprises:
a second determination module for determining a first mean of the sample features;
a third determining module, configured to determine a second mean of sample characteristics of co-located coding units, CUs, of the current prediction unit;
and the updating module is used for updating the condition threshold according to the first average value and the second average value to obtain the updated condition threshold.
Optionally, the updating module is further configured to determine a difference between the first average value and the second average value; determining a sum of the conditional threshold and the difference as the updated conditional threshold.
Optionally, the determining sub-module is further configured to determine a mean of the sample features as a conditional threshold; determining a maximum value of the sample feature as a conditional threshold; or determining the minimum value of the sample characteristic as a condition threshold value;
optionally, the partition multi-prediction module comprises:
the secondary prediction processing module is used for carrying out partition multiple prediction processing on the subblocks or the pixels;
an intra-frame prediction module, configured to perform intra-frame prediction processing on the sub-blocks or the pixels;
and the coding unit block dividing module is used for carrying out coding unit block division on the sub-blocks or the pixels.
Optionally, the obtaining module is further configured to
Obtaining an affine prediction sample of the current prediction unit;
acquiring texture of the current prediction unit, wherein the texture is the ASP and the absolute error of a current subblock and a collocated subblock;
acquiring a deviation matrix of the current prediction unit;
wherein the sample characteristics include one of: affine prediction samples, textures, bias matrices.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, obtaining the sample characteristics of the current prediction unit, wherein the sample characteristics of the sub-blocks or pixels of the current prediction unit are not identical;
s2, determining whether to perform partition multiple prediction processing on the sub-blocks or pixels of the current prediction unit based on the sample characteristics;
s3, if the determination result is yes, performing the partition multi-prediction process on the subblock or the pixel.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Example 4
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, obtaining the sample characteristics of the current prediction unit, wherein the sample characteristics of the sub-blocks or pixels of the current prediction unit are not identical;
s2, determining whether to perform partition multiple prediction processing on the sub-blocks or pixels of the current prediction unit based on the sample characteristics;
s3, if the determination result is yes, performing the partition multi-prediction process on the subblock or the pixel.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. An adaptive partition multi-prediction method, comprising:
acquiring sample characteristics of a current prediction unit, wherein the sample characteristics of sub-blocks or pixels of the current prediction unit are not identical;
determining whether to partition sub-blocks or pixels of the current prediction unit for a plurality of prediction processes based on the sample features;
and if so, performing partition multiple prediction processing on the sub-blocks or the pixels.
2. The method of claim 1, wherein determining whether to partition sub-blocks or pixels of the current prediction unit for multiple prediction processes based on the sample features comprises:
determining a condition threshold according to the sample characteristics;
performing the following steps for each sub-block or each pixel of the current prediction unit, wherein the currently executed sub-block or pixel is called as a current sub-block or a current pixel:
setting a first mark for judging whether the current sub-block or the current pixel is partitioned and predicted for multiple times according to the condition threshold;
and determining whether to perform partition multi-time prediction processing on the current sub-block or the current pixel according to the first mark.
3. The method of claim 2, wherein setting a first flag indicating whether the current sub-block or the current pixel is partitioned for multiple predictions according to the condition threshold comprises:
if the average value of the prediction samples of the current sub-block is larger than the condition threshold, setting the first flag to be 1;
and if the average value of the prediction samples of the current sub-block is less than or equal to the condition threshold value, setting the first flag to be 0.
4. The method of claim 2, wherein determining whether to partition the current sub-block or the current pixel multiple prediction processes according to the first flag comprises:
if the first flag is equal to 1, determining whether a second flag of the current prediction unit for partitioning and multi-time prediction in the horizontal direction is equal to 1 and whether a third flag of the current prediction unit for partitioning and multi-time prediction in the vertical direction is equal to 1, and performing partitioning and multi-time prediction processing on the current sub-block or the current pixel in the horizontal direction and the vertical direction;
if the first flag is equal to 1, the second flag is equal to 1 and the third flag is equal to 0, determining to perform partition multiple prediction processing on the current sub-block or the current pixel in the horizontal direction;
if the first flag is equal to 1, the second flag is equal to 0 and the third flag is equal to 1, determining to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction;
and if the first flag is equal to 0, the second flag is equal to 0 and the third flag is equal to 0, determining not to perform partition multiple prediction processing on the current sub-block or the current pixel in the vertical direction.
5. The method of claim 2, further comprising:
determining a first mean of the sample features;
determining a second mean of sample characteristics of co-located Coding Units (CUs) of the current prediction unit;
and updating the condition threshold according to the first average value and the second average value to obtain the updated condition threshold.
6. The method of claim 5, wherein updating the conditional threshold according to the first mean and the second mean comprises:
determining a difference between the first mean and the second mean;
determining a sum of the conditional threshold and the difference as the updated conditional threshold.
7. The method of claim 2, wherein determining a condition threshold from the sample features comprises:
determining a mean of the sample features as a conditional threshold;
determining a maximum value of the sample feature as a conditional threshold; or
Determining a minimum value of the sample feature as a conditional threshold.
8. The method of claim 1, wherein partitioning the sub-blocks or the pixels for multiple prediction comprises:
performing affine quadratic prediction processing on the sub-blocks or the pixels;
performing intra prediction processing on the sub-blocks or the pixels;
coding unit block division is performed on the subblocks or the pixels.
9. The method according to any of claims 1 to 8, wherein obtaining the sample characteristic of the current prediction unit comprises:
obtaining an affine prediction sample of the current prediction unit;
acquiring texture of the current prediction unit, wherein the texture is the ASP and the absolute error of a current subblock and a collocated subblock;
acquiring a deviation matrix of the current prediction unit;
wherein the sample characteristics include one of: the affine prediction samples, the texture, the bias matrix.
10. A partitioned multi-prediction processing apparatus, comprising:
the device comprises an acquisition module, a prediction module and a prediction module, wherein the acquisition module is used for acquiring the sample characteristics of a current prediction unit, and the sample characteristics of sub-blocks or pixels of the current prediction unit are not completely the same;
a first determining module, configured to determine whether to perform partitioned multiple prediction processing on each sub-block or each pixel of the current prediction unit based on the sample feature;
and the partitioning multi-prediction module is used for performing partitioning multi-prediction processing on the sub-blocks or the pixels if the determination result is positive.
11. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to carry out the method of any one of claims 1 to 9 when executed.
12. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 9.
CN202011403779.3A 2020-12-04 2020-12-04 Adaptive partition multi-prediction method and device Active CN112601081B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011403779.3A CN112601081B (en) 2020-12-04 2020-12-04 Adaptive partition multi-prediction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011403779.3A CN112601081B (en) 2020-12-04 2020-12-04 Adaptive partition multi-prediction method and device

Publications (2)

Publication Number Publication Date
CN112601081A true CN112601081A (en) 2021-04-02
CN112601081B CN112601081B (en) 2022-06-24

Family

ID=75188135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011403779.3A Active CN112601081B (en) 2020-12-04 2020-12-04 Adaptive partition multi-prediction method and device

Country Status (1)

Country Link
CN (1) CN112601081B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022022278A1 (en) * 2020-07-29 2022-02-03 Oppo广东移动通信有限公司 Inter-frame prediction method, encoder, decoder, and computer storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011099792A2 (en) * 2010-02-10 2011-08-18 엘지전자 주식회사 Method and apparatus for processing a video signal
CN107534770A (en) * 2015-03-10 2018-01-02 华为技术有限公司 Image prediction method and relevant device
CN108293130A (en) * 2015-11-27 2018-07-17 联发科技股份有限公司 Pass through the device and method of the coding and decoding video of intra prediction
CN110741642A (en) * 2017-07-05 2020-01-31 华为技术有限公司 Apparatus and method for directional intra prediction using a fitted plane and a plurality of base reference samples, and a plurality of secondary reference samples
CN111050168A (en) * 2019-12-27 2020-04-21 浙江大华技术股份有限公司 Affine prediction method and related device thereof
CN111869218A (en) * 2018-03-07 2020-10-30 腾讯美国有限责任公司 Video coding and decoding method and device
CN111885387A (en) * 2019-05-02 2020-11-03 腾讯美国有限责任公司 Video decoding method and device for affine optical flow predicted value refinement

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011099792A2 (en) * 2010-02-10 2011-08-18 엘지전자 주식회사 Method and apparatus for processing a video signal
CN107534770A (en) * 2015-03-10 2018-01-02 华为技术有限公司 Image prediction method and relevant device
CN108293130A (en) * 2015-11-27 2018-07-17 联发科技股份有限公司 Pass through the device and method of the coding and decoding video of intra prediction
CN110741642A (en) * 2017-07-05 2020-01-31 华为技术有限公司 Apparatus and method for directional intra prediction using a fitted plane and a plurality of base reference samples, and a plurality of secondary reference samples
CN111869218A (en) * 2018-03-07 2020-10-30 腾讯美国有限责任公司 Video coding and decoding method and device
CN111885387A (en) * 2019-05-02 2020-11-03 腾讯美国有限责任公司 Video decoding method and device for affine optical flow predicted value refinement
CN111050168A (en) * 2019-12-27 2020-04-21 浙江大华技术股份有限公司 Affine prediction method and related device thereof

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022022278A1 (en) * 2020-07-29 2022-02-03 Oppo广东移动通信有限公司 Inter-frame prediction method, encoder, decoder, and computer storage medium

Also Published As

Publication number Publication date
CN112601081B (en) 2022-06-24

Similar Documents

Publication Publication Date Title
US20240064295A1 (en) Image encoding/decoding method and device, and recording medium in which bitstream is stored
CN111164974B (en) Image encoding/decoding method and apparatus, and non-transitory storage medium
CN108353168B (en) Method for encoding/decoding image and apparatus for encoding/decoding image
US20160269744A1 (en) Moving picture coding device, moving picture coding method, moving picture coding program, transmitting device, transmission method and transmission program, and moving picture decoding device, moving picture decoding method, moving picture decoding program, receiving device, reception method and reception program
KR20180107761A (en) Method and apparatus for prediction using reference block
KR20190046704A (en) Method and apparatus for asymmetric sub-block based video encoding/decoding
KR20180134764A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
JP2024028985A (en) Method of encoding video, electronic device, computer readable storage medium and computer program
KR20190038371A (en) Method and apparatus for encoding/decoding image and recording medium for storing bitstream
CN116886930A (en) Method and apparatus for encoding/decoding image and recording medium storing bit stream
CN112369021A (en) Image encoding/decoding method and apparatus for throughput enhancement and recording medium storing bitstream
KR20190062273A (en) Method and apparatus for image processing using image transform network and inverse transform neaural network
CN110024402B (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
US20240080450A1 (en) Image encoding/decoding method and device, and recording medium storing bitstream
CN112740697A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN113454990A (en) Inter-frame prediction coding and decoding method and device
CN113924779A (en) Video encoding/decoding method and apparatus, and bit stream storage medium
KR20190116067A (en) Method and apparatus for inter predection using reference frame generabed based on deep-learning
CN113196758A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN113228681A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
CN112601081B (en) Adaptive partition multi-prediction method and device
CN113875237A (en) Method and apparatus for signaling prediction mode related signals in intra prediction
CN113841404A (en) Video encoding/decoding method and apparatus, and recording medium storing bitstream
CN113261286A (en) Method and apparatus for deriving intra prediction mode
KR20200145778A (en) Method, apparatus and recording medium for encoding/decoding image using affine transform

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
GR01 Patent grant
GR01 Patent grant