Method, apparatus, and medium for video processing

The bidirectional context-based approach enhances video coding by leveraging local and non-local correlations and adaptive context weighting, addressing inefficiencies in existing technologies and achieving improved coding quality and reduced bit-rate.

WO2026233433A1PCT designated stage Publication Date: 2026-11-12BEIJING ZITIAO NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/095683
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-13
Filing Date
2026-05-08
Publication Date
2026-11-12

AI Technical Summary

Technical Problem

Existing video coding technologies do not fully exploit bidirectional information and hierarchical structures, overlook non-local correlations, and suffer from error propagation and redundancy in end-to-end video compression, leading to suboptimal coding quality and efficiency.

Method used

Implement a bidirectional context-based approach using learning models to determine and adjust contexts for video frames, incorporating local and non-local correlations, and employing context gating to adaptively weight and suppress noisy signals, while utilizing a feature cache to manage memory efficiently.

Benefits of technology

Improves coding quality and reduces bit-rate by 13.4% and 15.7% compared to existing standards, achieving superior performance across various test datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2026095683_12112026_PF_FP_ABST
    Figure CN2026095683_12112026_PF_FP_ABST
Patent Text Reader

Abstract

Implementations of the present disclosure provide a solution for video processing. A method for video processing is proposed. The method comprises: determining, for a conversion between a current frame of a video and a bitstream of the video with a learning-based model, bidirectional contexts for the current frame;and performing the conversion based on the bidirectional contexts.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD, APPARATUS, AND MEDIUM FOR VIDEO PROCESSINGFIELDS

[0001] Implementations of the present disclosure generally relate to computer technologies, and more particularly, to video coding.BACKGROUND

[0002] In nowadays, digital video capabilities are being applied in various aspects of peoples’ lives. Multiple types of video compression technologies, such as motion picture expert group (MPEG) -2, MPEG-4, international telecommunication union -telecommunication standardization sector (ITU-T) H. 263, ITU-T H. 264 / MPEG-4 Part 10 advanced video coding (AVC) , ITU-T H. 265 high efficiency video coding (HEVC) standard, versatile video coding (VVC) standard, have been proposed for video encoding / decoding. However, coding quality of video coding techniques is generally expected to be further improved.SUMMARY

[0003] Implementations of the present disclosure provide a solution for video processing.

[0004] In a first aspect, a method for video processing is proposed. The method comprises: determining, for a conversion between a current frame of a video and a bitstream of the video with a learning-based model, bidirectional contexts for the current frame; and performing the conversion based on the bidirectional contexts.

[0005] Based on the method in accordance with the first aspect of the present disclosure, bidirectional contexts are determined and used for the conversion. Compared with the conventional solution where unidirectional contexts are adopted for the conversion, the proposed solution can sufficiently utilize bidirectional correlation thus improving the coding quality. In addition, the use of bidirectional contexts may enable more accurate prediction and more effective exploitation of temporal redundancy, thereby reducing the bit-rate.

[0006] In a second aspect, an apparatus for video processing is proposed. The apparatus comprises a processor and a non-transitory memory with instructions thereon. The instructions upon execution by the processor, cause the processor to perform a method in accordance with the first aspect of the present disclosure.

[0007] In a third aspect, a non-transitory computer-readable storage medium is proposed. The non-transitory computer-readable storage medium stores instructions that cause a processor to perform a method in accordance with the first aspect of the present disclosure.

[0008] In a fourth aspect, another non-transitory computer-readable recording medium is proposed. The non-transitory computer-readable recording medium stores a bitstream of a video which is generated by a method performed by an apparatus for video processing. The method comprises: determining bidirectional contexts for a current frame of the video; and generating the bitstream based on the bidirectional contexts with a learning-based model.

[0009] In a fifth aspect, a method for storing a bitstream of a video is proposed. The method comprises: determining bidirectional contexts for a current frame of the video; generating the bitstream based on the bidirectional contexts with a learning-based model; and storing the bitstream in a non-transitory computer-readable recording medium.

[0010] In a sixth aspect, a method of video processing is provided. The method comprises determining, for a conversion between a current frame of a video and a bitstream of the video with a learning-based model, bidirectional contexts for the current frame, adjusting the bidirectional contexts based on adjustment information for the current frame, and performing the conversion based on the adjusted bidirectional contexts.

[0011] Based on the method in accordance with the sixth aspect of the present disclosure, bidirectional contexts are determined and adjusted with adjustment information via a learning-based model. Compared with the conventional solution where bidirectional contexts are used directly without adjustment, the proposed solution can enable more effective exploitation of bidirectional temporal priors. The adjustment of bidirectional contexts may allow the learning-based model to adaptively weight or gate the contexts, thereby suppressing noisy or misleading signals caused by fast motion or occlusion while retaining informative cues. This can lead to improved compression efficiency and enhanced rate-distortion performance in learned video compression, thus further improving the video coding quality.

[0012] In a seventh aspect, an apparatus for video processing is proposed. The apparatus comprises a processor and a non-transitory memory with instructions thereon. The instructions upon execution by the processor, cause the processor to perform a method in accordance with the sixth aspect of the present disclosure.

[0013] In an eighth aspect, a non-transitory computer-readable storage medium is proposed. The non-transitory computer-readable storage medium stores instructions that cause a processor to perform a method in accordance with the sixth aspect of the present disclosure.

[0014] In a ninth aspect, another non-transitory computer-readable recording medium is proposed. The non-transitory computer-readable recording medium stores a bitstream of a video which is generated by a method performed by an apparatus for video processing. The method comprises: determining bidirectional contexts for a current frame of the video; adjusting the bidirectional contexts based on adjustment information for the current frame; and generating the bitstream based on the adjusted bidirectional contexts with a learning-based model.

[0015] In a tenth aspect, a method for storing a bitstream of a video is proposed. The method comprises: determining bidirectional contexts for a current frame of the video; adjusting the bidirectional contexts based on adjustment information for the current frame; generating the bitstream based on the adjusted bidirectional contexts with a learning-based model; and storing the bitstream in a non-transitory computer-readable recording medium.

[0016] In an eleventh aspect, there is provided a computer program for performing a method in accordance with the first aspect or the sixth aspect of the present disclosure when the computer program runs on a computer.

[0017] In a twelfth aspect, there is provided a computer program product tangibly stored in a computer storage medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform a method in accordance with the first aspect or the sixth aspect of the present disclosure.

[0018] This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Through the following detailed description with reference to the accompanying drawings, the above and other objectives, features, and advantages of example implementations of the present disclosure will become more apparent. In the example implementations of the present disclosure, the same reference numerals usually refer to the same components.

[0020] FIG. 1 illustrates a block diagram of an example video coding system in accordance with some implementations of the present disclosure;

[0021] FIG. 2 illustrates an illustration of contextual encoder and decoder;

[0022] FIG. 3 illustrates a proposed Multiple Frame Non-Local Context Mining (MNLC) for conditional coding of the

[0023] FIG. 4 illustrates a proposed Partial Cascaded Finetuning Strategy (PCFS) ;

[0024] FIG. 5 illustrates an overall framework of BiECVC;

[0025] FIG. 6 illustrates a coding structure when intra period is 8;

[0026] FIG. 7 illustrates an illustrations of the proposed Bidirectional Local Context Diversification (BLCD) and Bidirectional Non-Local Context Diversification (BNLCD) and Bidirectional Context Gating (BCG) ;

[0027] FIG. 8 illustrates a visualization of local context (with motion trajectory) and non-local context (no motion trajectory) ;

[0028] FIG. 9 illustrates a visualization of predicted errors in optical flow-based warping;

[0029] FIG. 10 illustrates Rate-Distortion curves on HEVC B, HEVC E, and UVG dataset;

[0030] FIG. 11 illustrates rate allocations on "BQTerrace" from HEVC B;

[0031] FIG. 12 illustrates a visualization of attention maps with a query selected from flower regions;

[0032] FIG. 13 illustrates a visual quality comparison on reconstruction frames and ground truth;

[0033] FIG. 14 illustrates architectures of DWConv Block and DepthConv Block;

[0034] FIGS. 15A-15C illustrate rate-PSNR performances under intra period 32 with 96 frames;

[0035] FIGS. 16A-16C illustrate rate-PSNR performances under intra period 32 with 97 frames;

[0036] FIGS. 17A-17C illustrate rate-PSNR performances under intra period 64 with 64 frames;

[0037] FIGS. 18A-18C illustrate rate-PSNR performances under intra period 64 with 65 frames;

[0038] FIGS. 19A-19C illustrate rate-PSNR performances under intra period 64 with 192 frames;

[0039] FIGS. 20A-20C illustrate rate-PSNR performances under intra period 64 with 193 frames;

[0040] FIGS. 21A-21C illustrate rate-MS-SSIM performances under intra period 32 with 96 frames;

[0041] FIG. 22 illustrates a flowchart of a method for video processing in accordance with some implementations of the present disclosure;

[0042] FIG. 23 illustrates a flowchart of a method for video processing in accordance with some further implementations of the present disclosure; and

[0043] FIG. 24 illustrates a block diagram of a computing device in which various implementations of the present disclosure can be implemented.

[0044] Throughout the drawings, the same or similar reference numerals usually refer to the same or similar elements.DETAILED DESCRIPTION

[0045] Principle of the present disclosure will now be described with reference to some implementations. It is to be understood that these implementations are described only for the purpose of illustration and help those skilled in the art to understand and implement the present disclosure, without suggesting any limitation as to the scope of the disclosure. The disclosure described herein can be implemented in various manners other than the ones described below.

[0046] In the following description and claims, unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skills in the art to which this disclosure belongs.

[0047] References in the present disclosure to “one implementation, ” “an implementation, ” “an example implementation, ” and the like indicate that the implementation described may include a particular feature, structure, or characteristic, but it is not necessary that every implementation includes the particular feature, structure, or characteristic. Moreover, such phrases are not necessarily referring to the same implementation. Further, when a particular feature, structure, or characteristic is described in connection with an example implementation, it is submitted that it is within the knowledge of one skilled in the art to affect such feature, structure, or characteristic in connection with other implementations whether or not explicitly described.

[0048] It shall be understood that although the terms “first” and “second” etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element could be termed a second element, and similarly, a second element could be termed a first element, without departing from the scope of example implementations. As used herein, the term “and / or” includes any and all combinations of one or more of the listed terms.

[0049] The terminology used herein is for the purpose of describing particular implementations only and is not intended to be limiting of example implementations. As used herein, the singular forms “a” , “an” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms “comprises” , “comprising” , “has” , “having” , “includes” and / or “including” , when used herein, specify the presence of stated features, elements, and / or components etc., but do not preclude the presence or addition of one or more other features, elements, components and / or combinations thereof. Example Environment

[0050] FIG. 1 is a block diagram that illustrates an example video coding system 100 that may utilize the techniques of this disclosure. As shown, the video coding system 100 may include a source device 110 and a destination device 120. The source device 110 can be also referred to as a video encoding device, and the destination device 120 can be also referred to as a video decoding device. In operation, the source device 110 can be configured to generate encoded video data and the destination device 120 can be configured to decode the encoded video data generated by the source device 110. The source device 110 may include a video source 112, a video encoder 114, and an input / output (I / O) interface 116.

[0051] The video source 112 may include a source such as a video capture device. Examples of the video capture device include, but are not limited to, an interface to receive video data from a video content provider, a computer graphics system for generating video data, and / or a combination thereof.

[0052] The video data may comprise one or more pictures. The video encoder 114 encodes the video data from the video source 112 to generate a bitstream. The bitstream may include a sequence of bits that form a coded representation of the video data. The bitstream may include coded pictures and associated data. The coded picture is a coded representation of a picture. The associated data may include sequence parameter sets, picture parameter sets, and other syntax structures. The I / O interface 116 may include a modulator / demodulator and / or a transmitter. The encoded video data may be transmitted directly to destination device 120 via the I / O interface 116 through the network 130A. The encoded video data may also be stored onto a storage medium / server 130B for access by destination device 120.

[0053] The destination device 120 may include an I / O interface 126, a video decoder 124, and a display device 122. The I / O interface 126 may include a receiver and / or a modem. The I / O interface 126 may acquire encoded video data from the source device 110 or the storage medium / server 130B. The video decoder 124 may decode the encoded video data. The display device 122 may display the decoded video data to a user. The display device 122 may be integrated with the destination device 120, or may be external to the destination device 120 which is configured to interface with an external display device.

[0054] The video encoder 114 and the video decoder 124 may operate according to a video compression standard, such as the High Efficiency Video Coding (HEVC) standard, Versatile Video Coding (VVC) standard and other current and / or further standards. 1. Brief Summary This detailed solution is related to learning-based end-to-end optimized video coding technologies. Specifically, it is related to flow-based motion estimation and motion compensation. It may be applied to the existing learning-based video coding models like DCVC (Li, Jiahao, Bin Li, and Yan Lu. "Deep contextual video compression. " Advances in Neural Information Processing Systems 34 (2021) : 18114-18125) , DCVC-TCM (Sheng, Xihua, et al. "Temporal context mining for learned video compression. " IEEE Transactions on Multimedia (2022) ) , ECVC (Wei Jiang, Junru Li, Kai Zhang, Li Zhang. “ECVC: Exploiting Non-Local Correlations in Multiple Frames for Contextual Video Compression” IEEE CVPR 2025) . It may also be applicable to future video coding standards or video codec powered by AI. 2. Introduction Due to the rise and emergence of social media and video applications, it is vital to restore them efficiently, which makes image and video compression become an active area. In recent years, learned video compression attracts lots of attention, most of the learned video compression models are based on predictive coding paradigm. They use an optical flow net (Ranjan, Anurag, and Michael J. Black. "Optical flow estimation using a spatial pyramid network. " Proceedings of the IEEE conference on computer vision and pattern recognition. 2017) or Deforma-ble Convolutional Network (DCN) (Dai, Jifeng, et al. "Deformable convolutional networks. " Proceedings of the IEEE international conference on computer vision. 2017) to predict the motion information between the decoded frame and current frame, use a motion codec to compress the motion information, and use a residual codec or a contextual codec to compress the residuals or contexts. These models are optimized in an end-to-end manner, which makes it flexible to meet a variety of demands, such as perceptual quality. 2.1. Deep Contextual Video Compression The learning-based video compression model consists of an independent intra codec, a contextual or encoder EC, a contextual decoder DC, a motion encoder, a motion decoder, and an optical flow net. The intra codec is used to compress the key frame (I frame) in each GOP (group of images) . When compress the P frames xt, optical flow net (Ranjan, Anurag, and Michael J. Black. "Optical flow estimation using a spatial pyramid network. " Proceedings of the IEEE conference on computer vision and pattern recognition. 2017) is used to estimate the flow between previous decoded frame and current P frame xt. Flow map is employed as the motion vector. At encoder, a motion codec is used to compress the flow map and the reconstructed flow map is employed for consistency between encoding and decoding. The decoded frame is warped to context based on the decoded optical flow When compressing P frame xt, xt is concatenated with context and the result is fed to the contextual codec. The concatenation between xt and is to let the network learn conditional coding. At decoder, the key frame or I frame is first decoded using the independent intra codec decoder. The optical flow is decoded using the motion codec decoder. The decoded frame is warped to context based on the de-coded optical flow. The inter codec is used to decompress the learned conditional coding information and it is concatenated with the context to obtain the reconstructed frame The overall process is as follows: 2.2. Multi-Scale Deep Contextual Video Compression The compression of frame xt is taken as an example. Multi-scale features are first extracted from propagated feature The propagated feature is the feature extracted from previous frames. Motion vector is adopted to warp the multi-scale features to multi-scale local contexts The is concatenated to the current frame xt,  is concatenated the to the mid-feature and the is concatenated to mid-feature The concatenation lets the network learn how to conduct conditional coding by itself. When decoding, multi-scale contexts are also concatenated to recover the frame. The overall process can be formulated as: where EC and ED are the contextual encoder and the contextual decoder. 2.3. ECVC The proposed ECVC builds upon the DCVC-DC, but focuses more on exploiting non-local correlations in multiple frames. The architecture of ECVC is presented in FIG. 2 and FIG. 3. The method processes the t-th frame xt by firstly converting the propagated features into multi-scale features 0≤i≤2, targeting at the coding of mid-feature where H, W are the height and width.  denote channel numbers. A key innovation is the Multiple Frame Non-Local Context Mining, which leverages multiple reference frames to extract local and non-local contexts. For local contexts and ECVC use motion vectors and to capture local contexts from the multi-scale features and via the offset diversity and proposed multi-scale refinement module, yielding priors from two refer-ence frames. For non-local contexts, the Multi-Head Linear Cross Attention is proposed to capture non-local contexts and among Those local and non-local contexts are then used for condi-tional coding of The decoding process mirrors the encoding process but uses as input instead of Be-sides, a Partial Cascaded Finetuning Strategy (PCFS) is proposed to further mitigate error accumulation, as depicted in FIG. 4. FIG. 2 illustrates an illustration of contextual encoder and decoder. x,  are input frame and reconstructed frame.  is the propagated feature for coding xt+1.  are motion vectors.  are mid-features during encoding and decoding. “Res Block” and “Recon Generation” are adopted from DCVC-DC. “Q" is quantization. “AE" denotes arithmetic encoding and “AD" denotes arithmetic decoding. μt and σt are estimated means and scales of by the entropy model for AE / AD. FIG. 3 illustrates a proposed Multiple Frame Non-Local Context Mining (MNLC) for conditional coding of the FIG. 4 illustrates a proposed Partial Cascaded Finetuning Strategy (PCFS) . The I frame model is frozen during finetuning. 2.3.1. Local Correlations In ECVC, two reference frames are employed. The process of conditionally coding is employed as an example and depicted in FIG. 3. Specifically, the offset diversity is adopted and extended for two reference frames.  is first warped by decoded motion vector to and then refined by offset diversity to The process is: To capture additional local contexts from the previous local context is reused to avoid additional motion bits.  is firstly warped by and then refined to local context by a multi-scale refine-ment module which can be formulated as: 2.3.2. Non-Local / Global Correlations To capture non-local correlations, it is necessary to compare all elements, which implies the receptive field should be large enough. The offset diversity is not sufficient due to its limited kernel sizes of convolutions. The necessity of large receptive fields inspires us to employ attention mechanisms. Thanks to the flexible conditional coding paradigm, the network itself is able to learn the non-local correlations by cross attention between the current feature and given temporal contexts. For simplicity, we omit the Depth-wise Res Block in FIG. 3. The non-local contexts from for can be captured by, where d is the output channel number of embedding.  are the embedding layer for queries, keys, and values. 3. Problems The current learning-based video coding scheme mainly focus on the low-delay scenes and has the following problems: 1. The current design of end-to-end video compression does not fully exploit bidirectional information or the hierarchical structure across multiple layers. 2. Non-local correlations are overlooked in the bidirectional prediction process of end-to-end video compression. 3. Propagated features from previous frames may contain errors that negatively impact the prediction of the current frame-an issue that remains unaddressed in existing end-to-end video compression designs. 4. Increasing the number of reference frames imposes a significant storage burden, and the current de-sign of end-to-end video compression exhibits substantial redundancy in internal features. 4. Detailed solution The detailed solutions below should be considered as examples to explain general concepts. These detailed so-lutions should not be interpreted in a narrow way. Furthermore, these detailed solutions can be combined in any manner. It is noted that the sequence where t is the time step, N is the number of frames, H and W are the height and width of a frame respectively. During encoding and decoding, the sequence is divided into multiple group of pictures (GOP) and the reconstructions are denoted as Within each GOP, Intra (I) frames are encoded independently, while Bidirectional (B) frames are compressed using contexts from both backward and forward references. let it represent the temporal interval between the current frame xt and its two reference frames and During encoding, xt is first transformed to multi-scale latents where the  is the scale index and  is the channel number for latent with scale index  The corre-sponding latents in the decoder side are Propagated features / references from lower layers and their downsampled and are em-ployed as references, where and is the channel number for propagated features / references with scale index 1. It is proposed to use bidirectional contexts in learning-based video compression. a. In one example, the forward contexts may be used. b. In one example, forward local contexts may be used to enhance motion compensation. i. In one example, the forward propagated features / references and reconstructed mo-tion vectors may be warped into the forward context. ii. In one example, a single-scale forward local context is constructed via flow-based warping. An optical flow network is used to estimate the motion vector from forward reference frame This motion vector is compressed and decompressed using a motion codec, resulting in a reconstructed motion vector The single-scale forward context at scale is then obtained as:  where and denotes the warping operation. iii. In one example, multi-scale forward local contexts are constructed by applying the same warping operation to multi-scale reference features and the decoded motion vector. The result is:  c. In one example, the backward contexts may be used. d. In one example, backward local contexts may be used to enhance motion compensation. i. In one example, the backward propagated features / references and reconstructed motion vectors may be warped into the backward context. ii. In one example, a single-scale backward local context is constructed via flow-based warping. An optical flow network is used to estimate the motion vector  from backward reference frame This motion vector is compressed and decompressed using a motion codec, resulting in a reconstructed motion vec-tor The single-scale backward context at scale is then obtained as:  where and denotes the warping operation. iii. In one example, multi-scale backward local contexts are constructed by applying the same warping operation to multi-scale reference features and the decoded mo-tion vector. The result is:  e. In one example, the forward and backward contexts may be both used. f. In one example, forward local contexts from lower layers may be utilized to enhance motion com-pensation. i. In one example, the non-adjacent forward local features / references (which are the adjacent references of the frames which are treated as forward local references for current frame) may be also used as the forward local references for current frame, and also be utilized to generate additional forward local contexts for current frame. 1. In one example, the additional forward local contexts may be generated via the local non-adjacent forward features and a motion vector. 2. In one example, the motion vector may be predicted / inferred via the multi-ple motion vectors. 3. In one example, the motion vector may be estimated via the optical flow network. ii. In one example, the reference feature of the frame is used to con-struct a single-scale forward local context. An optical flow network predicts the motion vector between the current frame xt and This vector is compressed and decompressed by a motion codec, yielding the recon-structed motion vector The single-scale forward context is obtained via flow warping:  where and denotes the warping operation. iii. In one example, multi-scale forward local contexts are con-structed by applying flow warping to the multi-scale reference features and the same reconstructed motion vector:  iv. In one example, the same single-scale context is constructed without introducing additional motion bits. In this case, the motion vector is inferred by ac-cumulating decoded motion vectors:  The forward context is then obtained as:  Similarly, in the multi-scale case, the inferred mo-tion vector is used to generate multi-scale forward local contexts:  g. In one example, backward local contexts from lower layers may be utilized to enhance motion com-pensation. i. In one example, the non-adjacent backward local features / references (which are the adjacent references of the frames which are treated as backward local references for current frame) may be also used as the backward local references for current frame, and also be utilized to generate additional backward local contexts for current frame. 1. In one example, the additional backward local contexts may be generated via the local non-adjacent backward features and a motion vector. 2. In one example, the motion vector may be predicted / inferred via the multi-ple motion vectors. 3. In one example, the motion vector may be estimated via the optical flow network. ii. In one example, the reference feature of the frame is used to con-struct a single-scale forward local context. An optical flow network predicts the motion vector between the current frame xt and This vector is compressed and decompressed by a motion codec, yielding the recon-structed motion vector The single-scale forward context is obtained via flow warping:  where and denotes the warping operation. iii. In one example, multi-scale forward local contexts are con-structed by applying flow warping to the multi-scale reference features and the same reconstructed motion vector:  iv. In one example, the same single-scale context is constructed without introducing additional motion bits. In this case, the motion vector is inferred by accumulating decoded motion vectors:  The forward context is then ob-tained as:  Similarly, in the multi-scale case, the inferred motion vector is used to generate multi-scale forward local contexts:  h. In one example, the forward and backward contexts may be both used. i. In one example, both forward and backward local contexts may be utilized. ii. In one example, single-scale local contexts are used, including the forward context and the backward context where denotes the context scale. iii. In one example, single-scale forward and backward local contexts are used along with additional lower-layer contexts such as and where iv. In one example, multi-scale local contexts are employed, including forward contexts and backward local contexts v. In another example, the multi-scale forward and backward local contexts and are used together with lower-layer contexts vi. In example, only a subset of the aforementioned contexts may be used, such as se-lected multi-scale forward or backward contexts and / or selected lower-layer con-texts. i. In one example, the type of contexts which are used may be dependent on the current frame types. i. In one example, if only the forward references are available, the forward contexts are used. ii. In one example, if only the backward references are available, the forward contexts are used. iii. In one example, if the forward and backward references are available, the forward and backward contexts are used. j. In one example, multiple contexts may be used together. 2. It is proposed to generate global contexts via the temporal features from bidirectional references. a. In one example, global context generation may utilize the forward / backward features. i. In one example, the forward contexts and backward contexts are utilized to generate the cor-responding global contexts, separately. ii. In one example, features with index i in the multi-scale features are utilized in the global con-texts. 1. In one example, the index may be equal to 0, 1, 2. 2. In one example, only the lower layer features with indices 1 and 2 are used in global contexts. 3. In one example, only the lower layer features with index 2 are used in global contexts. b. In one example, the attention method may be used to generate the global contexts. 1. In one example, linear attention may be used to generate the global contexts. 2. In one example, vanilla attention may be used to generate the global contexts. c. In one example, global context generation may utilize the forward / backward features at the encoder side. i. In one example, the forward and backward references from previous layer are utilized to gen-erate the corresponding global contexts for encoder. 1. In one example, the linear attention is employed to capture global forward and backward contexts. The linear attention is conducted between latent and propagated features. Current is embedded to a query The available features and are embedded into keys  and values The pro-cess is where  denotes the scale and This formulation applies two independent softmax (SM) operations on row and column-allowing the key-value product to be computed first, reducing complexity to linear order. ii. In one example, the forward and backward references from lower layers are utilized to gen-erate the corresponding global contexts for encoder. 1. In one example, the linear attention is employed to capture global forward and backward contexts. The linear attention is conducted between latent and propagated features. Current is embedded to a query The available features and are embed-ded into keys and values The process is where denotes the scale and iii. In one example, the forward and backward references from previous layer are utilized to gen-erate the corresponding global contexts for decoder. 1. In one example, the linear attention is employed to capture global forward and backward contexts. The linear attention is conducted between latent and propagated features. Current latent at decoder side is embedded to a query The available features and are embed-ded into keys and values The process is where denotes the scale and This formulation applies two in-dependent softmax (SM) operations on row and column-allowing the key-value product to be computed first, reducing complexity to linear order. iv. In one example, the forward and backward references from lower layers are utilized to gen-erate the corresponding global contexts for decoder. 1. In one example, the linear attention is employed to capture global forward and backward contexts. The linear attention is conducted between latent and propagated features. Current latent at deocder side is embedded to a query The available features and are embedded into keys and values The process is where denotes the scale and d. In one example, features with index in the multi-scale features are utilized in the global contexts. i. In one example, this global context modeling is applied at multiple scales ii. In one example, only partial lower layers (e.g.,  or ) are used for global context construction to reduce computational complexity. 3. It is proposed to fuse or concatenate multiple contexts including local and global (non-local) contexts in the bidirectional conditional coding. a. In one example, the global context may be used as part of conditional coding. b. In one example, the local context may be used as part of conditional coding. c. In one example, the local and global contexts may be fused firstly then fed into the conditional coding. i. In one example, the local and global contexts may be fused with a convolutional layer. 4. It is proposed to gate the contexts with gating / weighting matrixes / factors / features. a. In one example, the contexts may be fused into one hybrid context via a network before gating process. i. In one example, a dimension reduction (DR) network may be used. The process is DR where and global contexts denoting the available contexts. ii. In one example, the dimension reduction can be implemented using a convolutional network. b. In one example, the hybrid context may be gated via a gating / weighting matrixes / factors / features into the final context. c. In one example, the (hybrid) context may be gated via a gating / weighting matrixes / factors / features into the final context for latents at the encoder side. The gating matrix is computed based on latent and contexts. i. In one example, a residual block and a sigmiod function may be used to generate gating matrix for via The gating matrix is employed to filter the (hybrid ) context via element-wise multiplica-tion The final context is used as prior for conditional cod-ing ii. In one example, a residual block and a ReLU function may be used to generate gating matrix for via The gating ma-trix is employed to filter the (hybrid ) context via element-wise multiplication The final context is used as prior for conditional coding d. In one example, the (hybrid) context may be gated via a gating / weighting matrixes / factors / features into the final context for latents at the decoder side. The gating matrix is computed based on decoded latent and contexts. i. In one example, a residual block and a sigmiod function may be used to generate gating matrix for via The gating matrix is employed to filter the (hybrid ) context via element-wise multiplication The final context is employed as the prior for condi-tional decoding ii. In one example, a residual block and a ReLU function may be used to generate gating matrix for via The gating ma-trix is employed to filter the (hybrid ) context via element-wise multiplication The final context is employed as the prior for conditional de-coding 5. It is proposed that only the final context generated in gating process may be used to fuse the current frame in the conditional coding of current frame. a. In one example, the current frame may refer to the latent reconstruction in the decoding process or original frame in the encoding process in pixel domain or feature domain or multi-feature domain. 6. It is proposed that only the 0-scale final context generated in gating process may be used to generate propagated features  / reconstructed frame. a. In one example, a feature generation network (FG) may be employed to generate the propagated feature for subsequent frames to be coded / decoded. The feature generation network may be im-plemented with a convolutional network. A convolutional weight (W) may be used to generate the reconstructed frame The process is formulated as:  7. It is proposed to use conditional coding to generate gating / weighting matrixes / factors / features. a. In one example, the current frame / mid-feature and contexts including local and global (non-local) contexts may be fed into a conditional coding network to generate the gating matrix. b. In one example, a Sigmoid function may be used following the conditional coding network in the gating matrix generation process. 8. It is proposed to create a feature cache to store the reference features. Features that will be referenced later are stored in the cache, while those no longer needed are removed to control memory usage. a. In one example, the features of current frame or propagated features or other features in generating the local contexts may be stored in the feature cache. i. In one example, the features may refer to multiple features / references in pixel domain or feature domain or multi-feature domain. b. In one example, the keys and values in gener-ating global (non-local) contexts may be stored in the feature cache. 5. Implementation 5.1. Implementation 1 5.1.1. Introduction Video compression aims to represent visual signals using fewer bits while maintaining high reconstruction quality. Traditional video coding methods, such as VVC , have been developed over decades and have achieved impressive performance. However, their progress is fundamentally constrained by the hand-crafted design of coding tools, leading to a performance plateau. In contrast, learned video compression (LVC) is op-timized in a fully end-to-end manner, offering greater flexibility and the potential for superior performance. As a result, it has garnered increasing attention in recent years. Current LVCs follow the conditional coding paradigm , where temporal contexts are used as priors for a re-duction in conditional entropy. As used herein, the term context refers to predictions used for computing resid-uals or conducting conditional coding, which differs from the contexts used in entropy models. Existing ap-proaches primarily focus on forward prediction, in which each frame (P-frame) can only reference frames from earlier time steps. Although this strategy has led to impressive progress, with recent methods even surpassing VVC reference software VTM under the Low Delay B (LDB) configuration, bidirectional prediction, where a frame (B-frame) can reference both past and future frames, remains relatively underexplored. In theory, bidi-rectional prediction offers richer contextual information and holds greater potential for compression efficiency. However, current bidirectional video compression (BVC) methods still underperform compared to their for-ward-only counterparts . Such performance gap is largely due to the limited ability of existing methods to fully exploit bidirectional temporal priors, as well as their insufficient adaptability in handling complex motion and occlusions. To better understand the limitations of existing BVCs , we analyze the factors contributing to the superior per-formance of traditional codecs such as VVC under bidirectional prediction. First, VVC supports the selection of up to 4~6 reference frames , offering significantly more diverse temporal information compared to current BVCs. Most existing BVCs utilize only a single forward and a single backward frame as references, which may fall short in modeling complex motion dynamics or handling occluded regions. Second, in VVC, motion estimation is based on minimizing Sum of Absolute Differences (SAD) , which captures block-level similarity. However, small SAD values do not necessarily imply real motion; they may simply indicate pixel fidelity. Thus, VVC can benefit from flexible content matching, even across frames with weak temporal relevance, a capability largely absent in current optical flow-based BVCs. Finally, VVC assigns adaptive weights to multi-ple reference frames through rate-distortion (RD) optimization, enabling flexible utilization of contextual in-formation. In contrast, existing learned BVC approaches typically lack mechanisms for context-wise weighting, making it difficult to selectively enhance informative cues while suppressing noisy or misleading signals. To address above issues, we propose bidirectional context diversification for enhanced exploitation of tem-poral priors, and bidirectional context gating to adaptively weight contexts based on conditional coding results. We categorize bidirectional contexts into local and non-local types . Local contexts capture correlations with explicit motion, while non-local contexts correspond to similar regions without clear motion trajectories as il-lustrated in FIG. 8. To diversify local contexts, we incorporate additional reference frames from lower hierarchical layers. In BVCs, such lower-layer frames are generally assigned higher bit-rates and therefore offer better reconstruction quality, making them valuable sources for reliable motion-aligned context. To align these frames with the cur-rent target frame without incurring additional motion coding overhead, we reuse the decoded motion vectors already estimated for primary reference frames. To diversify non-local contexts, we adopt a linear attention mechanism to capture non-local correlations across frames. Linear attention compares each element in the current frame with all elements in reference frames, based on learned attention-driven similarity. We note that the process of aggregating contexts using attention scores fundamentally aligns with the principle of block matching in VVC, which selects reference candidates by minimizing the SAD. However, unlike hand-crafted SAD, our approach enables flexible similar-ity optimization in an end-to-end manner. In bidirectional context gating, we draw inspiration from data-dependent decay in linear-time autoregressive language modeling . To compute the gating matrix, we first concatenate the latent features with the corre-sponding contexts, and apply a nonlinear transform. The resulting gating matrix is used to modulate the magni-tude of each context feature. Interestingly, this nonlinear transform of the latent feature and contexts can be interpreted as an attempt of conditional coding-performed without weighting-to assess their relevance. The output of this initial interaction serves as guidance for the actual weighted conditional coding. Based on proposed techniques, we propose a bidirectional video compression model with Gated Diversifica-tion of Bidirectional Contexts, termed BiECVC. To accelerate BiECVC, to our knowledge, we introduce the first feature cache mechanism for BVCs to efficiently reuse pre-computed features. Experiments demonstrate that BiECVC achieves performance, reducing bit-rate by 13.4%and 15.7%compared to the VTM 13.2 RA with intra periods of 32 and 64. To the best of our knowledge, BiECVC is the first learned video codec to out-perform VTM 13.2 RA across all standard test datasets. Our contributions are summarized as follows: ·To diversify local contexts, BiECVC exploits high-quality features from lower layers and aligns them using decoded motion vectors, without additional motion overhead. ·To diversify non-local contexts, linear attention mechanism is employed to capture correlations across frames with unclear motion trajectories based on learned attention-driven similarity. ·To enhance context weighting, we introduce a bidirectional context gating mechanism that dynami-cally emphasizes beneficial information while suppressing harmful noise, drawing inspiration from recent advancements in linear-time autoregressive language modeling. ·Experiments demonstrate that our BiECVC achieves performance, reducing bit-rate by 13.4%and 15.7%over VTM 13.2 RA with intra periods of 32 and 64. To our knowledge, BiECVC is the first learned video codec to surpass VTM 13.2 RA across all standard test datasets. 5.1.2. Related Works Learned Video Compression with Forward Prediction Most existing learned video compression models focus on forward prediction. DVC is one of the pioneering frameworks in this domain, following the residual coding paradigm. It employs an optical flow network for motion estimation, compressing both motion and residuals between the original and predicted frames using neural networks. To enhance performance, the DVC framework has been further refined with various tech-niques, including resolution-adaptive coding , scale-space flow warping , selective compression , and coarse-to-fine prediction . Despite advancements in residual coding-based methods, they fail to fully exploit temporal priors, as their per-formance is fundamentally constrained by the entropy of the residuals . To address this issue, Li et al. propose the conditional coding paradigm, where the neural network learns the correlations between the current frame and temporal priors automatically, rather than relying on predefined residuals, leading to improved compres-sion efficiency. This paradigm is further refined with temporal context mining for better temporal dependency exploitation. Regarding entropy modeling, Li et al. propose hybrid spatial-temporal coding and quadtree-based entropy models to minimize the bit-rate of latent representations. Additionally, hierarchical quality and offset diversity are leveraged to enhance temporal adaptability. To mitigate accumulated errors in long coding chains, Li et al. introduce temporal-propagated context refreshment, significantly improving long-term perfor-mance. Recently, Jiang et al. propose ECVC, which captures long-range dependencies across multiple frames. With an improved training strategy, ECVC achieves performance in low-delay configurations. FIG. 5 illustrates an overall framework of BiECVC. The quantization parameter (qp) controls variable-rate compression. Local contexts are shared between the encoder and decoder. The non-local contexts,  and are extracted separately at the encoder and decoder. The final contexts,  and are used at the contextual encoder and decoder, respectively. AE and AD are arithmetic encoding and decoding, respectively. FIG. 6 illustrates a Coding Structure when Intra Period is 8. "Yellow" denotes I-frames, "Blue" denotes B-frames. When coding 3-th frame, {0, 2, 4, 8} -th frames serve as references. Learned Video Compression with Bidirectional Prediction Compared to forward prediction, bidirectional prediction is more challenging and has been relatively unex-plored in learned video compression. Wu et al. propose the first motion-free video compression framework, which relies on frame interpolation. The residual between the interpolated and original frames is compressed using a neural network. This approach is further refined by Xu et al. by advanced interpolation techniques. Djelouah et al. introduce residual coding in the latent space while Alexandre et al. propose a two-layer condi-tional augmented normalizing flow to improve expressiveness. In contrast, most BVCs retain motion estimation and motion compensation modules. Yang et al. employ an optical flow network for bidirectional motion estimation, where both the predicted frame (obtained via flow warping) and the motion itself are compressed. Pourreza et al. introduce an interpolation-based approach, gen-erating a predicted frame by interpolating two warped reference frames before performing residual coding. Yang et al. develop UCVC, a conditional coding-based method capable of compressing both P-frames and B-frames within a single model. Sheng et al. propose DCVC-B , a bidirectional video compression model that extends temporal propagation and multi-scale contexts from forward prediction to bidirectional prediction. Despite advancements in bidirectional video compression, existing models still lag behind their forward-only counterparts. This performance gap stems from challenges such as limited contextual information and errors of predicted contexts. Current methods typically use flow maps for motion compensation and conditional coding, which overlooks non-local correlations without explicit movements, leading to limited context diversity. Moreover, predicted errors in contexts caused by large motions and non-overlapped regions introduce extra noise, reducing coding efficiency. FIG. 7 illustrates an illustrations of the proposed Bidirectional Local Context Diversification (BLCD) and Bi-directional Non-Local Context Diversification (BNLCD) and Bidirectional Context Gating (BCG) . The pro-cess is conditional coding at the encoder side. The decoding process mirrors the encoding process. 5.1.3. Method 5.1.3.1 Overview The overall architecture of our proposed BiECVC is presented in FIG. 5 and FIG. 7. Our BiECVC is based on ECVC and the offset diversity module is removed for lower complexity. In Section 5.1.3.2, 5.1.3.3 and 5.1.3.4, we mainly take the encoder side as example. The process of the decoder side mirrors that of the en-coder side. 5.1.4.2 Background Given sequence where t is the time step, N is the number of frames, H and W are the height and width of a frame respectively, bidirectional video compression aims to efficiently encode the se-quence by dividing it into multiple group of pictures (GOP) and make the reconstructions with high quality. Within each GOP, Intra (I) frames are encoded independently, while Bidirectional (B) frames are com-pressed using contexts from both backward and forward references. In the bidirectional coding structure, frames within an GOP are organized into multiple hierarchical layers. For example, when the IP is 8, the frames are divided into 4 layers as illustrated in FIG. 6. Lower layers are as-signed more bits and higher quality because they are referenced by multiple frames at higher layers. BiECVC employs the feature propagation mechanism in DCVC series and ECVC . Specifically, let it repre-sent the temporal interval between the current frame xt and its two reference frames and During encoding, xt is first transformed to multi-scale Propagated features from lower layers and their downsampled and are warped by motion vectors and to serve as the multi-scale temporal priors for conditional coding corresponding FIG. 8 illustrates a visualization of local context (with motion trajectory) and non-local context (no motion tra-jectory) . 5.1.3.2.1 Motion Estimation and Compression To leverage temporal priors, we employ SPyNet to estimate the motion vectors which represent the motion from time step t-it to t and from t+it to t, respectively. To efficiently com-press the motion vectors,  and are concatenated along the channel dimension and fed into a mo-tion encoder. On the decoder side, the reconstructed tensor with four channels is split along the channel dimen-sion to obtain the reconstructed motion vectors 5.1.3.2.4 Bidirectional Contextual Compression In BiECVC, we propose the Bidirectional Local Context Diversification (BLCD) and Bidirectional Non-Local Context Diversification (BNLCD) to diversify the temporal contexts. Local contexts are defined as regions exhibiting explicit motion, whereas non-local contexts refer to similar regions that do not display explicit movement as illustrated in FIG. 8. For diverse local contexts, BLCD incorporates additional local contexts from time steps and in addition to local contexts at t-it and t+it for better quality of lower layers. For example, in FIG. 6, when t=3, contexts from t= {0, 8} are employed in addition to contexts from t= {2, 4} . For effective non-local context modeling, BNLCD employs linear attention mecha-nisms to capture non-local contexts at time steps t-it, t+it,  and with linear complexity. Considering the non-overlapped regions between temporal contexts and the current feature due to fast motions, and accumulated errors during feature propagation, inspired by the data-dependent decay mecha-nism in recent linear attentions for autoregressive language modeling , we propose a Conditional Coding-Aware Bidirectional Context Gating (BCG) mechanism to adaptively adjust context weights via gating. In BCG, we first attempt conditional coding using the available contexts. The results guide the genera-tion of a weighting mask M, which selectively adjusts the influence of different contexts to suppress harmful errors and non-overlapped contexts. In implementation, we introduce feature cache mechanism to reuse pre-computed features for acceleration. 5.1.3.3 Bidirectional Local Context Diversification In existing bidirectional video compression models , the conditional coding of relies on motion compensa-tion from two reference frames at time steps t-it and t+it: where represents warping with optical flow. However, in a hierarchical bidirectional coding structure, lower-layer reference frames / features generally have higher quality and lower reconstruction errors, which can improve compression efficiency. Additionally, vid-eos often contain complex motion patterns, such as fast movements , affine transformations , and occlusions , using only two reference frames may not be sufficient to handle these challenging scenarios. To address these issues, we propose the Bidirectional Local Context Diversification (BLCD) , as illustrated in FIG. 7. In BLCD, we leverage priors from time steps and as the corresponding features and are available in most cases during the coding of For example, in FIG. 6, when t=3, features from t= {0, 8} are employed in addition to features from t= {2, 4} . A key challenge in utiliz-ing these additional contexts is how to warp the features at and to align with the current time step t. Direct motion estimation and compression would not only increase computational com-plexity but also require extra bits to encode motions. Fortunately, if both and are available, the motion has already been decoded. This allows us to predict the motion by accumulating flows . Similarly, we could predict the motion based on and For simplicity, we omit the convolutional layer in FIG. 7. Thus, the additional local contexts can be formulated as: To balance reference diversity and computational cost, we set avoiding the inclusion of for the local contexts from and FIG. 9 illustrates a visualization of predicted errors in optical flow-based warping. The frames are from "Jockey" sequence in UVG dataset. 5.1.3.4 Bidirectional Non-Local Context Diversification To enhance contextual diversity, BiECVC introduces Bidirectional Non-Local Context Diversification (BNLCD) to capture non-local correlations as illustrated in FIG. 8. This requires comparing all elements of the current feature with those of the reference features, necessitating a non-local receptive field. Given the flex-ibility of conditional coding, we follow ECVC and adopt linear attention , allowing the network to learn corre-lations automatically. For high-resolution features, linear attention is more efficient and memory-friendly than vanilla attention , as it avoids the explicit computation of large attention maps with quadratic complexity. Ad-ditionally, since non-local attention directly models feature similarities, explicit warping of features is unnec-essary. To maintain a balanced parameter count, we utilize a shared linear attention layer across all available features. First, current is embedded to a query The available features and are embedded into keys and values For simplicity, we omit the DWConv Block in FIG. 7. The process is formulated as: This formulation applies two independent softmax (SM) operations on row and column-allowing the key-value product to be computed first, reducing complexity to linear order. Additionally, each row of the implicit similarity matrix (e.g., softmax2 softmax1 ) sums to 1, ensuring a normalized attention distribu-tion across all positions . For more diverse non-local contexts, we explore the non-local contexts from time step and To balance reference diversity and complexity, we set The process is formulated as: 5.1.3.4.1. Conditional Coding Aware Bidirectional Context Gating In bidirectional video compression, effectively utilizing the captured local contexts and non-local contexts are crucial for achieving high compression efficiency. However, as illustrated in FIG. 9, the predicted local contexts may contain errors due to non-overlapping regions or large motion. While conditional coding is highly flexible, fixed weights may fail to mitigate these errors. Therefore, for regions with unreliable contexts, it is essential to suppress their influence and favor intra coding (i.e., coding without external contexts) . Moreo-ver, due to feature propagation, prediction errors may accumulate across layers, leading to performance degra-dation. Recent advancements in linear-time autoregressive language modeling have demonstrated that data-dependent decay plays a crucial role in preserving important information while suppressing irrelevant details. Formally, this process is defined as: FIG. 10 illustrates Rate-Distortion curves on HEVC B, HEVC E, and UVG dataset. The intra period is 32 with 96 frames. where St represents the state at time t, Mt is the data-dependent gating matrix, and qt, kt, vt correspond to queries, keys, and values, respectively. The output is denoted as ot. Drawing an analogy to video compression, we interpret as the output and as the current state. The process can be abstracted as: where represents operations such as warping and attention, W represents convolutional weights. Inspired by this connection, we propose the Bidirectional Context Gating (BCG) . At the encoder side, we gen-erate the data-dependent decay matrix Mt based on and To reduce computational complexity, a di-mension reduction (DR) branch is introduced before gating. The matrix generation follows the principle of conditional coding (CC) , meaning the network effectively performs conditional coding once, and the results guide the actual conditional coding. At the encoder side, the process is: Similarly, at the decoder side, the process is: where ω denotes the Sigmoid function, following HGRN . At the 0-th scale, the features propagated to the next layers and reconstruction are computed by Feature Generation (FG) and convolutions: With the BCG module, the network can effectively suppress harmful errors while emphasizing beneficial con-texts. 5.1.3.4.2 Feature Cache for Acceleration In bidirectional video compression, a single frame may serve as a reference for multiple frames. For instance, in FIG. 6,  is referenced by frames This implies that the multi-scale features, keys, and values com-puted for in BLCD and BNLCD during the encoding of x4 can also be reused for encoding To effi-ciently manage these reusable features, to our knowledge, we introduce the first feature cache mechanism for BVCs. Features that will be referenced later are stored in the cache, while those no longer needed are removed to control memory usage. This caching strategy improves computational efficiency, leading to an inference speedup of up to 18%. 5.1.4. Experiments 5.1.4.1 Experimental Setup 5.1.4.1.1 Training Details The proposed BiECVC is implemented using PyTorch 2.2.2 and trained on the Vimeo-90K training split and the BVI-AOM dataset (serval sequences are removed to prevent potential data leakage) using GPUs. Follow-ing ECVC , we adopt the multi-stage training strategy with long-sequence fine-tuning. During training, se-quences are randomly cropped into 256×256 patches with a batch size of 4. In the finetuning stage, we in-corporate 33-frame sequences and set the learning rate to 10-6. The optimization objective is defined as where represents the bit rate and denotes distortion. For variable bit-rate training, λ is sampled from {85, 170, 380, 840} . We use hierarchical quality control with weight factors wk={1.4, 1.4, 0.7, 0.5, 0.5} , where k denotes the layer index. For intra-frame coding, we adopt the intra-frame codec of DCVC-DC . FIG. 11 illustrates Rate Allocations on "BQTerrace" from HEVC B. The average bpps are around 0.09. FIG. 12 illustrates a visualization of attention maps with a query selected from flower regions. The frames are from "HoneyBee" sequence in UVG dataset. 5.1.4.1.2 Evaluation Details Following prior works , BiECVC is evaluated on HEVC datasets , including Class B, C, D, E, as well as UVG and MCL-JCV . To comprehensively assess its performance, we compare BiECVC with both low-delay and random access methods: ·Low-delay methods: DCVC-TCM , DCVC-HEM , DCVC-DC , DCVC-FM , and ECVC . ·Random access methods: B-CANF , UCVC , APSVC , DCVC-B and L-LBVC . Performance is measured using PSNR in RGB color format. BiECVC under IP32 with 96 frames and IP64 with 64 frames are evaluated since several sequences of MCL-JCV only have 125 frames to ensure fair com-parison with low delay methods. Since RA relies on future intra frame, we duplicate the previous intra frame ( or ) as a proxy for the unavailable future intra frame ( or ) , avoiding future information leakage. To fully assess RA performance, we also report results on 97 and 65 frames, where actual future intra frames are accessible. The Bjontegaard Delta-Rate (BD-Rate) metric is used to rank the methods. 5.1.4.2 Comparisons with Previous Methods 5.1.4.2, 1 Rate-Distortion Performance The performances (The MS-SSIM results, as well as the results on all sequences under the IP64 setting with 192 / 193 frames (excluding MCL-JCV) , are presented in the supplementary material) are presented in FIG. 10 and Table 1. In FIG. 10, 16 data points of BiECVC are plotted to demonstrate the ability of variable rate. Under IP32. We evaluate BiECVC with 96 and 97 frames. On 96 frames, BiECVC achieves significant im-provements over non-learned codecs, including VTM-13.2 under both LDB and RA configurations. On aver-age, BiECVC outperforms VTM-13.2 RA by 13.4%in BD-rate. Compared to low-delay learned methods, BiECVC consistently surpasses ECVC across all datasets, with an average gain of 17%. Furthermore, BiECVC outperforms the random access method DCVC-B by a large margin of 25.4%on average. On 97 frames, we compare BiECVC only against existing BVCs and VTM-13.2 RA. In this setting, BiECVC achieves even greater improvements, reducing BD-rate by 17.3%on average relative to VTM-13.2 RA. Under IP64 On 64 frames, BiECVC outperforms VTM-13.2 RA by 15.7%in BD-rate. On 65 frames, BiECVC achieves even greater improvements, reducing BD-rate by 21%on average relative to VTM-13.2 RA. Under the IP64 setting, larger motion in lower-layer frames leads to less informative reference contexts for bidirectional prediction, limiting performance gains. This also occurs in traditional codecs, where the ad-vantage of VTM RA over VTM LD diminishes under longer IPs. It explains why BiECVC underperforms ECVC on certain sequences. Nonetheless, BiECVC still achieves an average bit-rate reduction of 6%com-pared to ECVC. To our knowledge, this is the first learned video compression model to surpass VTM-13.2 RA in rate-distor-tion performance. Notably, BiECVC consistently outperforms VTM-13.2 RA across all datasets, demonstrat-ing its strong generalization ability. FIG. 13 illustrates a visual quality comparison on reconstruction frames and ground truth. 5.1.4.2.2 Rate Allocation Analysis Since BiECVC is designed for B-frame coding, we compare it with DCVC-B in terms of rate allocation. The results are shown in FIG. 11. At lower layers (e.g., frame 16) , BiECVC allocates more bits, whereas at higher layers, it allocates fewer bits compared to DCVC-B. This strategy is more reasonable because lower-layer frames serve as references for higher-layer frames, making it beneficial to allocate more bits to improve their quality. 5.1.4.2.3 Visual Quality Comparison The visual quality comparison is shown in FIG. 13 Compared with ECVC, BiECVC achieves a 0.4 dB im-provement in PSNR while consuming fewer bits. In terms of visual quality, our BiECVC demonstrates notice-able improvements over prior methods . 5.1.4.2.4 Complexity Analysis BiECVC is compared with both low-delay and random access baselines in terms of complexity, as shown in Table 2. While bidirectional prediction inherently involves higher complexity due to multiple motion estima-tions and compensations, BiECVC achieves significantly better performance than low-delay methods despite its higher complexity. Moreover, compared with other bidirectional approaches such as B-CANF and DCVC-B , BiECVC achieves lower complexity thanks to the proposed feature cache. Table 1. BD-Rate (%) comparison for PSNR (dB) . The anchor is VTM-13.2 RA. 5.1.4.3 Ablation Studies In the ablation studies, all models are optimized using the same setting, and PSNR is adopted to evaluate dis-tortion. The results are summarized in Table 3. The baseline model ( "Base" ) does not incorporate bidirectional context diversification or weighting; instead, it directly warps two reference frames for conditional coding. According to Table 3, introducing BLCD improves performance. BNLCD contributes the most to the overall performance, likely due to its non-local receptive field, which better handles various types of motion. To fur-ther analyze the non-local context, we visualize the attention map in FIG. 12 When a query from the flower region is selected, the attention scores are high across multiple flower areas, indicating that non-local depend-encies are effectively captured. BCG provides a relatively smaller performance gain on HEVC Class E, possi-bly because the sequences in HEVC E contain only small movements. The ablation studies demonstrate the effectiveness of our proposed techniques for BiECVC. Table 2. Complexity comparison on 720p sequence. "Params" (M) is the number of parameters. "kMACs / Pixel" is evaluated during forward. "ET" (s) and "DT" (s) refer to the average encoding and decoding time per frame. Table 3: Ablation Studies on HEVC B~E, UVG and MCL-JCV. The metric is BD-Rate (%) w. r. t VTM-13.2 RA 5.1.5. Conclusion In this document, we present BiECVC, a bidirectional video compression framework that leverages local and non-local context diversification along with context gating. To enhance local context diversity, we incorporate high-quality features from lower layers. These features are aligned using existing decoded motion vectors, eliminating the need for additional motion estimation and compression. For non-local context diversification, we adopt a linear attention mechanism to strike a balance between performance and computational efficiency. Furthermore, we introduce a bidirectional context gating mechanism that dynamically emphasizes beneficial information while suppressing harmful noise, drawing inspiration from recent advancements in linear-time au-toregressive language modeling . To accelerate inference, we integrate a feature cache that reuses precomputed features. Experimental results demonstrate that BiECVC achieves performance. To the best of our knowledge, this is the first learned video codec to surpass VTM 13.2 RA across all datasets. However, since BiECVC builds upon the DCVC-DC and ECVC frameworks, its speed remains far from real-time. In future work, we plan to integrate the proposed techniques into DCVC-RT to enable practical bidirectional video compression. 5.2. Implementation 2 5.2.1. Test Settings We evaluate both learned video codecs (LVCs) and traditional codecs in the RGB color space. Frames en-coded in YUV are converted to RGB using the BT. 601 standard. For obtaining the rate-distortion (RD) data of VTM-13.2 under LDB and RA configurations , the following commands are used: #VTM-13.2 LDB . / EncoderAppStatic -c encoder_lowdelay_vtm. cfg --InputFile= {input file name} --BitstreamFile= {bitstream file name} --DecodingRefreshType=2 --InputBitDepth=8 --OutputBitDepth=8 --OutputBitDepth=8 --InputChromaFormat=444 --FrameRate= {frame rate} --FramesToBeEncoded= {frame number} --SourceWidth= {width} --SourceHeight= {height} --IntraPeriod= {IP} --QP= {qp} --Level=6.2 #VTM-13.2 RA . / EncoderAppStatic -c encoder_randomaccess_vtm. cfg --InputFile= {input file name} --BitstreamFile= {bitstream file name} --DecodingRefreshType=1 --InputBitDepth=8 --OutputBitDepth=8 --OutputBitDepth=8 --InputChromaFormat=444 --FrameRate= {frame rate} --FramesToBeEncoded= {frame number} --SourceWidth= {width} --SourceHeight= {height} --IntraPeriod= {IP} --QP= {qp} --Level=6.2 5.2.2. Architectures In this section, we describe the architectures of DWConv Block and Bidirectional Context Gating Module. The architectures are presented in FIG. 14. The DWConv Block first applies a 1×1 convolution followed by a LeakyReLU activation to adjust channel dimensions. Then, a depthwise 3×3 convolution captures spatial information efficiently, followed by another activation. Finally, a second 1×1 convolution refines the output. A skip connection is added, which is either an identity mapping or a 1×1 convolution if the input and output channel dimensions differ. In Bidirectional Context Gating Module, the DepthConv Block is employed for conditional coding and di-mension reduction. The DepthConv Block first applies a depthwise convolution layer (DepthConv) to extract spatial features with low computational cost, followed by a channel-wise feed-forward network (ConvFFN) to enhance channel interactions. Table 4: BD-Rate (%) comparison for PSNR (dB) . The anchor is VTM-13.2 RA Table 5: BD-Rate (%) comparison for MS-SSIM. The anchor is DCVC-TCM. The Intra Period is 32 with 96 frames. 5.2.3. Rate-Distortion Results For all baselines, we evaluate their performances using official code and weights. To comprehensively assess its performance, we compare BiECVC with both low-delay and random access methods: ·Low-delay methods: DCVC-TCM , DCVC-HEM , DCVC-DC , DCVC-FM , ECVC , and VTM-13.2 LDB. ·Random access methods: B-CANF , UCVC , DCVC-B , L-LBVC and VTM-13.2 RA. The rate-distortion results are presented in Table 4, 5 and FIGS. 15A-15C, 16A-16C, 17A-17C, 18A-18C, 19A-19C, 20A-20C, 21A-21C. For MS-SSIM optimized BiECVC, we finetune the MSE-optimized model and sample λ from {7.68, 15.36, 30.72, 61.44} for variable rate. 5.3. Implementation 3 5.3.1 Introduction Video compression aims to represent visual signals using fewer bits while maintaining high reconstruction quality. Traditional video coding methods, such as VVC , have been developed over decades and have achieved impressive performance. However, their progress is fundamentally constrained by the hand-crafted design of coding tools, leading to a performance plateau. In contrast, learned video compression (LVC) is op-timized in a fully end-to-end manner, offering greater flexibility and the potential for superior performance. As a result, it has garnered increasing attention in recent years. Current LVCs follow the conditional coding paradigm , where temporal contexts are used as priors for a re-duction in conditional entropy. As used herein, the term context refers to predictions used for computing resid-uals or conducting conditional coding, which differs from the contexts used in entropy models. Existing ap-proaches primarily focus on forward prediction, in which each frame (P-frame) can only reference frames from earlier time steps. Although this strategy has led to impressive progress, with recent methods even surpassing VVC reference software VTM under the Low Delay B (LDB) configuration, bidirectional prediction, where a frame (B-frame) can reference both past and future frames, remains relatively underexplored. In theory, bidi-rectional prediction offers richer contextual information and holds greater potential for compression efficiency. However, current bidirectional video compression (BVC) methods still underperform compared to their for-ward-only counterparts . Such performance gap is largely due to the limited ability of existing methods to fully exploit bidirectional temporal priors, as well as their insufficient adaptability in handling complex motion and occlusions. To better understand the limitations of existing BVCs , we analyze the factors contributing to the superior per-formance of traditional codecs such as VVC under bidirectional prediction. First, VVC supports the selection of up to 4~6 reference frames , offering significantly more diverse temporal information compared to current BVCs. Most existing BVCs utilize only a single forward and a single backward frame as references, which may fall short in modeling complex motion dynamics or handling occluded regions. Second, in VVC, motion estimation is based on minimizing Sum of Absolute Differences (SAD) , which captures block-level similarity. However, small SAD values do not necessarily imply real motion; they may simply indicate pixel fidelity. Thus, VVC can benefit from flexible content matching, even across frames with weak temporal relevance, a capability largely absent in current optical flow-based BVCs. Finally, VVC assigns adaptive weights to multi-ple reference frames through rate-distortion (RD) optimization, enabling flexible utilization of contextual in-formation. In contrast, existing learned BVC approaches typically lack mechanisms for context-wise weighting, making it difficult to selectively enhance informative cues while suppressing noisy or misleading signals. To address above issues, we propose bidirectional context diversification for enhanced exploitation of tem-poral priors, and bidirectional context gating to adaptively weight contexts based on conditional coding results. We categorize bidirectional contexts into local and non-local types . Local contexts capture correlations with explicit motion, while non-local contexts correspond to similar regions without clear motion trajectories as il-lustrated in FIG. 8. To diversify local contexts, we incorporate additional reference frames from lower hierarchical layers. In BVCs, such lower-layer frames are generally assigned higher bit-rates and therefore offer better reconstruction quality, making them valuable sources for reliable motion-aligned context. To align these frames with the cur-rent target frame without incurring additional motion coding overhead, we reuse the decoded motion vectors already estimated for primary reference frames. To diversify non-local contexts, we adopt a linear attention mechanism to capture non-local correlations across frames. Linear attention compares each element in the current frame with all elements in reference frames, based on learned attention-driven similarity. We note that the process of aggregating contexts using attention scores fundamentally aligns with the principle of block matching in VVC, which selects reference candidates by minimizing the SAD. However, unlike hand-crafted SAD, our approach enables flexible similar-ity optimization in an end-to-end manner. In bidirectional context gating, we draw inspiration from data-dependent decay in linear-time autoregressive language modeling . To compute the gating matrix, we first concatenate the latent features with the corre-sponding contexts, and apply a nonlinear transform. The resulting gating matrix is used to modulate the magni-tude of each context feature. Interestingly, this nonlinear transform of the latent feature and contexts can be interpreted as an attempt of conditional coding-performed without weighting-to assess their relevance. The output of this initial interaction serves as guidance for the actual weighted conditional coding. Based on proposed techniques, we propose a bidirectional video compression model with Gated Diversifica-tion of Bidirectional Contexts, termed BiECVC. To accelerate BiECVC, to our knowledge, we introduce the first feature cache mechanism for BVCs to efficiently reuse pre-computed features. Experiments demonstrate that BiECVC achieves performance, reducing bit-rate by 13.4%and 15.7%compared to the VTM 13.2 RA with intra periods of 32 and 64. To the best of our knowledge, BiECVC is the first learned video codec to out-perform VTM 13.2 RA across all standard test datasets. Our contributions are summarized as follows: ·To diversify local contexts, BiECVC exploits high-quality features from lower layers and aligns them using decoded motion vectors, without additional motion overhead. ·To diversify non-local contexts, linear attention mechanism is employed to capture correlations across frames with unclear motion trajectories based on learned attention-driven similarity. ·To enhance context weighting, we introduce a bidirectional context gating mechanism that dynami-cally emphasizes beneficial information while suppressing harmful noise, drawing inspiration from recent advancements in linear-time autoregressive language modeling. ·Experiments demonstrate that our BiECVC achieves performance, reducing bit-rate by 13.4%and 15.7%over VTM 13.2 RA with intra periods of 32 and 64. To our knowledge, BiECVC is the first learned video codec to surpass VTM 13.2 RA across all standard test datasets. 5.3.2 Related Works Learned Video Compression with Forward Prediction Most existing learned video compression models focus on forward prediction. DVC is one of the pioneering frameworks in this domain, following the residual coding paradigm. It employs an optical flow network for motion estimation, compressing both motion and residuals between the original and predicted frames using neural networks. To enhance performance, the DVC framework has been further refined with various tech-niques, including resolution-adaptive coding , scale-space flow warping , selective compression , and coarse-to-fine prediction . Despite advancements in residual coding-based methods, they fail to fully exploit temporal priors, as their per-formance is fundamentally constrained by the entropy of the residuals . To address this issue, Li et al. propose the conditional coding paradigm, where the neural network learns the correlations between the current frame and temporal priors automatically, rather than relying on predefined residuals, leading to improved compres-sion efficiency. This paradigm is further refined with temporal context mining for better temporal dependency exploitation. Regarding entropy modeling, Li et al. propose hybrid spatial-temporal coding and quadtree-based entropy models to minimize the bit-rate of latent representations. Additionally, hierarchical quality and offset diversity are leveraged to enhance temporal adaptability. To mitigate accumulated errors in long coding chains, Li et al. introduce temporal-propagated context refreshment, significantly improving long-term perfor-mance. Recently, Jiang et al. propose ECVC, which captures long-range dependencies across multiple frames. With an improved training strategy, ECVC achieves performance in low-delay configurations. FIG. 5 illustrates an overall framework of BiECVC. The quantization parameter (qp) controls variable-rate compression. Local contexts are shared between the encoder and decoder. The non-local contexts,  and are extracted separately at the encoder and decoder. The final contexts,  and are used at the contextual encoder and decoder, respectively. AE and AD are arithmetic encoding and decoding, respectively. FIG. 6 illustrates a Coding Structure when Intra Period is 8. "Yellow" denotes I-frames, "Blue" denotes B-frames. When coding 3-th frame, {0, 2, 4, 8} -th frames serve as references. Learned Video Compression with Bidirectional Prediction Compared to forward prediction, bidirectional prediction is more challenging and has been relatively unex-plored in learned video compression. Wu et al. propose the first motion-free video compression framework, which relies on frame interpolation. The residual between the interpolated and original frames is compressed using a neural network. This approach is further refined by Xu et al. by advanced interpolation techniques. Djelouah et al. introduce residual coding in the latent space while Alexandre et al. propose a two-layer condi-tional augmented normalizing flow to improve expressiveness. In contrast, most BVCs retain motion estimation and motion compensation modules. Yang et al. employ an optical flow network for bidirectional motion estimation, where both the predicted frame (obtained via flow warping) and the motion itself are compressed. Pourreza et al. introduce an interpolation-based approach, gen-erating a predicted frame by interpolating two warped reference frames before performing residual coding. Yang et al. develop UCVC, a conditional coding-based method capable of compressing both P-frames and B-frames within a single model. Sheng et al. propose DCVC-B , a bidirectional video compression model that extends temporal propagation and multi-scale contexts from forward prediction to bidirectional prediction. Despite advancements in bidirectional video compression, existing models still lag behind their forward-only counterparts. This performance gap stems from challenges such as limited contextual information and errors of predicted contexts. Current methods typically use flow maps for motion compensation and conditional coding, which overlooks non-local correlations without explicit movements, leading to limited context diversity. Moreover, predicted errors in contexts caused by large motions and non-overlapped regions introduce extra noise, reducing coding efficiency. FIG. 7 illustrates an illustrations of the proposed Bidirectional Local Context Diversification (BLCD) and Bi-directional Non-Local Context Diversification (BNLCD) and Bidirectional Context Gating (BCG) . The pro-cess is conditional coding at the encoder side. The decoding process mirrors the encoding process. 5.3.3 Method 5.3.3.1 Overview The overall architecture of our proposed BiECVC is presented in FIG. 5 and FIG. 7. Our BiECVC is based on ECVC and the offset diversity module is removed for lower complexity. In Section 5.3.3.2, 5.3.3.3 and 5.3.3.4, we mainly take the encoder side as example. The process of the decoder side mirrors that of the en-coder side. 5.3.3.1.1 Background Given sequence where t is the time step, N is the number of frames, H and W are the height and width of a frame respectively, bidirectional video compression aims to efficiently encode the se-quence by dividing it into multiple group of pictures (GOP) and make the reconstructions with high quality. Within each GOP, Intra (I) frames are encoded independently, while Bidirectional (B) frames are com-pressed using contexts from both backward and forward references. In the bidirectional coding structure, frames within an GOP are organized into multiple hierarchical layers. For example, when the IP is 8, the frames are divided into 4 layers as illustrated in FIG. 6. Lower layers are as-signed more bits and higher quality because they are referenced by multiple frames at higher layers. BiECVC employs the feature propagation mechanism in DCVC series and ECVC . Specifically, let it repre-sent the temporal interval between the current frame xt and its two reference frames and During encoding, xt is first transformed to multi-scale Propagated features from lower layers and their downsampled and are warped by motion vectors and to serve as the multi-scale temporal priors for conditional coding corresponding FIG. 8 illustrates a visualization of local context (with motion trajectory) and non-local context (no motion tra-jectory) . 5.3.3.1.2 Motion Estimation and Compression To leverage temporal priors, we employ SPyNet to estimate the motion vectors which represent the motion from time step t-it to t and from t+it to t, respectively. To efficiently com-press the motion vectors,  and are concatenated along the channel dimension and fed into a mo-tion encoder. On the decoder side, the reconstructed tensor with four channels is split along the channel dimen-sion to obtain the reconstructed motion vectors 5.3.3.1.3 Bidirectional Contextual Compression In BiECVC, we propose the Bidirectional Local Context Diversification (BLCD) and Bidirectional Non-Local Context Diversification (BNLCD) to diversify the temporal contexts. Local contexts are defined as regions exhibiting explicit motion, whereas non-local contexts refer to similar regions that do not display explicit movement as illustrated in FIG. 8. For diverse local contexts, BLCD incorporates additional local contexts from time steps and in addition to local contexts at t-it and t+it for better quality of lower layers. For example, in FIG. 6, when t=3, contexts from t= {0, 8} are employed in addition to contexts from t= {2, 4} . For effective non-local context modeling, BNLCD employs linear attention mecha-nisms to capture non-local contexts at time steps t-it, t+it,  and with linear complexity. Considering the non-overlapped regions between temporal contexts and the current feature due to fast motions, and accumulated errors during feature propagation, inspired by the data-dependent decay mecha-nism in recent linear attentions for autoregressive language modeling , we propose a Conditional Coding-Aware Bidirectional Context Gating (BCG) mechanism to adaptively adjust context weights via gating. In BCG, we first attempt conditional coding using the available contexts. The results guide the genera-tion of a weighting mask M, which selectively adjusts the influence of different contexts to suppress harmful errors and non-overlapped contexts. In implementation, we introduce feature cache mechanism to reuse pre-computed features for acceleration. 5.3.3.2 Bidirectional Local Context Diversification In existing bidirectional video compression models , the conditional coding of relies on motion compensa-tion from two reference frames at time steps t-it and t+it: where  represents warping with optical flow. However, in a hierarchical bidirectional coding structure, lower-layer reference frames / features generally have higher quality and lower reconstruction errors, which can improve compression efficiency. Additionally, vid-eos often contain complex motion patterns, such as fast movements , affine transformations , and occlusions , using only two reference frames may not be sufficient to handle these challenging scenarios. To address these issues, we propose the Bidirectional Local Context Diversification (BLCD) , as illustrated in FIG. 7. In BLCD, we leverage priors from time steps and as the corresponding features and are available in most cases during the coding of For example, in FIG. 6, when t=3, features from t= {0, 8} are employed in addition to features from t= {2, 4} . A key challenge in utiliz-ing these additional contexts is how to warp the features at and to align with the current time step t. Direct motion estimation and compression would not only increase computational com-plexity but also require extra bits to encode motions. Fortunately, if both and are available, the motion has already been decoded. This allows us to predict the motion by accumulating flows . Similarly, we could predict the motion based on and For simplicity, we omit the convolutional layer in FIG. 7. Thus, the additional local contexts can be formulated as: To balance reference diversity and computational cost, we set avoiding the inclusion of for the local contexts from and FIG. 9 illustrates a visualization of predicted errors in optical flow-based warping. The frames are from "Jockey" sequence in UVG dataset. 5.3.3.3 Bidirectional Non-Local Context Diversification To enhance contextual diversity, BiECVC introduces Bidirectional Non-Local Context Diversification (BNLCD) to capture non-local correlations as illustrated in FIG. 8. This requires comparing all elements of the current feature with those of the reference features, necessitating a non-local receptive field. Given the flex-ibility of conditional coding, we follow ECVC and adopt linear attention , allowing the network to learn corre-lations automatically. For high-resolution features, linear attention is more efficient and memory-friendly than vanilla attention , as it avoids the explicit computation of large attention maps with quadratic complexity. Ad-ditionally, since non-local attention directly models feature similarities, explicit warping of features is unnec-essary. To maintain a balanced parameter count, we utilize a shared linear attention layer across all available features. First, current  is embedded to a query The available features and are embedded into keys and values For simplicity, we omit the DWConv Block in FIG. 7. The process is formulated as: This formulation applies two independent softmax (SM) operations on row and column-allowing the key-value product to be computed first, reducing complexity to linear order. Additionally, each row of the implicit similarity matrix (e.g., softmax2 softmax1 ) sums to 1, ensuring a normalized attention distribu-tion across all positions . For more diverse non-local contexts, we explore the non-local contexts from time step and To balance reference diversity and complexity, we set  The process is formulated as: 5.1.3.4.1. Conditional Coding Aware Bidirectional Context Gating In bidirectional video compression, effectively utilizing the captured local contexts and non-local contexts are crucial for achieving high compression efficiency. However, as illustrated in FIG. 9, the predicted local contexts may contain errors due to non-overlapping regions or large motion. While conditional coding is highly flexible, fixed weights may fail to mitigate these errors. Therefore, for regions with unreliable contexts, it is essential to suppress their influence and favor intra coding (i.e., coding without external contexts) . Moreo-ver, due to feature propagation, prediction errors may accumulate across layers, leading to performance degra-dation. Recent advancements in linear-time autoregressive language modeling have demonstrated that data-dependent decay plays a crucial role in preserving important information while suppressing irrelevant details. Formally, this process is defined as: FIG. 10 illustrates Rate-Distortion curves on HEVC B, HEVC E, and UVG dataset. The intra period is 32 with 96 frames. where St represents the state at time t, Mt is the data-dependent gating matrix, and qt, kt, vt correspond to queries, keys, and values, respectively. The output is denoted as ot. Drawing an analogy to video compression, we interpret as the output and as the current state. The process can be abstracted as: where represents operations such as warping and attention, W represents convolutional weights. Inspired by this connection, we propose the Bidirectional Context Gating (BCG) . At the encoder side, we gen-erate the data-dependent decay matrix based on and To reduce computational complexity, a di-mension reduction (DR) branch is introduced before gating. The matrix generation follows the principle of conditional coding (CC) , meaning the network effectively performs conditional coding once, and the results guide the actual conditional coding. At the encoder side, the process is: Similarly, at the decoder side, the process is: where ω denotes the Sigmoid function, following HGRN . At the 0-th scale, the features propagated to the next layers and reconstruction are computed by Feature Generation (FG) and convolutions: With the BCG module, the network can effectively suppress harmful errors while emphasizing beneficial con-texts. 5.3.3.4 Feature Cache for Acceleration In bidirectional video compression, a single frame may serve as a reference for multiple frames. For instance, in FIG. 6,  is referenced by frames This implies that the multi-scale features, keys, and values com-puted for in BLCD and BNLCD during the encoding of x4 can also be reused for encoding To effi-ciently manage these reusable features, to our knowledge, we introduce the first feature cache mechanism for BVCs. Features that will be referenced later are stored in the cache, while those no longer needed are removed to control memory usage. This caching strategy improves computational efficiency, leading to an inference speedup of up to 18%. 5.3.4 Experiments 5.3.4.1 Experimental Setup 5.3.4.1.1 Training Details The proposed BiECVC is implemented using PyTorch 2.2.2 and trained on the Vimeo-90K training split and the BVI-AOM dataset (serval sequences are removed to prevent potential data leakage) using GPUs. Follow-ing ECVC , we adopt the multi-stage training strategy with long-sequence fine-tuning. During training, se-quences are randomly cropped into 256×256 patches with a batch size of 4. In the finetuning stage, we in-corporate 33-frame sequences and set the learning rate to 10-6. The optimization objective is defined as where represents the bit rate and denotes distortion. For variable bit-rate training, λ is sampled from {85, 170, 380, 840} . We use hierarchical quality control with weight factors wk= {1.4, 1.4, 0.7, 0.5, 0.5} , where k denotes the layer index. For intra-frame coding, we adopt the intra-frame codec of DCVC-DC . FIG. 11 illustrates Rate Allocations on "BQTerrace" from HEVC B. The average bpps are around 0.09. FIG. 12 illustrates a visualization of attention maps with a query selected from flower regions. The frames are from "HoneyBee" sequence in UVG dataset. 5.3.4.1.2 Evaluation Details Following prior works , BiECVC is evaluated on HEVC datasets , including Class B, C, D, E, as well as UVG and MCL-JCV . To comprehensively assess its performance, we compare BiECVC with both low-delay and random access methods: ·Low-delay methods: DCVC-TCM , DCVC-HEM , DCVC-DC , DCVC-FM , and ECVC . ·Random access methods: B-CANF , UCVC , APSVC , DCVC-B and L-LBVC . Performance is measured using PSNR in RGB color format. BiECVC under IP32 with 96 frames and IP64 with 64 frames are evaluated since several sequences of MCL-JCV only have 125 frames to ensure fair com-parison with low delay methods. Since RA relies on future intra frame, we duplicate the previous intra frame ( or ) as a proxy for the unavailable future intra frame ( or ) , avoiding future information leakage. To fully assess RA performance, we also report results on 97 and 65 frames, where actual future intra frames are accessible. The Bjontegaard Delta-Rate (BD-Rate) metric is used to rank the methods. 5.3.4.2 Comparisons with Previous Methods 5.3.4.2.1 Rate-Distortion Performance The performances (The MS-SSIM results, as well as the results on all sequences under the IP64 setting with 192 / 193 frames (excluding MCL-JCV) , are presented in the supplementary material) are presented in FIG. 10 and Table 1. In FIG. 10, 16 data points of BiECVC are plotted to demonstrate the ability of variable rate. Under IP32. We evaluate BiECVC with 96 and 97 frames. On 96 frames, BiECVC achieves significant im-provements over non-learned codecs, including VTM-13.2 under both LDB and RA configurations. On aver-age, BiECVC outperforms VTM-13.2 RA by 13.4%in BD-rate. Compared to low-delay learned methods, BiECVC consistently surpasses ECVC across all datasets, with an average gain of 17%. Furthermore, BiECVC outperforms the random access method DCVC-B by a large margin of 25.4%on average. On 97 frames, we compare BiECVC only against existing BVCs and VTM-13.2 RA. In this setting, BiECVC achieves even greater improvements, reducing BD-rate by 17.3%on average relative to VTM-13.2 RA. Under IP64 On 64 frames, BiECVC outperforms VTM-13.2 RA by 15.7%in BD-rate. On 65 frames, BiECVC achieves even greater improvements, reducing BD-rate by 21%on average relative to VTM-13.2 RA. Under the IP64 setting, larger motion in lower-layer frames leads to less informative reference contexts for bidirectional prediction, limiting performance gains. This also occurs in traditional codecs, where the ad-vantage of VTM RA over VTM LD diminishes under longer IPs. It explains why BiECVC underperforms ECVC on certain sequences. Nonetheless, BiECVC still achieves an average bit-rate reduction of 6%com-pared to ECVC. To our knowledge, this is the first learned video compression model to surpass VTM-13.2 RA in rate-distor-tion performance. Notably, BiECVC consistently outperforms VTM-13.2 RA across all datasets, demonstrat-ing its strong generalization ability. FIG. 13 illustrates a visual quality comparison on reconstruction frames and ground truth. 5.3.4.2.2 Rate Allocation Analysis Since BiECVC is designed for B-frame coding, we compare it with DCVC-B in terms of rate allocation. The results are shown in FIG. 11. At lower layers (e.g., frame 16) , BiECVC allocates more bits, whereas at higher layers, it allocates fewer bits compared to DCVC-B. This strategy is more reasonable because lower-layer frames serve as references for higher-layer frames, making it beneficial to allocate more bits to improve their quality. 5.3.4.2.3 Visual Quality Comparison The visual quality comparison is shown in FIG. 13 Compared with ECVC, BiECVC achieves a 0.4 dB im-provement in PSNR while consuming fewer bits. In terms of visual quality, our BiECVC demonstrates notice-able improvements over prior methods. 5.3.4.2.4 Complexity Analysis BiECVC is compared with both low-delay and random access baselines in terms of complexity, as shown in Table 2. While bidirectional prediction inherently involves higher complexity due to multiple motion estima-tions and compensations, BiECVC achieves significantly better performance than low-delay methods despite its higher complexity. Moreover, compared with other bidirectional approaches such as B-CANF and DCVC-B , BiECVC achieves lower complexity thanks to the proposed feature cache. 5.3.4.3 Ablation Studies In the ablation studies, all models are optimized using the same setting, and PSNR is adopted to evaluate dis-tortion. The results are summarized in Table 3. The baseline model ( "Base" ) does not incorporate bidirectional context diversification or weighting; instead, it directly warps two reference frames for conditional coding. According to Table 3, introducing BLCD improves performance. BNLCD contributes the most to the overall performance, likely due to its non-local receptive field, which better handles various types of motion. To fur-ther analyze the non-local context, we visualize the attention map in FIG. 12 When a query from the flower region is selected, the attention scores are high across multiple flower areas, indicating that non-local depend-encies are effectively captured. BCG provides a relatively smaller performance gain on HEVC Class E, possi-bly because the sequences in HEVC E contain only small movements. The ablation studies demonstrate the effectiveness of our proposed techniques for BiECVC. 5.3.5 Conclusion In this document, we present BiECVC, a bidirectional video compression framework that leverages local and non-local context diversification along with context gating. To enhance local context diversity, we incorporate high-quality features from lower layers. These features are aligned using existing decoded motion vectors, elim-inating the need for additional motion estimation and compression. For non-local context diversification, we adopt a linear attention mechanism to strike a balance between performance and computational efficiency. Fur-thermore, we introduce a bidirectional context gating mechanism that dynamically emphasizes beneficial infor-mation while suppressing harmful noise, drawing inspiration from recent advancements in linear-time auto-regressive language modeling . To accelerate inference, we integrate a feature cache that reuses precomputed features. Experimental results demonstrate that BiECVC achieves performance. To the best of our knowledge, this is the first learned video codec to surpass VTM 13.2 RA across all datasets. However, since BiECVC builds upon the DCVC-DC and ECVC frameworks, its speed remains far from real-time. In future work, we plan to integrate the proposed techniques into DCVC-RT to enable practical bidirectional video compression. FIG. 14 illustrates architectures of DWConv Block and DepthConv Block. FIGS. 15A-15C illustrate rate-PSNR performances under intra period 32 with 96 frames, where the legends for FIGS. 15A and 15B are referenced to FIG. 15C. FIGS. 16A-16C illustrate rate-PSNR performances under intra period 32 with 97 frames, where the legends for FIGS. 16A and 16B are referenced to FIG. 16C. FIGS. 17A-17C illustrate rate-PSNR performances under intra period 64 with 64 frames, where the legends for FIGS. 17A and 17B are referenced to FIG. 17C. FIGS. 18A-18C illustrate rate-PSNR performances under intra period 64 with 65 frames, where the legends for FIGS. 18A and 18B are referenced to FIG. 18C. FIGS. 19A-19C illustrate rate-PSNR performances under intra period 64 with 192 frames, where the legends for FIGS. 19A and 19B are referenced to FIG. 19C. FIGS. 20A-20C illustrate rate-PSNR performances under intra period 64 with 193 frames, where the legends for FIGS. 20A and 20B are referenced to FIG. 20C. FIGS. 21A-21C illustrate rate-MS-SSIM performances under intra period 32 with 96 frames, where the legends for FIGS. 21A and 21B are referenced to FIG. 21C.

[0055] More details of the implementation of the present disclosure will be described below which are related to video coding. The implementations of the present disclosure should be considered as examples to explain the general concepts and should not be interpreted in a narrow way. Furthermore, these implementations can be applied individually or combined in any manner.

[0056] As used herein, the term “block” may represent a coding tree block (CTB) , a coding tree unit (CTU) , a coding block (CB) , a coding unit (CU) , a prediction unit (PU) , a transform unit (TU) , a prediction block (PB) , a transform block (TB) , a subblock, a tile, a slice, a subpicture, a video processing unit comprising multiple samples / pixels, and / or the like. A block may be rectangular or non-rectangular.

[0057] FIG. 22 illustrates a flowchart of a method 2200 for video processing in accordance with implementations of the present disclosure. The method 2200 is implemented during a conversion between a current frame of a video and a bitstream of the video by using a learning-based model.

[0058] As used herein, the term “model” may learn a correlation between respective inputs and outputs from training data, so that a corresponding output can be generated for a given input after training is completed. The generation of the model can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs by using multiple layers of processing units. A neural networks model is an example of a deep learning-based model. As used herein, “model” may also be referred to as “machine learning model” , “learning model” , “learning-based model” , “machine learning network” , “learning network” , or the like, and these terms are used interchangeably herein.

[0059] “Neural networks” are a type of machine learning network based on deep learning. Neural networks are capable of processing inputs and providing corresponding outputs, typically comprising input and output layers and one or more hidden layers between the input and output layers. Neural networks used in deep learning applications typically comprise many hidden layers, thereby increasing the depth of the network. The layers of neural networks are sequentially connected so that the output of the previous layer is provided as input to the latter layer, where the input layer receives the input of the neural network and the output of the output layer serves as the final output of the neural network. Each layer of a neural network comprises one or more nodes (also known as processing nodes or neurons) , each of which processes input from the previous layer.

[0060] Usually, machine learning may roughly comprise three stages, namely training stage, test stage, and application stage (also known as inference stage) . During the training stage, a given model can be trained using a large scale of training data, iteratively updating parameter values until the model can obtain consistent inference from the training data that meets the expected objective. Through the training, the model can be considered to learn the correlation between input and output (also known as input-to-output mapping) from the training data. The parameter values of the trained model are determined. In the test stage, test inputs are applied to the trained model to test whether the model can provide correct outputs, thereby determining the performance of the model. In the application stage, the model can be used to process actual inputs and determine corresponding outputs based on the parameter values obtained from training.

[0061] As shown in FIG. 22, the method 2200 starts at 2210, where bidirectional contexts for a current frame of a video are determined. In some cases, the bidirectional contexts may comprise at least one forward local context and / or at least one backward local context. The bidirectional contexts may also comprise global contexts generated based on temporal features from bidirectional reference frames. In some examples, the forward local contexts may be determined based on a forward reference frame of the current frame, and the backward local contexts may be determined based on a backward reference frame of the current frame. The bidirectional contexts may capture both local correlations with explicit motion and non-local correlations across frames without clear motion trajectories. This will be described in details below.

[0062] As used herein, local contexts and global contexts (a.k.a., non-local contexts) represent two complementary types of temporal priors that can be exploited for efficient video coding. Local contexts may refer to motion-compensated features that capture correlations between the current frame and reference frames based on explicit motion trajectories. These contexts are typically generated by warping propagated features from reference frames to the current frame using estimated motion vectors. Local contexts are effective for regions where motion can be accurately estimated and where corresponding content exists in the reference frames. However, local contexts may be limited in their ability to handle scenarios involving large motions, occlusions, or newly appearing content that does not have a direct correspondence in the reference frames. On the other hand, global contexts may capture non-local correlations across frames that do not rely on explicit motion trajectories. These contexts are generated using attention mechanisms that compare features between the current frame and reference frames based on learned similarity measures rather than geometric motion relationships. Global contexts can capture semantic or structural similarities between regions that may not be spatially aligned according to motion vectors, thereby complementing the local contexts by providing additional temporal priors for regions where motion-based compensation is less effective.

[0063] At 2220, the conversion is performed based on the bidirectional contexts. In some cases, the conversion includes encoding the video into the bitstream. Alternatively or additionally, the conversion includes decoding the video from the bitstream. In some cases, the conversion may comprises: generating the bitstream from the video, and the method 2200 further comprises: storing the bitstream in a non-transitory computer-readable recording medium. It should be understood that the above illustrations are described merely for purpose of description. The scope of the present disclosure is not limited in this respect.

[0064] In view of the above, bidirectional contexts are determined and used for the conversion. Compared with the conventional solution where unidirectional contexts are adopted for the conversion, the proposed solution can sufficiently utilize bidirectional correlation thus improving the coding quality. In addition, the use of bidirectional contexts may enable more accurate prediction and more effective exploitation of temporal redundancy, thereby reducing the bit-rate.

[0065] In some cases, the bidirectional contexts may comprise at least one forward local context. In some further cases, the bidirectional contexts may comprise at least one backward local context. In some other cases, the bidirectional contexts may comprise at least one forward local context and at least one backward local context. In some still further cases, the bidirectional contexts may comprise a subset of the at least one forward local context and the at least one backward local context. By using both forward and backward local contexts, the method may exploit temporal correlations from both directions, which may provide more comprehensive temporal priors for the current frame.

[0066] In some cases, the at least one forward local context may comprise a first forward local context determined based on a forward reference frame of the current frame, and the first forward local context may be used for applying motion compensation on the current frame. By using the first forward local context for motion compensation, the method may provide more accurate temporal prediction for the current frame. In some cases, the first forward local context may be determined by applying a warping operation on at least one forward propagated feature and a motion vector for the current frame.

[0067] In some cases, the first forward local context may comprise a single-scale forward local context at a scale determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents the single-scale forward local context at the scale from the forward reference frame to the current frame,  represents the warping operation,  represents the forward propagated feature at the scale corresponding to the forward reference frame represents a reconstructed motion vector from the forward reference frame to the current frame. For example,  may be 0, 1, 2 or the like.

[0068] In the context of the present disclosure, scales 0, 1, and 2 correspond to different spatial resolution levels in a multi-scale feature representation. Scale 0 typically represents the highest resolution (or finest) feature map, whose spatial dimensions are same as or closest to those of the original frame. Scale 1 represents a medium resolution feature map, whose spatial dimensions are downsampled relative to scale 0 (e.g., reduced by a factor of 2) . Scale 2 represents the lowest resolution (or coarsest) feature map, whose spatial dimensions are further downsampled. For example, for an input frame with a resolution of 960×540, the feature map at scale 0 may have a spatial size of 960×540, the feature map at scale 1 may have a spatial size of 480×270, and the feature map at scale 2 may have a spatial size of 240×135. As another example, for an input frame with a resolution of 256×256, the feature map at scale 0 may have a spatial size of 128×128, the feature map at scale 1 may have a spatial size of 64×64, and the feature map at scale 2 may have a spatial size of 32×32. By constructing local contexts at multiple scales, the method may capture temporal correlations at different spatial granularities, thereby more comprehensively exploiting temporal priors from reference frames.

[0069] It should be understood that the above examples are described merely for purpose of illustration, and the scope of the present disclosure is not limited thereto. In other examples, two scales or more than three scales may be used to construct multi-scale local contexts. For example, N may be equal to 2, 4, 5, or a larger value, thereby capturing temporal correlations at more spatial resolution levels. The specific number of scales may be adjusted according to the application scenario, computational resources, and coding efficiency requirements.

[0070] In some cases, the first forward local context may comprise multi-scale forward local contexts determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame, l represents a scale of the multi-scale forward local contexts, N represents a predetermined value of the scale l,  represents a set of the multi-scale forward local contexts from the forward reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the forward propagated feature at the scale corresponding to the forward reference frame represents a reconstructed motion vector from the forward reference frame to the current frame. In one example, N may be 2. It should be understand that the value of N is only for illustration, an the disclosure is not limited in this aspect.

[0071] In some cases, the reconstructed motion vector may correspond a motion vector determined from the forward reference frame of the current frame by an optical flow network of the learning-based model, and the motion vector may be encoded into the bitstream.

[0072] In some cases, the at least one forward local context comprises a second forward local context determined based on a first reference frame for a forward reference frame of the current frame, and the second forward local context is used for applying motion compensation on the current frame. By way of example, the current frame refers to the forward reference frame, and the forward reference frame further refers to the first reference frame. Such first reference frame may be a non-adjacent reference frame from a lower hierarchical layer. By incorporating features from lower-layer reference frames, the method may diversify the local contexts and improve the quality of motion compensation, since lower-layer frames are generally assigned higher bit-rates and therefore offer better reconstruction quality.

[0073] In some cases, the second forward local context may be determined based on at least one forward propagated feature and a motion vector from the first reference frame to the current frame. In some further cases, the motion vector may be determined based on a plurality of motion vectors. Additionally or alternatively, the motion vector may be determined by an optical flow network.

[0074] In some cases, the second forward local context may comprise a second single-scale forward local context at a scale l determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame,  represents the second single-scale forward local context at the scale l from the first reference frame to the current frame,  represents the warping operation,  represents the forward propagated feature at the scale l corresponding to the first reference frame,  represents a reconstructed motion vector from the first reference frame to the current frame.

[0075] In some cases, the second forward local context may comprise second multi-scale forward local contexts determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame, N represents a predetermined value of the scale l,  represents a set of the second multi-scale forward local contexts from the first reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the forward propagated feature at the scale l corresponding to the first reference frame,  represents a reconstructed motion vector from the first reference frame to the current frame.

[0076] In some cases, the reconstructed motion vector may correspond to a motion vector  determined from the first reference frame by an optical flow network of the learning-based model, and the motion vector may be encoded into the bitstream.

[0077] In some cases, the motion vector may be determined by accumulating the plurality of motion vectors, and a motion vector from the first reference frame to the current frame may be determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame,  represents the warping operation,  represents a reconstructed motion vector from the forward reference frame to the current frame,  represents a reconstructed motion vector from the first reference frame to the forward reference frame,  represents the motion vector from the first reference frame to the current frame.

[0078] In some cases, the second forward local context may comprise a second single-scale forward local context at a scale l determined as follows: where represents the second single-scale forward local context at the scale l from the first reference frame to the current frame,  represents the forward propagated feature at the scale l corresponding to the first reference frame.

[0079] In some cases, the second forward local context comprises second multi-scale forward local contexts determined as follows: where N represents a predetermined value of the scale l,  represents a set of the second multi-scale forward local contexts from the first reference frame to the current frame with the scale l from 0 to N,  represents the forward propagated feature at the scale l corresponding to the first reference frame.

[0080] In some cases, the at least one backward local context may comprise a first backward local context determined based on a backward reference frame of the current frame, and the first backward local context may be used for applying motion compensation on the current frame. In some further cases, the first backward local context may be determined by applying a warping operation on at least one backward propagated feature and a motion vector for the current frame.

[0081] In some cases, the first backward local context may comprise a single-scale backward local context at a scale  determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents the single-scale backward local context at the scale from the backward reference frame to the current frame,  represents the warping operation,  represents the backward propagated feature at the scale corresponding to the backward reference frame represents a reconstructed motion vector from the backward reference frame to the current frame.

[0082] In some cases, the first backward local context may comprise multi-scale backward local contexts determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame, l represents a scale of the multi-scale backward local contexts, N represents a predetermined value of the scale l,  represents a set of the multi-scale backward local contexts from the backward reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the backward propagated feature at the scale corresponding to the backward reference frame represents a reconstructed motion vector from the backward reference frame to the current frame.

[0083] In some cases, the reconstructed motion vector may correspond a motion vector determined from the backward reference frame of the current frame by an optical flow network of the learning-based model, and the motion vector may be encoded into the bitstream.

[0084] In some cases, the at least one backward local context may comprise a second backward local context determined based on a second reference frame for a backward reference frame of the current frame, and the second backward local context may be used for applying motion compensation on the current frame. By way of example, the current frame refers to the backward reference frame, and the backward reference frame further refers to the second reference frame. Such second reference frame may be a non-adjacent reference frame from a lower hierarchical layer relative to the backward reference frame. By incorporating features from lower-layer backward reference frames, the method may further diversify the backward local contexts.

[0085] In some further cases, the second backward local context may be determined based on at least one backward propagated feature and a motion vector from the second reference frame to the current frame. Furthermore, the motion vector may be determined based on a plurality of motion vectors. In some other cases, the motion vector may be determined by an optical flow network.

[0086] In some cases, the second backward local context may comprise a second single-scale backward local context at a scale l determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents a temporal interval between the backward reference frame and the second reference frame for the backward reference frame,  represents the second single-scale backward local context at the scale l from the second reference frame to the current frame,  represents the warping operation,  represents the backward propagated feature at the scale l corresponding to the second reference frame,  represents a reconstructed motion vector from the second reference frame to the current frame.

[0087] In some cases, the second backward local context may comprise second multi-scale backward local contexts determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents a temporal interval between the backward reference frame and the second reference frame for the backward reference frame, N represents a predetermined value of the scale l,  represents a set of the second multi-scale backward local contexts from the second reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the backward propagated feature at the scale l corresponding to the second reference frame,  represents a reconstructed motion vector from the second reference frame to the current frame.

[0088] In some cases, the reconstructed motion vector may correspond to a motion vector  determined from the second reference frame by an optical flow network of the learning-based model, and the motion vector may be encoded into the bitstream.

[0089] In some cases, the motion vector may be determined by accumulating the plurality of motion vectors, and a motion vector from the second reference frame to the current frame may be determined as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents a temporal interval between the backward reference frame and the second reference frame for the backward reference frame,  represents the warping operation,  represents a reconstructed motion vector from the backward reference frame to the current frame,  represents a reconstructed motion vector from the second reference frame to the backward reference frame,  represents the motion vector from the second reference frame to the current frame.

[0090] In some cases, the second backward local context may comprise a second single-scale backward local context at a scale l determined as follows: where represents the second single-scale backward local context at the scale l from the second reference frame to the current frame,  represents the backward propagated feature at the scale l corresponding to the second reference frame.

[0091] In some cases, the second backward local context may comprise second multi-scale backward local contexts determined as follows: where N represents a predetermined value of the scale l,  represents a set of the second multi-scale backward local contexts from the second reference frame to the current frame with the scale l from 0 to N,  represents the backward propagated feature at the scale l corresponding to the second reference frame.

[0092] In some cases, the bidirectional contexts may comprise a single-scale forward local context and a single-scale backward local context, the single-scale forward local context may be represented as and the single-scale backward local context may be represented as where l represents a scale.

[0093] In some further cases, the bidirectional contexts may comprise a second forward local context and a second backward local context, the second forward local context may be represented as and the second backward local context may be represented as where l represents a scale.

[0094] In some cases, the bidirectional contexts may comprise multi-scale forward local contexts and multi-scale backward local contexts, the multi-scale forward local contexts may be represented as  and the multi-scale backward local contexts may be represented as where l represents a scale, N represents a predetermined value of the scale l. For example, N may be equal to 2.

[0095] In some further cases, the bidirectional contexts may further comprise second multi-scale forward local contexts and second multi-scale backward local contexts, the second multi-scale forward local contexts may be represented as and the second multi-scale backward local contexts may be represented as By combining multi-scale local contexts from both adjacent and non-adjacent reference frames in both forward and backward directions, the method may provide a rich set of temporal priors that capture correlations at multiple spatial resolutions and from multiple temporal distances.

[0096] In some cases, a type of the bidirectional contexts used for the current frame may be determined based on a type of the current frame. In some cases, if only a forward reference frame for the current frame is available, only at least one forward local context may be used as the bidirectional contexts. In some further cases, if only a backward reference frame for the current frame is available, only at least one backward local context may be used as the bidirectional contexts. In some other cases, if both a forward reference frame and a backward reference frame for the current frame are available, at least one forward local context and at least one backward local context may be used as the bidirectional contexts. In some cases, a plurality of the bidirectional contexts may be used for the current frame.

[0097] In some cases, global contexts may be generated based on temporal features from bidirectional reference frames for the current frame. By incorporating global contexts, the method may complement the local contexts and provide a more comprehensive set of temporal priors. In some cases, the global contexts may be generated based on at least one of forward features corresponding to a forward reference frame for the current frame or backward features corresponding to a backward reference frame for the current frame. In some cases, forward global contexts may be generated based on the forward features, and backward global contexts may be generated based on the backward features separately. By generating forward and backward global contexts separately, the method may independently capture non-local correlations from each direction.

[0098] In some cases, the global contexts may be generated based on a feature at a scale l among multi-scale features for the current frame. By way of example rather than limitation, the scale l may equal to 0, 1 or 2. By using lower layer features, the method may reduce computational complexity while still capturing non-local correlations at coarser spatial resolutions. It should be understood that the scale l may equal to other value such as 3 or more, this disclosure does not limited in this aspect.

[0099] In some cases, the global contexts may be generated based on lower layer features at the scales 1 and 2. Alternatively, the global contexts may be generated based on lower layer features at the scale 2.

[0100] In some cases, an attention mechanism may be used to generate the global contexts. The attention mechanism may compare each element in the current frame with all elements in reference frames, based on learned attention-driven similarity, thereby capturing non-local correlations. In some cases, the attention mechanism may comprise a linear attention mechanism. Alternatively, the attention mechanism may comprise a vanilla attention mechanism. It should be understood that, any other resonable attention mechanisms may also be used, for example, the attention mechanism may further comprise multi-head attention mechanism, cross-attention mechanism and so on.

[0101] In some cases, the global contexts may be generated at an encoder side of the learning-based model based on forward features associated with a forward reference frame for the current frame and backward features associated with a backward reference frame for the current frame. In some cases, the global contexts for the encoder side may be generated based on the forward reference frame and the backward reference frame from a lower layer.

[0102] In some cases, a linear attention may be performed between a latent of the current frame and propagated features to generate the global contexts, and the global contexts may be determined as follows: where the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the forward reference frame to the current frame,  represents a backward global context at the scale l from the backward reference frame to the current frame.

[0103] In some cases, the global contexts for the encoder side may be generated based on a first reference frame for the forward reference frame and a second reference frame for the backward reference frame.

[0104] In some cases, a linear attention may be performed between a latent of the current frame and propagated features to generate the global contexts, and the global contexts may be determined as follows: where the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys  and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the first reference frame to the current frame,  represents a backward global context at the scale l from the second reference frame to the current frame.

[0105] In some cases, the global contexts may be generated at a decoder side of the learning-based model based on forward features associated with a forward reference frame of the current frame and backward features associated with a backward reference frame for the current frame. In some cases, the global contexts for the decoder side may be generated based on the forward reference frame and the backward reference frame from a lower layer.

[0106] In some cases, a linear attention may be performed between a decoded latent of the current frame and propagated features to generate the global contexts, and the global contexts may be determined as follows: where the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the forward reference frame to the current frame,  represents a backward global context at the scale l from the backward reference frame to the current frame.

[0107] In some cases, the global contexts for the decoder side may be generated based on a first reference frame for the forward reference frame and a second reference frame for the backward reference frame.

[0108] In some cases, a linear attention may be performed between a decoded latent of the current frame and propagated features to generate the global contexts, and the global contexts may be determined as follows: where the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys  and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the first reference frame to the current frame,  represents a backward global context at the scale l from the second reference frame to the current frame.

[0109] In some cases, features with a scale l in multi-scale features may be used for generating the global contexts. In some cases, generating the global context may be applied at a plurality of scales l, the plurality of scales l may comprise scale 0, 1, 2 or other value. In some cases, the global contexts may be generated based on partial lower-layer multi-scale features. In addition, the partial lower-layer multi-scale features may comprise features at the scale 1 and the scale 2, or features at the scale 2.

[0110] In some cases, a plurality of contexts including local contexts and global contexts may be combined for bidirectional conditional coding of the current frame. It should be understood that, the way to combine a plurality of contexts is not limited in this disclosure. By way of example rather than limitation, a plurality of contexts may be fused or concatenated.

[0111] In the context of learned video compression, conditional coding may refer to a coding paradigm where the encoding and decoding of the current frame are conditioned on contextual information derived from reference frames. Unlike traditional residual coding that directly compresses the difference between the current frame and a predicted frame, conditional coding leverages temporal priors as side information to guide the entropy model and the reconstruction process.

[0112] In one example implementation of bidirectional conditional coding, the contexts used for conditioning may be derived from both forward and backward reference frames. These contexts may include local contexts obtained through motion-compensated warping operations, which capture correlations along explicit motion trajectories, as well as global contexts obtained through attention mechanisms, which capture non-local correlations across frames without relying on geometric motion relationships. By conditioning the coding process on these diverse temporal priors, the entropy model can more accurately estimate the probability distribution of the latent representations, thereby reducing the bit-rate required to encode the current frame. Additionally, the decoder can leverage the same contextual information to improve the quality of the reconstructed frame.

[0113] In some cases of the present disclosure, the bidirectional contexts may refer not only to contexts derived from a forward reference frame and a backward reference frame, but also to contexts derived from two reference frames in the same direction. For example, the bidirectional contexts may include contexts from two forward reference frames, or contexts from two backward reference frames. In such cases, "bidirectional" may be understood as leveraging temporal priors from two different reference frames, without being limited to the requirement that the two reference frames are respectively located in the forward and backward directions relative to the current frame. This flexible definition of bidirectional contexts may accommodate different coding scenarios. For example, when only forward reference frames are available, contexts from two different forward reference frames may be utilized to provide richer temporal priors for the current frame.

[0114] In some cases, the global contexts may be used as a part of the bidirectional conditional coding. In some further cases, the local contexts may be used as a part of the bidirectional conditional coding. In some other cases, the local contexts and the global contexts may be combined, and a result of the combination may be input to the bidirectional conditional coding. In some cases, the local contexts and the global contexts may be combined via a convolutional layer. The combination of local contexts and global contexts in bidirectional conditional coding enables the exploitation of a richer set of temporal priors compared to using either type of context alone. Local contexts provide accurate predictions for regions where motion can be reliably estimated, while global contexts complement local contexts by providing useful information for regions with large motions, occlusions, or newly appearing content. This complementary nature of local and global contexts can lead to improved rate-distortion performance in learned bidirectional video compression.

[0115] According to further cases of the present disclosure, a non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video which is generated by a method performed by an apparatus for video processing. The method comprises: determining bidirectional contexts for a current frame of the video; and generating the bitstream based on the bidirectional contexts with a learning-based model.

[0116] According to still further cases of the present disclosure, a method for storing bitstream of a video is provided. The method comprises: determining bidirectional contexts for a current frame of the video; generating the bitstream based on the bidirectional contexts with a learning-based model; and storing the bitstream in a non-transitory computer-readable recording medium.

[0117] FIG. 23 illustrates a flowchart of a method 2300 for video processing in accordance with implementations of the present disclosure. The method 2300 is implemented during a conversion between a current frame of a video and a bitstream of the video with a learning-based model. As shown in FIG. 23, the method 2300 starts at 2310 where bidirectional contexts for the current frame are determined. In some cases, the bidirectional contexts may comprise local contexts and global contexts of the current frame. Local contexts may capture correlations with explicit motion, while global (non-local) contexts may correspond to similar regions without clear motion trajectories. In some examples, the local contexts may include forward local contexts derived from forward reference frames and backward local contexts derived from backward reference frames. The global contexts may be generated via an attention mechanism, such as a linear attention mechanism, applied to temporal features from bidirectional references. It should be understood that the above examples are described merely for purpose of description. The scope of the present disclosure is not limited in this respect. By way of example rather than limitation, the bidirectional contexts for the current frame may be determined according to a scheme described above with reference to FIG. 22.

[0118] At 2320, the bidirectional contexts are adjusted based on adjustment information for the current frame. In some cases, adjusting the bidirectional contexts may comprise gating the bidirectional contexts or weighting the bidirectional contexts. For example, a gating operation may modulate the magnitude of each context feature based on data-dependent information, while a weighting operation may assign different weights to different context components. Other forms of adjustment, such as scaling, masking, or attention-based reweighting, may also be employed. In some cases, the adjustment information may comprise an adjustment matrix, an adjustment factor, an adjustment feature and / or the like. By way of example rather than limitation, the adjustment matrix may be a two-dimensional matrix having the same spatial dimensions as the context features, the adjustment factor may be a scalar or a per-channel factor, and the adjustment feature may be a learned feature map. Other representations of the adjustment information are also contemplated. In some examples, the bidirectional contexts may be fused into a hybrid context via a network before the adjusting, and the hybrid context may then be adjusted with the adjustment information to obtain a final context. The adjustment may dynamically emphasize beneficial information while suppressing harmful noise in the contexts. It should be understood that the above examples are described merely for purpose of description. The scope of the present disclosure is not limited in this respect.

[0119] At 2330, the conversion is performed based on the adjusted bidirectional contexts. In some cases, the conversion may include encoding the video into the bitstream. Alternatively or additionally, in some cases, the conversion may include decoding the video from the bitstream. In some examples, the conversion may comprise generating the bitstream from the video, and the method 2300 may further comprise storing the bitstream in a non-transitory computer-readable recording medium.

[0120] By determining bidirectional contexts for the current frame, adjusting the bidirectional contexts based on adjustment information, and performing the conversion based on the adjusted bidirectional contexts, the method 2300 can enable more effective exploitation of bidirectional temporal priors. The adjustment of bidirectional contexts can allow the learning-based model to adaptively weight or gate the contexts, thereby suppressing noisy or misleading signals caused by fast motion or occlusion while retaining informative cues. This can lead to improved compression efficiency and enhanced rate-distortion performance in learned video compression.

[0121] In some cases, the bidirectional contexts may be fused into a hybrid context via a network before adjusting the bidirectional contexts. The fusion may combine multiple types of contexts, such as local contexts and global contexts, into a unified representation before the adjustment is applied. This may allow the adjustment to operate on a consolidated context representation, potentially improving the effectiveness of the gating or weighting process.

[0122] In some examples, the bidirectional contexts may comprise local contexts and global contexts of the current frame, and a dimension reduction (DR) network of the learning-based model may be applied to process the local contexts and the global contexts. The local contexts may capture correlations with explicit motion trajectories between frames, while the global contexts may capture non-local correlations across frames without clear motion trajectories. The DR network may reduce the dimensionality of the concatenated local and global contexts to produce the hybrid context. In some cases, the processing of the local contexts and the global contexts at a scale  with the DR network may be represented as: DR where where t represents a time step of the current frame, it represents a temporal interval between the current frame and a reference frame of the current frame,  represents a temporal interval between a forward reference frame of the current frame and a first reference frame for the forward reference frame,  represents a tem-poral interval between a backward reference frame and a second reference frame for the backward reference frame,  represents the local contexts of the current frame at the scale l,  represents local contexts at the scale l from the first reference frame to the current frame,  represents local contexts at the scale l from the forward reference frame to the current frame,  represents local contexts at the scale l from the backward reference frame to the current frame,  represents local contexts at the scale l from the second reference frame to the current frame,  represents the global contexts of the current frame at the scale l,  represents global contexts at the scale l from the first reference frame to the current frame,  represents global contexts at the scale l from the forward reference frame to the current frame,  represents global contexts at the scale l from the backward reference frame to the current frame and  represents global contexts at the scale l from the second reference frame to the current frame. It should be understood that the above examples are described merely for purpose of description. The scope of the present disclosure is not limited in this respect.

[0123] In some cases, the dimension reduction network may be implemented with a convolutional network. For example, one or more convolutional layers may be used to reduce the channel dimension of the concatenated contexts. Other network architectures, such as fully connected layers, depthwise separable convolutions, or attention-based reduction modules, may also be used.

[0124] Additionally, in some cases, the hybrid context may be adjusted with adjustment information to obtain a final context, and adjusting the hybrid context may comprise gating the hybrid context or weighting the hybrid context. The gating or weighting may be performed element-wise, channel-wise, or spatially, depending on the implementation. The resulting final context may then be used in subsequent coding operations.

[0125] In some cases, in an encoding process of the learning-based model, the final context may be used for encoding latents of the current frame, and an adjustment matrix comprised in the adjustment information may be determined based on the latents and contexts of the current frame. The latents may represent multi-scale feature representations of the current frame generated by the context encoder. By computing the adjustment matrix based on both the latents and the contexts, the gating mechanism may assess the relevance of each context feature with respect to the current frame content.

[0126] In one example, a residual block and a sigmoid function may be used to generate the adjustment matrix for a latent of the current frame at a scale l. The sigmoid function may constrain the values of the adjustment matrix to the range [0, 1] , enabling the matrix to act as a soft gate that selectively passes or suppresses context features. In some cases, the adjustment matrix may be determined as follows: where t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0127] Alternatively or in addition, in some cases, a residual block and a rectified linear unit (ReLU) function may be used to generate the adjustment matrix. The ReLU function may constrain the values to be non-negative, allowing the matrix to scale context features without sign reversal. In some cases, the adjustment matrix may be determined as follows: where t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l. Other activation functions, such as tanh, softplus, or learned activation functions, may also be employed.

[0128] In some cases, the adjustment matrix may be used to filter contexts of the current frame to obtain the final context via element-wise multiplication. The element-wise multiplication between the adjustment matrix and the output of the DR network may allow fine-grained, per-element control over which context features are retained and which are suppressed. In some cases, the final context may be obtained as follows: where represents the final context at the scale l, ⊙ represents an element-wise multiplication operation. This may be beneficial for handling regions with fast motion or occlusion where certain context features may be unreliable.

[0129] In some cases, the final context may be used as a prior for conditional coding of the latent of the current frame. The final context, having been filtered through the adjustment process, may serve as a more accurate and reliable prior for entropy modeling and conditional coding, potentially reducing the conditional entropy of the latent representations.

[0130] In some cases, in a decoding process of the learning-based model, the final context may be used for decoding latents of the current frame, and an adjustment matrix comprised in the adjustment information may be determined based on the latents and the contexts of the current frame. The decoding-side adjustment may mirror the encoding-side adjustment, using decoded latents instead of original latents.

[0131] In one example, a residual block and a sigmoid function may be used to generate the adjustment matrix for a latent of the current frame at a scale l on the decoder side. In some cases, the adjustment matrix may be determined as follows: where t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0132] Alternatively or in addition, in some cases, a residual block and a ReLU function may be used to generate the adjustment matrix on the decoder side. In some cases, the adjustment matrix may be determined as follows: where t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0133] In some cases, the adjustment matrix on the decoder side may be used to filter contexts of the current frame to obtain the final context via element-wise multiplication, in a manner analogous to the encoder side. In some cases, the final context may be obtained as follows: wherein represents the final context at the scale l, ⊙ represents an element-wise multiplication operation. It should be understood that the above examples are described merely for purpose of description. The scope of the present disclosure is not limited in this respect.

[0134] In some cases, only the final context generated after the adjusting may be used to fuse with information associated with the current frame in conditional coding of the current frame. This may ensure that the conditional coding operates on the adjusted context rather than the unadjusted context, thereby avoiding the introduction of noise from unreliable context features. In some examples, the information associated with the current frame may comprise at least one of: a reconstructed latent of the current frame in a feature domain or a multi-feature domain; or the current frame in a pixel domain. Other representations of the current frame information are also contemplated.

[0135] In some cases, only a final context at a first scale generated through the adjusting may be used to generate propagated features or a reconstructed frame of the current frame, where a resolution of the first scale is equal to a resolution of the current frame. This may allow the highest-resolution context to be used for frame reconstruction and feature propagation, while lower-scale contexts may be used for other purposes such as entropy modeling.

[0136] In some examples, a feature generation (FG) network of the learning-based model may be used to generate a propagated feature for a subsequent frame to be coded. The propagated feature may serve as a reference for coding subsequent frames in the video sequence. In some cases, the feature generation network may be implemented with a convolutional network, and the propagated feature and the reconstructed frame may be determined based on the decoded latent at the first scale and the final context at the first scale. In some cases, the propagated feature and the reconstructed frame may be determined as follows: wherein represents a latent of the current frame at the first scale, FG (·) represents processing with the feature generation network, W represents a convolutional weight. A convolutional weight may be applied to the propa-gated feature to generate the reconstructed frame. Other network architectures for feature generation, such as residual networks or transformer-based networks, may also be employed.

[0137] In some cases, conditional coding may be used to generate the adjustment information. The conditional coding may leverage the interaction between the current frame content and the available contexts to produce the adjustment information. In some examples, the adjustment information may be generated by a conditional coding network of the learning-based model based on one of the current frame or a mid-feature of the current frame, and contexts comprising local contexts and global contexts of the current frame. The term “mid-feature” refers to intermediate multi-scale features generated in the encoding process before outputting latents for quantization and entropy coding. The mid-feature comprises features at a full resolution, a half resolution, a quarter resolution and / or the like of the current frame. The conditional coding network may assess the relevance of the contexts with respect to the current frame content and produce adjustment information accordingly. In some cases, a sigmoid function may be applied after the conditional coding network during generation of the adjustment information. Other activation functions may also be used. It should be understood that the above examples are described merely for purpose of description. The scope of the present disclosure is not limited in this respect.

[0138] In some cases, a feature cache may be configured to store features to be referenced by a subsequent frame, and features no longer referenced may be removed from the feature cache. The feature cache may help reduce computational redundancy by reusing pre-computed features across frames, thereby accelerating inference. In some examples, the features stored in the feature cache may comprise at least one of features of the current frame, propagated features, or features in generating the local contexts.

[0139] In some cases, the features stored in the feature cache may comprise forward propagated features and backward propagated features. The forward propagated features may be multi-scale features from a forward reference frame, and the backward propagated features may be multi-scale features from a backward reference frame. In some cases, the forward propagated features and backward propagated features may be represented as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and a reference frame of the current frame,  is the channel number for propagated features with a scale N represents a predetermined value of the scale l, H and W are the height and width of the current frame respec-tively. The features may be in one of a pixel domain, a feature domain, or a multi-feature domain. In some examples, keys and values for generating the global contexts may be stored in the feature cache. In some cases, the keys and the values may be represented as follows: where t represents a time step of the current frame, it represents a temporal interval between the current frame and a reference frame of the current frame,  is the channel number for propagated features with a scale H and W are the height and width of the current frame respectively. By caching the keys and values, the global context generation process may avoid redundant computation of embeddings for reference frames that have been processed previously. Other types of features, such as motion vectors, intermediate network activations, or at-tention maps, may also be stored in the feature cache. It should be understood that the above examples are described merely for purpose of description. The scope of the present disclosure is not limited in this respect.

[0140] According to a further aspect of the present disclosure, a non-transitory computer-readable recording medium is provided. The non-transitory computer-readable recording medium stores a bitstream of a video generated by a method performed by an apparatus for video processing. The method comprises: determining bidirectional contexts for a current frame of the video; adjusting the bidirectional contexts based on adjustment information for the current frame; and generating the bitstream based on the adjusted bidirectional contexts with a learning-based model.

[0141] According to yet a further aspect of the present disclosure, a method for storing a bitstream of a video is provided. The method comprises: determining bidirectional contexts for a current frame of the video; adjusting the bidirectional contexts based on adjustment information for the current frame; generating the bitstream based on the adjusted bidirectional contexts with a learning-based model; and storing the bitstream in a non-transitory computer-readable recording medium.

[0142] According to yet a further aspect of the present disclosure, a computer program for performing any of the above methods when the computer program runs on a computer is provided.

[0143] According to yet a further aspect of the present disclosure, a computer program product tangibly stored in a computer storage medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform any of the above methods is provided.

[0144] In view of the foregoing, the solutions according to some aspects of the present disclosure may advantageously improve coding efficiency and coding quality.

[0145] It should be understood by those of ordinary skill in the art that the operations of the methods disclosed herein are not necessarily presented in any particular order and that performance of some or all of the operations in an alternative order (s) is possible and is contemplated. The operations have been presented in the demonstrated order for ease of description and illustration. Operations may be added, omitted, performed together, and / or performed simultaneously, without departing from the scope of the appended claims. It should also be understood that the illustrated methods may end at any time and need not be performed in their entireties.

[0146] Although the methods and cases of the present disclosure have been described separately above, it should be understood that these features may be combined in any suitable manner without conflict. For example, features described in connection with one case may be combined with features described in connection with another case, unless such combination would result in a contradiction or would be technically infeasible. By way of example rather than limitation, the various context adjustment mechanisms, gating operations, weighting operations, dimension reduction networks, feature generation networks, conditional coding networks, and feature caching strategies described herein may be used individually or in any combination to achieve improved coding efficiency. The scope of the present disclosure encompasses all such combinations of features that are consistent with the principles and objectives described herein.

[0147] Implementations of the present disclosure can be described in view of the following clauses, the features of all of the following clauses can be combined in any reasonable manner. For example, a feature (s) from clause section A, and / or a feature (s) from clause section B can be combined with each other in any suitable manner. The division of the two clause sections A and B are merely for clarity, and therefore should not be construed as limiting the present disclosure in any way.

[0148] Clause A1. A method of video processing, comprising: determining, for a conversion between a current frame of a video and a bitstream of the video with a learning-based model, bidirectional contexts for the current frame; and performing the conversion based on the bidirectional contexts.

[0149] Clause A2. The method of clause A1, wherein the bidirectional contexts comprise at least one forward local context.

[0150] Clause A3. The method of clause A2, wherein the at least one forward local context comprises a first forward local context determined based on a forward reference frame of the current frame, and the first forward local context is used for applying motion compensation on the current frame.

[0151] Clause A4. The method of clause A3, wherein the first forward local context is determined by applying a warping operation on at least one forward propagated feature and a motion vector for the current frame.

[0152] Clause A5. The method of clause A4, wherein the first forward local context comprises a single-scale forward local context at a scale determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents the single-scale forward local context at the scale from the forward reference frame to the current frame,  represents the warping operation,  represents the forward propagated feature at the scale corresponding to the forward reference frame represents a reconstructed motion vector from the forward reference frame to the current frame.

[0153] Clause A6. The method of any of clauses A3-A4, wherein the first forward local context comprises multi-scale forward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame, l represents a scale of the multi-scale forward local contexts, N represents a predetermined value of the scale l,  represents a set of the multi-scale forward local contexts from the forward reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the forward propagated feature at the scale corresponding to the forward reference frame represents a reconstructed motion vector from the forward reference frame to the current frame.

[0154] Clause A7. The method of clause A5 or A6, wherein the reconstructed motion vector corresponds a motion vector determined from the forward reference frame of the current frame by an optical flow network of the learning-based model, and the motion vector is encoded into the bitstream.

[0155] Clause A8. The method of any of clauses A2-A7, wherein the at least one forward local context comprises a second forward local context determined based on a first reference frame for a forward reference frame of the current frame, and the second forward local context is used for applying motion compensation on the current frame.

[0156] Clause A9. The method of clause A8, wherein the second forward local context is determined based on at least one forward propagated feature and a motion vector from the first reference frame to the current frame.

[0157] Clause A10. The method of clause A9, wherein the motion vector is determined based on a plurality of motion vectors.

[0158] Clause A11. The method of any of clauses A9-A10, wherein the motion vector is determined by an optical flow network.

[0159] Clause A12. The method of clause A11, wherein the second forward local context comprises a second single-scale forward local context at a scale l determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame,  represents the second single-scale forward local context at the scale l from the first reference frame to the current frame,  represents the warping operation,  represents the forward propagated feature at the scale l corresponding to the first reference frame,  represents a reconstructed motion vector from the first reference frame to the current frame.

[0160] Clause A13. The method of clause A11, wherein the second forward local context comprises second multi-scale forward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame, N represents a predetermined value of the scale l,  represents a set of the second multi-scale forward local contexts from the first reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the forward propagated feature at the scale l corresponding to the first reference frame,  represents a reconstructed motion vector from the first reference frame to the current frame.

[0161] Clause A14. The method of clause A12 or A13, wherein the reconstructed motion vector  corresponds to a motion vector determined from the first reference frame by an optical flow network of the learning-based model, and the motion vector is encoded into the bitstream.

[0162] Clause A15. The method of clause A10, wherein the motion vector is determined by accumulating the plurality of motion vectors, and a motion vector from the first reference frame to the current frame is determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frame of the current frame,  represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame,  represents the warping operation,  represents a reconstructed motion vector from the forward reference frame to the current frame,  represents a reconstructed motion vector from the first reference frame to the forward reference frame,  represents the motion vector from the first reference frame to the current frame.

[0163] Clause A16. The method of clause A15, wherein the second forward local context comprises a second single-scale forward local context at a scale l determined as follows: wherein represents the second single-scale forward local context at the scale l from the first reference frame to the current frame,  represents the forward propagated feature at the scale l corresponding to the first reference frame.

[0164] Clause A17. The method of clause A15, wherein the second forward local context comprises second multi-scale forward local contexts determined as follows: wherein N represents a predetermined value of the scale l,  represents a set of the second multi-scale forward local contexts from the first reference frame to the current frame with the scale l from 0 to N,  represents the forward propagated feature at the scale l corresponding to the first reference frame.

[0165] Clause A18. The method of any of clauses A1-A17, wherein the bidirectional contexts comprise at least one backward local context.

[0166] Clause A19. The method of clause A18, wherein the at least one backward local context comprises a first backward local context determined based on a backward reference frame of the current frame, and the first backward local context is used for applying motion compensation on the current frame.

[0167] Clause A20. The method of clause A19, wherein the first backward local context is determined by applying a warping operation on at least one backward propagated feature and a motion vector for the current frame.

[0168] Clause A21. The method of clause A20, wherein the first backward local context comprises a single-scale backward local context at a scale determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents the single-scale backward local context at the scale  from the backward reference frame to the current frame,  represents the warping operation,  represents the backward propagated feature at the scale corresponding to the backward reference frame represents a reconstructed motion vector from the backward reference frame to the current frame.

[0169] Clause A22. The method of any of clauses A19-A20, wherein the first backward local context comprises multi-scale backward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame, l represents a scale of the multi-scale backward local contexts, N represents a predetermined value of the scale l,  represents a set of the multi-scale backward local contexts from the backward reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the backward propagated feature at the scale corresponding to the backward reference frame represents a reconstructed motion vector from the backward reference frame to the current frame.

[0170] Clause A23. The method of clause A21 or A22, wherein the reconstructed motion vector corresponds a motion vector determined from the backward reference frame of the current frame by an optical flow network of the learning-based model, and the motion vector is encoded into the bitstream.

[0171] Clause A24. The method of any of clauses A18-A23, wherein the at least one backward local context comprises a second backward local context determined based on a second reference frame for a backward reference frame of the current frame, and the second backward local context is used for applying motion compensation on the current frame.

[0172] Clause A25. The method of clause A24, wherein the second backward local context is determined based on at least one backward propagated feature and a motion vector from the second reference frame to the current frame.

[0173] Clause A26. The method of clause A25, wherein the motion vector is determined based on a plurality of motion vectors.

[0174] Clause A27. The method of any of clauses A25-A26, wherein the motion vector is determined by an optical flow network.

[0175] Clause A28. The method of clause A27, wherein the second backward local context comprises a second single-scale backward local context at a scale l determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents a temporal interval between the backward reference frame and the second reference frame for the backward reference frame,  represents the second single-scale backward local context at the scale l from the second reference frame to the current frame,  represents the warping operation,  represents the backward propagated feature at the scale l corresponding to the second reference frame,  represents a reconstructed motion vector from the second reference frame to the current frame.

[0176] Clause A29. The method of clause A27, wherein the second backward local context comprises second multi-scale backward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents a temporal interval between the backward reference frame and the second reference frame for the backward reference frame, N represents a predetermined value of the scale l,  represents a set of the second multi-scale backward local contexts from the second reference frame to the current frame with the scale l from 0 to N,  represents the warping operation,  represents the backward propagated feature at the scale l corresponding to the second reference frame,  represents a reconstructed motion vector from the second reference frame to the current frame.

[0177] Clause A30. The method of clause A28 or A29, wherein the reconstructed motion vector  corresponds to a motion vector determined from the second reference frame by an optical flow network of the learning-based model, and the motion vector is encoded into the bitstream.

[0178] Clause A31. The method of clause A26, wherein the motion vector is determined by accumulating the plurality of motion vectors, and a motion vector from the second reference frame to the current frame is determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frame of the current frame,  represents a temporal interval between the backward reference frame and the second reference frame for the backward reference frame,  represents the warping operation,  represents a reconstructed motion vector from the backward reference frame to the current frame,  represents a reconstructed motion vector from the second reference frame to the backward reference frame,  represents the motion vector from the second reference frame to the current frame.

[0179] Clause A32. The method of clause A31, wherein the second backward local context comprises a second single-scale backward local context at a scale l determined as follows: wherein represents the second single-scale backward local context at the scale l from the second reference frame to the current frame,  represents the backward propagated feature at the scale l corresponding to the second reference frame.

[0180] Clause A33. The method of clause A31, wherein the second backward local context comprises second multi-scale backward local contexts determined as follows: wherein N represents a predetermined value of the scale l,  represents a set of the second multi-scale backward local contexts from the second reference frame to the current frame with the scale l from 0 to N,  represents the backward propagated feature at the scale l corresponding to the second reference frame.

[0181] Clause A34. The method of any of clauses A1-A33, wherein the bidirectional contexts comprise at least one forward local context and at least one backward local context.

[0182] Clause A35. The method of clause A34, wherein the bidirectional contexts comprise a single-scale forward local context and a single-scale backward local context, the single-scale forward local context is represented as and the single-scale backward local context is represented as wherein l represents a scale.

[0183] Clause A36. The method of clause A34 or A35, wherein the bidirectional contexts comprise a second forward local context and a second backward local context, the second forward local context is represented as and the second backward local context is represented as wherein l represents a scale.

[0184] Clause A37. The method of any of clauses A34-A36, wherein the bidirectional contexts comprise multi-scale forward local contexts and multi-scale backward local contexts, the multi-scale forward local contexts are represented as and the multi-scale backward local contexts are represented as  wherein l represents a scale, N represents a predetermined value of the scale l.

[0185] Clause A38. The method of clause A37, wherein the bidirectional contexts further comprise second multi-scale forward local contexts and second multi-scale backward local contexts, the second multi-scale forward local contexts are represented as and the second multi-scale backward local contexts are represented as

[0186] Clause A39. The method of any of clauses A34-A38, wherein the bidirectional contexts comprise a subset of the at least one forward local context and the at least one backward local context.

[0187] Clause A40. The method of any of clauses A1-A39, wherein a type of the bidirectional contexts used for the current frame is determined based on a type of the current frame.

[0188] Clause A41. The method of clause A40, wherein in accordance with that only a forward reference frame for the current frame is available, only at least one forward local context is used as the bidirectional contexts.

[0189] Clause A42. The method of any of clauses A40-A41, wherein in accordance with that only a backward reference frame for the current frame is available, only at least one backward local context is used as the bidirectional contexts.

[0190] Clause A43. The method of any of clauses A40-A42, wherein in accordance with that both a forward reference frame and a backward reference frame for the current frame are available, at least one forward local context and at least one backward local context are used as the bidirectional contexts.

[0191] Clause A44. The method of any of clauses A1-A43, wherein a plurality of the bidirectional contexts are used for the current frame.

[0192] Clause A45. The method of any of clauses A1-A44, wherein global contexts are generated based on temporal features from bidirectional reference frames for the current frame.

[0193] Clause A46. The method of clause A45, wherein the global contexts are generated based on at least one of forward features corresponding to a forward reference frame for the current frame or backward features corresponding to a backward reference frame for the current frame.

[0194] Clause A47. The method of clause A46, wherein forward global contexts are generated based on the forward features, and backward global contexts are generated based on the backward features separately.

[0195] Clause A48. The method of any of clauses A45-A47, wherein the global contexts are generated based on a feature at a scale l among multi-scale features for the current frame.

[0196] Clause A49. The method of clause A48, wherein the scale l equals to 0, 1 or 2.

[0197] Clause A50. The method of clause A49, wherein the global contexts are generated based on lower layer features at the scales 1 and 2.

[0198] Clause A51. The method of clause A49, wherein the global contexts are generated based on lower layer features at the scale 2.

[0199] Clause A52. The method of any of clauses A45-A51, wherein an attention mechanism is used to generate the global contexts.

[0200] Clause A53. The method of clause A52, wherein the attention mechanism comprises at least one of a linear attention mechanism or a vanilla attention mechanism.

[0201] Clause A54. The method of any of clauses A45-A53, wherein the global contexts are generated at an encoder side of the learning-based model based on forward features associated with a forward reference frame for the current frame and backward features associated with a backward reference frame for the current frame.

[0202] Clause A55. The method of clause A54, wherein the global contexts for the encoder side are generated based on the forward reference frame and the backward reference frame from a lower layer.

[0203] Clause A56. The method of clause A55, wherein a linear attention is performed between a latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latent  at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the forward reference frame to the current frame,  represents a backward global context at the scale l from the backward reference frame to the current frame.

[0204] Clause A57. The method of clause A54, wherein the global contexts for the encoder side are generated based on a first reference frame for the forward reference frame and a second reference frame for the backward reference frame.

[0205] Clause A58. The method of clause A57, wherein a linear attention is performed between a latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys  and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the first reference frame to the current frame,  represents a backward global context at the scale l from the second reference frame to the current frame.

[0206] Clause A59. The method of any of clauses A45-A53, wherein the global contexts are generated at a decoder side of the learning-based model based on forward features associated with a forward reference frame of the current frame and backward features associated with a backward reference frame for the current frame.

[0207] Clause A60. The method of clause A59, wherein the global contexts for the decoder side are generated based on the forward reference frame and the backward reference frame from a lower layer.

[0208] Clause A61. The method of clause A60, wherein a linear attention is performed between a decoded latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the forward reference frame to the current frame,  represents a backward global context at the scale l from the backward reference frame to the current frame.

[0209] Clause A62. The method of clause A59, wherein the global contexts for the decoder side are generated based on a first reference frame for the forward reference frame and a second reference frame for the backward reference frame.

[0210] Clause A63. The method of clause A62, wherein a linear attention is performed between a decoded latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latent at a scale l is embedded into a query aforward propagated feature  and a backward propagated feature are embedded into keys  and values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax operations performed on a column and a row,  represents a forward global context at the scale l from the first reference frame to the current frame,  represents a backward global context at the scale l from the second reference frame to the current frame.

[0211] Clause A64. The method of any of clauses A45-A63, wherein features with a scale l in multi-scale features are used for generating the global contexts.

[0212] Clause A65. The method of clause A64, wherein generating the global context is applied at a plurality of scales l, the plurality of scales l comprise scale 0, 1 or 2.

[0213] Clause A66. The method of any of clauses A45-A64, wherein the global contexts are generated based on partial lower-layer multi-scale features, and the partial lower-layer multi-scale features comprise features at the scale 1 and the scale 2, or features at the scale 2.

[0214] Clause A67. The method of any of clauses A1-A66, wherein a plurality of contexts including local contexts and global contexts are combined for bidirectional conditional coding of the current frame.

[0215] Clause A68. The method of clause A67, wherein the global contexts are used as a part of the bidirectional conditional coding.

[0216] Clause A69. The method of any of clauses A67-A68, wherein the local contexts are used as a part of the bidirectional conditional coding.

[0217] Clause A70. The method of any of clauses A67-A69, wherein the local contexts and the global contexts are combined, and a result of the combination is input to the bidirectional conditional coding.

[0218] Clause A71. The method of clause A70, wherein the local contexts and the global contexts are combined via a convolutional layer.

[0219] Clause A72. The method of any of clauses A1-A71, wherein the conversion includes encoding the video into the bitstream.

[0220] Clause A73. The method of any of clauses A1-A71, wherein the conversion includes decoding the video from the bitstream.

[0221] Clause A74. The method of any of clauses A1-A73, wherein the conversion comprises: generating the bitstream from the video, and the method further comprises: storing the bitstream in a non-transitory computer-readable recording medium.

[0222] Clause A75. An apparatus for video processing comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with any of clauses A1-A74.

[0223] Clause A76. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of clauses A1-A74.

[0224] Clause A77. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of clauses A1-A74.

[0225] Clause A78. A computer program for performing a method in accordance with any of clauses A1-A74 when the computer program runs on a computer.

[0226] Clause A79. A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by an apparatus for video processing, wherein the method comprises: determining bidirectional contexts for a current frame of the video; and generating the bitstream based on the bidirectional contexts with a learning-based model.

[0227] Clause A80. A method for storing a bitstream of a video, comprising: determining bidirectional contexts for a current frame of the video; generating the bitstream based on the bidirectional contexts with a learning-based model; and storing the bitstream in a non-transitory computer-readable recording medium.

[0228] Clause B 1. A method of video processing, comprising: determining, for a conversion between a current frame of a video and a bitstream of the video with a learning-based model, bidirectional contexts for the current frame; and adjusting the bidirectional contexts based on adjustment information for the current frame; and performing the conversion based on the adjusted bidirectional contexts.

[0229] Clause B2. The method of clause B1, wherein adjusting the bidirectional contexts comprises: gating the bidirectional contexts, or weighting the bidirectional contexts.

[0230] Clause B3. The method of any of clauses B1-B2, wherein the adjustment information comprises at least one of an adjustment matrix, an adjustment factor or an adjustment feature.

[0231] Clause B4. The method of any of clauses B1-B3, wherein the bidirectional contexts are fused into a hybrid context via a network before adjusting the bidirectional contexts.

[0232] Clause B5. The method of clause B4, wherein the bidirectional contexts comprise local contexts and global contexts of the current frame, and a dimension reduction (DR) network of the learning-based model is applied to process the local contexts and the global contexts.

[0233] Clause B6. The method of clause B5, wherein the processing of the local contexts and the global contexts at a scale with the DR network is represented as: DR where wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and a reference frame of the current frame,  represents a temporal interval between a forward reference frame of the current frame and a first reference frame for the forward reference frame,  represents a tem-poral interval between a backward reference frame and a second reference frame for the backward reference frame,  represents the local contexts of the current frame at the scale l,  represents local contexts at the scale l from the first reference frame to the current frame,  represents local contexts at the scale l from the forward reference frame to the current frame,  represents local contexts at the scale l from the backward reference frame to the current frame,  represents local contexts at the scale l from the second reference frame to the current frame,  represents the global contexts of the current frame at the scale l,  represents global contexts at the scale l from the first reference frame to the current frame,  represents global contexts at the scale l from the forward reference frame to the current frame,  represents global contexts at the scale l from the backward reference frame to the current frame and  represents global contexts at the scale l from the second reference frame to the current frame.

[0234] Clause B7. The method of any of clauses B5-B6, wherein the dimension reduction network is implemented with a convolutional network.

[0235] Clause B8. The method of any of clauses B4-B7, wherein the hybrid context is adjusted with adjustment information to obtain a final context, and adjusting the hybrid context comprises gating the hybrid context or weighting the hybrid context.

[0236] Clause B9. The method of clause B8, wherein in an encoding process of the learning-based model, the final context is used for encoding latents of the current frame, and an adjustment matrix comprised in the adjustment information is determined based on the latents and contexts of the current frame.

[0237] Clause B 10. The method of clause B9, wherein a residual block and a sigmoid function are used to generate the adjustment matrix for a latent of the current frame at a scale l, and the adjustment matrix is determined as follows: wherein t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0238] Clause B 11. The method of clause B9, wherein a residual block and a rectified linear unit (ReLU) function are used to generate the adjustment matrix for a latent of the current frame at a scale l, and the adjustment matrix is determined as follows: wherein t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0239] Clause B 12. The method of any of clauses B 10-B 11, wherein the adjustment matrix is used to filter contexts of the current frame to obtain the final context as follows: wherein represents the final context at the scale l, ⊙ represents an element-wise multiplication operation.

[0240] Clause B13. The method of any of clauses B8-B 12, wherein the final context is used as a prior for conditional coding of the latent of the current frame.

[0241] Clause B 14. The method of any of clauses B8-B 13, wherein in a decoding process of the learning-based model, the final context is used for decoding latents of the current frame, and an adjustment matrix comprised in the adjustment information is determined based on the latents and the contexts of the current frame.

[0242] Clause B15. The method of clause B14, wherein a residual block and a sigmoid function are used to generate the adjustment matrix for a latent of the current frame at a scale l, and the adjustment matrix is determined as follows: wherein t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0243] Clause B 16. The method of clause B 14, wherein a residual block and a ReLU function are used to generate the adjustment matrix for a latent of the current frame at a scale index l, and the adjustment matrix is determined as follows: wherein t represents a time step of the current frame,  represents the latent of the current frame at the scale l,  represents the adjustment matrix at the scale l,  represents the local contexts of the current frame at the scale l,  represents the global contexts of the current frame at the scale l.

[0244] Clause B 17. The method of any of clauses B 14-B 16, wherein the adjustment matrix is used to filter contexts of the current frame to obtain the final context as follows: wherein represents the final context at the scale l, ⊙ represents an element-wise multiplication operation.

[0245] Clause B 18. The method of any of clauses B8-B17, wherein only the final context generated after the adjusting is used to fuse with information associated with the current frame in conditional coding of the current frame.

[0246] Clause B 19. The method of clause B18, wherein the information associated with the current frame comprises at least one of: a reconstructed latent of the current frame in a feature domain or a multi-feature domain; or the current frame in a pixel domain.

[0247] Clause B20. The method of any of clauses B8-B 19, wherein only a final context at a first scale generated through the adjusting is used to generate propagated features or a reconstructed frame of the current frame, a resolution of the first scale being equal to a resolution of the current frame.

[0248] Clause B21. The method of clause B20, wherein a feature generation network of the learning-based model is used to generate a propagated feature for a subsequent frame to be coded.

[0249] Clause B22. The method of clause B21, wherein the feature generation network is implemented with a convolutional network, and the propagated feature and the reconstructed frame are determined as follows: wherein represents a latent of the current frame at the first scale, FG (·) represents processing with the feature generation network, W represents a convolutional weight.

[0250] Clause B23. The method of any of clauses B 1-B22, wherein conditional coding is used to generate the adjustment information.

[0251] Clause B24. The method of clause B23, wherein the adjustment information is generated by a conditional coding network of the learning-based model based on: one of the current frame or a mid-feature of the current frame, contexts comprising local contexts and global contexts of the current frame.

[0252] Clause B25. The method of clause B24, wherein a sigmoid function is applied after the conditional coding network during generation of the adjustment information.

[0253] Clause B26. The method of any of clauses B 1-B25, wherein a feature cache is configured to store features to be referenced by a subsequent frame, and features no longer needed are removed from the feature cache.

[0254] Clause B27. The method of clause B26, wherein the features stored in the feature cache comprise at least one of features of the current frame, propagated features, or features in generating the local contexts.

[0255] Clause B28. The method of clause B27, wherein the features stored in the feature cache comprise forward propagated features and backward propagated features represented as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and a reference frame of the current frame,  is the channel number for propagated features with a scale N represents a predetermined value of the scale l, H and W are the height and width of the current frame respec-tively, and the features are in one of a pixel domain, a feature domain or a multi-feature domain.

[0256] Clause B29. The method of clause B26, wherein keys and values for generating the global contexts are stored in the feature cache, the keys and the values are represented as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and a reference frame of the current frame,  is the channel number for propagated features with a scale H and W are the height and width of the current frame respectively.

[0257] Clause B30. The method of any of clauses B1-B29, wherein the conversion includes encoding the video into the bitstream.

[0258] Clause B31. The method of any of clauses B1-B29, wherein the conversion includes decoding the video from the bitstream.

[0259] Clause B32. The method of any of clauses B 1-B31, wherein the conversion comprises: generating the bitstream from the video, and the method further comprises: storing the bitstream in a non-transitory computer-readable recording medium.

[0260] Clause B33. An apparatus for video processing comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with any of clauses B1-B32.

[0261] Clause B34. A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of clauses B1-B32.

[0262] Clause B35. A computer program for performing a method in accordance with any of clauses B1-32 when the computer program runs on a computer.

[0263] Clause B36. A computer program product tangibly stored in a computer storage medium and comprising computer-executable instructions that, when executed by a device, cause the device to perform a method in accordance with any of clauses B1-B32.

[0264] Clause B37. A non-transitory computer-readable recording medium storing a bitstream of a video which is generated by a method performed by an apparatus for video processing, wherein the method comprises: determining bidirectional contexts for a current frame of the video; adjusting the bidirectional contexts based on adjustment information for the current frame; and generating the bitstream based on the adjusted bidirectional contexts with a learning-based model.

[0265] Clause B38. A method for storing a bitstream of a video, comprising: determining bidirectional contexts for a current frame of the video; adjusting the bidirectional contexts based on adjustment information for the current frame; generating the bitstream based on the adjusted bidirectional contexts with a learning-based model; and storing the bitstream in a non-transitory computer-readable recording medium. Example Device

[0266] FIG. 24 illustrates a block diagram of a computing device 2400 in which various implementations of the present disclosure can be implemented. The computing device 2400 may be implemented as or included in the source device 110 (or the video encoder 114 or 200) or the destination device 120 (or the video decoder 124 or 300) .

[0267] It would be appreciated that the computing device 2400 shown in FIG. 24 is merely for purpose of illustration, without suggesting any limitation to the functions and scopes of the implementations of the present disclosure in any manner.

[0268] As shown in FIG. 24, the computing device 2400 includes a general-purpose computing device 2400. The computing device 2400 may at least comprise one or more processors or processing units 2410, a memory 2420, a storage unit 2430, one or more communication units 2440, one or more input devices 2450, and one or more output devices 2460.

[0269] In some implementations, the computing device 2400 may be implemented as any user terminal or server terminal having the computing capability. The server terminal may be a server, a large-scale computing device or the like that is provided by a service provider. The user terminal may for example be any type of mobile terminal, fixed terminal, or portable terminal, including a mobile phone, station, unit, device, multimedia computer, multimedia tablet, Internet node, communicator, desktop computer, laptop computer, notebook computer, netbook computer, tablet computer, personal communication system (PCS) device, personal navigation device, personal digital assistant (PDA) , audio / video player, digital camera / video camera, positioning device, television receiver, radio broadcast receiver, E-book device, gaming device, or any combination thereof, including the accessories and peripherals of these devices, or any combination thereof. It would be contemplated that the computing device 2400 can support any type of interface to a user (such as “wearable” circuitry and the like) .

[0270] The processing unit 2410 may be a physical or virtual processor and can implement various processes based on programs stored in the memory 2420. In a multi-processor system, multiple processing units execute computer executable instructions in parallel so as to improve the parallel processing capability of the computing device 2400. The processing unit 2410 may also be referred to as a central processing unit (CPU) , a microprocessor, a controller or a microcontroller.

[0271] The computing device 2400 typically includes various computer storage medium. Such medium can be any medium accessible by the computing device 2400, including, but not limited to, volatile and non-volatile medium, or detachable and non-detachable medium. The memory 2420 can be a volatile memory (for example, a register, cache, Random Access Memory (RAM) ) , a non-volatile memory (such as a Read-Only Memory (ROM) , Electrically Erasable Programmable Read-Only Memory (EEPROM) , or a flash memory) , or any combination thereof. The storage unit 2430 may be any detachable or non-detachable medium and may include a machine-readable medium such as a memory, flash memory drive, magnetic disk or another other media, which can be used for storing information and / or data and can be accessed in the computing device 2400.

[0272] The computing device 2400 may further include additional detachable / non-detachable, volatile / non-volatile memory medium. Although not shown in FIG. 24, it is possible to provide a magnetic disk drive for reading from and / or writing into a detachable and non-volatile magnetic disk and an optical disk drive for reading from and / or writing into a detachable non-volatile optical disk. In such cases, each drive may be connected to a bus (not shown) via one or more data medium interfaces.

[0273] The communication unit 2440 communicates with a further computing device via the communication medium. In addition, the functions of the components in the computing device 2400 can be implemented by a single computing cluster or multiple computing machines that can communicate via communication connections. Therefore, the computing device 2400 can operate in a networked environment using a logical connection with one or more other servers, networked personal computers (PCs) or further general network nodes.

[0274] The input device 2450 may be one or more of a variety of input devices, such as a mouse, keyboard, tracking ball, voice-input device, and the like. The output device 2460 may be one or more of a variety of output devices, such as a display, loudspeaker, printer, and the like. By means of the communication unit 2440, the computing device 2400 can further communicate with one or more external devices (not shown) such as the storage devices and display device, with one or more devices enabling the user to interact with the computing device 2400, or any devices (such as a network card, a modem and the like) enabling the computing device 2400 to communicate with one or more other computing devices, if required. Such communication can be performed via input / output (I / O) interfaces (not shown) .

[0275] In some implementations, instead of being integrated in a single device, some or all components of the computing device 2400 may also be arranged in cloud computing architecture. In the cloud computing architecture, the components may be provided remotely and work together to implement the functionalities described in the present disclosure. In some implementations, cloud computing provides computing, software, data access and storage service, which will not require end users to be aware of the physical locations or configurations of the systems or hardware providing these services. In various implementations, the cloud computing provides the services via a wide area network (such as Internet) using suitable protocols. For example, a cloud computing provider provides applications over the wide area network, which can be accessed through a web browser or any other computing components. The software or components of the cloud computing architecture and corresponding data may be stored on a server at a remote position. The computing resources in the cloud computing environment may be merged or distributed at locations in a remote data center. Cloud computing infrastructures may provide the services through a shared data center, though they behave as a single access point for the users. Therefore, the cloud computing architectures may be used to provide the components and functionalities described herein from a service provider at a remote location. Alternatively, they may be provided from a conventional server or installed directly or otherwise on a client device.

[0276] The computing device 2400 may be used to implement video encoding / decoding in implementations of the present disclosure. The memory 2420 may include one or more video coding modules 2425 having one or more program instructions. These modules are accessible and executable by the processing unit 2410 to perform the functionalities of the various implementations described herein.

[0277] In the example implementations of performing video encoding, the input device 2450 may receive video data as an input 2470 to be encoded. The video data may be processed, for example, by the video coding module 2425, to generate an encoded bitstream. The encoded bitstream may be provided via the output device 2460 as an output 2480.

[0278] In the example implementations of performing video decoding, the input device 2450 may receive an encoded bitstream as the input 2470. The encoded bitstream may be processed, for example, by the video coding module 2425, to generate decoded video data. The decoded video data may be provided via the output device 2460 as the output 2480.

[0279] While this disclosure has been particularly shown and described with references to example implementations thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application as defined by the appended claims. Such variations are intended to be covered by the scope of this present application. As such, the foregoing description of implementations of the present application is not intended to be limiting.

Claims

1.A method of video processing, comprising:determining, for a conversion between a current frame of a video and a bitstream of the video with a learning-based model, bidirectional contexts for the current frame; andperforming the conversion based on the bidirectional contexts.2.The method of claim 1, wherein the bidirectional contexts comprise at least one forward local context.3.The method of claim 2, wherein the at least one forward local context comprises a first forward local context determined based on a forward reference frame of the current frame, and the first forward local context is used for applying motion compensation on the current frame.4.The method of claim 3, wherein the first forward local context is determined by applying a warping operation on at least one forward propagated feature and a motion vector for the current frame.5.The method of claim 4, wherein the first forward local context comprises a single-scale forward local context at a scale determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frameof the current frame, represents the single-scale forward local context at the scalefrom the forward reference frameto the current frame, represents the warping operation, represents the forward propagated feature at the scalecorrespond-ing to the forward reference framerepresents a reconstructed motion vector from the forward reference frameto the current frame.6.The method of any of claims 3-4, wherein the first forward local context comprises multi-scale for-ward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frameof the current frame, l represents a scale of the multi-scale forward local contexts, N represents a predetermined value of the scale l, represents a set of the multi-scale forward local contexts from the forward reference frameto the current frame with the scale l from 0 to N, represents the warping operation, represents the forward propa-gated feature at the scalecorresponding to the forward reference framerepresents a recon-structed motion vector from the forward reference frameto the current frame.7.The method of claim 5 or 6, wherein the reconstructed motion vector corresponds a motion vector determined from the forward reference frame of the current frame by an op-tical flow network of the learning-based model, and the motion vector is encoded into the bit-stream.8.The method of any of claims 2-7, wherein the at least one forward local context comprises a second forward local context determined based on a first reference frame for a forward reference frame of the current frame, and the second forward local context is used for applying motion compensation on the current frame.9.The method of claim 8, wherein the second forward local context is determined based on at least one forward propagated feature and a motion vector from the first reference frame to the current frame.10.The method of claim 9, wherein the motion vector is determined based on a plurality of motion vectors.11.The method of any of claims 9-10, wherein the motion vector is determined by an optical flow net-work.12.The method of claim 11, wherein the second forward local context comprises a second single-scale forward local context at a scale l determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frameof the current frame, represents a temporal interval between the forward reference frame and the first reference frame for the forward reference frame, represents the second single-scale forward local context at the scale l from the first reference frame to the current frame, represents the warping operation, represents the forward propagated feature at the scale l corresponding to the first reference frame, repre-sents a reconstructed motion vector from the first reference frame to the current frame.13.The method of claim 11, wherein the second forward local context comprises second multi-scale forward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frameof the current frame, represents a temporal interval between the forward reference frameand the first reference frame for the forward reference frame, N represents a predetermined value of the scale l, represents a set of the second multi-scale forward local contexts from the first reference frame to the current frame with the scale l from 0 to N, represents the warping operation, represents the forward propagated feature at the scale l corresponding to the first reference frame, represents a reconstructed motion vector from the first reference frame to the current frame.14.The method of claim 12 or 13, wherein the reconstructed motion vector corre-sponds to a motion vector determined from the first reference frame by an optical flow net-work of the learning-based model, and the motion vector is encoded into the bitstream.15.The method of claim 10, wherein the motion vector is determined by accumulating the plurality of motion vectors, and a motion vector from the first reference frame to the current frame is determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the forward reference frameof the current frame, represents a temporal interval between the forward reference frameand the first reference frame for the forward reference frame, represents the warping operation, represents a reconstructed motion vector from the forward reference frameto the current frame, represents a reconstructed motion vec-tor from the first reference frame to the forward reference frame, represents the motion vector from the first reference frame to the current frame.16.The method of claim 15, wherein the second forward local context comprises a second single-scale forward local context at a scale l determined as follows: whereinrepresents the second single-scale forward local context at the scale l from the first reference frame to the current frame, represents the forward propagated feature at the scale l corresponding to the first reference frame.17.The method of claim 15, wherein the second forward local context comprises second multi-scale forward local contexts determined as follows: wherein N represents a predetermined value of the scale l, represents a set of the second multi-scale forward local contexts from the first reference frame to the current frame with the scale l from 0 to N, represents the forward propagated feature at the scale l corresponding to the first reference frame.18.The method of any of claims 1-17, wherein the bidirectional contexts comprise at least one backward local context.19.The method of claim 18, wherein the at least one backward local context comprises a first backward local context determined based on a backward reference frame of the current frame, and the first backward local context is used for applying motion compensation on the current frame.20.The method of claim 19, wherein the first backward local context is determined by applying a warp-ing operation on at least one backward propagated feature and a motion vector for the current frame.21.The method of claim 20, wherein the first backward local context comprises a single-scale backward local context at a scale determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frameof the current frame, represents the single-scale backward local context at the scalefrom the backward reference frameto the current frame, represents the warping operation, represents the backward propagated feature at the scalecor-responding to the backward reference framerepresents a reconstructed motion vector from the backward reference frameto the current frame.22.The method of any of claims 19-20, wherein the first backward local context comprises multi-scale backward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frameof the current frame, l represents a scale of the multi-scale backward local contexts, N represents a predetermined value of the scale l, represents a set of the multi-scale backward local contexts from the backward reference frameto the current frame with the scale l from 0 to N, represents the warping operation, represents the backward propagated feature at the scalecorresponding to the backward reference framerepresents a reconstructed motion vector from the backward reference frameto the current frame.23.The method of claim 21 or 22, wherein the reconstructed motion vector corresponds a motion vector determined from the backward reference frame of the current frame by an optical flow network of the learning-based model, and the motion vector is encoded into the bit-stream.24.The method of any of claims 18-23, wherein the at least one backward local context comprises a second backward local context determined based on a second reference frame for a backward reference frame of the current frame, and the second backward local context is used for applying motion compensation on the current frame.25.The method of claim 24, wherein the second backward local context is determined based on at least one backward propagated feature and a motion vector from the second reference frame to the current frame.26.The method of claim 25, wherein the motion vector is determined based on a plurality of motion vectors.27.The method of any of claims 25-26, wherein the motion vector is determined by an optical flow network.28.The method of claim 27, wherein the second backward local context comprises a second sin-gle-scale backward local context at a scale l determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frameof the current frame, represents a temporal interval between the backward reference frameand the second reference frame for the backward reference frame, represents the second single-scale backward local context at the scale l from the second reference frame to the current frame, represents the warping operation, represents the backward propagated feature at the scale l corresponding to the second reference frame, represents a reconstructed motion vector from the second reference frame to the current frame.29.The method of claim 27, wherein the second backward local context comprises second multi-scale backward local contexts determined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frameof the current frame, represents a temporal interval between the backward reference frameand the second reference frame for the backward reference frame, N represents a predetermined value of the scale l, represents a set of the second multi-scale backward local contexts from the second reference frame to the current frame with the scale l from 0 to N, represents the warping operation, represents the backward propa-gated feature at the scale l corresponding to the second reference frame, represents a reconstructed motion vector from the second reference frame to the current frame.30.The method of claim 28 or 29, wherein the reconstructed motion vector corre-sponds to a motion vector determined from the second reference frame by an optical flow network of the learning-based model, and the motion vector is encoded into the bitstream.31.The method of claim 26, wherein the motion vector is determined by accumulating the plural-ity of motion vectors, and a motion vector from the second reference frame to the current frame is deter-mined as follows: wherein t represents a time step of the current frame, it represents a temporal interval between the current frame and the backward reference frameof the current frame, represents a temporal interval between the backward reference frameand the second reference frame for the backward reference frame, represents the warping operation, represents a reconstructed motion vector from the backward reference frameto the current frame, represents a reconstructed motion vector from the second reference frame to the backward reference frame, represents the motion vector from the second reference frame to the current frame.32.The method of claim 31, wherein the second backward local context comprises a second sin-gle-scale backward local context at a scale l determined as follows: whereinrepresents the second single-scale backward local context at the scale l from the second reference frame to the current frame, represents the backward propagated feature at the scale l corresponding to the second reference frame.33.The method of claim 31, wherein the second backward local context comprises second multi-scale backward local contexts determined as follows: wherein N represents a predetermined value of the scale l, represents a set of the second multi-scale backward local contexts from the second reference frame to the current frame with the scale l from 0 to N, represents the backward propagated feature at the scale l corresponding to the second reference frame.34.The method of any of claims 1-33, wherein the bidirectional contexts comprise at least one forward local context and at least one backward local context.35.The method of claim 34, wherein the bidirectional contexts comprise a single-scale forward local context and a single-scale backward local context, the single-scale forward local context is repre-sented as and the single-scale backward local context is represented as wherein l repre-sents a scale.36.The method of claim 34 or 35, wherein the bidirectional contexts comprise a second forward local context and a second backward local context, the second forward local context is represented as and the second backward local context is represented as wherein l represents a scale.37.The method of any of claims 34-36, wherein the bidirectional contexts comprise multi-scale forward local contexts and multi-scale backward local contexts, the multi-scale forward local contexts are represented as and the multi-scale backward local contexts are represented as  wherein l represents a scale, N represents a predetermined value of the scale l.38.The method of claim 37, wherein the bidirectional contexts further comprise second multi-scale forward local contexts and second multi-scale backward local contexts, the second multi-scale for-ward local contexts are represented as and the second multi-scale backward local con-texts are represented as 39.The method of any of claims 34-38, wherein the bidirectional contexts comprise a subset of the at least one forward local context and the at least one backward local context.40.The method of any of claims 1-39, wherein a type of the bidirectional contexts used for the current frame is determined based on a type of the current frame.41.The method of claim 40, wherein in accordance with that only a forward reference frame for the current frame is available, only at least one forward local context is used as the bidirectional contexts.42.The method of any of claims 40-41, wherein in accordance with that only a backward reference frame for the current frame is available, only at least one backward local context is used as the bidirec-tional contexts.43.The method of any of claims 40-42, wherein in accordance with that both a forward reference frame and a backward reference frame for the current frame are available, at least one forward local context and at least one backward local context are used as the bidirectional contexts.44.The method of any of claims 1-43, wherein a plurality of the bidirectional contexts are used for the current frame.45.The method of any of claims 1-44, wherein global contexts are generated based on temporal features from bidirectional reference frames for the current frame.46.The method of claim 45, wherein the global contexts are generated based on at least one of forward features corresponding to a forward reference frame for the current frame or backward features corresponding to a backward reference frame for the current frame.47.The method of claim 46, wherein forward global contexts are generated based on the forward features, and backward global contexts are generated based on the backward features separately.48.The method of any of claims 45-47, wherein the global contexts are generated based on a feature at a scale l among multi-scale features for the current frame.49.The method of claim 48, wherein the scale l equals to 0, 1 or 2.50.The method of claim 49, wherein the global contexts are generated based on lower layer features at the scales 1 and 2.51.The method of claim 49, wherein the global contexts are generated based on lower layer features at the scale 2.52.The method of any of claims 45-51, wherein an attention mechanism is used to generate the global contexts.53.The method of claim 52, wherein the attention mechanism comprises at least one of a linear attention mechanism or a vanilla attention mechanism.54.The method of any of claims 45-53, wherein the global contexts are generated at an encoder side of the learning-based model based on forward features associated with a forward reference frame for the current frame and backward features associated with a backward reference frame for the current frame.55.The method of claim 54, wherein the global contexts for the encoder side are generated based on the forward reference frame and the backward reference frame from a lower layer.56.The method of claim 55, wherein a linear attention is performed between a latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latentat a scale l is embedded into a queryaforward propagated feature and a backward propagated featureare embedded into keysand values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax opera-tions performed on a column and a row, represents a forward global context at the scale l from the forward reference frame to the current frame, represents a backward global context at the scale l from the backward reference frame to the current frame.57.The method of claim 54, wherein the global contexts for the encoder side are generated based on a first reference frame for the forward reference frame and a second reference frame for the backward reference frame.58.The method of claim 57, wherein a linear attention is performed between a latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latentat a scale l is embedded into a queryaforward propagated feature and a backward propagated featureare embedded into keysand valuesl represents the scale, SM1 (·) and SM2 (·) repre-sent two independent softmax operations performed on a column and a row, represents a forward global context at the scale l from the first reference frame to the current frame, represents a back-ward global context at the scale l from the second reference frame to the current frame.59.The method of any of claims 45-53, wherein the global contexts are generated at a decoder side of the learning-based model based on forward features associated with a forward reference frame of the current frame and backward features associated with a backward reference frame for the current frame.60.The method of claim 59, wherein the global contexts for the decoder side are generated based on the forward reference frame and the backward reference frame from a lower layer.61.The method of claim 60, wherein a linear attention is performed between a decoded latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latentat a scale l is embedded into a queryaforward propagated feature and a backward propagated featureare embedded into keysand values l represents the scale, SM1 (·) and SM2 (·) represent two independent softmax opera-tions performed on a column and a row, represents a forward global context at the scale l from the forward reference frame to the current frame, represents a backward global context at the scale l from the backward reference frame to the current frame.62.The method of claim 59, wherein the global contexts for the decoder side are generated based on a first reference frame for the forward reference frame and a second reference frame for the backward reference frame.63.The method of claim 62, wherein a linear attention is performed between a decoded latent of the current frame and propagated features to generate the global contexts, and the global contexts are determined as follows: wherein the latentat a scale l is embedded into a queryaforward propagated feature and a backward propagated featureare embedded into keysand valuesl represents the scale, SM1 (·) and SM2 (·) repre-sent two independent softmax operations performed on a column and a row, represents a forward global context at the scale l from the first reference frame to the current frame, represents a back-ward global context at the scale l from the second reference frame to the current frame.64.The method of any of claims 45-63, wherein features with a scale l in multi-scale features are used for generating the global contexts.65.The method of claim 64, wherein generating the global context is applied at a plurality of scales l, the plurality of scales l comprise scale 0, 1 or 2.66.The method of any of claims 45-64, wherein the global contexts are generated based on partial lower-layer multi-scale features, and the partial lower-layer multi-scale features comprise features at the scale 1 and the scale 2, or features at the scale 2.67.The method of any of claims 1-66, wherein a plurality of contexts including local contexts and global contexts are combined for bidirectional conditional coding of the current frame.68.The method of claim 67, wherein the global contexts are used as a part of the bidirectional conditional coding.69.The method of any of claims 67-68, wherein the local contexts are used as a part of the bidirectional conditional coding.70.The method of any of claims 67-69, wherein the local contexts and the global contexts are combined, and a result of the combination is input to the bidirectional conditional coding.71.The method of claim 70, wherein the local contexts and the global contexts are combined via a con-volutional layer.72.The method of any of claims 1-71, wherein the conversion includes encoding the video into the bitstream.73.The method of any of claims 1-71, wherein the conversion includes decoding the video from the bitstream.74.The method of any of claims 1 to 73, wherein the conversion comprises: generating the bitstream from the video, andthe method further comprises: storing the bitstream in a non-transitory computer-readable recording me-dium.75.An apparatus for video processing comprising a processor and a non-transitory memory with instruc-tions thereon, wherein the instructions upon execution by the processor, cause the processor to perform a method in accordance with any of claims 1-74.76.A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of claims 1-74.77.A non-transitory computer-readable storage medium storing instructions that cause a processor to perform a method in accordance with any of claims 1-74.78.A computer program for performing a method in accordance with any of claims 1-74 when the com-puter program runs on a computer.79.A non-transitory computer-readable recording medium storing a bitstream of a video which is gener-ated by a method performed by an apparatus for video processing, wherein the method comprises:determining bidirectional contexts for a current frame of the video; andgenerating the bitstream based on the bidirectional contexts with a learning-based model.80.A method for storing a bitstream of a video, comprising:determining bidirectional contexts for a current frame of the video;generating the bitstream based on the bidirectional contexts with a learning-based model; andstoring the bitstream in a non-transitory computer-readable recording medium.