Video coding method, video decoding method, video code stream processing method, video coding device and storage medium

By adopting a bidirectional prediction mode in video encoding and using the information of multiple reference frames, the problem of low encoding efficiency in the prior art is solved, and more efficient video data compression is achieved.

CN119835431APending Publication Date: 2025-04-15TENCENT AMERICA LLC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411973210.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-04-21
Filing Date
2022-04-26
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing video encoding technology is difficult to effectively utilize the information of multiple reference frames when compressing video data, resulting in low encoding efficiency.

Method used

Using a bidirectional prediction mode, the weights of the bidirectional prediction mode are calculated by determining the first motion vector associated with the first reference picture and the second motion vector associated with the second reference picture, and the encoded blocks are encoded using the bidirectional prediction with these weights.

Benefits of technology

Improves the efficiency of video encoding, reduces redundancy through more accurate predictions, and reduces storage and transmission requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119835431A_ABST
    Figure CN119835431A_ABST
Patent Text Reader

Abstract

The invention provides a video coding method, a video decoding method, a video code stream processing method, a video coding device and a storage medium, and the method comprises the steps: setting the information of a coding block in a current picture, the information indicating a bidirectional prediction mode; determining a first motion vector associated with the first reference picture and a second motion vector associated with the second reference picture for bidirectional prediction of the coded block; determining a first reference template in the first reference picture based on a current template of the coded block and the first motion vector; determining a second reference template in a second reference picture based on the current template of the coded block and the second motion vector; calculating a weight of a bidirectional prediction mode based on a difference value between the first reference template and the second reference template and the current template; and encoding the encoded block using bidirectional prediction with the calculated weights.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of an actively modified version of a patent application with an application date of April 26, 2022, Chinese patent application number 202280004423.3, and invention name “Video encoding method, video encoding device and storage medium”. Technical Field

[0002] The embodiments of the present application describe embodiments generally related to video encoding and decoding. Background Art

[0003] The background description provided herein is for the purpose of presenting the content of the embodiments of the present application in general. The extent to which the work of the inventors currently named described in this background technology section and various aspects of this specification has been performed does not indicate that it qualifies as prior art when the present application is filed, and it is never explicitly or implicitly admitted as prior art to the content of the embodiments of the present application.

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

[0005] One purpose of video encoding and decoding can be to reduce redundancy in the input video images through compression. Compression can help reduce the above-mentioned bandwidth and / or storage space requirements, in some cases by two orders of magnitude or more. 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 from 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 usable for the intended application. In the case of video, lossy compression is widely used. The amount of tolerable distortion depends on the application; for example, some users of consumer streaming applications can tolerate higher distortion than users of television distribution applications. The achievable compression rate can reflect that higher allowable / tolerable distortion can produce higher compression rates.

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

[0007] Video codec techniques may include a technique known as intra-coding. In intra-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 blocks of samples. When all sample blocks are encoded in intra-mode, the picture may be an intra-picture. Intra-pictures and their derivatives (e.g., 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 stream and video session, or as a still image. Samples of intra-blocks can be transformed, and transform coefficients can be quantized before entropy coding. Intra-prediction can be a technique for minimizing sample values ​​in the pre-transform domain. In some cases, the smaller the DC value after the transform and the smaller the AC coefficient, the fewer bits are required to represent the block after entropy coding at a given quantization step size.

[0008] Traditional intra-frame coding known, for example, from coding techniques such as MPEG-2 does not use intra-frame prediction. However, some newer video compression techniques include techniques that attempt to do so based on surrounding sample data and / or metadata that precede the data block in decoding order, for example, obtained during spatially adjacent encoding and / or decoding. Such techniques are hereinafter referred to as "intra-frame prediction" techniques. It should be noted that, at least in some cases, intra-frame prediction uses only reference data from the current picture being reconstructed, and does not use reference data from reference pictures.

[0009] Intra-frame prediction can take many different forms. When more than one such technique is available for use in a given video coding technique, the technique in use may be encoded in an intra-frame prediction mode. In some cases, a mode may have sub-modes and / or parameters, which may be encoded separately or contained in a mode codeword. Which codeword is used for a given mode, sub-mode, and / or parameter combination may affect the coding efficiency gain through intra-frame prediction, and therefore may affect the entropy coding technique used to convert the codeword into a bitstream.

[0010] H.264 introduced a certain intra prediction mode, which was refined in H.265 and further refined in newer coding techniques such as the Joint Exploration Model (JEM), Next Generation Video Coding (VVC), and Benchmark Set (BMS). Neighboring sample values ​​belonging to samples that are already available can be used to form a prediction block. Sample values ​​of neighboring samples are copied into the prediction block according to a certain direction. A reference to the direction in use can be encoded in the bitstream, or it can be predicted itself.

[0011] refer to Figure 1A, depicted at the bottom right is a subset of 9 prediction directions known from the 33 possible prediction directions of H.265 (corresponding to the 33 angular modes of the 35 intra modes). The point (101) where the arrows converge represents the sample being predicted. The arrows represent the direction along which the sample is predicted. For example, arrow (102) indicates that sample (101) is predicted from one or more samples at the top right at an angle of 45 degrees to the horizontal. Similarly, arrow (103) indicates that sample (101) is predicted from one or more samples at the bottom left of sample (101) at an angle of 22.5 degrees to the horizontal.

[0012] Still reference Figure 1A , a square block (104) of 4×4 samples is depicted in the upper left (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 (starting from the top) and the first sample in the X dimension (starting from the left). Similarly, sample S44 is the fourth sample in the block (104) in both the Y and X dimensions. Since the size of the block is 4×4 samples, S44 is located in the lower right corner. Reference samples are also shown that 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 H.264 and H.265, prediction samples adjacent to the block being reconstructed are used; there is no need to use negative values.

[0013] Intra picture prediction may start by copying reference sample values ​​from neighboring samples according to a signaled prediction direction. For example, assume that the encoded video bitstream includes signaling that indicates a prediction direction consistent with arrow (102) for the block, i.e., predicting samples from one or more prediction samples at the top right and 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. Sample S44 is then predicted from reference sample R08.

[0014] In some cases, the values ​​of multiple reference samples may be combined, such as by interpolation, to compute the reference sample; particularly when the directions are not evenly separated by 45 degrees.

[0015] As video coding technology continues to develop, the number of possible directions increases. In H.264 (2003), nine different directions can be represented. In H.265 (2013), this increased to 33 directions, and at the time of the present application embodiment, JEM / VVC / BMS can support up to 65 directions. Experiments have been conducted to identify the most likely directions, and some techniques in entropy coding are used to represent those possible directions with a small number of bits, accepting a certain cost for less likely directions. In addition, the direction itself can sometimes be predicted from the adjacent directions used in the adjacent blocks that have been decoded.

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

[0017] The mapping of intra-prediction directions to represent directions in the coded video bitstream may vary from one video coding technique to another; for example, it may range from a simple direct mapping of prediction directions to intra-prediction modes, to codewords, to complex adaptive schemes involving most probable modes, and similar techniques. However, in all cases, there may be certain directions that are statistically less likely to occur in the video content than certain other directions. Since the goal of video compression is to reduce redundancy, in a well-designed video coding technique, those less likely directions will be represented by more bits than more likely directions.

[0018] 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 a technique where 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 (hereafter MV). In some cases, the reference picture may be the same as the picture currently being reconstructed. The MV may have two dimensions, X and Y, or three dimensions, with the third dimension indicating the reference picture being used (indirectly, the third dimension may be a temporal dimension).

[0019] In some video compression techniques, the MV applicable to a region of sample data may be predicted based on other MVs, for example, based on other MVs related to another region of sample data that is spatially adjacent to the region being reconstructed and that precede the MV in decoding order. Doing so can greatly reduce the amount of data required to encode the MV, thereby eliminating redundancy and increasing 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 probability that a larger area than the area for which a single MV applies moves in a similar direction, so in some cases, similar motion vectors derived from MVs of adjacent areas can be used to predict the larger area. This makes the MV considered to be for a given area similar or identical to the MV predicted from the surrounding MVs, and then after entropy coding, the MV can be represented with fewer bits than when the MV is 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, the MV prediction itself can be lossy, for example due to rounding errors when calculating the predicted value based on multiple surrounding MVs.

[0020] Various MV prediction mechanisms are described in H.265 / HEVC (ITU-T Recommendation H.265, “High Efficiency Video Coding,” December 2016). Among the multiple MV prediction mechanisms provided by H.265, this article describes a technique referred to below as “spatial merging”.

[0021] refer to Figure 2 , the current block (201) includes samples that have been found by the encoder during the motion search process, which can be predicted from a previous block of the same size that has been spatially offset. Instead of encoding the MV directly, the MV can be derived from metadata associated with one or more reference pictures, for example using the MV associated with any of the five surrounding samples labeled A0, A1 and B0, B1, B2 (corresponding to 202 to 206), which is derived from the nearest reference picture (in decoding order). In H.265, MV prediction can use prediction values ​​from the same reference picture that is being used by neighboring blocks. Summary of the invention

[0022] Aspects of the embodiments of the present application provide a method for video encoding, the method comprising:

[0023] Setting information of a coding block in a current picture, the information indicating a bidirectional prediction mode;

[0024] determining, for bidirectional prediction of the coding block, a first motion vector associated with a first reference picture and a second motion vector associated with a second reference picture;

[0025] Determine a first reference template in the first reference picture based on a current template of the coding block and the first motion vector;

[0026] determining a second reference template in the second reference picture based on the current template of the coding block and the second motion vector;

[0027] Calculating a weight of the bidirectional prediction mode based on a difference between the first reference template and the second reference template and the current template; and

[0028] The coding block is encoded using bidirectional prediction with the calculated weights.

[0029] The present application also provides a method for video decoding, the method comprising:

[0030] Decoding information of a coding block in a current picture from a video bitstream, the information indicating a bidirectional prediction mode;

[0031] determining, for bidirectional prediction of the coding block, a first motion vector associated with a first reference picture and a second motion vector associated with a second reference picture;

[0032] Determine a first reference template in the first reference picture based on a current template of the coding block and the first motion vector;

[0033] determining a second reference template in the second reference picture based on the current template of the coding block and the second motion vector;

[0034] Calculating a weight of the bidirectional prediction mode based on a difference between the first reference template and the second reference template and the current template; and

[0035] The coding block is reconstructed using bidirectional prediction with the calculated weights.

[0036] An embodiment of the present application also provides a device for video encoding, the device comprising a processing circuit and a decoder, the processing circuit being configured to execute the video encoding method according to the embodiment of the present application, or to execute the video decoding method according to the embodiment of the present application.

[0037] The embodiment of the present application also provides a method for processing a video code stream, wherein the video code stream is generated based on the video encoding method described in the embodiment of the present application, or the video code stream is decoded based on the video decoding method described in the embodiment of the present application.

[0038] An embodiment of the present application also provides a non-temporary computer-readable storage medium, which stores instructions. When the instructions are executed by a processor, the instructions implement the video encoding method described in the embodiment of the present application to generate a video stream, or implement the video decoding method of the embodiment of the present application to decode the video stream. BRIEF DESCRIPTION OF THE DRAWINGS

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

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

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

[0042] Figure 2 is a schematic illustration of a current block and its surrounding spatial merging candidates in one example.

[0043] Figure 3 is a schematic illustration of a simplified block diagram of a communication system according to one embodiment.

[0044] Figure 4 is a schematic illustration of a simplified block diagram of a communication system according to one embodiment.

[0045] Figure 5 is a schematic illustration of a simplified block diagram of a decoder according to one embodiment.

[0046] Figure 6 is a schematic illustration of a simplified block diagram of an encoder according to one embodiment.

[0047] Figure 7 A block diagram of an encoder according to another embodiment is shown.

[0048] Figure 8 A block diagram of a decoder according to another embodiment is shown.

[0049] 9A to 9C A diagram illustrating unidirectional prediction of an inter-coded coding block is shown in some examples.

[0050] Fig.10 A diagram showing encoding of a video sequence using bi-directional prediction according to some embodiments of the present application.

[0051] Fig.11 A flowchart outlining a process of processing in a bidirectional prediction mode according to an embodiment of the present application is shown.

[0052] Fig.12 A flow chart outlining the process of some embodiments according to embodiments of the present application is shown.

[0053] Fig.13 A flow chart outlining an encoding process according to one embodiment of the present application is shown.

[0054] Fig.14 A flowchart outlining a decoding process according to one embodiment of the present application is shown.

[0055] Fig.15 is a schematic diagram of a computer system according to one embodiment. DETAILED DESCRIPTION

[0056] Figure 3 A simplified block diagram of a communication system (300) according to an embodiment of an embodiment of the present application 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 of , the first terminal device performs unidirectional data transmission on (310) and (320). For example, the terminal device (310) can encode video data (e.g., a video picture stream collected by the terminal device (310)) for transmission to another terminal device (320) via the network (350). The encoded video data can be transmitted in the form of one or more encoded video code streams. The terminal device (320) can receive the encoded video data from the network (350), decode the encoded video data to restore the video picture, and display the video picture based on the restored video data. Unidirectional data transmission may be common in applications such as media services.

[0057] 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, which bidirectional transmission can occur, for example, during a video conference. For bidirectional data transmission, in one example, each of the terminal devices (330) and (340) can encode video data (e.g., a video picture stream collected by the terminal device) for transmission to the other terminal device (330) and (340) via a network (350). Each of the terminal devices (330) and (340) can also receive the encoded video data transmitted by the other terminal device (330) and (340), and can decode the encoded video data to restore the video picture, and can display the video picture on an accessible display device based on the restored video data.

[0058] exist Figure 3 In the example of, terminal device (310), terminal device (320), terminal device (330) and terminal device (340) may be shown as a server, a personal computer and a smart phone, but the principle of the embodiment of the present application may not be limited to this. The embodiment of the embodiment of the present application finds application on a laptop computer, a tablet computer, a media player and / or a dedicated video conferencing device. Network (350) represents any number of networks that transmit encoded video data between terminal device (310), terminal device (320), terminal device (330) and terminal device (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 purpose of this discussion, unless otherwise described below, the architecture and topology of network (350) may be irrelevant to the operation of the embodiment of the present application.

[0059] As examples of applications for the disclosed subject matter, Figure 4 The placement of the video encoder and video decoder in a streaming environment is shown. The disclosed subject matter is equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, storing compressed video on digital media including CDs, DVDs, memory sticks, etc., and the like.

[0060] The streaming system may include an acquisition subsystem (413), which may include a video source (401) such as a digital camera, which creates, for example, an uncompressed video picture stream (402). In one example, the video picture stream (402) includes samples captured by the digital camera. The video picture stream (402), which is depicted as a thick line to emphasize the high amount of data compared to the encoded video data (404) (or the encoded video code stream), can be processed by an electronic device (420), which includes a video encoder (403) coupled to the video source (401). The video encoder (403) may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the disclosed subject matter as described in more detail below. The encoded video data (404) (or the encoded video code stream (404)), which is depicted as a thin line to emphasize the lower amount of data compared to the video picture stream (402), can be stored on a streaming server (405) for future use. One or more streaming client subsystems, such as Figure 4The client subsystem (406) and the client subsystem (408) in the streaming server (405) can access the copy (407) and the copy (409) of the encoded video data (404). The client subsystem (406) may 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 generates an output video picture stream (411) that can be presented on a display (412) (e.g., a display screen) or other 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 one example, the video coding standard under development is informally referred to as next-generation video coding (VVC). The disclosed subject matter can be used in the context of VVC.

[0061] It should be noted that the electronic device (420) and the electronic device (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).

[0062] Figure 5 A block diagram of a video decoder (510) according to an embodiment of the present application 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., a receiving circuit). The video decoder (510) may be used to replace Figure 4 A video decoder (410) in an example of FIG.

[0063] The receiver (531) may receive one or more encoded video sequences to be decoded by the video decoder (510); in the same or another embodiment, one encoded video sequence may be decoded at a time, wherein the decoding of each encoded video sequence is independent of the other encoded video sequences. The encoded video sequence may be received from a channel (501), which may be a hardware / software link leading to a storage device storing the encoded video data. The receiver (531) may receive the encoded video data and 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 the 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 located external to the video decoder (510) (not depicted). In still other applications, a buffer memory (not depicted) may be provided external to the video decoder (510) to, for example, prevent network jitter, and another additional buffer memory (515) may be provided 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 may be made smaller. For use on a traffic packet network such as the Internet, the buffer memory (515) may be required, the buffer memory (515) may be relatively large, advantageously may 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).

[0064] 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 an integral 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 auxiliary enhancement information (SEI message) or video usability information (VUI) parameter set fragments (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 subgroup 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 (GOP), a picture, a tile, a slice, a macroblock, a coding unit (CU), a block, a transform unit (TU), a prediction unit (PU), etc. The parser (520) may also extract information such as transform coefficients, quantizer parameter values, motion vectors, etc. from the coded video sequence.

[0065] The parser (520) may perform entropy decoding / parsing operations on the video sequence received from the buffer memory (515), thereby creating symbols (521).

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

[0067] 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 actual implementations 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 purposes of describing the disclosed subject matter, the conceptual subdivision into the following multiple functional units is appropriate.

[0068] 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) may output a block including sample values, which may be input into an aggregator (555).

[0069] In some cases, the output samples of the scaler / inverse transform (551) may belong to an intra-coded block; that is, a block that does not use prediction information from a previously reconstructed picture, but may use prediction information from a previously reconstructed portion of the current picture. Such prediction information may be provided by an intra-picture prediction unit (552). In some cases, the intra-picture prediction unit (552) uses surrounding reconstructed information extracted from a 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 generated by the intra-prediction unit (552) to the output sample information provided by the scaler / inverse transform unit (551) on a per-sample basis.

[0070] In other cases, the output samples of the scaler / inverse transform unit (551) may belong to a block that is inter-coded and potentially motion compensated. In this case, the motion compensated prediction unit (553) may access the reference picture memory (557) to extract samples for prediction. After the extracted 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, referred to as residual samples or residual signals) by the aggregator (555) to generate output sample information. The extraction of prediction samples by the motion compensated prediction unit (553) from the address in the reference picture memory (557) may be controlled by a motion vector, which may be provided to the motion compensated prediction unit (553) in the form of symbols (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 ​​extracted from the reference picture memory (557) when using sub-sample accurate motion vectors, motion vector prediction mechanisms, etc.

[0071] 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 a coded video bitstream) and available to the loop filter unit (556) as symbols (521) from the parser (520), however, the video compression techniques may also be responsive to meta-information obtained during decoding of a previous (in decoding order) portion of a coded picture or coded video sequence, and to previously reconstructed and loop filtered sample values.

[0072] 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 future inter-picture prediction.

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

[0074] The video decoder (510) may perform decoding operations according to a predetermined video compression technique in a 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 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 the only tools available for use under the profile. For compliance, it is also required that the complexity of the encoded video sequence is within the range 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 limited by the hypothetical reference decoder (HRD) specification and metadata of the HRD buffer management signaled in the encoded video sequence.

[0075] In one embodiment, the receiver (531) can receive additional (redundant) data when receiving the encoded video. The additional data can be included as part of the encoded video sequence. The additional data can be used by the video decoder (510) to properly decode the data and / or more accurately reconstruct the original video data. The additional data can take the form of, for example, temporal, spatial or signal-to-noise ratio (SNR) enhancement layers, redundant slices, redundant pictures, forward error correction codes, etc.

[0076] Figure 6 A block diagram of a video encoder (603) according to an embodiment of the present application 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). The video encoder (603) can be used to replace Figure 4 A video encoder (403) in an example.

[0077] The video encoder (603) can be used to obtain the video source (601) (not Figure 6In an example, the video source (601) is a part of the electronic device (620) to receive the video samples, and the video source (601) can capture the video images to be encoded by the video encoder (603). In another example, the video source (601) is a part of the electronic device (620).

[0078] 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-bit, 10-bit, 12-bit, ...), any color space (e.g., BT.601 YCrCB, RGB, ...), and any suitable sampling structure (e.g., YCrCb 4:2:0, YCrCb 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 picture itself may be constructed 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 the samples.

[0079] According to one embodiment, the video encoder (603) may 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 by the application. 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 described. For clarity, the coupling is not depicted in the figure. The parameters set by the controller (650) may include rate control related parameters (picture skipping, quantizer, lambda value of rate distortion optimization techniques, etc.), picture size, picture group (GOP) layout, maximum motion vector search range, etc. The controller (650) may be configured to have other suitable functions that are related to the video encoder (603) optimized for a certain system design.

[0080] In some embodiments, the video encoder (603) is configured to operate in an encoding loop. As an oversimplified description, in one 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 may also create sample data (because in the video compression techniques considered in the disclosed subject matter, any compression between the symbols and the encoded video bitstream is lossless). The reconstructed sample stream (sample data) is input to a reference picture memory (634). Since the decoding of the symbol stream produces bit-accurate results that are independent of the decoder location (local or remote), the contents of the reference picture memory (634) are also bit-accurately corresponding between the local encoder and the remote encoder. In other words, the reference picture samples "seen" by the prediction portion of the encoder are exactly the same as the sample values ​​that the decoder will "see" when using the prediction during decoding. This basic principle of reference picture synchronization (and the drift that occurs when synchronization cannot be maintained, eg due to channel errors) is also used in some related techniques.

[0081] The operation of the "local" decoder (633) may be similar to that described above in conjunction with Figure 5 The "remote" decoder of the video decoder (510) described in detail is identical. However, additional brief reference is made to Figure 5 , since the symbols are available and the entropy encoder (645) and the parser (520) are able to losslessly encode / decode the symbols into an encoded video sequence, 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).

[0082] At this point it can be observed that any decoder technology other than parsing / entropy decoding present in the decoder must necessarily be present in the corresponding encoder in substantially the same functional form. For this reason, the disclosed subject matter focuses on decoder operation. The description of encoder technology can be simplified because encoder technology is mutually inverse to the decoder technology described comprehensively. A more detailed description is needed in certain areas and is provided below.

[0083] During operation, in some examples, the source encoder (630) may perform motion compensated predictive coding that predictively encodes an input picture by referencing 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.

[0084] The local video decoder (633) may decode the encoded video data of the picture that may be designated as the reference picture based on the symbol created by the source encoder (630). The operation of the encoding engine (632) may advantageously be a lossy process. When the encoded video data may be decoded at the video decoder ( Figure 6 When decoded from a remote video decoder (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 cache (634). In this way, the video encoder (603) may store a copy of the reconstructed reference picture locally that has common content (absent transmission errors) with the reconstructed reference picture to be obtained by the remote video decoder.

[0085] 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 certain 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 a suitable 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).

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

[0087] The outputs of all the above functional units may be entropy encoded in an entropy encoder (645). The entropy encoder (645) performs lossless compression on the symbols generated by the various functional units according to techniques such as Huffman coding, variable length coding, arithmetic coding, etc., thereby converting the symbols into a coded video sequence.

[0088] The transmitter (640) can buffer the encoded video sequence created by the entropy encoder (645) in preparation for transmission over a communication channel (660), which can be a hardware / software link to a storage device that can store the encoded video data. 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).

[0089] The controller (650) may manage the operation of the video encoder (603). During encoding, the controller (650) may assign a certain coded picture type to each coded picture, but this may affect the coding techniques that can be applied to the corresponding picture. For example, a picture may generally be assigned to any of the following picture types:

[0090] 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 for different types of intra pictures, including, for example, independent decoder refresh ("IDR") pictures. Those skilled in the art are aware of these variations of I pictures and their corresponding applications and features.

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

[0092] Bidirectional predictive pictures (B pictures), which can be pictures that can be encoded and decoded using intra-frame prediction or inter-frame prediction, which uses up to two motion vectors and reference indices to predict the sample values ​​of each block. Similarly, multiple predictive pictures can use more than two reference pictures and associated metadata to reconstruct a single block.

[0093] The source picture may typically be spatially subdivided into blocks of samples (e.g., blocks of 4×4, 8×8, 4×8, or 16×16 samples), and coded block by block. These blocks may be predictively coded with reference to other (already coded) 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 coded, or blocks of an I picture may be predictively coded (spatial prediction or intra prediction) with reference to already coded blocks of the same picture. Blocks of pixels of a P picture may be predictively coded by spatial prediction with reference to one previously coded reference picture or by temporal prediction. Blocks of a B picture may be predictively coded by spatial prediction with reference to one or two previously coded reference pictures or by temporal prediction.

[0094] 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 operation, the video encoder (603) may perform various compression operations, including predictive encoding operations that exploit temporal and spatial redundancy in an input video sequence. Thus, the encoded video data may conform to the syntax specified by the video encoding technique or standard used.

[0095] In one embodiment, the transmitter (640) may transmit additional data when transmitting 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.

[0096] The captured video may be taken as a plurality of source pictures (video pictures) in a temporal sequence. Intra-picture prediction (often shortened to intra-prediction) exploits spatial correlations in a given picture, while inter-picture prediction exploits (temporal or other) correlations between pictures. In one example, a particular picture being encoded / decoded is divided into blocks, and the particular picture being encoded / decoded is referred to as the current picture. When a block in the current picture is similar to a reference block in a reference picture that was previously encoded in the video and is still buffered, the block in the current picture may 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 where multiple reference pictures are used, the motion vector may have a third dimension that identifies the reference picture.

[0097] In some embodiments, a bidirectional prediction technique may be used for inter-picture prediction. According to this bidirectional prediction technique, two reference pictures are used, for example, a first reference picture and a second reference picture that precede the current picture in the video in decoding order (but may be in the past and future, respectively, in display order). 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. The block may be predicted by a combination of the first reference block and the second reference block.

[0098] In addition, merge mode technology can be used for inter-picture prediction to improve coding efficiency.

[0099] According to some embodiments of the embodiments of the present application, 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 (CTUs) 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 (CTBs), which are a luminance CTB and two chrominance CTBs. Each CTU can be recursively divided into one or more coding units (CUs) 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 one example, each CU can be analyzed to determine a prediction type for the CU, such as an inter-prediction type or an intra-prediction type. The CU is divided into one or more prediction units (PUs) based on temporal and / or spatial predictability. Typically, each PU includes a luminance prediction block (PB) and two chrominance PBs. In one embodiment, the prediction operation in encoding (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 values ​​(e.g., luma values) for pixels, such as 8×8 pixels, 16×16 pixels, 8×16 pixels, 16×8 pixels, etc.

[0100] Figure 7 A diagram of a video encoder (703) according to another embodiment of an embodiment of the present application is shown. The video encoder (703) is configured to receive a processed block (e.g., a prediction block) of sample values ​​within a current video picture in a video picture sequence, and encode the processed block into an encoded picture that is part of an encoded video sequence. In one example, the video encoder (703) is used instead of Figure 4 A video encoder (403) in an example.

[0101] 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, etc. The video encoder (703) uses, for example, rate-distortion optimization (RDO) to determine whether to use intra mode, inter mode, or bidirectional prediction mode to best encode the processing block. When the processing block is encoded in intra mode, the video encoder (703) may use intra prediction techniques to encode the processing block into an encoded picture; and when the processing block is encoded in inter mode or bidirectional prediction mode, the video encoder (703) may use inter prediction or bidirectional prediction techniques to encode the processing block into an encoded picture, respectively. In some video coding techniques, merge mode may be used as 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 one example, the video encoder (703) includes other components, such as a mode decision module (not shown) for determining a mode of processing a block.

[0102] exist Figure 7 In the example of FIG. 7 , 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.

[0103] 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., redundant information description according to an inter-frame coding technique, motion vectors, merge mode information), and calculate an inter-frame prediction result (e.g., a predicted block) based on the inter-frame prediction information using any suitable technique. In some examples, the reference picture is a decoded reference picture decoded based on the encoded video information.

[0104] The intra encoder (722) is configured to receive samples of a current block (e.g., a processing block), compare the block with an 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 one example, the intra encoder (722) also calculates an intra prediction result (e.g., a predicted block) based on the intra prediction information and a reference block in the same picture.

[0105] 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 one 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 an intra-frame mode, the general controller (721) controls the switch (726) to select the intra-frame mode result for use by the residual calculator (723), and controls the entropy encoder (725) to select the intra-frame prediction information and include the intra-frame prediction information in the bitstream; and when the mode is an inter-frame mode, the general controller (721) controls the switch (726) to select the inter-frame prediction result for use by the residual calculator (723), and controls the entropy encoder (725) to select the inter-frame prediction information and include the inter-frame prediction information in the bitstream.

[0106] The residual calculator (723) is configured to calculate the difference (residual data) between the received block and the prediction result selected from the intra encoder (722) or the inter encoder (730). The residual encoder (724) is configured to operate based on the residual data to encode the residual data to generate a transform coefficient. In one example, the residual encoder (724) is configured to transform the residual data from the spatial domain to the frequency domain and generate a transform coefficient. The transform coefficient is then subjected to a quantization process to obtain a quantized transform coefficient. 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 encoder (722) and the inter 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. In some examples, the decoded blocks are processed appropriately to generate a decoded picture, and the decoded picture can be buffered in a memory circuit (not shown) and used as a reference picture.

[0107] The entropy encoder (725) is configured to format the codestream to include the encoded blocks. The entropy encoder (725) is configured to include various information according to a suitable standard such as the HEVC standard. In one 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 codestream. It should be noted that according to the disclosed subject matter, when the block is encoded in the inter-frame mode or the merge sub-mode of the bidirectional prediction mode, there is no residual information.

[0108] Figure 8A diagram of a video decoder (810) according to another embodiment of the present application 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 one example, the video decoder (810) is used instead of Figure 4 A video decoder (410) in an example of FIG.

[0109] exist Figure 8 In the example of FIG. 8 , 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.

[0110] The entropy decoder (871) may be configured to reconstruct certain symbols from the encoded picture, the symbols representing the syntax elements constituting the encoded picture. Such symbols may include, for example, a mode for encoding a block (e.g., intra mode, inter mode, bidirectional prediction mode, a merged sub-mode of the latter two, or another sub-mode), prediction information (e.g., intra prediction information or inter prediction information) that can identify certain samples or metadata used by the intra decoder (872) or the inter decoder (880) for prediction, respectively, residual information in the form of, for example, quantized transform coefficients, etc. In one example, when the prediction mode is inter or bidirectional prediction mode, the inter prediction information is provided to the inter decoder (880); and when the prediction type is an intra prediction type, the intra prediction information is provided to the intra decoder (872). The residual information may be subjected to inverse quantization and provided to the residual decoder (873).

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

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

[0113] The residual decoder (873) is configured to perform inverse quantization to extract dequantized transform coefficients, and process the dequantized transform coefficients to transform the residual from the frequency domain to the spatial domain. The residual decoder (873) may also require certain control information (to include quantizer parameters (QP)), which may be provided by the entropy decoder (871) (data path not depicted because this is only low data volume control information).

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

[0115] It should be noted that the video encoder (403), video encoder (603) and video encoder (703) and video decoder (410), video decoder (510) and video decoder (810) may be implemented using any suitable technology. In one embodiment, the video encoder (403), video encoder (603) and video encoder (703) and video decoder (410), video decoder (510) and video decoder (810) may be implemented using one or more integrated circuits. In another embodiment, the video encoder (403), video encoder (603) and video encoder (703) and video decoder (410), video decoder (510) and video decoder (810) may be implemented using one or more processors that execute software instructions.

[0116] Various aspects of embodiments of the present application provide techniques for bidirectional prediction that do not require the use of signals to represent CU-level weights. Bidirectional prediction refers to a technique in inter-frame prediction that uses two reference blocks located in two reference pictures to perform predictions on blocks in a current picture. In some examples, one of the two reference pictures is before the current picture in a video sequence, and the other of the two reference pictures is after the current picture in the video sequence, and the bidirectional prediction is called two-way prediction. According to some aspects of embodiments of the present application, the bidirectional prediction technique uses a prediction model with CU-level weights. For example, the CU-level weights can be calculated from previously decoded pixels using a fixed point algorithm, and the CU-level weights are not represented by signals in the bitstream.

[0117] In some related examples, bidirectional prediction with CU-level weights (BCW) may use fixed weights or weights signaled at the CU level (eg, separately for each CU) from the encoder side to the decoder side.

[0118] In one example (e.g., HEVC), a bidirectional prediction signal (sample) is generated by averaging two prediction signals (samples) obtained from two different reference pictures and / or obtained using two different motion vectors. For example, in order to predict a sample in a current picture using bidirectional prediction, a first prediction signal is obtained by inter-frame prediction based on a first reference picture and a first motion vector, and a second prediction signal is obtained by inter-frame prediction based on a second reference picture and a second motion vector. Then, the bidirectional prediction signal in the current picture is obtained by averaging the first prediction signal and the second prediction signal. The weights for averaging are fixed, and the weights for the first prediction signal and the second prediction signal are 0.5, respectively.

[0119] In another example (e.g., VVC), the bidirectional prediction mode is extended beyond simple averaging to allow weighted averaging of two prediction signals. For example, P0[i, j] indicates the first prediction signal of the pixel at position (i, j) in the current CU, and P1[i, j] indicates the second prediction signal of the pixel at position (i, j) in the current CU. The first prediction signal is obtained by inter-frame prediction based on a first reference picture and a first motion vector, and the second prediction signal is obtained by inter-frame prediction based on a second reference picture and a second motion vector. The bidirectional prediction signal of the pixel at position (i, j) is obtained by P0[i, j], which is a first prediction signal of the pixel at position (i, j). bi-pred [i, j] indicates that it can be calculated according to equation (1):

[0120] P bi-pred [i, j] = ((8-w)×P0[i, j] + w×P1[i, j] + 4) >>3 Equation (1)

[0121] Wherein, w indicates the weight of the second prediction signal. In some examples, from the encoder side to the decoder side, a weight index is used to signal the weight. For example, five weights are allowed in weighted average bidirectional prediction, w∈{-2, 3, 4, 5, 10}. The BCW weight index is encoded in the bitstream at the CU level, and the BCW weight index may indicate one of the five weights used in bidirectional prediction.

[0122] In some related examples, a technique called local illumination compensation (LIC) is used. In one example, LIC is used in an inter prediction technique for unidirectional prediction of an inter-coded CU. LIC is not applicable to bidirectional prediction. LIC can model the local illumination variation between the current block and its reference block as a function of the variation between the current block template and the reference block template.

[0123] 9A to 9C A diagram illustrating unidirectional prediction of an inter-coded CU is shown in some examples. Fig. 9AIn the example, the current block (910) is located in the current picture for encoding. In order to perform inter-frame prediction on the current block (910), a reference block (920) in the reference picture is determined as a temporal prediction of the current block (910). The position of the reference block (920) in the reference picture may be spatially offset from the position of the current block (910) in the current picture, such as Fig. 9A As indicated by the motion vector (930) in .

[0124] exist Fig. 9B , a current template and a reference template associated with a current block (910) and a reference block (920), respectively, are shown. In some examples, such as Fig. 9B As shown, the current template of the current block (910) includes an upper current template (911) and a left current template (912). The upper current template (911) includes adjacent pixels above the current block (910) in the current picture. The left current template (912) includes adjacent pixels on the left side of the current block (910) in the current picture.

[0125] Similarly, if Fig. 9B As shown, the reference template of the reference block (920) includes an upper reference template (921) and a left reference template (922). The upper reference template (921) includes adjacent pixels located above the reference block (920) in the reference picture. The left reference template (922) includes adjacent pixels located to the left of the reference block (920) in the reference picture.

[0126] In some examples, the template above the block includes a row of pixels immediately above the block, and the template to the left of the block includes a column of pixels immediately to the left of the block. Fig. 9B As shown, the upper current template (911) includes a row of pixels immediately above the current block (910) in the current picture, and the left current template (912) includes a column of pixels immediately to the left of the current block (910) in the current picture. The upper reference template (921) includes a row of pixels immediately above the reference block (920) in the reference picture. The left reference template (922) includes a column of pixels immediately to the left of the reference block (920) in the reference picture.

[0127] exist Fig. 9C In the present invention, the reference block template (including the upper reference template (921) and the left reference template (922)) can be regarded as a temporal prediction of the current block template (including the upper current template (911) and the left current template (912)) indicated by the motion vector (930) between the current block (910) and the reference block (920).

[0128] In some examples, according to local illumination compensation (LIC), samples in a current block can be predicted by applying an LIC model to samples in a reference block. For example, the current block has a width w and a height h, and the reference block also has a width w and a height h. For ease of description, it is assumed that the upper left corner of the current block has coordinates (0, 0), and it is assumed that the upper left corner of the reference block has coordinates (0, 0). In addition, y[i, j] indicates the sample value at position (i, j) in the current block, where 0 ≤ i < w and 0 ≤ j < h, indicates the prediction of the sample value at position (i, j) in the current block, where 0 ≤ i < w and 0 ≤ j < h, and x[i, j] indicates the reconstructed sample value at position (i, j) in the reference block, where 0 ≤ i < w and 0 ≤ j < h. In some examples, the LIC model can be represented by Equation (2):

[0129]

[0130] where α indicates a scaling parameter and β indicates an offset parameter, and α and β are used to compensate for the illumination change between the current block in the current picture and the reference block in the reference picture.

[0131] In some examples, the scaling parameter α and the offset parameter β can be derived based on a current block template (such as (911) and (912)) and a reference block template (such as (921) and (922)). In one example, an LIC flag is signaled to indicate the use of LIC, and no signaling overhead is required to signal the scaling parameter α and the offset parameter β.

[0132] It should be noted that LIC is an inter - prediction technique for uni - directional prediction of an inter - coded CU and is not applicable to bi - directional prediction.

[0133] According to one aspect of the embodiments of the present application, BCW in related examples (such as VVC) has limited weight precision. In some examples, at most five weight values are allowed in weighted average bi - directional prediction. In addition, signaling the weight index in the bitstream increases the signaling overhead of the bitrate.

[0134] According to another aspect of the embodiments of the present application, LIC can model the local illumination change between a current block and its reference block as a function of the illumination change between the current block template of the current block and the reference block template of the reference block. LIC does not increase the overhead of signaling the scaling parameter and the offset parameter in the bitrate. However, LIC is not applicable to bi - directional prediction.

[0135] Some aspects of the embodiments of the present application provide techniques for bi - directional prediction, where CU - level weights have higher weight precision (for example, higher than the weight precision in VVC), and there is no need to signal the weights in the bitstream.

[0136] In some embodiments, in the bidirectional prediction mode, P0[i, j] indicates the first prediction signal of the pixel at position (i, j) in the current CU, and P1[i, j] indicates the second prediction signal of the pixel at position (i, j) in the current CU. The bidirectional prediction signal of the pixel at position (i, j) is represented by P bi-pred [i, j] indicates that it can be calculated as a weighted average of the first prediction signal and the second prediction signal, for example, according to equation (3):

[0137] P bi-pred [i, j] = ((2 n -w)×P0[i,j]+w×P1[i,j]+2 n-1 )>>n

[0138] = P0[i,j] + (w·(P1[i,j] - P0[i,j]) + 2 n-1 ) >>n Equation (3)

[0139] Wherein, w indicates a weight and n indicates a predetermined offset parameter. In some examples, the weight w is an integer and 0 <w<2 n In one embodiment, when 10 bits are used to represent the first prediction signal P0 and the second prediction signal P1, n is set to 5, so the calculation in equation (3) can be completed using a 16-bit signed arithmetic.

[0140] According to some embodiments, the weight w may be determined based on the current template of the current CU and the reference template of the reference CU, so in some examples no CU-level weight signaling is required.

[0141] Fig.10 A diagram showing encoding of a video sequence (1000) using bi-directional prediction according to some embodiments of the present application.

[0142] exist Fig.10In the example of , a video sequence (1000) includes multiple picture frames, for example, frames (1001)-(1003), etc. Frame (1001) is a current frame for encoding, and frames (1002) and (1003) are encoded (encoded or decoded) before frame (1001). In some examples, one of frame (1002) and frame (1003) is before frame (1001) in the display order of the video sequence (1000), and the other of frame (1002) and frame (1003) is after frame (1001) in the display order. It should be noted that additional frames may or may not exist between frame (1002) and frame (1001) or between frame (1001) and frame (1003). In some other examples, frame (1002) and frame (1003) both precede frame (1001) in the display order, or frame (1002) and frame (1003) both follow frame (1001) in the display order.

[0143] exist Fig.10 In the example of , a current block (1010) is located in a current picture for encoding (e.g., frame (1001)). In order to inter-predict the current block (1010) in a bi-directional prediction mode, a first reference block (1020) in a first reference picture (e.g., frame (1002)) and a second reference block (1030) in a second reference picture (e.g., frame (1003)) are determined. The position of the first reference block (1020) in frame (1002) can generate a first spatial offset from the position of the current block (1010) in frame (1001), such as Fig.10 The position of the second reference block (1030) in the frame (1003) may be offset from the position of the current block (1010) in the frame (1001) by a second spatial offset, as shown in FIG. Fig.10 The first reference block (1020) may be referred to as a first prediction of the current block (1010) and may be indicated by P0. The second reference block (1030) may be referred to as a second prediction of the current block (1010) and may be indicated by P1. The current block (1010) may be predicted by a weighted average of the first prediction P0 and the second prediction P1.

[0144] In some embodiments, in bi-prediction mode, the weight w is determined using a current template of the current block (1020), a reference template of the first reference block (1022), and a reference template of the second reference block (1030).

[0145] In some examples, the current template of the current block (1010) is referred to as the current template T c . Current template T c Includes decoded pixels adjacent to the current block (1010). In some examples, the current template Tc A row of pixels (eg, shown by (1011)) immediately above the current block (1010) is included and a column of pixels (eg, shown by (1012)) immediately to the left of the current block (1010) is included.

[0146] The reference template of the first reference block (1020) is referred to as the first reference template T0. The first reference template T0 includes decoded pixels adjacent to the first reference block (1020). In some examples, the first reference template T0 includes a row of pixels immediately above the first reference block (1020) (e.g., as shown by (1021)) and includes a column of pixels immediately to the left of the first reference block (1020) (e.g., as shown by (1022)).

[0147] The reference template of the second reference block (1030) is referred to as the second reference template T1. The second reference template T1 includes decoded pixels adjacent to the second reference block (1030). In some examples, the second reference template T1 includes a row of pixels immediately above the second reference block (1030) (e.g., as shown by (1031)) and includes a column of pixels immediately to the left of the second reference block (e.g., as shown by (1032)).

[0148] It should be noted that in some examples, the current template T c Can have any suitable shape, corresponding to the current template T c The first reference template T0 and the second reference template T1 may be determined based on the motion vectors mv0 and mv1.

[0149] According to one aspect of an embodiment of the present application, when encoding (encoding or decoding) the current block (1010), the current template T c The first reference picture (1002) and the second reference picture (1003) have been reconstructed, so the first reference template T0 and the second reference template T1 are reconstructed. Then, based on the current template T c , the first reference template T0 and the second reference template T1 to determine the weight w. The weight w can be calculated at the encoder and the decoder, so in some examples, the weight w is not signaled in the bitstream.

[0150] It should be noted that the weight w may be calculated using any suitable technique.

[0151] In some embodiments, the cost function may be formed of a cost that depends on a weight w. The weight w may then be determined as an augment that minimizes the cost of the cost function.

[0152] In some examples, the first reference template T0 and the second reference template T1 are applied according to equation (3) to predict the current template T wDetermined as a function of weight w. For example, the current template T c The predicted current template T at position (i, j) w It can be calculated according to equation (4):

[0153] T w [i,j]=T0[i,j]+(w×(T1[i,j]-T0[i,j])+2 n-1 )>>nEquation (4)

[0154] In one embodiment, T w [i, j] and T c The difference between [i, j] can be used to calculate the cost function.

[0155] In some examples, the cost function may be formed according to equation (5):

[0156] Cost function = ||T c -T w || 2 =∑Position in current template (T c [i,j]-T w [i,j]) 2 Equation (5)

[0157] The weight w is the parameter that minimizes the cost of the cost function. In one example, the weight w is subject to the following constraints: <w<2 n , n is a positive integer. In one embodiment, when 10 bits are used to represent the first prediction signal P0 and the second prediction signal P1, n is set to 5, so the calculations in equations (4) and (5) can be completed using a 16-bit signed algorithm.

[0158] In some examples, the weight w is approximately determined by ordinary least squares using fixed point arithmetic and then fixed to the range [a, b], where a and b are predetermined integers.

[0159] After determining the weight w, the current block (1010) may be predicted as a weighted average of the first prediction P0 and the second prediction P1 in a bi-prediction mode, for example using equation (3).

[0160] Fig.11 A flow chart outlining a process (1100) performed in a bi-directional prediction mode according to one embodiment of the present application is shown. The process starts at (S1101) and proceeds to (S1110).

[0161] At (S1110), in order to encode in a bidirectional prediction mode, a current block (e.g., current block (1010)) is determined, and then a first motion vector mv0, a first reference picture, a second motion vector mv1, and a second reference picture are determined. A first prediction P0 (e.g., first reference block (1020)) is determined based on the first motion vector mv0 and the first reference picture; and a second prediction P1 (e.g., second reference block (1030)) is determined based on the second motion vector mv1 and the second reference picture. In addition, a current template T is determined. c (For example (1011) and (1012)).

[0162] At (S1120), a first reference template T0 and a second reference template T1 are determined. In some examples, based on the current template T c and the first motion vector mv0 to determine the first reference template T0, and based on the current template T c and the second motion vector mv1 to determine the second reference template T1.

[0163] At (S1130), a weight that minimizes the cost of the cost function is determined. For example, the cost function may be formed as a function of the weight w based on equations (4) and (5). Then, the weight w is determined to minimize the cost of the cost function.

[0164] At (S1140), the bidirectional prediction may then be calculated as a weighted average of the first prediction P0 and the second prediction P1 based on the determined weights.

[0165] According to one aspect of an embodiment of the present application, multiple weight parameters may be used in a bidirectional prediction mode.

[0166] In some examples, three weight parameters are used in bidirectional prediction mode. For example, in bidirectional prediction mode, the bidirectional prediction signal of the pixel at position (i, j) in the current CU (e.g., the current block (1010)) is represented by P bi-pred [i, j] indicates that it can be calculated as a weighted average of the first prediction signal P0[i, j] and the second prediction signal P1[i, j] according to a prediction model (for example, according to the prediction model of equation (6)):

[0167] P bi-pred [i,j] = (w0×P0[i,j] + w1×P1[i,j] + w2) >>n Equation (6)

[0168] Wherein, w0, w1, w2 are weight parameters (also referred to as weights) of the prediction model, and n is a predetermined offset parameter. The weight parameters w0, w1, w2 can be derived from the template (eg, the current template, the first reference template, and the second reference template) by a fixed point algorithm.

[0169] The values ​​of weight parameters w0, w1, w2 can be based on the current template T c , the pixels in the first reference template T0 and the second reference template T1. In one example, the current template T w It can be formed as a function of weight parameters. For example, the current template T c The predicted current template T at position (i, j) w It can be expressed according to equation (7):

[0170] T w [i,j] = (w0×T0[i,j] + w1×T1[i,j] + w2) >>n Equation (7)

[0171] In some examples, the prediction template T may be used according to equation (5) w and the current template T c The cost function is thus formed as a function of the weight parameters. In one example, the weight parameters w0, w1, w2 may be determined as (for the current template T c All positions in ) 0 ≤ T w [i, j] < 2 b The parameter that minimizes the cost function under the constraint , where b is the bit depth of the pixel.

[0172] In one example, the weight parameters w0, w1, w2 are approximately determined by ordinary least squares using a fixed point algorithm using Cramer's rule. In some examples, the values ​​of the weight parameters may be fixed. In one example, w i Fixed to range [a i , b i ], where a i and b i is a predetermined integer, i∈{0, 1, 2}.

[0173] In some examples, two weight parameters are used in bidirectional prediction mode. For example, in bidirectional prediction mode, the bidirectional prediction signal of the pixel at position (i, j) in the current CU (e.g., the current block (1010)) is represented by P bi-pred [i, j] indicates that it can be calculated as a weighted average of the first prediction signal P0[i, j] and the second prediction signal P1[i, j] according to a prediction model (for example, a prediction model according to equation (8)):

[0174] P bi-pred [i, j] = (w0×P0[i, j] + w1×P1[i, j] + C) >>n Equation (8)

[0175] Wherein, w0, w1 are weight parameters (also referred to as weights) of the prediction model and can be derived from templates (eg, current template, first reference template, and second reference template) by fixed point algorithm. Parameter C is a predetermined value for rounding, and n is a predetermined offset parameter.

[0176] The values ​​of weight parameters w0 and w1 can be based on the current template T c , the pixels in the first reference template T0 and the second reference template T1. In one example, the current template T w It can be formed as a function of weight parameters. For example, the current template T c The predicted current template T at position (i, j) in the region w It can be expressed according to equation (9):

[0177] T w [i, j] = (w0×T0[i, j] + w1×T1[i, j] + C) >>n Equation (9)

[0178] In some examples, the prediction template T may be used according to equation (5) w and the current template T c The cost function is thus a function of the weight parameters. In one example, the weight parameters w0, w1 can be determined as (for the current template T c All positions in ) 0 ≤ T w [i, j] < 2 b The parameter that minimizes the cost function under the constraint , where b is the bit depth of the pixel.

[0179] In one example, the weight parameters w0, w1 are approximately determined by ordinary least squares using a fixed point algorithm using Cramer's rule. In some examples, the values ​​of the weight parameters may be fixed. In one example, w i Fixed to range [a i , b i ], where a i and b i is a predetermined integer, i∈{0,1}.

[0180] According to an aspect of an embodiment of the present application, at the encoder side, a weight parameter for a bidirectional prediction mode may be determined together with the determination of motion vectors mv0 and mv1.

[0181] Fig.12A flowchart outlining a process (1200) according to some embodiments of the present application is shown. In some examples, the process (1200) is used on the encoder side to jointly determine weight parameters for a bidirectional prediction mode, a first motion vector mv0, and a second motion vector mv1. The process (1200) performs motion vector refinement based on a predetermined search pattern using an initial first motion vector mv'0 and an initial second motion vector mv'1. The process (1200) can determine the best motion vectors mv0 and mv1 and the best weights using a predetermined bidirectional prediction model and a predetermined cost function based on a fixed point algorithm. The best motion vectors mv0 and mv1 can be appropriately notified to the decoder side, and the best weights are not signaled to the decoder side. The decoder side can determine the weights based on the notified motion vectors (e.g., the best motion vectors mv0 and mv1). The process starts at (S1201) and proceeds to (S1210).

[0182] At (S1210), the initial first motion vector mv'0, the initial second motion vector mv'1 and the current template T are determined. c , a first refinement of mv'0 is indicated by dmv0, which is initially set to 0, and a second refinement of mv'1 is indicated by dmv1, which is initially set to 0. The initial first motion vector mv'0 and the initial second motion vector mv'1 may be determined by any suitable technique.

[0183] At (S1220), a refined first motion vector mv′0 is determined based on the initial first motion vector mv′0 and the first refined dmv0. Determine the refined second motion vector mv′1 based on the initial second motion vector mv′1 and the second refined dmv1

[0184] At (S1230), based on the current template T c and refine the first motion vector To determine the first reference template T0, based on the current template T c and refine the second motion vector To determine the second reference template T1.

[0185] At (S1240), a predetermined bidirectional prediction model (eg, equation (3), equation (6), equation (8)) with weight parameters may be used to represent the prediction template T based on the first reference template T0 and the second reference template T1. w , as shown in equations (4), (7) and (9). Therefore, the prediction template T w is expressed as a function of weight parameters. Then, the predetermined cost function can be used to predict the template T w and the current template T cTo represent the cost, for example, according to equation (5). Therefore, the cost is a function of the weight parameter. Further, the weight parameter is calculated to minimize the cost of the cost function. The minimum cost associated with the current refinement dmv0 and dmv1 is called the newly calculated cost. The calculated weight parameter is associated with the newly calculated cost. In some examples, the calculation is performed by ordinary least squares using a fixed point algorithm using Cramer's rule.

[0186] At (S1250), the newly calculated cost is compared with the previous best cost to update the best cost. In one example, when the newly calculated cost is less than the previous best cost, the newly calculated cost is stored as the best cost, the calculated weight parameter associated with the newly calculated cost is maintained as the best weight associated with the best cost, and the current refined motion vector associated with the newly calculated cost is maintained. and (in the case where the current refinements dmv0 and dmv1 are applied to the initial motion vectors mv'0 and mv'1) as the best refined motion vector associated with the best cost. In another example, when the newly calculated cost is equal to or higher than the previous best cost, the previous best cost is still stored as the best cost, the previous best weight associated with the previous best cost is still maintained as the best weight associated with the best cost, and the previous best refined motion vector associated with the previous best cost is still maintained as the best refined motion vector associated with the best cost.

[0187] At (S1260), when the predetermined search pattern completely completes the search, the process proceeds to (S1280); otherwise, the process proceeds to (S1270).

[0188] At (S1270), the first refined dmv0 and the second refined dmv1 are updated according to a predetermined search pattern, and the process returns to (S1220).

[0189] At (S1280), a first prediction P0 and a second prediction P1 are determined (eg, calculated) based on the best refined motion vector associated with the best cost.

[0190] At (S1290), a bidirectional prediction may be calculated based on the first prediction P0, the second prediction P1, and an optimal weight associated with the optimal cost.

[0191] Fig.13A flow chart outlining a process (1300) according to one embodiment of an embodiment of the present application is shown. The process (1300) may be used for a video encoder. In various embodiments, the process (1300) is performed by a processing circuit, such as a processing circuit in a terminal device (310), a terminal device (320), a terminal device (330), and a terminal device (340), a processing circuit that performs the functions of a video encoder (403), a processing circuit that performs the functions of a video encoder (603), a processing circuit that performs the functions of a video encoder (703), etc. In some embodiments, the process (1300) is implemented in software instructions, so when the processing circuit executes the software instructions, the processing circuit performs the process (1300). The process starts at (S1301) and proceeds to (S1310).

[0192] At (S1310), a bi-directional prediction mode without weight signaling is determined for encoding a coding block in a current picture. In one example, the encoder may perform an evaluation and, based on the evaluation, determine to use the bi-directional prediction mode without weight signaling to encode the coding block.

[0193] At (S1320), weights and motion vectors for bidirectional prediction of a coding block are determined, for example, a first motion vector associated with a first reference picture and a second motion vector associated with a second reference picture.

[0194] In some embodiments, a first motion vector and a second motion vector are determined, and then a weight is determined. In some examples, after the motion vector is determined, a reference template in a reference picture is determined based on a current template and a motion vector of the coding block. For example, a first reference template in a first reference picture is determined based on the current template and the first motion vector of the coding block, and a second reference template in a second reference picture is determined based on the current template and the second motion vector of the coding block.

[0195] According to one aspect of an embodiment of the present application, the current template of the current block includes one or more reconstructed samples adjacent to the coding block. In some examples, the current template includes one or more rows of samples located above the coding block, and / or one or more columns of samples located to the left of the coding block. In one example, the current template includes a row of samples immediately above the coding block, and / or a column of samples immediately to the left of the coding block.

[0196] In some embodiments, weights for the bi-directional prediction mode are determined based on the first reference template, the second reference template, and the current template.

[0197] In some embodiments, the weight is determined to minimize the cost of a predetermined cost function. The predetermined cost function is based on the first reference template, the second reference template, and the current template. For example, the predetermined cost function is based on the corresponding sample difference between the current template and the predicted current template, such as equation (5).

[0198] The current template is predicted based on the first reference template and the second reference template using a predetermined bidirectional prediction model having one or more weight parameters.

[0199] In some examples, the predetermined bidirectional prediction model includes three weight parameters, and the prediction of the current template can be expressed, for example, according to equation (7). In one example, the values ​​of the three weight parameters in the predetermined bidirectional prediction model are determined by ordinary least squares method, for example, using a fixed point algorithm using Cramer's rule.

[0200] In some examples, the predetermined bidirectional prediction model includes two weight parameters, and the prediction of the current template can be expressed, for example, according to equation (9). In one example, the values ​​of the two weight parameters in the predetermined bidirectional prediction model are determined by ordinary least squares, for example, using a fixed point algorithm using Cramer's rule.

[0201] In some examples, the predetermined bidirectional prediction model includes a weight parameter, and the prediction of the current template can be expressed, for example, according to equation (4). In one example, the value of the weight parameter in the predetermined bidirectional prediction model is determined by ordinary least squares method, for example, using a fixed point algorithm.

[0202] In some examples, the values ​​of the weight parameters are fixed within predetermined ranges for the respective weight parameters.

[0203] In some examples, the first motion vector, the second motion vector, and the weight are determined jointly. Examples of jointly determining the first motion vector, the second motion vector, and the weight have been referenced. Fig.12 describe.

[0204] At (S1330), the coding block is reconstructed using bidirectional prediction with weights. In some examples, the predetermined bidirectional prediction model includes three weight parameters, and the coding block can be reconstructed, for example, according to equation (6). In some examples, the predetermined bidirectional prediction model includes two weight parameters, and the coding block can be reconstructed, for example, according to equation (8). In some examples, the predetermined bidirectional prediction model includes one weight parameter, and the coding block can be reconstructed, for example, according to equation (3).

[0205] At (S1340), information of the coding block is encoded in the code stream without weight signaling. The information indicates a bidirectional prediction mode without weight signaling in the code stream. Then, the process proceeds to (S1399) and ends.

[0206] The process (1300) may be adapted as appropriate. Steps in the process (1300) may be modified and / or omitted. Additional steps may be added. Any suitable order of implementation may be used.

[0207] Fig.14 A flow chart outlining a process (1400) according to one embodiment of an embodiment of the present application is shown. The process (1400) may be used in a video decoder. In various embodiments, the process (1400) is performed by a processing circuit, such as a processing circuit in a terminal device (310), a terminal device (320), a terminal device (330), and a terminal device (340), a processing circuit that performs the functions of a video decoder (410), a processing circuit that performs the functions of a video decoder (510), etc. In some embodiments, the process (1400) is implemented in software instructions, so when the processing circuit executes the software instructions, the processing circuit performs the process (1400). The process starts at (S1401) and proceeds to (S1410).

[0208] At (S1410), information of a coding block in a current picture is decoded from a bitstream, wherein the information indicates a bidirectional prediction mode without weight signaling.

[0209] At (S1420), a motion vector for bidirectional prediction of the coding block is determined. For example, a first motion vector associated with a first reference picture and a second motion vector associated with a second reference picture are determined. The motion vector may be determined by any suitable technique. In some examples, the motion vector may be determined based on an index of a candidate list, which may be decoded from a bitstream.

[0210] At (S1430), a reference template in a reference picture is determined based on the current template and the motion vector of the coding block. For example, a first reference template in a first reference picture is determined based on the current template and the first motion vector of the coding block, and a second reference template in a second reference picture is determined based on the current template and the second motion vector of the coding block.

[0211] According to one aspect of an embodiment of the present application, the current template of the current block includes one or more reconstructed samples adjacent to the coding block. In some examples, the current template includes one or more rows of samples located above the coding block, and / or one or more columns of samples located to the left of the coding block. In one example, the current template includes a row of samples immediately above the coding block, and / or a column of samples immediately to the left of the coding block.

[0212] At (S1440), a weight for the bi-directional prediction mode is determined based on the first reference template, the second reference template, and the current template.

[0213] In some embodiments, the weight is determined to minimize the cost of a predetermined cost function. The predetermined cost function is based on the first reference template, the second reference template, and the current template. For example, the predetermined cost function is based on the corresponding sample difference between the current template and the predicted current template, for example using equation (5).

[0214] The current template is predicted based on the first reference template and the second reference template using a predetermined bidirectional prediction model having one or more weight parameters.

[0215] In some examples, the predetermined bidirectional prediction model includes three weight parameters, and the prediction of the current template can be expressed, for example, according to equation (7). In one example, the values ​​of the three weight parameters in the predetermined bidirectional prediction model are determined by ordinary least squares method, for example, using a fixed point algorithm using Cramer's rule.

[0216] In some examples, the predetermined bidirectional prediction model includes two weight parameters, and the prediction of the current template can be expressed, for example, according to equation (9). In one example, the values ​​of the two weight parameters in the predetermined bidirectional prediction model are determined by ordinary least squares, for example, using a fixed point algorithm using Cramer's rule.

[0217] In some examples, the predetermined bidirectional prediction model includes a weight parameter, and the prediction of the current template can be expressed, for example, according to equation (4). In one example, the value of the weight parameter in the predetermined bidirectional prediction model is determined by ordinary least squares method, for example, using a fixed point algorithm.

[0218] In some examples, the values ​​of the weight parameters are fixed within predetermined ranges for the respective weight parameters.

[0219] At (S1450), the coding block is reconstructed using bidirectional prediction with weights. In some examples, the predetermined bidirectional prediction model includes three weight parameters, and the coding block can be reconstructed, for example, according to equation (6). In some examples, the predetermined bidirectional prediction model includes two weight parameters, and the coding block can be reconstructed, for example, according to equation (8). In some examples, the predetermined bidirectional prediction model includes one weight parameter, and the coding block can be reconstructed, for example, according to equation (3).

[0220] Then, the process proceeds to (S1499) and ends.

[0221] It should be noted that in some examples, when any neighbors of a coding block are not available, predetermined weights (eg, default weights, etc.) may be used.

[0222] The process (1400) may be adapted as appropriate. Steps in the process (1400) may be modified and / or omitted. Additional steps may be added. Any suitable order of implementation may be used.

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

[0224] Computer software may be encoded using any suitable machine code or computer language that may be subjected to assembly, compilation, linking or similar mechanisms to create code comprising instructions that may be executed directly by one or more computer central processing units (CPUs), graphics processing units (GPUs), etc., or through interpretation, microcode execution, etc.

[0225] 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, and the like.

[0226] Fig.15 The components of the computer system (1500) shown are exemplary in nature and are not intended to impose any limitation on the scope of use or functionality of computer software implementing embodiments of the present application. The configuration of components should not be interpreted as having any dependency or requirement related to any one or combination of components shown in the exemplary embodiment of the computer system (1500).

[0227] The computer system (1500) may include certain human-machine interface input devices. Such human-machine interface input devices may be responsive to input from one or more human users through, for example, tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, clapping), visual input (e.g., gestures), olfactory input (not depicted). 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, captured images obtained from a still image camera), and videos (e.g., two-dimensional video, three-dimensional video including stereoscopic video).

[0228] The human-machine interface input device may include one or more of the following (only one of each is shown): keyboard (1501), mouse (1502), touchpad (1503), touch screen (1510), data gloves (not shown), joystick (1505), microphone (1506), scanner (1507), camera (1508).

[0229] The computer system (1500) may also include certain human-computer interface output devices. Such human-computer interface output devices may stimulate one or more human user senses through, for example, tactile output, sound, light, and smell / taste. Such human-computer interface output devices may include tactile output devices (e.g., tactile feedback of a touch screen (1510), a data glove (not shown), or a joystick (1505), but may also be a tactile feedback device that is not an input device), audio output devices (e.g., speakers (1509), headphones (not depicted)), visual output devices (e.g., screens (1510) including CRT screens, LCD screens, plasma screens, OLED screens, each with or without touch screen input capabilities, each with or without tactile feedback capabilities, some of which are capable of outputting two-dimensional visual outputs or outputs in more than three dimensions through devices such as stereoscopic image output, virtual reality glasses (not depicted), holographic displays and smoke boxes (not depicted), and printers (not depicted).

[0230] The computer system (1500) may also include human-accessible storage devices and their associated media, such as optical media including CD / DVD ROM / RW (1520) with CD / DVD etc. media (1521), thumb drives (1522), removable hard drives or solid-state drives (1523), traditional magnetic media such as tapes and floppy disks (not depicted), dedicated ROM / ASIC / PLD based devices such as security dongles (not depicted), and the like.

[0231] 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 encompass transmission media, carrier waves, or other transitory signals.

[0232] The computer system (1500) may also include an interface (1554) to one or more communication networks (1555). The network may be, for example, a wireless network, a wired network, an optical network. The network may further be a local network, a wide area network, a metropolitan area network, a vehicle and industrial network, a real-time network, a delay-tolerant network, etc. Examples of networks include local area networks such as Ethernet, wireless LANs, cellular networks including GSM, 3G, 4G, 5G, LTE, etc., television wired or wireless wide area digital networks including cable television, satellite television, and terrestrial broadcast television, vehicle and industrial networks including CANBus, etc. Some networks typically require an external network interface adapter attached to some common data port or peripheral bus (1549) (e.g., a USB port of the computer system (1500)); as described below, other network interfaces are typically integrated into the kernel of the computer system (1500) by attaching to the system bus (e.g., connected to an Ethernet interface in a PC computer system or connected to a cellular network interface in a smartphone computer system). The computer system (1500) can use any of these networks to communicate with other entities. Such communications may be one-way receive only (e.g., broadcast television), one-way send only (e.g., CANBus connected to certain CANBus devices), or bidirectional, for example, using a LAN or WAN digital network to connect to other computer systems. As described above, certain protocols and protocol stacks may be used on each of those networks and network interfaces.

[0233] The above-mentioned human interface device, human-accessible storage device, and network interface may be attached to the kernel (1540) of the computer system (1500).

[0234] The kernel (1540) may include one or more central processing units (CPUs) (1541), graphics processing units (GPUs) (1542), dedicated programmable processing units in the form of field programmable gate arrays (FPGAs) (1543), hardware accelerators (1544) for certain tasks, graphics adapters (1550), and the like. These devices, as well as read-only memory (ROM) (1545), random access memory (1546), internal mass storage (1547) such as internal non-user accessible hard drives, SSDs, and the like, may be connected via a system bus (1548). In some computer systems, the system bus (1548) may be accessed in the form of one or more physical plugs to enable expansion by additional CPUs, GPUs, and the like. Peripheral devices may be attached directly to the kernel's system bus (1548) or to the kernel's system bus (1548) via a peripheral bus (1549). In one example, a screen (1510) may be connected to a graphics adapter (1550). The architecture of the peripheral bus includes PCI, USB, and the like.

[0235] The CPU (1541), GPU (1542), FPGA (1543) and accelerator (1544) can execute certain instructions, which can be combined to form the above-mentioned computer code. The computer code can be stored in ROM (1545) or RAM (1546). Transitional data can also be stored in RAM (1546), while permanent data can be stored, for example, in internal mass storage (1547). Fast storage and retrieval to any storage device can be performed by using a cache, which can be closely associated with the following: one or more CPUs (1541), GPUs (1542), mass storage (1547), ROM (1545), RAM (1546), etc.

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

[0237] As an example, but not a limitation, a computer system having an architecture (1500), particularly a kernel (1540), may provide functionality due to one or more processors (including CPUs, GPUs, FPGAs, accelerators, etc.) executing software contained in one or more tangible computer-readable media. Such computer-readable media may be media associated with user-accessible mass storage as described above, as well as memories of certain non-temporary kernels (1540), such as kernel internal mass storage (1547) or ROM (1545). Software implementing various embodiments of the present application embodiments may be stored in such devices and executed by the kernel (1540). Depending on specific needs, the computer-readable medium may include one or more storage devices or chips. The software may enable the kernel (1540), particularly the processors therein (including CPUs, GPUs, FPGAs, etc.), to perform specific processes or specific parts of specific processes described herein, including defining data structures stored in RAM (1546) and modifying such data structures according to processes defined by the software. Additionally or alternatively, a computer system may provide functionality due to logic hardwired or otherwise embodied in a circuit (e.g., accelerator (1544)) that may replace software or operate in conjunction with software to perform a particular process or a particular portion of a particular process described herein. Where appropriate, a reference to a portion of software may include logic and vice versa. Where appropriate, a reference to a portion of a computer-readable medium may include a circuit (e.g., an integrated circuit (IC)) storing software for execution, a circuit embodying logic for execution, or both. Embodiments of the present application include any suitable combination of hardware and software.

[0238] Appendix A: Acronyms

[0239] JEM: Joint Exploration Model

[0240] VVC: Next Generation Video Coding

[0241] BMS: Benchmark Set

[0242] MV: Motion Vector

[0243] HEVC: High Efficiency Video Coding

[0244] SEI: Supplementary Enhancement Information

[0245] VUI: Video Availability Information

[0246] GOP: Group of Pictures

[0247] TU: Transform Unit

[0248] PU: prediction unit

[0249] CTU: Coding Tree Unit

[0250] CTB: Coding Tree Block

[0251] PB: prediction block

[0252] HRD: Hypothetical Reference Decoder

[0253] SNR: Signal to Noise Ratio

[0254] CPU: Central Processing Unit

[0255] GPU: Graphics Processing Unit

[0256] CRT: cathode ray tube

[0257] LCD: Liquid Crystal Display

[0258] OLED: Organic Light Emitting Diode

[0259] CD: compact disc

[0260] DVD: Digital Video Disc

[0261] ROM: Read Only Memory

[0262] RAM: Random Access Memory

[0263] ASIC: Application-Specific Integrated Circuit

[0264] PLD: Programmable Logic Device

[0265] LAN: Local Area Network

[0266] GSM: Global System for Mobile Communications

[0267] LTE: Long Term Evolution

[0268] CANBus: Controller Area Network Bus

[0269] USB: Universal Serial Bus

[0270] PCI: Peripheral Component Interconnect

[0271] FPGA: Field Programmable Gate Array

[0272] SSD: Solid State Drive

[0273] IC: Integrated Circuit

[0274] CU: Coding Unit

[0275] Although the embodiments of the present application have described multiple exemplary embodiments, there are modifications, permutations, and various replacement equivalents that fall within the scope of the embodiments of the present application. Therefore, it should be understood that those skilled in the art will be able to design many systems and methods that, although not explicitly shown or described herein, embody the principles of the embodiments of the present application and therefore fall within the spirit and scope of the embodiments of the present application.

Claims

1. A video encoding method, characterized in that: The method comprises: Setting information of a coding block in a current picture, the information indicating a bidirectional prediction mode; determining, for bidirectional prediction of the coding block, a first motion vector associated with a first reference picture and a second motion vector associated with a second reference picture; Determine a first reference template in the first reference picture based on a current template of the coding block and the first motion vector; determining a second reference template in the second reference picture based on the current template of the coding block and the second motion vector; Calculating a weight of the bidirectional prediction mode based on a difference between the first reference template and the second reference template and the current template; and The coding block is encoded using bidirectional prediction with the calculated weights.

2. The method according to claim 1, characterized in that The weights are not signaled in the bitstream.

3. The method according to claim 1, characterized in that The current template includes one or more reconstructed samples adjacent to the coding block.

4. The method according to claim 3, characterized in that The current template includes at least one of the following: one or more rows of samples located above the coding block; or One or more columns of samples located to the left of the coding block.

5. The method according to claim 3, characterized in that: The current template includes at least one of the following: a row of samples immediately above the coding block; or The column of samples immediately to the left of the coded block.

6. The method according to any one of claims 1 to 5, characterized in that The calculating the weight of the bidirectional prediction mode includes: Based on the difference between the first reference template and the second reference template and the current template, a weight that minimizes a value of a predetermined cost function is determined.

7. The method according to claim 6, characterized in that The predetermined cost function is based on corresponding sample differences between the current template and a predicted current template, and the predicted current template is predicted based on the first reference template and the second reference template using a predetermined bidirectional prediction model with one or more weight parameters.

8. The method according to any one of claims 1 to 5, characterized in that The calculating the weight of the bidirectional prediction mode includes: The weights in the predetermined bidirectional prediction model are determined by ordinary least squares method.

9. The method according to any one of claims 1 to 5, characterized in that The calculating the weight of the bidirectional prediction mode includes: The weights are fixed within a predetermined range.

10. A method for video decoding, characterized in that: The method comprises: Decoding information of a coding block in a current picture from a video bitstream, the information indicating a bidirectional prediction mode; determining, for bidirectional prediction of the coding block, a first motion vector associated with a first reference picture and a second motion vector associated with a second reference picture; Determine a first reference template in the first reference picture based on a current template of the coding block and the first motion vector; determining a second reference template in the second reference picture based on the current template of the coding block and the second motion vector; Calculating a weight of the bidirectional prediction mode based on a difference between the first reference template and the second reference template and the current template; and The coding block is reconstructed using bidirectional prediction with the calculated weights.

11. A device for video encoding, characterized in that: The apparatus comprises a processing circuit and a decoder, wherein the processing circuit is configured to perform the video encoding method according to any one of claims 1 to 9, or to perform the video decoding method according to claim 10.

12. A method for processing a video code stream, characterized in that: The video code stream is generated based on the video encoding method according to any one of claims 1 to 9, or the video code stream is decoded based on the video decoding method according to claim 10.

13. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable medium stores instructions. When the instructions are executed by a processor, the instructions implement the video encoding method according to any one of claims 1 to 9 to generate a video stream, or implement the video decoding method according to claim 10 to decode the video stream.