Method, device and medium for video decoding

By generating an independent current block template in video decoding, the dependence of the intra prediction mode on the intra coding block is solved, the video decoding efficiency is improved, and a faster template matching process is achieved.

CN116746151BActive Publication Date: 2024-10-29TENCENT AMERICA LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202280009025.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-21
Publication Date
2024-10-29
Estimated Expiration
2042-09-21

AI Technical Summary

Technical Problem

In existing video coding technology, the intra prediction mode has a dependence on the intra-coded spatial neighboring blocks, resulting in coding delay and low efficiency. Especially in template matching technology, the template generation of the current block depends on the reconstructed neighboring pixels. Cannot be decoded independently.

Method used

By extracting the initial template of the current block in video decoding, it is judged whether its sample is included in the intra-frame coding block. If included, an independent current template is generated, and the motion vector is determined based on the template to avoid direct dependence on the intra-frame coding block. Implement template matching without waiting for decoding of intra-coded blocks.

Benefits of technology

The decoding delay of intra-frame coding blocks is reduced, the efficiency and speed of video decoding are improved, and the dependence on intra-frame coding blocks is reduced, making the video decoding process more independent and efficient.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116746151B_ABST
    Figure CN116746151B_ABST
Patent Text Reader

Abstract

Aspects of the present disclosure provide methods and apparatus for performing video decoding. The method includes: decoding prediction information of a current block in a current picture from a video bitstream, the prediction information indicating a template matching (TM) mode for the current block, determining whether at least one sample in a first template of the current block is included in an intra-coded block that is a spatial neighboring block of the current block, the first template of the current block including (1) one or more samples of a top neighboring block of the current block and (2) one or more samples of a left neighboring block of the current block; in response to (i) determining that the at least one sample in the first template is included in the intra-coded block and (ii) the TM mode is applied to the current block, excluding the at least one sample from the first template to generate a second template of the current block; determining a motion vector (MV) of the current block based on the second template of the current block; and reconstructing the current block based on the determined MV.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of priority to U.S. Patent Application No. 17 / 942,036, filed on September 9, 2022, “CONSTRAINED TEMPLATE MATCHING,” which claims the benefit of priority to U.S. Provisional Application No. 63 / 281,772, filed on November 22, 2021, “Constrained Template Matching.” The entire disclosure of the prior application is incorporated herein by reference. Technical Field

[0003] The present disclosure generally relates to the field of data processing, and more particularly to a method, apparatus, and medium for video decoding. Background Art

[0004] The background description provided herein is for the purpose of generally presenting the context of the present disclosure. To the extent the work is described in this background section, the work of the presently named inventors and aspects of the description that may not otherwise be qualified as prior art at the time of filing are neither explicitly nor implicitly admitted to be prior art against the present disclosure.

[0005] An uncompressed digital image and / or video may include a series of pictures, each with spatial dimensions of, for example, 1920×1080 luminance samples and associated chrominance samples. The series of pictures may have a fixed or variable picture rate (also informally referred to as a frame rate), such as 60 pictures per second or 60 Hz. Uncompressed images and / or videos have specific bit rate requirements. For example, 1080p60 4:2:0 video at 8 bits per sample (1920×1080 luminance sample resolution at 60 Hz frame rate) requires a bandwidth of nearly 1.5 Gbit / s. One hour of such video requires more than 600 gigabytes of storage space.

[0006] One purpose of image and / or video encoding and decoding can be to reduce redundancy in input image and / or video signals by compression. Compression can help reduce the bandwidth and / or storage space requirements mentioned above, in some cases by two orders of magnitude or more. Although the description herein uses video encoding / decoding as an illustrative example, the same techniques can be applied to image encoding / decoding in a similar manner without departing from the spirit of the present disclosure. Both lossless compression and lossy compression and their combinations can be used. Lossless compression refers to a technique that can reconstruct an exact copy of the original signal based on the compressed original signal. When lossy compression is used, the reconstructed signal may be different from the original signal, but the distortion between the original signal and the reconstructed signal is small enough to make the reconstructed signal useful for the intended application. In the case of video, lossy compression is widely used. The amount of distortion tolerated depends on the application; for example, users of certain consumer streaming applications may tolerate higher distortion than users of television distribution applications. The achievable compression ratio can reflect that a higher allowable / tolerable distortion can produce a higher compression ratio.

[0007] Video encoders and decoders may utilize techniques from several broad categories including, for example, motion compensation, transform processing, quantization, and entropy coding.

[0008] Video codec techniques may include techniques known as intra-frame coding. In intra-frame coding, sample values ​​are represented without reference to samples or other data from previously reconstructed reference pictures. In some video codecs, pictures are spatially subdivided into sample blocks. When all sample blocks are encoded in intra-frame mode, the picture may be an intra-frame picture. Intra-frame pictures and their derivatives such as independent decoder refresh pictures can be used to reset the decoder state, and can therefore be used as the first picture in an encoded video bitstream and video session or as a still image. The samples of the intra-frame block can be subjected to transformation, and the transform coefficients can be quantized before entropy coding. Intra-frame prediction can be a technique for minimizing sample values ​​in the pre-transform domain. In some cases, the smaller the DC value after the transformation and the smaller the AC coefficient, the fewer bits are required to represent the block after entropy coding at a given quantization step size.

[0009] Traditional intra-frame coding used in, for example, MPEG (Moving Picture Experts Group, MPEG)-2 generation coding techniques does not use intra-frame prediction. However, some newer video compression techniques include techniques that attempt to perform predictions based on, for example, surrounding sample data and / or metadata obtained during encoding and / or decoding of a data block. Such techniques are hereinafter referred to as "intra-frame prediction" techniques. Note that, in at least some cases, intra-frame prediction uses reference data only from the current picture being reconstructed, and does not use reference data from reference pictures.

[0010] There can be many different forms of intra-frame prediction. When more than one such technique can be used in a given video coding technique, the specific technique used can be encoded as a specific intra-frame prediction mode that uses the specific technique. In some cases, an intra-frame prediction mode can have sub-modes and / or parameters, where the sub-modes and / or parameters can be encoded separately or included in a mode codeword that defines the prediction mode used. Which codeword is used for a given mode, sub-mode and / or parameter combination can have an impact on the coding efficiency gain through intra-frame prediction, and therefore the entropy coding technique used to convert the codeword into a bitstream.

[0011] Some modes of intra prediction were introduced with H.264, refined in H.265, and further refined in newer coding techniques such as the Joint Exploration Model (JEM), Versatile Video Coding (VVC), and Benchmark set (BMS). The prediction block can be formed using the values ​​of neighboring samples of samples that are already available. Sample values ​​of neighboring samples are copied into the prediction block according to the direction. A reference to the direction in use can be encoded in the bitstream, or the reference to the direction in use can be predicted itself.

[0012] Template matching technology can be used in video / image coding. In order to further improve the compression efficiency of the VVC standard, for example, template matching (TM) can be used to refine the MV. In the example, TM is used at the decoder side. In TM mode, the MV can be refined by constructing a template of a block in the current picture to be reconstructed (e.g., the current block) and determining the closest match between the template of the block in the current picture and multiple templates in the reference picture. In an embodiment, the template of the block in the current picture may include the left neighboring reconstructed samples of the block and the top neighboring reconstructed samples of the block. Template matching technology can also be used in video / image coding other than VVC.

[0013] In a related template matching method, a template of a current block is generated by reconstructed neighboring pixels of the current block. Since the TM of the current block cannot be performed until all neighboring pixels used in the template of the current block are reconstructed, additional dependencies arise. For example, for hardware in which the inter-frame pipeline and the intra-frame pipeline are separated, additional dependencies may be undesirable. Therefore, at the decoder side, if the intra-coded neighboring blocks are not decoded when the current block is being reconstructed, the samples in the neighboring blocks are unavailable. Therefore, reconstruction of the current block cannot be performed until the intra-coded neighboring blocks are decoded. The dependency of the template of the current block on the intra-coded neighboring blocks causes encoding delays for the current block. Summary of the invention

[0014] Aspects of the present disclosure provide methods and apparatus for video encoding and decoding.

[0015] In some examples, a method for performing video decoding includes: decoding prediction information of a current block in a current picture from a video bitstream, the prediction information indicating a template matching (TM) mode for the current block, determining whether at least one sample in a first template of the current block is included in an intra-coded block that is a spatial neighboring block of the current block, the first template of the current block including (1) one or more samples of a top neighboring block of the current block and (2) one or more samples of a left neighboring block of the current block; in response to (i) determining that the at least one sample in the first template is included in the intra-coded block and (ii) the TM mode is applied to the current block, excluding the at least one sample from the first template to generate a second template of the current block; determining a motion vector (MV) of the current block based on the second template of the current block; and reconstructing the current block based on the determined MV.

[0016] In some examples, a device for performing video decoding includes a decoding module, a determination module, a second template generation module, a motion vector determination module, and a reconstruction module. The decoding module is configured to decode prediction information of a current block in a current picture from a video bitstream. The prediction information indicates a template matching (TM) mode for the current block. The determination module determines whether at least one sample in an initial template (also referred to as a first template) of the current block is included in an intra-coded block that is a spatial neighboring block of the current block. The initial template of the current block includes samples of one or more top neighboring blocks of the current block and / or samples of one or more left neighboring blocks of the current block. If at least one sample in the initial template is included in an intra-coded block, the motion vector determination module determines the motion vector (MV) of the current block based on (i) the initial MV of the current block without applying the TM mode or (ii) based on the initial MV of the current block and a current template (also referred to as a second template) generated based on the initial template and omitting at least one sample included in the intra-coded block in the initial template. The reconstruction module reconstructs the current block based on the determined MV.

[0017] In an embodiment, a determination module determines whether at least one sample in a first template of a current block is included in an intra-coded block that is a spatial neighboring block of the current block. The first template of the current block may include (1) one or more samples of one or more top neighboring blocks of the current block and (2) one or more samples of one or more left neighboring blocks of the current block. In an example, one or more top neighboring blocks are top neighboring blocks. In an example, one or more left neighboring blocks are left neighboring blocks. In response to the determination module determining that at least one sample in the first template is included in the intra-coded block, the second template generation module may exclude the at least one sample from the first template to generate a second template of the current block. The motion vector determination module may determine the MV of the current block based on the second template of the current block.

[0018] In an example, in response to (i) determining that at least one sample in the first template is included in an intra-coded block and (ii) the TM mode is applied to the current block, the second template generation module may exclude the at least one sample from the first template to generate a second template for the current block.

[0019] In an embodiment, the determination module determines that at least one sample in the initial template of the current block is included in the intra-coded block. The motion vector determination module determines the MV based on the initial MV of the current block without applying the TM mode.

[0020] In an embodiment, the initial template of the current block includes an initial top template including one or more top neighboring blocks and an initial left template including samples of one or more left neighboring blocks. The determination module determines that at least one sample in the initial template of the current block is included in an intra-coded block. If one or more left neighboring blocks of the current block do not include an intra-coded block, the motion vector determination module uses a TM mode based on an initial MV and a current template composed of the initial left template to determine the MV of the current block. If one or more top neighboring blocks of the current block do not include an intra-coded block, the motion vector determination module uses a TM mode based on an initial MV and a current template composed of an initial top template to determine the MV of the current block.

[0021] In an embodiment, the determination module determines that at least one sample in the initial template of the current block is included in the intra-coded block. The motion vector determination module determines the MV of the current block using a TM mode based on the initial MV and the current template of the current block.

[0022] In an embodiment, the apparatus further comprises a second template interpolation module, which generates at least one interpolated sample by interpolating based on one or more samples in the current template. The at least one interpolated sample corresponds to at least one sample included in the intra-coded block in the initial template. The current template of the current block also comprises the at least one interpolated sample.

[0023] In an embodiment, a reference sample in a reference template corresponding to a current template of a current block is located at a sub-pixel position in a reference picture. The apparatus further comprises a reference template interpolation module, which interpolates the reference template using a filter having less than four taps to generate an interpolated reference template in the reference picture. The motion vector determination module determines the MV of the current block using a TM mode based on an initial MV, the current template of the current block, and the interpolated reference template.

[0024] In an example, a reference template in a reference picture omits at least one reference sample in the reference picture corresponding to at least one sample included in an intra-coded block in an initial template of a current block. The apparatus further comprises a reference template filling module that generates a filling sample corresponding to a reference sample in the omitted at least one reference sample in the reference picture by copying the closest reference sample in the reference picture. The apparatus further comprises a reference template interpolation module that generates an interpolated reference template in the reference picture by interpolation based on the filling sample.

[0025] In an example, a reference template in a reference picture omits at least one reference sample in the reference picture corresponding to at least one sample included in an intra-coded block in an initial template of a current block. The apparatus further comprises a reference template interpolation module that generates an interpolated reference template in the reference picture by interpolating based on the omitted at least one reference sample in the reference picture.

[0026] In an embodiment, a reference sample in an initial reference template corresponding to an initial template of a current block is located at a sub-pixel position in a reference picture. The apparatus further comprises a reference template interpolation module that generates an intermediate reference template in the reference picture using interpolation performed on the initial reference template. The apparatus further comprises a reference template generation module that generates a reference template corresponding to a current template of the current block based on the intermediate reference template and a mask. The shape of the mask may be determined based on the current template of the current block.

[0027] In an embodiment, at least one sample included in the intra-coded block in the initial template includes: (i) one or more left samples of samples of one or more left neighboring blocks; or (ii) one or more top samples of samples of one or more top neighboring blocks. If at least one sample in the initial template includes the one or more left samples, the current template further includes one or more extended left samples adjacent to the samples of the one or more left neighboring blocks included in the current template. The one or more extended left samples are not included in the intra-coded block of the current picture.

[0028] If at least one sample in the initial template includes the one or more top samples, the current template further includes one or more extended top samples adjacent to samples of the one or more top neighboring blocks included in the current template. The one or more extended top samples are not included in the intra-coded block of the current picture.

[0029] In an example, the number of samples in the current template is 150% of the number of samples in the initial template.

[0030] In an example, the number of samples in the current template is 200% of the number of samples in the initial template.

[0031] Aspects of the present disclosure also provide a computer device comprising: one or more computer-readable non-transitory storage media, the one or more computer-readable non-transitory storage media being configured to store computer program code; and one or more computer processors, the one or more computer processors being configured to access the computer program code and execute a method for video decoding as indicated by the computer program code.

[0032] Aspects of the present disclosure also provide a non-transitory computer-readable medium storing a program executable by at least one processor to perform a method for video decoding.

[0033] The disclosed embodiments provide a method and apparatus for video decoding, a computer device, and a non-transitory computer-readable storage medium. The method includes: decoding prediction information of a current block in a current picture from a video bitstream, the prediction information indicating a TM mode for the current block, determining whether at least one sample in a first template of the current block is included in an intra-coded block that is a spatial neighboring block of the current block, the first template of the current block including (1) one or more samples of a top neighboring block of the current block and (2) one or more samples of a left neighboring block of the current block; in response to (i) determining that the at least one sample in the first template is included in the intra-coded block and (ii) the TM mode is applied to the current block, excluding the at least one sample from the first template to generate a second template of the current block; determining an MV of the current block based on the second template of the current block; and reconstructing the current block based on the determined MV. A method and apparatus, a computer device, and a non-transitory computer-readable storage medium for video decoding, so that the template of a block (e.g., a current block) in a current picture is constrained so that the TM of the block has no dependency on spatially adjacent blocks encoded within the frame, thereby reducing the encoding delay of the current block caused by the dependency of the template of the current block on adjacent blocks encoded within the frame. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Additional features, properties, and various advantages of the disclosed subject matter will become more apparent from the following detailed description and accompanying drawings, in which:

[0035] Figure 1A is a schematic illustration of an exemplary subset of intra prediction modes.

[0036] Figure 1B is a diagram of exemplary intra prediction directions.

[0037] FIG2 shows an example of a current block and surrounding samples.

[0038] Figure 3 is a schematic illustration of an exemplary block diagram of a communication system.

[0039] Figure 4 is a schematic illustration of an exemplary block diagram of a communication system.

[0040] Figure 5 is a schematic illustration of an exemplary block diagram of a decoder.

[0041] Figure 6 is a schematic illustration of an exemplary block diagram of an encoder.

[0042] Figure 7 A block diagram of an exemplary encoder is shown.

[0043] Figure 8A block diagram of an exemplary decoder is shown.

[0044] Fig. 9 An example of Template Matching (TM) is shown.

[0045] Fig.10 An example of a TM in affine merge mode is shown.

[0046] Fig.11 An example of a TM is shown.

[0047] Fig. 12A An example of a TM is shown.

[0048] Fig. 12B An example of a TM is shown.

[0049] Fig.13 An exemplary process for obtaining a reference template in a reference picture is shown.

[0050] Fig.14 An example of extending the current template in the TM is shown.

[0051] Fig.15 A flow chart outlining an encoding process according to an embodiment of the present disclosure is shown.

[0052] Fig.16 A flow chart outlining a decoding process according to an embodiment of the present disclosure is shown.

[0053] Fig.17 is a schematic illustration of a computer system according to an embodiment. DETAILED DESCRIPTION

[0054] Reference Figure 1A , depicted at the bottom right is a subset of nine predictor directions known from the 33 possible predictor directions defined in H.265 (corresponding to the 33 angular modes for the 35 intra modes). The point (101) where the arrows converge represents the sample being predicted. The arrows represent the direction in which the sample is predicted. For example, arrow (102) indicates that sample (101) is predicted based on one or more samples at an angle of 45 degrees to the horizontal line to the upper right. Similarly, arrow (103) indicates that sample (101) is predicted based on one or more samples at an angle of 22.5 degrees to the horizontal line to the lower left of sample (101).

[0055] Still refer to Figure 1A, depicted at the top left is a square block (104) of 4×4 samples (indicated by the bold dashed line). The square block (104) includes 16 samples, each of which is labeled with "S", its position in the Y dimension (e.g., row index), and its position in the X dimension (e.g., column index). For example, sample S21 is the second sample in the Y dimension (from the top) and the first sample in the X dimension (from the left). Similarly, sample S44 is the fourth sample in block (104) in both the Y and X dimensions. Since the size of the block is 4×4 samples, S44 is at the bottom right. Also shown are reference samples, which follow a similar numbering scheme. The reference samples are labeled with R, their Y position (e.g., row index), and X position (column index) relative to the block (104). In both H.264 and H.265, the prediction samples are adjacent to the block being reconstructed; therefore, there is no need to use negative values.

[0056] Intra-picture prediction can work by copying reference sample values ​​from neighboring samples indicated by a signaled prediction direction. For example, assume that the encoded video bitstream includes the following signaling, which indicates a prediction direction consistent with arrow (102) for this block - that is, the samples are predicted from the samples to the upper right at a 45 degree angle to the horizontal. In this case, samples S41, S32, S23, and S14 are predicted from the same reference sample R05. Then, sample S44 is predicted from reference sample R08.

[0057] In some cases, the values ​​of multiple reference samples may be combined, such as by interpolation, in order to compute a reference sample; particularly if the directions do not divide evenly by 45 degrees.

[0058] As video coding technology develops, the number of possible directions is also increasing. In H.264 (2003), nine different directions can be represented. In H.265 (2013), it increased to 33. Currently, JEM / VVC / BMS can support up to 65 directions. Experiments have been conducted to identify the most likely directions, and certain techniques in entropy coding are used to represent these possible directions with a small number of bits, thereby accepting certain penalties for less likely directions. In addition, the direction itself can sometimes be predicted based on the neighboring directions used in adjacent decoded blocks.

[0059] Figure 1B A schematic diagram (110) is shown depicting 65 intra prediction directions according to JEM to illustrate the increase in the number of prediction directions over time.

[0060] The mapping of intra-prediction direction bits representing directions in the coded video bitstream may vary from one video coding technique to another. Such mappings may range, for example, from simple direct mappings to codewords to complex adaptive schemes involving most probable modes and similar techniques. However, in most cases, there may be some directions that are statistically less likely to appear in the video content than some other directions. Since the goal of video compression is to reduce redundancy, in a video coding technique that works well, those less likely directions will be represented by a larger number of bits than more likely directions.

[0061] Image and / or video encoding and decoding may be performed using inter-picture prediction with motion compensation. Motion compensation may be a lossy compression technique and may involve the following technique: a block of sample data from a previously reconstructed picture or portion thereof (reference picture) is used to predict a newly reconstructed picture or picture portion after being spatially shifted in a direction indicated by a motion vector (hereinafter referred to as Motion Vector, MV). In some cases, the reference picture may be the same as the picture in the current reconstruction. The MV may have two dimensions, X and Y, or three dimensions, the third dimension being an indication of the reference picture used (the third dimension may indirectly be a temporal dimension).

[0062] In some video compression techniques, an MV applicable to a particular region of sample data can be predicted based on other MVs, for example, based on an MV of another region of sample data that is spatially adjacent to the region being reconstructed and that precedes the MV in decoding order. Doing so can significantly reduce the amount of data required to encode the MV, thereby eliminating redundancy and improving compression. MV prediction can work effectively, for example, because when encoding an input video signal obtained from a camera (called natural video), there is a statistical possibility that a larger region than the region to which a single MV applies moves in a similar direction, and therefore similar motion vectors derived from MVs of adjacent regions can be used in some cases to predict the larger region. This makes the MV found for a given region similar or identical to the MV predicted from the surrounding MVs, and can then be represented with fewer bits after entropy coding than would be used if the MV was encoded directly. In some cases, MV prediction can be an example of lossless compression of a signal (i.e., MV) derived from the original signal (i.e., sample stream). In other cases, MV prediction itself may be lossy, for example due to rounding errors when calculating a predictor based on several surrounding MVs.

[0063] Various MV prediction mechanisms are described in H.265 / HEVC (High Efficiency Video Coding, HEVC) (ITU-T (International Telecommunication Union-Telecommunication Standardization Sector, ITU-T) H.265 Recommendation, "High Efficiency Video Coding", December 2016). Among the various MV prediction mechanisms provided by H.265, the technique referred to as "spatial merging" hereinafter is described with reference to FIG. 2 .

[0064] 2, the current block (201) may include samples discovered by the encoder during a motion search process that can be predicted from a previous block of the same size that has been spatially shifted. Instead of encoding the MV directly, the MV associated with any of the five surrounding samples represented by A0, A1 and B0, B1, B2 (corresponding to 202 to 206, respectively) may be used to derive the MV from metadata associated with one or more reference pictures, for example, from the most recent (in decoding order) reference picture. In H.265, MV prediction can use a predictor from the same reference picture being used by a neighboring block.

[0065] Figure 3 An exemplary block diagram of a communication system (300) is shown. The communication system (300) includes a plurality of terminal devices that can communicate with each other via, for example, a network (350). For example, the communication system (300) includes a first pair of terminal devices (310) and (320) interconnected via the network (350). Figure 3 In the example, a first pair of terminal devices (310) and (320) perform unidirectional transmission of data. For example, the terminal device (310) can encode video data (e.g., a video picture stream captured by the terminal device (310)) for transmission to another terminal device (320) via a network (350). The encoded video data can be transmitted in the form of one or more encoded video bitstreams. The terminal device (320) can receive the encoded video data from the network (350), decode the encoded video data to recover the video picture, and display the video picture based on the recovered video data. Unidirectional data transmission may be common in media service applications, etc.

[0066] In another example, the communication system (300) includes a second pair of terminal devices (330) and (340) that perform bidirectional transmission of encoded video data, such as during a video conference. For the bidirectional transmission of data, in the example, each of the terminal devices (330) and (340) can encode video data (e.g., a video picture stream captured by the terminal device) for transmission to the other of the terminal devices (330) and (340) via the network (350). Each of the terminal devices (330) and (340) can also receive the encoded video data transmitted by the other of the terminal devices (330) and (340), and can decode the encoded video data to restore the video picture, and can display the video picture at an accessible display device based on the restored video data.

[0067] exist Figure 3 In the example of , terminal devices (310), (320), (330) and (340) are respectively shown as servers, personal computers and smart phones, but the principles of the present disclosure may not be so limited. Implementations of the present disclosure are applicable to laptop computers, tablet computers, media players and / or dedicated video conferencing equipment. Network (350) represents any number of networks that transmit encoded video data between terminal devices (310), (320), (330) and (340), including, for example, wired (wired) and / or wireless communication networks. Communication network (350) can exchange data in circuit switching channels and / or packet switching channels. Representative networks include telecommunication networks, local area networks, wide area networks and / or the Internet. For the purposes of this discussion, unless otherwise specified below, the architecture and topology of network (350) may be irrelevant to the operation of the present disclosure.

[0068] As examples of applications for the disclosed subject matter, Figure 4 A video encoder and a video decoder in a streaming environment are shown. The disclosed subject matter can be equally applicable to other video-enabled applications, including, for example, video conferencing, digital TV, streaming services, storing compressed video on digital media including CD (Compact Disc, CD), DVD (Digital Versatile Disc, DVD), memory sticks, etc.

[0069] The streaming system may include a capture subsystem (413) that may include a video source (401), such as a digital camera, that creates, for example, an uncompressed video picture stream (402). In an example, the video picture stream (402) includes samples captured by the digital camera. The video picture stream (402) is depicted as a thick line to emphasize the high amount of data when compared to the encoded video data (404) (or encoded video bitstream), which may be processed by an electronic device (420) coupled to the video source (401) including a video encoder (403). The video encoder (403) may include hardware, software, or a combination thereof to implement or embody aspects of the disclosed subject matter as described in more detail below. The encoded video data (404) (or encoded video bitstream) is depicted as a thin line to emphasize the lower amount of data when compared to the video picture stream (402), which can be stored on the streaming server (405) for future use. One or more streaming client subsystems such as Figure 4 The client subsystems (406) and (408) in the streaming server (405) can access the streaming server (405) to retrieve copies (407) and (409) of the encoded video data (404). The client subsystem (406) can include, for example, a video decoder (410) in an electronic device (430). The video decoder (410) decodes the incoming copy (407) of the encoded video data and creates an output video picture stream (411) that can be presented on a display (412) (e.g., a display screen) or another presentation device (not depicted). In some streaming systems, the encoded video data (404), (407) and (409) (e.g., a video bitstream) can be encoded according to certain video encoding / compression standards. Examples of these standards include ITU-T Recommendation H.265. In the example, the video coding standard under development is informally referred to as Versatile Video Coding (VVC). The disclosed subject matter can be used in the context of VVC.

[0070] Note that the electronic devices (420) and (430) may include other components (not shown). For example, the electronic device (420) may include a video decoder (not shown), and the electronic device (430) may also include a video encoder (not shown).

[0071] Figure 5 An exemplary block diagram of a video decoder (510) is shown. The video decoder (510) may be included in an electronic device (530). The electronic device (530) may include a receiver (531) (e.g., receiving circuitry). The video decoder (510) may be used to replace Figure 4 A video decoder (410) is shown in an example.

[0072] The receiver (531) may receive one or more encoded video sequences to be decoded by the video decoder (510). In an embodiment, one encoded video sequence is received at a time, wherein the decoding of each encoded video sequence is independent of the decoding of other encoded video sequences. The encoded video sequence may be received from a channel (501), which may be a hardware / software link to a storage device storing the encoded video data. The receiver (531) may receive the encoded video data as well as other data, such as encoded audio data and / or auxiliary data streams, which may be forwarded to their respective consuming entities (not depicted). The receiver (531) may separate the encoded video sequence from the other data. To prevent network jitter, a buffer memory (515) may be coupled between the receiver (531) and an entropy decoder / parser (520) (hereinafter referred to as "parser (520)"). In some applications, the buffer memory (515) is part of the video decoder (510). In other applications, the buffer memory (515) may be external to the video decoder (510) (not depicted). In still other applications, there may be a buffer memory (not depicted) external to the video decoder (510) to, for example, prevent network jitter, and there may be another buffer memory (515) internal to the video decoder (510) to, for example, handle playout timing. When the receiver (531) receives data from a store / forward device with sufficient bandwidth and controllability or from an isochronous network, the buffer memory (515) may not be required, or the buffer memory (515) may be smaller. In order to use a packet network such as the Internet as much as possible, a buffer memory (515) may be required, which may be relatively large and may advantageously have an adaptive size, and may be implemented at least in part in an operating system or similar element (not depicted) external to the video decoder (510).

[0073] The video decoder (510) may include a parser (520) to reconstruct symbols (521) from the encoded video sequence. The categories of these symbols include information for managing the operation of the video decoder (510) and potential information for controlling a presentation device such as a presentation device (512) (e.g., a display screen) that is not part of the electronic device (530) but can be coupled to the electronic device (530), such as Figure 5As shown. The control information for the rendering device may be in the form of a supplementary enhancement information (SEI (Supplemental Enhancement Information, SEI) message) or a video usability information (VUI (Video Usability Information, VUI)) parameter set fragment (not depicted). The parser (520) may parse / entropy decode the received coded video sequence. The encoding of the coded video sequence may be performed according to a video coding technique or standard, and may follow various principles, including variable length coding, Huffman coding, arithmetic coding with or without context sensitivity, etc. The parser (520) may extract a subgroup parameter set for at least one of the subgroups of pixels in the video decoder from the coded video sequence based on at least one parameter corresponding to the group. The subgroup may include a group of pictures (Group of Pictures, GOP), a picture, a tile, a slice, a macroblock, a coding unit (Coding Unit, CU), a block, a transform unit (Transform Unit, TU), a prediction unit (Prediction Unit, PU), etc. The parser (520) may also extract information such as transform coefficients, quantizer parameter values, motion vectors, etc. from the encoded video sequence.

[0074] The parser (520) may perform entropy decoding / parsing operations on the video sequence received from the buffer memory (515) to create symbols (521).

[0075] Depending on the type of coded video picture or part of coded video picture (e.g., inter-frame and intra-frame pictures, inter-frame blocks and intra-frame blocks) and other factors, the reconstruction of the symbol (521) may involve multiple different units. Which units are involved and how they are involved can be controlled by subgroup control information parsed by the parser (520) from the coded video sequence. For the sake of simplicity, such subgroup control information flow between the parser (520) and the following multiple units is not depicted.

[0076] In addition to the functional blocks already mentioned, the video decoder (510) can be conceptually subdivided into a number of functional units as described below. In a practical implementation operating under commercial constraints, many of these units interact closely with each other and may be at least partially integrated with each other. However, for the purpose of describing the disclosed subject matter, the conceptual subdivision into the following functional units is appropriate.

[0077] The first unit is a sealer / inverse transform unit (551). The sealer / inverse transform unit (551) receives quantized transform coefficients as symbols (521) from the parser (520) and control information including which transform to use, block size, quantization factor, quantization scaling matrix, etc. The sealer / inverse transform unit (551) can output a block including sample values, which can be input into an aggregator (555).

[0078] In some cases, the output samples of the scaler / inverse transform unit (551) may belong to an inter-coded block. An intra-coded block is a block that does not use predictive information from a previously reconstructed picture, but may use predictive information from a previously reconstructed portion of the current picture. Such predictive information may be provided by an intra-picture prediction unit (552). In some cases, the intra-picture prediction unit (552) uses surrounding already reconstructed information obtained from the current picture buffer (558) to generate a block of the same size and shape as the block being reconstructed. For example, the current picture buffer (558) buffers a partially reconstructed current picture and / or a fully reconstructed current picture. In some cases, the aggregator (555) adds the prediction information already generated by the intra-prediction unit (552) to the output sample information as provided by the scaler / inverse transform unit (551) on a per-sample basis.

[0079] In other cases, the output samples of the scaler / inverse transform unit (551) may belong to an inter-frame coded block and potentially a motion compensated block. In this case, the motion compensated prediction unit (553) may access the reference picture memory (557) to obtain samples for prediction. After the obtained samples are motion compensated according to the symbols (521) belonging to the block, these samples may be added to the output of the scaler / inverse transform unit (551) (in this case called residual samples or residual signals) by the aggregator (555) to generate output sample information. The address in the reference picture memory (557) at which the motion compensated prediction unit (553) obtains the predicted samples may be controlled by a motion vector, which may be used for the motion compensated prediction unit (553) in the form of a symbol (521), which may have, for example, an X component, a Y component and a reference picture component. Motion compensation may also include interpolation of sample values ​​such as those obtained from the reference picture memory (557) when using sub-sample accurate motion vectors, motion vector prediction mechanisms, etc.

[0080] The output samples of the aggregator (555) may be subjected to various loop filtering techniques in a loop filter unit (556). The video compression techniques may include in-loop filter techniques controlled by parameters included in the coded video sequence (also referred to as the coded video bitstream) and available to the loop filter unit (556) as symbols (521) from the parser (520). The video compression may also be responsive to meta-information obtained during decoding of a coded picture or a previous (in decoding order) portion of the coded video sequence, as well as to previously reconstructed and loop filtered sample values.

[0081] The output of the loop filter unit (556) may be a sample stream that may be output to a rendering device (512) and stored in a reference picture memory (557) for use in future inter-picture prediction.

[0082] Once fully reconstructed, certain coded pictures can be used as reference pictures for future prediction. For example, once a coded picture corresponding to a current picture is fully reconstructed and the coded picture has been identified as a reference picture (e.g., by the parser (520)), the current picture buffer (558) can become part of the reference picture memory (557) and a new current picture buffer can be reallocated before starting to reconstruct a subsequent coded picture.

[0083] The video decoder (510) may perform decoding operations according to a predetermined video compression technology or standard such as ITU-T H.265 Recommendation. The encoded video sequence may conform to the syntax specified by the video compression technology or standard used in the sense that the encoded video sequence follows both the syntax of the video compression technology or standard and the profile recorded in the video compression technology or standard. Specifically, the profile may select certain tools from all the tools available in the video compression technology or standard as tools available only under the profile. For compliance, the complexity of the encoded video sequence is also required to be within a range as defined by the hierarchy of the video compression technology or standard. In some cases, the hierarchy limits the maximum picture size, the maximum frame rate, the maximum reconstruction sampling rate (measured in, for example, mega samples per second), the maximum reference picture size, etc. In some cases, the limits set by the hierarchy may be further defined by the Hypothetical Reference Decoder (HRD) specification and metadata for HRD buffer management signaled in the encoded video sequence.

[0084] In an embodiment, the receiver (531) may receive additional (redundant) data along with the encoded video. The additional data may be included as part of the encoded video sequence. The video decoder (510) may use the additional data to properly decode the data and / or more accurately reconstruct the original video data. The additional data may be in the form of, for example, temporal, spatial or signal-to-noise ratio (SNR) enhancement layers, redundant slices, redundant pictures, forward error correction codes, etc.

[0085] Figure 6 An exemplary block diagram of a video encoder (603) is shown. The video encoder (603) is included in an electronic device (620). The electronic device (620) includes a transmitter (640) (e.g., a transmission circuit system). The video encoder (603) can be used to replace Figure 4 The video encoder (403) in the example.

[0086] The video encoder (603) can be obtained from a video source (601) (not Figure 6 In another example, the video source (601) is a part of the electronic device (620).

[0087] The video source (601) may provide a source video sequence in the form of a digital video sample stream to be encoded by a video encoder (603), the digital video sample stream may have any suitable bit depth (e.g., 8 bits, 10 bits, 12 bits, ...), any color space (e.g., BT.601 Y CrCB, RGB, ...), and any suitable sampling structure (e.g., YCrCb 4:2:0, Y CrCb 4:4:4). In a media service system, the video source (601) may be a storage device storing previously prepared videos. In a video conferencing system, the video source (601) may be a camera that captures local image information as a video sequence. The video data may be provided as a plurality of separate pictures that are given motion when viewed sequentially. The pictures themselves may be organized as a spatial pixel array, wherein each pixel may include one or more samples, depending on the sampling structure, color space, etc. used. The relationship between pixels and samples may be easily understood by those skilled in the art. The following description focuses on samples.

[0088] According to an embodiment, the video encoder (603) can encode and compress the pictures of the source video sequence into an encoded video sequence (643) in real time or under any other time constraints required. Implementing the appropriate encoding speed is a function of the controller (650). In some embodiments, the controller (650) controls other functional units as described below and is functionally coupled to the other functional units. For the sake of brevity, the coupling is not depicted. The parameters set by the controller (650) may include rate control related parameters (picture skipping, quantizer, lambda value of rate distortion optimization technology, ...), picture size, picture group (GOP) layout, maximum motion vector search range, etc. The controller (650) can be configured to have other suitable functions belonging to the video encoder (603) optimized for a specific system design.

[0089] In some embodiments, the video encoder (603) is configured to operate in an encoding loop. As a simplified description, in an example, the encoding loop may include a source encoder (630) (e.g., responsible for creating symbols, such as a symbol stream, based on an input picture to be encoded and a reference picture) and a (local) decoder (633) embedded in the video encoder (603). The decoder (633) reconstructs the symbols to create sample data in a manner similar to how the (remote) decoder would also create sample data. The reconstructed sample stream (sample data) is input to a reference picture memory (634). Since the decoding of the symbol stream produces a bit-accurate result that is independent of the decoder location (local or remote), the contents of the reference picture memory (634) are also bit-accurate between the local encoder and the remote encoder. In other words, the reference picture samples "seen" by the prediction part of the encoder are exactly the same as the sample values ​​that the decoder will "see" when using prediction during decoding. The basic principles of reference picture synchronization (and drift caused when synchronization cannot be maintained, such as due to channel errors) are also used in some related technologies.

[0090] The operation of the "local" decoder (633) can be combined with the "remote" decoder such as has been described above. Figure 5 The operation of the video decoder (510) described in detail is the same. However, reference is also briefly made to Figure 5 , since the symbols are available and the encoding of the symbols into a coded video sequence by the entropy encoder (645) and the decoding of the symbols by the parser (520) can be lossless, the entropy decoding portion of the video decoder (510) including the buffer memory (515) and the parser (520) may not be fully implemented in the local decoder (633).

[0091] In an embodiment, decoder techniques other than parsing / entropy decoding present in a decoder are present in a corresponding encoder in the same or substantially the same functional form. Therefore, the disclosed subject matter focuses on decoder operation. The description of encoder techniques can be simplified because encoder techniques are contrary to the decoder techniques described comprehensively. A more detailed description is provided below in some parts.

[0092] In some examples, during operation, the source encoder (630) may perform motion compensated predictive coding that predictively encodes an input picture with reference to one or more previously encoded pictures from a video sequence designated as "reference pictures." In this manner, the encoding engine (632) encodes the differences between pixel blocks of the input picture and pixel blocks of a reference picture that may be selected as a prediction reference for the input picture.

[0093] The local video decoder (633) can decode the encoded video data of the picture that can be designated as the reference picture based on the symbols created by the source encoder (630). The operation of the encoding engine (632) can advantageously be a lossy process. When the encoded video data can be decoded at the video decoder ( Figure 6 When the video encoder (603) is decoded at a remote location (not shown), the reconstructed video sequence may typically be a copy of the source video sequence with some errors. The local video decoder (633) replicates the decoding process that may be performed by the video decoder on the reference picture and may cause the reconstructed reference picture to be stored in the reference picture memory (634). In this way, the video encoder (603) may locally store a copy of the reconstructed reference picture that has common content (absent transmission errors) with the reconstructed reference picture to be obtained by the remote video decoder.

[0094] The predictor (635) may perform a prediction search for the encoding engine (632). That is, for a new picture to be encoded, the predictor (635) may search the reference picture memory (634) for sample data (as candidate reference pixel blocks) or specific metadata such as reference picture motion vectors, block shapes, etc. that may be used as appropriate prediction references for the new picture. The predictor (635) may operate on a pixel block by pixel block basis to find an appropriate prediction reference. In some cases, as determined by the search results obtained by the predictor (635), the input picture may have prediction references taken from multiple reference pictures stored in the reference picture memory (634).

[0095] The controller (650) can manage encoding operations of the source encoder (630), including, for example, setting parameters and subgroup parameters for encoding video data.

[0096] The outputs of all the above mentioned functional units may be subjected to entropy coding in an entropy encoder (645). The entropy encoder (645) converts the symbols generated by the various functional units into a coded video sequence by applying lossless compression to the symbols according to techniques such as Huffman coding, variable length coding, arithmetic coding, etc.

[0097] The transmitter (640) can buffer the encoded video sequence created by the entropy encoder (645) in preparation for transmission via a communication channel (660), which can be a hardware / software link to a storage device where the encoded video data will be stored. The transmitter (640) can combine the encoded video data from the video encoder (603) with other data to be transmitted, such as encoded audio data and / or auxiliary data streams (source not shown).

[0098] The controller (650) may manage the operation of the video encoder (603). During encoding, the controller (650) may assign a certain encoding picture type to each encoded picture, which may affect the encoding techniques that may be applied to the corresponding picture. For example, a picture may generally be assigned one of the following picture types:

[0099] An intra picture (I picture) may be a picture that can be encoded and decoded without using any other picture in the sequence as a prediction source. Some video codecs allow different types of intra pictures, including, for example, Independent Decoder Refresh ("IDR") pictures. Those skilled in the art are aware of those variations of I pictures and their corresponding applications and features.

[0100] A predictive picture (P picture) may be a picture that can be encoded and decoded using inter prediction or intra prediction to predict sample values ​​of each block using at most one motion vector and a reference index.

[0101] Bi-directional predictive pictures (B pictures), which can be pictures that can be encoded and decoded using inter-prediction or intra-prediction that uses up to two motion vectors and reference indices to predict sample values ​​for each block. Similarly, multi-predictive pictures can use more than two reference pictures and associated metadata for reconstruction of a single block.

[0102] The source picture may typically be spatially subdivided into a number of blocks of samples (e.g., blocks of 4×4, 8×8, 4×8, or 16×16 samples, respectively), and encoded block by block. The blocks may be predictively encoded with reference to other (already encoded) blocks, which are determined by the coding allocation applied to the corresponding picture of the block. For example, blocks of an I picture may be non-predictively encoded, or may be predictively encoded (spatial prediction or intra-frame prediction) with reference to already encoded blocks of the same picture. Pixel blocks of a P picture may be predictively encoded via spatial prediction or via temporal prediction with reference to one previously encoded reference picture. Blocks of a B picture may be predictively encoded via spatial prediction or via temporal prediction with reference to one or two previously encoded reference pictures.

[0103] The video encoder (603) may perform encoding operations according to a predetermined video encoding technique or standard, such as ITU-T H.265 Recommendation. In the operation of the video encoder (503), the video encoder (603) may perform various compression operations, including predictive encoding operations that exploit temporal and spatial redundancy in the input video sequence. Thus, the encoded video data may conform to the syntax specified by the video encoding technique or standard used.

[0104] In an embodiment, the transmitter (640) may transmit additional data along with the encoded video. The source encoder (630) may include such data as part of the encoded video sequence. The additional data may include temporal / spatial / SNR enhancement layers, other forms of redundant data such as redundant pictures and slices, SEI messages, VUI parameter set fragments, etc.

[0105] Video can be captured as multiple source pictures (video pictures) in a temporal sequence. Intra-picture prediction (often referred to simply as intra-picture prediction) exploits spatial correlation in a given picture, while inter-picture prediction exploits (temporal or other) correlations between pictures. In an example, a particular picture in encoding / decoding, which is referred to as the current picture, is divided into blocks. In the case where a block in the current picture is similar to a reference block in a reference picture that has been previously encoded in the video and is still buffered, the block in the current picture can be encoded by a vector called a motion vector. The motion vector points to a reference block in a reference picture, and in the case of using multiple reference pictures, the motion vector may have a third dimension that identifies the reference picture.

[0106] In some embodiments, a bidirectional prediction technique may be used in inter-picture prediction. According to the bidirectional prediction technique, two reference pictures are used, for example, a first reference picture and a second reference picture that are both before the current picture in the video in decoding order (but may be in the past and future in display order, respectively). A block in the current picture may be encoded by a first motion vector pointing to a first reference block in the first reference picture and a second motion vector pointing to a second reference block in the second reference picture. A block may be predicted by a combination of the first reference block and the second reference block.

[0107] In addition, merge mode techniques can be used in inter-picture prediction to improve coding efficiency.

[0108] According to some embodiments of the present disclosure, predictions such as inter-picture prediction and intra-picture prediction are performed in units of blocks. For example, according to the HEVC standard, a picture in a video picture sequence is divided into coding tree units (CodingTree Unit, CTU) for compression, and the CTUs in the picture have the same size, such as 64×64 pixels, 32×32 pixels, or 16×16 pixels. Typically, a CTU includes three coding tree blocks (Coding Tree Block, CTB), which are a luminance CTB and two chrominance CTBs. Each CTU can be recursively divided into one or more coding units (CU) in a quadtree. For example, a 64×64 pixel CTU can be divided into a 64×64 pixel CU, or 4 32×32 pixel CUs, or 16 16×16 pixel CUs. In the example, each CU is analyzed to determine the prediction type for the CU, such as an inter-frame prediction type or an intra-frame prediction type. The CU is divided into one or more prediction units (PUs) according to temporal and / or spatial predictability. Typically, each PU includes a luma prediction block (PB) and two chroma PBs. In an embodiment, the prediction operation in decoding (encoding / decoding) is performed in units of prediction blocks. Using a luma prediction block as an example of a prediction block, the prediction block includes a matrix of pixel values ​​(e.g., luma values), such as 8×8 pixels, 16×16 pixels, 8×16 pixels, 16×8 pixels, etc.

[0109] Figure 7 An exemplary diagram of a video encoder (703) is shown. The video encoder (703) is configured to receive a processed block (e.g., a predicted block) of sample values ​​within a current video picture in a sequence of video pictures, and encode the processed block into an encoded picture that is part of an encoded video sequence. In an example, the video encoder (703) is used instead of Figure 4 The video encoder (403) in the example.

[0110] In the HEVC example, the video encoder (703) receives a matrix of sample values ​​for a processing block, such as a prediction block of 8×8 samples. The video encoder (703) uses, for example, rate-distortion optimization to determine whether to use intra mode, inter mode, or bidirectional prediction mode to best encode the processing block. In the case where the processing block is to be encoded in intra mode, the video encoder (703) can use intra prediction techniques to encode the processing block into an encoded picture; and in the case where the processing block is to be encoded in inter mode or bidirectional prediction mode, the video encoder (703) can use inter prediction or bidirectional prediction techniques to encode the processing block into an encoded picture, respectively. In some video coding techniques, the merge mode can be an inter-picture prediction submode, in which motion vectors are derived from one or more motion vector predictors without the aid of encoded motion vector components external to the predictor. In some other video coding techniques, there may be motion vector components applicable to the subject block. In the example, the video encoder (703) includes other components, such as a mode decision module (not shown) for determining the mode of the processing block.

[0111] exist Figure 7 In this example, the video encoder (703) includes Figure 7 An inter-frame encoder (730), an intra-frame encoder (722), a residual calculator (723), a switch (726), a residual encoder (724), a general controller (721), and an entropy encoder (725) are shown coupled together.

[0112] The inter-frame encoder (730) is configured to: receive samples of a current block (e.g., a processing block); compare the block with one or more reference blocks in a reference picture (e.g., blocks in a previous picture and a subsequent picture); generate inter-frame prediction information (e.g., description of redundant information, motion vectors, merge mode information according to an inter-frame coding technique); and calculate an inter-frame prediction result (e.g., a prediction block) based on the inter-frame prediction information using any suitable technique. In some examples, the reference picture is a decoded reference picture that is decoded based on the encoded video information.

[0113] The intra encoder (722) is configured to: receive samples of a current block (e.g., a processing block); compare the block with an already encoded block in the same picture in some cases; generate quantization coefficients after transformation; and in some cases also generate intra prediction information (e.g., intra prediction direction information according to one or more intra coding techniques). In an example, the intra encoder (722) also calculates an intra prediction result (e.g., a prediction block) based on the intra prediction information and a reference block in the same picture.

[0114] The general controller (721) is configured to determine general control data and control other components of the video encoder (703) based on the general control data. In an example, the general controller (721) determines the mode of the block and provides a control signal to the switch (726) based on the mode. For example, when the mode is intra mode, the general controller (721) controls the switch (726) to select the intra mode result for use by the residual calculator (723), and controls the entropy encoder (725) to select intra prediction information and include the intra prediction information in the bitstream; and when the mode is inter mode, the general controller (721) controls the switch (726) to select the inter prediction result for use by the residual calculator (723), and controls the entropy encoder (725) to select the inter prediction information and include the inter prediction information in the bitstream.

[0115] The residual calculator (723) is configured to calculate the difference (residual data) between the received block and the prediction result selected from the intra-frame encoder (722) or the inter-frame encoder (730). The residual encoder (724) is configured to operate based on the residual data to encode the residual data to generate transform coefficients. In an example, the residual encoder (724) is configured to convert the residual data from the spatial domain to the frequency domain and generate transform coefficients. The transform coefficients are then subjected to quantization to obtain quantized transform coefficients. In various embodiments, the video encoder (703) also includes a residual decoder (728). The residual decoder (728) is configured to perform an inverse transform and generate decoded residual data. The decoded residual data can be used appropriately by the intra-frame encoder (722) and the inter-frame encoder (730). For example, the inter encoder (730) can generate a decoded block based on the decoded residual data and the inter prediction information, and the intra encoder (722) can generate a decoded block based on the decoded residual data and the intra prediction information. The decoded blocks are appropriately processed to generate a decoded picture, and in some examples, the decoded picture can be buffered in a memory circuit (not shown) and used as a reference picture.

[0116] The entropy encoder (725) is configured to format the bitstream to include the encoded blocks. The entropy encoder (725) is configured to include various information in the bitstream according to a suitable standard, such as the HEVC standard. In an example, the entropy encoder (725) is configured to include general control data, selected prediction information (e.g., intra-frame prediction information or inter-frame prediction information), residual information, and other suitable information in the bitstream. Note that in accordance with the disclosed subject matter, when the block is encoded in inter-frame mode or the merge sub-mode of the bidirectional prediction mode, there is no residual information.

[0117] Figure 8An exemplary diagram of a video decoder (810) is shown. The video decoder (810) is configured to receive an encoded picture as part of an encoded video sequence and decode the encoded picture to generate a reconstructed picture. In an example, the video decoder (810) is used to replace Figure 4 A video decoder (410) is shown in an example.

[0118] exist Figure 8 In this example, the video decoder (810) includes Figure 8 An entropy decoder (871), an inter-frame decoder (880), a residual decoder (873), a reconstruction module (874) and an intra-frame decoder (872) are shown coupled together.

[0119] The entropy decoder (871) may be configured to reconstruct certain symbols from the encoded picture, which represent syntax elements constituting the encoded picture. Such symbols may include, for example, a mode for encoding a block (such as, for example, an intra-frame mode, an inter-frame mode, a bidirectional prediction mode, a merged sub-mode of an inter-frame mode and a bidirectional prediction mode, or another sub-mode), and prediction information (such as, for example, intra-frame prediction information or inter-frame prediction information) of certain samples or metadata used by the intra-frame decoder (872) or the inter-frame decoder (880) for prediction. The symbol may also include residual information in the form of, for example, quantized transform coefficients. In an example, when the prediction mode is an inter-frame mode or a bidirectional prediction mode, the inter-frame prediction information is provided to the inter-frame decoder (880); and when the prediction type is an intra-frame prediction type, the intra-frame prediction information is provided to the intra-frame decoder (872). The residual information may be subjected to inverse quantization and provided to the residual decoder (873).

[0120] The inter-frame decoder (880) is configured to receive the inter-frame prediction information and generate an inter-frame prediction result based on the inter-frame prediction information.

[0121] The intra decoder (872) is configured to receive intra prediction information and generate a prediction result based on the intra prediction information.

[0122] The residual decoder (873) is configured to perform inverse quantization to extract dequantized transform coefficients, and process the dequantized transform coefficients to convert residual information from the frequency domain to the spatial domain. The residual decoder (873) may also require certain control information (to include quantizer parameters (Quantizer Parameter, QP)), and the information may be provided by the entropy decoder (871) (since this may only be a small amount of control information, the data path is not depicted).

[0123] The reconstruction module (874) is configured to combine the residual information output by the residual decoder (873) with the prediction result (in this case, it can be output by the inter-frame prediction module or the intra-frame prediction module) in the spatial domain to form a reconstructed block, which can be part of a reconstructed picture, which in turn can be part of a reconstructed video. Note that other suitable operations such as deblocking operations can be performed to improve visual quality.

[0124] Note that the video encoders (403), (603) and (703) and the video decoders (410), (510) and (810) may be implemented using any suitable technology. In an embodiment, the video encoders (403), (603) and (703) and the video decoders (410), (510) and (810) may be implemented using one or more integrated circuits. In another embodiment, the video encoders (403), (603) and (703) and the video decoders (410), (510) and (810) may be implemented using one or more processors that execute software instructions.

[0125] Various inter prediction modes can be used in VVC. For an inter-predicted CU, motion parameters may include MV, one or more reference picture indexes, a reference picture list usage index, and additional information of certain coding features to be used for inter-prediction sample generation. Motion parameters may be signaled explicitly or implicitly. When a CU is encoded in skip mode, the CU may be associated with a PU and may not have valid residual coefficients, may not have encoded motion vector increments or MV differences (e.g., MVD (MV Difference, MVD)), or may not have reference picture indexes. A merge mode may be specified in which the motion parameters of the current CU are obtained from neighboring CUs, including spatial candidates, temporal candidates, and / or additional scheduling (e.g., scheduling introduced in VVC). Instead of supporting only skip mode, merge mode may also be applied to inter-predicted CUs. In an example, an alternative to merge mode is to explicitly transmit motion parameters, wherein MV, corresponding reference picture indexes for each reference picture list, and reference picture list usage flags and other information are explicitly signaled per CU.

[0126] In an embodiment, for example in VVC, the VVC Test Model (VTM) reference software includes one or more refined inter-frame prediction coding tools, and the refined inter-frame prediction coding tools include: extended merge prediction, merge motion vector difference (MMVD) mode, adaptive motion vector prediction (Adaptive Motion Vector Prediction, AMVP) mode with symmetric MVD (Motion Vector Difference, MVD) signaling, affine motion compensation prediction, sub-block-based temporal motion vector prediction (Subblock-based Temporal Motion Vector Predictor, SbTMVP), adaptive motion vector resolution (Adaptive Motion Vector Resolution, AMVR), motion field storage (1 / 16 luminance sample MV storage and 8×8 motion field compression), bi-prediction with CU-level Weight (Bi-prediction with CU-level Weight, BCW), bi-directional optical flow (Bi-direction Optical Flow, BDOF), prediction refinement using optical flow (Prediction Refinement using Optical Flow, PROF), Decoder Side Motion Vector Refinement (DMVR), Combined Inter and Intra Prediction (CIIP), Geometric Partitioning Mode (GPM), etc.

[0127] Template matching technology can be used in video / image coding. In order to further improve the compression efficiency of the VVC standard, for example, template matching (TM) can be used to refine the MV. In the example, TM is used at the decoder side. In TM mode, the MV can be refined by constructing a template of a block in the current picture to be reconstructed (e.g., the current block) and determining the closest match between the template of the block in the current picture and multiple templates in the reference picture. In an embodiment, the template of the block in the current picture may include the left neighboring reconstructed samples of the block and the top neighboring reconstructed samples of the block. Template matching technology can also be used in video / image coding other than VVC.

[0128] Fig. 9 An example of template matching (900) is shown. Fig. 9As shown, template matching can be used to obtain motion information of the current CU (901) by determining the closest match between the template (921) of the current CU (901) in the current picture (910) and the template (925) in the reference picture (911). The template (921) of the current CU (901) can have any suitable shape and any suitable size.

[0129] In an embodiment, the template (921) of the current CU (901) includes a top template (922) and a left template (923). Each of the top template (922) and the left template (923) can have any suitable shape and any suitable size.

[0130] The top template (922) may include samples from one or more top neighboring blocks of the current CU (901). In an example, the top template (922) includes four rows of samples from one or more top neighboring blocks of the current CU (901). The left template (923) may include samples from one or more left neighboring blocks of the current CU (901). In an example, the left template (922) includes four columns of samples from one or more left neighboring blocks of the current CU (901).

[0131] The template (925) in the reference picture (911) corresponds to the template (921) in the current picture (910). In an embodiment, the initial MV (902) points from the current CU (901) to the reference block (903) in the reference picture (911). The template (925) in the reference picture (911) and the template (921) in the current picture (910) may have the same shape and the same size. For example, the template (925) includes a top template (926) in the reference picture (911) and a left template (927) in the reference picture (911). The top template (926) may include samples in one or more top neighboring blocks of the reference block (903). The left template (927) may include samples in one or more left neighboring blocks of the reference block (903).

[0132] A TM cost may be determined based on a template (921) and a template (925). The TM cost may indicate a match between the template (921) and the template (925). An optimized MV may be determined based on a search performed around an initial MV (902) of the current CU (901) within a search range (915). The search range (915) in the reference picture (911) may include a [-L, L] pixel range, where L is a positive integer such as 8 (e.g., 8 samples). For example, a difference (e.g., [0, 1]) is determined based on the search range (915), and an intermediate MV is determined by the sum of the initial MV (902) and the difference (e.g., [0, 1]). An intermediate reference block and a corresponding template in the reference picture (911) may be determined based on the intermediate MV. A TM cost may be determined based on the template (921) and the intermediate template in the reference picture (911). The TM cost may correspond to a difference determined based on the search range (915) (e.g., [0, 0], [0, 1], etc. corresponding to the initial MV (902)). In an example, the difference corresponding to the minimum TM cost is selected, and the optimized MV is the sum of the difference corresponding to the minimum TM cost and the initial MV (902).

[0133] The TM may be applied in affine merging mode and may be referred to as an affine TM. Fig.10 An example of a TM (1000) in an affine merge mode is shown. The template (1021) of the current block (eg, current CU) (1001) may correspond to a template in a TM applied to a translational motion model (eg, Fig. 9 The reference template (1025) of the reference block in the reference picture may include a control point MV (CPMV) obtained from a neighboring sub-block at the CU boundary (e.g., Fig.10 A0 to A3 and L0 to L3) as shown - points to multiple sub-blocks (e.g., 4×4 sub-blocks).

[0134] The search process of the TM applied to the affine merge mode can start from CPMV0 while keeping the other CPMVs (for example, (i) CPMV1 in the case of using a 4-parameter model, or (ii) CPMV1 and CPMV2 in the case of using a 6-parameter model) constant. The search can be performed in the horizontal direction and the vertical direction. In the example, the search is performed in the diagonal direction only when the zero vector is not the best difference vector found from the horizontal search and the vertical search. The affine TM can repeat the same search process for CPMV1. If a 6-parameter model is used, the affine TM can repeat the same search process for CPMV2. Based on the refined CPMV, the entire search process can be restarted from the refined CPMV0 when the zero vector is not the best difference vector from the previous iteration and the search process iterations are less than 3 times.

[0135] In a related template matching method, a template of a current block (e.g., template (921) or (1021)) is generated by reconstructed neighboring pixels of the current block. In some examples, additional dependencies may occur because the TM of the current block cannot be performed before all neighboring pixels used in the template of the current block are reconstructed. For example, for hardware in which the inter-frame pipeline and the intra-frame pipeline are separated, the additional dependencies may be undesirable. In some examples, the template of the current block includes samples in neighboring blocks that are intra-coded (at the decoder side) or to be intra-coded (at the encoder side). Therefore, at the decoder side, if the intra-coded neighboring blocks are not decoded when the current block is being reconstructed, the samples in the neighboring blocks are unavailable. Therefore, reconstruction of the current block cannot be performed until the intra-coded neighboring blocks are decoded. The dependency of the template of the current block on the intra-coded neighboring blocks may cause encoding delays for the current block. The present disclosure includes implementations that can remove the dependencies described above and thereby reduce such delays.

[0136] The present disclosure includes embodiments related to constrained template matching. According to embodiments of the present disclosure, the template of a block (eg, current block) in a current picture is derived with constraints such that the TM of the block has no dependency on spatially neighboring blocks encoded within the frame.

[0137] The template of the current block in the current picture can be generated without using samples (or pixels) from the intra-coded block in the current picture. Therefore, at the decoder side, the decoder does not need to wait for the intra-coded block to be decoded before using TM to reconstruct the current block, and the decoding speed can be improved.

[0138] In an embodiment, prediction information of a current block in a current picture may be decoded from a video bitstream. The prediction information may indicate a TM mode for the current block. It may be determined whether a sample in an initial template of the current block is included in an intra-coded block that is a spatially adjacent block of the current block. The initial template of the current block may include samples of one or more top adjacent blocks of the current block and / or samples of one or more left adjacent blocks of the current block. In response to determining that the sample in the initial template is included in an intra-coded block, the MV of the current block may be determined based on: (i) the initial MV of the current block without applying the TM mode; or (ii) the initial MV of the current block and a current template generated based on the initial template and omitting the samples included in the intra-coded block in the initial template. The current block may be reconstructed based on the determined MV.

[0139] Fig.11 An example of template matching (1100) is shown. Fig. 9 Described in Fig.11The current CU (901), template (921), initial MV (902), template (925), current picture (910) and reference picture (911) in FIG. 9 . Template (921) is an initial template of a current block (e.g., current CU (901)). In an embodiment, it is determined that samples in an initial template (e.g., template (921)) of a current block (e.g., (901)) are included in an intra-coded block. Based on determining that samples in the initial template are included in an intra-coded block, an MV may be determined based on an initial MV (e.g., initial MV (902)) of the current block (e.g., current CU (901)) without applying a TM mode. In an example, the MV is an initial MV (e.g., initial MV (902)) of the current block (e.g., current CU (901)).

[0140] Reference Fig.11 In the example, the top template (922) includes sub-templates (922(1) to 922(3)), and the left template (923) includes sub-templates (923(1) to 923(3)). Sub-templates (922(1)), (922(3)), (923(1)), and (923(3)) do not include samples in intra-coded blocks in the current picture (910). Sub-templates (922(2)) and (923(2)) include samples in intra-coded blocks in the current picture (910). In the example, the MV is an initial MV (e.g., initial MV (902)) of a current block (e.g., current CU (901)), and TM is not applied to the current CU (901).

[0141] In the example, samples (or pixels) of a template (e.g., (921)) used to generate a current block (e.g., (901)) are checked. If any of the pixels in the template (e.g., (921)) of the current block (e.g., (901)) belongs to an intra-coded block, the template (e.g., (921)) of the current block (e.g., (901)) is marked as unavailable, wherein the template (e.g., (921)) includes a top template (e.g., (922)) and a left template (e.g., (923)).

[0142] In an example, a top template (e.g., (922)) and a left template (e.g., (923)) are generated separately. When the top template (e.g., (922)) and / or the left template (e.g., (923)) are available, the TM can be used. In an example, if no pixels in the top template (e.g., (922)) belong to an intra-coded block, the top template (e.g., (922)) is available. In an example, if no pixels in the left template (e.g., (923)) belong to an intra-coded block in the current picture (910), the left template (e.g., (923)) is available.

[0143] Reference Fig.11 In the example, an initial template (e.g., (921)) of a current block (e.g., (901)) includes an initial top template (e.g., (922)) including samples of one or more top neighboring blocks and an initial left template (e.g., (923)) including samples of one or more left neighboring blocks. It is determined that the samples in the initial template (e.g., (921)) of the current block are included in an intra-coded block. In response to one or more left neighboring blocks of the current block (e.g., (901)) not including an intra-coded block, the MV of the current block may be determined using a TM mode based on an initial MV (e.g., (902)) and a current template (e.g., (923)) composed of the initial left template (e.g., (923)). In response to one or more top neighboring blocks of the current block (e.g., (901)) not including an intra-coded block, the MV of the current block can be determined using a TM mode based on an initial MV (e.g., (902)) and a current template (e.g., (922)) composed of an initial top template (e.g., (922)).

[0144] In an embodiment, samples (or pixels) of an initial template (template (921)) used to generate a current block (e.g., (901)) are checked. Samples belonging to intra-coded blocks may be excluded from a current template of the current block. After samples in intra-coded blocks are excluded from the current template, corresponding samples in the reference template may be excluded when calculating a matching error between the current template and a reference template.

[0145] Fig. 12A An example of TM (1200A) is shown, where Fig. 9 and Fig.11 Described in Fig. 12A The current CU (901), the initial MV (902), the current picture (910), the reference picture (911), the sub-templates (922 (1)), (922 (3)), (923 (1)) and (923 (3)). Fig.11 and Fig. 12A, the initial template of the current CU (901) is template (921). It is determined that the samples in the initial template (921) of the current CU (901) are included in the intra-frame coding block. The MV of the current CU (901) can be determined using a TM mode based on the initial MV (902) and the current template (1221) of the current CU (901). In the example, the samples included in the intra-frame coding block in the initial template (921) include samples in sub-templates (922 (2)) and (923 (2)). The current template (1221) of the current CU (901) may include sub-templates (922 (1)), (922 (3)), (923 (1)) and (923 (3)). The current template (1221) of the current CU (901) omits samples in sub-templates (922 (2)) and (923 (2)). In an example, the current template (1221) includes samples in an inter-coded block and / or an intra-block copy (IBC) coded block.

[0146] Return to reference Fig.11 In the reference picture (911), the top template (926) may include sub-templates (926(1)) to (926(3)) corresponding to sub-templates (922(1)) to (922(3)), and the left template (927) may include sub-templates (927(1)) to (927(3)) corresponding to sub-templates (923(1)) to (923(3)). Fig. 12A , the reference template (1225) may correspond to the current template (1221), wherein the reference template (1225) includes sub-templates (926(1)), (926(3)), (927(1)) and (927(3)). The reference template (1225) omits sub-templates (926(2)) and (927(2)).

[0147] In the example, the current template (1221) includes a top template (1222) and a left template (1223). The top template (1222) includes sub-templates (922(1)) and (922(3)). The left template (1223) includes sub-templates (923(1)) and (923(3)). The reference template (1225) includes a top template (1226) and a left template (1227). The top template (1226) includes sub-templates (926(1)) and (926(3)). The left template (1227) includes sub-templates (927(1)) and (927(3)).

[0148] The current template of the current CU (901) may include any samples in the initial template of the current CU (901) that are not included in the intra-coded block. The current template of the current CU (901) may omit any samples in the initial template of the current CU (901) that are included in the intra-coded block. Fig. 12B An example of TM (1200B) is shown, where Fig. 9 and Fig.11 Described in Fig. 12B The current CU (901), the initial MV (902), the current picture (910), the reference picture (911), the top templates (922) and (926), and the sub-templates (923(2)) to (923(3)) and (927(2)) to (927(3)).

[0149] Reference Fig.11 and Fig. 12B , the initial template of the current CU (901) is template (921). The samples included in the intra-frame coding block in the initial template (921) include samples in the sub-template (923(1)). The current template (1321) of the current CU (901) may include a top template (922) and sub-templates (923(2)) to (923(3)). The current template (1321) of the current CU (901) omits samples in the sub-template (923(1)). The reference template (1325) may correspond to the current template (1321), wherein the reference template (1325) includes a top template (926) and sub-templates (927(2)) to (927(3)). The reference template (1325) omits the sub-template (927(1)).

[0150] In an example, omitted pixels (e.g., intra-coded pixels) in a current template (e.g., current template (1221) or (1321)) are interpolated based on available pixels in the current template. In an example, interpolated samples may be generated by interpolation based on one or more samples in the current template (e.g., current template (1221) or (1321)). The interpolated samples may correspond to (replace) samples included in an intra-coded block in an initial template (e.g., (921)). The current template of the current block may also include interpolated samples, wherein the interpolated samples may replace samples omitted from the current template in the initial template (e.g., (921)).

[0151] Omitted pixels (eg, intra-coded pixels) in a reference template (eg, reference template (1225) or (1325)) may be interpolated based on available pixels in the reference template.

[0152] In an embodiment, a reference sample in a reference template (e.g., reference template (1225) or (1325)) of a current template (e.g., current template (921)) corresponding to a current block (e.g., (901)) is located at a sub-pixel position in a reference picture (e.g., (911)). In this case, an interpolation of the reference template using a filter having less than four taps may be used to generate an interpolated reference template in the reference picture. The MV of the current block may be determined using a TM mode based on an initial MV, a current template of the current block, and an interpolated reference template.

[0153] In an example, a reference template in a reference picture omits reference samples in the reference picture corresponding to samples in an initial template of a current block included in an intra-coded block. Padding samples corresponding to (replacing) reference samples in the omitted reference samples in the reference picture may be generated by copying the closest reference samples in the reference picture. An interpolated reference template in the reference picture may be generated by interpolation based on the padding samples.

[0154] In an example, a reference template (e.g., reference template (1225) or (1325)) is located at a sub-pixel position. In this case, interpolation can be performed for the reference template so that the interpolated reference template is located at an integer position. Interpolation can be performed for the reference template using a filter with less than 4 taps (e.g., a 2-tap bilinear interpolation filter) to reduce complexity. If a portion of the reference template is omitted due to exclusion of an intra-coded block, pixel padding can be performed by copying the nearest pixel for interpolation. In an example, no more than 2 pixels are padded in the necessary direction.

[0155] In an embodiment, the reference template in the reference picture omits reference samples in the reference picture corresponding to samples included in the intra-coded block in the initial template of the current block. In this case, the interpolated reference template in the reference picture can be generated by interpolation based on the omitted reference samples in the reference picture.

[0156] In the example, when the reference template is at a sub-pixel position, pixel padding is not used. In this case, because all pixels in the reference picture (eg, (911)) are available, interpolation can be performed based on pixels to be excluded from the matching process.

[0157] In various examples, when pixels in the current template are spatial neighbors of the reconstruction at integer pixel locations, no interpolation of the current template is required.

[0158] In an example, interpolation of the entire reference template in the reference picture is performed at sub-pixel positions. A mask may be applied to the reference template to exclude pixels in the reference template corresponding to pixels belonging to an intra-coded block in the current template. The shape and size of the mask may be based on the shape and size of the current template.

[0159] Fig.13 An exemplary process for obtaining a reference template in a reference picture is shown. In an embodiment, a reference sample in an initial reference template (e.g., reference template (925)) corresponding to an initial template (e.g., current template (921)) of a current block (e.g., (901)) is located at a sub-pixel position in a reference picture (e.g., (911)). Fig. 9 The template (925), template (921), current CU (901) and reference picture (911) are described in FIG. Fig.13 The template (921) and the current CU (901) are not shown in FIG. An intermediate reference template (1425) in a reference picture may be generated using interpolation of an initial reference template (eg, (925)).

[0160] The mask (1415) includes regions (1415(1)) to (1415(4)) and regions (1415(5)) to (1415(6)). In an example, pixels in regions (1415(1)) to (1415(4)) have a value of "1", while pixels in regions (1415(5)) to (1415(6)) have a value of "0". Regions (1415(1)) to (1415(4)) may be referred to as non-zero regions, and regions (1415(5)) to (1415(6)) may be referred to as zero regions. In an example, the shape of the non-zero regions (1415(1)) to (1415(4)) of the mask (1415) is the same as the shape of the current template (e.g., (1221)) of the current block. In an example, the size of the non-zero regions (1415(1)) to (1415(4)) of the mask (1415) is the same as the size of the current template (eg, (1221)) of the current block.

[0161] A current template (eg, Fig. 12AThe reference template (1435) is a reference template of the current template (1221) in the intermediate reference template (1425). For example, the intermediate reference template (1425) includes sub-templates (1425(1)) to (1425(6)). The non-zero areas (1415(1)) to (1415(4)) in the mask (1415) correspond to sub-templates (1425(1)), (1425(3)), (1425(4)) and (1425(6)). The reference template (1435) is generated by applying the mask (1415) to the intermediate reference template (1425). In the example, the reference template (1435) includes sub-templates (1435(a)) to (1435(d)). Sub-templates (1435(a)) to (1435(d)) may correspond to sub-templates (1425(1)), (1425(3)), (1425(4)), and (1425(6)). In the example, sub-templates (1435(a)) to (1435(d)) are sub-templates (1425(1)), (1425(3)), (1425(4)), and (1425(6)), respectively.

[0162] The mask (1415) may include additional non-zero regions that do not overlap with the template (925), wherein pixels in the additional non-zero regions have a value of "1". The mask (1415) may include additional zero regions that do not overlap with the template (925), wherein pixels in the additional zero regions have a value of "0". The additional non-zero regions and the additional zero regions do not affect the reference template (1435).

[0163] In an embodiment, when an intra-coded block is in the top template area or the left template area of ​​the current picture, the intra-coded block may be excluded from the current template. The current template may be extended to another part of the current picture. The size of the current template may be increased.

[0164] In an embodiment, the samples included in the intra-coded block in the initial template (e.g., template (921)) include: (i) one or more left samples of the samples of one or more left neighboring blocks; or (ii) one or more top samples of the samples of one or more top neighboring blocks. If the samples in the initial template (e.g., template (921)) include the one or more left samples, the current template also includes one or more extended left samples adjacent to the samples of the one or more left neighboring blocks included in the current template. In the example, the one or more extended left samples are not included in the intra-coded block in the current picture. If the samples in the initial template include the one or more top samples, the current template may also include one or more extended top samples adjacent to the samples of the one or more top neighboring blocks included in the current template. The one or more extended top samples are not included in the intra-coded block of the current picture.

[0165] Fig.14 An example of extending the current template in TM (1400) is shown. Fig. 9 and Fig.11 Described in Fig.14 The current CU (901), the initial MV (902), the current picture (910), the reference picture (911), the top template (922) and the sub-templates (923(1)) and (923(3)) and the top template (926) and the sub-templates (927(1)) and (927(3)).

[0166] Reference Fig.11 and Fig.14 , the samples in the sub-template (923(2)) of the initial template (921) are in the intra-coded block. The samples in the top template (922) and the sub-templates (923(1)) and (923(3)) in the initial template (921) are not in the intra-coded block. The current template (1421) of the current CU (901) may include the top template (922) and the sub-templates (923(1)) and (923(3)). The current template (1421) may also include the sub-template (923 e (1)) and (923 e (3)), the sub-template (923 e (1)) and (923 e (3)) is the corresponding extension of the sub-templates (923(1)) and (923(3)) in the current template (1421). e (1)) is the left neighbor of the sub-template (923(1)). e (1)) may include one or more extended left samples adjacent to the samples of the sub-template (923(1)). The sub-template (923(1)) may include one or more extended left samples adjacent to the samples of the sub-template (923(1)). e (3)) is the left neighbor of the sub-template (923(3)). e (3)) may include one or more extended left samples adjacent to the samples of the sub-template (923(3)). In the example, the sub-template (923(3)) may include one or more extended left samples adjacent to the samples of the sub-template (923(3)). e (1)) and (923 e The samples in (3)) are not included in the intra-coded block.

[0167] In an example, the number of samples in the current template (eg, (1421)) is 150% of the number of samples in the initial template (eg, (921)).

[0168] In an example, the number of samples in the current template (eg, (1421)) is 200% of the number of samples in the initial template (eg, (921)).

[0169] When a sub-template in the top template (922) is omitted from the current template, the reference can be adjusted appropriately. Fig.14 Description of the process.

[0170] Fig.15 A flow chart outlining an encoding process (1500) according to an embodiment of the present disclosure is shown. In various embodiments, the process (1500) is performed by a processing circuit system, such as a processing circuit system in a terminal device (310), (320), (330), and (340), a processing circuit system that performs the functions of a video encoder (e.g., (403), (603), (703), etc. In some embodiments, the process (1500) is implemented as software instructions, so when the processing circuit system executes the software instructions, the processing circuit system performs the process (1500). The process starts at (S1501) and proceeds to (S1510).

[0171] At (S1510), it is determined whether the samples in the initial template of the current block in the current picture are included in the block to be intra-coded. In an example, the block to be intra-coded is a spatial neighboring block of the current block. The initial template of the current block may include samples of one or more top neighboring blocks of the current block and / or samples of one or more left neighboring blocks of the current block. In an example, the block to be intra-coded has been intra-coded. In an example, the block to be intra-coded has not yet been intra-coded.

[0172] At (S1520), in response to determining that the samples in the initial template are included in the block to be intra-coded, the motion vector (MV) of the current block can be determined based on: (i) the initial MV of the current block without applying a template matching (TM) mode; or (ii) the initial MV of the current block and a current template generated based on the initial template and omitting the samples included in the block to be intra-coded.

[0173] In an embodiment, it is determined that samples in an initial template of a current block are included in an intra-coded block. In this case, the MV may be determined based on the initial MV of the current block without applying the TM mode.

[0174] In an embodiment, the initial template of the current block includes an initial top template including samples of one or more top neighboring blocks and an initial left template including samples of one or more left neighboring blocks. It is determined that the samples in the initial template of the current block are included in an intra-coded block. If one or more left neighboring blocks of the current block do not include an intra-coded block, the MV of the current block can be determined using a TM mode based on an initial MV and a current template composed of an initial left template. If one or more top neighboring blocks of the current block do not include an intra-coded block, the MV of the current block can be determined using a TM mode based on an initial MV and a current template composed of an initial top template.

[0175] In an embodiment, it is determined that samples in an initial template (e.g., (921)) of the current block are included in an intra-coded block. In this case, a TM mode based on the initial MV of the current block and the current template (e.g., (1221) or (1321)) may be used to determine the MV of the current block, for example FIG. 12A to FIG. 12B as described.

[0176] In the example, for example Fig.14 As described, the samples included in the intra-coded block in the initial template include: (i) one or more left samples of one or more left neighboring blocks and / or (ii) one or more top samples of one or more top neighboring blocks. If the samples in the initial template include the one or more left samples, the current template may also include one or more extended left samples adjacent to the samples of the one or more left neighboring blocks included in the current template. The one or more extended left samples are not included in the intra-coded block in the current picture. If the samples in the initial template include the one or more top samples, the current template also includes one or more extended top samples adjacent to the samples of the one or more top neighboring blocks included in the current template. The one or more extended top samples are not included in the intra-coded block in the current picture. The number of samples in the current template may be greater than the number of samples in the initial template. The number of samples in the current template may be 150% or 200% of the number of samples in the initial template.

[0177] In an example, the interpolated samples are generated by interpolation based on one or more samples in the current template. The interpolated samples may correspond to (replace) samples in the initial template included in the intra-coded block. The current template of the current block may also include interpolated samples.

[0178] In an example, a reference sample in a reference template corresponding to a current template of a current block is located at a sub-pixel position in a reference picture. An interpolated reference template in a reference picture may be generated by interpolating the reference template using a filter having less than four taps. An MV of the current block may be determined using a TM mode based on an initial MV, a current template of the current block, and an interpolated reference template.

[0179] In an example, a reference template in a reference picture omits reference samples in the reference picture corresponding to samples in an initial template of a current block included in an intra-coded block. A padding sample corresponding to (replacing) a reference sample in the omitted reference sample in the reference picture may be generated by copying the closest reference sample in the reference picture. An interpolated reference template in the reference picture may be generated by interpolation based on the padding sample.

[0180] In an example, a reference template in a reference picture omits reference samples corresponding to samples included in an intra-coded block in an initial template of a current block. An interpolated reference template in the reference picture may be generated by interpolation based on the omitted reference samples in the reference picture.

[0181] In an example, a reference sample in an initial reference template corresponding to an initial template of a current block is located at a sub-pixel position in a reference picture. In this case, an intermediate reference template in the reference picture may be generated using interpolation of the initial reference template. A reference template corresponding to a current template of the current block may be generated based on the intermediate reference template and a mask. A shape of the mask may be determined based on the current template of the current block.

[0182] At (S1530), the current block may be encoded based on the determined MV.

[0183] At (S1540), prediction information of the current block may be encoded. In an example, the prediction information indicates a TM mode for the current block. In an example, the prediction information includes information indicating an initial MV (eg, initial MV (902)) used in the TM mode.

[0184] Processing (1500) proceeds to (S1599) and ends.

[0185] The process (1500) may be suitably adapted to various scenarios, and the steps in the process (1500) may be adjusted accordingly. One or more steps in the process (1500) may be modified, omitted, repeated, and / or combined. The process (1500) may be implemented in any suitable order. Additional steps may be added.

[0186] Fig.16A flow chart outlining a decoding process (1600) according to an embodiment of the present disclosure is shown. In various embodiments, the process (1600) is performed by a processing circuit system, such as a processing circuit system in a terminal device (310), (320), (330), and (340), a processing circuit system that performs the functions of a video encoder (403), a processing circuit system that performs the functions of a video decoder (410), a processing circuit system that performs the functions of a video decoder (510), a processing circuit system that performs the functions of a video encoder (603), etc. In some embodiments, the process (1600) is implemented in software instructions, so when the processing circuit system executes the software instructions, the processing circuit system performs the process (1600). The process starts at (S1601) and proceeds to (S1610).

[0187] At (S1610), prediction information of a current block in a current picture may be decoded from a video bitstream. The prediction information may indicate a template matching (TM) mode for the current block.

[0188] At (S1620), it is determined whether the samples in the initial template (or first template) of the current block are included in an intra-coded block. In an example, the intra-coded block is a spatial neighboring block of the current block. The initial template of the current block (e.g., template (921)) may include samples of one or more top neighboring blocks of the current block and / or samples of one or more left neighboring blocks of the current block.

[0189] At (S1630), in an example, if it is determined that the sample in the initial template is included in the intra-coded block, the motion vector (MV) of the current block may be determined based on the initial MV of the current block without applying the TM mode. Fig.11 If the samples in the sub-template (922(2)) are included in an intra-coded block, the MV of the current block (eg, the current CU (901)) may be determined based on the initial MV (902) of the current block without applying the TM mode.

[0190] Alternatively, in (S1630), if it is determined that the samples in the initial template are included in the intra-coded block, the MV of the current block may be determined based on the initial MV of the current block and the current template (or the second template), for example Fig.11 , Fig. 12A and Fig. 12B The current template may be generated based on the initial template and samples included in the intra-coded block in the initial template may be omitted.

[0191] In an embodiment, the initial template of the current block includes an initial top template including one or more top neighboring blocks and an initial left template including samples of one or more left neighboring blocks. It is determined that the samples in the initial template of the current block are included in the intra-coded block. In this case, if the left neighboring block of the initial left template does not include the intra-coded block, the MV of the current block can be determined using a TM mode based on the initial MV and the current template as the initial left template. If one or more top neighboring blocks of the current block do not include the intra-coded block, the MV of the current block can be determined using a TM mode based on the initial MV and the current template composed of the initial top template.

[0192] In an embodiment, it is determined that samples in an initial template (e.g., (921)) of the current block are included in an intra-coded block. In this case, a TM mode based on the initial MV of the current block and the current template (e.g., (1221) or (1321)) may be used to determine the MV of the current block, for example FIG. 12A to FIG. 12B as described.

[0193] In the example, for example Fig.14 As described, the samples included in the intra-coded block in the initial template include: (i) one or more left samples of one or more left neighboring blocks and / or (ii) one or more top samples of one or more top neighboring blocks. If the samples in the initial template include the one or more left samples, the current template may also include one or more extended left samples adjacent to the samples of the one or more left neighboring blocks included in the current template. The one or more extended left samples are not included in the intra-coded block in the current picture. If the samples in the initial template include the one or more top samples, the current template also includes one or more extended top samples adjacent to the samples of the one or more top neighboring blocks included in the current template. The one or more extended top samples are not included in the intra-coded block in the current picture. The number of samples in the current template may be greater than the number of samples in the initial template. The number of samples in the current template may be 150% or 200% of the number of samples in the initial template.

[0194] In an example, the interpolated samples are generated by interpolation based on one or more samples in the current template. The interpolated samples may correspond to (replace) samples in the initial template included in the intra-coded block. The current template of the current block may also include interpolated samples.

[0195] In an example, a reference sample in a reference template corresponding to a current template of a current block is located at a sub-pixel position in a reference picture. In this case, an interpolation of a filter with less than four taps may be used on the reference template to generate an interpolated reference template in the reference picture. The MV of the current block may be determined using a TM mode based on an initial MV, the current template of the current block, and the interpolated reference template.

[0196] In an example, a reference template in a reference picture omits reference samples corresponding to samples included in an intra-coded block in an initial template of a current block. A padding sample corresponding to (replacing) a reference sample in the omitted reference sample in the reference picture may be generated by copying the closest reference sample in the reference picture. An interpolated reference template in the reference picture may be generated by interpolation based on the padding sample.

[0197] In an example, a reference template in a reference picture omits reference samples corresponding to samples included in an intra-coded block in an initial template of a current block. In this case, an interpolated reference template in the reference picture may be generated by interpolation based on the omitted reference samples in the reference picture.

[0198] In an example, a reference sample in an initial reference template corresponding to an initial template of a current block is located at a sub-pixel position in a reference picture. An intermediate reference template in the reference picture may be generated using interpolation of the initial reference template. A reference template corresponding to a current template of the current block may be generated based on the intermediate reference template and a mask. A shape of the mask may be determined based on the current template of the current block.

[0199] At (S1640), the current block may be reconstructed based on the determined MV.

[0200] Processing (1600) proceeds to (S1699) and ends.

[0201] The process (1600) may be suitably adapted to various scenarios, and the steps in the process (1600) may be adjusted accordingly. One or more steps in the process (1600) may be modified, omitted, repeated, and / or combined. The process (1600) may be implemented in any suitable order. Additional steps may be added.

[0202] In an embodiment, it is determined whether at least one sample in an initial template (or first template) of a current block is included in an intra-coded block that is a spatial neighboring block of the current block. The first template of the current block may include one or more samples of: (1) one or more top neighboring blocks of the current block and (2) one or more left neighboring blocks of the current block. In an example, the one or more top neighboring blocks are top neighboring blocks. In an example, the one or more left neighboring blocks are left neighboring blocks. In response to determining that at least one sample in the first template is included in the intra-coded block, the at least one sample may be excluded from the first template to generate a current template (or second template) of the current block. The MV of the current block may be determined based on the second template for the current block.

[0203] In an example, in response to (i) determining that at least one sample in a first template is included in an intra-coded block and (ii) TM mode is applied to a current block, the at least one sample may be excluded from the first template to generate a second template for the current block.

[0204] The embodiments in the present disclosure may be used alone or in any order. In addition, each of the method (or embodiment), encoder, and decoder may be implemented by a processing circuit system (e.g., one or more processors or one or more integrated circuits). In one example, one or more processors execute a program stored in a non-transitory computer-readable medium.

[0205] The techniques described above may be implemented as computer software using computer-readable instructions and physically stored in one or more computer-readable media. Fig.17 A computer system (1700) suitable for implementing certain embodiments of the disclosed subject matter is shown.

[0206] Computer software may be encoded using any suitable machine code or computer language, which may be subjected to mechanisms such as assembly, compilation, and linking to create code comprising instructions that may be executed directly by one or more computer central processing units (CPU), graphics processing units (GPU), etc., or by interpretation, microcode execution, etc.

[0207] The instructions may be executed on various types of computers or components thereof, including, for example, personal computers, tablet computers, servers, smart phones, gaming devices, Internet of Things devices, etc.

[0208] Fig.17The components for the computer system (1700) shown in the example are exemplary in nature and are not intended to suggest any limitation on the scope of use or functionality of computer software implementing embodiments of the present disclosure. Neither should the configuration of components be interpreted as having any dependency or requirement relating to any one or combination of components shown in the exemplary embodiment of the computer system (1700).

[0209] The computer system (1700) may include certain human-machine interface input devices. Such human-machine interface input devices may respond to input by one or more human users through, for example, tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, tapping), visual input (e.g., gestures), olfactory input (not depicted). The human-machine interface devices may also be used to capture certain media that are not necessarily directly related to human conscious input, such as audio (e.g., voice, music, ambient sounds), images (e.g., scanned images, photographic images obtained from a still image camera), and videos (e.g., two-dimensional video, three-dimensional video including stereoscopic video).

[0210] Input human-machine interface devices may include one or more of the following (only one of each is depicted): keyboard (1701), mouse (1702), touchpad (1703), touch screen (1710), data gloves (not shown), joystick (1705), microphone (1706), scanner (1707), camera (1708).

[0211] The computer system (1700) may also include certain human interface output devices. Such human interface output devices may stimulate one or more senses of a human user through, for example, tactile output, sound, light, and smell / taste. Such human-machine interface output devices may include: tactile output devices (e.g., tactile feedback via a touch screen (1710), a data glove (not shown), or a joystick (1705), but there may also be tactile feedback devices that do not function as input devices); audio output devices (e.g., speakers (1709), headphones (not depicted)); visual output devices (e.g., screens (1710), including CRT (Cathode Ray Tube, CRT) screens, LCD (Liquid Crystal Display, LCD) screens, plasma screens, OLED (Organic Light Emitting Diode, OLED) screens, each with or without touch screen input capabilities, each with or without tactile feedback capabilities - some of which may be able to output two-dimensional visual output or more than three-dimensional output by means such as stereoscopic image output; virtual reality glasses (not depicted); holographic displays and cigarette cans (not depicted)); and printers (not depicted).

[0212] The computer system (1700) may also include storage devices and their associated media accessible to humans, such as optical media including CD / DVD ROM (Read Only Memory, ROM) / RW (1720) with CD / DVD and other media (1721), thumb drives (1722), removable hard drives or solid-state drives (1723), legacy magnetic media such as tapes and floppy disks (not depicted), dedicated ROM / ASIC (Application Specific Integrated Circuit, ASIC) / PLD (Programmable Logic Device, PLD) based devices such as security dongles (not depicted), etc.

[0213] Those skilled in the art should also understand that the term "computer-readable media" used in connection with the presently disclosed subject matter does not include transmission media, carrier waves, or other transient signals.

[0214] The computer system (1700) may also include a network interface (1754) to one or more communication networks (1755). The network may be, for example, wireless, wired, optical. The network may also be local area, wide area, metropolitan area, vehicle and industrial, real-time, delay tolerant, etc. Examples of networks include: local area networks such as Ethernet; wireless LAN (Local Area Network, LAN); cellular networks including GSM (Global System for Mobile Communications, GSM), 3G (the Third Generation, 3G), 4G (the Fourth Generation, 4G), 5G (the Fifth Generation, 5G), LTE (Long Term Evolution, LTE), etc.; TV wired or wireless wide area digital networks including cable TV, satellite TV and terrestrial broadcast TV; vehicle and industrial networks including CANBus, etc. Some networks typically require an external network interface adapter attached to some general data port or peripheral bus (1749) (such as, for example, a USB port of the computer system (1700)); other networks are typically integrated into the core of the computer system (1700) by attaching to a system bus as described below (e.g., to an Ethernet interface in a PC computer system or to a cellular network interface in a smartphone computer system). Using any of these networks, the computer system (1700) can communicate with other entities. Such communications can be one-way receive only (e.g., broadcast TV), one-way send only (e.g., CANbus to certain CANbus devices), or two-way, for example, to other computer systems using a local area digital network or a wide area digital network. Certain protocols and protocol stacks can be used on each of these networks and network interfaces as described above.

[0215] The above-mentioned human-machine interface devices, human-accessible storage devices, and network interfaces may be attached to the core ( 1740 ) of the computer system ( 1700 ).

[0216] The core (1740) may include one or more central processing units (CPUs) (1741), graphics processing units (GPUs) (1742), dedicated programmable processing units in the form of field programmable gate areas (FPGAs) (1743), hardware accelerators for certain tasks (1744), graphics adapters (1750), etc. These devices, along with read-only memory (ROM) (1745), random access memory (1746), internal mass storage devices (1747) such as internal non-user accessible hard drives, SSDs (Solid State Drives, SSDs), etc., may be connected via a system bus (1748). In some computer systems, the system bus (1748) may be accessible in the form of one or more physical plugs to enable expansion by additional CPUs, GPUs, etc. Peripheral devices may be attached to the core's system bus (1748) directly or via a peripheral bus (1749). In an example, a screen (1710) may be connected to a graphics adapter (1750). The architecture of the peripheral bus includes PCI (Peripheral Component Interconnect / Interface, PCI), USB (Universal Serial Bus, USB), etc.

[0217] The CPU (1741), GPU (1742), FPGA (1743) and accelerator (1744) can execute certain instructions, which can be combined to form the above-mentioned computer code. The computer code can be stored in ROM (1745) or RAM (Random Access Memory, RAM) (1746). Transient data can be stored in RAM (1746), while permanent data can be stored in, for example, an internal large-capacity storage device (1747). Fast storage and retrieval of any storage device in the storage device can be achieved by using a cache memory, which can be closely associated with one or more CPUs (1741), GPUs (1742), large-capacity storage devices (1747), ROMs (1745), RAMs (1746), etc.

[0218] The computer readable medium may have computer code thereon for performing various computer-implemented operations. The medium and computer code may be those specially designed and constructed for the purposes of the present disclosure, or the medium and computer code may be of a type well known and available to those skilled in the art of computer software.

[0219] As an example and not limitation, a computer system (1700) having an architecture and in particular a core (1740) can provide functionality due to a processor (including a CPU, GPU, FPGA, accelerator, etc.) executing software contained in one or more tangible computer-readable media. Such a computer-readable medium can be a medium associated with a user-accessible mass storage device as described above, as well as certain storage devices of the core (1740) having non-transitory properties, for example, a core internal mass storage device (1747) or a ROM (1745). Software implementing various embodiments of the present disclosure can be stored in such a device and executed by the core (1740). Depending on specific needs, the computer-readable medium may include one or more memory devices or chips. The software can enable the core (1740) and in particular the processor therein (including a CPU, GPU, FPGA, etc.) to perform a specific process or a specific part of a specific process described herein, including defining a data structure stored in the RAM (1746) and modifying such a data structure according to a process defined by the software. Additionally or alternatively, the computer system may provide functionality as a result of hard-wired logic or otherwise embodied in circuitry (e.g., accelerator (1744)) that may operate in place of or in conjunction with software to perform a particular process or a particular portion of a particular process described herein. Where appropriate, references to software may include logic, and references to logic may also include software. Where appropriate, references to computer-readable media may include circuitry (e.g., an integrated circuit (IC)) storing software for execution, circuitry implementing logic for execution, or both. The present disclosure includes any suitable combination of hardware and software.

[0220] Appendix A: Acronyms

[0221] JEM: Joint Exploration Model

[0222] VVC: Versatile Video Coding

[0223] BMS: Benchmark Set

[0224] MV: Motion Vector

[0225] HEVC: High Efficiency Video Coding

[0226] SEI: Supplemental Enhancement Information

[0227] VUI: Video Availability Information

[0228] GOP: Group of Pictures

[0229] TU: Transform Unit

[0230] PU: prediction unit

[0231] CTU: Coding Tree Unit

[0232] CTB: Coding Tree Block

[0233] PB: prediction block

[0234] HRD: Hypothesized Reference Decoder

[0235] SNR: Signal to Noise Ratio

[0236] CPU: Central Processing Unit

[0237] GPU: Graphics Processing Unit

[0238] CRT: cathode ray tube

[0239] LCD: Liquid Crystal Display

[0240] OLED: Organic Light Emitting Diode

[0241] CD: Compact Disc

[0242] DVD: Digital Video Disc

[0243] ROM: Read Only Memory

[0244] RAM: Random Access Memory

[0245] ASIC: Application-Specific Integrated Circuit

[0246] PLD: Programmable Logic Device

[0247] LAN: Local Area Network

[0248] GSM: Global System for Mobile Communications

[0249] LTE: Long Term Evolution

[0250] CANBus: Controller Area Network Bus

[0251] USB: Universal Serial Bus

[0252] PCI: Peripheral Component Interconnect

[0253] FPGA: Field Programmable Gate Array

[0254] SSD: Solid State Drive

[0255] IC: Integrated Circuit

[0256] CU: Coding Unit

[0257] RD: Rate Distortion

[0258] Although the present disclosure has described several exemplary embodiments, there are changes, permutations, and various alternative equivalents that fall within the scope of the present disclosure. It will therefore be appreciated that those skilled in the art will be able to conceive of many systems and methods that, although not explicitly shown or described herein, embody the principles of the present disclosure and are therefore within the spirit and scope of the present disclosure.

Claims

1. A method for video decoding, characterized in that: The method comprises: Decoding prediction information of a current block in a current picture from a video bitstream, the prediction information indicating a template matching (TM) mode for the current block, the prediction information including indicating an initial MV used in the TM mode; Determining whether there is a sample included in an intra-coded block as a spatial neighboring block of the current block among all samples in a first template of the current block, the first template of the current block including (1) one or more samples of a top neighboring block of the current block and (2) one or more samples of a left neighboring block of the current block; In response to (i) determining that samples included in the intra-coded block exist in the first template and (ii) the TM mode is applied to the current block, excluding all samples included in the intra-coded block from the first template to generate a second template for the current block; determining a motion vector (MV) of the current block based on a second template of the current block; and Reconstructing the current block based on the determined MV, the second template comprising samples in the inter-frame coded block and / or the intra-frame block copy coded block; determining whether there is a sample included in an intra-coded block that is a spatially neighboring block of the current block among all samples in the first template of the current block; and Determining the MV includes determining the MV of the current block using a TM mode based on an initial MV and a second template of the current block; In response to the first template excluding all samples included in the intra-coded block including one or more left samples, the second template further includes one or more extended left samples adjacent to the samples of the left neighboring block included in the second template before expansion, and the one or more extended left samples are not included in the intra-coded block in the current picture, and In response to the first template excluding all samples included in the intra-coded block including one or more top samples, the second template further includes one or more extended top samples adjacent to the samples of the top neighboring block included in the second template before extension, the one or more extended top samples not included in the intra-coded block in the current picture; The number of samples in the second template is 150% or 200% of the number of samples in the first template.

2. The method according to claim 1, characterized in that determining whether there is a sample included in an intra-coded block that is a spatially neighboring block of the current block among all samples in the first template of the current block; and Determining the MV includes determining the MV based on an initial MV of the current block without applying the TM mode.

3. The method according to claim 1, characterized in that The first template of the current block includes an initial top template including samples of the top neighboring block and an initial left template including samples of the left neighboring block; determining whether there is a sample included in an intra-coded block that is a spatial neighboring block of the current block among all samples in the first template of the current block; In response to the left neighboring block of the current block not including the intra-coded block, determining the MV comprises determining the MV of the current block using a TM mode based on an initial MV and a second template composed of the initial left template; as well as In response to the top neighboring block of the current block not including the intra-coded block, determining the MV includes determining the MV of the current block using a TM mode based on the initial MV and a second template composed of the initial top template.

4. A device for video decoding, characterized in that: The device comprises: A decoding module configured to decode prediction information of a current block in a current picture from a video bitstream, the prediction information indicating a template matching (TM) mode for the current block, the prediction information including an indication of an initial MV used in the TM mode; a determination module configured to determine whether there is a sample included in an intra-coded block as a spatial neighboring block of the current block among all samples in a first template of the current block, the first template of the current block including (1) one or more samples of a top neighboring block of the current block and (2) one or more samples of a left neighboring block of the current block; a second template generation module configured to exclude all samples included in the intra-coded block from the first template to generate a second template for the current block in response to (i) determining that the samples included in the intra-coded block exist in the first template and (ii) the TM mode is applied to the current block; a motion vector determination module configured to determine a motion vector (MV) of the current block based on a second template of the current block, the second template comprising samples in an inter-coded block and / or an intra-block-copy coded block; and a reconstruction module configured to reconstruct the current block based on the determined MV; The determination module determines whether there is a sample included in an intra-coded block which is a spatially neighboring block of the current block among all samples in the first template of the current block; and The motion vector determination module is configured to determine the MV of the current block using a TM mode based on an initial MV and a second template of the current block; In response to the first template excluding all samples included in the intra-coded block including one or more left samples, the second template further includes one or more extended left samples adjacent to the samples of the left neighboring block included in the second template before expansion, and the one or more extended left samples are not included in the intra-coded block in the current picture, and In response to the first template excluding all samples included in the intra-coded block including one or more top samples, the second template further includes one or more extended top samples adjacent to the samples of the top neighboring block included in the second template before extension, the one or more extended top samples not included in the intra-coded block in the current picture; The number of samples in the second template is 150% or 200% of the number of samples in the first template.

5. The device according to claim 4, characterized in that The determination module determines whether there is a sample included in an intra-coded block which is a spatially neighboring block of the current block among all samples in the first template of the current block; and The motion vector determination module is configured to determine the MV based on an initial MV of the current block without applying the TM mode.

6. The device according to claim 4, characterized in that The first template of the current block includes an initial top template including samples of the top neighboring block and an initial left template including samples of the left neighboring block; The determination module determines whether there is a sample included in an intra-coded block which is a spatial neighboring block of the current block among all samples in the first template of the current block; In response to the left neighboring block of the current block not including the intra-coded block, the motion vector determination module is configured to determine the MV of the current block using a TM mode based on an initial MV and a second template composed of the initial left template; as well as In response to the top neighboring block of the current block not including the intra-coded block, the motion vector determination module is configured to determine the MV of the current block using a TM mode based on the initial MV and a second template composed of the initial top template.

7. A computer device, characterized in that: The computer device comprises: one or more computer-readable non-transitory storage media configured to store computer program code; and One or more computer processors configured to access the computer program code and execute the method of any one of claims 1 to 3 as instructed by the computer program code. 8 . A non-transitory computer-readable storage medium storing a program, wherein the program can be executed by at least one processor to perform the method according to claim 1 .

9. A method for processing a video bitstream, characterized in that: The video bit stream is decoded according to the decoding method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Method and apparatus for video coding

    US10511852B1

  • Method and Apparatus for Template-Based Intra Prediction in Image and Video Coding

    US20170353719A1