Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the application, fall within the scope of protection of the application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the "first" and "second" distinguishing between objects generally are not limited in number to the extent that the first object may, for example, be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/" generally means a relationship in which the associated object is an "or" before and after.
The prior art related to the present application is briefly described as follows.
In video coding, a frame of image is divided into a number of macroblocks, and prediction blocks are obtained using intra prediction or inter prediction. The difference between the original block and the predicted block is a residual block, and then the residual block is transformed, quantized, and entropy-encoded.
The picture types in video standards typically include I pictures, P pictures, and B pictures. The I picture can be independently decoded without referring to other pictures, the P picture uses a plurality of pictures (past) that are in display order before the current picture as reference pictures, and the B picture uses a plurality of pictures (past) that are in display order before the current picture and a plurality of pictures (future) that are in display order after the current picture as reference pictures.
1. Intra prediction
Intra prediction has many prediction modes to handle multiple types of textures in an image, including DC, planar, and some angular prediction modes. The peripheral reconstructed pixels are used as input, and the predicted value of the current predicted block is obtained through the specified predicted mode, so that the purpose of removing the spatial redundancy is achieved. The specified prediction mode index can be obtained explicitly from the code stream or can be inferred implicitly from the decoding end.
2. Most probable intra prediction mode (Most probably mode, MPM)
MPM is a technique for explicitly deriving intra-prediction modes. In view of the strong correlation between the current prediction block and the surrounding neighboring blocks, a most probable intra prediction mode candidate list is constructed using the prediction modes of the neighboring blocks. If the optimal prediction mode is in the list, only the index of this mode in the list needs to be written into the code stream, so that the number of bits required for coding the intra-prediction mode can be saved.
3. The decoding end derives intra prediction modes (Decoder-SIDE INTRA mode derivation, DIMD)
DIMD mode is a technique for implicitly deriving intra prediction modes. At the decoding end, a horizontal and vertical Sobel (Sobel) filter is applied to pixels in a template of width N around a block to perform gradient histogram calculation, then the direction of the gradient is converted into an intra prediction mode, and the intensity of the gradient is accumulated as the amplitude of the corresponding intra prediction mode, and the intra prediction mode is derived by comparing the magnitudes of the amplitudes in the gradient histogram. If DIMD mode identification of the current coding unit to be decoded is true, intra-prediction is performed using the derived intra-prediction mode, and if DIMD mode is false, the derived intra-prediction mode is used to construct an MPM list.
The following describes in detail the intra prediction method and apparatus provided by the embodiments of the present application through some embodiments and application scenarios thereof with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present application provides an intra prediction method, including:
Step 101, obtaining a gradient histogram of an intra-frame prediction mode of a template corresponding to a coding unit to be decoded;
Step 102, acquiring a first intra-frame prediction mode and a first candidate intra-frame prediction mode in the gradient histogram;
step 103, obtaining a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set;
Step 104, obtaining a prediction sample of a coding unit to be decoded according to the first intra-frame prediction mode and the second intra-frame prediction mode;
Wherein the set of candidate intra-prediction modes includes at least one intra-prediction mode of the gradient histogram other than the first intra-prediction mode and the first candidate intra-prediction mode, and further wherein the amplitudes of the first intra-prediction mode and the first candidate intra-prediction mode are each greater than or equal to the amplitude of each intra-prediction mode of the set of candidate intra-prediction modes.
Alternatively, the first intra-frame prediction mode is an intra-frame prediction mode with the largest amplitude (first large) corresponding to the intra-frame prediction mode contained in the gradient histogram, the first candidate intra-frame prediction mode is an intra-frame prediction mode with the second largest amplitude corresponding to the intra-frame prediction mode contained in the gradient histogram, and it should be noted that in the embodiment of the application, the implementation manner of acquiring the first intra-frame prediction mode and the first candidate intra-frame prediction mode may be that after the gradient histogram is acquired, all the intra-frame prediction modes are ordered according to the order of the amplitudes from large to small, and the two intra-frame prediction modes with the ordering positions at the forefront are selected, which may be understood as directly determining the intra-frame prediction modes with the first large amplitude and the second large amplitude in the gradient histogram.
Optionally, the amplitude of the first intra prediction mode in the embodiment of the present application is greater than or equal to the first candidate intra prediction mode.
In the present application, the first intra-frame prediction mode and the first candidate intra-frame prediction mode are not directly used to obtain the prediction samples of the coding unit to be decoded, so that the two intra-frame prediction modes selected in this way may not be optimal, the first candidate intra-frame prediction mode is used as the intra-frame prediction mode to be determined, if the first candidate intra-frame prediction mode is found to be directly used in the subsequent comparison process, the first candidate intra-frame prediction mode is used as the second intra-frame prediction mode, and if the first candidate intra-frame prediction mode is not directly used, one intra-frame prediction mode which can be directly used is selected as the second intra-frame prediction mode in the other compared intra-frame prediction modes.
It should be noted that, when performing video encoding and decoding, processing is performed for each frame image, and the frame image is divided into a plurality of coding units to perform prediction, that is, the coding unit to be decoded mentioned in the embodiment of the present application may be understood as a coding unit to be decoded (which may be referred to as a coding unit to be decoded) that is currently being processed.
Specifically, the implementation manner of step 101 in the embodiment of the present application is:
obtaining reconstructed samples of adjacent decoded pixels of a coding unit to be decoded;
constructing a template corresponding to a coding unit to be decoded according to the reconstructed sample;
and carrying out gradient analysis on the template to obtain a gradient histogram of an intra-frame prediction mode corresponding to the coding unit to be decoded.
For example, as shown in fig. 2, the Current CU represents the coding unit to be decoded currently, the region indicated by Templete represents the reconstructed sample of the template corresponding to the coding unit to be decoded currently, and the region indicated by REFERENCE OF THE TEMPLETE represents the reference sample of the template corresponding to the coding unit to be decoded currently.
Alternatively, one implementation manner that may be adopted in step 103 of the embodiment of the present application is:
step 1031, respectively utilizing a first candidate intra-frame prediction mode and each intra-frame prediction mode in a candidate intra-frame prediction mode set to generate a prediction sample of a template corresponding to a coding unit to be decoded;
it should be noted that, this step is to obtain a prediction sample of a template by using each intra prediction mode.
Step 1032, performing a first operation on the reconstructed samples of the template and the predicted samples of the template;
It should be noted that the first operation in the embodiment of the present application realizes the comparison of two samples, which is mainly to obtain the difference value of two samples, for example, the first operation may be calculated at the cost, and of course, the specific form of the first operation is not limited in the embodiment of the present application, and any operation mode capable of obtaining the difference value of two samples belongs to the protection scope of the first operation.
Step 1033, determining a second intra-frame prediction mode from the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set according to the result corresponding to the first operation;
it should be noted that, in step 1033, mainly, according to the result corresponding to the first operation, an intra-frame prediction mode with the smallest difference or difference between the reconstructed sample and the predicted sample indicated by the result corresponding to the first operation is selected as the second intra-frame prediction mode.
Optionally, in the case of the first operation being a cost calculation, the implementation of step 1033 is:
And determining the first intra-frame prediction mode candidate and the intra-frame prediction mode with the minimum cost calculation result corresponding to the intra-frame prediction mode candidate set as the second intra-frame prediction mode.
That is, the smallest difference or difference between the reconstructed samples and the predicted samples indicates that the result of the cost calculation is smallest.
Optionally, the result of the cost calculation may be the sum of absolute transformation differences, the sum of absolute differences, etc., which is certainly not limited in the embodiment of the present application, and all the calculation results capable of representing the difference between two samples belong to the protection range of the result of the cost calculation.
It should be noted that, because the intra-frame prediction mode derived by the decoding end is obtained in the present application, alternatively, the embodiment of the present application may perform the second intra-frame prediction mode only when the intra-frame prediction mode (DIMD) derived by the decoding end is identified as true, and certainly, the embodiment of the present application may also do without considering DIMD identification, that is, when the predicted sample is obtained, the first intra-frame prediction mode and the second intra-frame prediction mode may be obtained first by directly using this method, and then the predicted sample is obtained.
It should be noted that, in the case of considering DIMD identifiers, DIMD identifiers need to be acquired first, and optionally, the method for acquiring DIMD identifiers in the embodiment of the present application is as follows:
Before the gradient histogram of the intra-frame prediction mode of the template corresponding to the coding unit to be decoded is obtained, intra-frame prediction information of the coding unit to be decoded is obtained in the code stream, wherein the intra-frame prediction information comprises identification of a decoding end derived intra-frame prediction mode DIMD.
Further, the implementation manner of step 103 is:
And in the case that DIMD is identified as true, acquiring a second intra-prediction mode according to the first candidate intra-prediction mode and the candidate intra-prediction mode set.
Optionally, if the DIMD is identified as true, further judgment may be further performed according to the image type of the image to which the coding unit to be decoded belongs, specifically, if the image type of the image to which the coding unit to be decoded belongs is an I image, then the second intra-frame prediction mode is obtained according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set.
Alternatively, in the case that DIMD is identified as false, the decoding end does not acquire the second intra-prediction mode by using the method of step 103 any more, but directly adds the first intra-prediction mode and the first candidate intra-prediction mode to the MPM list.
Optionally, without considering DIMD identification, the method further comprises one of:
a11, adding the first intra-frame prediction mode and the first candidate intra-frame prediction mode into an MPM list;
It should be noted that, since a certain processing time is required to obtain the second intra-frame prediction mode, when the delay is not allowed, in order to increase the prediction rate, the first intra-frame prediction mode and the first candidate intra-frame prediction mode are selected to be added to the MPM list.
A12, adding the first intra-frame prediction mode and the second intra-frame prediction mode into an MPM list;
It should be noted that, because the second intra-frame prediction mode is a more accurate intra-frame prediction mode, the first intra-frame prediction mode and the second intra-frame prediction mode are added to the MPM list under the condition of allowing a delay, so as to improve the prediction accuracy.
Specific applications of the present application are exemplified below.
The main implementation process of the specific application case I is as follows:
Step S101, obtaining intra-frame prediction information of a current coding unit to be decoded from a code stream, where the intra-frame prediction information includes DIMD mode identifiers, MPM index values, intra-frame prediction mode index values, and the like.
Step S102, obtaining reconstructed samples of adjacent decoded pixels of a coding unit to be decoded currently;
step S103, constructing a template, wherein the template comprises a row (or a plurality of rows) above a coding unit to be decoded currently and/or a reconstructed sample of a decoded pixel in a left column (or a plurality of columns);
step S104, carrying out gradient analysis on the template to obtain a gradient histogram of an intra-frame prediction mode;
Step 105, selecting the intra-frame prediction mode with the largest amplitude value and the second largest from the gradient histogram as a first intra-frame prediction mode and a first candidate intra-frame prediction mode;
step S106, obtaining the intra-frame prediction mode of the current coding unit to be decoded according to the intra-frame prediction information obtained in step S101, wherein the method specifically comprises the following steps:
if DIMD mode identification is false and when the MPM list is used, adding the first intra-frame prediction mode and the first candidate intra-frame prediction mode obtained in the step S105 into the MPM list;
If DIMD mode identification is true, a final second intra-prediction mode is derived as follows, taking the first intra-prediction mode and the final second intra-prediction mode as intra-prediction modes of the coding unit currently to be decoded.
Specifically, the final second intra prediction mode is derived by:
Selecting an intra-frame prediction mode with the third largest amplitude value from the gradient histogram as a second candidate intra-frame prediction mode, comparing the second candidate intra-frame prediction mode with the first candidate intra-frame prediction mode, and selecting a final second intra-frame prediction mode;
the comparison is as follows:
And for the second candidate intra-frame prediction mode and the first candidate intra-frame prediction mode, respectively using the reference samples of the templates to generate the prediction samples of the templates, carrying out cost calculation on the prediction samples and the reconstruction samples of the templates corresponding to the second candidate intra-frame prediction mode to obtain the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode, carrying out cost calculation on the prediction samples and the reconstruction samples of the templates corresponding to the first candidate intra-frame prediction mode to obtain the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode, comparing the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode with the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode, selecting the second candidate intra-frame prediction mode as a final second intra-frame prediction mode if the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode is minimum, and selecting the first candidate intra-frame prediction mode as a final second intra-frame prediction mode if the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode is minimum.
Step S107, calculating a predicted value of a current coding unit to be decoded by using the obtained intra-frame prediction mode;
Specifically, the intra prediction mode is a first intra prediction mode and a first candidate intra prediction mode, or the intra prediction mode is a first intra prediction mode and a second intra prediction mode, or the intra prediction mode may be an intra prediction mode obtained by other intra prediction modes (for example, modes other than DIMD modes mentioned in the embodiments of the present application).
The main implementation process of the specific application case II is as follows:
step S201, obtaining reconstructed samples of adjacent decoded pixels of a coding unit to be decoded currently;
step S202, constructing a template, wherein the template comprises a row (or a plurality of rows) above a coding unit to be decoded currently and/or a reconstructed sample of a decoded pixel in a left column (or a plurality of columns);
Step S203, carrying out gradient analysis on the template to obtain a gradient histogram of an intra-frame prediction mode;
step S204, selecting the intra-frame prediction mode with the largest amplitude value and the second largest from the gradient histogram as a first intra-frame prediction mode and a first candidate intra-frame prediction mode;
Step S205, selecting one intra-frame prediction mode with the third largest amplitude value from the gradient histogram as a second candidate intra-frame prediction mode and one intra-frame prediction mode with the fourth largest amplitude value as a third candidate intra-frame prediction mode, comparing the selected intra-frame prediction mode with the first candidate intra-frame prediction mode, and selecting a final second intra-frame prediction mode;
the comparison is as follows:
And for the second candidate intra-frame prediction mode, the third candidate intra-frame prediction mode and the first candidate intra-frame prediction mode, respectively using the reference samples of the templates to generate the prediction samples of the templates, carrying out cost calculation on the prediction samples and the reconstruction samples of the templates corresponding to the second candidate intra-frame prediction mode, obtaining the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode, carrying out cost calculation on the prediction samples and the reconstruction samples of the templates corresponding to the third candidate intra-frame prediction mode, obtaining the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode, comparing the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode with the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode, selecting the second candidate intra-frame prediction mode as the final second candidate intra-frame prediction mode if the sum of absolute conversion differences corresponding to the third candidate intra-frame prediction mode is minimum, and obtaining the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode if the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode is minimum, and selecting the second candidate intra-frame prediction mode if the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode is minimum.
It should be noted that the cost function may be other calculation methods, which are not limited herein.
Step S206, obtaining the intra-frame prediction information of the current coding unit to be decoded from the code stream, wherein the intra-frame prediction information comprises DIMD mode identifications, MPM index values, intra-frame prediction mode index values and the like;
It should be noted that, for the intra-frame prediction method used for the MPM list, the first candidate intra-frame prediction mode and the first intra-frame prediction mode obtained in step 204 may be added to the MPM list in the first type intra-frame prediction mode, and the first intra-frame prediction mode and the final second intra-frame prediction mode obtained in step 205 may be added to the MPM list in the second type intra-frame prediction mode.
The first type intra prediction mode and the second type intra prediction mode may be implicitly derived or may display an identifier, which is not limited herein.
The main implementation process of the specific application case III is as follows:
Step S301, obtaining intra-frame prediction information of a current coding unit to be decoded from a code stream, where the intra-frame prediction information includes DIMD mode identifiers, MPM index values, intra-frame prediction mode index values, and the like.
Step S302, obtaining reconstructed samples of adjacent decoded pixels of a coding unit to be decoded currently;
Step S303, constructing a template, wherein the template comprises a row (or a plurality of rows) above a coding unit to be decoded currently and/or a reconstructed sample of a decoded pixel in a left column (or a plurality of columns);
Step S304, carrying out gradient analysis on the template to obtain a gradient histogram of an intra-frame angle prediction mode;
Step S305, selecting the intra-frame prediction mode with the largest amplitude value and the second largest from the gradient histogram as a first intra-frame prediction mode and a first candidate intra-frame prediction mode;
Step S306, obtaining the intra-frame prediction mode of the current coding unit to be decoded according to the intra-frame prediction information obtained in step S301, wherein the intra-frame prediction mode is specifically one of the following:
If DIMD mode identification is false and when the MPM list is used, adding the first intra-frame prediction mode and the second candidate intra-frame prediction mode obtained in the step S305 into the MPM list;
if DIMD mode identification is true and the current picture type is an I picture, a final second intra mode is derived as follows, taking the first intra prediction mode and the final second intra prediction mode as intra prediction modes of the coding unit to be currently decoded.
Specifically, the final second intra prediction mode is derived by:
Selecting an intra-frame prediction mode with the third largest amplitude value from the gradient histogram as a candidate intra-frame prediction mode, comparing the candidate intra-frame prediction mode with the first candidate intra-frame prediction mode, and selecting a final second intra-frame prediction mode;
The comparison method is as follows:
And for the second candidate intra-frame prediction mode and the first candidate intra-frame prediction mode, respectively using the reference samples of the templates to generate the prediction samples of the templates, carrying out cost calculation on the prediction samples and the reconstruction samples of the templates corresponding to the second candidate intra-frame prediction mode to obtain the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode, carrying out cost calculation on the prediction samples and the reconstruction samples of the templates corresponding to the first candidate intra-frame prediction mode to obtain the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode, comparing the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode with the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode, selecting the second candidate intra-frame prediction mode as a final second intra-frame prediction mode if the sum of absolute conversion differences corresponding to the second candidate intra-frame prediction mode is minimum, and selecting the first candidate intra-frame prediction mode as a final second intra-frame prediction mode if the sum of absolute conversion differences corresponding to the first candidate intra-frame prediction mode is minimum.
Step S307, calculating the predicted value of the current coding unit to be decoded by using the obtained intra-frame prediction mode.
Specifically, the intra prediction mode is a first intra prediction mode and a first candidate intra prediction mode, or the intra prediction mode is a first intra prediction mode and a second intra prediction mode, or the intra prediction mode may be an intra prediction mode obtained by other intra prediction modes (for example, modes other than DIMD modes mentioned in the embodiments of the present application).
It should be noted that, the embodiment of the present application can make the intra-frame prediction mode derived from DIMD modes more accurate, and can improve the prediction accuracy, thereby improving the compression efficiency.
It should be noted that, in the intra-frame prediction method provided in the embodiment of the present application, the execution body may be an intra-frame prediction device, or a control module in the intra-frame prediction device for executing the intra-frame prediction method. In the embodiment of the present application, an intra-frame prediction method performed by an intra-frame prediction device is taken as an example, and the intra-frame prediction device provided by the embodiment of the present application is described.
As shown in fig. 3, an embodiment of the present application provides an intra prediction apparatus 300, including:
A first obtaining module 301, configured to obtain a gradient histogram of an intra-frame prediction mode of a template corresponding to a coding unit to be decoded;
A second obtaining module 302, configured to obtain a first intra-prediction mode and a first candidate intra-prediction mode in the gradient histogram;
A third obtaining module 303, configured to obtain a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set;
A fourth obtaining module 304, configured to obtain a prediction sample of a coding unit to be decoded according to the first intra-frame prediction mode and the second intra-frame prediction mode;
Wherein the set of candidate intra-prediction modes includes at least one intra-prediction mode in the gradient histogram other than the first intra-prediction mode and the first candidate intra-prediction mode.
Optionally, the third obtaining module 303 includes:
the generating unit is used for generating a prediction sample of the template by using the first candidate intra-frame prediction mode and each intra-frame prediction mode in the candidate intra-frame prediction mode set respectively according to the reference sample of the template corresponding to the coding unit to be decoded;
The operation unit is used for carrying out first operation on the reconstruction sample of the template and the prediction sample of the template;
and the determining unit is used for determining a second intra-frame prediction mode in the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set according to the corresponding result of the first operation.
Optionally, the first operation is calculated at the cost of;
The determining unit is used for:
And determining the first intra-frame prediction mode candidate and the intra-frame prediction mode with the minimum cost calculation result corresponding to the intra-frame prediction mode candidate set as the second intra-frame prediction mode.
Optionally, before the first obtaining module 301 obtains the gradient histogram of the intra-prediction mode of the template corresponding to the coding unit to be decoded, the method further includes:
A fifth obtaining module, configured to obtain intra-frame prediction information of a coding unit to be decoded in a code stream, where the intra-frame prediction information includes a identifier of a decoding end derived intra-frame prediction mode DIMD;
the third obtaining module 303 is configured to:
And in the case that DIMD is identified as true, acquiring a second intra-prediction mode according to the first candidate intra-prediction mode and the candidate intra-prediction mode set.
Optionally, the third obtaining module 303 is configured to:
and under the condition that the image type of the image to which the coding unit to be decoded belongs is an I image, acquiring a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set.
Optionally, the apparatus further comprises:
a first processing module, configured to add the first intra-prediction mode and the first candidate intra-prediction mode to a most probable intra-prediction mode MPM list if the DIMD is identified as false.
Optionally, the apparatus further comprises one of:
A second processing module configured to add the first intra-prediction mode and the first candidate intra-prediction mode to an MPM list;
and a third processing module, configured to add the first intra-frame prediction mode and the second intra-frame prediction mode to an MPM list.
Optionally, the amplitude of the first intra-prediction mode and the first candidate intra-prediction mode are each greater than or equal to the amplitude of each intra-prediction mode in the set of candidate intra-prediction modes.
Optionally, the first intra-frame prediction mode is an intra-frame prediction mode with the largest amplitude corresponding to the intra-frame prediction mode included in the gradient histogram.
Optionally, the first candidate intra-prediction mode is an intra-prediction mode having a second largest amplitude corresponding to the intra-prediction mode included in the gradient histogram.
It should be noted that, compared with the mode of directly selecting the first intra-frame prediction mode and the second intra-frame prediction mode in the prior art, the embodiment of the application adds the secondary selection on the basis of the primary selection, can perform the optimal verification on the first selected intra-frame prediction mode, ensures that the finally determined intra-frame prediction mode is optimal, and can improve the prediction accuracy.
The intra-frame prediction apparatus in the embodiment of the present application may be an apparatus, an apparatus with an operating system or an electronic device, or may be a component, an integrated circuit, or a chip in a terminal. The apparatus or electronic device may be a mobile terminal or a non-mobile terminal. By way of example, mobile terminals may include, but are not limited to, the types of terminals 11 listed above, and non-mobile terminals may be servers, network attached storage (Network Attached Storage, NAS), personal computers (personal computer, PCs), televisions (TVs), teller machines, self-service machines, etc., and embodiments of the present application are not limited in particular.
The intra-frame prediction apparatus provided by the embodiment of the present application can implement each process implemented by the method embodiment of fig. 1, and achieve the same technical effects, and in order to avoid repetition, a detailed description is omitted herein.
The embodiment of the application also provides an intra-frame prediction device, which comprises a processor and a communication interface, wherein the processor is used for acquiring a gradient histogram of an intra-frame prediction mode of a template corresponding to a coding unit to be decoded;
Acquiring a first intra-frame prediction mode and a first candidate intra-frame prediction mode in the gradient histogram;
acquiring a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set;
obtaining a prediction sample of a coding unit to be decoded according to the first intra-frame prediction mode and the second intra-frame prediction mode;
Wherein the set of candidate intra-prediction modes includes at least one intra-prediction mode in the gradient histogram other than the first intra-prediction mode and the first candidate intra-prediction mode.
The device embodiment corresponds to the device-side method embodiment, and each implementation process and implementation manner of the method embodiment can be applied to the device embodiment, and the same technical effects can be achieved. Specifically, fig. 4 is a schematic hardware structure of an intra prediction apparatus for implementing an embodiment of the present application.
The intra prediction apparatus 400 includes, but is not limited to, at least some of the components of a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, and a processor 410.
Those skilled in the art will appreciate that the intra-frame prediction apparatus 400 may further include a power source (e.g., a battery) for powering the various components, and the power source may be logically coupled to the processor 410 by a power management system to perform functions such as managing charging, discharging, and power consumption by the power management system. The intra prediction apparatus structure shown in fig. 4 does not constitute a limitation of the apparatus, and the intra prediction apparatus may include more or less components than those shown in the drawings, or may combine some components, or may be arranged in different components, which will not be described herein.
It should be appreciated that in embodiments of the present application, the input unit 404 may include a graphics processor (Graphics Processing Unit, GPU) 4041 and a microphone 4042, with the graphics processor 4041 processing image data of still pictures or video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071 is also referred to as a touch screen. The touch panel 4071 may include two parts, a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
In the embodiment of the present application, the radio frequency unit 401 receives downlink data from the network side device and processes the downlink data with the processor 410, and in addition, sends uplink data to the network side device. Typically, the radio frequency unit 401 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
Memory 409 may be used to store software programs or instructions as well as various data. The memory 409 may mainly include a storage program or instruction area and a storage data area, wherein the storage program or instruction area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. In addition, the Memory 409 may include a high-speed random access Memory, and may also include a nonvolatile Memory, wherein the nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable Programmable ROM (EPROM), an Electrically Erasable Programmable EPROM (EEPROM), or a flash Memory. Such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
Processor 410 may include one or more processing units and, optionally, processor 410 may integrate an application processor that primarily processes operating systems, user interfaces, and applications or instructions, and a modem processor that primarily processes wireless communications, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
Wherein the processor 410 is configured to implement:
acquiring a gradient histogram of an intra-frame prediction mode of a template corresponding to a coding unit to be decoded;
Acquiring a first intra-frame prediction mode and a first candidate intra-frame prediction mode in the gradient histogram;
acquiring a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set;
obtaining a prediction sample of a coding unit to be decoded according to the first intra-frame prediction mode and the second intra-frame prediction mode;
Wherein the set of candidate intra-prediction modes includes at least one intra-prediction mode in the gradient histogram other than the first intra-prediction mode and the first candidate intra-prediction mode.
The intra-frame prediction device of the embodiment of the application obtains the first intra-frame prediction mode and the first candidate intra-frame prediction mode according to the gradient histogram, then determines the second intra-frame prediction mode according to the first candidate intra-frame prediction mode and other intra-frame prediction modes in the gradient histogram, and finally obtains the prediction sample of the coding unit to be decoded according to the first intra-frame prediction mode and the second intra-frame prediction mode.
Optionally, the processor 410 is configured to implement:
Respectively utilizing a first candidate intra-frame prediction mode and each intra-frame prediction mode in a candidate intra-frame prediction mode set to generate a prediction sample of a template corresponding to a coding unit to be decoded;
performing a first operation on the reconstructed sample of the template and the predicted sample of the template;
and determining a second intra-frame prediction mode in the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set according to a result corresponding to the first operation.
Optionally, the first operation is calculated at the cost of;
further, the processor 410 is configured to implement:
And determining the first intra-frame prediction mode candidate and the intra-frame prediction mode with the minimum cost calculation result corresponding to the intra-frame prediction mode candidate set as the second intra-frame prediction mode.
Optionally, the processor 410 is further configured to implement:
the method comprises the steps of obtaining intra-frame prediction information of a coding unit to be decoded from a code stream, wherein the intra-frame prediction information comprises a decoding end derived intra-frame prediction mode DIMD identifier;
The obtaining a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set includes:
And in the case that DIMD is identified as true, acquiring a second intra-prediction mode according to the first candidate intra-prediction mode and the candidate intra-prediction mode set.
Optionally, the processor 410 is further configured to implement:
and under the condition that the image type of the image to which the coding unit to be decoded belongs is an I image, acquiring a second intra-frame prediction mode according to the first candidate intra-frame prediction mode and the candidate intra-frame prediction mode set.
Optionally, the processor 410 is further configured to implement:
and adding the first intra-prediction mode and the first candidate intra-prediction mode to a most probable intra-prediction mode MPM list if the DIMD flag is false.
Optionally, the processor 410 is further configured to implement one of:
adding the first intra-prediction mode and the first candidate intra-prediction mode to an MPM list;
And adding the first intra-frame prediction mode and the second intra-frame prediction mode into an MPM list.
Optionally, the amplitude of the first intra-prediction mode and the first candidate intra-prediction mode are each greater than or equal to the amplitude of each intra-prediction mode in the set of candidate intra-prediction modes.
Optionally, the first intra-frame prediction mode is an intra-frame prediction mode with the largest amplitude corresponding to the intra-frame prediction mode included in the gradient histogram.
Optionally, the first candidate intra-prediction mode is an intra-prediction mode having a second largest amplitude corresponding to the intra-prediction mode included in the gradient histogram.
Preferably, the embodiment of the present application further provides an intra-frame prediction apparatus, which includes a processor, a memory, and a program or an instruction stored in the memory and capable of running on the processor, where the program or the instruction when executed by the processor implements each process of the intra-frame prediction method embodiment, and the same technical effects can be achieved, and for avoiding repetition, a detailed description is omitted herein.
The embodiment of the application also provides a readable storage medium, and the readable storage medium stores a program or an instruction, which when executed by a processor, implements each process of the intra-frame prediction method embodiment, and can achieve the same technical effect, so that repetition is avoided, and no further description is provided here. The computer readable storage medium is, for example, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk or an optical disk.
Optionally, as shown in fig. 5, an embodiment of the present application further provides a communication device 500, including a processor 501, a memory 502, and a program or an instruction stored in the memory 502 and capable of being executed on the processor 501, where, for example, the communication device 500 is an intra-frame prediction apparatus, the program or the instruction when executed by the processor 501 implements each process of the above-mentioned intra-frame prediction method embodiment, and the same technical effects can be achieved, so that repetition is avoided and no further description is given here.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the embodiment of the intra-frame prediction method, and can achieve the same technical effects, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.