Processing method, processing device, and storage medium
Patent Information
- Application Number
- CN202510822191.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-06-18
AI Technical Summary
[0003]在构思及实现本申请过程中,发明人发现至少存在如下问题:在帧内预测和/或帧间预测过程中,预测处理的处理方式较为单一,灵活度不高,进而使得视频编码和/或解码过程中的编解码质量不佳
[0015] As described above, the processing method of this application can be applied to a processing device to determine or obtain the prediction result of the current block based on the weight information corresponding to at least one prediction mode. Through the technical solution of this application, the prediction result can be flexibly adjusted using weight information.
Smart Images

Figure CN120568059B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, specifically to a processing method, processing device, and storage medium. Background Technology
[0002] The existing video coding standard (H.266 / VVC) proposes a video frame coding technique. For example, when encoding and decoding video frames, the protocol divides each frame into different blocks and performs prediction processing and encoding / decoding processing.
[0003] In the process of conceiving and implementing this application, the inventors discovered at least the following problems: in the intra-frame prediction and / or inter-frame prediction process, the prediction processing method is relatively simple and lacks flexibility, which in turn leads to poor encoding and decoding quality in the video encoding and / or decoding process.
[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a processing method, processing device, and storage medium that can flexibly adjust the prediction results using weight information.
[0006] This application provides a processing method applicable to a processing device, comprising the following steps: S10, Based on the weight information corresponding to at least one prediction mode, determine or obtain the prediction result of the current block. Optionally, the weight information is determined or obtained based on the pixel position of at least one pixel and / or the position-dependent orientation.
[0007] Optionally, the location-dependent direction corresponds to at least one prediction pattern; and / or, the location-dependent direction is determined or obtained based on the main distribution area and / or the location information of the current block.
[0008] Optionally, the processing method further includes at least one of the following: The primary distribution region is located in at least one reference region of the current block; The position-dependent direction is determined or obtained based on the first position and / or the second position; The first position includes at least one of the following: the center of the main distribution region, the centroid, at least one vertex, and at least one boundary midpoint; The second position includes at least one of the following: the center of the current block, the centroid, at least one vertex, and at least one boundary midpoint.
[0009] Optionally, 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. The candidate motion vector or candidate block vector of the current block is determined or the candidate block is obtained.
[0010] Optionally, the main distribution area is determined or obtained based on at least one of the following: At least one sub-region of at least one reference region of the current block; The pixel position of the pixel corresponding to the gradient information of at least one prediction mode; The gradient magnitude of at least one prediction model.
[0011] Optionally, at least one prediction model is determined or obtained based on at least one of the following: At least one statistical histogram; First pattern list; At least one gradient operator.
[0012] Optionally, the statistical histogram is determined or obtained based on at least one reference region of the current block; and / or, the statistical histogram includes at least one of the following: Gradient histogram; Area histogram; Histogram of the number of times the prediction mode is used for the encoded image patch.
[0013] This application also provides a processing device, including: a memory and a processor, wherein the memory stores a processing program, and when the processing program is executed by the processor, it implements the steps of any of the processing methods described above.
[0014] This application also provides a storage medium storing a computer program that, when executed by a processor, implements the steps of any of the processing methods described above.
[0015] As described above, the processing method of this application can be applied to a processing device to determine or obtain the prediction result of the current block based on the weight information corresponding to at least one prediction mode. Through the technical solution of this application, the prediction result can be flexibly adjusted using weight information. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0017] Figure 1 A schematic diagram of the hardware structure of a mobile terminal to implement the various embodiments of this application; Figure 2 A communication network system architecture diagram provided for an embodiment of this application; Figure 3 A schematic diagram of the hardware structure of a controller 140 provided in this application; Figure 4 A schematic diagram of the hardware structure of a network node 150 provided in this application; Figure 5 This is a flowchart illustrating the processing method according to the first embodiment; Figure 6 This is a schematic diagram of intra-frame prediction direction shown according to the first embodiment; Figure 7 This is a schematic diagram of the encoder's encoding process in the image processing method shown in the first embodiment; Figure 8 This is a schematic diagram of the decoding process of the decoder in the image processing method according to the first embodiment; Figure 9 This is a schematic diagram of a sub-region shown according to the second embodiment. Figure 1 ; Figure 10 This is a schematic diagram of a sub-region shown according to the second embodiment. Figure 2 ; Figure 11 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 1 ; Figure 12 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 2 ; Figure 13 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 3 ; Figure 14 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 4 ; Figure 15 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 5 ; Figure 16 This is a schematic diagram of a sub-region shown according to the second embodiment. Figure 3 ; Figure 17 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 6 ; Figure 18 This is a schematic diagram of the sub-region and position-dependent direction shown in the second embodiment. Figure 7 ; Figure 19 This is a schematic diagram of pixel interpolation according to the second embodiment; Figure 20 This is a schematic diagram of the reference area of the DIMD mode in the processing method shown according to the fourth embodiment; Figure 21 This is a schematic diagram of the gradient magnitude in the processing method shown in the fourth embodiment; Figure 22 This is a schematic diagram of the encoded region corresponding to the block to be predicted in the processing method shown in the fourth embodiment; Figure 23 This is a schematic diagram of the decoded region corresponding to the block to be predicted in the processing method shown in the fourth embodiment; Figure 24 This is a schematic diagram of the processing module of the processing device.
[0018] The realization of the objectives, functional features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and textual descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation
[0019] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0020] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.
[0021] It should be understood that although the terms first, second, third, etc., may be used herein to describe various information, this information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another; for example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if," as used herein, can be interpreted as "when," "when," or "in response to determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to also include the plural forms unless the context indicates otherwise. It should be further understood that the terms "comprising," "including," indicate the presence of the stated feature, step, operation, element, component, item, kind, and / or group, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms “or,” “and / or,” and “including at least one of the following” as used in this application may be interpreted as inclusive, or mean any one or any combination thereof. For example, “including at least one of the following: A, B, C” means “any one of the following: A; B; C; A and B; A and C; B and C; A and B and C”, or “A, B or C” or “A, B and / or C” means “any one of the following: A; B; C; A and B; A and C; B and C; A and B and C”. Exceptions to this definition will only occur if the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.
[0022] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0023] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”
[0024] It should be noted that step designations such as S10 are used in this paper to more clearly and concisely describe the corresponding content, and do not constitute a substantial restriction on the order.
[0025] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0026] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.
[0027] Processing devices can be implemented in various forms. For example, the processing devices described in this application may include processing devices such as mobile phones, servers, tablet computers, laptops, handheld computers, personal digital assistants (PDAs), portable media players (PMPs), navigation devices, wearable devices, smart bracelets, pedometers, and fixed terminals such as digital TVs and desktop computers.
[0028] The following description will use a mobile terminal as an example. Those skilled in the art will understand that, apart from elements specifically designed for mobile purposes, the construction according to the embodiments of this application can also be applied to fixed-type terminals.
[0029] Please see Figure 1 This is a schematic diagram of the hardware structure of a mobile terminal implementing various embodiments of this application. The mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an A / V (Audio / Video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111, etc. Those skilled in the art will understand that... Figure 1 The mobile terminal structure shown does not constitute a limitation on the mobile terminal. The mobile terminal may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0030] The following is combined with Figure 1 A detailed introduction to each component of the mobile terminal: The radio frequency unit 101 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with the processor 110; and / or transmits uplink data to the base station. Typically, the radio frequency 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 radio frequency unit 101 can also communicate with networks and other devices wirelessly. The aforementioned wireless communications may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution), TDD-LTE (Time Division Duplexing-Long Term Evolution), 5G, and 6G.
[0031] WiFi is a short-range wireless transmission technology. Mobile terminals, through the WiFi module 102, can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 1 WiFi module 102 is shown, but it is understood that it is not a necessary component of a mobile terminal and can be omitted as needed without changing the nature of the invention.
[0032] The audio output unit 103 can convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into audio signals and output them as sound when the mobile terminal 100 is in call signal receiving mode, call mode, recording mode, voice recognition mode, broadcast receiving mode, etc. Furthermore, the audio output unit 103 can also provide audio output related to specific functions performed by the mobile terminal 100 (e.g., call signal receiving sound, message receiving sound, etc.). The audio output unit 103 may include a speaker, a buzzer, etc.
[0033] The A / V input unit 104 is used to receive audio or video signals. The A / V input unit 104 may include a graphics processing unit (GPU) 1041 and a microphone 1042. The GPU 1041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on the display unit 106. The image frames processed by the GPU 1041 can be stored in the memory 109 (or other storage media) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) in operating modes such as telephone call mode, recording mode, and voice recognition mode, and can process such sound into audio data. The processed audio (voice) data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 101 in telephone call mode. The microphone 1042 can implement various types of noise cancellation (or suppression) algorithms to eliminate (or suppress) noise or interference generated during the reception and transmission of audio signals.
[0034] The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Optionally, the light sensor includes an ambient light sensor and a proximity sensor. Optionally, the ambient light sensor can adjust the brightness of the display panel 1061 according to the ambient light level, and the proximity sensor can turn off the display panel 1061 and / or backlight when the mobile terminal 100 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. Other sensors that may be configured in the phone, such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.
[0035] The display unit 106 is used to display information input by the user or information provided to the user. The display unit 106 may include a display panel 1061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0036] User input unit 107 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of the mobile terminal. Optionally, user input unit 107 may include touch panel 1071 and other input devices 1072. Touch panel 1071, also known as touch screen, can collect touch operations on or near the user (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 1071), and drive corresponding connection devices according to a pre-set program. Touch panel 1071 may include two parts: a touch detection device and a touch controller. Optionally, the touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to processor 110, and can receive and execute commands sent by processor 110. In addition, touch panel 1071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may also include other input devices 1072. Optionally, other input devices 1072 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc., without being specifically limited here.
[0037] Optionally, the touch panel 1071 may cover the display panel 1061. When the touch panel 1071 detects a touch operation on or near it, it transmits the information to the processor 110 to determine the type of touch event. Subsequently, the processor 110 provides corresponding visual output on the display panel 1061 based on the type of touch event. Although in Figure 1 In this embodiment, the touch panel 1071 and the display panel 1061 are two independent components to realize the input and output functions of the mobile terminal. However, 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. The specific implementation is not limited here.
[0038] Interface unit 108 serves as an interface through which at least one external device can connect to mobile terminal 100; for example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 108 may be used to receive input from external devices (e.g., data information, power, etc.) and transmit the received input to one or more elements within mobile terminal 100, or it may be used to transmit data between mobile terminal 100 and external devices.
[0039] The memory 109 can be used to store software programs and various data. The memory 109 may primarily include a program storage area and a data storage area. Optionally, the program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0040] The processor 110 is the control center of the mobile terminal. It connects various parts of the mobile terminal via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 109, and by calling data stored in the memory 109, it performs various functions and processes data of the mobile terminal, thereby providing overall monitoring of the mobile terminal. The processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor. Optionally, the application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 110.
[0041] The mobile terminal 100 may also include a power supply 111 (such as a battery) that supplies power to various components. Preferably, the power supply 111 can be logically connected to the processor 110 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.
[0042] although Figure 1 As not shown, the mobile terminal 100 may also include a Bluetooth module, etc., which will not be described in detail here.
[0043] To facilitate understanding of the embodiments of this application, the communication network system on which the mobile terminal of this application is based is described below.
[0044] Please see Figure 2 , Figure 2 This application provides a communication network system architecture diagram. The communication network system is an LTE system based on 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 the operator's IP services 204, which are connected in sequence.
[0045] Optionally, UE201 can be the aforementioned terminal 100, which will not be described in detail here.
[0046] E-UTRAN202 includes eNodeB2021 and other eNodeB2022s. Optionally, eNodeB2021 can connect to other eNodeB2022s via backhaul (e.g., X2 interface). eNodeB2021 connects to EPC203 and can provide UE201 with access to EPC203.
[0047] EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving Gateway) 2034, a PGW (Packet Data Network Gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, etc. Optionally, MME2031 is the control node that handles signaling between UE201 and EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as the Home Location Register (not shown in the figure) and stores user-specific information such as service characteristics and data rates. All user data can be sent through SGW2034. PGW2035 can provide UE 201 IP address allocation and other functions. PCRF2036 is the policy and charging control decision point for service data flow and IP bearer resources. It selects and provides available policy and charging control decisions for the policy and charging enforcement function unit (not shown in the figure).
[0048] IP services 204 may include the Internet, intranet, IMS (IP Multimedia Subsystem), or other IP services.
[0049] Although the above description uses the LTE system as an example, those skilled in the art should know that this application is not only applicable to the LTE system, but also to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, 5G and future new network systems (such as 6G), etc., without limitation.
[0050] Figure 3 This is a schematic diagram of the hardware structure of a controller 140 provided in this application. The controller 140 includes a memory 1401 and a processor 1402. The memory 1401 is used to store program instructions, and the processor 1402 is used to call the program instructions in the memory 1401 to execute the steps performed by the controller in the first embodiment of the above method. The implementation principle and beneficial effects are similar, and will not be described again here.
[0051] Optionally, the controller further includes a communication interface 1403, which can be connected to the processor 1402 via a bus 1404. The processor 1402 can control the communication interface 1403 to implement the receiving and sending functions of the controller 140.
[0052] Figure 4 This application provides a schematic diagram of the hardware structure of a network node 150. The network node 150 includes a memory 1501 and a processor 1502. The memory 1501 is used to store program instructions, and the processor 1502 is used to call the program instructions in the memory 1501 to execute the steps performed by the first node in the first embodiment of the above method. The implementation principle and beneficial effects are similar, and will not be described again here.
[0053] Optionally, the controller further includes a communication interface 1503, which can be connected to the processor 1502 via a bus 1504. The processor 1502 can control the communication interface 1503 to implement the receiving and sending functions of the network node 150.
[0054] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0055] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A 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 flow or function according to the embodiments of this application is 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 transmitted from one storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk, SSD), etc.
[0056] First Embodiment Reference Figure 5 , Figure 5This is a flowchart illustrating the processing method according to the first embodiment. The processing method of this application embodiment can be applied to a processing device, including step S10: Step S10: Determine or obtain the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0057] In this embodiment, the processing device can be a smart terminal, such as a mobile phone or computer, or a server, such as a local server or a cloud server. This embodiment and this application primarily use a smart terminal as an example for illustration.
[0058] Optionally, the technical solution of this embodiment can be applied to fields such as image encoding and decoding, video encoding and decoding, hardware video encoding and decoding, dedicated circuit video encoding and decoding, and real-time video encoding and decoding.
[0059] Optionally, the processing device can acquire video image data from a video source, segment each frame of the video image data to obtain at least one image block, and determine the image block to be predicted in the at least one image block as the current block.
[0060] Optionally, the prediction mode is a mode used to perform prediction processing on the current block, and the prediction mode includes at least one of the following: angular prediction mode, non-angular prediction mode, and derivation mode.
[0061] Optionally, the prediction result of the current block can be determined or obtained based on at least one prediction mode and its corresponding weight information.
[0062] Optionally, angle prediction mode is a technique for predicting the current pixel block. It generates a predicted block by propagating the values of neighboring pixels along a specific direction. Angle prediction mode is mainly used to process directional textures in images, which can effectively reduce spatial redundancy and improve compression efficiency. In the H.265 / HEVC (High Efficiency Video Coding) standard, intra-frame prediction modes include 33 angle prediction modes, which cover different angles from horizontal to vertical, ensuring accurate prediction of various texture directions. In the H.266 / VVC (Versatile Video Coding) standard, the angle modes are expanded to 65, with more densely added directions to more accurately capture edges in natural video.
[0063] Optionally, the non-angle prediction mode can be a prediction mode other than the angle prediction mode. For example, the non-angle prediction mode includes at least one of the following: DC mode, Planar mode, and neural network-based prediction mode.
[0064] Optionally, the derivation mode is a mode used to derive an intra-prediction mode. The derivation mode is a method of deriving the prediction mode matched by the current block by analyzing the relevant information of the current block. For example, the derivation mode includes at least one of the following: Decoder side intra-mode derivation (DIMD) mode, Occurrence-based Intra Coding (OBIC) mode, and template-based intra-mode derivation (TIMD) mode.
[0065] Optionally, the current block is predicted according to at least one prediction mode to determine or obtain the prediction result of the current block corresponding to at least one prediction mode (hereinafter referred to as the prediction result corresponding to the prediction mode for distinction).
[0066] Optionally, the prediction result of the current block corresponding to the prediction mode includes the pixel prediction result corresponding to at least one pixel in the current block.
[0067] Optionally, in order to improve the prediction accuracy of the current block, the current block can be predicted using one or more prediction modes. In order to achieve the fusion of at least one prediction mode, the weight information corresponding to at least one prediction mode can be used.
[0068] Optionally, the weight information corresponding to the prediction mode refers to the weights assigned to different prediction modes, which are used to fuse the prediction results of at least one prediction mode to determine or generate the final prediction result. By combining the advantages of different modes through weight information, the prediction accuracy can be improved, the residual energy can be reduced, and the compression efficiency can be improved.
[0069] Optionally, based on at least one prediction mode, the prediction result of the current block corresponding to the at least one prediction mode is determined or obtained, and based on the weight information corresponding to the at least one prediction mode and the prediction result of the current block corresponding to the at least one prediction mode, the final target prediction result of the current block is determined or obtained.
[0070] Optionally, the weight information can be a fixed value, and / or the weight information can be determined or obtained based on the spatial location of the pixel in the current block (i.e., the x / y coordinates of the pixel to be predicted) and / or the local texture characteristics of the current block (e.g., the gradient distribution of the current block).
[0071] Optionally, the weight information can be determined or obtained based on the position-dependent direction corresponding to at least one prediction mode and / or the position (e.g., spatial location) of at least one pixel (e.g., the pixel to be predicted in the current block).
[0072] Optionally, the position-dependent direction of the prediction mode is the spatial distribution pattern of the reference pixels (e.g., at least one pixel in at least one reference region of the current block) associated with a certain prediction mode when predicting the current block using that prediction mode. This pattern makes the accuracy of the predicted pixels in the current block spatially distributed when using the prediction mode. For example, if the position-dependent direction of a prediction mode is vertical from top to bottom, then under that prediction mode, the weight of each pixel in the current block decreases as the vertical coordinate of each pixel increases. If the position-dependent direction of a prediction mode is horizontal from left to right, then under that prediction mode, the weight of each pixel in the current block decreases as the horizontal coordinate of each pixel increases.
[0073] Optionally, if pixels with textures and / or gradient directions related to the prediction mode are clustered in a defined reference region above and / or to the left of the current block, the prediction accuracy of the pixels of the current block determined by the prediction mode will have a spatial distribution pattern. For example, pixels in the current block that are closer to the reference region have higher accuracy in the prediction mode than pixels in the current block that are farther away from the reference region.
[0074] Reference Figure 6 Assuming the prediction pattern for the current block is Figure 6 If the texture features of the pixels in the left reference region of the current block match the prediction mode 34 (for example, the texture direction of the left reference region is similar to the prediction direction of the prediction mode 34), then the position-dependent direction of mode 34 is horizontal to the left. If the current block is predicted using prediction mode 34, the predicted value of the left pixel in the current block is more accurate than the predicted value of the right pixel in the current block.
[0075] Optionally, the weight information may include at least one of the following: weight coefficients, weight vectors, and weight matrices.
[0076] Optionally, the weight coefficient can be a scalar value that represents the weight of a single prediction result. For example, the prediction result includes result P1 determined or obtained according to prediction mode 1 and result P2 determined or obtained according to prediction mode 2. The weight coefficients corresponding to prediction mode 1 and prediction mode 2 are W1 and W2, respectively. Thus, the predicted block P0 of the current block can be expressed as: P0 = W1 × P1 + W2 × P2.
[0077] Optionally, the weight vector can be a one-dimensional array containing multiple weight coefficients, each coefficient corresponding to a prediction result for a prediction mode. For example, the prediction results include result P1 determined or obtained according to prediction mode 1, result P2 determined or obtained according to prediction mode 2, and result P3 determined or obtained according to prediction mode 3. The weight vector corresponding to the prediction mode is w=[W1, W2, W3]. Therefore, the predicted block P0 of the current block can be represented as: P0= W1×P1+W2×P2+W3×P3.
[0078] Optionally, the weight matrix can be a two-dimensional array, where each element represents the weight coefficient of a pixel at a specific location. It is typically the same size as the current block. For example, the prediction result includes result P1 determined or obtained according to prediction mode 1 and result P2 determined or obtained according to prediction mode 2. Both result P1 and result P2 include the predicted value corresponding to each pixel in the current block. The weight matrix W[i, j, k] represents the weight of the pixel in the i-th row and i-th column in the k-th result (k=1 or 2). Therefore, each pixel of the predicted block P0 of the current block can be represented as: P0[i,j]=W[i,j,1]×P1[i,j]+W[i,j,2]×P2[i,j]+c; Optionally, c is a bias term, and optionally, c equals 0.
[0079] Optionally, if the prediction results are included for N prediction modes, then the value of k above is 1 to N, and the values of i and j above are integers greater than 0.
[0080] Reference Figure 7When the processing device is an encoder on the encoding side, the encoder can receive video data from the video source, such as receiving video images from the video source, determining the image to be predicted in the video images, dividing the image to be predicted into at least one image block, and using the temporal and / or spatial correlation between video images, performing prediction processing on each of the at least one image block, including intra-frame prediction processing and / or inter-frame prediction processing, and the intra-frame prediction processing and / or inter-frame prediction processing includes the derivation mode of at least one prediction mode and / or at least one prediction mode. For the prediction mode, the encoder uses, for example, rate-distortion cost to determine the prediction mode finally adopted by each of the at least one image block. For example, it calculates the rate-distortion cost corresponding to each prediction mode or the rate-distortion cost of combining several prediction methods to determine the minimum rate-distortion cost from at least one rate-distortion cost. The prediction mode or combination of prediction modes corresponding to the minimum rate-distortion cost is the prediction mode finally adopted by the image block. The prediction result (e.g., the prediction block) of the current block (i.e., the block to be predicted) can be determined or obtained according to at least one prediction mode and its corresponding weight information.
[0081] Optionally, a residual block between the predicted block and the current block can be calculated. The residual block can be transformed and quantized, and then encoded by an entropy encoder to form an encoded bit stream.
[0082] Optionally, the encoded bitstream may include prediction parameters corresponding to a defined prediction mode and related side information.
[0083] Optionally, the prediction parameters are entropy-encoded and then packed into the encoded bitstream.
[0084] Optionally, the prediction parameters include indication information of the prediction mode.
[0085] Optionally, the transformed and quantized residual block can be added to the corresponding prediction data (such as the prediction block) obtained using the prediction mode after inverse quantization and inverse transformation to obtain the reconstruction block. After obtaining the reconstruction block, the loop filtering module performs loop filtering on the reconstruction block according to the filter control parameters to reduce distortion.
[0086] Optionally, after performing loop filtering, the reconstructed block after loop filtering is stored according to the encoded image buffer.
[0087] Reference Figure 8 When the processing device is a decoder on the decoding side, after receiving the encoded bitstream, the decoder's entropy decoding unit parses and decodes the encoded bitstream to obtain transform coefficients. The decoder's inverse transform unit and inverse quantization unit perform inverse transform and inverse quantization processing on the transform coefficients to obtain residual blocks.
[0088] Optionally, the decoder's entropy decoding unit parses and decodes the encoded bitstream to obtain prediction data, such as prediction parameters and related auxiliary information.
[0089] Optionally, the decoder's prediction processing unit performs prediction processing using prediction parameters to determine the prediction block corresponding to the residual block.
[0090] Optionally, the prediction processing includes intra-frame prediction processing and / or inter-frame prediction processing, and the intra-frame prediction processing and / or inter-frame prediction processing includes a combination of at least one derivation mode and / or at least one prediction mode.
[0091] Optionally, the processing method includes: determining or obtaining the prediction result (e.g., the prediction block) of the current block (i.e. the block to be predicted) based on the weight information corresponding to at least one prediction mode.
[0092] Optionally, the obtained residual block and the corresponding prediction block (including the predicted luminance block and the predicted chrominance block) are added together to obtain the reconstructed block. The loop filtering unit of the decoder performs loop filtering on the reconstructed block to reduce distortion and improve video quality.
[0093] Optionally, the processing method further includes: the reconstructed blocks after loop filtering are further combined into a decoded image and stored in a decoded image buffer or output as a decoded video signal.
[0094] Optionally, when the processing device is an encoder, the initially obtained prediction value can be the prediction value obtained in the corresponding prediction mode, which can be directly used in the rate-distortion cost process.
[0095] Optionally, when the processing device is a decoder, the initially obtained prediction value can be the prediction value obtained through the prediction mode corresponding to the block to be predicted (i.e., the image block located in the decoding end) indicated by the syntax elements parsed in the bitstream.
[0096] Optionally, the predicted block can be used as the target image block, the residual block between the target image block and the current block can be calculated, and then encoded by an entropy encoder through transformation and quantization to form an encoded bitstream. Alternatively, the predicted block can be processed accordingly, for example, by using other models, and the processed image block can be used 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.
[0097] In this embodiment, by using the weight information corresponding to at least one prediction mode, the prediction results of at least one prediction mode can be fused to determine or generate the final prediction result. The weight information can flexibly combine the advantages of different modes, thereby supporting the improvement of prediction accuracy and / or encoding and / or decoding quality in the video encoding and / or decoding process.
[0098] Second Embodiment Based on the first embodiment described above, a second embodiment is proposed.
[0099] In this embodiment, the weight information is determined or obtained according to the following method one and / or method two: Method 1: Pixel position of at least one pixel; Optionally, step S10 includes: determining or obtaining weight information corresponding to at least one prediction mode based on the pixel position of at least one pixel, and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0100] Optionally, the pixel position of a pixel is the coordinate (x, y) of the pixel (e.g., the pixel to be predicted in the current block) in the image block (e.g., the current block).
[0101] Optionally, the above coordinates can be represented in multiple ways. For example, there are multiple ways to set the coordinates [0,0], such as setting the coordinates of the top left pixel of the image to [0,0], or setting the coordinates of the top left pixel of the current block to [0, 0].
[0102] Optionally, the pixel position of the at least one pixel mentioned in step S10 is the distance of the at least one pixel relative to the position of the above coordinates [0, 0], that is, the x coordinate is the horizontal distance from the pixel to the coordinates [0, 0], and the y coordinate is the vertical distance from the pixel to the coordinates [0, 0].
[0103] Optionally, the same prediction mode may use the same or different weights when predicting pixels at different pixel positions in the current block.
[0104] Optionally, the weight of the same prediction mode when predicting pixels at different pixel positions in the current block changes dynamically according to the pixel position. For example, when the prediction mode predicts pixels at pixel positions in the current block that are close to the top or left of the current block and have a distribution of pixels with a texture or gradient direction related to the prediction mode (hereinafter referred to as the clustered reference area for distinction), the prediction mode is given a higher weight, and when the prediction mode predicts pixels at pixel positions far away from the aforementioned clustered reference area, the weight is reduced.
[0105] Optionally, for the same prediction mode, if the distance between pixels at different pixel positions in the current block and the aforementioned clustering reference region is the same, then the weights of pixels at different pixel positions are the same; if the distance between pixels at different pixel positions in the current block and the aforementioned clustering reference region is different, then the weights of pixels at different pixel positions are different.
[0106] Optionally, the aforementioned aggregation reference area corresponds to a range of location coordinates.
[0107] Optionally, different prediction modes may use the same or different weights when predicting pixels at the same pixel position in the current block.
[0108] Optionally, for different prediction modes, if the positional dependency direction of different prediction modes is the same, then the weights are the same when predicting pixels at the same pixel position in the current block; if the positional dependency direction of different prediction modes is different, then the weights are different when predicting pixels at the same pixel position in the current block.
[0109] Optionally, the current block adopts the first prediction mode (e.g., Figure 6 The prediction pattern shown is 39) and the second prediction pattern (e.g., Figure 6 When performing intra-frame prediction using the prediction mode 13 shown, if the position dependency directions of the first prediction mode and the second prediction mode are the same (for example, the position dependency directions of the first prediction mode and the second prediction mode are both from the top left to the bottom right), then when using the first prediction mode and the second prediction mode to predict pixels at the same pixel position in the current block, the weights of the first prediction mode and the second prediction mode are the same. If the position dependency directions of the first prediction mode and the second prediction mode are different (for example, the position dependency direction of the first prediction mode is from the top left to the bottom right, while the position dependency direction of the second prediction mode is from the top right to the bottom left), then when using the first prediction mode and the second prediction mode to predict pixels at the same pixel position in the current block, the weights of the first prediction mode and the second prediction mode are different.
[0110] In this embodiment, the weight information of at least one prediction mode is determined or obtained based on the pixel position of at least one pixel. For example, the weight of the prediction mode is dynamically adjusted, thereby enabling the adaptive use of spatial correlation (for example, when the prediction mode predicts pixels in pixel positions close to the above-mentioned clustered reference area, the prediction mode is given a higher weight, and when the prediction mode predicts pixels in pixel positions far from the above-mentioned clustered reference area, the weight is reduced), thereby enabling flexible adjustment of the prediction results and improving the accuracy of the determined or obtained prediction results.
[0111] Method 2: Position-dependent direction.
[0112] Optionally, step S10 includes: determining or obtaining weight information corresponding to at least one prediction mode based on the position-dependent direction, and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0113] Optionally, the location-dependent direction corresponds to at least one prediction model, and the location-dependent directions corresponding to different prediction models may be the same or different.
[0114] Optionally, step S10 includes: determining or obtaining weight information corresponding to at least one prediction mode based on the pixel position of at least one pixel and the position dependency direction corresponding to at least one prediction mode, and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0115] Optionally, the position-dependent direction of the prediction mode is the spatial distribution pattern of the reference pixels (e.g., at least one pixel in at least one reference region of the current block) associated with a certain prediction mode when predicting the current block using that prediction mode. This pattern makes the accuracy of the predicted pixels in the current block spatially distributed when using the prediction mode. For example, if the position-dependent direction of a prediction mode is vertical from top to bottom, then under that prediction mode, the weight of each pixel in the current block decreases as the vertical coordinate of each pixel increases. If the position-dependent direction of a prediction mode is horizontal from left to right, then under that prediction mode, the weight of each pixel in the current block decreases as the horizontal coordinate of each pixel increases.
[0116] Optionally, the location-dependent direction corresponding to the prediction model is the decay or enhancement direction of the weight information corresponding to the prediction model.
[0117] Optionally, in determining the weight information corresponding to the prediction mode, the weight information corresponding to the prediction mode can be dynamically adjusted by combining the positional dependency direction of the prediction mode and the pixel position of the pixel to be predicted.
[0118] Optionally, the weights corresponding to pixels at at least one pixel position in the current block can be determined or obtained based on the attenuation or enhancement direction of the weight information.
[0119] Optionally, the weight corresponding to the pixel at the position of at least one pixel in the current block is determined or obtained based on the attenuation or enhancement direction of the weight information and the pixel position of at least one pixel in the current block.
[0120] Optionally, the pixel position of at least one pixel in the current block is determined or obtained, the distance between at least one pixel and at least one reference region of the current block is determined or obtained, and the weight corresponding to the pixel at the position of at least one pixel in the current block is determined or obtained based on the attenuation or enhancement direction of the weight information and the distance between at least one pixel and at least one reference region of the current block.
[0121] Optionally, for different prediction modes, if the positional dependency direction of different prediction modes is the same, then the weights are the same when predicting pixels at the same pixel position in the current block; if the positional dependency direction of different prediction modes is different, then the weights are different when predicting pixels at the same pixel position in the current block.
[0122] Optionally, in conventional techniques, the weights of the prediction modes can be fixed values and / or determined or obtained based on the spatial location of the pixel to be predicted (e.g., the x / y coordinates of the pixel to be predicted) and / or the local texture characteristics of the current block (e.g., the gradient distribution of the current block). Fixed weights have low flexibility, while weight settings based on the location of the pixel to be predicted and / or the local texture characteristics of the current block are usually only adjusted for the prediction modes corresponding to pixels whose positions change in the vertical or horizontal direction, making it difficult to adapt to complex textures (such as beveled or curved edges), thus resulting in low flexibility.
[0123] In this embodiment, the dominant weight distribution can be determined based on the position-dependent direction of the prediction mode. Then, the weight is dynamically adjusted based on the specific position of the pixel in the current block (such as its distance from the aforementioned focal reference area). For example, if the position-dependent direction of the prediction mode is a 45° diagonal direction, the prediction mode assigns higher weights (e.g., a weight value of 0.9) to the prediction results of pixels located on the extension path of this direction and close to the aforementioned focal reference area, and reduces the weights (e.g., a weight value of 0.6) to the prediction results of pixels located on the extension path of this direction but far from the aforementioned focal reference area. This breaks through the limitations of vertical / horizontal orientation, flexibly adjusts the prediction results to accurately match the texture direction at any angle, and thus improves the prediction accuracy.
[0124] Optionally, the position-dependent direction is determined or obtained according to the following methods A and / or method B: Method A, main distribution area; Optionally, step S10 includes: determining or obtaining the location dependency direction corresponding to at least one prediction mode based on the main distribution area corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the location dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0125] Optionally, the main distribution area can be the main distribution area of the prediction model.
[0126] Optionally, the main distribution region of a prediction pattern is the coordinate range of the main distribution or cluster of pixels with texture features or gradient directions associated with the prediction pattern in the upper and / or left sides of the current block.
[0127] Optionally, if the coordinates of the current block are [0, 0], and there exists a coordinate range in the adjacent region above the current block (e.g., a coordinate range consisting of four pixels: [-3, -3], [-3, 10], [-1, -3], and [-1, 10]), and the texture features of the pixels in this coordinate range match the prediction mode (e.g., the texture direction is consistent with the prediction direction of the prediction mode), and the texture features of other adjacent regions of the current block, excluding this coordinate range, do not match the prediction mode, then the probability that the texture features of pixels near this coordinate range in the current block match the prediction mode is higher than the probability that the texture features of pixels at other locations match the prediction mode.
[0128] Optionally, the main distribution area is located in at least one reference area of the current block.
[0129] Optionally, at least one prediction model may correspond to one or more main distribution regions.
[0130] Optionally, the main distribution area is determined or obtained according to at least one of the following methods a1 to a3: Method a1: At least one sub-region of at least one reference region of the current block; Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on at least one sub-region of at least one reference region of the current block; determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0131] Optionally, the reference region refers to a set of neighboring pixels surrounding the current block, which can provide important clues about the edges and texture orientation of the block to be predicted, and the sub-region is at least a portion of the reference region.
[0132] Optionally, based on at least one reference region of the current block, at least one sub-region is determined or obtained, and from the at least one sub-region, at least one main distribution region of a prediction pattern is determined or obtained, the main distribution region may include one or more adjacent sub-regions.
[0133] Optionally, the sub-regions may have different or at least partially the same size.
[0134] Optionally, based on a preset sub-region size, at least one sub-region is determined or obtained from at least one reference region of the current block. For example, the sub-region size is set to include: the width of the sub-region is 1 / 2 the width of the current block, and the height of the sub-region is 1 / 2 the height of the current block.
[0135] Optionally, each sub-region is at least partially non-overlapping or coincident. The fact that the sub-regions are at least partially non-overlapping or coincident can be that one sub-region contains pixels that are at least partially different from the other sub-regions. For example, sub-region one contains pixels a, b, and c, and sub-region two contains pixels a, b, and d. Sub-region one and sub-region two have the same pixels a and b, but different pixels c and d.
[0136] Optionally, each sub-region does not overlap or coincide. Sub-regions not overlapping or coinciding can mean that the pixels contained in one sub-region are completely different from the pixels contained in the other sub-regions or that there are no identical pixels. For example, each pixel in the reference region is classified into only a single sub-region.
[0137] Reference Figure 9 Based on the reference area of the block to be predicted (i.e. the current block), sub-regions are determined or obtained, including: sub-region 0 to sub-region 6, and each sub-region does not overlap.
[0138] Reference Figure 10 Based on the reference region of the block to be predicted (i.e. the current block) and the preset sub-region size (the preset sub-region size is WxH), the sub-regions are determined or obtained, including: sub-region 0 to sub-region 3, and each sub-region does not overlap or coincide at least partially.
[0139] Optionally, W is 1 / 2, 1 / 4, or 1 / 8 of the width of the current block, and H is 1 / 2, 1 / 4, or 1 / 8 of the height of the current block.
[0140] Optionally, the values of W and H can be set according to the size of the current block.
[0141] Optionally, if the width and / or height of the current block is greater than 64, then W is greater than or equal to 1 / 4 of the width of the current block and / or H is greater than or equal to 1 / 4 of the height of the current block, for example, W is 16 and / or H is 16.
[0142] In this embodiment, by dividing at least one reference region into at least one sub-region, a more accurate main distribution region of the prediction pattern is determined or obtained based on at least one sub-region, thereby improving the accuracy of the position-dependent direction and weight information of the determined or obtained prediction pattern, and thus supporting the improvement of the accuracy of the prediction results for the current block.
[0143] Method a2, the gradient magnitude of at least one prediction mode; Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on the gradient magnitude of at least one prediction mode; determining or obtaining the position dependence direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependence direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0144] Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on at least one sub-region of at least one reference region of the current block and the gradient magnitude of at least one prediction mode; determining or obtaining the position-dependent direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position-dependent direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0145] Optionally, the gradient magnitude of at least one prediction mode can be the gradient magnitude of the prediction mode in at least one reference region of the current block, and / or, the gradient magnitude of the prediction mode in at least one sub-region.
[0146] Optionally, the gradient information includes: gradient magnitude and / or gradient direction, wherein the gradient direction represents the direction in which the gray value changes the fastest at a pixel in the image (e.g., at least one reference region), i.e., the direction perpendicular to the edge, and the gradient magnitude represents the intensity of the gray value change at that pixel, i.e., the salience of the edge.
[0147] Optionally, at least one sub-region is determined or obtained based on at least one reference region of the current block, and the main distribution region of at least one prediction mode is determined or obtained based on the gradient information of at least one sub-region and the gradient magnitude of at least one prediction mode.
[0148] Optionally, based on the gradient information of at least one reference region, a first gradient histogram is determined or obtained; based on the first gradient histogram, the gradient magnitude of at least one target prediction mode (hereinafter, for ease of distinction, the prediction mode used to perform prediction processing on the current block is referred to as the target prediction mode) is determined or obtained; based on the gradient magnitude of at least one target prediction mode, an magnitude threshold associated with at least one target prediction mode is determined or obtained; based on the magnitude threshold associated with at least one target prediction mode and the gradient information of at least one sub-region, the main distribution area of at least one prediction mode is determined or obtained.
[0149] Optionally, 2 / 3 of the gradient magnitude of the target prediction pattern in the reference region is determined as the magnitude threshold associated with the target prediction pattern.
[0150] Optionally, assume that the target prediction mode is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, and the magnitude threshold of mode 45 is 67.
[0151] Optionally, based on the gradient information of at least one sub-region, a second gradient histogram corresponding to the sub-region is determined or obtained; based on the second gradient histogram, the gradient magnitude of the target prediction mode in at least one sub-region is determined or obtained; and based on the gradient magnitude of the target prediction mode in at least one sub-region and the magnitude threshold associated with the target prediction mode, the main distribution region corresponding to the target prediction mode is determined or obtained.
[0152] Optionally, assume that the target prediction mode is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, the magnitude threshold of mode 45 is 67, the reference region includes sub-region A and sub-region B, the gradient magnitude of mode 45 in sub-region A is 10, and the gradient magnitude of mode 45 in sub-region B is 90.
[0153] Optionally, the sub-regions where the gradient magnitude of the target prediction pattern is greater than the gradient threshold are identified as the main distribution regions.
[0154] Optionally, assuming the target prediction pattern is pattern 45, and the gradient magnitude of pattern 45 in the reference region is 100, the magnitude threshold of pattern 45 is 67, the reference region includes sub-region A and sub-region B, the gradient magnitude of pattern 45 in sub-region A is 10, and the gradient magnitude in sub-region B is 90, since the gradient information of sub-region B is greater than the magnitude threshold 67, and the gradient information of sub-region A is less than the magnitude threshold 67, then sub-region B is the main distribution region of pattern 45.
[0155] Optionally, assume there are at least two target prediction modes, including target prediction mode A and target prediction mode B. Target prediction mode A is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, and the magnitude threshold of mode 45 is 67. Target prediction mode B is mode 66, and the gradient magnitude of mode 66 in the reference region is 50, and the magnitude threshold of mode 66 is 34. The reference region includes sub-region A and sub-region B. The gradient magnitude of mode 45 in sub-region A is 10, and the gradient magnitude in sub-region B is 90. The gradient magnitude of mode 67 in sub-region A is 5, and the gradient magnitude in sub-region B is 45. Then, sub-region B is the main distribution region of mode 45 and mode 67.
[0156] Optionally, assume there are at least two target prediction modes, including target prediction mode A and target prediction mode B. Target prediction mode A is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, and the magnitude threshold of mode 45 is 67. Target prediction mode B is mode 66, and the gradient magnitude of mode 66 in the reference region is 50, and the magnitude threshold of mode 66 is 34. The reference region includes sub-region A and sub-region B. The gradient magnitude of mode 45 in sub-region A is 10, and the gradient magnitude in sub-region B is 90. The gradient magnitude of mode 67 in sub-region A is 45, and the gradient magnitude in sub-region B is 5. Then, sub-region A is the main distribution region of mode 67, and sub-region B is the main distribution region of mode 45.
[0157] Optionally, sub-region A is Figures 9-13 A subregion B is Figures 9-13 Another sub-region.
[0158] Optionally, if the gradient magnitude of the target prediction mode in each sub-region is less than or equal to the gradient threshold, then the sub-region with the largest gradient magnitude of the target prediction mode is determined as the main distribution region.
[0159] Optionally, assuming the target prediction mode is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, the magnitude threshold of mode 45 is 67, the reference region includes sub-regions A to D, the gradient magnitude of mode 45 in sub-region A is 10, the gradient magnitude in sub-region B is 35, the gradient magnitude in sub-region C is 50, and the gradient magnitude in sub-region D is 5. Since the gradient information of sub-regions A to D is all less than the magnitude threshold of 67, and the gradient magnitude of sub-region C is the largest, then sub-region C is taken as the main distribution region.
[0160] Optionally, sub-regions A to D are Figures 9-13 The four different sub-regions.
[0161] Optionally, if the gradient magnitude of the target prediction mode in each sub-region is less than or equal to the gradient threshold, then adjacent sub-regions are combined to determine or obtain at least one combined region, and the third gradient histogram corresponding to the at least one combined region is determined or obtained. Based on the third gradient histogram, the gradient magnitude of the target prediction mode in the at least one combined region is determined or obtained. Based on the gradient magnitude of the target prediction mode in the at least one combined region and the magnitude threshold associated with the target prediction mode, the main distribution region corresponding to the target prediction mode is determined or obtained.
[0162] Optionally, the combined region is composed of at least two adjacent sub-regions. For example, two, three, four, or other adjacent sub-regions are combined to determine or obtain at least one combined region.
[0163] Reference Figure 9 The reference region of the block to be predicted (i.e. the current block) includes sub-regions 0 to 6. Adjacent sub-regions can be combined to determine or obtain a combined region. For example, sub-region 0 and sub-region 1 can be combined to determine or obtain a combined region, sub-region 4, sub-region 0 and sub-region 1 can be combined to determine or obtain a combined region, and sub-region 1, sub-region 2 and sub-region 3 can be combined to determine or obtain a combined region.
[0164] Optionally, the dimensions of the combined regions may differ or be at least partially the same.
[0165] Optionally, the shape of the combined area can be non-rectangular or L-shaped.
[0166] Optionally, it can be Figure 9 Subregions 0 and 1 are merged to obtain a combined subregion 0, which can then be used to... Figure 9 Subregions 1, 2, and 3 are merged to obtain a combined subregion 1, which can then be used to... Figure 9 Subregions 4, 5, and 6 are merged to obtain subregion 2. Subregions 0 and 2 do not overlap. The widths of combined region 0 and combined region 1 are different, the heights of combined region 0 and combined region 1 are the same, the widths of combined region 0 and combined region 2 are different, and the heights of combined region 0 and combined region 2 are different.
[0167] Optionally, it can be Figure 9 Subregions 0, 1, and 4 are merged to obtain a combined subregion 0. Figure 9 Subregions 0, 1, and 2 are merged to obtain a combined subregion 1, which can then be used to... Figure 9 Subregions 1, 2, and 3 are merged to obtain a combined subregion 2, which can then be used to... Figure 9 Subregions 0, 4, and 5 are merged to obtain a combined subregion 3, which can then be used to... Figure 9 Subregions 4, 5, and 6 are merged to obtain a combined subregion 4. The combined subregions 0 to 4 partially overlap. Combined region 0 is L-shaped, and the width and height of each combined region are different.
[0168] Optionally, it can be Figure 9 Subregion 1 and subregion 2 are merged to obtain combined subregion 1, which can then be used to... Figure 9 Subregions 2 and 3 in the original text are merged to obtain combined subregion 2. The width and height of combined regions 1 and 2 are the same.
[0169] Optionally, the regions where the gradient magnitude of the target prediction pattern is greater than the gradient threshold are identified as the main distribution regions.
[0170] Optionally, assuming the target prediction mode is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, the magnitude threshold of mode 45 is 67, the reference region includes combined region A and combined region B, the gradient magnitude of mode 45 in combined region A is 10, and the gradient magnitude in combined region B is 90. Since the gradient information of combined region B is greater than the magnitude threshold 67, and the gradient information of combined region A is less than the magnitude threshold 67, then combined region B is the main distribution region of mode 45.
[0171] Optionally, if there are multiple combination regions or sub-regions where the gradient magnitude of the target prediction mode is greater than the gradient threshold, the combination region or sub-region with the largest gradient magnitude among the combination regions or sub-regions where the gradient magnitude is greater than the gradient threshold can be determined as the main distribution region, or all combination regions or sub-regions where the gradient magnitude is greater than the gradient threshold can be used as the main reference region.
[0172] Optionally, assuming the target prediction mode is mode 45, and the gradient magnitude of mode 45 in the reference region is 100, the magnitude threshold of mode 45 is 67, the reference region includes combination region A to combination region D, the gradient magnitude of mode 45 in combination region A is 10, the gradient magnitude in combination region B is 35, the gradient magnitude in combination region C is 50, and the gradient magnitude in combination region D is 5. Since the gradient information of combination regions A to combination region D is all less than the magnitude threshold of 67, and the gradient magnitude of combination region C is the largest, then combination region C is taken as the main distribution region.
[0173] Optionally, assuming there are at least two target prediction modes, including target prediction mode A and target prediction mode B, target prediction mode A is mode 45, and mode 45 has a gradient magnitude of 100 in the reference region and a magnitude threshold of 67, target prediction mode B is mode 66, and mode 66 has a gradient magnitude of 50 in the reference region and a magnitude threshold of 34, the reference region includes sub-region A and sub-region B, mode 45 has a gradient magnitude of 10 in sub-region A and a gradient magnitude of 90 in sub-region B, the reference region includes combined region A and combined region B, mode 67 has a gradient magnitude of 45 in combined region A and a gradient magnitude of 5 in combined region B, then combined region A is the main distribution region of mode 67, and sub-region B is the main distribution region of mode 45.
[0174] Optionally, at least one prediction model may correspond to one or more primary reference regions.
[0175] In this embodiment, the main distribution area of a more accurate prediction mode can be determined or obtained based on the gradient magnitude of at least one prediction mode in the sub-region and / or combined region, so as to improve the accuracy of the position-dependent direction of the determined or obtained prediction mode and the accuracy of the weight information, thereby supporting the improvement of the accuracy of the prediction results for the current block.
[0176] Method a3, the pixel position of the pixel corresponding to the gradient information of at least one prediction mode.
[0177] Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on the pixel position of the pixel corresponding to the gradient information of at least one prediction mode; determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0178] Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on the pixel position of the pixel corresponding to the gradient information of at least one prediction mode and the gradient magnitude of at least one prediction mode; determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0179] Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on the pixel position of the pixel corresponding to the gradient information of at least one sub-region of at least one reference region of the current block and at least one prediction mode; determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0180] Optionally, step S10 includes: determining or obtaining the main distribution region corresponding to at least one prediction mode based on at least one sub-region of at least one reference region of the current block, the gradient magnitude of at least one prediction mode, and the pixel position of the pixel corresponding to the gradient information of at least one prediction mode; determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the main distribution region corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0181] Optionally, in intra-frame prediction, each angle prediction mode represents a specific prediction direction. The prediction mode corresponding to the current block can be determined or obtained based on at least one gradient histogram (hereinafter, for ease of distinction, the prediction mode used to perform prediction processing on the current block is referred to as the target prediction mode). This indicates that the prediction direction corresponding to the target prediction mode (i.e., the direction perpendicular to the gradient direction) is the dominant texture direction of the current block, and the position of the pixel in at least one reference region of the current block that is consistent with the prediction direction corresponding to the target prediction mode is the pixel position of the pixel corresponding to the gradient information of the target prediction mode.
[0182] Optionally, gradient information (e.g., gradient magnitude and / or gradient direction) of at least one pixel contained in at least one reference region of the current block can be pre-stored in the storage unit. When a prediction mode for predicting the current block is determined, the pixel position of the pixel corresponding to the gradient information of the prediction mode can be determined or obtained through the storage unit, and the position-dependent direction corresponding to the prediction mode can be determined or obtained based on the pixel position of the pixel corresponding to the gradient information of the prediction mode.
[0183] Optionally, based on the number of pixels corresponding to the gradient information of at least one prediction mode, the mode distribution ratio of the target prediction mode in at least one reference region is determined or obtained; based on the mode distribution ratio of the target prediction mode in at least one reference region, a mode ratio threshold is determined or obtained; based on the pixel position of the pixel corresponding to the gradient information of at least one prediction mode, the mode distribution ratio of the target prediction mode in at least one sub-region is determined or obtained; and based on the mode distribution ratio of the target prediction mode in at least one sub-region and the mode ratio threshold, the main distribution region is determined or obtained.
[0184] Optionally, the mode distribution ratio of the target prediction mode in the at least one reference region is determined or obtained based on the number of pixels corresponding to the gradient information of at least one prediction mode and the total number of pixels in the at least one reference region of the current block. For example, if the total number of pixels in the reference region is 4 and the number of pixels corresponding to the gradient information of at least one prediction mode is 3, then the mode distribution ratio of the target prediction mode in the reference region is 3 / 4.
[0185] Optionally, based on the pixel position of the pixel corresponding to the gradient information of at least one prediction mode, the number of pixels in at least one sub-region whose prediction mode is the target prediction mode is determined or obtained, and based on the number of pixels in at least one sub-region whose prediction mode is the target prediction mode and the total number of pixels in at least one sub-region, the mode distribution ratio of the target prediction mode in at least one sub-region is determined or obtained.
[0186] Optionally, the sub-regions where the distribution proportion of the target prediction pattern is greater than the pattern proportion threshold are identified as the main distribution regions.
[0187] Optionally, assuming the target prediction mode is mode 35, the mode proportion threshold of mode 35 is 2 / 3, the reference area includes sub-region A and sub-region B, the number of pixels in sub-region A and sub-region B is the same, the mode distribution proportion of mode 35 in sub-region A is 3 / 4, and the mode distribution proportion of mode 35 in sub-region B is 1 / 3. Since the mode distribution proportion of mode 35 in sub-region A is greater than the mode proportion threshold, sub-region A is the main distribution area of mode 35.
[0188] Optionally, if the pattern distribution ratio of the target prediction pattern in each sub-region is less than or equal to the pattern distribution ratio threshold, then the sub-region with the largest pattern distribution ratio of the target prediction pattern is determined as the main distribution region.
[0189] Optionally, assuming the target prediction mode is mode 35, and the mode proportion threshold of mode 35 is 2 / 3, the reference area includes sub-regions A to D. The mode distribution proportion of mode 35 is 1 / 3 in sub-region A, 1 / 3 in sub-region B, 1 / 2 in sub-region C, and 1 / 3 in sub-region D. Since the mode distribution proportions of sub-regions A to D are all less than the mode proportion threshold of 2 / 3, and the gradient magnitude of sub-region C is the largest, then sub-region C is taken as the main distribution area of mode 35.
[0190] Optionally, if the pattern distribution ratio of the target prediction pattern in each sub-region is less than or equal to the pattern ratio threshold, then the adjacent sub-regions are combined to determine or obtain at least one combined region, the pattern distribution ratio of the target prediction pattern in the at least one combined region is determined or obtained, and the main distribution region corresponding to the target prediction pattern is determined or obtained based on the pattern distribution ratio of the target prediction pattern in the at least one combined region and the pattern ratio threshold associated with the target prediction pattern.
[0191] Optionally, assuming the target prediction pattern is pattern 35, the pattern proportion threshold is 2 / 3, and the reference area includes sequentially adjacent sub-regions A, B, and C, the pattern distribution proportion of pattern 35 in sub-region A is 1 / 3, in sub-region B is 1 / 3, and in sub-region C is 1 / 3. Since the pattern distribution proportions of sub-regions A to D are all less than the pattern proportion threshold of 2 / 3, adjacent sub-regions are combined to obtain combined region 0 composed of sub-regions A and B, and combined region 1 composed of sub-regions B and C. The pattern distribution proportion of combined region 0 is determined to be 3 / 4, and the pattern distribution proportion of combined region 1 is 1 / 2. Since the pattern distribution proportion of combined region 1 is less than the pattern proportion threshold, and the pattern distribution proportion of combined pattern 0 is greater than the pattern proportion threshold, combined region 1 is taken as the main distribution area of pattern 35.
[0192] Optionally, a first gradient histogram is determined or obtained based on the gradient information of at least one reference region; the gradient magnitude of at least one target prediction mode is determined or obtained based on the first gradient histogram; the magnitude threshold associated with at least one target prediction mode is determined or obtained based on the gradient magnitude of at least one target prediction mode; and the main distribution region of at least one prediction mode is determined or obtained based on the magnitude threshold associated with at least one target prediction mode and the gradient information of at least one sub-region.
[0193] Optionally, assuming the target prediction mode is mode 35, the gradient magnitude corresponding to mode 35 in the gradient histogram is 100, the magnitude threshold associated with mode 35 is determined to be 67, the reference region includes sub-region A and sub-region B, the gradient magnitude of mode 35 in sub-region A is 10, and the gradient magnitude of mode 35 in sub-region B is 80. Since the gradient magnitude of sub-region B is greater than the magnitude threshold and the gradient magnitude of sub-region A is less than the gradient threshold, sub-region B is determined as the main distribution region of mode 35.
[0194] Optionally, if the gradient magnitude of the target prediction mode in each sub-region is less than or equal to the gradient threshold, or if there are multiple sub-regions with gradient magnitudes greater than the gradient threshold, then the sub-regions are sorted according to the gradient magnitude of the target prediction mode in each sub-region, and at least one candidate sub-region is determined based on the sorting result. For example, the sub-regions are sorted according to the gradient magnitude of the target prediction mode from largest to smallest, and the top 3 sub-regions with the largest gradient magnitudes are determined as candidate sub-regions. Based on the distribution ratio of the target prediction mode in the candidate sub-regions, the main distribution area of the target prediction mode is determined from the candidate sub-regions.
[0195] Optionally, assuming the target prediction mode is mode 35, the magnitude threshold associated with mode 35 is 67, and the reference region includes sequentially adjacent sub-regions A, B, and C, the gradient magnitude of mode 35 in sub-region A is 30, the gradient magnitude of mode 35 in sub-region B is 60, and the gradient magnitude of mode 35 in sub-region C is 62. Since the gradient magnitudes of sub-regions A through C are all less than the magnitude threshold, the sub-regions are sorted according to the gradient magnitude, and the sorting result is: sub-region C > sub-region B > sub-region A. The two sub-regions with the highest gradient magnitudes are determined as candidate sub-regions, that is, the candidate sub-regions include sub-region C and sub-region B. Assuming the mode proportion threshold associated with mode 35 is 2 / 3, the mode distribution proportion of mode 35 in sub-region C is determined to be 1 / 3, and the mode distribution proportion of mode 35 in sub-region B is determined to be 3 / 4. Since the mode distribution proportion in sub-region C is less than the mode proportion threshold, and the mode distribution proportion in sub-region B is greater than the mode proportion threshold, sub-region B is taken as the main distribution region of mode 35.
[0196] Optionally, assuming the target prediction mode is mode 35, the magnitude threshold associated with mode 35 is 67, and the reference region includes sequentially adjacent sub-regions A, B, and C, the gradient magnitude of mode 35 in sub-region A is 68, the gradient magnitude of mode 35 in sub-region B is 75, and the gradient magnitude of mode 35 in sub-region C is 80. Since the gradient magnitudes of sub-regions A through C are all greater than the magnitude threshold, the sub-regions are sorted according to the gradient magnitude, and the sorting result is: sub-region C > sub-region B > sub-region A. The two sub-regions with the highest gradient magnitudes are determined as candidate sub-regions, that is, the candidate sub-regions include sub-region C and sub-region B. Assuming the mode proportion threshold associated with mode 35 is 2 / 3, the mode distribution proportion of mode 35 in sub-region C is determined to be 1 / 3, and the mode distribution proportion of mode 35 in sub-region B is determined to be 3 / 4. Since the mode distribution proportion in sub-region C is less than the mode proportion threshold, and the mode distribution proportion in sub-region B is greater than the mode proportion threshold, sub-region B is taken as the main distribution region of mode 35.
[0197] In this embodiment, the main distribution region of the prediction mode can be determined or obtained more accurately based on the pixel position of the pixel corresponding to the gradient information of at least one prediction mode, so as to improve the accuracy of the position-dependent direction and weight information of the determined or obtained prediction mode, thereby supporting the improvement of the accuracy of the prediction result for the current block.
[0198] Method B: Current block position information.
[0199] Optionally, step S10 includes: determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the position information of the current block; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0200] Optionally, step S10 includes: determining or obtaining the position dependency direction corresponding to at least one prediction mode based on the position information of the current block and the main distribution area corresponding to at least one prediction mode; determining or obtaining the weight information corresponding to at least one prediction mode based on the position dependency direction corresponding to at least one prediction mode; and determining or obtaining the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0201] Optionally, the location-dependent direction corresponding to at least one prediction model is determined or obtained based on the direction from the current block to the main distribution area corresponding to at least one prediction model, which is determined or obtained through the location information of the current block.
[0202] Optionally, the position-dependent direction of at least one prediction mode is determined or obtained based on the first position and / or the second position.
[0203] Optionally, the position-dependent direction of at least one prediction mode is determined or obtained based on the direction from the second position to the first position.
[0204] Optionally, the first location includes at least one of the following: the center of the main distribution region, the centroid, at least one vertex, and at least one boundary midpoint.
[0205] Optionally, the second position includes at least one of the following: the center of the current block, the centroid, at least one vertex, and at least one boundary midpoint.
[0206] Reference Figure 11 Based on the reference region of the block to be predicted (i.e., the current block), sub-regions are determined or obtained, including: sub-regions 0 to 6. Each sub-region does not overlap. If sub-region 0, sub-region 2, or sub-region 3 is used as the main reference region corresponding to the prediction mode, the position dependency direction corresponding to the prediction mode is determined or obtained according to the direction from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of sub-region 0, sub-region 2, or sub-region 3 (i.e., the first position). If sub-region 4, sub-region 5, or sub-region 6 is used as the main reference region corresponding to the prediction mode, the position dependency direction corresponding to the prediction mode is determined or obtained according to the direction from the center of the current block (i.e., the second position) to the midpoint of the right boundary of sub-region 4, sub-region 5, or sub-region 6 (i.e., the first position). If sub-region 0 is used as the main reference region corresponding to the prediction mode, the position dependency direction corresponding to the prediction mode is determined or obtained according to the direction from the center of the current block (i.e., the second position) to the lower right corner vertex of sub-region 0 (i.e., the first position).
[0207] Reference Figure 12 The reference region of the block to be predicted (i.e., the current block) includes sub-regions 0 to 6. Adjacent sub-regions can be combined to determine or obtain a combined region. For example, if sub-region 1 and sub-region 2 are combined to determine or obtain combined region 1, and used as the main distribution region, the position dependency direction corresponding to the prediction mode is determined or obtained according to the direction (i.e., direction 1) from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of combined region 1 (i.e., the first position). If sub-region 2 and sub-region 3 are combined to determine or obtain combined region 2, and used as the main distribution region, the position dependency direction corresponding to the prediction mode is determined or obtained according to the direction (i.e., direction 2) from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of combined region 2 (i.e., the first position). If sub-region 0 and sub-region 1 are combined to determine or obtain combined region 6, the position dependency direction corresponding to the prediction mode is determined or obtained according to the direction (i.e., direction 2) from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of combined region 2 (i.e., the first position). If region 3 is used as the main distribution region, the location-dependent direction of the prediction mode is determined or obtained by the direction from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of combined region 3 (i.e., the first position) (i.e., direction 3). If sub-regions 4 and 5 are combined to determine or obtain combined region 4, and it is used as the main distribution region, the location-dependent direction of the prediction mode is determined or obtained by the direction from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of combined region 4 (i.e., the first position) (i.e., direction 4). If sub-regions 5 and 6 are combined to determine or obtain combined region 5, and it is used as the main distribution region, the location-dependent direction of the prediction mode is determined or obtained by the direction from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of combined region 5 (i.e., the first position) (i.e., direction 5).
[0208] Reference Figure 12 Based on the location dependency direction corresponding to the prediction model, the weight information corresponding to the prediction model is determined or obtained. If the location dependency direction corresponding to the prediction model is... Figure 12 If direction 2 is given, the weight information can be determined or obtained according to the following formula (I).
[0209] W = W ori -0.5 △x+0.5 △y+△x (x / (W-1))-△y Formula (y / (H-1)) (I); Optionally, W represents the adjusted weight information. ori The original weight information is defined as follows: x is the horizontal coordinate of the pixel within the current block, y is the vertical coordinate of the pixel within the current block, Δx is the preset horizontal weight value, Δy is the preset vertical weight value, W is the width of the current block, and H is the height of the current block.
[0210] Optionally, the original weight information is determined or obtained based on the gradient magnitude of the gradient direction corresponding to the prediction mode in the gradient histogram of the reference region.
[0211] Optionally, the original weight information is determined or obtained based on at least one gradient histogram.
[0212] Optionally, from at least one gradient histogram (e.g., Figure 21 In the gradient histogram shown, the N gradient magnitude values with the largest gradient magnitude are determined. At least one of the N prediction modes related to the gradient direction corresponding to the N gradient magnitude values is the above prediction mode. The weight information of the above prediction mode is determined or obtained based on the N gradient magnitude values. This weight information is the original weight information.
[0213] Optionally, the above-mentioned prediction mode includes at least one prediction mode, which includes mode X and mode Y. In the gradient magnitude map H, the gradient magnitude value of mode X is AmpX and the gradient magnitude value of mode Y is AmpY. The original weight information of mode X can be determined by the ratio of the gradient magnitude value of mode X to the sum of the gradient magnitude values of the two modes (AmpX+AmpY), and the original weight information of mode Y can be determined by the ratio of the gradient magnitude value of mode Y to the sum of the gradient magnitude values of the two modes (AmpX+AmpY).
[0214] Reference Figure 12 Based on the location dependency direction corresponding to the prediction model, the weight information corresponding to the prediction model is determined or obtained. If the location dependency direction corresponding to the prediction model is... Figure 12 If direction 5 is used, the weight information can be determined or obtained according to the following formula (II).
[0215] W = W ori +0.5 △x-0.5 △y-△x (x / (W-1)) + Δy Formula (II) for (y / (H-1)); Optionally, W represents the adjusted weight information. ori The original weight information is defined as follows: x is the horizontal coordinate of the pixel within the current block, y is the vertical coordinate of the pixel within the current block, Δx is the preset horizontal weight value, Δy is the preset vertical weight value, W is the width of the current block, and H is the height of the current block.
[0216] Optionally, the original weight information is determined or obtained based on the gradient magnitude of the gradient direction corresponding to the prediction mode in the gradient histogram of the reference region.
[0217] Reference Figure 12Based on the location dependency direction corresponding to the prediction model, the weight information corresponding to the prediction model is determined or obtained. If the location dependency direction corresponding to the prediction model is... Figure 12 If direction 3 is used, the weight information can be determined or obtained according to the following formula (III).
[0218] W = W ori +0.5 △x+0.5 △y-△x (x / (W-1))-△y Formula (3) for (y / (H-1)); Optionally, W represents the adjusted weight information. ori The original weight information is defined as follows: x is the horizontal coordinate of the pixel within the current block, y is the vertical coordinate of the pixel within the current block, Δx is the preset horizontal weight value, Δy is the preset vertical weight value, W is the width of the current block, and H is the height of the current block.
[0219] Optionally, the original weight information is determined or obtained based on the gradient magnitude of the gradient direction corresponding to the prediction mode in the gradient histogram of the reference region.
[0220] Optionally, the derivation formulas for the weight information corresponding to position-dependent directions other than those mentioned above can be deduced similarly.
[0221] Reference Figures 13-15 Based on the reference region of the block to be predicted (i.e., the current block) and the preset sub-region size (the preset sub-region size is WxH), the sub-region is determined or obtained. Figure 13 In the diagram, sub-regions include: sub-region 0, sub-region 1, sub-region 2, sub-region 3, ..., sub-region N. Each sub-region must not overlap or coincide with at least some parts. If sub-regions 0 to 3 are taken as the main distribution area, the location-dependent direction corresponding to the prediction pattern is determined or obtained based on the direction from the center of the current block (i.e., the second position) to the midpoint of the lower boundary of sub-regions 0 to 3 (i.e., the first position). Figure 14 In the middle, if sub-regions 0 to 3 are taken as the main distribution areas, then the location-dependent direction corresponding to the prediction model is determined or obtained based on the direction from the center of the current block (i.e., the second position) to the midpoint of the right boundary of sub-regions 0 to 3 (i.e., the first position). Figure 15 In this context, if sub-regions 0 to 3 are taken as the main distribution areas, the location-dependent direction corresponding to the prediction model is determined or obtained based on the direction from the center of the current block (i.e., the second position) to the midpoint of the boundary adjacent to the current block in sub-regions 0 to 3 (i.e., the first position). For example, Figure 16 The boundary between sub-region 0 and the current block is shown.
[0222] Reference Figure 13For sub-regions 0, 1, 2, 3, ..., N located above the current block, the positional offset between each sub-region and its adjacent sub-regions is a preset value, which is greater than 0. For example, Figure 13 In this case, the default value is 1.
[0223] Reference Figure 14 For sub-regions 0, 1, 2, 3, ..., M located to the left of the current block, the positional offset between each sub-region and its adjacent sub-region is a preset value, which is greater than 0. For example, Figure 14 In this case, the default value is 1.
[0224] Reference Figure 15 For sub-regions 0, 1, 2, 3, ..., L located to the upper left of the current block, the positional offset between each sub-region and its adjacent sub-regions is a preset value, which is greater than 0. For example, Figure 15 In this case, the default value is 1.
[0225] In this embodiment, by Figures 13-15 By combining the embodiments shown, the position-dependent directions of the current block can be obtained in each direction. Without interpolating the pixels in the reference area (i.e., at integer pixel precision), the angle difference between adjacent position-dependent directions is relatively small. Therefore, by setting the position-dependent directions in this embodiment, the accuracy of the weight information can be improved, thereby supporting the improvement of the accuracy of the prediction results for the current block.
[0226] refer to Figure 17 The sub-regions 00, 01, 02, ..., 0N located above the current block are sub-regions obtained by interpolating the pixels in the reference region (i.e., sub-region 00). Figure 17 The pixels in each sub-region are obtained by... Figure 13 It is obtained by interpolating corresponding pixels in two adjacent sub-regions, for example... Figure 17 The pixels in neutron region 00 are... Figure 13 It is obtained by interpolating the corresponding pixels in sub-region 0 and sub-region 1.
[0227] refer to Figure 18 Subregion 00 is obtained by interpolating subregion 0 and subregion 1. For example, the pixel at the top left corner of subregion 00 is obtained by interpolating the pixels at the top left corner of subregion 0 and subregion 1 (e.g., ...). Figure 18 The weighted average of the shadow pixels in the image is obtained by averaging the pixels at other positions in sub-region 00, which is obtained by averaging the corresponding pixels in sub-region 0 and sub-region 1.
[0228] Optionally, positional correspondence means that in different sub-regions, the x-coordinate and / or y-coordinate of a pixel are the same relative to the top-left corner pixel of the reference region.
[0229] Optionally, pixels in sub-region 00 of the reference region are determined or obtained by subpixel interpolation (e.g., horizontal interpolation and / or vertical interpolation).
[0230] Optionally, sub-regions with different fractional pixel precisions can be obtained, such as 1 / 2, 1 / 4, and 1 / 8 pixel precisions, with different plugging coefficients used in the interpolation process for each fractional pixel precision.
[0231] Optionally, templates of 1 / 2 pixel, 1 / 4 pixel, and 3 / 4 pixel are as follows: Figure 19 As shown, A -1, -1 A 0, -1 ,…,A 2,2 For integer pixels, b 0, 0 ,h 0, 0 , equal to 1 / 2 pixel point, a 0, 0 ,d 0, 0 , equal to 1 / 4 pixel, c 0, 0 ,n 0, 0 The values at the 1 / 2 pixel position are generated by an 8-tap filter based on discrete cosine transform, while the values at the 1 / 4 and 3 / 4 pixel positions are generated by a 7-tap filter based on discrete cosine transform. The tap coefficients are provided by the luminance interpolation filter tap coefficient table, which can be shown in Table 1 below: Table 1
[0232] Reference Figure 19 The pixel-by-pixel interpolation process includes the following steps S101 and S102: Step S101: Interpolate the row or column containing the integer pixel.
[0233] Optionally, with A 0, 0 Taking nearby sub-pixels as an example, the following satisfy the condition: a 0, 0 ,b 0, 0 ,c 0, 0 ,d 0, 0 ,h 0, 0 ,n 0, 0 Where a 0, 0 ,b 0, 0 ,c 0, 0 The value can be calculated using integer pixels in the horizontal direction, d 0, 0 ,h 0, 0 ,n 0, 0 The value is calculated using integer pixels in the vertical direction, as follows: a0, 0 =(-A -3, 0 +4A -2, 0 -10A -1, 0 +58A 0, 0 +17A 1, 0 -5A 2, 0 +A 3, 0 )>>6; h 0, 0 =(-A 0, -3 +4A 0, -2 -11A 0, -1 +40A 0, 0 +40A 0, 1 -11A 0, 2 +4A 0, 3 -A 0, 4 )>>6; The pixels at other locations can be calculated using the corresponding filters.
[0234] Step S102: Interpolate the remaining sub-pixel positions.
[0235] Optionally, for pixels not located in integer row or column positions, such as e 0, 0 ,f 0, 0 ,g 0, 0 i 0, 0 ,j 0, 0 ,k 0, 0 ,p 0, 0 ,q 0, 0 ,r 0, 0 It needs to be calculated using the pixel values (positions a, b, c) of the integer pixel row obtained in the first step, as follows: e 0, 0 =(-a 0, -3 +4a 0, -2 -10a 0, -1 +58 0, 0 +17 0, 1 -5a 0, 2 +a 0, 3 )>>6; j 0, 0 =(-b 0, -3 +4b 0, -2 -11b 0, -1 +40b 0, 0 +40b 0, 1 -11b 0, 2 +4b 0, 3 -b 0, 4 )>>6; r 0, 0 =(C 0, -2 -5c 0, -1 +17c 0, 0 +58c 0, 1 -10c0, 2 +4c 0, 3 -C 0, 4 )>>6; The pixels at other locations can be calculated using the corresponding filters.
[0236] Optionally, the aforementioned pixels are luminance pixels or chrominance pixels.
[0237] Optionally, the pixel values corresponding to each position of the sub-region 00 of the reference region with a precision of 1 / 2, 1 / 4, and 1 / 8 pixels are determined according to the interpolation method, and the sub-region 00 with each pixel precision is determined by the pixel values with the same pixel precision.
[0238] In this embodiment, by Figure 17 The illustrated embodiments and Figures 13-15 By combining the illustrated embodiments, the position-dependent directions of the current block in each direction can be obtained, thereby determining position-dependent directions with sub-pixel precision. Compared to position-dependent directions with integer pixel precision, position-dependent directions with sub-pixel precision are more accurate. Therefore, by setting the position-dependent directions in this embodiment, the accuracy of weight information is improved, thereby supporting an increase in the accuracy of prediction results for the current block.
[0239] Third Embodiment Based on any of the above embodiments, a third embodiment is proposed.
[0240] In this embodiment, the reference region is determined or obtained according to at least one of the following methods b1 to b4: Method b1, at least one of the following: the upper adjacent pixel, the upper non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the upper left adjacent pixel, and the upper left non-adjacent pixel; Optionally, the reference area includes: reference pixels, reference blocks, and / or reference templates.
[0241] Optionally, the reference region of the current block can be determined or obtained based on at least one of the above adjacent pixels, above non-adjacent pixels, left adjacent pixels, left non-adjacent pixels, upper left adjacent pixels, and upper left non-adjacent pixels.
[0242] Optionally, step S10 includes: determining or obtaining at least one reference region of the current block based on at least one of the above adjacent pixels, above non-adjacent pixels, left adjacent pixels, left non-adjacent pixels, upper left adjacent pixels, and upper left non-adjacent pixels; and determining or obtaining the prediction result of the current block based on the at least one reference region of the current block, at least one prediction mode, and its corresponding weight information.
[0243] Optionally, the upper adjacent pixel can be a pixel located above and adjacent to the current block in the same frame of the image.
[0244] Alternatively, the non-adjacent pixels above can be pixels in the same frame that are above the current block but not adjacent to it.
[0245] Optionally, the left-adjacent pixel can be a pixel located to the left and adjacent to the current block in the same frame of the image.
[0246] Optionally, the non-adjacent pixels on the left can be pixels located to the left of the current block in the same frame of the image, but not adjacent to the current block.
[0247] Optionally, the upper left adjacent pixel can be a pixel located in the same frame image that is adjacent to the upper left of the current block.
[0248] Optionally, the non-adjacent pixel in the upper left corner can be a pixel in the same frame that is located in the upper left corner of the current block, but is not adjacent to the current block.
[0249] Optionally, at least one of the above adjacent pixel, above non-adjacent pixel, left adjacent pixel, left non-adjacent pixel, upper left adjacent pixel, and upper left non-adjacent pixel can be a reconstructed pixel or a predicted pixel.
[0250] Optionally, at least one of the following can be used as the reference area: the upper adjacent pixel, the upper non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the upper left adjacent pixel, and the upper left non-adjacent pixel. Alternatively, the reference area can be derived or calculated from at least one obtained pixel.
[0251] Optionally, the reference region of the current block can be obtained according to preset mapping / correspondence rules.
[0252] Optionally, a reference region can be selected from the top adjacent pixels, top non-adjacent pixels, left adjacent pixels, left non-adjacent pixels, top left adjacent pixels, and top left non-adjacent pixels of the current block, based on the prediction model.
[0253] Alternatively, if some locations lack valid pixel data, they can be filled using neighboring valid pixels.
[0254] In this embodiment, since the current block usually has a high similarity to at least one of the above adjacent pixel, above non-adjacent pixel, left adjacent pixel, left non-adjacent pixel, upper left adjacent pixel, and upper left non-adjacent pixel, the prediction accuracy for the current block and / or its partitions can be improved based on the reference area determined by these adjacent pixels and / or non-adjacent pixels.
[0255] Method b2 requires at least one of the following: the neighboring block, the non-neighboring block, the sibling block, the temporal block, and the default block corresponding to the current block. Optionally, at least one of the following can be used as a reference region: the neighboring block, the non-neighboring block, the co-located block, the temporal block, and the default block corresponding to the current block.
[0256] Optionally, at least one reference region can be determined or obtained based on image block information from at least one of the following: neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks, and default blocks corresponding to the current block.
[0257] Optionally, step S10 includes: determining or obtaining at least one reference region of the current block based on at least one of the neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks and default blocks corresponding to the current block; and determining or obtaining the prediction result of the current block based on the at least one reference region, at least one prediction mode and its corresponding weight information.
[0258] Optionally, the image block information may include at least one of the following: block size, block area, image block attributes, and image block type.
[0259] Optionally, the block size includes the block's width, height, scale, depth, area, resolution, and number of pixels, etc. The image block attributes may include the block's position and / or image texture, and the image block type may include natural images or screen content images, etc.
[0260] Optionally, at least one reference region can be determined or obtained based on at least one of the following: the upper adjacent pixel, the upper non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the upper left adjacent pixel, and the upper left non-adjacent pixel, among the neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks, and default blocks corresponding to the current block.
[0261] Optionally, at least one of the following can be used as a reference region: the upper adjacent pixel, the upper non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the upper left adjacent pixel, and the upper left non-adjacent pixel among the neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks, and default blocks corresponding to the current block.
[0262] Optionally, at least one reference region can be determined or obtained based on at least one of the width, height, block size, and block area of at least one of the neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks, and default blocks corresponding to the current block.
[0263] Optionally, a neighboring block can be a block adjacent to the current block, and can be a block that has already been predicted or reconstructed.
[0264] Optionally, a non-neighbor block can be a block that is not adjacent to the current block, and can be a block that has already been predicted or reconstructed.
[0265] Optionally, a co-location block can be an image block in a co-location image that has the same position and size as the current block. The co-location image can be the image in the reference image that is temporally closest to the current image.
[0266] Optionally, a temporal block can be a block distinguished in the time domain, such as an image block in other frames before or after the current frame. For example, if video data contains a first frame, a second frame, and a third frame played in the first, second, and third seconds, and the current block is a block divided from the second frame, then the temporal block corresponding to the current block can be determined to be the corresponding image block in other frames besides the second frame.
[0267] Optionally, the default block can be a pre-set block, such as a block with typical pixel characteristics pre-set by the encoder and / or decoder.
[0268] In this embodiment, at least one reference region is determined or obtained based on at least one of the neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks, and default blocks corresponding to the current block. This ensures that the determined or obtained reference region is closely related to the current block and / or its partitions, thereby making the subsequent prediction results obtained based on the reference region more accurate.
[0269] Method b3, at least one of the following: width, height, block size, and block area of the current block; Optionally, step S10 includes: determining or obtaining at least one reference region of the current block based on at least one of the width, height, block size, and block area of the current block; and determining or obtaining the prediction result of the current block based on the at least one reference region, at least one prediction mode, and its corresponding weight information.
[0270] Optionally, at least one reference region can be determined or obtained based on the width, height, and first mapping table of the current block. Optionally, the first mapping table can be as shown in Table 2 below: Table 2
[0271] Optionally, the height of at least one reference region is equal to the height of the current block by a first preset multiple, and the width of at least one reference region is equal to the width of the current block by a second preset multiple.
[0272] Optionally, the reference area or the image area within the reference area can be an encoded area or a decoded area.
[0273] Optionally, the encoded or decoded region can be determined by the position of the top-left pixel, the height and width of the encoded or decoded region. For example, the position of the top-left pixel can be the position of the image block at a height N (N is greater than 1) times above the top-left position of the current block and at a position N times the width of the image block to the left. The width of the encoded or decoded region is an integer multiple of the width of the current block, and the height of the encoded or decoded region is an integer multiple of the height of the current block.
[0274] Optionally, the reference region can be determined based on the block size of the current block and the second mapping table.
[0275] Alternatively, the second mapping table can be as shown in Table 3 below: Table 3
[0276] Optionally, the block size includes at least one of the block's width, height, scale, depth, area, resolution, and number of pixels. Optionally, X4 to X7 can be a preset threshold corresponding to at least one of the block size's width, height, scale, depth, area, resolution, and number of pixels.
[0277] Optionally, a reference region can be determined based on the block area of the current block and a third mapping table. Optionally, the third mapping table can be as shown in Table 4 below: Table 4
[0278] Optionally, the positions of the reference region, reference block, and / or reference pixels can be determined or obtained based on the upper adjacent pixels, left adjacent pixels, and upper left adjacent pixels of the current block, and the size of the reference region can be determined based on the width and height of the current block and the first mapping table.
[0279] Optionally, the reference area of the current block includes: a first area adjacent to the top of the current block, a second area adjacent to the left of the current block, and a third area adjacent to the upper left of the current block. The width of the first area is equal to twice the width of the current block, and the height of the second area is equal to twice the height of the current block. If the width and height of the current block are both greater than or equal to 8, then the height of the first area is 8, the width of the second area is 8, and the width and height of the third area are both 8; or, if either the width or the height of the current block is less than 8, then the height of the first area is 4, the width of the second area is 4, and the width and height of the third area are both 4.
[0280] In this embodiment, by determining or obtaining a reference region, a reference block, and / or a reference pixel based on at least one of the width, height, block size, and block area of the current block, it is ensured that the reference region is closely related to the current block and / or its partitions, thereby making the subsequent prediction results obtained based on the reference region more accurate.
[0281] Method b4: The candidate motion vector or candidate block vector of the current block is determined or the candidate block is obtained; Optionally, step S10 includes: determining or obtaining a candidate block based on the candidate motion vector or candidate block vector of the current block; determining or obtaining at least one reference region of the current block; and determining or obtaining the prediction result of the current block based on the at least one reference region, at least one prediction mode and its corresponding weight information.
[0282] Optionally, a candidate block can be determined or obtained based on at least one candidate motion vector or at least one candidate block vector in the candidate list of the current block, and used as at least one reference region.
[0283] Optionally, a candidate block can be determined or obtained based on the candidate motion vector or candidate block vector of the current block, and at least one reference region can be determined or obtained based on at least one of the above adjacent pixels, above non-adjacent pixels, left adjacent pixels, left non-adjacent pixels, upper left adjacent pixels, and upper left non-adjacent pixels of the candidate block.
[0284] Optionally, a candidate block can be determined or obtained based on the candidate motion vector or candidate block vector of the current block, and at least one of the following: the upper adjacent pixel, the upper non-adjacent pixel, the left adjacent pixel, the left non-adjacent pixel, the upper left adjacent pixel, and the upper left non-adjacent pixel of the candidate block can be used as at least one reference region.
[0285] Optionally, a candidate block can be determined or obtained based on the candidate motion vector or candidate block vector of the current block. At least one reference region can be determined or obtained based on at least one of the width, height, block size, and block area of the candidate block. The specific implementation process can refer to the scheme in method F above, that is, the current block in method F can be replaced with the candidate block, which will not be repeated here.
[0286] Optionally, a candidate block can be determined or obtained based on the candidate motion vector or candidate block vector of the current block, and at least one reference region can be determined or obtained based on at least one of the neighboring blocks, non-neighboring blocks, co-located blocks, temporal blocks and default blocks corresponding to the candidate block.
[0287] Optionally, a candidate block can be determined or obtained based on the candidate motion vector or candidate block vector of the current block, and at least one of the following: the neighboring block, non-neighboring block, co-located block, temporal block, and default block corresponding to the candidate block can be used as a reference region.
[0288] In this embodiment, the candidate block determined or obtained based on the candidate motion vector or candidate block vector of the current block ensures that the determined or obtained reference area is closely related to the current block and / or its partitions, thereby making the subsequent prediction results obtained based on the reference area more accurate.
[0289] Fourth embodiment Based on any of the above embodiments, a fourth embodiment is proposed.
[0290] In this embodiment, at least one prediction mode is determined or obtained according to at least one of the following methods C to E: Method C, at least one statistical histogram; Optionally, step S10 includes: determining or obtaining at least one prediction pattern based on at least one statistical histogram corresponding to the current block, and determining or obtaining the prediction result of the current block based on the weight information corresponding to the at least one prediction pattern.
[0291] Optionally, the statistical histogram includes at least one of the following: a gradient histogram, an area histogram, and a histogram of the number of times the predicted pattern is used for the encoded image patch.
[0292] Optionally, the statistical histogram is determined or obtained based on at least one reference region of the current block.
[0293] Optionally, a gradient histogram is a statistical tool used to describe the gradient magnitude distribution of the current block in different directions. It calculates the gradient magnitude value of each pixel in at least one reference region of the current block in the direction corresponding to the prediction mode in each frame, and statistically analyzes the distribution of the gradient magnitude values to obtain a histogram containing the gradient magnitude values corresponding to each prediction direction.
[0294] Optionally, in the intra-frame prediction prediction modes, 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 to describe its prediction direction.
[0295] Optionally, for each prediction direction, the sum of the gradient magnitude values of each pixel in at least one reference region of the current block in that direction is calculated. This sum reflects the overall gradient strength of the current block in that prediction direction. The gradient histogram records the sum of the gradient magnitude values corresponding to each prediction direction.
[0296] Optionally, based on at least one gradient histogram corresponding to the current block, it is determined whether the sum of gradient magnitude values related to at least one prediction direction of the prediction mode contained in the gradient histogram satisfies the first condition. If the first condition is satisfied, at least one prediction mode is determined or obtained.
[0297] Optionally, the first condition may be whether the sum of gradient magnitudes is one of the sums of the N largest gradient magnitude values in the gradient histogram. For example, at least one prediction mode may be determined or obtained based on whether the sum of gradient magnitude values related to at least one prediction direction corresponding to the prediction mode contained in at least one gradient histogram is one of the sums of the N largest gradient magnitude values in the gradient histogram.
[0298] Optionally, the sums of the gradient magnitude values in the gradient histogram are sorted in ascending or descending order to determine or obtain the sums of the first N gradient magnitude values in ascending order or the sums of the last N gradient magnitude values in descending order. For example, after sorting in ascending order, the prediction modes corresponding to the prediction directions whose sums of gradient magnitude values are in the top 3 are determined as prediction modes.
[0299] Optionally, the gradient magnitude values in the gradient histogram are compared to determine or obtain the sum of the N gradient magnitude values with the largest gradient magnitude in the gradient histogram. Based on the prediction mode corresponding to the sum of the N gradient magnitude values with the largest gradient magnitude, at least one prediction mode for the current block is determined or obtained.
[0300] Optionally, a gradient histogram of at least one reference region with respect to the intra-prediction direction can be determined or obtained based on the gradient magnitude and gradient direction of pixels in at least one reference region of the current block, the corresponding intra-prediction direction can be determined based on the gradient histogram, and at least one prediction mode can be determined or obtained.
[0301] Optionally, at least one reference region of the current block includes at least one of: reference pixels, reference blocks, and reference templates. The reference region refers to a set of neighboring pixels surrounding the current block. These neighboring pixels can provide important clues about the edges and texture orientation of the block to be predicted. Therefore, the target inference mode can be analyzed and inferred based on these pixels to derive the intra-frame prediction mode of the current block.
[0302] Optionally, the processing method in the embodiments of this application can be DIMD mode and / or improved DIMD mode.
[0303] Reference Figure 20 The processing steps of the DIMD mode, the processing steps of the improved DIMD mode, and / or the determination or acquisition method of the gradient histogram include: determining a reference template adjacent to the block to be predicted (the current block) above and to the left of the block to be predicted, i.e., three pixel lines / pixel rows / pixel columns on the left and above the block to be predicted; then taking a pixel in the middle line (e.g., pixel A) as the pixel for calculating the gradient; by calculating the gradient direction of at least one pixel in the middle line, as well as the magnitude of the horizontal and vertical gradients, the gradient direction of at least one pixel and the gradient magnitude value corresponding to the gradient can be obtained.
[0304] Optionally, the gradient magnitude value is the sum of the absolute values of the horizontal gradient and the vertical gradient. If the gradient magnitude values with the same gradient direction in at least one pixel are added together, the sum of the gradient magnitude values corresponding to that gradient direction can be obtained.
[0305] Optionally, a histogram of gradient magnitude values for different gradient directions of at least one pixel can be constructed, and the prediction direction perpendicular to the gradient direction of the maximum gradient magnitude value can be used as the prediction direction of the intra-prediction mode and / or the prediction direction of the prediction mode for the current block.
[0306] Alternatively, the horizontal gradient Gx and vertical gradient Gy can be calculated using the 3x3 horizontal Sober operator and the vertical Sober operator. For example, the horizontal gradient Gx and vertical gradient Gy for a pixel x 4 in a pixel line can be calculated according to the following formulas (iv) and (v).
[0307] Formula (IV); Formula (5); Optionally, A can be a matrix consisting of 9 pixels centered at pixel x4, including the pixel x1 above it, the pixel x3 to its left, the pixel x7 below it, the pixel x5 to its right, the pixel x0 to its upper left, the pixel x6 to its lower left, the pixel x2 to its upper right, and the pixel x8 to its lower right, as shown in formula (VI) below: Formula (VI); Optionally, the magnitude of gradient G is the sum of the absolute values of the horizontal and vertical gradients, and its calculation formula is shown in formula (VII): Formula (VII); Alternatively, the gradient direction of a pixel can be calculated using arctan(Gx / Gy) or arctan(Gy / Gx).
[0308] Optionally, since each gradient direction corresponds to a specific gradient direction range, and each gradient direction range corresponds to the prediction direction of an intra-frame prediction mode, for at least one pixel in the pixel line, the gradient magnitude values with the same gradient direction range in at least one pixel can be added together to obtain the sum of the gradient magnitude values corresponding to the gradient direction range.
[0309] Alternatively, the sum of the gradient magnitude values of the prediction direction of the corresponding intra-frame prediction mode can also be obtained.
[0310] Reference Figure 21 It includes the magnitude values of the gradient magnitudes corresponding to the prediction directions of each intra-frame prediction mode, and optionally, according to Figure 21 The final intra-frame prediction mode selected was mode 30.
[0311] Optionally, step S10 includes: determining or obtaining at least one gradient histogram corresponding to the current block based on at least one reference region of the current block; determining or obtaining at least one prediction mode based on the at least one gradient histogram; and determining or obtaining the prediction result of the current block based on the weight information corresponding to the at least one prediction mode.
[0312] Optionally, step S10 includes: determining or obtaining at least one area histogram corresponding to the current block based on at least one reference region of the current block; determining or obtaining at least one prediction mode based on the at least one area histogram; and determining or obtaining the prediction result of the current block based on the weight information corresponding to the at least one prediction mode.
[0313] Optionally, the area histogram is used to describe at least one reference region of the current block, such as the area magnitude distribution of adjacent and / or non-adjacent coded blocks in different frames in the prediction direction. Optionally, the reference region can be an encoded region or a decoded region.
[0314] Optionally, an area histogram and / or statistical results can be generated by analyzing the relationship between the area magnitude value of each coded block (e.g., the size of the block or the texture coverage) and the intra-frame prediction direction.
[0315] Optionally, the area amplitude value can represent the size of the coding block, the texture coverage, or other area-related features. It reflects the texture distribution intensity of the coding block in a specific direction. Each coding block has a corresponding intra-frame prediction direction (e.g., vertical, horizontal, diagonal, etc.). The area histogram statistically analyzes the area amplitude values in these directions. By analyzing the distribution of area amplitude values in different intra-frame prediction directions recorded on the area histogram, it can be determined which prediction directions are statistically more consistent with the texture features of the current block.
[0316] Optionally, the processing method in the embodiments of this application can be OBIC mode and / or improved OBIC mode.
[0317] Optionally, at least one prediction mode is determined or obtained based on the prediction mode corresponding to the prediction direction in which the area amplitude value in the area histogram satisfies the second condition. Optionally, the second condition can be the area amplitude value that ranks first in position or order after the area amplitude value is sorted according to a preset sorting rule, and / or the second condition can be the area amplitude value that is within a preset position or preset order range after the area amplitude value is sorted according to a preset sorting rule. For example, the preset sorting can be a sorting rule that arranges the area amplitude values from largest to smallest, and the prediction mode corresponding to the prediction direction in which the area amplitude value in the area histogram ranks first 3 is determined as the prediction mode.
[0318] Optionally, the basic principle of the improved OBIC mode proposed in this application may be to determine at least one prediction mode by analyzing the use of intra-prediction modes in adjacent coding blocks and / or non-adjacent coding blocks.
[0319] Optionally, the implementation process of the improved OBIC mode may include: determining the intra-prediction mode usage of at least one reference region of the current block (including at least one adjacent coding block and / or non-adjacent coding block of the current block), calculating the area amplitude value and intra-prediction direction of at least one reference region, determining at least one area amplitude histogram or statistical result, and determining at least one prediction direction of the current block based on the area amplitude histogram or statistical result.
[0320] Optionally, determining the intra-prediction mode usage of a coded block includes: determining a coded region and / or a decoded region, determining the intra-prediction mode usage of a coded block in the coded region, and / or determining the intra-prediction mode usage of a decoded block in the decoded region.
[0321] Optionally, the encoding unit includes an encoding block of three color components, which include a luminance component and two chrominance components.
[0322] Optionally, determining the intra-prediction mode usage of at least one reference region of the current block (including at least one adjacent coded block and / or non-adjacent coded block of the current block) may include: determining at least one coded region or at least one decoded region, determining the intra-prediction mode usage of coded blocks in the coded region, and / or determining the intra-prediction mode usage of decoded blocks in the decoded region, for example, such as Figure 22 As shown, in the encoded region, there are coded blocks 4 and 6 adjacent to the block to be predicted (i.e., the current block), and coded blocks 1, 2, 3, 5, 7, and 8 that are not adjacent to the block to be predicted. Figure 23 As shown, in the decoded region there are decoded blocks 4 and 6 that are adjacent to the block to be predicted, and decoded blocks 1, 2, 3, 5, 7 and 8 that are not adjacent to the block to be predicted.
[0323] Optionally, step S10 includes: determining or obtaining at least one prediction mode based on at least one usage histogram of the prediction mode corresponding to the encoded image block corresponding to the current block, and determining or obtaining the prediction result of the current block based on the weight information corresponding to the at least one prediction mode.
[0324] Optionally, the encoded image block corresponding to the current block is an adjacent or reference image block that has been encoded (or decoded) before the current block. These blocks can provide spatial and / or temporal prediction information for the prediction of the current block.
[0325] Optionally, the prediction mode usage frequency histogram corresponding to the encoded image block records the usage frequency of different intra-frame prediction modes in the encoded image block. By using the usage frequency of different intra-frame prediction modes recorded in the frequency histogram, it is possible to determine which prediction modes are frequently used in the encoded region.
[0326] Optionally, at least one prediction pattern is determined or obtained based on the prediction pattern corresponding to the prediction direction whose usage frequency satisfies the third condition in the usage frequency histogram.
[0327] Optionally, the third condition can be the number of times the usage is sorted according to a preset sorting rule and the number of times the usage is in the position or order that is earlier, and / or the third condition can be the number of times the usage is sorted according to a preset sorting rule and the number of times the usage is in the preset position or order that is within the range of preset position or order. For example, the preset sorting can be a sorting rule that arranges the number of times the usage is arranged from largest to smallest, and the prediction mode corresponding to the prediction mode of the prediction direction in the histogram of the number of times the usage is in the top 3 is determined as the prediction mode.
[0328] In this embodiment, at least one prediction pattern matching the current block is determined or obtained by using at least one statistical histogram, such as a gradient histogram, an area histogram, and / or at least one usage count histogram of the prediction pattern corresponding to the encoded image block corresponding to the current block, thereby improving prediction accuracy.
[0329] Method D, at least one gradient operator; Optionally, a gradient operator is a tool and / or method for determining or obtaining at least one gradient information, capable of extracting pixel gradient information from an image through convolution operations or other mathematical operations. Optionally, the gradient information includes: gradient direction and / or gradient magnitude.
[0330] Optionally, step S10 includes: determining or obtaining gradient information of at least one reference region based on at least one reference region and at least one gradient operator of the current block; determining or obtaining at least one gradient histogram corresponding to the current block based on the gradient information of at least one reference region; determining or obtaining at least one prediction mode based on the at least one gradient histogram; and determining or obtaining the prediction result of the current block based on the weight information corresponding to the at least one prediction mode.
[0331] Optionally, at least one gradient operator includes at least one pair of mutually perpendicular gradient operators.
[0332] Optionally, mutually perpendicular gradient operators include: a first pair of mutually perpendicular gradient operators and / or a second pair of mutually perpendicular gradient operators, wherein the first pair of gradient operators and the second pair of gradient operators are different.
[0333] Optionally, gradient information 1 of at least one reference region is determined or obtained based on a first pair of mutually perpendicular gradient operators, gradient information 2 of at least one reference region is determined or obtained based on a second pair of mutually perpendicular gradient operators, and at least one prediction mode of the current block is determined or obtained based on gradient information 1 and / or gradient information 2.
[0334] Optionally, at least one first gradient histogram is determined or obtained based on gradient information one, at least one second gradient histogram is determined or obtained based on gradient information two, and at least one prediction mode for the current block is determined or obtained based on at least one first gradient histogram and / or at least one second gradient histogram.
[0335] Optionally, the first pair of mutually perpendicular gradient operators includes a 0° gradient operator and a 90° gradient operator. The horizontal gradient Gx and vertical gradient Gy can be calculated using a 3×3 horizontal (0°) Sober operator and a vertical (90°) Sober operator. For example, the horizontal gradient Gx and vertical gradient Gy for a pixel x4 in a pixel line can be calculated according to the following formulas (iv) and (v).
[0336] Formula (IV); Formula (5); Optionally, A can be a matrix consisting of 9 pixels centered at pixel x4, including the pixel x1 above it, the pixel x3 to its left, the pixel x7 below it, the pixel x5 to its right, the pixel x0 to its upper left, the pixel x6 to its lower left, the pixel x2 to its upper right, and the pixel x8 to its lower right, as shown in formula (VI) below: Formula (VI); Optionally, the magnitude of gradient G is the sum of the absolute values of the horizontal and vertical gradients, and its calculation formula is shown in formula (VII): Formula (VII); Alternatively, the gradient direction of a pixel can be calculated using arctan(Gx / Gy) or arctan(Gy / Gx).
[0337] Optionally, the second pair of mutually perpendicular gradient operators includes a +45° gradient operator and a -45° gradient operator, and the +45° gradient G can be calculated using the Prewitt operator, the Scharr operator, and / or the Sobel operator. +45° and -45° gradient G -45° For example, for a pixel x 4 in a pixel line, G +45° gradient and G -45° The gradient can be calculated using any pair of operators from Equation (VIII) to Equation (XIII).
[0338] Formulas (8) and (9) are Prevet operators that can directly respond to diagonal edges via a reference template.
[0339] Formula (8); Formula (IX); Formulas (10) and (11) are Sobel operators, with a center pixel weight of 0 and symmetrical increases and decreases on both sides, which can enhance the response of the diagonal edge.
[0340] Formula (10); Formula (XI); Formulas (12) and (13) are Schar operators, and their diagonal gradient calculations are more accurate.
[0341] Formula (12); Formula (XIII); Optionally, applying only the gradient operators in the horizontal and vertical directions to determine the prediction pattern and / or gradient histogram results in low prediction accuracy in the diagonal direction. Therefore, embodiments of this application introduce a ±45° gradient operator to effectively improve prediction accuracy in the diagonal direction.
[0342] Optionally, gradient information of at least one reference region is determined or obtained based on the first pair of gradient operators and / or the second pair of gradient operators. The first pair of gradient operators includes a 0° gradient operator and a 90° gradient operator, and the second pair of gradient operators includes a +45° gradient operator and a -45° gradient operator. Based on the gradient information of at least one reference region, at least one prediction mode of the current block is determined or obtained.
[0343] Alternatively, the gradient direction can be determined or obtained by a lookup table. For example, using a lookup table for arctan(a), the two closest indices index1 and index2 of arctan(Gx / Gy) or arctan(Gy / Gx) can be determined, and the corresponding prediction direction of the pixel can be determined based on the angle difference between arctan(Gx / Gy) or arctan(Gy / Gx) and index1 and index2.
[0344] Optionally, the predicted direction a corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained. Based on the angle difference between each predicted direction and the predicted direction a in at least one lookup table, the predicted direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained. For example, the direction with the smallest absolute angle difference is determined as the predicted direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx).
[0345] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained based on the gradient information and is located between the first direction and the second direction in at least one lookup table, then the gradient direction is determined or obtained based on 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.
[0346] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained based on the gradient information and is located between the first direction and the second direction in at least one lookup table, then the weight information corresponding to the first direction and the second direction is determined or obtained based on the angle difference between the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) and the first direction and the second direction, at least one gradient histogram is determined or obtained based on the weight information corresponding to the first direction and the second direction, and at least one prediction mode of the current block is determined or obtained based on the at least one gradient histogram.
[0347] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained based on the gradient information and is located between the first direction and the second direction in at least one lookup table, then the weight information corresponding to the first direction and the second direction is determined or obtained based on 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 magnitude is determined or obtained based on the gradient information, and at least one gradient histogram is determined or obtained based on the gradient magnitude and the weight information corresponding to the first direction and the second direction, and at least one prediction mode of the current block is determined or obtained based on the at least one gradient histogram.
[0348] Optionally, if the gradient direction corresponding to arctan(Gx / Gy) or arctan(Gy / Gx) is determined or obtained based on the gradient information, and it lies between the first direction (e.g., a1) and the second direction (e.g., a2) in at least one lookup table, the weight information corresponding to a1 and a2 is determined or obtained based on the angle difference between a and a1 and a2, for example, a1 corresponds to weight w1 and a2 corresponds to weight w2. The gradient magnitude b is determined or obtained based on the gradient information. Based on the gradient magnitude b and the weight information w1 and w2 corresponding to the first and second directions, at least one gradient histogram is determined or obtained, and the gradient magnitude corresponding to the first direction a1 in the gradient histogram is b. w1, the gradient magnitude corresponding to the second direction a2 is b w2.
[0349] In this embodiment, applying only the gradient operators in the horizontal and vertical directions to determine the gradient histogram and / or prediction mode results in low prediction accuracy in the diagonal direction. Therefore, different direction gradient operators, such as ±45°, are introduced in this embodiment to effectively improve the prediction accuracy in the diagonal direction.
[0350] Optionally, gradient information of at least one reference region is determined or obtained based on at least one reference region of the current block, at least one pair of gradient operators, and weight information corresponding to at least one pair of gradient operators. At least one prediction mode of the current block is determined or obtained based on the gradient information of at least one reference region. The at least one pair of gradient operators includes a first pair of gradient operators and / or a second pair of gradient operators. The first pair of gradient operators includes a 0° gradient operator and a 90° gradient operator. The second pair of gradient operators includes a +45° gradient operator and a -45° gradient operator.
[0351] Optionally, gradient information of at least one reference region is determined or obtained based on at least one reference region of the current block, at least one pair of gradient operators and weight information corresponding to at least one pair of gradient operators, and at least one prediction mode of the current block is determined or obtained based on at least one gradient histogram determined or obtained through the gradient information of at least one reference region.
[0352] Optionally, gradient information 1 is determined or obtained based on a first pair of mutually perpendicular gradient operators, at least one first gradient histogram is determined or obtained based on gradient information 1, and at least one prediction mode for the current block is determined or obtained based on at least one first gradient histogram.
[0353] Optionally, gradient information two is determined or obtained based on a second pair of mutually perpendicular gradient operators, at least one second gradient histogram is determined or obtained based on gradient information two, and at least one prediction mode for the current block is determined or obtained based on at least one second gradient histogram.
[0354] Optionally, based on gradient information one and gradient information two, a third gradient information is determined or obtained; based on the third gradient information, at least one third gradient histogram is determined or obtained; and based on the at least one third gradient histogram, at least one prediction mode for the current block is determined or obtained.
[0355] Optionally, based on gradient information one, the weight information corresponding to the first pair of gradient operators, gradient information two, and the weight information corresponding to the second pair of gradient operators, a third gradient information is determined or obtained; based on the third gradient information, at least one third gradient histogram is determined or obtained; and based on the at least one third gradient histogram, at least one prediction mode for the current block is determined or obtained.
[0356] Optionally, the third gradient information can be determined or obtained by fusing gradient information one and gradient information two through the weight information corresponding to at least one pair of gradient operators. The third gradient information includes gradient direction and / or gradient magnitude.
[0357] Optionally, based on the weight information corresponding to at least one pair of gradient operators, at least one first gradient histogram and at least one second gradient histogram are fused to determine or obtain at least one third gradient histogram, and at least one prediction mode is determined or obtained based on the at least one third gradient histogram.
[0358] Optionally, the weight information corresponding to the gradient operator includes: weight information corresponding to the gradient magnitude of each gradient direction in the gradient histogram, and the weight information corresponding to the gradient operator includes: weight information corresponding to the gradient magnitude of at least one first gradient histogram and / or weight information corresponding to the gradient magnitude of at least one second gradient histogram.
[0359] Optionally, the weight information corresponding to the gradient operator includes the weight value corresponding to the gradient magnitude of each prediction direction in the gradient histogram corresponding to the gradient operator. The magnitude of the weight value corresponding to the gradient magnitude of each prediction direction in the gradient histogram is inversely proportional to and / or negatively correlated with the angle difference between the prediction direction and the direction of the gradient operator corresponding to the gradient histogram. For example, if the direction of the gradient operator corresponding to the gradient histogram is 0° and 90°, then the direction with the smaller angle difference with the horizontal or vertical direction in each prediction direction of the gradient histogram has a larger weight value, and the direction with the larger angle difference with the horizontal or vertical direction has a smaller weight value.
[0360] Optionally, the first pair of mutually perpendicular gradient operators includes a 0° gradient operator and a 90° gradient operator. For example, in the first gradient histogram, the weight value corresponding to the gradient magnitude of mode 3 is 0.9, and the gradient magnitude is C1. In the second gradient histogram, the weight value corresponding to the gradient magnitude of mode 3 is 0.1, and the gradient magnitude is D1. Then, the first gradient histogram and the second gradient histogram are fused to determine or obtain the third gradient information and / or the third gradient histogram. The gradient direction of the third gradient information is the gradient direction corresponding to mode 3, and the gradient magnitude is C1. 0.9+D1 0.1, and / or the gradient magnitude value corresponding to mode 3 in the third gradient histogram is C1. 0.9+D1 0.1.
[0361] Optionally, step S10 includes: determining or obtaining gradient information one based on at least one reference region of the current block and a first pair of gradient operators; determining or obtaining gradient information two based on at least one reference region of the current block and a second pair of gradient operators; determining or obtaining third gradient information based on gradient information one, gradient information two, weight information corresponding to the first pair of gradient operators, and weight information corresponding to the second pair of gradient operators; and determining or obtaining at least one prediction mode of the current block based on the third gradient information. The weight information corresponding to the gradient operator includes the weight value corresponding to the gradient magnitude of each prediction direction in the gradient histogram corresponding to the gradient operator. The magnitude of the weight value corresponding to the gradient magnitude of each prediction direction in the gradient histogram is inversely proportional to and / or negatively correlated with the angle difference between the prediction direction and the direction of the gradient operator corresponding to the gradient histogram.
[0362] In this embodiment, since the convolution response is maximized and the detection is most accurate when the operator design direction (e.g., 0°, 90° and / or ±45°) is consistent with the prediction edge direction, the accuracy of the obtained prediction mode can be effectively improved by setting the weight information corresponding to the gradient operator.
[0363] Optionally, the first pair of mutually perpendicular gradient operators includes a 0° gradient operator and a 90° gradient operator, and the second pair of mutually perpendicular gradient operators includes a +45° gradient operator and a -45° gradient operator. A first gradient histogram is determined or obtained based on the first pair of mutually perpendicular gradient operators, and a second gradient histogram is determined or obtained based on the second pair of mutually perpendicular gradient operators. Since the first gradient histogram has higher precision for horizontal and vertical edges, the weight information corresponding to the gradient magnitudes in the horizontal and vertical directions in the first gradient histogram is greater than the weight information corresponding to the gradient magnitudes in the horizontal and vertical directions in the second gradient histogram. Conversely, the second gradient histogram has higher precision for diagonal edges, therefore, the weight information corresponding to the gradient magnitudes in the diagonal direction in the second gradient histogram is greater than the weight information corresponding to the gradient magnitudes in the diagonal direction in the first gradient histogram.
[0364] Optionally, the weight information corresponding to the gradient magnitude of the prediction direction of the first gradient histogram is shown in Table 5 below: Table 5
[0365] Optionally, the weight information corresponding to the gradient magnitude of the prediction direction of the second gradient histogram is shown in Table 6 below: Table 6
[0366] Optionally, the first pair of mutually perpendicular gradient operators includes a 0° gradient operator and a 90° gradient operator, and the second pair of mutually perpendicular gradient operators includes a +45° gradient operator and a -45° gradient operator. Based on the first pair of mutually perpendicular gradient operators, a first gradient histogram is determined or obtained. Based on the second pair of mutually perpendicular gradient operators, a second gradient histogram is determined or obtained. The weight value corresponding to the gradient magnitude of the prediction direction in the second gradient histogram where the angle difference between the prediction direction and the horizontal or vertical direction is less than a first angle difference threshold is 0, and the weight value corresponding to the gradient magnitude of the prediction direction in the second gradient histogram where the angle difference between the prediction direction and 45°, 135°, or -45° is less than a second angle difference threshold is 1. Optionally, the first angle difference threshold and the second angle difference threshold are different.
[0367] In this embodiment, applying only the gradient operators in the horizontal and vertical directions to determine the gradient histogram results in low prediction accuracy for the diagonal direction. Therefore, this embodiment introduces a ±45° gradient operator to effectively improve the prediction accuracy in the diagonal direction. Furthermore, since horizontal (e.g., horizon, buildings) and vertical (e.g., trees, people) structures dominate in natural scenes, while diagonal textures (e.g., 45° diagonal) are relatively rare, the gradient operators corresponding to the 0° and 90° gradient operators have higher accuracy for prediction directions that are close to 0° and 90°. Therefore, by setting the above weight values, the prediction accuracy of the obtained prediction pattern can be effectively improved.
[0368] Optionally, the first pair of mutually perpendicular gradient operators includes a 0° gradient operator and a 90° gradient operator, and the second pair of mutually perpendicular gradient operators includes a +45° gradient operator and a -45° gradient operator. Based on at least one reference region of the current block and the first pair of mutually perpendicular gradient operators, at least one gradient information 1 for at least one reference region of the current block is determined or obtained. Based on at least one reference region of the current block and the second pair of mutually perpendicular gradient operators, at least one gradient information 2 for at least one reference region of the current block is determined or obtained. Gradient information 2 includes: the gradient component G corresponding to +45°. +45° The gradient component G corresponding to -45° -45° For gradient component G +45° and gradient component G -45° By projecting, the gradient components D in the directions of the 0° and 90° gradient operators can be determined or obtained. x1 and D y1 D x1 and D y1 The following formulas (XIV) and (XV) are used to calculate the following: Formula (XIV); Formula (XV); Optionally, the gradient information includes the gradient component D corresponding to 0°. x2 The gradient component D corresponding to 90° y2 Based on the weight information corresponding to the first pair of mutually perpendicular gradient operators, the weight information corresponding to the second pair of mutually perpendicular gradient operators, and the gradient component D x1 D y1 Gradient component D x2 and D y2 Determine or obtain at least one fusion gradient information, which includes: the fusion gradient component corresponding to 0° and the fusion gradient component corresponding to 90°. Based on the at least one fusion gradient information, determine or obtain at least one gradient histogram and / or at least one prediction mode.
[0369] Optionally, the target gradient component Gx corresponding to 0° and the target gradient component Gy corresponding to 90° are calculated according to the following formulas (xvii) and (xvii): Gx=w a D x1 +w b D x2 Formula (XVI); Gy=w a D y1 +w b D y2 Formula (XVII); Optionally, w a For the weight information corresponding to the second pair of mutually perpendicular gradient operators, w b The weight information is for the first pair of mutually perpendicular gradient operators. Optionally, the weights corresponding to the above weight information are preset fixed values, and / or the above weight values can be adaptively adjusted according to different scenarios.
[0370] In this embodiment, by fusing gradient operators in the horizontal, vertical and diagonal directions, all dominant edge directions in the current block can be accurately detected, avoiding the blind spots of single-direction operators, thereby effectively improving the prediction accuracy of the prediction mode for the current block.
[0371] Method E, the first mode list.
[0372] Optionally, step S10 includes: determining or obtaining at least one prediction mode based on the first mode list, and determining or obtaining the prediction result of the current block based on the weight information corresponding to the at least one prediction mode.
[0373] Optionally, the first pattern list is a set for storing at least one prediction pattern, providing multiple possible pattern options for the prediction of the current block. By comparing the prediction effects of different patterns in the first pattern list, a suitable prediction pattern can be matched for the current block to improve the prediction accuracy for the current block.
[0374] Optionally, the first pattern list is at least one pattern list, where the prediction patterns in the at least one pattern list are different or at least partially the same.
[0375] Optionally, the first mode list includes an MPM (Most Probable Modes) list. Optionally, the first mode list in this embodiment can be an improved MPM list.
[0376] Optionally, the MPM list is a collection of prediction patterns that are considered to be the most likely prediction patterns to apply to the current block. The determination or acquisition of the MPM list is based on the neighborhood information of the current block (such as the prediction patterns of the blocks above and to the left) and statistical information (such as the probability of pattern occurrence). In this way, the MPM list can reduce the amount of pattern information that the encoder needs to transmit, while improving the prediction accuracy of the decoder for the prediction patterns.
[0377] Optionally, the first pattern list includes at least one candidate pattern, and at least one prediction pattern is determined or obtained based on the at least one candidate pattern in the first pattern list.
[0378] Optionally, in intra-frame prediction, the candidate modes in the first mode list may include: at least one angular prediction mode, at least one non-angular prediction mode, and / or a derived mode of at least one prediction mode.
[0379] Optionally, a first mode list can be determined or obtained based on gradient information of at least one reference region of the current block.
[0380] Optionally, a first pattern list can be determined or obtained based on at least one reference region of the current block and the neural network model.
[0381] Optionally, a first pattern list can be determined or obtained based on the pixels of at least one reference region of the current block and the neural network model.
[0382] Optionally, a first pattern list can be determined or obtained based on the pixels, gradient information, and neural network model of at least one reference region of the current block.
[0383] Optionally, by using at least one reference region of the current block, the pixels of the at least one reference region, and / or gradient information of the at least one reference region as input to the neural network model, at least one prediction mode and / or the confidence level of at least one prediction mode are determined or obtained, and a first mode list is determined or obtained based on the at least one prediction mode and / or the confidence level of the at least one prediction mode output by the neural network model.
[0384] Optionally, confidence level is a quantitative indicator of the degree of certainty the model has about the current prediction result.
[0385] In this embodiment, the first pattern list can provide a prediction pattern with good adaptability for the current block, which improves processing efficiency and improves the prediction effect of the determined or obtained prediction pattern for the current block.
[0386] Fifth Embodiment This application also provides a processing device, please refer to... Figure 24 , Figure 24 This is a functional block diagram of the processing device of this application, which can be installed in or is the processing equipment. The processing device includes: The processing module A10 is used to determine or obtain the prediction result of the current block based on the weight information corresponding to at least one prediction mode.
[0387] Optionally, the weight information is determined or obtained based on the pixel position of at least one pixel and / or the position-dependent orientation.
[0388] Optionally, the location-dependent direction corresponds to at least one prediction pattern; and / or, the location-dependent direction is determined or obtained based on the main distribution area and / or the location information of the current block.
[0389] Optionally, the processing apparatus further includes at least one of the following: The primary distribution region is located in at least one reference region of the current block; The position-dependent direction is determined or obtained based on the first position and / or the second position; The first position includes at least one of the following: the center of the main distribution region, the centroid, at least one vertex, and at least one boundary midpoint; The second position includes at least one of the following: the center of the current block, the centroid, at least one vertex, and at least one boundary midpoint.
[0390] Optionally, 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. The candidate motion vector or candidate block vector of the current block is determined or the candidate block is obtained.
[0391] Optionally, the main distribution area is determined or obtained based on at least one of the following: At least one sub-region of at least one reference region of the current block; The pixel position of the pixel corresponding to the gradient information of at least one prediction mode; The gradient magnitude of at least one prediction model.
[0392] Optionally, at least one prediction model is determined or obtained based on at least one of the following: At least one statistical histogram; First pattern list; At least one gradient operator.
[0393] Optionally, the statistical histogram is determined or obtained based on at least one reference region of the current block; and / or, the statistical histogram includes at least one of the following: Gradient histogram; Area histogram; Histogram of the number of times the prediction mode is used for the encoded image patch.
[0394] The processing device provided in this application embodiment is similar in implementation principle and beneficial effect to the technical solution shown in the corresponding method embodiment above, and will not be described again here.
[0395] This application also provides a processing device, including a memory and a processor. The memory stores a processing program, and when the processing program is executed by the processor, it implements the steps of the processing method in any of the above embodiments.
[0396] This application also provides a storage medium storing a processing program, which, when executed by a processor, implements the steps of the processing method in any of the above embodiments.
[0397] In the embodiments of the processing device and storage medium provided in this application, all the technical features of any of the above-described processing method embodiments may be included. The extended and explanatory content of the specification is basically the same as that of the embodiments of the above methods, and will not be repeated here.
[0398] This application also provides a computer program product, which includes computer program code. When the computer program code is run on a computer, it causes the computer to perform the methods described in the various possible implementations above.
[0399] This application also provides a chip, including a memory and a processor. The memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device with the chip installed performs the methods described in the various possible implementations above.
[0400] It is understood that the above scenarios are merely examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of this application. The technical solutions of this application can also be applied to other scenarios. For example, as those skilled in the art know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0401] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0402] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.
[0403] The units in the device of this application embodiment can be merged, divided, and deleted according to actual needs.
[0404] In this application, the same or similar terms, concepts, technical solutions and / or application scenario descriptions are generally described in detail only when they appear for the first time. When they appear again, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of this application, the same or similar terms, concepts, technical solutions and / or application scenario descriptions that are not described in detail later can be referred to their previous relevant detailed descriptions.
[0405] In this application, the descriptions of the various embodiments have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0406] The technical features of the present application can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.
[0407] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, controlled terminal, or network device, etc.) to execute the methods of each embodiment of this application.
[0408] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A 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 flow or function according to the embodiments of this application is 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 transmitted from one storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, storage disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0409] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A processing method characterized by, Including the following steps: S10, Based on the weight information corresponding to multiple prediction modes and the prediction results determined or obtained through multiple prediction modes, determine or obtain the prediction result of the current block. The weight information includes a weight matrix W[i,j,k], which represents the weight of the pixel in the i-th row and j-th column in the k-th prediction result, where k is equal to 1 to N and N is the number of prediction modes. The weight matrix corresponding to the pixel in the i-th row and j-th column is determined or obtained based on the positional dependency direction of the prediction mode. The location-dependent direction of the prediction model is determined or obtained based on the location information of the main distribution area and the current block. The main distribution region is the sub-region in which the gradient magnitude of the prediction mode is greater than a preset threshold or has the largest gradient magnitude in at least one reference region of the current block.
2. The treatment method of claim 1, wherein, It also includes at least one of the following: The position-dependent direction is determined or obtained based on the first position and / or the second position; The first position includes at least one of the following: the center of the main distribution region, the centroid, at least one vertex, and at least one boundary midpoint; The second position includes at least one of the following: the center of the current block, the centroid, at least one vertex, and at least one boundary midpoint.
3. The processing method as described in claim 1, characterized in that, 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. The candidate motion vector or candidate block vector of the current block is determined or the candidate block is obtained.
4. The processing method as described in claim 1, characterized in that, The main distribution region is also determined or obtained based on the pixel position of the pixel corresponding to the gradient information of at least one prediction mode.
5. The processing method according to any one of claims 1 to 4, characterized in that, At least one prediction model is determined or obtained based on at least one of the following: At least one statistical histogram; First pattern list; At least one gradient operator.
6. The processing method as described in claim 5, characterized in that, The statistical histogram is determined or obtained based on at least one reference region of the current block; and / or, the statistical histogram includes at least one of the following: Gradient histogram; Area histogram; Histogram of the number of times the prediction mode is used for the encoded image patch.
7. A processing device, characterized in that, include: 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 the processing method as described in any one of claims 1 to 6.
8. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Intra-frame prediction method and device, decoder and encoder
CN116601957A