CN100586185C - Mode selection method for transcoding 264 video to reduce resolving capability - Google Patents

Mode selection method for transcoding 264 video to reduce resolving capability Download PDF

Info

Publication number
CN100586185C
CN100586185C CN 200810103682 CN200810103682A CN100586185C CN 100586185 C CN100586185 C CN 100586185C CN 200810103682 CN200810103682 CN 200810103682 CN 200810103682 A CN200810103682 A CN 200810103682A CN 100586185 C CN100586185 C CN 100586185C
Authority
CN
China
Prior art keywords
lt
gt
mi
mo
mn
Prior art date
Application number
CN 200810103682
Other languages
Chinese (zh)
Other versions
CN101272496A (en
Inventor
戴琼海
强 栗
陈芝鑫
Original Assignee
清华大学
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 清华大学 filed Critical 清华大学
Priority to CN 200810103682 priority Critical patent/CN100586185C/en
Publication of CN101272496A publication Critical patent/CN101272496A/en
Application granted granted Critical
Publication of CN100586185C publication Critical patent/CN100586185C/en

Links

Abstract

The invention relates to a mode selection method for 264 reducing resolution transcoding, which belongs to the multimedia technological field of computers and includes that: the code stream with a 264 format is decoded, and the size of each block and the amount of the corresponding motion vector are recorded; the motion mode of an original block is mapped into a new block in a proportion of 2:1, and the original motion vector is reduced by 1/2 and then transformed to the corresponding block in a new video frame; according to the motion mode and the motion vector of the original block, the motion mode and the estimating motion vector of the new block are judged, and an optional mode is determined; an improved 264 rate distortion optimization algorithm basing on transcoding is used for the selection of a best mode; the 264 coding of the block is finished; the next frame is decoded continuously and the transcoding treatment is implemented. The mode selection method fully uses effective information input into 264 coding data and greatly reduces the computational complexity from 264 to 264 reducing resolution transcoding in the mode selection.

Description

一种H.264视频降低分辨率转码的模式选择方法 For H.264 Video transcoding reduced resolution mode selection method

技术领域 FIELD

本发明属于计算机多媒体技术领域,特别涉及视频转码技术。 The present invention belongs to the technical field of computer multimedia, and particularly to video transcoding. 背景技术 Background technique

数字视频是指以数字形式记录的视频信息,英文对应的词组是Digital video。 A digital video means video information recorded in digital form, corresponding English phrase is Digital video. 数字视频的原始数据量非常大,给传输和存储都带来了很大的不便,因此实际应用中往往需要进行编码压縮。 The original amount of digital video data is very large, to the transmission and storage has brought great inconvenience, so the practical applications often need to be encoded compressed.

视频编码釆用运动估计的方法来实现数据的压缩。 The video encoding method of motion estimation preclude the use of data compression is achieved. 视频数据是以固定的时间间隔连续采集的图像序列,由于采集速度快,相邻图像在内容上的相关性很强。 Video image sequence data is continuously collected at fixed time intervals, since the rate acquisition strong neighboring image correlation in content. 运动估计就是利用图像间的这种相关性,消除其中的冗余信息,实现数据的压縮。 Motion estimation is the use of this correlation between images, elimination of redundant information which, to achieve compressed data. 运动估计方法的大体过程如下:首先将当前帧(编码过程中准备编码的图像)划分为固定大小的块(16像素X16像素);然后,对于每个块,在参考帧中(编码选用的参考图像)进行搜索和比较,找到一个内容相似度最高的"匹配块",由此得到编码当前块的运动向量(当前块与匹配块之间的相对位移);接着,将两个块相减得到残差,并对,差矩阵进行DCT变换;最后对运动向量和DCT变换系数进行熵编码得到压縮数据。 The motion estimation method substantially as follows: First, a current frame (to prepare encoded image encoding process) is divided into fixed-size blocks (16 pixels pixels X16); then, for each block in the reference frame (encoding the selected reference image) search and compare the contents with the highest similarity to find a "matching block", thereby obtaining a motion vector of the current block is encoded (current block and the relative displacement between the matching block); then, the two blocks relative to give Save residual, and the difference DCT transform matrix; Finally, the motion vectors and DCT coefficients for entropy encoding to obtain compressed data. .. ..

但是由于终端设备的处理和显示能力不同,传输视频信号的网络状况的千差万别,以及各大组织及公司针对不同的用途和应用场合制定的一系列不同的视频编码标准,造成了视频数据的格式及参数多样化;给媒体资源的传播和共享带来了很大的困难。 However, due to different processing and display capabilities of the terminal device, network conditions vary widely in the transmission of video signals, as well as major organizations and companies for a range of different video coding standards for different uses and applications developed, resulting in a format of video data and parameters diversification; to disseminate and share media resources has brought great difficulties. 视频转码技术就是为了解决以上问题,以更好更有效地实现视频数据间的转换而提出来的。 Video transcoding is to solve the above problems, in order to better their argument more effectively to achieve the conversion between video data.

视频转码(VideoTranscoding)技术,就是要将原来的某种压縮视频流,转换为另一种不同的压縮视频流,以改变其码率、分辨率等参数,或完全改变其语法格式。 Video transcoding (VideoTranscoding) technique, is, to some original compressed video stream into another different compression video streams to change its bit rate, resolution and other parameters, or completely change its syntax. 视频转码方法主要可以分为两大类:像素域转码和变换域转码。 Video transcoding method can be divided into two categories: pixel-domain transcoding and transform domain transcoding. 变换域转码通过对DCT系数进行运动补偿,实现码流格式的转换。 Transform domain by transcoding motion compensation DCT coefficients, to achieve the conversion stream format. 这种方法的优点是计算量小,转码速度快,缺点是该方法对运动向量,编码速率等有一定的要求,给实际应用带来了一定的限制。 The advantage of this method is that a small amount of calculation, fast transcoding speed, the disadvantage is that the method has certain requirements for the motion vector, coding rate, etc., brought to the practical application of certain restrictions. 像素域转码则是将码流解码后通过DCT反变换到像素域后进行处理,比较灵活,便于实现,但转码的计算量较大。 Pixel-domain transcoding sucked code stream after decoding by the inverse DCT transform processing to the pixel domain, flexible, easy to implement, but the larger the amount of calculation transcoding.

H.264/AVC是ITU-T视频编码专家组(VCEG)和ISO/IEC运动图像专家组(MPEG)联合制定的最新国际视频编码标准,其主要目标是提高压縮性能,并提供与网络友好(network-friendly)的视频表示。 H.264 / AVC is the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Moving Picture Experts Group (MPEG) jointly developed the latest international video coding standard, and its main objective is to improve the compression performance and provides network-friendly (network-friendly) video representation. 通过对之前各视频编码标准多方面的改进,H.264能够满足各种码率下的不同需求。 Through various improvements before each video coding standard, H.264 can meet the different needs at various code rates. 例如,它既可用于移动电话等较低码率下的视频传输,也可用在中码率的视频会议等场合,同时也适于数字电视等较高码率的应用。 For example, it is used for both video transmission at a lower rate such as mobile phones, it can also be used in the bit rate video conferences and so forth, but also suitable for use in high bit rate digital television. H.264在给出感觉上相当的视频质量的同时,码率只是MPEG-2码率的1/3到1/2;与现存其他视频标准相比较,H.264可期望提高50%以上的编码效率。 H.264 is given at the same time feel equivalent video quality, bit-rate MPEG-2 is only 1/3 to 1/2 rate; compared with other existing video standards, H.264 may be desirable to increase more than 50% coding efficiency. 与之前的MPEG-2, MPEG-4等编码标准相比,^1264增加了运动补偿的可变尺寸块技术,在运动补偿中,H.264支持更加灵活的块尺寸选择机制,比其他视频标准有更多的块形状和尺寸。 Compared with the previous MPEG-2, MPEG-4 like coding standard, ^ 1264 increases the variable block size motion compensation technique, motion compensation, H.264 supports more flexible block size selection mechanism, other than the video standards more block shapes and sizes. 每一个P型(单向运动预测)或B型(双向运动预测)的块,均对应一个特定的分区情况,被分为若干个8x8、 8x16、 16x8 或16xl6的块;如果选择了8x8的i央,将有可能进一步被分割为8x4、 4x8或4x4的块。 Each of a P-type (one-way motion predictive) or B type (bidirectional motion prediction) of the block, each corresponding to a specific partition, the number of 8x8 is divided into, blocks of 8x16, 16x8 or 16xl6; if you select the 8x8 i central, will likely be further divided into blocks of 8x4, 4x8 or 4x4 in. 此技术在增加编码效率的同时也大大的增加了编码的复杂度和计算量。 This technique increases the coding efficiency but also greatly increases the computational complexity and coding.

目前的针对降低分辨率的转码方法是将码流解码到像素域,每一帧图像数据下采样到指定的分辨率后,对其中的每个块进行运动估计,估计运动向量为该块对应到原始图像的区域内所有块的运动向量的加权平均值或取中值,在对估计运动向量细化后,完成降低分辨率后图像的编码。 The current method for transcoding is reduced resolution pixel domain to the decoded code stream, sampled to the specified resolution, wherein for each block motion estimation is performed at each frame of image data, corresponding to the estimated motion vector for the block or a weighted average of the motion vector takes value of all the blocks in the area of ​​the original image, in the refinement of the motion vector estimation, after the completion of reducing the coding resolution of the image. 这种方法适合MPEG-2、 MPEG-4等编码标准的降低分辨率的转码应用,但由于R264具有可变尺寸块的特点,在编码和转码时候需要进行最佳模式选择,因此传统的这种降低分辨率的转码方法并不适合H.264标准内的降低分辨率的转码。 This method is suitable for MPEG-2, MPEG-4 like coding standard resolution reduction transcoding application, but R264 has the characteristics of a variable block size needs to be in the best mode selection when encoding and transcoding, traditional this transcoding method is not suitable for the reduced resolution reduced resolution in the standard H.264 transcoding.

发明内容 SUMMARY

本发明的目的是为克服已有技术的不足之处,提出了一种新的264视频降低分辨率转码的模式选择方法,该方法充分利用了264编码中的运动模式和运动向量信息,结合264 视频编码的可变尺寸块的特点,有效的减少了转码过程中模式选择的备选模式,提高了转码效率。 Object of the present invention is to overcome the deficiencies of the prior art, proposes a new reduced resolution video transcoder 264 mode selection method makes full use of the motion information and the motion vector mode coding 264, in conjunction with It features variable size video coding block 264, effectively reducing the alternate mode in the mode selection transcoding process to improve the efficiency of transcoding.

本发明提出的一种11.264降低1/2空间分辨率的像素域转码方法,其特征在于,包括以下步骤: The present invention provides a 11.264 proposed pixel domain transcoding method of reducing the spatial resolution 1/2, the method comprising the steps of:

1) 对264格式的编码码流进行解码,并记录下各个原始块的大小和对应的运动向量的大小; 1) the format of encoded code stream 264 is decoded, and the size and the size of the motion vector corresponding to the original block of each record;

2) 原始块的运动模式按2:1映射到新视频帧的块中(如16xl6模式映射为8x8模式, 16x8模式映射为8X4模式等),并将原运动向量经过1/2缩减后传递给新视频帧中的相应±央;小于8x8的原始块,所在的8x8区域整体映射为4x4块,计算新块运动向量MP^为: 2) movement pattern of the original block by 2: 1 block is mapped to a new video frame (e.g., as the mapping mode 16xl6 8x8 mode, map mode is 16x8 mode, 8X4, etc.), and the original motion vector is transmitted to the reduced after 1/2 ± respective central new video frame; original block is smaller than 8x8, 8x8 mapped to the entire area where the 4x4 block, a new block motion vectors calculated as MP ^:

<formula>formula see original document page 5</formula> <Formula> formula see original document page 5 </ formula>

式子中,M巧。 Formulas, M clever. "为该块对应原始帧区域中第z'个块的运动向量,w,为加权系数,加权系数用第f个块的面积来确定,《代表所包含原始块的总数; "For the block corresponding to the original frame region of z 'blocks the motion vector, w, is a weighting factor, the weighting coefficient of the f block of the area to determine the" total number of representatives included in the original block;

3) 如果当前16xl6块对应的四个原始块均为16xl6模式,首先分别计算左上右上,左 3) If the current 16xl6 four blocks corresponding to the original block are 16xl6 mode, first calculate the upper left upper right, left

下右下,左上左下和右上右下对应的每两个运动向量之间的距离《: At the lower right, the distance "between the lower left and upper right lower right upper left corresponding to each of the two motion vectors:

<formula>formula see original document page 5</formula> <Formula> formula see original document page 5 </ formula>

式子中,;c,, x2,力,h分别为两个运动向量的横、纵坐标值; Formulas,; c ,, x2, force, h is a cross two motion vectors, respectively, and the ordinate value;

如果得到的距离《的最大值小于/)16><16,则新块使用16xl6运动模式,对应的运动向量为四个运动向量的中间向量; If the maximum value obtained from the "less than /) 16> <16, the new block using 16xl6 motion pattern, the motion vectors corresponding to four motion vectors of intermediate vector;

如果得到的距离《的最大值大于"16>;16,最小值小于i^8,则这两个运动向量对应的块使用16x8或8xl6模式,对应的运动向量为这两个运动向量的平均值;同时,如果另外两个运动向量对应之间的距离小于Z^s ,则这两个运动向量对应的块使用16x8或8xl6模式,对应的运动向量为这两个运动向量的平均值;否则,两个对应的块使用8x8运动模式; If the resulting distance "is greater than the maximum value" 16 "; 16, smaller than the smallest i ^ 8, then the two motion vectors using the corresponding block or 8xl6 16x8 mode, the motion vector corresponding to the average of these two motion vectors ; Meanwhile, if the distance between the corresponding motion vector is smaller than the other two Z ^ s, then the two motion vectors using the corresponding block or 8xl6 16x8 mode, the motion vector corresponding to the average of these two motion vectors; otherwise, two corresponding 8x8 blocks using motion pattern;

如果得到的距离《的最大值大于/)16><16,最小值大于/)8><8,则使用步骤2)中的映射的运动模式和向量; If the maximum value obtained from "greater than /) 16> <16, greater than the minimum /) 8> <8, is used in step 2) the motion mode and the mapping vector;

和Ax8为常数(其值可以根据实际应用要求的视频质量和计算量来确定,"1M6和Z^8值越大,计算量越小,视频质量越差;反之,计算量越大,视频质量越好;例如",6和Ax8分别设置为20和10); And Ax8 constant (value which can be determined according to the video quality and computation requirements of the practical application, the greater the "1M6 and Z ^ 8 value, the smaller the calculation amount, quality of the video; the other hand, the amount of calculation is larger, the video quality better; e.g., "Ax8 and 6 are set to 20 and 10);

4)如果四个原始块中有三个块为16xl6模式,分别计算出3个16xl6块对应的运动向 4) If the original block in the four blocks of three 16xl6 mode, calculates the three 16xl6 block corresponding to the motion

量之间的距离《:_ The distance between the amount ": _

式子中,;c,, &, h分别为两个运动向量的横、纵坐标值; Formulas,; c ,, &, h respectively cross two motion vectors, and the ordinate value;

如果最大距离《小于/)16)<16,则将16xi6运动模式加入到备选模式中,对应的运动向量为3个运动向量的中间向量; If the maximum distance "less than /) 16) <16, then added to the motion mode 16xi6 alternate mode, the motion vector corresponding to the motion vectors for the three intermediate vector;

如果得到的距离《的最大值大于D丄,'e ,但存在相邻两块对应的运动向量之间距离^小于/)8;<8,则这两个运动向量对应的块使用16x8或8xl6模式,对应的运动向量为这两个运动向量的平均值,另外两个块维持映射得到的运动模式不变,并将这种模式加入到备选模式中; If the maximum value obtained from "greater than D Shang, 'e, but two motion vectors exists between adjacent distance corresponding to less than ^ /) 8; <8, then the two motion vectors corresponding to the blocks used 16x8 or 8xl6 mode, the motion vector corresponding to the average of these two motion vectors, motion mode to maintain the other two blocks obtained by mapping the same, and the addition of such an alternative model to the model;

将步骤2)中映射得到的运动模式和向量加入到备选模式中;对运动向量进行细化后,从上述备选模式中选择出最佳模式。 The movement mode in step 2) obtained and mapped to the vectors added in the alternate mode; refined after the motion vector, the best mode is selected from among the candidate modes.

该最佳模式选择可采用264编码中的基于Lagrangian优化算法的率失真优化技术(Rate-Distortion Optimization),其中入按下式计算:h 0.85x2,, The optimum mode selector 264 may be employed in the encoding distortion optimization (Rate-Distortion Optimization) Lagrangian optimization algorithm based on rate, wherein the following formula: h 0.85x2 ,,

QP为264的量化参数,该新块QP的值不小于之前对应块的QP值(2&。,,^ ^ )。 QP is the quantization parameter 264 corresponding to QP value (& 2. ,, ^ ^) value for the new block before the block is not smaller than QP.

本i明的特点及效果 Features and advantages of the present i Ming

本发明提出了一种新的H. 264降低1/2空间分辨率的像素域转码方法。 The present invention proposes a new H. 264 pixel domain transcoding method of reducing the spatial resolution of 1/2. 本发明充分利用了264编码中的运动模式和运动向量信息,结合了264视频编码的可变尺寸块的特点,有效的减少了转码过程中模式选择的备选模式,提高了转码效率。 The present invention fully utilizes the motion pattern and motion vector information coding 264, combines the characteristics of a variable size video coding block 264, effectively reducing the alternate mode in the mode selection transcoding process to improve the efficiency of transcoding.

具体实施方式 Detailed ways

本发明提出的一种264视频降低分辨率转码的模式选择方法结合附图及实施例详细说明如下: Mode selection method of the present invention provides a proposed reduced resolution video transcoder 264 described in detail in conjunction with the accompanying drawings and the following examples:

本发明方法包括以下步骤:1) 对264格式的编码码流进行解码,并记录下各个原始块的大小和对应的运动向量的大小; The method of the present invention comprises the following steps: 1) the format of the encoded code stream 264 is decoded, and the size and the size of the motion vector corresponding to the original block of each record;

2) 原始块的运动模式按2:1映射到新视频帧的块中(如16xl6模式映射为8x8模式, 16x8模式映射为SX4模式等),并将原运动向量经过1/2縮减后传递给新视频帧中的相应块;小于8x8的原始块,所在的8x8区域整体映射为4x4块,计算新块运动向量M7,为: 2) movement pattern of the original block by 2: 1 block is mapped to a new video frame (e.g., mapped into 8x8 mode Mode 16xl6, 16x8 mode SX4 mapped mode), and the original motion vector is transmitted after reduction 1/2 to the corresponding blocks of a new video frame; original block is smaller than 8x8, 8x8 mapping the entire area where the block is 4x4, a motion vector calculating new block M7, is:

——^—— - ^ -

式子中,MI^"为该块对应原始帧区域中第z'个块的运动向量,vv,为加权系数,加权系数用第/个块的面积来确定,W代表所包含原始块的总数; Formulas, MI ^ "for the block corresponding to the total number of original frame region of z 'motion vectors of blocks, VV, a weighting factor, the weighting coefficient of / th block area is determined, and W represents the original block contains ;

3) 如果当前16xl6块对应的四个原始块均为16xl6模式,首先分别计算左上右上,左下右下,左上左下和右上右下对应的每两个运动向量之间的距离《: 3) The distance between the upper left upper right, lower left, lower right, lower left and upper right lower right upper left corresponding to each of the two motion vectors corresponding to the block if the current 16xl6 four original block are 16xl6 mode, first calculate ":

式子中,:c,, x2, 乂,力分别为两个运动向量的横、纵坐标值; Formulas,: c ,, x2, qe, lateral forces are two motion vectors, and the ordinate value;

如果得到的距离《的最大值小于1)16><16,则新块使用16xl6运动模式,对应的运动向量为四个运动向量的中间向量; If the resulting distance "is less than the maximum value of 1) 16> <16, the new block using 16xl6 motion pattern, the motion vectors corresponding to four motion vectors of intermediate vector;

如果得到fe距离rf,的最大值大于Aw6,最小值小于Ax8,则这两个运动向量对应的块使用16x8或8xl6模式,对应的运动向量为这两个运动向量的平均值;同时,如果另外两个运动向量对应之间的距离小于A^ ,则这两个运动向量对应的块使用16x8或8xl6模式, 对应的运动向量为这两个运动向量的平均值,否则,两个对应的块使用8x8运动模式; If fe obtained from rf, is greater than the maximum Aw6, Ax8 less than the minimum, then the two motion vectors using the corresponding block or 8xl6 16x8 mode, the motion vector corresponding to the average of these two motion vectors; the same time, if the additional the distance between the two motion vectors corresponding to less than a ^, then the two motion vectors using the corresponding block or 8xl6 16x8 mode, the motion vector corresponding to the average of these two motion vectors, otherwise, use of the two corresponding blocks 8x8 sport mode;

如果得到的距离4的最大值大于016><,6,最小值大于Ax8,则使用步骤2)中的映射的运动模式和向量; If the distance obtained is larger than the maximum value of 016 4> <, 6, Ax8 greater than the minimum, Step 2 using the mode and motion vector) is mapped;

"16)<16和Aw为常数(其值可以根据实际应用要求的视频质量和计算量来确定,A&w和Z^8值越大,计算量越小,视频质量越差;反之,计算量越大,视频质量越好;£>16)<16和/)8!<8 可以设置为20和10); "16) <16 and Aw constant (value which can be determined according to the video quality and computation requirements of practical applications, and the larger A & w value Z ^ 8, the smaller the calculation amount, quality of the video; the other hand, the amount of calculation large, the better the video quality; £> 16) <16 and /) 8 <8 may be set to 20 and 10!);

4) 如果四个原始块中有三个块为16xl6模式,分别计算出3个16xl6块对应的运动向 4) If the original block in the four blocks of three 16xl6 mode, calculates the three 16xl6 block corresponding to the motion

量之间的距离《:_ The distance between the amount ": _

式子中,x,, x2, 乂, h分别为两个运动向量的横、纵坐标值; Formulas, x ,, x2, qe, h respectively cross two motion vectors, and the ordinate value;

如果最大距离《小于A^6,则将16xl6运动模式加入到备选模式中'对应的运动向量为3个运动向量的中间向量; If the maximum distance "is less than A ^ 6, then added to an alternative motion pattern 16xl6 pattern 'corresponding to the motion vector of the motion vectors for the three intermediate vector;

'如果得到的距离《的最大值大于Aw6,但存在相邻两块对应的运动向量之间距离"小于Axs,则这两个运动向量对应的块使用16x8 (8x16)模式,对应的运动向量为这两个 'If the resulting distance "greater than the maximum Aw6, but the distance between two adjacent corresponding to the motion vector exists" less than Axs, then the two motion vectors corresponding to the blocks used 16x8 (8x16) mode, the motion vector corresponding to both

运动向量的平均值,另外两个块维持映射得到的运动模式不变,并将这种模式加入到备选 Average of the motion vectors, two additional blocks obtained by mapping to maintain constant motion pattern, and this pattern is added to the alternative

模式中; Mode;

将步骤2)中映射得到的运动模式和向量加入到备选模式中;对运动向量进行细化后,从上述备选模式中选择出最佳模式; The movement mode in step 2) obtained and mapped to the vectors added in the alternate mode; refined after the motion vector, the best mode is selected from among the candidate modes;

最佳模式选择采用264编码中的基于Lagrangian优化算法的率失真优化技术(Rate-Distortion Optimization),其中入按下式计算:义=0.85x2,, Best Mode opt 264 based on coding rate distortion optimization algorithm Lagrangian optimization techniques (Rate-Distortion Optimization), wherein the following formula: Yi = 0.85x2 ,,

QP为264的量化参数,该新块QP的值不小于之前对应块的QP值(^ 24—,)。 QP is the quantization parameter 264, corresponding to the value of QP values ​​of the block before the new block is not smaller than QP (24- ^,). 下面以步骤2中可能出现的一种情况为例,详细说明本发明提出的264视频降低分辨 In one case the following two steps may occur, for example, 264 video detailed description of the present invention reduces the resolution proposed

率转码的模式选择方法的操作方法: Operation mode selection method of transcoding:

在对264码流解码得到一帧后,对其进行2:1下采样,得到一帧新的图像。 After 264 obtained by decoding a code stream, subjected to 2: 1 down-sampling, to obtain a new image. 对其中的 Of which

一个16xl6块进行编码; 16xl6 a block is encoded;

此16xl6块在原始图像中对应的是4个16xl6块,每个块都采用16xl6运动模式编码,对应的运动向量分别为M^, MK2, MJ^和M)V分别计算M^和MJ^, M^和M^, MJ^和MK3 , MF2和MF4之间的距离《; This 16xl6 corresponding to the block in the original image is 16xl6 four blocks, each block using motion 16xl6 coding mode, motion vectors respectively corresponding to M ^, MK2, MJ ^ and M) V and calculate M ^ MJ ^, distance "between and M ^ M ^, MJ ^ and MK3, MF2 and MF4;

M^和MK4之间的距离^^最大,且"隨大于A6x,6,故此16><16块不使用16><16运动模式编码; The distance between the maximum MK4 ^^ and M ^, and "greater than with A6x, 6, therefore 16> <16 not used 16> <16 motion mode coding;

M^和M^之间的距离《m最小,且小于Axs,故而新块的上半8xl6区域使用8xl6运动模式,运动向量MP;'估计为M^和M72的平均值的1/2; And the distance between M ^ M ^ "m minimum, and less than Axs, therefore the upper half region 8xl6 8xl6 new block using motion mode, a motion vector MP; 'M72 and M ^ is the estimated average of 1/2;

剩余两个块M^和M^之间的距离大于I)^ ,故而新块的下半8xl6区域不使用8x16运动模式,而是两个8x8运动模式,运动向量M《和M^'分别估计为My3和MR的1/2;,' The distance between the remaining two blocks is greater than M ^ M ^ and I) ^, and therefore the lower half region 8xl6 new block is not used 8x16 motion mode, but two 8x8 motion mode, motion vectors M "and M ^ 'were estimated 1/2 of My3 ;, and MR '

按照上述运动模式完成此16><16块的编码后,继续编码下一个块。 After this 16> <16 encoded according to the above motion model, a coding block with continued.

Claims (2)

1、一种H.264视频降低分辨率转码的模式选择方法,其特征在于,包括以下步骤: 1)对H.264格式的编码码流进行解码,并记录下各个原始块的大小和对应的运动向量的大小; 2)原始块的运动模式按2:1映射到新视频帧的块中,并将原运动向量经过1/2缩减后传递给新视频帧中的相应块;小于8×8的原始块,所在的8×8区域整体映射为4×4块,计算新块运动向量MVnew为: <maths id="math0001" num="0001" ><math><![CDATA[ <mrow> <msub> <mi>MV</mi> <mi>new</mi> </msub> <mo>=</mo> <mfrac> <mrow> <munderover> <mi>&Sigma;</mi> <mi>i</mi> <mi>n</mi> </munderover> <mrow> <mo>(</mo> <msubsup> <mi>MV</mi> <mi>i</mi> <mi>org</mi> </msubsup> <mo>&times;</mo> <msub> <mi>w</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> </mrow> <mrow> <mn>2</mn> <mo>&times;</mo> <munderover> <mi>&Sigma;</mi> <mi>i</mi> <mi>n</mi> </munderover> <msub> <mi>w</mi> <mi>i</mi> </msub> </mrow> </mfrac> </mrow>]]></math></maths> 1, a mode selection for H.264 video reducing resolution transcoding method characterized by comprising the steps of: 1) the encoded bit stream to decode H.264 format, and record the size of each original block and the corresponding the magnitude of the motion vector; 2) movement pattern of the original block by 2: 1 block is mapped to a new video frame, and the original motion vector is transmitted after reduction to the corresponding half of the new block in the video frame; less than 8 × original block 8, 8 × 8 regions where the entire map is 4 × 4 blocks, calculate a new block motion vectors MVnew as: <maths id = "math0001" num = "0001"> <math> <[CDATA [<mrow! > <msub> <mi> MV </ mi> <mi> new </ mi> </ msub> <mo> = </ mo> <mfrac> <mrow> <munderover> <mi> & Sigma; </ mi> <mi> i </ mi> <mi> n </ mi> </ munderover> <mrow> <mo> (</ mo> <msubsup> <mi> MV </ mi> <mi> i </ mi> <mi> org </ mi> </ msubsup> <mo> & times; </ mo> <msub> <mi> w </ mi> <mi> i </ mi> </ msub> <mo>) </ mo> </ mrow> </ mrow> <mrow> <mn> 2 </ mn> <mo> & times; </ mo> <munderover> <mi> & Sigma; </ mi> <mi> i </ mi> <mi> n </ mi> </ munderover> <msub> <mi> w </ mi> <mi> i </ mi> </ msub> </ mrow> </ mfrac> </ mrow>]]> </ math> </ maths> 子中,MViorg为该新视频帧中的相应块对应原始帧区域中第i个块的运动向量,wi为加权系数,加权系数用第i个块的面积来确定,n代表所包含原始块的总数; 3)如果当前16×16块对应的四个原始块均为16×16模式,首先分别计算左上右上,左下右下,左上左下和右上右下对应的每两个运动向量之间的距离d1: <maths id="math0002" num="0002" ><math><![CDATA[ <mrow> <msub> <mi>d</mi> <mn>1</mn> </msub> <mo>=</mo> <msqrt> <msup> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mn>1</mn> </msub> <mo>-</mo> <msub> <mi>x</mi> <mn>2</mn> </msub> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mo>+</mo> <msup> <mrow> <mo>(</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>-</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>)</mo> </mrow> <mn>2</mn> </msup> </msqrt> </mrow>]]></math></maths> 式子中,x1,x2,y1,y2分别为两个运动向量的横、纵坐标值; 如果得到的距离d1的最大值小于D16×16,则新块使用 Sub, the corresponding block MViorg for the new video frame the motion vector corresponding to the original frame region in the i-th block, wi is a weighting factor, the weighting coefficient is determined by the area of ​​the i-th block, n represents the original block contains Total; 3) if a current of 16 × 16 block corresponding to the original block are four 16 × 16 mode, calculate the first upper left upper right, lower left distance between the lower right, lower left and upper right lower right upper left corresponding to each of the two motion vectors d1:! <maths id = "math0002" num = "0002"> <math> <[CDATA [<mrow> <msub> <mi> d </ mi> <mn> 1 </ mn> </ msub> < mo> = </ mo> <msqrt> <msup> <mrow> <mo> (</ mo> <msub> <mi> x </ mi> <mn> 1 </ mn> </ msub> <mo> - </ mo> <msub> <mi> x </ mi> <mn> 2 </ mn> </ msub> <mo>) </ mo> </ mrow> <mn> 2 </ mn> </ msup> <mo> + </ mo> <msup> <mrow> <mo> (</ mo> <msub> <mi> y </ mi> <mn> 1 </ mn> </ msub> <mo> - </ mo> <msub> <mi> y </ mi> <mn> 2 </ mn> </ msub> <mo>) </ mo> </ mrow> <mn> 2 </ mn> </ msup> </ msqrt> </ mrow>]]> </ math> </ maths> formulas, x1, x2, y1, y2, respectively two lateral motion vectors, the ordinate value; obtained if the distance d1 it is smaller than the maximum value of D16 × 16, using the new block 16×16运动模式,对应的运动向量为四个运动向量的中间向量; 如果得到的距离d1的最大值大于D16×16,最小值小于D8×8,则d1的最小值小于D8×8的这两个运动向量对应的块使用16×8或8×16模式,对应的运动向量为这两个运动向量的平均值;同时,如果另外两个运动向量对应之间的距离小于D8×8,则这两个运动向量对应的块使用16×8或8×16模式,对应的运动向量为这两个运动向量的平均值;否则,两个对应的块使用8×8运动模式; 如果得到的距离d1的最大值大于D16×16,最小值大于D8×8,则使用步骤2)中的映射的运动模式和向量; D16×16和D8×8为常数; 4)如果四个原始块中有三个块为16×16模式,分别计算出3个16×16块对应的运动向量之间的距离d2: <maths id="math0003" num="0003" ><math><![CDATA[ <mrow> <msub> <mi>d</mi> <mn>2</mn> </msub> <mo>=</mo> <msqrt> <msup> <mrow> <mo>(</mo> <msub> <mi>x</mi> < 16 × 16 motion pattern, the motion vectors corresponding to four motion vectors of intermediate vector; obtained if the maximum distance d1 is larger than D16 × 16, D8 × 8 is smaller than the minimum value, the minimum value of d1 is smaller than this D8 × 8 two motion vectors corresponding to blocks of 16 × 8, or the use of 8 × 16 mode, the motion vector corresponding to the average of these two motion vectors; Meanwhile, if the distance between the two motion vectors corresponding further smaller than D8 × 8, the these two motion vectors corresponding to blocks of 16 × 8, or the use of 8 × 16 mode, the motion vector corresponding to the average of these two motion vectors; otherwise, two corresponding blocks of 8 × 8 motion pattern used; if the distance obtained d1 is greater than the maximum value of D16 × 16, the minimum value is larger than D8 × 8, step 2 using the motion vector and the mapping mode) in; D16 × 16 constant and D8 × 8; 4) If the original block has three four 16 × 16 mode block, calculates the distance d2 between the three motion vectors corresponding to 16 × 16 blocks: <maths id = "math0003" num = "0003"> <math> <[CDATA [<mrow>! <msub> <mi> d </ mi> <mn> 2 </ mn> </ msub> <mo> = </ mo> <msqrt> <msup> <mrow> <mo> (</ mo> <msub > <mi> x </ mi> < mn>1</mn> </msub> <mo>-</mo> <msub> <mi>x</mi> <mn>2</mn> </msub> <mo>)</mo> </mrow> <mn>2</mn> </msup> <mo>+</mo> <msup> <mrow> <mo>(</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>-</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>)</mo> </mrow> <mn>2</mn> </msup> </msqrt> </mrow>]]></math></maths> 式子中,x1,x2,y1,y2分别为两个运动向量的横、纵坐标值; 如果最大距离d2小于D16×16,则将16×16运动模式加入到备选模式中,对应的运动向量为3个运动向量的中间向量; 如果得到的距离d2的最大值大于D16×16,但存在相邻两块对应的运动向量之间距离d小于D8×8,则这两个运动向量对应的块使用16×8或8×16模式,对应的运动向量为这两个运动向量的平均值,另外两个块维持映射得到的运动模式不变,并将这种模式加入到备选模式中; 5)将步骤2)中映射得到的运动模式和运动向量加入到备选模式中,对该运动向量进行细化后,从上 mn> 1 </ mn> </ msub> <mo> - </ mo> <msub> <mi> x </ mi> <mn> 2 </ mn> </ msub> <mo>) </ mo> </ mrow> <mn> 2 </ mn> </ msup> <mo> + </ mo> <msup> <mrow> <mo> (</ mo> <msub> <mi> y </ mi> < mn> 1 </ mn> </ msub> <mo> - </ mo> <msub> <mi> y </ mi> <mn> 2 </ mn> </ msub> <mo>) </ mo> </ mrow> <mn> 2 </ mn> </ msup> </ msqrt> </ mrow>]]> </ math> </ maths> formulas, x1, x2, y1, y2 are two horizontal motion vector, the ordinate value; if less than the maximum distance d2 D16 × 16, 16 × 16 motion pattern will be added to the alternate mode, the motion vector corresponding to the motion vectors for the three intermediate vector; obtained if the distance d2 is greater than the maximum value of D16 × 16, but two motion vectors exists between adjacent d is smaller than the corresponding distance D8 × 8, then the two motion vectors corresponding to blocks of 16 × 8, or the use of 8 × 16 mode, the motion vector corresponding to is the average of these two motion vectors, two additional blocks obtained by mapping to maintain constant motion pattern, and this pattern is added to the alternate mode; 5) motion mode in step 2) and the motion vector obtained through mapping was added to an alternate mode, the refinement of the motion vector, from the 备选模式中选择出最佳模式。 Alternatively mode select the best mode.
2、如权利要求l所述的方法,其特征在于,所述步骤5)从备选模式中选择出最佳模式采用H.264编码中的基于Lagrangian优化算法的率失真优化技术(Rate-DistortionOptimization),其中入按下式计算:h0.85x2,12)/2QP为.H.264的量化参数,该新块QP的值不小于之前对应块的QP值。 2. The method of claim l, wherein said step 5) alternate mode selected from the best mode uses Lagrangian rate-distortion optimization technique is based on optimization algorithm H.264 coding (Rate-DistortionOptimization ), wherein the following formula: h0.85x2,12) / 2QP .H.264 the quantization parameter, QP values ​​corresponding to the new value of the block before the block is not smaller than QP.
CN 200810103682 2008-04-10 2008-04-10 Mode selection method for transcoding 264 video to reduce resolving capability CN100586185C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810103682 CN100586185C (en) 2008-04-10 2008-04-10 Mode selection method for transcoding 264 video to reduce resolving capability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810103682 CN100586185C (en) 2008-04-10 2008-04-10 Mode selection method for transcoding 264 video to reduce resolving capability

Publications (2)

Publication Number Publication Date
CN101272496A CN101272496A (en) 2008-09-24
CN100586185C true CN100586185C (en) 2010-01-27

Family

ID=40006142

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810103682 CN100586185C (en) 2008-04-10 2008-04-10 Mode selection method for transcoding 264 video to reduce resolving capability

Country Status (1)

Country Link
CN (1) CN100586185C (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101715124B (en) 2008-10-07 2013-05-08 镇江唐桥微电子有限公司 Single-input and multi-output video encoding system and video encoding method
CN101909211B (en) 2010-01-04 2012-05-23 西安电子科技大学 H.264/AVC high-efficiency transcoder based on fast mode judgment
CN105898308A (en) * 2015-12-18 2016-08-24 乐视云计算有限公司 Resolution-variable coding mode prediction method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585495A (en) 2004-06-11 2005-02-23 上海大学 Quick selection of prediction modes in H.264/AVC frame
EP1575301A2 (en) 2004-03-12 2005-09-14 Daeyang Foundation V ideo transcoding method and apparatus
EP1628484A1 (en) 2004-08-18 2006-02-22 STMicroelectronics S.r.l. Method for transcoding compressed video signals, related apparatus and computer program product therefor
CN101026756A (en) 2007-03-23 2007-08-29 武汉大学 Video transcoding inter-frame mode fast selecting method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1575301A2 (en) 2004-03-12 2005-09-14 Daeyang Foundation V ideo transcoding method and apparatus
CN1585495A (en) 2004-06-11 2005-02-23 上海大学 Quick selection of prediction modes in H.264/AVC frame
EP1628484A1 (en) 2004-08-18 2006-02-22 STMicroelectronics S.r.l. Method for transcoding compressed video signals, related apparatus and computer program product therefor
CN101026756A (en) 2007-03-23 2007-08-29 武汉大学 Video transcoding inter-frame mode fast selecting method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
视频转码中的运动重估计技术. 王辅中,戴琼海,丁嵘.有线电视技术,第Vol.11卷第No.18期. 2004

Also Published As

Publication number Publication date
CN101272496A (en) 2008-09-24

Similar Documents

Publication Publication Date Title
RU2559740C2 (en) Method and apparatus for encoding/decoding motion vector
CN101263718B (en) Integrated digital transcoding
CN1225127C (en) A coding/decoding end bothway prediction method for video coding
CN100579224C (en) Method and apparatus for lossless video encoding and decoding
CN100394447C (en) Improved optimizing technology for data compression
CN101496409B (en) Method and deice for adaptive video frame interpolation
CN101682781B (en) Image encoding method and image decoding method
CN101204094B (en) Method for scalably encoding and decoding video signal
CN100417218C (en) Method and apparatus for variable accuracy inter-picture timing specification for digital video encoding with reduced requirements for division operations
CN102301710B (en) Multiple bit rate video encoding using variable bit rate and dynamic resolution for adaptive video streaming
CN101189884B (en) Method and apparatus of temporal error concealment for p-frame
CN1981535B (en) Method and apparatus for weighted prediction in predictive frames
CN1220391C (en) Image encoder, image decoder, image encoding method, and image decoding method
CN100452883C (en) Skip macroblock coding
CN1214647C (en) Method for encoding images, and image coder
DE602004008763T2 (en) Video trans coding
CN100399829C (en) Video transcoding method and apparatus and motion vector interpolation method
CN101352046B (en) Image encoding/decoding method and apparatus
CN1257614C (en) Signal encoding method and apparatus and decoding method and apparatus
CN100348051C (en) An enhanced in-frame predictive mode coding method
CN101448162B (en) Method for processing video image
CN100568976C (en) Method and device for intra prediction coding and decoding of image
CN101379816B (en) Temporal error concealment for bi-directionally predicted frames
CN100461867C (en) Inage predicting encoding method in frame
CN101860754B (en) Method and device for coding and decoding motion vector

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C14 Granted