CN111684799A - Video processing method and device - Google Patents

Video processing method and device Download PDF

Info

Publication number
CN111684799A
CN111684799A CN201980009149.7A CN201980009149A CN111684799A CN 111684799 A CN111684799 A CN 111684799A CN 201980009149 A CN201980009149 A CN 201980009149A CN 111684799 A CN111684799 A CN 111684799A
Authority
CN
China
Prior art keywords
offset value
motion vector
block
target candidate
current block
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.)
Granted
Application number
CN201980009149.7A
Other languages
Chinese (zh)
Other versions
CN111684799B (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.)
Peking University
SZ DJI Technology Co Ltd
Original Assignee
Peking University
SZ DJI 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 Peking University, SZ DJI Technology Co Ltd filed Critical Peking University
Publication of CN111684799A publication Critical patent/CN111684799A/en
Application granted granted Critical
Publication of CN111684799B publication Critical patent/CN111684799B/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/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • 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/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction

Landscapes

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

Abstract

提供一种视频处理方法和装置。该方法包括从当前块的运动矢量候选列表中选取目标候选块的运动矢量,运动矢量候选列表包括多个候选块的运动矢量;确定当前块的第一偏移值;当目标候选块和当前块位于不同帧,且目标候选块具有两个运动矢量时,确定当前块的第二偏移值;根据第一偏移值对目标候选块的第一运动矢量进行偏移;根据第二偏移值对目标候选块的第二运动矢量进行偏移。通过识别特定候选块,并为特定候选块选取适配的偏移方案,可以优化帧间预测方式。

Figure 201980009149

A video processing method and apparatus are provided. The method includes selecting a motion vector of a target candidate block from a motion vector candidate list of the current block, the motion vector candidate list including motion vectors of a plurality of candidate blocks; determining a first offset value of the current block; when the target candidate block and the current block are When the target candidate block is located in a different frame and the target candidate block has two motion vectors, the second offset value of the current block is determined; the first motion vector of the target candidate block is offset according to the first offset value; according to the second offset value Offset the second motion vector of the target candidate block. By identifying a specific candidate block and selecting an adapted offset scheme for the specific candidate block, the inter prediction method can be optimized.

Figure 201980009149

Description

视频处理方法和装置Video processing method and device

版权申明Copyright notice

本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。The disclosure of this patent document contains material that is subject to copyright protection. This copyright belongs to the copyright owner. The copyright owner has no objection to the reproduction by anyone of the patent document or the patent disclosure as it exists in the official records and archives of the Patent and Trademark Office.

技术领域technical field

本申请涉及视频编解码领域,并且更为具体地,涉及一种视频处理方法和装置。The present application relates to the field of video coding and decoding, and more particularly, to a video processing method and apparatus.

背景技术Background technique

视频编码过程包括帧间预测过程。帧间预测模式可以有多种,有些帧间预测模式会构建当前块的运动矢量候选列表,并基于当前块的运动矢量候选列表确定当前块的运动矢量。The video encoding process includes an inter prediction process. There are various inter prediction modes. Some inter prediction modes will construct a motion vector candidate list of the current block, and determine the motion vector of the current block based on the motion vector candidate list of the current block.

为了改善帧间预测效果,在确定当前块的运动矢量的过程中,有些帧间预测模式会对当前块的运动矢量候选列表中的运动矢量进行一定程度的偏移。In order to improve the effect of inter-frame prediction, in the process of determining the motion vector of the current block, some inter-frame prediction modes will offset the motion vector in the motion vector candidate list of the current block to a certain extent.

发明内容SUMMARY OF THE INVENTION

本申请提供一种视频处理方法和装置,以优化帧间预测方式。The present application provides a video processing method and apparatus to optimize an inter-frame prediction method.

第一方面,提供一种视频处理方法,包括:从当前块的运动矢量候选列表中选取目标候选块的运动矢量,所述运动矢量候选列表包括多个候选块的运动矢量;确定所述当前块的第一偏移值;当所述目标候选块和当前块位于不同帧,且所述目标候选块具有两个运动矢量时,确定所述当前块的第二偏移值;根据所述第一偏移值对所述目标候选块的第一运动矢量进行偏移;根据所述第二偏移值对所述目标候选块的第二运动矢量进行偏移。A first aspect provides a video processing method, comprising: selecting a motion vector of a target candidate block from a motion vector candidate list of a current block, the motion vector candidate list including motion vectors of multiple candidate blocks; determining the current block When the target candidate block and the current block are located in different frames, and the target candidate block has two motion vectors, determine the second offset value of the current block; according to the first The offset value offsets the first motion vector of the target candidate block; the second motion vector of the target candidate block is offset according to the second offset value.

第二方面,提供一种视频处理装置,包括:存储器,用于存储代码;处理器,用于读取所述存储器中的代码,以执行如下操作:从当前块的运动矢量候选列表中选取目标候选块的运动矢量,所述运动矢量候选列表包括多个候选块的运动矢量;确定所述当前块的第一偏移值;当所述目标候选块和当前块位于不同帧,且所述目标候选块具有两个运动矢量时,确定所述当前块的第二偏移值;根据所述第一偏移值对所述目标候选块的第一运动矢量进行偏移;根据所述第二偏移值对所述目标候选块的第二运动矢量进行偏移。In a second aspect, a video processing apparatus is provided, comprising: a memory for storing codes; a processor for reading codes in the memory to perform the following operations: selecting a target from a motion vector candidate list of a current block motion vectors of candidate blocks, the motion vector candidate list includes motion vectors of multiple candidate blocks; determining the first offset value of the current block; when the target candidate block and the current block are located in different frames, and the target When the candidate block has two motion vectors, determine a second offset value of the current block; offset the first motion vector of the target candidate block according to the first offset value; The offset value offsets the second motion vector of the target candidate block.

第三方面,提供一种视频处理装置,包括用于执行第一方面中的方法的各个步骤的模块。In a third aspect, a video processing apparatus is provided, comprising modules for performing each step of the method in the first aspect.

第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行第一方面所述的方法。In a fourth aspect, a computer-readable storage medium is provided, and instructions are stored in the computer-readable storage medium, which, when executed on a computer, cause the computer to perform the method of the first aspect.

第五方面,提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行第一方面所述的方法。In a fifth aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect.

本申请识别特定候选块,并为特定候选块选取适配的偏移方案,可以优化帧间预测方式。The present application identifies a specific candidate block and selects an adapted offset scheme for the specific candidate block, which can optimize the inter-frame prediction method.

附图说明Description of drawings

图1是merge候选列表的构建过程的示意性流程图。FIG. 1 is a schematic flowchart of the construction process of the merge candidate list.

图2是时域运动矢量的缩放方式的示例图。FIG. 2 is an example diagram of a scaling method of a temporal motion vector.

图3是lowdelay模式下的预测方式示例图。FIG. 3 is an example diagram of a prediction mode in the lowdelay mode.

图4是random access模式下的预测方式示例图。FIG. 4 is an example diagram of a prediction method in random access mode.

图5是本申请实施例提供的视频处理方法的示意性流程图。FIG. 5 is a schematic flowchart of a video processing method provided by an embodiment of the present application.

图6是当前帧的两个参考帧均位于当前帧的同一侧的示例图。FIG. 6 is an example diagram in which both reference frames of the current frame are located on the same side of the current frame.

图7是本申请实施例提供的缩放方案的示例图。FIG. 7 is an example diagram of a scaling solution provided by an embodiment of the present application.

图8是本申请实施例提供的视频处理装置的示意性结构图。FIG. 8 is a schematic structural diagram of a video processing apparatus provided by an embodiment of the present application.

具体实施方式Detailed ways

本申请可应用于多种视频编码标准,如H.264,高效率视频编码(high efficiencyvideo coding,HEVC),通用视频编码(versatile video coding,VVC),音视频编码标准(audio video coding standard,AVS),AVS+,AVS2以及AVS3等。The present application can be applied to various video coding standards, such as H.264, high efficiency video coding (HEVC), universal video coding (VVC), audio video coding standard (AVS) ), AVS+, AVS2 and AVS3 etc.

本申请中提及的两帧之间的距离可以指两帧在播放顺序上的差异,距离越大,播放顺序差异越大;由于播放顺序可以利用帧号(picture of order,POC)表示,因此,在某些实施例中,两帧之间的距离可以采用两帧帧号之间的差值进行度量。The distance between two frames mentioned in this application may refer to the difference in the playing order of the two frames. The greater the distance, the greater the difference in the playing order. , in some embodiments, the distance between the two frames can be measured by using the difference between the frame numbers of the two frames.

视频编码过程主要包括预测、变换、量化、熵编码、环路滤波等部分。预测是主流视频编码技术的重要组成部分。预测可以分为帧内预测和帧间预测。帧间预测可以通过运动补偿的方式来实现。下面对运动补偿过程进行举例说明。The video coding process mainly includes prediction, transformation, quantization, entropy coding, loop filtering and other parts. Prediction is an important part of mainstream video coding techniques. Prediction can be divided into intra prediction and inter prediction. Inter-frame prediction can be achieved by means of motion compensation. The motion compensation process is illustrated below with an example.

例如,对于一帧图像,可以先将其划分成一个或多个编码区域。该编码区域也可称为编码树单元(coding tree unit,CTU)。CTU的尺寸例如可以是64×64,也可以是128×128(单位为像素,后文的类似描述均省略单位)。每个CTU可以划分成方形或矩形的图像块,后文将编码端或解码端当前正在处理的图像块称为当前块。本申请实施例提及的当前块有时可以指当前编码单元(coding unit,CU),有时也可指当前预测单元(prediction unit,PU),本申请实施例对此并不限定。For example, for a frame of image, it can be divided into one or more coding regions. The coding region may also be referred to as a coding tree unit (CTU). The size of the CTU may be, for example, 64×64 or 128×128 (the unit is a pixel, and the unit is omitted in the similar description below). Each CTU can be divided into square or rectangular image blocks, and the image block currently being processed by the encoding end or the decoding end is referred to as the current block hereinafter. The current block mentioned in the embodiments of the present application may sometimes refer to the current coding unit (coding unit, CU), and sometimes may also refer to the current prediction unit (prediction unit, PU), which is not limited in the embodiments of the present application.

在对当前块进行帧间预测时,可以从参考帧(可以是时域附近的已重构帧)中寻找当前块的相似块,作为当前块的预测块。当前块与相似块之间的相对位移称为运动矢量。在参考帧中寻找相似块作为当前块的预测块的过程即为运动补偿。When performing inter-frame prediction on the current block, a similar block of the current block may be searched from a reference frame (which may be a reconstructed frame near the time domain) as a prediction block of the current block. The relative displacement between the current block and similar blocks is called the motion vector. The process of finding a similar block in the reference frame as the prediction block of the current block is motion compensation.

帧间预测模式可以有多种,有些帧间预测模式会构建当前块的运动矢量候选列表,并从当前块的运动矢量候选列表中选取当前块的运动矢量。下面以merge模式为例,对运动矢量候选列表(在merge模式中,运动矢量候选列表也可称为merge候选列表)的构建过程进行举例说明。There are various inter prediction modes. Some inter prediction modes will construct a motion vector candidate list of the current block, and select the motion vector of the current block from the motion vector candidate list of the current block. The following takes the merge mode as an example to illustrate the construction process of the motion vector candidate list (in the merge mode, the motion vector candidate list may also be referred to as the merge candidate list).

如图1所示,merge候选列表的构建过程包括步骤S102至步骤S118。As shown in FIG. 1 , the construction process of the merge candidate list includes steps S102 to S118.

在步骤S102,向merge候选列表中添加空域MVP(Motion Vector Prediction,运动矢量预测值),或称空域MVP候选(spatial MVP candidate(s))。In step S102, a spatial MVP (Motion Vector Prediction, motion vector prediction value), or a spatial MVP candidate (s), is added to the merge candidate list.

空域MVP是与当前块处于同一帧的空间相邻块的运动矢量。空域MVP的最大数量可以设置为4。The spatial MVP is the motion vector of a spatially neighboring block in the same frame as the current block. The maximum number of airspace MVPs can be set to 4.

在步骤S104,判断merge候选列表中的候选数量是否达到预设最大值(maxNumMergeCand)。In step S104, it is determined whether the number of candidates in the merge candidate list reaches a preset maximum value (maxNumMergeCand).

如果merge候选列表中的候选数量达到预设最大值,结束图1的流程;如果merge候选列表中的候选数量未达到预设最大值,可以继续执行步骤S106。If the number of candidates in the merge candidate list reaches the preset maximum value, the process of FIG. 1 ends; if the number of candidates in the merge candidate list does not reach the preset maximum value, step S106 may be continued.

在步骤S106,向merge候选列表中添加TMVP,或称TMVP候选(temporal MVPcandidate(s))。In step S106, a TMVP, or TMVP candidate (temporal MVP candidate(s)) is added to the merge candidate list.

步骤S106中添加的TMVP可以基于当前帧的同位帧中的同位块(col-locatedblock)的运动矢量确定。由于同位帧与同位帧的参考帧之间的距离与当前帧与当前帧的参考帧之间的距离通常不同,所以同位块的运动矢量一般需要经过缩放之后才能作为TMVP被添加至merge候选列表中。后文会结合图2,对TMVP的获取过程进行更为详细的描述。The TMVP added in step S106 may be determined based on the motion vector of a col-located block in the co-located frame of the current frame. Since the distance between the co-located frame and the reference frame of the co-located frame is usually different from the distance between the current frame and the reference frame of the current frame, the motion vector of the co-located block generally needs to be scaled before being added to the merge candidate list as a TMVP. . The process of acquiring the TMVP will be described in more detail later in conjunction with FIG. 2 .

在步骤S108,判断merge候选列表中的候选数量是否达到预设最大值。In step S108, it is determined whether the number of candidates in the merge candidate list reaches a preset maximum value.

如果merge候选列表中的候选数量达到预设最大值,结束图1的流程;如果merge候选列表中的候选数量未达到预设最大值,继续执行步骤S110。If the number of candidates in the merge candidate list reaches the preset maximum value, the process of FIG. 1 ends; if the number of candidates in the merge candidate list does not reach the preset maximum value, step S110 is continued.

在步骤S110,向merge候选列表中添加历史MVP(historical MVP),或称HMVP候选。In step S110, a historical MVP (historical MVP), or HMVP candidate, is added to the merge candidate list.

HMVP可以是当前块所在帧中的其他块(如当前块的非相邻块)的运动矢量。The HMVP may be motion vectors of other blocks (eg, non-adjacent blocks of the current block) in the frame where the current block is located.

在步骤S112,判断merge候选列表中的候选数量是否达到预设最大值。In step S112, it is determined whether the number of candidates in the merge candidate list reaches a preset maximum value.

如果merge候选列表中的候选数量达到预设最大值,结束图1的流程;如果merge候选列表中的候选数量未达到预设最大值,继续执行步骤S114。If the number of candidates in the merge candidate list reaches the preset maximum value, the process of FIG. 1 ends; if the number of candidates in the merge candidate list does not reach the preset maximum value, step S114 is continued.

在步骤S114,向merge候选列表中添加成对MVP(pairwise MVP)。In step S114, a pairwise MVP (pairwise MVP) is added to the merge candidate list.

pairwise MVP可以是将已添加至merge候选列表中的MVP进行加和平均等处理之后得到的MVP。The pairwise MVP may be an MVP obtained by adding and averaging the MVPs added to the merge candidate list.

在步骤S116,判断merge候选列表中的候选数量是否达到预设最大值。In step S116, it is determined whether the number of candidates in the merge candidate list reaches a preset maximum value.

如果merge候选列表中的候选数量达到预设最大值,结束图1的流程;如果merge候选列表中的候选数量未达到预设最大值,继续执行步骤S118。If the number of candidates in the merge candidate list reaches the preset maximum value, the process of FIG. 1 ends; if the number of candidates in the merge candidate list does not reach the preset maximum value, step S118 is continued.

在步骤S118,向merge候选列表中添加向量(0,0),直到merge候选列表中的候选数量达到预设最大值。In step S118, the vector (0, 0) is added to the merge candidate list until the number of candidates in the merge candidate list reaches a preset maximum value.

应理解,步骤S108至步骤S118均为可选步骤。例如,在向merge候选列表添加了空域MVP和TMVP之后,即可停止merge候选列表的构建。又如,在向merge候选列表添加了空域MVP和TMVP之后,如果merge候选列表中的候选数量仍未达到预设最大值,则可以添加向量(0,0)。又如,在向merge候选列表添加了空域MVP和TMVP之后,如果merge候选列表中的候选数量仍未达到预设最大值,可以执行上述步骤S110至步骤S112,而不执行步骤S114至步骤S116;或者,如果merge候选列表中的候选数量仍未达到预设最大值,执行步骤S114至步骤S116,而不执行步骤S110至步骤S112。It should be understood that steps S108 to S118 are optional steps. For example, after adding the airspace MVP and TMVP to the merge candidate list, the construction of the merge candidate list can be stopped. For another example, after adding the spatial MVP and TMVP to the merge candidate list, if the number of candidates in the merge candidate list has not yet reached the preset maximum value, a vector (0, 0) may be added. For another example, after adding the airspace MVP and TMVP to the merge candidate list, if the number of candidates in the merge candidate list has not yet reached the preset maximum value, the above-mentioned steps S110 to S112 may be performed without performing steps S114 to S116; Alternatively, if the number of candidates in the merge candidate list has not yet reached the preset maximum value, steps S114 to S116 are performed, and steps S110 to S112 are not performed.

步骤S106获取的TMVP可以指的是基于TMVP技术得到的候选块的运动矢量。下面结合图2,对TMVP的获取过程进行介绍。The TMVP obtained in step S106 may refer to the motion vector of the candidate block obtained based on the TMVP technology. The following describes the acquisition process of the TMVP with reference to FIG. 2 .

在构建当前块(cur_PU)的merge候选列表的过程中,如果需要向merge候选列表添加TMVP,则通常会先确定当前块的同位帧(col_pic)。该同位帧是与当前帧在时域上不同的一帧。该同位帧例如可以是当前块的参考列表中的第一帧。在确定同位帧之后,可以从同位帧中确定当前块的对应块,作为当前块的同位块(col_PU)。例如,可以将同位帧中的与当前块在C1(当前块的右下角点)或C0(当前块的中心点)位置的对应块确定为当前块的同位块。In the process of constructing the merge candidate list of the current block (cur_PU), if a TMVP needs to be added to the merge candidate list, the co-located frame (col_pic) of the current block is usually determined first. The co-located frame is a frame different in time domain from the current frame. The co-located frame may be, for example, the first frame in the reference list of the current block. After the co-located frame is determined, a corresponding block of the current block may be determined from the co-located frame as a co-located block (col_PU) of the current block. For example, a block in the co-located frame corresponding to the current block at C1 (lower right corner point of the current block) or C0 (center point of the current block) may be determined as the co-located block of the current block.

接着,可以基于同位块的运动矢量确定TMVP。如图2所示,同位帧(col_pic)与同位帧的参考帧(col_ref)之间的距离用tb表示,当前帧(cur_pic)与当前帧的参考帧(cur_ref)之间的距离用td表示。由于tb和td通常不同,因此,通常先对同位块的运动矢量colMV进行缩放,得到curMV,再将curMV作为TMVP,添加至merge候选列表中。curMV可以通过以下公式计算得到:curMV=td*colMV/tb。为了便于描述,后文会将同位块的运动矢量的缩放操作称为:将同位块的运动矢量映射至当前帧的参考帧。Next, the TMVP may be determined based on the motion vector of the co-located block. As shown in FIG. 2 , the distance between the co-located frame (col_pic) and the reference frame (col_ref) of the co-located frame is represented by tb, and the distance between the current frame (cur_pic) and the reference frame (cur_ref) of the current frame is represented by td. Since tb and td are usually different, the motion vector colMV of the co-located block is usually scaled first to obtain curMV, and then curMV is added to the merge candidate list as TMVP. curMV can be calculated by the following formula: curMV=td*colMV/tb. For convenience of description, the scaling operation of the motion vector of the co-located block will be referred to as: mapping the motion vector of the co-located block to the reference frame of the current frame.

在运用时域运动矢量预测技术时,如果当前帧为B帧(即当前帧采用双向预测模式),则需要执行2次如图2所示的缩放操作,一次缩放操作用于将同位块的运动矢量映射至当前块的前向参考帧,另一次缩放操作用于将同位块的运动矢量映射至当前块的后向参考帧。When using the temporal motion vector prediction technology, if the current frame is a B frame (that is, the current frame adopts the bidirectional prediction mode), it is necessary to perform two scaling operations as shown in Figure 2, and one scaling operation is used to convert the motion of the co-located block The vector is mapped to the forward reference frame of the current block, and another scaling operation is used to map the motion vector of the co-located block to the backward reference frame of the current block.

需要说明的是,同位块可以为双向预测模式,因此,同位块可以包括两个运动矢量,其中一个运动矢量为同位块的前向预测模式对应的运动矢量(下文用col_MV0表示),另一个运动矢量为同位块的后向预测模式对应的运动矢量(下文用col_MV1表示)。在执行上述两次缩放操作时,一种可能的实现方式是将col_MV0分别映射至当前块的前向参考帧和后向参考帧;或者,可以将col_MV0映射至当前块的前向参考帧,并将col_MV1映射至当前块的后向参考帧;或者,可以将col_MV1分别映射至当前块的前向参考帧和后向参考帧;或者,也可以将col_MV1映射指当前块的前向参考帧,并将col_MV0映射至当前块的后向参考帧。It should be noted that the co-located block may be a bidirectional prediction mode. Therefore, the co-located block may include two motion vectors, one of which is the motion vector corresponding to the forward prediction mode of the co-located block (represented by col_MV0 hereinafter), and the other is the motion vector corresponding to the forward prediction mode of the co-located block. The vector is the motion vector corresponding to the backward prediction mode of the co-located block (represented by col_MV1 below). When performing the above two scaling operations, a possible implementation is to map col_MV0 to the forward reference frame and backward reference frame of the current block respectively; or, to map col_MV0 to the forward reference frame of the current block, and Map col_MV1 to the backward reference frame of the current block; alternatively, col_MV1 can be mapped to the forward reference frame and backward reference frame of the current block respectively; alternatively, col_MV1 can also be mapped to the forward reference frame of the current block, and Map col_MV0 to the backward reference frame of the current block.

下面结合图3和图4,分别以低延时(lowdelay)模式和随机访问(random access)模式为例,对同位块的运动矢量映射至当前帧的前向参考帧和后向参考帧的过程进行说明。3 and 4, the process of mapping the motion vector of the co-located block to the forward reference frame and the backward reference frame of the current frame by taking the low delay mode and the random access mode as examples, respectively Be explained.

lowdelay模式下,当前帧的参考帧的帧号均比当前帧的帧号小,即当前帧的参考帧的播放顺序均在当前帧的播放顺序之前。In the lowdelay mode, the frame numbers of the reference frames of the current frame are all smaller than the frame numbers of the current frame, that is, the playback order of the reference frames of the current frame is before the playback order of the current frame.

以图3为例,在lowdelay模式下,当前帧(cur_pic)为POC 5,其前向参考列表的第一帧为POC 4,后向参考列表的第一帧为POC 4。在图3的示例中,POC 4同时为当前帧的同位帧(col_pic)、前向参考帧(cur_ref0)和后向参考帧(cur_ref1)。POC 4的前向参考列表为{POC 3,POC2,POC0},后向参考列表为{POC 3,POC2,POC0}。POC 4的前向参考帧可能为POC3,POC 2以及POC 0中的任一帧,图3是以POC 4的前向参考帧为POC 3为例进行说明的。同理,POC 4的后向参考帧可能为POC 3,POC2以及POC0中的任一帧,图3是以POC 4的后向参考帧为POC 2为例进行说明的。Taking FIG. 3 as an example, in the lowdelay mode, the current frame (cur_pic) is POC 5, the first frame of the forward reference list is POC 4, and the first frame of the backward reference list is POC 4. In the example of FIG. 3, POC 4 is simultaneously the co-located frame (col_pic), the forward reference frame (cur_ref0) and the backward reference frame (cur_ref1) of the current frame. The forward reference list for POC 4 is {POC 3, POC2, POC0} and the backward reference list is {POC 3, POC2, POC0}. The forward reference frame of POC 4 may be any one of POC3, POC 2, and POC 0. FIG. 3 takes the example that the forward reference frame of POC 4 is POC 3 for illustration. Similarly, the backward reference frame of POC 4 may be any one of POC 3, POC 2, and POC 0. FIG. 3 takes the backward reference frame of POC 4 as POC 2 as an example for illustration.

图3中的(a)描述的是lowdelay模式下的针对前向预测模式的缩放操作,其结果是将当前块(cur_PU)的同位块(col_PU)的运动矢量(col_MV0)映射至当前块的前向参考帧(POC 4),从而得到时域运动矢量预测cur_MV0。图3中的(b)描述的是lowdelay模式下的针对后向预测模式的缩放操作,其结果是将当前块(cur_PU)的同位块(col_PU)的运动矢量(col_MV1)映射至当前块的后向参考帧(POC 4),从而得到时域运动矢量预测cur_MV1。(a) in FIG. 3 depicts the scaling operation for the forward prediction mode in the lowdelay mode, the result of which is to map the motion vector (col_MV0) of the co-located block (col_PU) of the current block (cur_PU) to the front of the current block To the reference frame (POC 4), the temporal motion vector prediction cur_MV0 is obtained. (b) in FIG. 3 depicts the scaling operation for the backward prediction mode in the lowdelay mode, the result of which is to map the motion vector (col_MV1) of the co-located block (col_PU) of the current block (cur_PU) to the backend of the current block To the reference frame (POC 4), the temporal motion vector prediction cur_MV1 is obtained.

random access模式下,当前帧的参考帧的帧号可以比当前帧的帧号大,也可以比当前帧的帧号小,即当前帧的参考帧可以在当前帧之后播放,也可以在当前帧之前播放。In random access mode, the frame number of the reference frame of the current frame can be larger than the frame number of the current frame or smaller than the frame number of the current frame, that is, the reference frame of the current frame can be played after the current frame, or can be played after the current frame. played before.

以图4为例,在random access模式下,当前帧为POC 27。当前帧的前向参考列表的第一帧为POC 26,后向参考列表的第一帧为POC 28。在图4的示例中,POC 26同时为当前帧的同位帧(col_pic)和前向参考帧(cur_ref0);POC 28为当前帧的后向参考帧(cur_ref1)。POC 26的前向参考列表为{POC24,POC 16},后向参考列表为{POC 28,POC 32}。POC 26的后向参考帧可以为POC 28,也可以为POC 32。在图4示例中,POC 32被选为POC 32的后向参考帧(col_ref1)。Taking Figure 4 as an example, in random access mode, the current frame is POC 27. The first frame of the forward reference list of the current frame is POC 26 and the first frame of the backward reference list is POC 28. In the example of FIG. 4, POC 26 is both the co-located frame (col_pic) and the forward reference frame (cur_ref0) of the current frame; POC 28 is the backward reference frame (cur_ref1) of the current frame. The forward reference list for POC 26 is {POC24, POC 16}, and the backward reference list is {POC 28, POC 32}. The backward reference frame of POC 26 may be POC 28 or POC 32. In the example of FIG. 4 , POC 32 is selected as the backward reference frame (col_ref1 ) of POC 32 .

图4中的(a)描述的是random access模式下的针对前向预测模式的缩放操作,其结果是将当前块(cur_PU)的同位块(col_PU)的运动矢量(col_MV1)映射至当前块的前向参考帧(cur_ref0),从而得到时域运动矢量预测cur_MV0。图4中的(b)描述的是randomaccess模式下的针对后向预测模式的缩放操作,其结果是将当前块(cur_PU)的同位块(col_PU)的运动矢量(col_MV1)映射至当前块的后向参考帧(cur_ref1),从而得到时域运动矢量预测cur_MV1。(a) in Figure 4 depicts the scaling operation for the forward prediction mode in random access mode, the result of which is to map the motion vector (col_MV1) of the co-located block (col_PU) of the current block (cur_PU) to the current block's The forward reference frame (cur_ref0) is used to obtain the temporal motion vector prediction cur_MV0. (b) in FIG. 4 depicts the scaling operation for backward prediction mode in randomaccess mode, the result of which is to map the motion vector (col_MV1) of the co-located block (col_PU) of the current block (cur_PU) to the backend of the current block To the reference frame (cur_ref1), the temporal motion vector prediction cur_MV1 is obtained.

为了改善帧间预测效果,在确定当前块的运动矢量的过程中,有些帧间预测模式会对当前块的运动矢量候选列表中的运动矢量进行一定程度的偏移。具有运动矢量差值的merge模式(merge mode with motion vector difference,MMVD)就是一种在传统merge模式基础上引入偏移方案的帧间预测技术,In order to improve the effect of inter-frame prediction, in the process of determining the motion vector of the current block, some inter-frame prediction modes will offset the motion vector in the motion vector candidate list of the current block to a certain extent. The merge mode with motion vector difference (MMVD) is an inter-frame prediction technology that introduces an offset scheme based on the traditional merge mode.

下面以MMVD为例,对运动矢量的偏移方案进行举例说明。The following takes MMVD as an example to illustrate the offset scheme of the motion vector.

MMVD技术也可称为终极运动矢量表达(ultimate motion vector expression,UMVE)技术。MMVD的实现过程主要包括如下两个步骤。The MMVD technique may also be referred to as the ultimate motion vector expression (UMVE) technique. The implementation process of MMVD mainly includes the following two steps.

第一步:从已经构建完成的merge候选列表中选取基础运动矢量(base MV)。通常来讲,会可以将merge候选列表中的前两个运动矢量预测选择为基础运动矢量。Step 1: Select the base motion vector (base MV) from the merge candidate list that has been constructed. Generally speaking, the first two motion vector predictions in the merge candidate list may be selected as base motion vectors.

第二步:根据一定规则对基础运动矢量进行偏移,产生新的运动矢量候选,并利用新的运动矢量进行预测。Step 2: Offset the basic motion vector according to certain rules, generate a new motion vector candidate, and use the new motion vector for prediction.

举例说明,假设基础运动矢量为(x,y),偏移后得到的新的运动矢量为(x’,y’),偏移操作使用的偏移值可以是预先配置的一组偏移值。例如,可以预先配置8个可选的偏移值(offset),每个偏移值的实现方式分为如下4种:For example, assuming that the base motion vector is (x, y), the new motion vector obtained after offset is (x', y'), and the offset value used in the offset operation can be a set of pre-configured offset values . For example, 8 optional offset values (offset) can be pre-configured, and the implementation of each offset value is divided into the following 4 types:

-x’=x+offset,y’=y;-x'=x+offset,y'=y;

-x’=x–offset,y’=y;-x'=x-offset,y'=y;

-x’=x,y’=y+offset;-x'=x,y'=y+offset;

-x’=x,y’=y–offset。-x'=x,y'=y-offset.

因此,两个基础运动矢量经偏移之后会得到2*4*8=64种可能的组合方式。当基础运动矢量采用双向预测模式时,则基础运动矢量在两个参考方向上的运动矢量均需要进行偏移。如果基础运动矢量的前向参考帧和后向参考帧为同一帧,则基础运动矢量在两个参考方向上可采用相同的偏移值进行偏移;如果基础运动矢量的前向参考帧和后向参考帧不同,则需要对基础运动矢量在某个参考方向上的运动矢量的偏移值进行缩放,并使用缩放后的偏移值对该基础运动矢量进行偏移。Therefore, after the two basic motion vectors are offset, 2*4*8=64 possible combinations are obtained. When the base motion vector adopts the bidirectional prediction mode, the motion vectors of the base motion vector in both reference directions need to be offset. If the forward reference frame and the backward reference frame of the base motion vector are the same frame, the base motion vector can be offset with the same offset value in the two reference directions; if the forward reference frame and the backward reference frame of the base motion vector Different from the reference frame, the offset value of the motion vector of the base motion vector in a certain reference direction needs to be scaled, and the scaled offset value is used to offset the base motion vector.

下面结合图5,对本申请实施例进行详细描述。应理解的是,图5的方法可以应用于编码端,也可以应用于解码端,本申请实施例对此并不限定。The embodiments of the present application will be described in detail below with reference to FIG. 5 . It should be understood that the method in FIG. 5 may be applied to the encoding end and may also be applied to the decoding end, which is not limited in this embodiment of the present application.

图5是本申请实施例提供的视频处理方法的示意性流程图。图5的方法包括步骤S510至步骤S550。FIG. 5 is a schematic flowchart of a video processing method provided by an embodiment of the present application. The method of FIG. 5 includes steps S510 to S550.

在步骤S510,从当前块的运动矢量候选列表中选取目标候选块的运动矢量。In step S510, the motion vector of the target candidate block is selected from the motion vector candidate list of the current block.

运动矢量候选列表可以包括多个候选块的运动矢量。以merge模式为例,步骤S510中提及的运动矢量候选列表可以为merge候选列表。merge候选列表的构建过程可以参见图1。The motion vector candidate list may include motion vectors of a plurality of candidate blocks. Taking the merge mode as an example, the motion vector candidate list mentioned in step S510 may be a merge candidate list. The construction process of the merge candidate list can be seen in Figure 1.

在某些实施例中,可以将目标候选块的运动矢量称为当前块的基础运动矢量(Base MV)。In some embodiments, the motion vector of the target candidate block may be referred to as the base motion vector (Base MV) of the current block.

本申请实施例中,当前块所在的当前帧可以为B帧。当前块的预测模式可以为双向预测模式。In this embodiment of the present application, the current frame where the current block is located may be a B frame. The prediction mode of the current block may be a bidirectional prediction mode.

在步骤S520,确定当前块的第一偏移值。In step S520, the first offset value of the current block is determined.

在步骤S530,当目标候选块和当前块位于不同帧,且目标候选块具有两个运动矢量时,确定当前块的第二偏移值。In step S530, when the target candidate block and the current block are located in different frames, and the target candidate block has two motion vectors, a second offset value of the current block is determined.

目标候选块可以是根据TMVP技术确定的候选块。换句话说,基于TMVP技术确定的候选块与当前块会位于不同帧中。The target candidate block may be a candidate block determined according to the TMVP technique. In other words, the candidate block determined based on the TMVP technique and the current block may be located in different frames.

目标候选块的两个运动矢量可以分别为前向预测和后向预测。或者,目标候选块的两个运动矢量均可以为单向预测。以视频的编码模式为随机访问模式为例,目标候选块的两个运动矢量可以为前向预测和后向预测。以视频的编码模式为低延时模式为例,目标候选块的两个运动矢量可以均是前向预测。The two motion vectors of the target candidate block may be forward prediction and backward prediction respectively. Alternatively, both motion vectors of the target candidate block may be unidirectional prediction. Taking the random access mode of the video as an example, the two motion vectors of the target candidate block may be forward prediction and backward prediction. Taking the encoding mode of the video as the low-latency mode as an example, the two motion vectors of the target candidate block may both be forward prediction.

目标候选块的两个运动矢量的参考帧可以相同,也可以不同。The reference frames of the two motion vectors of the target candidate block may be the same or different.

在步骤S540,根据第一偏移值对目标候选块的第一运动矢量进行偏移。In step S540, the first motion vector of the target candidate block is offset according to the first offset value.

第一偏移值可以包括一个或多个可选值。第一偏移值例如可以包括8个可选值。第一偏移值可以是预设的偏移值,也可以是对预设的偏移值经过其他操作之后得到的偏移值。这里的其他操作可以是缩放操作、取反操作等,本申请实施例对此不做具体限定。The first offset value may include one or more optional values. The first offset value may include, for example, 8 optional values. The first offset value may be a preset offset value, or may be an offset value obtained by performing other operations on the preset offset value. Other operations here may be scaling operations, inversion operations, and the like, which are not specifically limited in this embodiment of the present application.

作为一个示例,步骤S540可以包括:根据未经缩放的第一偏移值对目标候选块的第一运动矢量进行偏移。As an example, step S540 may include: offsetting the first motion vector of the target candidate block according to the unscaled first offset value.

需要说明的是,未经缩放的第一偏移值可以是预设的偏移值,也可以是对预设的偏移值经过除缩放操作之外的其他操作处理之后得到的偏移值,如对预设偏移值经过取反操作后得到的偏移值。需要说明的是,预设的偏移值可以包括多个可选值,这里的取反操作可以是对该多个可选值全部取反,也可以对该多个可选值中的部分可选值取反,本申请实施例对此并不限定。It should be noted that the unscaled first offset value may be a preset offset value, or may be an offset value obtained by processing the preset offset value through other operations except the scaling operation, For example, the offset value obtained by inverting the preset offset value. It should be noted that the preset offset value may include multiple optional values, and the inversion operation here may be the inversion of all the multiple optional values, or may be part of the multiple optional values. The selected value is reversed, which is not limited in this embodiment of the present application.

在步骤S550,根据第二偏移值对目标候选块的第二运动矢量进行偏移。In step S550, the second motion vector of the target candidate block is offset according to the second offset value.

本申请实施例识别特定候选块,并为特定候选块选取适配的偏移方案,可以优化帧间预测方式。The embodiment of the present application identifies a specific candidate block, and selects an adapted offset scheme for the specific candidate block, which can optimize the inter-frame prediction method.

第二偏移值可以包括一个或多个可选值。第二偏移值例如可以包括8个可选值。第二偏移值可以是预设的偏移值,也可以是对预设的偏移值经过其他操作之后得到的偏移值。这里的其他操作可以是缩放操作、取反操作等,本申请实施例对此不做具体限定。The second offset value may include one or more optional values. The second offset value may include, for example, 8 optional values. The second offset value may be a preset offset value, or may be an offset value obtained by performing other operations on the preset offset value. Other operations here may be scaling operations, inversion operations, and the like, which are not specifically limited in this embodiment of the present application.

需要说明的是,未经缩放的第二偏移值可以是预设的偏移值,也可以是对预设的偏移值经过除缩放操作之外的其他操作处理之后得到的偏移值,如对预设偏移值经过取反操作后得到的偏移值。需要说明的是,预设的偏移值可以包括多个可选值,这里的取反操作可以是对该多个可选值全部取反,也可以对该多个可选值中的部分可选值取反,本申请实施例对此并不限定。It should be noted that the unscaled second offset value may be a preset offset value, or may be an offset value obtained after processing the preset offset value through other operations except the scaling operation, For example, the offset value obtained by inverting the preset offset value. It should be noted that the preset offset value may include multiple optional values, and the inversion operation here may be the inversion of all the multiple optional values, or may be part of the multiple optional values. The selected value is reversed, which is not limited in this embodiment of the present application.

第一偏移值与第二偏移值可以是相互独立的偏移值。或者,第二偏移值可以是根据未经缩放的第一偏移值得到的偏移值。或者,第二偏移值可以是通过除对第一偏移值进行缩放的其他方式得到的。例如,第一偏移值可以是预设的偏移值,第二偏移值可以是在第一偏移值基础上部分或全部取反后得到的偏移值。The first offset value and the second offset value may be mutually independent offset values. Alternatively, the second offset value may be an offset value derived from the unscaled first offset value. Alternatively, the second offset value may be obtained by means other than scaling the first offset value. For example, the first offset value may be a preset offset value, and the second offset value may be an offset value obtained by inverting part or all of the first offset value.

第一偏移值和第二偏移值可以相同,也可以不同。例如,第一偏移值和第二偏移值均可以为预设的偏移值。又如,第一偏移值可以为预设的偏移值,第二偏移值可以为预设的偏移值的相反数。又如,第二偏移值可以为预设的偏移值,第一偏移值可以为预设的偏移值的相反数。又如,第一偏移值和第二偏移值中的部分偏移值相同,部分偏移值互为相反数。The first offset value and the second offset value may be the same or different. For example, both the first offset value and the second offset value may be preset offset values. For another example, the first offset value may be a preset offset value, and the second offset value may be an opposite number of the preset offset value. For another example, the second offset value may be a preset offset value, and the first offset value may be an opposite number of the preset offset value. For another example, some of the offset values in the first offset value and the second offset value are the same, and some of the offset values are opposite numbers to each other.

例如,目标候选块的两个运动矢量分别是前向预测和后向预测,则第一偏移值和第二偏移值可以相同。For example, if the two motion vectors of the target candidate block are forward prediction and backward prediction respectively, the first offset value and the second offset value may be the same.

又如,目标候选块的两个运动矢量是前向预测,则第一偏移值和第二偏移值可以互为相反数。For another example, if the two motion vectors of the target candidate block are forward prediction, the first offset value and the second offset value may be opposite numbers to each other.

以图6为例,假设当前帧的帧号为current POC,当前帧的前向参考帧的帧号为POC0,当前帧的后向参考帧的帧号为POC 1,如果(current POC–POC0)*(current POC–POC 1)>0,则说明当前帧的前向参考帧和后向参考帧的播放顺序均位于当前帧之前或之后。在这种情况下,在某些实施例中,可以将当前块的第一偏移值与第二偏移值设置为相同的偏移值。Taking Figure 6 as an example, it is assumed that the frame number of the current frame is current POC, the frame number of the forward reference frame of the current frame is POC0, and the frame number of the backward reference frame of the current frame is POC 1. If (current POC–POC0) *(current POC−POC 1)>0, it means that the playback order of the forward reference frame and the backward reference frame of the current frame are both located before or after the current frame. In this case, in some embodiments, the first offset value and the second offset value of the current block may be set to the same offset value.

从图2的描述可以看出,如果目标候选块与当前块位于不同帧,且目标候选块具有两个运动矢量,则将目标候选块的两个运动矢量添加至当前块的运动矢量候选列表时可能需要两次缩放操作。此外,如果目标候选块的运动矢量对应的两个参考帧不同,则在对目标候选块的运动矢量进行偏移时,可能还需要对偏移值进行一次缩放操作。由此可见,当目标候选块和当前块位于不同帧,目标候选块具有两个运动矢量,且目标候选块的两个运动矢量的参考帧不同时,可能会出现3次缩放操作。3次缩放操作会增加视频处理的复杂度,增大编解码系统的负担。It can be seen from the description of FIG. 2 that if the target candidate block and the current block are located in different frames, and the target candidate block has two motion vectors, when the two motion vectors of the target candidate block are added to the motion vector candidate list of the current block Two zoom operations may be required. In addition, if the two reference frames corresponding to the motion vector of the target candidate block are different, when offsetting the motion vector of the target candidate block, it may be necessary to perform a scaling operation on the offset value. It can be seen that when the target candidate block and the current block are located in different frames, the target candidate block has two motion vectors, and the reference frames of the two motion vectors of the target candidate block are different, three scaling operations may occur. Three scaling operations will increase the complexity of video processing and increase the burden on the codec system.

为了避免3次缩放操作带来的上述问题,当目标候选块和当前块位于不同帧,目标候选块具有两个运动矢量,且目标候选块的两个运动矢量的参考帧不同时,可以将第一偏移值和第二偏移值均可设置为未经缩放的偏移值。换句话说,当目标候选块和当前块位于不同帧,目标候选块具有两个运动矢量,且目标候选块的两个运动矢量的参考帧不同时,可以舍弃对偏移值的缩放操作,直接利用未经缩放的偏移值对目标候选块的运动矢量进行偏移,从而简化了视频处理过程,降低了视频处理的复杂度。In order to avoid the above problems caused by three scaling operations, when the target candidate block and the current block are located in different frames, the target candidate block has two motion vectors, and the reference frames of the two motion vectors of the target candidate block are different, the Both the first offset value and the second offset value can be set as unscaled offset values. In other words, when the target candidate block and the current block are located in different frames, the target candidate block has two motion vectors, and the reference frames of the two motion vectors of the target candidate block are different, the scaling operation on the offset value can be discarded, and the The motion vector of the target candidate block is offset by using the unscaled offset value, thereby simplifying the video processing process and reducing the complexity of the video processing.

可选地,在一些实施例中,图5的方法还可以包括:根据偏移后的第一运动矢量和第二运动矢量,确定当前块的运动矢量。当前块的运动矢量有时也可以称为当前块的最优运动矢量。当前块的运动矢量可以根据率失真代价等算法计算,本申请实施例对此并不限定。Optionally, in some embodiments, the method of FIG. 5 may further include: determining the motion vector of the current block according to the shifted first motion vector and the second motion vector. The motion vector of the current block may also sometimes be referred to as the optimal motion vector of the current block. The motion vector of the current block may be calculated according to an algorithm such as rate-distortion cost, which is not limited in this embodiment of the present application.

上文是以目标候选块和当前块位于不同帧为例进行举例说明的,当目标候选块和当前块位于相同帧时,图5的方法还可包括:根据所述第一偏移值对第二偏移值进行缩放,并利用缩放后的第二偏移值对目标候选块的第二运动矢量进行偏移。The above is exemplified by taking the target candidate block and the current block located in different frames as an example, when the target candidate block and the current block are located in the same frame, the method in FIG. The second offset value is scaled, and the second motion vector of the target candidate block is offset by using the scaled second offset value.

下面以目标运动矢量为空域MVP为例进行说明。如图7所示,当前块(cur_PU)的基础运动矢量的前向参考帧为cur ref pic 0,后向参考帧为cur ref pic 1,基础运动矢量相对前向参考帧的运动矢量为MV0,相对后向参考帧的运动矢量为MV1。当cur ref pic 0与cur ref pic 1不为同一帧时,则两个参考帧相对当前帧的距离就可能存在差异,此时,如果使用相同的偏移值对MV0和MV1进行偏移(偏移值在图7中用offset 0和offset 1表示),是不合理的。例如,假设偏移值为128,如果在两个参考方向上均使用128的偏移值进行偏移,将会使与当前帧距离较近的参考帧所对应的MV的变动过大,不符合自然视频中的物体的运动规律,因此,需要对该MV的偏移值进行缩放。The following description will be given by taking the target motion vector as the spatial domain MVP as an example. As shown in FIG. 7 , the forward reference frame of the base motion vector of the current block (cur_PU) is cur ref pic 0, the backward reference frame is cur ref pic 1, and the motion vector of the base motion vector relative to the forward reference frame is MV0, The motion vector relative to the backward reference frame is MV1. When cur ref pic 0 and cur ref pic 1 are not the same frame, the distance between the two reference frames relative to the current frame may be different. At this time, if the same offset value is used to offset MV0 and MV1 (offset The shift values are represented by offset 0 and offset 1 in Figure 7), which is unreasonable. For example, assuming that the offset value is 128, if the offset value of 128 is used for offset in both reference directions, the MV corresponding to the reference frame that is closer to the current frame will change too much, which is inconsistent with the current frame. The motion law of objects in natural videos, therefore, the offset value of the MV needs to be scaled.

上文结合图1至图7,详细描述了本申请实施例的视频处理方法,下文结合图8,详细描述本申请实施例的视频处理装置。应理解,方法实施例与装置实施例之间的描述相互对应,因此,装置实施例部分未详细描述的内容可以参见前文中的方法实施例部分的对应内容。The video processing method of the embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 7 , and the video processing apparatus of the embodiment of the present application is described in detail below with reference to FIG. 8 . It should be understood that the descriptions between the method embodiments and the apparatus embodiments correspond to each other. Therefore, for the content not described in detail in the apparatus embodiment part, reference may be made to the corresponding content in the method embodiment part above.

图8是本申请实施例提供的视频处理装置的示意性结构图。图8的视频处理装置800可以是编码器也可以是解码器。该视频处理装置800可以包括存储器810和处理器820。FIG. 8 is a schematic structural diagram of a video processing apparatus provided by an embodiment of the present application. The video processing apparatus 800 of FIG. 8 may be an encoder or a decoder. The video processing apparatus 800 may include a memory 810 and a processor 820 .

存储器810可用于存储代码。Memory 810 may be used to store code.

处理器820可用于读取存储器中的代码,以执行如下操作:从当前块的运动矢量候选列表中选取目标候选块的运动矢量,所述运动矢量候选列表包括多个候选块的运动矢量;确定所述当前块的第一偏移值;当所述目标候选块和当前块位于不同帧,且所述目标候选块具有两个运动矢量时,确定所述当前块的第二偏移值;根据所述第一偏移值对所述目标候选块的第一运动矢量进行偏移;根据所述第二偏移值对所述目标候选块的第二运动矢量进行偏移。The processor 820 is operable to read code in the memory to perform the following operations: select a motion vector of the target candidate block from a motion vector candidate list of the current block, the motion vector candidate list including motion vectors of a plurality of candidate blocks; determine the first offset value of the current block; when the target candidate block and the current block are located in different frames, and the target candidate block has two motion vectors, determine the second offset value of the current block; according to The first offset value offsets the first motion vector of the target candidate block; the second motion vector of the target candidate block is offset according to the second offset value.

可选地,所述第二偏移值是根据未经缩放的所述第一偏移值得到的。Optionally, the second offset value is obtained according to the unscaled first offset value.

可选地,所述第一偏移值和所述第二偏移值相同。Optionally, the first offset value and the second offset value are the same.

可选地,所述处理器820还可用于执行以下操作:当所述目标候选块和当前块位于相同帧时,对所述第二偏移值进行缩放,利用缩放后的所述第二偏移值对所述目标候选块的第二运动矢量进行偏移。Optionally, the processor 820 may be further configured to perform the following operations: when the target candidate block and the current block are located in the same frame, scaling the second offset value, and using the scaled second offset value The offset value offsets the second motion vector of the target candidate block.

可选地,所述目标候选块是根据TMVP技术确定的。Optionally, the target candidate block is determined according to the TMVP technology.

可选地,所述目标候选块的两个运动矢量分别是前向预测和后向预测。Optionally, the two motion vectors of the target candidate block are forward prediction and backward prediction respectively.

可选地,所述第一偏移值和所述第二偏移值互为相反数。Optionally, the first offset value and the second offset value are opposite numbers to each other.

可选地,所述视频的编码模式为随机访问模式。Optionally, the encoding mode of the video is a random access mode.

可选地,所述目标候选块的两个运动矢量是前向预测。Optionally, the two motion vectors of the target candidate block are forward prediction.

可选地,所述第一偏移值和所述第二偏移值相同。Optionally, the first offset value and the second offset value are the same.

可选地,所述视频的编码模式为低延时模式。Optionally, the encoding mode of the video is a low-latency mode.

可选地,所述运动矢量候选列表为merge候选列表。Optionally, the motion vector candidate list is a merge candidate list.

可选地,所述目标候选块的运动矢量为所述当前块的基础运动矢量。Optionally, the motion vector of the target candidate block is the basic motion vector of the current block.

可选地,所述第一偏移值和/或所述第二偏移值包括多个可选值。Optionally, the first offset value and/or the second offset value includes a plurality of optional values.

可选地,所述处理器820还可用于执行以下操作:根据偏移后的第一运动矢量和第二运动矢量,确定当前块的运动矢量。Optionally, the processor 820 is further configured to perform the following operation: determine the motion vector of the current block according to the shifted first motion vector and the second motion vector.

可选地,所述第二偏移值是通过除对所述第一偏移值进行缩放的其他方式得到的。Optionally, the second offset value is obtained by other methods other than scaling the first offset value.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其他任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如数字视频光盘(digital video disc,DVD))、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disk, hard disk, magnetic tape), optical media (eg, digital video disc (DVD)), or semiconductor media (eg, solid state disk (SSD)), etc. .

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.

在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (32)

1. A video processing method, comprising:
selecting a motion vector of a target candidate block from a motion vector candidate list of a current block, wherein the motion vector candidate list comprises motion vectors of a plurality of candidate blocks;
determining a first offset value for the current block;
determining a second offset value for the current block when the target candidate block and the current block are located in different frames and the target candidate block has two motion vectors;
offsetting a first motion vector of the target candidate block according to the first offset value;
and offsetting a second motion vector of the target candidate block according to the second offset value.
2. The method of claim 1, wherein the second offset value is derived from the first offset value without scaling.
3. The method of claim 1, wherein the first offset value and the second offset value are the same.
4. The method of claim 1, further comprising:
and when the target candidate block and the current block are positioned in the same frame, scaling the second offset value, and offsetting a second motion vector of the target candidate block by using the scaled second offset value.
5. The method of claim 1, wherein the target candidate block is determined according to a Temporal Motion Vector Prediction (TMVP) technique.
6. The method of claim 1, wherein the two motion vectors of the target candidate block are forward prediction and backward prediction, respectively.
7. The method of claim 6, wherein the first offset value and the second offset value are opposite numbers of each other.
8. The method of claim 6, wherein the encoding mode of the video is a random access mode.
9. The method of claim 1, wherein the two motion vectors of the target candidate block are forward predicted.
10. The method of claim 9, wherein the first offset value and the second offset value are the same.
11. The method of claim 9, wherein the encoding mode of the video is a low latency mode.
12. The method of claim 1, wherein the motion vector candidate list is a merge candidate list.
13. The method of claim 1, wherein the motion vector of the target candidate block is a base motion vector of the current block.
14. The method of claim 1, wherein the first offset value and/or the second offset value comprises a plurality of selectable values.
15. The method of claim 1, further comprising:
and determining the motion vector of the current block according to the first motion vector and the second motion vector after the offset.
16. The method of claim 1, wherein the second offset value is derived by dividing by scaling the first offset value.
17. A video processing apparatus, comprising:
a memory for storing code;
a processor to read code in the memory to perform the following operations:
selecting a motion vector of a target candidate block from a motion vector candidate list of a current block, wherein the motion vector candidate list comprises motion vectors of a plurality of candidate blocks;
determining a first offset value for the current block;
determining a second offset value for the current block when the target candidate block and the current block are located in different frames and the target candidate block has two motion vectors;
offsetting a first motion vector of the target candidate block according to the first offset value;
and offsetting a second motion vector of the target candidate block according to the second offset value.
18. The apparatus of claim 17, wherein the second offset value is derived from the first offset value without scaling.
19. The apparatus of claim 17, wherein the first offset value and the second offset value are the same.
20. The apparatus of claim 17, wherein the processor is further configured to:
and when the target candidate block and the current block are positioned in the same frame, scaling the second offset value, and offsetting a second motion vector of the target candidate block by using the scaled second offset value.
21. The apparatus of claim 17, wherein the target candidate block is determined according to a Temporal Motion Vector Prediction (TMVP) technique.
22. The apparatus of claim 17, wherein the two motion vectors of the target candidate block are forward prediction and backward prediction, respectively.
23. The apparatus of claim 22, wherein the first offset value and the second offset value are opposite numbers of each other.
24. The apparatus of claim 22, wherein the encoding mode of the video is a random access mode.
25. The apparatus of claim 17 wherein the two motion vectors of the target candidate block are forward predicted.
26. The apparatus of claim 25, wherein the first offset value and the second offset value are the same.
27. The apparatus of claim 25, wherein the coding mode of the video is a low latency mode.
28. The apparatus of claim 17, wherein the motion vector candidate list is a merge candidate list.
29. The apparatus of claim 17, wherein the motion vector of the target candidate block is a base motion vector of the current block.
30. The apparatus of claim 17, wherein the first offset value and/or the second offset value comprises a plurality of selectable values.
31. The apparatus of claim 17, wherein the processor is further configured to:
and determining the motion vector of the current block according to the first motion vector and the second motion vector after the offset.
32. The apparatus of claim 17, wherein the second offset value is derived by dividing by scaling the first offset value.
CN201980009149.7A 2019-06-25 2019-06-25 Video processing method and device Active CN111684799B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/092751 WO2020258024A1 (en) 2019-06-25 2019-06-25 Video processing method and device

Publications (2)

Publication Number Publication Date
CN111684799A true CN111684799A (en) 2020-09-18
CN111684799B CN111684799B (en) 2023-07-25

Family

ID=72451465

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980009149.7A Active CN111684799B (en) 2019-06-25 2019-06-25 Video processing method and device

Country Status (2)

Country Link
CN (1) CN111684799B (en)
WO (1) WO2020258024A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565753A (en) * 2020-12-06 2021-03-26 浙江大华技术股份有限公司 Method and apparatus for determining motion vector difference, storage medium, and electronic apparatus
CN115086678A (en) * 2022-08-22 2022-09-20 北京达佳互联信息技术有限公司 Video encoding method and device, and video decoding method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013069932A1 (en) * 2011-11-08 2013-05-16 주식회사 케이티 Method and apparatus for encoding image, and method and apparatus for decoding image
MX358773B (en) * 2012-07-02 2018-09-04 Samsung Electronics Co Ltd Method and apparatus for predicting motion vector for coding video or decoding video.
WO2019009618A1 (en) * 2017-07-04 2019-01-10 삼성전자 주식회사 Image encoding method and apparatus, and image decoding method and apparatus

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JINGYA LI,RU-LING LIAO,CHONG SOON LIM: "Non-CE4: MMVD scaling simplification", 《JVET OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11》 *
SEUNGSOO JEONG,MIN WOO PARK,CHANYUL KIM: "CE4 Ultimate motion vector expression in J0024", 《JVET OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11》 *
XU CHEN,JIANHUA ZHENG: "Non-CE4: MMVD simplification", 《JVET OF ITU-T SG 16 WP 3 AND ISO/IEC JTC 1/SC 29/WG 11》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565753A (en) * 2020-12-06 2021-03-26 浙江大华技术股份有限公司 Method and apparatus for determining motion vector difference, storage medium, and electronic apparatus
CN112565753B (en) * 2020-12-06 2022-08-16 浙江大华技术股份有限公司 Method and apparatus for determining motion vector difference, storage medium, and electronic apparatus
CN115086678A (en) * 2022-08-22 2022-09-20 北京达佳互联信息技术有限公司 Video encoding method and device, and video decoding method and device

Also Published As

Publication number Publication date
CN111684799B (en) 2023-07-25
WO2020258024A1 (en) 2020-12-30

Similar Documents

Publication Publication Date Title
CN113507612B (en) Video processing method and device
JP7596457B2 (en) METHOD AND APPARATUS FOR VIDEO DECODING BY INTER PREDICTION IN VIDEO CODING SYSTEM
US20220286689A1 (en) Video encoding/decoding method and apparatus using motion information candidate, and method for transmitting bitstream
CN112866720B (en) Motion vector prediction method and device and coder-decoder
CN111418212B (en) Image decoding method and device based on affine motion prediction in image coding system
US12184835B2 (en) Video encoding/decoding method and device for deriving weight index for bidirectional prediction of merge candidate, and method for transmitting bitstream
US20220368891A1 (en) Image encoding/decoding method and apparatus, and method of transmitting bitstream using sequence parameter set including information on maximum number of merge candidates
CN114208171A (en) Image decoding method and apparatus for deriving weight index information for generating predicted samples
CN114631318B (en) Image decoding method and device for deriving weight index information for weighted averaging when applying bidirectional prediction
CN111684799A (en) Video processing method and device
CN114375573B (en) Image decoding method and device using merged candidate derived prediction samples
JP6032367B2 (en) Moving picture coding apparatus, moving picture coding method, moving picture decoding apparatus, and moving picture decoding method
US12047582B2 (en) Image encoding/decoding method and device using symmetric motion vector difference (SMVD), and method for transmitting bitstream
US20230353749A1 (en) Method and apparatus for encoding/decoding image on basis of picture header including information relating to co-located picture, and method for transmitting bitstream
US11949874B2 (en) Image encoding/decoding method and device for performing prof, and method for transmitting bitstream
US20240357130A1 (en) Image decoding method and device therefor
CN113678455A (en) Video or image coding for deriving weight index information for bi-prediction
US20220191535A1 (en) Image encoding/decoding method and apparatus for performing bi-directional prediction, and method for transmitting bitstream
CN112136328B (en) Method and apparatus for inter prediction in video processing system
KR20240113906A (en) Picture encoding and decoding method and device

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