WO2012088649A1 - 复用码流信息的h264转码方法 - Google Patents

复用码流信息的h264转码方法 Download PDF

Info

Publication number
WO2012088649A1
WO2012088649A1 PCT/CN2010/002244 CN2010002244W WO2012088649A1 WO 2012088649 A1 WO2012088649 A1 WO 2012088649A1 CN 2010002244 W CN2010002244 W CN 2010002244W WO 2012088649 A1 WO2012088649 A1 WO 2012088649A1
Authority
WO
WIPO (PCT)
Prior art keywords
macroblock
code stream
original
slice
frame
Prior art date
Application number
PCT/CN2010/002244
Other languages
English (en)
French (fr)
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 EP10861264.9A priority Critical patent/EP2661079A1/en
Priority to CA2817790A priority patent/CA2817790A1/en
Priority to PCT/CN2010/002244 priority patent/WO2012088649A1/zh
Priority to JP2013546546A priority patent/JP2014504815A/ja
Priority to CN201080057348.4A priority patent/CN102696226B/zh
Priority to US13/988,550 priority patent/US20130243099A1/en
Publication of WO2012088649A1 publication Critical patent/WO2012088649A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/40Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream

Definitions

  • the present invention relates to the field of multimedia coding technologies, and in particular, to a H264 transcoding method for multiplexing code stream information.
  • the transcoding process is extremely demanding on hardware and software.
  • the general transcoding algorithm decodes the original video stream and then re-encodes it. Due to the complexity of the codec algorithm, this method is too computationally intensive and requires a long calculation time. Since the current video coding and decoding standards are based on the basic framework of transcoding and motion compensation, the motion vector and macroblock information in the original code stream can obtain the prior information of the motion level and image details of the relevant video stream, if The use of the encoding process can greatly increase the speed of re-encoding without sacrificing too much picture quality.
  • mainstream video coding standards such as VC-1, MPEG2, MPEG4 and H26L are based on hybrid coding, motion estimation, and entropy coding.
  • the current H264 code streaming H264 code stream method first decodes the image in the original code stream out of the YUV image sequence, and transmits it to the encoder according to the play order.
  • the encoder analyzes the image one by one, determines the slice type of the image code, and then pairs the slice.
  • the motion of each macroblock, the complexity of the details are analyzed, the type of the macroblock, the size of the motion vector, and then encoded.
  • Intra-16x16 has 4 prediction modes
  • Intra_4x4 has 8 prediction modes
  • Inter block motion estimation supports 1/4 pixel precision
  • the technical problem to be solved by the present invention is: how to achieve fast and efficient transcoding without sacrificing too much image quality.
  • the present invention provides an H264 transcoding method for multiplexing code stream information.
  • the frame or field decoded by the original code stream is counted, and the current output frame or field is marked with a count, and the code is encoded.
  • the encoder encodes the slice type of the current frame or field and the slice of the original code stream per frame or field, and multiplexes the macroblock level code stream information of the original code stream when encoding the macroblock level code stream information.
  • the step of encoding, by the encoder, the slice type of the current frame or field is consistent with the original code stream is:
  • the slice encoding the current frame or field is an I slice, and if the frame type of the original code stream or the slice type of the field is a P slice, the current frame is encoded or The slice of the field is a P slice; if the slice type of the original stream or the slice type of the field is a B slice, it is determined whether nal_ref_idc is equal to 0, and if equal to 0, the slice encoding the current frame or field is a B slice, if not equal to 0, Then the slice encoding the current frame or field is a B slice, and the current frame or field is inserted as a reference frame into the reference frame queue of the encoder.
  • the macroblock level code stream information of the multiplexed original stream includes the following steps:
  • step S21 determining whether there is an error in the original stream, if there is an error, the decoder fails to decode the current macroblock, the decoder marks the current macroblock error, and the encoder analyzes the macroblock using the original motion estimation and prediction mode selection algorithm. If there is no error, step S22 is performed;
  • the pre-processed original code stream is encoded in a prediction manner corresponding to the location macroblock, and the pre-processing includes:
  • the macroblock level information multiplexing includes the following steps:
  • S231 processing of a macroblock type, if the current macroblock of the original stream is P_SKIP, the decoder marks its The type is P_L0_16xl6, the motion vector is the motion vector predicted by the median value of the decoder. If it is B-SKIP, the decoder marks it as B-DIRECT type, and the other inter-type remains unchanged to the encoder;
  • the decoder passes the count of the reference frame corresponding to the ref_idx_k of the 8x8 block of each macro block to the encoder, and after obtaining the reference frame count of the 8x8 block, the encoder searches for the same count from the encoder reference frame queue. a frame or field, if it exists as a reference frame, continue to perform step S233, otherwise the entire macroblock is estimated using the original motion estimation process of the encoder;
  • the method for multiplexing the motion information in the inter macroblock in the step S233 is: using the motion vector of the macroblock corresponding to the original stream as one of the initial prediction vectors of the encoder, and the motion vector obtained by the median prediction and other methods.
  • the motion vector is compared using the original matching criteria of the encoder to obtain the initial search point position, which is the initial search point search;
  • the original stream corresponds to the motion vector size of the macroblock, the entire pixel portion, the motion vector reference frame, the macroblock type, the block mode, and the reference frame index multiplexing, and the encoder performs the sub-pixel with the motion vector integer point as the initial search point. 1/4 pixel search to get the final matching position;
  • the residual vector is calculated by directly multiplexing the motion vector of the original stream macroblock, the block mode, the reference frame index, and the macroblock type.
  • the invention speeds up the coding speed and improves the coding efficiency by prematurely reducing the video quality of the original code stream by frame or field level multiplexing and macroblock level multiplexing.
  • Figure 1 is a basic frame diagram of the H264 encoder encoding
  • FIG. 2 is a flowchart of a coded slice type in a frame or field level multiplexing method in a H264 transcoding method for multiplexing code stream information according to an embodiment of the present invention
  • FIG. 3 is a flowchart of macroblock level multiplexing in a H264 transcoding method for multiplexing code stream information according to an embodiment of the present invention.
  • the H264 encoder coding frame diagram in the method of the present invention, ME (motion estimate), that is, inter macroblock information multiplexing coding, intra prediction selection, and intra prediction partial code stream information complex
  • the code is used, and the frame index of the decoder is processed.
  • MC motion compensation
  • T DCT
  • Q quantization
  • the frame decoded by the original stream is counted, and the current output frame is marked with a count.
  • the slice type of the image of each frame of the encoder since the macroblock level information of the original code stream is to be multiplexed, the slice type of the image of each frame of the encoder must be consistent with the original code stream, otherwise the motion vector of the inter block and the like cannot be multiplexed, and the encoder code is encoded.
  • the slice type of the current frame is consistent with the original code stream, and the macroblock level code stream information of the original code stream is multiplexed when encoding the macroblock level code stream information.
  • the step of the encoder encoding the slice type of the current frame is consistent with the original code stream, as shown in FIG. 2, including:
  • Step S201 the original stream is input into the NAL.
  • Step S202 determining whether the nal_unit_type of the NAL is equal to 5, if equal to 5, executing step S203, if not equal to 5, executing step S204.
  • Step S203 encoding all slices of the current frame as IDR slices.
  • Step S204 it is determined whether the slice type of the frame of the original code stream is a B slice, and if yes, step S206 is performed, and if not, step S205 is performed.
  • Step S205 If the slice type of the frame of the original code stream is I slice, the slice encoding the current frame is an I slice, and if the slice type of the frame of the original code stream is a P slice, the slice encoding the current frame is a P slice.
  • Step S206 determining whether nal_ref_idc is equal to 0, and if equal to 0, performing step S208, Otherwise, step S207 is performed.
  • Step S207 encoding the slice of the current frame into a B slice, and inserting the current frame as a reference frame into the reference frame queue of the encoder.
  • Step S208 encoding the slice of the current frame as a B slice.
  • the encoder cannot reuse the ref_pic_list_modification_flag_lx, ad3 ⁇ 43tive_re ⁇ _pic_flag_node_flag, memory- management-CQntrol-operaiion and other related information in the original h264 code stream to adjust the reference frame sequence and the reference frame sequence ⁇ 'J adjustment mode (reference) : ITU-T H264 Advanced video coding for generic audiovisual services, 8.2.5.1), if ref-idx-lx of macroblock-level code stream information is simply multiplexed when encoding an inter macroblock, the frame referenced by the encoder is not the original stream.
  • the frame referenced by the corresponding macroblock does not obtain the best matching position of the motion vector in the original stream, so the first frame is decoded from the original stream and counted from 0, and the current output frame is marked with the count, and the macroblock level is passed the reference.
  • the frame index needs to be processed accordingly.
  • the process of multiplexing the macroblock level code stream information of the original stream is as shown in FIG. 3, including:
  • Step S301 Input a macroblock of the current frame, that is, a macroblock currently encoded when encoding one frame.
  • Step S302 determining that there is an error in the original stream, if there is an error, the decoder decodes the current macroblock and the decoder marks the current macroblock error, and performs step S308. If there is no error, step S303.
  • Step S303 determining the current macroblock type. If it is an intm macroblock, step S304 is performed, otherwise, step S305 is performed.
  • Step S304 Perform pre-processing on the current macroblock, and encode according to the pre-processed original code stream corresponding to the location macroblock.
  • the pre-processing includes:
  • the current macroblock is the DC prediction mode of the Intra-4x4-DC, Intra-16x-16-DC or Intra-8x8-DC
  • the current macroblock or block is encoded as the corresponding DC prediction mode. This requires calculation of the predicted values in three ways based on the division of the encoder's current frame slice (Reference: ITU-T H264 Advanced video coding for generic audiovisual services, 8.3.2.2.4).
  • Step S305 at this time, the macro block is an inter macroblock, and the inter macroblock type is processed, if the original code stream is The former macroblock is P_SKIP, then the decoder flag is of type P_L0_16xl6, and the motion vector is the motion vector predicted by the decoder median. If B_SKIP, the decoder marks it as B_DIRECT type, and other inter types remain unchanged. Output to the encoder.
  • Step S306 the decoder transmits the count of the reference frame corresponding to the ref_idx_lx of the 8x8 block of each macroblock to the encoder.
  • the encoder side obtains the reference frame count of 8x8 blocks, it searches for the same frame from the encoder reference frame queue, and if it exists as a reference frame, continues to step S307, if not, uses the original motion estimation of the encoder.
  • the process estimates the entire macroblock (inter macroblock), step S308.
  • Step S307 multiplexing the motion information in the inter macroblock.
  • the way to multiplex motion information in an inter macroblock is:
  • the motion vector corresponding to the macroblock of the original stream is used as one of the initial prediction vectors of the encoder, and the motion vector obtained by the median prediction and the motion vector obtained by other methods are compared using the original matching criterion of the encoder to obtain the initial search point position, which is Initial search point search;
  • the original stream corresponds to the motion vector size of the macroblock, the entire pixel portion, the motion vector reference frame, the macroblock type, the block mode, and the reference frame index are multiplexed, and the encoder uses the motion vector integer point as the initial search point to perform the sub-pixel, 1 /4 pixel search to get the final matching position;
  • the residual vector is calculated by directly multiplexing the motion vector of the original stream macroblock, the block mode, the reference frame index, and the macroblock type.
  • Step S308 the encoder analyzes the current macroblock by using the original algorithm, that is, the motion estimation and the prediction mode selection in FIG.
  • Step S309 the encoded macroblock is output.
  • the transcoding method of the multiplexed code stream information of the present invention is also applicable to coding of VC-1, MPEG2, and MPEG4, and the hybrid coding frame based on transform coding and motion estimation, such as VC-1, MPEG2, and MPEG4 and H264.
  • transform coding and motion estimation such as VC-1, MPEG2, and MPEG4 and H264.
  • the former has a large difference with the H264 storage standard, such as DCT transform, macroblock mode and the like are different.
  • the motion vector of the former macroblock can be used as one of the prediction vectors of the H264 motion estimation, and the initial search point of motion estimation is predicted.
  • Test 1 is the test result of the method of the present invention
  • test 2 is the test result of the existing full decoding full coding method. Both Test 1 and Test 2 use the same ffinpeg decoder, x264 parameter configuration, and the same test source.
  • Test 1 multiplexes the a priori information from the original stream frame level to the macroblock level, the motion vector multiplexing uses the mode c, does not perform macroblock coding mode analysis and motion estimation, and the test 2 uses the x264 default analysis and estimation process.
  • Tables 1 and 2 show the comparison of PSNR (peak signal to noise ratio) and consumption time.
  • the invention speeds up the coding speed and improves the coding efficiency by prematurely reducing the video quality of the original code stream by frame or field level multiplexing and macroblock level multiplexing.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

复用码流信息的 H264转码方法
技术领域
本发明涉及多媒体编码技术领域, 特别涉及一种复用码流信息的 H264转 码方法。
背景技术
随着网络共享及多媒体技术的发展, 对视频进行备份, 存储需求不断增 加, 这加速了转码技术的发展。 而由于视频编码巨大的计算量, 转码过程对 硬件软件要求极高。 一般的转码算法通过对原始视频流进行解码, 然后重新 编码的方式, 由于编解码算法的复杂性, 这种方式计算量太大, 需要较长的 计算时间。 而由于现行的视频编解码标准都基于转码编码及运动补偿的基本 框架, 从原始码流中的运动矢量及宏块信息可以得到相关视频流的运动程度 及图像细节等先验信息, 如果在编码过程中加以利用可以在不牺牲太多画面 质量的前提下大大提升再编码的速度。
目前主流的视频编码标准如 VC-1、 MPEG2、 MPEG4及 H26L等均基于变 换编码, 运动估计, 熵编码的混合编码框架。 现行的 H264码流转 H264码流的 方法, 先将原始码流中图像解码出 YUV图像序列, 按照播放顺序传递给编码 器, 编码器逐幅图像分析, 确定图像编码的 slice类型, 然后对 slice中各个宏块 的运动情况, 细节复杂度进行分析, 确定宏块的类型, 运动矢量大小, 然后 进行编码。 因为 H264标准的复杂性, 如具有很多种宏块类型, Intra— 16x16有 4 种预测方式, Intra_4x4有 8中预测方式, Inter块的运动估计支持 1/4像素精度, 需要大量插值运算等等, 从诸多模式中选择最适合当前宏块的编码方式及寻 找 Inter宏块最匹配的参考位置等等计算量负荷很大。
发明内容
(一)要解决的技术问题
本发明要解决的技术问题是: 如何在不牺牲太多画质的前提下实现快速 高效地转码。
(二)技术方案 为解决上述技术问题, 本发明提供了一种复用码流信息的 H264转码方 法, 在解码时, 对原始码流解码出的帧或场计数, 并用计数标记当前输出帧 或场, 在编码过程中, 编码器编码当前帧或场的 slice类型与原始码流每帧或 场的 slice—致, 在对宏块级码流信息编码时复用原始码流的宏块级码流信息。
其中, 所述编码器编码当前帧或场的 slice类型是与原始码流一致的步骤 为:
S11 : 原始流输入 NAL;
S12: 判断 NAL的 nal_unit_type是否等于 5, 若等于 5, 则编码当前帧或 场的所有 slice为 IDR slice; 若不等于 5, 执行步骤 S13;
S 13:若原始码流的帧或场的 slice类型为 I slice,则编码当前帧或场的 slice 为 I slice, 若原始码流的帧或场的 slice类型为 P slice, 则编码当前帧或场的 slice为 P slice;若原始码流的帧或场的 slice类型为 B slice,则判断 nal_ref_idc 是否等于 0, 若等于 0, 则编码当前帧或场的 slice为 B slice, 若不等于 0, 则 编码当前帧或场的 slice为 B slice, 并将当前帧或场作为参考帧插入编码器的 参考帧队列。
其中, 所述复用原始流的宏块级码流信息包括步骤:
S21: 判断原始码流中是否存在错误, 若有错误, 则解码器解码当前宏块 失败, 解码器标记当前宏块错误, 编码器使用原有的运动估计及预测模式选 择算法对宏块进行分析, 若没有错误, 则执行步骤 S22;
S22: 若当前宏块为 intra宏块, 则按照预处理后的原始码流对应位置宏 块的预测方式编码, 预处理包括:
S221 : 若当前宏块为 Intra— 4x4— DC、 Intra— 16x16— DC或 Intra— 8x8— DC的 DC预测方式, 则编码当前宏块或块为对应的 DC预测方式;
S222 : 当前宏块其它的帧内预测方式, 计算当前编码宏块及其块的 mbAddrA, mbAddrB, mbAddrC, 判断三者的 availa lity属性与原始码流对 应位置相同, 若不同, 则去掉不可得方向的预测, 均不可得使用 DC预测;
S23: 若当前宏块为 inter宏块, 则宏块级信息复用包括以下步骤:
S231 : 宏块类型的处理, 若原始流当前宏块为 P_SKIP, 则解码器标志其 类型为 P— L0_16xl6, 运动矢量为解码器中值预测的运动矢量, 若为 B— SKIP, 则解码器标志其为 B— DIRECT类型, 其它 inter类型保持不变输出给编码器;
S232: 解码器将保存的各个宏块的 8x8块的 ref_idx— k对应的参考帧的 计数传递给编码器, 编码器得到 8x8块的参考帧计数后, 从编码器参考帧队 列中寻找计数相同的帧或场, 如果存在将其作为参考帧继续执行步骤 S233, 否则使用编码器原有的运动估计过程对整个宏块进行估计;
S233: 复用 inter宏块中的运动信息;
S24: 输出编码后的宏块。
其中, 所述步骤 S233中复用 inter宏块中的运动信息的方式为: 将原始流对应宏块的运动矢量作为编码器初始预测矢量之一, 与中值预 测得到的运动矢量及其它方式得到的运动矢量使用编码器原有匹配准则进行 比较, 得到初始搜索点位置, 为初始搜索点搜索;
将原始流对应宏块的运动矢量大小整像素部分, 运动矢量参考帧., 宏块 类型, 分块模式, 参考帧索引复用, 编码器以运动矢量整数点为初始搜索点 再进行亚像素, 1/4像素搜索得到最终匹配位置;
直接复用原始流宏块的运动矢量, 分块模式, 参考帧索引及宏块类型, 计算残差。
(三)有益效果
本发明通过对原始码流的帧或场级复用和宏块级复用, 在不牺牲太多视 频画质的前提下, 加快了编码速度, 提高了编码效率。
附图说明
图 1是 H264编码器编码基本框架图;
图 2是本发明实施例的一种复用码流信息的 H264转码方法中帧或场级复 用时编码 slice类型流程图;
图 3是本发明实施例的一种复用码流信息的 H264转码方法中宏块级复 用流程图。
具体实施方式
下面结合附图和实施例, 对本发明的具体实施方式作进一步详细描述。 以下实施例用于说明本发明, 但不用来限制本发明的范围。
本发明在转换过程中, 若转码输出与原始流图像序列分辨率不变, 则使 用原始码流中帧或场级, slice级及宏块级的先验信息, 这些信息与视频序列 的运动程度, 细节精细度等图像固有属性相关, 使用这些信息减少宏块级分 析的时间, 加速再次编码过程, 并保持压缩效率损失不大。 考虑叙述的简洁 性, 以下用帧代表帧及场两种方式。 下面主要以 H264到 H264的转码为例, 进 一步说明本发明。
如图 1所示, 为 H264编码器编码框架图, 本发明的方法中对 ME ( motion estimate, 运动估计), 即 inter宏块信息复用编码, intra预测选择和帧内预测部 分码流信息复用编码, 并且对解码器的帧索引进行了处理, 其它各部分 MC (运动补偿)、 T ( DCT )及 Q (量化)等均按原来的编码方式编码。
在解码时, 对原始码流解码出的帧计数, 并用计数标记当前输出帧。 在 编码过程中,因为要复用原始码流的宏块级信息,所以编码器每帧图像的 slice 类型必须与原始码流一致, 否则将无法复用 inter块的运动矢量等信息, 编码 器编码当前帧的 slice类型与原始码流一致, 在对宏块级码流信息编码时复用 原始码流的宏块级码流信息。
编码器编码当前帧的 slice类型是与原始码流一致的步骤为如图 2所示, 包括:
步骤 S201 , 原始流输入 NAL。
步骤 S202, 判断 NAL的 nal_unit_type是否等于 5, 若等于 5, 则执行步 骤 S203, 若不等于 5, 则执行步骤 S204。
步骤 S203, 编码当前帧的所有 slice为 IDR slice。
步骤 S204, 判断原始码流的帧的 slice类型是否为 B slice, 若是, 则执行 步骤 S206, 若不是, 则执行步骤 S205。
步骤 S205, 若原始码流的帧的 slice类型为 I slice, 则编码当前帧的 slice 为 I slice, 若原始码流的帧的 slice类型为 P slice, 则编码当前帧的 slice为 P slice。
步骤 S206, 判断 nal— ref_idc是否等于 0, 若等于 0, 则执行步骤 S208, 否则执行步骤 S207。
步骤 S207,编码当前帧的 slice为 B slice, 并将当前帧作为参考帧插入编 码器的参考帧队列。
步骤 S208, 编码当前帧的 slice为 B slice.
编码器无法复用原始 h264 码流中调整参考帧序列排列顺序及参考帧序 歹 'J 调 整 方 式 的 ref _pic_list_modification_flag_lx , ad¾3tive_re^_pic— markingjnode— flag, memory— management— CQntrol—operaiion等相关信息 (参考文献: ITU-T H264 Advanced video coding for generic audiovisual services, 8.2.5.1 ),若编码 inter宏块时简单复用宏块级码流信息的 ref—idx— lx, 编码器所参考的帧并不是原始流相应宏块参考的帧, 得到的并不是原始流中 运动矢量的最佳匹配位置, 所以对原始流解码出第一帧从 0进行计数, 并用 计数标记当前输出帧, 同时宏块级在传递参考帧索引时需要做相应处理。
复用原始流的宏块级码流信息流程如图 3所示, 包括:
步骤 S301 , 输入当前帧的宏块, 即编码一帧时当前编码的宏块。
步骤 S302, 判断原始流中存在错误, 若有错, 则解码器解码当前宏块失 败,解码器标记当前宏块错误,并执行步骤 S308,若没有错误,则步骤 S303。
步骤 S303, 判断当前宏块类型, 若为 intm宏块, 则执行步骤 S304, 否 则, 执行步骤 S305。
步骤 S304, 对当前宏块进行预处理, 按照预处理后的原始码流对应位置 宏块的预测方式编码, 预处理包括:
若当前宏块为 Intra— 4x4— DC、 Intra— 16x 16— DC或 Intra— 8x8— DC的 DC预 测方式, 则编码当前宏块或块为对应的 DC预测方式。 这需要根据编码器当 前帧 slice的划分釆用标准(参考文献: ITU-T H264 Advanced video coding for generic audiovisual services, 8.3.2.2.4 ) 3种方式计算预测值。
当前宏块其它的帧内预测方式, 计算当前编码宏块及其块的 mbAddrA, mbAddrB, mbAddrC, 判断三者的 availability属性与原始码流对应位置相同, 若不同, 则去掉不可得(availiable )方向的预测, 均不可得使用 DC预测。
步骤 S305 , 此时宏块为 inter宏块, 处理 inter宏块类型, 若原始码流当 前宏块为 P— SKIP, 则解码器标志其类型为 P_L0_16xl6, 运动矢量为解码器 中值预测的运动矢量, 若为 B— SKIP, 则解码器标志其为 B_DIRECT类型, 其它 inter类型保持不变输出给编码器。
步骤 S306, 解码器将保存各个宏块的 8x8块的 ref— idx_lx对应的参考帧 的计数传递给编码器。 编码器端得到 8x8块的参考帧计数后, 从编码器参考 帧队列中寻找计数相同的帧, 如果存在将其作为参考帧继续执行步骤 S307, 若不存在, 则使用编码器原有的运动估计过程对整个宏块(inter宏块)进行 估计, 即步骤 S308。
步骤 S307, 复用 inter宏块中的运动信息。 复用 inter宏块中的运动信息 的方式为:
将原始流对应宏块的运动矢量作为编码器初始预测矢量之一, 与中值预 测得到的运动矢量及其他方式得到的运动矢量使用编码器原有匹配准则进行 比较, 得到初始搜索点位置, 为初始搜索点搜索;
将原始流对应宏块的运动矢量大小整像素部分, 运动矢量参考帧, 宏块 类型, 分块模式, 参考帧索引复用, 编码器以运动矢量整数点为初始搜索点 再进行亚像素, 1/4像素搜索得到最终匹配位置;
直接复用原始流宏块的运动矢量, 分块模式, 参考帧索引及宏块类型, 计算残差。
步骤 S308, 编码器使用原有算法对当前宏块进行分析, 即对图 1中的运 动估计及预测模式选择。
步骤 S309, 输出编码后的宏块。
本发明的复用码流信息的转码方法还适用于 VC-1、 MPEG2及 MPEG4等 的编码, VC-1 , MPEG2及 MPEG4等与 H264均基于变换编码, 运动估计的混 合编码框架。 虽然前者与 H264存标准存在较大差异, 如 DCT变换, 宏块模式 等句不同。 但是可以将前者宏块的运动矢量作为 H264运动估计时预测矢量之 一, 预测运动估计的初始搜索点。
以下对本发明的转码方法和现有的编码方法进行仿真测试及测试结果对 比。 仿真环境 windows7, Intel(R) Core(TM)2 Duo CPU E8500 @3.16GHz, memory 4GB, 解码器釆用 ffinpeg, 编码器釆用 x264对算法进行仿真。 测试 1 为本发明方法的测试结果, 测试 2为现有的全解码全编码方法的测试结果。 测 试 1和测试 2都使用相同 ffinpeg解码器、 x264参数配置及相同的测试源。 测试 1 复用原始码流帧级到宏块级的先验信息, 运动矢量复用釆用方式 c, 不进行宏 块编码模式分析及运动估计, 测试 2使用 x264默认的分析及估计过程。 表 1和 表 2为两者 PSNR (峰值信噪比)及消耗时间的对比。
表 1 本发明的复用码流信息的 H264转码方法测试结果
Figure imgf000009_0001
以上实施方式仅用于说明本发明, 而并非对本发明的限制, 有关技术领 域的普通技术人员, 在不脱离本发明的精神和范围的情况下, 还可以做出各 种变化和变型, 因此所有等同的技术方案也属于本发明的范畴, 本发明的专 利保护范围应由杈利要求限定。
工业实用性
本发明通过对原始码流的帧或场级复用和宏块级复用, 在不牺牲太多视 频画质的前提下, 加快了编码速度, 提高了编码效率。

Claims

1、 一种复用码流信息的 H264转码方法, 其特征在于, 在解码时, 对 原始码流解码出的帧或场计数, 并用计数标记当前输出帧或场, 在编码过程 中,编码器编码当前帧或场的 Slice类型与原始码流每帧或场的 slice—致,在 对宏块级码流信息编码时复用原始码流的宏块级码流信息。
2、 如权利要求 1所述的复用码流信息的 H264转码方法, 其特征在于, 所述编码器编码当前帧或场的 slice类型是与原始码流一致的步骤为:
S11: 原始流输入 NAL;
S12: 判断 NAL的 nal_unit_type是否等于 5, 若等于 5, 则编码当前帧或 场的所有 slice为 IDR slice; 若不等于 5, 执行步骤 S13;
S 13:若原始码流的帧或场的 slice类型为 I slice ,则编码当前帧或场的 slice 为 I slice, 若原始码流的帧或场的 slice类型为 P slice, 则编码当前帧或场的 slice为 P slice;若原始码流的帧或场的 slice类型为 B slice,则判断 nal— ref— idc 是否等于 0, 若等于 0, 则编码当前帧或场的 slice为 B slice, 若不等于 0, 则 编码当前帧或场的 slice为 B slice, 并将当前帧或场作为参考帧插入编码器的 参考帧队列。
3、 如权利要求 2所述的复用码流信息的 H264转码方法, 其特征在于, 所述复用原始流的宏块级码流信息包括步骤:
S21: 判断原始码流中是否存在错误, 若有错误, 则解码器解码当前宏块 失败, 解码器标记当前宏块错误, 编码器使用原有的运动估计及预测模式选 择算法对宏块进行分析, 若没有错误, 则执行步骤 S22;
S22: 若当前宏块为 intra宏块, 则按照预处理后的原始码流对应位置宏 块的预测方式编码, 预处理包括:
S221 : 若当前宏块为 Intra— 4x4— DC、 Intra— 16x16— DC或 Intra— 8x8— DC的 DC预测方式, 则编码当前宏块或块为对应的 DC预测方式;
S222: 当前宏块其它的帧内预测方式, 计算当前编码宏块及其块的 mbAddrA, mbAddrB, mbAddrC, 判断三者的 availability属性与原始码流对 应位置相同, 若不同, 则去掉不可得方向的预测, 均不可得使用 DC预测; S23: 若当前宏块为 inter宏块, 则宏块级信息复用包括以下步骤:
S231 : 宏块类型的处理, 若原始流当前宏块为 P_SKIP, 则解码器标志其 类型为 P_L0_16xl6, 运动矢量为解码器中值预测的运动矢量, 若为 B_SKIP, 则解码器标志其为 B— DIRECT类型, 其它 inter类型保持不变输出给编码器; S232: 解码器将保存的各个宏块的 8x8块的 ref_idx— lx对应的参考帧的 计数传递给编码器, 编码器得到 8x8块的参考帧计数后, 从编码器参考帧队 列中寻找计数相同的帧或场, 如果存在将其作为参考帧继续执行步骤 S233, 否则使用编码器原有的运动估计过程对整个宏块进行估计;
S233: 复用 inter宏块中的运动信息;
S24: 输出编码后的宏块。
4、 如权利要求 3所述的复用码流信息的 H264转码方法, 其特征在于, 所述步骤 S233中复用 inter宏块中的运动信息的方式为:
将原始流对应宏块的运动矢量作为编码器初始预测矢量之一, 与中值预 测得到的运动矢量及其它方式得到的运动矢量使用编码器原有匹配准则进行 比较, 得到初始搜索点位置, 为初始搜索点搜索;
将原始流对应宏块的运动矢量大小整像素部分, 运动矢量参考帧, 宏块 类型, 分块模式, 参考帧索引复用, 编码器以运动矢量整数点为初始搜索点 再进行亚像素, 1/4像素搜索得到最终匹配位置;
直接复用原始流宏块的运动矢量, 分块模式, 参考帧索引及宏块类型, 计算残差。
PCT/CN2010/002244 2010-12-31 2010-12-31 复用码流信息的h264转码方法 WO2012088649A1 (zh)

Priority Applications (6)

Application Number Priority Date Filing Date Title
EP10861264.9A EP2661079A1 (en) 2010-12-31 2010-12-31 H264 transcoding method by multiplexing code stream information
CA2817790A CA2817790A1 (en) 2010-12-31 2010-12-31 Method for h264 transcoding with code stream information reuse
PCT/CN2010/002244 WO2012088649A1 (zh) 2010-12-31 2010-12-31 复用码流信息的h264转码方法
JP2013546546A JP2014504815A (ja) 2010-12-31 2010-12-31 コードストリーム情報の再利用によるh264トランスコード方法
CN201080057348.4A CN102696226B (zh) 2010-12-31 2010-12-31 复用码流信息的h264转码方法
US13/988,550 US20130243099A1 (en) 2010-12-31 2010-12-31 Method for h264 transcoding with code stream information reuse

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2010/002244 WO2012088649A1 (zh) 2010-12-31 2010-12-31 复用码流信息的h264转码方法

Publications (1)

Publication Number Publication Date
WO2012088649A1 true WO2012088649A1 (zh) 2012-07-05

Family

ID=46382167

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/002244 WO2012088649A1 (zh) 2010-12-31 2010-12-31 复用码流信息的h264转码方法

Country Status (6)

Country Link
US (1) US20130243099A1 (zh)
EP (1) EP2661079A1 (zh)
JP (1) JP2014504815A (zh)
CN (1) CN102696226B (zh)
CA (1) CA2817790A1 (zh)
WO (1) WO2012088649A1 (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120281761A1 (en) * 2011-05-02 2012-11-08 Futurewei Technologies, Inc. System and Method for Macroblock Transcoding
CN103686204A (zh) * 2013-12-20 2014-03-26 乐视网信息技术(北京)股份有限公司 基于转码失败的智能重试的方法和系统
US20150271491A1 (en) * 2014-03-24 2015-09-24 Ati Technologies Ulc Enhanced intra prediction mode selection for use in video transcoding
US9712828B2 (en) * 2015-05-27 2017-07-18 Indian Statistical Institute Foreground motion detection in compressed video data
US10531095B2 (en) * 2015-11-17 2020-01-07 Nbcuniversal Media, Llc System and method for optimal variable bit rate packing
CN107277534A (zh) * 2017-06-15 2017-10-20 深圳市潮流网络技术有限公司 一种视频转码方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050169374A1 (en) * 2004-01-30 2005-08-04 Detlev Marpe Video frame encoding and decoding
CN1700771A (zh) * 2005-05-23 2005-11-23 上海广电(集团)有限公司中央研究院 一种增强像素域码流转换方法
CN101621687A (zh) * 2008-08-18 2010-01-06 深圳市铁越电气有限公司 H.264到avs视频码流转换方法及其装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101668215A (zh) * 2003-02-18 2010-03-10 诺基亚有限公司 图像解码方法
CN101578884B (zh) * 2007-01-08 2015-03-04 诺基亚公司 提供和使用译码的媒体流的互操作点的预定信令的系统和方法
TW200836130A (en) * 2007-02-16 2008-09-01 Thomson Licensing Bitrate reduction method by requantization
JP4935746B2 (ja) * 2008-04-07 2012-05-23 富士通株式会社 動画像符号化装置、動画像復号化装置及びその符号化、復号化方法
JP2010062871A (ja) * 2008-09-03 2010-03-18 Panasonic Corp より高いピクチャレートの圧縮hd映像を、h.264規格を用いるレガシーhd映像デコーダでの復号に対応可能な、より低いピクチャレートの圧縮映像に変換する方法および装置
CN101557512B (zh) * 2009-05-19 2011-07-20 武汉长江通信产业集团股份有限公司 视频终端接收视频数据延时的处理方法
CN101600109A (zh) * 2009-07-13 2009-12-09 北京工业大学 基于纹理和运动特征的h.264降尺寸转码方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050169374A1 (en) * 2004-01-30 2005-08-04 Detlev Marpe Video frame encoding and decoding
CN1700771A (zh) * 2005-05-23 2005-11-23 上海广电(集团)有限公司中央研究院 一种增强像素域码流转换方法
CN101621687A (zh) * 2008-08-18 2010-01-06 深圳市铁越电气有限公司 H.264到avs视频码流转换方法及其装置

Also Published As

Publication number Publication date
JP2014504815A (ja) 2014-02-24
CN102696226A (zh) 2012-09-26
CA2817790A1 (en) 2012-07-05
EP2661079A1 (en) 2013-11-06
CN102696226B (zh) 2015-12-02
US20130243099A1 (en) 2013-09-19

Similar Documents

Publication Publication Date Title
CN103248893B (zh) 从h.264/avc标准到hevc标准的快速帧间转码方法及其转码器
CN101584219B (zh) 基于帧内预测进行编码和解码的方法和设备
JP5368482B2 (ja) ビデオ符号化および復号におけるインプリシットなブロック分割のための方法および装置
JP5061179B2 (ja) 照明変化補償動き予測符号化および復号化方法とその装置
TWI597969B (zh) 視訊解碼裝置
WO2009124511A1 (zh) 一种帧间预测编解码方法、装置及系统
CN104038764B (zh) 一种h.264到h.265的视频转码方法及转码器
TWI230547B (en) Low-complexity spatial downscaling video transcoder and method thereof
He et al. Framework of AVS2-video coding
WO2009052742A1 (en) An interframe prediction encoding/decoding method and apparatus
KR20110071231A (ko) 부호화 방법, 복호화 방법 및 장치
WO2012088649A1 (zh) 复用码流信息的h264转码方法
KR20050112130A (ko) 비디오 트랜스코딩
US20140003518A1 (en) Image encoding method using a skip mode, and a device using the method
CN113965763A (zh) 视频转码的跨编解码器编码优化
KR20140044775A (ko) 디지털화된 이미지들의 시퀀스를 코딩하기 위한 방법
CN110351552B (zh) 视频编码中一种快速编码方法
CN109495745B (zh) 一种基于逆量化/逆变换的无损压缩解码方法
KR101078525B1 (ko) 다중시점 영상의 부호화 방법
JP2015139013A (ja) 動画符号化装置、及び動画符号化プログラム
RU2782400C2 (ru) Способ кодирования и декодирования изображений, устройство кодирования и декодирования и соответствующие компьютерные программы
Zhang et al. Overview of the IEEE 1857 surveillance groups
Moiron et al. Low-complexity video content adaptation for legacy user equipment
KR101390195B1 (ko) 인트라 예측 부호화, 복호화 방법 및 장치
Moiron et al. Inter mode conversion of H. 264 to MPEG-2 video with reduced complexity

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201080057348.4

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10861264

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2817790

Country of ref document: CA

WWE Wipo information: entry into national phase

Ref document number: 13988550

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2010861264

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2010861264

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2013546546

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE