Image processing method, processing device, and storage medium
By selecting the intra prediction mode according to the reference area during video coding for chroma or brightness prediction, the problem of low video coding efficiency caused by unclear intra prediction mode selection is solved and more efficient video coding is achieved.
Patent Information
- Application Number
- PCT/CN2024/080620
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-21
- Filing Date
- 2024-03-07
- Publication Date
- 2024-09-26
AI Technical Summary
In video coding technology, unclear selection of intra prediction modes results in low video coding efficiency.
By determining the prediction result of the sample to be predicted based on the reference area, and selecting an appropriate intra-frame prediction mode to perform intra-frame prediction of chroma or brightness, the video coding efficiency is improved.
It effectively improves the overall efficiency of video coding, determines parameters by obtaining or determining reference areas, optimizes intra-frame prediction modes, and improves coding performance.
Smart Images

Figure CN2024080620_26092024_PF_FP
Abstract
Description
Image processing method, processing device and storage medium
[0001] Related applications
[0002] This application is based on the prior Chinese patent application, and in the current patent application, we hereby claim the priority of the Chinese patent application filed on March 21, 2023, with application number "202310276253.0" and application name "Image processing method, processing device and storage medium" in accordance with the law. Technical Field
[0003] The present application relates to the field of image processing technology, and in particular to an image processing method, processing device and storage medium. Background Art
[0004] In the development of video coding technology, improvements made by various video coding standards are all committed to improving video coding effects from different aspects. Among them, intra-frame prediction is a hot topic in current research.
[0005] During the process of conceiving and implementing this application, the inventors discovered that there are at least the following problems: in the research on intra-frame prediction, it is still unclear how to select a suitable intra-frame prediction mode, which leads to low overall efficiency of video coding.
[0006] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Technical Solutions
[0007] In response to the above technical problems, the present application provides an image processing method, processing device and storage medium, which can select a suitable intra-frame prediction mode for intra-frame prediction of chrominance or luminance during the video encoding and decoding process, thereby effectively improving the overall efficiency of video encoding.
[0008] This application provides an image processing method that can be applied to a processing device (such as an intelligent terminal or a server, etc.), comprising the following steps:
[0009] S1: Determine or obtain a prediction result of a sample to be predicted based on at least one reference area.
[0010] Optionally, the method for obtaining or determining the reference area includes at least one of the following:
[0011] Obtain or determine from a left adjacent area or an upper adjacent area of the co-located sample to be predicted;
[0012] Obtain or determine from an area formed by splicing a left adjacent area and an upper adjacent area of the co-located sample to be predicted;
[0013] Acquire or determine based on a preset sign;
[0014] Acquire or determine based on template area;
[0015] If the intra prediction mode adopted by the co-located sample and / or adjacent sample of the sample to be predicted is an angular intra prediction mode, the angle is obtained or determined according to the intra angle corresponding to the angular intra prediction mode.
[0016] Optionally, the flag is parsed from a coded bit stream.
[0017] Optionally, the acquiring or determining the reference area according to a preset marker includes:
[0018] According to the value of the flag, the reference area of the value mapping is obtained or determined.
[0019] Optionally, acquiring or determining the reference area according to an angle within a frame includes:
[0020] The reference area is acquired or determined according to the angle range of the intra-frame angle.
[0021] Optionally, the value includes a first value and / or a second value.
[0022] Optionally, the acquiring or determining according to the template area includes:
[0023] If the value is the third value, the reference area is determined according to the template area.
[0024] Optionally, determining the reference area according to the template area includes:
[0025] Acquire or determine a first parameter and a second parameter from the template area;
[0026] Obtaining or determining a first sampling prediction result corresponding to the first parameter and a second sampling prediction result corresponding to the second parameter;
[0027] If the first sampling prediction result is better than the second sampling prediction result, the reference area is obtained or determined according to the first parameter, and / or, if the second sampling prediction result is better than the first sampling prediction result, the reference area is obtained or determined according to the second parameter.
[0028] Optionally, acquiring or determining the reference area according to the first parameter includes:
[0029] The reference area is acquired or determined according to a positional relationship between an area corresponding to the first parameter in the template area and the template area.
[0030] Optionally, the step S1 includes the steps of:
[0031] S11: determining at least one parameter according to at least one reference region;
[0032] S12: Determine or obtain a prediction result of the sample to be predicted according to the parameters.
[0033] Optionally, step S11 includes: determining at least one of the parameters based on at least one reference sample in the reference area.
[0034] Optionally, step S12 includes: determining or deriving a prediction result of the sample to be predicted based on at least one of the parameters, at least one first sample, at least one adjacent sample of the first sample, at least one non-adjacent sample of the first sample, and at least one gradient component of the first sample.
[0035] The present application also provides a processing device, comprising: a memory and a processor, wherein an image processing program is stored in the memory, and when the image processing program is executed by the processor, the steps of any of the above-mentioned image processing methods are implemented.
[0036] The present application also provides a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of any of the above-mentioned image processing methods.
[0037] As described above, the image processing method of the present application includes: determining or deriving a prediction result for a sample to be predicted based on at least one reference region. Specifically, the technical solution of the present application obtains or determines at least one reference region, and then determines or derives a prediction result for the sample to be predicted based on at least one parameter determined by the reference region. In this way, the technical solution of the present application can select an appropriate intra-frame prediction mode for intra-frame prediction of chroma or luminance during video encoding and decoding using an intra-frame prediction mode, effectively improving the overall efficiency of video encoding. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for describing the embodiments. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without inventive work.
[0039] FIG1 is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present application;
[0040] FIG2 is a diagram of a communication network system architecture provided by an embodiment of the present application;
[0041] FIG3 is a schematic diagram of an application scenario involved in the cross-component linear model prediction mode CCLM;
[0042] FIG4 is a schematic diagram of an application scenario involving a convolutional cross-component model prediction mode CCCM;
[0043] FIG5 is a schematic diagram of another application scenario involving the convolutional cross component model prediction mode CCCM;
[0044] FIG6A is a schematic diagram of an image coding scenario involved in the image processing method provided in an embodiment of the present application;
[0045] FIG6B is a schematic diagram of an image decoding scenario involved in the image processing method provided in an embodiment of the present application;
[0046] FIG7a, FIG7b and FIG7c are schematic diagrams of types of brightness reference areas involved in the image processing method shown in the second embodiment of the present application;
[0047] FIG7d, FIG7e and FIG7f are schematic diagrams of types of chromaticity reference areas involved in the image processing method shown in the second embodiment of the present application;
[0048] FIG8 is a schematic diagram of a YUV image involved in an image processing method according to a second embodiment of the present application;
[0049] FIG9a, FIG9b, FIG9c and FIG9d are schematic diagrams of a template region including brightness sampling involved in the image processing method shown in the second embodiment of the present application;
[0050] FIG10a, FIG10b, FIG10c and FIG10d are schematic diagrams of a template region including chroma sampling involved in the image processing method shown in the second embodiment of the present application;
[0051] FIG11 is a schematic diagram of intra-frame prediction directions involved in an image processing method according to a second embodiment of the present application;
[0052] FIG12a, FIG12b, and FIG12c are schematic diagrams of brightness reference areas of a template area involved in an image processing method according to a third embodiment of the present application;
[0053] FIG13a, FIG13b, and FIG13c are schematic diagrams of chromaticity reference areas of a template area involved in an image processing method according to a third embodiment of the present application;
[0054] FIG14 is a schematic diagram of an application flow involved in an image processing method according to the fourth embodiment of the present application.
[0055] The purpose of this application, its features, and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and the accompanying text are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of this application to those skilled in the art by reference to specific embodiments.
[0056] Implementation Methods of the Application
[0057] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0058] It should be noted that, in this document, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. Optionally, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined based on their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0059] It should be understood that although the terms "first," "second," "third," etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are used solely to distinguish information of the same type from one another. For example, without departing from the scope of this disclosure, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if," as used herein, may be interpreted as "upon," "when," or "in response to a determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It should be further understood that the terms "comprising" and "including" indicate the presence of the recited features, steps, operations, elements, components, items, types, and / or groups, but do not preclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, types, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., as used herein, may be interpreted as inclusive, meaning any one or any combination. For example, “comprising at least one of the following: A, B, C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”; and for another example, “A, B or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.
[0060] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are shown in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless clearly stated herein, the execution of these steps is not strictly limited in order, and they can be performed in other orders. Moreover, at least a portion of the steps in the figure may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0061] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.
[0062] It should be noted that in this article, step codes such as S11 and S12 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the order. When implementing the step, those skilled in the art may execute S12 first and then S11, etc., but these should all be within the scope of protection of this application.
[0063] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0064] In the subsequent description, the use of suffixes such as "module", "component" or "unit" to represent elements is only for the purpose of facilitating the description of the present application and has no specific meaning. Therefore, "module", "component" or "unit" can be used interchangeably.
[0065] The processing device may be implemented in various forms. For example, the processing device described in this application may be a server, or may be a smart terminal such as a mobile phone, tablet computer, laptop computer, PDA, portable media player (PMP), navigation device, wearable device, smart bracelet, pedometer, etc., or a fixed terminal such as a digital TV, desktop computer, etc.
[0066] In the subsequent description, the processing device provided in this application will be explained using a mobile terminal as an example. Those skilled in the art will understand that, in addition to components specifically used for mobile purposes, the construction according to the embodiment of this application can also be applied to fixed-type terminals.
[0067] Please refer to Figure 1, which is a schematic diagram of the hardware structure of a mobile terminal for implementing various embodiments of the present application. The mobile terminal 100 may include components such as an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will understand that the mobile terminal structure shown in Figure 1 does not limit the mobile terminal. The mobile terminal may include more or fewer components than shown, or may combine certain components, or arrange the components differently.
[0068] The following is a detailed introduction to the various components of the mobile terminal in conjunction with Figure 1:
[0069] The RF unit 101 can be used to send and receive information or receive signals during calls. Specifically, it receives downlink information from the base station and transmits it to the processor 110 for processing. It also transmits uplink data to the base station. Typically, the RF unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, and other components. Optionally, the RF unit 101 can also communicate with the network and other devices via wireless communication. The above-mentioned wireless communications can use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), TDD-LTE (Time Division Duplexing-Long Term Evolution) and 5G, etc.
[0070] WiFi is a short-range wireless transmission technology. A mobile terminal, through WiFi module 102, enables users to send and receive emails, browse web pages, and access streaming media, providing wireless broadband Internet access. Although FIG1 illustrates WiFi module 102, it is understood that it is not a required component of the mobile terminal and can be omitted as needed without altering the essence of the invention.
[0071] The audio output unit 103 can convert audio data received by the RF unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output it as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Furthermore, the audio output unit 103 can also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, or the like.
[0072] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos captured by an image capture device (e.g., a camera) in video capture mode or image capture mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the GPU 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the RF unit 101 or the WiFi module 102. The microphone 1042 may receive sound (audio data) in operating modes such as a phone call mode, a recording mode, and a voice recognition mode, and may process such sound into audio data. In the phone call mode, the processed audio (voice) data may be converted into a format that can be transmitted to a mobile communication base station via the RF unit 101. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.
[0073] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Optionally, the light sensor includes an ambient light sensor and a proximity sensor. Optionally, the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0074] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0075] The user input unit 107 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile terminal. Optionally, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using a finger, stylus, or any other suitable object or accessory on or near the touch panel 1071) and drive the corresponding connection device according to a pre-set program. The touch panel 1071 may include two parts: a touch detection device and a touch controller. Optionally, the touch detection device detects the user's touch direction and detects the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110. It can also receive commands sent by the processor 110 and execute them. Optionally, the touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may further include other input devices 1072. Optionally, the other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, a joystick, etc., and the specifics are not limited here.
[0076] Optionally, the touch panel 1071 may overlay the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. The processor 110 then provides a corresponding visual output on the display panel 1061 based on the type of touch event. Although in FIG1 , the touch panel 1071 and the display panel 1061 are shown as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, which is not limited to this specific embodiment.
[0077] The interface unit 108 serves as an interface through which at least one external device can be connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
[0078] Memory 109 can be used to store software programs and various data. Memory 109 may primarily include a program storage area and a data storage area. Optionally, the program storage area may store an operating system and at least one application required for a function (such as a sound playback function or an image playback function); the data storage area may store data generated based on the use of the mobile phone (such as audio data, a phone book, etc.). Optionally, memory 109 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0079] Processor 110 is the control center of the mobile terminal, connecting all components of the mobile terminal using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 109 and accessing data stored in memory 109, it executes various functions of the mobile terminal and processes data, thereby providing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, processor 110 may integrate an application processor and a modem processor. Optionally, the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 110.
[0080] The mobile terminal 100 may also include a power supply 111 (such as a battery) for supplying power to various components. Preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.
[0081] Although not shown in FIG. 1 , the mobile terminal 100 may further include a Bluetooth module, etc., which will not be described in detail here.
[0082] To facilitate understanding of the embodiments of the present application, the communication network system on which the processing device of the present application is based is described below using a mobile terminal as an example.
[0083] Please refer to Figure 2, which is a communication network system architecture diagram provided in an embodiment of the present application. The communication network system is an LTE system of universal mobile communication technology. The LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203 and an operator's IP service 204, which are connected in sequence.
[0084] Optionally, UE201 may be the above-mentioned terminal 100, which will not be described in detail here.
[0085] E-UTRAN 202 includes eNodeB 2021 and other eNodeBs 2022 . Optionally, eNodeB 2021 may be connected to other eNodeBs 2022 via a backhaul (eg, an X2 interface). eNodeB 2021 is connected to EPC 203 , and eNodeB 2021 may provide access from UE 201 to EPC 203 .
[0086] EPC 203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving Gate Way) 2034, a PGW (PDN Gate Way) 2035, and a PCRF (Policy and Charging Rules Function) 2036. Optionally, MME 2031 is a control node that processes signaling between UE 201 and EPC 203, providing bearer and connection management. HSS 2032 provides registers for managing functions such as the Home Location Register (not shown) and stores user-specific information such as service features and data rates. All user data can be sent through SGW2034, PGW2035 can provide IP address allocation and other functions for UE 201, PCRF2036 is the policy and charging control policy decision point for service data flow and IP bearer resources, and it selects and provides available policy and charging control decisions for the policy and charging execution function unit (not shown in the figure).
[0087] The IP service 204 may include the Internet, an intranet, an IMS (IP Multimedia Subsystem), or other IP services.
[0088] Although the above introduction takes the LTE system as an example, those skilled in the art should know that this application is not only applicable to the LTE system, but can also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, 5G and future new network systems (such as 6G), etc., which are not limited here.
[0089] Based on the hardware structure of the processing device and the communication network system taking the mobile terminal as an example, the overall concept of the image processing method of the present application is proposed.
[0090] In the development of video coding technology, improvements made by various video coding standards are all committed to improving video coding effects from different aspects. Among them, intra-frame prediction is a hot topic in current research.
[0091] However, in the process of conceiving and implementing this application, the inventors of this application found that there are at least the following problems: in the research on intra-frame prediction, it is still unclear how to select a suitable intra-frame prediction mode, which leads to low overall efficiency of video encoding.
[0092] To address the above issues, the present application proposes an image processing method for determining or deriving a prediction result for a sample to be predicted based on at least one reference region. Specifically, the present application's technical solution obtains or determines at least one reference region, and then determines at least one parameter (e.g., a weight parameter, a filter coefficient) based on the reference region to determine or derive a prediction result for the sample to be predicted. In this way, the present application's technical solution can select an appropriate intra-frame prediction mode for intra-frame prediction of chroma or luminance during video encoding and decoding using an intra-frame prediction mode, effectively improving the overall efficiency of video encoding.
[0093] Based on the overall concept of the image processing method provided by the present application, various embodiments of the image processing method of the present application are further proposed.
[0094] To facilitate understanding, the following first explains the professional terms that may be involved in the embodiments of this application.
[0095] (1) Intra-frame prediction
[0096] In the process of encoding or decoding an image, predicting the image block is an essential step. The encoder obtains the prediction block by predicting the image block, constructs the residual block with lower energy, and reduces the transmission bit. The encoder or decoder can predict the image block through some preset prediction modes, which include inter-frame prediction mode and intra-frame prediction mode. Optionally, in intra-frame prediction, the encoder or decoder can usually use the cross-component linear model prediction mode CCLM, the multi-model CCLM prediction mode MMLM and the convolution-based cross-component model prediction mode CCCM to perform intra-frame chrominance prediction.
[0097] (2) Cross-component linear model prediction mode CCLM
[0098] The core idea of the Cross-Component Linear Model (CCLM) prediction mode is to reduce cross-component redundancy and perform cross-component prediction. CCLM mainly uses the reconstructed luminance pixels of the same coding block to construct the predicted value of the chrominance pixels. The linear model used by CCLM is: predC(i, j) = α * recL(i, j) + β
[0099] Among them, predC(i, j) represents the chroma prediction pixel of the current image block, and recL(i, j) represents the downsampled reconstructed luminance pixel of the current CU. α and β are called linear model parameters. In one embodiment, α and β can be generated and derived from the four adjacent chroma pixels and the corresponding downsampled luminance pixels. For example, α and β can be specifically derived from the adjacent pixels on the left and the adjacent pixels above the current image block in the application scenario shown in Figure 3. Of course, the present invention is not limited to this, and other methods can also be used to derive the values of the linear model parameters. In one embodiment, recL(i, j) can also be the reconstructed luminance pixel of the current CU without downsampling.
[0100] (3) Multi-model CCLM prediction model MMLM
[0101] The multi-model CCLM prediction mode MMLM uses a threshold value, which is the average value of the brightness reconstruction of adjacent samples, to classify the reconstructed adjacent samples into two categories. It then uses the least mean square (LMS) method to derive a linear model CCLM for each class, thereby using multiple linear models CCLM for prediction. For example, the brightness mean is first calculated using the adjacent sample pairs of the current block. The adjacent sample pairs are then grouped based on this brightness mean as a threshold. Finally, after the adjacent samples are grouped, their respective linear models CCLM are fitted using the sample pairs of each group. Thus, when performing chrominance prediction on the current block, each point in the current block is also grouped to use a different linear model CCLM for prediction. This ensures more accurate prediction of points with rich texture details in the current block.
[0102] (IV) Convolutional Cross Component Model Prediction Mode CCCM
[0103] The convolution cross component model prediction mode CCCM uses a filter to predict the chrominance of the current image block from the reconstructed luminance samples. In one embodiment, the filter used by CCCM consists of a 5-tap (or 7-tap) plus-shaped spatial component, a nonlinear term, and a bias term. Optionally, the input of the 5-tap plus-shaped spatial component of the filter includes a center (C) luminance sample, and an upper sample (also called a north sample, N), a lower sample (also called a south sample, S), a left sample (also called a west sample, W), and a right sample (also called an east sample, E) of the center (C) luminance sample.
[0104] The calculation formula used by CCCM to predict chrominance pixels is as follows: predChromaVal = c0*C+c1*N+c2*S+c3*E+c4*W+c5*P+c6*B
[0105] Among them, C represents the luma sample at the corresponding position of the current chroma sample, and N, S, E, and W are the adjacent samples of the current luma sample, as shown in Figure 4.
[0106] The nonlinear term P = (C*C + midVal) >> bitDepth, and the bias term B = midVal. The bias term B represents a scalar offset between the input and output (similar to the offset term in CCLM) and is set to the middle chroma value (for 10-bit video, B = 512).
[0107] In another embodiment, the filter used by CCCM consists of a center (C) luminance sample, a gradient component, a nonlinear term, and a bias term. Optionally, the gradient component includes a vertical gradient component and a horizontal gradient component. For example, the vertical gradient component is Gy and the horizontal gradient component is Gx. As shown in Figure 5, the calculation formulas for Gy and Gx are as follows: Gy = (2N + NW + NE) – (2S + SW + SE) Gx = (2W + NW + SW) – (2E + NE + SE)
[0108] In another embodiment, the filter used by CCCM consists of a center (C) luma sample, center luma sample position information, a nonlinear term, and a bias term. Optionally, the center luma sample position information includes a vertical position and a horizontal position. For example, the vertical position of the center luma sample is Y, and the horizontal position of the center luma sample is X, which are calculated relative to the upper left coordinate of the sample (also called the image block) for which chroma prediction is currently required.
[0109] Alternatively, please refer to Figures 6A and 6B. Figure 6A is a schematic diagram of the image encoding scenario involved in the processing method provided herein, and Figure 6B is a schematic diagram of the image decoding process. The encoder at the encoding end typically divides the input video image into at least one image block per frame for processing. Each image block can be subtracted from the prediction block obtained by the prediction mode to obtain a residual block. The residual block and the relevant parameters of the prediction mode are then subjected to a series of processing to obtain the encoded bitstream. Subsequently, at the decoding end, the decoder receives the bitstream and parses it to obtain the prediction mode parameters. Furthermore, the decoder's inverse transform unit and inverse quantization unit inversely transform and inverse quantize the transform coefficients to obtain the residual block. Optionally, the decoder's decoding unit parses and decodes the encoded bitstream to obtain the prediction parameters and related auxiliary information. Next, the decoder's prediction processing unit uses the prediction parameters to perform prediction processing to determine the prediction block corresponding to the residual block. The decoder then adds the obtained residual block to the corresponding prediction block to obtain a reconstructed block. Optionally, the decoder's loop filtering unit performs loop filtering on the reconstructed block to reduce distortion and improve video quality. Thus, the reconstructed blocks that have undergone loop filtering are further combined into decoded images and stored in a decoded image buffer or output as decoded video signals.
[0110] Optionally, the image processing method provided in the embodiment of the present application can be applied to the scenario where chroma prediction and / or brightness prediction is performed on the image block in the above-mentioned video image encoding process (for example, the scenario of intra-frame prediction in the video image encoding process). Of course, the image processing method provided in the embodiment of the present application can also be used in the scenario where chroma prediction and / or brightness prediction is performed on the image block to be decoded in the video decoding process (for example, the scenario of intra-frame prediction in the video image decoding process).
[0111] First embodiment
[0112] In this embodiment, the image processing method provided by this application can be executed by the aforementioned processing device, or a cluster composed of multiple aforementioned processing devices. The processing device can be a smart terminal (such as the aforementioned mobile terminal 100) or a server. Here, the image processing method provided by this application is described using the processing device as the executing entity in the first embodiment of the image processing method provided by this application.
[0113] In this embodiment, the processing method provided by this application includes the following steps:
[0114] S1: Determine or obtain a prediction result of a sample to be predicted based on at least one reference area.
[0115] Optionally, in this embodiment, the sample to be predicted may be an image block in the input video image (i.e., video frame) that is being encoded or decoded and thus requires chrominance prediction or luminance prediction. Optionally, the image block may also be referred to as an image sample, which may be referred to as a current block, current sample, or block to be processed. Under the H.265 / High Efficiency Video Coding (HEVC) standard, the sample to be predicted may be a Coding Tree Unit (CTU) or a Coding Unit (CU) in the input video image. The embodiment of the present application does not impose any specific restrictions on the type of the sample to be predicted.
[0116] Optionally, after receiving a video image from a video source, the processing device, as an encoder, segments the video image to obtain at least one image block. The processing device then utilizes temporal and / or spatial correlations between the video images to perform prediction processing on each image block. When the processing device uses an intra-frame prediction mode (particularly a cross-component intra-frame prediction mode) to perform chroma prediction on the current image block, it can determine the samples to be predicted for the image block. In one embodiment, chroma prediction is performed based on at least one reference region within the current image frame in which the image block is located to determine or derive a chroma prediction result for the samples to be predicted. Optionally, when the processing device uses an intra-frame prediction mode to perform luma prediction on the current image block, it can determine the samples to be predicted for the image block. In one embodiment, luma prediction is performed based on at least one reference region within the current image frame in which the image block is located to determine or derive a luma prediction result for the luma sample to be predicted.
[0117] Optionally, in this embodiment, the processing device as an encoder may use, for example, a rate-distortion optimization method to determine the intra-frame prediction mode ultimately adopted by the current image block. For example, the processing device may calculate the rate-distortion cost corresponding to each prediction mode to determine the minimum rate-distortion cost from the rate-distortion costs corresponding to a plurality of prediction modes, and the prediction mode corresponding to the minimum rate-distortion cost is the prediction mode ultimately adopted by the current image block. That is, assuming that for the prediction processing of the image block currently to be subjected to chroma prediction, the prediction modes that can be used are chroma intra-frame prediction modes 0-N (including cross-component intra-frame prediction modes), and when the processing device calculates that the prediction mode corresponding to the minimum rate-distortion cost for chroma prediction is mode i, the processing device determines mode i as the mode ultimately used for chroma prediction of the current image block. Wherein, i=0, ..., N.
[0118] Optionally, after the processing device determines or obtains the prediction result of the sample to be predicted (the chroma sample to be predicted or the luma sample to be predicted) in a sample-by-sample manner according to the above process, the processing device as an encoder can further subtract the prediction value of the corresponding pixel in the predicted image block (the chroma prediction result of the chroma sample to be predicted or the luma prediction result of the luma sample to be predicted) from the sample value of the pixel in the current image block to obtain the residual value of the pixel and the residual block corresponding to the image block. Thereafter, the residual block will be transformed and quantized, and then encoded by the entropy encoder to form an encoded bitstream. In addition, the encoded bitstream may also include prediction parameters corresponding to the prediction mode determined by the processing device through the above process (packaged into the encoded bitstream after entropy encoding) and related side information. Optionally, if the processing device adopts a cross-component intra-frame prediction mode, the above-mentioned prediction parameters at least include indication information about the use of a cross-component intra-frame prediction model for prediction operations.
[0119] Optionally, the transformed and quantized residual block is added to the corresponding prediction block obtained using the prediction mode to obtain a reconstructed block. After obtaining the reconstructed block, the processing device further performs loop filtering on the reconstructed block to reduce distortion.
[0120] Optionally, when the processing device acts as a decoder, it can receive the encoded bitstream transmitted by the processing device acting as an encoder. After the processing device acts as a decoder and receives the bitstream encoded by the encoder, the decoding unit of the decoder parses and decodes the bitstream to obtain prediction parameters. Optionally, the inverse transform unit and inverse quantization unit of the decoder perform inverse transform and inverse quantization on the transform coefficients to obtain a residual block. Next, the prediction processing unit of the decoder can treat the residual block as the block to be processed and perform prediction processing using the prediction parameters to determine the prediction block corresponding to the residual block.
[0121] Optionally, when the decoder adopts the same intra-frame prediction mode as that used by the encoder, it can use the prediction parameters obtained by parsing the bitstream to obtain or determine the prediction mode that needs to be used for chroma prediction or luma prediction of the current sample to be predicted (for example, when the prediction parameters indicate that the corresponding prediction mode is a cross-component intra-frame prediction mode, the decoder will use the cross-component intra-frame prediction mode as the prediction mode for chroma prediction or luma prediction of the decoded residual block). Thus, the decoder directly uses the prediction mode to determine one or more luma samples or chroma samples from the current image where the image block is located, and uses the one or more samples to perform chroma prediction or luma prediction to determine or obtain the chroma or luma prediction result for the sample to be predicted.
[0122] Optionally, after the processing device acting as a decoder determines or derives the prediction result of the sample to be predicted (chroma sample to be predicted or luma sample to be predicted) in a sample-by-sample manner, the processing device can further add the residual block obtained by parsing to the predicted value of the corresponding pixel in the predicted image block (chroma prediction result of the chroma sample to be predicted or luma prediction result of the luma sample to be predicted) to obtain a reconstructed block. Finally, the processing device also performs loop filtering on the reconstructed block through a loop filtering unit to reduce distortion and improve video quality. The reconstructed block that has undergone loop filtering is further combined into a decoded image and stored in a decoded image buffer or output as a decoded video signal.
[0123] Optionally, in this embodiment, the prediction mode used by the processing device as an encoder or decoder to predict the current image block (e.g., chroma block) may be a convolutional cross-component intra prediction model CCCM as shown in the following formula (1): predChromaVal=c0*C+c1*N+c2*S+c3*E+c4*W+c5*P+c6*B Formula (1)
[0124] Alternatively, taking chroma prediction as an example, predChromaVal is the chroma prediction value of the sample to be predicted (in this case, the chroma sample to be predicted), c0~c6 are weight coefficients, C is the luminance value of the co-located luminance sample of the chroma sample to be predicted, N is the luminance value of the luminance sample above / north of the co-located luminance sample, S is the luminance value of the luminance sample below / south of the co-located luminance sample, E is the luminance value of the luminance sample to the right / east of the co-located luminance sample, W is the luminance value of the luminance sample to the left / west of the co-located luminance sample, and P is a nonlinear term. B is a bias term, which represents a scalar offset between the input and output (for 10-bit depth video, B is set to the chroma median, i.e. 512), P = (C*C+midVal)>>bitDepth (midVal is the chroma median of the chroma sample, bitDepth is the bit depth of the video content). The positional relationship between N, S, E, W and C is shown in Figure 4.
[0125] Optionally, in order to use the CCCM model shown in the above formula (1) to perform chroma intra-frame prediction processing, the processing device needs to determine the weight coefficients c0~c6 in formula (1) and the luminance values of C, N, S, E, W, P, and B, and then obtain the chroma prediction result of the chroma sample to be predicted predChromaVal based on formula (1). Optionally, the processing device can determine the weight coefficient in formula (1) by obtaining or determining at least one reference area from the image frame where the image block currently needs to perform chroma prediction is located, and determining the weight coefficient based on the sampling value of the luminance / chroma sample in the at least one reference area. In one embodiment, when performing chroma prediction, at least one luminance reference area is obtained or determined. In another embodiment, when performing chroma prediction, at least one chroma reference area is obtained or determined.
[0126] Optionally, the prediction mode used by the processing device as an encoder or decoder to predict the current image block (e.g., luminance block) may be a convolutional cross-component intra prediction model CCCM as shown in the following formula (2): predLumaVal = c0'*C'+c1'*N'+c2'*S'+c3'*E'+c4'*W'+c5'*P'+c6'*B' Formula (2)
[0127] Wherein, predLumaVall is the luminance prediction value of the sample to be predicted (in this case, the luminance sample to be predicted), c0'~c6' are weight coefficients, C' is the chroma value of the chroma sample in the same position as the luminance sample to be predicted, N' is the chroma value of the chroma sample above / north of the same position, S' is the chroma value of the chroma sample below / south of the same position, E' is the chroma value of the chroma sample to the right / east of the same position, W' is the chroma value of the chroma sample to the left / west of the same position, and P' is a nonlinear term. B' is a bias term, which represents a scalar offset between the input and output (for 10-bit depth video, B is set to the median luminance value), P'=(C'*C'+midVal')>>bitDepth (midVal' is the median chroma value of the chroma sample, bitDepth is the bit depth of the video content). The positional relationship of N', S', E', W' and C' is similar to the positional relationship of N, S, E, W and C shown in FIG4 .
[0128] Optionally, in order to use the CCCM model shown in the above formula (2) to perform luma intra-frame prediction processing, the processing device needs to determine the weight coefficients c0'~c6' in formula (2) and the chroma values of C', N', S', E', W', P', and B', and then obtain the luma prediction result of the luma sample to be predicted predLumaVal based on formula (2). Optionally, the processing device determines the weight coefficient in formula (2) by obtaining or determining at least one reference area from the image block where the luma prediction is currently located, and determining the weight coefficient based on the sampling value of the luma / chroma sample in the at least one reference area. In one embodiment, at least one luma reference area is obtained or determined when performing luma prediction. In another embodiment, at least one chroma reference area is obtained or determined when performing luma prediction.
[0129] In this embodiment, the technical solution of the present application obtains or determines at least one reference area to determine at least one parameter (for example, a weight parameter, a filter coefficient) based on the reference area to determine or derive a prediction result of the sample to be predicted. In this way, the technical solution of the present application can realize the selection of a suitable intra-frame prediction mode for intra-frame prediction of chroma or luminance in the process of video encoding and decoding using the intra-frame prediction mode, thereby effectively improving the overall efficiency of video encoding.
[0130] Second embodiment
[0131] In this embodiment, the execution subject of the image processing method provided by this application can still be the above-mentioned processing device. In this embodiment, the above-mentioned method of obtaining or determining the reference area can include at least one of the following methods:
[0132] Method 1: obtaining or determining from the left adjacent area or the upper adjacent area of the sample to be predicted or the co-located sample of the sample to be predicted;
[0133] Optionally, if chroma prediction is performed to determine a chroma sample to be predicted, the co-located sample of the chroma sample to be predicted is a co-located luma sample. Optionally, the co-located luma sample is a luma sample located at the same position within the image frame as the chroma sample to be predicted. Optionally, the luma prediction of the co-located luma sample has been completed, and thus the luma value is known.
[0134] Optionally, if luma prediction is performed to determine a luma sample to be predicted, the co-located sample of the luma sample to be predicted is a co-located chroma sample. Optionally, the co-located chroma sample is a chroma sample located at the same position within the image frame as the luma sample to be predicted. Optionally, the co-located chroma sample has already undergone chroma prediction, so that the chroma value is known.
[0135] Optionally, the processing device determines that the image block is used as the chroma sample to be predicted during the process of performing chroma prediction on the current image block. The current image block includes a luminance block and a chroma block. In one embodiment, within the current image frame where the image block is located, at least one reference area is obtained or determined from the left adjacent area or the upper adjacent area of the luminance block where the co-located luminance sample to be predicted is located. Optionally, one of the left adjacent area and the upper adjacent area can be referred to as the first reference area a1; the other of the left adjacent area and the upper adjacent area can be referred to as the second reference area b1. Optionally, the first reference area a1 and the second reference area b1 are luminance reference areas.
[0136] Optionally, the processing device determines the chroma sample to be predicted for the image block during the process of performing chroma prediction on the current image block. The current image block includes a luminance block and a chroma block. In one embodiment, within the current image frame where the image block is located, at least one reference area is obtained or determined from the left adjacent area or the upper adjacent area of the chroma block where the chroma sample to be predicted is located. Optionally, one of the left adjacent area and the upper adjacent area can be referred to as the first reference area a2; the other of the left adjacent area, the upper adjacent area, and the left adjacent area can be referred to as the second reference area b2. Optionally, the first reference area a2 and the second reference area b2 are chroma reference areas.
[0137] Optionally, the processing device determines that the image block is used as the luminance sample to be predicted during the process of performing luminance prediction on the current image block. The current image block includes a luminance block and a chrominance block. In one embodiment, within the current image frame in which the image block is located, at least one reference area is obtained or determined from the left adjacent area or the upper adjacent area of the chrominance block where the co-located chrominance sample of the luminance sample to be predicted is located. Optionally, one of the left adjacent area and the upper adjacent area can be referred to as the first reference area a3; the other of the left adjacent area and the upper adjacent area can be referred to as the second reference area b3. Optionally, the first reference area a3 and the second reference area b3 are chrominance reference areas.
[0138] Optionally, during the process of performing brightness prediction on the current image block, the processing device determines that the image block is used as the brightness sample to be predicted. The current image block includes a brightness block and a chrominance block. In one embodiment, within the current image frame in which the image block is located, at least one reference region is obtained or determined from the left adjacent region or the upper adjacent region of the brightness block of the brightness sample to be predicted. Optionally, one of the left adjacent region and the upper adjacent region can be referred to as the first reference region a4; the other of the left adjacent region and the upper adjacent region can be referred to as the second reference region b4. Optionally, the first reference region a4 and the second reference region b4 are brightness reference regions.
[0139] Method 2: Obtain or determine from an area formed by splicing the left adjacent area and the upper adjacent area of the sample to be predicted or the co-located sample of the sample to be predicted;
[0140] Optionally, during the process of performing chroma prediction on the current image block, the processing device determines that the image block is used as the chroma sample to be predicted. The current image block includes a luminance block and a chroma block. In one embodiment, at least one reference region can also be obtained or determined from a region formed by combining (e.g., splicing) a left adjacent region and an upper adjacent region of the luminance block where the co-located luminance sample of the chroma sample to be predicted is located within the current image frame in which the image block is located. The at least one reference region is a third reference region c1. Optionally, the third reference region c1 is a luminance reference region.
[0141] Optionally, during the process of performing chroma prediction on the current image block, the processing device determines that the image block is used as the chroma sample to be predicted. The current image block includes a luminance block and a chroma block. In one embodiment, at least one reference region can also be obtained or determined from a region formed by combining (e.g., splicing) the left adjacent region and the upper adjacent region of the chroma block where the chroma sample to be predicted is located within the current image frame in which the image block is located. The at least one reference region is a third reference region c2. Optionally, the third reference region c2 is a chroma reference region.
[0142] Optionally, during the process of performing luma prediction on a current image block, the processing device determines that the image block is used as a luma sample to be predicted. The current image block includes a luma block and a chroma block. In one embodiment, at least one reference region c3 may be obtained or determined from a region formed by combining (e.g., splicing) a left adjacent region or a top adjacent region of a chroma block containing a co-located chroma sample of the luma sample to be predicted within the current image frame in which the image block is located. Optionally, the third reference region c3 is a chroma reference region.
[0143] Optionally, during the process of performing luminance prediction on the current image block, the processing device determines that the image block is used as the luminance sample to be predicted. The current image block includes a luminance block and a chrominance block. In one embodiment, at least one reference region can also be obtained or determined from a region formed by combining (e.g., splicing) the left adjacent region and the upper adjacent region of the luminance block where the luminance sample to be predicted is located within the current image frame in which the image block is located. The at least one reference region is a third reference region c4. Optionally, the third reference region c3 is a luminance reference region.
[0144] Optionally, the first and second methods may be combined with each other. For example, the reference area may be obtained or determined by using at least one of the first reference area, the second reference area, and the third reference area. For example:
[0145] Optionally, the reference region is acquired or determined through the first reference region, the second reference region, or the third reference region;
[0146] Optionally, the reference region is acquired or determined through the first reference region and / or the second reference region;
[0147] Optionally, the reference region is acquired or determined through the second reference region and / or the third reference region;
[0148] Optionally, the reference region is acquired or determined through the first reference region and / or the third reference region;
[0149] Optionally, the reference region is acquired or determined through the first reference region and / or the second reference region and / or the third reference region.
[0150] By determining the reference area to be finally adopted from multiple reference areas, the selection of the reference area can be made more flexible. In one embodiment, the first reference area can be area x, the second reference area can be area y, and the third reference area can be area z. By obtaining or determining the reference area to be finally adopted from at least one of the first reference area, the second reference area, and the third reference area, the reference area to be finally adopted can be a combination of the first reference area, the second reference area, and the third reference area, thereby making the position, size, or shape of the reference area to be finally adopted more flexible, and / or, different area combinations can be further adopted according to the computing power of the codec to adapt to different application scenarios.
[0151] Optionally, as shown in Figures 7a to 7c, the reference area is a luminance reference area, and when the co-located luminance block where the co-located luminance sample of the chroma sample to be predicted is located is the first luminance block or the luminance block where the luminance sample to be predicted is located is the first luminance block, the first reference area shown in Figure 7a includes the area adjacent to the left of the first luminance block but does not include the area adjacent above the first luminance block, the second reference area shown in Figure 7b includes the area adjacent above the first luminance block but does not include the area adjacent to the left of the first luminance block, and the above-mentioned third reference area shown in Figure 7c includes at least a part of the area formed by the combination of the area adjacent to the left of the first luminance block and the area adjacent above the first luminance block.
[0152] Optionally, in this embodiment, the width of the area adjacent to the first brightness block may be greater than the width of the first brightness block, and / or the height of the area adjacent to the left of the first brightness block may be greater than the height of the first brightness block.
[0153] Optionally, as shown in Figures 7d to 7f, when the above-mentioned reference area is a chroma reference area, and the chroma block where the chroma sample to be predicted is located is the first chroma block or the co-located chroma block where the co-located chroma sample of the luminance sample to be predicted is located is the first chroma block, the first reference area shown in Figure 7d includes the area adjacent to the left of the first chroma block but does not include the area adjacent above the first chroma block, the second reference area shown in Figure 7e includes the area adjacent above the first chroma block but does not include the area adjacent to the left of the first chroma block, and the above-mentioned third reference area shown in Figure 7f includes at least a part of the area formed by the combination of the area adjacent to the left of the first chroma block and the area adjacent above the first chroma block.
[0154] Optionally, in this embodiment, the width of the area adjacent to the first chroma block above may be greater than the width of the first chroma block, and / or the height of the area adjacent to the left of the first chroma block may be greater than the height of the first chroma block.
[0155] Optionally, in this embodiment, the aforementioned luminance reference areas and chrominance reference areas correspond to each other in position and are co-located areas. For example, the aforementioned first, second, and third reference areas may correspond to the first, second, and third luminance reference areas. Optionally, the aforementioned first, second, and third reference areas may also correspond to the first, second, and third chrominance reference areas. In this way, the first luminance reference area and the first chrominance reference area are co-located areas, the second luminance reference area and the second chrominance reference area are co-located areas, and the third luminance reference area and the third chrominance reference area are co-located areas.
[0156] YUV is a type of true-color encoding space. Y'UV, YUV, YCbCr, YPbPr, and other technical terms can all be referred to as YUV, and there is some overlap. Y represents brightness, or grayscale value, while U and V represent chrominance.
[0157] Alternatively, referring to FIG8 , the left side of FIG8 shows a Y image of a color image to be encoded and decoded by the processing device, while the right side of FIG8 shows a U / V image corresponding to the Y image. Optionally, reference region a and reference region b are located in the Y image, while reference region a' and reference region b' are located in the U / V image. Since reference region a and reference region a' are located in the same position, and reference region b and reference region b' are located in the same position, reference region a and reference region a' are collocated regions, and reference region b and reference region b' are collocated regions.
[0158] Method 3: Obtain or determine based on a preset flag;
[0159] Optionally, in this embodiment, the preset flag is a flag in the bit stream transmitted to the decoding end and is used to indicate a reference area required to be used for predicting the sample to be predicted.
[0160] Alternatively, the flag can be parsed from the encoded bitstream.
[0161] Optionally, the above-mentioned obtaining or determining the reference area according to a preset marker may include:
[0162] According to the value of the flag, the reference area of the value mapping is obtained or determined.
[0163] Optionally, after determining the above-mentioned reference area, the processing device as the encoding end can encode a flag indicating the reference area into the bit stream transmitted to the decoding end. In this way, after receiving the bit stream transmitted from the encoding end, the processing device as the decoding end can parse the flag from the bit stream, and then obtain or determine at least one reference area based on the flag.
[0164] Optionally, the processing device, acting as an encoder, may indicate the different reference regions by encoding flags having different bit numbers. For example, the processing device may encode a flag having a first number of bits to instruct the processor, acting as a decoder, to acquire or determine at least one reference region within the first reference region, and encode a flag having a second number of bits to instruct the processor, acting as a decoder, to acquire or determine at least one reference region within the second reference region. Optionally, the first number of bits is less than the second number of bits, and optionally, the second number of bits is less than the first number of bits.
[0165] Optionally, the processing device acting as an encoder may further indicate the different reference regions by encoding flags of different values. For example, the processing device may encode a flag having a first value to instruct the processor acting as a decoder to acquire or determine at least one reference region within the first reference region, and may encode a flag having a second value to instruct the processor acting as a decoder to acquire or determine at least one reference region within the second reference region. Optionally, the first value and the second value are different.
[0166] Optionally, when encoding the above-mentioned flags to indicate the first reference area, the second reference area, and the third reference area, respectively, the processing device as an encoder may further use a smaller number of bits to indicate a reference area with a higher probability of use, and a larger number of bits to indicate a reference area with a lower probability of use. For example, for most scenarios, the probability that the processing device uses the third reference area to obtain or determine a reference area for predicting a sample to be predicted is higher than the probability that the processing device uses the first reference area or the second reference area to obtain or determine a reference area for predicting a sample to be predicted. In this way, the processing device may encode the flag indicating the third reference area with a smaller number of bits, and use a larger number of bits to encode the flag indicating the first reference area or the second reference area.
[0167] In this embodiment, the processing device encodes the flag indicating the reference area through the above process, which can reduce the number of bits used in the bit stream transmitted to the decoder, thereby effectively improving the compression rate for the flag.
[0168] Optionally, when performing chroma prediction for the sample to be predicted, the processing device as an encoder determines that the luminance reference area used to obtain or determine the reference area is of the type shown in any one of Figures 7a to 7c. The processing device can then send a luminance reference area flag (flag luma_ref_region_flag) to indicate the type of the first reference area shown in Figure 7a, the type of the second reference area shown in Figure 7b, or the type of the third reference area shown in Figure 7c. At the decoding end, the processing device as a decoder can parse the flag luma_ref_region_flag to obtain the value corresponding to the flag, thereby determining the type of the luminance reference area used to obtain or determine the reference area based on the value. Optionally, the mapping relationship between the value of the flag luma_ref_region_flag, the type of the luminance reference area, and the binarization of the flag luma_ref_region_flag is shown in Table 1 below:
[0169] Table 1
[0170] As shown in Figures 7a to 7c, the reference region shown in Figure 7a is the first luma reference region, the reference region shown in Figure 7b is the second luma reference region, and the reference region shown in Figure 7c is the third luma reference region. Optionally, if the third luma reference region shown in Figure 7c is used, the encoder sets the value of the flag luma_ref_region_flag to 0, binarizes the flag luma_ref_region_flag to 0, and then encapsulates it into the bitstream. And / or, if the first luma reference region shown in Figure 7a is used, the encoder sets the value of the flag luma_ref_region_flag to 1, binarizes the flag luma_ref_region_flag to 10, and then encapsulates it into the bitstream. And / or, if the second luma reference region shown in Figure 7b is used, the encoder sets the value of the flag luma_ref_region_flag to 2, binarizes the flag luma_ref_region_flag to 11, and then encapsulates it into the bitstream.
[0171] For the decoder, if the binary value of the flag luma_ref_region_flag parsed from the bit stream is 0, the value of the flag luma_ref_region_flag is 0, indicating that the reference area is the third luminance reference area shown in Figure 7c; and / or, if the binary value of the flag luma_ref_region_flag parsed from the bit stream is 10, the value of the flag luma_ref_region_flag is 1, indicating that the reference area is the first luminance reference area shown in Figure 7a; and / or, if the binary value of the flag luma_ref_region_flag parsed from the bit stream is 11, the value of the flag luma_ref_region_flag is 2, indicating that the reference area is the second luminance reference area shown in Figure 7b.
[0172] Optionally, the value of the flag luma_ref_region_flag, the type of the luminance reference region, and the binarization of the flag luma_ref_region_flag are not fixed, and their mapping relationship may also be as shown in the following Table 2:
[0173] Table 2
[0174] Optionally, in Table 1 and Table 2 above, the number of binarized bits of the flag luma_ref_region_flag corresponding to the third reference region type is smaller than the number of binarized bits of the flag luma_ref_region_flag corresponding to the first reference region type and the second reference region type. The reason is that, when computing power is sufficient, the prediction processing that favors the third reference region type is more accurate than the prediction processing that favors the first reference region type and the second reference region type, and the probability of use of the third reference region type is greater than the probability of use of the other two reference region types. Setting the number of binarized bits of the flag luma_ref_region_flag corresponding to the third reference region type with a high probability of use to be smaller than the number of binarized bits of the flag luma_ref_region_flag corresponding to the other reference region types can reduce the number of coding bits when computing power is sufficient.
[0175] Optionally, when performing chroma prediction on a sample to be predicted, the processing device as an encoder determines that the chroma reference region used to obtain or determine the reference region is of the type shown in any of Figures 7d to 7f. The processing device may then send a chroma reference region flag (flag Chroma_ref_region_flag) to indicate the type of the first reference region shown in Figure 7d, the type of the second reference region shown in Figure 7e, or the type of the third reference region shown in Figure 7f. At the decoding end, the processing device as a decoder may parse the flag Chroma_ref_region_flag to obtain the value corresponding to the flag, and thereby determine the type of the chroma reference region used to obtain or determine the reference region based on the value. Optionally, the mapping relationship between the value of the flag Chroma_ref_region_flag, the type of the chroma reference region, and the binarization of the flag Chroma_ref_region_flag is shown in Table 3 below:
[0176] Table 3
[0177] As shown in Figures 7d and 7f, the reference region shown in Figure 7d is the first chroma reference region, the reference region shown in Figure 7e is the second chroma reference region, and the reference region shown in Figure 7f is the third chroma reference region. Optionally, if the third chroma reference region shown in Figure 7f is used, the encoder sets the value of the flag Chroma_ref_region_flag to 0, binarizes the flag Chroma_ref_region_flag to 0, and then packages it into the bitstream. And / or, if the first chroma reference region shown in Figure 7d is used, the encoder sets the value of the flag Chroma_ref_region_flag to 1, binarizes the flag Chroma_ref_region_flag to 10, and then packages it into the bitstream. And / or, if the second chroma reference region shown in Figure 7e is used, the encoder sets the value of the flag Chroma_ref_region_flag to 2, binarizes the flag Chroma_ref_region_flag to 11, and then packages it into the bitstream.
[0178] For the decoder, if the binary value of the flag Chroma_ref_region_flag parsed from the bit stream is 0, the value of the flag Chroma_ref_region_flag is 0, indicating that the reference area is the third chroma reference area shown in Figure 7f; and / or, if the binary value of the flag Chroma_ref_region_flag parsed from the bit stream is 10, the value of the flag Chroma_ref_region_flag is 1, indicating that the reference area is the first chroma reference area shown in Figure 7d; and / or, if the binary value of the flag Chroma_ref_region_flag parsed from the bit stream is 11, the value of the flag Chroma_ref_region_flag is 2, indicating that the reference area is the second chroma reference area shown in Figure 7e.
[0179] Optionally, the value of the flag Chroma_ref_region_flag, the type of the chrominance reference region, and the binarization of the flag Chroma_ref_region_flag are not fixed, and their mapping relationship may also be as shown in the following Table 4:
[0180] Table 4
[0181] Optionally, in Tables 3 and 4 above, the number of binarized bits of the flag Chroma_ref_region_flag corresponding to the third reference region type is smaller than the number of binarized bits of the flag Chroma_ref_region_flag corresponding to the first reference region type and the second reference region type. This is because, when computing power is sufficient, the probability of use of the third reference region type is greater than the probability of use of the other two reference region types because the prediction processing that favors the third reference region type is more accurate than the prediction processing that favors the first reference region type and the second reference region type. Setting the number of binarized bits of the flag Chroma_ref_region_flag corresponding to the third reference region type with a high probability of use to be smaller than the number of binarized bits of the flag Chroma_ref_region_flag corresponding to the other reference region types can reduce the number of encoded bits when computing power is sufficient.
[0182] Similarly, when performing luminance prediction for the sample to be predicted, the processing device as an encoder can use a luminance reference region type similar to the above-mentioned luminance reference region type, a flag similar to the above-mentioned flag Luma_ref_region_flag, and a mapping relationship similar to Table 1 or Table 2 above; it can also use a chroma reference region type similar to the above-mentioned chroma reference region type, a flag similar to the above-mentioned flag Chroma_ref_region_flag, and a mapping relationship similar to Table 3 or Table 4 above.
[0183] Optionally, the flag ref_region_select_flag may be used to indicate whether the luma reference region type or the chroma reference region type is used. For example, if the value of the flag ref_region_select_flag is 1, the luma reference region type is used, and / or if the value of the flag ref_region_select_flag is 0, the chroma reference region type is used.
[0184] Method 4: Obtain or determine based on template area;
[0185] Optionally, the processing device serving as a decoder may also obtain or determine at least one reference area from the template area.
[0186] Optionally, in this embodiment, the above-mentioned flag may include a third value in addition to the first value and / or the second value.
[0187] The first value and the second value are one of 0, 1, and 2, and the third value is a value other than the first value and the second value.
[0188] In one embodiment, the first value and the second value are values within a first value range, and the third value is a value outside the first value range.
[0189] Optionally, the fourth method of acquiring or determining the reference area based on the template area may include:
[0190] If the value is the third value, the reference area is determined according to the template area.
[0191] Optionally, in addition to encoding the flag having the first or second value to instruct the processing device on the decoding side to obtain or determine at least one reference region from the first, second, or third reference regions based on the value of the flag for predicting the sample to be predicted, the processing device on the encoding side may also encode a flag having a third value to instruct the processing device on the decoding side to directly use the template region to obtain or determine at least one reference region. That is, upon parsing the bitstream and determining that the flag encoded by the encoder has the third value, the processing device as the decoder directly and autonomously derives the template region on the decoding side, thereby further obtaining or determining at least one reference region from the template region for predicting the sample to be predicted.
[0192] Optionally, in the process of performing chroma prediction for the sample to be predicted, the processing device as a decoder, after parsing the received bit stream to obtain a flag with a third value, determines a template area around the sample to be predicted, and then uses three reference area types (i.e., the types of the first reference area, the second reference area, and the third reference area) to derive the weight coefficients of the CCCM model for the chroma sample in the template area, and predicts the corresponding weight coefficients under different reference area types based on the obtained weight coefficients. The predicted value of the chroma sample in the template area is calculated based on the different weight coefficients. Finally, the optimal reference area type is determined by analyzing the prediction error of the predicted value under each reference area type. The optimal reference area type is set as the reference area type of the sample to be predicted.
[0193] Optionally, the template area determined by the processing device around the sample to be predicted may be: an area adjacent to the left and / or above the sample to be predicted.
[0194] Optionally, the processing device as an encoder uses a luma reference region derivation flag luma_ref_region_deriv_flag to instruct the decoding end to determine the type of the luma reference region based on the template region, thereby determining the luma reference region. For example, when the value of the luma reference region derivation flag luma_ref_region_deriv_flag is 1, it indicates that the type of the luma reference region can be deduced based on the template region, and / or when the value of the luma reference region derivation flag luma_ref_region_deriv_flag is 0, it indicates that the type of the luma reference region cannot be deduced based on the template region.
[0195] Alternatively, as shown in FIG9a to FIG9d , in a feasible embodiment in which a processing device performs chroma prediction on a chroma sample to be predicted, the template area may be an area consisting of one or more rows of luma samples adjacent to and to the left of a first luma block (a co-located luma block of the chroma block where the chroma sample to be predicted is located). This template area is a luma template area.
[0196] Optionally, the template area may be L-shaped, with the right edge of the template area aligned with the right edge of the first luminance block, and the lower edge of the template area aligned with the lower edge of the first luminance block. The number of rows above the template area and the number of columns to the left may be the same or different.
[0197] Alternatively, as shown in FIG10a to FIG10d , in a feasible embodiment in which a processing device performs chroma prediction for a chroma sample to be predicted, the template area may be an area consisting of one or more rows of luma samples adjacent above and one or more rows of luma samples adjacent to the left of a first chroma block (the chroma block in which the chroma sample to be predicted is located). This template area is a chroma template area.
[0198] Optionally, the template area can be L-shaped, with the right edge of the template area aligned with the right edge of the first chroma block, and the bottom edge of the template area aligned with the bottom edge of the first chroma block. The number of rows above the template area and the number of columns to the left can be the same or different.
[0199] Optionally, a portion of the L-shaped template area is located above the first luminance block or the first chrominance block and another portion of the L-shaped template area is located to the left of the first luminance block or the first chrominance block. Therefore, the pixel features of the L-shaped template area are similar to the pixel features of the first luminance block / first chrominance block, so that the suitable reference area of the L-shaped template area is similar to the most suitable for the first luminance block / first chrominance block.
[0200] Alternatively, the template area may be a block area. For example, the template area may be a block area located on a diagonal line of the first luminance block or the first chrominance block. Alternatively, the diagonal line is a diagonal line connecting the upper left corner and the lower right corner of the first luminance block / the first chrominance block.
[0201] Similarly, in a feasible embodiment in which a processing device performs luma prediction for a luma sample to be predicted, the template area may be an area consisting of one or several adjacent rows of luma samples above and to the left of a first luma block (the luma block where the luma sample to be predicted is located). This template area is a luma template area. In a feasible embodiment in which a processing device performs luma prediction for a luma sample to be predicted, the template area may be an area consisting of one or several adjacent rows of chroma samples above and to the left of a first chroma block (the co-located chroma block of the luma block where the luma sample to be predicted is located). This template area is a chroma template area.
[0202] Method 5: If the intra prediction mode adopted by the co-located sample of the sample to be predicted and / or the adjacent sample of the sample to be predicted is an angular intra prediction mode, then the angle is obtained or determined according to the intra angle corresponding to the angular intra prediction mode.
[0203] Optionally, the processing device may further acquire or determine at least one reference region for use in performing a prediction operation on the sample to be predicted based on the intra-frame prediction mode employed by the co-located sample and / or the adjacent sample of the sample to be predicted when performing the same prediction operation. That is, when the processing device acquires or determines that the intra-frame prediction mode employed by the co-located sample and / or the adjacent sample of the sample to be predicted is an angular intra-frame prediction mode, the processing device may directly acquire or determine at least one reference region for use in predicting the sample to be predicted based on the intra-frame angle corresponding to the angular intra-frame prediction mode.
[0204] Optionally, acquiring or determining the reference area according to an angle within a frame may include:
[0205] The reference area is acquired or determined according to the angle range of the intra-frame angle.
[0206] Optionally, as indicated by the solid arrows in FIG11 , the intra-frame angles corresponding to the angle intra-frame prediction modes used by the above-mentioned co-located samples and / or adjacent samples include: intra-frame angle 2 (INTRA_ANGULAR2) to intra-frame angle 66 (INTRA_ANGULAR66). Optionally, for wide-angle modes (wide-angle modes are only applied to non-square blocks), the angle intra-frame prediction modes also include intra-frame angles -14 (INTRA_ANGULAR-14) to intra-frame angle -1 (INTRA_ANGULAR-1) and intra-frame angles 67 (INTRA_ANGULAR67) to intra-frame angles 80 (INTRA_ANGULAR80).
[0207] Optionally, if a sample or an image block uses an angular intra prediction mode within a first angle range, the reference region type to be predicted is reference region type X; if the sample or the image block uses an angular intra prediction mode within a second angle range, the reference region type to be predicted is a second reference region type Y. Optionally, reference region type X and reference region type Y are different.
[0208] Optionally, in the process of performing chroma prediction for the sample to be predicted, if the processing device determines that the luminance block in which the co-located luminance sample for the sample to be predicted or the adjacent luminance sample of the sample to be predicted is located is chroma predicted using an angular intra-frame prediction mode, and the intra-frame angle corresponding to the angular intra-frame prediction mode is greater than 2 and less than or equal to 18, then the processing device can directly obtain or determine at least one reference area from the left adjacent area of the co-located luminance sample or the adjacent luminance sample.
[0209] Optionally, if the processing device determines that the luminance block where the co-located luminance sample of the sample to be predicted or the adjacent luminance sample of the sample to be predicted is located is chroma predicted using an angular intra-frame prediction mode, and the intra-frame angle corresponding to the angular intra-frame prediction mode is greater than or equal to 50 and less than 66, then the processing device can directly obtain or determine at least one reference area from the upper adjacent area of the co-located luminance sample or the adjacent luminance sample.
[0210] Optionally, if the processing device determines that the luminance block where the co-located luminance sample or the adjacent luminance sample to be predicted is located is chrominance predicted using an angular intra-frame prediction mode, and the intra-frame angle corresponding to the angular intra-frame prediction mode is greater than 21 and less than 49, then the processing device can directly obtain or determine at least one reference area from the area formed by splicing the left adjacent area and the upper adjacent area of the co-located luminance sample or the adjacent luminance sample.
[0211] Optionally, as shown in Table 5 below, as a processing device of an encoder or decoder, during chroma prediction for a sample to be predicted, if the luma block containing the co-located luma sample corresponding to the sample to be predicted is chroma predicted using an angular intra prediction mode, and the intra angle of the angular intra prediction mode is between 50 (INTRA_ANGULAR50) and 66 (INTRA_ANGULAR66), the processing device may determine that the type of the luma reference region for the sample to be predicted is the type of the second reference region. If the intra angle of the angular intra prediction mode is between 2 (INTRA_ANGULAR2) and 18 (INTRA_ANGULAR18), the type of the luma reference region for the sample to be predicted is the type of the first reference region. If the intra angle of the angular intra prediction mode is between 21 (INTRA_ANGULAR21) and 49 (INTRA_ANGULAR49), the type of the luma reference region for the sample to be predicted is the type of the third reference region.
[0212] Table 5
[0213] Optionally, as shown in Table 6 below, for wide-angle modes, if the luma block containing the co-located luma sample corresponding to the sample to be predicted adopts the angular intra prediction mode, and the intra-frame angle of the angular intra prediction mode is from INTRA_ANGULAR67 to INTRA_ANGULAR80, then the type of the luma reference region for the chroma block to be predicted is the type of the second reference region described above. If the intra-frame angle of the angular intra prediction mode is from INTRA_ANGULAR-14 to INTRA_ANGULAR-1, then the type of the luma reference region for the chroma block to be predicted is the type of the first reference region described above. If the intra-frame angle of the angular intra prediction mode is from INTRA_ANGULAR-14 to INTRA_ANGULAR-1, then the type of the luma reference region for the chroma block to be predicted is the type of the first reference region described above.
[0214] Table 6
[0215] Optionally, if the intra-frame angle of the angular intra-frame prediction mode used by the luminance block where the above-mentioned co-located luminance sample is located is INTRA_ANGULAR50~INTRA_ANGULAR66, it can be confirmed that the predicted value of the luminance sample in the luminance block is derived based on the boundary pixels above the luminance block. In this case, the processing device can determine that the chrominance value of the sample to be predicted is highly correlated with the area above it. If the intra-frame angle of the angular intra-frame prediction mode used by the luminance block where the above-mentioned co-located luminance sample is located is INTRA_ANGULAR2~INTRA_ANGULAR18, it can be confirmed that the predicted value of the luminance sample in the luminance block is derived based on the boundary pixels on the left side of the luminance block. In this case, the processing device can determine that the chrominance value of the sample to be predicted is highly correlated with the area to its left. If the intra-frame angle of the angular intra-frame prediction mode used by the luminance block where the above-mentioned co-located luminance sample is located is INTRA_ANGULAR21~INTRA_ANGULAR49, it can be confirmed that the predicted value of the luminance sample in the luminance block is derived based on the boundary pixels on the left and above the luminance block. In this case, the processing device can determine that the chrominance value of the sample to be predicted is highly correlated with the area where the left area and the above area are combined and spliced.
[0216] Optionally, the upper region includes the upper luminance adjacent region and its co-located chrominance adjacent region. The left region includes the left luminance adjacent region and its co-located chrominance adjacent region.
[0217] Optionally, when the processing device of an encoder or decoder performs brightness prediction, the operating means of using method five to obtain or determine the reference area is based on the same principle as when the above-mentioned processing device performs chrominance prediction, and no further details are given here.
[0218] In this embodiment, when the processing device determines the reference area for chroma / luminance prediction of the sample to be predicted through the various methods mentioned above, if the characteristics of the sample to be predicted are similar only to the characteristics of the adjacent area on the left, but not similar to the characteristics of the adjacent area above, the processing device can use the above-mentioned first reference area to obtain a better weight coefficient for chroma / luminance prediction; if the characteristics of the sample to be predicted are similar only to the characteristics of the adjacent area above, but not similar to the characteristics of the adjacent area on the left, the processing device can use the above-mentioned second reference area to obtain a better weight coefficient for chroma / luminance prediction; and if the characteristics of the sample to be predicted are similar to the characteristics of the adjacent area above and the characteristics of the adjacent area on the left, the processing device can use the above-mentioned third reference area to obtain a better weight coefficient for chroma / luminance prediction.
[0219] Third embodiment
[0220] In this embodiment, the execution subject of the image processing method provided by this application can still be the above-mentioned processing device. In this embodiment, the above-mentioned fourth method of obtaining or determining the reference area based on the template area can also include:
[0221] Acquire or determine a first parameter and / or a second parameter from the template area;
[0222] The reference area is acquired or determined according to the first parameter and / or the second parameter.
[0223] Optionally,
[0224] Acquire or determine a first parameter and / or a second parameter from the template area;
[0225] Obtaining or determining a first sampling prediction result corresponding to the first parameter and / or a second sampling prediction result corresponding to the second parameter;
[0226] The reference area is determined according to the first sampling prediction result and / or the second sampling prediction result.
[0227] Optionally,
[0228] Acquire or determine a first parameter and / or a second parameter from the template area;
[0229] Obtaining or determining a first sampling prediction result corresponding to the first parameter and / or a second sampling prediction result corresponding to the second parameter;
[0230] The reference area is obtained or determined according to the first sampling prediction result and / or the second sampling prediction result.
[0231] Optionally, a reference area corresponding to the first sampling prediction result or a reference area corresponding to the second sampling prediction result is used as the reference area.
[0232] Optionally,
[0233] Acquire or determine a first parameter and a second parameter from the template area;
[0234] Obtaining or determining a first sampling prediction result corresponding to the first parameter and a second sampling prediction result corresponding to the second parameter;
[0235] If the first sampling prediction result is better than the second sampling prediction result, the reference area is obtained or determined as a fourth reference area according to the first parameter, and / or, if the second sampling prediction result is better than the first sampling prediction result, the reference area is obtained or determined as a fifth reference area according to the second parameter. Optionally, the fourth reference area is one of an area that includes the area adjacent to the template area above but does not include the area adjacent to the left of the template area, an area that includes the area adjacent to the left of the template area but does not include the area adjacent to the top of the template area, and an area formed by combining (e.g., splicing) the area adjacent to the left and the area adjacent to the top of the template area, and the fifth reference area is another of an area that includes the area adjacent to the template area above but does not include the area adjacent to the left of the template area, an area adjacent to the left of the template area but does not include the area adjacent to the top of the template area, and an area formed by combining (e.g., splicing) the area adjacent to the left and the area adjacent to the top of the template area. The template area can be a luminance template area or a chrominance template area.
[0236] Optionally, as an encoder or a processing device of the encoder, each can use the above-mentioned template area to obtain or determine at least one reference area on the local end. That is, the processing device first obtains or determines at least two parameters - a first parameter and a second parameter - from the template area; then, the processing device sequentially obtains or determines a first sampling prediction result corresponding to the first parameter and a second sampling prediction result corresponding to the second parameter, and compares the first sampling prediction result with the second sampling prediction result. If the processing device finds that the first sampling prediction result is better than the second sampling prediction result, it can obtain or determine at least one reference area based on the first parameter; and / or, if the second sampling prediction result is better than the first sampling prediction result, it can obtain or determine at least one reference area based on the second parameter.
[0237] Optionally, the acquiring or determining the reference area according to the first parameter may include:
[0238] The reference area is acquired or determined according to a positional relationship between an area corresponding to the first parameter in the template area and the template area.
[0239] Optionally, when the processing device determines that the first sample prediction result corresponding to the first parameter is superior to the second sample prediction result corresponding to the second parameter, and thus obtains or determines the reference area based on the first parameter, the processing device may first obtain or determine a fourth reference area corresponding to the first parameter in the template area, and then obtain or determine at least one reference area based on the positional relationship between the fourth reference area and the template area. In one embodiment, if the first parameter is derived from the fourth reference area, and the fourth reference area includes the area adjacent to the left of the template area but does not include the area adjacent to the top of the template area, then the at least one reference area includes the area adjacent to the left of the first luminance block / first chrominance block as shown in Figures 7a and 7e but does not include the area adjacent to the top of the first luminance block / first chrominance block. In one embodiment, if the first parameter is derived from the fourth reference area, and the fourth reference area includes the area adjacent to the top of the template area but does not include the area adjacent to the left of the template area, then the at least one reference area includes the area adjacent to the top of the first luminance block / first chrominance block as shown in Figures 7b and 7d but does not include the area adjacent to the left of the first luminance block / first chrominance block. In one embodiment, if the first weight coefficient is derived through a fourth reference area, and the fourth reference area is an area formed by a combination (for example, splicing) of the left adjacent area and the upper adjacent area of the template area, then the at least one reference area is an area formed by a combination (for example, splicing) of the left adjacent area and the upper adjacent area of the first luminance block / first chrominance block as shown in Figures 7c and 7f.
[0240] Optionally, the operation means of the processing device for acquiring or determining the reference area according to the second parameter is the same as the process of acquiring or determining the reference area according to the first parameter, and is not repeated here.
[0241] Optionally, in this embodiment, during chroma prediction for a sample to be predicted, a processing device at the encoding end and / or decoding end may use a fourth luminance reference region to determine a first parameter for the template region, and use a fifth reference region to determine a second parameter for the template region, thereby determining at least one luminance reference region based on the first and second parameters. Optionally, the at least one luminance reference region may be acquired or determined based on a positional relationship between the fourth luminance reference region and the template region. Optionally, the fourth luminance reference region and the fifth luminance reference region are of different types.
[0242] Optionally, the first parameter and the second parameter are weight parameters, filter coefficients, etc.
[0243] Optionally, as shown in Figures 12a to 12c, as a processing device of an encoder and / or decoder, in the process of performing chrominance prediction for the sample to be predicted, it is assumed that the template area is a luminance template area, and the luminance reference area of the template area is located to the left and / or above the template area and is adjacent to the template area. The processing device can apply three types of luminance reference areas to the template area respectively to determine the corresponding three types of weight coefficients.
[0244] In one embodiment, the three types of brightness reference areas are a left reference area only on the left side of the template area as shown in FIG12a , an upper reference area only above the template area as shown in FIG12b , and / or an area formed by combining the left and upper areas of the template area as shown in FIG12c .
[0245] In another embodiment, the three types of brightness reference areas are a first reference area, a second reference area, and a third reference area. The first reference area includes an area adjacent to the left of the template area but not an area adjacent above the template area, the second reference area includes an area adjacent to the above the template area but not an area adjacent to the left of the template area, and the third reference area includes at least a portion of an area formed by a combination of an area adjacent to the left of the template area and an area adjacent above the template area.
[0246] After the processing device determines the weight coefficients corresponding to the three types, the processing device calculates the predicted values of the co-located chroma samples of the luminance samples in the template area under the weight coefficients corresponding to the three types, and compares the predicted values with the reconstructed values of the co-located chroma samples, thereby taking the luminance reference area type corresponding to the weight coefficient with the smallest error between the predicted value and the reconstructed value as the type of the luminance reference area of the first luminance block.
[0247] Alternatively, assuming that the processing device determines weight coefficients ca10 to ca16 from the luma reference region shown in FIG. 12a , weight coefficients ca20 to ca26 from the luma reference region shown in FIG. 12b , and weight coefficients ca30 to ca36 from the luma reference region shown in FIG. 12c , the processing device then calculates a predicted value PredCx1 for the co-located chroma samples of the luma samples in the template region using the weight coefficients ca10 to ca16, calculates a predicted value PredCx2 for the co-located chroma samples of the luma samples in the template region using the weight coefficients ca20 to ca26, and calculates a predicted value PredCx3 for the co-located chroma samples of the luma samples in the template region using the weight coefficients ca30 to ca36. Thus, after obtaining predicted values for the co-located chroma samples corresponding to the luma samples in the template region, the processing device compares the errors between the predicted values and the reconstructed values of the co-located chroma samples, and selects the luma reference region type corresponding to the predicted value with the smallest error as the luma reference region type of the first luma block. For example, the processing device compares the errors between the predicted values PredCnx1 to PredCnx3 and the reconstructed values recCnx of the multiple co-located chroma samples Xn. N = 1, 2, ..., num. num is the number of co-located chroma samples. For example, the sum of absolute differences (SAD) between the predicted values PredCnxi (i = 1, 2, 3) and the reconstructed values recCnx of the multiple co-located chroma samples Xn is compared, and the luma reference region type corresponding to the predicted value with the smallest SAD is selected as the luma reference region type of the first luma block.
[0248] Optionally, as shown in Figures 13a to 13c, as a processing device of an encoder and / or decoder, in the process of performing chroma prediction for the sample to be predicted, it is assumed that the template area is a chroma template area, and the chroma reference area of the template area is located on the left and / or above the template area and is adjacent to the template area. The processing device can apply three types of chroma reference areas to the template area (i.e., a left reference area only on the left side of the template area as shown in Figure 13a, an upper reference area only above the template area as shown in Figure 13b, and / or an area composed of a combination of the left and upper areas of the template area as shown in Figure 13c) to determine the corresponding three types of weight coefficients respectively.
[0249] After the processing device determines the weight coefficients corresponding to the three types, the processing device calculates the predicted values of the chroma samples in the template area under the weight coefficients corresponding to the three types, and compares the predicted values with the reconstructed values of the chroma samples, thereby taking the chroma reference area type corresponding to the weight coefficient with the smallest error between the predicted value and the reconstructed value as the type of the chroma reference area of the first chroma block.
[0250] Similarly, as a processing device of an encoder and / or decoder, in the process of performing luminance prediction for the sample to be predicted, similar to the above-mentioned chrominance prediction process, those skilled in the art can understand how to implement it after understanding the content and essence of the present invention.
[0251] Alternatively, assuming that the processing device determines weight coefficients ca10 to ca16 from the chroma reference region shown in FIG. 13a , weight coefficients ca20 to ca26 from the chroma reference region shown in FIG. 13b , and weight coefficients ca30 to ca36 from the chroma reference region shown in FIG. 13c , the processing device then calculates predicted values PredCx1 for the chroma samples in the template region using the weight coefficients ca10 to ca16, predicts PredCx2 for the chroma samples in the template region using the weight coefficients ca20 to ca26, and predicts PredCx3 for the chroma samples in the template region using the weight coefficients ca30 to ca36. Thus, after obtaining predicted values for the plurality of chroma samples in the template region, the processing device compares the errors between the predicted values and the reconstructed values of the co-located luma samples, and selects the chroma reference region type corresponding to the predicted value with the smallest error as the chroma reference region type for the first chroma block. For example, the processing device compares the errors between the predicted values PredCnx1 to PredCnx3 of the chroma samples Xn and the reconstructed values recCnx of the chroma samples Xn, respectively. N = 1, 2, ..., num. num is the number of co-located luma samples. For example, the sum of absolute differences (SAD) between the predicted values PredCnxi (i = 1, 2, 3) and the reconstructed values recCnx of the chroma samples Xn is compared, and the chroma reference region type corresponding to the predicted value with the smallest SAD is selected as the chroma reference region type of the first chroma block.
[0252] Optionally, in this embodiment, the third method of acquiring or determining the reference area according to the preset mark may further include:
[0253] Obtaining or determining the intra-frame prediction mode corresponding to the flag;
[0254] A prediction result of the sample to be predicted is determined or obtained according to the intra-frame prediction mode.
[0255] Optionally, when performing chroma prediction on the chroma sample to be predicted, the processing device of the encoder can use the luma reference region derivation flag luma_ref_region_deriv_flag1 to instruct the processing device at the decoding end to determine the type of the luma reference region based on the luma block where the co-located luma sample corresponding to the chroma sample to be predicted is located, or the adjacent luma block of the luma block, and then determine the luma reference region of the chroma sample to be predicted that needs to be predicted.
[0256] Optionally, the processing device at the encoding end may use different flags to instruct the processing device at the decoding end how to derive the reference region type.
[0257] Optionally, when the value of the luma reference region derivation flag luma_ref_region_deriv_flag1 is 1, it instructs the processing device at the decoding end to determine the luma block in which the co-located luma sample corresponding to the chroma sample to be predicted is located, and to use the type of the intra-frame prediction mode of the luma block to derive the type of the luma reference region for the chroma sample to be predicted for chroma prediction. In one embodiment, if the intra-frame prediction mode type of the luma block is angular intra-frame prediction mode x1, then the type of the luma reference region for the chroma sample to be predicted for chroma prediction is reference region type X1. Reference region type X1 is one of Figures 7a to 7c. Optionally, the angular intra-frame prediction mode x1 and the reference region type X1 correspond to Table 5. For example, if the angular intra-frame prediction mode x1 is INTRA_ANGULAR2 to INTRA_ANGULAR18, then the reference region type X1 is the first reference region. And / or, if the angular intra prediction mode x1 is INTRA_ANGULAR50 to INTRA_ANGULAR66, the reference region type X1 is the second reference region. And / or, if the angular intra prediction mode x1 is INTRA_ANGULAR21 to INTRA_ANGULAR49, the reference region type X1 is the third reference region.
[0258] Optionally, when the value of the luma reference region derivation flag luma_ref_region_deriv_flag1 is 2, it instructs the processing device at the decoding end to determine the adjacent luma blocks of the luma block in which the corresponding co-located luma sample to be predicted is located, and to use the type of the intra-frame prediction mode of the adjacent luma block to derive the type of the luma reference region for the sample to be predicted for chroma prediction. In one embodiment, if the intra-frame prediction mode type of the adjacent luma block is angular intra-frame prediction mode x2, the type of the luma reference region for the chroma sample to be predicted for chroma prediction is reference region type X2. Reference region type X2 corresponds to at least a portion of a region selected from the group consisting of a region adjacent to the left of the adjacent luma block but excluding a region adjacent above the adjacent luma block, a region adjacent above the adjacent luma block but excluding a region adjacent to the left of the adjacent luma block, and a region adjacent to the left of the adjacent luma block and a region adjacent above the adjacent luma block. Optionally, angular intra-frame prediction mode x2 and reference region type X2 correspond to Table 5. For example, if the angular intra prediction mode x2 is INTRA_ANGULAR2 to INTRA_ANGULAR18, the reference region type X2 is the first reference region. And / or, if the angular intra prediction mode x2 is INTRA_ANGULAR50 to INTRA_ANGULAR66, the reference region type X2 is the second reference region. And / or, if the angular intra prediction mode x2 is INTRA_ANGULAR21 to INTRA_ANGULAR49, the reference region type X2 is the third reference region. Optionally, the first reference region, the second reference region, and the third reference region are one of at least a portion of the region formed by the region adjacent to the left of the adjacent luminance block but not including the region adjacent above the adjacent luminance block, the region adjacent above the adjacent luminance block but not including the region adjacent to the left of the adjacent luminance block, and the region adjacent to the left of the adjacent luminance block and the region adjacent above the adjacent luminance block. Optionally, the first reference region, the second reference region, and the third reference region are different from each other.
[0259] Optionally, when the value of the luma reference region derivation flag luma_ref_region_deriv_flag1 is 0, it indicates that the processing device at the decoding end is prohibited from using the luma block where the above-mentioned co-located luma sample is located or the adjacent luma block of the luma block to derive the type of the luma reference region.
[0260] Optionally, when performing chroma prediction on the chroma sample to be predicted, the processing device of the encoder can use the chroma reference region derivation flag Chroma_ref_region_deriv_flag1 to instruct the processing device at the decoding end to determine the type of the chroma reference region based on the chroma block where the chroma sample to be predicted is located, or the adjacent chroma block of the chroma block, and then determine the chroma reference region of the chroma sample to be predicted that needs to be predicted.
[0261] Optionally, the processing device at the encoding end may use different flags to instruct the processing device at the decoding end how to derive the reference region type.
[0262] Optionally, when the value of the chroma reference region derivation flag Chroma_ref_region_deriv_flag1 is 1, it instructs the processing device at the decoding end to determine the chroma block in which the chroma sample to be predicted is located, and to derive the type of the chroma reference region for the chroma sample to be predicted using the type of the intra-frame prediction mode of the co-located luminance block of the chroma block. In one embodiment, if the intra-frame prediction mode type of the co-located luminance block is angular intra-frame prediction mode x1', then the type of the chroma reference region for the chroma sample to be predicted is reference region type X1'. Reference region type X1' is one of Figures 7a to 7c. Optionally, the angular intra-frame prediction mode x1' and the reference region type X1' correspond to Table 5. For example, if the angular intra-frame prediction mode x1' is INTRA_ANGULAR2 to INTRA_ANGULAR18, then the reference region type X1' is the first reference region. And / or, if the angular intra prediction mode x1' is INTRA_ANGULAR50 to INTRA_ANGULAR66, the reference region type X1' is the second reference region. And / or, if the angular intra prediction mode x1' is INTRA_ANGULAR21 to INTRA_ANGULAR49, the reference region type X1' is the third reference region.
[0263] Optionally, when the value of the chroma reference region derivation flag Chroma_ref_region_deriv_flag1 used is 2, it instructs the processing device at the decoding end to determine the co-located adjacent luminance block of the adjacent chroma block of the chroma block where the chroma sample to be predicted is located, and use the type of the intra-frame prediction mode of the co-located adjacent luminance block to derive the type of the chroma reference region for the chroma sample to be predicted for chroma prediction. The adjacent chroma block and the co-located adjacent luminance block are co-located blocks. In one embodiment, if the intra-frame prediction mode type of the co-located adjacent luminance block is the angular intra-frame prediction mode x2', then the type of the luminance reference region for the chroma sample to be predicted for chroma prediction is the reference region type X2'. The reference region type X2' corresponds to one of at least a portion of the region formed by the region adjacent to the left of the co-located adjacent luminance block but not including the region adjacent above the co-located adjacent luminance block, the region adjacent above the co-located adjacent luminance block but not including the region adjacent to the left of the co-located adjacent luminance block, and the region adjacent to the left of the co-located adjacent luminance block and the region adjacent above the co-located adjacent luminance block. Optionally, the angular intra prediction mode x2 and the reference region type X2 correspond to Table 5. For example, if the angular intra prediction mode x2' is INTRA_ANGULAR2 to INTRA_ANGULAR18, the reference region type X2' is a first reference region. And / or, if the angular intra prediction mode x2' is INTRA_ANGULAR50 to INTRA_ANGULAR66, the reference region type X2' is a second reference region. And / or, if the angular intra prediction mode x2' is INTRA_ANGULAR21 to INTRA_ANGULAR49, the reference region type X2' is a third reference region. Optionally, the first reference region, the second reference region, and the third reference region are one of at least a portion of a region formed by a region adjacent to the left of the collocated adjacent luminance block but excluding a region adjacent above the collocated adjacent luminance block, a region adjacent above the collocated adjacent luminance block but excluding a region adjacent to the left of the collocated adjacent luminance block, and a region adjacent to the left of the collocated adjacent luminance block and a region adjacent above the collocated adjacent luminance block. Optionally, the first reference region, the second reference region and the third reference region are different from each other.
[0264] Optionally, when the value of the chroma reference region derivation flag Chroma_ref_region_deriv_flag1 is 0, it indicates that the processing device at the decoding end is prohibited from using the chroma block where the chroma sample to be predicted is located, or the chroma block adjacent to the chroma block to derive the type of the chroma reference region.
[0265] Optionally, based on the same principle, the processing device of the encoder can use the brightness reference region derivation flag luma_ref_region_deriv_flag1' in the process of performing brightness prediction for the brightness sample to be predicted to instruct the processing device at the decoding end to determine the type of the brightness reference region based on the brightness block where the brightness sample to be predicted is located, or the adjacent brightness block of the brightness block, and then determine the brightness reference region of the brightness sample to be predicted that needs to be predicted.
[0266] Optionally, based on the same principle, the processing device of the encoder can use the chroma reference region derivation flag Chroma_ref_region_deriv_flag1' in the process of performing luminance prediction for the luminance sample to be predicted to instruct the processing device at the decoding end to determine the type of chroma reference region based on the chroma block where the co-located chroma sample corresponding to the luminance sample to be predicted is located, or the adjacent luminance block of the chroma block, and then determine the chroma reference region of the luminance sample to be predicted that needs to be predicted.
[0267] In this embodiment, the processing device at the encoding end can first determine the reference area for deriving the weight coefficients of the CCCM model by judging the degree of similarity between the adjacent luminance / chrominance area above the area where the sample to be predicted is located, and / or the adjacent luminance / chrominance area to the left of the area where the sample to be predicted is located, and the luminance / chrominance area corresponding to (or co-located with) the area where the sample to be predicted is located, thereby achieving better encoding performance. After the processing device at the encoding end determines the reference area, it can transmit a flag to indicate the processing device at the decoding end, so that the processing device at the decoding end can autonomously derive the reference area for deriving the weight coefficients of the CCCM model from one of the following three types: the adjacent luminance / chrominance area above, the adjacent luminance / chrominance area to the left, and the area formed by combining (e.g., splicing) the adjacent luminance / chrominance area above and the adjacent luminance / chrominance area to the left.
[0268] Fourth embodiment
[0269] In this embodiment, the execution subject of the image processing method provided by this application can still be the above-mentioned processing device. In this embodiment, the above-mentioned step S1 can include the following steps:
[0270] S11: determining at least one parameter according to at least one reference region;
[0271] S12: Determine or obtain a prediction result of the sample to be predicted according to the parameters.
[0272] Optionally, after the processing device obtains or determines at least one reference region from any of the first reference region, the second reference region, or the third reference region, the processing device may further use the reference region to perform chroma prediction or luma prediction for the sample to be predicted. That is, the processing device first determines parameters of at least one intra-frame prediction model based on the obtained at least one reference region. In this way, the processing device may use the parameters and the corresponding intra-frame prediction model to perform calculations to determine or derive a chroma prediction result for the current chroma prediction for the sample to be predicted, or determine or derive a luma prediction result for the current luma prediction for the sample to be predicted.
[0273] Optionally, during chroma prediction for the sample to be predicted, the processing device determines a set of samples for each of at least one reference region of at least one reference region type. For at least one reference region, there is at least one set of samples, and each set of samples includes at least one sampling point. Then, the processing device determines the weight values corresponding to each set of samples when the loss function for each set of samples reaches a minimum. Finally, by comparing the degree of distortion of the predicted values under the weight values corresponding to each set of samples, the processing device determines the most suitable reference region from the at least one reference region of at least one reference region type.
[0274] Optionally, the parameters are weight parameters, filter coefficients, etc.
[0275] Formula (1) is now used for explanation. For example, for each of the first, second, and third luminance reference regions, seven chrominance reference samples are determined, each of which has predicted values predCa1 to predCa7 and reconstructed values recCa1 to recCa7 (the reconstructed values of the seven chrominance reference samples are known values). In one embodiment, the first luminance reference region may be the luminance reference region shown in FIG12a. The second luminance reference region may be the luminance reference region shown in FIG12b. The third luminance reference region may be the luminance reference region shown in FIG12c. The predicted values predCa1 to predCa7 are expressions related to Formula (1).
[0276] For example, in the luminance reference area shown in FIG12a , 7 luminance reference samples corresponding to the above-mentioned 7 chrominance reference samples are determined as luminance samples Ca1 to Ca7 in formula (1), and then the luminance samples Na1 to Na7, Sa1 to Sa7, Ea1 to Ea7, Wa1 to Wa7, and the values of the nonlinear terms Pa1 to Pa7 and the bias terms Ba1 to Ba7 around the selected 7 luminance samples are determined.
[0277] Then, the processing device further constructs a vector predC using predCa1 to predCa7, where predC = [predCa1, predCa2, predCa3, predCa4, predCa5, predCa6, predCa7] T , and, using recCa1~recCa7, construct vector recC, recC=[recCa1,recCa2,recCa3,recCa4,recCa5,recCa6,recCa7] T Optionally, the processing device characterizes the magnitude of the error e by a loss function L. Optionally, L = ||recC-predC|| 2 , and find the value of the weight corresponding to the minimum value of the loss function L (that is, the derivative of the loss function L is 0). For example, after substituting the values of the 7 luminance samples Ca1 to Ca7, the luminance samples Na1 to Na7, Sa1 to Sa7, Ea1 to Ea7, Wa1 to Wa7 around the 7 luminance samples, and the nonlinear terms Pa1 to Pa7 and the bias terms Ba1 to Ba7 into formula (1), the predicted values predCa1 to predCa7 are obtained as the expression of formula (1), and this expression is substituted into the loss function L = ||recC-predC|| 2 , and solve the values of the weight coefficients Ca1 to Ca7 in formula (1) when the loss function takes the minimum value. The weight coefficients Ca1 to Ca7 are the weight coefficients corresponding to the brightness reference area shown in Figure 12a (also called parameter w1).
[0278] The above method can further determine the corresponding weight coefficient (also referred to as parameter w2) of the luminance reference region shown in Figure 12b and the corresponding weight coefficient (also referred to as parameter w3) of the luminance reference region shown in Figure 12c. Next, by comparing the degree of distortion of the predicted values under the values of the corresponding weight coefficients (parameters w1 to w3) of each group of samples, the most suitable reference region is determined from multiple reference regions with multiple reference region types. For example, by comparing the values of the corresponding parameters w1 to w3 of each group of samples, the predicted values of the multiple co-located chroma samples corresponding to the multiple luminance samples in the luminance reference regions shown in Figures 12a to 12c are calculated using formula (1). Then, the absolute error sum (SAD) / Hadamard transformed absolute error sum (SATD) between the predicted values and the reconstructed values of these co-located chroma samples are compared to determine the degree of distortion of the predicted values of these co-located chroma samples corresponding to the luminance reference regions shown in Figures 12a to 12c. Finally, the brightness reference region corresponding to the minimum value of the sum of absolute difference (SAD) / the sum of absolute difference after Hadamard transformation (SATD) is determined among the brightness reference regions shown in FIG. 12 a to FIG. 12 c .
[0279] For example, if the absolute error sum corresponding to the luminance reference area of the template area shown in FIG12a is the minimum value among the absolute error sums corresponding to the luminance reference areas shown in FIG12a to FIG12c, since the luminance reference area shown in FIG12a includes the left reference area of the template area but does not include the upper reference area of the template area, the left luminance reference area of the image block where the sample to be predicted is located or the co-located image block of the image block (for example, the first luminance block) is used as the determined reference area, and the luminance reference area above the image block or the co-located image block of the image block is not used as the determined reference area. In other words, the reference area corresponding to the sample to be predicted includes the left luminance reference area of the image block or the co-located image block of the image block but does not include the upper luminance reference area of the image block or the co-located image block of the image block.
[0280] If the absolute error sum corresponding to the luminance reference area of the template area shown in FIG12b is the minimum value among the absolute error sums corresponding to the luminance reference areas shown in FIG12a to FIG12c, since the luminance reference area shown in FIG12b includes the upper reference area of the template area but does not include the left reference area of the template area, the upper luminance reference area of the image block where the sample to be predicted is located or the co-located image block of the image block (for example, the first luminance block) is used as the determined reference area, and the left luminance reference area of the image block or the co-located image block of the image block is not used as the determined reference area. In other words, the reference area corresponding to the sample to be predicted includes the upper luminance reference area of the image block or the co-located image block of the image block but does not include the left luminance reference area of the image block or the co-located image block of the image block.
[0281] If the absolute error sum corresponding to the luminance reference region of the template region shown in FIG12c is the minimum value among the absolute error sums corresponding to the luminance reference regions shown in FIG12a to FIG12c, since the luminance reference region shown in FIG12c includes the left reference region of the template region and the upper reference region of the template region, the region combined with the left luminance reference region and the upper region of the image block where the sample to be predicted is located or the co-located image block of the image block (e.g., the first luminance block) is used as the determined reference region. In other words, the reference region corresponding to the sample to be predicted includes the left luminance reference region and the upper luminance reference region of the image block or the co-located image block of the image block.
[0282] Finally, the weight coefficient used in prediction of the sample to be predicted is derived through the determined reference area, and inter-frame prediction is performed according to the derived weight coefficient.
[0283] Optionally, the above-described embodiments of the present invention may also be combined with Figures 13a and 13b. For example, a method similar to the above method may be used to determine the degree of distortion of the predicted values of the chroma samples in the chroma reference regions shown in Figures 13a to 13c. Subsequently, the chroma reference region corresponding to the minimum SAD / SATD value is determined within the chroma reference regions shown in Figures 13a to 13c.
[0284] For example, if the sum of absolute errors corresponding to the chrominance reference area of the template area shown in FIG13a is the minimum value among the sums of absolute errors corresponding to the chrominance reference areas shown in FIG13a to FIG13c, since the chrominance reference area shown in FIG13a includes the left reference area of the template area but does not include the upper reference area of the template area, the left chrominance reference area of the image block where the sample to be predicted is located or the co-located image block of the image block (for example, the first chrominance block) is used as the determined reference area, and the chrominance reference area above the image block or the co-located image block of the image block is not used as the determined reference area. In other words, the reference area corresponding to the sample to be predicted includes the left chrominance reference area of the image block or the co-located image block of the image block but does not include the chrominance reference area above the image block or the co-located image block of the image block.
[0285] If the sum of absolute errors corresponding to the chrominance reference area of the template area shown in FIG13b is the minimum value among the sums of absolute errors corresponding to the chrominance reference areas shown in FIG13a to FIG13c, since the chrominance reference area shown in FIG13b includes the upper reference area of the template area but does not include the left reference area of the template area, the upper chrominance reference area of the image block where the sample to be predicted is located or the co-located image block of the image block (for example, the first chrominance block) is used as the determined reference area, and the left chrominance reference area of the image block or the co-located image block of the image block is not used as the determined reference area. In other words, the reference area corresponding to the sample to be predicted includes the upper chrominance reference area of the image block or the co-located image block of the image block but does not include the left chrominance reference area of the image block or the co-located image block of the image block.
[0286] If the sum of absolute errors corresponding to the chrominance reference region of the template region shown in FIG13c is the minimum value among the sums of absolute errors corresponding to the chrominance reference regions shown in FIG13a to FIG13c, since the chrominance reference region shown in FIG12c includes the left reference region of the template region and the upper reference region of the template region, the region consisting of the left chrominance reference region and the upper chrominance region of the image block where the sample to be predicted is located or the co-located image block of the image block (e.g., the first chrominance block) is used as the determined reference region. In other words, the reference region corresponding to the sample to be predicted includes the left chrominance reference region and the upper chrominance reference region of the image block or the co-located image block of the image block.
[0287] Optionally, in this embodiment, the processing device selects predicted values and reconstructed values of seven chroma reference sampling points from the chroma reference region because seven equations can be constructed using the predicted values and reconstructed values of the seven chroma reference sampling points, thereby obtaining seven weight coefficients to be determined. That is, the number of selected chroma reference samples in the chroma reference region is the same as the number of weight coefficients to be determined.
[0288] Optionally, if a sample or an image block uses an angular intra prediction mode within a first angle range, the reference region type to be predicted is reference region type X'. In this embodiment, a weight coefficient for the sample to be predicted can be determined based on reference region type X', and a prediction result to be predicted can be determined or derived based on the determined weight coefficient.
[0289] Optionally, the above step S11: determining at least one parameter according to at least one reference area may include:
[0290] determining at least one of the parameters based on at least one reference sample in the reference area;
[0291] Optionally, in this embodiment, the position of the reference sample meets a preset position condition, and / or the value of the reference sample meets a preset value condition.
[0292] Optionally, the preset position condition may be: the position of the reference sample in the reference area is farther or farther away from the sample to be predicted (in one implementation, among the straight-line distances between all samples in the reference area and the sample to be predicted, the straight-line distance between the reference sample and the sample to be predicted is greater than or equal to a first preset threshold or a maximum. Optionally, the first preset threshold may be set based on the design needs of the actual application to be: any distance value greater than or equal to the width, height or diagonal distance of the image block where the sample to be predicted is located. Optionally, the width, height or diagonal distance of the image block may each be 64, 32 or 16, etc., corresponding to the width, height or diagonal distance of the coding unit used in VVC, HEVC or other coding standards). Optionally, the reference sample is located in the reference area. The position is close to or closest to the sample to be predicted (in one implementation, among the straight-line distances between all the samples in the reference area and the sample to be predicted, the straight-line distance between the reference sample and the sample to be predicted is less than or equal to a second preset threshold or a minimum. Optionally, the second preset threshold can be set to any distance value that is less than or equal to the sum of the widths, heights, or diagonal distances of N*N samples based on the design needs of the actual application, where N is the number of samples from the left edge of the reference area to the sample to be predicted in the horizontal direction, or the number of samples from the upper edge of the reference area to the sample to be predicted in the vertical direction. Optionally, N can be less than or equal to 4. Optionally, N can also be less than or equal to 1 / 2 or 1 / 3 of the width or height of the image block).
[0293] Optionally, the first preset threshold and the second preset threshold may be the same or different.
[0294] Optionally, the reference samples may be distributed at equal distances in the horizontal position and / or at equal distances in the vertical position in the reference area.
[0295] Optionally, the preset value conditions may be: the chromaticity value or luminance value of the reference sample in the reference area is the maximum chromaticity value or the maximum luminance value; optionally, the chromaticity value or luminance value of the reference sample in the reference area is the minimum chromaticity value or the minimum luminance value; optionally, the chromaticity value or luminance value of the reference sample in the reference area is near the N equally divided chromaticity values between the maximum chromaticity value and the minimum chromaticity value.
[0296] Optionally, when determining parameters from the above-mentioned chroma reference area, the processing device can determine the maximum chroma value, the minimum chroma value, and the chroma sampling of the average chroma value close to the maximum chroma value and the minimum chroma value from the chroma reference area to determine the parameters in the intra-frame prediction model based on the chroma sampling.
[0297] Alternatively, the average chromaticity value of the maximum chromaticity value and the minimum chromaticity value may be a 2-equally divided chromaticity value. Alternatively, based on the same principle, the average chromaticity value may also be two 3-equally divided chromaticity values between the maximum chromaticity value and the minimum chromaticity value, namely, (maximum chromaticity value - minimum chromaticity value) * 1 / 3 and (maximum chromaticity value - minimum chromaticity value) * 2 / 3. The same applies to the remaining N-equally divided chromaticity values.
[0298] Optionally, when determining parameters from a luminance reference area, the processing device may determine a luminance sample of a maximum luminance value, a brightest chrominance value, and an average luminance value close to the maximum luminance value and the minimum luminance value from the luminance reference area to determine parameters in an intra-frame prediction model based on the luminance sample.
[0299] Alternatively, the average brightness value of the maximum brightness value and the minimum brightness value can be a 2-way brightness value. Alternatively, based on the same principle, the average brightness value can also be: two 3-way brightness values between the maximum brightness value and the minimum brightness value, which are: (maximum brightness value - minimum brightness value) * 1 / 3, and (maximum brightness value - minimum brightness value) * 2 / 3. The same applies to the remaining N-way brightness values.
[0300] Optionally, in this embodiment, the above-mentioned step S12: determining or obtaining a prediction result of the sample to be predicted according to the parameter may include:
[0301] Determine or derive a prediction result of the sample to be predicted based on at least one of the parameters, at least one first sample, at least one adjacent sample of the first sample, at least one non-adjacent sample of the first sample, and at least one gradient component of the first sample.
[0302] Optionally, after determining the parameter from the above-mentioned reference area, the processing device can further substitute one or more of the parameter, the first sample corresponding to the parameter, at least one adjacent sample of the first sample, at least one non-adjacent sample of the first sample, and at least one gradient component of the first sample into the corresponding intra-frame prediction mode for calculation to determine or obtain the chrominance prediction result or luminance prediction result of the sample to be predicted.
[0303] Optionally, the processing device may use at least one intra prediction mode to determine a chroma prediction result or a luma prediction result of a sample to be predicted. Optionally, the at least one intra prediction mode may be at least one CCCM mode and / or at least one non-CCCM mode.
[0304] Optionally, as shown in FIG14 , the processing device at the decoding end can determine whether to use the CCCM mode by parsing the first flag. For example, if the first flag is 0, the CCCM mode is not used; and / or, if the first flag is 1, the CCCM mode is used. When the processing device determines that the CCCM mode is not used, the non-CCCM mode is used. In this case, the processing device further parses the second flag to determine which non-CCCM mode to use (e.g., the first non-CCCM mode). Next, the processing device can use the first non-CCCM mode to determine the chroma prediction result or the luma prediction result of the sample to be predicted. In another case, if the processing device determines to use the CCCM mode, it also further parses the third flag to determine which CCCM mode to use (e.g., the first CCCM mode). Next, the processing device can use the first CCCM mode and substitute the above parameters to determine the chroma prediction result or the luma prediction result of the sample to be predicted.
[0305] Optionally, the processing device may also use other prediction models other than the prediction model shown in the above formula (1) to determine or derive the predicted value of the sample to be predicted. For example, the processing device may determine the predicted value of the sample to be predicted based on the prediction model shown in the following formula (3) and / or formula (4). predChromaVal = c0*C+c1*Gy+c2*Gx+c3*Y+c4*X+c5*P+c6*B Formula (3)
[0306] Where Gy = (2N + NW + NE) – (2S + SW + SE), Gx = (2W + NW + SW) – (2E + NE + SE). Y is the vertical position of the luminance / chrominance sample C corresponding to the sample to be predicted, and X is the horizontal position of the luminance / chrominance sample C corresponding to the sample to be predicted. P is a nonlinear term, which is expressed as the square of the luminance / chrominance sample C corresponding to the sample to be predicted, and is scaled to the bit depth range. That is, P = (C*C + midVal) >> bitDepth; bitDepth is the bit depth corresponding to the sample, and ">>" is the right shift sign. For example, for 10-bit video content, P is calculated as "P = (C*C + 512) >> 10". B is a bias term, which represents a scalar offset between the input and output. In the video coding standard, it is set to the chrominance value 512 for 10-bit video content. predChromaVal=c0*C+c1*L1+c2*L2+c3*A1+c4*A2+c5*P+c6*B Formula (4)
[0307] Among them, L1 is the brightness sample adjacent to the left of the brightness sample corresponding to the sample to be predicted, L2 is the brightness sample on the edge of the brightness block adjacent to the left side of the current sample to be predicted, and the brightness sample corresponding to the brightness sample to be predicted is in the horizontal direction, A1 is the brightness sample adjacent to the brightness sample corresponding to the sample to be predicted, and L2 is the brightness sample on the edge of the brightness block adjacent to the top of the current sample to be predicted, and the brightness sample corresponding to the brightness sample to be predicted is in the vertical direction.
[0308] Optionally, L1 is the chroma sample adjacent to the left of the chroma sample corresponding to the sample to be predicted, L2 is the chroma sample on the edge of the chroma block adjacent to the left side of the current sample to be predicted, and the chroma sample corresponding to the sample to be predicted is in the horizontal direction, A1 is the chroma sample adjacent to the chroma sample corresponding to the sample to be predicted, and L2 is the chroma sample on the edge of the chroma block adjacent to the top of the current sample to be predicted, and the chroma sample corresponding to the sample to be predicted is in the vertical direction.
[0309] In this embodiment, the processing device predicts and calculates the chrominance / luminance of the sample to be predicted by selecting modes corresponding to different gradient algorithms, thereby further improving the accuracy of chrominance prediction for image blocks during the image encoding and decoding process. Optionally, the processing device can also improve the calculation process of the gradient component in the formula for calculating the predicted chrominance / luminance value in the CCCM to utilize the luminance / chrominance samples to the left, above, and / or above-left of the co-located luminance / chrominance sample to calculate the gradient component. In this way, the processing device can still calculate the gradient component for chrominance prediction even when the luminance / chrominance samples to the right, below, and / or below-right of the co-located luminance / chrominance sample are unavailable. Optionally, the processing device can also calculate the predicted value of the sample to be predicted sample by sample. For example, the processing device does not need to wait until all samples in the current luminance block are calculated (at least all luma samples are calculated) before sequentially calculating the sample values of the chrominance blocks corresponding to the current luminance block. Instead, the processing device can calculate the chrominance sample values corresponding to a luma sample value immediately after calculating the luma sample value of the current luminance block.
[0310] An embodiment of the present application further provides a processing device, including a memory and a processor. The memory stores an image processing program, and when the image processing program is executed by the processor, the steps of the image processing method in any of the above embodiments are implemented.
[0311] The present application also provides a storage medium on which an image processing program is stored. When the image processing program is executed by a processor, the steps of the image processing method in any of the above embodiments are implemented.
[0312] In the embodiments of the smart terminal and storage medium provided in this application, all technical features of any of the above-mentioned image processing method embodiments may be included. The expanded and explained contents of the specification are basically the same as those of the embodiments of the above-mentioned methods and will not be repeated here.
[0313] An embodiment of the present application further provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer executes the methods in the various possible implementation modes described above.
[0314] An embodiment of the present application also provides a chip, including a memory and a processor, wherein the memory is used to store computer programs, and the processor is used to call and run the computer programs from the memory, so that a device equipped with the chip executes the methods in the various possible implementation modes as described above.
[0315] It is understood that the above scenarios are merely examples and do not limit the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, those skilled in the art will appreciate that with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application will also be applicable to similar technical problems.
[0316] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0317] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.
[0318] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.
[0319] In this application, the same or similar terminology, technical solutions and / or application scenario descriptions are generally only described in detail the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, for the same or similar terminology, technical solutions and / or application scenario descriptions that are not described in detail later, you can refer to the previous relevant detailed descriptions.
[0320] In this application, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0321] The various technical features of the technical solution of this application can be combined arbitrarily. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0322] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as mentioned above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the method of each embodiment of the present application.
[0323] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a storage medium or transmitted from one storage medium to another storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a storage disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state storage disk Solid State Disk (SSD)).
[0324] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An image processing method, wherein: Includes steps: S1: Determine or obtain a prediction result of a sample to be predicted according to at least one reference area.
2. The method of claim 1, wherein: The method of obtaining or determining the reference area includes at least one of the following: Acquire or determine from a left adjacent area or an upper adjacent area of an image block where the sample to be predicted or a co-located sample of the sample to be predicted is located; Acquire or determine from the left adjacent area and the upper adjacent area of the image block where the sample to be predicted or the co-located sample of the sample to be predicted is located; Acquire or determine according to a preset sign; Acquire or determine based on template area; If the intra prediction mode adopted by the co-located sample and / or the adjacent sample of the sample to be predicted is an angular intra prediction mode, the angle is obtained or determined according to the intra angle corresponding to the angular intra prediction mode.
3. The method of claim 2, wherein: Also includes at least one of the following: The flag is parsed from the encoded bit stream; The acquiring or determining the reference area according to the preset flag includes: acquiring or determining the reference area of the value mapping according to the value of the flag; The acquiring or determining the reference area according to the angle in the frame includes: acquiring or determining the reference area according to the angle range in which the angle in the frame is located.
4. The method of claim 3, wherein: Also includes at least one of the following: The value includes a first value and / or a second value; The acquiring or determining according to the template area includes: if the value is a third value, determining the reference area according to the template area.
5. The method of claim 4, wherein: The determining the reference area according to the template area comprises: Acquire or determine a first parameter and / or a second parameter from the template area; The reference area is acquired or determined according to the first parameter and / or the second parameter.
6. The method of claim 5, wherein: The acquiring or determining the reference area according to the first parameter and / or the second parameter includes: The reference area is acquired or determined according to a positional relationship between an area corresponding to the first parameter in the template area and the template area.
7. The method of claim 1, wherein: The step S1 comprises the steps of: S11: determining at least one parameter according to at least one reference area; S12: Determine or obtain a prediction result of the sample to be predicted according to the parameters.
8. The method of claim 7, wherein: Step S11 includes: determining at least one of the parameters based on at least one reference sample in the reference area; And / or, step S12 includes: A prediction result of the sample to be predicted is determined or derived according to at least one of the parameters, at least one first sample, at least one adjacent sample of the first sample, at least one non-adjacent sample of the first sample, and at least one gradient component of the first sample.
9. A processing device, wherein: include: A memory and a processor, wherein an image processing program is stored in the memory, and when the image processing program is executed by the processor, the steps of the image processing method according to any one of claims 1 to 8 are implemented.
10. A storage medium, wherein: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image processing method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Method for decoding image on basis of CCLM prediction in image coding system, and device therefor
CN111587574A
Intra prediction-based video encoding / decoding method and device
CN113261282A
Chrominance linear prediction method and device based on position weighting, equipment and medium
CN113365067A
Video coding and decoding method and device
CN114503570A
Image processing method, processing equipment and storage medium
CN115988206A
Cited By
Prediction method and apparatus, and device
WO2026223718A1
