CN115118990A - Chroma prediction method, device, encoding device, decoding device and storage medium - Google Patents

Chroma prediction method, device, encoding device, decoding device and storage medium Download PDF

Info

Publication number
CN115118990A
CN115118990A CN202210730957.6A CN202210730957A CN115118990A CN 115118990 A CN115118990 A CN 115118990A CN 202210730957 A CN202210730957 A CN 202210730957A CN 115118990 A CN115118990 A CN 115118990A
Authority
CN
China
Prior art keywords
value
sub
block
reconstructed
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210730957.6A
Other languages
Chinese (zh)
Inventor
张涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202210730957.6A priority Critical patent/CN115118990A/en
Publication of CN115118990A publication Critical patent/CN115118990A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • 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/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/186Methods 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 colour or a chrominance component
    • 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/523Motion estimation or motion compensation with sub-pixel accuracy

Abstract

The application provides a chroma prediction method, a device, an encoding device, a decoding device and a storage medium; the embodiment of the application can be applied to video coding and decoding scenes of cloud technology, artificial intelligence, intelligent transportation, vehicle-mounted and the like, and relates to the video coding technology, wherein the method comprises the following steps: analyzing the code stream to obtain a chroma prediction mode of the current block, and segmenting the current block into at least two sub-blocks according to the chroma prediction mode; predicting a predicted chrominance value of a pixel in a first sub-block based on a reconstructed luminance value and a reconstructed chrominance value of a first prediction reference pixel of a current block in a chrominance prediction mode and a reconstructed luminance value of the pixel in the first sub-block; for the second sub-block, determining a corresponding second prediction reference pixel; and predicting the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second predicted reference pixel and the reconstructed brightness value of the pixel in the second sub-block. By the method and the device, the accuracy of chromaticity prediction can be improved.

Description

Chroma prediction method, device, encoding device, decoding device and storage medium
Technical Field
The present application relates to video coding technologies, and in particular, to a chroma prediction method, device, encoding apparatus, decoding apparatus, and storage medium.
Background
In intra prediction, the chroma value of a coding block can be predicted using the reconstructed luma values of the same coding block, which can reduce the redundancy of cross components. The key point of constructing the chroma value of the coding block by using the reconstructed brightness value of the coding block is to determine a model parameter in a transformation model between the brightness and the chroma, wherein the model parameter is calculated according to the reconstructed brightness value and the reconstructed chroma value of reference pixels around the coding block.
However, in the related art, there is a problem that the distance between the pixel in the coding block and the reference pixel is far, so that the correlation between the pixel in the coding block and the reference pixel is low, and finally the accuracy of the chroma prediction is low.
Disclosure of Invention
Embodiments of the present application provide a chroma prediction method, a chroma prediction apparatus, an encoding device, a decoding device, a computer-readable storage medium, and a program product, which can improve the accuracy of chroma prediction.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a chroma prediction method, which comprises the following steps:
analyzing the code stream to obtain a chroma prediction mode of a current block, and dividing the current block into at least two sub-blocks according to the chroma prediction mode;
predicting to obtain a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
for a second sub-block of the at least two sub-blocks, determining a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
and predicting to obtain the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel and the reconstructed brightness value of the pixel in the second sub-block.
The embodiment of the application provides a chroma prediction method, which comprises the following steps:
determining a chroma prediction mode for a current block, and dividing the current block into at least two sub-blocks according to the chroma prediction mode;
predicting to obtain a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
for a second sub-block of the at least two sub-blocks, determining a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
and predicting to obtain the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel and the reconstructed brightness value of the pixel in the second sub-block.
An embodiment of the present application provides a chroma prediction apparatus, including:
the code stream analyzing module is used for analyzing the code stream to obtain the chromaticity prediction mode of the current block;
a first partitioning module for partitioning the current block into at least two sub-blocks according to the chroma prediction mode;
the first prediction module is used for predicting to obtain a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
a first determining module, configured to determine, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
the first prediction module is further configured to predict a predicted chrominance value of a pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block.
In some embodiments of the present application, the first segmentation module is configured to, when the chroma prediction mode characterization determines a model parameter by using upper neighboring pixels of the current block, perform average segmentation on the current block according to a horizontal direction to obtain at least two sub-blocks; and when the chroma prediction mode representation utilizes the left adjacent pixel of the current block to determine the model parameters, performing average segmentation on the current block according to the vertical direction to obtain at least two sub blocks.
In some embodiments of the present application, the first prediction module is further configured to calculate a first model parameter according to a reconstructed luminance value and a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode; calculating to obtain a second model parameter based on the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the first model parameter; and predicting to obtain the predicted chromatic value of the pixel in the first sub-block based on the first model parameter, the second model parameter and the reconstructed brightness value of the pixel in the first sub-block.
In some embodiments of the present application, the first prediction module is further configured to perform a linear chromaticity transformation on the reconstructed luminance values of the pixels in the first sub-block by using a linear transformation model obtained based on the first model parameter and the second model parameter, so as to obtain predicted chromaticity values of the pixels in the first sub-block, and complete prediction of the chromaticity values of the reconstructed luminance values in the first sub-block.
In some embodiments of the present application, the first prediction module is further configured to down-sample reconstructed luminance values of the first prediction reference pixel of the current block in the chroma prediction mode to obtain down-sampled luminance values, and extract N first luminance values in order from small to large and N second luminance values in order from large to small from the down-sampled luminance values; n is more than or equal to 2 and less than or equal to Q/2, and Q is the total number of the downsampled brightness values; extracting N first chrominance values corresponding to N first luminance values and N second chrominance values corresponding to N second luminance values from a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode; determining a difference value between the mean value of the N second chrominance values and the mean value of the N first chrominance values as a first difference value; determining a difference value between the average value of the N second brightness values and the average value of the N first brightness values as a second difference value; and determining the ratio of the first difference value and the second difference value as the first model parameter.
In some embodiments of the present application, the first prediction module is further configured to extract, from reconstructed luma values of the first prediction reference pixels of the current block in the chroma prediction mode, N first luma values in order from small to large; wherein N is greater than or equal to 2 and less than or equal to Q/2, Q being the total number of the first prediction reference pixels; extracting N first chrominance values corresponding to the N first luminance values from a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode; adjusting the average value of the N first brightness values by using the first model parameter to obtain an adjusted brightness average value; and calculating the difference value between the average value of the N first chrominance values and the adjusted brightness average value to obtain the second model parameter.
In some embodiments of the present application, the first prediction module is further configured to calculate a third model parameter according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel; a reconstructed chroma value of the second prediction reference pixel is derived based on a predicted chroma value of the second prediction reference pixel; calculating to obtain a fourth model parameter based on the reconstructed brightness value and the reconstructed chroma value of the second prediction reference pixel and the third model parameter; and predicting to obtain the predicted chromatic value of the pixel in the second sub-block based on the third model parameter, the fourth model parameter and the reconstructed brightness value of the pixel in the second sub-block.
In some embodiments of the present application, the first determining module is further configured to screen an intra candidate pixel from the first sub-block according to the chroma prediction mode; according to the internal candidate pixels, screening external candidate pixels from pixels positioned outside the current block; when the reconstructed brightness value and the reconstructed chroma value of the external candidate pixel exist, the internal candidate pixel and the external candidate pixel are jointly used as candidate reference pixels; determining the second prediction reference pixel corresponding to the second sub-block of the at least two sub-blocks from the candidate reference pixels.
In some embodiments of the present application, the first determining module is further configured to, when the external candidate pixel does not have the reconstructed luminance value and the reconstructed chrominance value, perform, by using the reconstructed luminance value and the reconstructed chrominance value of the internal candidate pixel, completion of the luminance value and the chrominance value on the external candidate pixel, respectively, to obtain a completed external candidate pixel; and taking the internal candidate pixel and the complemented external candidate pixel together as the candidate reference pixel.
An embodiment of the present application provides a chroma prediction apparatus, including:
a mode determination module to determine a chroma prediction mode for a current block;
a second partitioning module, configured to partition the current block into at least two sub-blocks according to the chroma prediction mode;
the second prediction module is used for predicting to obtain a predicted chromatic value of a pixel in a first sub-block based on a reconstructed brightness value and a reconstructed chromatic value of a first prediction reference pixel of the current block in the chromatic prediction mode and a reconstructed brightness value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel of the at least two sub-blocks;
a second determining module, configured to determine, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
the second prediction module is further configured to predict a predicted chrominance value of a pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block.
An embodiment of the present application provides a decoding apparatus, including:
a first memory for storing executable instructions;
and the first processor is used for realizing the chroma prediction method on the decoding device side provided by the embodiment of the application when executing the executable instructions stored in the first memory.
An embodiment of the present application provides an encoding apparatus, including:
a second memory for storing executable instructions;
and the second processor is used for realizing the chroma prediction method on the encoding device side provided by the embodiment of the application when the executable instructions stored in the second memory are executed.
The embodiment of the present application provides a computer-readable storage medium, which stores executable instructions for causing a first processor to execute the chroma prediction method on the decoding apparatus side provided in the embodiment of the present application, or causing a second processor to execute the chroma prediction method on the encoding apparatus side provided in the embodiment of the present application.
The present application provides a computer program product, which includes a computer program or an instruction, and when the computer program or the instruction is executed by a first processor, the computer program or the instruction implements the chroma prediction method on the decoding device side provided in the present application, or is used to cause a second processor to execute, the computer program or the instruction implements the chroma prediction method on the encoding device side provided in the present application.
The embodiment of the application has the following beneficial effects: the method comprises the steps of dividing a current block into at least two sub-blocks with smaller sizes according to a chrominance prediction mode obtained by analyzing a code stream, performing chrominance prediction on a first sub-block closest to the current block by using a first prediction reference pixel selected for the current block, and then reselecting a second prediction reference pixel closer to the first prediction reference pixel for a second sub-block farther from the first prediction reference pixel in the at least two sub-blocks so as to perform chrominance prediction on pixels in the second sub-block. In this way, the decoding device can ensure that the chroma prediction is carried out on the basis of the pixels with high enough correlation with each pixel in the current block, and the accuracy of the chroma prediction can be improved.
Drawings
FIG. 1 is a case of distribution of reference pixels of an encoded block;
FIG. 2 is a schematic diagram of a reference pixel in LM-A mode;
FIG. 3 is a schematic diagram of a reference pixel in LM-L mode;
fig. 4 is a schematic diagram of an architecture of a chroma prediction system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of the terminal in fig. 4 according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of the server in FIG. 4 according to an embodiment of the present disclosure;
fig. 7 is a schematic flowchart of a chroma prediction method according to an embodiment of the present application;
FIG. 8 is a diagram illustrating slicing a current block according to an embodiment of the present application;
FIG. 9 is another schematic diagram of slicing a current block according to an embodiment of the present application;
fig. 10 is a schematic flowchart of another chrominance prediction method according to an embodiment of the present disclosure;
fig. 11 is a schematic flowchart of a chroma prediction method according to an embodiment of the present application;
FIG. 12 is a schematic diagram of a candidate reference pixel provided in an embodiment of the present application;
FIG. 13 is another schematic diagram of a candidate reference pixel provided in an embodiment of the present application;
fig. 14 is a schematic flowchart of a chroma prediction method according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, the described embodiments should not be considered as limiting the present application, and all other embodiments obtained by a person of ordinary skill in the art without making creative efforts fall within the protection scope of the present application.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third \ fourth" are only to distinguish similar objects and do not denote a particular order or importance to the objects, and it is to be understood that "first \ second \ third \ fourth" may be interchanged with a particular order or sequence where permissible to enable embodiments of the present application described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
Before further detailed description of the embodiments of the present application, terms and expressions referred to in the embodiments of the present application will be described, and the terms and expressions referred to in the embodiments of the present application will be used for the following explanation.
1) Predictive coding is a method for data compression based on the statistical properties of video frames. The method and the device utilize the correlation of video frames in time and space, predict the pixel which is currently coded through the reconstructed pixel data, and then code the residual error between the predicted value obtained by prediction and the true value of the pixel, so that the coding can be completed by using less data quantity, and the effect of data compression is achieved.
2) Inter-frame prediction, refers to the fact that the pixel used for prediction and the pixel currently being encoded are not in the same video frame, but are generally in adjacent or nearby locations.
3) Intra-prediction, meaning that the pixels used for prediction and the pixels currently being encoded are both within the same video frame and are generally in adjacent regions.
Intra prediction may predict a block being encoded in units of blocks using neighboring and already reconstructed blocks. The prediction component is divided into luminance and chrominance.
4) Chroma prediction refers to a prediction technique that predicts the chroma component based on the luma component of the block being coded. The luminance component here is the reconstructed luminance value of the block being encoded.
5) A Coding Unit (CU) refers to a Unit that determines a prediction mode in a video Coding process, that is, different Coding blocks may use different prediction modes for Coding.
The predictive coding is carried out through the residual error between the predicted value and the true value of the pixel, and the coding can be completed by using a small amount of data. Both inter-frame prediction and intra-frame prediction include multiple prediction modes, and in the encoding process, the encoding device needs to determine an optimal prediction mode for each encoding block.
In the intra-frame prediction, the chroma value of the coding block can be predicted by performing cross-component prediction on the coding block, namely, the reconstructed luma value of the same coding block is used for predicting the chroma value of the coding block, so that the redundancy of cross components can be reduced, and the performance of the intra-frame prediction is further improved.
The key to constructing the chrominance values of the encoded blocks using the reconstructed luminance values of the encoded blocks is to determine model parameters in a transformation model between luminance and chrominance. Illustratively, equation (1) is a transformation model formulation between luminance and chrominance values:
pred_C(i,j)=α·rec_L′(i,j)+β (1)
where rec _ L' (i, j) is the downsampled value of the reconstructed luma values, pred _ C (i, j) is the predicted chroma value, and α and β are the model parameters that need to be determined.
The model parameters are calculated from reconstructed luminance and chrominance values of reference pixels located around the encoded block. Illustratively, fig. 1 is a case of distribution of reference pixels of an encoded block. The coding block includes an nxn chrominance block 1-1 and a 2 nx2N luminance block 1-2. The pixel values of the circular pixels around the chrominance block 1-1 have been reconstructed (i.e., the circular pixels have the reconstructed luminance value and the reconstructed chrominance value), the pixel values of the circular pixels around the luminance block 1-2 are downsampled to obtain the circular pixels around the chrominance block 1-1, and the circular pixels around the luminance block 1-2 are the reference pixels. The model parameters may be calculated using reconstructed luminance values and reconstructed chrominance values of a number of pixels selected from the reference pixels.
In the related art, the chrominance prediction may be divided into three prediction modes, i.e., a mode in which model parameters are jointly calculated based on an upper neighboring pixel and a left neighboring pixel (i.e., an LM mode, which can be understood as an illustration of the LM mode in fig. 1), a mode in which model parameters are calculated based on an upper neighboring pixel (i.e., an LM-a mode), and a mode in which model parameters are calculated based on a left neighboring pixel (i.e., an LM-L mode), depending on a reference pixel used in calculating the model parameters.
Assuming that the size of the coding block is W × H, in the LM mode, W 'is W, H' is H (W 'is a value of an abscissa of the rightmost reference pixel, H' is a value of an ordinate of the bottommost reference pixel, and W 'and H' determine a range of the reference pixels); in the LM-a mode, W' ═ W + H (i.e., the upper reference pixels are expanded to W + H in order to obtain enough reference pixels); in the LM-L mode, H' ═ H + W (i.e., the left reference pixel is expanded to H + W).
Illustratively, fig. 2 is a schematic diagram of a reference pixel in the LM-a mode, and it can be seen that the reference pixel 2-1 in the LM-a mode is a plurality of circular pixels located above the coding block 2-2. Fig. 3 is a schematic diagram of a reference pixel in the LM-L mode, and it can be seen that the reference pixel 3-1 in the LM-L mode is a plurality of circular pixels located at the left side of the coding block 3-2.
The distance between the pixel of the coding block and the reference pixel for calculating the model parameter represents the correlation between the pixel of the coding block and the reference pixel for calculating the model parameter, and the higher the correlation between the pixels is, the more accurate the obtained model parameter is and the more accurate the chromaticity prediction is. Therefore, the distance between the pixel in the coding block and the reference pixel affects the accuracy of the chroma prediction.
As can be seen from fig. 2 and 3, in the related art, there is a problem that the distance between the pixel in the coding block and the reference pixel is relatively long, so that the correlation between the pixel in the coding block and the reference pixel is relatively low, and finally the accuracy of the chroma prediction is relatively low.
Embodiments of the present application provide a chroma prediction method, device, encoding apparatus, decoding apparatus, and computer-readable storage medium, and program product, which can improve the accuracy of chroma prediction. The following describes exemplary applications of the encoding device and the decoding device provided by the embodiments of the present application, and the encoding device provided by the embodiments of the present application can be implemented as various types of terminals such as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable game device), and can also be implemented as a server; the decoding device provided by the embodiment of the present application may be implemented as various types of terminals, such as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, and a portable game device), and may also be implemented as a server. Next, an exemplary application when the encoding apparatus implements a server and the decoding apparatus implements a terminal will be described.
Referring to fig. 4, fig. 4 is an architecture diagram of a chroma prediction system provided in this embodiment, in order to support a chroma prediction application, in the chroma prediction system 100, a terminal 400 (an exemplary terminal 400-1 and a terminal 400-2 are shown) is connected to a server 200 through a network 300, where the network 300 may be a wide area network or a local area network, or a combination of the two. A database 500 is also provided in the chroma prediction system 100 to provide data support to the server 200. Database 500 may be configured in server 200 or may be independent of server 200, and fig. 4 illustrates a case where database 500 is independent of server 200.
The terminal 400-1 and the terminal 400-2 are configured to request a code stream of a video (e.g., a code stream of a variety video, a code stream of a live fitness broadcast, etc.) from the server 200 in response to a trigger operation of the usage object in the graphical interface 410-1 and the graphical interface 410-2, respectively; analyzing the code stream to obtain a chroma prediction mode of the current block, and segmenting the current block into at least two sub-blocks according to the chroma prediction mode; predicting to obtain a predicted chromatic value of a pixel in a first sub-block based on a reconstructed brightness value and a reconstructed chromatic value of a first prediction reference pixel of a current block in a chromatic prediction mode and a reconstructed brightness value of the pixel in the first sub-block, wherein the first sub-block is the sub-block which is closest to the first prediction reference pixel in at least two sub-blocks; for a second sub-block in the at least two sub-blocks, determining a corresponding second prediction reference pixel, wherein the distance between the second sub-block and the second prediction reference pixel is less than the distance between the second sub-block and the first prediction reference pixel; and predicting to obtain the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel and the reconstructed brightness value of the pixel in the second sub-block. Then, the terminal 400-1 and the terminal 400-2 may further perform chroma reconstruction on the current block according to the predicted chroma value and a residual coefficient in the code stream to obtain a reconstructed chroma value, so as to complete decoding of the current block.
The server 200 is configured to determine a chroma prediction mode for a current block in an original video to be encoded (i.e., a video before encoding), and split the current block into at least two sub-blocks according to the chroma prediction mode; predicting to obtain a predicted chromatic value of a pixel in a first sub-block based on a reconstructed brightness value and a reconstructed chromatic value of a first prediction reference pixel of a current block in a chromatic prediction mode and a reconstructed brightness value of the pixel in the first sub-block, wherein the first sub-block is the sub-block which is closest to the first prediction reference pixel in at least two sub-blocks; aiming at the second sub-block, determining a corresponding second prediction reference pixel, wherein the distance between the second prediction reference pixel and the second sub-block is smaller than the distance between the first prediction reference pixel and the second sub-block; and predicting to obtain the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second predicted reference pixel and the reconstructed brightness value of the pixel in the second sub-block. The server 200 may also determine a residual value of the chroma according to the predicted chroma value and the real chroma value, and obtain a code stream by performing conversion, quantization, encoding, and the like on the residual value.
In some embodiments, the server 200 may be an independent physical server, may also be a server cluster or a distributed system formed by a plurality of physical servers, and may also be a cloud server that provides basic cloud computing services such as cloud services, a cloud database, cloud computing, cloud functions, cloud storage, a network service, cloud communication, middleware services, domain name services, security services, a CDN, and a big data and artificial intelligence platform. The terminal 400 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a smart home appliance, a vehicle-mounted terminal, and the like. The terminal and the server may be directly or indirectly connected through wired or wireless communication, and the embodiment of the present application is not limited.
Referring to fig. 5, fig. 5 is a schematic structural diagram of the terminal (an implementation of a decoding device) in fig. 4 according to an embodiment of the present application, where the terminal 400 shown in fig. 5 includes: at least one first processor 410, a first memory 450, at least one first network interface 420, and a first user interface 430. The various components in the terminal 400 are coupled together by a first bus system 440. It is understood that the first bus system 440 is used to enable connected communication between these components. The first bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as a first bus system 440 in fig. 5.
The first Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The first user interface 430 includes one or more first output devices 431, including one or more speakers and/or one or more visual display screens, that enable the presentation of media content. The first user interface 430 also includes one or more first input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The first memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. The first memory 450 optionally includes one or more memory devices physically located remote from the first processor 410.
The first memory 450 includes either volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The first memory 450 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, the first memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
A first operating system 451 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a first network communication module 452 for communicating to other computing devices via one or more (wired or wireless) first network interfaces 420, an exemplary first network interface 420 comprising: bluetooth, wireless-compatibility authentication (Wi-Fi), and Universal Serial Bus (USB), etc.;
a first rendering module 453 for enabling the rendering of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more first output devices 431 (e.g., display screens, speakers, etc.) associated with the first user interface 430;
a first input processing module 454 for detecting one or more user inputs or interactions from one of the one or more first input devices 432 and translating the detected inputs or interactions.
In some embodiments, the chroma prediction apparatus provided in this embodiment may be implemented in software, and fig. 5 illustrates the chroma prediction apparatus 455 stored in the first memory 450, which may be software in the form of programs and plug-ins, and includes the following software modules: a code stream parsing module 4551, a first dividing module 4552, a first prediction module 4553 and a first determination module 4554, which are logical, and thus can be arbitrarily combined or further divided according to the implemented functions. The functions of the respective modules will be explained below.
Referring to fig. 6, fig. 6 is a schematic structural diagram of the server (an implementation of the encoding apparatus) in fig. 4 according to an embodiment of the present application, where the server 200 shown in fig. 6 includes: at least one second processor 210, a second memory 250, at least one second network interface 220, and a second user interface 230. The various components in server 200 are coupled together by a second bus system 240. It is understood that the second bus system 240 is used to enable connection communication between these components. The second bus system 240 includes a power bus, a control bus, and a status signal bus in addition to the data bus. But for clarity of illustration the various buses are labeled as the second bus system 240 in figure 6.
The second Processor 210 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc., wherein the general purpose Processor may be a microprocessor or any conventional Processor, etc.
The second user interface 230 includes one or more second output devices 231, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. The second user interface 230 also includes one or more second input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
The second memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, and the like. The second memory 250 optionally includes one or more storage devices physically located remote from the second processor 210.
The second memory 250 includes either volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read Only Memory (ROM), and the volatile Memory may be a Random Access Memory (RAM). The second memory 250 described in embodiments herein is intended to comprise any suitable type of memory.
In some embodiments, the second memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplified below.
A second operating system 251 including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
a second network communication module 252 for communicating to other computing devices via one or more (wired or wireless) second network interfaces 220, the exemplary second network interfaces 220 including: bluetooth, wireless-compatibility authentication (Wi-Fi), and Universal Serial Bus (USB), etc.;
a second presentation module 253 for enabling presentation of information (e.g., a user interface for operating peripherals and displaying content and information) via one or more second output devices 231 (e.g., a display screen, speakers, etc.) associated with the second user interface 230;
a second input processing module 254 for detecting one or more user inputs or interactions from one of the one or more second input devices 232 and translating the detected inputs or interactions.
In some embodiments, the chroma prediction apparatus provided by the embodiments of the present application may be implemented in software, and fig. 6 illustrates the chroma prediction apparatus 255 stored in the second memory 250, which may be software in the form of programs and plug-ins, and includes the following software modules: a mode determination module 2551, a second segmentation module 2552, a second prediction module 2553 and a second determination module 2554, which are logical and therefore can be combined arbitrarily or further split depending on the functionality implemented. The functions of the respective modules will be explained below.
In other embodiments, the chroma prediction apparatus provided in the embodiments of the present Application may be implemented in hardware, and for example, the chroma prediction apparatus provided in the embodiments of the present Application may be a processor in the form of a hardware decoding processor, which is programmed to perform the chroma prediction method provided in the embodiments of the present Application, for example, the processor in the form of the hardware decoding processor may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), or other electronic components.
In some embodiments, a terminal (an implementation of a decoding apparatus) or a server (an implementation of an encoding apparatus) may implement the chroma prediction method provided by the embodiments of the present application by running a computer program. For example, the computer program may be a native program or a software module in an operating system; can be a local (Native) Application program (APP), i.e. a program that needs to be installed in an operating system to run, such as a video processing APP; or may be an applet, i.e. a program that can be run only by downloading it to the browser environment; but also an applet that can be embedded into any APP. In general, the computer programs described above may be any form of application, module or plug-in.
The embodiment of the application can be applied to video coding and decoding scenes of cloud technology, artificial intelligence, intelligent transportation, vehicle-mounted and the like. In the following, the chroma prediction method provided by the embodiment of the present application will be described in conjunction with exemplary applications and implementations of the decoding apparatus provided by the embodiment of the present application.
Referring to fig. 7, fig. 7 is a schematic flowchart of a chroma prediction method according to an embodiment of the present application, and will be described with reference to the steps shown in fig. 7.
S101, the decoding device analyzes the code stream to obtain a chroma prediction mode of the current block, and divides the current block into at least two sub blocks according to the chroma prediction mode.
The embodiment of the application is realized in the scene of decoding the received code stream. The decoding device receives the code stream through a network, or acquires the code stream from the local, analyzes the code stream, obtains the chroma prediction mode parameter corresponding to the current block by reading the mode identification bit in the code stream, and then determines the chroma prediction mode used by the current block in chroma prediction through the chroma prediction mode parameter. Then, the decoding device performs at least one segmentation on the current block by using a sub-block segmentation method corresponding to the chroma prediction mode to obtain at least two sub-blocks. Each sub-block has a size smaller than that of the current block.
It can be understood that the chroma prediction modes can be classified as: the above-neighboring pixel and the left-neighboring pixel jointly calculate model parameters (i.e., LM mode), calculate model parameters based on the above-neighboring pixel (i.e., LM-a mode), and calculate model parameters based on the left-neighboring pixel (i.e., LM-L mode).
Different chroma prediction modes all have corresponding sub-block splitting methods, for example, performing average splitting according to a horizontal direction, or performing uneven splitting, or performing average splitting according to a vertical direction, or performing uneven splitting, and the like, and the embodiments of the present application are not limited herein.
S102, the decoding device obtains a predicted chromatic value of a pixel in a first sub-block through prediction based on a reconstructed brightness value and a reconstructed chromatic value of a first prediction reference pixel of a current block in a chromatic prediction mode and a reconstructed brightness value of the pixel in the first sub-block.
After the segmentation of the current block is completed, the decoding device determines a first prediction reference pixel used for calculating model parameters of the current block in chroma prediction according to a chroma prediction mode. Then, the decoding device obtains a reconstructed luminance value and a reconstructed chrominance value of the first prediction reference pixel, calculates model parameters (i.e., model parameters in a transformation model between luminance and chrominance) based on the reconstructed luminance value and the reconstructed chrominance value of the first prediction reference pixel, and predicts the chrominance value of each pixel in the first sub-block of the at least two sub-blocks by combining the calculated model parameters and the reconstructed luminance value of each pixel in the first sub-block to obtain a predicted chrominance value.
It should be noted that the first sub-block is a sub-block closest to the first prediction reference pixel in the at least two sub-blocks. That is to say, in the embodiment of the present application, the decoding device first screens, from the at least two sub-blocks, of which pixels have a stronger correlation with the first prediction reference pixel, based on the position of the first prediction reference pixel of the current block, as the first sub-block, so that a more accurate model parameter can be determined for one of the at least two sub-blocks by using the first prediction reference pixel.
It will be appreciated that the first prediction reference pixel of the current block is selected in conjunction with the chroma prediction mode of the current block. When the chroma prediction mode of the current block is the LM-A mode, the decoding device can obtain a first prediction reference pixel by screening from upper side adjacent pixels of the current block. For example, when the coordinates of the upper neighboring pixel are expressed as S [0, -1] … S [ W ' -1, -1], the decoding apparatus may determine S [ W '/8, -1], S [3W '/8, -1], S [5W '/8, -1], and S [7W '/8, -1] as the first prediction reference pixels. When the chroma prediction mode of the current block is LM-L, the decoding device can obtain a first prediction reference pixel from the left adjacent pixel of the current block by screening. For example, when the coordinates of the left-side neighboring pixel are expressed as S [ -1,0] … S [ -1, H ' -1], the decoding apparatus may use S [ -1, H '/8 ], S [ -1, 3H '/8 ], S [ -1, 5H '/8 ], and S [ -1, 7H '/8 ] as the first prediction reference pixel.
In the embodiment of the application, the reconstructed brightness value is obtained by reconstructing a predicted brightness value and a brightness residual value obtained based on a code stream, and the reconstructed chroma value is obtained by reconstructing a predicted chroma value and a chroma residual value obtained based on the code stream. That is, the code stream includes encoded data of luminance residual values and chrominance residual values in addition to the chrominance prediction mode parameters, and these encoded information can be transmitted using few bits.
In more detail, the decoding device decodes the code stream to obtain a decoded residual coefficient, and the residual coefficient is divided into a luminance residual coefficient and a chrominance residual coefficient. And then, the decoding equipment respectively carries out inverse quantization and inverse transformation on the luminance residual error coefficient and the chrominance residual error coefficient to respectively obtain a luminance residual error value and a chrominance residual error value. The decoding equipment firstly predicts to obtain a predicted brightness value, and then reconstructs to obtain a reconstructed brightness value based on the predicted brightness value and the brightness residual value. Then, the decoding device calculates a predicted colorimetric value based on the reconstructed luminance value and the calculated model parameter, and reconstructs the reconstructed colorimetric value through the predicted colorimetric value and the colorimetric residual value.
It is understood that, in the embodiment of the present application, the reconstructed luminance value and the reconstructed chrominance value of each type of pixel (including the first prediction reference pixel, the pixel in the current block, the second prediction reference pixel, and the like) may be calculated in the above manner.
S103, the decoding device determines a corresponding second prediction reference pixel for a second sub-block of the at least two sub-blocks.
The second sub-block is the remaining sub-block except the first sub-block from among the at least two sub-blocks, and these sub-blocks are sub-blocks farther from the first prediction reference pixel, which means that the correlation between the first prediction reference pixel and the pixels in the second sub-block is low, and if the first prediction reference pixel is directly used to calculate the model parameters for the second sub-block, the obtained model parameters are not accurate, thereby causing the chroma prediction of the second sub-block to be inaccurate. Therefore, in the embodiment of the present application, the decoding apparatus needs to determine the second prediction reference pixel used for calculating the model parameter again for the second sub-block.
It should be noted that the distance between the second sub-block and the second prediction reference pixel is smaller than the distance between the second sub-block and the first prediction reference pixel. In some embodiments, the decoding apparatus may filter the second prediction reference pixels from the pixels of the first sub-block, for example, filter a number of pixels at equal intervals from the last row of the first sub-block as the second prediction reference pixels. In other embodiments, the decoding device may further arbitrarily filter, from among pixels located outside the current block, pixels whose distance from the pixels in the second sub-block is lower than a distance threshold value, out of the pixels, as the second prediction reference pixels.
And S104, the decoding equipment predicts and obtains the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel and the reconstructed brightness value of the pixel in the second sub-block.
The decoding apparatus acquires the reconstructed luminance value and chrominance value of the second prediction reference pixel, calculates a model parameter for the second sub-block, and then predicts the predicted chrominance value of the pixel in the second sub-block from the reconstructed luminance value of the pixel in the second sub-block based on the model parameter. The predicted chrominance values of the pixels in the first sub-block have been obtained in the above-mentioned step, so that after the decoding apparatus obtains the predicted chrominance values of the pixels in the second sub-block, the predicted chrominance values of all the pixels in the current block are obtained.
It can be understood that, compared to the problem in the related art that the chroma prediction is ultimately low in accuracy due to the long distance between the pixels in the coding block and the reference pixels, in the embodiment of the present application, the decoding device may first divide the current block into at least two sub-blocks with smaller sizes according to the chroma prediction mode obtained by parsing from the code stream, first perform chroma prediction on a first sub-block closest to the current block by using a first prediction reference pixel selected for the current block, and then reselect a second prediction reference pixel closer to a second sub-block farther from the first prediction reference pixel among the at least two sub-blocks, so as to perform chroma prediction on pixels in the second sub-block. In this way, the decoding device can ensure that the chroma prediction is carried out on the basis of the pixels with high enough correlation with each pixel in the current block, and the accuracy of the chroma prediction can be improved.
That is to say, in the embodiment of the present application, the decoding apparatus divides the current block into at least two sub-blocks to implement prediction of the current block according to a finer sub-block granularity, so as to make chroma prediction for the current block finer. In addition, during each prediction, a prediction reference pixel which is closer to the subblock and has higher correlation is selected for the subblock to calculate the model parameters, so that the calculated model parameters are more accurate. In this way, by dividing the current block into finer sub-blocks and selecting prediction reference pixels with high correlation for the sub-blocks, the accuracy of the chroma prediction for the current block can be greatly improved.
In some embodiments of the present application, the implementation process of the decoding device splitting the current block into at least two sub-blocks according to the chroma prediction mode, that is, S101, may include: s1011 or S1012, as follows:
s1011, when the chroma prediction mode representation utilizes the upper side adjacent pixels of the current block to determine the model parameters, the decoding device averagely divides the current block according to the horizontal direction to obtain at least two sub blocks.
The upper neighboring pixels of the current block may be understood as a line of pixels located above the first line of pixels of the current block from top to bottom. The number of upper side neighboring pixels may be the same as or greater than the number of first line pixels of the current block. Since the upper adjacent pixels are represented in the video frame as a line of pixels in the horizontal direction, the decoding apparatus equally divides the current block into two sub-blocks or more sub-blocks according to the horizontal direction, so that the decoding apparatus can obtain at least two sub-blocks.
It can be understood that, by performing average segmentation on the current block in the horizontal direction, the shapes of the at least two sub-blocks can be matched with the shape formed by the upper adjacent pixels of the current block, so that it is ensured that the distance between the upper adjacent pixels and the pixels in the first sub-block of the at least two sub-blocks does not change, that is, the upper adjacent pixels can still be used as prediction reference pixels to participate in the operation process of the model parameters (that is, the prediction reference pixels do not need to be re-determined for the first sub-block), so as to reduce the number of sub-blocks in which the prediction reference pixels need to be re-determined, and save the calculation resources.
Exemplarily, fig. 8 is a schematic diagram of slicing a current block according to an embodiment of the present application. The current block 8-1 is a square coded block and the upper adjacent pixel 8-2 is a row of pixels located above the first row of pixels from top to bottom of the current block 8-1. When the chroma prediction mode determines model parameter model parameters by using upper side adjacent pixels, the decoding device performs average segmentation on the current block 8-1 according to the horizontal direction 8-3, so as to obtain at least two sub-blocks.
S1012, when the chroma prediction mode representation utilizes the left adjacent pixel of the current block to determine the model parameters, the decoding device averagely divides the current block according to the vertical direction to obtain at least two sub-blocks.
The left neighboring pixels of the current block may be understood as a column of pixels located to the left of a first column of pixels from left to right of the current block. The number of left-side neighboring pixels may be the same as or greater than the number of first-column pixels of the current block, and the embodiment of the present application is not limited herein. The left-side neighboring pixel represents a vertical column of pixels in the video frame, and thus, the decoding apparatus may slice the current block into two sub-blocks, or more sub-blocks, in the vertical direction to obtain at least two sub-blocks.
It can be understood that, by performing average segmentation on the current block in the vertical direction, the shapes of the at least two sub-blocks can be matched with the shape formed by the left-side adjacent pixels of the current block, so as to ensure that the distance between the left-side adjacent pixels and the pixels in the first sub-block of the at least two sub-blocks is not changed, that is, the left-side adjacent pixels can still be used as prediction reference pixels to participate in the operation process of the model parameters, and thus, the number of sub-blocks which need to determine the prediction reference pixels again can be reduced, and the calculation resources are saved.
Illustratively, fig. 9 is another schematic diagram of slicing a current block according to an embodiment of the present application. The left neighboring pixel 9-2 is a column of pixels located to the left of the first column of pixels from left to right of the current block 9-1. When the chroma prediction mode determines model parameter model parameters by using upper side neighboring pixels, the decoding device performs average segmentation on the current block 9-1 according to the vertical direction 9-3, thereby obtaining at least two sub-blocks.
It can be understood that, for the chroma prediction mode of the current block, the decoding device performs average segmentation of the current block in a corresponding direction to obtain at least two sub-blocks with the same size, so as to perform chroma prediction for each pixel in the current block by using a prediction reference pixel with higher correlation with the pixel.
Referring to fig. 10 based on fig. 7, fig. 10 is a schematic flowchart of another chroma prediction method according to an embodiment of the present application. In some embodiments of the present application, the predicting, by the decoding device, the predicted chroma value of the pixel in the first sub-block based on the reconstructed luma value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the reconstructed luma value of the pixel in the first sub-block, that is, a specific implementation process of S102, may include: S1021-S1023, as follows:
s1021, the decoding device calculates to obtain a first model parameter according to the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode.
In the embodiment of the present application, the transformation model between luminance and chrominance may be a linear transformation model. The decoding device determines two brightness values of a first model parameter based on the reconstructed brightness value of a first prediction reference pixel of a current block in a chromaticity prediction mode, and determines two chromaticity values corresponding to the two brightness values one by one based on the reconstructed chromaticity value of the first prediction reference pixel, so that two points on a two-dimensional coordinate system constructed by a brightness dimension and a chromaticity dimension are obtained, and then the model parameters (namely two parameters in a linear equation) of a linear transformation model can be determined by solving the equation through a two-point straight line.
In some embodiments, the decoding apparatus may use any two luminance values of the reconstructed luminance values of the first prediction reference pixel, and obtain two points in the two-dimensional coordinate system from the two luminance values and chrominance values corresponding to the two luminance values.
In still other embodiments, the decoding apparatus may further divide the reconstructed luminance values of the first prediction reference pixels into two sets, and calculate a luminance mean value for each set. Meanwhile, according to the corresponding relation between the reconstructed brightness value and the reconstructed chroma value, namely according to the reconstructed brightness value contained in each set, the reconstructed chroma value of the first prediction reference is divided into two sets, and then the chroma mean value is calculated for each set. In this way, the decoding apparatus can obtain two luminance mean values and two chrominance mean values corresponding to the two luminance mean values one to one, and construct two points in the two-dimensional coordinate system from the two luminance mean values and the two chrominance mean values.
S1022, the decoding device calculates a second model parameter based on the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the first model parameter.
The decoding device may optionally select two reconstructed luminance values from the reconstructed luminance values of the first prediction reference pixel, adjust the reconstructed luminance values by using the two reconstructed luminance values and the corresponding reconstructed chrominance values, and by using the calculated first model parameter, and then calculate to obtain a second model parameter by using the reconstructed chrominance values and the adjusted reconstructed luminance values.
The decoding device can also screen out N reconstructed brightness values from the brightness values of the first prediction reference pixel, calculate a brightness mean value of the N reconstructed brightness values, calculate a chromaticity mean value of N reconstructed chromaticity values corresponding to the N reconstructed brightness values, then adjust the brightness mean value by using the first model parameter, and calculate to obtain the second model parameter based on the chromaticity mean value and the adjusted brightness mean value.
And S1023, predicting to obtain a predicted chromatic value of the pixel in the first sub-block by the decoding equipment based on the first model parameter, the second model parameter and the reconstructed brightness value of the pixel in the first sub-block.
After obtaining the first model parameter and the second model parameter, the decoding device defines a linear transformation model when the pixels in the first sub-block are transformed from brightness to chroma, and directly uses the reconstructed brightness values of the pixels in the first sub-block as the input of the linear transformation model, or uses the processed brightness values obtained by processing the reconstructed brightness values of the pixels in the first sub-block by down-sampling and the like as the input of the linear transformation model, so as to realize the transformation from the brightness values to the chroma values, obtain the predicted chroma values of the pixels in the first sub-block, and complete the chroma value prediction processing of the reconstructed brightness values of the pixels.
In some embodiments of the present application, the implementation of S1023, in which the decoding device predicts the predicted chrominance value of the pixel in the first sub-block based on the first model parameter, the second model parameter, and the reconstructed luminance value of the pixel in the first sub-block, may include: s1023a, as follows:
and S1023a, the decoding device performs linear transformation on chroma of the reconstructed brightness value of the pixel in the first sub-block by using a linear transformation model obtained based on the first model parameter and the second model parameter to obtain a predicted chroma value of the pixel in the first sub-block, and the prediction of the chroma value of the reconstructed brightness value in the first sub-block is completed.
That is, in the embodiment of the present application, the decoding apparatus uses the reconstructed luminance values of the pixels in the first sub-block as an input of a linear variation model constructed based on the first model parameter and the second model parameter to realize the prediction of the chroma value.
For example, when the formula of the transformation model between the luminance value and the chrominance value can be shown in formula (1), the decoding apparatus uses the reconstructed luminance value of the pixel in the first sub-block as the input of formula (1) to obtain the predicted chrominance value of the pixel in the first sub-block.
In some embodiments of the present application, the calculating, by the decoding device, the first model parameter according to the reconstructed luminance value and the reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode, that is, the specific implementation process of S1021, may include: s1021a-S1021e, as follows:
s1021a, the decoding apparatus down-samples the reconstructed luminance value of the first prediction reference pixel of the current block in the chroma prediction mode to obtain down-sampled luminance values, and extracts N first luminance values in order from small to large and N second luminance values in order from large to small from the down-sampled luminance values.
In this embodiment of the application, the reconstructed luminance value of the first prediction reference pixel is greater than the number of the reconstructed chrominance values, that is, the reconstructed luminance value is calculated on a smaller scale, which can be understood as being calculated for the sub-pixels with finer granularity in the first prediction reference pixel, and therefore, the reconstructed chrominance value of the first preset reference pixel corresponds to a plurality of reconstructed luminance values. At this time, the decoding device performs downsampling processing on the reconstructed luminance value of the first prediction reference pixel to make the downsampled luminance value and the reconstructed chrominance value correspond to each other one by one, and then selects N smaller downsampled luminance values as the first luminance value and N larger downsampled luminance values as the second luminance value. The number of the first brightness value and the second brightness value is larger than 2 and smaller than Q/2, namely N is larger than or equal to 2 and smaller than or equal to Q/2, and Q is the total number of the down-sampling brightness values.
It can be understood that the value of Q may be set according to actual situations, for example, set to 4, set to 8, and the like, and the embodiment of the present application is not limited herein.
It should be noted that the decoding device may perform downsampling on the reconstructed luminance value of the first prediction reference pixel through pooling processing such as average pooling and maximum pooling. The decoding device can also perform convolution processing on the reconstructed brightness value through a convolution kernel for data dimension reduction to realize down-sampling of the reconstructed brightness value of the first prediction reference pixel.
S1021b, the decoding apparatus extracts N first chrominance values corresponding to the N first luminance values and N second chrominance values corresponding to the N second luminance values from the reconstructed chrominance values of the first prediction reference pixel of the current block in the chrominance prediction mode.
And the decoding equipment respectively selects the corresponding chromatic values from the reconstructed chromatic values of the first prediction reference pixels aiming at each selected first brightness value, so as to obtain N first chromatic values in one-to-one correspondence with the N first brightness values. Similarly, for each second luminance value, the decoding device may also select a corresponding chrominance value from the reconstructed chrominance values of the first prediction reference pixel, and obtain N second luminance values, where the N second luminance values correspond to the N second chrominance values one to one.
S1021c, the decoding apparatus determines a difference value between the mean value of the N second chrominance values and the mean value of the N first chrominance values as a first difference value.
And the decoding equipment performs mean value processing on the N second chrominance values to obtain a mean value of the N second chrominance values, and performs mean value processing on the N first chrominance values to obtain a mean value of the N first chrominance values. Then, the decoding device performs difference processing on the average value of the N second chrominance values and the average value of the N second chrominance values to obtain a first difference value.
S1021d, the decoding apparatus determines a difference between the average value of the N second luminance values and the average value of the N first luminance values as a second difference.
And finally, subtracting the average value of the N second brightness values from the average value of the N first brightness values to obtain a second difference value.
S1021e, the decoding apparatus determines a ratio of the first difference value and the second difference value as the first model parameter.
And finally, the decoding equipment performs ratio operation on the first difference and the second difference, and the obtained ratio is the first model parameter.
Illustratively, equation (2) is an operation formula for calculating the first model parameter provided in the embodiment of the present application, and is as follows:
Figure BDA0003713424790000231
where Ya is a mean value of the N second chrominance values, Yb is a mean value of the N first chrominance values, Xa is a mean value of the N second luminance values, Xb is a mean value of the N first luminance values, and α is a first model parameter.
To this end, the decoding apparatus completes the process of calculating the first model parameter based on the reconstructed luminance value and the reconstructed chrominance value of the first prediction reference pixel.
In some embodiments of the present application, the calculating a second model parameter based on the reconstructed luminance value and the reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode and the first model parameter, that is, the specific implementation process of S1022 may include: s1022a-S1022d, as follows:
s1022a, the decoding apparatus down-samples the reconstructed luminance value of the first prediction reference pixel of the current block in the chroma prediction mode to obtain down-sampled luminance values, and extracts N first luminance values from the down-sampled luminance values in order from small to large.
Where N is greater than or equal to 2 and less than or equal to Q/2, and Q is the total number of the first prediction reference pixels.
S1022b, the decoding apparatus extracts N first chrominance values corresponding to the N first luminance values from the reconstructed chrominance values of the first prediction reference pixels of the current block in the chrominance prediction mode.
S1022c, the decoding device adjusts the average value of the N first luminance values by using the first model parameter, so as to obtain an adjusted luminance average value.
The decoding device calculates the mean value of the N first brightness values, and scales and adjusts the mean value of the first N first brightness values by using the first model parameter to obtain the adjusted brightness mean value.
S1022d, the decoding device calculates a difference between the average value of the N first chrominance values and the adjusted luminance average value, so as to obtain a second model parameter.
The decoding device makes a difference between the average value of the N first chrominance values and the adjusted luminance average value, and the obtained result is the second model parameter.
Illustratively, equation (3) is an equation for calculating the second model parameter provided in the embodiments of the present application:
β=Yb-αXb (3)
where Yb is a mean of the N first chrominance values, Xb is a mean of the first luminance values, α is a first model parameter, and β is a second model parameter.
The decoding device has now performed the calculation of the second model parameters in order to subsequently determine the predicted chrominance values from the first model parameters and the second model parameters.
In some embodiments of the present application, the predicting, by the decoding device, the predicted chrominance value of the pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block, that is, the specific implementation process of S104 may include: S1041-S1043, as follows:
and S1041, calculating by the decoding device according to the reconstructed brightness value and the reconstructed chroma value of the second prediction reference pixel to obtain a third model parameter.
The reconstructed chroma value of the second prediction reference pixel is obtained based on the predicted chroma value of the second prediction reference pixel, that is, the reconstructed chroma value of the second prediction reference pixel is obtained based on the predicted chroma value of the second prediction reference pixel and the chroma residual value of the second prediction reference pixel obtained based on the code stream.
And S1042, calculating by the decoding device a fourth model parameter based on the reconstructed brightness value and the reconstructed chroma value of the second prediction reference pixel and the third model parameter.
And S1043, predicting to obtain a predicted chromatic value of the pixel in the second sub-block by the decoding device based on the third model parameter, the fourth model parameter and the reconstructed brightness value of the pixel in the second sub-block.
It is understood that the specific implementation processes of S1041-S1043 in the embodiment of the present application are similar to the specific implementation processes of S1021-S1023, and a description thereof is not repeated here.
Referring to fig. 11 based on fig. 7, fig. 11 is a schematic flowchart of a chroma prediction method according to an embodiment of the present application. In some embodiments of the present application, the determining, by the decoding device, a corresponding second prediction reference pixel for a second sub-block of the at least two sub-blocks, that is, a specific implementation process of S103, may include: S1031-S1034, as follows:
and S1031, the decoding device filters the internal candidate pixels from the first sub-block according to the chroma prediction mode.
When the chroma prediction mode characterization determines chroma-coded model parameters using upper-side neighboring pixels of the current block, the decoding apparatus may use a line of pixels located at the bottommost portion of the first sub-block as intra-candidate pixels. When the chroma prediction mode characterization determines chroma-coded model parameters using the left-side neighboring pixels of the current block, the decoding apparatus may use a column of pixels located at the rightmost side of the first sub-block as intra candidate pixels.
S1032, the decoding device screens the pixels outside the current block according to the internal candidate pixels to obtain external candidate pixels.
The decoding apparatus continues to extend the shape (e.g., row, column, etc.) of the region into which the intra candidate pixels are arranged to the outside of the current block, and determines the pixels outside the current block covered by the extended region as the outer candidate pixels.
For example, when the intra candidate pixels are aligned in a line, the decoding apparatus continues to extend the line of pixels to the outside of the current block by several pixels, or, when the intra candidate pixels are aligned in a column, the decoding apparatus continues to extend the column of pixels to the outside of the current block. Then, the decoding device will use the pixels covered by the extension and located outside the current block as the external candidate pixels.
S1033, when the reconstructed luminance value and the reconstructed chrominance value exist in the outer candidate pixel, the decoding apparatus uses the inner candidate pixel and the outer candidate pixel together as a candidate reference pixel.
After determining the outer candidate pixels, the decoding apparatus needs to determine whether the outer candidate pixels are available, i.e., whether there are any reconstructed luma values and reconstructed chroma values. When the decoding device judges that the reconstructed luminance value and the reconstructed chrominance value of the external candidate pixel exist, the external candidate pixel is judged to be available, and the internal candidate pixel and the external candidate pixel are jointly determined to be a candidate reference pixel for selecting the second prediction reference pixel.
For example, fig. 12 is a schematic diagram of a candidate reference pixel provided in an embodiment of the present application, in which a chroma prediction mode is to determine a model parameter of chroma coding using an upper neighboring pixel of a current block, a first prediction reference pixel of a first sub-block 12-11 in the current block 12-1 is extracted from the upper neighboring pixel 12-2, and a second prediction reference pixel of a second sub-block 12-12 needs to be selected from the candidate reference pixel 12-3 again. The candidate reference pixels include inner candidate pixels 12-31 and outer candidate pixels 12-32.
FIG. 13 is another exemplary diagram of a candidate reference pixel provided in the present application, in which the chroma prediction mode determines chroma-coded model parameters using left-side neighboring pixels of the current block, and a first prediction reference pixel of a first sub-block 13-11 of the current block 13-1 is extracted from the left-side neighboring pixel 13-2. The candidate reference pixels 13-3 of the second sub-block 13-12 comprise inner candidate pixels 13-31 (i.e. the rightmost column of pixels of the first sub-block 13-11) and outer candidate pixels 13-32.
S1034, the decoding device determines a second prediction reference pixel corresponding to a second sub-block of the at least two sub-blocks from the candidate reference pixels.
The decoding device may randomly select a plurality of pixels from the candidate reference pixels as the second prediction reference pixels, or may use a plurality of pixels extracted at preset positions as the second prediction reference pixels according to a preset interval, which is not limited herein in the embodiment of the present application.
In some embodiments of the present application, after the outer candidate pixel is obtained by screening from the pixels located outside the current block according to the inner candidate pixel, the method further includes, from the candidate reference pixels, before determining a second prediction reference pixel corresponding to a second sub-block of the at least two sub-blocks, that is, after S1032 and before S1034, the method further includes:
and S1035, when the reconstructed brightness value and the reconstructed chroma value do not exist in the external candidate pixel, the decoding device respectively completes the brightness value and the chroma value of the external candidate pixel by using the reconstructed brightness value and the reconstructed chroma value of the internal candidate pixel to obtain the completed external candidate pixel.
When the reconstructed luminance value and the reconstructed chrominance value do not exist in the external candidate pixel, the external candidate pixel cannot be directly added into the candidate reference pixel. At this time, the decoding device may select a pixel having the number of pixels that is the largest distance from the outer candidate pixels from the inner candidate pixels, or select a pixel having the largest distance from the outer candidate pixels, and copy the reconstructed luminance value and the reconstructed chrominance value of the selected pixels to the outer candidate pixels to complete the chrominance value and the luminance value of the outer candidate pixels.
S1036, the decoding device uses the inner candidate pixel and the supplemented outer candidate pixel together as a candidate reference pixel.
Finally, the decoding apparatus uses the inner candidate pixels and the outer candidate pixels whose chrominance values and luminance values are complemented, that is, the complemented outer candidate pixels, as candidate reference pixels.
In addition, in some embodiments, the decoding apparatus may determine only the inner candidate pixel as the candidate reference pixel instead of complementing the outer candidate pixel, so as to select the second candidate reference pixel.
It is to be understood that the decoding device determines the intra candidate pixel from the first sub-block and then determines the outer candidate pixel from the outside of the current block based on the intra candidate pixel according to the chroma prediction mode, so as to determine the candidate reference pixel with closer distance for the second sub-block, so as to select the second prediction reference pixel having stronger association with the pixel in the second sub-block.
In the following, the chroma prediction method provided by the embodiment of the present application will be described in conjunction with exemplary applications and implementations of the encoding apparatus provided by the embodiment of the present application.
Referring to fig. 14, fig. 14 is a schematic flowchart of a chroma prediction method according to an embodiment of the present application, which will be described with reference to the steps shown in fig. 14.
S201, the encoding device determines a chroma prediction mode for the current block and divides the current block into at least two sub-blocks according to the chroma prediction mode.
The coding device can pre-code the current block by utilizing each available prediction mode in the chroma prediction to obtain the rate distortion cost value of each available prediction mode, and determines the prediction mode corresponding to the optimal rate distortion cost value as the final chroma prediction mode of the current block.
The process of the encoding device segmenting the current block into at least two sub-blocks according to the chroma prediction mode is the same as the process of the decoding device segmenting the current block into at least two sub-blocks according to the chroma prediction mode, and the description is not repeated here.
S202, the encoding device predicts the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the reconstructed brightness value of the pixels in the first sub-block to obtain the predicted chroma value of the pixels in the first sub-block.
It should be noted that the first sub-block is a sub-block closest to the first prediction reference pixel in the at least two sub-blocks.
S203, the encoding device determines a corresponding second prediction reference pixel for a second sub-block of the at least two sub-blocks.
And the distance between the second sub-block and the second prediction reference pixel is smaller than that between the second sub-block and the first prediction reference pixel.
And S204, the encoding device predicts the reconstructed chrominance value of the pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block.
It is to be understood that the processing procedures of the encoding device sides S202 to S204 are similar to those of the decoding device sides S102 to S104, and a description thereof will not be repeated.
Next, an exemplary application of the embodiment of the present application in a practical application scenario will be described.
The embodiment of the application is realized in the scene of predicting the chroma value of the reconstructed brightness value of the block to be coded.
Before predicting the chrominance values from the reconstructed luminance values, first linear model parameters (model parameters of the transformation model) as in equation (1) need to be found. The calculation of the linear model parameters needs to be performed not only at the encoding end (encoding device), but also at the decoding end (decoding device), that is, α and β in equation (1) are not recorded in the code stream.
In the encoding process, an encoding end generally compares all available intra-frame chroma prediction modes through an encoding decision, so as to select a best mode (chroma prediction model) for encoding, meanwhile, the selected mode is recorded in a code stream through an identification bit (chroma prediction mode parameter) and transmitted to a decoding end, and the decoding end decodes the code stream to obtain the selected mode.
Since the closer the block to be encoded (current block) is to the reconstructed pixels used to calculate the linear model parameters, the higher the correlation, the more accurate the resulting linear model parameters. Therefore, in the embodiment of the present application, the distance between the reconstructed pixel and the block to be coded is shortened by dividing the current coding block into sub-blocks, so as to improve the accuracy of prediction.
In more detail, when the mode selected by the encoding end is the LM-a mode, the block to be encoded (W × H) is divided into two sub-blocks (with the size of W × H/2) with the same size according to the horizontal direction. For example, when the size of the block to be coded is 8 × 8, for the LM-a mode, the block to be coded is divided into two sub-blocks, each of which is 8 × 4 up and down (the division is similar to fig. 8). For the prediction of the upper half (the first sub-block), 8+4 ═ 12(W × H/2) pixels adjacent to the block to be coded are used, and these pixels are the reconstructed pixels referred to by the block to be coded in LM-a mode. The encoding end may use the 12 pixels (or, of course, 8(W) pixels above and adjacent to the block to be encoded) to perform calculation of the linear model parameters, and then use the calculated linear model parameters in prediction of the chrominance values. The upper half part is coded to obtain reconstructed pixel values (reconstructed brightness values and reconstructed chroma values of pixels of the first sub-block) of the upper half part, and the reconstructed pixel values are used for prediction of the lower half part (a second sub-block), namely, when linear model parameters are calculated by the lower half part, a row of reconstructed pixels (inner candidate pixels) from the bottom of the upper half part and pixels (outer candidate pixels) adjacent to the row of reconstructed pixels outside a block to be coded are used, and then chroma prediction of the lower half part is carried out by using the calculated linear model parameters.
For the LM-L mode, a block to be coded (W × H) is divided into two sub-blocks (W/2 × H) with the same size in the vertical direction. For example, when the size of the block to be coded is 8 × 8, the block to be coded is divided into two 4 × 8 sub-blocks (at least two sub-blocks) for the LM-L mode. For the prediction of the left half (first sub-block), the 4+ 8-12 (W/2+ H) pixels adjacent to the left half are used, or the 8(H) pixels on the left side closest to the block to be coded are used for calculating the linear model parameters, and then used for predicting the chroma of the block to be coded. The left half is encoded to obtain a reconstructed pixel value for prediction of a right half (a second sub-block), that is, a column of reconstructed pixels (inner candidate pixels) from the rightmost side of the left half and pixels (outer candidate pixels) outside a block to be encoded and adjacent to the column of reconstructed pixels are used when linear model parameters are calculated in the right half, and then chrominance prediction of the right half is performed by using the calculated linear model parameters.
In calculating the linear model parameters, four (Q) downsampled 4 luminance values may be selected from the downsampled luminance values of the neighboring luminance pixels, and two larger values, i.e. X, may be found through four comparisons 0 A And X 1 A (N second luminance values) and two smaller values X 0 B And X 1 B (N number of first luminance values). Then, the linear model parameters can be calculated according to the equation (2) and the equation (3). In equation (2), Xa is an average value of 2 larger luminance values among the 4 luminance values, Xb is an average value of 2 smaller luminance values among the 4 luminance values, Ya is an average value of chromaticity values (N second chromaticity values) corresponding to 2 larger luminance values among the 4 luminance values, and Yb is an average value of chromaticity values corresponding to 2 smaller luminance values (N first chromaticity values) among the 4 luminance values. In this way, the linear model parameters are calculated, and the chromaticity value (predicted chromaticity value) is predicted from the luminance value by equation (1).
It is understood that, in the embodiments of the present application, related data such as video to be encoded of a user, which relates to user information, when the embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and collection, use and processing of related data need to comply with related laws and regulations and standards of related countries and regions.
Continuing with the exemplary structure of the chroma decoding apparatus 455 provided by the embodiments of the present application implemented as software modules, in some embodiments, as shown in fig. 5, the software modules stored in the chroma decoding apparatus 455 of the first memory 450 may include:
a code stream analyzing module 4551, configured to analyze a code stream to obtain a chroma prediction mode of the current block;
a first partitioning module 4552 configured to partition the current block into at least two sub-blocks according to the chroma prediction mode;
a first prediction module 4553, configured to predict a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
a first determining module 4554, configured to determine, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
the first predicting module 4553 is further configured to predict the predicted chrominance value of the pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block.
In some embodiments of the present application, the first partitioning module 4552 is configured to, when the chroma prediction mode characterization determines the model parameter by using upper neighboring pixels of the current block, perform average partitioning on the current block according to a horizontal direction to obtain at least two sub-blocks; and when the chroma prediction mode representation utilizes the left adjacent pixel of the current block to determine the model parameters, performing average segmentation on the current block according to the vertical direction to obtain at least two sub blocks.
In some embodiments of the present application, the first prediction module 4553 is further configured to calculate a first model parameter according to a reconstructed luminance value and a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode; calculating to obtain a second model parameter based on the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the first model parameter; and predicting to obtain the predicted chromatic value of the pixel in the first sub-block based on the first model parameter, the second model parameter and the reconstructed brightness value of the pixel in the first sub-block.
In some embodiments of the present application, the first prediction module 4553 is further configured to perform a linear transformation on chroma of the reconstructed luma values of the pixels in the first sub-block by using a linear transformation model obtained based on the first model parameter and the second model parameter, so as to obtain a predicted chroma value of the pixels in the first sub-block, and complete prediction of the chroma value of the reconstructed luma values in the first sub-block.
In some embodiments of the present application, the first prediction module 4553 is further configured to down-sample reconstructed luminance values of the first prediction reference pixel of the current block in the chroma prediction mode to obtain down-sampled luminance values, and extract N first luminance values in order from small to large and N second luminance values in order from large to small from the down-sampled luminance values; n is more than or equal to 2 and less than or equal to Q/2, and Q is the total number of the downsampled brightness values; extracting N first chrominance values corresponding to N first luminance values and N second chrominance values corresponding to N second luminance values from a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode; determining a difference value between the mean value of the N second chrominance values and the mean value of the N first chrominance values as a first difference value; determining a difference value between the average value of the N second brightness values and the average value of the N first brightness values as a second difference value; and determining the ratio of the first difference to the second difference as the first model parameter.
In some embodiments of the present application, the first prediction module 4553 is further configured to extract N first luminance values in order from small to large from reconstructed luminance values of the first prediction reference pixel of the current block in the chroma prediction mode; wherein N is greater than or equal to 2 and less than or equal to Q/2, Q being the total number of the first prediction reference pixels; extracting N first chrominance values corresponding to the N first luminance values from a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode; adjusting the average value of the N first brightness values by using the first model parameter to obtain an adjusted brightness average value; and calculating the difference value between the average value of the N first chrominance values and the adjusted brightness average value to obtain the second model parameter.
In some embodiments of the present application, the first prediction module 4553 is further configured to calculate a third model parameter according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel; the reconstructed chroma value of the second prediction reference pixel is derived based on the predicted chroma value of the second prediction reference pixel; calculating to obtain a fourth model parameter based on the reconstructed brightness value and the reconstructed chroma value of the second prediction reference pixel and the third model parameter; and predicting to obtain the predicted chromatic value of the pixel in the second sub-block based on the third model parameter, the fourth model parameter and the reconstructed brightness value of the pixel in the second sub-block.
In some embodiments of the present application, the first determining module 4554 is further configured to obtain an intra candidate pixel from the first sub-block according to the chroma prediction mode; according to the internal candidate pixel, screening out external candidate pixels from pixels positioned outside the current block; when the reconstructed brightness value and the reconstructed chroma value of the external candidate pixel exist, the internal candidate pixel and the external candidate pixel are jointly used as candidate reference pixels; determining the second prediction reference pixel corresponding to the second sub-block of at least two of the sub-blocks from the candidate reference pixels.
In some embodiments of the present application, the first determining module 4554 is further configured to, when the external candidate pixel does not have the reconstructed luminance value and the reconstructed chrominance value, complement the luminance value and the chrominance value of the external candidate pixel with the reconstructed luminance value and the reconstructed chrominance value of the internal candidate pixel, respectively, to obtain a complemented external candidate pixel; and taking the internal candidate pixel and the complemented external candidate pixel together as the candidate reference pixel.
Continuing with the exemplary structure of the chroma encoding apparatus 255 provided by the embodiments of the present application implemented as software modules, in some embodiments, as shown in fig. 6, the software modules stored in the chroma decoding apparatus 255 of the second memory 250 may include:
a mode determination module 2551 for determining a chroma prediction mode for the current block;
a second segmentation module 2552 configured to segment the current block into at least two sub-blocks depending on the chroma prediction mode;
a second prediction module 2553, configured to predict a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
a second determining module 2554, configured to determine, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
the second prediction module 2553 is further configured to predict the predicted chroma value of the pixel in the second sub-block according to the reconstructed luma value and the reconstructed chroma value of the second prediction reference pixel and the reconstructed luma value of the pixel in the second sub-block.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the chroma prediction method according to the embodiment of the present application.
Embodiments of the present application provide a computer-readable storage medium having stored therein executable instructions, which when executed by a processor, will cause the processor to perform a chroma prediction method provided by embodiments of the present application, for example, the chroma prediction method as shown in fig. 7.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may, but need not, correspond to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
As an example, executable instructions may be deployed to be executed on one computing device (an implementation of an encoding device or a decoding device), or on multiple computing devices located at one site, or distributed across multiple sites and interconnected by a communication network.
In summary, according to the embodiments of the present application, the current block is divided into at least two sub-blocks with smaller sizes according to the chroma prediction mode obtained by parsing the code stream, the first prediction reference pixel selected for the current block is utilized to perform chroma prediction on the first sub-block closest to the current block, and then the second prediction reference pixel closer to the second sub-block, which is farther from the first prediction reference pixel, is reselected for the second sub-block of the at least two sub-blocks, so as to perform chroma prediction on pixels in the second sub-block. In this way, the decoding device can ensure that the chroma prediction is carried out on the basis of the pixels with high enough correlation with each pixel in the current block, and the accuracy of the chroma prediction can be improved.
The above description is only an example of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims (15)

1. A chroma prediction method, characterized in that the method comprises:
analyzing the code stream to obtain a chroma prediction mode of a current block, and dividing the current block into at least two sub-blocks according to the chroma prediction mode;
predicting to obtain a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
for a second sub-block of the at least two sub-blocks, determining a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
and predicting to obtain the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel and the reconstructed brightness value of the pixel in the second sub-block.
2. The method of claim 1, wherein the partitioning the current block into at least two sub-blocks according to the chroma prediction mode comprises:
when the chroma prediction mode representation utilizes the upper adjacent pixels of the current block to determine model parameters, the current block is averagely segmented according to the horizontal direction to obtain at least two sub blocks;
and when the chroma prediction mode representation utilizes the left adjacent pixel of the current block to determine the model parameters, performing average segmentation on the current block according to the vertical direction to obtain at least two sub blocks.
3. The method of claim 1 or 2, wherein the predicting the predicted chroma value of the pixel in the first sub-block based on the reconstructed luma value and the reconstructed chroma value of the first prediction reference pixel in the chroma prediction mode of the current block and the reconstructed luma value of the pixel in the first sub-block comprises:
calculating to obtain a first model parameter according to the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode;
calculating to obtain a second model parameter based on the reconstructed brightness value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the first model parameter;
and predicting to obtain the predicted chromatic value of the pixel in the first sub-block based on the first model parameter, the second model parameter and the reconstructed brightness value of the pixel in the first sub-block.
4. The method of claim 3, wherein predicting the predicted chroma value of the pixel in the first sub-block based on the first model parameter, the second model parameter, and a reconstructed luma value of the pixel in the first sub-block comprises:
and performing linear transformation on chroma on the reconstructed brightness values of the pixels in the first sub-block by using a linear transformation model obtained based on the first model parameter and the second model parameter to obtain a predicted chroma value of the pixels in the first sub-block, and completing prediction of the chroma value of the reconstructed brightness values in the first sub-block.
5. The method of claim 3, wherein the calculating a first model parameter according to the reconstructed luma value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode comprises:
downsampling reconstructed brightness values of the first prediction reference pixel of the current block in the chroma prediction mode to obtain downsampled brightness values, and extracting N first brightness values from small to large and N second brightness values from large to small from the downsampled brightness values; n is more than or equal to 2 and less than or equal to Q/2, Q being the total number of said down-sampled luminance values;
extracting N first chrominance values corresponding to N first luminance values and N second chrominance values corresponding to N second luminance values from a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode;
determining a difference value between the mean value of the N second chrominance values and the mean value of the N first chrominance values as a first difference value;
determining a difference value between the average value of the N second brightness values and the average value of the N first brightness values as a second difference value;
and determining the ratio of the first difference value and the second difference value as the first model parameter.
6. The method of claim 3, wherein the calculating a second model parameter based on the reconstructed luma value and the reconstructed chroma value of the first prediction reference pixel of the current block in the chroma prediction mode and the first model parameter comprises:
extracting N first luminance values in order from small to large from reconstructed luminance values of the first prediction reference pixels of the current block in the chroma prediction mode; wherein N is greater than or equal to 2 and less than or equal to Q/2, Q being the total number of the first prediction reference pixels;
extracting N first chrominance values corresponding to the N first luminance values from a reconstructed chrominance value of the first prediction reference pixel of the current block in the chrominance prediction mode;
adjusting the average value of the N first brightness values by using the first model parameter to obtain an adjusted brightness average value;
and calculating the difference value between the average value of the N first chrominance values and the adjusted brightness average value to obtain the second model parameter.
7. The method according to claim 1 or 2, wherein the predicting the predicted chrominance value of the pixels in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixels in the second sub-block comprises:
calculating to obtain a third model parameter according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel; a reconstructed chroma value of the second prediction reference pixel is derived based on a predicted chroma value of the second prediction reference pixel;
calculating to obtain a fourth model parameter based on the reconstructed brightness value and the reconstructed chroma value of the second prediction reference pixel and the third model parameter;
and predicting to obtain the predicted chromatic value of the pixel in the second sub-block based on the third model parameter, the fourth model parameter and the reconstructed brightness value of the pixel in the second sub-block.
8. The method according to claim 1 or 2, wherein said determining, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel comprises:
screening the first subblock according to the chroma prediction mode to obtain internal candidate pixels;
according to the internal candidate pixel, screening out external candidate pixels from pixels positioned outside the current block;
when the reconstructed brightness value and the reconstructed chroma value of the external candidate pixel exist, the internal candidate pixel and the external candidate pixel are jointly used as candidate reference pixels;
determining the second prediction reference pixel corresponding to the second sub-block of the at least two sub-blocks from the candidate reference pixels.
9. The method of claim 8, wherein after the outer candidate pixel is filtered from the pixels outside the current block according to the inner candidate pixel and before the second prediction reference pixel corresponding to the second sub-block of the at least two sub-blocks is determined from the candidate reference pixels, the method further comprises:
when the reconstructed brightness value and the reconstructed chroma value of the external candidate pixel do not exist, respectively completing the brightness value and the chroma value of the external candidate pixel by using the reconstructed brightness value and the reconstructed chroma value of the internal candidate pixel to obtain a completed external candidate pixel;
and taking the internal candidate pixel and the complemented external candidate pixel together as the candidate reference pixel.
10. A chroma prediction method applied to an encoder, the method comprising:
determining a chroma prediction mode for a current block, and dividing the current block into at least two sub-blocks according to the chroma prediction mode;
predicting to obtain a predicted chroma value of a pixel in a first sub-block based on a reconstructed luma value and a reconstructed chroma value of a first prediction reference pixel of the current block in the chroma prediction mode and a reconstructed luma value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
for a second sub-block of the at least two sub-blocks, determining a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
and predicting to obtain the predicted chromatic value of the pixel in the second sub-block according to the reconstructed brightness value and the reconstructed chromatic value of the second prediction reference pixel and the reconstructed brightness value of the pixel in the second sub-block.
11. A chroma prediction apparatus, characterized in that the apparatus comprises:
the code stream analyzing module is used for analyzing the code stream to obtain the chroma prediction mode of the current block;
a first partitioning module for partitioning the current block into at least two sub-blocks according to the chroma prediction mode;
the first prediction module is used for predicting to obtain a predicted chromatic value of a pixel in a first sub-block based on a reconstructed brightness value and a reconstructed chromatic value of a first prediction reference pixel of the current block in the chromatic prediction mode and a reconstructed brightness value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
a first determining module, configured to determine, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
the first prediction module is further configured to predict a predicted chrominance value of a pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block.
12. A chroma prediction apparatus, characterized in that the apparatus comprises:
a mode determination module for determining a chroma prediction mode for a current block;
a second partitioning module, configured to partition the current block into at least two sub-blocks according to the chroma prediction mode;
the second prediction module is used for predicting to obtain a predicted chromatic value of a pixel in a first sub-block based on a reconstructed brightness value and a reconstructed chromatic value of a first prediction reference pixel of the current block in the chromatic prediction mode and a reconstructed brightness value of the pixel in the first sub-block; wherein the first sub-block is a sub-block closest to the first prediction reference pixel among the at least two sub-blocks;
a second determining module, configured to determine, for a second sub-block of the at least two sub-blocks, a corresponding second prediction reference pixel; the second sub-block is less distant from the second prediction reference pixel than from the first prediction reference pixel;
the second prediction module is further configured to predict a predicted chrominance value of a pixel in the second sub-block according to the reconstructed luminance value and the reconstructed chrominance value of the second prediction reference pixel and the reconstructed luminance value of the pixel in the second sub-block.
13. A decoding device, characterized in that the decoding device comprises:
a first memory for storing executable instructions;
a first processor, configured to implement the chroma prediction method of any one of claims 1 to 9 when executing executable instructions stored in the first memory.
14. An encoding apparatus characterized by comprising:
a second memory for storing executable instructions;
a second processor, configured to execute the executable instructions stored in the second memory, to implement the chroma prediction method of claim 10.
15. A computer readable storage medium storing executable instructions which, when executed by a first processor, implement the chroma prediction method of any one of claims 1 to 9, or which, when executed by a second processor, implement the chroma prediction method of claim 10.
CN202210730957.6A 2022-06-24 2022-06-24 Chroma prediction method, device, encoding device, decoding device and storage medium Pending CN115118990A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210730957.6A CN115118990A (en) 2022-06-24 2022-06-24 Chroma prediction method, device, encoding device, decoding device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210730957.6A CN115118990A (en) 2022-06-24 2022-06-24 Chroma prediction method, device, encoding device, decoding device and storage medium

Publications (1)

Publication Number Publication Date
CN115118990A true CN115118990A (en) 2022-09-27

Family

ID=83330674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210730957.6A Pending CN115118990A (en) 2022-06-24 2022-06-24 Chroma prediction method, device, encoding device, decoding device and storage medium

Country Status (1)

Country Link
CN (1) CN115118990A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024078416A1 (en) * 2022-10-12 2024-04-18 维沃移动通信有限公司 Chromaticity component prediction method and apparatus, and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024078416A1 (en) * 2022-10-12 2024-04-18 维沃移动通信有限公司 Chromaticity component prediction method and apparatus, and device

Similar Documents

Publication Publication Date Title
CN103957415B (en) CU dividing methods and device based on screen content video
US10455229B2 (en) Prediction mode selection method, apparatus and device
US20170180727A1 (en) Picture prediction method and related apparatus
KR102271765B1 (en) Intraframe prediction method and apparatus, video encoding apparatus and storage medium
CN105959693A (en) Image coding apparatus, image coding method, image decoding apparatus, and image decoding method
Fu et al. Efficient depth intra frame coding in 3D-HEVC by corner points
CN115118990A (en) Chroma prediction method, device, encoding device, decoding device and storage medium
CN110381312B (en) HEVC (high efficiency video coding) -based depth partition range prediction method and device
CN111654696B (en) Intra-frame multi-reference-line prediction method and device, storage medium and terminal
JP7383720B2 (en) Image component prediction method, encoder, decoder and storage medium
CN114745551A (en) Method for processing video frame image and electronic equipment
CN112312131A (en) Inter-frame prediction method, device, equipment and computer readable storage medium
CN116866591A (en) Image coding method and device, computer equipment and medium
CN112995661B (en) Image encoding method and apparatus, electronic device, and storage medium
US20220021874A1 (en) Systems and methods for image coding
CN114520916B (en) Video encoding method, video encoding device, terminal equipment and storage medium
CN114697650A (en) Intra-frame division method based on down-sampling, related device equipment and medium
CN115278225A (en) Method and device for selecting chroma coding mode and computer equipment
CN114079769A (en) Video encoding method, apparatus, device and computer readable storage medium
JP7448641B2 (en) Current block prediction method, prediction device, device, storage medium
CN109302605B (en) Image coding method and device based on multi-core processor
Zhang et al. An early CU partition mode decision algorithm in VVC based on variogram for virtual reality 360 degree videos
CN114374843B (en) Live video coding method based on prediction mode selection and computer equipment
CN112511843B (en) Video encoding method, video encoding device, terminal device and storage medium
US20230232020A1 (en) Inter prediction encoding method, apparatus, and device, and readable storage medium

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