+

CN113891089B - Method, device and equipment for constructing motion information candidate list - Google Patents

Method, device and equipment for constructing motion information candidate list Download PDF

Info

Publication number
CN113891089B
CN113891089B CN202010637298.2A CN202010637298A CN113891089B CN 113891089 B CN113891089 B CN 113891089B CN 202010637298 A CN202010637298 A CN 202010637298A CN 113891089 B CN113891089 B CN 113891089B
Authority
CN
China
Prior art keywords
motion information
current block
time domain
backward
reference frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010637298.2A
Other languages
Chinese (zh)
Other versions
CN113891089A (en
Inventor
曹小强
陈方栋
王莉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202010637298.2A priority Critical patent/CN113891089B/en
Priority to CN202111150918.0A priority patent/CN114007078B/en
Priority to CN202111153145.1A priority patent/CN113873257B/en
Publication of CN113891089A publication Critical patent/CN113891089A/en
Application granted granted Critical
Publication of CN113891089B publication Critical patent/CN113891089B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本申请提供一种运动信息候选列表的构建方法、装置及其设备,包括:若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。通过本申请提高预测准确性。

Figure 202010637298

The present application provides a method, device and equipment for constructing a motion information candidate list, including: if the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame ; Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion of the time domain adjacent blocks information is not available, and the backward motion information of the neighboring blocks in the time domain is available, then determine the backward motion information in the time domain motion information according to the backward motion information of the neighboring blocks in the time domain; based on the current Time-domain motion information of the block, and constructing a motion information candidate list of the current block. Improve prediction accuracy with this application.

Figure 202010637298

Description

一种运动信息候选列表的构建方法、装置及其设备Method, device and equipment for constructing motion information candidate list

技术领域technical field

本申请涉及编解码领域,尤其是涉及一种运动信息候选列表的构建方法、装置及其设备。The present application relates to the field of encoding and decoding, and in particular relates to a method, device and equipment for constructing a motion information candidate list.

背景技术Background technique

为了达到节约空间的目的,视频图像都是经过编码后才传输的,完整的视频编码可以包括预测、变换、量化、熵编码、滤波等过程。针对预测过程,预测过程可以包括帧内预测和帧间预测,帧间预测是指利用视频时间域的相关性,使用邻近已编码图像的像素预测当前像素,以达到有效去除视频时域冗余的目的。帧内预测是指利用视频空间域的相关性,使用当前帧图像的已编码块的像素预测当前像素,以达到去除视频空域冗余的目的。In order to achieve the purpose of saving space, video images are transmitted after being coded, and complete video coding may include processes such as prediction, transformation, quantization, entropy coding, and filtering. For the prediction process, the prediction process can include intra-frame prediction and inter-frame prediction. Inter-frame prediction refers to using the correlation of the video time domain to predict the current pixel using the pixels of the adjacent encoded image, so as to effectively remove video time domain redundancy. Purpose. Intra-frame prediction refers to using the correlation of the video spatial domain to predict the current pixel using the pixels of the encoded block of the current frame image, so as to achieve the purpose of removing video spatial redundancy.

在帧间预测过程中,通常需要为当前块构建运动信息候选列表,该运动信息候选列表可以包括多个候选运动信息,运动信息候选列表中的候选运动信息,可以为空域运动信息,也可以为时域运动信息。显然,为了构建运动信息候选列表,就需要获取当前块的时域运动信息,相关技术中获取的时域运动信息,存在预测效果不佳,编码性能较差等问题。In the inter-frame prediction process, it is usually necessary to construct a motion information candidate list for the current block. The motion information candidate list may include multiple candidate motion information. The candidate motion information in the motion information candidate list may be spatial motion information or Time domain motion information. Obviously, in order to construct the motion information candidate list, it is necessary to obtain the time-domain motion information of the current block. The time-domain motion information obtained in the related art has problems such as poor prediction effect and poor coding performance.

发明内容Contents of the invention

本申请提供一种运动信息候选列表的构建方法、装置及其设备,提高预测准确性。The present application provides a method, device and equipment for constructing a motion information candidate list, so as to improve prediction accuracy.

本申请提供一种运动信息候选列表的构建方法,所述方法包括:The present application provides a method for constructing a motion information candidate list, the method comprising:

若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame;

基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks If it is not available, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain; based on the current block The time-domain motion information of the current block is constructed to construct a motion information candidate list of the current block.

本申请提供一种运动信息候选列表的构建装置,所述装置包括:The present application provides a device for constructing a motion information candidate list, the device comprising:

确定模块,用于若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;以及,基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则所述确定模块根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;构建模块,用于基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。A determining module, configured to determine the temporal adjacent blocks of the current block from the co-located frame of the current frame if the current frame where the current block is located is a B frame; and determine the current block based on the motion information of the temporal adjacent blocks time domain motion information, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent block is not available, the time domain adjacent block after If the backward motion information is available, the determination module determines the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain; the construction module is used to determine the backward motion information based on the time domain of the current block Motion information, constructing a motion information candidate list of the current block.

本申请提供一种解码端设备,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;The present application provides a decoding device, including: a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;

所述处理器用于执行机器可执行指令,以实现如下步骤:The processor is used to execute machine-executable instructions to implement the following steps:

若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame;

基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks If it is not available, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain; based on the current block The time-domain motion information of the current block is constructed to construct a motion information candidate list of the current block.

本申请提供一种编码端设备,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;The present application provides an encoding device, including: a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor;

所述处理器用于执行机器可执行指令,以实现如下步骤:The processor is used to execute machine-executable instructions to implement the following steps:

若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame;

基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks If it is not available, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain; based on the current block The time-domain motion information of the current block is constructed to construct a motion information candidate list of the current block.

由以上技术方案可见,本申请实施例中,在时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用时,可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息,从而获取当前块的时域运动信息,提高预测的准确性,提高预测性能,提高编码性能,能够使当前块的预测值更加接近原始像素,并带来编码性能的提高。It can be seen from the above technical solutions that in the embodiment of the present application, when the forward motion information of the adjacent blocks in the time domain is not available and the backward motion information of the adjacent blocks in the time domain is available, the backward motion information of the adjacent blocks in the time domain can be used. The motion information determines the backward motion information in the time-domain motion information of the current block, thereby obtaining the time-domain motion information of the current block, improving the accuracy of prediction, improving the prediction performance, improving the coding performance, and making the prediction value of the current block closer to Raw pixels and brings improved encoding performance.

附图说明Description of drawings

图1是视频编码框架的示意图;FIG. 1 is a schematic diagram of a video coding framework;

图2是本申请一种实施方式中的运动信息候选列表的构建方法的流程图;FIG. 2 is a flowchart of a method for constructing a motion information candidate list in an embodiment of the present application;

图3A-图3C是本申请一种实施方式中的时域运动信息的导出示意图;3A-3C are schematic diagrams of deriving time-domain motion information in an embodiment of the present application;

图4A-图4C是本申请一种实施方式中的权重预测角度的示意图;4A-4C are schematic diagrams of weight prediction angles in an embodiment of the present application;

图4D是本申请一种实施方式中的权重预测位置的示意图;FIG. 4D is a schematic diagram of weight prediction positions in an embodiment of the present application;

图4E是本申请一种实施方式中的参考权重值的示意图;FIG. 4E is a schematic diagram of reference weight values in an embodiment of the present application;

图4F是本申请一种实施方式中的当前块的相邻块的示意图;FIG. 4F is a schematic diagram of adjacent blocks of the current block in an embodiment of the present application;

图4G是本申请一种实施方式中的角度分区的示意图;FIG. 4G is a schematic diagram of an angle partition in an embodiment of the present application;

图5A是本申请一种实施方式中的UMVE模式预测过程示意图;FIG. 5A is a schematic diagram of a UMVE model prediction process in an embodiment of the present application;

图5B是本申请一种实施方式中的AFFINE模式预测过程示意图;FIG. 5B is a schematic diagram of the AFFINE model prediction process in an embodiment of the present application;

图6A是本申请一种实施方式中的运动信息候选列表的构建装置的结构示意图;FIG. 6A is a schematic structural diagram of an apparatus for constructing a motion information candidate list in an embodiment of the present application;

图6B是本申请一种实施方式中的解码端设备的硬件结构图;FIG. 6B is a hardware structural diagram of a decoder device in an embodiment of the present application;

图6C是本申请一种实施方式中的编码端设备的硬件结构图。FIG. 6C is a hardware structural diagram of an encoding end device in an implementation manner of the present application.

具体实施方式detailed description

在本申请实施例使用的术语仅仅是出于描述特定实施例的目的,而非限制本申请。本申请实施例和权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其它含义。还应当理解,本文中使用的术语“和/或”是指包含一个或多个相关联的列出项目的任何或所有可能组合。应当理解,尽管在本申请实施例可能采用术语第一、第二、第三等来描述各种信息,但是,这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请实施例范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息,取决于语境。此外,所使用的词语“如果”可以被解释成为“在……时”,或“当……时”,或“响应于确定”。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, rather than limiting the present application. The singular forms of "a", "said" and "the" used in the embodiments and claims of this application are also intended to include plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items. It should be understood that although terms such as first, second, and third may be used in the embodiment of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of the embodiments of the present application, first information may also be called second information, and similarly, second information may also be called first information, depending on the context. Additionally, the use of the word "if" may be construed as "at", or "when", or "in response to determination".

本申请实施例提出一种运动信息候选列表的构建方法、装置及其设备,涉及如下概念:The embodiment of this application proposes a method, device and equipment for constructing a motion information candidate list, involving the following concepts:

视频编码框架:参见图1所示,可以使用视频编码框架实现本申请实施例的编码端处理流程,视频解码框架的示意图与图1类似,在此不再赘述,可以使用视频解码框架实现本申请实施例的解码端处理流程。示例性的,在视频编码框架和视频解码框架中,可以包括但不限于:帧内预测/帧间预测、运动估计/运动补偿、参考图像缓冲器、环内滤波、重建、变换、量化、反变换、反量化、熵编码器等模块。在编码端,通过这些模块之间的配合,可以实现编码端处理流程,在解码端,通过这些模块之间的配合,可以实现解码端处理流程。Video coding framework: see Figure 1, the video coding framework can be used to implement the encoding end processing flow of the embodiment of the application, the schematic diagram of the video decoding framework is similar to Figure 1, and will not be repeated here, and the video decoding framework can be used to implement the application The processing flow of the decoding end of the embodiment. Exemplarily, in the video encoding framework and video decoding framework, it may include but not limited to: intra prediction/inter prediction, motion estimation/motion compensation, reference image buffer, in-loop filtering, reconstruction, transformation, quantization, inversion Transform, inverse quantization, entropy encoder and other modules. At the encoding end, through the cooperation between these modules, the processing flow at the encoding end can be realized, and at the decoding end, through the cooperation between these modules, the processing flow at the decoding end can be realized.

帧内预测(intra prediction):考虑到在图像中,相邻块之间存在很强的空域相关性,因此,可以利用周围已经重建的像素作为参考像素对当前未编码块进行预测,因此,只需要对残差信号(原始信号-预测信号)进行后续编码处理,而不是对原始信号进行编码,有效去除了空域上的冗余,达到去除视频空域冗余的目的,大大提高了视频信号的压缩效率。Intra prediction: Considering that there is a strong spatial correlation between adjacent blocks in the image, the surrounding reconstructed pixels can be used as reference pixels to predict the current unencoded block. Therefore, only It is necessary to perform subsequent encoding processing on the residual signal (original signal-predicted signal), instead of encoding the original signal, which effectively removes the redundancy in the spatial domain, achieves the purpose of removing video spatial redundancy, and greatly improves the compression of the video signal efficiency.

帧间预测(inter prediction):基于视频时间域的相关性,由于视频序列包含较强的时域相关性,使用邻近已编码图像像素预测当前图像的像素,达到有效去除视频时域冗余的目的。Inter prediction (inter prediction): Based on the correlation of the video time domain, since the video sequence contains strong temporal correlation, the pixels of the current image are predicted by using the pixels of the adjacent encoded image, so as to effectively remove the redundancy of the video time domain .

变换:将以空间域中像素形式描述的图像转换至变换域,以变换系数加以表示。由于大多数图像都含有较多平坦区域和缓慢变化区域,变换可以使图像能量在空间域的分散分布转换为变换域的相对集中分布,去除信号间的频域相关性,配合量化过程,可以有效压缩码流。Transform: Convert an image described in the form of pixels in the spatial domain to the transform domain, expressed in terms of transform coefficients. Since most images contain more flat areas and slowly changing areas, transformation can convert the scattered distribution of image energy in the spatial domain into a relatively concentrated distribution in the transformed domain, remove the frequency domain correlation between signals, and cooperate with the quantization process to effectively Compressed stream.

熵编码:按照信息熵的原理进行的无损编码方式,将一系列用来表示视频序列的元素符号转变为用来传输或存储的二进制码流,输入的符号可能包括量化后的变换系数、运动矢量信息、预测模式信息,变换量化相关语法等。输出数据即原始视频压缩后的最终码流。熵编码可以有效地去除这些视频元素符号的统计冗余,是保证视频编码压缩效率的重要工具之一。Entropy coding: A lossless coding method based on the principle of information entropy, which converts a series of element symbols used to represent video sequences into binary code streams for transmission or storage. The input symbols may include quantized transformation coefficients and motion vectors Information, prediction mode information, transform and quantization related syntax, etc. The output data is the final code stream after the original video compression. Entropy coding can effectively remove the statistical redundancy of these video element symbols, and is one of the important tools to ensure the compression efficiency of video coding.

运动矢量(Motion Vector,MV):在帧间预测中,可以使用运动矢量表示当前帧的当前块与参考帧的参考块之间的相对位移。每个划分的块都有相应的运动矢量传送到解码端,如果对每个块的运动矢量进行独立编码和传输,特别是小尺寸的大量块,则消耗很多比特。为降低用于编码运动矢量的比特数,可以利用相邻块之间的空间相关性,根据相邻已编码块的运动矢量对当前块的运动矢量进行预测,然后对预测差进行编码,这样可以有效降低表示运动矢量的比特数。在对当前块的运动矢量进行编码时,可以先使用相邻已编码块的运动矢量预测当前块的运动矢量,然后对该运动矢量的预测值(MVP,Motion VectorPrediction)与运动矢量的真正估值之间的差值(MVD,Motion Vector Difference)进行编码。Motion Vector (Motion Vector, MV): In inter-frame prediction, the motion vector can be used to represent the relative displacement between the current block of the current frame and the reference block of the reference frame. Each divided block has a corresponding motion vector transmitted to the decoder. If the motion vector of each block is encoded and transmitted independently, especially for a large number of small-sized blocks, a lot of bits will be consumed. In order to reduce the number of bits used to encode the motion vector, the spatial correlation between adjacent blocks can be used to predict the motion vector of the current block according to the motion vector of the adjacent encoded block, and then encode the prediction difference, which can Effectively reduces the number of bits representing motion vectors. When encoding the motion vector of the current block, the motion vector of the adjacent coded block can be used to predict the motion vector of the current block, and then the predicted value of the motion vector (MVP, Motion VectorPrediction) and the real estimate of the motion vector The difference (MVD, Motion Vector Difference) between them is encoded.

运动信息(Motion Information):由于运动矢量表示当前块与某个参考块之间的位置偏移,为了准确的获取指向块的信息,除了运动矢量,还需要参考帧图像的索引信息来表示当前块使用哪个参考帧图像。在视频编码技术中,对于当前帧,通常可以建立一个参考帧图像列表,参考帧图像索引信息则表示当前块采用了参考帧图像列表中的第几个参考帧图像。Motion Information: Since the motion vector represents the position offset between the current block and a reference block, in order to accurately obtain the information pointing to the block, in addition to the motion vector, the index information of the reference frame image is also required to represent the current block Which reference frame image to use. In video coding technology, for the current frame, a reference frame image list can usually be established, and the reference frame image index information indicates which reference frame image in the reference frame image list is used for the current block.

示例性的,很多编码技术还支持多个参考图像列表,因此,还可以使用一个索引值来表示使用了哪一个参考图像列表,这个索引值可以称为参考方向。综上所述,在视频编码技术中,可以将运动矢量,参考帧索引,参考方向等与运动相关的信息统称为运动信息。Exemplarily, many encoding technologies also support multiple reference picture lists, therefore, an index value may also be used to indicate which reference picture list is used, and this index value may be called a reference direction. To sum up, in the video coding technology, information related to motion, such as a motion vector, a reference frame index, and a reference direction, may be collectively referred to as motion information.

Skip模式(跳过模式)和Direct模式(直接模式):在帧间预测过程中,由于视频存在很强的时域相关性,即相邻两帧图像有很多相似块,当前帧的当前块往往在相邻参考图像中进行运动搜索,找到与当前块最匹配的块作为参考块。由于参考块与当前块相似度高,两者的差值非常小,因此,编码差值的码率开销通常远小于编码当前块像素值带来的码率开销。Skip mode (skip mode) and Direct mode (direct mode): In the inter-frame prediction process, due to the strong temporal correlation of video, that is, there are many similar blocks in two adjacent frames of images, the current block of the current frame is often Motion search is performed in adjacent reference images, and the block that best matches the current block is found as a reference block. Due to the high similarity between the reference block and the current block, the difference between the two is very small. Therefore, the code rate overhead of encoding the difference value is usually much smaller than the code rate overhead of encoding the pixel value of the current block.

为了表示与当前块最匹配块的位置,需要编码很多运动信息传递到解码端,使得解码端知晓最匹配块的位置。而运动信息,尤其是运动矢量,需要消耗非常多的码率进行传递。为了节省这部分码率开销,设计了比较节省运动信息的特殊模式:Skip模式和Direct模式。In order to indicate the position of the block that best matches the current block, a lot of motion information needs to be encoded and sent to the decoder, so that the decoder knows the position of the best match block. The motion information, especially the motion vector, needs to consume a lot of code rate for transmission. In order to save this bit rate overhead, special modes that save motion information are designed: Skip mode and Direct mode.

在Skip模式和Direct模式下,当前块的运动信息完全复用时域或空域某个相邻块的运动信息,即,从周围多个块的运动信息集合中,选择一个运动信息作为当前块的运动信息。In Skip mode and Direct mode, the motion information of the current block fully reuses the motion information of a neighboring block in the time domain or space domain, that is, selects a motion information from the motion information sets of multiple surrounding blocks as the current block. Sports information.

因此,该模式只需要编码一个索引值表示当前块使用运动信息集合中的哪个运动信息,而Skip模式和Direct模式之间的区别在于:Skip模式不需要编码残差,Direct模式需要编码残差,Direct模式是一种帧间预测中的直接模式,它需要传输残差信息,解码端通过解析索引即可推导当前块的运动信息,获取运动信息后将预测值加上残差值得到重建值。Therefore, this mode only needs to encode an index value to indicate which motion information in the motion information set the current block uses, and the difference between Skip mode and Direct mode is: Skip mode does not need to encode residuals, Direct mode requires encoding residuals, Direct mode is a direct mode in inter-frame prediction. It needs to transmit residual information. The decoder can derive the motion information of the current block by analyzing the index. After obtaining the motion information, add the predicted value to the residual value to obtain the reconstruction value.

率失真原则(Rate-Distortion Optimized):评价编码效率的有两大指标:码率和PSNR(Peak Signal to Noise Ratio,峰值信噪比),比特流越小,则压缩率越大,PSNR越大,则重建图像质量越好,在模式选择时,判别公式实质上也就是对二者的综合评价。例如,模式对应的代价:J(mode)=D+λ*R,其中,D表示Distortion(失真),通常可以使用SSE指标来进行衡量,SSE是指重建图像块与源图像的差值的均方和;λ是拉格朗日乘子,R就是该模式下图像块编码所需的实际比特数,包括编码模式信息、运动信息、残差等所需的比特总和。在模式选择时,若使用RDO原则去对编码模式做比较决策,通常可以保证编码性能最佳。Rate-Distortion Optimized (Rate-Distortion Optimized): There are two indicators for evaluating coding efficiency: code rate and PSNR (Peak Signal to Noise Ratio, peak signal-to-noise ratio). The smaller the bit stream, the greater the compression rate and the greater the PSNR , the better the quality of the reconstructed image is, the discriminant formula is essentially a comprehensive evaluation of the two when selecting the mode. For example, the cost corresponding to the mode: J(mode)=D+λ*R, where D represents Distortion (distortion), which can usually be measured using the SSE index, and SSE refers to the average difference between the reconstructed image block and the source image Square sum; λ is the Lagrangian multiplier, and R is the actual number of bits required for image block coding in this mode, including the sum of bits required for coding mode information, motion information, residuals, etc. In mode selection, if the RDO principle is used to make comparison decisions on encoding modes, the best encoding performance can usually be guaranteed.

在帧间预测过程中,通常需要为当前块构建运动信息候选列表,该运动信息候选列表可以包括多个候选运动信息,运动信息候选列表中的候选运动信息,可以为空域运动信息,也可以为时域运动信息。显然,为了构建运动信息候选列表,就需要获取当前块的时域运动信息,相关技术中获取的时域运动信息,存在预测效果不佳,编码性能较差等问题。In the inter-frame prediction process, it is usually necessary to construct a motion information candidate list for the current block. The motion information candidate list may include multiple candidate motion information. The candidate motion information in the motion information candidate list may be spatial motion information or Time domain motion information. Obviously, in order to construct the motion information candidate list, it is necessary to obtain the time-domain motion information of the current block. The time-domain motion information obtained in the related art has problems such as poor prediction effect and poor coding performance.

针对上述发现,本实施例中,在时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用时,可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息,从而获取当前块的时域运动信息,提高预测的准确性,提高预测性能,提高编码性能。In view of the above findings, in this embodiment, when the forward motion information of adjacent blocks in time domain is not available and the backward motion information of adjacent blocks in time domain is available, it can be determined according to the backward motion information of adjacent blocks in time domain Forward motion information in the time domain motion information of the current block, determine the backward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain, so as to obtain the time domain motion information of the current block, Improve prediction accuracy, improve prediction performance, and improve encoding performance.

以下结合几个具体实施例,对运动信息候选列表的构建方法进行详细说明。The method for constructing the motion information candidate list will be described in detail below in conjunction with several specific embodiments.

实施例1:参见图2所示,为运动信息候选列表的构建方法的流程示意图,该方法可以应用于解码端(也称为视频解码器)或者编码端(也称为视频编码器),该方法可以包括:Embodiment 1: Referring to FIG. 2 , it is a schematic flowchart of a method for constructing a motion information candidate list. This method can be applied to a decoding end (also called a video decoder) or an encoding end (also called a video encoder). Methods can include:

步骤201,若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出当前块的时域相邻块。Step 201, if the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frames of the current frame.

示例性的,若当前块所在当前帧为B帧,则可以基于当前块的预设位置,从当前帧的同位帧(也可以称为collocated帧)中确定出与该预设位置对应的时域相邻块(也可以称为collocated位置)。Exemplarily, if the current frame where the current block is located is a B frame, based on the preset position of the current block, the time domain corresponding to the preset position can be determined from the co-located frame (also called collocated frame) of the current frame Neighboring blocks (may also be called collocated locations).

示例性的,当前块的预设位置可以根据经验进行配置,对此当前块的预设位置不做限制,比如说,当前块的预设位置可以为:当前块的左上角像素位置,或当前块的右上角像素位置,或当前块的左下角像素位置,或当前块的右下角像素位置,或当前块的中心像素位置等。Exemplarily, the preset position of the current block can be configured according to experience, and there is no restriction on the preset position of the current block. For example, the preset position of the current block can be: the pixel position of the upper left corner of the current block, or the current The upper right pixel position of the block, or the lower left pixel position of the current block, or the lower right pixel position of the current block, or the center pixel position of the current block, etc.

示例性的,同位帧(collocated帧)可以为当前帧的后向参考帧列表中参考帧索引的对应帧,如后向参考帧列表中的参考帧索引为0的对应帧,或,后向参考帧列表中的参考帧索引为1的对应帧,或,后向参考帧列表中的参考帧索引为2的对应帧,对此不做限制。同位帧也可以为当前帧的前向参考帧列表中参考帧索引的对应帧,如前向参考帧列表中的参考帧索引为0的对应帧,或,前向参考帧列表中的参考帧索引为1的对应帧,或,前向参考帧列表中的参考帧索引为2的对应帧,对此不做限制。当然,上述只是几个示例,对此不做限制。Exemplarily, the collocated frame (collocated frame) may be the corresponding frame of the reference frame index in the backward reference frame list of the current frame, such as the corresponding frame whose reference frame index is 0 in the backward reference frame list, or, the backward reference frame The corresponding frame whose reference frame index is 1 in the frame list, or the corresponding frame whose reference frame index is 2 in the backward reference frame list, is not limited. The co-located frame can also be the corresponding frame of the reference frame index in the forward reference frame list of the current frame, such as the corresponding frame whose reference frame index is 0 in the forward reference frame list, or the reference frame index in the forward reference frame list The corresponding frame is 1, or the corresponding frame whose reference frame index in the forward reference frame list is 2 is not limited. Of course, the above are just a few examples, which are not limited.

在一种可能的实现方式中,同位帧的确定方式是,若当前帧为P帧,则当前帧的同位帧是前向参考帧列表(即参考帧列表List0,前向参考帧列表也可以称为参考图像队列0)中参考帧索引为0的帧,若当前帧为B帧,则当前帧的同位帧是后向参考帧列表(即参考帧列表List1,后向参考帧列表也可以称为参考图像队列1)中参考帧索引为0的帧。In a possible implementation, the way to determine the co-located frame is that if the current frame is a P frame, then the co-located frame of the current frame is a forward reference frame list (that is, the reference frame list List0, and the forward reference frame list can also be called It is the frame whose reference frame index is 0 in the reference image queue (0). If the current frame is a B frame, the co-located frame of the current frame is a backward reference frame list (i.e. reference frame list List1, and the backward reference frame list can also be referred to as The frame whose reference frame index is 0 in the reference image queue 1).

示例性的,关于同位帧(collocated帧)的获取方式,可以是预设的同位帧,如将当前帧的前向参考帧列表中的第一个参考帧作为同位帧,或将当前帧的后向参考帧列表中的第一个参考帧作为同位帧;或者,也可以是导出的同位帧,如将当前帧的前向参考帧列表中与当前帧最近的参考帧作为同位帧,或将当前帧的后向参考帧列表中与当前帧最近的参考帧作为同位帧;或者,还可以是从编码比特流中解析出的参考帧,如针对解码端来说,解码端可以从码流中解析出同位帧的指示信息,并根据同位帧的指示信息确定同位帧。Exemplarily, regarding the acquisition method of the collocated frame, it may be a preset collocated frame, such as using the first reference frame in the forward reference frame list of the current frame as the collocated frame, or using the The first reference frame in the forward reference frame list is used as the co-located frame; or, it can also be an derived co-located frame, such as taking the reference frame closest to the current frame in the forward reference frame list of the current frame as the co-located frame, or using the current The reference frame closest to the current frame in the frame's backward reference frame list is used as the same frame; or, it can also be a reference frame parsed from the coded bit stream. For example, for the decoder, the decoder can parse it from the code stream output the indication information of the co-located frame, and determine the co-located frame according to the indicated information of the co-located frame.

示例性的,collocated位置是同位帧中与当前块的预设位置对应的时域相邻块。Exemplarily, the collocated position is a neighboring block in time domain corresponding to the preset position of the current block in the colocated frame.

步骤202,基于时域相邻块的运动信息确定当前块的时域运动信息,该时域运动信息可以包括前向运动信息和后向运动信息。示例性的,若时域相邻块的前向运动信息不可用,时域相邻块的后向运动信息可用,则根据时域相邻块的后向运动信息确定该时域运动信息中的后向运动信息。Step 202, determine time-domain motion information of the current block based on the motion information of temporal-domain adjacent blocks, and the time-domain motion information may include forward motion information and backward motion information. Exemplarily, if the forward motion information of the adjacent blocks in the time domain is not available, but the backward motion information of the adjacent blocks in the time domain is available, then the backward motion information.

在另一种可能的实施方式中,若时域相邻块的前向运动信息可用,时域相邻块的后向运动信息不可用,则根据时域相邻块的前向运动信息确定该时域运动信息中的前向运动信息,并根据时域相邻块的前向运动信息确定该时域运动信息中的后向运动信息。In another possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is available but the backward motion information of the neighboring blocks in the time domain is not available, the forward motion information in time domain motion information, and determine backward motion information in the time domain motion information according to forward motion information of adjacent blocks in time domain.

在另一种可能的实施方式中,若时域相邻块的前向运动信息可用,时域相邻块的后向运动信息可用,则根据时域相邻块的前向运动信息确定该时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定该时域运动信息中的后向运动信息。In another possible implementation manner, if the forward motion information of the adjacent blocks in the time domain is available and the backward motion information of the adjacent blocks in the time domain is available, then the time domain is determined according to the forward motion information of the adjacent blocks in the time domain. forward motion information in the time domain motion information, and determine the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain.

在另一种可能的实施方式中,若时域相邻块的前向运动信息可用,时域相邻块的后向运动信息可用,则根据时域相邻块的前向运动信息确定该时域运动信息中的前向运动信息,并根据时域相邻块的前向运动信息确定该时域运动信息中的后向运动信息。In another possible implementation manner, if the forward motion information of the adjacent blocks in the time domain is available and the backward motion information of the adjacent blocks in the time domain is available, then the time domain is determined according to the forward motion information of the adjacent blocks in the time domain. forward motion information in the time domain motion information, and determine backward motion information in the time domain motion information according to the forward motion information of adjacent blocks in the time domain.

在另一种可能的实施方式中,若时域相邻块的前向运动信息可用,时域相邻块的后向运动信息不可用,则根据时域相邻块的前向运动信息确定该时域运动信息中的前向运动信息。In another possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is available but the backward motion information of the neighboring blocks in the time domain is not available, the Forward motion information in temporal motion information.

在另一种可能的实施方式中,若时域相邻块的前向运动信息不可用,时域相邻块的后向运动信息可用,则根据时域相邻块的后向运动信息确定该时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定该时域运动信息中的后向运动信息。In another possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is not available, but the backward motion information of the neighboring blocks in the time domain is available, the The forward motion information in the time-domain motion information, and determine the backward motion information in the time-domain motion information according to the backward motion information of the adjacent blocks in the time domain.

在上述实施例中,时域相邻块的运动信息包括时域相邻块的前向运动信息和时域相邻块的后向运动信息。时域相邻块的前向运动信息包括时域相邻块的前向运动矢量和时域相邻块的前向参考帧索引,该前向参考帧索引对应时域相邻块的前向参考帧。时域相邻块的后向运动信息包括时域相邻块的后向运动矢量和时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧。当前块的时域运动信息包括前向运动信息和后向运动信息,时域运动信息中的前向运动信息包括当前块的前向运动矢量和当前块的前向参考帧索引,该前向参考帧索引对应当前块的前向参考帧。当前块的前向参考帧是当前块的前向参考帧列表中的参考帧,如当前块的前向参考帧列表中的参考帧索引为0的参考帧,或当前块的前向参考帧列表中的参考帧索引为1的参考帧,对此不做限制。时域运动信息中的后向运动信息包括当前块的后向运动矢量和当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧。当前块的后向参考帧是当前块的后向参考帧列表中的参考帧,如当前块的后向参考帧列表中的参考帧索引为0的参考帧,或当前块的后向参考帧列表中的参考帧索引为1的参考帧,对此不做限制。In the above embodiments, the motion information of the adjacent blocks in the time domain includes the forward motion information of the adjacent blocks in the time domain and the backward motion information of the adjacent blocks in the time domain. The forward motion information of the neighboring blocks in the temporal domain includes the forward motion vector of the neighboring blocks in the temporal domain and the forward reference frame index of the neighboring blocks in the temporal domain, and the forward reference frame index corresponds to the forward reference frame index of the neighboring blocks in the temporal domain frame. The backward motion information of the temporal adjacent block includes the backward motion vector of the temporal adjacent block and the backward reference frame index of the temporal adjacent block, and the backward reference frame index corresponds to the backward reference of the temporal adjacent block frame. The time-domain motion information of the current block includes forward motion information and backward motion information. The forward motion information in the time-domain motion information includes the forward motion vector of the current block and the forward reference frame index of the current block. The forward reference The frame index corresponds to the forward reference frame of the current block. The forward reference frame of the current block is the reference frame in the forward reference frame list of the current block, such as the reference frame whose reference frame index is 0 in the forward reference frame list of the current block, or the forward reference frame list of the current block The reference frame index in is the reference frame of 1, which is not limited. The backward motion information in the temporal motion information includes the backward motion vector of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the backward reference frame of the current block. The backward reference frame of the current block is the reference frame in the backward reference frame list of the current block, such as the reference frame whose reference frame index is 0 in the backward reference frame list of the current block, or the backward reference frame list of the current block The reference frame index in is the reference frame of 1, which is not limited.

示例性的,根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,可以包括但不限于:基于同位帧与时域相邻块的前向参考帧之间的距离,以及当前帧与当前块的前向参考帧之间的距离,对时域相邻块的前向运动矢量进行伸缩,得到伸缩后的运动矢量,将伸缩后的运动矢量确定为当前块的前向运动矢量;基于当前块的该前向运动矢量和当前块的前向参考帧索引确定当前块的时域运动信息中的前向运动信息。比如说,当前块的时域运动信息中的前向运动信息包括当前块的该前向运动矢量和当前块的前向参考帧索引。Exemplarily, the forward motion information in the time domain motion information of the current block is determined according to the forward motion information of the time domain adjacent blocks, which may include but not limited to: based on the co-located frame and the forward reference frame of the time domain adjacent blocks and the distance between the current frame and the forward reference frame of the current block, stretch the forward motion vector of the adjacent block in the time domain to obtain the stretched motion vector, and determine the stretched motion vector as A forward motion vector of the current block; determining the forward motion information in the temporal motion information of the current block based on the forward motion vector of the current block and the forward reference frame index of the current block. For example, the forward motion information in the temporal motion information of the current block includes the forward motion vector of the current block and the forward reference frame index of the current block.

示例性的,根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息,可以包括但不限于:基于同位帧与时域相邻块的后向参考帧之间的距离,以及当前帧与当前块的后向参考帧之间的距离,对时域相邻块的后向运动矢量进行伸缩,得到伸缩后的运动矢量,将伸缩后的运动矢量确定为当前块的后向运动矢量;基于当前块的该后向运动矢量和当前块的后向参考帧索引确定当前块的时域运动信息中的后向运动信息。比如说,当前块的时域运动信息中的后向运动信息包括当前块的该后向运动矢量和当前块的后向参考帧索引。Exemplarily, the backward motion information in the time domain motion information of the current block is determined according to the backward motion information of the time domain adjacent blocks, which may include but not limited to: based on the co-located frame and the backward reference frame of the time domain adjacent blocks and the distance between the current frame and the backward reference frame of the current block, stretch the backward motion vector of the adjacent block in the time domain to obtain the stretched motion vector, and determine the stretched motion vector as the backward motion vector of the current block; determining the backward motion information in the temporal motion information of the current block based on the backward motion vector of the current block and the backward reference frame index of the current block. For example, the backward motion information in the temporal motion information of the current block includes the backward motion vector of the current block and the backward reference frame index of the current block.

示例性的,根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,可以包括但不限于:基于同位帧与时域相邻块的后向参考帧之间的距离,以及当前帧与当前块的前向参考帧之间的距离,对时域相邻块的后向运动矢量进行伸缩,得到伸缩后的运动矢量,将伸缩后的运动矢量确定为当前块的前向运动矢量;基于当前块的该前向运动矢量和当前块的前向参考帧索引确定当前块的时域运动信息中的前向运动信息。比如说,当前块的时域运动信息中的前向运动信息包括当前块的该前向运动矢量和当前块的前向参考帧索引。Exemplarily, determining the forward motion information in the time domain motion information of the current block according to the backward motion information of the time domain adjacent blocks may include but not limited to: based on the co-located frame and the backward reference frame of the time domain adjacent blocks and the distance between the current frame and the forward reference frame of the current block, stretch the backward motion vector of the adjacent block in the time domain to obtain the stretched motion vector, and determine the stretched motion vector as A forward motion vector of the current block; determining the forward motion information in the temporal motion information of the current block based on the forward motion vector of the current block and the forward reference frame index of the current block. For example, the forward motion information in the temporal motion information of the current block includes the forward motion vector of the current block and the forward reference frame index of the current block.

示例性的,根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息,可以包括但不限于:基于同位帧与时域相邻块的前向参考帧之间的距离,以及当前帧与当前块的后向参考帧之间的距离,对时域相邻块的前向运动矢量进行伸缩,得到伸缩后的运动矢量,将伸缩后的运动矢量确定为当前块的后向运动矢量;基于当前块的该后向运动矢量和当前块的后向参考帧索引确定当前块的时域运动信息中的后向运动信息。比如说,当前块的时域运动信息中的后向运动信息包括当前块的该后向运动矢量和当前块的后向参考帧索引。Exemplarily, the backward motion information in the time domain motion information of the current block is determined according to the forward motion information of the time domain adjacent blocks, which may include but not limited to: based on the co-located frame and the forward reference frame of the time domain adjacent blocks and the distance between the current frame and the backward reference frame of the current block, stretch the forward motion vector of the adjacent block in the time domain to obtain the stretched motion vector, and determine the stretched motion vector as the backward motion vector of the current block; determining the backward motion information in the temporal motion information of the current block based on the backward motion vector of the current block and the backward reference frame index of the current block. For example, the backward motion information in the temporal motion information of the current block includes the backward motion vector of the current block and the backward reference frame index of the current block.

步骤203,基于当前块的时域运动信息,构建当前块的运动信息候选列表。Step 203, based on the temporal motion information of the current block, construct a motion information candidate list of the current block.

由以上技术方案可见,本申请实施例中,在时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用时,可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息,从而获取当前块的时域运动信息,提高预测的准确性,提高预测性能,提高编码性能,能够使当前块的预测值更加接近原始像素,并带来编码性能的提高。It can be seen from the above technical solutions that in the embodiment of the present application, when the forward motion information of the adjacent blocks in the time domain is not available and the backward motion information of the adjacent blocks in the time domain is available, the backward motion information of the adjacent blocks in the time domain can be used. The motion information determines the forward motion information in the time domain motion information of the current block, and determines the backward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain, thereby obtaining the time domain of the current block Motion information improves prediction accuracy, prediction performance, and coding performance, which can make the predicted value of the current block closer to the original pixel and bring about an improvement in coding performance.

实施例2:为了得到当前块的时域运动信息,可以采用如下方式实现:Embodiment 2: In order to obtain the time-domain motion information of the current block, it can be implemented in the following manner:

若当前块所在当前帧为P帧,即当前图像是P图像,采用如下步骤确定时域运动信息:If the current frame where the current block is located is a P frame, that is, the current image is a P image, the following steps are used to determine the temporal motion information:

步骤a1、基于当前块的预设位置,从当前帧的同位帧中确定出与该预设位置对应的时域相邻块,若该时域相邻块的运动信息不可用,则当前块的时域运动信息为零运动信息。Step a1. Based on the preset position of the current block, determine the temporal adjacent block corresponding to the preset position from the co-located frame of the current frame. If the motion information of the temporal adjacent block is not available, the current block's Time domain motion information is zero motion information.

示例性的,该同位帧可以是当前帧的前向参考帧列表中参考索引为0的图像,该前向参考帧列表还可以称为参考图像队列0,即List0。当前块的预设位置可以是左上角亮度样本位置。若时域相邻块的运动信息的参考帧索引为-1,则表示时域相邻块的运动信息不可用。Exemplarily, the co-located frame may be an image whose reference index is 0 in the forward reference frame list of the current frame, and the forward reference frame list may also be referred to as reference image queue 0, that is, List0. The preset position of the current block may be the upper left luminance sample position. If the reference frame index of the motion information of the adjacent blocks in the time domain is -1, it means that the motion information of the adjacent blocks in the time domain is not available.

综上所述,步骤a1还可以表示为:若参考图像队列0中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本(即时域相邻块)所在的时域运动信息存储单元存储的参考帧索引为-1(表示运动信息不可用),则当前块的L0运动矢量MvE0为零矢量,当前块的L0参考索引值RefIdxL0为0,结束时域运动信息导出过程。To sum up, step a1 can also be expressed as: if the luminance sample corresponding to the luminance sample position in the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 0 is located in the temporal domain The reference frame index stored in the information storage unit is -1 (indicating that the motion information is unavailable), then the L0 motion vector MvE0 of the current block is a zero vector, the L0 reference index value RefIdxL0 of the current block is 0, and the time domain motion information derivation process ends.

步骤a2、若时域相邻块的运动信息可用,则当前块的L0参考索引RefIdxL0为0,L0参考索引对应的图像的距离索引记为DistanceIndexL0,L0参考索引对应的图像的块距离记为BlockDistanceL0。时域相邻块的运动矢量记为mvRef(mvRef_x,mvRef_y),时域相邻块所在图像的距离索引记为DistanceIndexCol,运动矢量指向图像的距离索引记为DistanceIndexRef。Step a2, if the motion information of the neighboring blocks in time domain is available, the L0 reference index RefIdxL0 of the current block is 0, the distance index of the image corresponding to the L0 reference index is recorded as DistanceIndexL0, and the block distance of the image corresponding to the L0 reference index is recorded as BlockDistanceL0 . The motion vector of the adjacent block in the time domain is recorded as mvRef (mvRef_x, mvRef_y), the distance index of the image where the adjacent block in the time domain is located is recorded as DistanceIndexCol, and the distance index of the motion vector pointing to the image is recorded as DistanceIndexRef.

示例性的,若参考图像队列0中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本(即时域相邻块)所在的时域运动信息存储单元存储的参考帧索引不为-1,如存储的参考帧索引大于或者等于0,则表示时域相邻块的运动信息可用。Exemplarily, if the reference frame index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block (i.e. adjacent block in the instant domain) is located in the image whose reference index is 0 in the reference image queue 0 If it is not -1, if the stored reference frame index is greater than or equal to 0, it means that the motion information of the neighboring blocks in the time domain is available.

示例性的,当前块的L0参考索引RefIdxL0为0,表示参考图像队列0中的第一个图像,即L0参考索引对应参考图像队列0中的第一个图像。L0参考索引对应的图像的距离索引DistanceIndexL0,表示参考图像队列0中第一个图像的距离索引,如POC(显示顺序)。L0参考索引对应图像的块距离BlockDistanceL0,表示L0参考索引对应图像与当前帧之间的距离,如参考图像队列0中第一个图像的距离索引DistanceIndexL0与当前帧的距离索引的差值。Exemplarily, the L0 reference index RefIdxL0 of the current block is 0, indicating the first image in the reference image queue 0, that is, the L0 reference index corresponds to the first image in the reference image queue 0. The distance index DistanceIndexL0 of the picture corresponding to the L0 reference index indicates the distance index of the first picture in the reference picture queue 0, such as POC (display order). The block distance BlockDistanceL0 of the image corresponding to the L0 reference index indicates the distance between the image corresponding to the L0 reference index and the current frame, such as the difference between the distance index DistanceIndexL0 of the first image in the reference image queue 0 and the distance index of the current frame.

示例性的,在参考图像队列0中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),即时域相邻块的运动矢量。该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。Exemplarily, the L0 motion vector of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image with the reference index 0 in the reference image queue 0 is recorded as mvRef(mvRef_x, mvRef_y) , the motion vector of the adjacent block in the instant domain. The distance index of the image where the motion information storage unit is located is marked as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is marked as DistanceIndexRef.

步骤a3、基于DistanceIndexCol和DistanceIndexRef,可以采用如下方式确定时域相邻块所在的图像与时域相邻块的运动矢量指向的图像之间的距离BlockDistanceRef。Step a3, based on the DistanceIndexCol and DistanceIndexRef, the distance BlockDistanceRef between the image where the temporal adjacent block is located and the image pointed to by the motion vector of the temporal adjacent block can be determined in the following manner.

BlockDistanceRef=DistanceIndexCol–DistanceIndexRefBlockDistanceRef = DistanceIndexCol – DistanceIndexRef

步骤a4、令当前块的L0参考索引RefIdxL0为0,采用如下公式确定当前块的L0运动矢量mvE0(mvE0_x,mvE0_y),而L0参考索引和L0运动矢量就组成当前块的时域运动信息。Step a4: Set the L0 reference index RefIdxL0 of the current block to 0, and determine the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current block using the following formula, and the L0 reference index and the L0 motion vector constitute the time domain motion information of the current block.

mvE0_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14));mvE0_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14));

mvE0_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14))。mvE0_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14)).

在上述公式中,Clip3(-32768,32767),用于将mvE0_x和mvE0_y的取值范围限制在-32768与32767之间,即取值小于-32768时,令mvE0_x和mvE0_y的取值为-32768,取值大于32767时,令mvE0_x和mvE0_y的取值为32767。Sign表示符号函数,Abs表示求绝对值,>>表示右移。mvRef_x表示时域相邻块的水平运动矢量,mvRef_y表示时域相邻块的垂直运动矢量。mvE0_x表示当前块的时域运动信息的水平运动矢量,mvE0_y表示当前块的时域运动信息的垂直运动矢量。BlockDistanceL0和BlockDistanceRef的定义参见上述步骤,在此不在赘述。当然,上述公式中的各数值,还可以根据实际需要进行调整,对此不做限制。In the above formula, Clip3(-32768,32767) is used to limit the value range of mvE0_x and mvE0_y between -32768 and 32767, that is, when the value is less than -32768, let the value of mvE0_x and mvE0_y be -32768 , when the value is greater than 32767, set the values of mvE0_x and mvE0_y to 32767. Sign represents a sign function, Abs represents an absolute value, and >> represents a right shift. mvRef_x represents the horizontal motion vector of the adjacent blocks in the time domain, and mvRef_y represents the vertical motion vector of the adjacent blocks in the time domain. mvE0_x represents the horizontal motion vector of the temporal motion information of the current block, and mvE0_y represents the vertical motion vector of the temporal motion information of the current block. For the definitions of BlockDistanceL0 and BlockDistanceRef, refer to the above steps, and details are not repeated here. Of course, the numerical values in the above formulas can also be adjusted according to actual needs, and there is no limitation on this.

步骤a5、令interPredRefMode的值等于‘PRED_List0’。Step a5, set the value of interPredRefMode equal to 'PRED_List0'.

基于上述各步骤,若当前帧为P帧,就可以得到当前块的时域运动信息。Based on the above steps, if the current frame is a P frame, the temporal motion information of the current block can be obtained.

若当前块所在当前帧为B帧,即当前图像是B图像,采用如下步骤确定时域运动信息:If the current frame where the current block is located is a B frame, that is, the current image is a B image, the following steps are used to determine the temporal motion information:

步骤b1、基于当前块的预设位置,从当前帧的同位帧中确定出与该预设位置对应的时域相邻块,若时域相邻块的前向运动信息不可用,根据MVP方式得到当前块的时域运动信息。Step b1, based on the preset position of the current block, determine the temporal adjacent block corresponding to the preset position from the co-located frame of the current frame, if the forward motion information of the temporal adjacent block is not available, according to the MVP method Get the temporal motion information of the current block.

示例性的,同位帧可以是当前帧的后向参考帧列表中参考索引为0的图像,后向参考帧列表还可以称为参考图像队列1,即List1。当前块的预设位置可以是左上角亮度样本位置。若时域相邻块的运动信息的参考帧索引为-1,则表示时域相邻块的前向运动信息不可用。Exemplarily, the co-located frame may be an image whose reference index is 0 in the backward reference frame list of the current frame, and the backward reference frame list may also be referred to as reference image queue 1, that is, List1. The preset position of the current block may be the upper left luminance sample position. If the reference frame index of the motion information of the adjacent blocks in the time domain is -1, it means that the forward motion information of the adjacent blocks in the time domain is not available.

示例性的,根据MVP方式得到当前块的时域运动信息,可以包括但不限于:以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束运动信息导出过程。Exemplarily, obtaining the temporal motion information of the current block according to the MVP method may include but not limited to: taking the size and position of the coding unit where the current block is located as the size and position of the current block, and using the L0 motion vector predictor obtained according to the MVP and L1 motion vector predictors as the L0 motion vector MvE0 and L1 motion vector MvE1 of the current block respectively, and set the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block to be equal to 0, and end the motion information derivation process.

综上所述,步骤b1还可以表示为:如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引为-1(存储单元存储的是前向运动信息的参考帧索引,参考帧索引为-1表示前向运动信息不可用),则当前块的L0参考索引和L1参考索引均等于0。以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,然后将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束当前块的时域运动信息导出过程。To sum up, step b1 can also be expressed as: if the reference image stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block in the image whose reference index value is 0 in the reference image queue 1 is The frame index is -1 (the storage unit stores the reference frame index of the forward motion information, and the reference frame index is -1 indicating that the forward motion information is not available), then the L0 reference index and L1 reference index of the current block are both equal to 0. The size and position of the coding unit where the current block is located are used as the size and position of the current block, and then the L0 motion vector predictor and the L1 motion vector predictor obtained according to the MVP are respectively used as the L0 motion vector MvE0 and the L1 motion vector MvE1 of the current block, And make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block both equal to 0, and end the time-domain motion information derivation process of the current block.

步骤b2、若该时域相邻块的前向运动信息可用,则当前块的L0参考索引和L1参考索引均可以等于0。L0参考索引对应的图像的距离索引记为DistanceIndexL0,L1参考索引对应的图像的距离索引记为DistanceIndexL1;L0参考索引对应的图像的块距离记为BlockDistanceL0,L1参考索引对应的图像的块距离记为BlockDistanceL1。Step b2, if the forward motion information of the neighboring block in the time domain is available, both the L0 reference index and the L1 reference index of the current block may be equal to 0. The distance index of the image corresponding to the L0 reference index is recorded as DistanceIndexL0, the distance index of the image corresponding to the L1 reference index is recorded as DistanceIndexL1; the block distance of the image corresponding to the L0 reference index is recorded as BlockDistanceL0, and the block distance of the image corresponding to the L1 reference index is recorded as BlockDistanceL1.

示例性的,如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的参考帧索引不为-1,如参考帧索引大于或者等于0,则该时域相邻块的前向运动信息可用。Exemplarily, if the reference frame index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image with a reference index value of 0 in the reference image queue 1 is not -1, such as If the reference frame index is greater than or equal to 0, then the forward motion information of the temporal adjacent block is available.

示例性的,当前块的L0参考索引为0,表示当前块的参考图像队列0中的第一个参考图像,即,L0参考索引对应参考图像队列0中的第一个图像。L0参考索引对应的图像的距离索引DistanceIndexL0,表示参考图像队列0中的第一个图像的距离索引,如第一个图像的POC。L0参考索引对应的图像的块距离BlockDistanceL0,表示L0参考索引对应的图像与当前帧之间的距离,如参考图像队列0中的第一个图像的距离索引与当前帧的距离索引的差值。Exemplarily, the L0 reference index of the current block is 0, indicating the first reference image in the reference image queue 0 of the current block, that is, the L0 reference index corresponds to the first image in the reference image queue 0. The distance index DistanceIndexL0 of the picture corresponding to the L0 reference index indicates the distance index of the first picture in the reference picture queue 0, such as the POC of the first picture. The block distance BlockDistanceL0 of the image corresponding to the L0 reference index indicates the distance between the image corresponding to the L0 reference index and the current frame, such as the difference between the distance index of the first image in the reference image queue 0 and the distance index of the current frame.

示例性的,当前块的L1参考索引为0,表示当前块的参考图像队列1中的第一个图像,即,L1参考索引对应参考图像队列1中的第一个图像。L1参考索引对应的图像的距离索引DistanceIndexL1,表示参考图像队列1中的第一个图像的距离索引,如第一个参考图像的POC。L1参考索引对应的图像的块距离BlockDistanceL1,表示L1参考索引对应的图像与当前帧之间的距离,如参考图像队列1中的第一个图像的距离索引与当前帧的距离索引的差值。Exemplarily, the L1 reference index of the current block is 0, indicating the first image in the reference image queue 1 of the current block, that is, the L1 reference index corresponds to the first image in the reference image queue 1. The distance index DistanceIndexL1 of the image corresponding to the L1 reference index indicates the distance index of the first image in the reference image queue 1, such as the POC of the first reference image. The block distance BlockDistanceL1 of the image corresponding to the L1 reference index indicates the distance between the image corresponding to the L1 reference index and the current frame, such as the difference between the distance index of the first image in the reference image queue 1 and the distance index of the current frame.

步骤b3、将时域相邻块的运动矢量记为mvRef(mvRef_x,mvRef_y),时域相邻块所在的图像的距离索引记为DistanceIndexCol,时域相邻块的运动矢量指向的参考图像的距离索引记为DistanceIndexRef。比如说,在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef(mvRef_x,mvRef_y),即时域相邻块的运动矢量。该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef。基于DistanceIndexCol和DistanceIndexRef,可以采用如下方式确定时域相邻块所在的图像与时域相邻块的运动矢量指向的参考图像之间的距离BlockDistanceRef。Step b3, record the motion vector of the adjacent block in the time domain as mvRef (mvRef_x, mvRef_y), the distance index of the image where the adjacent block in the time domain is located is recorded as DistanceIndexCol, and the distance of the reference image pointed to by the motion vector of the adjacent block in the time domain The index is denoted as DistanceIndexRef. For example, the L0 motion vector of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef(mvRef_x, mvRef_y), Motion vectors of neighboring blocks in the instant domain. The distance index of the image where the motion information storage unit is located is marked as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the motion vector is marked as DistanceIndexRef. Based on the DistanceIndexCol and DistanceIndexRef, the distance BlockDistanceRef between the image where the temporal adjacent block is located and the reference image pointed to by the motion vector of the temporal adjacent block can be determined in the following manner.

BlockDistanceRef=DistanceIndexCol–DistanceIndexRefBlockDistanceRef = DistanceIndexCol – DistanceIndexRef

步骤b4、令当前块的L0参考索引RefIdxL0为0,采用如下公式确定当前块的L0运动矢量mvE0(mvE0_x,mvE0_y),而L0参考索引和L0运动矢量就组成当前块的时域运动信息中的前向运动信息。令当前块的L1参考索引RefIdxL1为0,采用如下公式确定当前块的L1运动矢量mvE1(mvE1_x,mvE1_y),而L1参考索引和L1运动矢量就组成当前块的时域运动信息中的后向运动信息,而该前向运动信息和该后向运动信息就组成当前块的时域运动信息。Step b4, set the L0 reference index RefIdxL0 of the current block to be 0, use the following formula to determine the L0 motion vector mvE0 (mvE0_x, mvE0_y) of the current block, and the L0 reference index and the L0 motion vector constitute the time domain motion information of the current block Forward motion information. Let the L1 reference index RefIdxL1 of the current block be 0, use the following formula to determine the L1 motion vector mvE1(mvE1_x, mvE1_y) of the current block, and the L1 reference index and L1 motion vector constitute the backward motion in the time domain motion information of the current block information, and the forward motion information and the backward motion information constitute the time-domain motion information of the current block.

mvE0_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14))mvE0_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14))

mvE0_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14))mvE0_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL0*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL0*(16384/BlockDistanceRef)))+8192)>>14))

mvE1_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL1*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL1*(16384/BlockDistanceRef)))+8192)>>14))mvE1_x=Clip3(-32768,32767,Sign(mvRef_x*BlockDistanceL1*BlockDistanceRef)*(((Abs(mvRef_x*BlockDistanceL1*(16384/BlockDistanceRef)))+8192)>>14))

mvE1_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL1*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL1*(16384/BlockDistanceRef)))+8192)>>14))mvE1_y=Clip3(-32768,32767,Sign(mvRef_y*BlockDistanceL1*BlockDistanceRef)*(((Abs(mvRef_y*BlockDistanceL1*(16384/BlockDistanceRef)))+8192)>>14))

在上述公式中,各符号的含义可以参见步骤a4,在此不再重复赘述。In the above formula, the meaning of each symbol can be referred to step a4, and will not be repeated here.

基于上述各步骤,若当前帧为B帧,就可以得到当前块的时域运动信息。Based on the above steps, if the current frame is a B frame, the temporal motion information of the current block can be obtained.

在实施例2中,若当前帧为B帧,是以参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动信息作为参考运动信息,而没有考虑参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动信息作为参考运动信息。In Embodiment 2, if the current frame is a B frame, it is L0 of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index is 0 in the reference image queue 1 The motion information is used as the reference motion information, without considering the L1 motion information of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is located as the reference motion information.

实施例3:为了得到当前块的时域运动信息,若当前块所在当前帧为P帧,即当前图像是P图像,则时域运动信息的确定方式参见实施例2,在此不再赘述。若当前块所在当前帧为B帧,即当前图像是B图像,则采用如下步骤确定当前块的时域运动信息。示例性的,P帧是帧间预测中可使用知识图像和显示顺序上过去的图像作为参考图像进行解码的图像。B帧是帧间预测中可使用知识图像,显示顺序上过去的和将来的图像作为参考图像进行解码的图像。Embodiment 3: In order to obtain the temporal motion information of the current block, if the current frame where the current block is located is a P frame, that is, the current image is a P image, then the determination method of the temporal motion information refers to Embodiment 2, which will not be repeated here. If the current frame where the current block is located is a B frame, that is, the current image is a B image, the following steps are used to determine the temporal motion information of the current block. Exemplarily, a P frame is a picture that can be decoded using a knowledge picture and past pictures in display order as reference pictures in inter-frame prediction. A B frame is a knowledge image that can be used in inter prediction, and displays sequentially past and future images as reference images to be decoded.

步骤c1、基于当前块的预设位置,从当前帧的同位帧中确定出与该预设位置对应的时域相邻块,该时域相邻块的运动信息包括前向运动信息和后向运动信息。若时域相邻块的前向运动信息不可用,时域相邻块的后向运动信息不可用,则根据MVP方式得到当前块的时域运动信息。Step c1. Based on the preset position of the current block, determine the temporal adjacent block corresponding to the preset position from the co-located frame of the current frame. The motion information of the temporal adjacent block includes forward motion information and backward motion information. Sports information. If the forward motion information of the neighboring blocks in the time domain is not available, and the backward motion information of the neighboring blocks in the time domain is not available, the time domain motion information of the current block is obtained according to the MVP method.

示例性的,当前帧的同位帧(collocated帧)可以为当前帧的后向参考帧列表中参考帧索引的对应图像(图像也可以称为帧),如后向参考帧列表中的参考帧索引为0的对应图像,也可以为当前帧的前向参考帧列表中参考帧索引的对应图像,如前向参考帧列表中的参考帧索引为0的对应图像,对此同位帧不做限制。为了方便描述,以当前帧的后向参考帧列表中参考索引为0的图像为例,后向参考帧列表还可以称为参考图像队列1,即List1。Exemplarily, the co-located frame (collocated frame) of the current frame may be the corresponding image (image may also be called a frame) of the reference frame index in the backward reference frame list of the current frame, such as the reference frame index in the backward reference frame list The corresponding image of 0 may also be the corresponding image of the reference frame index in the forward reference frame list of the current frame, such as the corresponding image of the reference frame index of 0 in the forward reference frame list, and there is no restriction on this co-located frame. For convenience of description, take the image whose reference index is 0 in the backward reference frame list of the current frame as an example. The backward reference frame list may also be called reference image queue 1, namely List1.

示例性的,当前块的预设位置可以根据经验进行配置,例如,上角亮度样本位置,右上角亮度样本位置,左下角亮度样本位置,右下角亮度样本位置,中心亮度样本位置等,对此预设位置不做限制。为了方便描述,以当前块的左上角亮度样本位置为例。Exemplarily, the preset position of the current block can be configured based on experience, for example, the upper corner luminance sample position, the upper right luminance sample position, the lower left luminance sample position, the lower right luminance sample position, the center luminance sample position, etc. The default position is not limited. For the convenience of description, take the upper-left luminance sample position of the current block as an example.

示例性的,若时域相邻块的前向运动信息的参考帧索引为-1,则表示时域相邻块的前向运动信息不可用。若时域相邻块的前向运动信息的参考帧索引不为-1,如参考帧索引大于或等于0,则表示时域相邻块的前向运动信息可用。若时域相邻块的后向运动信息的参考帧索引为-1,则表示时域相邻块的后向运动信息不可用。若时域相邻块的后向运动信息的参考帧索引不为-1,如参考帧索引大于或等于0,则表示时域相邻块的后向运动信息可用。Exemplarily, if the reference frame index of the forward motion information of the adjacent blocks in the time domain is -1, it means that the forward motion information of the adjacent blocks in the time domain is not available. If the reference frame index of the forward motion information of the neighboring blocks in the time domain is not -1, if the reference frame index is greater than or equal to 0, it means that the forward motion information of the neighboring blocks in the time domain is available. If the reference frame index of the backward motion information of the adjacent blocks in the time domain is -1, it means that the backward motion information of the adjacent blocks in the time domain is not available. If the reference frame index of the backward motion information of the adjacent blocks in the time domain is not -1, if the reference frame index is greater than or equal to 0, it means that the backward motion information of the adjacent blocks in the time domain is available.

示例性的,根据MVP方式得到当前块的时域运动信息,可以包括但不限于如下方式:以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0。Exemplarily, obtaining the time-domain motion information of the current block according to the MVP method may include but not limited to the following methods: using the size and position of the coding unit where the current block is located as the size and position of the current block, the L0 motion vector obtained according to the MVP The predicted value and the L1 motion vector predictor are respectively used as the L0 motion vector MvE0 and the L1 motion vector MvE1 of the current block, and the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block are both equal to 0.

L0运动矢量MvE0和L0参考索引RefIdxL0,组成当前块的时域运动信息中的前向运动信息,L1运动矢量MvE1和L1参考索引RefIdxL1,组成当前块的时域运动信息中的后向运动信息,而该前向运动信息和该后向运动信息就组成当前块的时域运动信息。The L0 motion vector MvE0 and the L0 reference index RefIdxL0 form the forward motion information in the time domain motion information of the current block, the L1 motion vector MvE1 and the L1 reference index RefIdxL1 form the backward motion information in the time domain motion information of the current block, The forward motion information and the backward motion information constitute time-domain motion information of the current block.

L0运动矢量MvE0表示前向运动矢量,L0参考索引RefIdxL0表示前向参考索引,L1运动矢量MvE1表示后向运动矢量,L1参考索引RefIdxL1表示后向参考索引。The L0 motion vector MvE0 indicates a forward motion vector, the L0 reference index RefIdxL0 indicates a forward reference index, the L1 motion vector MvE1 indicates a backward motion vector, and the L1 reference index RefIdxL1 indicates a backward reference index.

步骤c2、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Step c2, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion information of the current block can be determined according to the forward motion information of the neighboring block in the time domain and determine the backward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain.

示例性的,若时域相邻块的前向运动信息的参考帧索引不为-1,如参考帧索引大于或者等于0,则时域相邻块的前向运动信息可用。若时域相邻块的后向运动信息的参考帧索引不为-1,如参考帧索引大于或者等于0,则表示时域相邻块的后向运动信息可用。Exemplarily, if the reference frame index of the forward motion information of the adjacent blocks in the time domain is not -1, if the reference frame index is greater than or equal to 0, then the forward motion information of the adjacent blocks in the time domain is available. If the reference frame index of the backward motion information of the adjacent blocks in the time domain is not -1, if the reference frame index is greater than or equal to 0, it means that the backward motion information of the adjacent blocks in the time domain is available.

时域相邻块的前向运动信息可以包括时域相邻块的前向运动矢量mvRef0(mvRef0_x,mvRef0_y)和时域相邻块的前向参考帧索引,该前向参考帧索引对应时域相邻块的前向参考帧,时域相邻块的后向运动信息包括时域相邻块的后向运动矢量mvRef1(mvRef1_x,mvRef1_y)和时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧。The forward motion information of the neighboring block in the time domain may include the forward motion vector mvRef0(mvRef0_x, mvRef0_y) of the neighboring block in the time domain and the forward reference frame index of the neighboring block in the time domain, and the forward reference frame index corresponds to the time domain The forward reference frame of the adjacent block, the backward motion information of the adjacent block in the time domain includes the backward motion vector mvRef1(mvRef1_x, mvRef1_y) of the adjacent block in the time domain and the backward reference frame index of the adjacent block in the time domain, the The backward reference frame index corresponds to the backward reference frame of the neighboring block in time domain.

当前块的时域运动信息中的前向运动信息包括当前块的前向运动矢量mvE0(mvE0_x,mvE0_y)和当前块的前向参考帧索引,该前向参考帧索引对应当前块的前向参考帧,当前块的前向参考帧是当前块的前向参考帧列表中的参考帧,以当前块的前向参考帧列表中的参考帧索引为0的参考帧为例,即当前块的前向参考帧的参考帧索引(也可以称为L0参考索引)为0,表示当前块的前向参考帧列表(即参考图像队列0)中的第一个图像。当前块的时域运动信息中的后向运动信息包括当前块的后向运动矢量mvE1(mvE1_x,mvE1_y)和当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧,当前块的后向参考帧是当前块的后向参考帧列表中的参考帧,以当前块的后向参考帧列表中的参考帧索引为0的参考帧为例,即当前块的后向参考帧的参考帧索引(也可以称为L1参考索引)为0,表示当前块的后向参考帧列表(即参考图像队列1)中的第一个图像。The forward motion information in the temporal motion information of the current block includes the forward motion vector mvE0(mvE0_x, mvE0_y) of the current block and the forward reference frame index of the current block, which corresponds to the forward reference frame index of the current block frame, the forward reference frame of the current block is the reference frame in the forward reference frame list of the current block, taking the reference frame whose reference frame index is 0 in the forward reference frame list of the current block as an example, that is, the previous frame of the current block The reference frame index of the forward reference frame (also referred to as the L0 reference index) is 0, indicating the first picture in the forward reference frame list (ie reference picture queue 0) of the current block. The backward motion information in the temporal motion information of the current block includes the backward motion vector mvE1 (mvE1_x, mvE1_y) of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the backward reference of the current block frame, the backward reference frame of the current block is the reference frame in the backward reference frame list of the current block, taking the reference frame whose reference frame index is 0 in the backward reference frame list of the current block as an example, that is, the backward reference frame of the current block The reference frame index (also referred to as L1 reference index) of the forward reference frame is 0, indicating the first picture in the backward reference frame list (ie reference picture queue 1) of the current block.

示例性的,可以将当前块的前向参考帧的距离索引(如POC)记为DistanceIndexL0,并将当前块的后向参考帧的距离索引记为DistanceIndexL1,将当前帧与当前块的前向参考帧之间的距离记为BlockDistanceL0,BlockDistanceL0表示当前帧的距离索引与当前块的前向参考帧的距离索引的差值,将当前帧与当前块的后向参考帧之间的距离记为BlockDistanceL1,BlockDistanceL1表示当前帧的距离索引与当前块的后向参考帧的距离索引的差值。Exemplarily, the distance index (such as POC) of the forward reference frame of the current block can be recorded as DistanceIndexL0, and the distance index of the backward reference frame of the current block can be recorded as DistanceIndexL1, and the forward reference frame of the current frame and the current block can be recorded as DistanceIndexL1. The distance between frames is recorded as BlockDistanceL0, BlockDistanceL0 represents the difference between the distance index of the current frame and the distance index of the forward reference frame of the current block, and the distance between the current frame and the backward reference frame of the current block is recorded as BlockDistanceL1, BlockDistanceL1 represents the difference between the distance index of the current frame and the distance index of the backward reference frame of the current block.

示例性的,可以将时域相邻块所在图像(即当前帧的同位帧)的距离索引记为DistanceIndexCol,并将时域相邻块的前向运动矢量mvRef0指向的图像(即时域相邻块的前向参考帧)的距离索引记为DistanceIndexRef0,并将时域相邻块的后向运动矢量mvRef1指向的图像(即时域相邻块的后向参考帧)的距离索引记为DistanceIndexRef1。基于此,可以将该同位帧与该时域相邻块的前向参考帧之间的距离记为BlockDistanceRef0,并将该同位帧与该时域相邻块的后向参考帧之间的距离记为BlockDistanceRef1。Exemplarily, the distance index of the image where the time-domain adjacent block is located (ie, the co-located frame of the current frame) can be recorded as DistanceIndexCol, and the image pointed to by the forward motion vector mvRef0 of the time-domain adjacent block (ie, the time-domain adjacent block The distance index of the forward reference frame) is recorded as DistanceIndexRef0, and the distance index of the image pointed to by the backward motion vector mvRef1 of the adjacent block in the temporal domain (the backward reference frame of the adjacent block in the temporal domain) is recorded as DistanceIndexRef1. Based on this, the distance between the co-located frame and the forward reference frame of the time-domain adjacent block can be recorded as BlockDistanceRef0, and the distance between the co-located frame and the backward reference frame of the time-domain adjacent block can be recorded as for BlockDistanceRef1.

BlockDistanceRef0表示同位帧的距离索引和时域相邻块的前向参考帧的距离索引的差值,例如,可以通过如下公式表示:BlockDistanceRef0=DistanceIndexCol–DistanceIndexRef0。BlockDistanceRef0 represents the difference between the distance index of the co-located frame and the distance index of the forward reference frame of the temporal adjacent block, for example, it can be expressed by the following formula: BlockDistanceRef0=DistanceIndexCol−DistanceIndexRef0.

BlockDistanceRef1表示同位帧的距离索引和时域相邻块的后向参考帧的距离索引的差值,例如,可以通过如下公式表示:BlockDistanceRef1=DistanceIndexCol–DistanceIndexRef1。BlockDistanceRef1 represents the difference between the distance index of the co-located frame and the distance index of the backward reference frame of the temporal adjacent block, for example, it can be expressed by the following formula: BlockDistanceRef1=DistanceIndexCol−DistanceIndexRef1.

基于上述定义,根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,可以包括但不限于:基于同位帧与时域相邻块的前向参考帧之间的距离BlockDistanceRef0,以及当前帧与当前块的前向参考帧之间的距离BlockDistanceL0,对时域相邻块的前向运动矢量mvRef0(mvRef0_x,mvRef0_y)进行伸缩,得到伸缩后的运动矢量,将伸缩后的运动矢量作为当前块的前向运动矢量mvE0(mvE0_x,mvE0_y);基于当前块的前向运动矢量和当前块的前向参考帧索引确定当前块的时域运动信息中的前向运动信息,比如说,时域运动信息中的前向运动信息包括mvE0(mvE0_x,mvE0_y)和当前块的前向参考帧索引。Based on the above definition, the forward motion information in the time domain motion information of the current block is determined according to the forward motion information of the time domain adjacent blocks, which may include but not limited to: based on the co-located frame and the forward reference frame of the time domain adjacent block The distance BlockDistanceRef0 between, and the distance BlockDistanceL0 between the current frame and the forward reference frame of the current block, stretch the forward motion vector mvRef0 (mvRef0_x, mvRef0_y) of the adjacent block in the time domain to obtain the stretched motion vector, Use the stretched motion vector as the forward motion vector mvE0(mvE0_x, mvE0_y) of the current block; determine the forward motion vector in the temporal motion information of the current block based on the forward motion vector of the current block and the forward reference frame index of the current block The motion information, for example, the forward motion information in the temporal motion information includes mvE0 (mvE0_x, mvE0_y) and the forward reference frame index of the current block.

示例性的,可以采用如下公式(1)和公式(2)对时域相邻块的前向运动矢量mvRef0(mvRef0_x,mvRef0_y)进行伸缩,得到伸缩后的运动矢量mvE0(mvE0_x,mvE0_y)。Exemplarily, the following formula (1) and formula (2) can be used to stretch the forward motion vector mvRef0 (mvRef0_x, mvRef0_y) of the adjacent block in the time domain to obtain the stretched motion vector mvE0 (mvE0_x, mvE0_y).

mvE0_x=Clip3(-32768,32767,Sign(mvRef0_x*BlockDistanceL0*BlockDistanceRef0)*(((Abs(mvRef0_x*BlockDistanceL0*(16384/BlockDistanceRef0)))+8192)>>14))(1)mvE0_x=Clip3(-32768,32767,Sign(mvRef0_x*BlockDistanceL0*BlockDistanceRef0)*(((Abs(mvRef0_x*BlockDistanceL0*(16384/BlockDistanceRef0)))+8192)>>14))(1)

mvE0_y=Clip3(-32768,32767,Sign(mvRef0_y*BlockDistanceL0*BlockDistanceRef0)*(((Abs(mvRef0_y*BlockDistanceL0*(16384/BlockDistanceRef0)))+8192)>>14))(2)mvE0_y=Clip3(-32768,32767,Sign(mvRef0_y*BlockDistanceL0*BlockDistanceRef0)*(((Abs(mvRef0_y*BlockDistanceL0*(16384/BlockDistanceRef0)))+8192)>>14))(2)

在公式(1)和公式(2)中,Clip3(-32768,32767),用于将mvE0_x和mvE0_y的取值范围限制在-32768与32767之间,即取值小于-32768时,令mvE0_x和mvE0_y的取值为-32768,取值大于32767时,令mvE0_x和mvE0_y的取值为32767。Sign表示符号函数,Abs表示求绝对值,>>表示右移。mvRef0_x表示时域相邻块的前向运动矢量的水平运动矢量,mvRef0_y表示时域相邻块的前向运动矢量的垂直运动矢量。mvE0_x表示当前块的前向运动矢量的水平运动矢量,mvE0_y表示当前块的前向运动矢量的垂直运动矢量。BlockDistanceL0表示当前帧与当前块的前向参考帧之间的距离,BlockDistanceRef0表示同位帧与时域相邻块的前向参考帧之间的距离。在公式(1)和公式(2)中的各数值,还可以根据实际需要进行调整,对此不做限制。当然,公式(1)和公式(2)只是示例,只要能够基于同位帧与时域相邻块的前向参考帧之间的距离,以及当前帧与当前块的前向参考帧之间的距离,对时域相邻块的前向运动矢量mvRef0进行伸缩,得到伸缩后的运动矢量mvE0即可。比如说,基于同位帧与时域相邻块的前向参考帧之间的距离,以及当前帧与当前块的前向参考帧之间的距离,对时域相邻块的前向运动矢量中的水平运动矢量进行伸缩,得到当前块的前向运动矢量中的水平运动矢量;以及,基于同位帧与时域相邻块的前向参考帧之间的距离,以及当前帧与当前块的前向参考帧之间的距离,对时域相邻块的前向运动矢量中的垂直运动矢量进行伸缩,得到当前块的前向运动矢量中的垂直运动矢量。In formula (1) and formula (2), Clip3(-32768,32767) is used to limit the value range of mvE0_x and mvE0_y between -32768 and 32767, that is, when the value is less than -32768, let mvE0_x and The value of mvE0_y is -32768, and when the value is greater than 32767, set the values of mvE0_x and mvE0_y to 32767. Sign represents a sign function, Abs represents an absolute value, and >> represents a right shift. mvRef0_x represents the horizontal motion vector of the forward motion vector of the neighboring block in the temporal domain, and mvRef0_y represents the vertical motion vector of the forward motion vector of the neighboring block in the temporal domain. mvE0_x indicates the horizontal motion vector of the forward motion vector of the current block, and mvE0_y indicates the vertical motion vector of the forward motion vector of the current block. BlockDistanceL0 represents the distance between the current frame and the forward reference frame of the current block, and BlockDistanceRef0 represents the distance between the co-located frame and the forward reference frame of the temporal adjacent block. The numerical values in formula (1) and formula (2) can also be adjusted according to actual needs, and there is no limit to this. Of course, formula (1) and formula (2) are just examples, as long as it can be based on the distance between the co-located frame and the forward reference frame of the temporal adjacent block, and the distance between the current frame and the forward reference frame of the current block , stretching the forward motion vector mvRef0 of the adjacent block in the time domain to obtain the stretched motion vector mvE0. For example, based on the distance between the co-located frame and the forward reference frame of the temporal adjacent block, and the distance between the current frame and the forward reference frame of the current block, the forward motion vector of the temporal adjacent block The horizontal motion vector of the current block is stretched to obtain the horizontal motion vector in the forward motion vector of the current block; and, based on the distance between the co-located frame and the forward reference frame of the temporal adjacent block, and the previous To the distance between the reference frames, the vertical motion vector in the forward motion vector of the adjacent block in the time domain is stretched to obtain the vertical motion vector in the forward motion vector of the current block.

基于上述定义,根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息,包括但不限于:基于同位帧与时域相邻块的后向参考帧之间的距离BlockDistanceRef1,以及当前帧与当前块的后向参考帧之间的距离BlockDistanceL1,对时域相邻块的后向运动矢量mvRef1(mvRef1_x,mvRef1_y)进行伸缩,得到伸缩后的运动矢量,并将伸缩后的运动矢量作为当前块的后向运动矢量mvE1(mvE1_x,mvE1_y);基于当前块的后向运动矢量和当前块的后向参考帧索引确定当前块的时域运动信息中的后向运动信息,比如说,当前块的时域运动信息中的后向运动信息包括mvE1(mvE1_x,mvE1_y)和当前块的后向参考帧索引。Based on the above definition, the backward motion information in the time domain motion information of the current block is determined according to the backward motion information of the temporal adjacent blocks, including but not limited to: The distance BlockDistanceRef1 between, and the distance BlockDistanceL1 between the current frame and the backward reference frame of the current block, stretch the backward motion vector mvRef1 (mvRef1_x, mvRef1_y) of the adjacent block in the time domain to obtain the stretched motion vector, and Use the stretched motion vector as the backward motion vector mvE1(mvE1_x, mvE1_y) of the current block; determine the backward direction in the temporal motion information of the current block based on the backward motion vector of the current block and the backward reference frame index of the current block The motion information, for example, the backward motion information in the temporal motion information of the current block includes mvE1 (mvE1_x, mvE1_y) and the backward reference frame index of the current block.

示例性的,可以采用如下公式(3)和公式(4)对时域相邻块的后向运动矢量mvRef1(mvRef1_x,mvRef1_y)进行伸缩,得到伸缩后的运动矢量mvE1(mvE1_x,mvE1_y)。Exemplarily, the following formula (3) and formula (4) can be used to stretch the backward motion vector mvRef1(mvRef1_x, mvRef1_y) of the adjacent block in the time domain to obtain the stretched motion vector mvE1(mvE1_x, mvE1_y).

mvE1_x=Clip3(-32768,32767,Sign(mvRef1_x*BlockDistanceL1*BlockDistanceRef1)*(((Abs(mvRef1_x*BlockDistanceL1*(16384/BlockDistanceRef1)))+8192)>>14))(3)mvE1_x=Clip3(-32768,32767,Sign(mvRef1_x*BlockDistanceL1*BlockDistanceRef1)*(((Abs(mvRef1_x*BlockDistanceL1*(16384/BlockDistanceRef1)))+8192)>>14))(3)

mvE1_y=Clip3(-32768,32767,Sign(mvRef1_y*BlockDistanceL1*BlockDistanceRef1)*(((Abs(mvRef1_y*BlockDistanceL1*(16384/BlockDistanceRef1)))+8192)>>14))(4)mvE1_y=Clip3(-32768,32767,Sign(mvRef1_y*BlockDistanceL1*BlockDistanceRef1)*(((Abs(mvRef1_y*BlockDistanceL1*(16384/BlockDistanceRef1)))+8192)>>14))(4)

在公式(3)和公式(4)中,Clip3(-32768,32767),用于将mvE1_x和mvE1_y的取值范围限制在-32768与32767之间,即取值小于-32768时,令mvE1_x和mvE1_y的取值为-32768,取值大于32767时,令mvE1_x和mvE1_y的取值为32767。Sign表示符号函数,Abs表示求绝对值,>>表示右移。mvRef1_x表示时域相邻块的后向运动矢量的水平运动矢量,mvRef1_y表示时域相邻块的后向运动矢量的垂直运动矢量。mvE1_x表示当前块的后向运动矢量的水平运动矢量,mvE1_y表示当前块的后向运动矢量的垂直运动矢量。BlockDistanceL1表示当前帧与当前块的后向参考帧之间的距离,BlockDistanceRef1表示同位帧与时域相邻块的后向参考帧之间的距离。在公式(3)和公式(4)中的各数值,还可以根据实际需要进行调整,对此不做限制。当然,公式(3)和公式(4)只是示例,只要能够基于同位帧与时域相邻块的后向参考帧之间的距离,以及当前帧与当前块的后向参考帧之间的距离,对第一后运动矢量mvRef1进行伸缩,得到伸缩后的当前块的后向运动矢量mvE1即可。比如说,基于同位帧与时域相邻块的后向参考帧之间的距离,以及当前帧与当前块的后向参考帧之间的距离,对时域相邻块的后向运动矢量中的水平运动矢量进行伸缩,得到当前块的后向运动矢量中的水平运动矢量;以及,基于同位帧与时域相邻块的后向参考帧之间的距离,以及当前帧与当前块的后向参考帧之间的距离,对时域相邻块的后向运动矢量中的垂直运动矢量进行伸缩,得到当前块的后向运动矢量中的垂直运动矢量。In formula (3) and formula (4), Clip3(-32768,32767) is used to limit the value range of mvE1_x and mvE1_y between -32768 and 32767, that is, when the value is less than -32768, let mvE1_x and The value of mvE1_y is -32768, and when the value is greater than 32767, set the values of mvE1_x and mvE1_y to 32767. Sign represents a sign function, Abs represents an absolute value, and >> represents a right shift. mvRef1_x represents the horizontal motion vector of the backward motion vector of the neighboring block in the time domain, and mvRef1_y represents the vertical motion vector of the backward motion vector of the neighboring block in the time domain. mvE1_x indicates the horizontal motion vector of the backward motion vector of the current block, and mvE1_y indicates the vertical motion vector of the backward motion vector of the current block. BlockDistanceL1 represents the distance between the current frame and the backward reference frame of the current block, and BlockDistanceRef1 represents the distance between the co-located frame and the backward reference frame of the temporal adjacent block. The numerical values in formula (3) and formula (4) can also be adjusted according to actual needs, and there is no limit to this. Of course, formula (3) and formula (4) are just examples, as long as it can be based on the distance between the co-located frame and the backward reference frame of the temporal adjacent block, and the distance between the current frame and the backward reference frame of the current block , stretching the first backward motion vector mvRef1 to obtain the stretched backward motion vector mvE1 of the current block. For example, based on the distance between the co-located frame and the backward reference frame of the temporal adjacent block, and the distance between the current frame and the backward reference frame of the current block, the backward motion vector of the temporal adjacent block The horizontal motion vector of the current block is stretched to obtain the horizontal motion vector in the backward motion vector of the current block; and, based on the distance between the co-located frame and the backward reference frame of the temporal adjacent block, and the backward The distance between the reference frames is used to scale the vertical motion vector among the backward motion vectors of adjacent blocks in time domain to obtain the vertical motion vector among the backward motion vectors of the current block.

综上所述,可以得到当前块的时域运动信息中的前向运动信息,当前块的时域运动信息中的后向运动信息,并将该前向运动信息和该后向运动信息组成当前块的时域运动信息。To sum up, the forward motion information in the temporal motion information of the current block and the backward motion information in the temporal motion information of the current block can be obtained, and the forward motion information and the backward motion information are combined into a current Temporal motion information of a block.

综上所述,参见图3A所示,若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则可以基于同位帧的距离索引DistanceIndexCol与时域相邻块的前向参考帧的距离索引DistanceIndexRef0,确定出同位帧与时域相邻块的前向参考帧之间的距离BlockDistanceRef0,可以基于当前帧的距离索引DistanceIndexCur与当前块的前向参考帧的距离索引DistanceIndexL0,确定出当前帧与当前块的前向参考帧之间的距离BlockDistanceL0,然后,通过BlockDistanceRef0和BlockDistanceL0对时域相邻块的前向运动矢量mvRef0进行伸缩,得到当前块的前向运动矢量mvE0。可以基于同位帧的距离索引DistanceIndexCol与时域相邻块的后向参考帧的距离索引DistanceIndexRef1,确定出同位帧与时域相邻块的后向参考帧之间的距离BlockDistanceRef1,可以基于当前帧的距离索引DistanceIndexCur与当前块的后向参考帧的距离索引DistanceIndexL1,确定出当前帧与当前块的后向参考帧之间的距离BlockDistanceL1,然后,通过BlockDistanceRef1和BlockDistanceL1对时域相邻块的后向运动矢量mvRef1进行伸缩,得到当前块的后向运动矢量mvE1。To sum up, as shown in Figure 3A, if the forward motion information of adjacent blocks in time domain is available, and the backward motion information of adjacent blocks in time domain is available, then the distance index DistanceIndexCol of the co-located frame can be compared with the time domain relative The distance index DistanceIndexRef0 of the forward reference frame of the adjacent block determines the distance BlockDistanceRef0 between the co-located frame and the forward reference frame of the adjacent block in the time domain, which can be based on the distance index DistanceIndexCur of the current frame and the forward reference frame of the current block. The distance index DistanceIndexL0 determines the distance BlockDistanceL0 between the current frame and the forward reference frame of the current block, and then stretches the forward motion vector mvRef0 of the temporal adjacent block through BlockDistanceRef0 and BlockDistanceL0 to obtain the forward motion of the current block Vector mvE0. Based on the distance index DistanceIndexCol of the co-located frame and the distance index DistanceIndexRef1 of the backward reference frame of the temporal adjacent block, the distance BlockDistanceRef1 between the co-located frame and the backward reference frame of the temporal adjacent block can be determined, which can be based on the current frame The distance index DistanceIndexCur and the distance index DistanceIndexL1 of the backward reference frame of the current block determine the distance BlockDistanceL1 between the current frame and the backward reference frame of the current block, and then, through BlockDistanceRef1 and BlockDistanceL1, the backward movement of adjacent blocks in the time domain The vector mvRef1 is stretched to obtain the backward motion vector mvE1 of the current block.

然后,当前块的前向运动矢量mvE0,当前块的后向运动矢量mvE1,当前块的前向参考帧索引和当前块的后向参考帧索引,就可以组成当前块的时域运动信息。Then, the forward motion vector mvE0 of the current block, the backward motion vector mvE1 of the current block, the forward reference frame index of the current block and the backward reference frame index of the current block can form the temporal motion information of the current block.

步骤c3、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息不可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息。Step c3, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is not available, then the time domain motion of the current block can be determined according to the forward motion information of the neighboring block in the time domain The forward motion information in the information, and determine the backward motion information in the time domain motion information of the current block according to the forward motion information of the adjacent blocks in the time domain.

若时域相邻块的前向运动信息的参考帧索引大于等于0,时域相邻块的前向运动信息可用。若时域相邻块的后向运动信息的参考帧索引为-1,时域相邻块的后向运动信息不可用。If the reference frame index of the forward motion information of the adjacent blocks in the time domain is greater than or equal to 0, the forward motion information of the adjacent blocks in the time domain is available. If the reference frame index of the backward motion information of the adjacent blocks in the temporal domain is -1, the backward motion information of the adjacent blocks in the temporal domain is unavailable.

时域相邻块的前向运动信息包括时域相邻块的前向运动矢量mvRef0(mvRef0_x,mvRef0_y)和时域相邻块的前向参考帧索引,该前向参考帧索引对应时域相邻块的前向参考帧,时域相邻块的后向运动信息包括时域相邻块的后向运动矢量mvRef1(mvRef1_x,mvRef1_y)和时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧。当前块的时域运动信息中的前向运动信息包括当前块的前向运动矢量mvE0(mvE0_x,mvE0_y)和当前块的前向参考帧索引,该前向参考帧索引对应当前块的前向参考帧,当前块的时域运动信息中的后向运动信息包括当前块的后向运动矢量mvE1(mvE1_x,mvE1_y)和当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧。将当前块的前向参考帧的距离索引记为DistanceIndexL0,将当前块的后向参考帧的距离索引记为DistanceIndexL1,将当前帧与当前块的前向参考帧之间的距离记为BlockDistanceL0,将当前帧与当前块的后向参考帧之间的距离记为BlockDistanceL1。将同位帧的距离索引记为DistanceIndexCol,将时域相邻块的前向参考帧的距离索引记为DistanceIndexRef0,将时域相邻块的后向参考帧的距离索引记为DistanceIndexRef1。将同位帧与时域相邻块的前向参考帧之间的距离记为BlockDistanceRef0,将同位帧与时域相邻块的后向参考帧之间的距离记为BlockDistanceRef1。The forward motion information of the neighboring blocks in the time domain includes the forward motion vector mvRef0(mvRef0_x, mvRef0_y) of the neighboring blocks in the time domain and the forward reference frame index of the neighboring blocks in the time domain, and the forward reference frame index corresponds to the time domain phase The forward reference frame of the adjacent block, the backward motion information of the adjacent block in the temporal domain includes the backward motion vector mvRef1(mvRef1_x, mvRef1_y) of the adjacent block in the temporal domain and the backward reference frame index of the adjacent block in the temporal domain, the backward The backward reference frame index corresponds to the backward reference frame of the neighboring block in time domain. The forward motion information in the temporal motion information of the current block includes the forward motion vector mvE0(mvE0_x, mvE0_y) of the current block and the forward reference frame index of the current block, which corresponds to the forward reference frame index of the current block frame, the backward motion information in the temporal motion information of the current block includes the backward motion vector mvE1 (mvE1_x, mvE1_y) of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the backward direction of the current block to the reference frame. The distance index of the forward reference frame of the current block is recorded as DistanceIndexL0, the distance index of the backward reference frame of the current block is recorded as DistanceIndexL1, the distance between the current frame and the forward reference frame of the current block is recorded as BlockDistanceL0, and The distance between the current frame and the backward reference frame of the current block is denoted as BlockDistanceL1. The distance index of the co-located frame is recorded as DistanceIndexCol, the distance index of the forward reference frame of the temporal adjacent block is recorded as DistanceIndexRef0, and the distance index of the backward reference frame of the temporal adjacent block is recorded as DistanceIndexRef1. The distance between the co-located frame and the forward reference frame of the adjacent block in the time domain is recorded as BlockDistanceRef0, and the distance between the co-located frame and the backward reference frame of the adjacent block in the time domain is recorded as BlockDistanceRef1.

基于上述定义,可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,该过程可以参见步骤c2的处理过程,在此不再重复赘述。Based on the above definition, the forward motion information in the time domain motion information of the current block can be determined according to the forward motion information of the adjacent blocks in the time domain. For this process, refer to the process of step c2, which will not be repeated here.

基于上述定义,根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息,可以包括但不限于:基于同位帧与时域相邻块的前向参考帧之间的距离BlockDistanceRef0,以及当前帧与当前块的后向参考帧之间的距离BlockDistanceL1,对时域相邻块的前向运动矢量mvRef0(mvRef0_x,mvRef0_y)进行伸缩,得到伸缩后的运动矢量,将伸缩后的运动矢量作为当前块的后向运动矢量mvE1(mvE1_x,mvE1_y);基于当前块的后向运动矢量和当前块的后向参考帧索引确定当前块的时域运动信息中的后向运动信息,比如说,时域运动信息中的后向运动信息包括mvE1(mvE1_x,mvE1_y)和当前块的后向参考帧索引。Based on the above definition, the backward motion information in the time domain motion information of the current block is determined according to the forward motion information of the time domain adjacent blocks, which may include but not limited to: based on the co-located frame and the forward reference frame of the time domain adjacent block The distance BlockDistanceRef0 between, and the distance BlockDistanceL1 between the current frame and the backward reference frame of the current block, stretch the forward motion vector mvRef0 (mvRef0_x, mvRef0_y) of the adjacent block in the time domain to obtain the stretched motion vector, Use the stretched motion vector as the backward motion vector mvE1(mvE1_x, mvE1_y) of the current block; determine the backward direction in the temporal motion information of the current block based on the backward motion vector of the current block and the backward reference frame index of the current block Motion information, for example, backward motion information in time-domain motion information includes mvE1 (mvE1_x, mvE1_y) and the backward reference frame index of the current block.

示例性的,可以采用如下公式(5)和公式(6)对时域相邻块的前向运动矢量mvRef0(mvRef0_x,mvRef0_y)进行伸缩,得到伸缩后的运动矢量mvE1(mvE1_x,mvE1_y)。Exemplarily, the following formula (5) and formula (6) can be used to stretch the forward motion vector mvRef0 (mvRef0_x, mvRef0_y) of the adjacent block in the time domain to obtain the stretched motion vector mvE1 (mvE1_x, mvE1_y).

mvE1_x=Clip3(-32768,32767,Sign(mvRef0_x*BlockDistanceL1*BlockDistanceRef0)*(((Abs(mvRef0_x*BlockDistanceL1*(16384/BlockDistanceRef0)))+8192)>>14))(5)mvE1_x=Clip3(-32768,32767,Sign(mvRef0_x*BlockDistanceL1*BlockDistanceRef0)*(((Abs(mvRef0_x*BlockDistanceL1*(16384/BlockDistanceRef0)))+8192)>>14))(5)

mvE1_y=Clip3(-32768,32767,Sign(mvRef0_y*BlockDistanceL1*BlockDistanceRef0)*(((Abs(mvRef0_y*BlockDistanceL1*(16384/BlockDistanceRef0)))+8192)>>14))(6)mvE1_y=Clip3(-32768,32767,Sign(mvRef0_y*BlockDistanceL1*BlockDistanceRef0)*(((Abs(mvRef0_y*BlockDistanceL1*(16384/BlockDistanceRef0)))+8192)>>14))(6)

在公式(5)和公式(6)中,Clip3(-32768,32767)用于将mvE1_x和mvE1_y的取值范围限制在-32768与32767之间。Sign表示符号函数,Abs表示求绝对值,>>表示右移。mvRef0_x表示时域相邻块的前向运动矢量的水平运动矢量,mvRef0_y表示时域相邻块的前向运动矢量的垂直运动矢量。mvE1_x表示当前块的后向运动矢量的水平运动矢量,mvE1_y表示当前块的后向运动矢量的垂直运动矢量。BlockDistanceL1表示当前帧与当前块的后向参考帧之间的距离,BlockDistanceRef0表示同位帧与时域相邻块的前向参考帧之间的距离。In formula (5) and formula (6), Clip3(-32768, 32767) is used to limit the value range of mvE1_x and mvE1_y between -32768 and 32767. Sign represents a sign function, Abs represents an absolute value, and >> represents a right shift. mvRef0_x represents the horizontal motion vector of the forward motion vector of the neighboring block in the temporal domain, and mvRef0_y represents the vertical motion vector of the forward motion vector of the neighboring block in the temporal domain. mvE1_x indicates the horizontal motion vector of the backward motion vector of the current block, and mvE1_y indicates the vertical motion vector of the backward motion vector of the current block. BlockDistanceL1 represents the distance between the current frame and the backward reference frame of the current block, and BlockDistanceRef0 represents the distance between the co-located frame and the forward reference frame of the temporal adjacent block.

综上所述,可以得到当前块的时域运动信息中的前向运动信息,当前块的时域运动信息中的后向运动信息,并将该前向运动信息和该后向运动信息组成当前块的时域运动信息。To sum up, the forward motion information in the temporal motion information of the current block and the backward motion information in the temporal motion information of the current block can be obtained, and the forward motion information and the backward motion information are combined into a current Temporal motion information of a block.

综上所述,参见图3B所示,若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息不可用,则基于同位帧的距离索引DistanceIndexCol与时域相邻块的前向参考帧的距离索引DistanceIndexRef0,确定出同位帧与时域相邻块的前向参考帧之间的距离BlockDistanceRef0,可以基于当前帧的距离索引DistanceIndexCur与当前块的前向参考帧的距离索引DistanceIndexL0,确定出当前帧与当前块的前向参考帧之间的距离BlockDistanceL0,然后,通过BlockDistanceRef0和BlockDistanceL0对时域相邻块的前向运动矢量mvRef0进行伸缩,得到当前块的前向运动矢量mvE0。可以基于当前帧的距离索引DistanceIndexCur与当前块的后向参考帧的距离索引DistanceIndexL1,确定出当前帧与当前块的后向参考帧之间的距离BlockDistanceL1,通过BlockDistanceRef0和BlockDistanceL1对时域相邻块的前向运动矢量mvRef0进行伸缩,得到当前块的后向运动矢量mvE1。To sum up, as shown in Figure 3B, if the forward motion information of adjacent blocks in the time domain is available, and the backward motion information of adjacent blocks in the time domain is not available, the distance index DistanceIndexCol based on the co-located frame and the time domain phase The distance index DistanceIndexRef0 of the forward reference frame of the adjacent block determines the distance BlockDistanceRef0 between the co-located frame and the forward reference frame of the adjacent block in the time domain, which can be based on the distance index DistanceIndexCur of the current frame and the forward reference frame of the current block. The distance index DistanceIndexL0 determines the distance BlockDistanceL0 between the current frame and the forward reference frame of the current block, and then stretches the forward motion vector mvRef0 of the temporal adjacent block through BlockDistanceRef0 and BlockDistanceL0 to obtain the forward motion of the current block Vector mvE0. The distance BlockDistanceL1 between the current frame and the backward reference frame of the current block can be determined based on the distance index DistanceIndexCur of the current frame and the distance index DistanceIndexL1 of the backward reference frame of the current block. The forward motion vector mvRef0 is scaled to obtain the backward motion vector mvE1 of the current block.

当前块的前向运动矢量mvE0,当前块的后向运动矢量mvE1,当前块的前向参考帧索引和当前块的后向参考帧索引,就可以组成当前块的时域运动信息。The forward motion vector mvE0 of the current block, the backward motion vector mvE1 of the current block, the forward reference frame index of the current block and the backward reference frame index of the current block can form the temporal motion information of the current block.

步骤c4、若时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Step c4, if the forward motion information of the neighboring block in the time domain is not available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion of the current block can be determined according to the backward motion information of the neighboring block in the time domain The forward motion information in the information, and determine the backward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain.

若时域相邻块的前向运动信息的参考帧索引为-1,则时域相邻块的前向运动信息不可用。若时域相邻块的后向运动信息的参考帧索引大于等于0,则时域相邻块的后向运动信息可用。If the reference frame index of the forward motion information of the neighboring blocks in the temporal domain is -1, the forward motion information of the neighboring blocks in the temporal domain is unavailable. If the reference frame index of the backward motion information of the adjacent blocks in the time domain is greater than or equal to 0, the backward motion information of the adjacent blocks in the time domain is available.

基于上述实施例的定义,可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息,该过程可以参见步骤c2的处理过程,在此不再重复赘述。Based on the definition of the above embodiment, the backward motion information in the time domain motion information of the current block can be determined according to the backward motion information of the adjacent blocks in the time domain. For this process, refer to the processing process of step c2, which will not be repeated here. .

基于上述实施例的定义,根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,可以包括但不限于:基于同位帧与时域相邻块的后向参考帧之间的距离BlockDistanceRef1,以及当前帧与当前块的前向参考帧之间的距离BlockDistanceL0,对时域相邻块的后向运动矢量mvRef1(mvRef1_x,mvRef1_y)进行伸缩,得到伸缩后的运动矢量,并将伸缩后的运动矢量作为当前块的前向运动矢量mvE0(mvE0_x,mvE0_y);基于当前块的前向运动矢量和当前块的前向参考帧索引确定当前块的时域运动信息中的前向运动信息,比如,时域运动信息中的前向运动信息包括mvE0(mvE0_x,mvE0_y)和当前块的前向参考帧索引。Based on the definition of the above-mentioned embodiments, determining the forward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain may include but not limited to: The distance BlockDistanceRef1 between the reference frames, and the distance BlockDistanceL0 between the current frame and the forward reference frame of the current block, stretch the backward motion vector mvRef1 (mvRef1_x, mvRef1_y) of the adjacent block in the time domain, and obtain the stretched Motion vector, and use the stretched motion vector as the forward motion vector mvE0(mvE0_x, mvE0_y) of the current block; determine the temporal motion information of the current block based on the forward motion vector of the current block and the forward reference frame index of the current block For example, the forward motion information in the temporal motion information includes mvE0 (mvE0_x, mvE0_y) and the forward reference frame index of the current block.

示例性的,可以采用如下公式(7)和公式(8)对时域相邻块的后向运动矢量mvRef1(mvRef1_x,mvRef1_y)进行伸缩,得到伸缩后的运动矢量mvE0(mvE0_x,mvE0_y)。Exemplarily, the following formula (7) and formula (8) can be used to stretch the backward motion vector mvRef1 (mvRef1_x, mvRef1_y) of the adjacent block in the time domain to obtain the stretched motion vector mvE0 (mvE0_x, mvE0_y).

mvE0_x=Clip3(-32768,32767,Sign(mvRef1_x*BlockDistanceL0*BlockDistanceRef1)*(((Abs(mvRef1_x*BlockDistanceL0*(16384/BlockDistanceRef1)))+8192)>>14))(7)mvE0_x=Clip3(-32768,32767,Sign(mvRef1_x*BlockDistanceL0*BlockDistanceRef1)*(((Abs(mvRef1_x*BlockDistanceL0*(16384/BlockDistanceRef1)))+8192)>>14))(7)

mvE0_y=Clip3(-32768,32767,Sign(mvRef1_y*BlockDistanceL0*BlockDistanceRef1)*(((Abs(mvRef1_y*BlockDistanceL0*(16384/BlockDistanceRef1)))+8192)>>14))(8)mvE0_y=Clip3(-32768,32767,Sign(mvRef1_y*BlockDistanceL0*BlockDistanceRef1)*(((Abs(mvRef1_y*BlockDistanceL0*(16384/BlockDistanceRef1)))+8192)>>14))(8)

在公式(7)和公式(8)中,Clip3(-32768,32767)用于将mvE0_x和mvE0_y的取值范围限制在-32768与32767之间。Sign表示符号函数,Abs表示求绝对值,>>表示右移。mvRef1_x表示时域相邻块的后向运动矢量的水平运动矢量,mvRef1_y表示时域相邻块的后向运动矢量的垂直运动矢量。mvE0_x表示当前块的前向运动矢量的水平运动矢量,mvE0_y表示当前块的前向运动矢量的垂直运动矢量。BlockDistanceL0表示当前帧与当前块的前向参考帧之间的距离,BlockDistanceRef1表示同位帧与时域相邻块的后向参考帧之间的距离。In formula (7) and formula (8), Clip3(-32768, 32767) is used to limit the value range of mvE0_x and mvE0_y between -32768 and 32767. Sign represents a sign function, Abs represents an absolute value, and >> represents a right shift. mvRef1_x represents the horizontal motion vector of the backward motion vector of the neighboring block in the time domain, and mvRef1_y represents the vertical motion vector of the backward motion vector of the neighboring block in the time domain. mvE0_x indicates the horizontal motion vector of the forward motion vector of the current block, and mvE0_y indicates the vertical motion vector of the forward motion vector of the current block. BlockDistanceL0 represents the distance between the current frame and the forward reference frame of the current block, and BlockDistanceRef1 represents the distance between the co-located frame and the backward reference frame of the temporal adjacent block.

综上所述,可以得到当前块的时域运动信息中的前向运动信息,当前块的时域运动信息中的后向运动信息,并将该前向运动信息和该后向运动信息组成当前块的时域运动信息。To sum up, the forward motion information in the temporal motion information of the current block and the backward motion information in the temporal motion information of the current block can be obtained, and the forward motion information and the backward motion information are combined into a current Temporal motion information of a block.

综上所述,参见图3C所示,若时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用,则基于同位帧的距离索引DistanceIndexCol与时域相邻块的后向参考帧的距离索引DistanceIndexRef1,确定出同位帧与时域相邻块的后向参考帧之间的距离BlockDistanceRef1,可以基于当前帧的距离索引DistanceIndexCur与当前块的前向参考帧的距离索引DistanceIndexL0,确定出当前帧与当前块的前向参考帧之间的距离BlockDistanceL0,然后,通过BlockDistanceRef1和BlockDistanceL0对时域相邻块的后向运动矢量mvRef1进行伸缩,得到当前块的前向运动矢量mvE0。可以基于当前帧的距离索引DistanceIndexCur与当前块的后向参考帧的距离索引DistanceIndexL1,确定出当前帧与当前块的后向参考帧之间的距离BlockDistanceL1,通过BlockDistanceRef1和BlockDistanceL1对时域相邻块的后向运动矢量mvRef1进行伸缩,得到当前块的后向运动矢量mvE1。To sum up, as shown in Figure 3C, if the forward motion information of adjacent blocks in the time domain is not available, and the backward motion information of adjacent blocks in the time domain is available, the distance index DistanceIndexCol based on the co-located frame and the time domain phase The distance index DistanceIndexRef1 of the backward reference frame of the adjacent block determines the distance BlockDistanceRef1 between the co-located frame and the backward reference frame of the adjacent block in the time domain, which can be based on the distance index DistanceIndexCur of the current frame and the forward reference frame of the current block. The distance index DistanceIndexL0 determines the distance BlockDistanceL0 between the current frame and the forward reference frame of the current block, and then stretches the backward motion vector mvRef1 of the temporal adjacent block through BlockDistanceRef1 and BlockDistanceL0 to obtain the forward motion of the current block Vector mvE0. The distance BlockDistanceL1 between the current frame and the backward reference frame of the current block can be determined based on the distance index DistanceIndexCur of the current frame and the distance index DistanceIndexL1 of the backward reference frame of the current block. The backward motion vector mvRef1 is scaled to obtain the backward motion vector mvE1 of the current block.

当前块的前向运动矢量mvE0,当前块的后向运动矢量mvE1,当前块的前向参考帧索引和当前块的后向参考帧索引,就可以组成当前块的时域运动信息。The forward motion vector mvE0 of the current block, the backward motion vector mvE1 of the current block, the forward reference frame index of the current block and the backward reference frame index of the current block can form the temporal motion information of the current block.

以下结合一个具体应用场景,对实施例3的上述过程进行说明:The above process of Embodiment 3 is described below in combination with a specific application scenario:

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引均为-1,则当前块的L0参考索引和L1参考索引均等于0。以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,然后将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束当前块的时域运动信息的导出过程。If the L0 reference index and the L1 reference frame index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 are both -1, Then the L0 reference index and the L1 reference index of the current block are both equal to 0. The size and position of the coding unit where the current block is located are used as the size and position of the current block, and then the L0 motion vector predictor and the L1 motion vector predictor obtained according to the MVP are respectively used as the L0 motion vector MvE0 and the L1 motion vector MvE1 of the current block, And make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block both equal to 0, and end the derivation process of the time-domain motion information of the current block.

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引不均为-1,则当前块的L0参考索引和L1参考索引均等于0。当前块的L0参考索引对应的图像的距离索引记为DistanceIndexL0,当前块的L1参考索引对应的图像的距离索引记为DistanceIndexL1;当前块的L0参考索引对应的图像的BlockDistance记为BlockDistanceL0,即当前块的L0参考索引对应的图像与当前帧的距离;当前块的L1参考索引对应的图像的BlockDistance记为BlockDistanceL1,即当前块的L1参考索引对应的图像与当前帧的距离。If the reference index value of the reference image queue 1 is 0, the L0 reference index and the L1 reference frame index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left luminance sample position of the current block is not both -1 , then the L0 reference index and the L1 reference index of the current block are both equal to 0. The distance index of the image corresponding to the L0 reference index of the current block is recorded as DistanceIndexL0, the distance index of the image corresponding to the L1 reference index of the current block is recorded as DistanceIndexL1; the BlockDistance of the image corresponding to the L0 reference index of the current block is recorded as BlockDistanceL0, that is, the current block The distance between the image corresponding to the L0 reference index of the current frame and the current frame; the BlockDistance of the image corresponding to the L1 reference index of the current block is recorded as BlockDistanceL1, that is, the distance between the image corresponding to the L1 reference index of the current block and the current frame.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0(即时域相邻块的前向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef0(mvRef0_x,mvRef0_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L0运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef0。示例性的,可以通过如下公式确定BlockDistanceRef0:BlockDistanceRef0=DistanceIndexCol–DistanceIndexRef0。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block Forward motion information is available), then the L0 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef0( mvRef0_x, mvRef0_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L0 motion vector is recorded as DistanceIndexRef0. Exemplarily, BlockDistanceRef0 may be determined by the following formula: BlockDistanceRef0=DistanceIndexCol−DistanceIndexRef0.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0(即时域相邻块的后向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动矢量记为mvRef1(mvRef1_x,mvRef1_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L1运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef1。示例性的,可以通过如下公式确定BlockDistanceRef1:BlockDistanceRef1=DistanceIndexCol–DistanceIndexRef1。If the L1 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block backward motion information is available), then the L1 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef1( mvRef1_x, mvRef1_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L1 motion vector is recorded as DistanceIndexRef1. Exemplarily, BlockDistanceRef1 may be determined by the following formula: BlockDistanceRef1=DistanceIndexCol−DistanceIndexRef1.

然后,令当前块的L0参考索引RefIdxL0等于0,当前块的L0运动矢量为mvE0(mvE0_x,mvE0_y),当前块的L1参考索引RefIdxL1等于0,当前块的L1运动矢量mvE1(mvE1_x,mvE1_y)。L0参考索引RefIdxL0和L0运动矢量mvE0(mvE0_x,mvE0_y)组成前向运动信息,L1参考索引RefIdxL1和L1运动矢量mvE1(mvE1_x,mvE1_y)组成后向运动信息。Then, the L0 reference index RefIdxL0 of the current block is equal to 0, the L0 motion vector of the current block is mvE0 (mvE0_x, mvE0_y), the L1 reference index RefIdxL1 of the current block is equal to 0, and the L1 motion vector of the current block is mvE1 (mvE1_x, mvE1_y). The L0 reference index RefIdxL0 and the L0 motion vector mvE0 (mvE0_x, mvE0_y) form the forward motion information, and the L1 reference index RefIdxL1 and the L1 motion vector mvE1 (mvE1_x, mvE1_y) form the backward motion information.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,采用公式(1)和(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y),采用公式(3)和(4)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index value is 0 in the reference image queue 1 is greater than or equal to 0, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, and the L0 motion vector is calculated using formulas (1) and (2) mvE0(mvE0_x, mvE0_y), using formulas (3) and (4) to calculate the L1 motion vector mvE1(mvE1_x, mvE1_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引为-1,则采用公式(1)和(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y),采用公式(5)和(6)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index value is 0 in the reference image queue 1 is greater than or equal to 0, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left luminance sample position of the current block is located is -1, then formulas (1) and (2) are used to calculate the L0 motion Vector mvE0 (mvE0_x, mvE0_y), using the formulas (5) and (6) to calculate the L1 motion vector mvE1 (mvE1_x, mvE1_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引为-1,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,则采用公式(7)和(8)计算L0运动矢量mvE0(mvE0_x,mvE0_y),采用公式(3)和(4)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is -1, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, then formulas (7) and (8) are used to calculate the L0 motion Vector mvE0 (mvE0_x, mvE0_y), using the formulas (3) and (4) to calculate the L1 motion vector mvE1 (mvE1_x, mvE1_y).

在实施例3中,若当前帧为B帧,是以参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动信息作为参考运动信息,并以参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动信息作为参考运动信息。In Embodiment 3, if the current frame is a B frame, it is L0 of the time domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index is 0 in the reference image queue 1 The motion information is used as the reference motion information, and the L1 motion information of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is used as the reference motion information .

实施例4:为了得到当前块的时域运动信息,若当前块所在当前帧为P帧,即当前图像是P图像,则时域运动信息的确定方式参见实施例2,在此不再赘述。若当前块所在当前帧为B帧,即当前图像是B图像,则采用如下步骤确定当前块的时域运动信息:Embodiment 4: In order to obtain the temporal motion information of the current block, if the current frame where the current block is located is a P frame, that is, the current image is a P image, then the determination method of the temporal motion information refers to Embodiment 2, which will not be repeated here. If the current frame where the current block is located is a B frame, that is, the current image is a B image, then the following steps are used to determine the temporal motion information of the current block:

步骤d1、基于当前块的预设位置,从同位帧中确定出与该预设位置对应的时域相邻块,该时域相邻块的运动信息包括前向运动信息和后向运动信息。若时域相邻块的前向运动信息不可用,时域相邻块的后向运动信息不可用,则根据MVP方式得到当前块的时域运动信息。Step d1, based on the preset position of the current block, determine from the co-located frame the temporal adjacent block corresponding to the preset position, the motion information of the temporal adjacent block includes forward motion information and backward motion information. If the forward motion information of the neighboring blocks in the time domain is not available, and the backward motion information of the neighboring blocks in the time domain is not available, the time domain motion information of the current block is obtained according to the MVP method.

示例性的,步骤d1与步骤c1的实现过程类似,在此不再赘述。Exemplarily, the implementation process of step d1 is similar to that of step c1, and will not be repeated here.

步骤d2、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息。Step d2, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion information of the current block can be determined according to the forward motion information of the neighboring block in the time domain The forward motion information in the time domain, and determine the backward motion information in the time domain motion information of the current block according to the forward motion information of the adjacent blocks in the time domain.

示例性的,与步骤c2相比,若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息,而不是根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Exemplarily, compared with step c2, if the forward motion information of adjacent blocks in time domain is available, and the backward motion information of adjacent blocks in time domain is available, then determine the current Instead of determining the backward motion information in the time domain motion information of the current block according to the backward motion information of adjacent blocks in the time domain.

关于根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息的过程,可以参见步骤c3,在此不再重复赘述。关于根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息的过程,可以参见步骤c2,在此不再重复赘述。For the process of determining the backward motion information in the time domain motion information of the current block according to the forward motion information of adjacent blocks in the time domain, please refer to step c3, which will not be repeated here. For the process of determining the forward motion information in the time domain motion information of the current block according to the forward motion information of adjacent blocks in the time domain, refer to step c2, which will not be repeated here.

在另一种可能的实施方式中,若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。In another possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is available and the backward motion information of the neighboring blocks in the time domain is available, then the current The forward motion information in the time domain motion information of the block is determined, and the backward motion information in the time domain motion information of the current block is determined according to the backward motion information of the adjacent blocks in the time domain.

示例性的,与步骤c2相比,若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,而不是根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息。Exemplarily, compared with step c2, if the forward motion information of adjacent blocks in time domain is available, and the backward motion information of adjacent blocks in time domain is available, then determine the current Instead of determining the forward motion information in the time domain motion information of the current block according to the forward motion information of adjacent blocks in the time domain.

关于根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息的过程,可以参见步骤c4,在此不再重复赘述。关于根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息的过程,可以参见步骤c2,在此不再重复赘述。For the process of determining the forward motion information in the time domain motion information of the current block according to the backward motion information of adjacent blocks in the time domain, refer to step c4, which will not be repeated here. For the process of determining the backward motion information in the time domain motion information of the current block according to the backward motion information of adjacent blocks in the time domain, refer to step c2, which will not be repeated here.

步骤d3、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息不可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息。Step d3, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is not available, then the time domain motion of the current block can be determined according to the forward motion information of the neighboring block in the time domain The forward motion information in the information, and determine the backward motion information in the time domain motion information of the current block according to the forward motion information of the adjacent blocks in the time domain.

示例性的,步骤d3与步骤c3的实现过程类似,在此不再赘述。Exemplarily, the implementation process of step d3 is similar to that of step c3, and will not be repeated here.

步骤d4、若时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Step d4, if the forward motion information of the neighboring block in the time domain is not available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion of the current block can be determined according to the backward motion information of the neighboring block in the time domain The forward motion information in the information, and determine the backward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain.

示例性的,步骤d4与步骤c4的实现过程类似,在此不再赘述。Exemplarily, the implementation process of step d4 is similar to that of step c4, and will not be repeated here.

以下结合一个具体应用场景,对实施例4的上述过程进行说明:The above process of Embodiment 4 is described below in conjunction with a specific application scenario:

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引均为-1,则当前块的L0参考索引和L1参考索引均等于0。以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,然后将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束当前块的时域运动信息的导出过程。If the L0 reference index and the L1 reference frame index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 are both -1, Then the L0 reference index and the L1 reference index of the current block are both equal to 0. The size and position of the coding unit where the current block is located are used as the size and position of the current block, and then the L0 motion vector predictor and the L1 motion vector predictor obtained according to the MVP are respectively used as the L0 motion vector MvE0 and the L1 motion vector MvE1 of the current block, And make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block both equal to 0, and end the derivation process of the time-domain motion information of the current block.

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引不均为-1,则当前块的L0参考索引和L1参考索引均等于0。当前块的L0参考索引对应的图像的距离索引记为DistanceIndexL0,当前块的L1参考索引对应的图像的距离索引记为DistanceIndexL1;当前块的L0参考索引对应的图像的BlockDistance记为BlockDistanceL0,即当前块的L0参考索引对应的图像与当前帧的距离;当前块的L1参考索引对应的图像的BlockDistance记为BlockDistanceL1,即当前块的L1参考索引对应的图像与当前帧的距离。If the reference index value of the reference image queue 1 is 0, the L0 reference index and the L1 reference frame index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left luminance sample position of the current block is not both -1 , then the L0 reference index and the L1 reference index of the current block are both equal to 0. The distance index of the image corresponding to the L0 reference index of the current block is recorded as DistanceIndexL0, the distance index of the image corresponding to the L1 reference index of the current block is recorded as DistanceIndexL1; the BlockDistance of the image corresponding to the L0 reference index of the current block is recorded as BlockDistanceL0, that is, the current block The distance between the image corresponding to the L0 reference index of the current frame and the current frame; the BlockDistance of the image corresponding to the L1 reference index of the current block is recorded as BlockDistanceL1, that is, the distance between the image corresponding to the L1 reference index of the current block and the current frame.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0(即时域相邻块的前向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef0(mvRef0_x,mvRef0_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L0运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef0。示例性的,可以通过如下公式确定BlockDistanceRef0:BlockDistanceRef0=DistanceIndexCol–DistanceIndexRef0。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block Forward motion information is available), then the L0 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef0( mvRef0_x, mvRef0_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L0 motion vector is recorded as DistanceIndexRef0. Exemplarily, BlockDistanceRef0 may be determined by the following formula: BlockDistanceRef0=DistanceIndexCol−DistanceIndexRef0.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0(即时域相邻块的后向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动矢量记为mvRef1(mvRef1_x,mvRef1_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L1运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef1。示例性的,可以通过如下公式确定BlockDistanceRef1:BlockDistanceRef1=DistanceIndexCol–DistanceIndexRef1。If the L1 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block backward motion information is available), then the L1 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef1( mvRef1_x, mvRef1_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L1 motion vector is recorded as DistanceIndexRef1. Exemplarily, BlockDistanceRef1 may be determined by the following formula: BlockDistanceRef1=DistanceIndexCol−DistanceIndexRef1.

然后,令当前块的L0参考索引RefIdxL0等于0,当前块的L0运动矢量为mvE0(mvE0_x,mvE0_y),当前块的L1参考索引RefIdxL1等于0,当前块的L1运动矢量mvE1(mvE1_x,mvE1_y)。L0参考索引RefIdxL0和L0运动矢量mvE0(mvE0_x,mvE0_y)组成前向运动信息,L1参考索引RefIdxL1和L1运动矢量mvE1(mvE1_x,mvE1_y)组成后向运动信息。Then, the L0 reference index RefIdxL0 of the current block is equal to 0, the L0 motion vector of the current block is mvE0 (mvE0_x, mvE0_y), the L1 reference index RefIdxL1 of the current block is equal to 0, and the L1 motion vector of the current block is mvE1 (mvE1_x, mvE1_y). The L0 reference index RefIdxL0 and the L0 motion vector mvE0 (mvE0_x, mvE0_y) form the forward motion information, and the L1 reference index RefIdxL1 and the L1 motion vector mvE1 (mvE1_x, mvE1_y) form the backward motion information.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,采用公式(1)和(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y),并采用公式(5)和(6)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0, formula (1) and (2) Calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y), and use formulas (5) and (6) to calculate the L1 motion vector mvE1 (mvE1_x, mvE1_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引为-1,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,则采用公式(7)和(8)计算L0运动矢量mvE0(mvE0_x,mvE0_y),采用公式(3)和(4)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is -1, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, then formulas (7) and (8) are used to calculate the L0 motion Vector mvE0 (mvE0_x, mvE0_y), using the formulas (3) and (4) to calculate the L1 motion vector mvE1 (mvE1_x, mvE1_y).

在实施例4中,若当前帧为B帧,是以参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动信息作为参考运动信息,并以参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动信息作为参考运动信息。In Embodiment 4, if the current frame is a B frame, it is L0 of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index is 0 in the reference image queue 1 The motion information is used as the reference motion information, and the L1 motion information of the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is used as the reference motion information .

实施例5:为了得到当前块的时域运动信息,若当前块所在当前帧为P帧,即当前图像是P图像,则时域运动信息的确定方式参见实施例2,在此不再赘述。若当前块所在当前帧为B帧,即当前图像是B图像,则采用如下步骤确定当前块的时域运动信息:Embodiment 5: In order to obtain the temporal motion information of the current block, if the current frame where the current block is located is a P frame, that is, the current image is a P image, then the determination method of the temporal motion information refers to Embodiment 2, which will not be repeated here. If the current frame where the current block is located is a B frame, that is, the current image is a B image, then the following steps are used to determine the temporal motion information of the current block:

步骤s1、基于当前块的预设位置,从同位帧中确定出与该预设位置对应的时域相邻块,该时域相邻块的运动信息包括前向运动信息和后向运动信息。若时域相邻块的前向运动信息不可用,时域相邻块的后向运动信息不可用,则根据MVP方式得到当前块的时域运动信息。Step s1 , based on the preset position of the current block, determine the adjacent temporal block corresponding to the preset position from the co-located frame, and the motion information of the adjacent temporal block includes forward motion information and backward motion information. If the forward motion information of the neighboring blocks in the time domain is not available, and the backward motion information of the neighboring blocks in the time domain is not available, the time domain motion information of the current block is obtained according to the MVP method.

步骤s2、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Step s2, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion information of the current block can be determined according to the forward motion information of the neighboring block in the time domain and determine the backward motion information in the time domain motion information of the current block according to the backward motion information of the adjacent blocks in the time domain.

示例性的,步骤s2与步骤c2的实现过程类似,在此不再赘述。Exemplarily, the implementation process of step s2 is similar to that of step c2, and will not be repeated here.

步骤s3、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息不可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息。Step s3, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is not available, then the time domain motion of the current block can be determined according to the forward motion information of the neighboring block in the time domain Forward motion information in the message.

示例性的,关于根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息的过程,可以参见步骤c2中确定时域运动信息中的前向运动信息的过程,不再赘述。Exemplarily, for the process of determining the forward motion information in the temporal motion information of the current block according to the forward motion information of adjacent blocks in the temporal domain, please refer to the step c2 of determining the forward motion information in the temporal motion information process, no more details.

步骤s4、若时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Step s4, if the forward motion information of the neighboring blocks in the time domain is not available, and the backward motion information of the neighboring blocks in the time domain is available, then the time domain motion of the current block can be determined according to the backward motion information of the neighboring blocks in the time domain Backward motion information in the message.

示例性的,关于根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息的过程,可以参见步骤c2中确定时域运动信息中的后向运动信息的过程,不再赘述。Exemplarily, for the process of determining the backward motion information in the time domain motion information of the current block according to the backward motion information of adjacent blocks in the time domain, please refer to the step c2 of determining the backward motion information in the time domain motion information process, no more details.

以下结合一个具体应用场景,对实施例5的上述过程进行说明:The above-mentioned process of Embodiment 5 is described below in conjunction with a specific application scenario:

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引均为-1,则当前块的L0参考索引和L1参考索引均等于0。以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,然后将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束当前块的时域运动信息的导出过程。If the L0 reference index and the L1 reference frame index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 are both -1, Then the L0 reference index and the L1 reference index of the current block are both equal to 0. The size and position of the coding unit where the current block is located are used as the size and position of the current block, and then the L0 motion vector predictor and the L1 motion vector predictor obtained according to the MVP are respectively used as the L0 motion vector MvE0 and the L1 motion vector MvE1 of the current block, And make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block both equal to 0, and end the derivation process of the time-domain motion information of the current block.

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引不均为-1,则当前块的L0参考索引和L1参考索引均等于0。当前块的L0参考索引对应的图像的距离索引记为DistanceIndexL0,当前块的L1参考索引对应的图像的距离索引记为DistanceIndexL1;当前块的L0参考索引对应的图像的BlockDistance记为BlockDistanceL0,即当前块的L0参考索引对应的图像与当前帧的距离;当前块的L1参考索引对应的图像的BlockDistance记为BlockDistanceL1,即当前块的L1参考索引对应的图像与当前帧的距离。If the reference index value of the reference image queue 1 is 0, the L0 reference index and the L1 reference frame index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left luminance sample position of the current block is not both -1 , then the L0 reference index and the L1 reference index of the current block are both equal to 0. The distance index of the image corresponding to the L0 reference index of the current block is recorded as DistanceIndexL0, the distance index of the image corresponding to the L1 reference index of the current block is recorded as DistanceIndexL1; the BlockDistance of the image corresponding to the L0 reference index of the current block is recorded as BlockDistanceL0, that is, the current block The distance between the image corresponding to the L0 reference index of the current frame and the current frame; the BlockDistance of the image corresponding to the L1 reference index of the current block is recorded as BlockDistanceL1, that is, the distance between the image corresponding to the L1 reference index of the current block and the current frame.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0(即时域相邻块的前向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef0(mvRef0_x,mvRef0_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L0运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef0。示例性的,可以通过如下公式确定BlockDistanceRef0:BlockDistanceRef0=DistanceIndexCol–DistanceIndexRef0。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block Forward motion information is available), then the L0 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef0( mvRef0_x, mvRef0_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L0 motion vector is recorded as DistanceIndexRef0. Exemplarily, BlockDistanceRef0 may be determined by the following formula: BlockDistanceRef0=DistanceIndexCol−DistanceIndexRef0.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0(即时域相邻块的后向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动矢量记为mvRef1(mvRef1_x,mvRef1_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L1运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef1。示例性的,可以通过如下公式确定BlockDistanceRef1:BlockDistanceRef1=DistanceIndexCol–DistanceIndexRef1。If the L1 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block backward motion information is available), then the L1 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef1( mvRef1_x, mvRef1_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L1 motion vector is recorded as DistanceIndexRef1. Exemplarily, BlockDistanceRef1 may be determined by the following formula: BlockDistanceRef1=DistanceIndexCol−DistanceIndexRef1.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,令当前块的L0参考索引RefIdxL0等于0,L0运动矢量为mvE0(mvE0_x,mvE0_y),L1参考索引RefIdxL1等于0,L1运动矢量mvE1(mvE1_x,mvE1_y)。L0参考索引RefIdxL0和L0运动矢量mvE0(mvE0_x,mvE0_y)组成前向运动信息,L1参考索引RefIdxL1和L1运动矢量mvE1(mvE1_x,mvE1_y)组成后向运动信息。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index value is 0 in the reference image queue 1 is greater than or equal to 0, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, so that the L0 reference index RefIdxL0 of the current block is equal to 0, and the L0 motion The vector is mvE0(mvE0_x, mvE0_y), the L1 reference index RefIdxL1 is equal to 0, and the L1 motion vector mvE1(mvE1_x, mvE1_y). The L0 reference index RefIdxL0 and the L0 motion vector mvE0 (mvE0_x, mvE0_y) form the forward motion information, and the L1 reference index RefIdxL1 and the L1 motion vector mvE1 (mvE1_x, mvE1_y) form the backward motion information.

在此基础上,采用公式(1)和公式(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y),并采用公式(3)和公式(4)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。On this basis, formula (1) and formula (2) are used to calculate L0 motion vector mvE0(mvE0_x, mvE0_y), and formula (3) and formula (4) are used to calculate L1 motion vector mvE1(mvE1_x, mvE1_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引为-1,则令当前块的L0参考索引RefIdxL0等于0,当前块的L0运动矢量为mvE0(mvE0_x,mvE0_y),令当前块的L1参考索引RefIdxL1等于-1,令当前块的L1运动矢量为mvE1(0,0)。L0参考索引RefIdxL0和L0运动矢量mvE0(mvE0_x,mvE0_y)组成前向运动信息,且L1参考索引RefIdxL1为-1表示后向运动信息不可用。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index value is 0 in the reference image queue 1 is greater than or equal to 0, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is -1, then the L0 reference index RefIdxL0 of the current block is equal to 0, and the current The L0 motion vector of the block is mvE0(mvE0_x, mvE0_y), let the L1 reference index RefIdxL1 of the current block be equal to -1, and let the L1 motion vector of the current block be mvE1(0,0). The L0 reference index RefIdxL0 and the L0 motion vector mvE0 (mvE0_x, mvE0_y) constitute the forward motion information, and the L1 reference index RefIdxL1 being -1 indicates that the backward motion information is not available.

在此基础上,采用公式(1)和公式(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y)。On this basis, formula (1) and formula (2) are used to calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引为-1,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,则令当前块的L0参考索引RefIdxL0等于-1,当前块的L0运动矢量为mvE0(0,0),令当前块的L1参考索引RefIdxL1等于0,令当前块的L1运动矢量为mvE1(mvE1_x,mvE1_y)。L1参考索引RefIdxL1和L1运动矢量mvE1(mvE1_x,mvE1_y)组成后向运动信息,且L0参考索引RefIdxL0为-1表示前向运动信息不可用。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is -1, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, then the L0 reference index RefIdxL0 of the current block is equal to -1, The L0 motion vector of the current block is mvE0(0,0), the L1 reference index RefIdxL1 of the current block is equal to 0, and the L1 motion vector of the current block is mvE1(mvE1_x, mvE1_y). The L1 reference index RefIdxL1 and the L1 motion vector mvE1 (mvE1_x, mvE1_y) constitute the backward motion information, and the L0 reference index RefIdxL0 being -1 indicates that the forward motion information is not available.

在此基础上,采用公式(3)和公式(4)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。On this basis, formula (3) and formula (4) are used to calculate the L1 motion vector mvE1(mvE1_x, mvE1_y).

实施例6:为了得到当前块的时域运动信息,若当前块所在当前帧为P帧,即当前图像是P图像,则时域运动信息的确定方式参见实施例2,在此不再赘述。若当前块所在当前帧为B帧,即当前图像是B图像,则采用如下步骤确定当前块的时域运动信息:Embodiment 6: In order to obtain the time domain motion information of the current block, if the current frame where the current block is located is a P frame, that is, the current image is a P image, then the determination method of the time domain motion information refers to Embodiment 2, which will not be repeated here. If the current frame where the current block is located is a B frame, that is, the current image is a B image, then the following steps are used to determine the temporal motion information of the current block:

步骤w1、基于当前块的预设位置,从同位帧中确定出与该预设位置对应的时域相邻块,该时域相邻块的运动信息包括前向运动信息和后向运动信息。若时域相邻块的前向运动信息不可用,时域相邻块的后向运动信息不可用,则根据MVP方式得到当前块的时域运动信息。Step w1, based on the preset position of the current block, determine the adjacent block in time domain corresponding to the preset position from the co-located frame, the motion information of the adjacent block in time domain includes forward motion information and backward motion information. If the forward motion information of the neighboring blocks in the time domain is not available, and the backward motion information of the neighboring blocks in the time domain is not available, the time domain motion information of the current block is obtained according to the MVP method.

步骤w2、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息,并根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息。Step w2, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion information of the current block can be determined according to the forward motion information of the neighboring block in the time domain The forward motion information in the time domain, and determine the backward motion information in the time domain motion information of the current block according to the forward motion information of the adjacent blocks in the time domain.

示例性的,与步骤c2相比,根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息,不是根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。关于根据时域相邻块的前向运动信息确定当前块的时域运动信息中的后向运动信息的过程,可以参见步骤c3,在此不再赘述。关于根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息的过程,可以参见步骤c2,在此不再赘述。Exemplarily, compared with step c2, the backward motion information in the time domain motion information of the current block is determined according to the forward motion information of the time domain adjacent blocks, instead of the current Backward motion information in the block's temporal motion information. For the process of determining the backward motion information in the time domain motion information of the current block according to the forward motion information of adjacent blocks in the time domain, please refer to step c3, which will not be repeated here. For the process of determining the forward motion information in the time domain motion information of the current block according to the forward motion information of adjacent blocks in the time domain, please refer to step c2, which will not be repeated here.

步骤w3、若时域相邻块的前向运动信息可用,且时域相邻块的后向运动信息不可用,则可以根据时域相邻块的前向运动信息确定当前块的时域运动信息中的前向运动信息。Step w3, if the forward motion information of the neighboring block in the time domain is available, and the backward motion information of the neighboring block in the time domain is not available, then the time domain motion of the current block can be determined according to the forward motion information of the neighboring block in the time domain Forward motion information in the message.

步骤w4、若时域相邻块的前向运动信息不可用,且时域相邻块的后向运动信息可用,则可以根据时域相邻块的后向运动信息确定当前块的时域运动信息中的后向运动信息。Step w4. If the forward motion information of the neighboring block in the time domain is not available, and the backward motion information of the neighboring block in the time domain is available, then the time domain motion of the current block can be determined according to the backward motion information of the neighboring block in the time domain Backward motion information in the message.

以下结合一个具体应用场景,对实施例6的上述过程进行说明:The above process of Embodiment 6 is described below in conjunction with a specific application scenario:

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引均为-1,则当前块的L0参考索引和L1参考索引均等于0。以当前块所在编码单元的尺寸和位置作为当前块的尺寸和位置,然后将根据MVP得到的L0运动矢量预测值和L1运动矢量预测值分别作为当前块的L0运动矢量MvE0和L1运动矢量MvE1,并令当前块的L0参考索引RefIdxL0和L1参考索引RefIdxL1均等于0,结束当前块的时域运动信息的导出过程。If the L0 reference index and the L1 reference frame index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 are both -1, Then the L0 reference index and the L1 reference index of the current block are both equal to 0. The size and position of the coding unit where the current block is located are used as the size and position of the current block, and then the L0 motion vector predictor and the L1 motion vector predictor obtained according to the MVP are respectively used as the L0 motion vector MvE0 and the L1 motion vector MvE1 of the current block, And make the L0 reference index RefIdxL0 and the L1 reference index RefIdxL1 of the current block both equal to 0, and end the derivation process of the time-domain motion information of the current block.

如果参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引和L1参考帧索引不均为-1,则当前块的L0参考索引和L1参考索引均等于0。当前块的L0参考索引对应的图像的距离索引记为DistanceIndexL0,当前块的L1参考索引对应的图像的距离索引记为DistanceIndexL1;当前块的L0参考索引对应的图像的BlockDistance记为BlockDistanceL0,即当前块的L0参考索引对应的图像与当前帧的距离;当前块的L1参考索引对应的图像的BlockDistance记为BlockDistanceL1,即当前块的L1参考索引对应的图像与当前帧的距离。If the reference index value of the reference image queue 1 is 0, the L0 reference index and the L1 reference frame index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left luminance sample position of the current block is not both -1 , then the L0 reference index and the L1 reference index of the current block are both equal to 0. The distance index of the image corresponding to the L0 reference index of the current block is recorded as DistanceIndexL0, the distance index of the image corresponding to the L1 reference index of the current block is recorded as DistanceIndexL1; the BlockDistance of the image corresponding to the L0 reference index of the current block is recorded as BlockDistanceL0, that is, the current block The distance between the image corresponding to the L0 reference index of the current frame and the current frame; the BlockDistance of the image corresponding to the L1 reference index of the current block is recorded as BlockDistanceL1, that is, the distance between the image corresponding to the L1 reference index of the current block and the current frame.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0(即时域相邻块的前向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L0运动矢量记为mvRef0(mvRef0_x,mvRef0_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L0运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef0。示例性的,可以通过如下公式确定BlockDistanceRef0:BlockDistanceRef0=DistanceIndexCol–DistanceIndexRef0。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block Forward motion information is available), then the L0 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef0( mvRef0_x, mvRef0_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L0 motion vector is recorded as DistanceIndexRef0. Exemplarily, BlockDistanceRef0 may be determined by the following formula: BlockDistanceRef0=DistanceIndexCol−DistanceIndexRef0.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0(即时域相邻块的后向运动信息可用),则在参考图像队列1中参考索引为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元的L1运动矢量记为mvRef1(mvRef1_x,mvRef1_y),该运动信息存储单元所在的图像的距离索引记为DistanceIndexCol,该L1运动矢量指向的参考单元所在的图像的距离索引记为DistanceIndexRef1。示例性的,可以通过如下公式确定BlockDistanceRef1:BlockDistanceRef1=DistanceIndexCol–DistanceIndexRef1。If the L1 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the upper-left corner luminance sample position of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is greater than or equal to 0 (the time-domain adjacent block backward motion information is available), then the L1 motion vector of the time domain motion information storage unit where the luminance sample corresponding to the luminance sample position of the upper left corner of the current block in the image whose reference index is 0 in the reference image queue 1 is recorded as mvRef1( mvRef1_x, mvRef1_y), the distance index of the image where the motion information storage unit is located is recorded as DistanceIndexCol, and the distance index of the image where the reference unit pointed to by the L1 motion vector is recorded as DistanceIndexRef1. Exemplarily, BlockDistanceRef1 may be determined by the following formula: BlockDistanceRef1=DistanceIndexCol−DistanceIndexRef1.

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,令当前块的L0参考索引RefIdxL0等于0,L0运动矢量为mvE0(mvE0_x,mvE0_y),L1参考索引RefIdxL1等于0,L1运动矢量mvE1(mvE1_x,mvE1_y)。L0参考索引RefIdxL0和L0运动矢量mvE0(mvE0_x,mvE0_y)组成前向运动信息,L1参考索引RefIdxL1和L1运动矢量mvE1(mvE1_x,mvE1_y)组成后向运动信息。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index value is 0 in the reference image queue 1 is greater than or equal to 0, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, so that the L0 reference index RefIdxL0 of the current block is equal to 0, and the L0 motion The vector is mvE0(mvE0_x, mvE0_y), the L1 reference index RefIdxL1 is equal to 0, and the L1 motion vector mvE1(mvE1_x, mvE1_y). The L0 reference index RefIdxL0 and the L0 motion vector mvE0 (mvE0_x, mvE0_y) form the forward motion information, and the L1 reference index RefIdxL1 and the L1 motion vector mvE1 (mvE1_x, mvE1_y) form the backward motion information.

在此基础上,采用公式(1)和公式(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y),并采用公式(5)和公式(6)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。On this basis, formula (1) and formula (2) are used to calculate L0 motion vector mvE0(mvE0_x, mvE0_y), and formula (5) and formula (6) are used to calculate L1 motion vector mvE1(mvE1_x, mvE1_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引大于等于0,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引为-1,则令当前块的L0参考索引RefIdxL0等于0,当前块的L0运动矢量为mvE0(mvE0_x,mvE0_y),令当前块的L1参考索引RefIdxL1等于-1,令当前块的L1运动矢量为mvE1(0,0)。L0参考索引RefIdxL0和L0运动矢量mvE0(mvE0_x,mvE0_y)组成前向运动信息,且L1参考索引RefIdxL1为-1表示后向运动信息不可用。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image whose reference index value is 0 in the reference image queue 1 is greater than or equal to 0, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is -1, then the L0 reference index RefIdxL0 of the current block is equal to 0, and the current The L0 motion vector of the block is mvE0(mvE0_x, mvE0_y), let the L1 reference index RefIdxL1 of the current block be equal to -1, and let the L1 motion vector of the current block be mvE1(0,0). The L0 reference index RefIdxL0 and the L0 motion vector mvE0 (mvE0_x, mvE0_y) constitute the forward motion information, and the L1 reference index RefIdxL1 being -1 indicates that the backward motion information is not available.

在此基础上,采用公式(1)和公式(2)计算L0运动矢量mvE0(mvE0_x,mvE0_y)。On this basis, formula (1) and formula (2) are used to calculate the L0 motion vector mvE0 (mvE0_x, mvE0_y).

若参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L0参考索引为-1,参考图像队列1中参考索引值为0的图像中与当前块的左上角亮度样本位置对应的亮度样本所在的时域运动信息存储单元存储的L1参考索引大于等于0,则令当前块的L0参考索引RefIdxL0等于-1,当前块的L0运动矢量为mvE0(0,0),令当前块的L1参考索引RefIdxL1等于0,令当前块的L1运动矢量为mvE1(mvE1_x,mvE1_y)。L1参考索引RefIdxL1和L1运动矢量mvE1(mvE1_x,mvE1_y)组成后向运动信息,且L0参考索引RefIdxL0为-1表示前向运动信息不可用。If the L0 reference index stored in the time-domain motion information storage unit where the luminance sample corresponding to the luminance sample position in the upper left corner of the current block is located in the image with a reference index value of 0 in the reference image queue 1 is -1, the reference image in the reference image queue 1 In an image with an index value of 0, the L1 reference index stored in the time domain motion information storage unit where the luminance sample corresponding to the upper left corner luminance sample position of the current block is located is greater than or equal to 0, then the L0 reference index RefIdxL0 of the current block is equal to -1, The L0 motion vector of the current block is mvE0(0,0), the L1 reference index RefIdxL1 of the current block is equal to 0, and the L1 motion vector of the current block is mvE1(mvE1_x, mvE1_y). The L1 reference index RefIdxL1 and the L1 motion vector mvE1 (mvE1_x, mvE1_y) constitute the backward motion information, and the L0 reference index RefIdxL0 being -1 indicates that the forward motion information is not available.

在此基础上,采用公式(3)和公式(4)计算L1运动矢量mvE1(mvE1_x,mvE1_y)。On this basis, formula (3) and formula (4) are used to calculate the L1 motion vector mvE1(mvE1_x, mvE1_y).

在上述各实施例中,当前块也可以称为当前预测单元。In the foregoing embodiments, the current block may also be referred to as the current prediction unit.

在一种可能的实施方式中,若控制信息允许当前块启用时域运动信息导出模式,则可以采用实施例1-实施例6的任意实施例,导出当前块的时域运动信息。示例性的,控制信息可以包括但不限于:序列级控制信息,帧级控制信息,Slice(片)级控制信息,Tile(片)级控制信息,Patch(片)级控制信息,CTU(Coding Tee Unit,编码树单元)级控制信息,LCU(Largest Coding Unit,最大编码单元)级控制信息,块级控制信息,CU(Coding Unit,编码单元)级控制信息,PU(Prediction Unit,预测单元)级控制信息等,对此不做限制。例如,针对编码端和解码端来说,若获知控制信息允许当前块启用时域运动信息导出模式,则采用实施例1-实施例6的任意实施例,导出当前块的时域运动信息。In a possible implementation manner, if the control information allows the current block to enable the time-domain motion information derivation mode, any embodiment of Embodiment 1 to Embodiment 6 may be used to derive the time-domain motion information of the current block. Exemplarily, the control information may include but not limited to: sequence level control information, frame level control information, Slice (piece) level control information, Tile (piece) level control information, Patch (piece) level control information, CTU (Coding Tee Unit, coding tree unit) level control information, LCU (Largest Coding Unit, maximum coding unit) level control information, block level control information, CU (Coding Unit, coding unit) level control information, PU (Prediction Unit, prediction unit) level Control information, etc., without limitation. For example, for the encoding end and the decoding end, if it is known that the control information allows the current block to enable the time-domain motion information derivation mode, any embodiment of Embodiment 1-Embodiment 6 is used to derive the time-domain motion information of the current block.

实施例7:基于实施例1-实施例6的时域运动信息导出方式,本申请实施例提出一种编解码方法,可以应用于编码端或者解码端。针对编码端来说,可以构建当前块的运动信息候选列表,该运动信息候选列表包括当前块的时域运动信息,当前块的时域运动信息的导出方式可以参见实施例1-实施例6中的任意实施例,在此不再赘述。在得到运动信息候选列表后,编码端依次遍历运动信息候选列表中的每个运动信息,确定该运动信息对应的率失真代价值,并选择最小的率失真代价值所对应的运动信息。将最小的率失真代价值所对应的运动信息在运动信息候选列表中的位置索引信息携带进当前块的编码比特流,传送给解码端。Embodiment 7: Based on the time-domain motion information derivation method of Embodiment 1-Embodiment 6, this embodiment of the present application proposes a codec method, which can be applied to the encoding end or the decoding end. For the encoding side, a motion information candidate list of the current block can be constructed, and the motion information candidate list includes the time-domain motion information of the current block. For the derivation method of the time-domain motion information of the current block, refer to Embodiment 1-Embodiment 6 Any embodiment of the present invention will not be repeated here. After obtaining the motion information candidate list, the encoding end sequentially traverses each motion information in the motion information candidate list, determines the rate-distortion cost value corresponding to the motion information, and selects the motion information corresponding to the smallest rate-distortion cost value. The position index information of the motion information corresponding to the minimum rate-distortion cost value in the motion information candidate list is carried into the coded bit stream of the current block, and transmitted to the decoding end.

针对解码端来说,也可以构建当前块的运动信息候选列表,该运动信息候选列表包括当前块的时域运动信息,当前块的时域运动信息的导出方式可以参见实施例1-实施例6中的任意实施例,在此不再赘述。解码端构建的运动信息候选列表与编码端构建的运动信息候选列表相同。解码端可以从当前块的编码比特流中解析出运动信息在运动信息候选列表中的位置索引信息,并从运动信息候选列表中选择与该位置索引信息对应的运动信息,基于选择的运动信息对当前块进行运动补偿,得到当前块的预测值,对此运动补偿过程不做限制。For the decoding end, a motion information candidate list of the current block can also be constructed, the motion information candidate list includes the time-domain motion information of the current block, and the derivation method of the time-domain motion information of the current block can refer to Embodiment 1-Embodiment 6 Any embodiment in the above will not be repeated here. The motion information candidate list constructed by the decoder is the same as the motion information candidate list constructed by the encoder. The decoding end can analyze the position index information of the motion information in the motion information candidate list from the coded bit stream of the current block, and select the motion information corresponding to the position index information from the motion information candidate list, based on the selected motion information to Motion compensation is performed on the current block to obtain a prediction value of the current block, and there is no limitation on this motion compensation process.

实施例8:实施例1-实施例7的实现过程,可以应用于AWP(Angular WeightedPrediction,角度加权预测)模式中,即运动信息候选列表可以为AWP模式的运动信息候选列表,AWP模式通过借助帧内角度预测思想,先设置当前块周边位置(整像素位置以及亚像素位置)的参考权重值,而后利用角度得到每个像素位置对应的权重值,通过最终得到的权重阵列实现两个不同的帧间预测值的加权,以下结合AWP模式对运动信息候选列表进行说明。Embodiment 8: The implementation process of Embodiment 1-Embodiment 7 can be applied in the AWP (Angular Weighted Prediction, angle weighted prediction) mode, that is, the motion information candidate list can be the motion information candidate list of the AWP mode, and the AWP mode uses the frame The idea of inner angle prediction is to first set the reference weight value of the peripheral position of the current block (integral pixel position and sub-pixel position), and then use the angle to obtain the corresponding weight value of each pixel position, and realize two different frames through the finally obtained weight array The weighting of the inter-prediction value, the motion information candidate list will be described below in conjunction with the AWP mode.

步骤e1、在确定对当前块启动角度加权预测时,获取当前块的权重预测角度,当前块的权重预测位置,及当前块的权重变换率。基于当前块的权重预测角度,当前块的权重预测位置和当前块的尺寸中的至少一个,确定当前块的权重变换的起始位置。示例性的,可以将当前块的权重变换率和当前块的权重变换的起始位置,统称为当前块的权重配置参数。Step e1, when it is determined to start angle-weighted prediction for the current block, obtain the weight prediction angle of the current block, the weight prediction position of the current block, and the weight conversion rate of the current block. Based on at least one of the weight prediction angle of the current block, the weight prediction position of the current block, and the size of the current block, the starting position of the weight transformation of the current block is determined. Exemplarily, the weight transformation rate of the current block and the starting position of the weight transformation of the current block may be collectively referred to as weight configuration parameters of the current block.

示例性的,权重预测角度表示当前块内部的像素位置所指向的角度方向,参见图4A所示,基于某一种权重预测角度,示出了当前块内部的像素位置(如像素位置1、像素位置2和像素位置3)所指向的角度方向,该角度方向指向当前块外部的某个周边位置。参见图4B所示,基于另一种权重预测角度,示出了当前块内部的像素位置(如像素位置2、像素位置3和像素位置4)所指向的角度方向,该角度方向指向当前块外部的某个周边位置。Exemplarily, the weight prediction angle indicates the angle direction pointed to by the pixel position inside the current block. Referring to FIG. 4A , based on a certain weight prediction angle, it shows the pixel position inside the current block (such as pixel position 1, pixel The angular direction pointed by position 2 and pixel position 3) points to some peripheral position outside the current block. Referring to FIG. 4B , based on another weight prediction angle, it shows the angular direction pointed by the pixel positions (such as pixel position 2, pixel position 3 and pixel position 4) inside the current block, and the angular direction points to the outside of the current block a surrounding location.

该权重预测角度可以是任意角度,如180度内任意角度,或,360度内任意角度,对此权重预测角度不做限制。例如,该权重预测角度可以为水平角度或垂直角度,或,该权重预测角度的斜率的绝对值可以为2的n次方,n为整数,如正整数,0,负整数等。例如,权重预测角度的斜率的绝对值可以为1(即2的0次方),2(即2的1次方),1/2(即2的-1次方)等。参见图4C所示,示出了8种权重预测角度,其斜率的绝对值为2的n次方。The weight prediction angle may be any angle, such as any angle within 180 degrees, or any angle within 360 degrees, and there is no limitation on the weight prediction angle. For example, the weight prediction angle may be a horizontal angle or a vertical angle, or the absolute value of the slope of the weight prediction angle may be 2 to the nth power, where n is an integer, such as a positive integer, 0, a negative integer, and the like. For example, the absolute value of the slope of the weight prediction angle may be 1 (ie, 2 to the 0th power), 2 (ie, 2 to the 1st power), 1/2 (ie, 2 to the -1 power), etc. Referring to FIG. 4C , there are 8 kinds of weight prediction angles, and the absolute value of the slope is 2 to the nth power.

权重预测位置用于配置当前块外部周边位置的参考权重值。例如,根据当前块的权重预测角度、当前块的尺寸等,确定当前块外部的周边位置的范围(即当前块外部的周边位置的数量),将周边位置的范围进行N等分,N的取值任意配置,如4、6、8等,以8为例进行说明,权重预测位置用于表示当前块外部的哪个周边位置作为当前块的权重变换的起始位置,从而根据权重变换的起始位置配置当前块外部的周边位置的参考权重值。参见图4D所示,在将所有周边位置8等分后,可以得到7个权重预测位置。在此基础上,当权重预测位置为0时,可以表示周边位置a0作为当前块外部周边位置的权重变换的起始位置,以此类推。The weight prediction position is used to configure the reference weight value of the peripheral position outside the current block. For example, according to the weight prediction angle of the current block, the size of the current block, etc., the range of peripheral positions outside the current block (that is, the number of peripheral positions outside the current block) is determined, and the range of peripheral positions is divided into N equal parts. The value can be configured arbitrarily, such as 4, 6, 8, etc., and 8 is used as an example for illustration. The weight prediction position is used to indicate which peripheral position outside the current block is used as the starting position of the weight transformation of the current block, so that according to the starting position of the weight transformation Position configures the reference weight value for surrounding positions outside the current block. Referring to FIG. 4D , after dividing all surrounding positions into 8 equal parts, 7 weighted prediction positions can be obtained. On this basis, when the weight prediction position is 0, it may indicate that the surrounding position a0 is used as the starting position of the weight transformation of the surrounding positions outside the current block, and so on.

权重变换率表示当前块外部的周边位置的参考权重值的变换率,用于表示参考权重值的变化速度,权重变换率可以是不为0的任意数,如权重变换率可以是-4、-2、-1、1、2、4、0.5、0.75、1.5等。权重变换率的绝对值为1时,即,权重变换率为-1或者1,用于表示参考权重值的变化速度为1,基于此,参考权重值从0到8需要经过0,1,2,3,4,5,6,7,8等数值,参考权重值从8到0需要经过8,7,6,5,4,3,2,1,0等数值。The weight conversion rate indicates the conversion rate of the reference weight value of the peripheral position outside the current block, and is used to indicate the change speed of the reference weight value. The weight conversion rate can be any number other than 0. For example, the weight conversion rate can be -4, - 2, -1, 1, 2, 4, 0.5, 0.75, 1.5, etc. When the absolute value of the weight conversion rate is 1, that is, the weight conversion rate is -1 or 1, which is used to indicate that the change speed of the reference weight value is 1. Based on this, the reference weight value needs to go through 0, 1, 2 from 0 to 8 , 3, 4, 5, 6, 7, 8 and other values, the reference weight value needs to go through 8, 7, 6, 5, 4, 3, 2, 1, 0 and other values from 8 to 0.

步骤e2、根据当前块的权重配置参数为当前块外部的周边位置配置参考权重值。Step e2. Configure reference weight values for peripheral positions outside the current block according to the weight configuration parameters of the current block.

示例性的,当前块外部的周边位置的数量可以是基于当前块的尺寸和/或当前块的权重预测角度确定,例如,基于当前块的尺寸和/或当前块的权重预测角度确定当前块外部的周边位置的数量M,并根据当前块的权重配置参数为M个周边位置配置参考权重值。Exemplarily, the number of peripheral positions outside the current block may be determined based on the size of the current block and/or the weighted prediction angle of the current block, for example, the number of peripheral positions outside the current block may be determined based on the size of the current block and/or the weighted prediction angle of the current block. The number M of the surrounding positions of the block, and configure reference weight values for the M surrounding positions according to the weight configuration parameters of the current block.

示例性的,当前块外部的周边位置可以包括整像素位置,或者,亚像素位置,或者,整像素位置和亚像素位置。当前块外部的周边位置可以包括但不限于:当前块外部上侧一行的周边位置,或者,当前块外部左侧一列的周边位置,或者,当前块外部下侧一行的周边位置,或者,当前块外部右侧一列的周边位置。当然,上述只是周边位置的示例,对此不做限制。Exemplarily, the peripheral positions outside the current block may include integer pixel positions, or sub-pixel positions, or both integer pixel positions and sub-pixel positions. The peripheral position outside the current block may include but not limited to: the peripheral position of the upper row outside the current block, or the peripheral position of the left column outside the current block, or the peripheral position of the lower row outside the current block, or the current block The perimeter position of the outer right column. Of course, the above are only examples of peripheral locations, and are not limited thereto.

在步骤e2中,需要先获取有效数量(当前块外部的周边位置的数量为有效数量)个参考权重值,该有效数量可以是基于当前块的尺寸和/或当前块的权重预测角度确定,例如,可以采用如下方式确定该有效数量:ValidLenth=(N+(M>>X))<<1,N和M分别是当前块的高和宽,X为当前块的权重预测角度的斜率的绝对值的log2对数值,如0或1。In step e2, it is necessary to obtain an effective number (the number of peripheral positions outside the current block is an effective number) reference weight values. The effective number can be determined based on the size of the current block and/or the weight prediction angle of the current block, for example , the effective number can be determined in the following manner: ValidLenth=(N+(M>>X))<<1, N and M are the height and width of the current block respectively, and X is the absolute value of the slope of the weight prediction angle of the current block The log2 logarithmic value, such as 0 or 1.

针对有效数量个参考权重值,可以单调递增,或,单调递减。例如,有效数量个参考权重值可以为[88...88765432100...00],即单调递减。又例如,有效数量个参考权重值可以为[00...00123456788...88],即单调递增。当然,上述只是示例,对此不做限制。A valid number of reference weight values may be monotonically increasing or monotonically decreasing. For example, the valid number of reference weight values may be [88...88765432100...00], that is, monotonically decreasing. For another example, the effective number of reference weight values may be [00...00123456788...88], that is, monotonically increasing. Of course, the above is just an example, without limitation.

参见图4E所示,为有效数量个参考权重值的几个示例情况,对此不做限制。Referring to FIG. 4E , there are several examples of effective number of reference weight values, which are not limited.

在一种可能的实施方式中,可以根据权重变换率和权重变换的起始位置,确定有效数量个参考权重值。例如,可以采用如下方式确定参考权重值:y=Clip3(最小值,最大值,a*(x-s)),x表示周边位置的索引,即x的取值范围可以是1-有效数量值,如x为1,表示第1个周边位置,y表示第1个周边位置的参考权重值,x为2,表示第2个周边位置,y表示第2个周边位置的参考权重值。a用于表示权重变换率,s用于表示权重变换的起始位置。In a possible implementation manner, an effective number of reference weight values may be determined according to the weight conversion rate and the starting position of the weight conversion. For example, the reference weight value can be determined in the following manner: y=Clip3 (minimum value, maximum value, a*(x-s)), x represents the index of the surrounding position, that is, the value range of x can be 1-effective quantity value, such as When x is 1, it represents the first peripheral position, y represents the reference weight value of the first peripheral position, x is 2, it represents the second peripheral position, and y represents the reference weight value of the second peripheral position. a is used to indicate the weight transformation rate, and s is used to indicate the starting position of the weight transformation.

Clip3用于限制参考权重值位于最小值与最大值之间,最小值和最大值均可以根据经验配置,为了方便描述,在后续过程中,以最小值为0,最大值为8为例进行说明。Clip3 is used to limit the reference weight value between the minimum value and the maximum value. Both the minimum value and the maximum value can be configured based on experience. For the convenience of description, in the following process, the minimum value is 0 and the maximum value is 8. .

s表示权重变换的起始位置,s可以由权重预测位置确定,例如,s=f(权重预测位置),即s是一个与权重预测位置有关的函数。例如,在当前块外部的周边位置的范围确定后,可以确定周边位置的有效数量,并将所有周边位置进行N等分,N的取值可以任意配置,如4、6、8等,而权重预测位置用于表示采用当前块外部的哪个周边位置作为当前块的目标周边区域,而这个权重预测位置对应的周边位置就是权重变换的起始位置。或者,s可以由权重预测角度和权重预测位置确定,例如,s=f(权重预测角度,权重预测位置),即s是一个与权重预测角度和权重预测位置有关的函数。例如,可以根据权重预测角度确定当前块外部的周边位置的范围,在当前块外部的周边位置的范围确定后,可以确定周边位置的有效数量,并将所有周边位置进行N等分,权重预测位置用于表示采用当前块外部的哪个周边位置作为当前块的目标周边区域,而这个权重预测位置对应的周边位置就可以是权重变换的起始位置。s represents the starting position of the weight transformation, and s can be determined by the weight prediction position, for example, s=f (weight prediction position), that is, s is a function related to the weight prediction position. For example, after the range of surrounding positions outside the current block is determined, the effective number of surrounding positions can be determined, and all surrounding positions are divided into N equal parts. The value of N can be configured arbitrarily, such as 4, 6, 8, etc., and the weight The predicted position is used to indicate which surrounding position outside the current block is used as the target surrounding area of the current block, and the surrounding position corresponding to the weighted predicted position is the starting position of the weight transformation. Or, s may be determined by weight prediction angle and weight prediction position, for example, s=f(weight prediction angle, weight prediction position), that is, s is a function related to weight prediction angle and weight prediction position. For example, the range of surrounding positions outside the current block can be determined according to the weight prediction angle. After the range of surrounding positions outside the current block is determined, the effective number of surrounding positions can be determined, and all surrounding positions are divided into N equal parts, and the weight prediction position It is used to indicate which surrounding position outside the current block is used as the target surrounding area of the current block, and the surrounding position corresponding to the weight prediction position can be the starting position of weight transformation.

综上所述,可以得到当前块的有效数量个参考权重值,这些参考权重值单调递增或单调递减。然后,根据有效数量个参考权重值,配置当前块外部的周边位置的参考权重值。示例性的,当前块外部的周边位置的数量为有效数量,且参考权重值的数量为有效数量,因此,可以将有效数量个参考权重值,配置为当前块外部的周边位置的参考权重值。To sum up, an effective number of reference weight values of the current block can be obtained, and these reference weight values monotonically increase or monotonically decrease. Then, according to the valid number of reference weight values, the reference weight values of peripheral positions outside the current block are configured. Exemplarily, the number of peripheral positions outside the current block is an effective number, and the number of reference weight values is an effective number, therefore, an effective number of reference weight values may be configured as reference weight values for peripheral positions outside the current block.

步骤e3、针对当前块的每个像素位置,根据当前块的权重预测角度从当前块外部的周边位置中确定该像素位置指向的周边匹配位置;根据该周边匹配位置关联的参考权重值确定该像素位置的目标权重值,根据该像素位置的目标权重值确定该像素位置的关联权重值。Step e3, for each pixel position of the current block, determine the surrounding matching position pointed to by the pixel position from the surrounding positions outside the current block according to the weight prediction angle of the current block; determine the pixel according to the reference weight value associated with the surrounding matching position The target weight value of the position, and determine the associated weight value of the pixel position according to the target weight value of the pixel position.

示例性的,由于权重预测角度表示当前块内部的像素位置所指向的角度方向,因此,针对当前块的每个像素位置,基于该权重预测角度确定该像素位置所指向的角度方向,继而根据该角度方向从当前块外部的周边位置中确定该像素位置指向的周边匹配位置。Exemplarily, since the weighted prediction angle represents the angular direction pointed to by the pixel position inside the current block, therefore, for each pixel position of the current block, the angular direction pointed to by the pixel position is determined based on the weighted predicted angle, and then according to the The angular direction determines the surrounding matching location that the pixel location points to from the surrounding locations outside the current block.

针对当前块的每个像素位置,在确定该像素位置指向的周边匹配位置后,基于该周边匹配位置关联的参考权重值确定该像素位置的目标权重值,例如,将该周边匹配位置关联的参考权重值确定为该像素位置的目标权重值。然后,根据该像素位置的目标权重值确定该像素位置的关联权重值,例如,每个像素位置的目标权重值与关联权重值的和,可以均为固定的预设数值,因此,关联权重值可以为预设数值与目标权重值之差。假设预设数值为8,像素位置的目标权重值为0,则该像素位置的关联权重值为8;若像素位置的目标权重值为1,则该像素位置的关联权重值为7,以此类推,只要目标权重值与关联权重值之和为8即可。For each pixel position of the current block, after determining the surrounding matching position pointed to by the pixel position, determine the target weight value of the pixel position based on the reference weight value associated with the surrounding matching position, for example, the reference weight value associated with the surrounding matching position The weight value is determined as the target weight value for the pixel location. Then, determine the associated weight value of the pixel position according to the target weight value of the pixel position. For example, the sum of the target weight value and the associated weight value of each pixel position can be a fixed preset value. Therefore, the associated weight value It can be the difference between the preset value and the target weight value. Suppose the preset value is 8, and the target weight value of the pixel position is 0, then the associated weight value of the pixel position is 8; if the target weight value of the pixel position is 1, the associated weight value of the pixel position is 7, so that By analogy, as long as the sum of the target weight value and the associated weight value is 8.

步骤e4,获取运动信息候选列表,该运动信息候选列表包括至少一个候选运动信息;基于该运动信息候选列表获取当前块的第一目标运动信息和第二目标运动信息。Step e4, obtaining a motion information candidate list, the motion information candidate list including at least one motion information candidate; obtaining the first target motion information and the second target motion information of the current block based on the motion information candidate list.

针对编码端来说,可以基于率失真原则,从运动信息候选列表中选择一个候选运动信息作为当前块的第一目标运动信息,从运动信息候选列表中选择另一个候选运动信息作为当前块的第二目标运动信息,第一目标运动信息与第二目标运动信息不同,对此不做限制。For the encoding side, based on the rate-distortion principle, one candidate motion information can be selected from the motion information candidate list as the first target motion information of the current block, and another candidate motion information can be selected from the motion information candidate list as the first target motion information of the current block. Two target motion information, the first target motion information is different from the second target motion information, which is not limited.

编码端向解码端发送编码比特流时,编码比特流携带指示信息a和指示信息b,指示信息a用于指示当前块的第一目标运动信息的索引值1,索引值1表示第一目标运动信息是运动信息候选列表中的第几个候选运动信息。指示信息b用于指示当前块的第二目标运动信息的索引值2,索引值2表示第二目标运动信息是运动信息候选列表中的第几个候选运动信息。When the encoding end sends the encoded bit stream to the decoding end, the encoded bit stream carries indication information a and indication information b, the indication information a is used to indicate the index value 1 of the first target motion information of the current block, and the index value 1 indicates the first target motion The information is the number of candidate motion information in the motion information candidate list. The indication information b is used to indicate the index value 2 of the second target motion information of the current block, and the index value 2 indicates which candidate motion information the second target motion information is in the motion information candidate list.

针对解码端来说,在接收到编码比特流后,从编码比特流中解析出指示信息a和指示信息b。基于指示信息a,解码端从运动信息候选列表中选择索引值1对应的候选运动信息,该候选运动信息作为当前块的第一目标运动信息。基于指示信息b,解码端从运动信息候选列表中选择索引值2对应的候选运动信息,该候选运动信息作为当前块的第二目标运动信息。For the decoding end, after receiving the coded bit stream, the indication information a and the indication information b are parsed from the coded bit stream. Based on the indication information a, the decoding end selects the candidate motion information corresponding to the index value 1 from the motion information candidate list, and the candidate motion information is used as the first target motion information of the current block. Based on the indication information b, the decoding end selects the candidate motion information corresponding to the index value 2 from the motion information candidate list, and the candidate motion information is used as the second target motion information of the current block.

步骤e5,针对当前块的每个像素位置,根据当前块的第一目标运动信息确定该像素位置的第一预测值,根据当前块的第二目标运动信息确定该像素位置的第二预测值;根据该第一预测值,该目标权重值,该第二预测值和该关联权重值,确定该像素位置的加权预测值。Step e5, for each pixel position of the current block, determine the first predicted value of the pixel position according to the first target motion information of the current block, and determine the second predicted value of the pixel position according to the second target motion information of the current block; A weighted predictor for the pixel location is determined based on the first predictor, the target weight value, the second predictor and the associated weight value.

示例性的,假设目标权重值是第一目标运动信息对应的权重值,关联权重值是第二目标运动信息对应的权重值,则该像素位置的加权预测值可以为:(该像素位置的第一预测值*该像素位置的目标权重值+该像素位置的第二预测值*该像素位置的关联权重值)/固定的预设数值。或者,假设目标权重值是第二目标运动信息对应的权重值,关联权重值是第一目标运动信息对应的权重值,则该像素位置的加权预测值可以为:(该像素位置的第二预测值*该像素位置的目标权重值+该像素位置的第一预测值*该像素位置的关联权重值)/固定的预设数值。Exemplarily, assuming that the target weight value is the weight value corresponding to the first target motion information, and the associated weight value is the weight value corresponding to the second target motion information, then the weighted prediction value of the pixel position may be: (the pixel position of the first A predicted value*target weight value of the pixel position+second predicted value of the pixel position*associated weight value of the pixel position)/fixed preset value. Or, assuming that the target weight value is the weight value corresponding to the second target motion information, and the associated weight value is the weight value corresponding to the first target motion information, then the weighted prediction value of the pixel position can be: (the second prediction value of the pixel position value*the target weight value of the pixel position+the first predicted value of the pixel position*the associated weight value of the pixel position)/fixed preset value.

步骤e6,根据当前块的所有像素位置的加权预测值确定当前块的加权预测值。Step e6, determine the weighted prediction value of the current block according to the weighted prediction values of all pixel positions of the current block.

例如,将当前块的所有像素位置的加权预测值组成当前块的加权预测值。For example, the weighted prediction values of all pixel positions of the current block are combined to form the weighted prediction value of the current block.

综上所述,针对编码端和解码端来说,在步骤e4中,需要获取运动信息候选列表,即需要构建当前块的运动信息候选列表,而本实施例中,可以基于当前块的时域运动信息,构建当前块的运动信息候选列表。例如,基于待加入到运动信息候选列表的可用运动信息,构建当前块的运动信息候选列表,该可用运动信息包括当前块的时域运动信息,当前块的时域运动信息的导出方式可以参见实施例1-实施例6中的任意实施例,在此不再赘述。除了时域运动信息,可用运动信息还包括如下运动信息的至少一种:空域运动信息;HMVP(History-based Motion Vector Prediction,基于历史的运动矢量预测)运动信息;预设运动信息。To sum up, for the encoding end and the decoding end, in step e4, the motion information candidate list needs to be obtained, that is, the motion information candidate list of the current block needs to be constructed, and in this embodiment, it can be based on the time domain of the current block Motion information, build a candidate list of motion information for the current block. For example, based on the available motion information to be added to the motion information candidate list, the motion information candidate list of the current block is constructed, the available motion information includes the time domain motion information of the current block, and the derivation method of the time domain motion information of the current block can refer to the implementation Any embodiment in Example 1-Embodiment 6 will not be repeated here. In addition to the temporal motion information, the available motion information also includes at least one of the following motion information: spatial motion information; HMVP (History-based Motion Vector Prediction, history-based motion vector prediction) motion information; preset motion information.

示例性的,若可用运动信息包括空域运动信息,则在基于待加入到运动信息候选列表的可用运动信息,构述当前块的运动信息候选列表之前,针对当前块的空域相邻块,若空域相邻块存在,且空域相邻块采用帧间预测模式,则可以将该空域相邻块的运动信息确定为可用运动信息;和/或,针对当前块的第一空域相邻块,若该第一空域相邻块存在,且该第一空域相邻块采用帧间预测模式,且该第一空域相邻块的运动信息与当前块的第二空域相邻块(可以为至少一个第二空域相邻块)的运动信息不同(第二空域相邻块的运动信息已经被确定为可用运动信息),则可以将第一空域相邻块的运动信息确定为可用运动信息。Exemplarily, if the available motion information includes spatial motion information, before constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list, for the spatial adjacent blocks of the current block, if the spatial Adjacent blocks exist, and the spatial adjacent block adopts the inter prediction mode, then the motion information of the spatial adjacent block can be determined as the available motion information; and/or, for the first spatial adjacent block of the current block, if the The first spatial adjacent block exists, and the first spatial adjacent block adopts inter-frame prediction mode, and the motion information of the first spatial adjacent block is the same as the second spatial adjacent block of the current block (which may be at least one second If the motion information of adjacent spatial blocks) is different (the motion information of the second adjacent spatial block has been determined as available motion information), then the motion information of the first spatial adjacent block may be determined as available motion information.

示例性的,若可用运动信息包括预设运动信息,则在基于待加入到运动信息候选列表的可用运动信息,构述当前块的运动信息候选列表之前,将预设运动信息确定为可用运动信息;该预设运动信息可以包括但不限于如下运动信息的至少一种:零运动信息;基于运动信息候选列表中已存在的运动信息所导出的缺省运动信息;运动信息候选列表中已存在的运动信息。Exemplarily, if the available motion information includes preset motion information, the preset motion information is determined as the available motion information before constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list ; The preset motion information may include but not limited to at least one of the following motion information: zero motion information; default motion information derived based on existing motion information in the motion information candidate list; existing motion information in the motion information candidate list Sports information.

在一种可能的实施方式中,基于待加入到运动信息候选列表的可用运动信息,构建当前块的运动信息候选列表,包括但不限于:针对待加入到运动信息候选列表的可用运动信息,In a possible implementation manner, based on the available motion information to be added to the motion information candidate list, the motion information candidate list of the current block is constructed, including but not limited to: for the available motion information to be added to the motion information candidate list,

若该可用运动信息为单向运动信息,则可以将该单向运动信息加入到运动信息候选列表;若该可用运动信息为双向运动信息,则可以将该双向运动信息裁剪为第一单向运动信息和第二单向运动信息,并将该第一单向运动信息加入到运动信息候选列表;或者,If the available motion information is one-way motion information, the one-way motion information can be added to the motion information candidate list; if the available motion information is two-way motion information, then the two-way motion information can be clipped into the first one-way motion information information and second unidirectional motion information, and add the first unidirectional motion information to the motion information candidate list; or,

若该可用运动信息为单向运动信息,且该单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将该单向运动信息加入到运动信息候选列表;若该可用运动信息为双向运动信息,则将该双向运动信息裁剪为第一单向运动信息和第二单向运动信息,并将某个单向运动信息加入到运动信息候选列表;例如,若该第一单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将该第一单向运动信息加入到运动信息候选列表;或者,If the available motion information is unidirectional motion information, and the unidirectional motion information does not overlap with the existing motion information in the motion information candidate list, then add the unidirectional motion information to the motion information candidate list; if the available motion information is two-way motion information, then clip the two-way motion information into first one-way motion information and second one-way motion information, and add some one-way motion information to the motion information candidate list; for example, if the first one-way motion information The motion information does not overlap with the existing motion information in the motion information candidate list, then add the first unidirectional motion information to the motion information candidate list; or,

若可用运动信息为单向运动信息,且单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述单向运动信息加入到运动信息候选列表;若所述可用运动信息为双向运动信息,则将所述双向运动信息裁剪为第一单向运动信息和第二单向运动信息,并将某个单向运动信息加入到运动信息候选列表;例如,若第一单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述第一单向运动信息加入到运动信息候选列表;若第一单向运动信息与运动信息候选列表中已存在的运动信息重复,且第二单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述第二单向运动信息加入到运动信息候选列表。If the available motion information is unidirectional motion information, and the unidirectional motion information does not overlap with the existing motion information in the motion information candidate list, then add the unidirectional motion information to the motion information candidate list; if the available motion information is two-way motion information, then clip the two-way motion information into first one-way motion information and second one-way motion information, and add some one-way motion information to the motion information candidate list; for example, if the first one-way motion information The motion information does not overlap with the existing motion information in the motion information candidate list, then add the first one-way motion information to the motion information candidate list; if the first one-way motion information is the same as the existing motion information in the motion information candidate list If the information is repeated, and the second unidirectional motion information does not overlap with existing motion information in the motion information candidate list, then add the second unidirectional motion information to the motion information candidate list.

在上述实施例中,第一单向运动信息可以是指向第一参考帧列表中参考帧的单向运动信息;第二单向运动信息可以是指向第二参考帧列表中参考帧的单向运动信息。In the above embodiment, the first unidirectional motion information may be unidirectional motion information pointing to the reference frame in the first reference frame list; the second unidirectional motion information may be unidirectional motion pointing to the reference frame in the second reference frame list information.

示例性的,若运动信息候选列表中已存在的候选运动信息的总数量(即运动信息候选列表中当前存在的总数量)为偶数,则第一参考帧列表为当前块的前向参考帧列表,第二参考帧列表为当前块的后向参考帧列表;若运动信息候选列表中已存在的候选运动信息的总数量为奇数,则第一参考帧列表为当前块的后向参考帧列表,第二参考帧列表为当前块的前向参考帧列表。或者,若运动信息候选列表中已存在的候选运动信息的总数量为奇数,则第一参考帧列表为当前块的前向参考帧列表,第二参考帧列表为当前块的后向参考帧列表;若运动信息候选列表中已存在的候选运动信息的总数量为偶数,则第一参考帧列表为当前块的后向参考帧列表,第二参考帧列表为当前块的前向参考帧列表。Exemplarily, if the total number of candidate motion information existing in the motion information candidate list (that is, the total number currently present in the motion information candidate list) is an even number, the first reference frame list is the forward reference frame list of the current block , the second reference frame list is the backward reference frame list of the current block; if the total number of candidate motion information existing in the motion information candidate list is an odd number, the first reference frame list is the backward reference frame list of the current block, The second reference frame list is a forward reference frame list of the current block. Or, if the total number of candidate motion information existing in the motion information candidate list is an odd number, the first reference frame list is the forward reference frame list of the current block, and the second reference frame list is the backward reference frame list of the current block ; If the total number of candidate motion information existing in the motion information candidate list is an even number, the first reference frame list is the backward reference frame list of the current block, and the second reference frame list is the forward reference frame list of the current block.

示例性的,第一参考帧列表为当前块的前向参考帧列表,第二参考帧列表为当前块的后向参考帧列表。或者,第一参考帧列表为当前块的后向参考帧列表,第二参考帧列表为当前块的前向参考帧列表。Exemplarily, the first reference frame list is a forward reference frame list of the current block, and the second reference frame list is a backward reference frame list of the current block. Alternatively, the first reference frame list is a backward reference frame list of the current block, and the second reference frame list is a forward reference frame list of the current block.

以下结合几个应用场景,对AWP模式的运动信息候选列表的构建过程进行说明。在各应用场景中,将运动信息候选列表称为AwpCandArray,假设AwpCandArray的长度为X,即需要添加X个可用运动信息,X可以根据经验配置,如AwpCandArray的长度为5。The following describes the construction process of the motion information candidate list in the AWP mode in conjunction with several application scenarios. In each application scenario, the motion information candidate list is called AwpCandArray. Assume that the length of AwpCandArray is X, that is, X pieces of available motion information need to be added, and X can be configured according to experience. For example, the length of AwpCandArray is 5.

应用场景1:可以通过如下步骤构建AWP模式的运动信息候选列表:Application scenario 1: The motion information candidate list of AWP mode can be constructed through the following steps:

步骤f1、参见图4F所示,F,G,C,A,B,D是当前块的空域相邻块,可以确定F,G,C,A,B,D的运动信息的“可用”性。示例性的,如果F存在且采用帧间预测模式,则F的运动信息为可用运动信息;否则,F的运动信息为不可用运动信息。如果G存在且采用帧间预测模式,则G的运动信息为可用运动信息;否则,G的运动信息为不可用运动信息。如果C存在且采用帧间预测模式,则C的运动信息为可用运动信息;否则,C的运动信息为不可用运动信息。如果A存在且采用帧间预测模式,则A的运动信息为可用运动信息;否则,A的运动信息为不可用运动信息。如果B存在且采用帧间预测模式,则B的运动信息为可用运动信息;否则,B的运动信息为不可用运动信息。如果D存在且采用帧间预测模式,则D的运动信息为可用运动信息;否则,D的运动信息为不可用运动信息。Step f1, as shown in FIG. 4F, F, G, C, A, B, and D are spatial adjacent blocks of the current block, and the "availability" of the motion information of F, G, C, A, B, and D can be determined . Exemplarily, if F exists and adopts the inter-frame prediction mode, the motion information of F is available motion information; otherwise, the motion information of F is unavailable motion information. If G exists and adopts the inter prediction mode, the motion information of G is available motion information; otherwise, the motion information of G is unavailable motion information. If C exists and adopts the inter prediction mode, the motion information of C is available motion information; otherwise, the motion information of C is unavailable motion information. If A exists and adopts the inter prediction mode, the motion information of A is available motion information; otherwise, the motion information of A is unavailable motion information. If B exists and adopts the inter prediction mode, the motion information of B is available motion information; otherwise, the motion information of B is unavailable motion information. If D exists and adopts inter-frame prediction mode, the motion information of D is available motion information; otherwise, the motion information of D is unavailable motion information.

步骤f2、按F、G、C、A、B和D的顺序(该顺序可变),将单向的可用运动信息添加到AwpCandArray并查重,直至AwpCandArray长度为Y或遍历结束。Y的取值可以小于X的取值,可以根据经验配置,如Y的取值为4,表示至少预留X-Y个位置给时域运动信息。Step f2, according to the order of F, G, C, A, B and D (the order is variable), add unidirectional available motion information to AwpCandArray and check for duplicates until the length of AwpCandArray is Y or the traversal ends. The value of Y can be smaller than the value of X, and can be configured according to experience. For example, the value of Y is 4, indicating that at least X-Y positions are reserved for time domain motion information.

步骤f3、若AwpCandArray长度小于Y,按F、G、C、A、B和D的顺序(该顺序可变),将双向的可用运动信息拆分为指向前向参考帧列表(即参考帧列表List0)的单向运动信息以及指向后向参考帧列表(即参考帧列表List1)的单向运动信息,先进行单向运动信息的查重操作,若不重复则放入AwpCandArray并查重,直至AwpCandArray长度为Y或遍历结束。Step f3, if the length of AwpCandArray is less than Y, according to the order of F, G, C, A, B and D (the order is variable), the bidirectional available motion information is split into a forward reference frame list (ie reference frame list The one-way motion information of List0) and the one-way motion information pointing to the backward reference frame list (that is, the reference frame list List1), first perform the duplication check operation of the one-way motion information, if not repeated, put it into AwpCandArray and check the duplicates until The length of AwpCandArray is Y or the end of traversal.

步骤f4、将当前块的时域运动信息拆分为指向前向参考帧列表的单向运动信息以及指向后向参考帧列表的单向运动信息,先进行单向运动信息查重操作,若不重复则放入AwpCandArray,直至AwpCandArray长度为X或遍历结束。Step f4, split the time-domain motion information of the current block into unidirectional motion information pointing to the forward reference frame list and unidirectional motion information pointing to the backward reference frame list, and first perform a duplication check operation on the unidirectional motion information, if not Repeatedly put into AwpCandArray until the length of AwpCandArray is X or the traversal ends.

示例性的,关于当前块的时域运动信息的导出方式,可以参见实施例1-实施例6。Exemplarily, regarding the manner of deriving the temporal motion information of the current block, reference may be made to Embodiment 1-Embodiment 6.

步骤f5、若AwpCandArray长度小于X,则将AwpCandArray中最后一个单向运动信息进行重复填充操作,直至AwpCandArray长度为X,得到当前块的AwpCandArray。Step f5, if the length of AwpCandArray is less than X, then repeatedly fill the last unidirectional motion information in AwpCandArray until the length of AwpCandArray is X, and obtain the AwpCandArray of the current block.

应用场景2:可以通过如下步骤构建AWP模式的运动信息候选列表:Application scenario 2: The motion information candidate list of AWP mode can be constructed through the following steps:

步骤g1、F,G,C,A,B,D是当前块的空域相邻块,如果F存在且采用帧间预测模式,则F的运动信息为可用运动信息;否则,F的运动信息为不可用运动信息。如果G存在且采用帧间预测模式,G的运动信息与F的运动信息不相同,则G的运动信息为可用运动信息;否则,G的运动信息为不可用运动信息。如果C存在且采用帧间预测模式,C的运动信息与G的运动信息不相同,则C的运动信息为可用运动信息;否则,C的运动信息为不可用运动信息。如果A存在且采用帧间预测模式,A的运动信息与F的运动信息不相同,则A的运动信息为可用运动信息;否则,A的运动信息为不可用运动信息。如果B存在且采用帧间预测模式,则B的运动信息为可用运动信息;否则,B的运动信息为不可用运动信息。如果D存在且采用帧间预测模式,D的运动信息与A的运动信息不相同,且D的运动信息与G的运动信息不相同,则D的运动信息为可用运动信息;否则,D的运动信息为不可用运动信息。Steps g1, F, G, C, A, B, D are adjacent blocks in the current block, if F exists and adopts inter-frame prediction mode, then the motion information of F is the available motion information; otherwise, the motion information of F is Sports information is not available. If G exists and the inter prediction mode is used, and the motion information of G is different from that of F, then the motion information of G is available; otherwise, the motion information of G is unavailable. If C exists and the inter prediction mode is used, and the motion information of C is different from that of G, the motion information of C is available; otherwise, the motion information of C is unavailable. If A exists and adopts the inter prediction mode, and the motion information of A is different from that of F, the motion information of A is available; otherwise, the motion information of A is unavailable. If B exists and adopts the inter prediction mode, the motion information of B is available motion information; otherwise, the motion information of B is unavailable motion information. If D exists and adopts the inter prediction mode, the motion information of D is different from the motion information of A, and the motion information of D is different from the motion information of G, then the motion information of D is the available motion information; otherwise, the motion information of D is Information is unavailable athletic information.

步骤g2、按F、G、C、A、B和D的顺序(该顺序可变),将可用运动信息(单向运动信息或者双向运动信息)放入AwpCandArray,直至AwpCandArray长度为Y或遍历结束。Y的取值可以小于X的取值,可以根据经验配置,如Y的取值为4,表示至少预留X-Y个位置给时域运动信息。Step g2, according to the order of F, G, C, A, B and D (the order is variable), put the available motion information (one-way motion information or two-way motion information) into AwpCandArray until the length of AwpCandArray is Y or the traversal ends . The value of Y can be smaller than the value of X, and can be configured according to experience. For example, the value of Y is 4, indicating that at least X-Y positions are reserved for time domain motion information.

步骤g3、将当前块的时域运动信息放入AwpCandArray,直至AwpCandArray长度为X或遍历结束。Step g3. Put the time-domain motion information of the current block into AwpCandArray until the length of AwpCandArray is X or the traversal ends.

示例性的,关于当前块的时域运动信息的导出方式,可以参见实施例1-实施例6。Exemplarily, regarding the manner of deriving the temporal motion information of the current block, reference may be made to Embodiment 1-Embodiment 6.

步骤g4、若AwpCandArray长度小于X,则可以加入双向零运动信息到AwpCandArray,直至AwpCandArray长度为X,得到当前块的AwpCandArray。在双向零运动信息中,运动矢量值可以为零,L0参考图像索引可以等于0,L1参考图像索引可以等于0。Step g4, if the length of AwpCandArray is less than X, add bidirectional zero motion information to AwpCandArray until the length of AwpCandArray is X, and obtain the AwpCandArray of the current block. In bidirectional zero motion information, the motion vector value can be zero, the L0 reference picture index can be equal to 0, and the L1 reference picture index can be equal to 0.

步骤g5、将AwpCandArray中第AwpCandIdx0+1个运动信息的某一个单向运动信息赋值给mvAwp0L0,mvAwp0L1,RefIdxAwp0L0和RefIdxAwp0L1,如采用如下方式进行赋值:Step g5. Assign a certain one-way motion information of the AwpCandIdx0+1th motion information in AwpCandArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0 and RefIdxAwp0L1. For example, the following method is used for assignment:

情况1、若AwpCandIdx0是偶数,则将指向前向参考帧列表的单向运动信息赋值给mvAwp0L0和RefIdxAwp0L0,mvAwp0L1等于零,RefIdxAwp0L1等于-1。如果指向前向参考帧列表的单向运动信息不存在,则将指向后向参考帧列表的单向运动信息赋值给mvAwp0L1和RefIdxAwp0L1,mvAwp0L0等于零,RefIdxAwp0L0等于-1。Case 1. If AwpCandIdx0 is an even number, the one-way motion information pointing to the forward reference frame list is assigned to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 is equal to zero, and RefIdxAwp0L1 is equal to -1. If the unidirectional motion information pointing to the forward reference frame list does not exist, assign the unidirectional motion information pointing to the backward reference frame list to mvAwp0L1 and RefIdxAwp0L1, mvAwp0L0 is equal to zero, and RefIdxAwp0L0 is equal to -1.

情况2、若AwpCandIdx0是奇数,则将指向后向参考帧列表的单向运动信息赋值给mvAwp0L1和RefIdxAwp0L1,mvAwp0L0等于零,RefIdxAwp0L0等于-1。如果指向后向参考帧列表的单向运动信息不存在,则将指向前向参考帧列表的单向运动信息赋值给mvAwp0L0和RefIdxAwp0L0,mvAwp0L1等于零,RefIdxAwp0L1等于-1。Case 2. If AwpCandIdx0 is an odd number, assign the one-way motion information pointing to the backward reference frame list to mvAwp0L1 and RefIdxAwp0L1, mvAwp0L0 is equal to zero, and RefIdxAwp0L0 is equal to -1. If the unidirectional motion information pointing to the backward reference frame list does not exist, assign the unidirectional motion information pointing to the forward reference frame list to mvAwp0L0 and RefIdxAwp0L0, mvAwp0L1 is equal to zero, and RefIdxAwp0L1 is equal to -1.

步骤g6、将AwpCandArray中第AwpCandIdx1+1个运动信息的某一个单向运动信息赋值给mvAwp1L0,mvAwp1L1,RefIdxAwp1L0和RefIdxAwp1L1,如采用如下方式进行赋值:Step g6. Assign a certain one-way motion information of the AwpCandIdx1+1th motion information in AwpCandArray to mvAwp1L0, mvAwp1L1, RefIdxAwp1L0 and RefIdxAwp1L1. For example, the following method is used for assignment:

情况1、若AwpCandIdx1是偶数,则将指向前向参考帧列表的单向运动信息赋值给mvAwp1L0和RefIdxAwp1L0,mvAwp1L1等于零,RefIdxAwp1L1等于-1。如果指向前向参考帧列表的单向运动信息不存在,则将指向后向参考帧列表的单向运动信息赋值给mvAwp1L1和RefIdxAwp1L1,mvAwp1L0等于零,RefIdxAwp1L0等于-1。Case 1. If AwpCandIdx1 is an even number, assign the one-way motion information pointing to the forward reference frame list to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to -1. If the unidirectional motion information pointing to the forward reference frame list does not exist, assign the unidirectional motion information pointing to the backward reference frame list to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, and RefIdxAwp1L0 is equal to -1.

情况2、若AwpCandIdx1是奇数,则将指向后向参考帧列表的单向运动信息赋值给mvAwp1L1和RefIdxAwp1L1,mvAwp1L0等于零,RefIdxAwp1L0等于-1。如果指向后向参考帧列表的单向运动信息不存在,则将指向前向参考帧列表的单向运动信息赋值给mvAwp1L0和RefIdxAwp1L0,mvAwp1L1等于零,RefIdxAwp1L1等于-1。Case 2. If AwpCandIdx1 is an odd number, assign the unidirectional motion information pointing to the backward reference frame list to mvAwp1L1 and RefIdxAwp1L1, mvAwp1L0 is equal to zero, and RefIdxAwp1L0 is equal to -1. If the unidirectional motion information pointing to the backward reference frame list does not exist, the unidirectional motion information pointing to the forward reference frame list is assigned to mvAwp1L0 and RefIdxAwp1L0, mvAwp1L1 is equal to zero, and RefIdxAwp1L1 is equal to -1.

应用场景3:可以通过如下步骤构建AWP模式的运动信息候选列表:Application scenario 3: The motion information candidate list of AWP mode can be constructed through the following steps:

步骤h1-步骤h4、实现过程与步骤f1-步骤f4相同,在此不再重复赘述。Step h1-step h4 and the implementation process are the same as step f1-step f4, and will not be repeated here.

步骤h5、若AwpCandArray的长度小于X,依次生成四个单向运动信息,记AwpCandArray中第一个单向运动信息对应的运动矢量为(x,y),生成的四个单向运动信息的参考帧信息与AwpCandArray中第一个单向运动信息的参考帧信息相同,这四个单向运动信息对应的运动矢量分别为(x0,y0),(x1,y1),(x2,y2),(x3,y3),这些运动矢量的生成方式参见如下方式所示。将新生成的运动信息依次加入AwpCandArray,直至AwpCandArray长度为X。Step h5, if the length of AwpCandArray is less than X, generate four one-way motion information in turn, record the motion vector corresponding to the first one-way motion information in AwpCandArray as (x, y), and generate four one-way motion information for reference The frame information is the same as the reference frame information of the first unidirectional motion information in AwpCandArray, and the motion vectors corresponding to the four unidirectional motion information are (x0, y0), (x1, y1), (x2, y2), ( x3, y3), the generation of these motion vectors is shown in the following way. Add the newly generated motion information to AwpCandArray sequentially until the length of AwpCandArray is X.

x0=abs(x)<8?8:(abs(x)<=64?((abs(x)*5+2)>>2):((abs(x)*9+4)>>3))x0=abs(x)<8? 8:(abs(x)<=64?((abs(x)*5+2)>>2):((abs(x)*9+4)>>3 ))

x0=x<0?-x0:x0x0=x<0? -x0:x0

y0=yy0=y

x1=xx1=x

y1=abs(y)<8?8:(abs(y)<=64?((abs(y)*5+2)>>2):((abs(y)*9+4)>>3))y1=abs(y)<8? 8:(abs(y)<=64?((abs(y)*5+2)>>2):((abs(y)*9+4)>>3 ))

y1=y<0?-y1:y1y1=y<0? -y1:y1

x2=abs(x)<8?8:(abs(x)<=64?((abs(x)*3+2)>>2):((abs(x)*7+4)>>3))x2=abs(x)<8? 8:(abs(x)<=64?((abs(x)*3+2)>>2):((abs(x)*7+4)>>3 ))

x2=x<=0?-x2:x2x2=x<=0? -x2:x2

y2=yy2=y

x3=xx3=x

y3=abs(y)<8?8:(abs(y)<=64?((abs(y)*3+2)>>2):((abs(y)*7+4)>>3))y3=abs(y)<8? 8:(abs(y)<=64?((abs(y)*3+2)>>2):((abs(y)*7+4)>>3 ))

y3=y<=0?-y3:y3y3=y<=0? -y3:y3

步骤h6、若AwpCandArray长度小于X,则将AwpCandArray中最后一个单向运动信息进行重复填充操作,直至AwpCandArray长度为X,得到当前块的AwpCandArray。Step h6. If the length of AwpCandArray is less than X, repeat the padding operation for the last unidirectional motion information in AwpCandArray until the length of AwpCandArray is X, and obtain the AwpCandArray of the current block.

应用场景4:可以通过如下步骤构建AWP模式的运动信息候选列表:Application scenario 4: The motion information candidate list of AWP mode can be constructed through the following steps:

步骤k1-步骤k3,实现过程与步骤g1-步骤g3相同,在此不再重复赘述。Step k1-step k3, the implementation process is the same as step g1-step g3, and will not be repeated here.

步骤k4、若AwpCandArray的长度小于X,则依次生成四个单向运动信息,将新生成的运动信息依次加入AwpCandArray,直至AwpCandArray长度为X。若AwpCandArray中第一个有效运动信息为单向运动信息,运动矢量记为(x,y),生成的四个单向运动信息的参考帧信息与该第一个有效运动信息的参考帧信息相同,生成的四个单向运动信息的运动矢量分别为(x0,y0),(x1,y1),(x2,y2),(x3,y3),具体方式参见步骤h5,在此不再赘述。Step k4, if the length of AwpCandArray is less than X, generate four unidirectional motion information in sequence, and add the newly generated motion information into AwpCandArray in sequence until the length of AwpCandArray is X. If the first valid motion information in AwpCandArray is unidirectional motion information, and the motion vector is recorded as (x, y), the reference frame information of the generated four unidirectional motion information is the same as the reference frame information of the first valid motion information , the generated motion vectors of the four unidirectional motion information are (x0, y0), (x1, y1), (x2, y2), (x3, y3), respectively. For the specific method, refer to step h5, which will not be repeated here.

若AwpCandArray中第一个有效运动信息为双向运动信息,运动矢量记为(x,y)和(x’,y’),生成的四个双向运动信息的参考帧信息与第一个有效运动信息的参考帧信息相同。生成的四个双向运动信息的运动矢量分别为(x0,y0)和(x0’,y0’),(x1,y1)和(x1’,y1’),(x2,y2)和(x2’,y2’),(x3,y3)和(x3’,y3’)。(x0,y0),(x1,y1),(x2,y2),(x3,y3)的确定方式参见步骤h5。(x0’,y0’),(x1’,y1’),(x2’,y2’),和(x3’,y3’)的确定方式如下:If the first effective motion information in AwpCandArray is two-way motion information, and the motion vectors are recorded as (x, y) and (x', y'), the reference frame information of the four generated two-way motion information and the first effective motion information The same reference frame information. The motion vectors of the four generated bidirectional motion information are (x0, y0) and (x0', y0'), (x1, y1) and (x1', y1'), (x2, y2) and (x2', y2'), (x3,y3) and (x3',y3'). (x0, y0), (x1, y1), (x2, y2), (x3, y3) are determined in step h5. (x0',y0'), (x1',y1'), (x2',y2'), and (x3',y3') are determined as follows:

x0’=abs(x’)<8?8:(abs(x’)<=64?((abs(x’)*5+2)>>2):((abs(x’)*9+4)>>3))x0'=abs(x')<8? 8:(abs(x')<=64?((abs(x')*5+2)>>2):((abs(x')*9+ 4)>>3))

x0=x’<0?-x0’:x0’x0=x'<0? -x0':x0'

y0’=y’y0'=y'

x1’=x’x1'=x'

y1’=abs(y’)<8?8:(abs(y’)<=64?((abs(y’)*5+2)>>2):((abs(y’)*9+4)>>3))y1'=abs(y')<8? 8:(abs(y')<=64?((abs(y')*5+2)>>2):((abs(y')*9+ 4)>>3))

y1’=y’<0?-y1’:y1’y1'=y'<0? -y1':y1'

x2’=abs(x’)<8?8:(abs(x’)<=64?((abs(x’)*3+2)>>2):((abs(x’)*7+4)>>3))x2'=abs(x')<8? 8:(abs(x')<=64?((abs(x')*3+2)>>2):((abs(x')*7+ 4)>>3))

x2’=x’<=0?-x2’:x2’x2'=x'<=0? -x2':x2'

y2’=y’y2'=y'

x3’=x’x3'=x'

y3’=abs(y’)<8?8:(abs(y’)<=64?((abs(y’)*3+2)>>2):((abs(y’)*7+4)>>3))y3'=abs(y')<8? 8:(abs(y')<=64?((abs(y')*3+2)>>2):((abs(y')*7+ 4)>>3))

y3’=y’<=0?-y3’:y3’y3'=y'<=0? -y3':y3'

步骤k5、若AwpCandArray长度小于X,则可以加入双向零运动信息到AwpCandArray,直至AwpCandArray长度为X,得到当前块的AwpCandArray。在双向零运动信息中,运动矢量值可以为零,L0参考图像索引可以等于0,L1参考图像索引可以等于0。Step k5, if the length of AwpCandArray is less than X, add bidirectional zero motion information to AwpCandArray until the length of AwpCandArray is X, and obtain the AwpCandArray of the current block. In bidirectional zero motion information, the motion vector value can be zero, the L0 reference picture index can be equal to 0, and the L1 reference picture index can be equal to 0.

步骤k6、将AwpCandArray中第AwpCandIdx0+1个运动信息的某一个单向运动信息赋值给mvAwp0L0,mvAwp0L1,RefIdxAwp0L0和RefIdxAwp0L1,具体方式参见步骤g5。Step k6. Assign a certain one-way motion information of the AwpCandIdx0+1th motion information in AwpCandArray to mvAwp0L0, mvAwp0L1, RefIdxAwp0L0 and RefIdxAwp0L1. For details, refer to step g5.

步骤k7、将AwpCandArray中第AwpCandIdx1+1个运动信息的某一个单向运动信息赋值给mvAwp1L0,mvAwp1L1,RefIdxAwp1L0和RefIdxAwp1L1,具体方式参见步骤g6。Step k7. Assign a certain one-way motion information of the AwpCandIdx1+1th motion information in AwpCandArray to mvAwp1L0, mvAwp1L1, RefIdxAwp1L0 and RefIdxAwp1L1. For details, refer to step g6.

应用场景5:针对上述应用场景1-应用场景4中的任一应用场景,在按F、G、C、A、B和D的顺序将可用运动信息放入AwpCandArray时,可以直至AwpCandArray长度为X或遍历结束。示例性的,若AwpCandArray长度为X,则可以不再将当前块的时域运动信息放入AwpCandArray,即AwpCandArray也可以不包括当前块的时域运动信息。若遍历结束时AwpCandArray长度小于X,则将当前块的时域运动信息放入AwpCandArray。Application scenario 5: For any application scenario in the above application scenario 1-application scenario 4, when the available motion information is put into AwpCandArray in the order of F, G, C, A, B, and D, the length of AwpCandArray can be X or end of traversal. Exemplarily, if the length of the AwpCandArray is X, the time-domain motion information of the current block may not be put into the AwpCandArray, that is, the AwpCandArray may not include the time-domain motion information of the current block. If the length of AwpCandArray is less than X at the end of the traversal, put the time domain motion information of the current block into AwpCandArray.

应用场景6:假设AWP模式支持的最小块尺寸为8,最大块尺寸为64,共支持8种权重预测角度,参见图4C所示,每个权重预测角度支持7种权重预测位置,参见图4D所示,因此,对于每个块而言,共有56种模式。参见图4E所示,为AWP模式支持的权重预测位置的参考权重示意图。参见图4G所示,将权重预测角度分为划分为4个分区,根据权重预测角度所在区域的不同,逐像素权重导出的公式稍有差异,记当前块的块尺寸为MxN,M为宽,N为高,X为log2(权重预测角度的斜率绝对值),Y为权重预测位置。Application scenario 6: Assume that the minimum block size supported by AWP mode is 8, the maximum block size is 64, and a total of 8 weight prediction angles are supported, as shown in Figure 4C. Each weight prediction angle supports 7 weight prediction positions, see Figure 4D As shown, therefore, for each block, there are 56 patterns in total. Referring to FIG. 4E , it is a schematic diagram of reference weights for weight prediction positions supported by the AWP mode. As shown in Figure 4G, the weight prediction angle is divided into 4 partitions. According to the different areas where the weight prediction angle is located, the formula derived from the pixel-by-pixel weight is slightly different. Note that the block size of the current block is MxN, and M is the width. N is high, X is log2 (the absolute value of the slope of the weight prediction angle), and Y is the weight prediction position.

以针对位于角度分区0的权重预测角度0以及权重预测角度1为例,其导出过程为:Taking weight prediction angle 0 and weight prediction angle 1 in angle partition 0 as an example, the derivation process is as follows:

采用如下公式计算有效长度ValidLenth:ValidLenth=(N+(M>>X))<<1。The valid length ValidLenth is calculated using the following formula: ValidLenth=(N+(M>>X))<<1.

设置参考权重值ReferenceWeights[x],x的取值范围是0~ValidLength-1;FirstPos=(ValidLength>>1)-6+Y*((ValidLength-1)>>3);ReferenceWeights[x]=Clip3(0,8,x-FirstPos);示例性的,FirstPos表示上述实施例中的权重变换的起始位置。逐像素导出权重SampleWeight[x][y]:SampleWeight[x][y]=ReferenceWeights[(y<<1)+((x<<1)>>X)]Set the reference weight value ReferenceWeights[x], the value range of x is 0~ValidLength-1; FirstPos=(ValidLength>>1)-6+Y*((ValidLength-1)>>3); ReferenceWeights[x]= Clip3(0,8,x-FirstPos); Exemplarily, FirstPos represents the starting position of the weight transformation in the above embodiment. Export weight SampleWeight[x][y] pixel by pixel: SampleWeight[x][y]=ReferenceWeights[(y<<1)+((x<<1)>>X)]

色度权重导出为:直接取对应2*2亮度权重的左上角位置,SampleWeightChroma[x][y]=SampleWeight[x>>1][y>>1],x的取值范围是0~(M/2-1),y的取值范围是0~(N/2-1)。The chroma weight is exported as: directly take the position of the upper left corner corresponding to the 2*2 brightness weight, SampleWeightChroma[x][y]=SampleWeight[x>>1][y>>1], and the value range of x is 0~( M/2-1), the value range of y is 0~(N/2-1).

实施例9:实施例1-实施例7的实现过程,可以应用于UMVE(Ultimate MotionVector Expression,高级运动信息表达)模式中,即运动信息候选列表可以为UMVE模式的运动信息候选列表,UMVE模式是在已经生成的运动信息基础上进行偏移,从而得到更优的运动信息,以下结合UMVE模式的运动信息候选列表,对运动信息候选列表进行说明。Embodiment 9: The implementation process of Embodiment 1-Embodiment 7 can be applied in UMVE (Ultimate MotionVector Expression, advanced motion information expression) mode, that is, the motion information candidate list can be the motion information candidate list of UMVE mode, and the UMVE mode is Offset is performed on the basis of the generated motion information, so as to obtain better motion information. The motion information candidate list will be described below in conjunction with the motion information candidate list in the UMVE mode.

示例性的,针对编码端和解码端来说,需要获取运动信息候选列表,即需要构建当前块的运动信息候选列表,而本实施例中,可以基于当前块的时域运动信息,构建当前块的运动信息候选列表。例如,基于待加入到运动信息候选列表的可用运动信息,构建当前块的运动信息候选列表。示例性的,该可用运动信息包括当前块的时域运动信息,当前块的时域运动信息的导出方式可以参见实施例1-实施例6中的任意实施例,在此不再赘述。除了时域运动信息,可用运动信息还包括如下运动信息的至少一种:空域运动信息;预设运动信息。Exemplarily, for the encoding end and the decoding end, it is necessary to obtain the motion information candidate list, that is, to construct the motion information candidate list of the current block, and in this embodiment, the current block can be constructed based on the time-domain motion information of the current block Candidate list of motion information. For example, a motion information candidate list for the current block is constructed based on available motion information to be added to the motion information candidate list. Exemplarily, the available motion information includes time-domain motion information of the current block, and the derivation manner of the time-domain motion information of the current block can refer to any embodiment in Embodiment 1-Embodiment 6, which will not be repeated here. In addition to the time-domain motion information, the available motion information also includes at least one of the following motion information: spatial-domain motion information; preset motion information.

示例性的,若可用运动信息包括空域运动信息,则在基于待加入到运动信息候选列表的可用运动信息,构述当前块的运动信息候选列表之前,针对当前块的空域相邻块,若空域相邻块存在,且空域相邻块采用帧间预测模式,则可以将该空域相邻块的运动信息确定为可用运动信息;和/或,针对当前块的第一空域相邻块,若该第一空域相邻块存在,且该第一空域相邻块采用帧间预测模式,且该第一空域相邻块的运动信息与当前块的第二空域相邻块(可以为至少一个第二空域相邻块)的运动信息不同(第二空域相邻块的运动信息已经被确定为可用运动信息),则可以将第一空域相邻块的运动信息确定为可用运动信息。Exemplarily, if the available motion information includes spatial motion information, before constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list, for the spatial adjacent blocks of the current block, if the spatial Adjacent blocks exist, and the spatial adjacent block adopts the inter prediction mode, then the motion information of the spatial adjacent block can be determined as the available motion information; and/or, for the first spatial adjacent block of the current block, if the The first spatial adjacent block exists, and the first spatial adjacent block adopts inter-frame prediction mode, and the motion information of the first spatial adjacent block is the same as the second spatial adjacent block of the current block (which may be at least one second If the motion information of adjacent spatial blocks) is different (the motion information of the second adjacent spatial block has been determined as available motion information), then the motion information of the first spatial adjacent block may be determined as available motion information.

示例性的,若可用运动信息包括预设运动信息,则在基于待加入到运动信息候选列表的可用运动信息,构述当前块的运动信息候选列表之前,将预设运动信息确定为可用运动信息;该预设运动信息可以包括但不限于如下运动信息的至少一种:零运动信息;基于运动信息候选列表中已存在的运动信息所导出的缺省运动信息;运动信息候选列表中已存在的运动信息。Exemplarily, if the available motion information includes preset motion information, the preset motion information is determined as the available motion information before constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list ; The preset motion information may include but not limited to at least one of the following motion information: zero motion information; default motion information derived based on existing motion information in the motion information candidate list; existing motion information in the motion information candidate list Sports information.

在一种可能的实施方式中,基于待加入到运动信息候选列表的可用运动信息,构建当前块的运动信息候选列表,可以包括但不限于:针对待加入到运动信息候选列表的可用运动信息,若该可用运动信息为单向运动信息,则将该单向运动信息加入到运动信息候选列表;若该可用运动信息为双向运动信息,则将该双向运动信息加入到运动信息候选列表。In a possible implementation manner, based on the available motion information to be added to the motion information candidate list, constructing the motion information candidate list of the current block may include but not limited to: for the available motion information to be added to the motion information candidate list, If the available motion information is unidirectional motion information, add the unidirectional motion information to the motion information candidate list; if the available motion information is bidirectional motion information, add the bidirectional motion information to the motion information candidate list.

综上所述,针对UMVE模式的运动信息候选列表的构建过程,可以先放入当前块的空域相邻块的运动信息(需要是可用运动信息);然后放入当前块的时域运动信息;然后放入零运动信息,以下结合具体应用场景,对UMVE模式的运动信息候选列表的构建过程进行说明。将UMVE模式的运动信息候选列表称为UmveList,假设UmveList的长度为X,即需要添加X个可用运动信息,X可以根据经验配置,如UmveList的长度可以为2。To sum up, for the construction process of the motion information candidate list in UMVE mode, the motion information of the adjacent blocks in the spatial domain of the current block can be put in first (need to be available motion information); and then the time domain motion information of the current block can be put in; Then put in zero motion information, and the following describes the construction process of the motion information candidate list in UMVE mode in combination with specific application scenarios. The motion information candidate list of the UMVE mode is called UmveList, assuming that the length of UmveList is X, that is, X pieces of available motion information need to be added, X can be configured according to experience, for example, the length of UmveList can be 2.

步骤t1、参见图4F所示,F,G,C,A,D是当前块的空域相邻块,按照F->G->C->A->D的顺序依次确定F、G、C、A和D的“可用”性。如果F存在且采用帧间预测模式,则F的运动信息为可用运动信息;否则,F的运动信息为不可用运动信息。如果G存在且采用帧间预测模式,G的运动信息与F的运动信息不相同,则G的运动信息为可用运动信息;否则,G的运动信息为不可用运动信息。如果C存在且采用帧间预测模式,C的运动信息与G的运动信息不相同,则C的运动信息为可用运动信息;否则,C的运动信息为不可用运动信息。如果A存在且采用帧间预测模式,A的运动信息与F的运动信息不相同,则A的运动信息为可用运动信息;否则,A的运动信息为不可用运动信息。如果D存在且采用帧间预测模式,D的运动信息与A的运动信息不相同,且D的运动信息与G的运动信息不相同,则D的运动信息为可用运动信息;否则,D的运动信息为不可用运动信息。Step t1, as shown in FIG. 4F, F, G, C, A, and D are adjacent blocks in the space of the current block, and F, G, and C are sequentially determined in the order of F->G->C->A->D , the "availability" of A and D. If F exists and adopts the inter prediction mode, the motion information of F is available motion information; otherwise, the motion information of F is unavailable motion information. If G exists and the inter prediction mode is used, and the motion information of G is different from that of F, then the motion information of G is available; otherwise, the motion information of G is unavailable. If C exists and the inter prediction mode is used, and the motion information of C is different from that of G, the motion information of C is available; otherwise, the motion information of C is unavailable. If A exists and adopts the inter prediction mode, and the motion information of A is different from that of F, the motion information of A is available; otherwise, the motion information of A is unavailable. If D exists and adopts the inter prediction mode, the motion information of D is different from the motion information of A, and the motion information of D is different from the motion information of G, then the motion information of D is the available motion information; otherwise, the motion information of D is Information is unavailable athletic information.

步骤t2、按F->G->C->A->D的顺序(该顺序可以根据实际情况改变),依次将可用的空域运动信息添加到UmveList中,直至UmveList长度为X或遍历结束。Step t2: According to the order of F->G->C->A->D (the order can be changed according to the actual situation), the available airspace motion information is added to the UmveList in sequence until the length of the UmveList is X or the traversal ends.

步骤t3、如果UmveList的长度小于X,将当前块的时域运动信息(导出方式参见实施例1-实施例6)添加到UmveList中,直至UmveList长度为X或遍历结束。Step t3. If the length of UmveList is less than X, add the time-domain motion information of the current block (refer to Embodiment 1 to Embodiment 6 for the derivation method) to UmveList until the length of UmveList is X or the traversal ends.

步骤t4、如果UmveList的长度小于X,将零运动信息加入UmveList中,直至长度为X。Step t4. If the length of the UmveList is less than X, add zero motion information into the UmveList until the length is X.

示例性的,基于UMVE模式的运动信息候选列表,UMVE模式的预测过程包括:Exemplarily, based on the motion information candidate list of the UMVE mode, the prediction process of the UMVE mode includes:

参见图5A所示,将经过运动信息候选列表构建的每个初始运动信息作为起始点,从上下左右四个方向进行搜索,偏移分别为1/4、1/2、1、2、4像素,起始点有两个(2base),四个偏移方向(4direction)和5种offset,总共生成40个候选的运动矢量。As shown in Figure 5A, each initial motion information constructed through the motion information candidate list is used as a starting point to search from four directions, up, down, left, and right, and the offsets are 1/4, 1/2, 1, 2, and 4 pixels, respectively. , there are two starting points (2base), four offset directions (4direction) and 5 offsets, and a total of 40 candidate motion vectors are generated.

编码端通过RDO的方式对生成的候选的运动矢量进行运动补偿,得到最优的预测块,并编码最优预测块对应的运动信息,包括umve_mv_idx(指示初始运动信息),umve_step_idx(指示偏移值)和umve_dir_idx(指示偏移方向)。解码端通过构造运动信息候选列表,并解析出umve_mv_idx(指示初始运动信息)、umve_step_idx(指示偏移值)和umve_dir_idx(指示偏移方向)得到当前块的运动矢量,并进行运动补偿得到当前块的预测值。The encoding end performs motion compensation on the generated candidate motion vector through RDO to obtain the optimal prediction block, and encodes the motion information corresponding to the optimal prediction block, including umve_mv_idx (indicating the initial motion information), umve_step_idx (indicating the offset value ) and umve_dir_idx (indicating the offset direction). The decoding end obtains the motion vector of the current block by constructing the motion information candidate list, and parsing out umve_mv_idx (indicating the initial motion information), umve_step_idx (indicating the offset value) and umve_dir_idx (indicating the offset direction), and performing motion compensation to obtain the motion vector of the current block Predictive value.

实施例10:实施例1-实施例7的实现过程,可以应用于AFFINE(仿射运动补偿)模式中,即运动信息候选列表可以为AFFINE模式的运动信息候选列表。示例性的,AFFINE模式的运动信息是当前块的左上角和右上角的运动信息计算得到,通过多参数模型计算得到当前块的运动信息,AFFINE模式对于有旋转,缩放的场景有很好的预测效果。Embodiment 10: The implementation process of Embodiment 1-Embodiment 7 can be applied in AFFINE (affine motion compensation) mode, that is, the motion information candidate list can be the motion information candidate list in AFFINE mode. Exemplarily, the motion information of the AFFINE mode is calculated from the motion information of the upper left corner and the upper right corner of the current block, and the motion information of the current block is calculated through a multi-parameter model. The AFFINE mode has a good prediction for scenes with rotation and scaling Effect.

示例性的,针对编码端和解码端来说,需要获取AFFINE模式的运动信息候选列表,即需要构建当前块的运动信息候选列表,而本实施例中,可以基于当前块的时域运动信息,构建当前块的运动信息候选列表。例如,基于可用运动信息获取多参数模型,该多参数模型可以包括至少四个参数,该可用运动信息包括当前块的时域运动信息以及当前块的空域相邻块的运动信息;然后,可以根据该多参数模型构建当前块的运动信息候选列表。当前块的时域运动信息的导出方式可以参见实施例1-实施例6中的任意实施例,在此不再赘述。Exemplarily, for the encoding end and the decoding end, it is necessary to obtain the motion information candidate list of the AFFINE mode, that is, it is necessary to construct the motion information candidate list of the current block, and in this embodiment, based on the time domain motion information of the current block, Construct the motion information candidate list of the current block. For example, a multi-parameter model is obtained based on available motion information, the multi-parameter model may include at least four parameters, the available motion information includes temporal motion information of the current block and motion information of spatial adjacent blocks of the current block; then, according to This multi-parameter model builds a candidate list of motion information for the current block. For the manner of deriving the time-domain motion information of the current block, reference may be made to any of the embodiments in Embodiment 1 to Embodiment 6, which will not be repeated here.

在一种可能的实施方式中,多参数模型可以包括四参数模型和/或六参数模型;若多参数模型包括四参数模型,则可以基于当前块的时域运动信息和一个空域相邻块的运动信息获取四参数模型。当然,也可以基于两个空域相邻块的运动信息获取四参数模型。若多参数模型包括六参数模型,则可以基于当前块的时域运动信息和两个空域相邻块的运动信息获取六参数模型。当然,也可以基于三个空域相邻块的运动信息获取四参数模型。In a possible implementation manner, the multi-parameter model may include a four-parameter model and/or a six-parameter model; if the multi-parameter model includes a four-parameter model, it may be based on the temporal motion information of the current block and the A four-parameter model for motion information acquisition. Of course, a four-parameter model can also be obtained based on the motion information of two spatial adjacent blocks. If the multi-parameter model includes a six-parameter model, the six-parameter model can be obtained based on the temporal motion information of the current block and the motion information of two spatial adjacent blocks. Of course, a four-parameter model can also be obtained based on the motion information of three spatial adjacent blocks.

示例性的,AFFINE模式采用是多参数模型,如四参数模型和六参数模型,参见图5B所示,通过两个或者三个控制点的运动信息,得到每一个子块的运动信息。AFFINE模式可以分为AFFINE skip/direct和AFFINE inter两个部分。AFFINE skip/direct使用当前块周围的一些信息导出多参数模型,基于多参数模型构建运动信息候选列表,运动信息候选列表可以支持5个多参数模型。AFFINE skip/direct的运动信息候选列表的构建过程包括:从临近AFFINE编码单元拷贝多参数模型;利用当前块周围角点的运动信息生成多参数模型;如果运动信息候选列表的多参数模型数量没有到达五个,就填充零。AFFINE inter是在AFFINE skip/direct基础上加入了MVD,每一个控制点均需传输MVD,其运动信息候选列表构建过程类似。Exemplarily, the AFFINE mode adopts a multi-parameter model, such as a four-parameter model and a six-parameter model, as shown in FIG. 5B , and the motion information of each sub-block is obtained through the motion information of two or three control points. The AFFINE mode can be divided into two parts: AFFINE skip/direct and AFFINE inter. AFFINE skip/direct uses some information around the current block to derive a multi-parameter model, and builds a motion information candidate list based on the multi-parameter model. The motion information candidate list can support 5 multi-parameter models. The construction process of the AFFINE skip/direct motion information candidate list includes: copying the multi-parameter model from the adjacent AFFINE coding unit; using the motion information of the corner points around the current block to generate a multi-parameter model; if the number of multi-parameter models in the motion information candidate list has not reached Five, just pad with zeros. AFFINE inter adds MVD on the basis of AFFINE skip/direct. Each control point needs to transmit MVD, and the construction process of its motion information candidate list is similar.

以下结合具体应用场景,对AFFINE模式的运动信息候选列表的构建过程进行说明。假设运动信息候选列表的长度为X,即需要添加X个多参数模型,X可以根据经验配置,如5。The following describes the construction process of the motion information candidate list in the AFFINE mode in conjunction with specific application scenarios. Suppose the length of the motion information candidate list is X, that is, X multi-parameter models need to be added, and X can be configured according to experience, such as 5.

参见图4F所示,F,G,C,A,B,D是当前块的空域相邻块,如果A、B和D中至少有一个“可用”,则按A、B、D的顺序扫描得到第一个“可用”的相邻块X0;否则,X0“不存在”。示例性的,A、B和D中至少有一个“可用”,表示至少有一个空域相邻块的运动信息为可用运动信息,假设相邻块X0为A,则说明A的运动信息为可用运动信息。See Fig. 4F, F, G, C, A, B, D are adjacent blocks in the space of the current block, if at least one of A, B, and D is "available", scan in the order of A, B, D Get the first "available" neighboring block X0; otherwise, X0 "does not exist". Exemplarily, at least one of A, B, and D is "available", indicating that the motion information of at least one spatial adjacent block is available motion information. Assuming that the adjacent block X0 is A, it means that the motion information of A is available motion information. information.

如果G和C中至少有一个“可用”,则按G、C的顺序扫描得到第一个可用的相邻块X1;否则,X1“不存在”。G和C中至少有一个“可用”,表示至少有一个空域相邻块的运动信息为可用运动信息,假设相邻块X1为C,则说明C的运动信息为可用运动信息。If at least one of G and C is "available", scan in the order of G and C to get the first available adjacent block X1; otherwise, X1 "does not exist". At least one of G and C is "available", indicating that the motion information of at least one spatial adjacent block is available. Assuming that the adjacent block X1 is C, it means that the motion information of C is available.

如果F“可用”,则记相邻块F为X2;否则,X2“不存在”。If F is "available", record the adjacent block F as X2; otherwise, X2 "does not exist".

如果H“存在”,则记H为X3;否则,X3“不存在”,H块为collocated位置,即当前块的时域相邻块,如果H“存在”,则H的运动信息就是当前块的时域运动信息,当前块的时域运动信息的导出方式可以参见实施例1-实施例6中的任意实施例,在此不再赘述。If H "exists", record H as X3; otherwise, X3 "does not exist", and the H block is the collocated position, that is, the adjacent block in the time domain of the current block. If H "exists", then the motion information of H is the current block For the time-domain motion information of the current block, reference may be made to any of the embodiments in Embodiment 1 to Embodiment 6 for the derivation manner of the time-domain motion information of the current block, which will not be repeated here.

示例性的,如果X(X为X0、X1或X2)“存在”且X的L0参考索引不等于-1,则X的L0运动矢量为MVX_L0;否则MVX_L0“不存在”。如果X(X为X0、X1或X2)“存在”且X的L1参考索引不等于-1,则X的L1运动矢量为MVX_L1;否则MVX_L1“不存在”。如果X3“存在”且当前图像是B图像,则按时域运动信息的导出方式导出L0运动矢量MVX3_L0和L1运动矢量MVX3_L1,X3的L0和L1的参考索引均等于0;如果X3“存在”且当前图像是P图像,则按时域运动信息的导出方式导出L0运动矢量MVX3_L0,X3的L0参考索引等于0,L1参考索引等于-1;否则MVX3_L0和MVX3_L1“不存在”。Exemplarily, if X (X is X0, X1 or X2) "exists" and the L0 reference index of X is not equal to -1, then the L0 motion vector of X is MVX_L0; otherwise, MVX_L0 "does not exist". If X (X is X0, X1 or X2) is "present" and X's L1 reference index is not equal to -1, then X's L1 motion vector is MVX_L1; otherwise MVX_L1 is "absent". If X3 "exists" and the current image is a B image, then derive the L0 motion vector MVX3_L0 and the L1 motion vector MVX3_L1 according to the derivation method of temporal motion information, and the reference indexes of L0 and L1 of X3 are both equal to 0; if X3 "exists" and the current If the picture is a P picture, then the L0 motion vector MVX3_L0 is derived according to the derivation method of temporal motion information, the L0 reference index of X3 is equal to 0, and the L1 reference index is equal to -1; otherwise, MVX3_L0 and MVX3_L1 "do not exist".

综上所述,可以得到X0的运动信息,X1的运动信息,X2的运动信息,X3的运动信息。To sum up, the motion information of X0, the motion information of X1, the motion information of X2, and the motion information of X3 can be obtained.

示例性的,基于上述运动信息,可以构建AFFINE模式的运动信息候选列表,该运动信息候选列表依次包括如下多参数模型:{CPMV0,CPMV1,CPMV2},{CPMV0,CPMV1,CPMV3},{CPMV0,CPMV2,CPMV3},{CPMV1,CPMV2,CPMV3},{CPMV0,CPMV1},{CPMV0,CPMV2},CPMV0-CPMV3依次为X0-X3生成的运动信息。Exemplarily, based on the above motion information, a motion information candidate list of AFFINE mode can be constructed, and the motion information candidate list includes the following multi-parameter models in sequence: {CPMV0, CPMV1, CPMV2}, {CPMV0, CPMV1, CPMV3}, {CPMV0, CPMV2, CPMV3}, {CPMV1, CPMV2, CPMV3}, {CPMV0, CPMV1}, {CPMV0, CPMV2}, CPMV0-CPMV3 are the motion information generated by X0-X3 in turn.

示例性的,如果运动信息候选列表没有到达五个,就填充零运动信息。Exemplarily, if the motion information candidate list does not reach five, zero motion information is filled.

示例性的,基于AFFINE模式的运动信息候选列表,AFFINE模式的预测过程包括:Exemplarily, based on the motion information candidate list of the AFFINE mode, the prediction process of the AFFINE mode includes:

通过构造AFFINE模式的运动信息候选列表,利用运动信息候选列表中的多参数模型计算每个小块的mv(vx,vy),并对小块进行运动补偿。计算公式为:By constructing the motion information candidate list in AFFINE mode, the multi-parameter model in the motion information candidate list is used to calculate the mv(v x , v y ) of each small block, and perform motion compensation on the small block. The calculation formula is:

对于四参数模型来说,采用如下公式计算每个小块的mv(vx,vy):For the four-parameter model, the mv(v x , v y ) of each small block is calculated using the following formula:

Figure GDA0003902964790000321
Figure GDA0003902964790000321

对于六参数模型来说,采用如下公式计算每个小块的mv(vx,vy):For the six-parameter model, the mv(v x , v y ) of each small block is calculated using the following formula:

Figure GDA0003902964790000322
Figure GDA0003902964790000322

仿射运动补偿支持4参数和6参数的运动模型,如果当前块采用双向参考,则按照8*8的小块产生子块mv并对每个子块进行运动补偿,否则,当前块使用单向运动信息(前向参考或后向参考),则按照4*4或8*8的小块产生子块mv,并对每个子块进行运动补偿。Affine motion compensation supports 4-parameter and 6-parameter motion models. If the current block uses two-way reference, then generate sub-block mv according to the 8*8 small block and perform motion compensation for each sub-block; otherwise, the current block uses unidirectional motion information (forward reference or backward reference), generate sub-block mv according to 4*4 or 8*8 small blocks, and perform motion compensation on each sub-block.

示例性的,实施例1-实施例10可以单独实现,也可以组合实现。例如,实施例1和实施例2-实施例6的任一实施例组合实现,实施例7和实施例1-实施例6的任一实施例组合实现,实施例8和实施例1-实施例6的任一实施例组合实现,实施例9和实施例1-实施例6的任一实施例组合实现,实施例10和实施例1-实施例6的任一实施例组合实现。Exemplarily, Embodiment 1-Embodiment 10 may be implemented individually or in combination. For example, embodiment 1 and any embodiment of embodiment 2-embodiment 6 are realized in combination, embodiment 7 and embodiment 1-embodiment 6 are realized in combination, embodiment 8 and embodiment 1-embodiment Any embodiment of 6 is implemented in combination, embodiment 9 is implemented in combination with any embodiment of embodiment 1-embodiment 6, and embodiment 10 is implemented in combination with any embodiment of embodiment 1-embodiment 6.

当然,上述只是几个示例,对此实施例之间的组合方式不做限制。Of course, the above are just a few examples, and the combinations among these embodiments are not limited.

实施例11:基于与上述方法同样的申请构思,本申请实施例还提出一种运动信息候选列表的构建装置,应用于编码端或者解码端,参见图6A所示,为所述装置的结构图,包括:Embodiment 11: Based on the same application concept as the above method, the embodiment of the present application also proposes a device for constructing a motion information candidate list, which is applied to the encoding end or the decoding end, as shown in FIG. 6A, which is a structural diagram of the device ,include:

确定模块611,用于若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;以及,基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则所述确定模块611根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;构建模块612,用于基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。The determination module 611 is configured to determine the temporal adjacent blocks of the current block from the co-located frame of the current frame if the current frame where the current block is located is a B frame; and determine the current block based on the motion information of the temporal adjacent blocks. Time-domain motion information of the block, the time-domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time-domain adjacent blocks is not available, the time-domain adjacent blocks If the backward motion information is available, the determination module 611 determines the backward motion information in the time domain motion information according to the backward motion information of the time domain adjacent blocks; the construction module 612 is used to determine the backward motion information based on the current block The time-domain motion information of the current block is constructed to construct a motion information candidate list of the current block.

在一种可能的实施方式中,若所述时域相邻块的前向运动信息可用,所述时域相邻块的后向运动信息不可用,则所述确定模块611根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息,根据所述时域相邻块的前向运动信息确定所述时域运动信息中的后向运动信息。In a possible implementation manner, if the forward motion information of the adjacent blocks in the time domain is available but the backward motion information of the adjacent blocks in the time domain is not available, the determination module 611 The forward motion information of the neighboring blocks determines the forward motion information in the time domain motion information, and the backward motion information in the time domain motion information is determined according to the forward motion information of the time domain neighboring blocks.

在一种可能的实施方式中,若所述时域相邻块的前向运动信息可用,所述时域相邻块的后向运动信息可用,则所述确定模块611根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息,并根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息。In a possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is available and the backward motion information of the neighboring blocks in the time domain is available, the determination module 611 The forward motion information of the adjacent blocks determines the forward motion information in the time domain motion information, and determines the backward motion information in the time domain motion information according to the backward motion information of the time domain adjacent blocks.

在一种可能的实施方式中,若所述时域相邻块的前向运动信息可用,所述时域相邻块的后向运动信息可用,则所述确定模块611根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息,并根据所述时域相邻块的前向运动信息确定所述时域运动信息中的后向运动信息。In a possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is available and the backward motion information of the neighboring blocks in the time domain is available, the determination module 611 The forward motion information of the adjacent blocks determines the forward motion information in the time domain motion information, and determines the backward motion information in the time domain motion information according to the forward motion information of the time domain adjacent blocks.

在一种可能的实施方式中,若所述时域相邻块的前向运动信息可用,所述时域相邻块的后向运动信息不可用,所述确定模块611根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息。In a possible implementation manner, if the forward motion information of the neighboring blocks in the time domain is available, but the backward motion information of the neighboring blocks in the time domain is not available, the determination module 611 The forward motion information of the adjacent blocks determines the forward motion information in the time domain motion information.

在一种可能的实施方式中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则所述确定模块611根据所述时域相邻块的后向运动信息确定所述时域运动信息中的前向运动信息,并根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息。In a possible implementation manner, if the forward motion information of the adjacent blocks in the time domain is not available, but the backward motion information of the adjacent blocks in the time domain is available, the determination module 611 The backward motion information of the neighboring blocks determines the forward motion information in the time domain motion information, and the backward motion information in the time domain motion information is determined according to the backward motion information of the time domain neighboring blocks.

在一种可能的实施方式中,所述运动信息候选列表包括角度加权预测模式的运动信息候选列表;所述构建模块612具体用于:基于待加入到运动信息候选列表的可用运动信息,构建所述当前块的运动信息候选列表;其中,所述可用运动信息包括所述当前块的时域运动信息;所述可用运动信息还包括如下运动信息的至少一种:空域运动信息;HMVP运动信息;预设运动信息。In a possible implementation manner, the motion information candidate list includes an angle weighted prediction mode motion information candidate list; the construction module 612 is specifically configured to: construct the motion information candidate list based on the available motion information to be added to the motion information candidate list The motion information candidate list of the current block; wherein, the available motion information includes temporal motion information of the current block; the available motion information also includes at least one of the following motion information: spatial motion information; HMVP motion information; Preset exercise information.

在一种可能的实施方式中,所述运动信息候选列表包括高级运动信息表达模式的运动信息候选列表;所述构建模块612具体用于:基于待加入到运动信息候选列表的可用运动信息,构建所述当前块的运动信息候选列表;其中,所述可用运动信息包括所述当前块的时域运动信息;所述可用运动信息还包括如下运动信息的至少一种:空域运动信息;预设运动信息。In a possible implementation manner, the motion information candidate list includes a motion information candidate list of an advanced motion information expression mode; the construction module 612 is specifically configured to: construct The motion information candidate list of the current block; wherein, the available motion information includes temporal motion information of the current block; the available motion information also includes at least one of the following motion information: spatial motion information; preset motion information.

在一种可能的实施方式中,所述运动信息候选列表包括仿射运动补偿模式的运动信息候选列表;所述构建模块612具体用于:基于可用运动信息获取多参数模型;其中,所述多参数模型包括至少四个参数,所述可用运动信息包括所述当前块的时域运动信息以及所述当前块的空域相邻块的运动信息;根据所述多参数模型构建所述当前块的运动信息候选列表。In a possible implementation manner, the motion information candidate list includes a motion information candidate list of an affine motion compensation mode; the construction module 612 is specifically configured to: acquire a multi-parameter model based on available motion information; wherein, the multiple The parameter model includes at least four parameters, the available motion information includes temporal motion information of the current block and motion information of spatial adjacent blocks of the current block; constructing the motion of the current block according to the multi-parameter model Information Candidate List.

基于与上述方法同样的申请构思,本申请实施例提供的解码端设备(也可以称为视频解码器),从硬件层面而言,其硬件架构示意图具体可以参见图6B所示。包括:处理器621和机器可读存储介质622,其中:所述机器可读存储介质622存储有能够被所述处理器621执行的机器可执行指令;所述处理器621用于执行机器可执行指令,以实现本申请上述示例公开的方法。例如,所述处理器621用于执行机器可执行指令,以实现如下步骤:Based on the same application concept as the above-mentioned method, the decoding end device (also called a video decoder) provided by the embodiment of the present application, from the hardware level, its hardware architecture schematic diagram can be specifically shown in FIG. 6B . Including: a processor 621 and a machine-readable storage medium 622, wherein: the machine-readable storage medium 622 stores machine-executable instructions that can be executed by the processor 621; the processor 621 is used to execute machine-executable instructions Instructions to implement the methods disclosed in the above examples of the present application. For example, the processor 621 is configured to execute machine-executable instructions to implement the following steps:

若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame;

基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks If it is not available, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain; based on the current block The time-domain motion information of the current block is constructed to construct a motion information candidate list of the current block.

基于与上述方法同样的申请构思,本申请实施例提供的编码端设备(也可以称为视频编码器),从硬件层面而言,其硬件架构示意图具体可以参见图6C所示。包括:处理器631和机器可读存储介质632,其中:所述机器可读存储介质632存储有能够被所述处理器631执行的机器可执行指令;所述处理器631用于执行机器可执行指令,以实现本申请上述示例公开的方法。例如,所述处理器631用于执行机器可执行指令,以实现如下步骤:Based on the same application concept as the above-mentioned method, the encoding end device (also called a video encoder) provided in the embodiment of the present application, from the hardware level, its hardware architecture schematic diagram can be specifically referred to in FIG. 6C . Including: a processor 631 and a machine-readable storage medium 632, wherein: the machine-readable storage medium 632 stores machine-executable instructions that can be executed by the processor 631; the processor 631 is used to execute machine-executable instructions Instructions to implement the methods disclosed in the above examples of the present application. For example, the processor 631 is configured to execute machine-executable instructions to implement the following steps:

若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame;

基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表。Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks If it is not available, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the time domain motion information according to the backward motion information of the adjacent blocks in the time domain; based on the current block The time-domain motion information of the current block is constructed to construct a motion information candidate list of the current block.

基于与上述方法同样的申请构思,本申请实施例还提供一种机器可读存储介质,所述机器可读存储介质上存储有若干计算机指令,所述计算机指令被处理器执行时,能够实现本申请上述示例公开的方法,如上述各实施例中的运动信息候选列表的构建方法。Based on the same application idea as the above-mentioned method, the embodiment of the present application also provides a machine-readable storage medium, on which several computer instructions are stored, and when the computer instructions are executed by a processor, the present invention can be realized. The method disclosed in the above examples is applied, for example, the method for constructing the motion information candidate list in the above embodiments.

上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。The systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementing device is a computer, which may take the form of a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, e-mail device, game control device, etc. desktops, tablets, wearables, or any combination of these. For the convenience of description, when describing the above devices, functions are divided into various units and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in one or more pieces of software and/or hardware.

本领域内的技术人员应明白,本申请实施例可提供为方法、系统、或计算机程序产品。本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. This application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above descriptions are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (12)

1.一种运动信息候选列表的构建方法,其特征在于,所述方法包括:1. A construction method of motion information candidate list, is characterized in that, described method comprises: 若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame; 基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks Unavailable, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the motion information in the time domain according to the backward motion information of the adjacent blocks in the time domain; 基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表;Constructing a motion information candidate list of the current block based on the time-domain motion information of the current block; 其中,所述时域相邻块的后向运动信息包括所述时域相邻块的后向运动矢量和所述时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧,所述时域运动信息中的后向运动信息包括当前块的后向运动矢量和所述当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧;Wherein, the backward motion information of the neighboring block in time domain includes the backward motion vector of the neighboring block in time domain and the backward reference frame index of the neighboring block in time domain, and the backward reference frame index corresponds to The backward reference frame of the adjacent block, the backward motion information in the time domain motion information includes the backward motion vector of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the current the backward reference frame of the block; 根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息,包括:基于所述同位帧与所述时域相邻块的后向参考帧之间的距离,以及所述当前帧与所述当前块的后向参考帧之间的距离,对所述时域相邻块的后向运动矢量进行伸缩,得到伸缩后的运动矢量,将所述伸缩后的运动矢量确定为所述当前块的后向运动矢量;基于所述当前块的后向运动矢量和所述当前块的后向参考帧索引确定所述时域运动信息中的后向运动信息。Determining the backward motion information in the time domain motion information according to the backward motion information of the temporal domain adjacent block includes: based on the distance between the co-located frame and the backward reference frame of the temporal domain adjacent block distance, and the distance between the current frame and the backward reference frame of the current block, the backward motion vector of the adjacent block in the time domain is stretched to obtain the stretched motion vector, and the stretched Determine the motion vector of the current block as the backward motion vector of the current block; determine the backward motion information in the time domain motion information based on the backward motion vector of the current block and the backward reference frame index of the current block. 2.根据权利要求1所述的方法,其特征在于,2. The method of claim 1, wherein, 所述基于时域相邻块的运动信息确定当前块的时域运动信息,包括:The determining the time-domain motion information of the current block based on the motion information of the adjacent blocks in the time domain includes: 若所述时域相邻块的前向运动信息可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息,并根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;If the forward motion information of the neighboring blocks in the time domain is available and the backward motion information of the neighboring blocks in the time domain is available, then determine the time domain motion information according to the forward motion information of the neighboring blocks in the time domain The forward motion information in the time domain, and determine the backward motion information in the time domain motion information according to the backward motion information of the time domain adjacent blocks; 其中,所述时域相邻块的前向运动信息包括所述时域相邻块的前向运动矢量和所述时域相邻块的前向参考帧索引,该前向参考帧索引对应时域相邻块的前向参考帧,所述时域运动信息中的前向运动信息包括所述当前块的前向运动矢量和所述当前块的前向参考帧索引,该前向参考帧索引对应当前块的前向参考帧;Wherein, the forward motion information of the neighboring block in the time domain includes the forward motion vector of the neighboring block in the time domain and the forward reference frame index of the neighboring block in the time domain, and the forward reference frame index corresponds to The forward reference frame of the adjacent block, the forward motion information in the time domain motion information includes the forward motion vector of the current block and the forward reference frame index of the current block, the forward reference frame index The forward reference frame corresponding to the current block; 根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息,包括:基于所述同位帧与所述时域相邻块的前向参考帧之间的距离,以及所述当前帧与所述当前块的前向参考帧之间的距离,对所述时域相邻块的前向运动矢量进行伸缩,得到伸缩后的运动矢量,将所述伸缩后的运动矢量确定为所述当前块的前向运动矢量;基于所述当前块的前向运动矢量和所述当前块的前向参考帧索引确定所述时域运动信息中的前向运动信息。Determining the forward motion information in the time domain motion information according to the forward motion information of the time domain adjacent block includes: based on the distance between the co-located frame and the forward reference frame of the time domain adjacent block distance, and the distance between the current frame and the forward reference frame of the current block, stretch the forward motion vector of the neighboring block in the time domain to obtain the stretched motion vector, and stretch the stretched motion vector Determine the motion vector of the current block as the forward motion vector of the current block; determine the forward motion information in the time domain motion information based on the forward motion vector of the current block and the forward reference frame index of the current block. 3.根据权利要求1所述的方法,其特征在于,3. The method of claim 1, wherein, 所述基于时域相邻块的运动信息确定当前块的时域运动信息,包括:The determining the time-domain motion information of the current block based on the motion information of the adjacent blocks in the time domain includes: 若所述时域相邻块的前向运动信息可用,所述时域相邻块的后向运动信息不可用,则根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息;If the forward motion information of the neighboring blocks in the time domain is available but the backward motion information of the neighboring blocks in the time domain is not available, then determine the time domain motion according to the forward motion information of the neighboring blocks in the time domain Forward motion information in the message; 其中,所述时域相邻块的前向运动信息包括所述时域相邻块的前向运动矢量和所述时域相邻块的前向参考帧索引,该前向参考帧索引对应时域相邻块的前向参考帧,所述时域运动信息中的前向运动信息包括所述当前块的前向运动矢量和所述当前块的前向参考帧索引,该前向参考帧索引对应当前块的前向参考帧;Wherein, the forward motion information of the neighboring block in the time domain includes the forward motion vector of the neighboring block in the time domain and the forward reference frame index of the neighboring block in the time domain, and the forward reference frame index corresponds to The forward reference frame of the adjacent block, the forward motion information in the time domain motion information includes the forward motion vector of the current block and the forward reference frame index of the current block, the forward reference frame index The forward reference frame corresponding to the current block; 根据所述时域相邻块的前向运动信息确定所述时域运动信息中的前向运动信息,包括:基于所述同位帧与所述时域相邻块的前向参考帧之间的距离,以及所述当前帧与所述当前块的前向参考帧之间的距离,对所述时域相邻块的前向运动矢量进行伸缩,得到伸缩后的运动矢量,将所述伸缩后的运动矢量确定为所述当前块的前向运动矢量;基于所述当前块的前向运动矢量和所述当前块的前向参考帧索引确定所述时域运动信息中的前向运动信息。Determining the forward motion information in the time domain motion information according to the forward motion information of the time domain adjacent block includes: based on the distance between the co-located frame and the forward reference frame of the time domain adjacent block distance, and the distance between the current frame and the forward reference frame of the current block, stretch the forward motion vector of the neighboring block in the time domain to obtain the stretched motion vector, and stretch the stretched motion vector Determine the motion vector of the current block as the forward motion vector of the current block; determine the forward motion information in the time domain motion information based on the forward motion vector of the current block and the forward reference frame index of the current block. 4.根据权利要求1-3任一项所述的方法,其特征在于,4. The method according to any one of claims 1-3, characterized in that, 所述从当前帧的同位帧中确定出所述当前块的时域相邻块,包括:The determining the time-domain adjacent blocks of the current block from the co-located frame of the current frame includes: 基于所述当前块的预设位置,从所述当前帧的同位帧中确定出与所述预设位置对应的时域相邻块;其中,所述同位帧是所述当前帧的参考图像队列1中参考帧索引为0的对应帧;所述预设位置为所述当前块的左上角像素位置,或所述当前块的右上角像素位置,或所述当前块的左下角像素位置,或所述当前块的右下角像素位置,或所述当前块的中心像素位置。Based on the preset position of the current block, determine a temporal adjacent block corresponding to the preset position from co-located frames of the current frame; wherein the co-located frame is a reference image queue of the current frame The corresponding frame whose reference frame index in 1 is 0; the preset position is the upper left pixel position of the current block, or the upper right pixel position of the current block, or the lower left pixel position of the current block, or The pixel position of the lower right corner of the current block, or the center pixel position of the current block. 5.根据权利要求1-3任一所述的方法,其特征在于,5. The method according to any one of claims 1-3, characterized in that, 所述运动信息候选列表包括角度加权预测模式的运动信息候选列表;The motion information candidate list includes a motion information candidate list for an angle-weighted prediction mode; 所述基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表,包括:The constructing the motion information candidate list of the current block based on the time-domain motion information of the current block includes: 基于待加入到运动信息候选列表的可用运动信息,构建所述当前块的运动信息候选列表;Constructing a motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list; 其中,所述可用运动信息包括所述当前块的时域运动信息;所述可用运动信息还包括如下运动信息的至少一种:空域运动信息;HMVP运动信息;预设运动信息。Wherein, the available motion information includes time domain motion information of the current block; the available motion information further includes at least one of the following motion information: spatial domain motion information; HMVP motion information; preset motion information. 6.根据权利要求5所述的方法,其特征在于,6. The method of claim 5, wherein, 若所述可用运动信息包括空域运动信息,所述基于待加入到运动信息候选列表的可用运动信息,构建所述当前块的运动信息候选列表之前,所述方法还包括:If the available motion information includes spatial motion information, before constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list, the method further includes: 针对所述当前块的空域相邻块,若所述空域相邻块存在,且所述空域相邻块采用帧间预测模式,则将所述空域相邻块的运动信息确定为可用运动信息;和/或,For the spatial adjacent block of the current block, if the spatial adjacent block exists and the spatial adjacent block adopts an inter-frame prediction mode, then determine the motion information of the spatial adjacent block as available motion information; and / or, 针对所述当前块的第一空域相邻块,若所述第一空域相邻块存在,所述第一空域相邻块采用帧间预测模式,且所述第一空域相邻块的运动信息与所述当前块的第二空域相邻块的运动信息不同,则将所述第一空域相邻块的运动信息确定为可用运动信息。For the first spatial neighboring block of the current block, if the first spatial neighboring block exists, the first spatial neighboring block adopts inter-frame prediction mode, and the motion information of the first spatial neighboring block Different from the motion information of the second spatial adjacent block of the current block, the motion information of the first spatial adjacent block is determined as available motion information. 7.根据权利要求5所述的方法,其特征在于,7. The method of claim 5, wherein, 若所述可用运动信息包括预设运动信息,所述基于待加入到运动信息候选列表的可用运动信息,构建所述当前块的运动信息候选列表之前,所述方法还包括:If the available motion information includes preset motion information, before constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list, the method further includes: 将预设运动信息确定为可用运动信息;Determining preset exercise information as available exercise information; 其中,所述预设运动信息包括如下运动信息的至少一种:零运动信息;基于运动信息候选列表中已存在的运动信息所导出的缺省运动信息;运动信息候选列表中已存在的运动信息。Wherein, the preset motion information includes at least one of the following motion information: zero motion information; default motion information derived based on motion information existing in the motion information candidate list; motion information existing in the motion information candidate list . 8.根据权利要求5所述的方法,其特征在于,所述基于待加入到运动信息候选列表的可用运动信息,构建所述当前块的运动信息候选列表,包括:8. The method according to claim 5, wherein said constructing the motion information candidate list of the current block based on the available motion information to be added to the motion information candidate list comprises: 针对待加入到运动信息候选列表的可用运动信息,For the available motion information to be added to the motion information candidate list, 若所述可用运动信息为单向运动信息,则将所述单向运动信息加入到运动信息候选列表;若所述可用运动信息为双向运动信息,则将所述双向运动信息裁剪为第一单向运动信息和第二单向运动信息,将所述第一单向运动信息加入到运动信息候选列表;If the available motion information is one-way motion information, then add the one-way motion information to the motion information candidate list; if the available motion information is two-way motion information, then clip the two-way motion information into the first single Adding the first one-way motion information to the motion information candidate list for the motion information and the second one-way motion information; 或者,若所述可用运动信息为单向运动信息,且所述单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述单向运动信息加入到运动信息候选列表;Or, if the available motion information is unidirectional motion information, and the unidirectional motion information does not overlap with existing motion information in the motion information candidate list, then add the unidirectional motion information to the motion information candidate list; 若所述可用运动信息为双向运动信息,则将所述双向运动信息裁剪为第一单向运动信息和第二单向运动信息;若所述第一单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述第一单向运动信息加入到运动信息候选列表;If the available motion information is bidirectional motion information, clip the bidirectional motion information into first unidirectional motion information and second unidirectional motion information; if the first unidirectional motion information and the motion information candidate list have The existing motion information is not repeated, then adding the first unidirectional motion information to the motion information candidate list; 或者,若所述可用运动信息为单向运动信息,且所述单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述单向运动信息加入到运动信息候选列表;Or, if the available motion information is unidirectional motion information, and the unidirectional motion information does not overlap with existing motion information in the motion information candidate list, then add the unidirectional motion information to the motion information candidate list; 若所述可用运动信息为双向运动信息,则将所述双向运动信息裁剪为第一单向运动信息和第二单向运动信息;若第一单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述第一单向运动信息加入到运动信息候选列表;若第一单向运动信息与运动信息候选列表中已存在的运动信息重复,且第二单向运动信息与运动信息候选列表中已存在的运动信息不重复,则将所述第二单向运动信息加入到运动信息候选列表。If the available motion information is bidirectional motion information, clip the bidirectional motion information into first unidirectional motion information and second unidirectional motion information; If the motion information is not repeated, the first unidirectional motion information is added to the motion information candidate list; if the first unidirectional motion information is duplicated with the existing motion information in the motion information candidate list, and the second unidirectional motion information and If the existing motion information in the motion information candidate list is not repeated, the second unidirectional motion information is added to the motion information candidate list. 9.根据权利要求8所述的方法,其特征在于,9. The method of claim 8, wherein 所述第一单向运动信息是指向第一参考帧列表中参考帧的单向运动信息;The first unidirectional motion information is unidirectional motion information pointing to reference frames in the first reference frame list; 所述第二单向运动信息是指向第二参考帧列表中参考帧的单向运动信息;The second unidirectional motion information is unidirectional motion information pointing to reference frames in the second reference frame list; 其中,若运动信息候选列表中已存在的候选运动信息的总数量为偶数,则所述第一参考帧列表为当前块的前向参考帧列表,所述第二参考帧列表为当前块的后向参考帧列表;Wherein, if the total number of candidate motion information existing in the motion information candidate list is an even number, the first reference frame list is the forward reference frame list of the current block, and the second reference frame list is the subsequent reference frame list of the current block. to the list of reference frames; 若运动信息候选列表中已存在的候选运动信息的总数量为奇数,则所述第一参考帧列表为当前块的后向参考帧列表,所述第二参考帧列表为当前块的前向参考帧列表;或,If the total number of candidate motion information existing in the motion information candidate list is an odd number, the first reference frame list is the backward reference frame list of the current block, and the second reference frame list is the forward reference frame of the current block a list of frames; or, 若运动信息候选列表中已存在的候选运动信息的总数量为奇数,则所述第一参考帧列表为当前块的前向参考帧列表,所述第二参考帧列表为当前块的后向参考帧列表;If the total number of candidate motion information existing in the motion information candidate list is an odd number, the first reference frame list is the forward reference frame list of the current block, and the second reference frame list is the backward reference frame of the current block frame list; 若运动信息候选列表中已存在的候选运动信息的总数量为偶数,则所述第一参考帧列表为当前块的后向参考帧列表,所述第二参考帧列表为当前块的前向参考帧列表;或,If the total number of candidate motion information existing in the motion information candidate list is an even number, the first reference frame list is a backward reference frame list of the current block, and the second reference frame list is a forward reference frame list of the current block a list of frames; or, 所述第一参考帧列表为当前块的前向参考帧列表,所述第二参考帧列表为当前块的后向参考帧列表;或,The first reference frame list is a forward reference frame list of the current block, and the second reference frame list is a backward reference frame list of the current block; or, 所述第一参考帧列表为当前块的后向参考帧列表,所述第二参考帧列表为当前块的前向参考帧列表。The first reference frame list is a backward reference frame list of the current block, and the second reference frame list is a forward reference frame list of the current block. 10.一种运动信息候选列表的构建装置,其特征在于,所述装置包括:10. A device for constructing a motion information candidate list, characterized in that the device comprises: 确定模块,用于若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;以及,基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则所述确定模块根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;A determining module, configured to determine the temporal adjacent blocks of the current block from the co-located frame of the current frame if the current frame where the current block is located is a B frame; and determine the current block based on the motion information of the temporal adjacent blocks time domain motion information, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent block is not available, the time domain adjacent block after If the backward motion information is available, the determination module determines the backward motion information in the time domain motion information according to the backward motion information of the time domain adjacent blocks; 构建模块,用于基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表;A construction module, configured to construct a motion information candidate list of the current block based on the temporal motion information of the current block; 其中,所述时域相邻块的后向运动信息包括所述时域相邻块的后向运动矢量和所述时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧,所述时域运动信息中的后向运动信息包括当前块的后向运动矢量和所述当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧;其中,所述确定模块根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息时具体用于:基于所述同位帧与所述时域相邻块的后向参考帧之间的距离,以及所述当前帧与所述当前块的后向参考帧之间的距离,对所述时域相邻块的后向运动矢量进行伸缩,得到伸缩后的运动矢量,将所述伸缩后的运动矢量确定为所述当前块的后向运动矢量;基于所述当前块的后向运动矢量和所述当前块的后向参考帧索引确定所述时域运动信息中的后向运动信息。Wherein, the backward motion information of the neighboring block in time domain includes the backward motion vector of the neighboring block in time domain and the backward reference frame index of the neighboring block in time domain, and the backward reference frame index corresponds to The backward reference frame of the adjacent block, the backward motion information in the time domain motion information includes the backward motion vector of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the current A backward reference frame of a block; wherein, when the determining module determines the backward motion information in the time domain motion information according to the backward motion information of the time domain adjacent block, it is specifically used to: based on the co-located frame and The distance between the backward reference frames of the adjacent blocks in the time domain, and the distance between the current frame and the backward reference frame of the current block, the backward motion vector of the adjacent blocks in the time domain Perform stretching to obtain a stretched motion vector, and determine the stretched motion vector as the backward motion vector of the current block; based on the backward motion vector of the current block and the backward reference frame of the current block An index determines backward motion information in the temporal motion information. 11.一种解码端设备,其特征在于,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;11. A decoding device, comprising: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; 所述处理器用于执行机器可执行指令,以实现如下步骤:The processor is used to execute machine-executable instructions to implement the following steps: 若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame; 基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks Unavailable, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the motion information in the time domain according to the backward motion information of the adjacent blocks in the time domain; 基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表;Constructing a motion information candidate list of the current block based on the time-domain motion information of the current block; 其中,所述时域相邻块的后向运动信息包括所述时域相邻块的后向运动矢量和所述时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧,所述时域运动信息中的后向运动信息包括当前块的后向运动矢量和所述当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧;Wherein, the backward motion information of the neighboring block in time domain includes the backward motion vector of the neighboring block in time domain and the backward reference frame index of the neighboring block in time domain, and the backward reference frame index corresponds to The backward reference frame of the adjacent block, the backward motion information in the time domain motion information includes the backward motion vector of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the current the backward reference frame of the block; 根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息,包括:基于所述同位帧与所述时域相邻块的后向参考帧之间的距离,以及所述当前帧与所述当前块的后向参考帧之间的距离,对所述时域相邻块的后向运动矢量进行伸缩,得到伸缩后的运动矢量,将所述伸缩后的运动矢量确定为所述当前块的后向运动矢量;基于所述当前块的后向运动矢量和所述当前块的后向参考帧索引确定所述时域运动信息中的后向运动信息。Determining the backward motion information in the time domain motion information according to the backward motion information of the temporal domain adjacent block includes: based on the distance between the co-located frame and the backward reference frame of the temporal domain adjacent block distance, and the distance between the current frame and the backward reference frame of the current block, the backward motion vector of the adjacent block in the time domain is stretched to obtain the stretched motion vector, and the stretched Determine the motion vector of the current block as the backward motion vector of the current block; determine the backward motion information in the time domain motion information based on the backward motion vector of the current block and the backward reference frame index of the current block. 12.一种编码端设备,其特征在于,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;12. An encoding device, comprising: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; 所述处理器用于执行机器可执行指令,以实现如下步骤:The processor is used to execute machine-executable instructions to implement the following steps: 若当前块所在当前帧为B帧,则从当前帧的同位帧中确定出所述当前块的时域相邻块;If the current frame where the current block is located is a B frame, then determine the time-domain adjacent blocks of the current block from the co-located frame of the current frame; 基于时域相邻块的运动信息确定当前块的时域运动信息,所述时域运动信息包括前向运动信息和后向运动信息;其中,若所述时域相邻块的前向运动信息不可用,所述时域相邻块的后向运动信息可用,则根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息;Determine the time domain motion information of the current block based on the motion information of the time domain adjacent blocks, the time domain motion information includes forward motion information and backward motion information; wherein, if the forward motion information of the time domain adjacent blocks Unavailable, the backward motion information of the adjacent blocks in the time domain is available, then determine the backward motion information in the motion information in the time domain according to the backward motion information of the adjacent blocks in the time domain; 基于所述当前块的时域运动信息,构建所述当前块的运动信息候选列表;Constructing a motion information candidate list of the current block based on the time-domain motion information of the current block; 其中,所述时域相邻块的后向运动信息包括所述时域相邻块的后向运动矢量和所述时域相邻块的后向参考帧索引,该后向参考帧索引对应时域相邻块的后向参考帧,所述时域运动信息中的后向运动信息包括当前块的后向运动矢量和所述当前块的后向参考帧索引,该后向参考帧索引对应当前块的后向参考帧;Wherein, the backward motion information of the neighboring block in time domain includes the backward motion vector of the neighboring block in time domain and the backward reference frame index of the neighboring block in time domain, and the backward reference frame index corresponds to The backward reference frame of the adjacent block, the backward motion information in the time domain motion information includes the backward motion vector of the current block and the backward reference frame index of the current block, and the backward reference frame index corresponds to the current the backward reference frame of the block; 根据所述时域相邻块的后向运动信息确定所述时域运动信息中的后向运动信息,包括:基于所述同位帧与所述时域相邻块的后向参考帧之间的距离,以及所述当前帧与所述当前块的后向参考帧之间的距离,对所述时域相邻块的后向运动矢量进行伸缩,得到伸缩后的运动矢量,将所述伸缩后的运动矢量确定为所述当前块的后向运动矢量;基于所述当前块的后向运动矢量和所述当前块的后向参考帧索引确定所述时域运动信息中的后向运动信息。Determining the backward motion information in the time domain motion information according to the backward motion information of the temporal domain adjacent block includes: based on the distance between the co-located frame and the backward reference frame of the temporal domain adjacent block distance, and the distance between the current frame and the backward reference frame of the current block, the backward motion vector of the adjacent block in the time domain is stretched to obtain the stretched motion vector, and the stretched Determine the motion vector of the current block as the backward motion vector of the current block; determine the backward motion information in the time domain motion information based on the backward motion vector of the current block and the backward reference frame index of the current block.
CN202010637298.2A 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list Active CN113891089B (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202010637298.2A CN113891089B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list
CN202111150918.0A CN114007078B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list
CN202111153145.1A CN113873257B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010637298.2A CN113891089B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list

Related Child Applications (2)

Application Number Title Priority Date Filing Date
CN202111153145.1A Division CN113873257B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list
CN202111150918.0A Division CN114007078B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list

Publications (2)

Publication Number Publication Date
CN113891089A CN113891089A (en) 2022-01-04
CN113891089B true CN113891089B (en) 2022-12-23

Family

ID=79000655

Family Applications (3)

Application Number Title Priority Date Filing Date
CN202111150918.0A Active CN114007078B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list
CN202010637298.2A Active CN113891089B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list
CN202111153145.1A Active CN113873257B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202111150918.0A Active CN114007078B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list

Family Applications After (1)

Application Number Title Priority Date Filing Date
CN202111153145.1A Active CN113873257B (en) 2020-07-03 2020-07-03 Method, device and equipment for constructing motion information candidate list

Country Status (1)

Country Link
CN (3) CN114007078B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024008011A1 (en) * 2022-07-05 2024-01-11 Beijing Bytedance Network Technology Co., Ltd. Method, apparatus, and medium for video processing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110225346A (en) * 2018-12-28 2019-09-10 杭州海康威视数字技术股份有限公司 A kind of decoding method and its equipment
WO2020063687A1 (en) * 2018-09-27 2020-04-02 华为技术有限公司 Video decoding method and video decoder
CN111164976A (en) * 2019-01-03 2020-05-15 北京大学 Video processing method and device
CN111263166A (en) * 2018-11-30 2020-06-09 华为技术有限公司 A video image prediction method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2015137783A1 (en) * 2014-03-14 2015-09-17 삼성전자 주식회사 Method and device for configuring merge candidate list for decoding and encoding of interlayer video
US11025904B2 (en) * 2018-06-08 2021-06-01 Tencent America LLC Method and apparatus for temporal motion vector prediction
CN110933426B (en) * 2018-09-20 2022-03-01 杭州海康威视数字技术股份有限公司 A decoding and encoding method and device thereof
CN111698506B (en) * 2019-03-11 2022-04-26 杭州海康威视数字技术股份有限公司 Motion information candidate list construction method, triangular prediction decoding method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020063687A1 (en) * 2018-09-27 2020-04-02 华为技术有限公司 Video decoding method and video decoder
CN111263166A (en) * 2018-11-30 2020-06-09 华为技术有限公司 A video image prediction method and device
CN110225346A (en) * 2018-12-28 2019-09-10 杭州海康威视数字技术股份有限公司 A kind of decoding method and its equipment
CN111164976A (en) * 2019-01-03 2020-05-15 北京大学 Video processing method and device

Also Published As

Publication number Publication date
CN113891089A (en) 2022-01-04
CN113873257B (en) 2022-12-23
CN113873257A (en) 2021-12-31
CN114007078B (en) 2022-12-23
CN114007078A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
JP6768110B2 (en) Video decoding device and video coding device
CN104320666B (en) Image processing equipment and method
JP5081305B2 (en) Method and apparatus for interframe predictive coding
CN102265619B (en) Offset calculation in switched interpolation filters
CN110225346A (en) A kind of decoding method and its equipment
CN102823250B (en) Picture coding device, picture decoding apparatus, method for encoding images and picture decoding method
JP2015165694A (en) Video decoding method and apparatus
CN101867817A (en) Advanced bi-directional predictive coding of interlaced video
CN113810686B (en) Encoding and decoding method, device and equipment
CN104717512B (en) A kind of encoding and decoding method and device for forward double-hypothesis encoding image block
CN112135144B (en) Encoding and decoding method, device and equipment
JP2012151576A (en) Image coding method, image coding device, image decoding method and image decoding device
US7924918B2 (en) Temporal prediction in video coding
CN115348443A (en) Motion information determination method, device and equipment
CN112449181B (en) Encoding and decoding method, device and equipment
CN113891089B (en) Method, device and equipment for constructing motion information candidate list
CN114079783B (en) Encoding and decoding method, device and equipment
CN112291561B (en) HEVC maximum coding block motion vector calculation method, HEVC maximum coding block motion vector calculation device, HEVC maximum coding block motion vector chip and HEVC maximum coding block motion vector storage medium
HK40064078A (en) Method, device and equipment for constructing motion information candidate list
HK40064078B (en) Method, device and equipment for constructing motion information candidate list
CN112055220B (en) A coding and decoding method, device and equipment thereof
JP2018085751A (en) Video encoding method and video decoding method
JP5946980B1 (en) Image decoding method
JP2016158306A (en) Image decoding method
JP2016119726A (en) Image decoding method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载