CN104104948A - Video transcoding method and video transcoder - Google Patents
Video transcoding method and video transcoder Download PDFInfo
- Publication number
- CN104104948A CN104104948A CN201310129950.XA CN201310129950A CN104104948A CN 104104948 A CN104104948 A CN 104104948A CN 201310129950 A CN201310129950 A CN 201310129950A CN 104104948 A CN104104948 A CN 104104948A
- Authority
- CN
- China
- Prior art keywords
- block size
- encoding
- video
- decoding standard
- prediction direction
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 60
- 239000000872 buffer Substances 0.000 claims description 24
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 abstract description 17
- 238000013507 mapping Methods 0.000 description 12
- 238000010586 diagram Methods 0.000 description 9
- 238000012545 processing Methods 0.000 description 8
- 238000004364 calculation method Methods 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 239000013589 supplement Substances 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000008859 change Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 238000005215 recombination Methods 0.000 description 1
- 230000006798 recombination Effects 0.000 description 1
Landscapes
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本发明公开了一种视频转码方法以及视频转码器。所述视频转码方法包括:对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;获取各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式;根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;根据所确定的符合第二视频解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。
The invention discloses a video transcoding method and a video transcoding device. The video transcoding method includes: decoding a video stream containing multiple frames of images that conforms to the first video codec standard to generate decoded data; acquiring the coded block size and Prediction mode; according to the encoding block size and prediction mode of the video codec under the first video codec standard, determine its encoding block size and prediction mode in the encoding process conforming to the second video codec standard; according to the determined The coded block size and prediction mode conforming to the second video decoding standard encode the decoded data into a video stream conforming to the second video encoding and decoding standard.
Description
技术领域technical field
本发明涉及视频转码方法和视频转码器,特别涉及从一种视频编解码信号到另一种视频编解码信号的视频转码。The invention relates to a video transcoding method and a video transcoder, in particular to video transcoding from one video codec signal to another video codec signal.
背景技术Background technique
数字视频技术广泛应用于通信、计算机、广播电视等领域,带来了会议电视、可视电话及数字电视、媒体存储等一系列应用,促使了许多视频编解码标准的产生,例如H.261、H.262、H.263、H.264以及HEVC等。Digital video technology is widely used in communications, computers, radio and television, etc., bringing a series of applications such as conference TV, videophone, digital TV, and media storage, and has prompted the emergence of many video codec standards, such as H.261, H.262, H.263, H.264, HEVC, etc.
每当新的视频编解码标准被发布,工业界都会基于该视频编解码标准生产出新的产品以满足更好的满足用户的需求。自H.261于1990年公布至今的20多年间,H.262、H.263、H.264以及HEVC等被陆续公布。虽然适应于上述标准的视频编解码设备的更新换代相当迅速,但是通常在某个时间段,市场上会存在使用不同视频编解码标准的设备。Whenever a new video codec standard is released, the industry will produce new products based on the video codec standard to better meet user needs. In the more than 20 years since H.261 was released in 1990, H.262, H.263, H.264, and HEVC have been released successively. Although video codec devices adapted to the above-mentioned standards are updated quite rapidly, there are usually devices using different video codec standards on the market within a certain period of time.
并且随着技术的不断进步,各种视频编解码标准也在不断地提高着视频图像数据的压缩率、清晰度等参数,但同时也带来了编解码过程中的计算量的大幅度提高。因此,需要一种不同视频编解码标准之间的视频转码方法以及转码装置,以便使现有的视频编解码设备具有更长的使用时间,并且能够减少直接利用新的视频编解码标准视频数据进行编码的计算量。And with the continuous advancement of technology, various video codec standards are also continuously improving parameters such as the compression rate and definition of video image data, but at the same time, it also brings a significant increase in the amount of calculation in the process of encoding and decoding. Therefore, there is a need for a video transcoding method and a transcoding device between different video codec standards, so that the existing video codec equipment has a longer service time, and can reduce the number of video codecs directly using new video codec standards. The amount of computation required to encode the data.
发明内容Contents of the invention
本发明的实施例提供了一种高效的视频转码方法以及装置,用于将一种视频编码格式(下文称为第一视频编码格式)的视频数据转换成另一种视频编码格式(下文称为第二视频编码格式),其中,可以利用第一视频编码格式中现有的编解码信息,从而减小第二视频编码格式编解码的计算量。Embodiments of the present invention provide an efficient video transcoding method and device for converting video data in one video encoding format (hereinafter referred to as the first video encoding format) into another video encoding format (hereinafter referred to as the first video encoding format) is the second video encoding format), where the existing codec information in the first video encoding format can be used, thereby reducing the amount of calculation for encoding and decoding the second video encoding format.
在下文中给出关于本发明的简要概述,以便提供关于本发明的某些方面的基本理解。应当理解,这个概述并不是关于本发明的穷举性概述。它并不是意图确定本发明的关键或重要部分,也不是意图限定本发明的范围。其目的仅仅是以简化的形式给出某些概念,以此作为稍后论述的更详细描述的前序。A brief overview of the invention is given below in order to provide a basic understanding of some aspects of the invention. It should be understood that this summary is not an exhaustive overview of the invention. It is not intended to identify key or critical parts of the invention nor to delineate the scope of the invention. Its purpose is merely to present some concepts in a simplified form as a prelude to the more detailed description that is discussed later.
根据本发明的一个方面,公开了一种视频转码方法,包括:对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;确定各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式;根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;根据所确定的符合第二视频编解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。According to one aspect of the present invention, a video transcoding method is disclosed, including: decoding a video code stream that conforms to the first video codec standard containing multiple frames of images to generate decoded data; The coding block size and prediction mode of a video codec standard; according to the coding block size and prediction mode of the video codec under the first video codec standard, it is determined that it conforms to the coding process of the second video codec standard encoding block size and prediction mode; encoding the decoded data into a video code stream conforming to the second video encoding and decoding standard according to the determined encoding block size and predicting mode conforming to the second video encoding and decoding standard.
根据本发明的另一个方面,公开了一种视频转码器,包括,第一视频编解码标准解码单元,用于对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;缓存器,用于确定各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式,并存储于其中;参数信息转换单元,用于根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;第二视频编解码标准编码单元,用于根据所确定的符合第二视频编解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。According to another aspect of the present invention, a video transcoder is disclosed, including a first video codec standard decoding unit, configured to decode a video stream containing multiple frames of images that conforms to the first video codec standard, Generate decoded data; buffer, used to determine the encoding block size and prediction mode in each frame of image conforming to the first video codec standard, and store in it; parameter information conversion unit, used for according to the video codec in the The encoding block size and prediction mode under the first video codec standard are used to determine the encoding block size and prediction mode in the encoding process conforming to the second video codec standard; the second video codec standard coding unit is used to determine according to the determined The coded block size and prediction mode conforming to the second video codec standard encode the decoded data into a video code stream conforming to the second video codec standard.
附图说明Description of drawings
参照下面结合附图对本发明实施例的说明,会更加容易地理解本发明的以上和其它目的、特点和优点。The above and other objects, features and advantages of the present invention will be more easily understood with reference to the following description of the embodiments of the present invention in conjunction with the accompanying drawings.
图1示出了根据本发明的视频转码方法的示意性流程图;Fig. 1 shows the schematic flowchart of the video transcoding method according to the present invention;
图2示出了根据本发明的视频转码器200的示意性结构图;FIG. 2 shows a schematic structural diagram of a video transcoder 200 according to the present invention;
图3示出了H.264视频编解码标准中的宏块的不同编码块尺寸;Figure 3 shows different coded block sizes of macroblocks in the H.264 video codec standard;
图4示出了H.264视频编解码标准中的尺寸为16x16的编码块的预测模式;Fig. 4 shows the prediction mode of a coded block whose size is 16x16 in the H.264 video codec standard;
图5示出了H.264视频编解码标准中的尺寸为8x8和4x4的编码块的预测模式;Fig. 5 shows the prediction modes of coding blocks whose sizes are 8x8 and 4x4 in the H.264 video codec standard;
图6示出了HEVC视频编解码标准中的编码树单元(CTU)和编码单元(CU)的关系;Figure 6 shows the relationship between the Coding Tree Unit (CTU) and the Coding Unit (CU) in the HEVC video codec standard;
图7示出了HEVC视频编解码标准中的尺寸为8x8,16x16以及32x32的编码单元的预测方向;FIG. 7 shows prediction directions of coding units with sizes 8x8, 16x16 and 32x32 in the HEVC video codec standard;
图8示出了根据本发明的一个实施例的视频转码器的示意性结构图;Fig. 8 shows a schematic structural diagram of a video transcoder according to an embodiment of the present invention;
图9示出了根据本发明的一个实施例的视频转码方法的示意性流程图;FIG. 9 shows a schematic flowchart of a video transcoding method according to an embodiment of the present invention;
图10a示出了当前编码块尺寸为16x16的相邻编码块的位置关系图;Figure 10a shows a positional relationship diagram of adjacent coding blocks whose current coding block size is 16x16;
图10b示出了当前编码单元尺寸为32x32的相邻编码块的位置关系图;Figure 10b shows a positional relationship diagram of adjacent coding blocks with a current coding unit size of 32x32;
图11示出了应用在视频监控领域中的视频转码器的示意性结构图;FIG. 11 shows a schematic structural diagram of a video transcoder applied in the field of video surveillance;
图12示出了可用于实施根据本公开的实施例的计算机的示意性结构图。FIG. 12 shows a schematic structural diagram of a computer that can be used to implement an embodiment of the present disclosure.
具体实施方式Detailed ways
现有的视频编解码标准,例如H.261、H.262、H.263、H.264以及HEVC等,均采用编码块作为操作单位对视频图像进行编码,并采用预测模式等参数实现对视频图像的编解码。本发明的实施例提供了用于将一种视频编解码标准的视频数据转换成另一种视频编解码标准的视频转码方法以及装置。Existing video codec standards, such as H.261, H.262, H.263, H.264, and HEVC, all use coding blocks as operation units to encode video images, and use parameters such as prediction modes to achieve video Image codec. Embodiments of the present invention provide a video transcoding method and device for converting video data of one video codec standard into another video codec standard.
图1示出了根据本发明的视频转码方法的示意性流程图。Fig. 1 shows a schematic flowchart of a video transcoding method according to the present invention.
首先,在步骤S101中,对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;在步骤S102中,获取各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式;在步骤S103中,根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;最后,在步骤S104中,根据步骤S103中所确定的符合第二视频解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。First, in step S101, decode the video code stream that complies with the first video codec standard including multiple frames of images to generate decoded data; Coding block size and prediction mode; in step S103, according to the coding block size and prediction mode of the video codec under the first video codec standard, it is determined that it is encoded in the coding process conforming to the second video codec standard block size and prediction mode; finally, in step S104, according to the coding block size and prediction mode determined in step S103 in compliance with the second video decoding standard, the decoded data is encoded as a video code conforming to the second video codec standard flow.
上述第一和第二视频编解码标准种的预测模式可以用预测方向来表示,上述步骤S103可以进一步包括,对于各个图像帧中的符合第一视频编解码标准中的非最大编码块尺寸的块,将该编码块尺寸直接作为符合第二视频编解码标准的编码块尺寸,并选择与符合第一视频编解码标准的预测方向相同或相邻的预测方向作为符合第二视频编解码标准的备选预测方向。对于各个帧中的具有第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取第一视频编解码标准中对应于最大编码块尺寸的全部预测方向作为符合第二视频编解码标准的编码时的备选预测方向;如否,则提取其编码块尺寸和预测方向直接作为符合第二视频编解码标准的编码块尺寸和预测方向。The prediction modes of the above-mentioned first and second video codec standards may be represented by prediction directions, and the above-mentioned step S103 may further include, for blocks in each image frame that conform to the non-maximum coded block size in the first video codec standard , directly use the coding block size as the coding block size conforming to the second video codec standard, and select the prediction direction that is the same as or adjacent to the prediction direction conforming to the first video codec standard as a candidate for conforming to the second video codec standard Choose the forecast direction. For a block with the largest coding block size in the first video codec standard in each frame, determine whether its neighboring blocks with the same coding block size have the same prediction direction, and if so, merge the block with its neighboring blocks , extract the combined coded block size as the coded block size conforming to the second video codec standard, and extract all the prediction directions corresponding to the largest coded block size in the first video codec standard as the codec conforming to the second video codec standard If not, extract the coding block size and prediction direction directly as the coding block size and prediction direction conforming to the second video codec standard.
并且,如果上述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸,则判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块再次合并,将再次合并后的编码块尺寸作为第二视频编解码标准的编码块尺寸,并将第二视频编解码标准中对应于再次合并后的编码块尺寸的全部预测方向作为再次合并后的块的预测方向;如否,则将其编码块尺寸和预测模式直接作为第二视频编解码标准的编码块尺寸和预测方向。And, if the coded block size after the above-mentioned merging is smaller than the maximum coded block size allowed by the second video codec standard, it is judged whether the adjacent blocks having the same coded block size have the same prediction direction, and if so, the block Merge with its adjacent blocks again, use the coded block size after re-combination as the coded block size of the second video codec standard, and use all prediction directions corresponding to the coded block size after re-combined in the second video codec standard as The prediction direction of the combined block again; if not, its coding block size and prediction mode are directly used as the coding block size and prediction direction of the second video codec standard.
在从第一视频编解码标准到第二视频编解码标准的转码过程中,由于视频图像各帧中的背景区域相对于前景区域的变化较小,因此对于背景区域中的编码块,可以采取更简便的转换步骤。可以比较相邻两帧中相同位置的块的编码块尺寸与预测模式,如果均相同,则可以判定该块处于背景区域中。In the process of transcoding from the first video codec standard to the second video codec standard, since the change of the background area in each frame of the video image relative to the foreground area is small, for the coded blocks in the background area, you can take Easier conversion steps. The coded block sizes and prediction modes of blocks at the same position in two adjacent frames can be compared, and if they are the same, it can be determined that the block is in the background area.
在识别出各帧中的背景区域后,对于背景区域中的具有第一视频编解码标准中的非最大编码块尺寸的块,将其编码块尺寸直接作为第二视频编解码标准的编码块尺寸,选择与其预测方向相同的预测方向作为其在第二视频编解码标准中的预测方向。对于背景区域中的具有符合第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取所述相同的预测方向作为第二视频编解码标准中的预测方向;如否,则提取其编码块尺寸和预测方向直接作为第二视频编解码标准的编码块尺寸和预测方向。After identifying the background area in each frame, for a block in the background area that has a non-maximum coding block size in the first video codec standard, its coding block size is directly used as the coding block size of the second video codec standard , select the same prediction direction as its prediction direction in the second video codec standard. For a block in the background area that conforms to the largest coding block size in the first video codec standard, judge whether its adjacent blocks with the same coding block size have the same prediction direction, and if so, then the block and its neighboring blocks Merging, extracting the combined coding block size as the coding block size conforming to the second video codec standard, and extracting the same prediction direction as the prediction direction in the second video codec standard; if not, extracting its coding block The size and prediction direction are directly used as the coding block size and prediction direction of the second video codec standard.
如果上述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸,则判断与其具有相同编码块尺寸的相邻块是否具有相同的预测模式,如是,则将该块与其相邻块合并,将再次合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并将所述相同的预测模式作为符合第二视频编解码标准的预测模式;如否,则将其编码块尺寸和预测模式直接作为符合第二视频编解码标准的编码块尺寸和预测模式。If the coded block size after the above merging is smaller than the maximum coded block size allowed by the second video codec standard, it is judged whether the adjacent block having the same coded block size has the same prediction mode, and if so, the block is compared with it Adjacent blocks are merged, and the coded block size after re-merging is used as the coded block size conforming to the second video codec standard, and the same prediction mode is used as the prediction mode conforming to the second video codec standard; if not, then the The coding block size and prediction mode are directly used as the coding block size and prediction mode conforming to the second video codec standard.
并且由于背景区域在各帧中的变化较小,因此对于背景区域中的块,所确定的符合第二视频编解码标准的编码块尺寸和预测方向可以在不同的帧中被重复使用。And because the background area changes little in each frame, for the blocks in the background area, the determined coding block size and prediction direction conforming to the second video codec standard can be reused in different frames.
图2示出了根据本发明的视频转码器200的示意性结构图。FIG. 2 shows a schematic structural diagram of a video transcoder 200 according to the present invention.
解码器200包括第一视频编解码标准解码单元201,用于对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;缓存器202,用于获取各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式,并存储在其中;参数信息转换单元203,用于根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;以及第二视频编解码标准编码单元204,用于根据所确定的符合第二视频编解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。The decoder 200 includes a first video codec standard decoding unit 201, which is used to decode a video code stream that conforms to the first video codec standard containing multiple frames of images, and generates decoded data; a buffer 202, used to obtain each frame of image The encoding block size and prediction mode conforming to the first video codec standard in the first video codec standard and stored therein; the parameter information conversion unit 203 is used for encoding block size and the first video codec standard according to the video codec The prediction mode is used to determine the encoding block size and the prediction mode in the encoding process conforming to the second video codec standard; The block size and prediction mode encode the decoded data into the video code stream conforming to the second video codec standard.
其中,参数信息转换单元203被进一步配置为对于各个帧中的符合第一视频编解码标准中的非最大编码块尺寸的块,将该编码块尺寸直接作为符合第二视频编解码标准的编码块尺寸,并选择与符合第一视频编解码标准的预测方向相同或相邻的预测方向作为符合第二视频编解码标准的备选预测方向;对于各个帧中的具有第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取第一视频编解码标准中对应于最大编码块尺寸的全部预测方向作为符合第二视频编解码标准的编码时的备选预测方向;如否,则提取其编码块尺寸和预测方向直接作为符合第二视频编解码标准的编码块尺寸和预测方向。Wherein, the parameter information converting unit 203 is further configured to, for a block conforming to a non-maximum encoding block size in the first video encoding and decoding standard in each frame, directly use the encoding block size as an encoding block conforming to the second video encoding and decoding standard Size, and select the prediction direction that is the same as or adjacent to the prediction direction that conforms to the first video codec standard as the candidate prediction direction that conforms to the second video codec standard; For the block with the largest coded block size, it is judged whether its adjacent blocks with the same coded block size have the same prediction direction, if so, the block is merged with its adjacent blocks, and the coded block size after the merger is extracted as a code that meets the second video codec size. Decode the coding block size of the standard, and extract all the prediction directions corresponding to the largest coding block size in the first video codec standard as the alternative prediction direction during coding that conforms to the second video codec standard; if not, extract its coding The block size and prediction direction are directly used as the coding block size and prediction direction conforming to the second video codec standard.
以及,在所述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸的情况下,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块再次合并,将再次合并后的编码块尺寸作为第二视频编解码标准的编码块尺寸,并将第二视频编解码标准中对应于所述再次合并后的编码块尺寸的全部预测方向作为再次合并后的块的预测方向;如否,则将其编码块尺寸和预测模式直接作为第二视频编解码标准的编码块尺寸和预测方向。And, in the case that the combined coding block size is smaller than the maximum coding block size allowed by the second video codec standard, it is judged whether the adjacent blocks having the same coding block size have the same prediction direction, if so, then The block and its adjacent blocks are merged again, and the size of the coded block after the merger is used as the coded block size of the second video codec standard, and the size of the coded block corresponding to the coded block after the merger is used in the second video codec standard All the prediction directions of the blocks are used as the prediction directions of the re-merged block; if not, the coding block size and prediction mode are directly used as the coding block size and prediction direction of the second video codec standard.
转码器200进一步包括背景区域确定单元(未示出),其用于识别各帧中的背景区域。对于各帧中的背景区域,参数信息转换单元203被配置为,对于背景区域中的具有第一视频编解码标准中的非最大编码块尺寸的块,将其编码块尺寸直接作为第二视频编解码标准的编码块尺寸,选择与其预测方向相同的预测方向作为其在第二视频编解码标准中的预测方向;对于背景区域中的具有符合第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取所述相同的预测方向作为第二视频编解码标准中的预测方向;如否,则提取其编码块尺寸和预测方向直接作为第二视频编解码标准的编码块尺寸和预测方向。The transcoder 200 further includes a background area determining unit (not shown) for identifying a background area in each frame. For the background area in each frame, the parameter information conversion unit 203 is configured to, for a block in the background area with a non-maximum encoding block size in the first video encoding and decoding standard, directly use its encoding block size as the second video encoding and decoding standard. The coded block size of the decoding standard, choose the same prediction direction as its prediction direction in the second video codec standard; for the block in the background area with the largest coded block size in the first video codec standard , to determine whether the adjacent blocks with the same coding block size have the same prediction direction, if so, merge the block with its adjacent blocks, and extract the combined coding block size as the coding block size conforming to the second video codec standard , and extract the same prediction direction as the prediction direction in the second video codec standard; if not, extract its coding block size and prediction direction directly as the coding block size and prediction direction of the second video codec standard.
以及,在上述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸的情况下,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测模式,如是,则将该块与其相邻块再次合并,将再次合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并将所述相同的预测模式作为符合第二视频编解码标准的预测模式;如否,则将其编码块尺寸和预测模式直接作为符合第二视频编解码标准的编码块尺寸和预测模式。And, in the case that the combined coding block size is smaller than the maximum coding block size allowed by the second video codec standard, it is judged whether the adjacent blocks having the same coding block size have the same prediction mode, and if so, the The block and its adjacent blocks are merged again, and the re-merged coded block size is used as the coded block size conforming to the second video codec standard, and the same prediction mode is used as the prediction mode conforming to the second video codec standard; If not, the coding block size and prediction mode are directly used as the coding block size and prediction mode conforming to the second video codec standard.
转码器200中还可以包括背景区域参数缓存器(未示出),其中可以存储转换后的符合第二视频编解码标准的编码块尺寸和预测方向,以便在不同的帧中被重复使用,从而使背景区域中的块不必在每帧中都进行转换。The transcoder 200 may also include a background area parameter buffer (not shown), in which the converted coding block size and prediction direction conforming to the second video codec standard may be stored, so as to be reused in different frames, This frees the blocks in the background area from having to be transformed every frame.
下文中,为了更清楚的描述本发明的方法以及装置,将以H.264和HEVC这两种视频编解码标准之间的转码为例来进行说明。应理解,本发明的实施例并不局限于这两种视频编码标准之间的视频转码,而是还可应用于其他基于编码块的视频编码标准之间的转码。In the following, in order to describe the method and device of the present invention more clearly, the transcoding between two video codec standards, H.264 and HEVC, will be taken as an example for illustration. It should be understood that the embodiments of the present invention are not limited to video transcoding between these two video coding standards, but can also be applied to transcoding between other coding block-based video coding standards.
在H.264中,基本处理单元为宏块,最大尺寸为16x16。其中,采用编码块尺寸和预测模式(即预测方向)两个参数来表征一个宏块的编码模式。H.264的一个宏块,具有三种可选的编码块尺寸,分别为16x16、8x8(一个宏块被分成四个编码块)和4x4(一个宏块分成16个编码块)。图3表示了H.264中宏块的各种不同尺寸的编码块。对于不同的编码块尺寸有不同的预测模式,其中,尺寸为16x16的编码块具有4种预测模式,如图4所示,尺寸为8x8和4x4的编码块具有8种预测模式,如图5所示。In H.264, the basic processing unit is a macroblock with a maximum size of 16x16. Wherein, two parameters of coding block size and prediction mode (ie, prediction direction) are used to characterize the coding mode of a macroblock. A macroblock of H.264 has three optional coding block sizes, namely 16x16, 8x8 (one macroblock is divided into four coding blocks) and 4x4 (one macroblock is divided into 16 coding blocks). Fig. 3 shows coding blocks of various sizes of macroblocks in H.264. There are different prediction modes for different coding block sizes. Among them, a coding block with a size of 16x16 has 4 prediction modes, as shown in Figure 4, and a coding block with a size of 8x8 and 4x4 has 8 prediction modes, as shown in Figure 5 Show.
HEVC中的基本处理单元为编码树单元,其最大可以达到64x64。编码树单元中包括具有不同尺寸的编码单元,所述HEVC中的编码单元即相当于H.264中的编码块。编码单元的尺寸可以为64x64,32x32,16x16,8x8,4x4。图6中示出的编码树单元的尺寸为32x32,编码单元0、15的尺寸为16x16,编码单元1-4、9、14的尺寸为8x8,编码单元5-8、10-13的尺寸为4x4。相对于H.264,HEVC的编码单元的预测模式也增加了很多,最多为34种,如图7所示。不同尺寸的编码单元所对应的预测方向的数量如表1所示。The basic processing unit in HEVC is the coding tree unit, which can reach a maximum of 64x64. Coding tree units include coding units with different sizes, and the coding units in HEVC are equivalent to coding blocks in H.264. The size of the coding unit can be 64x64, 32x32, 16x16, 8x8, 4x4. The coding tree units shown in Fig. 6 are of size 32x32, coding units 0, 15 are of size 16x16, coding units 1-4, 9, 14 are of size 8x8, coding units 5-8, 10-13 are of size 4x4. Compared with H.264, HEVC coding unit prediction modes have also increased a lot, up to 34, as shown in Figure 7. Table 1 shows the number of prediction directions corresponding to coding units of different sizes.
表1Table 1
由此可见,HEVC相对于H.264,所允许的编码单元(编码块)尺寸更大,不同尺寸的编码单元的种类更多,所对应的预测方向也更多。因此,HEVC编解码过程也需要比H.264编解码过程更多的计算量。但是,如果将H.264中现有的编码块尺寸信息和预测方向信息转换为HEVC中的编码单元尺寸信息以及预测方向信息,即H.264到HEVC的视频转码,相对于直接利用HEVC对视频信号进行编解码,计算量能够大幅度的减少。It can be seen that, compared with H.264, HEVC allows a larger coding unit (coding block) size, more types of coding units of different sizes, and more corresponding prediction directions. Therefore, the HEVC encoding and decoding process also requires more calculation than the H.264 encoding and decoding process. However, if the existing coding block size information and prediction direction information in H.264 are converted into coding unit size information and prediction direction information in HEVC, that is, video transcoding from H.264 to HEVC, compared to directly using HEVC for The video signal is encoded and decoded, and the amount of calculation can be greatly reduced.
图8示出了根据本发明的一个实施例的视频转码器800的示意性结构图。所述视频转码器800包括H.264解码单元801、缓存器802、特征信息转换单元803、HEVC编码单元804,其中,特征信息转换单元803还包括编码单元尺寸映射模块8031和预测模式选择模块8032。FIG. 8 shows a schematic structural diagram of a video transcoder 800 according to an embodiment of the present invention. The video transcoder 800 includes an H.264 decoding unit 801, a buffer 802, a feature information conversion unit 803, and an HEVC encoding unit 804, wherein the feature information conversion unit 803 also includes a coding unit size mapping module 8031 and a prediction mode selection module 8032.
视频编码器800工作时,H.264视频码流被输入到H.264解码单元801进行解码以获得解码数据,缓存器802获取并缓存解码数据中的H.264的编码块尺寸信息和预测模式信息。特征信息转换单元803中的编码单元尺寸映射模块8031和预测模式选择模块8032分别将H.264的编码块尺寸信息和预测模式信息转换为HEVC中的编码单元尺寸信息和预测模式信息。HEVC编码单元利用上述转换后的HEVC的编码单元尺寸信息和预测模式信息对解码数据进行编码,从而得到HEVC视频编解码标准的视频码流。When the video encoder 800 is working, the H.264 video stream is input to the H.264 decoding unit 801 for decoding to obtain decoded data, and the buffer 802 acquires and caches the H.264 encoding block size information and prediction mode in the decoded data information. The coding unit size mapping module 8031 and the prediction mode selection module 8032 in the feature information converting unit 803 respectively convert the coding block size information and prediction mode information of H.264 into coding unit size information and prediction mode information in HEVC. The HEVC coding unit encodes the decoded data by using the converted HEVC coding unit size information and prediction mode information, so as to obtain a video stream of the HEVC video codec standard.
图9示出了根据本发明的一个实施例的视频转码方法的流程图。步骤S901中,首先对输入的H.264的视频码流进行解码;在步骤S902中,获取各帧中的各个宏块在H.264中的编码块尺寸和预测模式;在步骤S903中,将各帧中各个宏块在H.264中的编码块尺寸和预测模式转换为HEVC中的编码单元尺寸和预测模式,所述转换过程通过如下过程实现:Fig. 9 shows a flowchart of a video transcoding method according to an embodiment of the present invention. In step S901, firstly, the input video code stream of H.264 is decoded; in step S902, the encoding block size and prediction mode in H.264 of each macroblock in each frame are acquired; in step S903, the The coding block size and prediction mode of each macroblock in each frame in H.264 are converted to the coding unit size and prediction mode in HEVC, and the conversion process is realized through the following process:
(1)如果当前宏块在H.264中的编码块尺寸为4x4或8x8,则HEVC中相应位置处的编码单元的尺寸和H.264中的编码块尺寸一致,候选的预测模式通过表2进行映射;(1) If the coding block size of the current macroblock in H.264 is 4x4 or 8x8, then the size of the coding unit at the corresponding position in HEVC is consistent with the coding block size in H.264, and the candidate prediction modes are listed in Table 2 to map;
表2Table 2
(2)如果当前宏块在H.264中的编码块尺寸为16x16,则根据编码块尺寸为16x16的块的位置考察相邻的编码尺寸也为16x16的块。如图10a所示,如果当前宏块在位置B0,则检查B1-B3,如果当前宏块在位置B1,则检查B0、B2、B3,如果当前宏块在位置B2,则检查B0、B1、B3,如果当前宏块在位置B3,则检查B0-B2。如果B0-B3都是16x16块,且它们的预测模式一致,则这4个16x16块合并成为一个HEVC中的32x32的编码单元进行编码,否则仍按照16x16的尺寸分别将4个编码块转换为HEVC中的编码单元进行编码;(2) If the coding block size of the current macroblock in H.264 is 16x16, check the adjacent blocks with the coding size of 16x16 according to the position of the block with the coding block size of 16x16. As shown in Figure 10a, if the current macroblock is at position B0, then check B1-B3, if the current macroblock is at position B1, then check B0, B2, B3, if the current macroblock is at position B2, then check B0, B1, B3, if the current macroblock is at position B3, check B0-B2. If B0-B3 are all 16x16 blocks and their prediction modes are the same, the four 16x16 blocks are merged into one 32x32 coding unit in HEVC for encoding, otherwise the four coding blocks are still converted to HEVC according to the size of 16x16 The encoding unit in is encoded;
如果转换后的编码单元的尺寸为16x16,则编码单元的预测方向为各个编码块在H.264中的预测方向;如果转换后的编码单元的尺寸为32x32,则编码单元的候选预测模式为DC,planar,vertical和horizontal。If the size of the converted coding unit is 16x16, the prediction direction of the coding unit is the prediction direction of each coding block in H.264; if the size of the converted coding unit is 32x32, the candidate prediction mode of the coding unit is DC , planar, vertical and horizontal.
(3)如果转换后的编码单元的尺寸为32x32,且HEVC中最大的编码单元尺寸为64x64,则检查相邻位置的编码单元,如图10b所示。如果转换后的编码单元的位置在B0处,则检查B1-B3,如果转换后的编码单元的位置在B1处,则检查B0、B2、B3,如果转换后的编码单元的位置在B2处,则检查B0、B1、B3,如果转换后的编码单元的位置在B3处,则检查B0-B2。如果B0、B1、B2、B3均为尺寸为32x32的编码单元,且具有相同的预测方向,则将此4个转换后的32x32的编码单元合并成为一个64x64的编码单元,否则还是按照32x32的编码单元进行编码;(3) If the size of the converted CU is 32x32, and the largest CU size in HEVC is 64x64, check the CUs at adjacent positions, as shown in Figure 10b. If the position of the transformed coding unit is at B0, check B1-B3, if the position of the transformed coding unit is at B1, check B0, B2, B3, if the position of the transformed coding unit is at B2, Then check B0, B1, B3, if the position of the converted coding unit is at B3, then check B0-B2. If B0, B1, B2, and B3 are all 32x32 coding units and have the same prediction direction, then merge the four converted 32x32 coding units into a 64x64 coding unit, otherwise the 32x32 encoding is still used The unit is coded;
如果转换后的编码单元能够再次合并为64x64的编码单元,则再次合并的编码单元的候选预测模式为DC,planar,vertical和horizontal。If the converted CU can be merged into a 64x64 CU again, the candidate prediction modes of the re-merged CU are DC, planar, vertical and horizontal.
在步骤S904,使用上述转换为HEVC中的编码单元尺寸和预测方向对解码数据进行编码,从而输出HEVC视频编解码标准的视频码流。In step S904, encode the decoded data by using the CU size and prediction direction converted into HEVC, so as to output a video stream of the HEVC video codec standard.
H.264和HEVC视频编解码标准被广泛使用在视频监控领域,在视频监控领域中,视频图像的前景区域和背景区域具有显著的区别。背景区域通常包含较少的对用户有用的信息,并且在各帧中通常保持不变。所以一旦当前帧中背景区域被识别出,后续帧中的背景区域可以沿用当前帧中的背景区域。前景区域的图像中,包含了更多对用户有用的信息,因此,用户需要得到高质量的前景区域图像。H.264 and HEVC video codec standards are widely used in the field of video surveillance. In the field of video surveillance, there is a significant difference between the foreground area and the background area of a video image. Background regions usually contain less useful information for the user and usually remain unchanged across frames. So once the background area in the current frame is recognized, the background area in the subsequent frame can follow the background area in the current frame. The image of the foreground area contains more useful information for the user, therefore, the user needs to obtain a high-quality image of the foreground area.
由此可见,对视频监控领域中的视频图像中的前景和背景区域分别进行视频转码,有利于更高效的实现所述转码方法,并能进一步减少视频转码的计算量。下面结合图11来说明根据本发明的视频转码方法和视频转码器应用在视频监控领域中的实施例。It can be seen that performing video transcoding on the foreground and background regions of video images in the field of video surveillance is conducive to more efficient implementation of the transcoding method, and can further reduce the amount of calculation for video transcoding. An embodiment in which the video transcoding method and the video transcoder according to the present invention are applied in the field of video surveillance will be described below with reference to FIG. 11 .
图11为应用在视频监控领域中的视频转码器的示意性结构图。Fig. 11 is a schematic structural diagram of a video transcoder applied in the field of video surveillance.
其中,所述转码器1100中包括缓存器1102和1103、比较单元1104、减法器1105、前景区域预测模式选择/编码单元尺寸映射单元1106、背景区域预测模式选择/编码单元尺寸映射单元1107、背景参数缓存器1108、HEVC编码器1109。Wherein, the transcoder 1100 includes buffers 1102 and 1103, a comparison unit 1104, a subtractor 1105, a foreground area prediction mode selection/coding unit size mapping unit 1106, a background area prediction mode selection/coding unit size mapping unit 1107, Background parameter buffer 1108 , HEVC encoder 1109 .
转码器1100正常工作时,H.264解码器1101对H.264视频码流进行解码,并将解码数据传送至缓存器1102。缓存器1102存储其所接收的第一帧中的信息,即第一帧中的编码块尺寸信息和预测方向信息,并将第一帧直接作为前景区域进行处理,将该帧中的编码块尺寸信息和预测模式信息传送至前景区域预测模式选择/编码单元映射单元1106。当第二帧被解码后,缓存器1102中的数据被转移到缓存器1103中,同时,将第二帧中的编码块尺寸信息和预测模式信息存入已被清空的缓存器1102中。当缓存器1102和1103中都存储有数据时,比较单元1104比较两个缓存器中的数据,如果位于两个视频图像帧中同一位置处的两个宏块的编码块尺寸和预测模式均相同,则确定该宏块所在的区域属于背景区域。确定视频图像帧的背景区域后,通过减法器1105确定视频图像帧的前景区域。当第三帧解码完毕后,缓存器1102中的数据全部转移到缓存器1103中,同时,第三帧中的编码块尺寸信息和预测模式信息被写入缓存器1102,后续过程类似。When the transcoder 1100 works normally, the H.264 decoder 1101 decodes the H.264 video code stream, and transmits the decoded data to the buffer 1102 . Buffer 1102 stores the information in the first frame it receives, that is, the coding block size information and prediction direction information in the first frame, and directly processes the first frame as the foreground area, and the coding block size in the frame The information and prediction mode information are sent to the foreground region prediction mode selection/CU mapping unit 1106 . After the second frame is decoded, the data in the buffer 1102 is transferred to the buffer 1103 , and at the same time, the coded block size information and prediction mode information in the second frame are stored in the buffer 1102 which has been emptied. When data is stored in buffers 1102 and 1103, comparison unit 1104 compares the data in the two buffers, if the coded block sizes and prediction modes of the two macroblocks at the same position in the two video image frames are the same , it is determined that the area where the macroblock is located belongs to the background area. After the background area of the video image frame is determined, the foreground area of the video image frame is determined by the subtractor 1105 . After the decoding of the third frame is completed, all the data in the buffer 1102 is transferred to the buffer 1103, and at the same time, the coding block size information and prediction mode information in the third frame are written into the buffer 1102, and the subsequent process is similar.
在确定视频图像帧中的宏块属于前景区域或背景区域之后,通过前景区域预测模式选择/编码单元映射单元1106和背景区域预测模式选择/编码单元映射单元1107分别对前景区域和背景区域中的宏块的编码块尺寸和预测模式进行转换。After determining that the macroblock in the video image frame belongs to the foreground area or the background area, the foreground area and the background area are respectively selected by the foreground area prediction mode selection/coding unit mapping unit 1106 and the background area prediction mode selection/coding unit mapping unit 1107 The coded block size and prediction mode of the macroblock are converted.
在前景区域预测模式选择/编码单元映射单元1106中,对于前景区域中的宏块通过以下步骤进行转换:In the foreground area prediction mode selection/coding unit mapping unit 1106, the macroblocks in the foreground area are converted through the following steps:
(1)如果当前宏块在H.264中的编码尺寸为4x4或8x8,则HEVC中相应位置处的编码单元的尺寸和H.264中的编码块尺寸一致,候选的预测模式通过上述表2进行映射;(1) If the coding size of the current macroblock in H.264 is 4x4 or 8x8, then the size of the coding unit at the corresponding position in HEVC is consistent with the coding block size in H.264, and the candidate prediction mode is passed through the above table 2 to map;
(2)如果当前宏块在H.264中的编码尺寸为16x16,则根据编码块尺寸为16x16的块的位置考察相邻编码尺寸也为16x16的块。如图10a所示,如果当前宏块在位置B0,则检查B1-B3,如果当前宏块在位置B1,则检查B0、B2、B3,如果当前宏块在位置B2,则检查B0、B1、B3,如果当前宏块在位置B3,则检查B0-B2。如果B0-B3都是16x16块,且它们的预测模式一致,则这4个16x16块合并成为一个HEVC中的32x32的编码单元进行编码,否则仍按照16x16尺寸分别将4个编码块转换为HEVC中的编码单元进行编码;(2) If the encoding size of the current macroblock in H.264 is 16x16, check the adjacent blocks whose encoding size is also 16x16 according to the position of the block whose encoding block size is 16x16. As shown in Figure 10a, if the current macroblock is at position B0, then check B1-B3, if the current macroblock is at position B1, then check B0, B2, B3, if the current macroblock is at position B2, then check B0, B1, B3, if the current macroblock is at position B3, check B0-B2. If B0-B3 are all 16x16 blocks, and their prediction modes are the same, these 4 16x16 blocks are combined into a 32x32 coding unit in HEVC for encoding, otherwise the 4 coding blocks are still converted into HEVC according to the 16x16 size The encoding unit is encoded;
如果转换后的编码单元的尺寸为16x16,则编码单元的预测方向为各个编码块在H.264中的预测方向;如果转换后的编码单元的尺寸为32x32,编码单元的候选预测模式为DC,planar,vertical和horizontal。If the size of the converted coding unit is 16x16, the prediction direction of the coding unit is the prediction direction of each coding block in H.264; if the size of the converted coding unit is 32x32, the candidate prediction mode of the coding unit is DC, planar, vertical and horizontal.
(3)如果转换后的编码单元的尺寸为32x32,且HEVC中最大的编码单元尺寸为64x64,则检查相邻位置的编码单元,如图10b所示。如果转换后的编码单元的位置在B0处,则检查B1-B3,如果转换后的编码单元的位置在B1处,则检查B0、B2、B3,如果转换后的编码单元的位置在B2处,则检查B0、B1、B3,如果转换后的编码单元的位置在B3处,则检查B0-B2。如果B0、B1、B2、B3均为尺寸为32x32的编码单元,且具有相同的预测方向,则将此4个转换后的32x32的编码单元合并成为一个64x64的编码单元,否则还是按照32x32的编码单元进行编码;(3) If the size of the converted CU is 32x32, and the largest CU size in HEVC is 64x64, check the CUs at adjacent positions, as shown in Figure 10b. If the position of the transformed coding unit is at B0, check B1-B3, if the position of the transformed coding unit is at B1, check B0, B2, B3, if the position of the transformed coding unit is at B2, Then check B0, B1, B3, if the position of the converted coding unit is at B3, then check B0-B2. If B0, B1, B2, and B3 are all 32x32 coding units and have the same prediction direction, then merge the four converted 32x32 coding units into a 64x64 coding unit, otherwise the 32x32 encoding is still used The unit is coded;
如果转换后的编码单元能够再次合并为64x64的编码单元,则再次合并后的编码单元的候选预测模式为DC,planar,vertical和horizontal。If the converted CU can be merged into a 64x64 CU again, the candidate prediction modes of the re-merged CU are DC, planar, vertical and horizontal.
在背景区域预测模式选择/编码单元映射单元1107中,对于背景区域中的宏块通过以下步骤进行转换:In the background area prediction mode selection/coding unit mapping unit 1107, the macroblocks in the background area are converted through the following steps:
(1)如果当前宏块在H.264中的编码块尺寸为4x4或8x8,则HEVC中的相应位置处的编码单元的尺寸和H.264中的编码块尺寸一致,且预测方向与H.264中相应位置处的编码块的预测方向相同。(1) If the coding block size of the current macroblock in H.264 is 4x4 or 8x8, the size of the coding unit at the corresponding position in HEVC is consistent with the coding block size in H.264, and the prediction direction is the same as that of H. 264, the prediction direction of the coding block at the corresponding position is the same.
(2)如果当前宏块在H.264中的编码尺寸为16x16,则根据编码尺寸为16x16的块的位置考察相邻的编码尺寸也为16x16块。如图10a所示,如果当前宏块在位置B0,则检查B1-B3,如果当前宏块在位置B1,则检查B0、B2、B3,如果当前宏块在位置B2,则检查B0、B1、B3,如果当前宏块在位置B3,则检查B0-B2。如果B0-B3都是16x16的块,且它们的预测模式一致,则这4个16x16块合并成为一个HEVC中的32x32的编码单元进行编码,否则还是按照16x16尺寸分别将4个编码单元转换为HEVC中的编码单元进行编码。(2) If the coding size of the current macroblock in H.264 is 16x16, then according to the position of the block with the coding size of 16x16, the adjacent coding size is also 16x16 blocks. As shown in Figure 10a, if the current macroblock is at position B0, then check B1-B3, if the current macroblock is at position B1, then check B0, B2, B3, if the current macroblock is at position B2, then check B0, B1, B3, if the current macroblock is at position B3, check B0-B2. If B0-B3 are all 16x16 blocks and their prediction modes are the same, the four 16x16 blocks are merged into one 32x32 coding unit in HEVC for encoding, otherwise the four coding units are converted to HEVC according to the 16x16 size The coding unit in is encoded.
如果转换后的编码单元的尺寸为16x16,则编码单元的预测方向为各个编码块在H.264中的预测方向;如果转换后的编码单元的尺寸为32x32,则将上述4个16x16的编码块在H.264中的共同的预测方向作为转换后的HEVC中的32x32的编码单元的预测方向;If the size of the converted coding unit is 16x16, the prediction direction of the coding unit is the prediction direction of each coding block in H.264; if the size of the converted coding unit is 32x32, the above four 16x16 coding blocks The common prediction direction in H.264 is used as the prediction direction of the 32x32 coding unit in the converted HEVC;
(3)如果转换后的编码单元的尺寸为32x32,且HEVC中最大的编码单元尺寸为64x64,则检查相邻位置的编码单元,如图10b所示。如果转换后的编码单元的位置在B0处,则检查B1-B3,如果转换后的编码单元的位置在B1处,则检查B0、B2、B3,如果转换后的编码单元的位置在B2处,则检查B0、B1、B3,如果转换后的编码单元的位置在B3处,则检查B0-B2。如果B0、B1、B2、B3均为尺寸为32x32的编码单元,且具有相同的预测方向,则将此4个转换后的32x32的编码单元合并成为一个64x64的编码单元,否则还是按照32x32的编码单元进行编码;(3) If the size of the converted CU is 32x32, and the largest CU size in HEVC is 64x64, check the CUs at adjacent positions, as shown in Figure 10b. If the position of the transformed coding unit is at B0, check B1-B3, if the position of the transformed coding unit is at B1, check B0, B2, B3, if the position of the transformed coding unit is at B2, Then check B0, B1, B3, if the position of the converted coding unit is at B3, then check B0-B2. If B0, B1, B2, and B3 are all 32x32 coding units and have the same prediction direction, then merge the four converted 32x32 coding units into a 64x64 coding unit, otherwise the 32x32 encoding is still used The unit is coded;
如果转换后的编码单元能够再次合并为64x64的编码单元,则将上述4个32x32的编码单元的共同的预测方向作为再次合并后的32x32的编码单元的预测方向。If the converted CU can be re-merged into a 64x64 CU, the common prediction direction of the above four 32x32 CUs is used as the prediction direction of the re-merged 32x32 CU.
HEVC编码器1109利用前景区域预测模式选择/编码单元映射单元1106和背景区域预测模式选择/编码单元映射单元1107所转换的HEVC标准下的前景和背景区域的编码单元尺寸信息以及预测方向信息对解码数据进行编码,从而形成HEVC视频码流。The HEVC encoder 1109 uses the coding unit size information and prediction direction information of the foreground and background regions converted by the foreground region prediction mode selection/coding unit mapping unit 1106 and the background region prediction mode selection/coding unit mapping unit 1107 under the HEVC standard to decode The data is encoded to form an HEVC video stream.
此外,背景区域预测模式选择/编码单元映射单元1107所转换的HEVC标准的背景区域的编码单元尺寸信息以及预测方向信息还可以存储在背景区域参数缓存器1108中,从而在各个视频图像帧的转换中重复利用背景区域参数缓存器1108中缓存的背景区域的编码单元尺寸信息和预测方向信息,而不必对每个视频图像帧中的背景区域的编码单元尺寸信息和预测方向信息都进行转换。In addition, the background region prediction mode selection/coding unit mapping unit 1107 converts the coding unit size information and prediction direction information of the background region of the HEVC standard can also be stored in the background region parameter buffer 1108, so that in the conversion of each video image frame The coding unit size information and prediction direction information of the background area buffered in the background area parameter buffer 1108 are reused in the background area parameter buffer 1108, without converting the coding unit size information and prediction direction information of the background area in each video image frame.
应理解,上述实施例和示例是示例性的,而不是穷举性的,本公开不应被视为局限于任何具体的实施例或示例。It should be understood that the above-described embodiments and examples are illustrative rather than exhaustive, and the present disclosure should not be viewed as limited to any specific embodiment or example.
作为一个示例,上述方法的各个步骤以及上述设备的各个组成模块和/或装置可以实施为的软件、固件、硬件或其组合。例如,可以作为具有图像处理功能的各种设备(如计算机、个人数字助理、照相机、摄像机及其他图像处理设备等,这里不一一列举)的一部分。上述设备中各个组成模块通过软件、固件、硬件或其组合的方式进行配置时可使用的具体手段或方式为本领域技术人员所熟知,在此不再赘述。As an example, each step of the above method and each component module and/or device of the above device may be implemented as software, firmware, hardware or a combination thereof. For example, it can be used as a part of various devices with image processing functions (such as computers, personal digital assistants, cameras, video cameras, and other image processing devices, etc., not listed here). The specific means or methods that can be used when each component module of the above-mentioned device is configured by means of software, firmware, hardware or a combination thereof are well known to those skilled in the art, and will not be repeated here.
如上所述,上述方法和设备中对图像进行处理的步骤和模块可以通过软件来实现。从存储介质或网络向具有专用硬件结构的计算机(例如图12所示的通用计算机1200)安装构成该软件的程序,该计算机在安装有各种程序时,能够执行各种功能等。As mentioned above, the steps and modules of image processing in the above method and device can be realized by software. The programs constituting the software are installed from a storage medium or a network to a computer having a dedicated hardware configuration (for example, the general-purpose computer 1200 shown in FIG. 12 ), and the computer can execute various functions and the like when various programs are installed.
在图12中,中央处理单元(CPU)1201根据只读存储器(ROM)1202中存储的程序或从存储部分1208加载到随机存取存储器(RAM)1203的程序执行各种处理。在RAM1203中,也根据需要存储当CPU1201执行各种处理等等时所需的数据。CPU1201、ROM1202和RAM1203经由总线1204彼此连接。输入/输出接口1205也连接到总线1204。In FIG. 12 , a central processing unit (CPU) 1201 executes various processes according to programs stored in a read only memory (ROM) 1202 or loaded from a storage section 1208 to a random access memory (RAM) 1203 . In the RAM 1203, data required when the CPU 1201 executes various processes and the like is also stored as necessary. The CPU 1201 , ROM 1202 , and RAM 1203 are connected to each other via a bus 1204 . The input/output interface 1205 is also connected to the bus 1204 .
下述部件连接到输入/输出接口1205:输入部分1206(包括键盘、鼠标等等)、输出部分1207(包括显示器,比如阴极射线管(CRT)、液晶显示器(LCD)等,和扬声器等)、存储部分1208(包括硬盘等)、通信部分1209(包括网络接口卡比如LAN卡、调制解调器等)。通信部分1209经由网络比如因特网执行通信处理。根据需要,驱动器1210也可连接到输入/输出接口1205。可拆卸介质1211比如磁盘、光盘、磁光盘、半导体存储器等等根据需要被安装在驱动器1210上,使得从中读出的计算机程序根据需要被安装到存储部分1208中。The following components are connected to the input/output interface 1205: an input section 1206 (including a keyboard, a mouse, etc.), an output section 1207 (including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.), Storage part 1208 (including hard disk, etc.), communication part 1209 (including network interface cards such as LAN cards, modems, etc.). The communication section 1209 performs communication processing via a network such as the Internet. A driver 1210 may also be connected to the input/output interface 1205 as needed. A removable medium 1211 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1210 as necessary, so that a computer program read therefrom is installed into the storage section 1208 as necessary.
在通过软件实现上述系列处理的情况下,从网络比如因特网或存储介质比如可拆卸介质1211安装构成软件的程序。In the case of realizing the above-described series of processing by software, the programs constituting the software are installed from a network such as the Internet or a storage medium such as the removable medium 1211 .
本领域的技术人员应当理解,这种存储介质不局限于图12所示的其中存储有程序、与设备相分离地分发以向用户提供程序的可拆卸介质1211。可拆卸介质1211的例子包含磁盘(包含软盘(注册商标))、光盘(包含光盘只读存储器(CD-ROM)和数字通用盘(DVD))、磁光盘(包含迷你盘(MD)(注册商标))和半导体存储器。或者,存储介质可以是ROM1202、存储部分1208中包含的硬盘等等,其中存有程序,并且与包含它们的设备一起被分发给用户。Those skilled in the art should understand that such a storage medium is not limited to the removable medium 1211 shown in FIG. 12 in which the program is stored and distributed separately from the device to provide the program to the user. Examples of the removable media 1211 include magnetic disks (including floppy disks (registered trademark)), optical disks (including compact disk read only memory (CD-ROM) and digital versatile disks (DVD)), magneto-optical disks (including MiniDisc (MD) (registered trademark )) and semiconductor memory. Alternatively, the storage medium may be the ROM 1202, a hard disk contained in the storage section 1208, or the like, in which the programs are stored and distributed to users together with devices containing them.
本公开还提出一种存储有机器可读取的指令代码的程序产品。所述指令代码由机器读取并执行时,可执行上述根据本公开实施例的方法。The present disclosure also proposes a program product storing machine-readable instruction codes. When the instruction code is read and executed by a machine, the above-mentioned method according to the embodiments of the present disclosure can be executed.
相应地,用于承载上述存储有机器可读取的指令代码的程序产品的存储介质也包括在本公开的公开中。所述存储介质包括但不限于软盘、光盘、磁光盘、存储卡、存储棒等等。Correspondingly, a storage medium for carrying the program product storing the above-mentioned machine-readable instruction codes is also included in the disclosure of the present disclosure. The storage medium includes, but is not limited to, a floppy disk, an optical disk, a magneto-optical disk, a memory card, a memory stick, and the like.
在上面对本公开具体实施例的描述中,针对一种实施方式描述和/或示出的特征可以用相同或类似的方式在一个或更多个其它实施方式中使用,与其它实施方式中的特征相组合,或替代其它实施方式中的特征。In the above description of specific embodiments of the present disclosure, features described and/or illustrated for one embodiment can be used in one or more other embodiments in the same or similar manner, and features in other embodiments Combination or replacement of features in other embodiments.
应该强调,术语“包括/包含”在本文使用时指特征、要素、步骤或组件的存在,但并不排除一个或更多个其它特征、要素、步骤或组件的存在或附加。It should be emphasized that the term "comprising/comprising" when used herein refers to the presence of a feature, element, step or component, but does not exclude the presence or addition of one or more other features, elements, steps or components.
此外,本公开的方法不限于按照说明书中描述的时间顺序来执行,也可以按照其他的时间顺序地、并行地或独立地执行。因此,本说明书中描述的方法的执行顺序不对本公开的技术范围构成限制。In addition, the methods of the present disclosure are not limited to being performed in the chronological order described in the specification, and may also be performed in other chronological order, in parallel or independently. Therefore, the execution order of the methods described in this specification does not limit the technical scope of the present disclosure.
通过以上的描述可以看出,根据本公开的实施例,提供了如下的方案:It can be seen from the above description that according to the embodiments of the present disclosure, the following solutions are provided:
附记1.一种视频转码方法,包括:Note 1. A video transcoding method, comprising:
对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;Decoding a video code stream that complies with the first video codec standard and includes multiple frames of images to generate decoded data;
获取各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式;Obtain the coding block size and prediction mode in each frame of image conforming to the first video codec standard;
根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;Determine the coding block size and prediction mode in the encoding process conforming to the second video codec standard according to the coding block size and prediction mode of the video codec under the first video codec standard;
根据所确定的符合第二视频解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。Encode the decoded data into a video stream conforming to the second video encoding and decoding standard according to the determined encoding block size and prediction mode conforming to the second video encoding and decoding standard.
附记2.如附记1所述的方法,其中,所述预测模式即为预测方向,并且其中,根据所述的符合第一视频编解码标准的视频码流的编码块尺寸和预测模式来确定符合第二视频编解码标准的编码块尺寸和编码预测模式包括:Note 2. The method as described in Supplement 1, wherein the prediction mode is the prediction direction, and wherein, according to the coding block size and prediction mode of the video codec conforming to the first video codec standard, it is determined that the second The coding block size and coding prediction mode of the video codec standard include:
对于各个帧中的符合第一视频编解码标准中的非最大编码块尺寸的块,将该编码块尺寸直接作为符合第二视频编解码标准的编码块尺寸,并选择与符合第一视频编解码标准的预测方向相同或相邻的预测方向作为符合第二视频编解码标准的备选预测方向;For a block in each frame that conforms to the non-maximum encoding block size in the first video codec standard, use the encoding block size directly as the encoding block size conforming to the second video codec standard, and select the block that conforms to the first video codec The standard prediction direction is the same or adjacent to the prediction direction as an alternative prediction direction conforming to the second video codec standard;
对于各个帧中的具有第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取第一视频编解码标准中对应于最大编码块尺寸的全部预测方向作为符合第二视频编解码标准的编码时的备选预测方向;如否,则提取其编码块尺寸和预测方向直接作为符合第二视频编解码标准的编码块尺寸和预测方向。For a block with the largest coding block size in the first video codec standard in each frame, determine whether its neighboring blocks with the same coding block size have the same prediction direction, and if so, merge the block with its neighboring blocks , extract the combined coded block size as the coded block size conforming to the second video codec standard, and extract all the prediction directions corresponding to the largest coded block size in the first video codec standard as the codec conforming to the second video codec standard If not, extract the coding block size and prediction direction directly as the coding block size and prediction direction conforming to the second video codec standard.
附记3.如附记2所述的方法,进一步包括:Note 3. The method described in Appendix 2, further comprising:
如果所述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸,则判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块再次合并,将再次合并后的编码块尺寸作为第二视频编解码标准的编码块尺寸,并将第二视频编解码标准中对应于再次合并后的编码块尺寸的全部预测方向作为再次合并后的块的预测方向;如否,则将其编码块尺寸和预测模式直接作为第二视频编解码标准的编码块尺寸和预测方向。If the size of the combined coding block is smaller than the maximum coding block size allowed by the second video codec standard, it is judged whether the adjacent block having the same coding block size has the same prediction direction, and if so, the block is compared with the Adjacent blocks are merged again, and the coded block size after recombination is used as the coded block size of the second video codec standard, and all prediction directions corresponding to the coded block size after recombined in the second video codec standard are used as the coded block size again The prediction direction of the merged block; if not, its coding block size and prediction mode are directly used as the coding block size and prediction direction of the second video codec standard.
附记4.如附记2或3所述的方法,进一步包括:识别各帧中的背景区域。Note 4. The method described in Supplementary Note 2 or 3, further comprising: identifying background regions in each frame.
附记5.如附记4所述的方法,还包括:Note 5. The method described in Appendix 4, further comprising:
对于背景区域中的具有第一视频编解码标准中的非最大编码块尺寸的块,将其编码块尺寸直接作为第二视频编解码标准的编码块尺寸,选择与其预测方向相同的预测方向作为其在第二视频编解码标准中的预测方向;For a block in the background area that has a non-maximum coding block size in the first video codec standard, its coding block size is directly used as the coding block size of the second video codec standard, and the same prediction direction as its prediction direction is selected as its a prediction direction in the second video codec standard;
对于背景区域中的具有符合第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取所述相同的预测方向作为第二视频编解码标准中的预测方向;如否,则提取其编码块尺寸和预测方向直接作为第二视频编解码标准的编码块尺寸和预测方向。For a block in the background area that conforms to the largest coding block size in the first video codec standard, judge whether its adjacent blocks with the same coding block size have the same prediction direction, and if so, then the block and its neighboring blocks Merging, extracting the combined coding block size as the coding block size conforming to the second video codec standard, and extracting the same prediction direction as the prediction direction in the second video codec standard; if not, extracting its coding block The size and prediction direction are directly used as the coding block size and prediction direction of the second video codec standard.
附记6.如附记5所述的方法,进一步包括:Note 6. The method described in Appendix 5, further comprising:
如果所述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸,则判断与其具有相同编码块尺寸的相邻块是否具有相同的预测模式,如是,则将该块与其相邻块合并,将再次合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并将所述相同的预测模式作为符合第二视频编解码标准的预测模式;如否,则将其编码块尺寸和预测模式直接作为符合第二视频编解码标准的编码块尺寸和预测模式。If the combined coded block size is smaller than the maximum coded block size allowed by the second video codec standard, it is judged whether the adjacent block having the same coded block size has the same prediction mode, and if so, the block is compared with Adjacent blocks are merged, and the coded block size after re-merging is used as the coded block size conforming to the second video codec standard, and the same prediction mode is used as the prediction mode conforming to the second video codec standard; if not, then The coding block size and prediction mode are directly used as the coding block size and prediction mode conforming to the second video codec standard.
附记7.如附记5或6所述的方法,其中,Note 7. The method described in appendix 5 or 6, wherein,
对于背景区域中的块,所确定的符合第二视频编解码标准的编码块尺寸和预测方向可以在不同的帧中被重复使用。For the blocks in the background area, the determined coding block size and prediction direction conforming to the second video codec standard can be reused in different frames.
附记8.如附记4所述的方法,识别各帧中的背景区域包括:Note 8. As in the method described in Appendix 4, identifying the background area in each frame includes:
将相邻两帧中相同位置的块的编码块尺寸与预测模式进行比较,如果均相同,则判定该块处于背景区域中。Compare the coded block size of the block at the same position in two adjacent frames with the prediction mode, and if they are the same, it is determined that the block is in the background area.
附记9.如附记1所述的方法,其中Note 9. The method described in appendix 1, wherein
第一和第二视频编解码标准中允许多种编码块尺寸以及多种预测模式,第二视频编解码标准的编码块尺寸包括并大于第一视频编解码标准的编码块尺寸。Multiple coding block sizes and multiple prediction modes are allowed in the first and second video codec standards, and the coding block size of the second video codec standard includes and is larger than the coding block size of the first video codec standard.
附记10.如附记1所述的方法,其中Note 10. The method described in appendix 1, wherein
第二视频编解码标准的预测模式包括并多于第一视频编解码标准的预测模式。The prediction modes of the second video codec standard include more than the prediction modes of the first video codec standard.
附记11.如附记1所述的方法,其中Note 11. The method described in appendix 1, wherein
第一视频编解码标准为H.264标准。The first video codec standard is the H.264 standard.
附记12.如附记1所述的方法,其中Note 12. The method described in appendix 1, wherein
第二视频编解码标准为HEVC标准。The second video codec standard is the HEVC standard.
附记13.一种视频转码器,包括:Note 13. A video transcoder comprising:
第一视频编解码标准解码单元,用于对包含多帧图像的符合第一视频编解码标准的视频码流进行解码,生成解码数据;The first video codec standard decoding unit is used to decode a video code stream that complies with the first video codec standard including multiple frames of images to generate decoded data;
缓存器,用于获取各帧图像中的符合第一视频编解码标准的编码块尺寸和预测模式,并存储在其中;The buffer is used to obtain the coding block size and prediction mode conforming to the first video codec standard in each frame image, and store them therein;
参数信息转换单元,用于根据所述视频码流的在第一视频编解码标准下的编码块尺寸和预测模式来确定其在符合第二视频编解码标准的编码过程中编码块尺寸和预测模式;A parameter information conversion unit, configured to determine the encoding block size and prediction mode in the encoding process conforming to the second video encoding and decoding standard according to the encoding block size and prediction mode of the video codec under the first video encoding and decoding standard ;
第二视频编解码标准编码单元,用于根据所确定的符合第二视频编解码标准的编码块尺寸和预测模式将解码数据编码为所述符合第二视频编解码标准的视频码流。The second video codec standard encoding unit is configured to encode the decoded data into a video code stream conforming to the second video codec standard according to the determined coding block size and prediction mode conforming to the second video codec standard.
附记14.如附记13所述的视频转码器,其中,所述预测模式即为预测方向,并且Supplement 14. The video transcoder according to Supplement 13, wherein the prediction mode is the prediction direction, and
其中,所述参数信息转换单元被配置为:对于各个帧中的符合第一视频编解码标准中的非最大编码块尺寸的块,将该编码块尺寸直接作为符合第二视频编解码标准的编码块尺寸,并选择与符合第一视频编解码标准的预测方向相同或相邻的预测方向作为符合第二视频编解码标准的备选预测方向;对于各个帧中的具有第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取第一视频编解码标准中对应于最大编码块尺寸的全部预测方向作为符合第二视频编解码标准的编码时的备选预测方向;如否,则提取其编码块尺寸和预测方向直接作为符合第二视频编解码标准的编码块尺寸和预测方向。Wherein, the parameter information converting unit is configured to: for a block conforming to the non-maximum encoding block size in the first video encoding and decoding standard in each frame, directly use the encoding block size as an encoding conforming to the second video encoding and decoding standard block size, and select the prediction direction that is the same as or adjacent to the prediction direction that conforms to the first video codec standard as an alternative prediction direction that conforms to the second video codec standard; A block with the largest coding block size, judge whether its adjacent blocks with the same coding block size have the same prediction direction, if so, merge the block with its neighboring blocks, and extract the combined coding block size as conforming to the second video codec standard coding block size, and extract all the prediction directions corresponding to the largest coding block size in the first video codec standard as the candidate prediction direction during encoding that conforms to the second video codec standard; if not, extract its The coding block size and prediction direction are directly used as the coding block size and prediction direction conforming to the second video codec standard.
附记15.如附记14所述的视频转码器,其中,所述参数信息转换单元被进一步配置为:Note 15. The video transcoder described in Supplementary Note 14, wherein the parameter information conversion unit is further configured as:
在所述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸的情况下,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块再次合并,将再次合并后的编码块尺寸作为第二视频编解码标准的编码块尺寸,并将第二视频编解码标准中对应于所述再次合并后的编码块尺寸的全部预测方向作为再次合并后的块的预测方向;如否,则将其编码块尺寸和预测模式直接作为第二视频编解码标准的编码块尺寸和预测方向。In the case that the combined coding block size is smaller than the maximum coding block size allowed by the second video codec standard, it is judged whether the adjacent blocks having the same coding block size have the same prediction direction, and if so, the The block and its adjacent blocks are merged again, and the coded block size after the merge is used as the coded block size of the second video codec standard, and all the coded block sizes in the second video codec standard corresponding to the coded block size after the merge are used The prediction direction is used as the prediction direction of the re-merged block; if not, the coding block size and prediction mode are directly used as the coding block size and prediction direction of the second video codec standard.
附记16.如附记14或15所述的视频转码器,进一步包括背景区域确定单元,用于识别各帧中的背景区域。Note 16. The video transcoder according to Supplementary Note 14 or 15, further comprising a background area determining unit, configured to identify the background area in each frame.
附记17.如附记16所述的视频转码器,其中,所述参数信息转换单元被进一步配置为:Note 17. The video transcoder described in Supplementary Note 16, wherein the parameter information converting unit is further configured as:
对于背景区域中的具有第一视频编解码标准中的非最大编码块尺寸的块,将其编码块尺寸直接作为第二视频编解码标准的编码块尺寸,选择与其预测方向相同的预测方向作为其在第二视频编解码标准中的预测方向;For a block in the background area that has a non-maximum coding block size in the first video codec standard, its coding block size is directly used as the coding block size of the second video codec standard, and the same prediction direction as its prediction direction is selected as its a prediction direction in the second video codec standard;
对于背景区域中的具有符合第一视频编解码标准中的最大编码块尺寸的块,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测方向,如是,则将该块与其相邻块合并,提取合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并提取所述相同的预测方向作为第二视频编解码标准中的预测方向;如否,则提取其编码块尺寸和预测方向直接作为第二视频编解码标准的编码块尺寸和预测方向。For a block in the background area that conforms to the largest coding block size in the first video codec standard, judge whether its adjacent blocks with the same coding block size have the same prediction direction, and if so, then the block and its neighboring blocks Merging, extracting the combined coding block size as the coding block size conforming to the second video codec standard, and extracting the same prediction direction as the prediction direction in the second video codec standard; if not, extracting its coding block The size and prediction direction are directly used as the coding block size and prediction direction of the second video codec standard.
附记18.如附记17所述的视频转码器,其中,所述参数信息转换单元被进一步配置为:Note 18. The video transcoder described in Supplementary Note 17, wherein the parameter information conversion unit is further configured as:
在所述合并后的编码块尺寸小于第二视频编解码标准所允许的最大编码块尺寸的情况下,判断与其具有相同编码块尺寸的相邻块是否具有相同的预测模式,如是,则将该块与其相邻块再次合并,将再次合并后的编码块尺寸作为符合第二视频编解码标准的编码块尺寸,并将所述相同的预测模式作为符合第二视频编解码标准的预测模式;如否,则将其编码块尺寸和预测模式直接作为符合第二视频编解码标准的编码块尺寸和预测模式。In the case that the size of the combined coding block is smaller than the maximum coding block size allowed by the second video codec standard, it is judged whether the adjacent block having the same coding block size has the same prediction mode, and if so, the The block and its adjacent blocks are merged again, and the coded block size after remerging is used as the coded block size conforming to the second video codec standard, and the same prediction mode is used as the prediction mode conforming to the second video codec standard; If not, use the coding block size and prediction mode directly as the coding block size and prediction mode conforming to the second video codec standard.
附记19.如附记17或18所述的视频转码器,其中进一步包括背景区域参数缓存器,用于存储转换后的符合第二视频编解码标准的编码块尺寸和预测方向。Note 19. The video transcoder as described in Supplementary Note 17 or 18, further comprising a background area parameter buffer for storing the converted coding block size and prediction direction conforming to the second video codec standard.
附记20.如附记16所述的视频转码器,所述背景区域确定单元被配置为将相邻两帧中相同位置的块的编码块尺寸与预测模式进行比较,如果均相同,则判定该块处于背景区域中。Note 20. In the video transcoder described in Supplementary Note 16, the background area determination unit is configured to compare the coding block size of the block at the same position in two adjacent frames with the prediction mode, and if they are the same, determine that the block is in the in the background area.
附记21.如附记13所述的视频转码器,其中Note 21. The video transcoder described in appendix 13, wherein
第一和第二视频编解码标准中允许多种编码块尺寸以及多种预测模式,第二视频编解码标准的编码块尺寸包括并大于第一视频编解码标准的编码块尺寸。Multiple coding block sizes and multiple prediction modes are allowed in the first and second video codec standards, and the coding block size of the second video codec standard includes and is larger than the coding block size of the first video codec standard.
附记22.如附记13所述的视频转码器,其中Note 22. The video transcoder described in appendix 13, wherein
第二视频编解码标准的预测模式包括并多于第一视频编解码标准的预测模式。The prediction modes of the second video codec standard include more than the prediction modes of the first video codec standard.
附记23.如附记13所述的视频转码器,其中Note 23. The video transcoder described in appendix 13, wherein
第一视频编解码标准为H.264标准。The first video codec standard is the H.264 standard.
附记24.如附记13所述的视频转码器,其中Note 24. The video transcoder described in appendix 13, wherein
第二视频编解码标准为HEVC标准。The second video codec standard is the HEVC standard.
尽管上面已经通过对本发明的具体实施例的描述对本发明进行了披露,但是,应该理解,上述的所有实施例和示例均是示例性的,而非限制性的。本领域的技术人员可在所附权利要求的精神和范围内设计对本发明的各种修改、改进或者等同物。这些修改、改进或者等同物也应当被认为包括在本发明的保护范围内。Although the present invention has been disclosed by the description of specific embodiments of the present invention above, it should be understood that all the above embodiments and examples are illustrative rather than restrictive. Those skilled in the art can devise various modifications, improvements or equivalents to the present invention within the spirit and scope of the appended claims. These modifications, improvements or equivalents should also be considered to be included in the protection scope of the present invention.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310129950.XA CN104104948B (en) | 2013-04-15 | 2013-04-15 | Video transcoding method and video transcoder |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310129950.XA CN104104948B (en) | 2013-04-15 | 2013-04-15 | Video transcoding method and video transcoder |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104104948A true CN104104948A (en) | 2014-10-15 |
CN104104948B CN104104948B (en) | 2017-08-01 |
Family
ID=51672707
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310129950.XA Expired - Fee Related CN104104948B (en) | 2013-04-15 | 2013-04-15 | Video transcoding method and video transcoder |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104104948B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104618734A (en) * | 2015-01-29 | 2015-05-13 | 华为技术有限公司 | Video code stream transcoding method and device under same protocol type |
CN105898309A (en) * | 2015-12-25 | 2016-08-24 | 乐视云计算有限公司 | Transcoding method and device |
CN108600757A (en) * | 2018-05-03 | 2018-09-28 | 深圳市网心科技有限公司 | Macroblock type determining method, video transcoding method, electronic device, and storage medium |
CN110062235A (en) * | 2019-04-08 | 2019-07-26 | 上海大学 | Background frames generate and update method, system, device and medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101742321A (en) * | 2010-01-12 | 2010-06-16 | 浙江大学 | Video encoding and decoding method and device based on layer decomposition |
CN101888547A (en) * | 2010-06-18 | 2010-11-17 | 西安电子科技大学 | H.264/AVC fast transcoding method and device based on direct mode selection |
CN101909211A (en) * | 2010-01-04 | 2010-12-08 | 西安电子科技大学 | H.264/AVC Efficient Transcoder Based on Fast Mode Decision |
CN102510496A (en) * | 2011-10-14 | 2012-06-20 | 北京工业大学 | Quick size reduction transcoding method based on region of interest |
CN102665077A (en) * | 2012-05-03 | 2012-09-12 | 北京大学 | Rapid and efficient encoding-transcoding method based on macro block classification |
-
2013
- 2013-04-15 CN CN201310129950.XA patent/CN104104948B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101909211A (en) * | 2010-01-04 | 2010-12-08 | 西安电子科技大学 | H.264/AVC Efficient Transcoder Based on Fast Mode Decision |
CN101742321A (en) * | 2010-01-12 | 2010-06-16 | 浙江大学 | Video encoding and decoding method and device based on layer decomposition |
CN101888547A (en) * | 2010-06-18 | 2010-11-17 | 西安电子科技大学 | H.264/AVC fast transcoding method and device based on direct mode selection |
CN102510496A (en) * | 2011-10-14 | 2012-06-20 | 北京工业大学 | Quick size reduction transcoding method based on region of interest |
CN102665077A (en) * | 2012-05-03 | 2012-09-12 | 北京大学 | Rapid and efficient encoding-transcoding method based on macro block classification |
Non-Patent Citations (2)
Title |
---|
DONG ZHANG, ET AL.: "Fast Transcoding from H.264/AVC to High Efficiency Video Coding", 《2012 IEEE INTERNATIONAL CONFERENCE ON MULTIMEDIA AND EXPO》 * |
TONG SHEN,ET AL.: "Ultra Fast H.264/AVC to HEVC Transcoder", 《2013 DATA COMPRESSION CONFERENCE》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104618734A (en) * | 2015-01-29 | 2015-05-13 | 华为技术有限公司 | Video code stream transcoding method and device under same protocol type |
CN104618734B (en) * | 2015-01-29 | 2019-02-01 | 华为技术有限公司 | The code-transferring method and device of video code flow under same protocol type |
CN105898309A (en) * | 2015-12-25 | 2016-08-24 | 乐视云计算有限公司 | Transcoding method and device |
CN108600757A (en) * | 2018-05-03 | 2018-09-28 | 深圳市网心科技有限公司 | Macroblock type determining method, video transcoding method, electronic device, and storage medium |
CN110062235A (en) * | 2019-04-08 | 2019-07-26 | 上海大学 | Background frames generate and update method, system, device and medium |
CN110062235B (en) * | 2019-04-08 | 2023-02-17 | 上海大学 | Background frame generation and update method, system, device and medium |
Also Published As
Publication number | Publication date |
---|---|
CN104104948B (en) | 2017-08-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI681671B (en) | Multiple transform prediction | |
TWI677234B (en) | Secondary transform kernel size selection | |
CN112602324B (en) | Block horizontal geometric partitioning | |
CN103096055B (en) | The method and apparatus of a kind of image signal intra-frame prediction and decoding | |
US9325993B2 (en) | Encoding or decoding method and apparatus | |
US10051271B2 (en) | Coding structure | |
CN105163127A (en) | Video analysis method and device | |
CN104768007A (en) | Method for encoding/decoding high-resolution image and device for performing same | |
CN102006473A (en) | Video encoder and encoding method, and video decoder and decoding method | |
CN102595116A (en) | Encoding and decoding methods and devices for multiple image block division ways | |
TW201826798A (en) | Sample adaptive offset apparatus | |
CN107404648B (en) | A kind of multi-channel video code-transferring method based on HEVC | |
TWI839968B (en) | Local illumination compensation with coded parameters | |
CN110692241B (en) | Diverse motion using multiple global motion models | |
CN104618724B (en) | Method and apparatus for video encoding or decoding | |
CN104104948B (en) | Video transcoding method and video transcoder | |
CN107820095A (en) | A kind of long term reference image-selecting method and device | |
Wang et al. | Multi-scale convolutional neural network-based intra prediction for video coding | |
Zhu et al. | Machine learning based fast H. 264/AVC to HEVC transcoding exploiting block partition similarity | |
WO2019037471A1 (en) | Video processing method, video processing device and terminal | |
JP2022546774A (en) | Interpolation filtering method and device, computer program and electronic device for intra prediction | |
WO2022252567A1 (en) | Method and device for determining priority order of video encoding and decoding on basis of correlation comparison | |
CN102595117B (en) | Method and device for coding and decoding | |
US20150271491A1 (en) | Enhanced intra prediction mode selection for use in video transcoding | |
CN105872553B (en) | A kind of adaptive loop filter method based on parallel computation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170801 Termination date: 20180415 |