Processing method, processing device and storage medium

Template matching technology improves the prediction accuracy of local regions in image blocks, solving the problem of unsatisfactory prediction results in existing video coding standards and improving encoding and decoding quality.

WO2026158714A2PCT designated stage Publication Date: 2026-07-30SHENZHEN TRANSSION HLDG CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
SHENZHEN TRANSSION HLDG CO LTD
Filing Date
2026-02-10
Publication Date
2026-07-30

AI Technical Summary

Technical Problem

In existing video coding standards, the prediction of local regions of image blocks is not ideal, resulting in poor encoding and decoding quality.

Method used

By employing template matching technology, the prediction accuracy of local regions of image blocks is improved by determining or obtaining the prediction results of at least one partition of the current block and utilizing parameters such as motion vector, block vector, and template matching cost.

Benefits of technology

It improves the encoding and decoding quality in the video encoding and decoding process and enhances the prediction accuracy of local regions of image blocks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026078328_30072026_PF_FP_ABST
    Figure CN2026078328_30072026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a processing method, a processing device and a storage medium. The processing method may be applied to a processing device. The processing method comprises: on the basis of at least one template, determining or obtaining a prediction result of at least one partition of a current block. The technical solution of the present application can improve the accuracy of predicting a local region of an image block, thereby supporting an improvement in the coding and decoding quality during a video coding and / or decoding process.
Need to check novelty before this filing date? Find Prior Art

Description

Processing methods, processing equipment and storage media 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, each frame is divided into different blocks and prediction and encoding / decoding processes are performed.

[0003] In conceiving and implementing this application, the inventors discovered at least the following problems: the prediction effect for local regions of image blocks is not ideal during intra-frame prediction and / or inter-frame prediction, which leads to poor encoding and decoding quality during video encoding and / or decoding.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art.

[0005] Application content

[0006] To address the aforementioned technical problems, this application provides a processing method, processing device, and storage medium that can improve the prediction accuracy of local regions of image blocks, thereby supporting improvements in the encoding and / or decoding quality during video encoding and / or decoding processes.

[0007] This application provides a processing method applicable to a processing device, comprising the following steps:

[0008] S10, based on at least one template, determine or obtain the prediction result of at least one partition of the current block.

[0009] Optionally, at least one template may include: the current template and / or a reference template.

[0010] Optionally, at least one template is determined or obtained based on at least one of the following:

[0011] Motion vector;

[0012] Block vector;

[0013] Template matching cost;

[0014] Template type;

[0015] Offset adjustment amount;

[0016] At least one partition;

[0017] The current block size;

[0018] The current block is divided in a specific way;

[0019] Template pixel partition information;

[0020] First template list;

[0021] Second template list.

[0022] Optionally, the division method includes: division angle and / or displacement offset.

[0023] Optionally, the method of determining or obtaining at least one template includes at least one of the following:

[0024] Based on the division angle and the first displacement offset determined or obtained through displacement offset and offset adjustment, at least one template is determined or obtained.

[0025] Determine or obtain at least one template based on at least one of the template types determined or obtained through at least one partition of the current block, the block size, and the partitioning method;

[0026] Based on the template type determined or obtained from the first template list, at least one template is determined or obtained;

[0027] Based on the valid boundary information of at least one partition determined or obtained from the second template list, at least one template is determined or obtained;

[0028] Based on the valid boundary information of at least one partition determined or obtained through template pixel partitioning information and / or template type, at least one template is determined or obtained;

[0029] Based on at least one current template, determine or obtain at least one reference template.

[0030] Optionally, the processing method further includes at least one of the following:

[0031] The motion vector is: the motion vector of the current block and / or the motion vector of at least one partition;

[0032] The block vector is: the block vector of the current block and / or the block vector of at least one partition;

[0033] The current template is located in the current frame;

[0034] The reference template is located in the current frame and / or the reference frame;

[0035] The block dimensions are at least one of the following: width, height, aspect ratio, perimeter, and area;

[0036] The offset adjustment amount is determined or obtained based on the current block size;

[0037] The first template list includes: at least one first index parameter and / or its corresponding template type;

[0038] The second template list includes: at least one second index parameter and / or the valid boundary information of at least one corresponding partition.

[0039] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0040] Optionally, the template type corresponding to at least one first index parameter is determined or obtained based on at least one of the following:

[0041] The current block has at least one partition, block size, and partitioning method;

[0042] At least one effective boundary information of a partition and / or template type is determined or obtained through template pixel partition information;

[0043] At least one valid boundary information of a partition is determined or obtained through the second template list;

[0044] First template type.

[0045] Optionally, based on the valid boundary information of at least one partition, the template type corresponding to at least one first index parameter is determined or obtained, including at least one of the following:

[0046] If the valid boundary information of at least one partition satisfies the first condition, then the template type corresponding to at least one first index parameter is the first type;

[0047] If the valid boundary information of at least one partition satisfies the second condition, then the template type corresponding to at least one first index parameter is the second type;

[0048] If the valid boundary information of at least one partition satisfies the third condition, then the template type corresponding to at least one first index parameter is the third type.

[0049] Optionally, the template determined or obtained according to at least one of the first type, the second type and the third type includes at least one of the top template, the left template and the upper left combined template.

[0050] Optionally, the valid boundary information of at least one partition satisfies at least one of the first, second, and third conditions, including at least one of the following:

[0051] At least one partition's valid boundary information is invalid boundary information;

[0052] At least one partition's valid boundary information is its upper boundary information;

[0053] At least one partition's valid boundary information is its left boundary information;

[0054] At least one partition's valid boundary information is the top-left boundary information;

[0055] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper boundary of the current block;

[0056] At least one valid reference pixel in the valid boundary information of a partition is distributed at the left boundary of the current block;

[0057] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper left boundary of the current block.

[0058] Optionally, the second index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0059] Optionally, the valid boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained according to at least one of the following:

[0060] The current block has at least one partition, block size, and partitioning method;

[0061] Template pixel partition information.

[0062] 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.

[0063] 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.

[0064] As described above, the processing method of this application includes: determining or obtaining the prediction result of at least one partition of the current block based on at least one template. Through the technical solution of this application, the prediction accuracy of local regions of image blocks can be improved, thereby supporting improvements in the encoding and / or decoding quality during video encoding and / or decoding processes. Attached Figure Description

[0065] 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.

[0066] Figure 1 is a schematic diagram of the hardware structure of a mobile terminal implementing various embodiments of this application;

[0067] Figure 2 is a communication network system architecture diagram provided in an embodiment of this application;

[0068] Figure 3 is a schematic diagram of the hardware structure of a controller 140 provided in this application;

[0069] Figure 4 is a schematic diagram of the hardware structure of a network node 150 provided in this application;

[0070] Figure 5 is a flowchart illustrating the processing method according to the first embodiment;

[0071] Figure 6 is a schematic diagram of a specific adjacent position CU in a conventional GPM mode according to the first embodiment;

[0072] Figure 7 is a schematic diagram of the division effect on a square block with an offset of 0, according to the first embodiment;

[0073] Figure 8 is a schematic diagram of a template for a conventional GPM-TM mode according to the first embodiment;

[0074] Figure 9 is a schematic diagram of the encoder's encoding process in the image processing method according to the first embodiment;

[0075] Figure 10 is a schematic diagram of the decoding process of the decoder in the image processing method according to the first embodiment;

[0076] Figure 11 is a schematic diagram of the mismatch between the conventional GPM partitioning shape and the ideal template under different CU sizes according to the second embodiment;

[0077] Figure 12 is a schematic diagram of template pixel partitioning information according to the second embodiment;

[0078] Figure 13 is a schematic diagram of the processing module of the processing device.

[0079] 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

[0080] 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.

[0081] 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.

[0082] 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" or "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.

[0083] 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.

[0084] 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).”

[0085] It should be noted that step designations such as S10 are used in this application for the purpose of more clearly and concisely describing the corresponding content, and do not constitute a substantial limitation on the order.

[0086] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.

[0087] 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.

[0088] It should be noted that in this application, letter codes such as N are used, and unless otherwise specified, their values ​​range from 0 to positive integers.

[0089] The processing device can be implemented in various forms. For example, the processing device 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.

[0090] 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.

[0091] Please refer to Figure 1, which 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 the mobile terminal structure shown in Figure 1 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.

[0092] The following section, with reference to Figure 1, provides a detailed description of each component of the mobile terminal:

[0093] 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.

[0094] WiFi is a short-range wireless transmission technology. Mobile terminals using WiFi module 102 can help users send and receive emails, browse web pages, and access streaming media, providing wireless broadband internet access. Although Figure 1 shows WiFi module 102, it is understood that it is not an essential component of the mobile terminal and can be omitted as needed without altering the essence of the invention.

[0095] 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.

[0096] 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 medium) 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.

[0097] 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, an 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.

[0098] 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.

[0099] 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 a touch screen, can collect touch operations performed by the user on or near it (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 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.

[0100] 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 according to the type of touch event. Although in FIG. 1, the touch panel 1071 and the display panel 1061 are implemented as two independent components to realize the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 can be integrated to realize the input and output functions of the mobile terminal. The specific implementation is not limited here.

[0101] 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.

[0102] 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.

[0103] 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.

[0104] 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.

[0105] Although not shown in Figure 1, the mobile terminal 100 may also include a Bluetooth module, etc., which will not be described in detail here.

[0106] 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.

[0107] Please refer to Figure 2, which is a communication network system architecture diagram provided in an embodiment of this application. 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.

[0108] Optionally, UE201 can be the aforementioned terminal 100, which will not be described in detail here.

[0109] E-UTRAN202 includes eNodeB2021 and other eNodeB2022, etc. Optionally, eNodeB2021 can connect to other eNodeB2022 via backhaul (e.g., X2 interface), and eNodeB2021 connects to EPC203, providing access from UE201 to EPC203.

[0110] EPC203 may include MME (Mobility Management Entity) 2031, HSS (Home Subscriber Server) 2032, other MMEs 2033, SGW (Serving Gateway) 2034, PGW (Packet Data Network Gateway) 2035, and 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).

[0111] IP services 204 may include the Internet, intranet, IMS (IP Multimedia Subsystem), or other IP services.

[0112] 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.

[0113] Figure 3 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.

[0114] 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.

[0115] Figure 4 is a schematic diagram of the hardware structure of a network node 150 provided in this application. 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 above method embodiment. The implementation principle and beneficial effects are similar, and will not be described again here.

[0116] 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.

[0117] 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.

[0118] 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.

[0119] First Embodiment

[0120] Referring to Figure 5, which 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:

[0121] Step S10: Based on at least one template, determine or obtain the prediction result of at least one partition of the current block.

[0122] In this embodiment, the processing device can be a smart terminal, such as a mobile phone or a computer, and / or the processing device can be a server, such as a local server or a cloud server. In this embodiment and this application, the processing device is mainly described as a smart terminal.

[0123] 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 / or real-time video encoding and decoding. Optionally, the pixel to be predicted is located in the current block.

[0124] 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 the image block currently being encoded in the at least one image block is the current block.

[0125] Optionally, the processing device can decode the data in the bitstream to obtain at least one image block, wherein the image block currently being decoded in the at least one image block is the current block.

[0126] 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 the image block in the at least one image block that is undergoing prediction processing is the current block.

[0127] Optionally, the processing device can decode the data in the bitstream to obtain at least one image block, wherein the image block in which prediction processing is being performed is the current block.

[0128] Optionally, the current block can be the current coding block or the current decoding block. The current coding block refers to the image block that is currently being encoded and processed in the encoder, while the current decoding block refers to the image block that is currently being reconstructed in the decoder.

[0129] Optionally, the current block can be a Coding Tree Unit (CTU), a Coding Unit (CU), and / or a Macroblock.

[0130] Optionally, at least one partition of the current block refers to a sub-region obtained by dividing the current block according to specific rules. By partitioning, independent processing methods and / or processing parameters can be applied to the partitions to improve the prediction accuracy of local regions of the image block.

[0131] Optionally, in Geometric Partitioning Mode (GPM), the current block can be divided into two sub-regions (i.e., partitions) by dividing lines. Each partition can have different motion information and / or prediction modes, thereby more accurately fitting complex boundaries and / or texture orientations in the image.

[0132] Optionally, in modern video coding standards, to improve compression efficiency, at least one prediction mode is usually used to predict image blocks. Although traditional rectangular partitioning methods (such as quadtree, binary tree, ternary tree, etc.) can effectively handle most areas, they have limitations when processing image content with non-rectangular boundaries and / or complex motion / texture structures. Therefore, Geometric Partitioning Mode (GPM) is introduced. By dividing the coding unit (CU) into two non-rectangular sub-regions along a straight line, and using independent prediction signals (such as inter-frame motion vectors and / or intra-frame reference directions) for each sub-region, the edges, contours and / or motion boundaries in the image are more accurately fitted.

[0133] Optionally, the Geometric Partitioning Mode (GPM) is used for content with relative motion. It divides the rectangular CU into two irregular sub-regions (i.e., partitions) using straight lines, performs unidirectional prediction on each sub-region, and then performs weighted fusion.

[0134] Optionally, in H.266 / VVC, GPM supports a total of 64 partitioning schemes. The encoder only needs to encode the partitioning scheme and the two Merge MVP (Merge-based Motion Vector Prediction) options corresponding to each of the two sub-partitions. The boundaries of the GPM partitions are extended to the current templates of the two GPM partitions, resulting in 64 current templates. The TM (Template Matching) cost of each of these 64 reference templates is calculated. The GPM partitioning schemes are reordered in ascending order according to the TM cost, and the best 32 are marked as available partitioning schemes. After reordering in ascending order using the TM cost, an index is sent using Columbus-Rice code (divided by 4) to indicate the use of the GPM partitioning scheme.

[0135] Optionally, GPM includes: GPM-Inter (inter-frame GPM) and / or GPM-Intra (intra-frame GPM).

[0136] Optionally, GPM-Inter (inter-frame GPM) is suitable for motion estimation scenarios, which obtains predicted values ​​from reference frames by partitioning the current block using different motion vectors (MV).

[0137] Optionally, GPM-Intra is suitable for intra-frame coding scenarios without a reference frame. It generates prediction signals by using different prediction modes (such as planar mode, angle mode, etc.) for the partitions of the current block. For example, if 67 intra-frame prediction modes are used, the first partition of the current block uses angle prediction in the mode=50 direction, while the second partition of the current block uses angle prediction in the mode=18 direction to better match the diagonal texture and / or edge direction in the image.

[0138] Optionally, in GPM-Intra, the intra prediction mode (IPM) of at least one partition can be selected from a predefined list of modes, which typically contains three candidate modes. The construction of the candidate modes depends on the prediction information of the coded CUs adjacent to the current block and / or the angle mode that is close to the direction of the current GPM partition line.

[0139] Optionally, the candidate modes may be derived from at least one of the following: angle modes similar to the dividing line, DIMD modes (Directional Intra Mode Derivation), TIMD modes (Template-based Intra Mode Derivation), and prediction modes from CUs at specific neighboring locations.

[0140] Referring to Figure 6, a specific adjacent position CU includes at least one of the CUs to the left (L), above (A), below left (BL), above right (AR), and above left (AL) of the current block (CU).

[0141] Optionally, when constructing a predefined list of patterns, a preset search priority chain can be followed, for example, the priority order is: L-Intra→A-Intra→L-Inter→A-Inter→BL-Intra→AR-Intra→AL-Intra→BL-Inter→AR-Inter→AL-Inter, and / or, the priority order is: angle patterns similar to the dividing line → sequentially search for prediction patterns at L, A, BL, AR and AL positions.

[0142] Optionally, the effective search range of a specific adjacent CU can be determined or obtained based on the template shape:

[0143] For example, if the partition uses the template above, only the adjacent positions of A, AL and / or AR will be searched;

[0144] For example, if the partition uses the left template, then search for adjacent positions of L, BL and / or AL;

[0145] For example, if the partition uses the top-left combined template, then search for adjacent positions of L, A, BL, AR and / or AL.

[0146] Optionally, in order to further improve the prediction accuracy of at least one partition of the current block, the processing method of this application introduces the GPM-TM (Template Matching-based GPM) mechanism. Under the GPM framework, this mechanism combines template matching (TM) technology to search for the optimal prediction source for at least one partition of the current block using at least one template.

[0147] Optionally, Template Matching (TM) is a pixel-similarity-based search method that calculates the distortion between the current template and multiple candidate templates in the reference frame, such as SAD (Sum of Absolute Differences), SATD (Sum of Absolute Transformed Differences), and / or MRSAD (Mean-Removed Sum of Absolute Differences), and selects the position with the minimum distortion as the final prediction source.

[0148] Optionally, when GPM mode is enabled for the current block, the encoder sends a CU-level flag indicating whether motion compensation optimization is enabled for both geometric partitions simultaneously. If enabled, the template matching process is performed independently for each partition, including:

[0149] Based on the geometric angle of the partition, choose to build the left template, the top template, or the top-left combined template;

[0150] In the reference frame, a local search is performed centered on the initial motion vector provided by the Merge mode;

[0151] Disable the half-pixel interpolation filter to reduce computational complexity and / or avoid blurring introduced by interpolation;

[0152] The motion vectors are finely adjusted by minimizing the difference between the current template and the corresponding reference template in the reference image (such as SAD or SATD).

[0153] Optionally, at least one template can be divided into three types of shapes according to its spatial composition, including: top template (if it is the current template, it only contains the top pixels of the current block), left template (if it is the current template, it only contains the left pixels of the current block) and / or top-left combined template (if it is the current template, it contains the top and left pixels of the current block).

[0154] Optionally, the top-left combined template includes a template obtained by combining the left-side template and the top-side template.

[0155] Referring to Figure 7, the traditional GPM template shape selection rule is based on the ideal partitioning case of a square CU with an offset of 0. The template shape selection table (as shown in Table 1 below) is consulted according to the GPM partitioning angle and / or partition identifier (part, used to distinguish partitions) to determine which template shape should be used from A, L or AL. However, the traditional GPM template shape selection relies on idealized assumptions (such as square blocks and / or zero offset). In asymmetric CU sizes, large offset partitioning and / or complex texture scenes, it may lead to insufficient template coverage and / or redundancy, affecting the accuracy of TM cost evaluation and / or prediction accuracy.

[0156] Table 1

[0157] Optionally, in step S10, based on at least one template, the prediction result of at least one partition of the current block is determined or obtained.

[0158] Optionally, the prediction result of the current block can be determined or obtained based on the prediction result of at least one partition.

[0159] Optionally, if the prediction results of at least one partition are determined or obtained, the prediction results of at least one partition are spliced ​​and / or fused according to the geometric division method to determine or obtain the prediction results of the current block. Optionally, at the segmentation boundary of the current block, weighted average and / or smoothing filter can be applied to reduce visual discontinuity.

[0160] Optionally, at least one template may include: the current template and / or a reference template.

[0161] Optionally, in step S10, the prediction result of at least one partition of the current block is determined or obtained based on the current template and / or reference template.

[0162] Optionally, the current template refers to the reconstructed set of pixels located in the current frame and surrounding the edge of a certain partition of the current block. For example, the current block template includes the neighboring pixels of the row above and / or column to the left of the partition. The current template is used to characterize the expected local texture and / or structural features of the partition.

[0163] Optionally, the reference template, or reference image template, refers to the pixel block extracted from the candidate region initially located by motion vector (MV) and / or block vector (BV) in the reference frame and / or the current frame. In GPM-TM, the reference template can be used to perform similarity comparison with the current template to determine the optimal matching position.

[0164] Referring to Figure 8, the current block is located in the current frame. According to the division method of the current block, the current block is divided into two sub-regions along the dividing line, denoted as partition 1 and partition 0. For partition 1 or partition 0, the reconstructed pixels above and / or to the left of it are extracted from the current frame to form the current template corresponding to the partition. According to the initial motion vector (MV) of the partition, a local search window (e.g., ±8 pixel range) is defined as a candidate region for template matching. Within the search window, pixel blocks with the same size and shape as the current template are extracted point by point as reference templates. The distortion between the current template and at least one reference template (e.g., SAD and / or SATD) is calculated. The candidate position with the smallest distortion is selected as the optimal matching point, and its offset relative to the initial MV is recorded. The reference frame pixel block corresponding to the optimal matching position is used as the prediction result of the partition.

[0165] Optionally, in step S10, at least one reference template is determined or obtained based on at least one current template, and at least one prediction result of at least one partition of the current block is determined or obtained based on at least one reference template.

[0166] Optionally, based on at least one current template, determine or obtain the template matching cost associated with at least one candidate reference template, and based on the template matching cost associated with at least one candidate reference template, determine or obtain at least one reference template from at least one candidate reference template.

[0167] Optionally, the template matching cost is used to measure the similarity and / or error between the candidate reference template and the current template. For example, the template matching cost includes at least one of SAD (Sum of Absolute Differences), SATD (Sum of Absolute Transformed Differences), and MRSAD (Mean-Removed Sum of Absolute Differences).

[0168] Optionally, a matching position is determined or obtained based on at least one reference template, and a pixel block is determined or obtained from the reference frame based on the matching position. The pixel block has the same size and / or shape as at least one partition of the current block, and a prediction result of at least one partition is determined or obtained based on the pixel block.

[0169] Optionally, the pixel block is determined as the prediction result of at least one partition.

[0170] Optionally, the processing method in this application embodiment can be used to perform intra-frame prediction processing and / or inter-frame prediction processing on the current block.

[0171] Optionally, the processing method in this application embodiment can be a GPM mode and / or an improved GPM mode.

[0172] Optionally, the processing method in this application embodiment can be a GPM-TM mode and / or an improved GPM-TM mode.

[0173] Optionally, the processing method of this application embodiment can replace the traditional GPM mode and / or GPM-TM mode, and / or serve as a sub-mode of the traditional GPM mode when applied to the encoder and / or decoder. This application embodiment does not limit this.

[0174] Referring to Figure 9, when the processing device is an encoder on the encoding side, the encoder can receive video data input from a video source. For example, the encoder receives video images from the video source, determines the image to be predicted in the video images, divides the image to be predicted into at least one image block, the image block includes a luma block and a chroma block, and performs prediction processing on at least one image block using the temporal and / or spatial correlation between video images, including intra-frame prediction processing and / or inter-frame prediction processing. Intra-frame prediction processing and / or inter-frame prediction processing each include at least one prediction mode. For the above prediction modes, the encoder uses, for example, rate-distortion cost to determine the prediction mode finally adopted by at least one image block. For example, it calculates the rate-distortion cost corresponding to at least one prediction mode and / or the rate-distortion cost of combining several prediction modes to determine the minimum rate-distortion cost from at least one rate-distortion cost. The prediction mode corresponding to the minimum rate-distortion cost and / or the combination of prediction modes is the prediction mode finally adopted by the image block, and the prediction mode includes intra-frame prediction mode and / or inter-frame prediction mode.

[0175] Optionally, the intra-frame prediction mode and / or inter-frame prediction mode can be derived and / or determined using the GPM mode proposed in the embodiments of this application.

[0176] Optionally, when the prediction block corresponding to the image block is determined or obtained, the pixel value of the pixel sample in the original image block corresponding to the image block is subtracted from the prediction value of the corresponding pixel sample in the prediction block to obtain the residual value of the pixel sample and / or the residual block corresponding to the original image block. The residual block can be transformed and / or quantized and encoded by an entropy encoder to form an encoded bit stream. The encoded bit stream can include the prediction parameters corresponding to the determined prediction mode and related auxiliary information. The prediction parameters are entropy encoded and then packaged into the encoded bit stream.

[0177] Optionally, if the GPM mode proposed in the embodiments of this application is adopted, the auxiliary information includes indication information about the GPM mode proposed in the embodiments of this application.

[0178] Optionally, the transformed and / or quantized residual block can be added to the prediction block determined or obtained through the prediction mode to obtain the reconstructed block. The reconstructed block can also be subjected to loop filtering to reduce distortion.

[0179] Optionally, the loop filtering process includes: deblocking filtering, adaptive sampling offset and / or adaptive loop filtering, and after the loop filtering process is performed, the reconstructed block after the loop filtering process is stored according to the coded image buffer.

[0180] Referring to Figure 10, when the processing device is a decoder on the decoding side, after receiving the encoded bit stream, the decoder's entropy decoding unit will parse and / or decode the encoded bit stream to obtain transform coefficients. The decoder's inverse transform unit and inverse quantization unit will perform inverse transform and inverse quantization processing on the transform coefficients to obtain residual blocks.

[0181] Optionally, the decoding unit of the decoder parses and decodes the encoded bitstream to obtain prediction parameters and related auxiliary information. The prediction processing unit of the decoder uses the prediction parameters to perform prediction processing to determine the prediction block corresponding to the residual block. The prediction processing includes intra-frame prediction processing and / or inter-frame prediction processing, which includes a combination of one or more prediction modes.

[0182] Optionally, the intra-frame prediction mode and / or inter-frame prediction mode can be derived and / or determined using the GPM mode proposed in the embodiments of this application.

[0183] Optionally, when the auxiliary information indicates that the GPM mode proposed in this application is adopted, the prediction result (i.e., prediction block) of the image block is determined or obtained through the GPM mode, and the determined or obtained residual block and prediction block (including prediction luminance block and / or prediction chrominance block) are added together to obtain the reconstructed block.

[0184] Optionally, the loop filtering unit of the decoder performs loop filtering on the reconstructed blocks to reduce distortion and improve video quality. The reconstructed blocks after loop filtering are further combined into a decoded image and stored in the decoded image buffer or output as a decoded video signal.

[0185] Optionally, the loop filtering process includes: deblocking filtering, adaptive sampling offset, and / or adaptive loop filtering.

[0186] In this embodiment, by determining or obtaining the prediction result of at least one partition of the current block based on at least one template, the prediction accuracy of local regions of the image block can be improved, thereby supporting the improvement of encoding and / or decoding quality in the video encoding and / or decoding process.

[0187] Second Embodiment

[0188] Based on the first embodiment described above, a second embodiment is proposed.

[0189] In this embodiment, at least one template is determined or obtained according to at least one of the following methods a1 to a11:

[0190] Method a1, motion vector;

[0191] Optionally, at least one template is determined or obtained based on the motion vector, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0192] Optionally, at least one template may include: the current template and / or a reference template.

[0193] Optionally, the motion vector (MV) is a two-dimensional vector used in the prediction process to describe the spatial displacement between the current block and its best matching position in the reference frame. This vector is typically represented as (mv x ,mv y ), mv x Indicates horizontal offset, mv y This indicates the vertical offset, typically in pixels and / or 1 / 4 pixels (after motion-compensated interpolation).

[0194] Optionally, the motion vector can guide the decoder and / or encoder to extract pixel data of the corresponding region from the decoded and / or encoded reference frame, in order to determine or obtain the prediction result of the current block and / or at least one partition.

[0195] Optionally, the motion vector is: the motion vector of the current block and / or the motion vector of at least one partition of the current block.

[0196] Optionally, the motion vector of the current block can be the motion vector used by the current block in the prediction.

[0197] Optionally, the motion vector of at least one partition is the motion vector used in the prediction of at least one partition. For example, the current block includes partition A and partition B, where the motion vector MV1 of partition A points to the reference frame position P1, and the motion vector MV2 of partition B points to the reference frame position P2.

[0198] Optionally, based on the current template and the motion vector, at least one reference template is determined or obtained, and based on the at least one reference template, at least one prediction result for a partition is determined or obtained, wherein the motion vector is: the motion vector of the current block and / or the motion vector of at least one partition of the current block.

[0199] Optionally, the current template is located in the current frame, and the reference template is located in the current frame and / or the reference frame.

[0200] Optionally, at least one reference template, determined or obtained based on the motion vector, is located in the reference frame.

[0201] Optionally, the determination or acquisition of at least one reference template includes at least one of the following:

[0202] Based on the motion vector of at least one partition of the current template and the current block, determine or obtain at least one reference template;

[0203] Based on the motion vectors of the current template and the current block, determine or obtain at least one reference template;

[0204] Based on at least one candidate reference template determined or obtained through the motion vector of at least one partition of the current template and the current block, at least one reference template is determined or obtained;

[0205] Based on at least one candidate reference template determined or obtained through the motion vector of the current template and the current block, at least one reference template is determined or obtained;

[0206] Based on at least one candidate reference template determined or obtained through the motion vector of at least one partition of the current template and the current block, and its associated template matching cost, at least one reference template is determined or obtained.

[0207] At least one reference template is determined or obtained based on at least one candidate reference template determined or obtained through the motion vector of the current template and the current block, and its associated template matching cost.

[0208] In this embodiment, motion vectors can be used to accurately align at least one partition of the current block with the actual motion corresponding region in the reference frame to determine or obtain at least one template. Since motion vectors can reflect global and / or local motion trends, this can guide template matching, narrowing the search range and / or improving the reliability of template matching, so that the determined or obtained template (e.g., reference template) fits the actual texture structure of at least one partition, thereby improving the prediction accuracy of the partition.

[0209] Method a2, block vector;

[0210] Optionally, at least one template is determined or obtained based on the block vector, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0211] Optionally, at least one template may include: the current template and / or a reference template.

[0212] Optionally, a block vector (BV) is a two-dimensional displacement vector used to indicate the position of the current block within the reconstructed region of the current frame that matches the position of the block.

[0213] Optionally, the block vector is: the block vector of the current block and / or the block vector of at least one partition of the current block.

[0214] Optionally, the block vector of the current block can be the block vector used in the prediction of the current block.

[0215] Optionally, the block vector of at least one partition is the block vector used in the prediction of at least one partition. For example, the current block includes partition A and partition B, where the block vector BV1 of partition A points to the current frame position P1, and the block vector BV2 of partition B points to the current frame position P2.

[0216] Optionally, based on the current template and the block vector, at least one reference template is determined or obtained, and based on the at least one reference template, at least one prediction result for a partition is determined or obtained, wherein the block vector is: the block vector of the current block and / or the block vector of at least one partition of the current block.

[0217] Optionally, the current template is located in the current frame, and the reference template is located in the current frame and / or the reference frame.

[0218] Optionally, at least one reference template determined or obtained based on the block vector is located in the current frame.

[0219] Optionally, at the encoding and / or decoding end, the determination or acquisition of at least one reference template includes at least one of the following:

[0220] Based on the current template and the block vector of at least one partition of the current block, determine or obtain at least one reference template;

[0221] Based on the current template and the block vector of the current block, determine or obtain at least one reference template;

[0222] At least one reference template is determined or obtained based on at least one candidate reference template determined or obtained through at least one partition of the current template and the current block;

[0223] At least one reference template is determined or obtained based on at least one candidate reference template determined or obtained through the block vector of the current template and the current block;

[0224] At least one reference template is determined or obtained based on at least one candidate reference template determined or obtained through the block vector of at least one partition of the current template and the current block, and its associated template matching cost;

[0225] At least one reference template is determined or obtained based on at least one candidate reference template determined or obtained through the block vector of the current template and the current block, and its associated template matching cost.

[0226] In this embodiment, based on block vectors, reconstructed regions that are highly similar to at least one partition within the current frame can be located. Since BV points to local structures (such as text, icons, graphic elements, etc.) that are consistent and / or highly repetitive, the at least one template determined or obtained in this way can more realistically reflect the detailed features inside the partition, so that the at least one template determined or obtained (e.g., a reference template) fits the actual texture structure of at least one partition, thereby improving the prediction accuracy of the partition.

[0227] Method a3, template matching cost;

[0228] Optionally, at least one template is determined or obtained based on the template matching cost, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0229] Optionally, at least one template may include: the current template and / or a reference template.

[0230] Optionally, the template matching cost is used to measure the similarity and / or error between the candidate reference template and the current template. For example, the template matching cost includes at least one of SAD (Sum of Absolute Differences), SATD (Sum of Absolute Transformed Differences), and MRSAD (Mean-Removed Sum of Absolute Differences).

[0231] Optionally, the smaller the SAD and / or SATD values, the higher the degree of matching between the candidate reference template and the current template, the higher the similarity and / or the smaller the error between the prediction result determined or obtained through the candidate reference template and at least one partition, and / or the larger the SAD and / or SATD values, the lower the degree of matching between the candidate reference template and the current template, the lower the similarity and / or the larger the error between the prediction result determined or obtained through the candidate reference template and at least one partition.

[0232] Optionally, based on at least one candidate reference template and the current template, a template matching cost associated with at least one candidate reference template is determined or obtained; based on the template matching cost associated with at least one candidate reference template, at least one reference template is determined or obtained from at least one candidate reference template; and based on at least one reference template, a prediction result for at least one partition of the current block is determined or obtained.

[0233] Optionally, at least one candidate reference template is determined or obtained based on the current template and motion vectors and / or block vectors.

[0234] Optionally, at least one candidate reference template is located in the current frame and / or the reference frame.

[0235] Optionally, at least one candidate reference template is sorted (e.g., ascending or descending) according to the template matching cost, and at least one reference template is determined or obtained based on the sorting result.

[0236] Optionally, the method of determining or obtaining at least one reference template based on the sorting results includes at least one of the following:

[0237] The candidate reference template with the highest matching degree is determined or obtained based on the sorting results and is then selected as the reference template.

[0238] Based on the ranking results, candidate reference templates that match the top preset rankings are determined and selected as reference templates.

[0239] Based on the ranking results, candidate reference templates that match within a preset ranking range are determined and selected as reference templates.

[0240] In this embodiment, the similarity and / or error between the candidate reference template and the current template is measured by the template matching cost to quantify the matching quality. The template matching cost can be used to evaluate and / or filter the candidate reference templates, effectively identifying reference regions that are similar to the local texture, edge direction and / or structural features of at least one partition, thereby improving the prediction accuracy of the partition.

[0241] Method a4, template type;

[0242] Optionally, based on the template type, at least one template is determined or obtained, and based on the at least one template, the prediction result of at least one partition of the current block is determined or obtained.

[0243] Optionally, at least one template may include: the current template and / or a reference template.

[0244] Optionally, the template type is a set of predefined template configurations, including at least one of the following: template shape, template size, template position, and pixel sampling method.

[0245] Optionally, template shape is a key classification dimension in template type, referring to the pixel layout form occupied by the template in space. Its design is coupled to the boundary orientation and / or available neighborhood of at least one partition of the current block. For example, when the GPM dividing line is close to vertical, the partition mainly relies on the upper pixels for prediction. At this time, the upper template can capture the horizontal texture continuity more completely. And / or, when the dividing line is close to horizontal, the left template can better reflect the structural continuity in the vertical direction. For diagonal division or central symmetric division, the upper left combined template can simultaneously utilize information from the upper, lower, left and right sides to provide more comprehensive local information.

[0246] Optionally, at least one template can be divided into three categories according to its spatial composition, including: top template (if it is the current template, it only contains the top pixels of the current block), left template (if it is the current template, it only contains the left pixels of the current block) and / or top-left combined template (if it is the current template, it contains the top and left pixels of the current block).

[0247] Optionally, the top-left combined template includes a template obtained by combining the left-side template and the top-side template.

[0248] Optionally, in the traditional GPM mode, the template shape is not arbitrarily set but is determined based on the ideal partitioning case of a square CU with an offset of 0. The template shape selection table is consulted according to the partition angle of GPM and / or the partition identifier (part, used to distinguish partitions) to determine which template shape should be used among the top template, left template, and top-left combined template. However, the selection of the template shape in traditional GPM is fixed and depends on idealized assumptions (such as square blocks and / or zero offset). In asymmetric CU size, large offset partitioning, and / or complex texture scenes, it may lead to insufficient template coverage and / or redundancy, affecting the accuracy of TM cost evaluation and / or prediction accuracy.

[0249] Optionally, depending on the template type, the method for determining or obtaining at least one template includes at least one of the following:

[0250] Based on the template type, determine or obtain at least one current template;

[0251] Based on the template type, determine or obtain at least one reference template;

[0252] Based on the template type, determine or obtain at least one current template, and based on the at least one current template, determine or obtain at least one reference template;

[0253] Based on the template type of at least one current template, determine or obtain the template type of at least one reference template and / or at least one candidate reference template. Based on the template type of at least one reference template and / or at least one candidate reference template, determine or obtain at least one reference template.

[0254] Optionally, the template type includes: template shape, based on which at least one current template and / or at least one reference template are determined or obtained.

[0255] Optionally, the current template and the reference template have the same template type. When determining or obtaining the reference template, the same shape as the current template is maintained to avoid false similarity introduced by template asymmetry, so that the determined or obtained prediction results are highly consistent with the real content in terms of edge alignment, texture direction and / or local details.

[0256] Optionally, the prediction result of at least one partition of the current block can be determined or obtained based on at least one current template and / or at least one reference template.

[0257] Optionally, the template type is determined or obtained based on at least one of the following: offset adjustment amount, at least one partition, block size of the current block, partitioning method of the current block, template pixel partitioning information, first template list and second template list.

[0258] In this embodiment, the template type (e.g., template shape) is strongly correlated with the partition geometry, ensuring that at least one template accurately captures the representative edge and / or texture features of the partition. For example, for a triangular sub-partition that mainly exposes the upper boundary, forcibly using the left template (only left pixels) will lose key upper structural information, leading to matching deviation. However, using the upper template can effectively preserve horizontal continuity and improve matching reliability. And / or, selecting the template type on demand can also effectively suppress interference from invalid and / or noisy samples. For example, in a partition near the left edge of the image, there are no usable pixels on the left. If the left template or the upper left combined template is still used, it may introduce padding values ​​and / or out-of-bounds data, reducing matching quality. However, automatically selecting the upper template according to the partition position can avoid such problems, thereby improving the prediction accuracy of the partition.

[0259] Method a5, offset adjustment amount;

[0260] Optionally, based on the offset adjustment amount, at least one template is determined or obtained, and based on the at least one template, the prediction result of at least one partition of the current block is determined or obtained.

[0261] Optionally, the template type is determined or obtained based on the offset adjustment amount, and at least one template is determined or obtained based on the template type.

[0262] Optionally, at least one template includes: the current template and / or a reference template; optionally, the template type includes: a template shape.

[0263] Optionally, the offset adjustment amount is a value for adjusting the horizontal or vertical offset of the dividing line of the square block shown in Figure 7. For example, the dividing line shown in Figure 7 is the dividing line that passes through the center of the square, and the dividing line shown in Figure 11 is the dividing line obtained by offsetting the dividing line shown in Figure 7.

[0264] Optionally, by introducing an offset adjustment amount, the mapping relationship table in Table 1 regarding the template types corresponding to the division angle and partition can be improved to obtain an improved mapping relationship table regarding the template types corresponding to the division angle, offset, and / or partition.

[0265] Optionally, the offset adjustment is a correction factor introduced to compensate for the boundary availability deviation caused by the proportional imbalance of non-square and / or large blocks during geometric division. It can adapt the idealized division model (usually based on square and / or zero offset assumptions) to the actual geometric characteristics of the current block, thereby more realistically reflecting the actual exposed boundary length of the partition on the top and / or left.

[0266] Optionally, the offset adjustment amount is determined or obtained based on the current block size. Optionally, the block size is: width, height, aspect ratio, perimeter and / or area.

[0267] Optionally, the offset adjustment amount is determined or obtained based on the current block size and the first adjustment amount list, which stores the offset adjustment amounts corresponding to different block sizes.

[0268] Optionally, based on the offset adjustment amount and the current block division method, the template type and / or at least one template can be determined or obtained.

[0269] Optionally, the current block partitioning method refers to the process of dividing a coding unit (CU) to be processed into two or more sub-regions (i.e. partitions) according to specific rules. The partitioning method is defined by two core parameters: partitioning angle and displacement offset.

[0270] Optionally, the current block can be divided by: division angle and / or displacement offset.

[0271] Optionally, the dividing angle determines the tilt angle of the dividing line and the offset direction when the displacement offset is not equal to 0. For example, in Figure 7, the dividing angle 31 is offset to the upper left and the dividing angle 15 is offset to the lower right. It is usually represented by a predefined set of discrete angles (e.g., 32 angles are supported in VVC / H.266). This angle determines the tilt direction of the dividing line, thereby controlling the geometry of the partition.

[0272] Optionally, displacement offset refers to the amount of translation of the dividing line relative to the center and / or standard position of the block at a given dividing angle. It is used to fine-tune the specific position of the dividing line so that the area ratio of the partition can adapt to local content features (such as when a small object is located in a corner, a partition can be shrunk by offset to accurately cover the target area). Displacement offset is usually expressed in integer units and its value range is limited in the standard coordinate system (such as -7 to +7). The larger its absolute value, the more the division is biased to one side of the block.

[0273] Optionally, based on the offset adjustment amount and the displacement offset, a first displacement offset is determined or obtained; based on the division angle and the first displacement offset, a template type and / or at least one template is determined or obtained; based on the at least one template, the prediction result of at least one partition of the current block is determined or obtained.

[0274] Optionally, at least one template determined or obtained according to the template type includes: the top template (which contains only the top pixels of the current block if it is the current template), the left template (which contains only the left pixels of the current block if it is the current template), and / or the top-left combined template (which contains both the top and left pixels of the current block if it is the current template).

[0275] Optionally, the first displacement offset is a new offset obtained by correcting the original offset (i.e., displacement offset) in the original GPM partitioning parameters by an offset adjustment amount.

[0276] Optionally, since the original offset (i.e. displacement offset) of GPM is usually defined in a normalized coordinate system (such as a 64×64 unit grid), when applied to the current block of different sizes and / or aspect ratios, the physical boundary position corresponding to the same offset value will be distorted. For example, in a 16×64 vertical strip block, the original offset "0" may make a partition almost completely without the top pixel, while in a 64×16 horizontal strip block, there may be no left pixel. Therefore, the offset adjustment amount can be determined or obtained based on the actual width (W) and height (H) of the current block to perform scale normalization and / or geometric compensation on the offset.

[0277] In this embodiment, the traditional GPM mode typically determines or obtains the template shape and / or template based on the partition angle-offset mapping table, without considering the influence of the current block size (e.g., width, height, and / or aspect ratio) on the partitioning method. This can easily lead to the selection of mismatched templates under non-square blocks (e.g., 32×8, 8×32) and / or large offset partitioning (e.g., incorrectly enabling the left template in a narrow and tall block when there are actually not enough pixels on the left), resulting in template content distortion and / or missing content. However, the embodiment of this application determines or obtains the offset adjustment amount by the block size, so that the new offset (i.e., the first displacement offset) more accurately represents the effective exposed area of ​​the partition in the neighborhood, improves the matching degree between the determined or obtained template shape and at least one partition of the current block, avoids interference from invalid pixels, and thus improves the prediction accuracy of the partition.

[0278] Method a6, at least one partition;

[0279] Optionally, at least one template is determined or obtained based on at least one partition of the current block, and the prediction result of at least one partition of the current block is determined or obtained based on at least one template.

[0280] Optionally, based on at least one partition, at least one template for at least one partition is determined or obtained, wherein the at least one template includes: the current template and / or a reference template.

[0281] Optionally, based on at least one partition, determine or obtain the current template of at least one partition; based on the current template of at least one partition, determine or obtain the reference template of at least one partition; and based on the reference template of at least one partition, determine or obtain the prediction result of at least one partition of the current block.

[0282] Optionally, a template type is determined or obtained based on at least one partition, the template type including a template shape. Based on the template type, the current template and / or reference template of at least one partition are determined or obtained. Optionally, the at least one template determined or obtained based on the template type includes at least one of the following: the top template, the left template, and the top-left combined template.

[0283] Optionally, the template type of at least one partition is determined or obtained based on the contact relationship between the valid pixels (i.e., regions with non-zero mask weights) within at least one partition and the physical boundary of the current block (i.e., whether there are valid pixels located at the boundary of the current block).

[0284] For example, if a partition contains valid pixels located above the row boundary of the current block, the template determined or obtained based on the template type is the template above.

[0285] For example, if a partition contains valid pixels located at the left column boundary of the current block, then the template determined or obtained based on the template type is the left template;

[0286] For example, if a partition contains valid pixels at the top row boundary and the left column boundary of the current block, the template determined or obtained based on the template type is the top-left combined template.

[0287] Optionally, the effective pixels of a partition (i.e., the region where the mask weight is not zero) refer to the set of actual pixel positions belonging to a certain sub-partition (such as Part0 or Part1) after the current coding unit is geometrically divided.

[0288] Optionally, the effective pixels of a partition represent the shape and coverage of the partition in the CU space.

[0289] In this embodiment, since different partitions of the current block may be adapted to different template types, such as one partition mainly adjacent to the pixels above and another partition mainly adjacent to the pixels to the left, if the same template is used for different partitions, it may result in at least one partition using irrelevant and / or invalid reference samples. Therefore, the embodiments of this application independently decide on the template to match each partition, which can ensure that each sub-partition only uses its actually available and / or most representative neighboring pixels to construct the template, thereby improving the prediction accuracy of the partition.

[0290] Method a7, the block size of the current block;

[0291] Optionally, at least one template is determined or obtained based on the block size of the current block, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0292] Optionally, the block size is at least one of the following: width, height, aspect ratio, perimeter, and area.

[0293] Optionally, at least one template is determined or obtained based on the block size of the current block, and the at least one template includes: the current template and / or a reference template.

[0294] Optionally, based on the block size of the current block, a current template is determined or obtained; based on the current template, at least one reference template is determined or obtained; and based on the at least one reference template, the prediction result of at least one partition of the current block is determined or obtained.

[0295] Optionally, based on the block size of the current block, a template type is determined or obtained. The template type includes a template shape. Based on the template type, a current template and / or a reference template are determined or obtained. Optionally, at least one template determined or obtained based on the template type includes at least one of the following: the top template, the left template, and the top-left combined template.

[0296] Referring to Figure 11, the current block is divided by a dividing line with an angle of 28° and a displacement of 1° to determine or obtain partition 0 and partition 1. If the current block size is 16×16 (i.e., square), then partition 0 does not touch the top row and left column boundaries of the current block. Therefore, the current template matched by partition 0 under this block size is the top left combined template. Or, if the current block size is 16×32 (narrow and tall block), then partition 0 only touches the left column boundary of the current block. Therefore, the current template matched by partition 0 under this block size should be the left template. Or, if the current block size is 32×16 (wide and flat block), then partition 0 only touches the top row boundary of the current block. Therefore, the current template matched by partition 0 under this block size should be the top template. However, according to the traditional GPM mode, regardless of the size of the current block, the current template of partition 0 is always the top left combined template. This leads to misjudgment of the template type under non-square blocks and / or non-zero offset division, affecting the prediction accuracy.

[0297] In this embodiment, since the block size of the current block (e.g., width, height, and / or aspect ratio) affects the template type adapted to different partitions of the current block, if the differences in block size are ignored and a fixed template mapping rule is used uniformly, invalid and / or low-quality templates may be obtained. Therefore, this embodiment determines or obtains at least one template by block size to ensure the matching degree between the template and at least one partition of the current block, thereby improving the prediction accuracy of the partition.

[0298] Method a8, the current block's partitioning method;

[0299] Optionally, at least one template is determined or obtained based on the current block partitioning method, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0300] Optionally, the division method includes: division angle and / or displacement offset.

[0301] Optionally, the current block partitioning method refers to the process of dividing a coding unit (CU) to be processed into two or more sub-regions (i.e. partitions) according to specific rules. The partitioning method is defined by two core parameters: partitioning angle and displacement offset.

[0302] Optionally, the segmentation angle refers to the angular parameter used to define the direction of the segmentation line. It is usually represented by a predefined set of discrete angles (e.g., 32 or 64 angles are supported in VVC / H.266, covering the range from 0° to 180°). This angle determines the tilt direction of the segmentation line, thereby controlling the geometry of the partition. For example, 0° corresponds to vertical segmentation, 90° corresponds to horizontal segmentation, and 45° or 135° corresponds to diagonal segmentation. The segmentation angle reflects the direction of the dominant edge or motion boundary in the image content and is a key basis for determining the template shape and / or prediction strategy.

[0303] Optionally, displacement offset refers to the amount of translation of the dividing line relative to the center and / or standard position of the block at a given dividing angle. It is used to fine-tune the specific position of the dividing line so that the area ratio of the partition can adapt to local content features (such as when a small object is located in a corner, a partition can be shrunk by offset to accurately cover the target area). Displacement offset is usually expressed in integer units and its value range is limited in the standard coordinate system (such as -7 to +7). The larger its absolute value, the more the division is biased to one side of the block.

[0304] Optionally, based on the current block division method, at least one template is determined or obtained, and the at least one template includes: the current template and / or a reference template.

[0305] Optionally, based on the current block partitioning method, a current template is determined or obtained; based on the current template, at least one reference template is determined or obtained; and based on the at least one reference template, the prediction result of at least one partition of the current block is determined or obtained.

[0306] Optionally, based on the current block division method, a template type is determined or obtained. The template type includes a template shape. Based on the template type, a current template and / or a reference template are determined or obtained. Optionally, at least one template determined or obtained based on the template type includes at least one of the following: the top template, the left template, and the top-left combined template.

[0307] Optionally, based on the displacement offset and the current block division method, at least one template is determined or obtained, and based on the at least one template, the prediction result of at least one partition of the current block is determined or obtained.

[0308] Optionally, based on the division angle and the first displacement offset determined or obtained through displacement offset and offset adjustment, at least one template is determined or obtained, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0309] Optionally, the template type can be determined or obtained based on at least one of the following: at least one partition of the current block, the block size, and the partitioning method.

[0310] Optionally, depending on the template type, the current template and / or reference template can be determined or obtained.

[0311] Optionally, based on the template type, the current template is determined or obtained, a reference template is determined or obtained based on the current template, and the prediction result of at least one partition of the current block is determined or obtained based on the reference template.

[0312] In this embodiment, the partitioning method of the current block defines the geometric contour of at least one partition of the current block and / or its contact relationship with the boundary of the current block. Therefore, based on the partitioning method (including partitioning angle and displacement offset), at least one template matching at least one partition can be determined or obtained, thereby improving the prediction accuracy of the partition.

[0313] Method a9, template pixel partition information;

[0314] Optionally, template pixel partitioning information refers to information used to characterize the correspondence between each pixel in the current template and at least one partition. It can reflect, for example, which pixels belong to the first partition and which pixels belong to the second partition within the template area, providing a reliable and usable basis for template construction and matching.

[0315] Optionally, the template pixel partitioning information includes: partitioning weight information, which assigns a continuous or discrete weight value to at least one pixel position in the template, indicating the degree to which it belongs to a certain partition (for example, binary weights of 0 / 1 and / or interpolated weights between 0.0 and 1.0 can be used).

[0316] Optionally, the partitioning weight information includes: mask information, which is usually a binary array, including: the mask information of the current template and / or the mask information of the current block. The mask information of the current template includes the mask value of at least one template pixel in the current template, which can identify whether at least one template pixel is geometrically connected to the partition. The mask information of the current block contains the mask value of at least one pixel in at least one partition in the current block.

[0317] Optionally, the division weight information and the mask information correspond to each other; alternatively, the template pixel partitioning information corresponds to the division weight information and / or the mask information.

[0318] Optionally, the template pixel partitioning information is determined or obtained based on at least one of the following: partitioning weight information, mask information, and mask information of the current template.

[0319] Optionally, the template pixel partitioning information includes at least one of the following: partitioning weight information, mask information, and mask information of the current template.

[0320] Referring to Figure 12, the current block includes: partition 0 and partition 1. The template pixel partition information is mask information, including the mask value of at least one template pixel in the current template. The position of the mask value of 1 in the mask information indicates that the pixel corresponds to partition 0, and / or, the position of the mask value of 0 in the mask information indicates that the pixel corresponds to partition 1.

[0321] Optionally, boundary validity can be determined based on template pixel partitioning information, and at least one template and / or template type can be determined or obtained based on the boundary validity determination result.

[0322] Optionally, for partition 0 of the current block, the current template pixels in the row above the current block can be searched based on the template pixel partition information:

[0323] For example, if there is at least one non-zero mask value (e.g., a mask value of 1), then partition 0 is determined to be in contact with the upper row.

[0324] Optionally, for partition 0 of the current block, the current template in the left column of the current block can be searched based on the template pixel partition information;

[0325] For example, if there is at least one non-zero mask value (e.g., a mask value of 1), then partition 0 is determined to be in contact with the left column.

[0326] Optionally, if the boundary validity determination result is that partition 0 touches the top row and the left column, then based on the boundary validity determination result, the template type and / or the current template is determined to be the top-left combined template.

[0327] Optionally, for partition 0 of the current block, if a certain boundary (e.g., above and / or to the left) has no valid reference pixels (i.e., the mask value is zero or empty), the boundary validity determination result is that the boundary is invalid (e.g., represented by coordinates -1).

[0328] Optionally, based on the template pixel partitioning information, a boundary validity determination result is determined or obtained, and based on the boundary validity determination result, at least one template and / or template type is determined or obtained.

[0329] Optionally, the method for determining or obtaining at least one template and / or template type based on the boundary validity determination result includes at least one of the following:

[0330] If the boundary validity determination result is that at least one partition contacts the upper row, then the template type and / or the current template is determined to be the upper template;

[0331] If the boundary validity determination result is that at least one partition touches the left column, then the template type and / or the current template is determined to be the left template;

[0332] If the boundary validity determination result is that at least one partition touches the top row and the left column, then the template type and / or the current template is determined to be the top-left combined template.

[0333] If the boundary validity determination result is that at least one partition does not touch the top row and left column, then the template type and / or the current template is determined to be the top-left combined template.

[0334] Referring to Figure 12, the current block includes: partition 0 and partition 1. The template pixel partition information is mask information, including the mask value of at least one template pixel in the current template. The position of the mask value of 1 in the mask information indicates that the pixel corresponds to partition 0, and / or, the position of the mask value of 0 in the mask information indicates that the pixel corresponds to partition 1. The boundary validity determination result of partition 0 is determined or obtained according to the mask information as follows: partition 0 is in contact with the upper row and the left column, and / or the boundary validity determination result of partition 1 is as follows: partition 1 is in contact with the upper row. According to the boundary validity determination results of partition 0 and / or partition 1, at least one of the following is determined or obtained: the template type of partition 0 and / or the current template is the upper left combined template, and the template type of partition 1 and / or the current template is the upper template.

[0335] Optionally, the offset horizontal flag (shiftHor) can be determined or obtained based on the current block size and partition angle.

[0336] Optionally, the shiftHor flag determines whether the dividing line is offset along the x-axis or y-axis during calculation, thus affecting the actual position of the dividing line and the geometry of the partition.

[0337] Optionally, the method for determining or obtaining the offset horizontal flag (shiftHor) based on the current block size and partition angle includes at least one of the following:

[0338] If the dividing angle is completely horizontal (for example, dividing angle = 4), then set shiftHor = 1;

[0339] If the dividing angle is completely perpendicular (e.g., dividing angle = 0), then set shiftHor = 0;

[0340] For other angles, if the height is greater than or equal to the width based on the current block size, then set shiftHor = 1;

[0341] For other angles, if the height is less than the width based on the current block size, then set shiftHor=0.

[0342] Optionally, based on the division angle of the current block, an angle category is determined or obtained, which includes at least one of the following: near vertical (e.g., {0,1,2}), near horizontal (e.g., {6,7,8}), and near diagonal (e.g., {3,4,5}).

[0343] Optionally, the offset horizontal flag (shiftHor) can be determined or obtained based on the current block's partitioning angle and current block size.

[0344] Optionally, the method for determining or obtaining the offset horizontal flag (shiftHor) based on the current block's partitioning angle and current block size includes at least one of the following:

[0345] If the angle category is determined or obtained based on the current block's division angle and is classified as near vertical, then set shiftHor=1;

[0346] If the angle category is determined or obtained based on the current block's division angle and is close to horizontal, then set shiftHor=0;

[0347] If the angle category is determined to be near diagonal based on the current block's division angle, and the height is greater than or equal to the width based on the current block's block size, then set shiftHor = 1;

[0348] If the angle category is determined to be near diagonal based on the current block's partitioning angle, and the height is less than the width based on the current block's block size, then set shiftHor = 0.

[0349] If the angle category is determined or obtained based on the current block's partitioning angle as near diagonal, and the aspect ratio determined or obtained based on the current block's block size is greater than or equal to the aspect ratio of the partitioning angle determined or obtained based on the partitioning angle (i.e., the aspect ratio of the angle), then set shiftHor = 0.

[0350] If the angle category is determined or obtained based on the current block's division angle as near diagonal, and the aspect ratio determined or obtained based on the current block's block size is less than the aspect ratio of the division angle determined or obtained based on the division angle (i.e., the aspect ratio of the angle), then set shiftHor=1.

[0351] Optionally, mask information can be determined or obtained based on the offset level flag, the current block size, the partition angle, the displacement offset, and at least one partition.

[0352] Optionally, based on the offset horizontal flag, the current block size, the partition angle, the displacement offset, and at least one partition, the position of at least one pixel relative to the partition line is calculated using the geometric partition line equation, and the mask information is determined or obtained based on the position of at least one pixel relative to the partition line.

[0353] Optionally, at least one effective boundary information of a partition is determined or obtained based on the template pixel partition information, and at least one template is determined or obtained based on the effective boundary information of the at least one partition.

[0354] Optionally, based on the valid boundary information of at least one partition, a template type is determined or obtained, and based on the template type, at least one template is determined or obtained.

[0355] Optionally, the valid boundary information of at least one partition is used to describe which positions in the template belong to the valid reference samples of the current partition, and / or to characterize the actual contact between the physical boundary of at least one partition and the current block, thereby providing a reliable basis for the selection of template and / or template type.

[0356] Optionally, the effective boundary information of at least one partition includes: the effective reference pixel distribution information of at least one partition in the template, such as the coordinate parameters of the effective reference pixel distribution range, the value of which can affect the selection of the template and / or template type.

[0357] Optionally, the valid boundary information of at least one partition includes at least one of the following: invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0358] Optionally, the valid boundary information of at least one partition can be any one of invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0359] Optionally, the processing method includes at least one of the following:

[0360] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0361] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0362] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0363] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0364] Optionally, the effective reference pixel distribution information in the effective boundary information of at least one partition includes at least one of the following:

[0365] The top start position information (top_start) represents the horizontal coordinate (x value) of the first valid reference pixel belonging to this partition in the upper row template of the current block;

[0366] The top end position information (top_end) represents the horizontal coordinate (x value) of the last valid reference pixel belonging to this partition in the row template above the current block;

[0367] The left start position information (left_start) represents the vertical coordinate (y value) of the first valid reference pixel belonging to this partition in the left column template of the current block;

[0368] The left end position information (left_end) represents the vertical coordinate (y value) of the last valid reference pixel belonging to this partition in the left column template of the current block;

[0369] Invalid value: If there is no valid reference pixel for a certain boundary (i.e., the entire row and / or the entire column mask is zero), the corresponding parameter is marked as invalid (e.g., -1).

[0370] Optionally, based on the valid boundary information of at least one partition, the valid reference pixel range in the template related to at least one partition is determined or obtained.

[0371] Referring to Figure 12, the current block includes: partition 0 and partition 1. The effective boundary information of partition 0 is determined or obtained based on the template pixel partition information, including: top_start = 0, top_end = 3, left_start = 0, left_end = 8, and / or the effective boundary information of partition 1 includes: top_start = 5, top_end = 7, left_start = left_end = -1. Based on the effective boundary information of at least one partition, it can be quickly determined that partition 0 is in contact with the left and top boundaries of the current block, and / or the effective reference pixel range related to partition 0 in the template is a continuous pixel position from horizontal index 0 to horizontal index 3, and a continuous pixel position from vertical index 0 to vertical index 8. Partition 1 is only in contact with the top boundary of the current block, and / or the effective reference pixel range related to partition 1 in the template is a continuous pixel position from horizontal index 5 to horizontal index 7. Based on this, at least one of the following is determined or obtained: the template type of partition 0 and / or the current template is a top-left combined template, and the template type of partition 1 and / or the current template is a top template.

[0372] Optionally, the method for determining or obtaining the template type based on the valid boundary information of at least one partition includes at least one of the following:

[0373] If the valid boundary information of at least one partition includes: the top start position information (top_start) and / or the top end position information (top_end), then the template type is determined or obtained as the top template;

[0374] If the valid boundary information of at least one partition includes: left start position information (left_start) and / or left end position information (left_end), then the template type is determined or obtained as a left template;

[0375] If the valid boundary information of at least one partition includes: top start position information (top_start) and / or top end position information (top_end), and left start position information (left_start) and / or left end position information (left_end), then the template type is determined or obtained as the top-left combined template;

[0376] If at least one partition's valid boundary information is invalid, then the template type is determined to be the top-left combined template.

[0377] Optionally, the template pixel partition information can be the original mask, which typically contains the correspondence information between all pixels and partitions within the entire coding unit (CU), that is, it includes the pixel mask within the current block and the template pixel mask of the current template.

[0378] Optionally, in this embodiment, it is not necessary to access the complete original mask. Instead, it is only necessary to read the mask portion related to the current template, i.e., the mask information of the current template, to determine or obtain the effective boundary information of at least one partition, and to reliably determine at least one template accordingly, thereby reducing computational overhead.

[0379] In this embodiment, determining or obtaining at least one template based on template pixel partitioning information can eliminate the reliance on fixed angle-offset lookup table rules and directly start from the actual partitioning results. It can accurately identify the real boundary contact situation of at least one partition in a data-driven manner, thereby ensuring that the determined or obtained at least one template is consistent with the local structure of the partition and improving the prediction accuracy of the partition.

[0380] Method a10, first template list;

[0381] Optionally, the first template list can be a preset or dynamically determined or generated template type selection list. Each item in the first template list corresponds to a specific template type (such as the top template, the left template, or the top-left combined template). The first template list can be accessed by indexing the first index parameter, thereby outputting the template type that matches the first index parameter.

[0382] Optionally, the first template list includes: at least one first index parameter and / or at least one template type corresponding to the first index parameter.

[0383] Optionally, the template type includes a template shape, and the first index parameter includes at least one of the following: at least one partition of the current block, the block size, and the partitioning method.

[0384] Optionally, at least one of the following: the current block's partition, block size, and partitioning method can be used as an index to directly locate the corresponding template type in the first template list. The template type includes the template shape.

[0385] Optionally, at least one template and / or template type can be determined or obtained based on the first template list.

[0386] Optionally, at least one template and / or template type is determined or obtained based on at least one partition of the current block, block size and partitioning method, and a first template list. Optionally, at least one template is determined or obtained based on the template type. Optionally, the at least one template includes the current template and / or a reference template.

[0387] Optionally, based on the template type, at least one current template is determined or obtained, and based on the at least one current template, at least one reference template is determined or obtained.

[0388] Optionally, based on at least one template, the prediction result of at least one partition of the current block can be determined or obtained.

[0389] Optionally, the method for determining or obtaining the first template list includes: obtaining at least one combination of size and division method and its corresponding mask information, and determining or generating the first template list based on the mask information.

[0390] Optionally, the method of obtaining at least one combination of size and partitioning method and its corresponding mask information includes: during the operation of the codec, traversing all supported CU widths and heights h (e.g., w, h ∈ {8, 16, 32, 64}), and for each (w, h) combination, traversing all predefined partitioning methods (including partitioning angle and displacement offset) combinations, and capturing the pixel weighted mask map output by GPM in real time for each (w, h, angle, distance) combination. This mask map identifies which sub-partition each pixel in the current CU belongs to. For example, Part0 (first partition) is defined as the region with a mask value of 1, and Part1 (second partition) is defined as the region with a mask value of 0.

[0391] Optionally, the method for determining or generating the first template list based on the mask information includes: for each of the above mask images, determining the valid boundary information of Part0 and Part1, determining the template shape corresponding to at least one five-dimensional index (w, h, angle, distance) based on the valid boundary information, and storing it in the list to obtain the first template list.

[0392] Optionally, the method for determining the template shape corresponding to at least one five-dimensional index (w, h, angle, distance) based on the valid boundary information includes at least one of the following:

[0393] If a valid reference pixel of a certain partition (i.e., the area with a non-zero mask weight) only appears at the upper row boundary of the CU, then its template shape is set to the upper template.

[0394] If the valid reference pixels of a certain partition only appear on the left column boundary of the CU, then its template shape is set to the left template.

[0395] If a valid reference pixel of a certain partition appears at the top row boundary and the left column boundary of the CU, then its template shape is set to the top left combined template.

[0396] If a partition has no valid reference pixels at the top row boundary and left column boundary of the CU, then its template shape is set to the original GPM template shape.

[0397] Optionally, the processing method of the embodiments of this application can be performed by modifying the template shape selection rules of the decoding end and / or the decoding end.

[0398] Optionally, when a certain partitioning method is selected at the encoding end, its corresponding partitioning angle and displacement offset can be extracted, and combined with the width, height and partition identifier of the current block (part∈{Part 0,Part 1}), the first template list can be queried to obtain the corresponding template type.

[0399] Optionally, when a certain partitioning method is selected at the decoding end, its corresponding partitioning angle and displacement offset can be extracted, and combined with the width, height and partition identifier of the current block (part∈{Part 0,Part 1}), the first template list can be queried to obtain the corresponding template type.

[0400] Optionally, the decoding end can execute the same table lookup logic as the encoding end to ensure consistency between encoding and decoding.

[0401] Optionally, the processing method of this application embodiment can be integrated into the ECM (Encoding Configuration Model) reference software platform. Under two standard test configurations, random access and low-latency B-frames, the CTC (Common Test Conditions) dataset is used for objective performance evaluation. Experimental results show that the processing method of this application embodiment improves the prediction accuracy of at least one partition of the current block while keeping the encoding and decoding complexity controllable, and / or supports reducing residual energy, and / or supports saving bitrate.

[0402] Optionally, the processing method of this application embodiment can be applied to a reference software environment that conforms to the H.266 / VVC (Versatile Video Coding) standard, and can use ECM18 (Encoding Configuration Model 18) as the encoder, and / or run based on HHI software.

[0403] Optionally, the codec can be instrumented to locate the core function in the GPM module that performs template weighted calculation or SAD. By traversing the parameter combinations through nested loops, the pixel-level template mask corresponding to each parameter combination is obtained. This mask identifies the effective calculation area of ​​the partition (Part 0 or Part 1). The complete data is exported to a CSV file as the basis for offline analysis. The CSV data is processed using a Python script to generate two types of five-dimensional template shape selection arrays (dimensions: w×h×angle×distance×part) as the first template list, including: a type selection array for GPM-TM and a type selection array for GPM-Intra.

[0404] Optionally, the methods for obtaining the pixel-level template mask corresponding to each parameter combination include: obtaining the basic template mask of the basic division angle, and determining or obtaining the template mask corresponding to other parameter combinations through mirroring and / or offset displacement.

[0405] Optionally, the parameter combination includes at least one of the following:

[0406] Encoding unit size: Width w and height h are taken from the set {8, 16, 32, 64};

[0407] There are 32 possible angles for classification, with an index range of [0,31].

[0408] Displacement offset: Values ​​[0, 3].

[0409] Optionally, for selecting arrays for GPM-TM types, since GPM-TM has simplification constraints in ECM18 (i.e., Part 0 only allows the use of the top template or the top-left combined template, and Part 1 only allows the left template or the top-left combined template), this application embodiment introduces a modification rule, including at least one of the following:

[0410] If the actual mask of Part 0 shows that its effective reference pixels are only located at the left column boundary, then its template shape is redefined as the top left composite template;

[0411] If the actual mask of Part 1 shows that its effective reference pixels are only located at the top row boundary, then its template shape is redefined as the top left composite template;

[0412] If a certain partition has no valid reference pixels at both the Top and Left boundaries, then the original template shape is retained.

[0413] Optionally, for the type selection array for GPM-Intra, the classification is based on the geometric distribution of the effective reference pixels, including at least one of the following:

[0414] If the actual mask of at least one partition shows that its valid reference pixel touches the upper row boundary, then its template shape is defined as the upper template.

[0415] If the actual mask of at least one partition shows that its valid reference pixel touches the left column boundary, then its template shape is defined as the left template.

[0416] If the true mask of at least one partition shows that its effective reference pixels touch the upper row and left column boundaries, then its template shape is defined as the upper left combined template;

[0417] If the actual mask of at least one partition shows that it has no valid reference pixels, then the original template shape is retained.

[0418] Optionally, in the encoder source code, core reconstruction and / or motion compensation functions such as DecCu::xReconInter(CodingUnit&cu) and / or InterPrediction::motionCompensationGeo can be modified. The original ECM18 obtains the template shape through the global array g_geoTmShape. In this embodiment, it can be replaced with the GPM-TM five-dimensional type selection array (i.e., the first template list) generated above, thereby integrating the processing method of this embodiment into the GPM-TM module. When performing prediction processing on at least one partition of the current block, the upper template, left template, or upper left combined template obtained by searching the first template list can be used to determine or obtain an accurate reference template, avoiding the introduction of invalid pixels due to shape misjudgment and improving the motion compensation accuracy under non-square blocks (such as 16×64, 64×16).

[0419] Optionally, in the encoder source code, key functions such as PU::getGeoIntraMPMs, InterPrediction::motionCompensationGeo, and / or prepareGpmComboList can be modified to integrate the processing method of this application embodiment into the GPM-Intra module. This allows the construction of the GPM intra-frame candidate prediction mode list (e.g., MPM and / or IPM list) to no longer rely on the default geometric assumptions, but instead query the GPM-Intra shape selection array (i.e., the first template list). For example, if a certain partition is found to be the upper template, the PU::getGeoIntraMPMs function searches for candidate intra-frame modes only from the upper neighborhood (A, AL, AR positions). If it is the left template, it searches only from the left neighborhood (L, BL, AL positions), which supports improved prediction accuracy.

[0420] Optionally, the construction process of the first template list does not require storing complete mask data separately for all the division angles. Instead, a small amount of basic angle (such as 0°-45°) mask information (i.e., geometric weight templates) can be pre-stored. For the remaining angles, the required mirroring method can be dynamically determined through a predefined mirror mapping table (such as g_angle2mirror). For example, 0 represents no mirroring, 1 represents horizontal mirroring, and 2 represents vertical mirroring, and the method can be dynamically determined or generated accordingly.

[0421] Optionally, when actually accessing the weight template, the starting address and step direction can be dynamically adjusted according to g_angle2mirror[angle].

[0422] For example, when horizontal mirroring is required (i.e., g_angle2mirror[angle] == 1), set stepX to a negative value and stepY to a positive value, and position the starting position at the offset position corresponding to the upper right corner of the template;

[0423] For example, when vertical mirroring is required (i.e., g_angle2mirror[angle] == 2), the vertical step direction step Y is set to a negative value, so that the reading of the geometric weight template is pushed backward in the row direction, and the starting position is located at the corresponding top left corner of the mirror in the template;

[0424] For example, when there is no mirror image, the system directly reads from the starting offset corresponding to the current block position in the specification template using a forward stepping method.

[0425] Optionally, the weight offset array g_weightOffsetEx and the extended region compensation parameter GEO_TM_ADDED_WEIGHT_MASK_SIZE can be combined to accurately locate the partition start position of the current coding unit in the extended weight template, ensuring that the extracted weight distribution is geometrically aligned with the block size, partition angle and / or displacement offset of the current block.

[0426] Optionally, the above method can generate mask information with arbitrary angle and offset combinations based on a small amount of basic mask information, reducing storage overhead.

[0427] Optionally, the method for constructing the first template list in this application embodiment includes:

[0428] For each combination of [w][h][angle][distance][part], iterate through the Top row (the row above, length w) and the Left column (the column to the left, height h) in the current template;

[0429] If the Top row has at least one pixel with a mask value of 1 and the Left column has at least one pixel with a mask value of 1, then the record template type is the top-left combined template.

[0430] If only the top row contains valid pixels (the left column is all 0), then the record template type is the top template.

[0431] If only the Left column contains valid pixels (the Top row is all 0), then the record template type is the Left Template.

[0432] If neither has valid pixels, then fall back to the first template type (e.g., the default lookup result based on angle and partition in traditional GPM).

[0433] Store the template type corresponding to each combination of [w][h][angle][distance][part] into the first template list.

[0434] In this embodiment, the first template list can integrate multi-dimensional information such as block size, division method, and partition, avoiding template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods. This ensures that the obtained template has the same effective reference pixel distribution as at least one partition of the current block, improving the prediction accuracy for at least one partition. And / or, at least one template can be determined or obtained with only one index access through the first template list, without performing complex processing steps, thus reducing computational complexity.

[0435] Method a11, second template list.

[0436] Optionally, the second template list can be a preset or dynamically determined or generated list of valid template regions. Each item in the second template list corresponds to the valid boundary information of a partition. The second template list can be indexed and accessed through the second index parameter, thereby outputting the valid boundary information of at least one partition that matches the second index parameter.

[0437] Optionally, the second template list includes: at least one second index parameter and / or valid boundary information of at least one partition corresponding to at least one second index parameter.

[0438] Optionally, at least one template can be determined or obtained based on the valid boundary information of at least one partition.

[0439] Optionally, based on the valid boundary information of at least one partition, a template type is determined or obtained, and at least one template is determined or obtained based on the template type.

[0440] Optionally, based on at least one template, the prediction result of at least one partition of the current block can be determined or obtained.

[0441] Optionally, at least one template may include: the current template and / or a reference template.

[0442] Optionally, the current template can be determined or obtained based on the template type, and a reference template can be determined or obtained based on the current template.

[0443] Optionally, the template type includes a template shape, and the second index parameter includes at least one of the following: at least one partition of the current block, the block size, and the partitioning method.

[0444] Optionally, at least one of the following can be used as an index: at least one partition of the current block, the block size, and the partitioning method. This allows for direct location of the valid boundary information of the corresponding at least one partition in the second template list.

[0445] Optionally, at least one template and / or template type can be determined or obtained based on the second template list.

[0446] Optionally, at least one template and / or template type can be determined or obtained based on at least one partition of the current block, the block size and the partitioning method, and the second template list.

[0447] Optionally, the valid boundary information of at least one partition is used to describe which positions in the template belong to the valid reference samples of the current partition, and / or to characterize the actual contact between the physical boundary of at least one partition and the current block, thereby providing a reliable basis for the selection of template and / or template type.

[0448] Optionally, the effective boundary information of at least one partition includes: the effective reference pixel distribution information of at least one partition in the template, such as the coordinate parameters of the effective reference pixel distribution range, the value of which can affect the selection of the template and / or template type.

[0449] Optionally, the valid boundary information of at least one partition includes at least one of the following: invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0450] Optionally, the valid boundary information of at least one partition can be any one of invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0451] Optionally, the processing method includes at least one of the following:

[0452] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0453] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0454] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0455] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0456] Optionally, the effective reference pixel distribution information in the effective boundary information of at least one partition includes at least one of the following:

[0457] The top start position information (top_start) represents the horizontal coordinate (x value) of the first valid reference pixel belonging to this partition in the upper row template of the current block;

[0458] The top end position information (top_end) represents the horizontal coordinate (x value) of the last valid reference pixel belonging to this partition in the row template above the current block;

[0459] The left start position information (left_start) represents the vertical coordinate (y value) of the first valid reference pixel belonging to this partition in the left column template of the current block;

[0460] The left end position information (left_end) represents the vertical coordinate (y value) of the last valid reference pixel belonging to this partition in the left column template of the current block;

[0461] Invalid value: If there is no valid reference pixel for a certain boundary (i.e., the entire row and / or the entire column mask is zero), the corresponding parameter is marked as invalid (e.g., -1).

[0462] Optionally, based on the valid boundary information of at least one partition, the valid reference pixel range in the template related to at least one partition is determined or obtained.

[0463] Referring to Figure 12, the current block includes: partition 0 and partition 1. The effective boundary information of partition 0 is determined or obtained based on the template pixel partition information, including: top_start = 0, top_end = 3, left_start = 0, left_end = 8, and / or the effective boundary information of partition 1 includes: top_start = 5, top_end = 7, left_start = left_end = -1. Based on the effective boundary information of at least one partition, it can be quickly determined that partition 0 is in contact with the left and top boundaries of the current block, and / or the effective reference pixel range related to partition 0 in the template is a continuous pixel position from horizontal index 0 to horizontal index 3, and a continuous pixel position from vertical index 0 to vertical index 8. Partition 1 is only in contact with the top boundary of the current block, and / or the effective reference pixel range related to partition 1 in the template is a continuous pixel position from horizontal index 5 to horizontal index 7. Based on this, at least one of the following is determined or obtained: the template type of partition 0 and / or the current template is a top-left combined template, and the template type of partition 1 and / or the current template is a top template.

[0464] Optionally, based on the mask information output by the GPM module, a second template list can be determined or obtained. The second template list can be indexed by multidimensional encoding parameters and output at least one effective boundary information of a partition. Based on the effective boundary information of at least one partition, the effective reference pixel range of at least one partition in the template can be determined or obtained.

[0465] Alternatively, in reference software compliant with the H.266 / VVC standard (such as HHI ECM), all supported coding unit configurations can be traversed, including at least one of the following:

[0466] Encoding unit size: Width w and height h are taken from the set {8, 16, 32, 64};

[0467] The splitting method (splitdir) includes the splitting angle and displacement offset;

[0468] Partition identifier, part∈{Part 0,Part 1}.

[0469] Optionally, during operation, the original mask corresponding to each (w,h,splitdir,part) combination can be output. The original mask is a binary signal used to identify the pixel area covered by at least one partition under the GPM geometric division.

[0470] Optionally, the original mask includes the mask values ​​of pixels inside the CU and / or template pixels in the current template.

[0471] Alternatively, the original mask can be post-processed using a Python script, performing the following scanning algorithm for each (w,h,splitdir,part) combination:

[0472] Top boundary scan: Iterate through all w pixel positions in the template row above (horizontal index from 0 to w-1), find pixels with valid mask values, record the horizontal index of the first valid reference pixel as top_start, and the horizontal index of the last valid reference pixel as top_end;

[0473] Left boundary scan: Traverse all h pixel positions in the left template column (horizontal index from 0 to h-1), find pixels with valid mask values, record the vertical index of the first valid reference pixel as left_start, and the vertical index of the last valid reference pixel as left_end;

[0474] Null value handling: If there are no valid reference pixels in the template row above, set both top_start and top_end to predefined invalid values ​​(e.g., -1). If there are no valid reference pixels in the template column on the left, set both top_start and top_end to predefined invalid values ​​(e.g., -1).

[0475] Optionally, the above quadruple (top_start, top_end, left_start, left_end) can be used as table entries and stored in a pre-built array structure according to the five-dimensional index (w, h, angle, distance, part) to form a second template list.

[0476] Optionally, the second template list can be determined or obtained in the encoder and / or decoder through a table lookup operation to determine or obtain the valid boundary information of at least one partition.

[0477] In this embodiment, the second template list can integrate multi-dimensional information such as block size, division method, and partition to determine or obtain the effective boundary information of at least one partition, and based on this, determine or obtain at least one template. The above method can avoid the template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, and ensure that the obtained template has the same effective reference pixel distribution as at least one partition of the current block, thereby improving the prediction accuracy for at least one partition.

[0478] Third Embodiment

[0479] Based on any of the above embodiments, a third embodiment is proposed.

[0480] In this embodiment, the method of determining or obtaining at least one template includes at least one of the following methods b1 to b6:

[0481] Method b1: Based on the division angle and the first displacement offset determined or obtained through displacement offset and offset adjustment, at least one template is determined or obtained.

[0482] Optionally, the offset adjustment is a correction factor introduced to compensate for the boundary availability deviation caused by the proportional imbalance of non-square and / or large blocks during geometric division. It can adapt the idealized division model (usually based on square and / or zero offset assumptions) to the actual geometric characteristics of the current block, thereby more realistically reflecting the actual exposed boundary length of the partition on the top and / or left.

[0483] Optionally, the offset adjustment amount is determined or obtained based on the current block size. Optionally, the block size is: width, height, aspect ratio, perimeter and / or area.

[0484] Optionally, the offset adjustment amount is determined or obtained based on the current block size and the first adjustment amount list, which stores the offset adjustment amounts corresponding to different block sizes.

[0485] Optionally, the segmentation angle refers to the angular parameter used to define the direction of the segmentation line. It is usually represented by a predefined set of discrete angles (e.g., 32 or 64 angles are supported in VVC / H.266, covering the range from 0° to 180°). This angle determines the tilt direction of the segmentation line, thereby controlling the geometry of the partition. For example, 0° corresponds to vertical segmentation, 90° corresponds to horizontal segmentation, and 45° or 135° corresponds to diagonal segmentation. The segmentation angle reflects the direction of the dominant edge or motion boundary in the image content and is a key basis for determining the template shape and / or prediction strategy.

[0486] Optionally, displacement offset refers to the amount of translation of the dividing line relative to the center and / or standard position of the block at a given dividing angle. It is used to fine-tune the specific position of the dividing line so that the area ratio of the partition can adapt to local content features (such as when a small object is located in a corner, a partition can be shrunk by offset to accurately cover the target area). Displacement offset is usually expressed in integer units and its value range is limited in the standard coordinate system (such as -7 to +7). The larger its absolute value, the more the division is biased to one side of the block.

[0487] Optionally, the first displacement offset is a new offset obtained by correcting the original offset (i.e., displacement offset) in the original GPM partitioning parameters by an offset adjustment amount.

[0488] Optionally, based on the division angle and the first displacement offset determined or obtained through displacement offset and offset adjustment, at least one template is determined or obtained, and based on the at least one template, the prediction result of at least one partition of the current block is determined or obtained.

[0489] Optionally, the offset adjustment amount is determined or obtained based on the block size of the current block, the first displacement offset is determined or obtained based on the offset adjustment amount and the displacement offset, the template type is determined or obtained based on the partition angle and the first displacement offset, at least one template is determined or obtained based on the template type, and the prediction result of at least one partition of the current block is determined or obtained based on the at least one template.

[0490] Optionally, based on the template type, the current template is determined or obtained, and based on the current template, the prediction result of at least one partition of the current block is determined or obtained.

[0491] Optionally, a reference template is determined or obtained based on the template type, and the prediction result of at least one partition of the current block is determined or obtained based on the reference template.

[0492] Optionally, a reference template is determined or obtained based on the current template, and the prediction result of at least one partition of the current block is determined or obtained based on the reference template.

[0493] Optionally, at least one template determined or obtained according to the template type includes: the top template (which contains only the top pixels of the current block if it is the current template), the left template (which contains the left pixels of the current block if it is the current template), and / or the top-left combined template (which contains both the top and left pixels of the current block if it is the current template).

[0494] Optionally, the at least one template determined or obtained by the above method includes: the current template and / or the reference template; optionally, the template type includes: template shape.

[0495] Optionally, since the original offset (i.e. displacement offset) of GPM is usually defined in a normalized coordinate system (such as a 64×64 unit grid), when applied to the current block of different sizes and / or aspect ratios, the physical boundary position corresponding to the same offset value will be distorted. For example, in a 16×64 vertical strip block, the original offset "0" may make a partition almost completely without the top pixel, while in a 64×16 horizontal strip block, there may be no left pixel. Therefore, the offset adjustment amount can be determined or obtained based on the actual width (W) and height (H) of the current block to perform scale normalization and / or geometric compensation on the offset.

[0496] In this embodiment, the traditional GPM mode typically determines or obtains the template shape and / or template based on the partition angle-offset mapping table, without considering the influence of the current block size (e.g., width, height, and / or aspect ratio) on the partitioning method. This can easily lead to the selection of mismatched templates under non-square blocks (e.g., 32×8, 8×32) and / or large offset partitioning (e.g., incorrectly enabling the left template in a narrow and tall block when there are actually not enough pixels on the left), resulting in template content distortion and / or missing content. However, the embodiment of this application determines or obtains the offset adjustment amount by the block size, so that the new offset (i.e., the first displacement offset) more accurately represents the effective exposed area of ​​the partition in the neighborhood, improves the matching degree between the determined or obtained template shape and at least one partition of the current block, avoids interference from invalid pixels, and thus improves the prediction accuracy of the partition.

[0497] Method b2: Determine or obtain at least one template based on at least one of the template types determined or obtained through at least one partition of the current block, the block size, and the partitioning method;

[0498] Optionally, the template type is determined or obtained based on at least one of the following: at least one partition of the current block, block size, and partitioning method. The template type includes: template shape.

[0499] Optionally, depending on the template type, at least one template is determined or obtained, including: the current template and / or a reference template.

[0500] Optionally, based on at least one template, the prediction result of at least one partition of the current block can be determined or obtained.

[0501] Optionally, based on the template type, the current template is determined or obtained, a reference template is determined or obtained based on the current template, and the prediction result of at least one partition of the current block is determined or obtained based on the reference template.

[0502] Optionally, the template type can be dynamically determined by at least one of the following: at least one partition of the current block, the block size, and the partitioning method.

[0503] Optionally, the contact relationship between the effective pixels (i.e., the area with non-zero mask weight) of at least one partition in the current block and the physical boundary of the current block is determined or obtained by at least one of the partitions of the current block, the block size, and the partitioning method. The contact relationship includes whether the pixels are in contact with the upper row boundary and / or the left column boundary of the current block.

[0504] Optionally, the method for determining or obtaining the template type based on the contact relationship includes at least one of the following:

[0505] If at least one partition touches the top row boundary of the preceding block, then the template type is the first type (e.g., the top template);

[0506] If at least one partition touches the left column boundary of the preceding block, the template type is type 2 (e.g., left template).

[0507] If at least one partition touches the top row boundary and left column boundary of the preceding block, the template type is type 3 (e.g., top left combined template).

[0508] If at least one partition does not touch the top row boundary and left column boundary of the preceding block, the template type is type 3 (e.g., top left combined template).

[0509] Optionally, the effective pixels of a partition (i.e., the region where the mask weight is not zero) refer to the set of actual pixel positions belonging to a certain sub-partition (such as Part0 or Part1) after the current coding unit is geometrically divided.

[0510] Optionally, the effective pixels of a partition represent the shape and coverage of the partition in the CU space.

[0511] In this embodiment, since the block size of the current block (e.g., width, height, and / or aspect ratio) may affect the template type adapted to different partitions of the current block, and the partitioning method of the current block defines the geometric contour of at least one partition of the current block and / or its contact relationship with the boundary of the current block, the template type matching at least one partition can be determined or obtained based on at least one of the at least one partition of the current block, the block size, and the partitioning method, and at least one template can be determined or obtained based on the template type, thereby improving the prediction accuracy of the partition.

[0512] Method b3: Determine or obtain at least one template based on the template type determined or obtained from the first template list;

[0513] Optionally, a template type is determined or obtained based on the first template list, and at least one template is determined or obtained based on the template type.

[0514] Optionally, based on at least one template, the prediction result of at least one partition of the current block can be determined or obtained.

[0515] Optionally, at least one template may include: the current template and / or a reference template.

[0516] Optionally, based on the template type, the current template is determined or obtained, a reference template is determined or obtained based on the current template, and the prediction result of at least one partition of the current block is determined or obtained based on the reference template.

[0517] Optionally, the first template list can be a preset or dynamically determined or generated template type selection list. Each item in the first template list corresponds to a specific template type (such as the top template, the left template, or the top-left combined template). The first template list can be accessed by indexing the first index parameter, thereby outputting the template type that matches the first index parameter.

[0518] Optionally, the first template list includes: at least one first index parameter and / or at least one template type corresponding to the first index parameter.

[0519] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0520] Optionally, at least one of the following: the current block's partition, block size, and partitioning method can be used as an index to directly locate the corresponding template type in the first template list. The template type includes the template shape.

[0521] Optionally, the template type is determined or obtained based on at least one of the following: at least one partition of the current block, the block size, and the partitioning method, as well as the first template list.

[0522] Optionally, the method for determining or obtaining the first template list includes at least one of the following:

[0523] Based on at least one partition of the current block, the block size and the combination of partitioning methods and their corresponding mask information, determine or obtain the first template list;

[0524] Based on at least one partition of the current block, the block size and the combination of partitioning methods and their corresponding template pixel partitioning information, determine or obtain the first template list;

[0525] Based on the combination of at least one partition of the current block, the block size and the partitioning method, and the valid boundary information of the corresponding at least one partition, determine or obtain the first template list.

[0526] In this embodiment, the first template list can integrate multi-dimensional information such as block size, division method, and partition, avoiding template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods. This ensures that the obtained template has the same effective reference pixel distribution as at least one partition of the current block, improving the prediction accuracy for at least one partition. And / or, at least one template can be determined or obtained with only one index access through the first template list, without performing complex processing steps, thus reducing computational complexity.

[0527] Method b4: Determine or obtain at least one template based on the valid boundary information of at least one partition determined or obtained through the second template list;

[0528] Optionally, the second template list can be a preset or dynamically determined or generated list of valid template regions. Each item in the second template list corresponds to the valid boundary information of a partition. The second template list can be indexed and accessed through the second index parameter, thereby outputting the valid boundary information of at least one partition that matches the second index parameter.

[0529] Optionally, the second template list includes: at least one second index parameter and / or valid boundary information of at least one partition corresponding to at least one second index parameter.

[0530] Optionally, at least one template can be determined or obtained based on the valid boundary information of at least one partition.

[0531] Optionally, based on the valid boundary information of at least one partition, a template type is determined or obtained, and at least one template is determined or obtained based on the template type.

[0532] Optionally, based on at least one template, the prediction result of at least one partition of the current block can be determined or obtained.

[0533] Optionally, at least one template may include: the current template and / or a reference template.

[0534] Optionally, the current template can be determined or obtained based on the template type, and a reference template can be determined or obtained based on the current template.

[0535] Optionally, the template type includes a template shape, and the second index parameter includes at least one of the following: at least one partition of the current block, the block size, and the partitioning method.

[0536] Optionally, at least one of the following can be used as an index: at least one partition of the current block, the block size, and the partitioning method. This allows for direct location of the valid boundary information of the corresponding at least one partition in the second template list.

[0537] Optionally, at least one template and / or template type can be determined or obtained based on at least one partition of the current block, the block size and the partitioning method, and the second template list.

[0538] Optionally, the valid boundary information of at least one partition is used to describe which positions in the template belong to the valid reference samples of the current partition, and / or to characterize the actual contact between the physical boundary of at least one partition and the current block, thereby providing a reliable basis for the selection of template and / or template type.

[0539] Optionally, the effective boundary information of at least one partition includes: the effective reference pixel distribution information of at least one partition in the template, such as the coordinate parameters of the effective reference pixel distribution range, the value of which can affect the selection of the template and / or template type.

[0540] Optionally, the valid boundary information of at least one partition includes at least one of the following: invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0541] Optionally, the valid boundary information of at least one partition can be any one of invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0542] Optionally, the processing method includes at least one of the following:

[0543] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0544] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0545] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0546] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0547] Optionally, the effective reference pixel distribution information in the effective boundary information of at least one partition includes at least one of the following:

[0548] The top start position information (top_start) represents the horizontal coordinate (x value) of the first valid reference pixel belonging to this partition in the upper row template of the current block;

[0549] Top end position information (top_end): Represents the horizontal coordinate (x value) of the last valid reference pixel belonging to this partition in the row template above the current block;

[0550] The left start position information (left_start) represents the vertical coordinate (y value) of the first valid reference pixel belonging to this partition in the left column template of the current block;

[0551] Left end position information (left_end): Represents the vertical coordinate (y value) of the last valid reference pixel belonging to this partition in the left column template of the current block;

[0552] Invalid value: If there is no valid reference pixel for a certain boundary (i.e., the entire row and / or the entire column mask is zero), the corresponding parameter is marked as invalid (e.g., -1).

[0553] Optionally, based on the valid boundary information of at least one partition, the valid reference pixel range in the template related to at least one partition is determined or obtained.

[0554] Referring to Figure 12, the current block includes: partition 0 and partition 1. The effective boundary information of partition 0 is determined or obtained based on the template pixel partition information, including: top_start = 0, top_end = 3, left_start = 0, left_end = 8, and / or the effective boundary information of partition 1 includes: top_start = 5, top_end = 7, left_start = left_end = -1. Based on the effective boundary information of at least one partition, it can be quickly determined that partition 0 is in contact with the left and top boundaries of the current block, and / or the effective reference pixel range related to partition 0 in the template is a continuous pixel position from horizontal index 0 to horizontal index 3, and a continuous pixel position from vertical index 0 to vertical index 8. Partition 1 is only in contact with the top boundary of the current block, and / or the effective reference pixel range related to partition 1 in the template is a continuous pixel position from horizontal index 5 to horizontal index 7. Based on this, at least one of the following is determined or obtained: the template type of partition 0 and / or the current template is a top-left combined template, and the template type of partition 1 and / or the current template is a top template.

[0555] Optionally, the second template list can be determined or obtained in the encoder and / or decoder through a table lookup operation to determine or obtain the valid boundary information of at least one partition.

[0556] In this embodiment, the second template list can integrate multi-dimensional information such as block size, division method, and partition to determine or obtain the effective boundary information of at least one partition, and based on this, determine or obtain at least one template. The above method can avoid the template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, and ensure that the obtained template has the same effective reference pixel distribution as at least one partition of the current block, thereby improving the prediction accuracy for at least one partition.

[0557] Method b5: Determine or obtain at least one template based on the valid boundary information of at least one partition determined or obtained through template pixel partitioning information and / or template type;

[0558] Optionally, at least one valid boundary information of a partition and / or template type can be determined or obtained based on the template pixel partition information.

[0559] Optionally, the template type can be determined or obtained based on the valid boundary information of at least one partition.

[0560] Optionally, at least one template can be determined or obtained based on the template type.

[0561] Optionally, based on at least one template, the prediction result of at least one partition of the current block can be determined or obtained.

[0562] Optionally, template pixel partitioning information refers to information used to characterize the correspondence between each pixel in the current template and at least one partition. It can reflect, for example, which pixels belong to the first partition and which pixels belong to the second partition within the template area, providing a reliable and usable basis for template construction and matching.

[0563] Optionally, the template pixel partitioning information includes: partitioning weight information, which assigns a continuous or discrete weight value to at least one pixel position in the template, indicating the degree to which it belongs to a certain partition (for example, binary weights of 0 / 1 and / or interpolated weights between 0.0 and 1.0 can be used).

[0564] Optionally, the partitioning weight information includes: mask information, which is usually a binary array, including: the mask information of the current template and / or the mask information of the current block. The mask information of the current template includes the mask value of at least one template pixel in the current template, which can identify whether at least one template pixel is geometrically connected to the partition. The mask information of the current block contains the mask value of at least one pixel in at least one partition in the current block.

[0565] Optionally, the template pixel partitioning information is determined or obtained based on at least one of the following: partitioning weight information, mask information, and mask information of the current template.

[0566] Optionally, the template pixel partitioning information includes at least one of the following: partitioning weight information, mask information, and mask information of the current template.

[0567] Optionally, the valid boundary information of at least one partition is used to describe which positions in the template belong to the valid reference samples of the current partition, and / or to characterize the actual contact between the physical boundary of at least one partition and the current block, thereby providing a reliable basis for the selection of template and / or template type.

[0568] Optionally, the effective boundary information of at least one partition includes: the effective reference pixel distribution information of at least one partition in the template, such as the coordinate parameters of the effective reference pixel distribution range, the value of which can affect the selection of the template and / or template type.

[0569] Optionally, the valid boundary information of at least one partition includes at least one of the following: invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0570] Optionally, the valid boundary information of at least one partition can be any one of invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0571] Optionally, the processing method includes at least one of the following:

[0572] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0573] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0574] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0575] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0576] Optionally, the valid reference pixel distribution information in the valid boundary information of at least one partition includes at least one of the following: top start position information (top_start), top end position information (top_end), left start position information (left_start), left end position information (left_end), and invalid values.

[0577] Optionally, based on the valid boundary information of at least one partition, the valid reference pixel range in the template related to at least one partition is determined or obtained.

[0578] Referring to Figure 12, the current block includes: partition 0 and partition 1. The effective boundary information of partition 0 is determined or obtained based on the template pixel partition information, including: top_start = 0, top_end = 3, left_start = 0, left_end = 8, and / or the effective boundary information of partition 1 includes: top_start = 5, top_end = 7, left_start = left_end = -1. Based on the effective boundary information of at least one partition, it can be quickly determined that partition 0 is in contact with the left and top boundaries of the current block, and / or the effective reference pixel range related to partition 0 in the template is a continuous pixel position from horizontal index 0 to horizontal index 3, and a continuous pixel position from vertical index 0 to vertical index 8. Partition 1 is only in contact with the top boundary of the current block, and / or the effective reference pixel range related to partition 1 in the template is a continuous pixel position from horizontal index 5 to horizontal index 7. Based on this, at least one of the following is determined or obtained: the template type of partition 0 and / or the current template is a top-left combined template, and the template type of partition 1 and / or the current template is a top template.

[0579] Optionally, the template pixel partition information can be the original mask, which typically contains the correspondence information between all pixels and partitions within the entire coding unit (CU), that is, it includes the pixel mask within the current block and the template pixel mask of the current template.

[0580] Optionally, in this embodiment, it is not necessary to access the complete original mask. Instead, it is only necessary to read the mask portion related to the current template, i.e., the mask information of the current template, to determine or obtain the effective boundary information of at least one partition, and to reliably determine at least one template accordingly, thereby reducing computational overhead.

[0581] Optionally, boundary validity can be determined based on template pixel partitioning information, and the template type can be determined or obtained based on the boundary validity determination result. At least one template can be determined or obtained based on the template type.

[0582] Optionally, for partition 0 of the current block, the current template pixels in the row above the current block can be searched based on the template pixel partition information:

[0583] For example, if there is at least one non-zero mask value (e.g., a mask value of 1), then partition 0 is determined to be in contact with the upper row.

[0584] Optionally, for partition 0 of the current block, the current template pixels in the left column of the current block can be searched based on the template pixel partition information;

[0585] For example, if there is at least one non-zero mask value (e.g., a mask value of 1), then partition 0 is determined to be in contact with the left column.

[0586] Optionally, if the boundary validity determination result is that partition 0 touches the top row and the left column, then based on the boundary validity determination result, the template type is determined or obtained as the top-left combined template.

[0587] Optionally, for partition 0 of the current block, if a certain boundary (e.g., above and / or to the left) has no valid reference pixels (i.e., the mask value is zero or empty), the boundary validity determination result is that the boundary is invalid (e.g., represented by coordinates -1).

[0588] Optionally, based on the template pixel partitioning information, the boundary validity determination result is determined or obtained, and based on the boundary validity determination result, the template type is determined or obtained.

[0589] Optionally, the method for determining or obtaining the template type based on the boundary validity determination result includes at least one of the following:

[0590] If the boundary validity determination result is that at least one partition contacts the upper row, then the template type is determined to be the upper template.

[0591] If the boundary validity determination result is that at least one partition touches the left column, then the template type is determined to be the left template.

[0592] If the boundary validity determination result is that at least one partition touches the top row and the left column, then the template type is determined to be the top-left combined template.

[0593] If the boundary validity determination result is that at least one partition does not touch the top row and the left column, then the template type is determined to be the top-left combined template.

[0594] In this embodiment, determining or obtaining at least one template based on template pixel partitioning information can eliminate the reliance on fixed angle-offset lookup table rules and directly start from the actual partitioning results. It can accurately identify the real boundary contact situation of at least one partition in a data-driven manner, thereby ensuring that the determined or obtained at least one template is consistent with the local structure of the partition and improving the prediction accuracy of the partition.

[0595] Method b6: Determine or obtain at least one reference template based on at least one current template.

[0596] Optionally, based on at least one current template, at least one reference template is determined or obtained, and based on at least one reference template, the prediction result of at least one partition of the current block is determined or obtained.

[0597] Optionally, at least one current template is determined or obtained according to at least one of methods a1 to a11 in the second embodiment.

[0598] Optionally, at least one candidate reference template is determined or obtained based on at least one current template, and at least one reference template is determined or obtained based on at least one candidate reference template.

[0599] Optionally, based on at least one current template and at least one candidate reference template, a template matching cost associated with at least one candidate reference template is determined or obtained, and based on the template matching cost associated with at least one candidate reference template, at least one reference template is determined or obtained from at least one candidate reference template.

[0600] Optionally, the method of determining or obtaining at least one candidate reference template and / or at least one reference template based on at least one current template includes at least one of the following:

[0601] Based on the template type of at least one current template, determine or obtain at least one candidate reference template and / or at least one reference template;

[0602] Based on the motion vector of at least one partition of the current template and the current block, determine or obtain at least one candidate reference template and / or at least one reference template;

[0603] Based on the motion vectors of the current template and the current block, determine or obtain at least one candidate reference template and / or at least one reference template;

[0604] Based on the current template and the block vector of at least one partition of the current block, determine or obtain at least one candidate reference template and / or at least one reference template;

[0605] Based on the current template and the block vector of the current block, determine or obtain at least one candidate reference template and / or at least one reference template.

[0606] Optionally, the template type includes a template shape, and optionally, the current template is located in the current frame, and the reference template is located in the current frame and / or the reference frame.

[0607] Optionally, the reference template determined or obtained based on the motion vector is located in the reference frame, and the reference template determined or obtained based on the block vector is located in the current frame.

[0608] Optionally, a matching position is determined or obtained based on at least one reference template, and a pixel block is determined or obtained from the reference frame based on the matching position. The pixel block has the same size and / or shape as at least one partition of the current block, and a prediction result of at least one partition is determined or obtained based on the pixel block.

[0609] Optionally, the pixel block is determined as the prediction result of at least one partition.

[0610] In this embodiment, the current template can accurately depict the edge texture direction, edge orientation, and / or local details of at least one partition to be predicted. By determining or obtaining at least one reference template through the current template, the selected reference template can be highly matched with the current template, thereby guiding the extraction of prediction blocks that match the geometry and / or visual content of at least one partition from the reference source, thereby improving the prediction accuracy of the partition.

[0611] Fourth embodiment

[0612] Based on any of the above embodiments, a fourth embodiment is proposed.

[0613] In this embodiment, the template type corresponding to at least one first index parameter is determined or obtained according to at least one of the following methods c1 to c4:

[0614] Method c1, at least one of the following: at least one partition of the current block, block size, and partitioning method;

[0615] Optionally, based on at least one of the following: at least one partition of the current block, block size, and partitioning method, the template type corresponding to at least one first index parameter is determined or obtained.

[0616] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0617] Optionally, a first template list is determined or obtained based on at least one first index parameter and / or its corresponding template type.

[0618] Optionally, the method of determining or obtaining at least one template based on the first template list may refer to method a10 in the second embodiment and / or method b3 in the third embodiment.

[0619] Optionally, based on at least one of the partition, block size, and partitioning method, the corresponding mask information is determined or obtained; at least one of the partition, block size, and partitioning method is used as the first index parameter; based on the mask information, the template type corresponding to the first index parameter is determined or obtained; and based on the first index parameter and its corresponding template type, the first template list is determined or obtained.

[0620] Optionally, based on at least one of the partition, block size, and partitioning method, the effective boundary information of the corresponding at least one partition is determined or obtained; at least one of the partition, block size, and partitioning method is used as the first index parameter; based on the effective boundary information of the at least one partition, the template type corresponding to the first index parameter is determined or obtained; and based on the first index parameter and its corresponding template type, the first template list is determined or obtained.

[0621] Optionally, based on at least one of the following: partition, block size, and division method, the corresponding template pixel partition information is determined or obtained; at least one of the following: partition, block size, and division method is used as a first index parameter; based on the template pixel partition information, the template type corresponding to the first index parameter is determined or obtained; and based on the first index parameter and its corresponding template type, a first template list is determined or obtained.

[0622] Optionally, during codec operation, all supported CU widths and heights h (e.g., w, h ∈ {8, 16, 32, 64}) are traversed, and for each (w, h) combination, all predefined partitioning methods (including partitioning angle and displacement offset) combinations are traversed. For each (w, h, angle, distance) combination, a pixel weighted mask map of the GPM output is captured in real time. This mask map identifies which sub-partition each pixel in the current CU belongs to. For example, Part0 (first partition) is defined as the region with a mask value of 1, and Part1 (second partition) is defined as the region with a mask value of 0.

[0623] Optionally, the method for determining or generating the first template list based on the mask information includes: for each of the above mask images, determining the valid boundary information of Part0 and Part1, determining the template shape corresponding to at least one five-dimensional index (w, h, angle, distance) based on the valid boundary information, and storing it in the list to obtain the first template list.

[0624] Optionally, the method for determining the template shape corresponding to at least one five-dimensional index (w, h, angle, distance) based on the valid boundary information includes at least one of the following:

[0625] If a valid reference pixel of a certain partition (i.e., the area with a non-zero mask weight) only appears at the upper row boundary of the CU, then its template shape is set to the upper template.

[0626] If the valid reference pixels of a certain partition only appear on the left column boundary of the CU, then its template shape is set to the left template.

[0627] If a valid reference pixel of a certain partition appears at the top row boundary and the left column boundary of the CU, then its template shape is set to the top left combined template.

[0628] If a partition has no valid reference pixels at the top row boundary and left column boundary of the CU, then its template shape is set to the original GPM template shape.

[0629] In this embodiment, based on at least one of the following: at least one partition of the current block, block size, and partitioning method, at least one template type corresponding to a first index parameter is determined or obtained to construct a first template list. This first template list can integrate multi-dimensional information such as block size, partitioning method, and partitioning, avoiding template misjudgment caused by ignoring factors such as block size in traditional methods under non-square blocks and / or large offsets, thereby improving the prediction accuracy for at least one partition.

[0630] Method c2, which determines or obtains at least one effective boundary information of a partition and / or template type through template pixel partition information;

[0631] Optionally, based on the effective boundary information of at least one partition determined or obtained through template pixel partitioning information, the template type corresponding to at least one first index parameter is determined or obtained.

[0632] Optionally, based on the template type determined or obtained through template pixel partitioning information, at least one template type corresponding to a first index parameter is determined or obtained.

[0633] Optionally, at least one effective boundary information of a partition is determined or obtained based on the template pixel partition information, the template type is determined or obtained based on the effective boundary information of the at least one partition, and the template type corresponding to at least one first index parameter is determined or obtained based on the template type.

[0634] Optionally, the template pixel partitioning information is determined or obtained based on at least one of the following: at least one partition of the current block, at least one of the block size and partitioning method, partitioning weight information, mask information, and mask information of the current template.

[0635] Optionally, the template pixel partitioning information includes at least one of the following: partitioning weight information, mask information, and mask information of the current template.

[0636] Optionally, template pixel partitioning information refers to information used to characterize the correspondence between each pixel in the current template and at least one partition. It can reflect, for example, which pixels belong to the first partition and which pixels belong to the second partition within the template area, providing a reliable and usable basis for template construction and matching.

[0637] Optionally, boundary validity can be determined based on template pixel partition information, and based on the boundary validity determination result, at least one valid boundary information and / or template type can be determined or obtained.

[0638] Optionally, based on the template pixel partitioning information, the boundary validity determination result is determined or obtained, and based on the boundary validity determination result, the template type is determined or obtained.

[0639] Optionally, the method for determining or obtaining the template type based on the boundary validity determination result includes at least one of the following:

[0640] If the boundary validity determination result is that at least one partition contacts the upper row, then the template type is determined to be the upper template.

[0641] If the boundary validity determination result is that at least one partition touches the left column, then the template type is determined to be the left template.

[0642] If the boundary validity determination result is that at least one partition touches the top row and the left column, then the template type is determined to be the top-left combined template.

[0643] If the boundary validity determination result is that at least one partition does not touch the top row and the left column, then the template type is determined to be the top-left combined template.

[0644] Optionally, the valid boundary information of at least one partition is used to describe which positions in the template belong to the valid reference samples of the current partition, and / or to characterize the actual contact between the physical boundary of at least one partition and the current block, thereby providing a reliable basis for the selection of template and / or template type.

[0645] Optionally, the effective boundary information of at least one partition includes: the effective reference pixel distribution information of at least one partition in the template, such as the coordinate parameters of the effective reference pixel distribution range, the value of which can affect the selection of the template and / or template type.

[0646] Optionally, the valid boundary information of at least one partition includes at least one of the following: invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0647] Optionally, the valid boundary information of at least one partition can be any one of invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0648] Optionally, the processing method includes at least one of the following:

[0649] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0650] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0651] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0652] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0653] Optionally, the effective reference pixel distribution information in the effective boundary information of at least one partition includes at least one of the following:

[0654] The top start position information (top_start) represents the horizontal coordinate (x value) of the first valid reference pixel belonging to this partition in the upper row template of the current block;

[0655] Top end position information (top_end): Represents the horizontal coordinate (x value) of the last valid reference pixel belonging to this partition in the row template above the current block;

[0656] The left start position information (left_start) represents the vertical coordinate (y value) of the first valid reference pixel belonging to this partition in the left column template of the current block;

[0657] Left end position information (left_end): Represents the vertical coordinate (y value) of the last valid reference pixel belonging to this partition in the left column template of the current block;

[0658] Invalid value: If there is no valid reference pixel for a certain boundary (i.e., the entire row and / or the entire column mask is zero), the corresponding parameter is marked as invalid (e.g., -1).

[0659] Optionally, based on the valid boundary information of at least one partition, the valid reference pixel range in the template related to at least one partition is determined or obtained.

[0660] Optionally, the template type is determined or obtained based on the valid reference pixel range associated with at least one partition in the template, and the template type corresponding to at least one first index parameter is determined or obtained based on the template type.

[0661] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0662] Optionally, a first template list is determined or obtained based on at least one first index parameter and / or its corresponding template type.

[0663] Optionally, the method of determining or obtaining at least one template based on the first template list may refer to method a10 in the second embodiment and / or method b3 in the third embodiment.

[0664] Optionally, the method for determining or obtaining the template type based on the valid boundary information of at least one partition includes at least one of the following:

[0665] If the valid boundary information of at least one partition includes: the top start position information (top_start) and / or the top end position information (top_end), then the template type is determined or obtained as the top template;

[0666] If the valid boundary information of at least one partition includes: left start position information (left_start) and / or left end position information (left_end), then the template type is determined or obtained as a left template;

[0667] If the valid boundary information of at least one partition includes: top start position information (top_start) and / or top end position information (top_end), and left start position information (left_start) and / or left end position information (left_end), then the template type is determined or obtained as the top-left combined template;

[0668] If at least one partition's valid boundary information is invalid, then the template type is determined to be the top-left combined template.

[0669] In this embodiment, based on the effective boundary information of at least one partition and / or the template type determined or obtained through template pixel partition information, at least one template type corresponding to a first index parameter is determined or obtained to construct a first template list. This allows the first template list to store template types that are more compatible with at least one partition, avoiding template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, and improving the prediction accuracy for at least one partition.

[0670] Method c3: Valid boundary information of at least one partition determined or obtained through the second template list;

[0671] Optionally, based on the valid boundary information of at least one partition determined or obtained through the second template list, the template type corresponding to at least one first index parameter is determined or obtained.

[0672] Optionally, based on the valid boundary information of at least one partition, the template type is determined or obtained, and based on the template type, the template type corresponding to at least one first index parameter is determined or obtained.

[0673] Optionally, the second template list can be a preset or dynamically determined or generated list of valid template regions. Each item in the second template list corresponds to the valid boundary information of a partition. The second template list can be indexed and accessed through the second index parameter, thereby outputting the valid boundary information of at least one partition that matches the second index parameter.

[0674] Optionally, the second template list includes: at least one second index parameter and / or valid boundary information of at least one partition corresponding to at least one second index parameter.

[0675] Optionally, the valid boundary information of at least one partition is used to describe which positions in the template belong to the valid reference samples of the current partition, and / or to characterize the actual contact between the physical boundary of at least one partition and the current block, thereby providing a reliable basis for the selection of template and / or template type.

[0676] Optionally, the effective boundary information of at least one partition includes: the effective reference pixel distribution information of at least one partition in the template, such as the coordinate parameters of the effective reference pixel distribution range, the value of which can affect the selection of the template and / or template type.

[0677] Optionally, the valid boundary information of at least one partition includes at least one of the following: invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0678] Optionally, the valid boundary information of at least one partition can be any one of invalid boundary information, upper boundary information, left boundary information, and upper left boundary information.

[0679] Optionally, the processing method includes at least one of the following:

[0680] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0681] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0682] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0683] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0684] Optionally, the effective reference pixel distribution information in the effective boundary information of at least one partition includes at least one of the following:

[0685] The top start position information (top_start) represents the horizontal coordinate (x value) of the first valid reference pixel belonging to this partition in the upper row template of the current block;

[0686] The top end position information (top_end) represents the horizontal coordinate (x value) of the last valid reference pixel belonging to this partition in the row template above the current block;

[0687] The left start position information (left_start) represents the vertical coordinate (y value) of the first valid reference pixel belonging to this partition in the left column template of the current block;

[0688] The left end position information (left_end) represents the vertical coordinate (y value) of the last valid reference pixel belonging to this partition in the left column template of the current block;

[0689] Invalid value: If there is no valid reference pixel for a certain boundary (i.e., the entire row and / or the entire column mask is zero), the corresponding parameter is marked as invalid (e.g., -1).

[0690] Optionally, based on the valid boundary information of at least one partition, the valid reference pixel range in the template related to at least one partition is determined or obtained.

[0691] Optionally, the template type is determined or obtained based on the valid reference pixel range associated with at least one partition in the template, and the template type corresponding to at least one first index parameter is determined or obtained based on the template type.

[0692] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0693] Optionally, a first template list is determined or obtained based on at least one first index parameter and / or its corresponding template type.

[0694] Optionally, the method of determining or obtaining at least one template based on the first template list may refer to method a10 in the second embodiment and / or method b3 in the third embodiment.

[0695] Optionally, the method for determining or obtaining the template type based on the valid boundary information of at least one partition includes at least one of the following:

[0696] If the valid boundary information of at least one partition includes: the top start position information (top_start) and / or the top end position information (top_end), then the template type is determined or obtained as the top template;

[0697] If the valid boundary information of at least one partition includes: left start position information (left_start) and / or left end position information (left_end), then the template type is determined or obtained as a left template;

[0698] If the valid boundary information of at least one partition includes: top start position information (top_start) and / or top end position information (top_end), and left start position information (left_start) and / or left end position information (left_end), then the template type is determined or obtained as the top-left combined template;

[0699] If at least one partition's valid boundary information is invalid, then the template type is determined to be the top-left combined template.

[0700] In this embodiment, based on the valid boundary information of at least one partition determined or obtained through the second template list, the template type corresponding to at least one first index parameter is determined or obtained to construct a first template list. This allows the first template list to store template types that are more compatible with at least one partition, avoiding template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, and improving the prediction accuracy for at least one partition.

[0701] Method c4, first template type.

[0702] Optionally, based on the first template type, at least one template type corresponding to the first index parameter can be determined or obtained.

[0703] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0704] Optionally, a first template list is determined or obtained based on at least one first index parameter and / or its corresponding template type.

[0705] Optionally, the method of determining or obtaining at least one template based on the first template list may refer to method a10 in the second embodiment and / or method b3 in the third embodiment.

[0706] Optionally, the first template type can be a pre-set default template type, such as a fixed template type obtained by looking up a table based on the division angle and partition identifier in the traditional GPM standard (e.g., Part0 uses the top template or the top left combined template by default, and Part1 uses the left template or the top left combined template by default).

[0707] Optionally, if the valid boundary information of at least one partition is invalid, it indicates that the partition has no valid reference pixels in the upper row and left column of the current template. In this case, it is difficult to determine the template shape through the valid boundary information. To ensure the robustness of encoding and decoding, the template type corresponding to at least one first index parameter can be determined or obtained according to the first template type.

[0708] In this embodiment, by determining or obtaining the template type corresponding to at least one first index parameter through the first template type, a fallback strategy compatible with traditional standards can be introduced to avoid template loss problems caused by extreme partitions and / or boundary conditions, and / or maintain syntactic consistency with traditional GPM, thereby improving the prediction accuracy for at least one partition.

[0709] Optionally, based on the valid boundary information of at least one partition, the template type corresponding to at least one first index parameter is determined or obtained, including at least one of the following methods d1 to d3:

[0710] In method d1, if the valid boundary information of at least one partition satisfies the first condition, then the template type corresponding to at least one first index parameter is the first type;

[0711] Optionally, satisfying the first condition includes at least one of the following:

[0712] At least one partition's valid boundary information is invalid boundary information;

[0713] At least one partition's valid boundary information is its upper boundary information;

[0714] At least one partition's valid boundary information is its left boundary information;

[0715] At least one partition's valid boundary information is the top-left boundary information;

[0716] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper boundary of the current block;

[0717] At least one valid reference pixel in the valid boundary information of a partition is distributed at the left boundary of the current block;

[0718] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper left boundary of the current block.

[0719] Optionally, the first type includes at least one of the top template, the left template, and the top-left combined template.

[0720] Optionally, the template determined or obtained according to the first type includes at least one of the following: the top template, the left template, and the top-left combined template.

[0721] Optionally, the processing method further includes at least one of the following:

[0722] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0723] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0724] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0725] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0726] Optionally, if the valid boundary information of at least one partition satisfies the first condition, then the template type corresponding to at least one first index parameter is the first type. The first condition includes: the valid boundary information of at least one partition is the upper boundary information, and / or the valid reference pixels in the valid boundary information of at least one partition are distributed at the upper boundary of the current block, and the first type and / or the template determined or obtained according to the first type is the upper template.

[0727] Optionally, depending on the template type, the method for determining or obtaining at least one template can refer to method a4 in the second embodiment.

[0728] In this embodiment, the above method can avoid the template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, thereby improving the prediction accuracy for at least one partition.

[0729] In method d2, if the valid boundary information of at least one partition satisfies the second condition, then the template type corresponding to at least one first index parameter is the second type.

[0730] Optionally, satisfying the second condition includes at least one of the following:

[0731] At least one partition's valid boundary information is invalid boundary information;

[0732] At least one partition's valid boundary information is its upper boundary information;

[0733] At least one partition's valid boundary information is its left boundary information;

[0734] At least one partition's valid boundary information is the top-left boundary information;

[0735] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper boundary of the current block;

[0736] At least one valid reference pixel in the valid boundary information of a partition is distributed at the left boundary of the current block;

[0737] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper left boundary of the current block.

[0738] Optionally, the second type includes at least one of the top template, the left template, and the top-left combined template.

[0739] Optionally, the template determined or obtained according to the second type includes at least one of the following: the top template, the left template, and the upper left combined template.

[0740] Optionally, the processing method further includes at least one of the following:

[0741] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0742] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0743] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0744] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0745] Optionally, if the valid boundary information of at least one partition satisfies the second condition, then the template type corresponding to at least one first index parameter is the second type. The second condition includes: the valid boundary information of at least one partition is left boundary information, and / or the valid reference pixels in the valid boundary information of at least one partition are distributed on the left boundary of the current block, and the second type and / or the template determined or obtained according to the second type is the left template.

[0746] Optionally, depending on the template type, the method for determining or obtaining at least one template can refer to method a4 in the second embodiment.

[0747] In this embodiment, the above method can avoid the template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, thereby improving the prediction accuracy for at least one partition.

[0748] In method d3, if the valid boundary information of at least one partition satisfies the third condition, then the template type corresponding to at least one first index parameter is the third type.

[0749] Optionally, satisfying the third condition includes at least one of the following:

[0750] At least one partition's valid boundary information is invalid boundary information;

[0751] At least one partition's valid boundary information is its upper boundary information;

[0752] At least one partition's valid boundary information is its left boundary information;

[0753] At least one partition's valid boundary information is the top-left boundary information;

[0754] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper boundary of the current block;

[0755] At least one valid reference pixel in the valid boundary information of a partition is distributed at the left boundary of the current block;

[0756] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper left boundary of the current block.

[0757] Optionally, the third type includes at least one of the top template, the left template, and the top-left combined template.

[0758] Optionally, the template determined or obtained according to the third type includes at least one of the following: the top template, the left template, and the top-left combined template.

[0759] Optionally, the processing method further includes at least one of the following:

[0760] If the effective boundary information of at least one partition is the upper boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary.

[0761] If the effective boundary information of at least one partition is the left boundary information, it means that the effective reference pixels of at least one partition are distributed in the left boundary.

[0762] If the effective boundary information of at least one partition is the upper left boundary information, it means that the effective reference pixels of at least one partition are distributed in the upper boundary and the left boundary, and / or the effective reference pixels of at least one partition are distributed in the upper left boundary;

[0763] If the valid boundary information of at least one partition is invalid boundary information, it means that the valid reference pixels of at least one partition are not distributed in the upper and left boundaries, and / or the valid reference pixels of at least one partition are not distributed in the upper left boundary.

[0764] Optionally, if the valid boundary information of at least one partition satisfies the third condition, then the template type corresponding to at least one first index parameter is the third type. The third condition includes at least one of the following: the valid boundary information of at least one partition is the upper left boundary information; the valid reference pixels in the valid boundary information of at least one partition are distributed at the upper left boundary of the current block; the valid boundary information of at least one partition is the invalid boundary information; and the template determined or obtained according to the third type is the upper left combined template.

[0765] Optionally, depending on the template type, the method for determining or obtaining at least one template can refer to method a4 in the second embodiment.

[0766] In this embodiment, the above method can avoid the template misjudgment caused by ignoring factors such as block size under non-square blocks and / or large offsets in traditional methods, thereby improving the prediction accuracy for at least one partition.

[0767] Optionally, the effective boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained according to the following methods f1 and / or f2:

[0768] Method f1, at least one of the following: at least one partition of the current block, block size, and partitioning method;

[0769] Optionally, based on at least one of the following: at least one partition of the current block, block size, and partitioning method, the effective boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained.

[0770] Optionally, the second index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0771] Optionally, a second template list is determined or obtained based on at least one second index parameter and / or the valid boundary information of at least one corresponding partition.

[0772] Optionally, the method of determining or obtaining at least one template based on the second template list may refer to method a11 in the second embodiment and / or method b4 in the third embodiment.

[0773] Optionally, based on at least one of the partition, block size, and partitioning method, the corresponding mask information is determined or obtained; at least one of the partition, block size, and partitioning method is used as the second index parameter; based on the mask information, the effective boundary information of the at least one partition corresponding to the second index parameter is determined or obtained; and based on the second index parameter and the effective boundary information of the at least one partition corresponding to it, the second template list is determined or obtained.

[0774] Optionally, based on at least one of the partition, block size, and partitioning method, the effective boundary information of the corresponding at least one partition is determined or obtained. At least one of the partition, block size, and partitioning method is used as a second index parameter. Based on the effective boundary information of the at least one partition, the effective boundary information of the at least one partition corresponding to the second index parameter is determined or obtained. Based on the second index parameter and the effective boundary information of the corresponding at least one partition, a second template list is determined or obtained.

[0775] Optionally, based on at least one of the following: a partition, a block size, and a partitioning method, the corresponding template pixel partition information is determined or obtained; at least one of the following: a partition, a block size, and a partitioning method is used as a second index parameter; based on the template pixel partition information, the effective boundary information of the at least one partition corresponding to the second index parameter is determined or obtained; and based on the second index parameter and the effective boundary information of the at least one partition corresponding to it, the second template list is determined or obtained.

[0776] Optionally, the effective boundary information of at least one partition corresponding to at least one second index parameter can be determined or obtained based on the mask information output by the GPM module, which is determined or obtained through at least one partition of the current block, the block size, and the partitioning method.

[0777] Alternatively, in reference software compliant with the H.266 / VVC standard (such as HHI ECM), all supported coding unit configurations can be traversed, including at least one of the following:

[0778] Encoding unit size: Width w and height h are taken from the set {8, 16, 32, 64};

[0779] The splitting method (splitdir) includes the splitting angle and displacement offset;

[0780] Partition identifier, part∈{Part 0,Part 1}.

[0781] Optionally, during operation, the original mask corresponding to each (w,h,splitdir,part) combination can be output. The original mask is a binary signal used to identify the pixel area covered by at least one partition under the GPM geometric division.

[0782] Optionally, the original mask includes the mask values ​​of pixels inside the CU and / or template pixels in the current template.

[0783] Alternatively, the original mask can be post-processed using a Python script, performing the following scanning algorithm for each (w,h,splitdir,part) combination:

[0784] Top boundary scan: Iterate through all w pixel positions in the template row above (horizontal index from 0 to w-1), find pixels with valid mask values, record the horizontal index of the first valid reference pixel as top_start, and the horizontal index of the last valid reference pixel as top_end;

[0785] Left boundary scan: Traverse all h pixel positions in the left template column (horizontal index from 0 to h-1), find pixels with valid mask values, record the vertical index of the first valid reference pixel as left_start, and the vertical index of the last valid reference pixel as left_end;

[0786] Null value handling: If there are no valid reference pixels in the template row above, set both top_start and top_end to predefined invalid values ​​(e.g., -1). If there are no valid reference pixels in the template column on the left, set both top_start and top_end to predefined invalid values ​​(e.g., -1).

[0787] Optionally, the above quadruple (top_start, top_end, left_start, left_end) is used as a table entry (i.e., the effective boundary information of at least one partition corresponding to at least one second index parameter), and stored in a pre-built array structure according to the five-dimensional index (w, h, angle, distance, part) to form a second template list.

[0788] In this embodiment, based on at least one of the following: at least one partition of the current block, block size, and partitioning method, the effective boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained to construct a second template list. This allows the second template list to integrate multi-dimensional information such as block size, partitioning method, and partitioning, avoiding template misjudgment caused by ignoring factors such as block size in traditional methods under non-square blocks and / or large offsets, thereby improving the prediction accuracy for at least one partition.

[0789] Method f2, template pixel partition information.

[0790] Optionally, based on the template pixel partitioning information, the effective boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained.

[0791] Optionally, based on the effective boundary information of at least one partition corresponding to at least one second index parameter, the effective boundary information of at least one partition is determined or obtained through the template pixel partition information.

[0792] Optionally, based on the template type determined or obtained through the template pixel partitioning information, the effective boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained.

[0793] Optionally, the template pixel partitioning information is determined or obtained based on at least one of the following: at least one partition of the current block, at least one of the block size and partitioning method, partitioning weight information, mask information, and mask information of the current template.

[0794] Optionally, the template pixel partitioning information includes at least one of the following: partitioning weight information, mask information, and mask information of the current template.

[0795] Optionally, the effective boundary information of at least one partition includes: coordinate parameters of the effective reference pixel distribution range of at least one partition in the template, the values ​​of which can affect the selection of the template and / or template type.

[0796] Optionally, the valid boundary information of at least one partition includes at least one of the following:

[0797] The top start position information (top_start) represents the horizontal coordinate (x value) of the first valid reference pixel belonging to this partition in the upper row template of the current block;

[0798] The top end position information (top_end) represents the horizontal coordinate (x value) of the last valid reference pixel belonging to this partition in the row template above the current block;

[0799] The left start position information (left_start) represents the vertical coordinate (y value) of the first valid reference pixel belonging to this partition in the left column template of the current block;

[0800] The left end position information (left_end) represents the vertical coordinate (y value) of the last valid reference pixel belonging to this partition in the left column template of the current block;

[0801] Invalid value: If there is no valid reference pixel for a certain boundary (i.e., the entire row and / or the entire column mask is zero), the corresponding parameter is marked as invalid (e.g., -1).

[0802] Optionally, the second index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0803] Optionally, a second template list is determined or obtained based on at least one second index parameter and / or the valid boundary information of at least one corresponding partition.

[0804] Optionally, the method of determining or obtaining at least one template based on the second template list may refer to method a11 in the second embodiment and / or method b4 in the third embodiment.

[0805] In this embodiment, a second template list is constructed based on the effective boundary information of at least one partition corresponding to at least one second index parameter determined or obtained through template pixel partition information. This allows the second template list to store effective boundary information that better matches at least one partition, thereby improving the prediction accuracy for at least one partition.

[0806] Fifth Embodiment

[0807] This application embodiment also provides a processing device. Please refer to FIG13, which is a functional block diagram of the processing device of this application. It can be disposed in or is a processing device. The processing device includes:

[0808] Processing module A10 is used to determine or obtain the prediction result of at least one partition of the current block based on at least one template.

[0809] Optionally, at least one template may include: the current template and / or a reference template.

[0810] Optionally, at least one template is determined or obtained based on at least one of the following:

[0811] Motion vector;

[0812] Block vector;

[0813] Template matching cost;

[0814] Template type;

[0815] Offset adjustment amount;

[0816] At least one partition;

[0817] The current block size;

[0818] The current block is divided in a specific way;

[0819] Template pixel partition information;

[0820] First template list;

[0821] Second template list.

[0822] Optionally, the division method includes: division angle and / or displacement offset.

[0823] Optionally, processing module A10 is configured to perform at least one of the following:

[0824] Based on the division angle and the first displacement offset determined or obtained through displacement offset and offset adjustment, at least one template is determined or obtained.

[0825] Determine or obtain at least one template based on at least one of the template types determined or obtained through at least one partition of the current block, the block size, and the partitioning method;

[0826] Based on the template type determined or obtained from the first template list, at least one template is determined or obtained;

[0827] Based on the valid boundary information of at least one partition determined or obtained from the second template list, at least one template is determined or obtained;

[0828] Based on the valid boundary information of at least one partition determined or obtained through template pixel partitioning information and / or template type, at least one template is determined or obtained;

[0829] Based on at least one current template, determine or obtain at least one reference template.

[0830] Optionally, processing module A10 is configured to perform at least one of the following:

[0831] The motion vector is: the motion vector of the current block and / or the motion vector of at least one partition;

[0832] The block vector is: the block vector of the current block and / or the block vector of at least one partition;

[0833] The current template is located in the current frame;

[0834] The reference template is located in the current frame and / or the reference frame;

[0835] The block dimensions are at least one of the following: width, height, aspect ratio, perimeter, and area;

[0836] The offset adjustment amount is determined or obtained based on the current block size;

[0837] The first template list includes: at least one first index parameter and / or its corresponding template type;

[0838] The second template list includes: at least one second index parameter and / or the valid boundary information of at least one corresponding partition.

[0839] Optionally, the first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0840] Optionally, processing module A10 is configured to determine or obtain the template type corresponding to at least one first index parameter based on at least one of the following:

[0841] The current block has at least one partition, block size, and partitioning method;

[0842] At least one effective boundary information of a partition and / or template type is determined or obtained through template pixel partition information;

[0843] At least one valid boundary information of a partition is determined or obtained through the second template list;

[0844] First template type.

[0845] Optionally, the processing module A10 is configured to determine or obtain the template type corresponding to at least one first index parameter based on the valid boundary information of at least one partition, including at least one of the following:

[0846] If the valid boundary information of at least one partition satisfies the first condition, then the template type corresponding to at least one first index parameter is the first type;

[0847] If the valid boundary information of at least one partition satisfies the second condition, then the template type corresponding to at least one first index parameter is the second type;

[0848] If the valid boundary information of at least one partition satisfies the third condition, then the template type corresponding to at least one first index parameter is the third type.

[0849] Optionally, the template determined or obtained according to at least one of the first type, the second type and the third type includes at least one of the top template, the left template and the upper left combined template.

[0850] Optionally, the valid boundary information of at least one partition satisfies at least one of the first, second, and third conditions, including at least one of the following:

[0851] At least one partition's valid boundary information is invalid boundary information;

[0852] At least one partition's valid boundary information is its upper boundary information;

[0853] At least one partition's valid boundary information is its left boundary information;

[0854] At least one partition's valid boundary information is the top-left boundary information;

[0855] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper boundary of the current block;

[0856] At least one valid reference pixel in the valid boundary information of a partition is distributed at the left boundary of the current block;

[0857] At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper left boundary of the current block.

[0858] Optionally, the second index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method.

[0859] Optionally, the processing module A10 is configured to determine or obtain valid boundary information of at least one partition corresponding to at least one second index parameter based on at least one of the following:

[0860] The current block has at least one partition, block size, and partitioning method;

[0861] Template pixel partition information.

[0862] 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.

[0863] 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.

[0864] 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.

[0865] 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.

[0866] 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.

[0867] 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.

[0868] 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.

[0869] 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.

[0870] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.

[0871] The units in the device of this application embodiment can be merged, divided, and deleted according to actual needs.

[0872] 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.

[0873] 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.

[0874] 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.

[0875] 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.

[0876] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using 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., a solid-state disk (SSD)).

[0877] 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, wherein, Including the following steps: S10, based on at least one template, determine or obtain the prediction result of at least one partition of the current block.

2. The processing method as described in claim 1, wherein at least one template comprises: The current template and / or the reference template, and / or at least one template is determined or obtained based on at least one of the following: Motion vector; Block vector; Template matching cost; Template type; Offset adjustment amount; At least one partition; The current block size; The current block is divided in a specific way; Template pixel partition information; First template list; Second template list.

3. The processing method as described in claim 2, wherein, The division methods include: division angle and / or displacement offset, and / or, at least one template determination or acquisition method, including at least one of the following: Based on the division angle and the first displacement offset determined or obtained through displacement offset and offset adjustment, at least one template is determined or obtained. Determine or obtain at least one template based on at least one of the template types determined or obtained through at least one partition of the current block, the block size, and the partitioning method; Based on the template type determined or obtained from the first template list, at least one template is determined or obtained; Based on the valid boundary information of at least one partition determined or obtained from the second template list, at least one template is determined or obtained; Based on the valid boundary information of at least one partition determined or obtained through template pixel partitioning information and / or template type, at least one template is determined or obtained; Based on at least one current template, determine or obtain at least one reference template.

4. The processing method as described in claim 2, wherein, The method further includes at least one of the following: The motion vector is: the motion vector of the current block and / or the motion vector of at least one partition; The block vector is: the block vector of the current block and / or the block vector of at least one partition; The current template is located in the current frame; The reference template is located in the current frame and / or the reference frame; The block dimensions are at least one of the following: width, height, aspect ratio, perimeter, and area; The offset adjustment amount is determined or obtained based on the current block size; The first template list includes: at least one first index parameter and / or its corresponding template type; The second template list includes: at least one second index parameter and / or the valid boundary information of at least one corresponding partition.

5. The processing method as described in claim 4, wherein, The first index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method, and / or, the template type corresponding to at least one first index parameter is determined or obtained based on at least one of the following: The current block has at least one partition, block size, and partitioning method; At least one effective boundary information of a partition and / or template type is determined or obtained through template pixel partition information; At least one valid boundary information of a partition is determined or obtained through the second template list; First template type.

6. The processing method as described in claim 5, wherein, Based on the valid boundary information of at least one partition, determine or obtain the template type corresponding to at least one first index parameter, including at least one of the following: If the valid boundary information of at least one partition satisfies the first condition, then the template type corresponding to at least one first index parameter is the first type; If the valid boundary information of at least one partition satisfies the second condition, then the template type corresponding to at least one first index parameter is the second type; If the valid boundary information of at least one partition satisfies the third condition, then the template type corresponding to at least one first index parameter is the third type.

7. The processing method as described in claim 6, wherein, The template determined or obtained based on at least one of the first type, the second type, and the third type includes at least one of the top template, the left template, and the top-left combined template, and / or, the valid boundary information of at least one partition satisfies at least one of the first condition, the second condition, and the third condition, including at least one of the following: At least one partition's valid boundary information is invalid boundary information; At least one partition's valid boundary information is its upper boundary information; At least one partition's valid boundary information is its left boundary information; At least one partition's valid boundary information is the top-left boundary information; At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper boundary of the current block; At least one valid reference pixel in the valid boundary information of a partition is distributed at the left boundary of the current block; At least one valid reference pixel in the valid boundary information of a partition is distributed at the upper left boundary of the current block.

8. The processing method as described in claim 4, wherein, The second index parameter includes at least one of the following: at least one partition of the current block, block size, and partitioning method, and / or, the effective boundary information of at least one partition corresponding to at least one second index parameter is determined or obtained based on at least one of the following: The current block has at least one partition, block size, and partitioning method; Template pixel partition information.

9. A processing apparatus, wherein, include: The memory and the processor, wherein the memory stores a processing program, and the processing program, when executed by the processor, implements the steps of the processing method as described in claim 1.

10. A storage medium, wherein, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the processing method as described in claim 1.