Deriving a coding mode from one or more template-based costs

By using multiple components and adapting template shapes based on coding mode parameters, the method addresses the limitations of existing video compression systems in determining accurate coding modes, resulting in improved video compression efficiency.

WO2025067883A1PCT designated stage expired Publication Date: 2025-04-03INTERDIGITAL CE PATENT HOLDINGS SAS
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2024/075430
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-09-28
Filing Date
2024-09-12
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

Existing video compression systems using template-based costs face challenges in determining accurate coding modes, as they often rely on single-component costs and fixed template shapes, neglecting mode signaling costs and other mode parameters.

Method used

The method involves determining template-based costs using multiple components, such as luminance and chrominance, and incorporating mode signaling costs. Additionally, the template shape is adapted based on coding mode parameters, such as spatial candidate positions, to improve the accuracy of coding mode determination.

Benefits of technology

This approach enhances the determination of template-based costs, leading to improved coding mode selection and video compression efficiency by considering multiple components and dynamic template shapes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2024075430_03042025_PF_FP_ABST
    Figure EP2024075430_03042025_PF_FP_ABST
Patent Text Reader

Abstract

A method and an apparatus for encoding or decoding a video are provided wherein the block is coded using a coding mode that uses one or more template-based costs. In an embodiment, the determination of the template-based cost is adapted according to the coding mode. In one embodiment, the one or more template-based costs are determined using a first cost obtained for a first component of the block, e.g. the luminance, and at least one additional cost determined for the block. In a variant, the additional cost is a template-based cost determined for another component of the block, for example a chrominance component. In another variant, the additional cost is a cost for signaling one or more syntax elements of the coding mode. In another embodiment, the one or more template-based costs are determined using a template shape that is adapted according to a given criteria. Once the parameters of the coding mode have been determined, the prediction for the block is obtained based on the coding mode and, the block is encoded or decoded based on the prediction.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] DERIVING A CODING MODE FROM ONE OR MORE TEMPLATE-BASED COSTS

[0002] This application claims the priority to European Application No. 23306631.5, filed on 28 September 2023, which is incorporated herein by reference in its entirety.

[0003] TECHNICAL FIELD

[0004] The present embodiments generally relate to video compression. The present embodiments relate to a method and an apparatus for encoding or decoding an image or a video. More particularly, the present embodiments relate to improving coding modes of video compression system that uses template-based cost.

[0005] BACKGROUND

[0006] To achieve high compression efficiency, image and video coding schemes usually employ prediction and transform to leverage spatial and temporal redundancy in the video content. Generally, intra or inter prediction is used to exploit the intra or inter picture correlation, then the differences between the original block and the predicted block, often denoted as prediction errors or prediction residuals, are transformed, quantized, and entropy coded. In inter prediction, motion vectors used in motion compensation are often predicted from motion vector predictor. To reconstruct the video, the compressed data are decoded by inverse processes corresponding to the entropy coding, quantization, transform, and prediction.

[0007] SUMMARY

[0008] According to an aspect, a method for encoding or decoding a block of a video is provided. The method comprises obtaining a prediction for the block based on a coding mode, wherein the coding mode uses at least one template-based cost, the template-based cost being determined using at least one first cost obtained for a first component of the block, encoding or decoding the block based on the prediction, wherein the at least one template-based cost is determined using at least one additional cost determined for the block.

[0009] According to another aspect, an apparatus for encoding or decoding a block of a video is provided. The apparatus comprises one or more processors operable to obtain a prediction for the block based on a coding mode, wherein the coding mode uses at least one templatebased cost, the template-based cost being determined using at least one first cost obtained for a first component of the block, encode or decode the block based on the prediction, wherein the at least one template-based cost is determined using at least one additional cost determined for the block. In some embodiments, the additional cost is a template-based cost obtained for another component of the block. In other embodiments, the additional cost is a cost for signaling one or more syntax elements associated to the coding mode.

[0010] According to another aspect, a method for encoding or decoding a block of a video is provided. The method comprises obtaining a prediction for the block based on a coding mode, wherein the coding mode uses at least one template-based cost, encoding or decoding the block based on the prediction, wherein the at least one template-based cost is determined using a template shape that is determined based on at least one parameter of the coding mode.

[0011] According to another aspect, an apparatus for encoding or decoding a block of a video is provided. The apparatus comprises one or more processors operable to obtain a prediction for the block based on a coding mode, wherein the coding mode uses at least one templatebased cost, encode or decode the block based on the prediction, wherein the at least one template-based cost is determined using a template shape derived from at least one parameter of the coding mode.

[0012] Further embodiments that can be used alone or in combination are described herein.

[0013] One or more embodiments also provide a computer program comprising instructions which when executed by one or more processors cause the one or more processors to perform any one of the methods for encoding or decoding a video according to any of the embodiments described herein. One or more of the present embodiments also provide a non-transitory computer readable medium and / or a computer readable storage medium having stored thereon instructions for encoding or decoding a video according to the methods described herein.

[0014] One or more embodiments also provide a computer readable storage medium having stored thereon a bitstream generated according to the methods described herein. One or more embodiments also provide a method and apparatus for transmitting or receiving the bitstream generated according to the methods described above.

[0015] BRIEF DESCRIPTION OF THE DRAWINGS

[0016] FIG. 1 illustrates a block diagram of a system within which aspects of the present embodiments may be implemented.

[0017] FIG. 2 illustrates a block diagram of an embodiment of a video encoder within which aspects of the present embodiments may be implemented. FIG. 3 illustrates a block diagram of an embodiment of a video decoder within which aspects of the present embodiments may be implemented.

[0018] FIG. 4 illustrates an example of a template used for determining a template cost for reordering merge candidates in a list.

[0019] FIG. 5 illustrates an example of template and reference samples of the template for block with sub-block motion using motion information of the subblocks of a current block.

[0020] FIG. 6 illustrates an example of a template for a geo-partitioned block.

[0021] FIG. 7 illustrates examples of prediction directions for intra prediction.

[0022] FG. 8 illustrates an example of a flowchart for encoding or decoding at least one block of a video according to an embodiment.

[0023] FG. 9 illustrates an example of a flowchart for encoding or decoding at least one block of a video according to another embodiment.

[0024] FG. 10 illustrates an example of a flowchart for encoding or decoding at least one block of a video according to another embodiment.

[0025] FG. 1 1 illustrates an example of a flowchart for encoding or decoding at least one block of a video according to another embodiment.

[0026] FIG. 12 illustrates a block diagram of a system within which aspects of the present embodiments may be implemented, according to another embodiment.

[0027] FIG. 13 shows two remote devices communicating over a communication network in accordance with an example of the present principles.

[0028] FIG. 14 shows the syntax of a signal in accordance with an example of the present principles. FIG. 15 illustrates an example of spatial neighboring blocks used to derive spatial merge candidates.

[0029] DETAILED DESCRIPTION

[0030] This application describes a variety of aspects, including tools, features, embodiments, models, approaches, etc. Many of these aspects are described with specificity and, at least to show the individual characteristics, are often described in a manner that may sound limiting. However, this is for purposes of clarity in description, and does not limit the application or scope of those aspects. Indeed, all of the different aspects can be combined and interchanged to provide further aspects. Moreover, the aspects can be combined and interchanged with aspects described in earlier filings as well.

[0031] The aspects described and contemplated in this application can be implemented in many different forms. FIGs. 1 , 2 and 3 below provide some embodiments, but other embodiments are contemplated and the discussion of FIGs. 1 , 2 and 3 does not limit the breadth of the implementations. At least one of the aspects generally relates to video encoding and decoding, and at least one other aspect generally relates to transmitting a bitstream generated or encoded. These and other aspects can be implemented as a method, an apparatus, a computer readable storage medium having stored thereon instructions for encoding or decoding video data according to any of the methods described, and / or a computer readable storage medium having stored thereon a bitstream generated according to any of the methods described.

[0032] In the present application, the terms “reconstructed” and “decoded” may be used interchangeably, the terms “pixel” and “sample” may be used interchangeably, the terms “image,” “picture” and “frame” may be used interchangeably.

[0033] Various methods are described herein, and each of the methods comprises one or more steps or actions for achieving the described method. Unless a specific order of steps or actions is required for proper operation of the method, the order and / or use of specific steps and / or actions may be modified or combined. Additionally, terms such as “first”, “second”, etc. may be used in various embodiments to modify an element, component, step, operation, etc., such as, for example, a “first decoding” and a “second decoding”. Use of such terms does not imply an ordering to the modified operations unless specifically required. So, in this example, the first decoding need not be performed before the second decoding, and may occur, for example, before, during, or in an overlapping time period with the second decoding.

[0034] The present aspects are not limited to VVC or HEVC, and can be applied, for example, to other standards and recommendations, whether pre-existing or future-developed, and extensions of any such standards and recommendations (including VVC and HEVC). Unless indicated otherwise, or technically precluded, the aspects described in this application can be used individually or in combination.

[0035] FIG. 1 illustrates a block diagram of an example of a system in which various aspects and embodiments can be implemented. System 100 may be embodied as a device including the various components described below and is configured to perform one or more of the aspects described in this application. Examples of such devices, include, but are not limited to, various electronic devices such as personal computers, laptop computers, smartphones, tablet computers, digital multimedia set top boxes, digital television receivers, personal video recording systems, connected home appliances, and servers. Elements of system 100, singly or in combination, may be embodied in a single integrated circuit, multiple ICs, and / or discrete components. For example, in at least one embodiment, the processing and encoder / decoder elements of system 100 are distributed across multiple ICs and / or discrete components. In various embodiments, the system 100 is communicatively coupled to other systems, or to other electronic devices, via, for example, a communications bus or through dedicated input and / or output ports. In various embodiments, the system 100 is configured to implement one or more of the aspects described in this application.

[0036] The system 100 includes at least one processor 110 configured to execute instructions loaded therein for implementing, for example, the various aspects described in this application. Processor 110 may include embedded memory, input output interface, and various other circuitries as known in the art. The system 100 includes at least one memory 120 (e.g., a volatile memory device, and / or a non-volatile memory device). System 100 includes a storage device 140, which may include non-volatile memory and / or volatile memory, including, but not limited to, EEPROM, ROM, PROM, RAM, DRAM, SRAM, flash, magnetic disk drive, and / or optical disk drive. The storage device 140 may include an internal storage device, an attached storage device, and / or a network accessible storage device, as non-limiting examples.

[0037] System 100 includes an encoder / decoder module 130 configured, for example, to process data to provide an encoded video or decoded video, and the encoder / decoder module 130 may include its own processor and memory. The encoder / decoder module 130 represents module(s) that may be included in a device to perform the encoding and / or decoding functions. As is known, a device may include one or both of the encoding and decoding modules. Additionally, encoder / decoder module 130 may be implemented as a separate element of system 100 or may be incorporated within processor 1 10 as a combination of hardware and software as known to those skilled in the art.

[0038] Program code to be loaded onto processor 1 10 or encoder / decoder 130 to perform the various aspects described in this application may be stored in storage device 140 and subsequently loaded onto memory 120 for execution by processor 1 10. In accordance with various embodiments, one or more of processor 1 10, memory 120, storage device 140, and encoder / decoder module 130 may store one or more of various items during the performance of the processes described in this application. Such stored items may include, but are not limited to, the input video, the decoded video or portions of the decoded video, the bitstream, matrices, variables, and intermediate or final results from the processing of equations, formulas, operations, and operational logic.

[0039] In some embodiments, memory inside of the processor 110 and / or the encoder / decoder module 130 is used to store instructions and to provide working memory for processing that is needed during encoding or decoding. In other embodiments, however, a memory external to the processing device (for example, the processing device may be either the processor 1 10 or the encoder / decoder module 130) is used for one or more of these functions. The external memory may be the memory 120 and / or the storage device 140, for example, a dynamic volatile memory and / or a non-volatile flash memory. In several embodiments, an external non-volatile flash memory is used to store the operating system of a television. In at least one embodiment, a fast external dynamic volatile memory such as a RAM is used as working memory for video coding and decoding operations, such as for MPEG-2, HEVC (HEVC refers to High Efficiency Video Coding, also known as H.265 and MPEG-H Part 2), or VVC (Versatile Video Coding also known as H.266, standard developed by JVET, the Joint Video Experts Team).

[0040] The input to the elements of system 100 may be provided through various input devices as indicated in block 105. Such input devices include, but are not limited to, (i) a radio frequency (RF) portion that receives an RF signal transmitted, for example, over the air by a broadcaster, (ii) a Component (COMP) input terminal (or a set of COMP input terminals), (iii) a Universal Serial Bus (USB) input terminal, and / or (iv) a High Definition Multimedia Interface (HDMI) input terminal. Other examples, not shown in FIG. 1 , include composite video.

[0041] In various embodiments, the input devices of block 105 have associated respective input processing elements as known in the art. For example, the RF portion may be associated with elements suitable for (i) selecting a desired frequency (also referred to as selecting a signal, or band-limiting a signal to a band of frequencies), (ii) down converting the selected signal, (iii) band-limiting again to a narrower band of frequencies to select (for example) a signal frequency band which can be referred to as a channel in certain embodiments, (iv) demodulating the down converted and band-limited signal, (v) performing error correction, and (vi) demultiplexing to select the desired stream of data packets. The RF portion of various embodiments includes one or more elements to perform these functions, for example, frequency selectors, signal selectors, band-limiters, channel selectors, filters, downconverters, demodulators, error correctors, and demultiplexers. The RF portion may include a tuner that performs various of these functions, including, for example, down converting the received signal to a lower frequency (for example, an intermediate frequency or a near-baseband frequency) or to baseband. In one set-top box embodiment, the RF portion and its associated input processing element receives an RF signal transmitted over a wired (for example, cable) medium, and performs frequency selection by filtering, down converting, and filtering again to a desired frequency band. Various embodiments rearrange the order of the above-described (and other) elements, remove some of these elements, and / or add other elements performing similar or different functions. Adding elements may include inserting elements in between existing elements, for example, inserting amplifiers and an analog-to-digital converter. In various embodiments, the RF portion includes an antenna.

[0042] Additionally, the USB and / or HDMI terminals may include respective interface processors for connecting system 100 to other electronic devices across USB and / or HDMI connections. It is to be understood that various aspects of input processing, for example, Reed-Solomon error correction, may be implemented, for example, within a separate input processing IC or within processor 110 as necessary. Similarly, aspects of USB or HDMI interface processing may be implemented within separate interface ICs or within processor 1 10 as necessary. The demodulated, error corrected, and demultiplexed stream is provided to various processing elements, including, for example, processor 110, and encoder / decoder 130 operating in combination with the memory and storage elements to process the data stream as necessary for presentation on an output device.

[0043] Various elements of system 100 may be provided within an integrated housing, Within the integrated housing, the various elements may be interconnected and transmit data therebetween using suitable connection arrangement 115, for example, an internal bus as known in the art, including the I2C bus, wiring, and printed circuit boards.

[0044] The system 100 includes communication interface 150 that enables communication with other devices via communication channel 190. The communication interface 150 may include, but is not limited to, a transceiver configured to transmit and to receive data over communication channel 190. The communication interface 150 may include, but is not limited to, a modem or network card and the communication channel 190 may be implemented, for example, within a wired and / or a wireless medium.

[0045] Data is streamed to the system 100, in various embodiments, using a Wi-Fi network such as IEEE 802.11 (IEEE refers to the Institute of Electrical and Electronics Engineers). The Wi-Fi signal of these embodiments is received over the communications channel 190 and the communications interface 150 which are adapted for Wi-Fi communications. The communications channel 190 of these embodiments is typically connected to an access point or router that provides access to outside networks including the Internet for allowing streaming applications and other over-the-top communications. Other embodiments provide streamed data to the system 100 using a set-top box that delivers the data over the HDMI connection of the input block 105. Still other embodiments provide streamed data to the system 100 using the RF connection of the input block 105. As indicated above, various embodiments provide data in a non-streaming manner. Additionally, various embodiments use wireless networks other than Wi-Fi, for example a cellular network or a Bluetooth network.

[0046] The system 100 may provide an output signal to various output devices, including a display 165, speakers 175, and other peripheral devices 185. The display 165 of various embodiments includes one or more of, for example, a touchscreen display, an organic lightemitting diode (OLED) display, a curved display, and / or a foldable display. The display 165 can be for a television, a tablet, a laptop, a cell phone (mobile phone), or other device. The display 165 can also be integrated with other components (for example, as in a smart phone), or separate (for example, an external monitor for a laptop). The other peripheral devices 185 include, in various examples of embodiments, one or more of a stand-alone digital video disc (or digital versatile disc) (DVR, for both terms), a disk player, a stereo system, and / or a lighting system. Various embodiments use one or more peripheral devices 185 that provide a function based on the output of the system 100. For example, a disk player performs the function of playing the output of the system 100.

[0047] In various embodiments, control signals are communicated between the system 100 and the display 165, speakers 175, or other peripheral devices 185 using signaling such as AV.Link, CEC, or other communications protocols that enable device-to-device control with or without user intervention. The output devices may be communicatively coupled to system 100 via dedicated connections through respective interfaces 160, 170, and 180. Alternatively, the output devices may be connected to system 100 using the communications channel 190 via the communications interface 150. The display 165 and speakers 175 may be integrated in a single unit with the other components of system 100 in an electronic device, for example, a television. In various embodiments, the display interface 160 includes a display driver, for example, a timing controller (T Con) chip.

[0048] The display 165 and speaker 175 may alternatively be separate from one or more of the other components, for example, if the RF portion of input 105 is part of a separate set-top box. In various embodiments in which the display 165 and speakers 175 are external components, the output signal may be provided via dedicated output connections, including, for example, HDMI ports, USB ports, or COMP outputs.

[0049] The embodiments can be carried out by computer software implemented by the processor 1 10 or by hardware, or by a combination of hardware and software. As a non-limiting example, the embodiments can be implemented by one or more integrated circuits. The memory 120 can be of any type appropriate to the technical environment and can be implemented using any appropriate data storage technology, such as optical memory devices, magnetic memory devices, semiconductor-based memory devices, fixed memory, and removable memory, as non-limiting examples. The processor 1 10 can be of any type appropriate to the technical environment, and can encompass one or more of microprocessors, general purpose computers, special purpose computers, and processors based on a multi-core architecture, as non-limiting examples.

[0050] FIG. 2 illustrates an example of a block-based hybrid video encoder 200. Variations of this encoder 200 are contemplated, but the encoder 200 is described below for purposes of clarity without describing all expected variations.

[0051] In some embodiments, FIG. 2 also illustrate an encoder in which improvements are made to the HEVC standard or a VVC standard Versatile Video Coding, Standard ITU-T H.266, ISO / IEC 23090-3, 2020) or an encoder employing technologies similar to HEVC or VVC, such as an encoder ECM under development by JVET (Joint Video Exploration Team).

[0052] Before being encoded, the video sequence may go through pre-encoding processing (201 ), for example, applying a color transform to the input color picture (e.g., conversion from RGB 4:4:4 to YCbCr 4:2:0), or performing a remapping of the input picture components in order to get a signal distribution more resilient to compression (for instance using a histogram equalization of color components), or re-sizing the picture (ex: down-scaling). Metadata can be associated with the pre-processing, and attached to the bitstream.

[0053] In the encoder 200, a picture is encoded by the encoder elements as described below. The picture to be encoded is partitioned (202) and processed in units of, for example, CUs (Coding units) or blocks. In the disclosure, different expressions may be used to refer to such a unit or block resulting from a partitioning of the picture. Such wording may be coding unit or CU, coding block or CB, luminance CB, or block. A CTU (Coding Tree Unit) refers to a group of blocks or group of units or group of coding units (CUs). In some embodiments, a CTU may be considered as a block, or a unit as itself. An example of a partitioning using CTUs and CUs is illustrates on FIG. 15.

[0054] For example in VVC, as in HEVC, a picture is partitioned into multiple non-overlapping CTUs. A CTU size in VVC can be set up to 128 x 128 or 256 x 256 in units of luma samples, while in HEVC, it can be set up to 64 x 64. In HEVC, a recursive Quad-tree (QT) split can be applied to each CTU, resulting in one or multiple CUs, all having square shapes. In VVC, rectangular CUs are supported together with square CUs. A binary tree (BT) split and a ternary tree (TT) split are also adopted in VVC. FIG. 16 illustrates some examples of partitioning of a CTU. Further splitting of the obtained CUs are also possible.

[0055] Each unit is encoded using, for example, either an intra or inter mode. When a unit is encoded in an intra mode, it performs intra prediction (260). In an inter mode, motion estimation (275) and compensation (270) are performed. The encoder decides (205) which one of the intra mode or inter mode to use for encoding the unit, and indicates the intra / inter decision by, for example, a prediction mode flag. The encoder may also blend (263) intra prediction result and inter prediction result, or blend results from different intra / inter prediction methods. Prediction residuals are calculated, for example, by subtracting (210) the predicted block from the original image block.

[0056] The motion refinement module (272) uses already available reference picture in order to refine the motion field of a block without reference to the original block. A motion field for a region can be considered as a collection of motion vectors for all pixels with the region. If the motion vectors are sub-block-based, the motion field can also be represented as the collection of all sub-block motion vectors in the region (all pixels within a sub-block has the same motion vector, and the motion vectors may vary from sub-block to sub-block). If a single motion vector is used for the region, the motion field for the region can also be represented by the single motion vector (same motion vectors for all pixels in the region). The prediction residuals are then transformed (225) and quantized (230). The quantized transform coefficients, as well as motion vectors and other syntax elements, are entropy coded (245) to output a bitstream. The encoder can skip the transform and apply quantization directly to the non-transformed residual signal. The encoder can bypass both transform and quantization, i.e., the residual is coded directly without the application of the transform or quantization processes.

[0057] The encoder decodes (reconstructs) an encoded block to provide a reference for further predictions. The quantized transform coefficients are de-quantized (240) and inverse transformed (250) to decode prediction residuals. Combining (255) the decoded prediction residuals and the predicted block, an image block is reconstructed. In-loop filters (265) are applied to the reconstructed picture to perform, for example, deblocking / SAO (Sample Adaptive Offset) filtering to reduce encoding artifacts. The filtered image is stored at a reference picture buffer (280).

[0058] FIG. 3 illustrates a block diagram of a video decoder 300. In the decoder 300, a bitstream is decoded by the decoder elements as described below. Video decoder 300 generally performs a decoding pass reciprocal to the encoding pass as described in FIG. 2. The encoder 200 also generally performs video decoding as part of encoding video data.

[0059] In particular, the input of the decoder includes a video bitstream, which can be generated by video encoder 200. The bitstream is first entropy decoded (330) to obtain transform coefficients, motion vectors, and other coded information. The picture partition information indicates how the picture is partitioned. The decoder may therefore divide (335) the picture according to the decoded picture partitioning information. The transform coefficients are dequantized (340) and inverse transformed (350) to decode the prediction residuals. Combining (355) the decoded prediction residuals and the predicted block, an image block is reconstructed.

[0060] The predicted block can be obtained (370) from intra prediction (360) or motion-compensated prediction (i.e., inter prediction) (375). The decoder may blend (373) the intra prediction result and inter prediction result, or blend results from multiple intra / inter prediction methods. Before motion compensation, the motion field may be refined (372) by using already available reference pictures. In-loop filters (365) are applied to the reconstructed image. The filtered image is stored at a reference picture buffer (380).

[0061] The decoded picture can further go through post-decoding processing (385), for example, an inverse color transform (e.g. conversion from YCbCr 4:2:0 to RGB 4:4:4) or an inverse remapping performing the inverse of the remapping process performed in the pre-encoding processing (201 ), or re-sizing the reconstructed pictures (ex: up-scaling). The post-decoding processing can use metadata derived in the pre-encoding processing and signaled in the bitstream.

[0062] Some of the embodiments described herein relates to template-based coding modes and to improving the determination of the template-based cost used in these coding modes.

[0063] Any one of the embodiments described herein can be implemented for instance in an intra prediction module or an inter-prediction module of a video encoder or video decoder. For instance, the embodiments described herein can be implemented in the intra prediction module 260 or the motion estimation module 275, or the motion refinement module 272 or the motion compensation 270 of the video encoder 200 or the intra prediction module 360 or the motion refinement module 372, or the motion compensation 375 of the video decoder 300.

[0064] In the ECM algorithm description Muhammed Coban, Ru-Ling Liao, Karam Naser, Jacob Strom, Li Zhang, “Algorithm description of Enhanced Compression Model 9 (ECM 9),” 30th Meeting, Antalya, TR, 21-28 April 2023), several tools or coding modes use template-based costs for determining or deriving one or more parameters of the coding mode. Some of them are described below.

[0065] Fusion for template-based intra mode derivation (TIMD)

[0066] In ECM, for each intra prediction mode in MPMs (most probable modes list), as well as the wide-angle modes if the above-right and / or bottom-left reference samples are available, the SATD (Sum of Absolute Transform difference, ex: Hadamard transform) between the prediction and reconstructed samples of a template of a current block to encode or decode is calculated.

[0067] Then, two intra prediction modes that provide minimum SATD are selected as the TIMD modes. These two TIMD modes are fused with the weights after applying the PDPC process (Position Dependent Intra Prediction Combination), and such weighted intra prediction is used to code the current CU / block. Position dependent intra prediction combination (PDPC) is included in the derivation of the TIMD modes.

[0068] The costs (costModel , costMode2) of the two selected modes are compared with a threshold. In the comparison, a cost factor of 2 is applied as follows: costMode2 < 2*costMode1 .

[0069] If this condition is true, the fusion of the two selected modes is applied, otherwise the only model (that provided the CostModel ) is used.

[0070] When fusing the two selected modes, the weights (weight"! , weight2) of the modes are computed from their SATD costs as follows: weight"! = costMode2 / (costModel + costMode2) weight2 = 1 - weight"!

[0071] Adaptive reordering of merge candidates with template matching (ARMC-TM) In ECM, in the merge mode, a list of candidates motion is populated with motion information of previously coded blocks considered in a given order.

[0072] The candidates of the merge list, also called merge candidates, are adaptively reordered with template matching (TM). This reordering method is applied to the following merge modes: regular merge mode, TM merge mode, and affine merge mode (excluding the SbTMVP candidate - Subblock Temporal Motion Vector Predictor). For the TM merge mode, merge candidates are reordered before a refinement process is applied to the selected merge candidate.

[0073] An initial merge candidate list is firstly constructed according to a given checking order of the candidate. For example, the following candidates can be considered: spatial candidates, temporal motion vector predictors (TMVPs), non-adjacent candidates, History Motion Vector Predictors (HMVPs), pairwise candidate, virtual merge candidates. Then, the candidates in the initial list are divided into several subgroups.

[0074] For the template matching (TM) merge mode, and adaptive DMVR (Decoder-side Motion Vector Refinement) mode, each merge candidate in the initial list is firstly refined by using TM or multi-pass DMVR.

[0075] The merge candidates in each subgroup are reordered to generate a reordered merge candidate list. This reordering is done based on a template-based cost determined for each candidate. An index of a selected merge candidate in the reordered merge candidate list is signaled to the decoder.

[0076] For simplification, merge candidates in a last but not the first subgroup are not reordered. All the zero candidates from the ARMC reordering process are excluded during the construction of merge motion vector candidates list. The subgroup size is set to 5 for regular merge mode and TM merge mode. The subgroup size is set to 3 for affine merge mode.

[0077] Template-based cost calculation:

[0078] The template matching cost of a merge candidate during the reordering process is measured by the SAD (sum of absolute difference) between samples of a template of the current block and their corresponding reference samples. The template comprises a set of reconstructed samples neighboring to the current block. Reference (prediction) samples of the template are located by the motion information (motion compensation) of the merge candidate. When a merge candidate utilizes bi-directional prediction, the reference samples of the template of the merge candidate are also generated by bi-prediction as shown in FIG. 4.

[0079] Refinement of the initial merge candidate list:

[0080] When multi-pass DMVR is used to derive the refined motion to the initial merge candidate list only the first pass (i.e., Pll level) of multi-pass DMVR is applied in reordering. When template matching is used to derive the refined motion, the template size is set equal to 1 . Only the above or left template is used during the motion refinement of TM when the block is flat with block width greater than 2 times of height or narrow with height greater than 2 times of width respectively. TM is extended to perform 1 / 16-pel MVD precision. The first four merge candidates are reordered with the refined motion in TM merge mode.

[0081] For subblock-based merge candidates with subblock size equal to Wsub x Hsub, the above template comprises several sub-templates with the size of Wsub x 1 , and the left template comprises several sub-templates with the size of 1 x Hsub. As shown in FIG. 5, the motion information of the subblocks in the first row and the first column of current block is used to derive the reference samples of each sub-template.

[0082] Reordering criteria:

[0083] In the reordering process, a candidate is considered as redundant if the cost difference between a candidate and its predecessor is inferior to a lambda value e.g. |D1 -D2| < A, where D1 and D2 are the costs obtained during the first ARMC ordering and A is the Lagrangian parameter used in the RD criterion at encoder side.

[0084] The algorithm is defined as follows. The minimum cost difference is determined between a candidate and its predecessor among all candidates in the list. If the minimum cost difference is superior or equal to A, the list is considered diverse enough and the reordering stops. Otherwise (this minimum cost difference is inferior to A), the candidate is considered as redundant, and it is moved at a further position in the list. This further position is the first position where the candidate is diverse enough compared to its predecessor. The algorithm stops after a finite number of iterations (if the minimum cost difference is not inferior to A).

[0085] The above reordering algorithm is applied to the Regular, TM, BM (bilateral matching) and Affine merge modes. A similar algorithm is applied to the Merge MMVD (merge with MVD) and sign MVD (motion vector difference) prediction methods which also use ARMC for the reordering.

[0086] The value of A is set equal to the A of the rate distortion criterion used to select the best merge candidate at the encoder side for low delay configuration and to the value A corresponding to a another QP for Random Access configuration. A set of A values corresponding to each signaled QP offset is provided in the SPS or in the Slice Header for the QP offsets which are not present in the SPS.

[0087] Extension to AMVP modes:

[0088] The ARMC design is also applicable to the AMVP (Adaptive motion vector prediction) mode wherein the AMVP candidates are reordered according to the TM cost. For the template matching for advanced motion vector prediction (TM-AMVP) mode, an initial AMVP candidate list is constructed, followed by a refinement using TM to construct a refined AMVP candidate list. In addition, an MVP candidate with a TM cost larger than a threshold, which is equal to five times of the cost of the first MVP candidate, is skipped.

[0089] Geometric partitioning mode (GPM) with template matching (GPM-TM)

[0090] In ECM, template matching is applied to GPM (Geometry Partition Mode). When GPM mode is enabled for a CU / block, a CU-level flag (GPM-TM flag) is signaled to indicate whether TM is applied to both geometric partitions. Motion information for each geometric partition is refined using TM. When TM is chosen, a template is constructed using left, above or left and above neighboring samples according to partition angle, as shown in the table 1 below. The motion is then refined by minimizing the difference between the current template and the template in the reference picture using the same search pattern of merge mode with half-pel interpolation filter disabled.

[0091] Table 1 : Template for the 1 st and 2nd geometric partitions, where A represents using above samples, L represents using left samples, and L+A represents using both left and above samples.

[0092] Besides GPM-TM, GPM-MMVD allows signaling MVDs information to correct the selected motion vector candidates. The GPM-MMVD and GPM-TM are exclusively enabled to one GPM CLI. This is done by firstly signaling the GPM-MMVD syntax. When both two GPM- MMVD control flags are equal to false (i.e., the GPM-MMVD are disabled for two GPM partitions), the GPM-TM flag is signaled to indicate whether the template matching is applied to the two GPM partitions. Otherwise (at least one GPM-MMVD flag is equal to true), the value of the GPM-TM flag is inferred to be false.

[0093] Template matching based reordering for GPM split modes (GPM-SPLIT-TM)

[0094] In ECM, template-matching can also be used for reordering the different geometric patitionings of a block correspoding to the different edge angles. These partiotionnings are also referred to as GPM split modes. The GPM mode as 64 split modes.

[0095] In template matching based reordering for GPM split modes, given the motion information of the current GPM block, the respective TM cost values of GPM split modes are computed. Then, all GPM split modes are reordered in ascending ordering based on the TM cost values (SAD). Instead of sending GPM split mode, an index using Golomb-Rice code to indicate where the exact GPM split mode is located in the reordered list is signaled.

[0096] The reordering method for GPM split modes is a two-step process performed after the respective reference templates of the two GPM partitions in a coding unit are generated, as follows. The GPM partition edge is extended into the reference templates of the two GPM partitions, resulting in 64 reference templates and the respective TM cost is calculated for each of the 64 reference templates.

[0097] The GPM split modes are then reordered based on their TM cost values in ascending order and the best 32 split modes are marked as available split modes.

[0098] The edge on the template is extended from that of the current CU, as FIG. 6 illustrates, but GPM blending process is not used in the template area across the edge. After ascending reordering using TM cost, an index of the selected split mode is signaled.

[0099] Template matching based BCW index derivation for merge mode (BCW-TM)

[0100] In BCW for merge mode, a weighted bi-prediction is used for predicting the block, for example given by: B=(W0xP0+W1xP1 ) / 8, whith B the prediction block, PO and P1 the reference blocks and WO and W1 the respective weights apply to the reference blocks. Motion information inherited a candidate in the merge list provides for obtaining the reference blocks. In the BCW, for merge mode, the weights WO and W1 are selected from a given table using a BCW index. An example of such a table may be:

[0101] In the BCW-TM mode, the BCW (Bi-prediction with CU based weighting) index for merge coded CUs is derived based on template matching cost instead of being derived from the BCW indexes of the neighboring blocks.

[0102] Given a selected merge candidate, the TM cost values are calculated with different biprediction weights, and then, the bi-prediction weight with minimum TM cost value is used to predict the merge CU.

[0103] When calculating TM cost for bi-predicted weights, the following rules are applied. Since the inherited bi-predicted weight is likely to have higher accuracy than others, only the inherited bi-prediction weight and its two neighboring weights (i.e. ±1 ) are considered. For example, if the inherited bi-predicted weight is 4, then only three weights {3, 4, 5} are involved in TM cost calculation. The TM cost of the inherited BCW index is multiplied with 0.90625, that is, the cost is reduced by 3 / 32. The TM cost of the equal weight is multiplied with 0.90625 since bi- predicted samples are beneficial for BDOF and BDOF is only applied to CU with equal weights. The template matching based BCW index derivation is applied to CUs coded in regular merge, template matching, adaptive decoder-side motion vector refinement and MMVD modes.

[0104] In addition, the bi-prediction weights for merge mode are extended from {-2, 3, 4, 5, 10} to {1 , 2, 3, 4, 5, 6, 7}. Furthermore, the negative bi-predicted weights for non-merge mode {-2, 10} are replaced with positive weights {1 , 7}.

[0105] In the examples described above, it seems that the determination of the template cost could be improved. It can be observed that the template cost or template matching cost is computed using one single component (e.g. luma component) only. Also, the template matching cost does not consider the mode signaling cost, while in some coding modes, the signaling may have an impact on the Rate / distortion cost of a selected candidate. Furthermore, it can be seen in the examples described above, that the TM shape is fixed for all mode candidates, and it does not consider other mode parameters. Thus, there is a need for improving the template-based coding modes.

[0106] In the present document, the wording template-based cost and template matching cost can be used interchangeably.

[0107] Embodiments are provided here for improving template-based coding modes, that is coding modes that use template-based cost either for determining coding parameters such as a motion vector or an intra prediction mode, or refining derived coding parameters, or reordering candidates predictor for a block, etc...

[0108] Some of the embodiments described herein can include at least one of determining a template matching cost using at least two components (e.g. luma and chroma components), determining a template matching cost that includes a mode signaling cost (e.g. candidate index) or determining a template matching cost wherein the shape of the template is adapted according to a given criteria. For example, such a criteria can be at least one of a mode candidate, or a coding parameter of the coding mode. The TM shape can be implicitly derived as a function of some mode parameters (e.g. spatial candidate position relatively to the current block). The TM cost may be re-normalized appropriately when compared with template costs having different shape sizes.

[0109] According to a general embodiment, a method for encoding or decoding a block of a video is provided wherein the block is encoded / decoded using a coding mode that uses one or more template-based cost. Such a general embodiment is for example illustrated on FIG. 8 which shows a method 800 for encoding / decoding a block of a video. At 810, for a given coding mode that uses template-based cost, coding mode parameters are determined based on one or more template-based costs. The determination of the templatebased cost is adapted according to the coding mode.

[0110] In one embodiment, the one or more template-based costs are determined using a first cost obtained for a first component of the block, e.g. the luminance, and at least one additional cost determined for the block. In a variant, the additional cost is a template-based cost determined for another component of the block, for example a chrominance component. In another variant, the additional cost is a cost for signaling one or more syntax elements of the coding mode.

[0111] In another embodiment, the one or more template-based costs are determined using a template shape that is adapted according to a given criteria, such as the coding mode, or the candidate used in the coding mode.

[0112] At 820, once the parameters of the coding mode have been determined, the prediction for the block is obtained based on the coding mode and at 830, the block is encoded or decoded based on the prediction.

[0113] Embodiments mentioned above at step 810 are further described below along with further variants for these embodiments. These embodiments / variants can be used alone or in combination to further enhance the template-based cost determination or to reduce the complexity of the template-based cost determination. The embodiments / variants above and below are described considering a given coding mode that makes use of template-based cost for determining the parameters of the coding mode. These parameters can be either a candidate motion, a selected candidate in a candidate list, an intra mode prediction, a geometric splitting mode, weights for weighted prediction, etc..

[0114] For example, the embodiments / variants described above and below apply to any coding modes, when applicable, of the ECM algorithm mentioned above. For example, the coding mode is one of an intra mode that uses the template-based cost for deriving intra prediction mode, a merge mode that uses the template-based cost for reordering a list of candidates motion, an adaptive motion vector prediction mode that uses the template-based cost for reordering a list of candidates motion, a geometric partitioning mode that uses the templatebased cost for determining motion of geometric partitions, a geometric partitioning mode that uses the template-based cost for reordering a list of candidates splitting mode for the block, a merge mode that uses the template-based cost for determining weights for a block-based weighted bi-prediction.

[0115] The embodiments / variants can also apply to any coding mode that necessitates the determination of a template-based cost.

[0116] In ECM, several coding tools (e.g. TIMD, ARMC-TM, GPM-TM, GPM-SPLIT-TM, BCW-TM) estimate the cost of a set of candidate modes using template-based cost. The cost is measured as the difference between the reconstructed samples in the template and prediction obtained for the template using a considered candidate mode. The difference measure function may be the SAD (sum of absolute difference), SATD (Hadamard), MR-SAD (mean removed SAD), MR-SATD (mean-removed SATD) or any quadratic error function such as MSE (sum of squared errors) for instance. In general, the difference is measured with one single component which is the luminance samples.

[0117] In this embodiment described here, the difference is measured with several components, that is at least two components, nc>1 , nc being the number of components used in the templatebased cost determination. The two components may be the luminance and the chrominance component(s). The final measure is then the sum of the nc measures.

[0118] In a variant, the final measure can be a weighted sum of the nc measures, with pre-defined weights associated to each component. In a further variant, the weights may depend on the chroma format.

[0119] For example, in case of 4:4:4 RGB, one may use equal weights for each RGB component. In another example, in case of 4:4:4 YCbCr, one may use un-equal weights (ex: 4,1 ,1 ) respectively to emphasize distortion in Luma component. In another example, in case of 4:2:0 YCbCr, using equal weights would emphasize Luma implicitly since the number of samples in template of Y component is larger than the number of samples in template of Cb or Cr component.

[0120] In a variant, the use of one or more components for determining the template-based cost may be signaled to a decoder.

[0121] Or, in another variant, the use of one or more components for determining the template-based cost can be derived implicitly from the coding mode. For instance, in case of an intra mode where prediction modes are different for luma and chroma or in case of dual-tree, then the regular difference measure using a single component (nc=1 ) is used, whereas in case of an intra mode where prediction modes are identical for luma and chroma, a combination of several difference measures (nc > 1 ) is used.

[0122] In another variant, several components (ex: nc=3) are used for inter modes only, or for a subset of inter modes (e.g. BCW-TM).

[0123] FIG. 9 illustrates a method 900 for encoding / decoding a block of a video according to this embodiment. In this embodiment, at 910, parameters of the coding mode are determined for the block based on one or more template-based cost, with the template-based cost being determined using at least two components according to any of the variants described above. Once the parameters of the coding mode have been determined for the block, at 920 a prediction for the block is obtained based on the coding mode and at 930, the block is encoded or decoded based on the prediction. In another variant, to reduce the complexity, the cost is first computed only on one component for all candidates considered in the coding mode and the additional components’ costs are added only for the best N candidates (e.g. N=3, or N can have a different value for each tool / coding mode). For example, depending on the metric considered, the best candidates are the tested candidates that provide the lowest template-based costs. This variant allows to refine the template-based costs for these N best candidates and thus to improve the candidate among the others if the template-based cost is used for refining a candidate or to improve the reordering of the candidates of the template-based cost is for reordering the candidate list.

[0124] In some embodiments, the number of candidates for which more than one component is used in the template-based cost depends on the cost of a candidate obtained using only the first component compared to the best candidate’s cost obtained on this component. For example, if the cost of a candidate is under t*BestCost (with e.g. t=1 .1 ) this candidate has its cost refined using another component. The best candidate has also its cost refined using another component so that these two candidates can be further compared. This variant allows to refine the template-based cost of candidates that are too close and thus to further enhance the discrimination between close candidates.

[0125] As mentioned previously, according to an embodiment, the additional cost can be a cost for signaling one or more syntax elements of the coding mode. In ECM, the coding tools using the TM for re-ordering candidates (ex: ARMC-TM, GPM-TM, GPM-SPLI-TM), selecting the candidates (ex: BCW-TM, TIMD) and / or deriving the weighting fusion (ex: TIMD) use difference measure as cost function.

[0126] In this embodiment, the estimation cost (VLC, index number or Iog2(index num)) or the actual coding cost (using CABAC entropy coding for instance) of the signaling is added in the computation of the template-based cost. For example, the signaling can comprise at least one of an index of a candidate in a list of candidates ordered according to the template-based cost, a motion vector residual from a motion vector predictor determined using the template-based cost, a flag indicating use of a template-based cost for determining motion information of block partitions in a geometry block partitioned block, an intra-prediction mode or a geometric splitting mode index, ....

[0127] For example, the template-based cost is determined by cost = diff + A. bits, where diff is the difference measure determined on the template samples, bits is the estimated coding mode signaling cost and A may be the Lagrangian (pre-determined value that may be function of the picture type and / or the quantization parameter) or any other equivalent re-scaling factor related to the difference measure function. Indeed, the regular Lagrangian based formulae use MSE rather than SAD, then the value of A can be adjusted accordingly. FIG 10 illustrates a method 1000 for encoding / decoding a block of a video according to an embodiment, wherein the additional cost is used for refining the template-based cost initially determined. At 1010, template-matching costs are determined for all candidates considered in the coding mode. At 1020, a candidate that provides the lowest template-matching cost is determined as best candidate. At 1030, a loop is performed on the other candidates or on a subset of the other candidates, and it is verified whether the template-matching cost for the candidate is close to the template-matching cost of the best candidate. For instance, it is verified whether or not a difference between the template-based cost of the candidate and the template-based cost of the best candidate is below a given value.

[0128] If this is the case, the template-matching cost of the candidate and the template-matching cost of the best candidate are refined using an additional cost. This additional cost can be a template-based cost determined for another component or a cost for signaling one or more syntax elements of the coding mode associated with the candidate. Once the templatematching costs have been refined, parameters of the coding mode are determined based on the refined template-matching costs and the block is encoded / decoded as in the method of FIG. 8 or 9.

[0129] In ECM, the TM shape is either fixed (pre-determined set of samples on top and / or left of the current block to encode or decode) or the TM shape is explicitly signaled (e.g. GPM-TM).

[0130] According to an embodiment, the TM-shape is not explicitly signaled but it is derived implicitly from coding parameters of the current block.

[0131] In a variant, the TM shape may be derived from the block shape: for example, when W>k*H, the template is made of the above reconstructed samples of the block, where {W, H, k} are the width and height of the current block and k is a pre-defined value (e.g. k=4) respectively. When H>k*W, the template is made of the left reconstructed samples of the block only Left template is used.

[0132] For example, this variant can be used when the coding mode is an intra mode or when the coding mode is an inter mode and the at least one template-based cost is used for reordering a candidate list.

[0133] In another variant, the TM shape is defined based on the candidate that is considered for the template-matching cost. That is the TM shape is different for some candidates. For example, in case of an angular intra prediction, if the intraPredAngle is negative, then the TM shape is made of the reconstructed samples Left and Above the current block. In another example, if the intraPredAngle is zero (or abs(intraPredAngle) < TMthreshold) and vertical direction, then the TM shape is made of the reconstructed samples above the current block only, whereas if the intraPred Angle is zero (or abs(intraPredAngle) < TMthreshold) and horizontal direction, then the TM shape is made of the reconstructed samples on the left of the current block only, where TMthreshold is a given threshold. FIG. 7 illustrates an example of the intra prediction directions for a current block to encode / decode.

[0134] In another variant, the template shape is determined based on a location of a candidate with respect to the block to encode / decode. FIG. 15 illustrates an example of neighboring blocks used to derive spatial candidates.

[0135] For example, if the block is coded in a merge mode and if the merge candidate is a spatial candidate and the spatial candidate is situated above (or above-right) the block (for example referenced by 2, 3 on FIG. 15), the TM shape is made of the reconstructed samples above the block only ({Above}), whereas if the merge candidate is spatial and the spatial candidate is situated left (or below-left) the block (for example referenced by 1 , 4 on FIG. 15), the TM shape is made of the reconstructed samples on the left of the block only ({Left}). In other cases, the TM shape is made of the reconstructed samples above the block and the reconstructed samples on the left of the block ({Above + Left}). Similar conditions for defining the template shape could also be applied when the candidate is a spatial non-adjacent block as illustrated on FIG. 15 (blocks 6-7, 9-12, 14,17, 19, 22).

[0136] In the case where several candidates use template shape of different size, the difference measure on the template may be re-normalized. For example, if the reference TM shape (ex: {Above + Left}) contains NR samples, then the re-normalization applied for the difference ( Diffc) measured with a TM shape made of Ncsamples can be made as follows:

[0137] Diff = ( Diffc x Nc ) / N , where Diff is the re-normalized measure.

[0138] FIG 11 illustrates a method 1 100 for encoding / decoding a block of a video according to the embodiment wherein the template shape is defined depending on a coding parameter of the block. At 1 110, the coding parameters and template shape are determined for the block based on the coding mode. The coding mode uses one or more template-based costs. For each template-based cost that is used in the coding mode, the template shape is determined according to any of the variants described above. At 1 120, once the parameters of the coding mode have been determined, a prediction is determined based on the coding mode and at 1 130, the block is encoded or decoded based on the prediction.

[0139] FIG. 12 illustrates a block diagram of a system within which aspects of the present embodiments may be implemented, according to another embodiment. FIG. 12 shows one embodiment of an apparatus 1200 for encoding or decoding a video according to any one of the embodiments described herein. The apparatus comprises Processor 1210 and can be interconnected to a memory 1220 through at least one port. Both Processor 1210 and memory 1220 can also have one or more additional interconnections to external connections.

[0140] Processor 1210 is also configured to obtain a prediction for at least one block of a video based on a coding mode, wherein the coding mode uses at least one template-based cost, the template-based cost being determined using at least one first cost obtained for a first component of the block, encode or decode the block based on the prediction, wherein the at least one template-based cost is determined using at least one additional cost determined for the block, according to any one of the embodiments described herein.

[0141] In another embodiment, Processor 1210 is also configured to obtain a prediction for the block based on a coding mode, wherein the coding mode uses at least one template-based cost, encode or decode the block based on the prediction, wherein the at least one template-based cost is determined using a template shape derived from at least one parameter of the coding mode.

[0142] For instance, the processor 1210 uses a computer program product comprising code instructions that implements any one of embodiments described herein.

[0143] In an embodiment, illustrated in FIG. 13, in a transmission context between two remote devices A and B over a communication network NET, the device A comprises a processor in relation with memory RAM and ROM which are configured to implement a method for encoding a video, as described with FIG. 1 -12 and the device B comprises a processor in relation with memory RAM and ROM which are configured to implement a method for decoding a video as described in relation with FIG 1 -12. In accordance with an example, the network is a broadcast network, adapted to broadcast / transmit a coded video from device A to decoding devices including the device B.

[0144] FIG. 14 shows an example of the syntax of a signal transmitted over a packet-based transmission protocol. Each transmitted packet P comprises a header H and a payload PAYLOAD. In some embodiments, the payload PAYLOAD may comprise video data encoded according to any one of the embodiments described above. The payload can also comprise any signaling as described above.

[0145] Various implementations involve decoding. “Decoding”, as used in this application, can encompass all or part of the processes performed, for example, on a received encoded sequence in order to produce a final output suitable for display. In various embodiments, such processes include one or more of the processes typically performed by a decoder, for example, entropy decoding, inverse quantization, inverse transformation, and differential decoding. In various embodiments, such processes also, or alternatively, include processes performed by a decoder of various implementations described in this application, for example, entropy decoding a sequence of binary symbols to reconstruct image or video data.

[0146] As further examples, in one embodiment “decoding” refers only to entropy decoding, in another embodiment “decoding” refers only to differential decoding, and in another embodiment “decoding” refers to a combination of entropy decoding and differential decoding, and in another embodiment “decoding” refers to the whole reconstructing picture process including entropy decoding. Whether the phrase “decoding process” is intended to refer specifically to a subset of operations or generally to the broader decoding process will be clear based on the context of the specific descriptions and is believed to be well understood by those skilled in the art.

[0147] Various implementations involve encoding. In an analogous way to the above discussion about “decoding”, “encoding” as used in this application can encompass all or part of the processes performed, for example, on an input video sequence in order to produce an encoded bitstream. In various embodiments, such processes include one or more of the processes typically performed by an encoder, for example, partitioning, differential encoding, transformation, quantization, and entropy encoding. In various embodiments, such processes also, or alternatively, include processes performed by an encoder of various implementations described in this application, for example, determining re-sampling filter coefficients, resampling a decoded picture.

[0148] As further examples, in one embodiment “encoding” refers only to entropy encoding, in another embodiment “encoding” refers only to differential encoding, and in another embodiment “encoding” refers to a combination of differential encoding and entropy encoding. Whether the phrase “encoding process” is intended to refer specifically to a subset of operations or generally to the broader encoding process will be clear based on the context of the specific descriptions and is believed to be well understood by those skilled in the art.

[0149] Note that the syntax elements as used herein, are descriptive terms. As such, they do not preclude the use of other syntax element names.

[0150] This disclosure has described various pieces of information, such as for example syntax, that can be transmitted or stored, for example. This information can be packaged or arranged in a variety of manners, including for example manners common in video standards such as putting the information into an SPS, a PPS, a NAL unit, a header (for example, a NAL unit header, picture header or a slice header), or an SEI message. Other manners are also available, including for example manners common for system level or application level standards such as putting the information into one or more of the following: a. SDP (session description protocol), a format for describing multimedia communication sessions for the purposes of session announcement and session invitation, for example as described in RFCs and used in conjunction with RTP (Real-time Transport Protocol) transmission. b. DASH MPD (Media Presentation Description) Descriptors, for example as used in DASH and transmitted over HTTP, a Descriptor is associated to a Representation or collection of Representations to provide additional characteristic to the content Representation. c. RTP header extensions, for example as used during RTP streaming. d. ISO Base Media File Format, for example as used in OMAF and using boxes which are object-oriented building blocks defined by a unique type identifier and length also known as 'atoms' in some specifications. e. HLS (HTTP live Streaming) manifest transmitted over HTTP. A manifest can be associated, for example, to a version or collection of versions of a content to provide characteristics of the version or collection of versions.

[0151] When a figure is presented as a flow diagram, it should be understood that it also provides a block diagram of a corresponding apparatus. Similarly, when a figure is presented as a block diagram, it should be understood that it also provides a flow diagram of a corresponding method / process.

[0152] Some embodiments refer to rate distortion optimization. In particular, during the encoding process, the balance or trade-off between the rate and distortion is usually considered, often given the constraints of computational complexity. The rate distortion optimization is usually formulated as minimizing a rate distortion function, which is a weighted sum of the rate and of the distortion. There are different approaches to solve the rate distortion optimization problem. For example, the approaches may be based on an extensive testing of all encoding options, including all considered modes or coding parameters values, with a complete evaluation of their coding cost and related distortion of the reconstructed signal after coding and decoding. Faster approaches may also be used, to save encoding complexity, in particular with computation of an approximated distortion based on the prediction or the prediction residual signal, not the reconstructed one. Mix of these two approaches can also be used, such as by using an approximated distortion for only some of the possible encoding options, and a complete distortion for other encoding options. Other approaches only evaluate a subset of the possible encoding options. More generally, many approaches employ any of a variety of techniques to perform the optimization, but the optimization is not necessarily a complete evaluation of both the coding cost and related distortion.

[0153] The implementations and aspects described herein can be implemented in, for example, a method or a process, an apparatus, a software program, a data stream, or a signal. Even if only discussed in the context of a single form of implementation (for example, discussed only as a method), the implementation of features discussed can also be implemented in other forms (for example, an apparatus or program). An apparatus can be implemented in, for example, appropriate hardware, software, and firmware. The methods can be implemented in, for example, a processor, which refers to processing devices in general, including, for example, a computer, a microprocessor, an integrated circuit, or a programmable logic device. Processors also include communication devices, such as, for example, computers, cell phones, portable / personal digital assistants ("PDAs"), and other devices that facilitate communication of information between end-users.

[0154] Reference to “one embodiment” or “an embodiment” or “one implementation” or “an implementation”, as well as other variations thereof, means that a particular feature, structure, characteristic, and so forth described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of the phrase “in one embodiment” or “in an embodiment” or “in one implementation” or “in an implementation”, as well any other variations, appearing in various places throughout this application are not necessarily all referring to the same embodiment.

[0155] Additionally, this application may refer to “determining” various pieces of information. Determining the information can include one or more of, for example, estimating the information, calculating the information, predicting the information, or retrieving the information from memory.

[0156] Further, this application may refer to “accessing” various pieces of information. Accessing the information can include one or more of, for example, receiving the information, retrieving the information (for example, from memory), storing the information, moving the information, copying the information, calculating the information, determining the information, predicting the information, or estimating the information.

[0157] Additionally, this application may refer to “receiving” various pieces of information. Receiving is, as with “accessing”, intended to be a broad term. Receiving the information can include one or more of, for example, accessing the information, or retrieving the information (for example, from memory). Further, “receiving” is typically involved, in one way or another, during operations such as, for example, storing the information, processing the information, transmitting the information, moving the information, copying the information, erasing the information, calculating the information, determining the information, predicting the information, or estimating the information.

[0158] It is to be appreciated that the use of any of the following “and / or”, and “at least one of”, for example, in the cases of “A / B”, “A and / or B” and “at least one of A and B”, is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of both options (A and B). As a further example, in the cases of “A, B, and / or C” and “at least one of A, B, and C”, such phrasing is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of the third listed option (C) only, or the selection of the first and the second listed options (A and B) only, or the selection of the first and third listed options (A and C) only, or the selection of the second and third listed options (B and C) only, or the selection of all three options (A and B and C). This may be extended, as is clear to one of ordinary skill in this and related arts, for as many items as are listed.

[0159] Also, as used herein, the word “signal” refers to, among other things, indicating something to a corresponding decoder. In this way, in an embodiment the same parameter is used at both the encoder side and the decoder side. Thus, for example, an encoder can transmit (explicit signaling) a particular parameter to the decoder so that the decoder can use the same particular parameter. Conversely, if the decoder already has the particular parameter as well as others, then signaling can be used without transmitting (implicit signaling) to simply allow the decoder to know and select the particular parameter. By avoiding transmission of any actual functions, a bit savings is realized in various embodiments. It is to be appreciated that signaling can be accomplished in a variety of ways. For example, one or more syntax elements, flags, and so forth are used to signal information to a corresponding decoder in various embodiments. While the preceding relates to the verb form of the word “signal”, the word “signal” can also be used herein as a noun.

[0160] As will be evident to one of ordinary skill in the art, implementations can produce a variety of signals formatted to carry information that can be, for example, stored or transmitted. The information can include, for example, instructions for performing a method, or data produced by one of the described implementations. For example, a signal can be formatted to carry the bitstream of a described embodiment. Such a signal can be formatted, for example, as an electromagnetic wave (for example, using a radio frequency portion of spectrum) or as a baseband signal. The formatting can include, for example, encoding a data stream and modulating a carrier with the encoded data stream. The information that the signal carries can be, for example, analog or digital information. The signal can be transmitted over a variety of different wired or wireless links, as is known. The signal can be stored on a processor- readable medium.

[0161] A number of embodiments has been described above. Features of these embodiments can be provided alone or in any combination, across various claim categories and types.

Claims

CLAIMS1 . A method, comprising: obtaining a prediction for at least one block of a video based on a coding mode, wherein the coding mode uses at least one template-based cost, the templatebased cost being determined using at least one first cost obtained for a first component of the block, encoding or decoding the block based on the prediction, wherein the at least one template-based cost is determined using at least one additional cost determined for the block.

2. An apparatus comprising one or more processors configured to: obtain a prediction for at least one block of a video based on a coding mode, wherein the coding mode uses at least one template-based cost, the templatebased cost being determined using at least one first cost obtained for a first component of the block, encode or decode the block based on the prediction, wherein the at least one template-based cost is determined using at least one additional cost determined for the block.

3. The method of claim 1 or the apparatus of claim 2, wherein the additional cost is a template-based cost obtained for another component of the block.

4. The method or the apparatus of claim 3, wherein the first component is a luminance component, and the other component is a chrominance component.

5. The method of any of claims 1 or 3-4 or the apparatus of any of claims claim 2-4, wherein the at least one template-based cost is a weighted sum of the first cost and the at least one additional cost.

6. The method of the apparatus of claim 5, wherein the weights depend on a chroma format of the chrominance component.

7. The method of any one of claims 1 or 3-6, or the apparatus of any one of claims 2- 6, wherein using the at least one additional cost for the block depends on the coding mode.

8. The method of any one of claims 1 or 3-7, or the apparatus of any one of claims 2- 7, wherein determining the at least one template-based cost comprises determining a first template-based cost for a given number of candidates using the first cost and determining a second template-based cost for a subset of the candidates using the first cost and the additional cost.

9. The method or the apparatus of claim 8, wherein candidates of the subset for which the second template-based cost is determined using the first cost and the additional cost are candidates for which a difference between the first template-based cost and a first template-based of a best candidate is below a given value.

10. The method of any one of claims 1 or 3-9, or the apparatus of any one of claims 2- 9, wherein the additional cost is a cost for signaling one or more syntax element associated to the coding mode.1 1. The method or the apparatus of claim 10, wherein the one or more syntax element associated to the coding mode comprises at least one of: an index of a candidate in a list of candidates ordered according to the at least one template-based cost, a motion vector residual from a motion vector predictor determined using the at least one template-based cost, a flag indicating use of a template-based cost for determining motion information of block partitions in a geometry block partitioned block.

12. A method, comprising, for at least one block of a video: obtaining a prediction for the block based on a coding mode, wherein the coding mode uses at least one template-based cost, encoding or decoding the block based on the prediction, wherein the at least one template-based cost is determined using a template shape that is determined based on at least one parameter of the coding mode.

13. An apparatus, comprising one or more processors operable to for at least one block of a video: obtain a prediction for the block based on a coding mode, wherein the coding mode uses at least one template-based cost, encode or decode the block based on the prediction,wherein the at least one template-based cost is determined using a template shape derived from at least one parameter of the coding mode.

14. The method of claim 12 or the apparatus of claim 13, wherein the coding mode is an intra mode and the template shape is derived based on an angular intra prediction mode.

15. The method of claim 12 or the apparatus of claim 13, wherein the coding mode is a merge mode and the template shape depends on a location of a spatial merge candidate with respect to the block.

16. The method of claim 12 or 14 or the apparatus of claim 13 or 14, wherein the coding mode is an intra mode or the coding mode is an inter mode and the at least one template-based cost is used for reordering a candidate list, the template shape is derived from a shape of the block.

17. The method or the apparatus of claim 16, wherein if a width of the block is higher than k times a height of the block, the template is formed by pixels above the block or if the height of the block is higher than k times the width of the block, the template is formed by pixels which are left to the block.

18. The method of any of claims 1 , 3-12 or 14-17 or the apparatus of any of claims 2-1 1 or 13-17, wherein the coding mode is one of: an intra mode that uses the template-based cost for deriving intra prediction mode,- a merge mode that uses the template-based cost for reordering a list of candidates motion,- an adaptive motion vector prediction mode that uses the template-based cost for reordering a list of candidates motion,- a geometric partitioning mode that uses the template-based cost for determining motion of geometric partitions,- a geometric partitioning mode that uses the template-based cost for reordering a list of candidates splitting mode for the block,- a merge mode that uses the template-based cost for determining weights for a block-based weighted bi-prediction.

19. A computer program product including instructions for causing one or more processors to carry out the method of any of claims 1 , 3-9, 1 1 -12 or 14-18.

20. A non-transitory computer readable medium storing executable program instructions to cause a computer executing the program instructions to perform a method according to any of claims 1 , 3-9, 1 1 -12 or 14-18.21 . A device comprising: an apparatus according to claim 2-11 , or 13-18; and at least one of (i) an antenna configured to receive or transmit a signal, the signal including data representative of a video, (ii) a band limiter configured to limit the signal to a band of frequencies that includes the data representative of video, or (iii) a display configured to display the video.

22. A device according to claim 21 , wherein the device comprises at least one of a television, a cell phone, a tablet, a set-top box.

Citation Information

Patent Citations

  • Variable template size for template matching

    US20190253722A1

  • Predictive coding concept using template matching

    WO2018146151A1

  • Method, apparatus, and medium for video processing

    WO2023051652A1

  • Method and apparatus of implicit linear model derivation using multiple reference lines for cross-component prediction

    WO2024074125A1