WO2018166535A1 - 一种基于编码时间预测模型的负载均衡方法 - Google Patents
一种基于编码时间预测模型的负载均衡方法 Download PDFInfo
- Publication number
- WO2018166535A1 WO2018166535A1 PCT/CN2018/079378 CN2018079378W WO2018166535A1 WO 2018166535 A1 WO2018166535 A1 WO 2018166535A1 CN 2018079378 W CN2018079378 W CN 2018079378W WO 2018166535 A1 WO2018166535 A1 WO 2018166535A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- frame
- load
- encoding
- time
- adjacent
- 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.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/134—Methods 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/156—Availability of hardware or computational resources, e.g. encoding based on power-saving criteria
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/593—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
Definitions
- the invention belongs to the field of multimedia coding, and in particular relates to a load balancing method based on an encoding time prediction model.
- HEVC High Efficiency Video Coding
- the coding efficiency of video is further improved.
- HEVC can save nearly half the code rate with the same coding quality, however at the expense of coding complexity. How to minimize the complexity of the algorithm and significantly improve the coding speed without changing the code stream structure and maintaining the original code rate is the key to the large-scale promotion and application of HEVC.
- Serial optimization is mainly for the optimization of the encoding process. It is mainly divided into two categories. One is to reduce the computational complexity by the fast division of coding units and the fast selection of coding modes. The latter is to reduce the time of motion estimation by reducing the time. Computational complexity. The effect of these two types of optimization is obvious, and the optimization of these coding processes can reduce the computational complexity of HEVC by nearly half. However, with the advancement of society, people have higher requirements for the clarity of video. Simply reducing the computational complexity by half still does not meet the demand for ultra-high definition video. So there has been research on parallel optimization.
- Parallel optimization is also divided into many classes, from small to large, including image group level parallelism, frame level parallelism, stripe or tile level parallelism, and coding tree unit level parallelism.
- Parallelism between image group level and frame level is complicated because it needs to buffer a large amount of video data, and it is not suitable for real-time application.
- Parallel coding at the unit level of coding tree is strong due to strong correlation between adjacent coding tree units.
- the limitation of parallelism is not high. Strips and tiles are collections of coding tree elements in a frame, without delays and constraints, and the correlation is not limited. But the division of strips is more flexible than tiles and has better parallel performance. Therefore, this patent is primarily directed to the parallelism of stripe levels.
- the coding complexity uses only the information of adjacent coded frames, ignoring the hierarchical time coding structure.
- the normalized computational complexity established by the second scheme is predicted due to the dissimilarity of texture and motion characteristics of the image. The accuracy is poor and cannot be adapted to all video sequences. Therefore, we need to find a way to simultaneously use the hierarchical time coding structure and adjacent coded frames to better predict the computational complexity of each coding tree unit in the current frame.
- the present invention proposes a load balancing method based on the encoding time prediction model, which is reasonable in design, overcomes the deficiencies of the prior art, and has good effects.
- a load balancing method based on an encoding time prediction model includes the following steps:
- Step 1 Enter a video stream
- Step 2 averaging the number of coding tree units that each stripe in the current frame has;
- Step 3 Determine whether the current frame is an intra-coded frame
- step 10 is performed;
- step 4 is performed;
- Step 4 Determine whether the current frame has an encoded non-intra coded frame of the same time layer
- step 5 If the result of the determination is that the current frame has the same time layer of the encoded non-intra-coded frame, then step 5;
- Step 5 Synchronize the encoding time of the positionally adjacent encoded frame to the same level as the adjacent encoded frame of the same time layer by encoding the temporal prediction model;
- Step 6 jointly predict the encoding time of the current frame by the encoding time of the two frames after synchronization, and then perform step 8;
- Step 7 predict the encoding time of the current frame according to the encoding time of the adjacent coded frame of the location;
- Step 8 allocate the number of coding tree units owned by each stripe based on the predicted encoding time of the current frame
- Step 9 Fine-tune according to the distribution result of the strips, so that each strip obtains the same calculation load
- Step 10 Parallel encoding each strip of the current frame in parallel, ending one frame.
- step 5 the method specifically includes the following steps:
- Step 5.1 align the adjacent coded frames in the position based on their adjustments in the position of the image group, so that they are synchronized to the same image group position level as the adjacent coded frames of the same time layer;
- Step 5.2 The coding time of the adjacent coded frame in the position is adjusted based on the size of the quantization parameter to be synchronized to the same quantization parameter level as the adjacent coded frame of the same time layer;
- Step 5.3 The encoding time of the adjacent encoded frame in the position is adjusted based on the number of reference frames to be synchronized to the same reference frame level as the adjacent encoded frame of the same time layer.
- step 8 the following steps are specifically included:
- Step 8.1 Calculate the total predicted encoding time of the current frame
- Step 8.2 allocate the number of stripes according to the number of CPU cores of each device
- Step 8.3 Determine the average load of each strip by the results of steps 8.1 and 8.2;
- Step 8.4 Allocate a certain number of coding tree units for each strip according to the average load in step 8.3.
- step 9 the method specifically includes the following steps: Step 9.1: Entering a frame of video stream;
- Step 9.2 predicting the total coding time of the current frame and the coding time of each coding tree unit
- Step 9.3 Calculate the average load of each stripe and divide the number of coding tree units of each stripe;
- Step 9.4 Calculate the load of each divided strip and sort it.
- Step 9.5 Record the maximum computational load and assign it to a variable a;
- Step 9.6 determining whether the load value of a is greater than the calculation load before or after;
- step 9.7 is performed;
- step 9.11 the load value of a is less than the calculation load before or after, then step 9.11 is performed;
- Step 9.7 Decrement the number of coding tree units of a by one, and increase the number of coding tree units of the smaller bands by one;
- Step 9.8 Calculate the maximum load after the change
- Step 9.9 determining whether the maximum calculated load after the change is smaller than the previous maximum load
- step 9.10 is performed
- step 9.11 is performed
- Step 9.10 Reorder the computational load of each strip, and then perform step 9.5;
- Step 9.11 Determine whether a is the minimum load
- step 9.12 is performed
- Step 9.12 assign a to the next smallest computational load, and then perform step 9.6;
- the encoding time prediction model in step 5 is:
- T pred is the final prediction time
- T pos is the encoding time of the position adjacent frame
- qp pos is the quantization parameter of the position adjacent frame
- ref pos is the number of reference frames of the adjacent frame
- a is the position adjacent The weight of the frame
- T temp is the encoding time of the adjacent frame of the time layer
- qp temp is the quantization parameter of the adjacent frame of the time layer
- ref temp is the number of reference frames of the adjacent frame of the time layer
- b is the weight of the adjacent frame of the time layer
- ⁇ is the variation factor we calculated from the statistical data
- ⁇ is the ratio calculated based on the position of the encoded frame in the image group.
- the invention has the beneficial technical effects: the invention starts from the coding configuration, and by studying the influence degree of the three coding configuration parameters on the coding time, three adjustment schemes based on the coding parameters are proposed and integrated into one coding. Time prediction model.
- the present invention combines adjacent coded frames in position with adjacent coded frames on the same time layer, and uses the two coded frames to jointly predict the coding time of the current frame, and establishes A load balancing method based on coding time prediction model, the method can adapt to real-time compression application of high-definition and ultra-high-definition video under the premise of ensuring coding quality, and greatly improves the coding speed.
- FIG. 1 is a flow chart of a load balancing method of a stripe parallel HEVC encoder based on an encoding time prediction model.
- FIG. 2 is a flow chart of a coding time prediction method based on coding parameters.
- FIG. 3 is a specific flowchart of a load balancing method.
- the present invention proposes a load balancing method for a stripe parallel HEVC encoder based on a coding prediction model.
- the method mainly comprises two parts: a coding time adjustment method based on coding parameters and a load balancing method based on an encoding time prediction model, and the coding time adjustment method based on the coding parameters relates to steps (5) and (6) in the invention, based on
- the load balancing method of the coding time prediction model relates to step (8) and step (9) in the Summary of the Invention.
- the main flow of the invention is as shown in FIG. 1. First, it is determined whether the current video stream is an intra-coded frame, and whether there are adjacent coded frames of the same time layer, and when the frame is not the intra-frame coded frame and has the same time layer
- the adjacent coded frames in the position are respectively based on the configuration parameters of the adjacent coded frames of the same time layer (referred to as temporal layer adjacent frames).
- the number of coding tree units is fine-tuned based on this, so that each strip gets the same computational load to achieve strip-parallel load balancing.
- a fixed coding configuration template appears in the new generation video coding standard HEVC, which mainly includes three types: full intraframe coded frame configuration (AI), low latency configuration (LP), and random access configuration (RA).
- AI full intraframe coded frame configuration
- LP low latency configuration
- RA random access configuration
- T GOPsize is the encoding time of the last frame in the image group
- T Other is the encoding time of other frames in the image group.
- test sequences were selected as the training set in the HEVC test sequence, namely ParkScene and Cactus in the B test sequence, BQMall and PartyScene in the C test sequence, and BasketballPass and RaceHorses in the D-class test sequence. Recording the above by changing the size of the quantization parameter (range 20-48, which is the range of quantization parameters commonly used in video coding) under the condition that the number of reference frames is 1, the image group size is 4, and the remaining configuration parameters are the default configuration.
- the coding time of the six test sequences Each case was tested 3 times, and finally the average was taken as the encoding time for each frame.
- the experimental data shows that there is a law represented by the following formula (2) between the encoding time and the quantization parameter size.
- I the encoding time that needs to be predicted
- It is the time that is known and will be used for prediction
- QP pred is the quantization parameter of the frame to be predicted
- QP reference is the quantization parameter of the frame used for prediction.
- Motion estimation is the most time-consuming operation in HEVC interframe prediction.
- the corresponding motion estimation of one frame is also required.
- the statistical data indicates that the relationship between the encoding time and the number of reference frames can be described by the following equation (3).
- i is the number of reference frames
- T pred is the final prediction time
- T pos is the encoding time of the adjacent frame of the position
- the quantization parameter is qp pos
- the reference frame number is ref pos
- the weight is a
- T temp is the encoding of the temporal layer adjacent frame Time
- the quantization parameter is qp temp
- the number of reference frames is ref temp
- the weight is b
- ⁇ is the change factor in 3
- ⁇ is the ratio in 1).
- the flow of the encoding time adjustment method based on the encoding parameters is as shown in FIG. 2.
- the process of adjustment is described as follows:
- Load balancing is an ideal state in which we can achieve the highest acceleration ratio.
- the computational complexity distribution of one frame of image is not uniform. Therefore, when we evenly distribute the number of coding units for each strip, load imbalance occurs.
- Load imbalance is a very important factor in reducing the performance of parallel processor systems.
- the present invention utilizes the previous encoding parameter based encoding time prediction method to obtain the prediction encoding time of each coding unit in the current frame, and then uses the information to implement strip level horizontal parallel load balancing.
- the process of load distribution and adjustment is shown in Figure 3.
- the specific implementation is as follows:
- the total encoding time of the current frame and the encoding time of each coding unit are obtained according to the above-described encoding time prediction method.
- the number of coding units that each stripe should have is determined based on the average load of each stripe and the predicted prediction encoding time of each coding unit.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computing Systems (AREA)
- Theoretical Computer Science (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明公开了一种基于编码时间预测模型的负载均衡方法,属于多媒体编码领域,该方法在对视频流进行并行编码之前,首先根据编码时间预测模型预测当前视频帧每一个编码单元的编码时间,然后以当前帧每一个编码单元的预测编码时间为依据进行负载的均衡操作;负载均衡主要是对于负载的分配,首先根据当前设备的配置自动确定每一个核心的平均负载,然后根据预测的编码时间来为每一个核心分配一定的编码单元数目;最后通过负载的调整策略实现 HEVC 并行编码器的负载均衡。本发明提出的基于编码时间预测模型的 HEVC 并行编码器的负载均衡方法能够在保证编码质量的前提下,显著提高编码速度。
Description
本发明属于多媒体编码领域,具体涉及一种基于编码时间预测模型的负载均衡方法。
随着新一代视频编码标准HEVC(High Efficiency Video Coding)的发布,视频的编码效率进一步提升。相比于以前的视频编码标准H.264/AVC,在相同编码质量的情况下,HEVC可以节省近一半的码率,然而这是以牺牲编码复杂度为代价的。如何在不改变码流结构和保持原有码率的前提下,最大程度的降低算法复杂度,显著提高编码速度,是HEVC大规模推广与应用的关键所在。
为了降低HEVC的计算复杂度,并将其应用于实时应用,很多学者都致力于这个方向。降低计算复杂度的优化方法主要分为两种:串行优化和并行优化。
串行优化主要是针对于编码流程的优化,主要分为两类,一类是通过编码单元的快速划分和编码模式的快速选择来降低计算复杂度,一类是通过减少运动估计的时间来降低计算复杂度。这两类优化的效果是明显的,通过这些编码流程的优化,大约可以降低HEVC接近一半的计算复杂度。但是,随着社会的进步,人们对于视频的清晰度有了更高的要求。仅仅降低一半的计算复杂度依然满足不了人们对于超高清视频的需求。于是就出现了关于并行优化的研究。
并行优化也分为很多类,从小到大主要包括图像组级的并行、帧级的并行、条带或tile级的并行,以及编码树单元级的并行。图像组级和帧级的并行由于需要缓存大量的视频数据,时延大,不适应于实时应用;编码树单元级的并行由于相邻编码树单元间的相关性较强,并行编码存在很大的限制,并行效率不高。条带和tile都是一帧中的编码树单元的集合,没有时延和制约,且相关性限制不大。但是条带的划分较tile更加的灵活,且具有更好的并行性能。因此,本专利主要是针对条带级别的并行。
目前有关条带并行优化的方法主要有两种,一种是根据相邻已编码帧的编码时间来预测当前帧的编码时间,一种是建立一种归一化的计算复杂度来确定当前帧的编码复杂度。第一种方案仅仅使用了相邻已编码帧的信息,而忽略了分层时间编码结构,第二种方案建立的归一化的计算复杂度则由于图像的纹理特性和运动特性不相似而预测精度较差,不能适应于所有的视频序列。因此我们亟需找到一种能够同时使用分层时间编码结构和相邻已编码帧的方法,来更好的预测当前帧中每一个编码树单元的计算复杂度。
发明内容
为了找到一种更加有效的条带级并行的负载均衡方法,本发明提出了一种基于编码时间 预测模型的负载均衡方法,设计合理,克服了现有技术的不足,具有良好的效果。
为了实现上述目的,本发明采用如下技术方案:
一种基于编码时间预测模型的负载均衡方法,包括如下步骤:
步骤1:进入一帧视频流;
步骤2:平均划分当前帧中每一个条带所具有的的编码树单元数目;
步骤3:判断当前帧是否是帧内编码帧;
若:判断结果是当前帧是帧内编码帧,则执行步骤10;
或判断结果是当前帧不是帧内编码帧,则执行步骤4;
步骤4:判断当前帧是否有同一时间层的已编码非帧内编码帧;
若:判断结果是当前帧有同一时间层的已编码非帧内编码帧,则执行步骤5;
或判断结果是当前帧没有同一时间层的已编码非帧内编码帧,则执行步骤7;
步骤5:通过编码时间预测模型将位置相邻已编码帧的编码时间同步到与同一时间层的相邻已编码帧相同的水平上;
步骤6:通过同步后的两个帧的编码时间共同预测当前帧的编码时间,然后执行步骤8;
步骤7:根据位置相邻已编码帧的编码时间来预测当前帧的编码时间;
步骤8:以当前帧的预测编码时间为基准来分配每一个条带所拥有的编码树单元数目;
步骤9:根据条带的分配结果进行微调,使每一个条带获得相同的计算负载;
步骤10:并行编码当前帧的每一个条带,结束一帧。
优选地,在步骤5中,具体包括如下步骤:
步骤5.1:将位置上的相邻已编码帧做基于其在图像组中位置的调整,使其同步到与同一时间层的相邻已编码帧相同的图像组位置水平上;
步骤5.2:将位置上的相邻已编码帧的编码时间做基于量化参数大小的调整,使其同步到与同一时间层的相邻已编码帧相同的量化参数水平上;
步骤5.3:将位置上的相邻已编码帧的编码时间做基于参考帧数目的调整,使其同步到与同一时间层的相邻已编码帧相同的参考帧水平上。
优选地,在步骤8中,具体包括如下步骤:
步骤8.1:计算当前帧的总预测编码时间;
步骤8.2:根据每一个设备的CPU核心数分配条带的数目;
步骤8.3:通过步骤8.1和步骤8.2的结果确定每一个条带的平均负载;
步骤8.4:根据步骤8.3中的平均负载为每一个条带分配一定数目的编码树单元。
优选地,在步骤9中,具体包括如下步骤:步骤9.1:进入一帧视频流;
步骤9.2:预测当前帧的总编码时间和各个编码树单元的编码时间;
步骤9.3:计算每一个条带的平均负载并划分每一个条带的编码树单元数目;
步骤9.4:计算划分后的各个条带的负载并排序,
步骤9.5:记录最大计算负载,并将其赋值给一个变量a;
步骤9.6:判断a的负载值是否大于其前或后的计算负载;
若:判断结果是a的负载值大于其前或后的计算负载,则执行步骤9.7;
或判断结果是a的负载值小于其前或后的计算负载,则执行步骤9.11;
步骤9.7:将a的编码树单元数目减一,比其小的条带的编码树单元数目加一;
步骤9.8:计算变化后的最大负载;
步骤9.9:判断变化后的最大计算负载是否小于之前的最大负载;
若:判断结果为变化后的最大计算负载小于之前的最大负载,则执行步骤9.10;
或判断结果为变化后的最大计算负载大于之前的最大负载,则执行步骤9.11;
步骤9.10:重新排序各条带的计算负载,然后执行步骤9.5;
步骤9.11:判断a是否是最小负载;
若:判断结果是a是最小负载,则结束;
或判断结果是a不是最小负载,则执行步骤9.12;
步骤9.12:将a赋值为次小的计算负载,然后执行步骤9.6;
优选地,步骤5中编码时间预测模型为:
式中,T
pred是最终的预测时间,T
pos是位置相邻帧的编码时间,qp
pos是位置相邻帧的量化参数,ref
pos是位置相邻帧的参考帧数目,a是位置相邻帧的权重;T
temp是时间层相邻帧的编码时间,qp
temp是时间层相邻帧的量化参数,ref
temp是时间层相邻帧的参考帧数目,b是时间层相邻帧的权重;α是我们从统计数据计算得到的变化因子,β是基于图像组之中编码帧的位置计算得到的比率。
本发明所带来的有益技术效果:本发明从编码配置出发,通过研究三种编码配置参数对于编码时间的影响程度,提出了三种基于编码参数的调整方案,并将其综合成为一种编码时 间预测模型。
本发明根据上述编码时间预测模型,将位置上的相邻已编码帧与同一时间层上的相邻已编码帧结合起来考虑,利用这两种已编码帧共同预测当前帧的编码时间,建立了一种基于编码时间预测模型的负载均衡方法,本方法能够在保证编码质量的前提下,很好的适应高清、超高清视频的实时压缩应用,大大提高了编码速度。
图1为基于编码时间预测模型的条带并行HEVC编码器的负载均衡方法的流程图。
图2为基于编码参数的编码时间预测方法的流程图。
图3为负载均衡方法的具体流程图。
下面结合附图和具体实施方式对本发明作进一步的说明。
为了满足高清、超高清视频图像的实时压缩应用需求,提高HEVC视频编码器的编码速度,本发明提出了一种基于编码预测模型的条带并行HEVC编码器的负载均衡方法。该方法主要包括两部分:基于编码参数的编码时间调整方法和基于编码时间预测模型的负载均衡方法,基于编码参数的编码时间调整方法涉及发明内容中的步骤(5)和步骤(6),基于编码时间预测模型的负载均衡方法涉及发明内容中的步骤(8)和步骤(9)。
该发明的主要流程如图1所示,首先判断当前视频流是不是帧内编码帧,是否具有同一时间层的相邻已编码帧,当满足不是帧内编码帧,且具有同一时间层的相邻已编码帧的时候,根据同一时间层的相邻已编码帧(简称为时间层相邻帧)的配置参数,将位置上的相邻已编码帧(简称为位置相邻帧)分别做基于其在图像组位置、量化参数大小和参考帧数目的调整;然后根据编码时间预测模型,用时间层相邻帧和经过调整后的位置相邻帧共同预测当前帧每一个编码树单元的编码时间和总编码时间;再根据电脑配置确定条带的个数,并据此确定每一个条带的平均负载;最后根据编码树单元的预测时间和每一个条带的平均负载来确定每一个条带的编码树单元数目,并在此基础上进行微调,从而使得每一个条带获得相同的计算负载,以达到条带并行的负载均衡。
下面展开具体说明:
1、基于编码参数的编码时间调整方法
新一代视频编码标准HEVC中出现了固定的编码配置模板,主要包括三种:全帧内编码帧配置(AI)、低时延配置(LP)和随机存取配置(RA)。每一种配置文件下都有相似的编码配置,但是编码配置中有很多值是可以改变的,这些变化的配置参数往往会对编码的时间和编码的效率产生影响。同时这些不同的配置参数也严重影响了将两种不同类型的帧联合起来 用于实际预测的准确度。因此,为了同时使用两种不同的已编码帧,我们需要研究这些编码参数对于编码时间的影响。
1)图像组中的位置
通过实验统计发现,在每一个图像组中都会存在一个编码时间明显大于其余帧的帧,在改变了图像组的大小之后,结果依然是这样,这个帧就是每一个图像组中的最后一帧。通过研究发现,这一帧的编码时间严重大于此图像组中其余帧的编码时间的原因是,这一帧的时间层ID为0,λ较小。此外,研究表明在同一个视频序列中,图像组中的最后一帧的编码时间与其余帧的编码时间的比率在每一个图像组中都是相似的。为此,我们定义了一个比率β,计算公式如下式(1)所示。
β=T
other÷T
GOPsize (1)
式中,T
GOPsize是图像组中最后一帧的编码时间,T
Other是图像组中其他帧的编码时间。通过使用这个比率,可以将图像组中不同位置水平的编码帧同步到一个位置水平上。
2)量化参数大小
为了研究量化参数大小对于编码时间的影响水平,在HEVC的测试序列中选择了六个测试序列作为训练集,分别是B类测试序列中的ParkScene和Cactus、C类测试序列中的BQMall和PartyScene以及D类测试序列中的BasketballPass和RaceHorses。在参考帧数目为1,图像组大小为4,其余配置参数为默认配置的条件下,通过改变量化参数(范围为20-48,也就是视频编码中常用的量化参数范围)的大小来记录上述六个测试序列的编码时间。每一种情况都测试了3次,最后通过取平均值来作为每一帧的编码时间。
实验数据表明:编码时间与量化参数大小之间存在如下式(2)所示的规律。
式中,
是需要预测的编码时间,
是已经知道并且将用于预测的时间,,QP
pred是需要预测的帧的量化参数,QP
reference是用于预测的帧的量化参数。通过使用这个规律,可以将具有不同量化参数大小的帧同步到一种量化参数水平上。
3)参考帧数目
运动估计是HEVC帧间预测中最耗时的操作,当增加一个参考帧的时候,相应的也就要多做一个帧的运动估计。为了研究参考帧数目对编码时间的影响,我们依然选择2)中所用到的6个测试序列作为训练集,在保持所有配置参数都不改变的条件下,通过只改变每一帧 的参考帧的数目来测试上述每一个测试序列,并记录每一帧的编码时间,其中,参考帧的数目分别被设定为1、2、3和4。在测试4次之后,取平均值作为最后的测试结果。
统计数据表明编码时间与参考帧数目之间的关系可以用下式(3)来描述。
通过上述成果,我们提出了一种基于编码参数的编码时间预测模型,其公式如下式(4)所示。
式中,T
pred是最终的预测时间,T
pos是位置相邻帧的编码时间,其量化参数是qp
pos,参考帧数目是ref
pos,权重是a;T
temp是时间层相邻帧的编码时间,量化参数是qp
temp,参考帧数目是ref
temp,权重是b;α是3)中的变化因子,β是1)中的比率。
基于编码参数的编码时间调整方法的流程如图2所示。对我们所获取到的两种编码帧的编码时间,首先将两者同步到同一个图像组的位置水平上。然后对调整后的位置相邻帧的编码时间分别进行基于量化参数的调整和基于参考帧的调整。从而我们可以得到两个在统一编码水平上的帧。调整的过程描述如下:
(1)对当前帧,我们可以获得两种已编码帧,即时间层相邻帧和位置相邻帧。首先判断这两种帧是否在同一个图像组位置水平上,如果在,则不需要调整;否则,将位置相邻帧进行如式(1)所示的调整。
(2)若这两种帧不在同一量化参数水平上,我们将位置相邻帧进行如式(2)所示的调整;否则,不需要调整。
(3)若这两种帧不在同一参考帧数目水平上,我们将位置相邻帧进行如式(3)所示的调整;否则,不需要调整。
通过上述调整,我们可以得到在同一编码参数水平的两个不同类别的已编码帧。通过使用这两种已经同步到同一编码参数水平上的已编码帧的编码时间信息,我们可以预测得到当前帧的编码时间。
2.基于编码时间预测模型的负载均衡方法
负载均衡是一种我们能获得最高加速比的理想状态。但是在实际的编码中,由于自然图像的随机性和最优编码模式的选择问题,一帧图像的计算复杂度分布并不均匀。因此,当我们给每一个条带均匀分配编码单元数目的时候,会出现负载失衡。负载失衡是降低并行处理器系统性能的一个很重要的因素。为了实现条带水平并行的负载均衡,我们需要找到一种能够有效预测每一个编码树单元计算复杂度的方法。这样,我们就可以平均划分每一个条带的计算负载,使得每一个编码核心同时完成。通过这样做,并行处理系统就不会存在空闲等待现象,我们也将获得最高的加速比。
本发明利用前面的基于编码参数的编码时间预测方法来得到当前帧中每一个编码单元的预测编码时间,进而使用这些信息来实现条带水平并行的负载均衡。负载分配和调整的流程如图3所示,具体实施方式如下:
(1)首先根据上述编码时间预测方法来得到当前帧的总编码时间和每一个编码单元的编码时间。
(2)根据所用设备的配置自动确定条带的数目。
(3)根据条带的数目和总预测编码时间计算出每一个条带的平均负载。
(4)根据每一个条带的平均负载和所预测出来的每一个编码单元的预测编码时间,来确定每一个条带所应该具有的编码单元的数目。
(5)根据每一个条带划分的编码单元的数目,计算划分后的各个条带的计算负载并排序,记录最大负载,将其赋值给一个变量a。
(6)将变量a与其前后相邻的条带的负载相比,且向比其小的条带转移一个编码树单元;
(7)若变化后的最大负载小于之前的最大计算负载,或变化后的最小负载大于之前的最小负载,则确定此新的划分,并更新条带计算负载的排序,将最大负载赋值给变量a;执行步骤(6);否则保持原划分;
(8)若负载a不为最小,则将其赋值为次大计算负载,继续执行步骤(6);否则开始编码。
当然,上述说明并非是对本发明的限制,本发明也并不仅限于上述举例,本技术领域的技术人员在本发明的实质范围内所做出的变化、改型、添加或替换,也应属于本发明的保护范围。
Claims (5)
- 一种基于编码时间预测模型的负载均衡方法,其特征在于,包括如下步骤:步骤1:进入一帧视频流;步骤2:平均划分当前帧中每一个条带所具有的的编码树单元数目;步骤3:判断当前帧是否是帧内编码帧;若:判断结果是当前帧是帧内编码帧,则执行步骤10;或判断结果是当前帧不是帧内编码帧,则执行步骤4;步骤4:判断当前帧是否有同一时间层的已编码非帧内编码帧;若:判断结果是当前帧有同一时间层的已编码非帧内编码帧,则执行步骤5;或判断结果是当前帧没有同一时间层的已编码非帧内编码帧,则执行步骤7;步骤5:通过编码时间预测模型将位置相邻已编码帧的编码时间同步到与同一时间层的相邻已编码帧相同的水平上;步骤6:通过同步后的两个帧的编码时间共同预测当前帧的编码时间,然后执行步骤8;步骤7:根据位置相邻已编码帧的编码时间来预测当前帧的编码时间;步骤8:以当前帧的预测编码时间为基准来分配每一个条带所拥有的编码树单元数目;步骤9:根据条带的分配结果进行微调,使每一个条带获得相同的计算负载;步骤10:并行编码当前帧的每一个条带,结束一帧。
- 根据权利要求1所述的基于编码时间预测模型的负载均衡方法,其特征在于,在步骤5中,具体包括如下步骤:步骤5.1:将位置上的相邻已编码帧做基于其在图像组中位置的调整,使其同步到与同一时间层的相邻已编码帧相同的图像组位置水平上;步骤5.2:将位置上的相邻已编码帧的编码时间做基于量化参数大小的调整,使其同步到与同一时间层的相邻已编码帧相同的量化参数水平上;步骤5.3:将位置上的相邻已编码帧的编码时间做基于参考帧数目的调整,使其同步到与同一时间层的相邻已编码帧相同的参考帧水平上。
- 根据权利要求1所述的基于编码时间预测模型的负载均衡方法,其特征在于,在步骤8中,具体包括如下步骤:步骤8.1:计算当前帧的总预测编码时间;步骤8.2:根据每一个设备的CPU核心数分配条带的数目;步骤8.3:通过步骤8.1和步骤8.2的结果确定每一个条带的平均负载;步骤8.4:根据步骤8.3中的平均负载为每一个条带分配一定数目的编码树单元。
- 根据权利要求1所述的基于编码时间预测模型的负载均衡方法,其特征在于,在步骤 9中,具体包括如下步骤:步骤9.1:进入一帧视频流;步骤9.2:预测当前帧的总编码时间和各个编码树单元的编码时间;步骤9.3:计算每一个条带的平均负载并划分每一个条带的编码树单元数目;步骤9.4:计算划分后的各个条带的负载并排序;步骤9.5:记录最大计算负载,并将其赋值给一个变量a;步骤9.6:判断a的负载值是否大于其前或后的计算负载;若:判断结果是a的负载值大于其前或后的计算负载,则执行步骤9.7;或判断结果是a的负载值小于其前或后的计算负载,则执行步骤9.11;步骤9.7:将a的编码树单元数目减一,比其小的条带的编码树单元数目加一;步骤9.8:计算变化后的最大计算负载;步骤9.9:判断变化后的最大计算负载是否小于之前的最大计算负载;若:判断结果为变化后的最大计算负载小于之前的最大计算负载,则执行步骤9.10;或判断结果为变化后的最大计算负载大于之前的最大计算负载,则执行步骤9.11;步骤9.10:重新排序各条带的计算负载,然后执行步骤9.5;步骤9.11:判断a是否是最小负载;若:判断结果是a是最小负载,则结束;或判断结果是a不是最小负载,则执行步骤9.12;步骤9.12:将a赋值为次小的计算负载,然后执行步骤9.6。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710159343.6A CN107071424B (zh) | 2017-03-17 | 2017-03-17 | 一种基于编码时间预测模型的负载均衡方法 |
| CN201710159343.6 | 2017-03-17 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2018166535A1 true WO2018166535A1 (zh) | 2018-09-20 |
Family
ID=59618376
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/079378 Ceased WO2018166535A1 (zh) | 2017-03-17 | 2018-03-17 | 一种基于编码时间预测模型的负载均衡方法 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN107071424B (zh) |
| WO (1) | WO2018166535A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023011604A1 (en) * | 2021-08-05 | 2023-02-09 | Beijing Bytedance Network Technology Co., Ltd. | Method, apparatus, and medium for video processing |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107071424B (zh) * | 2017-03-17 | 2018-09-25 | 山东科技大学 | 一种基于编码时间预测模型的负载均衡方法 |
| CN118842552B (zh) * | 2024-06-20 | 2025-10-24 | 华中科技大学 | 一种面向编码分布式计算的大条带编码计算任务分配方法 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103702126A (zh) * | 2013-12-10 | 2014-04-02 | 清华大学深圳研究生院 | 一种基于视频标准hevc的并行编码优化方法 |
| US20150016503A1 (en) * | 2013-07-15 | 2015-01-15 | Qualcomm Incorporated | Tiles and wavefront processing in multi-layer context |
| CN104539972A (zh) * | 2014-12-08 | 2015-04-22 | 中安消技术有限公司 | 一种多核处理器中视频并行解码的控制方法和装置 |
| CN105245896A (zh) * | 2015-10-09 | 2016-01-13 | 传线网络科技(上海)有限公司 | Hevc并行运动补偿方法及装置 |
| CN106454354A (zh) * | 2016-09-07 | 2017-02-22 | 中山大学 | 一种avs2并行编码处理系统及方法 |
| CN107071424A (zh) * | 2017-03-17 | 2017-08-18 | 山东科技大学 | 一种基于编码时间预测模型的负载均衡方法 |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CA2722993A1 (fr) * | 2010-12-01 | 2012-06-01 | Ecole De Technologie Superieure | Systeme d'ecodage video parallele multitrames et multitranches avec encodage simultane de trames predites |
| CN102868888B (zh) * | 2012-04-27 | 2014-11-26 | 北京航空航天大学 | 一种面向并行视频编码的动态slice控制方法 |
| CN102833551B (zh) * | 2012-09-25 | 2014-10-29 | 中南大学 | 一种Slice级编解码端联合时间最小化方法 |
| CN103227919B (zh) * | 2013-03-29 | 2015-11-25 | 苏州皓泰视频技术有限公司 | 一种基于多核处理器Tilera的SVC编码方法 |
| CN104980764B (zh) * | 2014-04-14 | 2019-06-21 | 深圳力维智联技术有限公司 | 基于复杂度均衡的并行编解码方法、装置及系统 |
| CN106231320B (zh) * | 2016-08-31 | 2020-07-14 | 上海交通大学 | 一种支持多机并行编码的联合码率控制方法及系统 |
-
2017
- 2017-03-17 CN CN201710159343.6A patent/CN107071424B/zh not_active Expired - Fee Related
-
2018
- 2018-03-17 WO PCT/CN2018/079378 patent/WO2018166535A1/zh not_active Ceased
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150016503A1 (en) * | 2013-07-15 | 2015-01-15 | Qualcomm Incorporated | Tiles and wavefront processing in multi-layer context |
| CN103702126A (zh) * | 2013-12-10 | 2014-04-02 | 清华大学深圳研究生院 | 一种基于视频标准hevc的并行编码优化方法 |
| CN104539972A (zh) * | 2014-12-08 | 2015-04-22 | 中安消技术有限公司 | 一种多核处理器中视频并行解码的控制方法和装置 |
| CN105245896A (zh) * | 2015-10-09 | 2016-01-13 | 传线网络科技(上海)有限公司 | Hevc并行运动补偿方法及装置 |
| CN106454354A (zh) * | 2016-09-07 | 2017-02-22 | 中山大学 | 一种avs2并行编码处理系统及方法 |
| CN107071424A (zh) * | 2017-03-17 | 2017-08-18 | 山东科技大学 | 一种基于编码时间预测模型的负载均衡方法 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023011604A1 (en) * | 2021-08-05 | 2023-02-09 | Beijing Bytedance Network Technology Co., Ltd. | Method, apparatus, and medium for video processing |
Also Published As
| Publication number | Publication date |
|---|---|
| CN107071424B (zh) | 2018-09-25 |
| CN107071424A (zh) | 2017-08-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN106231320B (zh) | 一种支持多机并行编码的联合码率控制方法及系统 | |
| CN101815218B (zh) | 基于宏块特征的快速运动估计视频编码方法 | |
| CN106961606B (zh) | 基于纹理划分特征的hevc帧内编码模式选择方法 | |
| CN102984521B (zh) | 基于时域相关性的高性能视频编码帧间模式判决方法 | |
| CN104320658B (zh) | 一种hevc快速编码方法 | |
| CN103227919B (zh) | 一种基于多核处理器Tilera的SVC编码方法 | |
| US9883200B2 (en) | Method of acquiring neighboring disparity vectors for multi-texture and multi-depth video | |
| CN116260990B (zh) | 一种多路视频流的ai异步检测并实时渲染方法及系统 | |
| CN103384325A (zh) | 一种avs-m视频编码快速帧间预测模式选择方法 | |
| Yuan et al. | Divide-and-conquer-based rdo-free cu partitioning for 8k video compression | |
| WO2018166535A1 (zh) | 一种基于编码时间预测模型的负载均衡方法 | |
| CN108989818B (zh) | 一种图像编码参数调整方法及装置 | |
| CN114356544A (zh) | 面向边缘集群的并行计算方法和系统 | |
| CN101252695A (zh) | 一种视频编码器及其帧内预测模式选择方法 | |
| CN102868888B (zh) | 一种面向并行视频编码的动态slice控制方法 | |
| CN107135392A (zh) | 基于异步模式的hevc运动搜索并行方法 | |
| CN101917618B (zh) | 多视点视频编码分层b帧预测结构的计算复杂度控制方法 | |
| CA2689441C (en) | A system and method for time optimized encoding | |
| CN101621694A (zh) | 一种运动估计方法、系统及显示终端 | |
| CN105791829A (zh) | 一种基于多核平台的hevc并行帧内预测方法 | |
| CN107105240B (zh) | 一种hevc-scc复杂度控制方法及其系统 | |
| CN101511026B (zh) | 一种基于场景的avs二次编码码率控制方法 | |
| CN100474932C (zh) | 基于最佳预测模式概率的视频帧内图像快速编码方法 | |
| CN110545429B (zh) | 一种基于全景视频纬度特性的复杂度优化方法及设备 | |
| CN105069819A (zh) | 一种基于med预测算法的预测值补偿方法 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18767137 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18767137 Country of ref document: EP Kind code of ref document: A1 |


