Processing method, processing device and storage medium
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2026-04-02
AI Technical Summary
In existing video coding standards, the prediction performance for complex texture regions of video frames is not ideal, resulting in poor encoding and decoding quality.
By determining the prediction mode of the current block based on the gradient information of the reference area, and using the gradient information to match a suitable prediction mode, the prediction accuracy of complex texture regions can be improved.
It improves the prediction accuracy in the video encoding and decoding process, thereby enhancing the encoding and decoding quality.
Smart Images

Figure CN2025101883_02042026_PF_FP_ABST
Abstract
Description
Processing method, processing device and storage medium TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a processing method, a processing device and a storage medium. BACKGROUND
[0002] The existing video coding standard (H.266 / VVC) proposes a coding technology for video frames, for example, when coding and decoding a video frame, the protocol divides each frame into different blocks and performs prediction processing and coding and decoding processing.
[0003] In the process of conceiving and implementing the present application, the inventors found that at least the following problems exist: in the intra prediction and / or inter prediction process, the prediction effect for the texture complex region of the current block is not ideal, which further causes poor coding and decoding quality in the video coding and / or decoding process.
[0004] The foregoing narrative is to provide general background information and does not necessarily constitute prior art. SUMMARY
[0005] To solve the above technical problems, the present application provides a processing method, a processing device and a storage medium, which can match at least one suitable prediction mode for the current block according to the gradient information of at least one reference region, and can support improving the prediction accuracy of the current block and / or the texture complex region of the current block.
[0006] The present application provides a processing method, which can be applied to a processing device, comprising the steps of:
[0007] S10, determining or obtaining at least one prediction mode of the current block according to the gradient information of at least one reference region.
[0008] Optionally, the gradient information includes first gradient information and / or second gradient information.
[0009] Optionally, the gradient information is determined or obtained according to at least one gradient operator.
[0010] Optionally, the at least one prediction mode is determined or obtained according to at least one of the following:
[0011] The gradient information of the target pixel in the at least one reference region;
[0012] At least one gradient histogram;
[0013] At least one candidate mode;
[0014] The position distribution of the gradient information of the at least one reference region;
[0015] The position distribution of the target pixel in the at least one reference region;
[0016] the adjusted gradient information of the at least one reference region.
[0017] Optionally, the processing method further comprises at least one of the following:
[0018] the gradient histogram is determined or obtained according to the gradient information of the at least one reference region;
[0019] the candidate mode is determined or obtained according to the gradient information of the at least one reference region of the current block;
[0020] the adjusted gradient information is determined or obtained according to the first weight;
[0021] the at least one prediction mode is determined or obtained according to the position distribution of the target gradient information of the at least one reference region;
[0022] the target pixel is determined or obtained according to at least one of the following:
[0023] the size of the current block;
[0024] the position information of the pixel in the at least one reference region;
[0025] the gradient direction of the pixel in the at least one reference region;
[0026] the gradient direction corresponding to the prediction mode of the preset angle range.
[0027] Optionally, the processing method further comprises at least one of the following:
[0028] the first weight is determined or obtained according to the position distribution of the gradient information of the at least one reference region and / or the position distribution of the target pixel;
[0029] the target gradient information is determined or obtained according to the size of the current block and / or the target pixel.
[0030] Optionally, the mode indexes of the candidate mode corresponding to the first gradient information and the candidate mode corresponding to the second gradient information are adjacent.
[0031] Optionally, the at least one prediction mode of the current block is determined or obtained according to the adjusted first gradient information and / or the adjusted second gradient information.
[0032] Optionally, the adjusted first gradient information corresponds to the first gradient information determined or obtained by the second weight information; and / or, the adjusted second gradient information corresponds to the second gradient information determined or obtained by the third weight information.
[0033] Optionally, the at least one reference region is determined or obtained according to at least one of the following:
[0034] at least one of an above neighboring pixel, an above non-neighboring pixel, a left neighboring pixel, a left non-neighboring pixel, a top-left neighboring pixel, and a top-left non-neighboring pixel of the current block;
[0035] at least one of a neighbor block, a non-neighbor block, a collocated block, a temporal block, and a default block corresponding to the current block;
[0036] at least one of a width, a height, a block size, and a block area of the current block;
[0037] a candidate block.
[0038] The application further provides a processing device, comprising a memory and a processor, wherein the memory stores a processing program, and the processing program, when executed by the processor, implements the steps of any of the processing methods.
[0039] The application further provides a storage medium, wherein the storage medium stores a computer program, and the computer program, when executed by a processor, implements the steps of any of the processing methods.
[0040] As described above, the processing method of the application can be applied to a processing device, comprising determining or obtaining at least one prediction mode of a current block according to gradient information of at least one reference region of the current block. Through the technical solution of the application, the spatial correlation between the current block and at least one reference region of the current block and / or the directionality and continuity features carried by the trend of pixel value change in the reference region can be determined according to the gradient information of the at least one reference region of the current block, and then a suitable at least one prediction mode can be matched for the current block, which can support improving the prediction accuracy of the current block and / or a texture complex region of the current block. BRIEF DESCRIPTION OF DRAWINGS
[0041] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the application and, together with the description, function to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the application, the drawings needed to be used in the embodiment description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
[0042] FIG. 1 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the application;
[0043] FIG. 2 is a schematic diagram of a communication network system architecture provided by an embodiment of the application;
[0044] FIG. 3 is a schematic diagram of a hardware structure of a controller 140 provided by the application;
[0045] FIG. 4 is a schematic diagram of a hardware structure of a network node 150 provided by the application;
[0046] Fig. 5 is a flowchart of a processing method according to the first embodiment;
[0047] Fig. 6 is a diagram of an intra prediction direction according to the first embodiment;
[0048] Fig. 7 is a diagram of an encoding process of an encoder in the image processing method according to the first embodiment;
[0049] Fig. 8 is a diagram of a decoding process of a decoder in the image processing method according to the first embodiment;
[0050] Fig. 9 is a diagram of a reference region of a DIMD mode in the processing method according to the second embodiment;
[0051] Fig. 10 is a diagram of a gradient amplitude in the processing method according to the second embodiment;
[0052] Fig. 11 is a diagram of a reference region corresponding to a block to be predicted in the image processing method according to the second embodiment;
[0053] Fig. 12 is a diagram of a reference region of a neural network model in the processing method according to the second embodiment;
[0054] Fig. 13 is a diagram of a structure of a neural network model based on a full connection layer according to the second embodiment;
[0055] Fig. 14 is a diagram of a structure of a neural network model based on a convolution layer according to the second embodiment;
[0056] Fig. 15 is a diagram of a structure of a neural network model based on a hybrid convolution and full connection layer according to the second embodiment;
[0057] Fig. 16 is a diagram of a processing module of a processing apparatus.
[0058] The implementation, functional features and advantages of the present application will be further described with reference to the embodiments and the accompanying drawings. The above-mentioned drawings have shown the specific embodiments of the present application, and the following detailed description will be more specific. These drawings and the detailed description are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0059] The exemplary embodiments will be described in detail herein with reference to a few examples. The description herein, in connection with the appended drawings, is intended to convey principles of the exemplary embodiments, and not specific operation procedures or details, as some implement details are not known at this time. It will be appreciated that the description herein and disclosed elements and / or methods can be modified in various manners. Such modifications are intended to fall within the scope of the present application. Also, it will be appreciated that the
[0060] It has to be noted that, as used herein, the terms "includes" and / or "containing", "has", "having", "comprises" and / or "comprising", "involving", "including" or "including" or "consisting of" are used in the sense of "including", but do not exclude other elements. In other words, the terms "includes", "including", "has", "having", "comprises", "comprising", "involving", "including" or "consisting of" should be construed as specifying the presence of stated features or steps but not precluding the presence of one or more other features or steps. It is further noted that the claims can be drafted to exclude any elements or steps. Thus, no element or step can be present in the claims unless it is specifically recited.
[0061] It is to be understood that the singular forms "a", "an", and "the" include plural referents unless the context clearly dictates otherwise. It is further understood that the terms "comprising", "including", "containing", "characterized by" and / or "comprising" when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, and / or groups but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, items, and / or groups thereof. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items. Expressions like "at least one of A and B" when preceding a list of two or more items, cover all examples of that list (e.g. A or B; A and B; A and C; A, B, and C; etc.). Expressions connecting a list of elements preceded by "one of X, Y, and Z," are to be understood to cover all possible combinations of the elements in the list, e.g., only X; only Y; only Z; X and Y; X and Z; Y and Z; or X, Y, and Z. Only under circumstances where a combination of elements, functions, steps, or operations are inherently mutually exclusive are they "each house" one another.
[0062] It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and can be executed in other sequences. Moreover, at least part of the steps in the figures can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0063] Depending on the context, the word "if" as used herein can be interpreted as meaning "when" or "while" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if it is determined" or "if (a stated condition or event) is detected" can be interpreted as meaning "when it is determined" or "in response to determining" or "when (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)".
[0064] It should be noted that, in the present document, step codes such as S10 are used for the purpose of more clearly and briefly expressing the corresponding content, and do not constitute a substantial limitation in sequence.
[0065] It should be understood that the specific embodiments described herein are merely intended to explain the present application, and do not limit the present application.
[0066] In the following description, the suffixes such as "module", "part", or "unit" used for an element are merely intended for facilitating explanation of the present application, and do not have specific meanings or meanings by themselves. Therefore, "module", "part", or "unit" can be mixedly used.
[0067] The processing device can be implemented in various forms, for example, the processing device described in the present application can include a processing device such as a mobile phone, a server, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and a fixed terminal such as a digital TV, a desktop computer.
[0068] In the following description, a mobile terminal will be exemplarily described, and those skilled in the art will understand that the configuration according to the embodiments of the present application can also be applied to a terminal of a fixed type, except for elements particularly used for mobile purposes.
[0069] Referring to FIG. 1, a hardware structure of a mobile terminal to implement various embodiments of the present application can include a 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, etc. It is understood by those skilled in the art that the structure of the mobile terminal shown in FIG. 1 does not limit the mobile terminal, and the mobile terminal can include more or less components than those shown, or some components can be combined, or different components can be arranged.
[0070] The components of the mobile terminal will be described in detail with reference to FIG. 1.
[0071] The RF unit 101 can be used for receiving and transmitting signals in the process of information transmission or communication. Specifically, the RF unit 101 receives downlink information from a base station and processes the received downlink information for the processor 110, and / or 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, etc. In addition, the RF unit 101 can communicate with a network and other devices through wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for 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), 5G and 6G, etc.
[0072] The WiFi belongs to a short-range wireless transmission technology, and the mobile terminal can help the user to send and receive e-mails, browse web pages, and access streaming media, etc. through the WiFi module 102, which provides the user with wireless broadband Internet access. Although the WiFi module 102 is shown in FIG. 1, it is understood that it does not belong to the necessary components of the mobile terminal, and can be omitted as needed without changing the essence of the application.
[0073] The audio output unit 103 can convert audio data, which is received by the radio frequency 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 call mode, a recording mode, a voice recognition mode, a broadcast reception mode, and the like. Also, the audio output unit 103 can provide audio output related to a particular function (e.g., call signal reception sound, message reception sound, etc.) performed by the mobile terminal 100. The audio output unit 103 can include a speaker, a buzzer, and the like.
[0074] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 can include a graphics processor (GPU) 1041 and a microphone 1042. The graphics processor 1041 processes image data of a still picture or a video obtained by an image capture device (e.g., a camera) in a video call mode or an image call mode. The processed image frames can be displayed on the display unit 106. The image frames processed by the graphics processor 1041 can be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) in a call mode, a recording mode, a voice recognition mode, and the like via the microphone 1042, and can process the sound into audio data. The processed audio (voice) data can be converted into a format transmittable to a mobile communication base station in a call mode and outputted via the radio frequency unit 101. The microphone 1042 can implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the process of receiving and transmitting audio signals.
[0075] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. The light sensor includes an ambient light sensor and a proximity sensor, which can optionally adjust the brightness of the display panel 1061 according to the brightness of ambient light, and turn off the display panel 1061 and / or the backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and detect the magnitude and direction of gravity when at rest, which can be used for applications such as identifying the posture of the mobile phone (such as switching between landscape and portrait screens, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometers, taps), and the like. As for the fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor and other sensors that can be configured on the mobile phone, they will not be described here.
[0076] The display unit 106 is configured to display information input by a user or information provided to the user. The display unit 106 can include a display panel 1061, which can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0077] The user input unit 107 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the mobile terminal. The user input unit 107 can 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 (such as user operations on or near the touch panel 1071 using a finger, a stylus, or any suitable object or accessory) and drive the corresponding connection device according to the pre-set program. The touch panel 1071 can include a touch detection device and a touch controller. The touch detection device detects the user's touch position and detects the signals generated by the touch operation, and transmits the signals to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch coordinates, and sends it to the processor 110, and can receive commands from the processor 110 and execute them. In addition, the touch panel 1071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 can also include other input devices 1072. The other input devices 1072 can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, on / off keys, etc.), trackballs, mice, joysticks, and the like, without limitation.
[0078] Optionally, the touch panel 1071 can cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or in the vicinity thereof, transmits to the processor 110 to determine the type of touch event, and then the processor 110 provides corresponding visual output on the display panel 1061 according to the type of touch event. Although in FIG. 1, the touch panel 1071 and the display panel 1061 are implemented as two independent components to realize the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal, which is not limited here.
[0079] 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 can include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 108 can be used to receive input (e.g., data information, power, etc.) from the external device and to transmit the received input to one or more elements within the mobile terminal 100, or can be used to transmit data between the mobile terminal 100 and the external device.
[0080] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a storage program area and a storage data area, and optionally, the storage program area can store operating systems, application programs (such as sound play functions, image play functions, etc.) required by at least one function, etc.; the storage data area can store data (such as audio data, phone books, etc.) created according to the use of the mobile phone, etc. In addition, the memory 109 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.
[0081] The processor 110 is the control center of the mobile terminal, connects all parts of the mobile terminal through various interfaces and lines, executes various functions of the mobile terminal and processes data by running or executing software programs and / or modules stored in the memory 109, and calling data stored in the memory 109, thereby overall monitoring the mobile terminal. The processor 110 can include one or more processing units; preferably, the processor 110 can integrate an application processor and a modem processor, and optionally, the application processor mainly processes operating systems, user interfaces and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 110.
[0082] The mobile terminal 100 can further include a power supply 111, such as a battery, for powering the various components of the mobile terminal 100. Preferably, the power supply 111 is configured to receive power from a power management system that is logically connected to the processor 110, and which is configured to manage charging, discharging, and power consumption management, among other things.
[0083] Although not shown in FIG. 1, the mobile terminal 100 can further include a Bluetooth module, etc., which will not be described herein.
[0084] In order to facilitate understanding of the embodiments of the present application, the communication network system based on which the mobile terminal of the present application is described as follows.
[0085] Referring to FIG. 2, FIG. 2 is a diagram illustrating an architecture of a communication network system according to an embodiment of the present application. The communication network system is a LTE system of the 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.
[0086] Optionally, the UE 201 can be the terminal 100 described above, which will not be described herein.
[0087] The E-UTRAN 202 includes an eNode B 2021 and other eNode Bs 2022. Optionally, the eNode B 2021 can be connected to the other eNode Bs 2022 through a backhaul (for example, an X2 interface). The eNode B 2021 is connected to the EPC 203, and can provide access for the UE 201 to the EPC 203.
[0088] The EPC 203 can 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, and the like. Optionally, the MME 2031 is a control node for processing signaling between the UE 201 and the EPC 203, and provides bearer and connection management. The HSS 2032 is configured to provide some registers to manage functions such as a home location register (not shown in the figure), and stores some user-specific information about service features, data rates, and the like. All user data can be transmitted through the SGW 2034, the PGW 2035 can provide IP address allocation for the UE 201 and other functions, and the PCRF 2036 is a policy and charging control policy decision point for service data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function unit (not shown in the figure).
[0089] The IP service 204 can include the Internet, an intranet, an IMS (IP Multimedia Subsystem), or other IP services, and the like.
[0090] Although the above describes the LTE system as an example, those skilled in the art should know that the present application is not only applicable to the LTE system, but also applicable to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, 5G, and future new network systems (such as 6G), and the like, which are not limited here.
[0091] FIG. 3 is a schematic diagram of a hardware structure of a controller 140 provided by the present application. The controller 140 includes a memory 1401 and a processor 1402, the memory 1401 is configured to store program instructions, and the processor 1402 is configured to invoke the program instructions in the memory 1401 to execute the steps performed by the controller in the above method embodiment one, the implementation principles and beneficial effects are similar, and will not be described here.
[0092] Optionally, the above controller further includes a communication interface 1403, which can be connected with the processor 1402 through a bus 1404. The processor 1402 can control the communication interface 1403 to realize the functions of receiving and sending of the controller 140.
[0093] Fig. 4 is a schematic diagram of a hardware structure of a network node 150 according to an embodiment of the present application. The network node 150 comprises a memory 1501 and a processor 1502. The memory 1501 is configured to store program instructions. The processor 1502 is configured to invoke the program instructions stored in the memory 1501 to execute the steps performed by the first node in the method embodiment one described above. The implementation principle and the beneficial effects are similar, and will not be described here in detail.
[0094] Optionally, the controller further comprises a communication interface 1503, which can be connected with the processor 1502 through the bus 1504. The processor 1502 can control the communication interface 1503 to realize the receiving and sending functions of the network node 150.
[0095] The integrated modules implemented in the form of software function modules described above can be stored in a computer readable storage medium. The software function modules described above are stored in a storage medium, and include a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute part of the steps of the method embodiments of the present application.
[0096] In the above embodiments, all or part of the embodiments can be realized by software, hardware, firmware or any combination thereof. When realized by software, all or part of the embodiments can be realized 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, all or part of the processes or functions according to the embodiments of the present application are generated. 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 transferred from one storage medium to another storage medium, for example, the computer instructions can be transferred from one website site, computer, server or data center to another website site, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode. The storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk, SSD), etc.
[0097] First embodiment
[0098] Referring to Fig. 5, Fig. 5 is a flowchart of a processing method according to the first embodiment. The processing method of the embodiment of the present application can be applied to a processing device, comprising the following steps S10:
[0099] In step S10, at least one prediction mode of the current block is determined or obtained according to gradient information of at least one reference region.
[0100] In the embodiment, the processing device can be a smart terminal such as a mobile phone, a computer, etc., or a server such as a local server or a cloud server. In the embodiment and the present application, the processing device is mainly exemplified as a smart terminal.
[0101] Optionally, the technical solution of the embodiment can be applied to the fields of image coding, video coding, hardware video coding, special circuit video coding, real-time video coding, etc.
[0102] Optionally, the processing device can obtain video image data from a video source, segment each frame of image in the video image data to obtain at least one image block, and determine an image block to be predicted in the at least one image block as the current block.
[0103] Optionally, the gradient information includes a gradient direction and / or a gradient amplitude. The gradient direction represents a direction in which a gray value at a certain pixel point in an image (for example, at least one reference region) changes most quickly, that is, a direction perpendicular to an edge. The gradient amplitude represents an intensity of the gray value change at the pixel point, that is, a degree of saliency of the edge.
[0104] Optionally, the reference region includes at least one reference region of the current block. The reference region refers to a group of adjacent pixels surrounding the current block. These adjacent pixels can provide important clues about edges and texture directions of the block to be predicted. Therefore, the spatial correlation between the current block and the at least one reference region and / or the directionality and continuity features carried by the trend of pixel value change in the reference region can be determined according to the gradient information of the at least one reference region, so as to match a suitable at least one prediction mode for the current block, which can support improving the prediction accuracy of the current block and / or a texture complex region of the current block.
[0105] Optionally, the reference region includes at least one of a reference pixel, a reference block, and a reference template.
[0106] Optionally, the at least one prediction mode of the current block determined or obtained includes at least one of an angle prediction mode (for example, a non-wide angle mode), a non-angle prediction mode, a wide angle mode, and a derivation mode.
[0107] Optionally, the angular prediction mode (e.g., non-wide angle mode) is a technique for predicting a current pixel block by propagating the values of neighboring pixels along a certain direction to generate a prediction block, which is mainly used to handle directional texture in images, can effectively reduce spatial redundancy and improve compression efficiency, in the H.265 / HEVC (High Efficiency Video Coding) standard, there are 33 angular prediction modes in the intra prediction mode, which cover different angles from horizontal to vertical direction, ensuring accurate prediction of various texture directions, in the H.266 / VVC (Versatile Video Coding) standard, the angular mode is expanded to 65, and new directions are more intensive to more accurately capture edges in natural video.
[0108] Optionally, the non-angular prediction mode can be a prediction mode other than the angular prediction mode, for example, the non-angular prediction mode includes at least one of the following: DC mode (direct current mode), Planar mode (planar mode), neural network-based prediction mode.
[0109] Optionally, the wide angle mode is an extension technique of intra prediction in video coding standards, aiming to more accurately match the complex texture direction in the image by increasing the number of prediction directions and the range of angles, thereby improving compression efficiency, the non-wide angle mode of traditional intra prediction (such as H.265 / HEVC) usually covers 45°-225° directions in a counterclockwise direction with 0° direction as horizontal left, and the wide angle mode further expands the range of directions, as shown in FIG. 6, FIG. 6 describes 93 intra prediction directions, and the dashed direction corresponds to the wide angle mode applicable to non-square blocks.
[0110] Optionally, the prediction directions of the non-wide angle mode and the wide angle mode are opposite.
[0111] Optionally, the wide angle mode includes an angular prediction mode opposite to the direction of the non-wide angle mode.
[0112] Optionally, the non-wide angle mode includes an angular prediction mode covering a first angle range in a counterclockwise direction, and the wide angle mode includes an angular prediction mode covering a second angle range in a counterclockwise direction.
[0113] Optionally, the first angle range and the second angle range are different, and the first angle range and the second angle range are adjacent in the counterclockwise direction or the counterclockwise direction.
[0114] Optionally, the derivation mode is a mode used for deriving the intra prediction mode, and the derivation mode is a method of deriving the prediction mode matched by the current block by analyzing the related information of the current block. For example, the derivation mode includes at least one of the following: a decoder side intra mode derivation (DIMD) mode, an occurrence-based intra coding mode derivation (OBIC) mode, and a template-based intra mode derivation (TIMD) mode.
[0115] Optionally, the processing method of the embodiments of the present application can be an improved DIMD mode. At least one prediction mode of the current block is determined or obtained according to gradient information of at least one reference region of the current block. The current block is predicted according to the at least one prediction mode, and a prediction result of the current block is determined or obtained.
[0116] Optionally, a target prediction result of the current block is determined or obtained according to at least one prediction result of the current block determined or obtained by predicting the current block according to the at least one prediction mode.
[0117] Optionally, the target prediction result of the current block can be determined or obtained by fusion processing of at least one prediction result of the current block. The fusion processing can include weighted fusion. Through fusion, the advantages of different prediction modes can be combined to improve the prediction accuracy.
[0118] Optionally, the weighted fusion refers to assigning different weight information (for example, a fourth weight) to at least one prediction result according to the confidence of the at least one prediction result and / or the confidence of at least one prediction mode corresponding to the at least one prediction result, and performing fusion based on the fourth weight. For example, if the confidence of a prediction result and / or the corresponding prediction mode is higher, the prediction result can be given a higher weight ratio. If the confidence of a prediction result and / or the corresponding prediction mode is lower, the prediction result can be given a lower weight ratio.
[0119] Optionally, the fourth weight and / or the weight information can include at least one of a weight coefficient, a weight vector, and a weight matrix.
[0120] Optionally, the confidence of at least one prediction result and / or the confidence of at least one prediction mode corresponding to the at least one prediction result is in a positive proportional relationship and / or a positive correlation with the weight information (for example, the fourth weight) of the at least one prediction result.
[0121] Optionally, the fourth weight can be proportional information of a contribution of at least one prediction result to a target prediction result, for example, the fourth weight can be a weight coefficient.
[0122] Optionally, the fourth weight can also be a weight vector, a weight matrix, etc. containing weight coefficients, indicating indication information for measuring the proportion of different elements (e.g., prediction values) in the result or decision.
[0123] Optionally, the fourth weight is determined or obtained according to matching information of at least one prediction mode related to at least one reference region of the current block, for example, the fourth weight of the prediction result corresponding to the prediction mode A is determined or obtained according to matching information of the prediction mode A related to at least one reference region of the current block.
[0124] Optionally, the matching information refers to information for evaluating the matching degree between different prediction modes and reference regions and their corresponding current blocks. The matching information can be based on various indicators such as rate-distortion cost of prediction results, prediction error, texture similarity, etc. to indicate the matching degree between different prediction modes and reference regions.
[0125] Optionally, the matching degree corresponding to the matching information and the fourth weight are in a positive proportional relationship and / or a positive correlation. If the matching degree corresponding to the matching information related to the prediction mode is higher, the weight value of the fourth weight information corresponding to the prediction mode is larger; and / or, if the matching degree corresponding to the matching information related to the prediction mode is lower, the weight value of the fourth weight information corresponding to the prediction mode is smaller.
[0126] Optionally, the matching information includes SAD (Sum of Absolute Differences), SATD (Sum of Absolute Transformed Differences), and / or MRSAD (Mean-Removed Sum of Absolute Differences). Optionally, the smaller the SAD value, the SATD value, and / or the MRSAD value, the higher the matching degree; and / or, the larger the SAD value, the SATD value, and / or the MRSAD value, the lower the matching degree.
[0127] Optionally, at least one gradient histogram determined or obtained according to gradient information of at least one reference region is used to determine or obtain at least one prediction mode of the current block and its corresponding fourth weight.
[0128] Optionally, the matching information includes the gradient amplitude value or the sum of the corresponding gradient amplitude values of the prediction mode in the gradient histogram.
[0129] Optionally, the greater the gradient magnitude value, the higher the matching degree; and / or the smaller the gradient magnitude, the lower the matching degree.
[0130] Optionally, the matching information comprises confidence information, and optionally, the greater the confidence, the higher the matching degree; and / or the smaller the confidence, the lower the matching degree.
[0131] Referring to FIG. 7, when the processing device is an encoder at the encoding side, the encoder can receive video source input video data, such as the encoder receiving video images from a video source, determine a to-be-predicted image in the video images, divide the to-be-predicted image into at least one image block, perform prediction processing on each of the at least one image block by using the temporal and / or spatial correlation between the video images, including intra-prediction processing and / or inter-prediction processing, and the intra-prediction processing and / or the inter-prediction processing comprises derivation of at least one prediction mode and / or at least one prediction mode, for the prediction mode, the encoder determines a prediction mode finally adopted by each of the at least one image block by using, for example, a rate-distortion cost, for example, calculating a rate-distortion cost corresponding to each prediction mode or a rate-distortion cost in a manner of combining several prediction modes, to determine a minimum rate-distortion cost from the at least one rate-distortion cost, and the prediction mode corresponding to the minimum rate-distortion cost or the combination of the prediction modes is the prediction mode finally adopted by the image block, and at least one prediction mode of the current block can be determined or obtained according to gradient information of at least one reference region.
[0132] Optionally, after determining or obtaining at least one prediction mode of the to-be-predicted image block (i.e., the current block), the to-be-predicted image block is predicted by using the at least one prediction mode to determine or obtain a prediction block (i.e., a prediction result) of the to-be-predicted image block.
[0133] Optionally, a residual block between the prediction block and the current block can be calculated, the residual block can be subjected to transformation and quantization processing, and then encoded by an entropy encoder to form an encoded bitstream.
[0134] Optionally, the encoded bitstream can comprise prediction parameters corresponding to the determined prediction mode and related side information.
[0135] Optionally, the prediction parameters are packed into the encoded bitstream after being subjected to entropy encoding.
[0136] Optionally, the prediction parameters comprise indication information of the prediction mode.
[0137] Optionally, the transformed quantized residual block can be added to corresponding prediction data (e.g., a prediction block) obtained using the prediction mode after inverse quantization and inverse transformation to obtain a reconstructed block. After obtaining the reconstructed block, the loop filter module performs loop filtering on the reconstructed block according to the filter control parameter to reduce distortion.
[0138] Optionally, the reconstructed block after the loop filtering is stored in the coded picture buffer.
[0139] Referring to FIG. 8, when the processing device is a decoder at the decoding side, after receiving the coded bitstream, the entropy decoding unit of the decoder parses and decodes the coded bitstream to obtain the transform coefficients. The inverse transform unit and the inverse quantization unit of the decoder perform inverse transform and inverse quantization on the transform coefficients to obtain the residual block.
[0140] Optionally, the entropy decoding unit of the decoder parses and decodes the coded bitstream to obtain prediction data, such as prediction parameters and related auxiliary information.
[0141] Optionally, the prediction processing unit of the decoder performs prediction processing using the prediction parameters to determine a prediction block corresponding to the residual block.
[0142] Optionally, the prediction processing includes intra prediction processing and / or inter prediction processing, and the intra prediction processing and / or the inter prediction processing includes at least one derivation mode and / or at least one prediction mode in a combined manner.
[0143] Optionally, the processing method includes determining or obtaining at least one prediction mode of the current block according to gradient information of at least one reference region.
[0144] Optionally, the prediction processing is performed on the to-be-predicted image block according to the at least one prediction mode to determine or obtain a prediction block of the to-be-predicted image block. The obtained residual block and the corresponding prediction block (including a prediction luma block and a prediction chroma block) are added to obtain a reconstructed block. The loop filter unit of the decoder performs loop filtering on the reconstructed block to reduce distortion and improve video quality.
[0145] Optionally, the processing method further includes that the reconstructed block after the loop filtering is further combined into a decoded image and stored in a decoded picture buffer or output as a decoded video signal.
[0146] Optionally, when the processing device is an encoder, the initially obtained prediction value can be a prediction value obtained in a corresponding prediction mode, which can be directly used in the rate-distortion cost process.
[0147] Optionally, when the processing device is a decoder, the initially obtained prediction value can be a prediction value obtained in a prediction mode corresponding to a to-be-predicted block (i.e., an image block at a decoding end) indicated by a syntax element parsed from a bitstream.
[0148] Optionally, the target image block can be a prediction block, a residual block between the target image block and the current block can be calculated, and then the prediction block can be processed by a transform and quantization process, encoded by an entropy encoder to form an encoded bitstream, and / or processed by other models, and an image block obtained by the processing can be taken as the target image block, and the step of calculating the residual block between the target image block and the current block can be performed.
[0149] In this embodiment, the spatial correlation between the current block and the at least one reference region and / or the directionality and continuity features carried by the trend of the pixel value change in the reference region can be determined by the gradient information of the at least one reference region of the current block, and then a suitable at least one prediction mode can be matched for the current block, which can support improving the prediction accuracy of the current block and / or a texture complex region of the current block.
[0150] Second embodiment
[0151] Based on the first embodiment, the second embodiment is provided.
[0152] In this embodiment, the at least one prediction mode is determined or obtained according to at least one of the following modes one to six:
[0153] Mode one, at least one gradient histogram;
[0154] Optionally, the step S10 includes: determining or obtaining at least one gradient histogram according to the gradient information of the at least one reference region, and determining or obtaining the at least one prediction mode of the current block according to the at least one gradient histogram.
[0155] Optionally, the gradient histogram is a statistical tool for describing the gradient amplitude distribution of the current block in different directions, which obtains a histogram containing gradient amplitude values corresponding to each prediction direction by calculating the gradient amplitude values of each pixel in the at least one reference region of the current block in the directions corresponding to each intra-frame prediction mode and counting the distribution of the gradient amplitude values.
[0156] Optionally, in the prediction modes of the intra-frame prediction, different prediction modes correspond to different prediction directions, for example, the vertical mode corresponds to the vertical direction, the horizontal mode corresponds to the horizontal direction, and the diagonal line mode corresponds to the diagonal line direction, each prediction mode has a specific direction for describing the prediction direction.
[0157] Optionally, for each prediction direction, a sum of gradient magnitude values of pixels in the at least one reference region of the current block in the prediction direction is calculated, and the sum value reflects an overall gradient strength of the current block in the prediction direction. The gradient histogram records the sum of gradient magnitude values corresponding to each prediction direction.
[0158] Optionally, according to the at least one gradient histogram corresponding to the current block, it is determined whether the sum of gradient magnitude values corresponding to at least one prediction direction of a prediction mode contained in the gradient histogram satisfies a first preset condition, and in the case that the preset condition is satisfied, at least one candidate mode is determined or obtained.
[0159] Optionally, the first preset condition can be whether the sum of gradient magnitudes is one of sums of N gradient magnitudes with the largest gradient magnitudes in the gradient histogram, for example, according to whether the sum of gradient magnitude values corresponding to at least one prediction direction of a prediction mode contained in the at least one gradient histogram is one of sums of N gradient magnitudes with the largest gradient magnitudes in the gradient histogram, at least one prediction mode is determined or obtained.
[0160] Optionally, each sum of gradient magnitudes in the gradient histogram is sorted in ascending order or descending order, and a sum of gradient magnitudes located in the first N gradient magnitudes in ascending order or a sum of gradient magnitudes located in the last N gradient magnitudes in descending order is determined or obtained, for example, after sorting in ascending order, prediction modes corresponding to prediction directions with sums of gradient magnitudes located in the first 3 are determined as prediction modes of the current block.
[0161] Optionally, each gradient magnitude in the gradient histogram is compared, and a sum of N gradient magnitudes with the largest gradient magnitudes in the gradient histogram is determined or obtained, and according to prediction modes corresponding to the sum of N gradient magnitudes with the largest gradient magnitudes, at least one prediction mode of the current block is determined or obtained.
[0162] Optionally, according to gradient magnitude values and gradient directions of pixels in the at least one reference region of the current block, a gradient histogram of the at least one reference region with respect to an intra prediction direction is determined or obtained, a corresponding intra prediction direction is determined according to the gradient histogram, and at least one prediction mode is determined or obtained.
[0163] Optionally, the at least one reference region of the current block includes at least one of a reference pixel, a reference block and a reference template.
[0164] Optionally, the processing method in the embodiments of the present application can be a DIMD mode and / or an improved DIMD mode.
[0165] Referring to FIG. 9, the processing steps of the DIMD mode, the processing steps of the improved DIMD mode, and / or the determination or obtaining manner of the gradient histogram include: determining a reference template adjacent to a to-be-predicted block (current block) above and on the left of the to-be-predicted block, i.e., three pixel lines / pixel rows / pixel columns on the left and above the to-be-predicted block, and then taking a pixel (for example, pixel A) in the middle line as a pixel for calculating a gradient, and by calculating the direction of the gradient of the at least one pixel and the amplitude values of the horizontal gradient and the vertical gradient, the gradient direction of the at least one pixel and the gradient amplitude value corresponding to the gradient can be obtained.
[0166] Optionally, the gradient amplitude value is the sum of the absolute values of the horizontal gradient and the vertical gradient, and if the gradient amplitude values of the at least one pixel with the same gradient direction are added, the sum of the gradient amplitude values corresponding to the gradient direction can be obtained.
[0167] Optionally, a histogram of the gradient amplitude values of different gradient directions of the at least one pixel can be established, and a prediction direction perpendicular to the gradient direction of the maximum gradient amplitude value can be used as the prediction direction of the intra prediction mode of the current block and / or the prediction direction of the candidate mode.
[0168] Optionally, a 3X3 horizontal Sobel operator and a vertical Sobel operator can be used to calculate the horizontal gradient Gx and the vertical gradient Gy, for example, the horizontal gradient Gx and the vertical gradient Gy of a pixel x4 in a pixel line can be calculated according to the following formula (I) and formula (II).
[0169] Optionally, A can be a matrix composed of the pixel x4 as the center, and the pixels x1 above the pixel x4, the pixel x3 on the left of the pixel x4, the pixel x7 below the pixel x4, the pixel x5 on the right of the pixel x4, the pixel x0 on the top left of the pixel x4, the pixel x6 on the bottom left of the pixel x4, the pixel x2 on the top right of the pixel x4, and the pixel x8 on the bottom right of the pixel x4, as shown in the following formula (III).
[0170] Optionally, the gradient amplitude value G is the sum of the absolute values of the horizontal gradient and the vertical gradient, and the calculation formula is shown in the following formula (IV). G = |Gx| + |Gy| Formula (IV)
[0171] Optionally, the gradient direction corresponding to the pixel can be calculated by arctan(Gx / Gy) or arctan(Gy / Gx).
[0172] Optionally, since each gradient direction corresponds to a specific gradient direction range, and each gradient direction range corresponds to a prediction direction of an intra prediction mode, for the at least one pixel in the pixel line, the gradient amplitude values of the at least one pixel with the same gradient direction range can be added, and the sum of the gradient amplitude values corresponding to the gradient direction range can be obtained.
[0173] Optionally, the sum of the gradient magnitude values of the prediction directions corresponding to the intra prediction modes is also obtained.
[0174] Referring to FIG. 10, the sum of the gradient magnitude values of the gradient magnitudes corresponding to the prediction directions of the respective intra prediction modes is obtained, and optionally, the finally selected intra prediction mode is mode 30 according to FIG. 10.
[0175] Optionally, at least one candidate mode is determined or obtained according to the at least one gradient histogram, and at least one prediction mode of the current block is determined according to the matching information of the at least one candidate mode relative to the at least one reference region.
[0176] Optionally, the matching information refers to information used to evaluate the matching degree between different prediction modes and the reference region and the corresponding current block, and the matching information can indicate the matching degree between different prediction modes and the reference region based on various indicators, such as rate-distortion cost of the prediction result, prediction error, texture similarity, etc.
[0177] Optionally, the matching information includes SAD, SATD and / or MRSAD, and optionally, the smaller the SAD value, the SATD value and / or the MRSAD value, the higher the matching degree; and / or, the larger the SAD value, the SATD value and / or the MRSAD value, the lower the matching degree.
[0178] Optionally, the matching information includes the gradient magnitude value or the sum of the gradient magnitude values corresponding to the prediction mode in the gradient histogram. Optionally, the larger the gradient magnitude value, the higher the matching degree; and / or, the smaller the gradient magnitude, the lower the matching degree.
[0179] Optionally, the matching information includes confidence information, and optionally, the larger the confidence, the higher the matching degree; and / or, the smaller the confidence, the lower the matching degree.
[0180] Optionally, at least one candidate mode is determined or obtained according to the prediction mode corresponding to the prediction direction satisfying the first prediction condition in the at least one gradient histogram, and at least one prediction mode is determined from the at least one candidate mode according to the matching information of the at least one candidate mode relative to the at least one reference region.
[0181] Optionally, at least one prediction mode is determined or obtained according to the prediction mode corresponding to the prediction direction satisfying the first prediction condition in the at least one gradient histogram, and a fourth weight related to the at least one prediction mode is determined or obtained according to the matching information of the at least one prediction mode relative to the at least one reference region, and the prediction result of the current block is determined or obtained according to the at least one prediction mode and the fourth weight related thereto.
[0182] Optionally, at least one candidate mode is determined or obtained according to a prediction mode corresponding to a prediction direction satisfying the first prediction condition in the at least one gradient histogram, at least one prediction mode is determined from the at least one candidate mode according to matching information related to the at least one reference region and the at least one candidate mode, and a fourth weight related to the at least one prediction mode is determined or obtained according to matching information related to the at least one reference region and the at least one prediction mode, and a prediction result of the current block is determined or obtained according to the at least one prediction mode and the fourth weight related to the at least one prediction mode.
[0183] In the embodiment, the gradient histogram can accurately capture a dominant prediction direction (e.g., vertical, horizontal, or diagonal) related to the at least one reference region of the current block, thereby matching an appropriate prediction mode for the current block.
[0184] Optionally, the gradient information of the target pixel in the at least one reference region is determined or obtained.
[0185] Optionally, the step S10 comprises determining or obtaining at least one prediction mode of the current block according to the gradient information of the target pixel in the at least one reference region.
[0186] Optionally, the target pixel is a pixel with specific characteristics and / or likely to affect the selection of the prediction mode, which is selected from the at least one reference region of the current block. The gradient information of the target pixel can be adjusted, for example, the gradient amplitude in the gradient information of the target pixel is enhanced or weakened, thereby changing the distribution of the at least one gradient histogram determined or obtained based on the gradient information of the target pixel and / or the gradient information of the reference region, avoiding the selection of an inappropriate prediction mode, and improving the prediction accuracy of the prediction mode of the current block determined or obtained.
[0187] Optionally, the target pixel includes a pixel with specific characteristics and / or likely to affect the selection of the prediction mode, which needs to enhance and / or reduce the gradient amplitude.
[0188] Optionally, the pixel needing to enhance the gradient amplitude can be a first target pixel, and the pixel needing to reduce the gradient amplitude can be a second target pixel. By adjusting the gradient of the first target pixel and / or the second target pixel, the selection of an inappropriate prediction mode is avoided, and the prediction accuracy of the prediction mode of the current block determined or obtained is improved.
[0189] Optionally, the target pixel can be a pixel with specific characteristics and / or likely to affect the selection of the prediction mode, which needs to reduce the gradient amplitude, for example, the target pixel is a second target pixel needing to reduce the gradient amplitude. By only selecting the second target pixel needing to reduce the gradient amplitude, the calculation complexity is reduced, the selection of an inappropriate prediction mode is avoided, and the prediction accuracy of the prediction mode of the current block determined or obtained is improved.
[0190] Optionally, the pixels with specific characteristics and / or that can affect the prediction mode selection refer to pixels with a preset coordinate range and / or pixels with a gradient direction in a preset range.
[0191] Optionally, the pixels with the preset coordinate range include pixels with a vertical coordinate range of 0-2 / H on the left side of the current block or pixels with a horizontal coordinate range of 0-2 / W above the current block.
[0192] Optionally, the pixels with the preset coordinate range include pixels with a vertical coordinate range of 2 / H-H on the left side of the current block or pixels with a horizontal coordinate range of 2 / W-W above the current block.
[0193] Optionally, the pixels with the preset coordinate range include pixels with a vertical coordinate range of H-3 / 2H on the left side of the current block or pixels with a horizontal coordinate range of W-3 / 2W above the current block.
[0194] Optionally, the pixels with the preset coordinate range include pixels with a vertical coordinate range of 3 / 2H-2H on the left side of the current block or pixels with a horizontal coordinate range of 3 / 2W-2W above the current block.
[0195] Optionally, the prediction coordinate range can be a combination of the above preset coordinate ranges.
[0196] Optionally, W is the width of the current block and H is the height of the current block.
[0197] Optionally, the gradient direction in the preset range includes a first angle to a second angle.
[0198] Optionally, the first angle is the difference between 90 degrees and the angle corresponding to the angle prediction mode 2.
[0199] Optionally, the second angle is the difference between 90 degrees and the angle corresponding to the angle prediction mode 15.
[0200] Optionally, the first angle is the difference between 90 degrees and the angle corresponding to the angle prediction mode 53.
[0201] Optionally, the second angle is the difference between 90 degrees and the angle corresponding to the angle prediction mode 66.
[0202] Optionally, the target pixels include first target pixels and / or second target pixels, the first target pixels are pixels that need to enhance the gradient amplitude, and the second target pixels are pixels that need to reduce the gradient amplitude.
[0203] Optionally, in the case that the width of the current block is greater than the height, the first target pixel comprises: a pixel located above the current block and having a horizontal coordinate range within the second coordinate range, and a pixel gradient direction of the pixel being within a first angle to a second angle, the first angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 2, and the second angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 15.
[0204] Optionally, the second coordinate range is a horizontal coordinate range of the pixel, and comprises at least one of:
[0205] 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0206] Optionally, in the case that the width of the current block is greater than the height, the second target pixel comprises: a pixel located above the current block and having a horizontal coordinate range within the second coordinate range, and a pixel gradient direction of the pixel being within a first angle to a second angle, the first angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 2, and the second angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 15.
[0207] Optionally, the first coordinate range is a vertical coordinate range of the pixel, and comprises at least one of:
[0208] 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H.
[0209] Optionally, in the case that the height of the current block is less than the width, the first target pixel comprises: a pixel located on the left side of the current block and having a vertical coordinate range within the first coordinate range, and a pixel gradient direction of the pixel being within a third angle to a fourth angle, the third angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 53, and the fourth angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 66.
[0210] Optionally, the first coordinate range is a vertical coordinate range of the pixel, and comprises at least one of:
[0211] 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H.
[0212] Optionally, in the case that the height of the current block is less than the width, the second target pixel comprises: a pixel located above the current block and having a horizontal coordinate range within the second coordinate range, and a pixel gradient direction of the pixel being within a third angle to a fourth angle, the third angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 53, and the fourth angle being a difference between 90 degrees and an angle corresponding to the angle prediction mode 66.
[0213] Optionally, the second coordinate range is a horizontal coordinate range of the pixel, and comprises at least one of:
[0214] 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H.
[0215] Optionally, in the case that the width of the current block is not equal to the height, the target pixel comprises: a pixel located at the left side of the current block and having a vertical coordinate range within the first coordinate range, or a pixel located above the current block and having a horizontal coordinate range within the second coordinate range, and the pixel gradient direction of the pixel is within a first angle to a second angle, the first angle being the difference between 90 degrees and the angle corresponding to the angle prediction mode 2, and the second angle being the difference between 90 degrees and the angle corresponding to the angle prediction mode 15.
[0216] Optionally, in the case that the width of the current block is not equal to the height, the target pixel comprises: a pixel located above the current block and having a horizontal coordinate range within the second coordinate range, or a pixel located at the left side of the current block and having a vertical coordinate range within the first coordinate range, and the pixel gradient direction of the pixel is within a third angle to a fourth angle, the third angle being the difference between 90 degrees and the angle corresponding to the angle prediction mode 53, and the fourth angle being the difference between 90 degrees and the angle corresponding to the angle prediction mode 66.
[0217] Optionally, in the case that the width of the current block is not equal to the height, the target pixel is determined. Optionally, according to the width>height of the current block or the widthheight of the current block, the target pixel is determined as the first target pixel or the second target pixel.
[0218] Optionally, the first coordinate range is a vertical coordinate range of the pixel, and comprises at least one of the following:
[0219] 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H.
[0220] Optionally, the second coordinate range is a horizontal coordinate range of the pixel, and comprises at least one of the following:
[0221] 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0222] Optionally, the gradient information of the pixel comprises: original gradient information and adjusted gradient information, the original gradient information being gradient information directly calculated from the reference pixel region of the current block without intervention, and the adjusted gradient information being gradient information obtained by adjusting the original gradient information based on a specific rule.
[0223] Optionally, the adjustment of the gradient information comprises enhancement of the gradient amplitude and / or weakening of the gradient amplitude.
[0224] Optionally, the gradient information of the reference region comprises gradient information of the target pixel and / or gradient information of a non-target pixel in the reference region, the non-target pixel being a pixel other than the target pixel in the reference region.
[0225] Optionally, at least one gradient histogram is determined or obtained according to the original gradient information of the non-target pixels and the adjusted gradient information of the target pixels in the reference region, and at least one prediction mode of the current block is determined or obtained according to the at least one gradient histogram.
[0226] Optionally, at least one gradient histogram is determined or obtained according to the original gradient information of the non-target pixels and the adjusted gradient information of the target pixels in the reference region, at least one candidate mode is determined or obtained according to the at least one gradient histogram, and at least one prediction mode of the current block is determined or obtained according to matching information related to the at least one reference region and the at least one candidate mode.
[0227] Optionally, the adjusted gradient information of the at least one reference region is determined or obtained according to the original gradient information of the non-target pixels and the adjusted gradient information of the target pixels in the at least one reference region, and at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information of the at least one reference region.
[0228] Optionally, the adjusted gradient information of the at least one reference region is determined or obtained according to the adjusted gradient information of the target pixels in the at least one reference region, and at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information of the at least one reference region.
[0229] Optionally, at least one prediction mode of the current block is determined or obtained according to at least one gradient histogram determined or obtained according to the adjusted gradient information of the at least one reference region.
[0230] Optionally, at least one candidate mode is determined or obtained according to at least one gradient histogram determined or obtained according to the adjusted gradient information of the at least one reference region, and at least one prediction mode of the current block is determined or obtained according to matching information related to the at least one reference region and the at least one candidate mode.
[0231] In the embodiment, the target pixels are pixels with specific characteristics and / or likely to affect the selection of the prediction mode, which are selected from the at least one reference region of the current block. By adjusting the gradient information of the target pixels, the distribution of at least one gradient histogram determined or obtained based on the gradient information of the target pixels and / or the gradient information of the reference region is changed, so as to avoid selecting an inappropriate prediction mode and improve the prediction accuracy of the prediction mode of the current block determined or obtained.
[0232] Optionally, the target pixels are determined or obtained according to at least one of the following modes A1 to A4:
[0233] Mode A1, the size of the current block;
[0234] Optionally, the step S10 comprises: determining or obtaining the target pixels in the at least one reference region according to the size of the current block, and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the target pixels in the at least one reference region.
[0235] Optionally, in the conventional technology, the intra prediction block can be a rectangular block, and for the image block of the horizontal type (i.e., the width is greater than the height), the probability of using the reference pixels above the image block is greater than the probability of using the reference pixels on the left side of the image block, and for the image block of the vertical type (i.e., the height is greater than the width), the probability of using the reference pixels above the image block is less than the probability of using the reference pixels on the left side of the image block, and therefore, the WAIP (Wide-angle intra prediction) is proposed to replace the original direction by the wide-angle direction when performing the intra angular prediction on the non-square block, but in the process of deriving the prediction mode by the DIMD mode, the gradient distribution of the reference region can not match the wide-angle mode, for example, the original mode (e.g., the non-wide-angle mode) derived by the DIMD depends on the gradient information close to the center position of the reference region, and the corresponding wide-angle mode needs to depend on the reference pixels far away from the center position in the reference region, and at this time, if the corresponding wide-angle mode is switched according to the size of the current block, the wide-angle mode can not be predicted accurately.
[0236] Optionally, in order to avoid the false touch of the wide-angle mode, the target pixels in the at least one reference region are determined or obtained according to the size of the current block, and the distribution of the gradient histogram determined or obtained is changed by adjusting the gradient information of the target pixels, so as to avoid selecting the inappropriate wide-angle mode and improve the prediction accuracy of the prediction mode of the current block determined or obtained.
[0237] Optionally, in the case where the size of the current block satisfies the first condition, the target pixels in the at least one reference region are determined or obtained, and in the case where the size of the current block does not satisfy the first condition, the target pixels do not exist in the at least one reference region, and then the at least one prediction mode of the current block is determined or obtained according to the original gradient information of the at least one reference region.
[0238] Optionally, the size of the current block comprises the width, the height, the ratio, the depth, the area, the resolution and the number of pixels.
[0239] Optionally, the first condition comprises that the width and the height of the current block are not equal (for example, the width of the current block is greater than the height, or the height is greater than the width) and / or the aspect ratio of the current block is not equal to 1.
[0240] Optionally, the wide-angle mode is designed to solve the problem of the limitation of the prediction direction of the non-square block (rectangular block), and thus when the width and height of the block are not equal (for example, the aspect ratio ≠ 1), the reference pixel distribution of the non-wide-angle mode can not effectively capture the real structure of the image, and thus the wide-angle mode needs to be introduced, and thus the size of the current block can be used to determine whether to select the target pixel, how to select the target pixel, and / or how to adjust (for example, enhance or weaken) the gradient information of the target pixel.
[0241] In the embodiment, the target pixel in the at least one reference region is determined or obtained according to the size of the current block, the distribution of the determined or obtained gradient histogram is changed by adjusting the gradient information of the target pixel, and thus the inappropriate wide-angle mode is avoided, and the prediction accuracy of the determined or obtained prediction mode of the current block is improved.
[0242] Optionally, the position information of the pixel in the at least one reference region is determined or obtained.
[0243] Optionally, the step S10 comprises: determining or obtaining the target pixel in the at least one reference region according to the position information of the pixel in the at least one reference region, and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the target pixel in the at least one reference region.
[0244] Optionally, the pixel in the at least one reference region whose position information satisfies the second condition is determined as the target pixel.
[0245] Optionally, the second condition comprises at least one of the following:
[0246] The position information of the pixel corresponds to the first position information;
[0247] The position information of the pixel is located in the first preset range and / or the first reference region;
[0248] The position information of the pixel does not correspond to the second position information;
[0249] The position information of the pixel is located outside the second preset range and / or the second reference region.
[0250] Optionally, the first position information and / or the second position information is at least one fixed coordinate position in the reference region.
[0251] Optionally, if the position information of the pixel in the at least one reference region corresponds to the first position information, for example, is located in the region indicated by the first position information, the pixel is determined as the target pixel, and the current block is predicted by the first prediction mode determined or obtained by the second prediction mode.
[0252] Optionally, if the position information of the pixel in the at least one reference region does not correspond to the second position information, for example, is located outside the region indicated by the second position information, the pixel is determined as a non-target pixel.
[0253] Optionally, the first position information comprises position information of a horizontal coordinate of the pixel and / or position information of a vertical coordinate of the pixel.
[0254] Optionally, the position information of the horizontal coordinate of the pixel comprises at least one of 0-2 / W, 2 / W-W, W-3 / 2W, 3 / 2W-2W.
[0255] Optionally, the position information of the vertical coordinate of the pixel comprises at least one of 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0256] Optionally, the target pixel comprises a first target pixel and / or a second target pixel, the first target pixel is a pixel that needs to enhance the gradient amplitude, and the second target pixel is a pixel that needs to reduce the gradient amplitude.
[0257] Optionally, in the case that the width of the current block is not equal to the height, the target pixel is determined, and optionally, according to the width>height of the current block or the widthheight of the current block, the target pixel is determined as the first target pixel or the second target pixel.
[0258] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width>height of the current block, the position information of the pixel corresponding to the first position information comprises that there is a pixel in the reference region, and the horizontal coordinate of the pixel is located in at least one range of 0-2 / W, 2 / W-W, W-3 / 2W, 3 / 2W-2W.
[0259] Optionally, for the second target pixel, in the case that the coordinate of the current block is [0, 0] and the width>height of the current block, the position information of the pixel corresponding to the first position information comprises that there is a pixel in the reference region, and the vertical coordinate of the pixel is located in at least one range of 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0260] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the widthheight of the current block, the position information of the pixel corresponding to the first position information comprises that there is a pixel in the reference region, and the vertical coordinate of the pixel is located in at least one range of 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0261] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is less than the height of the current block, the position information of the pixel corresponding to the first position information comprises that there is a pixel in the reference region, and the horizontal coordinate of the pixel is located in at least one of the following ranges: 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0262] Optionally, for the target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is not equal to the height of the current block, the position information of the pixel corresponding to the first position information comprises that there is a pixel in the reference region, and the vertical coordinate of the pixel is located in at least one of the following ranges: 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H, or the horizontal coordinate of the pixel is located in at least one of the following ranges: 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0263] Optionally, the reference region is a first reference region.
[0264] Optionally, for the first target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is greater than the height of the current block, the first reference region comprises the coded region above the current block, and the coordinate of the first reference region is [2 / W, B], the width of the first reference region is 2 / W, and the height of the first reference region is B.
[0265] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is greater than the height of the current block, the first reference region comprises the coded region left of the current block, and the coordinate of the first reference region is [A, 2 / H], the width of the first reference region is A, and the height of the first reference region is 2 / H.
[0266] Optionally, for the first target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is less than the height of the current block, the first reference region comprises the coded region left of the current block, and the coordinate of the first reference region is [A, 2 / H], the width of the first reference region is A, and the height of the first reference region is 2 / H.
[0267] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is less than the height of the current block, the first reference region comprises the coded region above the current block, and the coordinate of the first reference region is [2 / W, B], the width of the first reference region is 2 / W, and the height of the first reference region is B.
[0268] Optionally, for the target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is not equal to the height of the current block, the first reference region comprises a coded region left of the current block and a coded region above the current block, the coded region left of the current block has a coordinate of [A, 2 / H], a width of A and a height of 2 / H, the coded region above the current block has a coordinate of [2 / W, B], a width of 2 / W and a height of B.
[0269] Optionally, for the first target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is greater than the height of the current block, the first reference region comprises a coded region above the current block, and the first reference region has a coordinate of [W, B], a width of 2 / W or W and a height of B.
[0270] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is greater than the height of the current block, the first reference region comprises a coded region left of the current block, and the first reference region has a coordinate of [A, H], a width of A and a height of 2 / H or H.
[0271] Optionally, for the first target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is less than the height of the current block, the first reference region comprises a coded region left of the current block, and the first reference region has a coordinate of [A, H], a width of A and a height of 2 / H or H.
[0272] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is less than the height of the current block, the first reference region comprises a coded region above the current block, and the first reference region has a coordinate of [W, B], a width of 2 / W or W and a height of B.
[0273] Optionally, for the target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is not equal to the height of the current block, the first reference region comprises a coded region left of the current block and a coded region above the current block, the coded region left of the current block has a coordinate of [A, H], a width of A and a height of 2 / H or H, the coded region above the current block has a coordinate of [W, B], a width of 2 / W or W and a height of B.
[0274] Optionally, A < 0 and B < 0, for example, A is equal to -3 and B is equal to -3.
[0275] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block > height of the current block, the second reference region comprises the coded region left of the current block, and the coordinate of the second reference region is [D, 2 / H], the width of the second reference region is D, and the height of the second reference region is 2 / H.
[0276] Optionally, for the second target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block > height of the current block, the second reference region comprises the coded region above the current block, and the coordinate of the second reference region is [2 / W, C], the width of the second reference region is 2 / W, and the height of the second reference region is C.
[0277] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block < height of the current block, the second reference region comprises the coded region above the current block, and the coordinate of the second reference region is [2 / W, C], the width of the second reference region is 2 / W, and the height of the second reference region is C.
[0278] Optionally, for the second target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block < height of the current block, the second reference region comprises the coded region left of the current block, and the coordinate of the second reference region is [D, 2 / H], the width of the second reference region is D, and the height of the second reference region is 2 / H.
[0279] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block > height of the current block, the second reference region comprises the coded region left of the current block, and the coordinate of the second reference region is [D, H], the width of the second reference region is D, and the height of the second reference region is 2 / H or H.
[0280] Optionally, for the second target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block > height of the current block, the second reference region comprises the coded region above the current block, and the coordinate of the second reference region is [W, C], the width of the second reference region is 2 / W or W, and the height of the second reference region is C.
[0281] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block < height of the current block, the second reference region comprises the coded region above the current block, and the coordinate of the second reference region is [W, C], the width of the second reference region is 2 / W or W, and the height of the second reference region is C.
[0282] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is less than the height of the current block, the second reference region comprises a coded region on the left side of the current block, and the coordinate of the second reference region is [D, H], the width of the second reference region is D, and the height of the second reference region is 2 / H or H.
[0283] Optionally, C < 0 and D < 0, for example, C is equal to -3 and D is equal to -3.
[0284] Optionally, for the target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is not equal to the height of the current block, the second reference region comprises a coded region on the upper left side of the current block, the coordinate of the coded region on the upper left side of the current block is [-E, -F], the width of the region is E, and the height of the region is F.
[0285] Optionally, E > 0 and F > 0, for example, E is equal to 3 and F is equal to 3.
[0286] Optionally, the target pixel comprises the first target pixel and / or the second target pixel.
[0287] Optionally, the coordinate of the current block refers to the coordinate of the upper left pixel of the current block, and the coordinate of the first reference region and / or the second reference region refers to the coordinate of the upper left pixel of the first reference region and / or the second reference region.
[0288] Optionally, the first preset range and / or the second preset range refers to a spatial range (such as a rectangular, circular or angular sector region) defined in the reference region, for limiting the distribution range of the position of the target pixel.
[0289] Optionally, if the position information of a pixel in at least one reference region is within the first preset range, the pixel is determined as a target pixel.
[0290] Optionally, if the position information of a pixel in at least one reference region is outside the second preset range, the pixel is determined as a non-target pixel.
[0291] Optionally, the first reference region and / or the second reference region refers to a set of reference pixels in a preset pixel position or coordinate range on the left side, the upper side and / or the upper left side of the current block, and the prediction pixel position or coordinate range of the first reference region and the second reference region is different or does not coincide.
[0292] Optionally, if the position information of a pixel in at least one reference region is within the first reference region, the pixel is determined as a target pixel.
[0293] Optionally, if the position information of a pixel in at least one reference region is outside the second reference region, the pixel is determined as a non-target pixel.
[0294] Optionally, for the first target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is greater than the height of the current block, if the reference region is located above the current block, the first preset range comprises at least one of the following:
[0295] a region composed of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0296] a region composed of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0297] a region composed of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1] and the pixel [3 / 2W, -1];
[0298] a region composed of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1] and the pixel [2W, -1];
[0299] the second preset range comprises at least one of the following:
[0300] a region composed of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0] and the pixel [-1, 2 / H];
[0301] a region composed of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0302] a region composed of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0303] a region composed of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H].
[0304] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the width of the current block is greater than the height of the current block, if the reference region is located on the left side of the current block, the first preset range comprises at least one of the following:
[0305] a region composed of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0] and the pixel [-1, 2 / H];
[0306] a region composed of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0307] a region composed of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0308] a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H];
[0309] The second preset range comprises at least one of:
[0310] a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0311] a region consisting of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0312] a region consisting of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1] and the pixel [3 / 2W, -1];
[0313] a region consisting of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1] and the pixel [2W, -1].
[0314] Optionally, for the first target pixel, in a case where the coordinates of the current block are [0, 0] and the width of the current block is less than the height of the current block, if the reference region is located on the left side of the current block, the first preset range comprises at least one of:
[0315] a region consisting of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0] and the pixel [-1, 2 / H];
[0316] a region consisting of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0317] a region consisting of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0318] a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H];
[0319] The second preset range comprises at least one of:
[0320] a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0321] a region consisting of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0322] a region composed of the pixel [W,-3], the pixel [3 / 2W,-3], the pixel [W,-1] and the pixel [3 / 2W,-1];
[0323] a region composed of the pixel [3 / 2W,-3], the pixel [2W,-3], the pixel [3 / 2W,-1] and the pixel [2W,-1].
[0324] Optionally, for the target pixel, in a case where the coordinates of the current block are [0, 0] and the height of the current block is not equal to the width of the current block, if the reference region is located above the current block, the first preset range comprises at least one of the following:
[0325] a region composed of the pixel [0,-3], the pixel [2 / W,-3], the pixel [0,-1] and the pixel [2 / W,-1];
[0326] a region composed of the pixel [2 / W,-3], the pixel [W,-3], the pixel [2 / W,-1] and the pixel [W,-1];
[0327] a region composed of the pixel [W,-3], the pixel [3 / 2W,-3], the pixel [W,-1] and the pixel [3 / 2W,-1];
[0328] a region composed of the pixel [3 / 2W,-3], the pixel [2W,-3], the pixel [3 / 2W,-1] and the pixel [2W,-1];
[0329] the second preset range comprises at least one of the following:
[0330] a region composed of the pixel [-3,0], the pixel [-3,2 / H], the pixel [-1,0] and the pixel [-1,2 / H];
[0331] a region composed of the pixel [-3,2 / H], the pixel [-3,H], the pixel [-1,2 / H] and the pixel [-1,H];
[0332] a region composed of the pixel [-3,H], the pixel [-3,3 / 2H], the pixel [-1,H] and the pixel [-1,3 / 2H];
[0333] a region composed of the pixel [-3,3 / 2H], the pixel [-3,2H], the pixel [-1,3 / 2H] and the pixel [-1,2H].
[0334] Optionally, for the target pixel, in a case where the coordinates of the current block are [0, 0] and the height of the current block is not equal to the width of the current block, if the reference region is located above the current block, the first preset range comprises at least one of the following:
[0335] a region composed of the pixel [0,-3], the pixel [2 / W,-3], the pixel [0,-1] and the pixel [2 / W,-1];
[0336] a region consisting of the pixel [2 / W,-3], the pixel [W,-3], [2 / W,-1] and the pixel [W,-1];
[0337] a region consisting of the pixel [W,-3], the pixel [3 / 2W,-3], [W,-1] and the pixel [3 / 2W,-1];
[0338] a region consisting of the pixel [3 / 2W,-3], the pixel [2W,-3], [3 / 2W,-1] and the pixel [2W,-1];
[0339] a region consisting of the pixel [-3,0], the pixel [-3,2 / H], [-1,0] and the pixel [-1,2 / H];
[0340] a region consisting of the pixel [-3,2 / H], the pixel [-3,H], [-1,2 / H] and the pixel [-1,H];
[0341] a region consisting of the pixel [-3,H], the pixel [-3,3 / 2H], [-1,H] and the pixel [-1,3 / 2H];
[0342] a region consisting of the pixel [-3,3 / 2H], the pixel [-3,2H], [-1,3 / 2H] and the pixel [-1,2H];
[0343] The second preset range comprises at least one of the following:
[0344] a region consisting of the pixel [-3,-3], the pixel [-1,-3], [-3,-1] and the pixel [-1,-1].
[0345] Optionally, the first position information, the first preset range and / or the first reference region correspond to preset pixel positions located at the left side and / or the top of the current block, and the second position information, the second preset range and / or the second reference region correspond to preset pixel positions located at the top-left of the current block.
[0346] Optionally, if the width of the current block is greater than the height, the current block belongs to a flat block, which mainly depends on reference pixels in the horizontal direction, and therefore, gradient adjustment can be performed on at least one reference pixel in the horizontal direction (for example, the pixel located in the left reference region of the current block, as shown in FIG. 11), and then the pixel located in the left reference region of the current block can be determined as the target pixel.
[0347] Optionally, if the height of the current block is greater than the width, the current block belongs to a vertical long block, which mainly depends on the reference pixels in the vertical direction, and therefore, the gradient of at least one reference pixel (for example, the pixel in the upper reference region of the current block, as shown in FIG. 11) in the vertical direction can be adjusted, and the pixel in the upper reference region of the current block can be determined as the target pixel. The upper-left reference region of the current block is the intersection of the horizontal and vertical reference pixels, and the contribution of the wide-angle mode is weak.
[0348] Optionally, if the size of the current block satisfies the first condition, the target pixel is determined or obtained according to the pixel in the at least one reference region whose position information satisfies the second condition. The first condition includes that the width and the height of the current block are not equal (for example, the width of the current block is greater than the height, or the height is greater than the width) and / or the width-height ratio of the current block is not equal to 1. The second condition includes that the position information of the pixel corresponds to the first position information, the position information of the pixel is located in the first preset range and / or the first reference region, the position information of the pixel does not correspond to the second position information, and / or the position information of the pixel is located outside the second preset range and / or the second reference region.
[0349] In this embodiment, the target pixel can be determined or obtained from the pixel position with strong contribution to the wide-angle mode according to the position information of the pixel in the at least one reference region, and the distribution of the determined or obtained gradient histogram can be changed by adjusting the gradient information of the target pixel, so as to avoid selecting an inappropriate wide-angle mode and improve the prediction accuracy of the determined or obtained prediction mode of the current block.
[0350] Optionally, the gradient direction of the pixel in the at least one reference region is determined or obtained.
[0351] Optionally, the target pixel in the at least one reference region is determined or obtained according to the gradient direction of the pixel in the at least one reference region, and the at least one prediction mode of the current block is determined or obtained according to the gradient information of the target pixel in the at least one reference region.
[0352] Optionally, the target pixel is determined according to the pixel in the at least one reference region whose gradient direction satisfies the third condition.
[0353] Optionally, the third condition includes at least one of the following:
[0354] The gradient direction corresponds to the first prediction angle mode;
[0355] The gradient direction is located in the first prediction angle range;
[0356] The gradient direction does not correspond to the second prediction angle mode;
[0357] The gradient direction is located outside the second prediction angle range.
[0358] Optionally, the first prediction angle mode and / or the second prediction angle mode is at least one fixed angle mode in the angle prediction modes.
[0359] Optionally, if the gradient direction of the pixel corresponds to the first prediction angle mode, the pixel is determined as the target pixel.
[0360] Optionally, if the gradient direction of the pixel does not correspond to the second prediction angle mode, the pixel is determined as the target pixel.
[0361] Optionally, the first prediction angle range and / or the second prediction angle range is used to define the angle distribution range corresponding to the gradient direction of the target pixel and / or the vertical direction of the gradient direction.
[0362] Optionally, if the gradient direction of the pixel is within the first prediction angle range, the pixel is determined as the target pixel.
[0363] Optionally, if the gradient direction of the pixel is outside the second prediction angle range, the pixel is determined as the target pixel.
[0364] Optionally, the gradient direction of the pixel can correspond to the prediction direction of the angle prediction mode, and if the width of the current block is greater than the height, the current block belongs to a flat block which mainly depends on the reference pixels in the horizontal direction, corresponding to modes 2-15 in the non-wide angle mode, thus the target pixel can be determined or obtained according to the pixel whose gradient direction corresponds to modes 2-15.
[0365] Optionally, if the height of the current block is greater than the width, the current block belongs to a vertical long block which mainly depends on the reference pixels in the vertical direction, corresponding to modes 53-66 in the non-wide angle mode, thus the target pixel can be determined or obtained according to the pixel whose gradient direction corresponds to modes 53-66.
[0366] Optionally, the first prediction angle mode and / or the first prediction angle range is determined or obtained according to modes 2-15 and / or modes 53-66.
[0367] Optionally, the first prediction angle mode and the second prediction angle mode are different, and / or the first prediction angle range and the second prediction angle range are different.
[0368] Optionally, in the case where the width of the current block is greater than the height, the first prediction angle mode is one of modes 2-15 as shown in FIG. 6, and in the case where the width of the current block is less than the height, the first prediction angle mode is one of modes 53-66 as shown in FIG. 6.
[0369] Optionally, in the case where the width of the current block is not equal to the height, the first prediction angle mode is one of modes 2-15 and modes 53-66 as shown in FIG. 6.
[0370] Optionally, in a case where the width of the current block is greater than the height, the first prediction angle mode is mode 2 to mode 15 as shown in FIG. 6, and in a case where the width of the current block is less than the height, the first prediction angle mode is mode 53 to mode 66 as shown in FIG. 6.
[0371] Optionally, in a case where the width of the current block is not equal to the height, the first prediction angle mode is mode 2 to mode 15, mode 53 to mode 66 as shown in FIG. 6.
[0372] Optionally, in a case where the width of the current block is greater than the height, the second prediction angle mode is a mode other than mode 2 to mode 15 as shown in FIG. 6, and in a case where the width of the current block is less than the height, the second prediction angle mode is a mode other than mode 53 to mode 66 as shown in FIG. 6.
[0373] Optionally, in a case where the width of the current block is greater than the height, the second prediction angle mode is a mode other than mode 2 to mode 15 as shown in FIG. 6, and in a case where the width of the current block is less than the height, the second prediction angle mode is a mode other than mode 53 to mode 66 as shown in FIG. 6.
[0374] Optionally, in a case where the width of the current block is not equal to the height, the second prediction angle mode is a mode other than mode 2 to mode 15, mode 53 to mode 66 as shown in FIG. 6 (for example, mode 18 to mode 50).
[0375] Optionally, if the size of the current block satisfies a first condition, the target pixel is determined or obtained according to a pixel whose position information satisfies a second condition and whose gradient direction satisfies a third condition in the at least one reference region, the first condition includes that the width and the height of the current block are not equal (for example, the width of the current block is greater than the height, or the height is greater than the width) and / or the width-height ratio of the current block is not equal to 1, the second condition includes that the position information of the pixel corresponds to first position information, the position information of the pixel is located within a first preset range and / or a first reference region, the position information of the pixel does not correspond to second position information and / or the position information of the pixel is located outside a second preset range and / or a second reference region, and the third condition includes that the gradient direction corresponds to a first prediction angle mode, the gradient direction is located within a first prediction angle range, the gradient direction does not correspond to a second prediction angle mode, and / or the gradient direction is located outside a second prediction angle range.
[0376] Optionally, the second condition and / or the third condition are determined or obtained according to the size of the current block.
[0377] Optionally, if the width of the current block is not equal to the height, the second condition comprises: the position information of the pixel corresponds to the first position information, the position information of the pixel is located in the first preset range and / or the first reference region, the position information of the pixel does not correspond to the second position information and / or the position information of the pixel is located outside the second preset range and / or the second reference region, the first position information, the first preset range and / or the first reference region correspond to a preset pixel position located on the left and / or above the current block, and the second position information, the second preset range and / or the second reference region correspond to a preset pixel position located on the top left of the current block.
[0378] Optionally, the target pixel comprises: a first target pixel and / or a second target pixel, the first target pixel is a pixel that needs to enhance the gradient amplitude, and the second target pixel is a pixel that needs to reduce the gradient amplitude.
[0379] Optionally, in the case that the width of the current block is not equal to the height, the target pixel is determined.
[0380] Optionally, according to the width>height of the current block or the widthheight of the current block, the target pixel is determined as the first target pixel or the second target pixel.
[0381] Optionally, for the first target pixel, if the width of the current block is greater than the height, the second condition comprises: the position information of the pixel corresponds to the first position information, the position information of the pixel is located in the first preset range and / or the first reference region, the position information of the pixel does not correspond to the second position information and / or the position information of the pixel is located outside the second preset range and / or the second reference region, the first position information, the first preset range and / or the first reference region correspond to a preset pixel position located above the current block, and the second position information, the second preset range and / or the second reference region correspond to a preset pixel position located on the top left and / or left side of the current block.
[0382] Optionally, for the second target pixel, if the width of the current block is greater than the height, the second condition comprises: the position information of the pixel corresponds to the first position information, the position information of the pixel is located in the first preset range and / or the first reference region, the position information of the pixel does not correspond to the second position information and / or the position information of the pixel is located outside the second preset range and / or the second reference region, the first position information, the first preset range and / or the first reference region correspond to a preset pixel position located on the left side of the current block, and the second position information, the second preset range and / or the second reference region correspond to a preset pixel position located on the top left and / or above the current block.
[0383] Optionally, for the first target pixel, if the width of the current block is less than the height, the second condition comprises: the position information of the pixel corresponds to the first position information, the position information of the pixel is located in the first preset range and / or the first reference region, the position information of the pixel does not correspond to the second position information and / or the position information of the pixel is located outside the second preset range and / or the second reference region, the first position information, the first preset range and / or the first reference region correspond to a preset pixel position located on the left side of the current block, and the second position information, the second preset range and / or the second reference region correspond to a preset pixel position located on the top left side and / or the top side of the current block.
[0384] Optionally, for the second target pixel, if the width of the current block is less than the height, the second condition comprises: the position information of the pixel corresponds to the first position information, the position information of the pixel is located in the first preset range and / or the first reference region, the position information of the pixel does not correspond to the second position information and / or the position information of the pixel is located outside the second preset range and / or the second reference region, the first position information, the first preset range and / or the first reference region correspond to a preset pixel position located on the top side of the current block, and the second position information, the second preset range and / or the second reference region correspond to a preset pixel position located on the top left side and / or the left side of the current block.
[0385] Optionally, the first position information comprises position information of a horizontal coordinate of the pixel and / or position information of a vertical coordinate of the pixel.
[0386] Optionally, the position information of the horizontal coordinate of the pixel comprises at least one of 0-2 / W, 2 / W-W, W-3 / 2W and 3 / 2W-2W.
[0387] Optionally, the position information of the vertical coordinate of the pixel comprises at least one of 0-2 / H, 2 / H-H, H-3 / 2H and 3 / 2H-2H.
[0388] Optionally, for the first target pixel, in a case where the coordinates of the current block are [0, 0] and the width of the current block is greater than the height, the position information of the pixel corresponding to the first position information comprises: there is a pixel in the reference region, and a horizontal coordinate position of the pixel is located in at least one of 0-2 / W, 2 / W-W, W-3 / 2W and 3 / 2W-2W.
[0389] Optionally, for the second target pixel, in a case where the coordinates of the current block are [0, 0] and the width of the current block is greater than the height, the position information of the pixel corresponding to the first position information comprises: there is a pixel in the reference region, and a vertical coordinate position of the pixel is located in at least one of 0-2 / H, 2 / H-H, H-3 / 2H and 3 / 2H-2H.
[0390] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block is < the height of the current block, the position information of the pixel corresponding to the first position information comprises that there is a pixel in the reference region, and the position of the vertical coordinate of the pixel is located in at least one of the following ranges: 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0391] Optionally, for the second target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block is > the height of the current block, if the first reference region is located on the left side of the current block, the first preset range is the first coordinate range, for example, the first coordinate range is the vertical coordinate range of the pixel, and comprises at least one of the following:
[0392] Optionally, for the target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block is not equal to the height of the current block, the position information of the pixel corresponding to the first position information comprises that the position of the vertical coordinate of the pixel is located in at least one of the following ranges: 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H, or the position of the horizontal coordinate of the pixel is located in at least one of the following ranges: 0-2 / W, 2 / W-W, W-3 / 2W, 3 / 2W-2W.
[0393] Optionally, for the first target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block is > the height of the current block, if the first reference region is located on the left side of the current block, the first preset range is the first coordinate range, for example, the first coordinate range is the vertical coordinate range of the pixel, and comprises at least one of the following:
[0394] 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0395] The second preset range is the first coordinate range, for example, the first coordinate range is the vertical coordinate range of the pixel, and comprises at least one of the following:
[0396] 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0397] Optionally, for the second target pixel, in the case that the coordinate of the current block is [0, 0] and the width of the current block is > the height of the current block, if the first reference region is located on the left side of the current block, the first preset range is the first coordinate range, for example, the first coordinate range is the vertical coordinate range of the pixel, and comprises at least one of the following:
[0398] 0-2 / H, 2 / H-H, H-3 / 2H, 3 / 2H-2H.
[0399] The second preset range is the second coordinate range, for example, the second coordinate range is the horizontal coordinate range of the pixel, and comprises at least one of the following:
[0400] 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0401] Optionally, for the first target pixel, in a case that the coordinate of the current block is [0, 0] and the height of the current block is greater than the width, if the first reference region is located on the left side of the current block, the first preset range is the first coordinate range, for example, the first coordinate range is a vertical coordinate range of pixels, including at least one of the following:
[0402] 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H.
[0403] The second preset range is the second coordinate range, for example, the second coordinate range is a horizontal coordinate range of pixels, including at least one of the following:
[0404] 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0405] Optionally, for the second target pixel, in a case that the coordinate of the current block is [0, 0] and the height of the current block is greater than the width, if the first reference region is located above the current block, the first preset range is the second coordinate range, for example, the second coordinate range is a horizontal coordinate range of pixels, including at least one of the following:
[0406] 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0407] The second preset range is the first coordinate range, for example, the first coordinate range is a vertical coordinate range of pixels, including at least one of the following:
[0408] 0~2 / H, 2 / H~H, H~3 / 2H, 3 / 2H~2H.
[0409] Optionally, for the target pixel, in a case that the width of the current block is not equal to the height, the third condition includes that the gradient direction corresponds to the first prediction angle mode, the gradient direction is located in the first prediction angle range, the gradient direction does not correspond to the second prediction angle mode and / or the gradient direction is located outside the second prediction angle range, the first prediction angle mode and / or the first prediction angle range are determined or obtained according to modes 2~15 or modes 53~66, and the second prediction angle mode and / or the second prediction angle range are determined or obtained according to modes other than modes 2~15 or modes 53~66.
[0410] Optionally, for the target pixel, if the width of the current block is greater than the height, the third condition comprises: the gradient direction corresponds to a first prediction angle mode, the gradient direction is located in a first prediction angle range, the gradient direction does not correspond to a second prediction angle mode and / or the gradient direction is located outside a second prediction angle range, the first prediction angle mode and / or the first prediction angle range is determined or obtained according to modes 2-15, and the second prediction angle mode and / or the second prediction angle range is determined or obtained according to modes other than modes 2-15.
[0411] Optionally, for the target pixel, if the width of the current block is less than the height, the third condition comprises: the gradient direction corresponds to a first prediction angle mode, the gradient direction is located in a first prediction angle range, the gradient direction does not correspond to a second prediction angle mode and / or the gradient direction is located outside a second prediction angle range, the first prediction angle mode and / or the first prediction angle range is determined or obtained according to modes 53-66, and the second prediction angle mode and / or the second prediction angle range is determined or obtained according to modes other than modes 53-66.
[0412] Optionally, for the target pixel, if the width of the current block is greater than the height, the first prediction angle range in which the pixel gradient direction is located comprises: a first angle to a second angle, the first angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 2, and the second angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 15.
[0413] Optionally, for the target pixel, if the width of the current block is less than the height, the first prediction angle range in which the pixel gradient direction is located comprises: a third angle to a fourth angle, the third angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 53, and the fourth angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 66.
[0414] Optionally, for the target pixel, if the width of the current block is not equal to the height, the first prediction angle range in which the pixel gradient direction is located comprises: the first angle to the second angle and the third angle to the fourth angle, the first angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 2, the second angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 15, the third angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 53, and the fourth angle is a difference value between 90 degrees and an angle corresponding to angle prediction mode 66.
[0415] Optionally, for the target pixel, in the case where the width of the current block is greater than the height, the first prediction angle mode is one of modes 2-15 as shown in FIG. 6, and in the case where the width of the current block is less than the height, the first prediction angle mode is one of modes 53-66 as shown in FIG. 6.
[0416] Optionally, for the target pixel, in the case that the width of the current block is not equal to the height, the first prediction angle mode is one of modes 2 to 15, modes 53 to 66 as shown in FIG. 6.
[0417] Optionally, for the target pixel, in the case that the width of the current block is greater than the height, the first prediction angle mode is one of modes 2 to 15 as shown in FIG. 6, and in the case that the width of the current block is less than the height, the first prediction angle mode is one of modes 53 to 66 as shown in FIG. 6.
[0418] Optionally, for the target pixel, in the case that the width of the current block is not equal to the height, the first prediction angle mode is one of modes 2 to 15, modes 53 to 66 as shown in FIG. 6.
[0419] Optionally, for the target pixel, in the case that the width of the current block is greater than the height, the second prediction angle mode is one of modes other than modes 2 to 15 as shown in FIG. 6, and in the case that the width of the current block is less than the height, the second prediction angle mode is one of modes other than modes 53 to 66 as shown in FIG. 6.
[0420] Optionally, for the target pixel, in the case that the width of the current block is not equal to the height, the second prediction angle mode is one of modes other than modes 2 to 15, modes 53 to 66 as shown in FIG. 6.
[0421] Optionally, for the target pixel, in the case that the width of the current block is greater than the height, the second prediction angle mode is one of angle ranges other than modes 2 to 15 as shown in FIG. 6 (for example, modes 53 to 66), and in the case that the width of the current block is less than the height, the first prediction angle mode is one of angle ranges other than modes 53 to 66 as shown in FIG. 6 (for example, modes 2 to 15).
[0422] Optionally, for the target pixel, in the case that the width of the current block is not equal to the height, the second prediction angle mode is one of angle ranges other than modes 2 to 15, modes 53 to 66 as shown in FIG. 6 (for example, modes 18 to 50).
[0423] Optionally, the step S10 comprises: if the size of the current block satisfies the first condition, determining or obtaining the second condition and / or the third condition according to the size of the current block, determining or obtaining the target pixel according to the pixels in the at least one reference region satisfying the second condition in terms of the position information and satisfying the third condition in terms of the gradient direction, and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the target pixel in the at least one reference region.
[0424] Optionally, if the size of the current block satisfies the first condition, determining or obtaining the third condition according to the size of the current block, and determining or obtaining the target pixel according to the pixels in the at least one reference region satisfying the third condition in terms of the gradient direction.
[0425] Optionally, the target pixels can be classified according to the position information of the target pixels, for example, according to the position information of the target pixels, the first target pixels and / or the second target pixels are determined or obtained, the first target pixels and the second target pixels are associated with different first weight information respectively.
[0426] Optionally, the first weight is a gradient adjustment weight, which is used to dynamically adjust the gradient information of the at least one reference region and / or the target pixels in the at least one reference region, and / or is used to dynamically adjust the gradient amplitude of the gradient direction corresponding to the target gradient direction, for example, the gradient amplitude in the gradient information of the target pixel A is adjusted by the first weight, the gradient amplitude of the mode 10 in the gradient histogram is adjusted by the first weight information, so as to optimize the decision process of the prediction mode.
[0427] Optionally, the first target pixel is a pixel that needs to enhance the gradient amplitude, and the first weight associated with the first target pixel is >1; the second target pixel is a pixel that needs to reduce the gradient amplitude, and the first weight associated with the second target pixel is <1.
[0428] Optionally, if the width of the current block is greater than the height, the target pixels (for example, the pixels corresponding to the gradient information and the modes 2-15) with the position information corresponding to the position information one and / or located in the preset range one and / or the reference region one are determined as the first target pixels, the first weight associated with the first target pixels is >1, and the position information one, the preset range one and / or the reference region one correspond to the preset pixel position located above the current block, for example, the reference region one is the upper reference region of the current block.
[0429] Optionally, if the width of the current block is greater than the height, the target pixels (for example, the pixels corresponding to the gradient information and the modes 2-15) with the position information corresponding to the position information two and / or located in the preset range two and / or the reference region two are determined as the second target pixels, the first weight associated with the second target pixels is <1, and the position information two, the preset range two and / or the reference region two correspond to the preset pixel position located on the left side of the current block, for example, referring to FIG. 11, the reference region one is the left reference region of the current block.
[0430] Optionally, if the height of the current block is greater than the width, the target pixels (for example, the pixels corresponding to the gradient information and the modes 53-66) with the position information corresponding to the position information one and / or located in the preset range one and / or the reference region one are determined as the second target pixels, the first weight associated with the second target pixels is <1, and the position information one, the preset range one and / or the reference region one correspond to the preset pixel position located above the current block, for example, referring to FIG. 11, the reference region one is the upper reference region of the current block.
[0431] Optionally, if height of the current block > width of the current block, the position information corresponding to the position information two and / or the position information located in the preset range two and / or the target pixel of the reference region two (for example, the pixel corresponding to the gradient information and the mode 53-66), is determined as the first target pixel, and the first weight associated with the first target pixel > 1. Optionally, the position information two, the preset range two and / or the reference region two correspond to the preset pixel position located on the left side of the current block. For example, referring to FIG. 11, the reference region one is the left reference region of the current block.
[0432] Optionally, the preset range one includes at least one of the following:
[0433] a region composed of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0434] a region composed of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0435] a region composed of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1] and the pixel [3 / 2W, -1];
[0436] a region composed of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1] and the pixel [2W, -1].
[0437] Optionally, the preset range two includes at least one of the following:
[0438] a region composed of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0] and the pixel [-1, 2 / H];
[0439] a region composed of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0440] a region composed of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0441] a region composed of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H].
[0442] In the embodiment, the target pixel can be determined or obtained from the pixel corresponding to the gradient direction with strong contribution to the wide-angle mode according to the gradient direction of the pixel in the at least one reference region, and then the distribution of the determined or obtained gradient histogram is changed by adjusting the gradient information of the target pixel, so as to avoid selecting an inappropriate wide-angle mode and improve the prediction accuracy of the determined or obtained prediction mode of the current block.
[0443] A4, the gradient direction corresponding to the prediction mode in the preset angle range.
[0444] Optionally, the step S10 comprises: determining or obtaining the target pixel in the at least one reference region according to the gradient direction corresponding to the prediction mode in the preset angle range; and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the target pixel in the at least one reference region.
[0445] Optionally, in the coding standard (for example, VVC), the intra prediction modes are divided into a plurality of angle ranges, each mode corresponds to a fixed prediction direction, for example, in the case of taking the horizontal left as the 0° direction, in the counterclockwise direction, the modes 2-34 cover 135°-225°, and each prediction mode (i.e. angle prediction mode) represents a specific prediction direction and / or gradient direction.
[0446] Optionally, the target pixel is determined or obtained according to the pixel in the at least one reference region whose gradient direction matches the gradient direction corresponding to the prediction mode in the preset angle range, and the at least one prediction mode of the current block is determined or obtained according to the gradient information of the target pixel in the at least one reference region.
[0447] Optionally, the target pixel is determined in the case that the width of the current block is not equal to the height.
[0448] Optionally, the target pixel is determined to be the first target pixel or the second target pixel according to the width>height of the current block or the widthheight of the current block.
[0449] Optionally, in the case of taking the horizontal left as the 0° direction, in the counterclockwise direction, the preset angle range is 180°-225°, and the prediction mode in the preset angle range is mode 2-15, so the target pixel can be determined according to the pixel in the at least one reference region whose gradient direction matches (for example, the gradient directions are the same) the gradient direction corresponding to the mode 2-15.
[0450] Optionally, the gradient direction corresponding to the prediction mode in the preset angle range is determined or obtained according to the size of the current block.
[0451] Optionally, if the width>height of the current block, the gradient direction corresponding to the prediction mode in the preset angle range is the gradient direction corresponding to the mode 2-15.
[0452] Optionally, if the height>width of the current block, the gradient direction corresponding to the prediction mode in the preset angle range is the gradient direction corresponding to the mode 53-66.
[0453] Optionally, the step S10 comprises: if the size of the current block satisfies a first condition, determining or obtaining a second condition and / or a gradient direction corresponding to a prediction mode of a preset angle range according to the size of the current block, determining or obtaining a target pixel according to a pixel in the at least one reference region whose position information satisfies the second condition and whose gradient direction matches the gradient direction corresponding to the prediction mode of the preset angle range, and determining or obtaining the at least one prediction mode of the current block according to gradient information of the target pixel in the at least one reference region.
[0454] Optionally, the first condition is satisfied when the width and the height of the current block are not equal (e.g., the width of the current block is greater than the height, or the height is greater than the width) and / or the aspect ratio of the width and the height of the current block is not equal to 1.
[0455] Optionally, the second condition is satisfied when the position information of the pixel corresponds to first position information, the position information of the pixel is located within a first preset range and / or a first reference region, the position information of the pixel does not correspond to second position information, and / or the position information of the pixel is located outside a second preset range and / or a second reference region, the first position information, the first preset range and / or the first reference region correspond to a preset pixel position located on the left side and / or above the current block, and the second position information, the second preset range and / or the second reference region correspond to a preset pixel position located at the top left of the current block.
[0456] Optionally, the third condition is determined or obtained according to the gradient direction corresponding to the prediction mode of the preset angle range, and the third condition comprises at least one of the following:
[0457] The gradient direction corresponds to a first prediction angle mode;
[0458] The gradient direction is located within a first prediction angle range;
[0459] The gradient direction does not correspond to a second prediction angle mode;
[0460] The gradient direction is located outside a second prediction angle range.
[0461] Optionally, at least one of the first prediction angle mode, the first prediction angle range, the second prediction angle mode and the second prediction angle range in the third condition is determined or obtained according to the gradient direction corresponding to the prediction mode of the preset angle range.
[0462] In this embodiment, the target pixel can be determined or obtained from a pixel corresponding to a gradient direction that contributes more to the wide angle mode according to the gradient direction corresponding to the prediction mode of the preset angle range, and then the distribution of the determined or obtained gradient histogram can be changed by adjusting the gradient information of the target pixel, so as to avoid selecting an inappropriate wide angle mode and improve the prediction accuracy of the determined or obtained prediction mode of the current block.
[0463] the adjusted gradient information of the at least one reference region;
[0464] Optionally, the step S10 comprises: determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the at least one reference region.
[0465] Optionally, the adjusted gradient information of the at least one reference region is determined or obtained according to a first weight.
[0466] Optionally, the first weight is a gradient adjustment weight, used for dynamically adjusting the gradient information of the at least one reference region and / or the target pixel in the at least one reference region, and / or used for dynamically adjusting the gradient amplitude of the target gradient direction, for example, adjusting the gradient amplitude in the gradient information of the target pixel A through the first weight, adjusting the gradient amplitude of the gradient direction corresponding to the mode 10 in the gradient histogram through the first weight information, so as to optimize the decision process of the prediction mode.
[0467] Optionally, the first weight comprises: a weight associated with the target pixel and / or a weight associated with the target gradient direction.
[0468] Optionally, the target pixel is a pixel with specific characteristics and / or possibly affecting the selection of the prediction mode, which is selected from the at least one reference region of the current block, and the gradient information of the target pixel can be adjusted, for example, the gradient amplitude in the gradient information of the target pixel is enhanced or weakened, so as to change the distribution of the at least one gradient histogram determined or obtained based on the gradient information of the target pixel and / or the gradient information of the reference region, thereby avoiding selecting an inappropriate prediction mode and improving the prediction accuracy of the prediction mode determined or obtained for the current block.
[0469] Optionally, the target pixel comprises a first target pixel and / or a second target pixel, and the first weight associated with the first target pixel is different from the first weight associated with the second target pixel.
[0470] Optionally, in the case that the width of the current block is not equal to the height, the target pixel is determined.
[0471] Optionally, according to the width>height of the current block or the widthheight of the current block, the target pixel is determined as the first target pixel or the second target pixel.
[0472] Optionally, the first weight associated with the first target pixel is 1.25.
[0473] Optionally, the first weight associated with the second target pixel is 0.75.
[0474] Optionally, the target gradient direction is a gradient direction corresponding to a mode in the non-wide-angle mode having a possibility of being wrongly switched to the wide-angle mode, and / or is a gradient direction of the target pixel, and by adjusting, such as enhancing or weakening, a gradient amplitude of the target gradient direction in the gradient histogram, a probability of the mode corresponding to the target gradient direction being selected as the prediction mode is improved or reduced, so as to avoid selecting a mode corresponding to an inappropriate target gradient direction as the prediction mode, and / or improve a probability of a mode corresponding to an appropriate target gradient direction being selected as the prediction mode.
[0475] Optionally, the target gradient direction is determined or obtained according to a size of the current block, and / or is determined or obtained according to the target pixel.
[0476] Optionally, if the width of the current block is greater than the height, the target gradient direction is a gradient direction corresponding to modes 2-15.
[0477] Optionally, if the height of the current block is greater than the width, the target gradient direction is a gradient direction corresponding to modes 53-66.
[0478] Optionally, the target gradient direction is determined or obtained according to a size of the current block, and a first weight associated with the target gradient direction is determined or obtained according to a position distribution of gradient information of the at least one reference region and / or a position distribution of the target pixel in the at least one reference region.
[0479] Optionally, step S10 comprises: determining or obtaining at least one gradient histogram according to the adjusted gradient information of the at least one reference region determined or obtained by the first weight, and determining or obtaining the at least one prediction mode of the current block according to the at least one gradient histogram.
[0480] Optionally, step S10 comprises: determining or obtaining at least one gradient histogram according to the adjusted gradient information of the at least one reference region determined or obtained by the first weight, determining or obtaining at least one candidate mode according to the at least one gradient histogram, and determining or obtaining the at least one prediction mode of the current block according to matching information related to the at least one candidate mode and the at least one reference region.
[0481] Optionally, step S10 comprises: determining or obtaining at least one initial gradient histogram according to gradient information of the at least one reference region of the current block, adjusting a gradient amplitude of a target gradient direction in the at least one initial gradient histogram according to the first weight to determine or obtain adjusted gradient information of the target gradient direction, determining or obtaining at least one adjusted gradient histogram according to the adjusted gradient information of the target gradient direction, and determining or obtaining the at least one prediction mode of the current block according to the at least one adjusted gradient histogram.
[0482] Optionally, if the width of the current block is greater than the height, the gradient information of modes 2-15 in the at least one initial gradient histogram is adjusted according to the first weight, adjusted gradient information of the target gradient direction is determined or obtained according to the adjusted gradient information of the target gradient direction, at least one adjusted gradient histogram is determined or obtained according to the at least one adjusted gradient histogram, and at least one prediction mode of the current block is determined or obtained according to the at least one adjusted gradient histogram.
[0483] Optionally, if the height of the current block is greater than the width, the gradient information of modes 53-66 in the at least one initial gradient histogram is adjusted according to the first weight, adjusted gradient information of the target gradient direction is determined or obtained according to the adjusted gradient information of the target gradient direction, at least one adjusted gradient histogram is determined or obtained according to the at least one adjusted gradient histogram, and at least one prediction mode of the current block is determined or obtained according to the at least one adjusted gradient histogram.
[0484] Optionally, the distribution of the gradient information of the reference region can be adjusted by the first weight, so that the gradient histogram determined or obtained can more accurately reflect the real texture of the current block, and the wide-angle mode or other unmatched prediction directions are avoided from being triggered by mistake.
[0485] Optionally, the adjusted gradient information of the at least one reference region includes: adjusted pixel gradient information determined or obtained according to the adjustment of the gradient information of the target pixel in the at least one reference region according to the first weight, and adjusted gradient information of the target gradient direction determined or obtained according to the adjustment of the gradient information of the target gradient direction in the at least one gradient histogram according to the first weight.
[0486] Optionally, the adjusted gradient information of the at least one reference region is determined or obtained according to the gradient information of the target pixel in the at least one reference region.
[0487] Optionally, the adjusted gradient information of the target pixel in the at least one reference region is determined or obtained according to the adjustment of the gradient information of the target pixel in the at least one reference region according to the first weight, and at least one prediction mode is determined or obtained according to the adjusted gradient information of the target pixel in the at least one reference region.
[0488] Optionally, the adjusted gradient information of the target pixel in the at least one reference region is determined or obtained according to the adjustment of the gradient information of the target pixel associated with the first weight in the at least one reference region according to the first weight.
[0489] Optionally, the first weight information associated with different target pixels in the at least one reference region is the same or different.
[0490] Optionally, the gradient information of the target pixel in the at least one reference region is adjusted according to the first weight, and adjusted gradient information of the target pixel in the at least one reference region is determined or obtained; and the at least one prediction mode is determined or obtained according to the adjusted gradient information of the target pixel in the at least one reference region and / or the original gradient information of the non-target pixel.
[0491] In the embodiment, the gradient information of the target pixel having the specific characteristics and / or possibly affecting the prediction mode selection is adjusted by the first weight, so as to change the distribution of the at least one gradient histogram determined or obtained based on the gradient information of the pixels (e.g., the target pixel and / or the non-target pixel) in the at least one reference region, thereby avoiding selecting an inappropriate prediction mode and improving the prediction accuracy of the determined or obtained prediction mode of the current block.
[0492] Optionally, the first weight includes at least one of a weight coefficient, a weight vector and a weight matrix, and the first weight can be a preset fixed value (e.g., 0.7), and / or the above weight value can be adaptively adjusted according to different scenes, and optionally, different weight values are set according to the size of the image block (e.g., if the image block is 16*8, the first weight associated with the second target pixel is 0.9, and if the image block is 64*32, the first weight associated with the second target pixel is 0.8).
[0493] Optionally, the first weight is determined or obtained according to the position distribution of the gradient information of the at least one reference region and / or the position distribution of the target pixel.
[0494] Optionally, the position distribution of the target pixel is the spatial distribution of the target pixel determined or obtained from the reference region, and the position distribution of the target pixel includes position information of the at least one target pixel.
[0495] Optionally, the position information of the target pixel is located in the first reference region, and if the width of the current block is greater than the height, the first reference region includes at least one of the following:
[0496] a region composed of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0497] a region composed of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0498] a region composed of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1] and the pixel [3 / 2W, -1];
[0499] a region composed of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1] and the pixel [2W, -1];
[0500] a region consisting of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0], and the pixel [-1, 2 / H];
[0501] a region consisting of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H], and the pixel [-1, H];
[0502] a region consisting of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H], and the pixel [-1, 3 / 2H];
[0503] a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H], and the pixel [-1, 2H].
[0504] Optionally, if the position information of the target pixel A is located in a first target region, for example, in a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1], and the pixel [2 / W, -1], the target pixel A belongs to a first target pixel, and a first weight of the target pixel A is greater than 1, for example, the first weight is 1.3. If the position of the target pixel B is located in a second target region, for example, in a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H], and the pixel [-1, 2H], the target pixel B belongs to a second target pixel, and a first weight of the target pixel B is less than 1, for example, the first weight is 0.7.
[0505] Optionally, the position information of the target pixel is located in a first reference region, and if the width of the current block is less than the height, the first reference region includes at least one of the following:
[0506] a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1], and the pixel [2 / W, -1];
[0507] a region consisting of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1], and the pixel [W, -1];
[0508] a region consisting of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1], and the pixel [3 / 2W, -1];
[0509] a region consisting of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1], and the pixel [2W, -1];
[0510] a region consisting of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0], and the pixel [-1, 2 / H];
[0511] a region consisting of pixel [-3, 3 / 2H], pixel [-3, 2H], [-1, 3 / 2H], and pixel [-1, 2H];
[0512] a region consisting of pixel [-3, 3 / 2H], pixel [-3, 2H], [-1, 3 / 2H], and pixel [-1, 2H];
[0513] a region consisting of pixel [-3, 3 / 2H], pixel [-3, 2H], [-1, 3 / 2H], and pixel [-1, 2H].
[0514] Optionally, if the position of the target pixel A is located in the first target region, for example, in a region consisting of pixel [-3, 3 / 2H], pixel [-3, 2H], [-1, 3 / 2H], and pixel [-1, 2H], the target pixel A belongs to the first target pixel, and the first weight of the target pixel A is greater than 1, for example, the first weight is 1.3; if the position of the target pixel B is located in the second target region, for example, in a region consisting of pixel [0, -3], pixel [2 / W, -3], [0, -1], and pixel [2 / W, -1], the target pixel B belongs to the second target pixel, and the first weight of the target pixel B is less than 1, for example, the first weight is 0.7.
[0515] Optionally, if the width of the current block is greater than the height, the first reference region comprises at least one of the following:
[0516] a region consisting of pixel [0, -3], pixel [2 / W, -3], [0, -1], and pixel [2 / W, -1];
[0517] a region consisting of pixel [2 / W, -3], pixel [W, -3], [2 / W, -1], and pixel [W, -1];
[0518] a region consisting of pixel [W, -3], pixel [3 / 2W, -3], [W, -1], and pixel [3 / 2W, -1];
[0519] a region consisting of pixel [3 / 2W, -3], pixel [2W, -3], [3 / 2W, -1], and pixel [2W, -1];
[0520] a region consisting of pixel [-3, 0], pixel [-3, 2 / H], [-1, 0], and pixel [-1, 2 / H];
[0521] a region consisting of pixel [-3, 2 / H], pixel [-3, H], [-1, 2 / H], and pixel [-1, H];
[0522] a region consisting of pixel [-3, H], pixel [-3, 3 / 2H], [-1, H], and pixel [-1, 3 / 2H];
[0523] a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H].
[0524] Optionally, the target gradient direction comprises: the gradient direction corresponding to the mode 2-15, if the gradient direction corresponding to the mode 2-15 in the gradient histogram of the first reference region is mainly located in the first target region, for example, is located in a region consisting of the pixel [0, -3], the pixel [2 / W, -3], [0, -1], the pixel [2 / W, -1], then the first weight associated with the mode is >1, for example, the first weight is 1.3, if the gradient direction corresponding to the mode 2-15 in the gradient histogram of the first reference region is mainly located in the second target region, for example, is located in a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], [-1, 3 / 2H], the pixel [-1, 2H], then the first weight associated with the mode is <1, for example, the first weight is 0.7.
[0525] Optionally, the target gradient direction comprises: the gradient direction corresponding to the mode 2-15, the gradient amplitude of the gradient direction corresponding to the mode 2-15 in the gradient histogram of the first reference region is adjusted by the determined first weight, to obtain the adjusted gradient amplitude of the gradient direction corresponding to the mode 2-15 in the gradient histogram of the first reference region, at least one gradient histogram is determined or obtained according to the adjusted gradient amplitude, at least one candidate mode or at least one prediction mode is determined or obtained according to the at least one gradient histogram.
[0526] Optionally, if the width of the current block < the height, the first reference region comprises at least one of the following:
[0527] a region consisting of the pixel [0, -3], the pixel [2 / W, -3], [0, -1], the pixel [2 / W, -1];
[0528] a region consisting of the pixel [2 / W, -3], the pixel [W, -3], [2 / W, -1], the pixel [W, -1];
[0529] a region consisting of the pixel [W, -3], the pixel [3 / 2W, -3], [W, -1], the pixel [3 / 2W, -1];
[0530] a region consisting of the pixel [3 / 2W, -3], the pixel [2W, -3], [3 / 2W, -1], the pixel [2W, -1];
[0531] a region consisting of the pixel [-3, 0], the pixel [-3, 2 / H], [-1, 0], the pixel [-1, 2 / H];
[0532] a region consisting of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0533] a region consisting of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0534] a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H].
[0535] Optionally, the target gradient direction comprises: a gradient direction corresponding to the mode 53-66, if the gradient direction corresponding to the mode 53-66 in the gradient histogram of the first reference region is mainly located in the first target region, for example, is located in a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H], the first weight of the gradient direction is >1, for example, the first weight is 1.3, if the gradient direction corresponding to the mode 53-66 in the gradient histogram of the first reference region is mainly located in the second target region, for example, is located in a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1], the first weight of the gradient direction is <1, for example, the first weight is 0.7.
[0536] Optionally, the target gradient direction comprises: a gradient direction corresponding to the mode 53-66, the gradient amplitude of the gradient direction corresponding to the mode 53-66 in the gradient histogram of the first reference region is adjusted by the determined first weight, to obtain an adjusted gradient amplitude of the gradient direction corresponding to the mode 53-66 in the gradient histogram of the first reference region, at least one gradient histogram is determined or obtained according to the adjusted gradient amplitude, and at least one candidate mode or at least one prediction mode is determined or obtained according to the at least one gradient histogram.
[0537] Optionally, the target pixel comprises a first pixel and / or a second pixel, the gradient information of the first pixel satisfies a first position condition, and the gradient information of the second pixel satisfies a second position condition.
[0538] Optionally, the first position condition comprises: the first pixel is located in the first target region.
[0539] Optionally, the second position condition comprises: the second pixel is located in the second target region.
[0540] Optionally, if the width of the current block is greater than the height, the first target region is at least one of a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1], the pixel [2 / W, -1], a region consisting of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1], the pixel [W, -1], a region consisting of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1], the pixel [3 / 2W, -1], or a region consisting of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1], the pixel [2W, -1]; and the second target region is at least one of a region consisting of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0], the pixel [-1, 2 / H], a region consisting of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H], the pixel [-1, H], a region consisting of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H], the pixel [-1, 3 / 2H], or a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H], the pixel [-1, 2H].
[0541] Optionally, if the width of the current block is less than the height, the first target region is at least one of a region consisting of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0], the pixel [-1, 2 / H], a region consisting of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H], the pixel [-1, H], a region consisting of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H], the pixel [-1, 3 / 2H], or a region consisting of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H], the pixel [-1, 2H]; and the second target region is at least one of a region consisting of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1], the pixel [2 / W, -1], a region consisting of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1], the pixel [W, -1], a region consisting of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1], the pixel [3 / 2W, -1], or a region consisting of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1], the pixel [2W, -1].
[0542] Optionally, the size of the current block and the position distribution of the target pixels determine or obtain the first weight associated with at least one target pixel (e.g., the first pixel and / or the second pixel).
[0543] Optionally, if the width of the current block is greater than the height, and the gradient direction of the at least one first pixel is one of the gradient directions corresponding to modes 2-15, a first weight associated with the at least one first pixel in the target pixel is determined or obtained, the adjusted gradient information of the at least one first pixel is determined or obtained according to the first weight, and the at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information of the at least one first pixel.
[0544] Optionally, determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the at least one first pixel comprises: determining or obtaining a gradient histogram according to the adjusted gradient information of the at least one first pixel, and determining or obtaining the at least one prediction mode of the current block according to the gradient histogram.
[0545] Optionally, the gradient information comprises a gradient direction and a gradient magnitude.
[0546] Optionally, if the first weight is 1.1 and the gradient magnitude of the first pixel is 50, the adjusted gradient magnitude of the first pixel is 55, a gradient histogram is determined or obtained according to the adjusted gradient magnitude of the first pixel, and the prediction mode corresponding to the gradient direction with the highest gradient magnitude in the gradient histogram is taken as the at least one prediction mode of the current block.
[0547] Optionally, if the height of the current block is greater than the width, and the gradient direction of the at least one second pixel is one of the gradient directions corresponding to modes 2-15, a first weight associated with the at least one second pixel in the target pixel is determined or obtained, the adjusted gradient information of the at least one second pixel is determined or obtained according to the first weight, and the at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information of the at least one second pixel.
[0548] Optionally, determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the at least one second pixel comprises: determining or obtaining a gradient histogram according to the adjusted gradient information of the at least one second pixel, and determining or obtaining the at least one prediction mode of the current block according to the gradient histogram.
[0549] Optionally, the gradient information comprises a gradient direction and a gradient magnitude.
[0550] Optionally, if the first weight is 0.9 and the gradient magnitude of the first pixel is 50, the adjusted gradient magnitude of the second pixel is 45, a gradient histogram is determined or obtained according to the adjusted gradient magnitude of the second pixel, and the prediction mode corresponding to the gradient direction with the highest gradient magnitude in the gradient histogram is taken as the at least one prediction mode of the current block.
[0551] Optionally, if the gradient direction of the at least one first pixel is one of the gradient directions corresponding to the modes 53-66, and the width of the current block is less than the height, the first weight associated with the at least one first pixel is determined or obtained, the adjusted gradient information of the at least one first pixel is determined or obtained according to the first weight, and the at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information of the at least one first pixel.
[0552] Optionally, the determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the at least one first pixel comprises: determining or obtaining a gradient histogram according to the adjusted gradient information of the at least one first pixel, and determining or obtaining the at least one prediction mode of the current block according to the gradient histogram.
[0553] Optionally, the gradient information comprises a gradient direction and a gradient magnitude.
[0554] Optionally, if the first weight is 1.1 and the gradient magnitude of the first pixel is 50, the adjusted gradient magnitude of the first pixel is 55, a gradient histogram is determined or obtained according to the adjusted gradient magnitude of the first pixel, and the prediction mode corresponding to the gradient direction with the highest gradient magnitude in the gradient histogram is taken as the at least one prediction mode of the current block.
[0555] Optionally, if the gradient direction of the at least one second pixel is one of the gradient directions corresponding to the modes 53-66, and the height of the current block is less than the width, the first weight associated with the at least one second pixel is determined or obtained, the adjusted gradient information of the at least one second pixel is determined or obtained according to the first weight, and the at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information of the at least one second pixel.
[0556] Optionally, the determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the at least one second pixel comprises: determining or obtaining a gradient histogram according to the adjusted gradient information of the at least one second pixel, and determining or obtaining the at least one prediction mode of the current block according to the gradient histogram.
[0557] Optionally, the gradient information comprises a gradient direction and a gradient magnitude.
[0558] Optionally, if the first weight is 0.9 and the gradient magnitude of the first pixel is 50, the adjusted gradient magnitude of the second pixel is 45, a gradient histogram is determined or obtained according to the adjusted gradient magnitude of the second pixel, and the prediction mode corresponding to the gradient direction with the highest gradient magnitude in the gradient histogram is taken as the at least one prediction mode of the current block.
[0559] Optionally, if the width of the current block is greater than the height, according to the position distribution of the target pixel, a first weight (e.g., the first weight > 1) associated with the position information one and at least one first pixel of the position information one located in the preset range one and / or the reference region one is determined or obtained, optionally, the position information one, the preset range one and / or the reference region one correspond to a preset pixel position located above the current block, for example, the reference region one is an upper reference region of the current block.
[0560] Optionally, in the case that the coordinates of the current block are [0, 0], if the width of the current block is greater than the height, the position information one is a coordinate information, for example, the position information is [x, y], x > 0 and x < 2 / W, y > -3 and y < -1, and the determined first weight is a weight greater than 1, for example, the weight is 1.1.
[0561] Optionally, in the case that the coordinates of the current block are [0, 0], if the width of the current block is greater than the height, the prediction range one is a horizontal coordinate range of the pixel, and the horizontal coordinate range of the pixel includes at least one of 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W, and the determined first weight is a weight greater than 1, for example, the weight is 1.1.
[0562] Optionally, in the case that the coordinates of the current block are [0, 0], if the width of the current block is greater than the height, the reference region one is at least one of a region composed of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1], the pixel [2 / W, -1], a region composed of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1], the pixel [W, -1], a region composed of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1], the pixel [3 / 2W, -1], a region composed of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1], the pixel [2W, -1], a region composed of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0], the pixel [-1, 2 / H], and the determined first weight is a weight greater than 1, for example, the weight is 1.1.
[0563] Optionally, if the width of the current block is greater than the height, according to the position distribution of the target pixel, a first weight (e.g., the first weight < 1) associated with the position information two and at least one first pixel of the position information two located in the preset range two and / or the reference region two is determined or obtained, optionally, the position information two, the preset range two and / or the reference region two correspond to a preset pixel position located on the left side of the current block, for example, referring to FIG. 11, the reference region two is a left reference region of the current block.
[0564] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is greater than the height, the position information is coordinate information, for example, the position information is [x, y], x > -3 and x < -1, y > 0 and y < 2 / H, and the determined first weight is a weight less than 1, for example, the weight is 0.9.
[0565] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is greater than the height, the prediction range one is a vertical coordinate range of a pixel, and the vertical coordinate range of the pixel includes at least one of 0-2 / H, 2 / H-H, H-3 / 2H, and 3 / 2H-2H, and the determined first weight is a weight less than 1, for example, the weight is 0.9.
[0566] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is greater than the height, the reference region one is at least one of a region composed of pixels [-3, 0], pixels [-3, 2 / H], [-1, 0], pixels [-1, 2 / H], a region composed of pixels [-3, 2 / H], pixels [-3, H], [-1, 2 / H], pixels [-1, H], a region composed of pixels [-3, H], pixels [-3, 3 / 2H], [-1, H], pixels [-1, 3 / 2H], and a region composed of pixels [-3, 3 / 2H], pixels [-3, 2H], [-1, 3 / 2H], pixels [-1, 2H], and the determined first weight is a weight less than 1, for example, the weight is 0.9.
[0567] Optionally, if the width of the current block is less than the height, according to the position distribution of the target pixel, a first weight (for example, the first weight is greater than 1) associated with at least one first pixel corresponding to the position information one and / or the position information in the preset range one and / or the reference region one of the target pixel is determined or obtained, and optionally, the position information one, the preset range one and / or the reference region one correspond to a preset pixel position located above the current block, for example, the reference region one is a left reference region of the current block.
[0568] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is less than the height, the position information one is coordinate information, for example, the position information is [x, y], x > -3 and x < -1, y > 0 and y < 2 / H, and the determined first weight is a weight greater than 1, for example, the weight is 1.1.
[0569] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is less than the height, the prediction range one is a vertical coordinate range of a pixel, and the vertical coordinate range of the pixel includes at least one of 0-2 / H, 2 / H-H, H-3 / 2H, and 3 / 2H-2H, and the determined first weight is a weight greater than 1, for example, the weight is 1.1.
[0570] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is less than the height, the first weight determined is a weight greater than 1, for example, the weight is 1.1, in at least one of the following cases: the reference region one is a region composed of pixels [-3, 0], [-3, 2 / H], [-1, 0], [-1, 2 / H], a region composed of pixels [-3, 2 / H], [-3, H], [-1, 2 / H], [-1, H], a region composed of pixels [-3, H], [-3, 3 / 2H], [-1, H], [-1, 3 / 2H], and a region composed of pixels [-3, 3 / 2H], [-3, 2H], [-1, 3 / 2H], [-1, 2H].
[0571] Optionally, if the width of the current block is less than the height, according to the position distribution of the target pixel, a first weight (for example, the first weight <1) corresponding to the position information in the target pixel and the position information two and / or the position information in the preset range two and / or at least one first pixel in the reference region two is determined or obtained, optionally, the position information two, the preset range two and / or the reference region two correspond to the preset pixel position located on the left side of the current block, for example, referring to FIG. 11, the reference region two is the upper reference region of the current block.
[0572] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is less than the height, the first weight determined is a weight less than 1, for example, the weight is 0.9, in the case that the position information one is a coordinate information, for example, the position information is [x, y], x>0 and x<2 / W, y>-3 and y<-1.
[0573] Optionally, in the case that the coordinate of the current block is [0, 0], if the width of the current block is less than the height, the first weight determined is a weight less than 1, for example, the weight is 0.9, in the case that the prediction range one is a horizontal coordinate range of pixels, and the horizontal coordinate range of pixels includes at least one of the following: 0~2 / W, 2 / W~W, W~3 / 2W, 3 / 2W~2W.
[0574] Optionally, in the case that the coordinates of the current block are [0, 0], if the width of the current block is less than the height, the reference region one is at least one of the following regions: a region composed of pixels [0, -3], [2 / W, -3], [0, -1], [2 / W, -1], a region composed of pixels [2 / W, -3], [W, -3], [2 / W, -1], [W, -1], a region composed of pixels [W, -3], [3 / 2W, -3], [W, -1], [3 / 2W, -1], a region composed of pixels [3 / 2W, -3], [2W, -3], [3 / 2W, -1], [2W, -1], a region composed of pixels [-3, 0], [-3, 2 / H], [-1, 0], [-1, 2 / H], and the determined first weight is a weight less than 1, for example, the weight is 0.9.
[0575] Optionally, the pixels in the at least one reference region whose gradient directions satisfy a third condition are determined as target pixels.
[0576] Optionally, if the width of the current block is greater than the height, the third condition includes that the gradient direction corresponds to a first prediction angle mode, the gradient direction is located in a first prediction angle range, the gradient direction does not correspond to a second prediction angle mode, and / or the gradient direction is located outside a second prediction angle range, the first prediction angle mode and / or the first prediction angle range are determined or obtained according to modes 2-15, and the second prediction angle mode and / or the second prediction angle range are determined or obtained according to modes other than modes 2-15, so that if the width of the current block is greater than the height, the target pixels are the first pixels (for example, the pixels whose gradient information correspond to modes 2-15).
[0577] Optionally, if the width of the current block is less than the height, the third condition includes that the gradient direction corresponds to a first prediction angle mode, the gradient direction is located in a first prediction angle range, the gradient direction does not correspond to a second prediction angle mode, and / or the gradient direction is located outside a second prediction angle range, the first prediction angle mode and / or the first prediction angle range are determined or obtained according to modes 53-66, and the second prediction angle mode and / or the second prediction angle range are determined or obtained according to modes other than modes 53-66, so that if the width of the current block is less than the height, the target pixels are the first pixels (for example, the pixels whose gradient information correspond to modes 53-66).
[0578] Optionally, in the present embodiment, the target pixels (i.e., the first target pixels) associated with the first weight greater than 1 can be determined in the above manner, the gradient amplitudes of the target pixels conform to the expected direction of the current block, so that the gradient amplitudes of the target pixels can be enhanced by the first weight greater than 1 to improve the selection probability of the prediction mode corresponding to the gradient direction of the target pixels.
[0579] Optionally, in the embodiment, the target pixels (i.e. the second target pixels) having the first weight <1 and being at least partially associated can be determined by the above-mentioned manner, and the gradient amplitudes of the target pixels do not conform to the expected direction of the current block, thus the gradient amplitudes of the target pixels can be weakened by the first weight <1, and the selection probability of the prediction mode corresponding to the gradient direction of the target pixels can be reduced.
[0580] Optionally, in the embodiment, the target pixels having the first weight >1 and being at least partially associated and the target pixels having the first weight <1 and being at least partially associated can be determined by the above-mentioned manner at the same time, and the matching degree of the prediction mode and the current block can be improved by the dual adjustment of the gradient amplitude enhancement and the gradient amplitude weakening.
[0581] Optionally, the position distribution of the gradient information of the at least one reference region is the spatial distribution of the at least one gradient direction in the reference region.
[0582] Optionally, according to the gradient information of the at least one reference region of the current block, at least one gradient histogram is determined or obtained, and according to the at least one gradient histogram, the position distribution of the gradient information of the at least one reference region is determined or obtained.
[0583] Optionally, the at least one reference region of the current block can be divided into at least one sub-region, the gradient histogram of the at least one sub-region is determined or obtained, and thus the position distribution of the gradient information in the reference region is determined or obtained according to the gradient histogram of the at least one sub-region, and according to the position distribution of the gradient information in the reference region, it can be obtained that, for example, the target gradient direction is distributed in which sub-regions, and the main distribution region of the target gradient direction is which sub-region.
[0584] Optionally, according to the size of the current block, the target gradient direction is determined or obtained, the gradient histogram of the at least one reference region is determined or obtained, the position distribution of the gradient information of the target gradient direction is determined or obtained according to the at least one gradient histogram, the first weight is determined according to the position distribution of the gradient information of the target gradient direction, the adjusted gradient information of the target gradient direction is determined or obtained according to the first weight, and the at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information.
[0585] Optionally, if the width of the current block > the height, the target gradient direction is the gradient direction corresponding to the modes 2-15.
[0586] Optionally, if the width of the current block < the height, the target gradient direction is the gradient direction corresponding to the modes 53-66.
[0587] Optionally, the reference region A of the current block comprises a sub-region B located above the current block and / or a sub-region C located left of the current block, for example, referring to FIG. 11, the above reference region is the sub-region C and the left reference region is the sub-region C, the determining or obtaining the gradient histogram of the at least one reference region comprises: determining or obtaining the gradient histogram of the sub-region B located above the current block, determining or obtaining the gradient histogram of the sub-region C located left of the current block and / or determining or obtaining the gradient histogram of the reference region A.
[0588] Optionally, the determining or obtaining the position distribution of the gradient information of the target gradient direction according to the position distribution of the gradient information of the at least one reference region comprises: determining or obtaining a main distribution region of the target gradient direction.
[0589] Optionally, the determining or obtaining the main distribution region of the target gradient direction according to the gradient information of the at least one reference region of the current block.
[0590] Optionally, the at least one reference region comprises at least one sub-region, the determining or obtaining the gradient amplitude of the target gradient direction in the at least one reference region according to the gradient information of the at least one reference region of the current block, the determining or obtaining a gradient amplitude threshold according to the gradient amplitude of the target gradient direction in the at least one reference region, and the determining or obtaining the main distribution region of the target gradient direction from the at least one sub-region according to the gradient amplitude threshold and the gradient information of the at least one sub-region.
[0591] Optionally, the determining or obtaining the gradient amplitude threshold according to 70% of the gradient amplitudes in the at least one reference region.
[0592] Optionally, the determining or obtaining the main distribution region of the target gradient direction from the at least one sub-region according to the gradient amplitude threshold and the gradient information of the at least one sub-region comprises: determining or obtaining the region in the at least one sub-region where the gradient amplitude of the target gradient direction is greater than the gradient amplitude threshold as the main distribution region.
[0593] Optionally, the determining or obtaining the main distribution region of the target gradient direction from the at least one sub-region according to the gradient amplitude threshold and the gradient information of the at least one sub-region comprises: determining or obtaining the sub-region in the at least one sub-region where the gradient amplitude of the target gradient direction is the largest as the main distribution region.
[0594] Optionally, the determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the target gradient direction comprises: determining or obtaining the at least one prediction mode of the current block according to the adjusted gradient information of the target gradient direction.
[0595] Optionally, if the width of the current block is greater than the height, the target gradient direction is the gradient direction corresponding to modes 2-15, and if the main distribution area of the target gradient direction is determined or obtained to be sub-area C on the left side of the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is less than 1 (for example, the first weight is 0.7), and if the main distribution area of the target gradient direction is determined or obtained to be sub-area B above the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is greater than 1 (for example, the first weight is 1.1).
[0596] Optionally, if the height of the current block is greater than the width, the target gradient direction is the gradient direction corresponding to modes 53-66, and if the main distribution area of the target gradient direction is determined or obtained to be sub-area C on the left side of the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is greater than 1 (for example, the first weight is 1.1), and if the main distribution area of the target gradient direction is determined or obtained to be sub-area B above the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is less than 1 (for example, the first weight is 0.7).
[0597] Optionally, the reference area A includes sub-area B and sub-area C, and the manner of determining the position distribution of the gradient information of the target gradient direction according to at least one gradient histogram includes at least one of the following:
[0598] If the width of the current block is greater than the height, whether the main distribution area of the gradient information of the target gradient direction is sub-area C or sub-area C is determined according to the reference area A, sub-area C and / or sub-area C, if the main distribution area of the gradient information of the target gradient direction is sub-area C, the first weight is greater than 1, for example, the first weight is 1.3, and if the main distribution area of the gradient information of the target gradient direction is sub-area C, the first weight is less than 1, for example, the first weight is 0.7.
[0599] If the width of the current block is less than the height, whether the main distribution area of the gradient information of the target gradient direction is sub-area B or sub-area C is determined according to the reference area A including sub-area B and sub-area C, if the main distribution area of the gradient information of the target gradient direction is sub-area C, the first weight is greater than 1, for example, the first weight is 1.3, and if the main distribution area of the gradient information of the target gradient direction is sub-area C, the first weight is less than 1, for example, the first weight is 0.7.
[0600] Optionally, the gradient histogram of the sub-region B and the gradient histogram of the sub-region C are determined or obtained, and a main distribution region of the gradient information of the target gradient direction is determined or obtained according to the gradient histogram of the sub-region B and the gradient histogram of the sub-region C, for example, if the gradient amplitude of the target gradient direction in the sub-region C is greater than the gradient amplitude of the target gradient direction in the sub-region C, the main distribution region of the gradient information of the target gradient direction is the sub-region C.
[0601] Optionally, the gradient histogram of the sub-region C, the gradient histogram of the sub-region C and the gradient histogram of the reference region A are determined or obtained, and a main distribution region of the gradient information of the target gradient direction is determined according to the gradient histogram of the sub-region C, the gradient histogram of the sub-region C and the gradient histogram of the reference region A, for example, if the gradient amplitude of the target gradient direction in the sub-region C is greater than a preset percentage (for example, seventy percent) of the gradient amplitude of the target gradient direction in the reference region A, the main distribution region of the gradient information of the target gradient direction is the sub-region C; if the gradient amplitude of the target gradient direction in the sub-region C is greater than a preset percentage (for example, seventy percent) of the gradient amplitude of the target gradient direction in the reference region A, the main distribution region of the gradient information of the target gradient direction is the sub-region C.
[0602] Optionally, the adjusted gradient information of the target gradient direction is determined or obtained according to the first weight, including: taking the gradient amplitude obtained by multiplying the gradient amplitude corresponding to the target gradient direction by the first weight as the adjusted gradient amplitude.
[0603] Optionally, at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information, including: obtaining an adjusted gradient histogram according to the adjusted gradient information, and determining or obtaining at least one prediction mode of the current block according to the adjusted gradient histogram.
[0604] Optionally, in the adjusted gradient histogram, the prediction modes corresponding to the N gradient directions with the largest gradient amplitudes are selected as at least one prediction mode (for example, candidate mode) of the current block, or at least one prediction mode of the current block is determined or obtained by using the prediction modes corresponding to the N gradient directions with the largest gradient amplitudes.
[0605] In the embodiment, the first weight of at least one target pixel in the reference region can be determined or obtained according to the position distribution of the gradient information of the at least one reference region and / or the position distribution of the target pixel, and the gradient amplitude of the pixel conforming to the expected direction of the current block can be enhanced and / or the gradient amplitude of the pixel not conforming to the expected direction of the current block can be reduced by the first weight, so as to improve the matching degree of the prediction mode determined or obtained based on the above manner and the current block.
[0606] Fourthly, the position distribution of the target pixel in the at least one reference region;
[0607] Optionally, the position distribution of the target pixels is a spatial distribution of the target pixels determined or obtained from the reference region, and the position distribution of the target pixels includes position information of at least one target pixel.
[0608] Optionally, the position distribution of the target pixels is determined or obtained according to gradient information of the at least one reference region.
[0609] Optionally, the step S10 includes: determining or obtaining at least one prediction mode of the current block according to the position distribution of the target pixels in the at least one reference region.
[0610] Optionally, the step S10 includes: determining or obtaining at least one gradient histogram according to the position distribution of the target pixels in the at least one reference region, and determining or obtaining at least one prediction mode of the current block according to the at least one gradient histogram.
[0611] Optionally, the step S10 includes: determining or obtaining at least one gradient histogram according to the position distribution of the target pixels in the at least one reference region, determining or obtaining at least one candidate mode according to the at least one gradient histogram, and determining or obtaining at least one prediction mode of the current block according to matching information of the at least one candidate mode and the at least one reference region.
[0612] Optionally, the target gradient direction is determined or obtained according to the target pixels, the first weight associated with the target gradient direction is determined or obtained according to the position distribution of the target pixels in the at least one reference region, the adjusted gradient information of the target gradient direction is determined or obtained according to the first weight, and at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information.
[0613] Optionally, the adjusted gradient information of the target gradient direction is determined or obtained according to the first weight, at least one adjusted gradient histogram is determined or obtained according to the adjusted gradient information, and at least one prediction mode of the current block is determined or obtained according to the at least one adjusted gradient histogram.
[0614] Optionally, the main distribution region of the target gradient direction is determined or obtained according to the position distribution of the target pixels in the at least one reference region, and the first weight is determined or obtained according to the main distribution region of the target gradient direction.
[0615] Optionally, the at least one reference region of the current block includes a sub-region C located on the left side of the current block and a sub-region B located above the current block.
[0616] Optionally, the main distribution region of the target gradient direction is the sub-region B and / or the sub-region C in the at least one reference region of the current block.
[0617] Optionally, the range of the sub-region C located at the left side of the current block comprises at least one of the following:
[0618] a region composed of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0] and the pixel [-1, 2 / H];
[0619] a region composed of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0620] a region composed of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0621] a region composed of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H].
[0622] Optionally, the range of the sub-region B located above the current block comprises at least one of the following:
[0623] a region composed of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0624] a region composed of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0625] a region composed of the pixel [W, -3], the pixel [3 / 2W, -3], the pixel [W, -1] and the pixel [3 / 2W, -1];
[0626] a region composed of the pixel [3 / 2W, -3], the pixel [2W, -3], the pixel [3 / 2W, -1] and the pixel [2W, -1].
[0627] Optionally, the gradient direction of the target pixel is a target gradient direction, according to the position distribution of the target pixel in at least one reference region, a direction distribution proportion of the target gradient direction in the sub-region B and / or the sub-region C is determined or obtained, and according to the direction distribution proportion of the target gradient direction in the sub-region B and / or the sub-region C, a main distribution region of the target gradient direction is determined or obtained.
[0628] Optionally, according to the gradient information of at least one reference region of the current block, a direction distribution proportion of the target gradient direction in the reference region is determined or obtained, and according to the direction distribution proportion of the target gradient direction in the reference region, a direction distribution proportion threshold is determined or obtained.
[0629] Optionally, the direction distribution proportion threshold is determined or obtained according to 70% of the direction distribution proportion of the target gradient direction in the reference region.
[0630] Optionally, according to the direction distribution proportion of the target gradient direction in the sub-region B and / or the sub-region C, and the direction distribution proportion threshold, a main distribution region of the target gradient direction is determined or obtained, for example, the sub-region with the direction distribution proportion greater than the direction distribution proportion threshold is determined or the main distribution region.
[0631] Optionally, the sub-region with the largest direction distribution proportion is determined as the main distribution region of the target gradient direction.
[0632] Optionally, according to the main distribution region of the target gradient direction, a manner of determining or obtaining the first weight associated with the target gradient direction comprises: if the width of the current block is greater than the height, the gradient direction corresponding to the target pixel is the direction corresponding to the modes 2-15, i.e., the target gradient direction is also the gradient direction corresponding to the modes 2-15, if the position distribution of the gradient information of the target pixel determines or obtains the main distribution region of the target gradient direction as the sub-region C located on the left side of the current block, the first weight is less than 1 (for example, the first weight is 0.7), and if the position distribution of the gradient information of the target pixel determines or obtains the main distribution region of the target gradient direction as the sub-region B located on the top of the current block, the first weight is greater than 1 (for example, the first weight is 1.1).
[0633] Optionally, according to the main distribution region of the target gradient direction, a manner of determining or obtaining the first weight associated with the target gradient direction comprises: if the height of the current block is greater than the width, the gradient direction corresponding to the target pixel is the gradient direction corresponding to the modes 53-66, i.e., the target gradient direction is also the gradient direction corresponding to the modes 53-66, if the position distribution of the gradient information of the target pixel determines or obtains the main distribution region of the target gradient direction as the sub-region C located on the left side of the current block, the first weight is greater than 1 (for example, the first weight is 1.1), and if the position distribution of the gradient information of the target pixel determines or obtains the main distribution region of the target gradient direction as the sub-region B located on the top of the current block, the first weight is less than 1 (for example, the first weight is 0.7).
[0634] Optionally, according to the position distribution of the target pixel in at least one reference region, a first weight associated with the target pixel is determined or obtained, the gradient information of the at least one reference region and / or the gradient information of the target pixel in the at least one reference region is adjusted according to the first weight, the adjusted gradient information of the at least one reference region and / or the adjusted gradient information of the target pixel in the at least one reference region is determined or obtained, and at least one prediction mode is determined or obtained according to the adjusted gradient information of the at least one reference region and / or the adjusted gradient information of the target pixel in the at least one reference region.
[0635] Optionally, the position distribution of the target pixels is a spatial distribution of the target pixels determined or derived from the reference region. Optionally, the position distribution of the target pixels comprises position information of at least one target pixel.
[0636] Optionally, the target pixels comprise first pixels and / or second pixels, the gradient information of the first pixels satisfying a first gradient condition, and the gradient information of the second pixels satisfying a second gradient condition.
[0637] Optionally, the first gradient condition comprises that the gradient direction corresponds to a first prediction angle mode and / or the gradient direction is within a first prediction angle range.
[0638] Optionally, the second gradient condition comprises that the gradient direction corresponds to a second prediction angle mode and / or the gradient direction is within a second prediction angle range.
[0639] Optionally, the first prediction angle mode and / or the first prediction angle range is determined or derived according to modes 2-15.
[0640] Optionally, the second prediction angle mode and / or the second prediction angle range is determined or derived according to modes 53-66.
[0641] Optionally, the size of the current block and the position distribution of the target pixels determine or derive a first weight associated with at least one target pixel (e.g., a first pixel and / or a second pixel).
[0642] Optionally, if the width of the current block is greater than the height, a first weight associated with at least one first pixel in the target pixels is determined or derived, the adjusted gradient information of the at least one first pixel is determined or derived according to the first weight, and at least one prediction mode of the current block is determined or derived according to the adjusted gradient information of the at least one first pixel.
[0643] Optionally, if the height of the current block is greater than the width, a first weight associated with at least one second pixel in the target pixels is determined or derived, the adjusted gradient information of the at least one second pixel is determined or derived according to the first weight, and at least one prediction mode of the current block is determined or derived according to the adjusted gradient information of the at least one second pixel.
[0644] Optionally, if the width of the current block is greater than the height, a first weight associated with at least one first pixel in the target pixels is determined or derived according to the position distribution of the target pixels, the first weight being associated with the at least one first pixel having position information corresponding to a first position information and / or being within a first preset range and / or a first reference region (e.g., the first weight > 1), and the first position information, the first preset range and / or the first reference region corresponding to a preset pixel position above the current block, e.g., the first reference region being an above reference region of the current block.
[0645] Optionally, if the width of the current block is greater than the height, according to the position distribution of the target pixels, a first weight (e.g., the first weight < 1) associated with at least one second pixel in which the position information corresponds to the position information two and / or the position information is located in the preset range two and / or the reference region two is determined or obtained, optionally, the position information two, the preset range two and / or the reference region two correspond to a preset pixel position located on the left side of the current block, for example, the reference region two is a left reference region of the current block.
[0646] Optionally, the pixel whose gradient direction in the at least one reference region satisfies the third condition is determined as the target pixel.
[0647] Optionally, if the width of the current block is greater than the height, the third condition includes that the gradient direction corresponds to the first prediction angle mode, the gradient direction is located in the first prediction angle range, the gradient direction does not correspond to the second prediction angle mode and / or the gradient direction is located outside the second prediction angle range, the first prediction angle mode and / or the first prediction angle range is determined or obtained according to modes 2-15, and the second prediction angle mode and / or the second prediction angle range is determined or obtained according to modes other than modes 2-15, so that if the width of the current block is greater than the height, the target pixel is the first pixel (e.g., the pixel whose gradient information corresponds to modes 2-15).
[0648] Optionally, if the height of the current block is greater than the width, according to the position distribution of the target pixels, a first weight (e.g., the first weight < 1) associated with at least one second pixel in which the position information corresponds to the position information two and / or the position information is located in the preset range two and / or the reference region two is determined or obtained, optionally, the position information two, the preset range two and / or the reference region two correspond to a preset pixel position located on the left side of the current block, for example, the reference region two is a left reference region of the current block.
[0649] Optionally, if the height of the current block is greater than the width, according to the position distribution of the target pixels, a first weight (e.g., the first weight > 1) associated with at least one second pixel in which the position information corresponds to the position information two and / or the position information is located in the preset range two and / or the reference region two is determined or obtained, optionally, the position information two, the preset range two and / or the reference region two correspond to a preset pixel position located on the left side of the current block, for example, the reference region two is a left reference region of the current block.
[0650] Optionally, the pixel whose gradient direction in the at least one reference region satisfies the third condition is determined as the target pixel.
[0651] Optionally, if height of the current block > width of the current block, the third condition comprises: the gradient direction corresponds to a first prediction angle mode, the gradient direction is located in a first prediction angle range, the gradient direction does not correspond to a second prediction angle mode, and / or the gradient direction is located out of a second prediction angle range, the first prediction angle mode and / or the first prediction angle range is determined or obtained according to the modes 53-66, and the second prediction angle mode and / or the second prediction angle range is determined or obtained according to the modes other than the modes 53-66, thus, if height of the current block > width of the current block, the target pixel is the second pixel (for example, the pixel whose gradient information corresponds to the modes 53-66).
[0652] Optionally, in the embodiment, the target pixel associated with the first weight > 1 can be determined by the above-mentioned manner, the gradient amplitude of the target pixel conforms to the expected direction of the current block, thus, the gradient amplitude of the target pixel can be enhanced by the first weight > 1, so as to improve the selection probability of the prediction mode corresponding to the gradient direction of the target pixel.
[0653] Optionally, in the embodiment, the target pixel associated with the first weight < 1 can be determined by the above-mentioned manner, the gradient amplitude of the target pixel does not conform to the expected direction of the current block, thus, the gradient amplitude of the target pixel can be reduced by the first weight < 1, so as to reduce the selection probability of the prediction mode corresponding to the gradient direction of the target pixel.
[0654] In the embodiment, the first weight associated with the target pixel and / or the target gradient direction can be determined or obtained according to the position distribution of the target pixel in the at least one reference region, and the gradient amplitude of the target gradient direction conforming to the expected direction of the current block and / or the gradient amplitude of the target pixel can be enhanced by the first weight, and / or the gradient amplitude of the target gradient direction not conforming to the expected direction of the current block and / or the gradient amplitude of the target pixel can be reduced by the first weight, so as to improve the matching degree of the prediction mode determined or obtained by the above-mentioned manner and the current block.
[0655] The fifth mode, the position distribution of the gradient information of the at least one reference region;
[0656] Optionally, the position distribution of the gradient information of the at least one reference region is the spatial distribution of at least one gradient direction in the reference region in the reference region.
[0657] Optionally, the step S10 comprises: determining or obtaining at least one prediction mode of the current block according to the position distribution of the gradient information of the at least one reference region.
[0658] Optionally, the step S10 comprises: determining or obtaining at least one gradient histogram according to the position distribution of the gradient information of the at least one reference region, and determining or obtaining at least one prediction mode of the current block according to the at least one gradient histogram.
[0659] Optionally, the step S10 comprises: determining or obtaining at least one gradient histogram according to the position distribution of the gradient information of the at least one reference region, determining or obtaining at least one candidate mode according to the at least one gradient histogram, and determining or obtaining the at least one prediction mode of the current block according to the matching information of the at least one candidate mode and the at least one reference region.
[0660] Optionally, the at least one gradient histogram is determined or obtained according to the gradient information of the at least one reference region of the current block, and the position distribution of the gradient information of the at least one reference region is determined or obtained according to the at least one gradient histogram.
[0661] Optionally, the at least one reference region of the current block can be divided into at least one sub-region, the gradient histogram of the at least one sub-region is determined or obtained, and thus the position distribution of the gradient information in the reference region is determined or obtained according to the gradient histogram of the at least one sub-region. According to the position distribution of the gradient information in the reference region, it can be obtained, for example, in which sub-regions the target gradient direction is distributed, and which sub-regions are the main distribution regions of the target gradient direction.
[0662] Optionally, the target gradient direction is determined or obtained according to the size of the current block, the position distribution of the gradient information of the target gradient direction is determined or obtained according to the position distribution of the gradient information of the at least one reference region, and the position distribution of the gradient information of the target gradient direction comprises the main distribution region of the target gradient direction.
[0663] Optionally, the main distribution region of the target gradient direction is determined or obtained according to the gradient information of the at least one reference region of the current block.
[0664] Optionally, the at least one reference region comprises at least one sub-region, the gradient amplitude of the target gradient direction in the at least one reference region is determined or obtained according to the gradient information of the at least one reference region of the current block, the gradient amplitude threshold is determined or obtained according to the gradient amplitude of the target gradient direction in the at least one reference region, and the main distribution region of the target gradient direction is determined or obtained from the at least one sub-region according to the gradient amplitude threshold and the gradient information of the at least one sub-region.
[0665] Optionally, the region in which the gradient amplitude of the target gradient direction is greater than the gradient amplitude threshold in the at least one sub-region is determined or the main distribution region.
[0666] Optionally, the sub-region in which the gradient amplitude of the target gradient direction is the largest in the at least one sub-region is determined as the main distribution region.
[0667] Optionally, the step S10 comprises: determining or obtaining a target gradient direction according to a size of the current block; determining or obtaining at least one gradient histogram according to gradient information of at least one reference region of the current block; determining or obtaining a position distribution of the gradient information of the target gradient direction according to the at least one gradient histogram; the position distribution of the gradient information comprises a main distribution region of the target gradient direction; determining or obtaining a first weight associated with the target gradient direction according to the main distribution region of the target gradient direction; determining or obtaining adjusted gradient information of the target gradient direction according to the first weight; and determining or obtaining at least one prediction mode of the current block according to the adjusted gradient information.
[0668] Optionally, if the width of the current block is greater than the height, the target gradient direction is a gradient direction corresponding to modes 2-15; if the main distribution region of the target gradient direction is a sub-region C located at the left side of the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is less than 1 (for example, the first weight is 0.7); and if the main distribution region of the target gradient direction is a sub-region B located at the top of the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is greater than 1 (for example, the first weight is 1.1).
[0669] Optionally, the range of the sub-region C located at the left side of the current block comprises at least one of the following:
[0670] a region composed of the pixel [-3, 0], the pixel [-3, 2 / H], the pixel [-1, 0] and the pixel [-1, 2 / H];
[0671] a region composed of the pixel [-3, 2 / H], the pixel [-3, H], the pixel [-1, 2 / H] and the pixel [-1, H];
[0672] a region composed of the pixel [-3, H], the pixel [-3, 3 / 2H], the pixel [-1, H] and the pixel [-1, 3 / 2H];
[0673] a region composed of the pixel [-3, 3 / 2H], the pixel [-3, 2H], the pixel [-1, 3 / 2H] and the pixel [-1, 2H].
[0674] Optionally, the range of the sub-region B located at the top of the current block comprises at least one of the following:
[0675] a region composed of the pixel [0, -3], the pixel [2 / W, -3], the pixel [0, -1] and the pixel [2 / W, -1];
[0676] a region composed of the pixel [2 / W, -3], the pixel [W, -3], the pixel [2 / W, -1] and the pixel [W, -1];
[0677] A region composed of the pixel [W,-3], the pixel [3 / 2W,-3], the pixel [W,-1] and the pixel [3 / 2W,-1];
[0678] A region composed of the pixel [3 / 2W,-3], the pixel [2W,-3], the pixel [3 / 2W,-1] and the pixel [2W,-1].
[0679] Optionally, if the height of the current block is greater than the width, the target gradient direction is the gradient direction corresponding to the mode 53-66, if the main distribution region of the target gradient direction is determined or obtained to be the sub-region C located at the left side of the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is greater than 1 (for example, the first weight is 1.1), if the main distribution region of the target gradient direction is determined or obtained to be the sub-region B located at the top of the current block according to the position distribution of the gradient information of the target gradient direction, the first weight is less than 1 (for example, the first weight is 0.7).
[0680] Optionally, the reference region A includes the sub-region B and the sub-region C, and the manner of determining the position distribution of the gradient information of the target gradient direction according to the at least one gradient histogram includes at least one of the following:
[0681] If the width of the current block is greater than the height, whether the main distribution region of the gradient information of the target gradient direction is the sub-region B or the sub-region C is determined according to the reference region A, the sub-region B and the sub-region C, if the main distribution region of the gradient information of the target gradient direction is the sub-region B, the first weight is greater than 1, for example, the first weight is 1.3, if the main distribution region of the gradient information of the target gradient direction is the sub-region C, the first weight is less than 1, for example, the first weight is 0.7.
[0682] If the width of the current block is less than the height, whether the main distribution region of the gradient information of the target gradient direction is the sub-region B or the sub-region C is determined according to the reference region A, the sub-region B and the sub-region C, if the main distribution region of the gradient information of the target gradient direction is the sub-region C, the first weight is greater than 1, for example, the first weight is 1.3, if the main distribution region of the gradient information of the target gradient direction is the sub-region B, the first weight is less than 1, for example, the first weight is 0.7.
[0683] Optionally, the adjusted gradient information of the target gradient direction is determined or obtained according to the first weight, including: taking the gradient amplitude obtained by multiplying the gradient amplitude corresponding to the target gradient direction by the first weight as the adjusted gradient amplitude.
[0684] Optionally, at least one prediction mode of the current block is determined or obtained according to the adjusted gradient information, including: obtaining an adjusted gradient histogram according to the adjusted gradient information, and determining or obtaining at least one prediction mode of the current block according to the adjusted gradient histogram.
[0685] Optionally, in the adjusted gradient histogram, the prediction modes corresponding to the N gradient directions with the largest gradient amplitudes are selected as at least one prediction mode (e.g., candidate mode) of the current block, or the prediction modes corresponding to the N gradient directions with the largest gradient amplitudes are used to determine or obtain at least one prediction mode of the current block.
[0686] In the embodiment, the first weight can be determined or obtained according to the position distribution of the gradient information of the at least one reference region, and the gradient amplitude of the target gradient direction and / or the gradient amplitude of the target pixel that conform to the expected direction of the current block can be enhanced by the first weight, and / or the gradient amplitude of the target gradient direction and / or the gradient amplitude of the target pixel that do not conform to the expected direction of the current block can be reduced by the first weight, so as to improve the matching degree of the prediction mode determined or obtained based on the above manner and the current block.
[0687] Mode six, at least one candidate mode.
[0688] Optionally, step S10 comprises: determining or obtaining at least one candidate mode according to the gradient information of the at least one reference region, and determining or obtaining at least one prediction mode of the current block according to the at least one candidate mode.
[0689] Optionally, at least one candidate mode of the current block is determined or obtained according to the matching information related to the at least one candidate mode and the at least one reference region, for example, at least one prediction mode is determined or obtained from at least one candidate mode according to the matching information related to the at least one candidate mode and the at least one reference region.
[0690] Optionally, the matching information comprises SAD, SATD and / or MRSAD, and optionally, the smaller the SAD value, the SATD value and / or the MRSAD value, the higher the matching degree; and / or the larger the SAD value, the SATD value and / or the MRSAD value, the lower the matching degree.
[0691] Optionally, the matching information comprises the gradient amplitude value or the sum of the gradient amplitude values corresponding to the prediction mode in the gradient histogram, and optionally, the larger the gradient amplitude value, the higher the matching degree; and / or the smaller the gradient amplitude, the lower the matching degree.
[0692] Optionally, the matching information comprises confidence information, and optionally, the larger the confidence, the higher the matching degree; and / or the smaller the confidence, the lower the matching degree.
[0693] In the embodiment, the gradient information of the at least one reference region can be used to preliminarily screen and determine or obtain at least one candidate mode, so as to reduce the mode screening range, and then the at least one candidate mode is used for secondary screening, for example, the candidate mode with a higher matching degree with the reference region is screened out as the prediction mode through the matching information of the candidate mode and the reference region, so as to improve the matching degree between the prediction mode and the current block.
[0694] Optionally, the at least one candidate mode is determined or obtained according to at least one of the following:
[0695] The at least one gradient histogram determined or obtained according to the gradient information of the at least one reference region;
[0696] The gradient information of a target pixel in the at least one reference region;
[0697] The position distribution of the gradient information of the at least one reference region;
[0698] The position distribution of a target pixel in the at least one reference region;
[0699] The adjusted gradient information of the at least one reference region;
[0700] The first mode list determined or obtained according to the gradient information of the at least one reference region.
[0701] Optionally, the first mode list is a set of at least one prediction mode, and provides a plurality of possible mode options for the prediction of the current block, and through comparison of the prediction effects of different modes in the first mode list, an appropriate prediction mode can be matched for the current block, so as to improve the prediction accuracy for the current block.
[0702] Optionally, the first mode list is at least one mode list, and the prediction modes in the at least one mode list are different or at least partially the same.
[0703] Optionally, the first mode list includes an MPM (Most Probable Modes) list.
[0704] Optionally, the MPM list is a set of a plurality of prediction modes, and these modes are considered to be the most likely prediction modes suitable for the current block, and the determination or obtaining of the MPM list is based on the neighborhood information (such as the prediction modes of the above block and the left block) and the statistical information (such as the probability of the mode occurrence) of the current block, in this way, the MPM list can reduce the amount of mode information to be transmitted by the encoder, and improve the prediction accuracy of the prediction mode by the decoder.
[0705] Optionally, the first mode list includes the at least one candidate mode.
[0706] Optionally, in the intra prediction, the candidate modes in the first mode list can include at least one non-wide angle mode, at least one wide angle mode, at least one non-angular prediction mode, and / or at least one derived mode of the prediction mode.
[0707] Optionally, the first mode list is determined or obtained according to gradient information of at least one reference region of the current block and a neural network model.
[0708] Optionally, the first mode list is determined or obtained according to pixels, gradient information of at least one reference region of the current block and a neural network model.
[0709] Optionally, the first mode list is determined or obtained according to at least one prediction mode and / or confidence of the at least one prediction mode determined or obtained by taking pixels and gradient information of at least one reference region of the current block as input of the neural network model, and according to the at least one prediction mode and / or confidence of the at least one prediction mode output by the neural network model.
[0710] Optionally, at least one candidate mode is determined or obtained from the at least one prediction mode output by the neural network model according to confidence of the at least one prediction mode determined or obtained by the neural network model, and the first mode list is determined or obtained according to the at least one candidate mode.
[0711] Optionally, the confidence is a quantitative indicator of the certainty degree of the model to the current prediction result.
[0712] Optionally, the neural network model is a computational model that mimics the way neurons in the human brain process information, and it learns complex patterns and features in data to perform various tasks. The neural network model is composed of at least one level of neurons, including an input layer, at least one hidden layer, and an output layer. Each neuron receives input signals, performs a weighted sum, and then generates an output through a non-linear activation function. The weights of these connected neurons determine the degree of influence of the input signal on the output, while the bias adjusts the activation threshold of the neuron. Activation functions such as ReLU, Sigmoid, or Tanh can give the neural network the ability to model non-linearly, enabling it to solve problems that linear models cannot.
[0713] Referring to FIG. 12, a specific implementation process of determining or obtaining the first mode list by the neural network model can include: determining or obtaining a neural network model corresponding to the current block, determining or obtaining a reference template of the neural network model according to at least one reference region of the current block (for example, the reference template 1 on the left, the reference template 2 on the top and the reference template 3 on the top left in FIG. 12), taking the reconstructed reference pixels of the reference template and the gradient information of the reference template as the input of the neural network model, obtaining the output of the neural network model (for example, at least one prediction mode and / or the confidence of at least one prediction mode) by using the correlation between the current block and its reference template learned by the neural network model.
[0714] Optionally, the reference region includes a reference block, a reference pixel, a reference frame and / or a reference template.
[0715] Optionally, the reference region can be an image region adjacent to the current block or a non-adjacent image region of the current block. Optionally, the reference region can be a region composed of already encoded and reconstructed pixels or blocks from the same frame and / or different frames.
[0716] Optionally, since there is a high correlation (for example, temporal correlation, spatial correlation, etc.) between the reference region and the current block, by using these correlations, the embodiments of the present application can significantly improve the matching degree between the obtained prediction mode and the current block, and improve the accuracy of the prediction result of the current block determined or obtained.
[0717] Optionally, the reference block can be a pixel block corresponding to the current block extracted from the reference frame (also referred to as the reference image) or the current frame (also referred to as the current image). The reference block can have the same size as the current block, and the reference block can be used to generate the prediction block of the current block. By using the reference block, the encoder can utilize the temporal or spatial correlation to reduce the redundant information in the current frame, thereby achieving efficient compression.
[0718] Optionally, at least one reference block of the current block is determined or obtained according to an index obtained from a bitstream.
[0719] Optionally, the reference frame refers to a frame (also referred to as an image) that has been encoded and reconstructed. These frames can be forward reference frames (i.e., frames / images located before the current frame in the playback order) or backward reference frames (i.e., frames / images located after the current frame in the playback order).
[0720] Optionally, the neural network model can include an input layer, a hidden layer, a dropout layer and an output layer.
[0721] Optionally, the input layer (Input Layer) is the first layer that receives input data. In this layer, each node (or neuron) usually represents a feature of the input data.
[0722] Optionally, the hidden layers are layers between the input layer and the output layer, and the hidden layers can have multiple layers, which process the input data through weighting.
[0723] Optionally, the hidden layers include at least one of a fully connected layer, a convolutional layer, a pooling layer, a recurrent layer, and a dropout layer.
[0724] Optionally, in the fully connected layer, each neuron is connected to each neuron of the previous layer.
[0725] Optionally, the convolutional layer is used to extract local features in the input data, and is commonly used in image processing.
[0726] Optionally, the pooling layer is used for down-sampling, reducing the amount of data and computation.
[0727] Optionally, the recurrent layer, such as LSTM or GRU, processes sequence data.
[0728] Optionally, the dropout layer is used to randomly "drop" (i.e., temporarily set the output to zero) a portion of neurons during model training, which can reduce the complex co-adaptation between neurons, improve the generalization ability of the model, and reduce the risk of overfitting.
[0729] Optionally, a dropout layer can be added between at least one fully connected layer to prevent neurons in these layers from relying too much on specific outputs from the previous layer, thereby enhancing the generalization ability of the model. A dropout layer can be added between the convolutional layer and the fully connected layer to help reduce overfitting introduced by the fully connected layer. The output layer is the layer that generates the final prediction result.
[0730] Optionally, the first layer of the neural network model is used to construct a learnable gradient convolution, which determines or obtains gradient information of the current block in at least one reference region through a convolution operation.
[0731] Optionally, in the case where the first layer of the neural network model is used to construct a learnable gradient convolution, the neural network model can determine or obtain gradient information of the current block in at least one reference region through a convolution operation, and therefore, pixels of the at least one reference region of the current block can be used as input of the neural network model.
[0732] Optionally, in the case that the first layer of the neural network model is not constructed with a learnable gradient convolution, the gradient information of the at least one reference region of the current block is taken as the input of the neural network model.
[0733] Optionally, the first neural network model can be determined or obtained from a group of neural network models; and the first mode list is determined or obtained according to the first neural network model and the gradient information of the at least one reference region of the current block. Optionally, the first neural network model is at least one of the following: a neural network model based on a fully connected layer, a neural network based on a convolution layer, and a neural network based on a mixed convolution and fully connected layer.
[0734] Optionally, the first neural network model is determined or obtained from the group of neural network models according to the at least one reference region of the current block and a preset model mapping / correspondence rule.
[0735] Optionally, the group of neural network models is pre-trained, including at least one of the following: a neural network model based on a fully connected layer, a neural network based on a convolution layer, and a neural network based on a mixed convolution and fully connected layer.
[0736] Optionally, the neural network model based on a fully connected layer is also called a Multilayer Perceptron (MLP). The model includes an input layer, one or more hidden layers (i.e., fully connected layers), and an output layer. Each layer contains a certain number of neurons, and all neurons between adjacent layers are connected to each other, i.e., "full connection" between layers. Optionally, a dropout layer can be arranged between at least one group of fully connected layers of the neural network model based on a fully connected layer to help reduce overfitting caused by the fully connected layers.
[0737] Referring to FIG. 13, the neural network model based on a fully connected layer includes an input layer, at least one hidden layer (i.e., a fully connected layer), and an output layer. The fully connected layer includes a linear layer (Linear layer) and an activation function layer (e.g., a LeakyReLU layer). The pixels of the at least one reference region of the current block and the gradient information of the at least one reference region are input into the neural network model based on a fully connected layer. Since the pixels of the reference region can exist in the form of a two-dimensional or three-dimensional matrix, in order to be able to send the above data into the fully connected layer for processing, the pixels of the at least one reference region can be flattened into a one-dimensional vector f through the input layer, and fi can be determined or obtained through a ReLU activation function for nonlinear transformation. This operation introduces nonlinearity, so that the model can learn more complex patterns. fi will enter the network composed of fully connected layers, each layer performs linear transformation and activation function processing, and outputs a new feature vector fr to extract higher-level abstract features from the input. Then, the high-level features fr and the low-level features fi are spliced in the channel dimension to generate a feature vector fc. The feature vector fc is sent to the linear layer, and at least one predicted mode and / or the confidence of the at least one predicted mode is output through the output layer.
[0738] Optionally, the neural network based on convolutional layers, i.e., Convolutional Neural Networks (CNNs), includes an input layer, at least one hidden layer, and an output layer, the hidden layer includes: a convolutional layer for extracting features; each convolutional layer can be followed by a pooling layer for reducing spatial dimensions and reducing computational complexity, and each convolutional layer can also be provided with a nonlinear activation function (for example, ReLU) to introduce a nonlinear factor, so that the network can learn more complex patterns; as the depth of the convolutional neural network increases, the convolutional neural network can automatically learn the feature representation from low to high, and improve the prediction accuracy.
[0739] Referring to FIG. 14, the convolutional neural network includes an input layer, at least one hidden layer, and an output layer, the hidden layer includes: a convolutional layer, an activation function layer (for example, a LeakyReLU layer), and a linear layer (Linear layer); the pixels and / or gradient information of the reference region of the current block are input into the convolutional neural network, the pixels of the at least one reference region are convolved by at least one convolutional layer, and the ReLU activation function after each convolutional layer is used for nonlinear transformation to obtain features f1, f2, and f3. The features f1, f2, and f3 are fused and spliced in the channel dimension to determine or obtain a new merged feature f containing three features, so as to retain information from different convolutional paths, allow the model to combine low-level and high-level features, and enhance the representation ability. The fused feature f is processed again by the ReLU activation function to obtain fi; this additional activation step helps to further improve the expression ability and flexibility of the model. The fi is sent to the linear layer to obtain at least one prediction mode and / or the confidence of the at least one prediction mode.
[0740] Optionally, the neural network model based on mixed convolution and fully connected layers is an architecture that combines the advantages of CNN and MLP, including a convolutional layer part and a fully connected layer part. The spatial hierarchy of the input data can be automatically learned by the convolutional layer, such as the edge, texture, shape, and other features in an image; the convolution operation can effectively capture local patterns and reduce model complexity through the parameter sharing mechanism; the features extracted by the convolutional layer can be flattened into a one-dimensional vector through the fully connected layer, and then sent to a series of fully connected layers, which are responsible for combining low-level features to determine or obtain higher-level abstract representations. Through the neural network model based on mixed convolution and fully connected layers, the advantages of the two different types of layers can be combined, which can efficiently extract features from the input data and make accurate predictions based on the features.
[0741] Optionally, the neural network model based on mixed convolution and fully connected layers includes an input layer, at least one convolutional layer, at least one fully connected layer, and an output layer.
[0742] Referring to FIG. 15, the neural network model based on mixed convolution and full connection layer includes an input layer, at least one hidden layer, and an output layer, and the hidden layer includes a convolution layer, a full connection layer (i.e., a linear layer), and an activation function layer (e.g., a LeakyReLU layer). The pixel and / or gradient information of the reference region of the current block is input into the neural network model based on mixed convolution and full connection layer, the pixel of the at least one reference region is subjected to a convolution operation through at least one convolution layer, and a non-linear transformation is performed through the ReLU activation function after each convolution layer to obtain features f1, f2, and f3. The features f1, f2, and f3 are fused and spliced in the channel dimension to determine or obtain a new merged feature f4 containing three features, so as to retain information from different convolution paths, allow the model to combine low-level and high-level features, enhance the representation ability, and obtain a feature f5 through at least one stacked linear layer. The features f4 and f5 are spliced in the channel dimension to form a fusion feature fi, and the fusion feature fi is subjected to convolution processing through at least one convolution layer to obtain at least one prediction mode and / or the confidence of the at least one prediction mode.
[0743] Optionally, the construction of the neural network model mainly includes dataset construction and construction and training of the neural network.
[0744] Optionally, according to the output result of the neural network model, a first mode list is determined or obtained.
[0745] In the embodiment, the neural network model has strong non-linear modeling capability, can automatically learn the complex mapping relationship between the input and the output from a large amount of data, and thus can recognize and utilize the subtle relationship between the current block and its reference region through the neural network: for example, effectively capture the temporal correlation between frames and the spatial correlation within frames, understand the continuity and change rule between different frames or adjacent regions in the same frame, and / or perceive the consistency of local features such as edges and textures, even if these features are displaced or deformed between different frames. Through multi-level feature extraction, it is ensured that the prediction result is not only accurate in local details but also conforms to the actual content in the overall layout, so as to improve the accuracy of the candidate mode in the first mode list for the prediction of the current block from at least one dimension, improve the coding and decoding quality in the video encoding and / or decoding process, and / or the neural network model can output the confidence of at least one prediction mode at one time through parallel inference, thereby improving the prediction efficiency.
[0746] Optionally, step S10 includes determining or obtaining a first mode list according to the first neural network model and the gradient information of the at least one reference region, and determining or obtaining at least one prediction mode of the current block according to at least one candidate mode determined or obtained through the first mode list.
[0747] Optionally, the first mode list is determined or obtained according to at least one of the width, height, block size and block area of the current block.
[0748] Optionally, the first neural network model corresponding to the target model structure is determined from the at least one model structure according to at least one of the width, height, size and area of the current block.
[0749] Optionally, according to at least one of the geometric properties (i.e. width, height, block size and block area) of the current block, the model structure most suitable for processing these features is selected, so that the first neural network model can more accurately reflect the characteristics of the input data and improve the prediction effect of the model.
[0750] Optionally, the structure of the first neural network model is determined according to at least one of the width, height, size and area of the current block.
[0751] Optionally, since there is a correlation between at least one of the width, height, block size and block area of the current block and at least one reference region of the current block, the first neural network model suitable for processing the reference region and / or reference block data of the current block can be determined or obtained through at least one of the width, height, size and area of the current block.
[0752] Optionally, according to at least one of the geometric properties (i.e. width, height, block size and block area) of the current block, the specific structure of the selected model is adjusted, for example, according to at least one of the width, height, size and area of the current block, the number of hidden layers (e.g. convolutional layer, fully connected layer) of the neural network model, filter size, pooling strategy, etc. are adjusted.
[0753] Optionally, if the current block, at least one reference region of the current block does not match all neural network models, the reconstructed reference pixels of the current block, at least one reference region of the current block can be transposed and / or down-sampled, so that the geometric properties of the current block and / or at least one reference region of the current block match (e.g. the same size) the neural network model after the reconstructed reference pixels obtained by transposing and / or down-sampling are input into the neural network model to obtain the prediction result of the model. By transposing or down-sampling, the number of target models and / or target model structures is reduced as a whole.
[0754] Optionally, the number of neural network models is N, for example, including neural network model NN0, neural network model NN1, neural network model NN2,..., neural network model NN N-1 . Neural network model NN0, neural network model NN1, neural network model NN2,..., neural network model NN N-1corresponding to block size W0xH0, W1xH1, W2xH2,..., W N-1 xH N-1 .
[0755] Optionally, the first mode list is determined or obtained according to at least one of width, height, size and area of at least one reference region of the current block.
[0756] Optionally, the first neural network model corresponding to the target model structure is determined from the at least one model structure according to at least one of width, height, size and area of at least one reference region of the current block.
[0757] Optionally, according to at least one of the geometric properties (i.e. width, height, block size and block area) of at least one reference region of the current block, the model structure most suitable for processing these features is selected, so that the first neural network model can more accurately reflect the characteristics of the input data and improve the model prediction effect.
[0758] In this embodiment, at least one candidate mode can be determined or obtained according to the gradient information of at least one reference region, narrowing down the mode selection range, and then performing secondary screening according to at least one candidate mode, for example, through the matching information of the candidate mode and the reference region, screening the candidate mode with higher matching degree with the reference region as the prediction mode, to improve the matching degree of the prediction mode and the current block.
[0759] Third embodiment
[0760] Based on any of the above embodiments, a third embodiment is proposed.
[0761] In this embodiment, the gradient information includes first gradient information and / or second gradient information.
[0762] Optionally, the mode indexes of the candidate modes corresponding to the first gradient information and the second gradient information are adjacent.
[0763] Optionally, adjacent mode indexes refer to modes whose prediction mode numbers are continuous in numerical value or close in geometric angle.
[0764] Optionally, adjacent mode indexes include left adjacent mode indexes and / or right adjacent mode indexes, for example, for each mode index i, it includes left adjacent i-1 index and / or right adjacent i+1 index, and optionally, part of the candidate modes only have single-side adjacent candidate modes.
[0765] Optionally, at least one gradient histogram is determined or obtained according to the gradient information of the at least one reference region, at least one candidate mode is determined or obtained according to the at least one gradient histogram, if there are candidate modes with adjacent mode indexes in the at least one candidate mode, gradient information corresponding to the candidate modes with adjacent mode indexes is determined as the first gradient information and / or the second gradient information.
[0766] Optionally, if there are at least one pair of candidate modes with adjacent mode indexes in the at least one candidate mode determined or obtained according to the at least one gradient histogram, for example, the candidate modes with adjacent mode indexes are mode 1 and mode 2, gradient information corresponding to mode 1 is determined as the first gradient information, and gradient information corresponding to mode 2 is determined as the second gradient information.
[0767] Optionally, if there are at least one group of candidate modes with adjacent mode indexes in the at least one candidate mode determined or obtained according to the at least one gradient histogram, for example, the candidate modes with adjacent mode indexes are mode 1, mode 2 and mode 3, gradient information corresponding to any mode (for example, mode 1) in the group of candidate modes with adjacent mode indexes is determined as the first gradient information, and gradient information corresponding to the remaining modes (for example, mode 2 and mode 3) is determined as the second gradient information.
[0768] Optionally, the candidate mode corresponding to the highest gradient magnitude in the group and / or pair of candidate modes with adjacent mode indexes is determined as the first gradient information, and gradient information corresponding to the remaining candidate modes is determined as the second gradient information.
[0769] Optionally, step S10 comprises: determining or obtaining at least one prediction mode of the current block according to the adjusted first gradient information and / or the adjusted second gradient information.
[0770] Optionally, step S10 comprises: determining or obtaining at least one initial gradient histogram according to the gradient information of the at least one reference region, determining or obtaining at least one candidate mode according to the at least one initial gradient histogram, determining or obtaining the adjusted first gradient information and / or the adjusted second gradient information according to the at least one candidate mode, determining or obtaining at least one adjusted gradient histogram according to the adjusted first gradient information and / or the adjusted second gradient information, and determining or obtaining at least one prediction mode of the current block according to the at least one adjusted gradient histogram.
[0771] Optionally, in the conventional technology, the mode with the largest gradient magnitude or the multiple modes with the top ranked gradient magnitudes in the gradient histogram are usually determined as the prediction modes, but if the directions of the multiple prediction modes with the largest gradient magnitudes are similar (for example, the mode indexes are adjacent), the above-mentioned manner will ignore other potential effective non-similar direction modes, so that the mode selection lacks diversity and may not be able to adapt to complex and variable image scenes, therefore, in order to enrich the mode selection, at least one prediction mode determined or obtained can be changed by adjusting the first gradient information and / or the second gradient information, so as to enrich the mode selection and improve the prediction accuracy.
[0772] Optionally, the first gradient information is adjusted according to the second weight information to determine or obtain the adjusted first gradient information.
[0773] Optionally, the second gradient information is adjusted according to the third weight information to determine or obtain the adjusted second gradient information.
[0774] Optionally, the second weight information and / or the third weight information can be a preset fixed value, and / or can be adaptively adjusted according to different scenes, and the second weight information and / or the third weight information can be the same or different.
[0775] Optionally, the second weight information and / or the third weight information includes a weight Wi and / or a weight Wj, and the first gradient information and / or the second gradient information is adjusted by the weight Wi and / or the weight Wj to obtain the adjusted first gradient information and / or the second gradient information.
[0776] Optionally, the adjustment of the first gradient information and / or the second gradient information includes adjusting the gradient magnitudes of the first gradient information and the second gradient information.
[0777] Optionally, the second weight information and / or the third weight information includes a weight Wi and / or a weight Wj, and the first gradient information and / or the second gradient information is adjusted by the weight Wi and / or the weight Wj to obtain the adjusted first gradient information and / or the second gradient information.
[0778] Optionally, the adjustment of the first gradient information and / or the second gradient information includes adjusting the gradient magnitudes of the first gradient information and the second gradient information.
[0779] Optionally, the weight Wi is 0.3 and the weight Wj is 1, the adjusted first gradient = the first gradient magnitude + Wi*the second gradient magnitude, and the second gradient magnitude remains unchanged.
[0780] Optionally, the adjusting the first gradient information and / or the second gradient information comprises: adjusting the gradient amplitudes of the second gradient information and the gradient amplitudes of the non-first gradient information.
[0781] Optionally, the weight Wi is 0, the weight Wj is 0, the adjusted second gradient amplitude is 0, and the first gradient amplitude is unchanged.
[0782] Optionally, the gradient information corresponding to any mode (e.g., the mode with the highest gradient amplitude) in a group of adjacent candidate modes is determined as the first gradient information, and the gradient information corresponding to the remaining at least one mode is determined as the second gradient information. Optionally, the group of adjacent candidate modes includes 2 or 3 candidate modes.
[0783] Optionally, the gradient information corresponding to any mode (e.g., the mode with the highest gradient amplitude) in a group of adjacent candidate modes is determined as the second gradient information, and the gradient information corresponding to the remaining at least one mode is determined as the first gradient information. Optionally, the group of adjacent candidate modes includes 2 or 3 candidate modes.
[0784] Optionally, the adjusted second gradient information is determined or obtained according to a third weight and the second gradient information, the third weight is less than 1, the adjusted first gradient information is determined or obtained according to a second weight and the first gradient information, the second weight is less than 1, the third weight and the second weight are different, and the at least one prediction mode of the current block is determined or obtained according to the adjusted first gradient information and the adjusted second gradient information. By weakening the gradient amplitudes of at least part of the candidate modes to different degrees through the second weight and the third weight, the prediction mode determined or obtained can be changed, and the diversity of mode selection can be improved.
[0785] Optionally, the adjusted second gradient information is determined or obtained according to a third weight and the second gradient information, the third weight is less than 1, and the at least one prediction mode of the current block is determined or obtained according to the adjusted second gradient information. By weakening the gradient amplitudes of at least part of the candidate modes in the adjacent candidate modes through the third weight, the diversity of mode selection can be improved on the basis of retaining at least one originally selected prediction mode. Since the at least one originally selected prediction mode has a small difference with the prediction result corresponding to the adjacent mode of the prediction mode, weakening part of the similar modes through the third weight will not affect the coding quality.
[0786] Optionally, the adjusted first gradient information is determined or obtained according to a second weight and the first gradient information, the second weight is less than 1, and the at least one prediction mode of the current block is determined or obtained according to the adjusted first gradient information.
[0787] Optionally, according to the third weight and the second gradient information, adjusted second gradient information is determined or obtained, the third weight is less than 1, according to the second weight and the first gradient information, adjusted first gradient information is determined or obtained, the second weight is greater than 1, the third weight and the second weight are different, at least one prediction mode of the current block is determined or obtained according to the adjusted first gradient information and the adjusted second gradient information, the gradient amplitudes corresponding to at least part of the candidate modes are weakened by the second weight, the gradient amplitudes corresponding to at least part of the candidate modes are enhanced by the third weight, and at least one group of index-adjacent candidate modes can be obtained according to the initial gradient histogram, and the second weight and / or the third weight of each group of index-adjacent candidate modes are the same or different, so that the determined or obtained prediction mode can be changed and the diversity of mode selection is enhanced.
[0788] Optionally, according to the third weight and the second gradient information, adjusted second gradient information is determined or obtained, the third weight is greater than 1, according to the second weight and the first gradient information, adjusted first gradient information is determined or obtained, the second weight is less than 1, the third weight and the second weight are different, at least one prediction mode of the current block is determined or obtained according to the adjusted first gradient information and the adjusted second gradient information.
[0789] Optionally, the gradient information corresponding to the mode with the highest gradient amplitude in the group of mode-index-adjacent candidate modes is determined as the first gradient information, and the gradient information corresponding to the remaining at least one mode is determined as the second gradient information, according to the third weight and the second gradient information, adjusted second gradient information is determined or obtained, the third weight is less than 1 (for example, the third weight = 0), at least one adjusted gradient histogram is determined or obtained according to the adjusted second gradient information, and at least one prediction mode is determined or obtained according to the at least one adjusted gradient histogram.
[0790] Optionally, the gradient amplitudes corresponding to at least part of the index-adjacent candidate modes are weakened by the third weight, and thus the diversity of mode selection can be enhanced on the basis of retaining at least one originally selected prediction mode, and since the originally selected prediction mode is retained and the difference between the prediction results corresponding to the prediction mode and its adjacent modes is small, weakening part of the similar modes by the third weight will not affect the coding quality.
[0791] In the embodiment, according to the adjusted first gradient information and / or the adjusted second gradient information, the determined or obtained prediction mode can be changed and the diversity of mode selection is enhanced.
[0792] Optionally, the reference region is determined or obtained according to at least one of the following modes B1 to B4:
[0793] at least one of the following: an above neighboring pixel, an above non-neighboring pixel, a left neighboring pixel, a left non-neighboring pixel, a top-left neighboring pixel, and a top-left non-neighboring pixel of the current block;
[0794] Optionally, the reference region comprises: a reference pixel, a reference block, and / or a reference template.
[0795] Optionally, the reference region of the current block is determined or obtained according to at least one of the following: an above neighboring pixel, an above non-neighboring pixel, a left neighboring pixel, a left non-neighboring pixel, a top-left neighboring pixel, and a top-left non-neighboring pixel of the current block.
[0796] Optionally, the step S10 comprises: determining or obtaining at least one reference region of the current block according to at least one of the following: an above neighboring pixel, an above non-neighboring pixel, a left neighboring pixel, a left non-neighboring pixel, a top-left neighboring pixel, and a top-left non-neighboring pixel of the current block; and determining or obtaining at least one prediction mode of the current block according to gradient information of the at least one reference region.
[0797] Optionally, the above neighboring pixel can be a pixel adjacent to the current block in the same frame image.
[0798] Optionally, the above non-neighboring pixel can be a pixel not adjacent to the current block in the same frame image.
[0799] Optionally, the left neighboring pixel can be a pixel adjacent to the current block in the same frame image.
[0800] Optionally, the left non-neighboring pixel can be a pixel not adjacent to the current block in the same frame image.
[0801] Optionally, the top-left neighboring pixel can be a pixel adjacent to the current block in the same frame image.
[0802] Optionally, the top-left non-neighboring pixel can be a pixel not adjacent to the current block in the same frame image.
[0803] Optionally, at least one of the following: an above neighboring pixel, an above non-neighboring pixel, a left neighboring pixel, a left non-neighboring pixel, a top-left neighboring pixel, and a top-left non-neighboring pixel can be a reconstructed pixel or a predicted pixel.
[0804] Optionally, at least one of the following: an above neighboring pixel, an above non-neighboring pixel, a left neighboring pixel, a left non-neighboring pixel, a top-left neighboring pixel, and a top-left non-neighboring pixel can be directly used as a reference region, or the at least one pixel can be derived or calculated to obtain a reference region.
[0805] Optionally, the reference region of the current block is obtained according to a preset mapping / correspondence rule.
[0806] Optionally, the reference region is selected from the above neighboring pixels, the above non-neighboring pixels, the left neighboring pixels, the left non-neighboring pixels, the top-left neighboring pixels and the top-left non-neighboring pixels of the current block according to a prediction model.
[0807] Optionally, if some positions lack valid pixel data, the adjacent valid pixels can be used for filling.
[0808] In this embodiment, since the current block usually has a high similarity with at least one of the above neighboring pixels, the above non-neighboring pixels, the left neighboring pixels, the left non-neighboring pixels, the top-left neighboring pixels and the top-left non-neighboring pixels of the current block, the reference region determined according to these neighboring pixels and / or non-neighboring pixels can improve the prediction accuracy for the current block.
[0809] Optionally, the at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block is used as the at least one reference region.
[0810] Optionally, the at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block is used as the at least one reference region.
[0811] Optionally, the at least one reference region is determined or obtained according to the image block information of the at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block.
[0812] Optionally, the at least one reference region is determined or obtained according to the image block information of the at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block.
[0813] Optionally, the image block information can include at least one of the block size, the block area, the image block attribute and the image block type.
[0814] Optionally, the block size includes the width, the height, the proportion, the depth, the area, the resolution and the pixel number of the block, the image block attribute can include the position and / or the image texture of the block, and the image block type can include a natural image or a screen content image.
[0815] Optionally, the at least one reference region is determined or obtained according to at least one of the above neighboring pixels, the above non-neighboring pixels, the left neighboring pixels, the left non-neighboring pixels, the top-left neighboring pixels and the top-left non-neighboring pixels of the at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block.
[0816] Optionally, at least one of the top neighboring pixel, the top non-neighboring pixel, the left neighboring pixel, the left non-neighboring pixel, the top-left neighboring pixel and the top-left non-neighboring pixel of at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block can be used as the at least one reference region.
[0817] Optionally, at least one of the width, the height, the block size and the block area of at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block can be used to determine or obtain the at least one reference region.
[0818] Optionally, the neighbor block can be a block adjacent to the current block and can be a block that has been predicted or reconstructed.
[0819] Optionally, the non-neighbor block can be a block not adjacent to the current block and can be a block that has been predicted or reconstructed.
[0820] Optionally, the collocated block can be a block in a collocated image having the same position and size as the current block. The collocated image can be an image in the reference image closest in time to the current image.
[0821] Optionally, the temporal block can be a block distinguished in the time domain, such as an image block in another frame before or after the current frame. For example, there is video data including a first frame image, a second frame image and a third frame image played in the first second, the second second and the third second, and the current block is a block divided from the second frame image, and the temporal block corresponding to the current block can be determined as a corresponding image block in another frame other than the second frame.
[0822] Optionally, the default block can be a block set in advance, for example, a block having typical pixel characteristics set in advance by the encoder and / or the decoder.
[0823] In the embodiment, at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the current block is used to determine or obtain the at least one reference region, which ensures that the reference region determined or obtained is closely related to the current block, and thus the prediction result obtained based on the reference region is more accurate.
[0824] Optionally, at least one of the width, the height, the block size and the block area of the current block is used to determine or obtain the at least one reference region of the current block.
[0825] Optionally, the step S10 comprises: determining or obtaining the at least one reference region of the current block according to at least one of the width, the height, the block size and the block area of the current block, and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the at least one reference region.
[0826] Optionally, the at least one reference region can be determined or obtained according to the width and height of the current block and a first mapping table. Optionally, the first mapping table can be shown in Table 1 as follows:
[0827] Table 1
[0828] Optionally, the height of the at least one reference region is equal to a first preset multiple of the height of the current block, and the width of the at least one reference region is equal to a second preset multiple of the width of the current block.
[0829] Optionally, the reference region or the image region in the reference region can be a coded region or a decoded region.
[0830] Optionally, the coded region or the decoded region can be determined by the position of the top-left pixel, the height and the width of the coded region or the decoded region. For example, the position of the top-left pixel can be a position which is N (N is greater than 1) times the height of the image block upward and N times the width of the image block leftward from the top-left position of the current block, the width of the coded region or the decoded region is an integer multiple of the width of the current block, and the height of the coded region or the decoded region is an integer multiple of the height of the current block.
[0831] Optionally, the reference region can be determined according to the block size of the current block and a second mapping table.
[0832] Optionally, the second mapping table can be shown in Table 2 as follows:
[0833] Table 2
[0834] Optionally, the block size includes at least one of the width, the height, the proportion, the depth, the area, the resolution and the number of pixels of the block. Optionally, X4 to X7 can be preset threshold values corresponding to at least one of the width, the height, the proportion, the depth, the area, the resolution and the number of pixels of the block size.
[0835] Optionally, the reference region can be determined according to the block area of the current block and a third mapping table. Optionally, the third mapping table can be shown in Table 3 as follows:
[0836] Table 3
[0837] Optionally, the position of the reference region, the reference block and / or the reference pixel can be determined or obtained according to the upper neighboring pixel, the left neighboring pixel and the top-left neighboring pixel of the current block, and the size of the reference region can be determined according to the width and the height of the current block and the first mapping table.
[0838] Optionally, the reference region of the current block comprises: a first region adjacent to the top of the current block, a second region adjacent to the left side of the current block, and a third region adjacent to the top-left corner of the current block, the width of the first region is equal to 2 times the width of the current block, the height of the second region is equal to 2 times the height of the current block, if both the width and the height of the current block are greater than or equal to 8, the height of the first region is 8, the width of the second region is 8, and the width and the height of the third region are both 8; or, if any one of the width and the height of the current block is less than 8, the height of the first region is 4, the width of the second region is 4, and the width and the height of the third region are both 4.
[0839] In the embodiment, by determining or obtaining the reference region, the reference block and / or the reference pixel according to at least one of the width, the height, the block size and the block area of the current block, it is ensured that the reference region is closely related to the current block, and thus the prediction result obtained according to the reference region is more accurate.
[0840] Optionally, the candidate block is determined or obtained according to the candidate motion vector or the candidate block vector of the current block.
[0841] Optionally, the candidate block is determined or obtained according to the candidate motion vector or the candidate block vector of the current block.
[0842] Optionally, the step S10 comprises: determining or obtaining the candidate block according to the candidate motion vector or the candidate block vector of the current block, determining or obtaining at least one reference region of the current block, and determining or obtaining at least one prediction mode of the current block according to the gradient information of the at least one reference region.
[0843] Optionally, the candidate block can be determined or obtained according to at least one candidate motion vector or at least one candidate block vector in the candidate list of the current block, and used as the at least one reference region.
[0844] Optionally, the candidate block can be determined or obtained according to the candidate motion vector or the candidate block vector of the current block, and at least one reference region can be determined or obtained according to at least one of the top adjacent pixel, the top non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the top-left adjacent pixel and the top-left non-adjacent pixel of the candidate block.
[0845] Optionally, the candidate block can be determined or obtained according to the candidate motion vector or the candidate block vector of the current block, and at least one reference region can be determined or obtained according to at least one of the top adjacent pixel, the top non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the top-left adjacent pixel and the top-left non-adjacent pixel of the candidate block.
[0846] Optionally, the candidate block is determined or obtained according to the candidate motion vector or the candidate block vector of the current block, and the at least one reference region is determined or obtained according to at least one of the width, the height, the block size and the block area of the candidate block. For the implementation process, the current block in the above-mentioned mode F can be replaced by the candidate block, and details are not repeated here.
[0847] Optionally, the candidate block is determined or obtained according to the candidate motion vector or the candidate block vector of the current block, and the at least one reference region is determined or obtained according to at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the candidate block.
[0848] Optionally, the candidate block is determined or obtained according to the candidate motion vector or the candidate block vector of the current block, and the at least one reference region is determined or obtained according to at least one of the neighbor block, the non-neighbor block, the collocated block, the temporal block and the default block corresponding to the candidate block.
[0849] In the embodiment, the candidate block determined or obtained according to the candidate motion vector or the candidate block vector of the current block ensures that the determined or obtained reference region is closely related to the current block, and further makes the subsequent prediction result obtained according to the reference region more accurate.
[0850] Fourth embodiment
[0851] Based on any of the above embodiments, a fourth embodiment is proposed.
[0852] In the embodiment, the gradient information is determined or obtained according to at least one gradient operator.
[0853] Optionally, the gradient operator is a tool and / or method for determining or obtaining the at least one gradient information, and can extract gradient information from an image through convolution operation or other mathematical operation. Optionally, the gradient information includes gradient direction and / or gradient amplitude.
[0854] Optionally, the step S10 includes: determining or obtaining gradient information of the at least one reference region according to the at least one gradient operator, and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the at least one reference region.
[0855] Optionally, the at least one gradient operator includes at least one pair of mutually perpendicular gradient operators.
[0856] Optionally, the mutually perpendicular gradient operators include: a first pair of mutually perpendicular gradient operators and / or a second pair of mutually perpendicular gradient operators, and the first pair of gradient operators and the second pair of gradient operators are different.
[0857] Optionally, the gradient information of the at least one reference region is determined or obtained according to a first pair of mutually perpendicular gradient operators, the second gradient information of the at least one reference region is determined or obtained according to a second pair of mutually perpendicular gradient operators, and the at least one prediction mode of the current block is determined or obtained according to the first gradient information and / or the second gradient information.
[0858] Optionally, the at least one first gradient histogram is determined or obtained according to the first gradient information, the at least one second gradient histogram is determined or obtained according to the second gradient information, and the at least one prediction mode of the current block is determined or obtained according to the at least one first gradient histogram and / or the at least one second gradient histogram.
[0859] Optionally, the gradient histogram is a statistical tool for describing the gradient amplitude distribution of the current block in different directions, which is obtained by calculating the gradient amplitude value of each pixel in the at least one reference region of the current block in the direction corresponding to each intra prediction mode and counting the distribution of the gradient amplitude value, thereby obtaining a histogram containing the gradient amplitude value corresponding to each prediction direction.
[0860] Optionally, in the prediction modes of intra prediction, different prediction modes correspond to different prediction directions, for example, the vertical mode corresponds to the vertical direction, the horizontal mode corresponds to the horizontal direction, and the diagonal mode corresponds to the diagonal direction, each prediction mode has a specific direction for describing its prediction direction.
[0861] Optionally, for each prediction direction, the sum of the gradient amplitude values of the pixels in the at least one reference region of the current block in the direction is calculated, and the sum value reflects the overall gradient strength of the current block in the prediction direction. The gradient histogram records the sum of the gradient amplitude values corresponding to each prediction direction.
[0862] Optionally, according to the at least one gradient histogram corresponding to the current block, it is determined whether the sum of the gradient amplitude values related to the at least one prediction direction corresponding to the prediction mode contained in the gradient histogram satisfies a first preset condition, and the at least one prediction mode is determined or obtained in the case of satisfying the preset condition.
[0863] Optionally, the first preset condition can be whether the sum of the gradient amplitudes is one of the sums of the N gradient amplitudes with the largest gradient amplitudes in the gradient histogram, for example, according to whether the sum of the gradient amplitude values related to the at least one prediction direction corresponding to the prediction mode contained in the at least one gradient histogram is one of the sums of the N gradient amplitudes with the largest gradient amplitudes in the gradient histogram, the at least one prediction mode is determined or obtained.
[0864] Optionally, the sum of each gradient magnitude value in the gradient histogram is sorted in ascending order or descending order, and the sum of the gradient magnitude values in the front N gradient magnitude values in the ascending order or the sum of the gradient magnitude values in the back N gradient magnitude values in the descending order is determined or obtained, for example, the prediction mode corresponding to the prediction direction with the sum of the gradient magnitude values in the front 3 is determined as the prediction mode of the current block after sorting in ascending order.
[0865] Optionally, the gradient magnitude values in the gradient histogram are compared, and the sum of the N gradient magnitude values with the largest gradient magnitude in the gradient histogram is determined or obtained, and at least one prediction mode of the current block is determined or obtained according to the prediction mode corresponding to the sum of the N gradient magnitude values with the largest gradient magnitude.
[0866] Optionally, the gradient histogram of at least one reference region with respect to the intra prediction direction can be determined or obtained according to the gradient magnitude value and the gradient direction of the pixels in the at least one reference region, the corresponding intra prediction direction is determined according to the gradient histogram, and at least one prediction mode of the current block is determined or obtained.
[0867] Optionally, the first pair of gradient operators perpendicular to each other includes a 0° gradient operator and a 90° gradient operator, and the horizontal gradient Gx and the vertical gradient Gy can be calculated by using a 3x3 horizontal (0°) Sobel operator and a vertical (90°) Sobel operator, for example, the horizontal (0°) gradient Gx and the vertical (90°) gradient Gy of a pixel x4 in a pixel line can be calculated according to the following formula (one) and formula (two).
[0868] Optionally, A can be a matrix composed of 9 pixels, i.e., the pixel x4 as the center, the pixel x1 above the pixel x4, the pixel x3 on the left side of the pixel x4, the pixel x7 below the pixel x4, the pixel x5 on the right side of the pixel x4, the pixel x0 on the upper left side of the pixel x4, the pixel x6 on the lower left side of the pixel x4, the pixel x2 on the upper right side of the pixel x4, and the pixel x8 on the lower right side of the pixel x4, as shown in the following formula (three).
[0869] Optionally, the G gradient magnitude value is the sum of the absolute values of the horizontal gradient and the vertical gradient, and the calculation formula is shown in formula (four). G = |Gx| + |Gy| Formula (four);
[0870] Optionally, the gradient direction corresponding to the pixel can be calculated by arctan(Gx / Gy) or arctan(Gy / Gx).
[0871] Optionally, the second pair of gradient operators perpendicular to each other includes a +45° gradient operator and a -45° gradient operator, and the +45° gradient G +45° and the -45° gradient G-45° For example, for a pixel x4 in a pixel line, G +45° Gradient and G -45° The gradient can be calculated according to any one of the following formulas (five) to (ten) on the operator.
[0872] The formulas (five) and (six) are Prewitt operators, which can directly respond to the diagonal edge by referring to the template.
[0873] The formulas (seven) and (eight) are Sobel operators, in which the center pixel weight is 0, and the weights on both sides are symmetrically increased and decreased, which can enhance the response to the diagonal edge.
[0874] The formulas (nine) and (ten) are Scharr operators, which are more accurate in calculating the diagonal gradient.
[0875] Optionally, only the gradient operators in the horizontal direction and the vertical direction are applied to determine the prediction mode and / or the prediction accuracy of the gradient histogram for the diagonal direction is low, therefore, the embodiments of the present application introduce ±45° gradient operators to effectively improve the prediction accuracy in the diagonal direction.
[0876] Optionally, the step S10 comprises: determining or obtaining gradient information of at least one reference region according to the first pair of gradient operators and / or the second pair of gradient operators, the first pair of gradient operators comprising: a 0° gradient operator and a 90° gradient operator, the second pair of gradient operators comprising: a +45° gradient operator and a -45° gradient operator, and determining or obtaining at least one prediction mode of the current block according to the gradient information of the at least one reference region.
[0877] Optionally, the gradient direction can be determined or obtained by a lookup table, for example, using a lookup table for arctan(a), determining the two indexes index1 and index2 closest to arctan(Gx / Gy) or arctan(Gy / Gx), and determining the corresponding prediction direction of the pixel according to the angle difference between arctan(Gx / Gy) or arctan(Gy / Gx) and index1 and index2.
[0878] Optionally, the prediction direction a corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained, and the prediction direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained according to the angle difference between each prediction direction in the at least one lookup table and the prediction direction a, for example, the direction with the smallest absolute angle difference is determined as the prediction direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx).
[0879] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is between the first direction and the second direction in the at least one look-up table, the gradient direction is determined or obtained according to the angle difference between the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) and the first direction and the second direction, for example, the gradient direction is the first direction or the second direction.
[0880] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is between the first direction and the second direction in the at least one look-up table, the weight information corresponding to the first direction and the second direction is determined or obtained according to the angle difference between the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) and the first direction and the second direction, and the at least one gradient histogram is determined or obtained according to the weight information corresponding to the first direction and the second direction, and the at least one prediction mode of the current block is determined or obtained according to the at least one gradient histogram.
[0881] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is between the first direction and the second direction in the at least one look-up table, the weight information corresponding to the first direction and the second direction is determined or obtained according to the angle difference between the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) and the first direction and the second direction, the gradient amplitude is determined or obtained according to the gradient information, and the at least one gradient histogram is determined or obtained according to the gradient amplitude and the weight information corresponding to the first direction and the second direction, and the at least one prediction mode of the current block is determined or obtained according to the at least one gradient histogram.
[0882] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is a, which is between the first direction (for example, a1) and the second direction (for example, a2) in the at least one look-up table, the weight information corresponding to a1 and a2 is determined or obtained according to the angle difference between a and a1 and a2, for example, a1 corresponds to the weight w1, and a2 corresponds to the weight w2, the gradient amplitude b is determined or obtained according to the gradient information, and the at least one gradient histogram is determined or obtained according to the gradient amplitude b and the weight information w1 and w2 corresponding to the first direction and the second direction, the gradient amplitude corresponding to the first direction a1 in the gradient histogram is b*w1, and the gradient amplitude corresponding to the second direction a2 in the gradient histogram is b*w2.
[0883] In the embodiment, the gradient operators in horizontal and vertical directions are only applied to determine the gradient histogram and / or the prediction mode, and the prediction accuracy in diagonal directions is low. Therefore, the gradient operators in different directions, such as ±45°, are introduced in the embodiment to effectively improve the prediction accuracy in diagonal directions.
[0884] Optionally, the step S10 comprises: determining or obtaining gradient information of the at least one reference region according to the at least one reference region, the at least one pair of gradient operators and the weight information corresponding to the at least one pair of gradient operators; and determining or obtaining the at least one prediction mode of the current block according to the gradient information of the at least one reference region. The first pair of gradient operators comprises a 0° gradient operator and a 90° gradient operator, and the second pair of gradient operators comprises a +45° gradient operator and a -45° gradient operator.
[0885] Optionally, the step S10 comprises: determining or obtaining gradient information of the at least one reference region according to the at least one reference region, the at least one pair of gradient operators and the weight information corresponding to the at least one pair of gradient operators; and determining or obtaining the at least one prediction mode of the current block according to the at least one gradient histogram determined or obtained according to the gradient information of the at least one reference region.
[0886] Optionally, the gradient information one is determined or obtained according to the first pair of gradient operators perpendicular to each other, the at least one first gradient histogram is determined or obtained according to the gradient information one, and the at least one prediction mode of the current block is determined or obtained according to the at least one first gradient histogram.
[0887] Optionally, the gradient information two is determined or obtained according to the second pair of gradient operators perpendicular to each other, the at least one second gradient histogram is determined or obtained according to the gradient information two, and the at least one prediction mode of the current block is determined or obtained according to the at least one second gradient histogram.
[0888] Optionally, the third gradient information is determined or obtained according to the gradient information one and the gradient information two, the at least one third gradient histogram is determined or obtained according to the third gradient information, and the at least one prediction mode of the current block is determined or obtained according to the at least one third gradient histogram.
[0889] Optionally, the third gradient information is determined or obtained according to the gradient information one, the weight information corresponding to the first pair of gradient operators, the gradient information two and the weight information corresponding to the second pair of gradient operators, the at least one third gradient histogram is determined or obtained according to the third gradient information, and the at least one prediction mode of the current block is determined or obtained according to the at least one third gradient histogram.
[0890] Optio...
Claims
1. A processing method, wherein, Including the following steps: S10, based on gradient information from at least one reference region, determine or obtain at least one prediction mode for the current block.
2. The processing method as described in claim 1, wherein, The gradient information includes first gradient information and / or second gradient information; and / or, the gradient information is determined or obtained based on at least one gradient operator.
3. The processing method as described in claim 2, wherein, At least one prediction model is determined or obtained based on at least one of the following: Gradient information of target pixels in at least one reference region; At least one gradient histogram; At least one candidate pattern; The location distribution of gradient information in at least one reference region; The positional distribution of target pixels in at least one reference region; Adjusted gradient information for at least one reference region.
4. The processing method as described in claim 3, wherein, It also includes at least one of the following: The gradient histogram is determined or obtained based on gradient information from at least one reference region; Candidate patterns are determined or obtained based on gradient information from at least one reference region of the current block; The adjusted gradient information is determined or obtained based on the first weight; At least one prediction model is determined or obtained based on the location distribution of target gradient information in at least one reference region; The target pixel is determined or obtained based on at least one of the following: Current block size; Position information of pixels in at least one reference region; The gradient direction of a pixel in at least one reference region; The gradient direction corresponding to the prediction mode within the preset angle range.
5. The processing method as described in claim 4, wherein, It also includes at least one of the following: The first weight is determined or obtained by the positional distribution of gradient information in at least one reference region and / or the positional distribution of the target pixel; The target gradient information is determined or obtained based on the size of the current block and / or the target pixels.
6. The processing method as described in claim 2, wherein, The candidate patterns corresponding to the first gradient information and the candidate patterns corresponding to the second gradient information have adjacent pattern indices. And / or, step S10 includes: Based on the adjusted first gradient information and / or the adjusted second gradient information, at least one prediction mode for the current block is determined or obtained.
7. The processing method as described in claim 6, wherein, The adjusted first gradient information corresponds to the first gradient information determined or obtained through the second weight information; and / or, the adjusted second gradient information corresponds to the second gradient information determined or obtained through the third weight information.
8. The processing method as described in claim 1, wherein, At least one reference region is determined or obtained based on at least one of the following: At least one of the following: the pixel above the current block, the non-adjacent pixel above the current block, the pixel to the left of the current block, the non-adjacent pixel to the left of the current block, the pixel above the left of the current block, and the non-adjacent pixel above the left of the current block; The current block is selected from at least one of the following: neighboring block, non-neighboring block, sibling block, temporal block, and default block; The current block's width, height, block size, and block area must be at least one of these. Candidate blocks.
9. A processing apparatus, wherein, include: The memory and the processor, wherein the memory stores a processing program, and the processing program, when executed by the processor, implements the steps of the processing method as described in claim 1.
10. A storage medium, wherein, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the processing method as described in claim 1.
Citation Information
Patent Citations
Improved angular discretization in decoder-side intra mode derivation
CN118120231A
Image encoding / decoding method and apparatus, and recording medium storing bit stream
CN118451707A
Image encoding / decoding method and apparatus, and recording medium having bitstream stored therein
CN118661417A
Intra-frame coding and decoding method and device based on neighborhood features, equipment and storage medium
CN119299702A
Processing method, processing equipment and storage medium
CN119865624A