[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104144347B - A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data - Google Patents

A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data Download PDF

Info

Publication number
CN104144347B
CN104144347B CN201410287578.XA CN201410287578A CN104144347B CN 104144347 B CN104144347 B CN 104144347B CN 201410287578 A CN201410287578 A CN 201410287578A CN 104144347 B CN104144347 B CN 104144347B
Authority
CN
China
Prior art keywords
macroblock
block
current macroblock
feature information
vector
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.)
Active
Application number
CN201410287578.XA
Other languages
Chinese (zh)
Other versions
CN104144347A (en
Inventor
王让定
李然然
徐达文
李倩
李伟
王家骥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo University
Original Assignee
Ningbo University
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 Ningbo University filed Critical Ningbo University
Priority to CN201410287578.XA priority Critical patent/CN104144347B/en
Publication of CN104144347A publication Critical patent/CN104144347A/en
Application granted granted Critical
Publication of CN104144347B publication Critical patent/CN104144347B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法,其在编码端,先提取宏块的特征向量和确定宏块的宿主向量,然后将上一个宏块的特征向量嵌入到当前的宏块的宿主向量中;在解码端,从嵌有特征信息的I帧中的宏块中提取出特征信息,并确定宏块的编码模式和亮度预测模式,再对非正确解码块进行错误恢复;优点是在编码端,提取的宏块的特征信息由宏块的子块的亮度预测模式或由宏块的编码模式和亮度预测模式确定,能有效恢复存在场景变换时丢失的宏块,并在向宿主向量中嵌入特征向量时,根据上一个宏块的编码模式,采用广义差分扩展的方法进行嵌入,不仅使得嵌入容量可控,而且可以实现提取特征信息后,还原I帧嵌入特征信息前的原始数据。

The present invention discloses a H.264/AVC video I frame error recovery method based on reversible data hiding. At the encoding end, first extract the feature vector of the macroblock and determine the host vector of the macroblock, and then convert the previous macroblock The feature vector is embedded into the host vector of the current macroblock; at the decoding end, the feature information is extracted from the macroblock in the I frame embedded with feature information, and the coding mode and brightness prediction mode of the macroblock are determined, and then the non- Correctly decode the block for error recovery; the advantage is that at the encoding end, the feature information of the extracted macroblock is determined by the luminance prediction mode of the sub-block of the macroblock or by the encoding mode and luminance prediction mode of the macroblock, which can effectively recover when there is a scene change. The missing macroblock, and when embedding the feature vector into the host vector, according to the encoding mode of the previous macroblock, the method of generalized differential expansion is used to embed, which not only makes the embedding capacity controllable, but also realizes the extraction of feature information. I-frame raw data before embedding feature information.

Description

一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法A H.264/AVC Video I Frame Error Recovery Method Based on Reversible Data Hiding

技术领域technical field

本发明涉及一种视频网络传输过程中的错误复原及隐秘通信技术,尤其是涉及一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法。The invention relates to an error recovery and covert communication technology in the video network transmission process, in particular to an H.264/AVC video I frame error recovery method based on reversible data hiding.

背景技术Background technique

随着多媒体技术日趋成熟以及用户需求的驱动,无线视频通信得到了越来越多的关注。但是无线通信网络和互联网的传输信道并不可靠,H.264/AVC视频码流在通信信道上传输时,特别是在具有较大噪声干扰的窄带信道或有可能丢包的信道(Internet)上传输时,信道干扰、网络拥塞和路由选择延迟等问题会导致随机比特错误、突发性差错等误码现象的发生。With the maturity of multimedia technology and the drive of user needs, wireless video communication has received more and more attention. However, the transmission channel of the wireless communication network and the Internet is not reliable. When the H.264/AVC video stream is transmitted on the communication channel, especially on a narrowband channel with large noise interference or a channel that may lose packets (Internet) During transmission, problems such as channel interference, network congestion, and routing delays can cause random bit errors, burst errors, and other bit errors.

高效的H.264/AVC视频编码标准对视频码流完整性的依赖较强,一旦发生丢包或误码,对视频质量的影响非常大。这是因为:一方面,H.264/AVC采用可变长编码(VLC,Variable Length Coding)来提高编码效率,但是由于变长编码的每个VLC码字具有不同的长度,因此若其中某些比特位出现错误,则解码器无法正确跳过出错码字,从而使VLC码字失去同步,导致后面的比特流无法正确解码;另一方面,H.264/AVC采用帧内预测、运动估计、运动矢量预测等预测技术,使得后面的数据在编码时要参考前面的数据,如果某部分数据出现错误,则不仅自身不能正确解码,而且其后面的数据也将受到影响,并且这种影响会一直持续到后续多帧。上述情况都将直接地导致视频信息的错误解码,使视频信号的重建质量急剧下降,严重时甚至会导致整个视频通信完全失效。因此,如何降低或者消除传输错误的影响是低码率视频通信应用中一个重要的研究方向。The efficient H.264/AVC video coding standard relies heavily on the integrity of the video code stream. Once packet loss or code error occurs, it will have a great impact on the video quality. This is because: on the one hand, H.264/AVC adopts variable length coding (VLC, Variable Length Coding) to improve coding efficiency, but because each VLC code word of variable length coding has different lengths, so if some of them If there is an error in the bit, the decoder cannot correctly skip the erroneous codeword, which will cause the VLC codeword to lose synchronization, resulting in the inability to decode the subsequent bit stream correctly; on the other hand, H.264/AVC uses intra-frame prediction, motion estimation, Motion vector prediction and other prediction technologies make the following data refer to the previous data when encoding. If some part of the data is wrong, not only will it not be able to decode correctly, but the subsequent data will also be affected, and this effect will continue. Continues for subsequent multiple frames. All of the above situations will directly lead to wrong decoding of video information, sharply reduce the reconstruction quality of video signal, and even lead to complete failure of the entire video communication in severe cases. Therefore, how to reduce or eliminate the impact of transmission errors is an important research direction in low-bit-rate video communication applications.

尽管目前已出现了一些针对H.264/AVC视频的错误恢复方法,例如在解码端利用视频内容相关性进行错误恢复;在编码端和解码端之间建立反馈通道的交互式错误恢复;利用信息隐藏技术,在编码端提取适于错误恢复的特征信息,通过信息隐藏的方式,将特征信息传递给解码端用于错误恢复。其中,基于信息隐藏技术进行错误恢复的方法,由于编码端的信息较解码端丰富、准确,是一种新的处理视频错误恢复的思路。Lin等人引用基于差分扩展的可逆数据隐藏方法来嵌入特征信息,但由于特征信息是像素值,导致嵌入的特征信息比特数非常多,因此使用了多层差分,计算相对复杂。Chen等人提出了一种有效的错误恢复方法,该方法将计算得到的I帧中的每个宏块的运动矢量(Motion vector,MV)作为重要特征数据,采用环路的方式嵌入到同一帧其他宏块中,嵌入方法采用的是奇偶嵌入法,由于嵌入信息后永久性的改变了视频载体原始的量化DCT(Discrete Cosine Transform)系数值,因此在提取信息后,会影响重建的视频质量。Chung等人在此基础上采用直方图平移的可逆信息隐藏方法,将宏块的运动矢量嵌入到值为零的量化DCT系数中,但该方法需要修改很多量化DCT系数,这样不仅会影响视频的不可感知性,而且会增加传输码率。因此,基于信息隐藏技术进行错误恢复的方法在提取有效特征、选择合适的嵌入方法和嵌入位置、提高视频重建质量等方面仍有改善的空间。Although there have been some error recovery methods for H.264/AVC video, such as error recovery using video content correlation at the decoding end; interactive error recovery with a feedback channel between the encoding end and decoding end; using information Concealment technology extracts feature information suitable for error recovery at the encoding end, and passes the feature information to the decoding end for error recovery through information hiding. Among them, the method of error recovery based on information hiding technology is a new way of dealing with video error recovery because the information at the encoding end is richer and more accurate than that at the decoding end. Lin et al. cited a reversible data hiding method based on differential expansion to embed feature information, but since the feature information is a pixel value, the number of embedded feature information bits is very large, so multi-layer difference is used, and the calculation is relatively complicated. Chen et al. proposed an effective error recovery method, which uses the calculated motion vector (Motion vector, MV) of each macroblock in the I frame as important feature data, and embeds it into the same frame in a loop manner In other macroblocks, the embedding method adopts the odd-even embedding method. Since the original quantized DCT (Discrete Cosine Transform) coefficient value of the video carrier is permanently changed after the information is embedded, the quality of the reconstructed video will be affected after the information is extracted. On this basis, Chung et al. used the reversible information hiding method of histogram translation to embed the motion vector of the macroblock into the quantized DCT coefficient with a value of zero, but this method needs to modify many quantized DCT coefficients, which will not only affect the quality of the video imperceptible, and will increase the transmission bit rate. Therefore, error recovery methods based on information hiding techniques still have room for improvement in terms of extracting effective features, selecting appropriate embedding methods and embedding locations, and improving video reconstruction quality.

发明内容Contents of the invention

本发明所要解决的技术问题是提供一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法,在存在场景变换时,其提取出的特征信息能高效恢复I帧中丢失的宏块,提升了I帧错误恢复质量,且其在提取出特征信息后,能够还原I帧宏块在嵌入特征信息前的原始数据。The technical problem to be solved by the present invention is to provide a method for recovering H.264/AVC video I frame errors based on reversible data hiding. When there is a scene change, the extracted feature information can efficiently recover lost macroblocks in the I frame. , which improves the quality of I frame error recovery, and after extracting the feature information, it can restore the original data of the I frame macroblock before embedding the feature information.

本发明解决上述技术问题所采用的技术方案为:一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法,其特征在于包括以下步骤:The technical scheme that the present invention solves the problems of the technologies described above is: a kind of H.264/AVC video I frame error recovery method based on reversible data hiding, it is characterized in that comprising the following steps:

①在编码端,向I帧中除第1个宏块外的每个宏块中嵌入特征信息,得到嵌有特征信息的I帧,具体过程为:① At the encoding end, embed feature information into each macroblock except the first macroblock in the I frame to obtain an I frame embedded with feature information. The specific process is as follows:

①-1、将I帧中当前预编码完成的第k个宏块定义为当前宏块,其中,1≤k≤K,在此K表示I帧中包含的宏块的总个数,k的初始值为1;①-1. Define the kth macroblock that is currently pre-encoded in the I frame as the current macroblock, where 1≤k≤K, where K represents the total number of macroblocks contained in the I frame, and k The initial value is 1;

①-2、将当前宏块的CBP的十进制值转化为由6位二进制值组成的二进制串,并记为A,A=a1a2a3a4a5a6,其中,a1为A的最高位二进制值,a6为A的最低位二进制值;①-2. Convert the decimal value of the CBP of the current macroblock into a binary string composed of 6-bit binary values, and record it as A, A=a 1 a 2 a 3 a 4 a 5 a 6 , where a 1 is The highest binary value of A, a 6 is the lowest binary value of A;

①-3、提取当前宏块的特征向量:如果当前宏块的编码模式为Intra4×4,则提取当前宏块中编号为0、4、8、12这四个4×4块各自的亮度预测模式的数字标识,然后将这四个4×4块各自的亮度预测模式的数字标识量化为4个比特,之后按这四个4×4块在当前宏块中的编号的顺序将这四个4×4块的亮度预测模式以比特表示的数字标识排列构成一个包含16个元素的一维向量,再将该一维向量作为当前宏块的特征向量,记为其中,对应表示当前宏块的特征向量wIntra4×4(k)中的第1个元素、第2个元素和第16个元素;①-3. Extract the feature vector of the current macroblock: if the encoding mode of the current macroblock is Intra4×4, then extract the respective luminance predictions of the four 4×4 blocks numbered 0, 4, 8, and 12 in the current macroblock The digital identification of the mode, and then quantize the digital identification of the respective luma prediction modes of the four 4×4 blocks into 4 bits, and then the four 4×4 blocks are numbered in the order of the current macroblock. The luminance prediction mode of the 4×4 block is arranged with digital signs represented by bits to form a one-dimensional vector containing 16 elements, and then the one-dimensional vector is used as the feature vector of the current macroblock, which is recorded as in, with Correspondingly represent the first element, the second element and the 16th element in the feature vector w Intra4×4 (k) of the current macroblock;

如果当前宏块的编码模式为Intra16×16,则用数字9标识当前宏块的编码模式,然后将当前宏块的编码模式的数字标识量化为4个比特,并将当前宏块的亮度预测模式的数字标识量化为4个比特,之后按先后顺序将当前宏块的编码模式以比特表示的数字标识和当前宏块的亮度预测模式以比特表示的数字标识排列构成一个包含8个元素的一维向量,再将该一维向量作为当前宏块的特征向量,记为wIntra16×16(k),其中,对应表示当前宏块的特征向量wIntra16×16(k)中的第1个元素、第2个元素和第8个元素;If the encoding mode of the current macroblock is Intra16×16, the number 9 is used to identify the encoding mode of the current macroblock, and then the digital identification of the encoding mode of the current macroblock is quantized to 4 bits, and the brightness prediction mode of the current macroblock is The digital identification of the current macroblock is quantized into 4 bits, and then the current macroblock coding mode and the current macroblock's luminance prediction mode are arranged in order to form a one-dimensional matrix containing 8 elements. vector, and then use the one-dimensional vector as the feature vector of the current macroblock, denoted as w Intra16×16 (k), in, with Correspondingly represent the first element, the second element and the eighth element in the feature vector w Intra16×16 (k) of the current macroblock;

①-4、确定当前宏块的宿主向量:计算当前宏块中的每个4×4块的所有交流DCT系数的绝对值的和,将和值最大的4×4块作为特征信息嵌入块,然后以zig-zag方式扫描特征信息嵌入块中的所有量化DCT系数,之后按zig-zag方式扫描的顺序将特征信息嵌入块中的第8个至第16个量化DCT系数排列构成一个包含9个元素的一维向量,再将该一维向量作为当前宏块的宿主向量,记为x(k),x(k)=(x1x2…x9),其中,x1、x2和x9对应表示当前宏块的宿主向量x(k)中的第1个元素、第2个元素和第9个元素;①-4. Determine the host vector of the current macroblock: calculate the sum of the absolute values of all AC DCT coefficients of each 4×4 block in the current macroblock, and embed the 4×4 block with the largest sum value as the feature information into the block, Then scan all the quantized DCT coefficients in the feature information embedding block in zig-zag mode, and then arrange the 8th to 16th quantized DCT coefficients in the feature information embedding block in the order of zig-zag scanning to form a set containing 9 The one-dimensional vector of the element, and then use the one-dimensional vector as the host vector of the current macroblock, which is recorded as x(k), x(k)=(x 1 x 2 ... x 9 ), where x 1 , x 2 and x 9 corresponds to the first element, the second element and the ninth element in the host vector x(k) of the current macroblock;

①-5、将当前宏块的上一个宏块的特征向量嵌入到当前宏块的宿主向量中:判断当前宏块是否为I帧中的第1个宏块,如果是,则对当前宏块不作处理,直接执行步骤①-7;否则,若当前宏块的上一个宏块的编码模式为Intra4×4,则采用两次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中,得到当前宏块对应的嵌有特征信息的向量然后用中的所有元素按序替换当前宏块中的特征信息嵌入块中的第8个至第16个量化DCT系数,再执行步骤①-6;若当前宏块的上一个宏块的编码模式为Intra16×16,则采用一次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中,得到当前宏块对应的嵌有特征信息的向量然后用中的所有元素按序替换当前宏块中的特征信息嵌入块中的第8个至第16个量化DCT系数,再执行步骤①-6;①-5. Embed the eigenvector of the previous macroblock of the current macroblock into the host vector of the current macroblock: determine whether the current macroblock is the first macroblock in the I frame, and if so, perform Do not process, directly execute steps ①-7; otherwise, if the coding mode of the previous macroblock of the current macroblock is Intra4×4, use the method of two generalized difference extensions to convert the feature vector of the previous macroblock of the current macroblock w Intra4×4 (k-1) is embedded into the host vector x(k) of the current macroblock to obtain the vector embedded with feature information corresponding to the current macroblock then use Replace all the elements in the current macroblock in sequence with the 8th to 16th quantized DCT coefficients in the feature information embedding block, and then perform steps ①-6; if the coding mode of the previous macroblock of the current macroblock is Intra16 ×16, then use a generalized differential extension method to embed the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock to obtain the current macroblock The corresponding vector embedded with feature information then use All elements in replace the 8th to 16th quantized DCT coefficients in the feature information embedding block in the current macroblock in order, and then perform steps ①-6;

①-6、修改当前宏块的CBP,然后执行步骤①-7;①-6. Modify the CBP of the current macroblock, and then perform steps ①-7;

①-7、对当前宏块进行熵编码;①-7. Entropy encoding is performed on the current macroblock;

①-8、令k=k+1,将I帧中下一个预编码完成的宏块作为当前宏块,再返回步骤①-2继续执行,直至I帧中的所有预编码完成的宏块处理完毕,得到嵌有特征信息的I帧的编码码流,其中,k=k+1中的“=”为赋值符号;①-8. Make k=k+1, use the next pre-encoded macroblock in the I frame as the current macroblock, and return to step ①-2 to continue until all pre-encoded macroblocks in the I frame are processed Complete, obtain the coded stream of the I frame that is embedded with feature information, wherein, "=" in k=k+1 is the assignment symbol;

②在解码端,从嵌有特征信息的I帧中的每个宏块中提取出特征信息,并确定每个宏块的编码模式和亮度预测模式,再对非正确解码块进行错误恢复,具体过程为:② At the decoding end, feature information is extracted from each macroblock in the I frame embedded with feature information, and the coding mode and brightness prediction mode of each macroblock are determined, and then error recovery is performed on incorrectly decoded blocks, specifically The process is:

②-1、对嵌有特征信息的I帧中的每个宏块进行熵解码,然后确定熵解码后的每个宏块是否为正确解码块,接着确定除熵解码后的第1个宏块外的每个正确解码块的包含有特征信息的向量,再从除熵解码后的第1个宏块外的每个正确解码块的包含有特征信息的向量中提取出特征信息,并确定除熵解码后的第1个宏块外的每个正确解码块的上一个宏块的编码模式和亮度预测模式,假设熵解码后的第k'个宏块为正确解码块,则②-1. Perform entropy decoding on each macroblock in the I frame embedded with feature information, then determine whether each macroblock after entropy decoding is a correct decoded block, and then determine the first macroblock after entropy-decoding The vector containing feature information of each correctly decoded block except the first macroblock after entropy decoding extracts the feature information from the vector containing feature information of each correctly decoded block except the first macroblock after entropy decoding, and determines The encoding mode and brightness prediction mode of the previous macroblock of each correctly decoded block outside the first macroblock after entropy decoding, assuming that the k'th macroblock after entropy decoding is a correctly decoded block, then

确定该宏块的包含有特征信息的向量的具体过程为:计算该宏块中的每个4×4块的所有经反量化后为交流DCT系数的量化DCT系数的绝对值的和,将和值最大的4×4块作为特征信息提取块,然后以zig-zag方式扫描特征信息提取块中的所有量化DCT系数,之后按zig-zag方式扫描的顺序将特征信息提取块中的第8个至第16个量化DCT系数排列构成一个包含9个元素的一维向量,再将该一维向量作为该宏块的包含有特征信息的向量,记为其中,对应表示中的第1个元素、第2个元素和第9个元素;The specific process of determining the vector containing feature information of the macroblock is: calculating the sum of the absolute values of all the quantized DCT coefficients of each 4×4 block in the macroblock which are dequantized as AC DCT coefficients, and the sum The 4×4 block with the largest value is used as the feature information extraction block, and then all quantized DCT coefficients in the feature information extraction block are scanned in zig-zag mode, and then the eighth one in the feature information extraction block is scanned in the order of zig-zag mode The 16th quantized DCT coefficients are arranged to form a one-dimensional vector containing 9 elements, and then the one-dimensional vector is used as the vector containing feature information of the macroblock, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 9th element in ;

从该宏块的包含有特征信息的向量中提取出特征信息,并确定该宏块的上一个宏块的编码模式和亮度预测模式;The vector containing feature information from the macroblock Extract feature information from the macroblock, and determine the encoding mode and brightness prediction mode of the previous macroblock of the macroblock;

上述,2≤k'≤K;Above, 2≤k'≤K;

②-2、将解码后的I帧中的第k个宏块定义为当前宏块,其中,1≤k≤K,k的初始值为1;②-2. Define the kth macroblock in the decoded I frame as the current macroblock, wherein, 1≤k≤K, and the initial value of k is 1;

②-3、判断当前宏块是否为解码后的I帧中的最后一个宏块,如果当前宏块不是最后一个宏块,则执行步骤②-4,如果当前宏块是最后一个宏块,则执行步骤②-5;②-3, judge whether the current macroblock is the last macroblock in the decoded I frame, if the current macroblock is not the last macroblock, then perform step ②-4, if the current macroblock is the last macroblock, then Execute steps ②-5;

②-4、判断当前宏块为正确解码块还是为非正确解码块,如果当前宏块为正确解码块,则对当前宏块不作处理,然后执行步骤②-6;②-4. Determine whether the current macroblock is a correctly decoded block or an incorrectly decoded block. If the current macroblock is a correctly decoded block, then do not process the current macroblock, and then perform step ②-6;

如果当前宏块为非正确解码块,则判断当前宏块的下一个宏块为正确解码块还是为非正确解码块,如果当前宏块的下一个宏块为正确解码块,则利用当前宏块的编码模式和亮度预测模式恢复当前宏块,然后执行步骤②-6;如果当前宏块的下一个宏块为非正确解码块,则采用双线性内插法恢复当前宏块;If the current macroblock is an incorrectly decoded block, then determine whether the next macroblock of the current macroblock is a correctly decoded block or an incorrectly decoded block, and if the next macroblock of the current macroblock is a correctly decoded block, use the current macroblock The encoding mode and brightness prediction mode restore the current macroblock, and then perform step ②-6; if the next macroblock of the current macroblock is an incorrectly decoded block, use bilinear interpolation to restore the current macroblock;

②-5、判断当前宏块为正确解码块还是为非正确解码块,如果当前宏块为正确解码块,则对当前宏块不作处理,至此完成解码后的I帧中的所有非正确解码块的恢复;如果当前宏块为非正确解码块,则采用双线性内插法恢复当前宏块,至此完成解码后的I帧中的所有非正确解码块的恢复;②-5. Determine whether the current macroblock is a correctly decoded block or an incorrectly decoded block. If the current macroblock is a correctly decoded block, the current macroblock is not processed. So far, all incorrectly decoded blocks in the decoded I frame are completed recovery; if the current macroblock is an incorrectly decoded block, the bilinear interpolation method is used to restore the current macroblock, and the recovery of all incorrectly decoded blocks in the decoded I frame is completed so far;

②-6、令k=k+1,将解码后的I帧中的下一个待处理的宏块作为当前宏块,然后返回步骤②-3继续执行,其中,k=k+1中的“=”为赋值符号。②-6, make k=k+1, use the next macroblock to be processed in the decoded I frame as the current macroblock, then return to step ②-3 to continue execution, wherein, " in k=k+1 =" is an assignment symbol.

所述的步骤①-5中采用两次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中的具体过程为:In the step ①-5, the method of two generalized differential extensions is used to embed the feature vector w Intra4×4 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock The specific process is:

A1、对x(k)进行正变换,得到向量y(k),y(k)=(y1y2…y9),其中,y1、y2和y9对应表示y(k)中的第1个元素、第2个元素和第9个元素,y2=x2-x1,yi'=xi'-x1,y9=x9-x1,2≤i'≤9,αi为权值,符号为向下取整符号;A1. Carry out positive transformation to x(k) to obtain vector y(k), y(k)=(y 1 y 2 ... y 9 ), wherein, y 1 , y 2 and y 9 correspond to y(k) The 1st element, the 2nd element and the 9th element of the , y 2 =x 2 -x 1 , y i'xi' -x 1 , y 9 =x 9 -x 1 , 2≤i'≤9, α i is weight, symbol is the rounding down symbol;

A2、将wIntra4×4(k-1)中的第1个元素至第8个元素嵌入到y(k)中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9,对应表示wIntra4×4(k-1)中的第1个元素、第i'-1个元素和第8个元素;A2. Embed the first to eighth elements of w Intra4×4 (k-1) into y(k) to get a vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represents the first element, the i'-1th element and the 8th element in w Intra4×4 (k-1);

A3、对进行逆变换,得到嵌有部分特征信息的向量其中,对应表示中的第1个元素、第2个元素和第9个元素,A3, yes Perform an inverse transformation to obtain a vector embedded with part of the feature information in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the ,

2≤i'≤9; 2≤i'≤9;

A4、对进行正变换,得到向量其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值;A4, yes Perform forward transformation to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight;

A5、将wIntra4×4(k-1)中的第9个元素至第16个元素嵌入到中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9,对应表示wIntra4×4(k-1)中的第9个元素、第i'+7个元素和第16个元素;A5. Embed the 9th to 16th elements in w Intra4×4 (k-1) into , get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represent the 9th element, the i'+7th element and the 16th element in w Intra4×4 (k-1);

A6、对进行逆变换,得到当前宏块对应的嵌有特征信息的向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9。A6, yes Perform inverse transformation to obtain the vector embedded with feature information corresponding to the current macroblock in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9.

所述的步骤①-5中采用一次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中的具体过程为:In the step ①-5, the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock is embedded into the host vector x(k) of the current macroblock by using a generalized differential extension method The specific process is:

B1、对x(k)进行正变换,得到向量y(k),y(k)=(y1y2…y9),其中,y1、y2和y9对应表示y(k)中的第1个元素、第2个元素和第9个元素,yi'=xi'-x1,y9=x9-x1,2≤i'≤9,αi为权值,符号为向下取整符号;B1. Carry out positive transformation on x(k) to obtain vector y(k), y(k)=(y 1 y 2 ... y 9 ), wherein, y 1 , y 2 and y 9 correspond to y(k) The 1st element, the 2nd element and the 9th element of the , y i' =x i' -x 1 , y 9 =x 9 -x 1 , 2≤i'≤9, α i is weight, symbol is the rounding down symbol;

B2、将wIntra16×16(k-1)嵌入到y(k)中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,对应表示wIntra16×16(k-1)中的第1个元素、第i'-1个元素和第8个元素;B2. Embed w Intra16×16 (k-1) into y(k) to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represents the first element, the i'-1th element and the 8th element in w Intra16×16 (k-1);

B3、对进行逆变换,得到当前宏块对应的嵌有特征信息的向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9。B3, yes Perform inverse transformation to obtain the vector embedded with feature information corresponding to the current macroblock in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9.

所述的步骤①-6中修改当前宏块的CBP的具体过程为:The specific process of modifying the CBP of the current macroblock in the described step 1.-6 is:

①-6a、如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中左上角位置的8×8块,则统计当前宏块嵌入特征信息后左上角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a6置为0,a3,a4,a5保持不变,如果不全为0,则将A中的a6置为1,a3,a4,a5保持不变;①-6a. If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the upper left corner of the current macroblock, then count the 8×8 at the upper left corner of the current macroblock after embedding the feature information Whether all the quantized DCT coefficients in the block are all 0, if all are 0, set a 6 in A to 0, a 3 , a 4 , a 5 remain unchanged, if not all 0, set a 6 in A a 6 is set to 1, a 3 , a 4 , a 5 remain unchanged;

如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中右上角位置的8×8块,则统计当前宏块嵌入特征信息后右上角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a5置为0,a3,a4,a6保持不变,如果不全为0,则将A中的a5置为1,a3,a4,a6保持不变;If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block in the upper right corner of the current macroblock, then count all the 8×8 blocks in the upper right corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 5 in A to 0, a 3 , a 4 , a 6 remain unchanged, if they are not all 0, set a 5 in A to 0 1, a 3 , a 4 , a 6 remain unchanged;

如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中左下角位置的8×8块,则统计当前宏块嵌入特征信息后左下角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a4置为0,a3,a5,a6保持不变,如果不全为0,则将A中的a4置为1,a3,a5,a6保持不变;If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the lower left corner of the current macroblock, then count all the 8×8 blocks at the lower left corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 4 in A to 0, a 3 , a 5 , a 6 remain unchanged, if they are not all 0, set a 4 in A to 0 1, a 3 , a 5 , a 6 remain unchanged;

如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中右下角位置的8×8块,则统计当前宏块嵌入特征信息后右下角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a3置为0,a4,a5,a6保持不变,如果不全为0,则将A中的a3置为1,a4,a5,a6保持不变;If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the lower right corner of the current macroblock, then count all the 8×8 blocks at the lower right corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 3 in A to 0, a 4 , a 5 , a 6 remain unchanged, if they are not all 0, set a 3 in A to 0 1, a 4 , a 5 , a 6 remain unchanged;

①-6b、将修改后的A转化成十进制数,得到当前宏块修改后的CBP。①-6b. Convert the modified A into a decimal number to obtain the modified CBP of the current macroblock.

所述的步骤②-1中从该宏块的包含有特征信息的向量中提取出特征信息,并确定该宏块的上一个宏块的编码模式和亮度预测模式的具体过程为:In the step ②-1, the vector containing feature information from the macroblock The specific process of extracting feature information from the macroblock and determining the encoding mode and brightness prediction mode of the previous macroblock of the macroblock is as follows:

②-1a、对进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值,符号为向下取整符号;②-1a, yes Perform forward transformation to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight, symbol is the rounding down symbol;

②-1b、从中提取出由8个特征信息比特组成的特征信息,记为 其中,对应表示中的第1个元素、第2个元素和第8个元素,1≤j≤8,符号“||”为取绝对值运算符号;②-1b, from The feature information consisting of 8 feature information bits is extracted from the feature information, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 8th element in the , 1≤j≤8, the symbol "||" is the absolute value operation symbol;

②-1c、构建一个新的向量z(k'),z(k')=(z1z2…z9),其中,z1、z2和z9对应表示z(k')中的第1个元素、第2个元素和第9个元素, 2≤i'≤9;②-1c. Construct a new vector z(k'), z(k')=(z 1 z 2 ... z 9 ), where z 1 , z 2 and z 9 correspond to the z(k') 1st element, 2nd element and 9th element, 2≤i'≤9;

②-1d、对z(k')进行逆变换,得到向量f(k'),f(k')=(f1f2…f9),其中,f1、f2和f9对应表示f(k')中的第1个元素、第2个元素和第9个元素,f2=z2+f1,fi'=zi'+f1,f9=z9+f1,2≤i'≤9;②-1d. Perform inverse transformation on z(k') to obtain vector f(k'), f(k')=(f 1 f 2 …f 9 ), where f 1 , f 2 and f 9 correspond to represent The 1st element, the 2nd element and the 9th element in f(k'), f 2 =z 2 +f 1 , f i' =z i' +f 1 , f 9 =z 9 +f 1 , 2≤i'≤9;

②-1e、将由中的第1个元素第2个元素第3个元素和第4个元素组成的二进制串转化为十进制值,如果十进制值对应数字9,则表示该宏块的上一个宏块的编码模式为Intra16×16,然后用f(k')中的所有元素按序替换该宏块的上一个宏块中的特征信息提取块中的第8个至第16个量化DCT系数,接着确定该宏块的上一个宏块的亮度预测模式,该宏块的上一个宏块的亮度预测模式的数字标识为由中的第5个元素第6个元素第7个元素和第8个元素组成的二进制串转化而成的十进制值,结束特征信息提取及编码模式和亮度预测模式确定;②-1e, will be made by The first element in 2nd element 3rd element and the 4th element The composed binary string is converted into a decimal value. If the decimal value corresponds to the number 9, it means that the coding mode of the previous macroblock of this macroblock is Intra16×16, and then replace the macro with all elements in f(k') in order The feature information in the previous macroblock of the block is extracted from the 8th to 16th quantized DCT coefficients in the block, and then the brightness prediction mode of the previous macroblock of the macroblock is determined, and the brightness of the previous macroblock of the macroblock is determined. The numerical identification of the predictive mode is given by The 5th element in 6th element 7th element and the 8th element The decimal value converted from the composed binary string ends feature information extraction and determination of encoding mode and brightness prediction mode;

如果十进制值不对应数字9,则表示该宏块的上一个宏块的编码模式为Intra4×4,然后执行步骤②-1f;If the decimal value does not correspond to the number 9, it means that the coding mode of the previous macroblock of this macroblock is Intra4×4, and then perform step ②-1f;

②-1f、对f(k')进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值,符号为向下取整符号;②-1f, perform positive transformation on f(k') to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight, symbol is the rounding down symbol;

②-1g、从中提取出由8个特征信息比特组成的特征信息,记为 其中,对应表示中的第1个元素、第2个元素和第8个元素,1≤j≤8,符号“||”为取绝对值运算符号;②-1g, from The feature information consisting of 8 feature information bits is extracted from the feature information, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 8th element in the , 1≤j≤8, the symbol "||" is the absolute value operation symbol;

②-1h、构建一个新的向量z'(k'),z'(k')=(z1'z2'…z9'),其中,z1'、z2'和z9'对应表示z'(k')中的第1个元素、第2个元素和第9个元素, 2≤i'≤9;②-1h. Construct a new vector z'(k'), z'(k')=(z 1 'z 2 '...z 9 '), where z 1 ', z 2 ' and z 9 ' correspond to Indicates the 1st element, the 2nd element and the 9th element in z'(k'), 2≤i'≤9;

②-1i、对z'(k')进行逆变换,得到向量x(k'),x(k')=(x1x2…x9),其中,x1、x2和x9对应表示x(k')中的第1个元素、第2个元素和第9个元素,x2=z2'+x1,xi'=zi''+x1,x9=z9'+x1,2≤i'≤9;②-1i. Perform inverse transformation on z'(k') to obtain vector x(k'), x(k')=(x 1 x 2 ... x 9 ), where x 1 , x 2 and x 9 correspond to Represents the 1st element, the 2nd element and the 9th element in x(k'), x 2 =z 2 '+x 1 , x i' =z i' '+x 1 , x 9 =z 9 '+x 1 , 2≤i'≤9;

②-1j、用x(k')中的所有元素按序替换该宏块的上一个宏块中的特征信息提取块中的第8个至第16个量化DCT系数;②-1j, replacing the 8th to 16th quantized DCT coefficients in the feature information extraction block in the previous macroblock of the macroblock in sequence with all elements in x(k');

②-1k、构建一个包含16个元素的向量w(k'),w(k')的前8个元素为的8个元素,w(k')的后8个元素为的8个元素;②-1k, construct a vector w(k') containing 16 elements, the first 8 elements of w(k') are The 8 elements of w(k'), the last 8 elements of w(k') are 8 elements of

②-1l、确定该宏块的上一个宏块中编号为0的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第1个元素、第2个元素、第3个元素和第4个元素组成的二进制串转化而成的十进制值;②-11. Determine the luminance prediction mode of the 4×4 block numbered 0 in the previous macroblock of the macroblock, and the number of the luminance prediction mode of the 4×4 block is identified by the first in w(k') The decimal value converted from the binary string composed of the first element, the second element, the third element and the fourth element;

确定该宏块的上一个宏块中编号为4的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第5个元素、第6个元素、第7个元素和第8个元素组成的二进制串转化而成的十进制值;Determine the luminance prediction mode of the 4×4 block numbered 4 in the previous macroblock of the macroblock, and the number of the luminance prediction mode of the 4×4 block is identified by the fifth element in w(k'), the first The decimal value converted from the binary string composed of 6 elements, the 7th element and the 8th element;

确定该宏块的上一个宏块中编号为8的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第9个元素、第10个元素、第11个元素和第12个元素组成的二进制串转化而成的十进制值;Determine the luminance prediction mode of the 4×4 block numbered 8 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the 9th element in w(k'), the 9th element The decimal value converted from the binary string composed of 10 elements, the 11th element and the 12th element;

确定该宏块的上一个宏块中编号为12的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第13个元素、第14个元素、第15个元素和第16个元素组成的二进制串转化而成的十进制值;Determine the luminance prediction mode of the 4×4 block numbered 12 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the 13th element in w(k'), the th The decimal value converted from the binary string composed of 14 elements, the 15th element and the 16th element;

结束特征信息提取及编码模式和亮度预测模式确定。End feature information extraction and determination of encoding mode and brightness prediction mode.

所述的步骤②-4中利用当前宏块的编码模式和亮度预测模式恢复当前宏块的具体过程为:The specific process of using the encoding mode and brightness prediction mode of the current macroblock in the described step ②-4 to restore the current macroblock is:

②-4a、如果当前宏块的编码模式为Intra16×16,则利用当前宏块的亮度预测模式对当前宏块中的每个像素点的像素值进行预测,然后将当前宏块中的每个像素点的预测值作为对应像素点的最终恢复的像素值,完成当前宏块的恢复;②-4a. If the encoding mode of the current macroblock is Intra16×16, use the brightness prediction mode of the current macroblock to predict the pixel value of each pixel in the current macroblock, and then use The predicted value of the pixel is used as the final restored pixel value of the corresponding pixel to complete the restoration of the current macroblock;

②-4b、如果当前宏块的编码模式为Intra4×4,则利用当前宏块中编号为0的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;②-4b. If the encoding mode of the current macroblock is Intra4×4, use the brightness prediction mode of the 4×4 block numbered 0 in the current macroblock to each of the 8×8 blocks where the 4×4 block is located The pixel value of each pixel in the 4×4 block is predicted, and then the predicted value of each pixel in each 4×4 block is used as the final restored pixel corresponding to each pixel in the 4×4 block value;

利用当前宏块中编号为4的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;Use the brightness prediction mode of the 4×4 block numbered 4 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then Taking the predicted value of each pixel in each 4×4 block as the final restored pixel value of each pixel in the corresponding 4×4 block;

利用当前宏块中编号为8的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;Use the brightness prediction mode of the 4×4 block numbered 8 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then Taking the predicted value of each pixel in each 4×4 block as the final restored pixel value of each pixel in the corresponding 4×4 block;

利用当前宏块中编号为12的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值。Use the brightness prediction mode of the 4×4 block numbered 12 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then The predicted value of each pixel in each 4×4 block is used as the final restored pixel value of each pixel in the corresponding 4×4 block.

与现有技术相比,本发明的优点在于:Compared with the prior art, the present invention has the advantages of:

1)在编码端,提取的宏块的特征信息由宏块(编码模式为Intra4×4)的子块的亮度预测模式确定或由宏块(编码模式为Intra16×16)的编码模式和亮度预测模式确定,不仅提取方便,而且能有效恢复存在场景变换时丢失的宏块,从而提升了I帧错误恢复质量。1) At the coding end, the feature information of the extracted macroblock is determined by the brightness prediction mode of the sub-block of the macroblock (the coding mode is Intra4×4) or is determined by the coding mode and brightness prediction of the macroblock (the coding mode is Intra16×16) The mode is determined, which is not only convenient for extraction, but also can effectively restore the lost macroblock when there is a scene change, thereby improving the quality of I frame error recovery.

2)在编码端,在向宿主向量中嵌入特征向量时,根据当前处理的宏块的上一个宏块的编码模式,采用两次广义差分扩展的方法或一次广义差分扩展的方法进行嵌入,广义差分扩展方法不仅使得嵌入容量可控,而且可以实现提取特征信息后,还原I帧嵌入特征信息前的原始数据。2) At the encoding end, when embedding the feature vector into the host vector, according to the encoding mode of the previous macroblock of the currently processed macroblock, the method of two generalized differential extensions or one generalized differential extension is used for embedding. The differential expansion method not only makes the embedding capacity controllable, but also can restore the original data of the I frame before embedding the feature information after extracting the feature information.

3)本发明方法采用的广义差分扩展方法的差分对象为量化DCT系数,对其差分不存在溢出的情况,计算复杂度大大降低。3) The difference object of the generalized difference extension method adopted by the method of the present invention is a quantized DCT coefficient, and there is no overflow in the difference, and the computational complexity is greatly reduced.

4)本发明方法借助信息隐藏技术进行I帧错误恢复,充分利用编码端的信息,相比仅在解码端进行错误隐藏,可利用的视频资源更丰富、准确,灵活性更高。4) The method of the present invention carries out I frame error recovery by means of information hiding technology, makes full use of the information of encoding end, compared with only carrying out error concealment at decoding end, the available video resources are richer, more accurate, and more flexible.

附图说明Description of drawings

图1为本发明方法的总体实现框图;Fig. 1 is the overall realization block diagram of the inventive method;

图2为一个宏块中的16个4×4块的编号示意图;Fig. 2 is a schematic diagram of numbering of 16 4×4 blocks in a macroblock;

图3a为编码量化参数QP=28时,Foreman标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;When Fig. 3 a is encoding quantization parameter QP=28, the I frame of Foreman standard test sequence is under different macroblock loss rates, adopts the comparison schematic diagram of the error recovery objective quality after the method of the present invention and existing JM method and RH method processing;

图3b为编码量化参数QP=28时,Carphone标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;When Fig. 3 b is the encoding quantization parameter QP=28, the I frame of Carphone standard test sequence is under different macroblock loss rates, adopts the comparison schematic diagram of the error recovery objective quality after the method of the present invention and existing JM method and RH method processing;

图3c为编码量化参数QP=28时,Container标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 3c is when the encoding quantization parameter QP=28, the I frame of the Container standard test sequence is under different macroblock loss rates, adopts the method of the present invention and the existing JM method and the RH method after the error recovery objective quality comparison schematic diagram;

图3d为编码量化参数QP=28时,Akyio标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Figure 3d is a schematic diagram of comparing the objective quality of error recovery after the method of the present invention and the existing JM method and RH method are used for the I frame of the Akyio standard test sequence under different macroblock loss rates when the coding quantization parameter QP=28;

图3e为编码量化参数QP=28时,Silent标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 3 e is when the encoding quantization parameter QP=28, the I frame of the Silent standard test sequence is under different macroblock loss rates, adopts the method of the present invention and the existing JM method and the RH method after the error recovery objective quality comparison schematic diagram;

图3f为编码量化参数QP=28时,Mobile标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 3 f is when coding quantization parameter QP=28, the I frame of Mobile standard test sequence is under different macroblock loss rates, adopts the error recovery objective quality comparison schematic diagram after the method of the present invention and existing JM method and RH method to process;

图4a为编码量化参数QP=38时,Foreman标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 4 a is when coding quantization parameter QP=38, and the I frame of Foreman standard test sequence is under different macroblock loss rates, adopts the comparison schematic diagram of the error recovery objective quality after the method of the present invention and existing JM method and RH method to process;

图4b为编码量化参数QP=38时,Carphone标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;When Fig. 4 b is the encoding quantization parameter QP=38, the I frame of Carphone standard test sequence is under different macroblock loss rates, adopts the comparison schematic diagram of the error recovery objective quality after the method of the present invention and existing JM method and RH method processing;

图4c为编码量化参数QP=38时,Container标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 4c is when the encoding quantization parameter QP=38, the I frame of the Container standard test sequence is under different macroblock loss rates, adopts the method of the present invention and the existing JM method and the RH method after the error recovery objective quality comparison schematic diagram;

图4d为编码量化参数QP=38时,Akyio标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Figure 4d is a schematic diagram of comparing the objective quality of error recovery after the method of the present invention and the existing JM method and RH method are used for the I frame of the Akyio standard test sequence under different macroblock loss rates when the coding quantization parameter QP=38;

图4e为编码量化参数QP=38时,Silent标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 4e is when the quantization parameter QP=38 of encoding, the I frame of Silent standard test sequence is under different macroblock loss rate, adopts the method of the present invention and the existing JM method and the RH method to process the error recovery objective quality comparative schematic diagram;

图4f为编码量化参数QP=38时,Mobile标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Fig. 4 f is when coding quantization parameter QP=38, the I frame of Mobile standard test sequence is under different macroblock loss rates, adopts the error recovery objective quality comparison schematic diagram after the method of the present invention and existing JM method and RH method to process;

图5a为Carphone标准测试序列的第20帧(I帧)的原图;Fig. 5 a is the original picture of the 20th frame (I frame) of Carphone standard test sequence;

图5b为图5a丢块后的图(丢块率为20%);Fig. 5b is the figure after block loss in Fig. 5a (block loss rate is 20%);

图5c为采用现有的JM方法对图5b进行恢复后的图;Fig. 5c is the figure after adopting existing JM method to restore Fig. 5b;

图5d为采用现有的RH方法对图5b进行恢复后的图;Fig. 5d is the figure after adopting existing RH method to restore Fig. 5b;

图5e为采用本发明方法对图5b进行恢复后的图;Fig. 5e is the figure after adopting the method of the present invention to restore Fig. 5b;

图6a为编码量化参数QP=28时,合成序列的前150帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Figure 6a is a schematic diagram of comparing the objective quality of error recovery after processing the method of the present invention with the existing JM method and RH method for the first 150 frames of the composite sequence under different macroblock loss rates when the coding quantization parameter QP=28;

图6b为编码量化参数QP=38时,合成序列的前150帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图;Figure 6b is a schematic diagram of comparing the objective quality of error recovery after processing the first 150 frames of the synthesized sequence under different macroblock loss rates when the coding quantization parameter QP=38, using the method of the present invention and the existing JM method and RH method;

图7a为合成序列的第29帧的原图;Figure 7a is the original picture of the 29th frame of the synthesized sequence;

图7b为合成序列的第30帧(I帧)的原图;Figure 7b is the original picture of the 30th frame (I frame) of the synthetic sequence;

图7c为图7b所示的图像丢块后的图(丢块率为20%);Fig. 7c is the picture after the block loss of the image shown in Fig. 7b (block loss rate is 20%);

图7d为采用现有的JM方法对图7c进行恢复后的主观质量图;Figure 7d is the subjective quality map after recovering Figure 7c using the existing JM method;

图7e为采用现有的RH方法对图7c进行恢复后的主观质量图;Figure 7e is the subjective quality map after recovering Figure 7c using the existing RH method;

图7f为采用本发明方法对图7c进行恢复后的主观质量图。Fig. 7f is a subjective quality map after restoration of Fig. 7c by the method of the present invention.

具体实施方式detailed description

以下结合附图实施例对本发明作进一步详细描述。The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments.

本发明提出的一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法,其总体实现框图如图1所示,其包括以下步骤:A kind of H.264/AVC video I frame error recovery method based on reversible data hiding that the present invention proposes, its overall realization block diagram is as shown in Figure 1, and it comprises the following steps:

①在编码端,向I帧中除第1个宏块外的每个宏块中嵌入特征信息,得到嵌有特征信息的I帧,具体过程为:① At the encoding end, embed feature information into each macroblock except the first macroblock in the I frame to obtain an I frame embedded with feature information. The specific process is as follows:

①-1、将I帧中当前预编码完成的第k个宏块定义为当前宏块,其中,1≤k≤K,在此K表示I帧中包含的宏块的总个数,k的初始值为1。①-1. Define the kth macroblock that is currently pre-encoded in the I frame as the current macroblock, where 1≤k≤K, where K represents the total number of macroblocks contained in the I frame, and k The initial value is 1.

①-2、将当前宏块的CBP的十进制值转化为由6位二进制值组成的二进制串,并记为A,A=a1a2a3a4a5a6,其中,a1为A的最高位二进制值,a6为A的最低位二进制值。①-2. Convert the decimal value of the CBP of the current macroblock into a binary string composed of 6-bit binary values, and record it as A, A=a 1 a 2 a 3 a 4 a 5 a 6 , where a 1 is The highest binary value of A, a 6 is the lowest binary value of A.

宏块的CBP对应的二进制串的高两位用于代表色度,低四位用于代表亮度;a6代表宏块的左上角位置的8×8块的量化DCT系数的统计情况,如果a6为0,则表示该8×8块中的4个4×4块的量化DCT系数全部为0,如果a6为1,则表示该8×8块中的4个4×4块的量化DCT系数不全部为0;a5代表宏块的右上角位置的8×8块的量化DCT系数的统计情况,a4代表宏块的左下角位置的8×8块的量化DCT系数的统计情况,a3代表宏块的右下角位置的8×8块的量化DCT系数的统计情况。The upper two bits of the binary string corresponding to the CBP of the macroblock are used to represent chroma, and the lower four bits are used to represent brightness; a 6 represents the statistics of the quantized DCT coefficients of the 8×8 block at the upper left corner of the macroblock, if a 6 is 0, it means that the quantized DCT coefficients of the four 4×4 blocks in the 8×8 block are all 0, if a 6 is 1, it means that the quantization of the four 4×4 blocks in the 8×8 block The DCT coefficients are not all 0; a 5 represents the statistics of the quantized DCT coefficients of the 8×8 block at the upper right corner of the macroblock, and a 4 represents the statistics of the quantized DCT coefficients of the 8×8 block at the lower left corner of the macroblock , a 3 represents the statistics of the quantized DCT coefficients of the 8×8 block at the lower right corner of the macroblock.

①-3、提取当前宏块的特征向量:如果当前宏块的编码模式为Intra4×4,则提取当前宏块中编号为0、4、8、12(如图2所示)这四个4×4块各自的亮度预测模式的数字标识,然后将这四个4×4块各自的亮度预测模式的数字标识量化为4个比特,之后按这四个4×4块在当前宏块中的编号的顺序将这四个4×4块的亮度预测模式以比特表示的数字标识排列构成一个包含16个元素的一维向量,再将该一维向量作为当前宏块的特征向量,记为其中,对应表示当前宏块的特征向量wIntra4×4(k)中的第1个元素、第2个元素和第16个元素。①-3. Extract the feature vector of the current macroblock: if the encoding mode of the current macroblock is Intra4×4, then extract the four 4s numbered 0, 4, 8, and 12 (as shown in Figure 2) in the current macroblock ×4 block’s respective luminance prediction mode digital identification, then quantize the digital identification of these four 4×4 blocks’ respective luminance prediction modes into 4 bits, and then press the four 4×4 blocks in the current macroblock The sequence of numbering arranges the luminance prediction modes of these four 4×4 blocks with digital identifiers represented by bits to form a one-dimensional vector containing 16 elements, and then uses the one-dimensional vector as the feature vector of the current macroblock, which is recorded as in, with Correspondingly represent the first element, the second element and the 16th element in the feature vector w Intra4×4 (k) of the current macroblock.

如果当前宏块的编码模式为Intra16×16,则用数字9标识当前宏块的编码模式,然后将当前宏块的编码模式的数字标识量化为4个比特,并将当前宏块的亮度预测模式的数字标识量化为4个比特,之后按先后顺序将当前宏块的编码模式以比特表示的数字标识和当前宏块的亮度预测模式以比特表示的数字标识排列构成一个包含8个元素的一维向量,再将该一维向量作为当前宏块的特征向量,记为wIntra16×16(k),其中,对应表示当前宏块的特征向量wIntra16×16(k)中的第1个元素、第2个元素和第8个元素。If the encoding mode of the current macroblock is Intra16×16, the number 9 is used to identify the encoding mode of the current macroblock, and then the digital identification of the encoding mode of the current macroblock is quantized to 4 bits, and the brightness prediction mode of the current macroblock is The digital identification of the current macroblock is quantized into 4 bits, and then the current macroblock coding mode and the current macroblock's luminance prediction mode are arranged in order to form a one-dimensional matrix containing 8 elements. vector, and then use the one-dimensional vector as the feature vector of the current macroblock, denoted as w Intra16×16 (k), in, with Correspondingly represent the first element, the second element and the eighth element in the feature vector w Intra16×16 (k) of the current macroblock.

在H.264/AVC视频中,编码模式为Intra4×4的宏块中的4×4块的亮度预测模式共有9种,分别用数字标识0~8来表示;编码模式为Intra16×16的宏块的亮度预测模式共有4种,分别用数字标识0~3来表示。In H.264/AVC video, there are 9 kinds of luminance prediction modes for the 4×4 blocks in the macroblock whose encoding mode is Intra4×4, which are represented by numbers 0 to 8 respectively; the macroblock whose encoding mode is Intra16×16 There are 4 types of brightness prediction modes for a block, which are represented by numbers 0 to 3 respectively.

①-4、确定当前宏块的宿主向量:计算当前宏块中的每个4×4块的所有交流DCT系数的绝对值的和,将和值最大的4×4块作为特征信息嵌入块,然后以zig-zag方式扫描特征信息嵌入块中的所有量化DCT系数,之后按zig-zag方式扫描的顺序将特征信息嵌入块中的第8个至第16个量化DCT系数(位于zig-zag扫描中第8个至第16个量化DCT系数为中高频量化DCT系数)排列构成一个包含9个元素的一维向量,再将该一维向量作为当前宏块的宿主向量,记为x(k),x(k)=(x1x2…x9),其中,x1、x2和x9对应表示当前宏块的宿主向量x(k)中的第1个元素、第2个元素和第9个元素。①-4. Determine the host vector of the current macroblock: calculate the sum of the absolute values of all AC DCT coefficients of each 4×4 block in the current macroblock, and embed the 4×4 block with the largest sum value as the feature information into the block, Then scan all the quantized DCT coefficients in the feature information embedding block in zig-zag mode, and then embed the feature information into the 8th to 16th quantized DCT coefficients in the block in the zig-zag scan order (located in the zig-zag scan The 8th to 16th quantized DCT coefficients are medium and high frequency quantized DCT coefficients) arranged to form a one-dimensional vector containing 9 elements, and then the one-dimensional vector is used as the host vector of the current macroblock, denoted as x(k) , x(k)=(x 1 x 2 …x 9 ), where x 1 , x 2 and x 9 correspond to the first element, the second element and 9th element.

①-5、将当前宏块的上一个宏块的特征向量嵌入到当前宏块的宿主向量中:判断当前宏块是否为I帧中的第1个宏块,如果是,则对当前宏块不作处理,直接执行步骤①-7;否则,若当前宏块的上一个宏块的编码模式为Intra4×4,则采用两次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中,得到当前宏块对应的嵌有特征信息的向量然后用中的所有元素按序替换当前宏块中的特征信息嵌入块中的第8个至第16个量化DCT系数,再执行步骤①-6;若当前宏块的上一个宏块的编码模式为Intra16×16,则采用一次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中,得到当前宏块对应的嵌有特征信息的向量然后用中的所有元素按序替换当前宏块中的特征信息嵌入块中的第8个至第16个量化DCT系数,再执行步骤①-6。①-5. Embed the eigenvector of the previous macroblock of the current macroblock into the host vector of the current macroblock: determine whether the current macroblock is the first macroblock in the I frame, and if so, perform Do not process, directly execute steps ①-7; otherwise, if the coding mode of the previous macroblock of the current macroblock is Intra4×4, use the method of two generalized difference extensions to convert the feature vector of the previous macroblock of the current macroblock w Intra4×4 (k-1) is embedded into the host vector x(k) of the current macroblock to obtain the vector embedded with feature information corresponding to the current macroblock then use Replace all the elements in the current macroblock in sequence with the 8th to 16th quantized DCT coefficients in the feature information embedding block, and then perform steps ①-6; if the coding mode of the previous macroblock of the current macroblock is Intra16 ×16, then use a generalized differential extension method to embed the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock to obtain the current macroblock The corresponding vector embedded with feature information then use All elements in replace the 8th to 16th quantized DCT coefficients in the feature information embedding block in the current macroblock in sequence, and then perform step ①-6.

在此具体实施例中,步骤①-5中采用两次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中的具体过程为:In this specific embodiment, in steps ①-5, two generalized differential extension methods are used to embed the feature vector w Intra4×4 (k-1) of the previous macroblock of the current macroblock into the host vector x of the current macroblock The specific process in (k) is:

A1、对x(k)进行正变换,得到向量y(k),y(k)=(y1y2…y9),其中,y1、y2和y9对应表示y(k)中的第1个元素、第2个元素和第9个元素,y2=x2-x1,yi'=xi'-x1,y9=x9-x1,2≤i'≤9,αi为权值,在具体实施时取αi=1,符号为向下取整符号。A1. Carry out positive transformation to x(k) to obtain vector y(k), y(k)=(y 1 y 2 ... y 9 ), wherein, y 1 , y 2 and y 9 correspond to y(k) The 1st element, the 2nd element and the 9th element of the , y 2 =x 2 -x 1 , y i' = xi' -x 1 , y 9 =x 9 -x 1 , 2≤i'≤9, α i is the weight, and α i = 1. Symbol is the rounding down symbol.

A2、将wIntra4×4(k-1)中的第1个元素至第8个元素嵌入到y(k)中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9,对应表示wIntra4×4(k-1)中的第1个元素、第i'-1个元素和第8个元素。A2. Embed the first to eighth elements of w Intra4×4 (k-1) into y(k) to get a vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with It corresponds to the 1st element, the i'-1th element and the 8th element in w Intra4×4 (k-1).

A3、对进行逆变换,得到嵌有部分特征信息的向量其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9。A3, yes Perform an inverse transformation to obtain a vector embedded with part of the feature information in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9.

A4、对进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值。A4, yes Perform forward transformation to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight.

A5、将wIntra4×4(k-1)中的第9个元素至第16个元素嵌入到中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9,对应表示wIntra4×4(k-1)中的第9个元素、第i'+7个元素和第16个元素。A5. Embed the 9th to 16th elements in w Intra4×4 (k-1) into , get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represent the 9th element, the i'+7th element and the 16th element in w Intra4×4 (k-1).

A6、对进行逆变换,得到当前宏块对应的嵌有特征信息的向量完成将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中,其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9。A6, yes Perform inverse transformation to obtain the vector embedded with feature information corresponding to the current macroblock Finish embedding the feature vector w Intra4×4 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock, in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9.

在此具体实施例中,步骤①-5中采用一次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中的具体过程为:In this specific embodiment, step ①-5 adopts a generalized differential extension method to embed the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock into the host vector x( The specific process in k) is:

B1、对x(k)进行正变换,得到向量y(k),y(k)=(y1y2…y9),其中,y1、y2和y9对应表示y(k)中的第1个元素、第2个元素和第9个元素,yi'=xi'-x1,y9=x9-x1,2≤i'≤9,αi为权值,在具体实施时取αi=1,符号为向下取整符号。B1. Carry out positive transformation on x(k) to obtain vector y(k), y(k)=(y 1 y 2 ... y 9 ), wherein, y 1 , y 2 and y 9 correspond to y(k) The 1st element, the 2nd element and the 9th element of the , y i' = x i' -x 1 , y 9 = x 9 -x 1 , 2≤i'≤9, α i is the weight value, α i =1 is taken in specific implementation, the symbol is the rounding down symbol.

B2、将wIntra16×16(k-1)嵌入到y(k)中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,对应表示wIntra16×16(k-1)中的第1个元素、第i'-1个元素和第8个元素。B2. Embed w Intra16×16 (k-1) into y(k) to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with It corresponds to the 1st element, the i'-1th element and the 8th element in w Intra16×16 (k-1).

B3、对进行逆变换,得到当前宏块对应的嵌有特征信息的向量完成将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中,其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9。B3, yes Perform inverse transformation to obtain the vector embedded with feature information corresponding to the current macroblock Finish embedding the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock, in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9.

①-6、修改当前宏块的CBP(CodedBlockPattern),然后执行步骤①-7。①-6. Modify the CBP (CodedBlockPattern) of the current macroblock, and then perform step ①-7.

在此具体实施例中,步骤①-6中修改当前宏块的CBP的具体过程为:In this specific embodiment, the specific process of modifying the CBP of the current macroblock in step 1.-6 is:

①-6a、如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中左上角位置的8×8块,则统计当前宏块嵌入特征信息后左上角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a6置为0,a3,a4,a5保持不变,如果不全为0,则将A中的a6置为1,a3,a4,a5保持不变。①-6a. If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the upper left corner of the current macroblock, then count the 8×8 at the upper left corner of the current macroblock after embedding the feature information Whether all the quantized DCT coefficients in the block are all 0, if all are 0, set a 6 in A to 0, a 3 , a 4 , a 5 remain unchanged, if not all 0, set a 6 in A a 6 is set to 1, and a 3 , a 4 , a 5 remain unchanged.

如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中右上角位置的8×8块,则统计当前宏块嵌入特征信息后右上角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a5置为0,a3,a4,a6保持不变,如果不全为0,则将A中的a5置为1,a3,a4,a6保持不变。If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block in the upper right corner of the current macroblock, then count all the 8×8 blocks in the upper right corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 5 in A to 0, a 3 , a 4 , a 6 remain unchanged, if they are not all 0, set a 5 in A to 0 1, a 3 , a 4 , a 6 remain unchanged.

如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中左下角位置的8×8块,则统计当前宏块嵌入特征信息后左下角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a4置为0,a3,a5,a6保持不变,如果不全为0,则将A中的a4置为1,a3,a5,a6保持不变。If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the lower left corner of the current macroblock, then count all the 8×8 blocks at the lower left corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 4 in A to 0, a 3 , a 5 , a 6 remain unchanged, if they are not all 0, set a 4 in A to 0 1, a 3 , a 5 , a 6 remain unchanged.

如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中右下角位置的8×8块,则统计当前宏块嵌入特征信息后右下角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a3置为0,a4,a5,a6保持不变,如果不全为0,则将A中的a3置为1,a4,a5,a6保持不变。If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the lower right corner of the current macroblock, then count all the 8×8 blocks at the lower right corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 3 in A to 0, a 4 , a 5 , a 6 remain unchanged, if they are not all 0, set a 3 in A to 0 1, a 4 , a 5 , a 6 remain unchanged.

①-6b、将修改后的A转化成十进制数,得到当前宏块修改后的CBP。①-6b. Convert the modified A into a decimal number to obtain the modified CBP of the current macroblock.

①-7、对当前宏块进行熵编码;在具体实施时可采用现有的基于上下文自适应的可变长编码(CAVLC)技术对当前宏块进行熵编码。①-7. Perform entropy coding on the current macroblock; in specific implementation, the existing context-adaptive variable length coding (CAVLC) technology can be used to perform entropy coding on the current macroblock.

①-8、令k=k+1,将I帧中下一个预编码完成的宏块作为当前宏块,再返回步骤①-2继续执行,直至I帧中的所有预编码完成的宏块处理完毕,得到嵌有特征信息的I帧的编码码流,其中,k=k+1中的“=”为赋值符号。①-8. Make k=k+1, use the next pre-encoded macroblock in the I frame as the current macroblock, and return to step ①-2 to continue until all pre-encoded macroblocks in the I frame are processed After completion, the coded code stream of the I frame embedded with feature information is obtained, wherein "=" in k=k+1 is an assignment symbol.

②在解码端,从嵌有特征信息的I帧中的每个宏块中提取出特征信息,并确定每个宏块的编码模式和亮度预测模式,再对非正确解码块进行错误恢复,具体过程为:② At the decoding end, feature information is extracted from each macroblock in the I frame embedded with feature information, and the coding mode and brightness prediction mode of each macroblock are determined, and then error recovery is performed on incorrectly decoded blocks, specifically The process is:

②-1、对嵌有特征信息的I帧中的每个宏块进行熵解码,然后确定熵解码后的每个宏块是否为正确解码块,接着确定除熵解码后的第1个宏块外(第1个宏块可能是正确解码块也可能是非正确解码块,而此处对第1个宏块不作处理)的每个正确解码块的包含有特征信息的向量,再从除熵解码后的第1个宏块外的每个正确解码块的包含有特征信息的向量中提取出特征信息,并确定除熵解码后的第1个宏块外的每个正确解码块的上一个宏块的编码模式和亮度预测模式,假设熵解码后的第k'个宏块为正确解码块,则②-1. Perform entropy decoding on each macroblock in the I frame embedded with feature information, then determine whether each macroblock after entropy decoding is a correct decoded block, and then determine the first macroblock after entropy-decoding (the first macroblock may be a correctly decoded block or an incorrectly decoded block, and the first macroblock is not processed here), the vector containing feature information of each correctly decoded block, and then decoded from the entropy Extract the feature information from the vector containing feature information of each correctly decoded block except the first macroblock after entropy decoding, and determine the previous macro of each correctly decoded block except the first macroblock after entropy decoding The encoding mode and brightness prediction mode of the block, assuming that the k'th macroblock after entropy decoding is the correct decoding block, then

确定该宏块的包含有特征信息的向量的具体过程为:计算该宏块中的每个4×4块的所有经反量化后为交流DCT系数的量化DCT系数的绝对值的和,即计算该宏块中的每个4×4块的部分量化DCT系数的绝对值的和,此处部分量化DCT系数中的每个量化DCT系数经反量化后为交流DCT系数,将和值最大的4×4块作为特征信息提取块,然后以zig-zag方式扫描特征信息提取块中的所有量化DCT系数,之后按zig-zag方式扫描的顺序将特征信息提取块中的第8个至第16个量化DCT系数(位于zig-zag扫描中第8个至第16个量化DCT系数为中高频量化DCT系数)排列构成一个包含9个元素的一维向量,再将该一维向量作为该宏块的包含有特征信息的向量,记为 其中,对应表示中的第1个元素、第2个元素和第9个元素。The specific process of determining the vector containing feature information of the macroblock is: calculating the sum of the absolute values of all the quantized DCT coefficients of each 4×4 block in the macroblock that are dequantized as AC DCT coefficients, that is, calculating The sum of the absolute values of the partially quantized DCT coefficients of each 4×4 block in the macroblock, where each quantized DCT coefficient in the partially quantized DCT coefficients is dequantized into an AC DCT coefficient, and the 4 with the largest sum value ×4 block as the feature information extraction block, and then scan all the quantized DCT coefficients in the feature information extraction block in zig-zag mode, and then scan the 8th to 16th coefficients in the feature information extraction block in the order of zig-zag scanning The quantized DCT coefficients (the 8th to 16th quantized DCT coefficients in the zig-zag scan are medium and high frequency quantized DCT coefficients) are arranged to form a one-dimensional vector containing 9 elements, and then the one-dimensional vector is used as the macroblock A vector containing feature information, denoted as in, with Corresponding representation The 1st element, the 2nd element and the 9th element in .

从该宏块的包含有特征信息的向量中提取出特征信息,并确定该宏块的上一个宏块的编码模式和亮度预测模式。The vector containing feature information from the macroblock The feature information is extracted from the macroblock, and the encoding mode and brightness prediction mode of the previous macroblock of the macroblock are determined.

在此具体实施例中,步骤②-1中从该宏块的包含有特征信息的向量中提取出特征信息,并确定该宏块的上一个宏块的编码模式和亮度预测模式的具体过程为:In this specific embodiment, in step ②-1, from the vector containing feature information of the macroblock The specific process of extracting feature information from the macroblock and determining the encoding mode and brightness prediction mode of the previous macroblock of the macroblock is as follows:

②-1a、对进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值,在具体实施时取αi=1,符号为向下取整符号。②-1a, yes Perform forward transformation to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight value, and α i =1 is taken in specific implementation, the symbol is the rounding down symbol.

②-1b、从中提取出由8个特征信息比特组成的特征信息,记为 其中,对应表示中的第1个元素、第2个元素和第8个元素,1≤j≤8,符号“||”为取绝对值运算符号。②-1b, from The feature information consisting of 8 feature information bits is extracted from the feature information, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 8th element in the , 1≤j≤8, the symbol "||" is the absolute value operation symbol.

②-1c、构建一个新的向量z(k'),z(k')=(z1z2…z9),其中,z1、z2和z9对应表示z(k')中的第1个元素、第2个元素和第9个元素, 2≤i'≤9。②-1c. Construct a new vector z(k'), z(k')=(z 1 z 2 ... z 9 ), where z 1 , z 2 and z 9 correspond to the z(k') 1st element, 2nd element and 9th element, 2≤i'≤9.

②-1d、对z(k')进行逆变换,得到向量f(k'),f(k')=(f1f2…f9),其中,f1、f2和f9对应表示f(k')中的第1个元素、第2个元素和第9个元素,f2=z2+f1,fi'=zi'+f1,f9=z9+f1,2≤i'≤9。②-1d. Perform inverse transformation on z(k') to obtain vector f(k'), f(k')=(f 1 f 2 …f 9 ), where f 1 , f 2 and f 9 correspond to represent The 1st element, the 2nd element and the 9th element in f(k'), f 2 =z 2 +f 1 , f i' =zi ' +f 1 , f 9 =z 9 +f 1 , 2≤i'≤9.

②-1e、将由中的第1个元素第2个元素第3个元素和第4个元素组成的二进制串转化为十进制值,如果十进制值对应数字9,则表示该宏块的上一个宏块的编码模式为Intra16×16,然后用f(k')中的所有元素按序替换该宏块的上一个宏块中的特征信息提取块中的第8个至第16个量化DCT系数,即恢复原始的量化DCT系数,接着确定该宏块的上一个宏块的亮度预测模式,该宏块的上一个宏块的亮度预测模式的数字标识为由中的第5个元素第6个元素第7个元素和第8个元素组成的二进制串转化而成的十进制值,结束特征信息提取及编码模式和亮度预测模式确定。②-1e, will be made by The first element in 2nd element 3rd element and the 4th element The composed binary string is converted into a decimal value. If the decimal value corresponds to the number 9, it means that the coding mode of the previous macroblock of this macroblock is Intra16×16, and then replace the macro with all elements in f(k') in order Extract the 8th to 16th quantized DCT coefficients in the block from the feature information in the previous macroblock of the block, that is, restore the original quantized DCT coefficients, and then determine the brightness prediction mode of the previous macroblock of the macroblock, the macro The numerical identification of the luma prediction mode of the previous macroblock of the block is given by The 5th element in 6th element 7th element and the 8th element The formed binary string is converted into a decimal value, and the extraction of feature information and the determination of the encoding mode and the brightness prediction mode are completed.

如果十进制值不对应数字9,则表示该宏块的上一个宏块的编码模式为Intra4×4,然后执行步骤②-1f。If the decimal value does not correspond to the number 9, it means that the coding mode of the previous macroblock of this macroblock is Intra4×4, and then step ②-1f is performed.

②-1f、对f(k')进行正变换,得到向量其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值,在具体实施时取αi=1,符号为向下取整符号。②-1f, perform positive transformation on f(k') to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight value, and α i =1 is taken in specific implementation, the symbol is the rounding down symbol.

②-1g、从中提取出由8个特征信息比特组成的特征信息,记为 其中,对应表示中的第1个元素、第2个元素和第8个元素,1≤j≤8,符号“||”为取绝对值运算符号。②-1g, from The feature information consisting of 8 feature information bits is extracted from the feature information, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 8th element in the , 1≤j≤8, the symbol "||" is the absolute value operation symbol.

②-1h、构建一个新的向量z'(k'),z'(k')=(z1'z2'…z9'),其中,z1'、z2'和z9'对应表示z'(k')中的第1个元素、第2个元素和第9个元素, 2≤i'≤9。②-1h. Construct a new vector z'(k'), z'(k')=(z 1 'z 2 '...z 9 '), where z 1 ', z 2 ' and z 9 ' correspond to Indicates the 1st element, the 2nd element and the 9th element in z'(k'), 2≤i'≤9.

②-1i、对z'(k')进行逆变换,得到向量x(k'),x(k')=(x1x2…x9),其中,x1、x2和x9对应表示x(k')中的第1个元素、第2个元素和第9个元素,x2=z2'+x1,xi'=zi''+x1,x9=z9'+x1,2≤i'≤9。②-1i. Perform inverse transformation on z'(k') to obtain vector x(k'), x(k')=(x 1 x 2 ... x 9 ), where x 1 , x 2 and x 9 correspond to Represents the 1st element, the 2nd element and the 9th element in x(k'), x 2 =z 2 '+x 1 , x i' =zi ' '+x 1 , x 9 =z 9 '+x 1 , 2≤i'≤9.

②-1j、用x(k')中的所有元素按序替换该宏块的上一个宏块中的特征信息提取块中的第8个至第16个量化DCT系数,即恢复原始的量化DCT系数。②-1j. Replace the 8th to 16th quantized DCT coefficients in the feature information extraction block in the previous macroblock of the macroblock in sequence with all elements in x(k'), that is, restore the original quantized DCT coefficient.

②-1k、构建一个包含16个元素的向量w(k'),w(k')的前8个元素为的8个元素,w(k')的后8个元素为的8个元素。②-1k, construct a vector w(k') containing 16 elements, the first 8 elements of w(k') are The 8 elements of w(k'), the last 8 elements of w(k') are of 8 elements.

②-1l、确定该宏块的上一个宏块中编号为0的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第1个元素、第2个元素、第3个元素和第4个元素组成的二进制串转化而成的十进制值。②-11. Determine the luminance prediction mode of the 4×4 block numbered 0 in the previous macroblock of the macroblock, and the number of the luminance prediction mode of the 4×4 block is identified by the first in w(k') The decimal value converted from the binary string composed of the first element, the second element, the third element and the fourth element.

确定该宏块的上一个宏块中编号为4的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第5个元素、第6个元素、第7个元素和第8个元素组成的二进制串转化而成的十进制值。Determine the luminance prediction mode of the 4×4 block numbered 4 in the previous macroblock of the macroblock, and the number of the luminance prediction mode of the 4×4 block is identified by the fifth element in w(k'), the first The decimal value converted from the binary string composed of 6 elements, the 7th element and the 8th element.

确定该宏块的上一个宏块中编号为8的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第9个元素、第10个元素、第11个元素和第12个元素组成的二进制串转化而成的十进制值。Determine the luminance prediction mode of the 4×4 block numbered 8 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the 9th element in w(k'), the 9th element The decimal value converted from the binary string consisting of 10 elements, the 11th element, and the 12th element.

确定该宏块的上一个宏块中编号为12的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第13个元素、第14个元素、第15个元素和第16个元素组成的二进制串转化而成的十进制值。Determine the luminance prediction mode of the 4×4 block numbered 12 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the 13th element in w(k'), the th The decimal value converted from the binary string consisting of 14 elements, the 15th element, and the 16th element.

结束特征信息提取及编码模式和亮度预测模式确定。End feature information extraction and determination of encoding mode and brightness prediction mode.

上述,2≤k'≤K。As mentioned above, 2≤k'≤K.

在具体实施时可采用现有的CAVLC熵解码技术对嵌有特征信息的I帧中的每个宏块进行熵解码;确定熵解码后的每个宏块是否为正确解码块直接采用现有技术。Existing CAVLC entropy decoding technology can be used in specific implementation to carry out entropy decoding to each macroblock in the I frame that is embedded with feature information; Determine whether each macroblock after entropy decoding is a correct decoding block directly adopts existing technology .

②-2、将解码后的I帧中的第k个宏块定义为当前宏块,其中,1≤k≤K,k的初始值为1。②-2. Define the kth macroblock in the decoded I frame as the current macroblock, where 1≤k≤K, and the initial value of k is 1.

②-3、判断当前宏块是否为解码后的I帧中的最后一个宏块,如果当前宏块不是最后一个宏块,则执行步骤②-4,如果当前宏块是最后一个宏块,则执行步骤②-5。②-3, judge whether the current macroblock is the last macroblock in the decoded I frame, if the current macroblock is not the last macroblock, then perform step ②-4, if the current macroblock is the last macroblock, then Execute steps ②-5.

②-4、判断当前宏块为正确解码块还是为非正确解码块,如果当前宏块为正确解码块,则对当前宏块不作处理,然后执行步骤②-6。②-4. Determine whether the current macroblock is a correctly decoded block or an incorrectly decoded block. If the current macroblock is a correctly decoded block, then do not process the current macroblock, and then perform step ②-6.

如果当前宏块为非正确解码块,则判断当前宏块的下一个宏块为正确解码块还是为非正确解码块,如果当前宏块的下一个宏块为正确解码块,则利用当前宏块的编码模式和亮度预测模式恢复当前宏块,然后执行步骤②-6;如果当前宏块的下一个宏块为非正确解码块,则采用现有的双线性内插法恢复当前宏块。If the current macroblock is an incorrectly decoded block, then determine whether the next macroblock of the current macroblock is a correctly decoded block or an incorrectly decoded block, and if the next macroblock of the current macroblock is a correctly decoded block, use the current macroblock The coding mode and brightness prediction mode restore the current macroblock, and then perform step ②-6; if the next macroblock of the current macroblock is an incorrectly decoded block, use the existing bilinear interpolation method to restore the current macroblock.

在此具体实施例中,步骤②-4中利用当前宏块的编码模式和亮度预测模式恢复当前宏块的具体过程为:In this specific embodiment, the specific process of recovering the current macroblock using the encoding mode and brightness prediction mode of the current macroblock in step ②-4 is:

②-4a、如果当前宏块的编码模式为Intra16×16,则利用当前宏块的亮度预测模式对当前宏块中的每个像素点的像素值进行预测,然后将当前宏块中的每个像素点的预测值作为对应像素点的最终恢复的像素值,完成当前宏块的恢复。②-4a. If the encoding mode of the current macroblock is Intra16×16, use the brightness prediction mode of the current macroblock to predict the pixel value of each pixel in the current macroblock, and then use The predicted value of the pixel is used as the final restored pixel value of the corresponding pixel to complete the restoration of the current macroblock.

②-4b、如果当前宏块的编码模式为Intra4×4,则利用当前宏块中编号为0的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值。②-4b. If the encoding mode of the current macroblock is Intra4×4, use the brightness prediction mode of the 4×4 block numbered 0 in the current macroblock to each of the 8×8 blocks where the 4×4 block is located The pixel value of each pixel in the 4×4 block is predicted, and then the predicted value of each pixel in each 4×4 block is used as the final restored pixel corresponding to each pixel in the 4×4 block value.

利用当前宏块中编号为4的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值。Use the brightness prediction mode of the 4×4 block numbered 4 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then The predicted value of each pixel in each 4×4 block is used as the final restored pixel value of each pixel in the corresponding 4×4 block.

利用当前宏块中编号为8的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值。Use the brightness prediction mode of the 4×4 block numbered 8 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then The predicted value of each pixel in each 4×4 block is used as the final restored pixel value of each pixel in the corresponding 4×4 block.

利用当前宏块中编号为12的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值。Use the brightness prediction mode of the 4×4 block numbered 12 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then The predicted value of each pixel in each 4×4 block is used as the final restored pixel value of each pixel in the corresponding 4×4 block.

②-5、判断当前宏块为正确解码块还是为非正确解码块,如果当前宏块为正确解码块,则对当前宏块不作处理,至此完成解码后的I帧中的所有非正确解码块的恢复;如果当前宏块为非正确解码块,则采用现有的双线性内插法恢复当前宏块,至此完成解码后的I帧中的所有非正确解码块的恢复。②-5. Determine whether the current macroblock is a correctly decoded block or an incorrectly decoded block. If the current macroblock is a correctly decoded block, the current macroblock is not processed. So far, all incorrectly decoded blocks in the decoded I frame are completed recovery; if the current macroblock is an incorrectly decoded block, the existing bilinear interpolation method is used to restore the current macroblock, and the recovery of all incorrectly decoded blocks in the decoded I frame is completed so far.

②-6、令k=k+1,将解码后的I帧中的下一个待处理的宏块作为当前宏块,然后返回步骤②-3继续执行,其中,k=k+1中的“=”为赋值符号。②-6, make k=k+1, use the next macroblock to be processed in the decoded I frame as the current macroblock, then return to step ②-3 to continue execution, wherein, " in k=k+1 =" is an assignment symbol.

本发明方法选择在H.264/AVC的测试模型JM-12.0上进行仿真实验。仿真中采用H.264/AVC基本档次对标准QCIF格式(176×144)视频序列Foreman、Carphone、Container、Akyio、Silent和Mobile进行编码测试。为了验证本发明方法对存在场景变化的有效性,采用由Akiyo、Bridge-close、Carphone合成的混合序列来模拟存在场景变化情况。两组测试实验分别在丢失率为10%、20%时,将本发明方法与现有的测试模型JM-12.0自带的帧内恢复方法(JM方法)和现有的Chung等人提出的基于直方图平移可逆信息隐藏的错误恢复算法(RH方法)做了对比实验。表1给出了设置的一些基本的编码参数。The method of the present invention chooses to carry out the simulation experiment on the test model JM-12.0 of H.264/AVC. In the simulation, the standard QCIF format (176×144) video sequences Foreman, Carphone, Container, Akyio, Silent and Mobile are encoded and tested using H.264/AVC basic profile. In order to verify the effectiveness of the method of the present invention for existing scene changes, a mixed sequence composed of Akiyo, Bridge-close, and Carphone is used to simulate the presence of scene changes. Two groups of test experiments respectively when the loss rate is 10% and 20%, the method of the present invention is combined with the intra-frame recovery method (JM method) carried by the existing test model JM-12.0 and the existing method based on Chung et al. The error recovery algorithm (RH method) of histogram shifting reversible information hiding is compared with the experiment. Table 1 shows some basic encoding parameters set.

表1 编码参数设置Table 1 Encoding parameter setting

档次grade 基本档次basic class 编码结构coding structure IPPPPIPPPP 编码帧数Encoded frames 150150 帧率(帧/秒)Frame rate (frame/second) 1515 熵编码方式entropy coding CAVLCCAVLC

为了验证本发明方法的错误恢复效果,特别是存在场景变化情况时视频错误恢复的质量,做了两组实验。一组是对标准的视频测试序列Foreman、Carphone、Container、Akyio、Silent和Mobile进行编码,在丢包率分别为10%、20%时测试实验,对比采用本发明方法与现有的JM方法和RH方法处理后的I帧图像的主客观质量;另一组是模拟存在场景变换的情况,即采用合成的序列进行编码测试,同样是在丢包率分别为10%、20%时测试实验,对比采用本发明方法与现有的JM方法和RH方法处理后的I帧图像的主客观质量。In order to verify the error recovery effect of the method of the present invention, especially the quality of video error recovery when there are scene changes, two groups of experiments are done. One group is to encode the standard video test sequences Foreman, Carphone, Container, Akyio, Silent and Mobile, test experiments when the packet loss rate is 10% and 20% respectively, compare the method of the present invention with the existing JM method and The subjective and objective quality of the I-frame image processed by the RH method; the other group is to simulate the situation of scene change, that is, to use the synthesized sequence for encoding test, and to test the experiment when the packet loss rate is 10% and 20%, respectively. The subjective and objective quality of the I-frame image processed by the method of the present invention and the existing JM method and the RH method is compared.

图3a至图3f分别给出了编码量化参数QP=28时,Foreman、Carphone、Container、Akyio、Silent和Mobile标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图。从图3a至图3f中可以看出,在丢失率为10%、20%时,采用本发明方法的错误恢复客观质量均高于采用现有的JM方法的错误恢复客观质量,分别平均高出3.24dB、2.79dB。Fig. 3 a to Fig. 3 f have provided coding quantization parameter QP=28 respectively, and the I frame of Foreman, Carphone, Container, Akyio, Silent and Mobile standard test sequence is under different macroblock loss rates, adopts the method of the present invention and existing Schematic diagram comparing objective quality of error recovery after processing by JM method and RH method. It can be seen from Fig. 3a to Fig. 3f that when the loss rate is 10% and 20%, the objective quality of error recovery using the method of the present invention is higher than the objective quality of error recovery using the existing JM method. 3.24dB, 2.79dB.

图4a至图4f分别给出了编码量化参数QP=38时,Foreman、Carphone、Container、Akyio、Silent和Mobile标准测试序列的I帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图。Fig. 4 a to Fig. 4 f have provided respectively when coding quantization parameter QP=38, and the I frame of Foreman, Carphone, Container, Akyio, Silent and Mobile standard test sequence is under different macroblock loss rates, adopts the method of the present invention and existing Schematic diagram comparing objective quality of error recovery after processing by JM method and RH method.

图5a给出了Carphone标准测试序列的第20帧(I帧)的原图,图5b给出了图5a丢块后的图(丢块率为20%),图5c给出了采用现有的JM方法对图5b进行恢复后的图,图5d给出了采用现有的RH方法对图5b进行恢复后的图,图5e给出了采用本发明方法对图5b进行恢复后的图。从图5c至图5e中可以看出,采用JM平台使用的加权内插法容易使丢失宏块图像模糊,采用RH方法恢复的图容易产生块效应,相比之下,采用本发明方法可以较好地恢复图像的边缘和纹理,避免块效应,主观质量明显好于现有的JM方法和RH方法。Fig. 5 a has provided the original picture of the 20th frame (I frame) of Carphone standard test sequence, Fig. 5 b has provided the figure after Fig. 5 a loses block (block loss rate 20%), Fig. 5 c has provided and adopted existing Figure 5b is restored by the JM method, Figure 5d shows the restored image of Figure 5b using the existing RH method, and Figure 5e shows the restored image of Figure 5b using the method of the present invention. It can be seen from Fig. 5c to Fig. 5e that the weighted interpolation method used by the JM platform is easy to make the lost macroblock image blurred, and the image restored by the RH method is easy to produce block effects. In contrast, the method of the present invention can be compared It can well restore the edge and texture of the image, avoid block effects, and the subjective quality is significantly better than the existing JM method and RH method.

图6a和图6b分别给出了编码量化参数QP=28和QP=38时,由Akiyo、Carphone、Bridge-close三个标准测试序列以30帧为间隔合成的合成序列的前150帧在不同宏块丢失率下,采用本发明方法与现有的JM方法和RH方法处理后的错误恢复客观质量比较示意图。从图6a和图6b中可以看出,存在场景变化时,采用本发明方法的客观恢复质量明显高于采用现有的JM方法和RH方法。在QP=28、宏块丢失率为10%时,采用本发明方法的客观恢复质量高出采用现有的JM方法的客观恢复质量2.14dB;在QP=28、宏块丢失率为20%时,采用本发明方法的客观恢复质量高出采用现有的JM方法的客观恢复质量0.93dB。与现有的RH方法相比,采用本发明方法的客观恢复质量平均高出大约1dB,这是因为采用RH方法,其特征是两个I帧宏块的运动矢量,这样存在场景变换时,RH方法会将前面的I帧的场景图像块,错误地引入到当前帧,不可避免的造成PSNR值下降,影响重建质量。Figure 6a and Figure 6b respectively show the encoding and quantization parameters QP=28 and QP=38, the first 150 frames of the synthetic sequence synthesized by the three standard test sequences of Akiyo, Carphone, and Bridge-close at intervals of 30 frames in different macros Under the block loss rate, a schematic diagram of comparing the objective quality of error recovery after processing by the method of the present invention and the existing JM method and RH method. It can be seen from Fig. 6a and Fig. 6b that when there is a scene change, the objective restoration quality of the method of the present invention is obviously higher than that of the existing JM method and RH method. When QP=28, macroblock loss rate is 10%, the objective restoration quality adopting the method of the present invention is higher than adopting the objective restoration quality of existing JM method by 2.14dB; When QP=28, macroblock loss rate is 20% , the objective restoration quality using the method of the present invention is 0.93dB higher than the objective restoration quality using the existing JM method. Compared with the existing RH method, the objective recovery quality of the method of the present invention is on average higher by about 1dB, because the RH method is characterized by the motion vectors of two I-frame macroblocks, so when there is a scene change, the RH The method will mistakenly introduce the scene image block of the previous I frame into the current frame, which will inevitably cause the PSNR value to decrease and affect the reconstruction quality.

图7a给出了合成序列的第29帧的原图,图7b给出了合成序列的第30帧(I帧)的原图,图7c给出了合成序列的第30帧的丢块后的图(丢块率为20%),图7d给出了采用现有的JM方法对图7c进行恢复后的主观质量图,图7e给出了采用现有的RH方法对图7c进行恢复后的主观质量图,图7f给出了采用本发明方法对图7c进行恢复后的主观质量图。从图7d至图7f所示的主观质量图中不难发现,本发明方法在存在场景变换时,可以保证重建质量以缓和的方式下降,避免产生块效应和图像模糊等。综合上述,对仿真结果分析发现:在存在场景变换时,利用本发明方法重建的视频的客观质量和主观质量明显好于利用现有的JM方法和RH方法重建的视频的客观质量和主观质量;在不存在场景变换时,本发明方法同样取得了很好的效果。Figure 7a shows the original picture of the 29th frame of the synthetic sequence, Figure 7b shows the original picture of the 30th frame (I frame) of the synthetic sequence, and Figure 7c shows the block loss of the 30th frame of the synthetic sequence Fig. 7 (block loss rate 20%), Fig. 7d shows the subjective quality map after using the existing JM method to restore Fig. 7c, and Fig. 7e shows the restoration of Fig. 7c using the existing RH method As for the subjective quality map, Fig. 7f shows the subjective quality map after restoration of Fig. 7c by the method of the present invention. It is not difficult to find from the subjective quality diagrams shown in Figures 7d to 7f that the method of the present invention can ensure that the reconstruction quality decreases in a moderate manner when there is a scene change, avoiding block effects and image blurring. In summary, the analysis of the simulation results found that: when there is a scene change, the objective quality and subjective quality of the video reconstructed by the method of the present invention are obviously better than the objective quality and subjective quality of the video reconstructed by the existing JM method and the RH method; When there is no scene change, the method of the present invention also achieves good results.

Claims (1)

1.一种基于可逆数据隐藏的H.264/AVC视频I帧错误恢复方法,其特征在于包括以下步骤:1. a kind of H.264/AVC video I frame error recovery method based on reversible data hiding, it is characterized in that comprising the following steps: ①在编码端,向I帧中除第1个宏块外的每个宏块中嵌入特征信息,得到嵌有特征信息的I帧,具体过程为:① At the encoding end, embed feature information into each macroblock except the first macroblock in the I frame to obtain an I frame embedded with feature information. The specific process is as follows: ①-1、将I帧中当前预编码完成的第k个宏块定义为当前宏块,其中,1≤k≤K,在此K表示I帧中包含的宏块的总个数,k的初始值为1;①-1. Define the kth macroblock that is currently pre-encoded in the I frame as the current macroblock, where 1≤k≤K, where K represents the total number of macroblocks contained in the I frame, and k The initial value is 1; ①-2、将当前宏块的CBP的十进制值转化为由6位二进制值组成的二进制串,并记为A,A=a1a2a3a4a5a6,其中,a1为A的最高位二进制值,a6为A的最低位二进制值;①-2. Convert the decimal value of the CBP of the current macroblock into a binary string composed of 6-bit binary values, and record it as A, A=a 1 a 2 a 3 a 4 a 5 a 6 , where a 1 is The highest binary value of A, a 6 is the lowest binary value of A; ①-3、提取当前宏块的特征向量:如果当前宏块的编码模式为Intra4×4,则提取当前宏块中编号为0、4、8、12这四个4×4块各自的亮度预测模式的数字标识,然后将这四个4×4块各自的亮度预测模式的数字标识量化为4个比特,之后按这四个4×4块在当前宏块中的编号的顺序将这四个4×4块的亮度预测模式以比特表示的数字标识排列构成一个包含16个元素的一维向量,再将该一维向量作为当前宏块的特征向量,记为wIntra4×4(k),其中,对应表示当前宏块的特征向量wIntra4×4(k)中的第1个元素、第2个元素和第16个元素;①-3. Extract the feature vector of the current macroblock: if the encoding mode of the current macroblock is Intra4×4, then extract the respective luminance predictions of the four 4×4 blocks numbered 0, 4, 8, and 12 in the current macroblock The digital identification of the mode, and then quantize the digital identification of the respective luma prediction modes of the four 4×4 blocks into 4 bits, and then the four 4×4 blocks are numbered in the order of the current macroblock. The luminance prediction mode of the 4×4 block is arranged with the digital identification represented by bits to form a one-dimensional vector containing 16 elements, and then the one-dimensional vector is used as the feature vector of the current macroblock, which is recorded as w Intra4×4 (k), in, with Correspondingly represent the first element, the second element and the 16th element in the feature vector w Intra4×4 (k) of the current macroblock; 如果当前宏块的编码模式为Intra16×16,则用数字9标识当前宏块的编码模式,然后将当前宏块的编码模式的数字标识量化为4个比特,并将当前宏块的亮度预测模式的数字标识量化为4个比特,之后按先后顺序将当前宏块的编码模式以比特表示的数字标识和当前宏块的亮度预测模式以比特表示的数字标识排列构成一个包含8个元素的一维向量,再将该一维向量作为当前宏块的特征向量,记为wIntra16×16(k),其中,对应表示当前宏块的特征向量wIntra16×16(k)中的第1个元素、第2个元素和第8个元素;If the encoding mode of the current macroblock is Intra16×16, the number 9 is used to identify the encoding mode of the current macroblock, and then the digital identification of the encoding mode of the current macroblock is quantized to 4 bits, and the brightness prediction mode of the current macroblock is The digital identification of the current macroblock is quantized into 4 bits, and then the current macroblock coding mode and the current macroblock's luminance prediction mode are arranged in order to form a one-dimensional matrix containing 8 elements. vector, and then use the one-dimensional vector as the feature vector of the current macroblock, denoted as w Intra16×16 (k), in, with Correspondingly represent the first element, the second element and the eighth element in the feature vector w Intra16×16 (k) of the current macroblock; ①-4、确定当前宏块的宿主向量:计算当前宏块中的每个4×4块的所有交流DCT系数的绝对值的和,将和值最大的4×4块作为特征信息嵌入块,然后以zig-zag方式扫描特征信息嵌入块中的所有量化DCT系数,之后按zig-zag方式扫描的顺序将特征信息嵌入块中的第8个至第16个量化DCT系数排列构成一个包含9个元素的一维向量,再将该一维向量作为当前宏块的宿主向量,记为x(k),x(k)=(x1x2…x9),其中,x1、x2和x9对应表示当前宏块的宿主向量x(k)中的第1个元素、第2个元素和第9个元素;①-4. Determine the host vector of the current macroblock: calculate the sum of the absolute values of all AC DCT coefficients of each 4×4 block in the current macroblock, and embed the 4×4 block with the largest sum value as the feature information into the block, Then scan all the quantized DCT coefficients in the feature information embedding block in zig-zag mode, and then arrange the 8th to 16th quantized DCT coefficients in the feature information embedding block in the order of zig-zag scanning to form a set containing 9 The one-dimensional vector of the element, and then use the one-dimensional vector as the host vector of the current macroblock, which is recorded as x(k), x(k)=(x 1 x 2 ... x 9 ), where x 1 , x 2 and x 9 corresponds to the first element, the second element and the ninth element in the host vector x(k) of the current macroblock; ①-5、将当前宏块的上一个宏块的特征向量嵌入到当前宏块的宿主向量中:判断当前宏块是否为I帧中的第1个宏块,如果是,则对当前宏块不作处理,直接执行步骤①-7;否则,若当前宏块的上一个宏块的编码模式为Intra4×4,则采用两次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中,得到当前宏块对应的嵌有特征信息的向量然后用中的所有元素按序替换当前宏块中的特征信息嵌入块中的第8个至第16个量化DCT系数,再执行步骤①-6;若当前宏块的上一个宏块的编码模式为Intra16×16,则采用一次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中,得到当前宏块对应的嵌有特征信息的向量然后用中的所有元素按序替换当前宏块中的特征信息嵌入块中的第8个至第16个量化DCT系数,再执行步骤①-6;①-5. Embed the eigenvector of the previous macroblock of the current macroblock into the host vector of the current macroblock: determine whether the current macroblock is the first macroblock in the I frame, and if so, perform Do not process, directly execute steps ①-7; otherwise, if the coding mode of the previous macroblock of the current macroblock is Intra4×4, use the method of two generalized difference extensions to convert the feature vector of the previous macroblock of the current macroblock w Intra4×4 (k-1) is embedded into the host vector x(k) of the current macroblock to obtain the vector embedded with feature information corresponding to the current macroblock then use Replace all the elements in the current macroblock in sequence with the 8th to 16th quantized DCT coefficients in the feature information embedding block, and then perform steps ①-6; if the coding mode of the previous macroblock of the current macroblock is Intra16 ×16, then use a generalized differential extension method to embed the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock to obtain the current macroblock The corresponding vector embedded with feature information then use All elements in replace the 8th to 16th quantized DCT coefficients in the feature information embedding block in the current macroblock in order, and then perform steps ①-6; 所述的步骤①-5中采用两次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra4×4(k-1)嵌入到当前宏块的宿主向量x(k)中的具体过程为:In the step ①-5, the method of two generalized differential extensions is used to embed the feature vector w Intra4×4 (k-1) of the previous macroblock of the current macroblock into the host vector x(k) of the current macroblock The specific process is: A1、对x(k)进行正变换,得到向量y(k),y(k)=(y1y2…y9),其中,y1、y2和y9对应表示y(k)中的第1个元素、第2个元素和第9个元素,y2=x2-x1,yi'=xi'-x1,y9=x9-x1,2≤i'≤9,αi为权值,符号为向下取整符号;A1. Carry out positive transformation to x(k) to obtain vector y(k), y(k)=(y 1 y 2 ... y 9 ), wherein, y 1 , y 2 and y 9 correspond to y(k) The 1st element, the 2nd element and the 9th element of the , y 2 =x 2 -x 1 , y i'xi' -x 1 , y 9 =x 9 -x 1 , 2≤i'≤9, α i is weight, symbol is the rounding down symbol; A2、将wIntra4×4(k-1)中的第1个元素至第8个元素嵌入到y(k)中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9,对应表示wIntra4×4(k-1)中的第1个元素、第i'-1个元素和第8个元素;A2. Embed the first to eighth elements of w Intra4×4 (k-1) into y(k) to get a vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represents the first element, the i'-1th element and the 8th element in w Intra4×4 (k-1); A3、对进行逆变换,得到嵌有部分特征信息的向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9;A3, yes Perform an inverse transformation to obtain a vector embedded with part of the feature information in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9; A4、对进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值;A4, yes Perform forward transformation to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight; A5、将wIntra4×4(k-1)中的第9个元素至第16个元素嵌入到中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9,对应表示wIntra4×4(k-1)中的第9个元素、第i'+7个元素和第16个元素;A5. Embed the 9th to 16th elements in w Intra4×4 (k-1) into , get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represent the 9th element, the i'+7th element and the 16th element in w Intra4×4 (k-1); A6、对进行逆变换,得到当前宏块对应的嵌有特征信息的向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9;A6, yes Perform inverse transformation to obtain the vector embedded with feature information corresponding to the current macroblock in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9; 所述的步骤①-5中采用一次广义差分扩展的方法将当前宏块的上一个宏块的特征向量wIntra16×16(k-1)嵌入到当前宏块的宿主向量x(k)中的具体过程为:In the step ①-5, the feature vector w Intra16×16 (k-1) of the previous macroblock of the current macroblock is embedded into the host vector x(k) of the current macroblock by using a generalized differential extension method The specific process is: B1、对x(k)进行正变换,得到向量y(k),y(k)=(y1y2…y9),其中,y1、y2和y9对应表示y(k)中的第1个元素、第2个元素和第9个元素,y2=x2-x1,yi'=xi'-x1,y9=x9-x1,2≤i'≤9,αi为权值,符号为向下取整符号;B1. Carry out positive transformation on x(k) to obtain vector y(k), y(k)=(y 1 y 2 ... y 9 ), wherein, y 1 , y 2 and y 9 correspond to y(k) The 1st element, the 2nd element and the 9th element of the , y 2 =x 2 -x 1 , y i'xi' -x 1 , y 9 =x 9 -x 1 , 2≤i'≤9, α i is weight, symbol is the rounding down symbol; B2、将wIntra16×16(k-1)嵌入到y(k)中,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,对应表示wIntra16×16(k-1)中的第1个元素、第i'-1个元素和第8个元素;B2. Embed w Intra16×16 (k-1) into y(k) to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, with Correspondingly represents the first element, the i'-1th element and the 8th element in w Intra16×16 (k-1); B3、对进行逆变换,得到当前宏块对应的嵌有特征信息的向量 其中,对应表示中的第1个元素、第2个元素和第9个元素,2≤i'≤9;B3, yes Perform inverse transformation to obtain the vector embedded with feature information corresponding to the current macroblock in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9; ①-6、修改当前宏块的CBP,然后执行步骤①-7;①-6. Modify the CBP of the current macroblock, and then perform steps ①-7; 所述的步骤①-6中修改当前宏块的CBP的具体过程为:The specific process of modifying the CBP of the current macroblock in the described step 1.-6 is: ①-6a、如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中左上角位置的8×8块,则统计当前宏块嵌入特征信息后左上角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a6置为0,a3,a4,a5保持不变,如果不全为0,则将A中的a6置为1,a3,a4,a5保持不变;①-6a. If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the upper left corner of the current macroblock, then count the 8×8 at the upper left corner of the current macroblock after embedding the feature information Whether all the quantized DCT coefficients in the block are all 0, if all are 0, set a 6 in A to 0, a 3 , a 4 , a 5 remain unchanged, if not all 0, set a 6 in A a 6 is set to 1, a 3 , a 4 , a 5 remain unchanged; 如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中右上角位置的8×8块,则统计当前宏块嵌入特征信息后右上角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a5置为0,a3,a4,a6保持不变,如果不全为0,则将A中的a5置为1,a3,a4,a6保持不变;If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block in the upper right corner of the current macroblock, then count all the 8×8 blocks in the upper right corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 5 in A to 0, a 3 , a 4 , a 6 remain unchanged, if they are not all 0, set a 5 in A to 0 1, a 3 , a 4 , a 6 remain unchanged; 如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中左下角位置的8×8块,则统计当前宏块嵌入特征信息后左下角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a4置为0,a3,a5,a6保持不变,如果不全为0,则将A中的a4置为1,a3,a5,a6保持不变;If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the lower left corner of the current macroblock, then count all the 8×8 blocks at the lower left corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 4 in A to 0, a 3 , a 5 , a 6 remain unchanged, if they are not all 0, set a 4 in A to 0 1, a 3 , a 5 , a 6 remain unchanged; 如果当前宏块中的特征信息嵌入块所在的8×8块为当前宏块中右下角位置的8×8块,则统计当前宏块嵌入特征信息后右下角位置的8×8块中的所有量化DCT系数是否全为0,如果全为0,则将A中的a3置为0,a4,a5,a6保持不变,如果不全为0,则将A中的a3置为1,a4,a5,a6保持不变;If the 8×8 block where the feature information embedded block in the current macroblock is located is the 8×8 block at the lower right corner of the current macroblock, then count all the 8×8 blocks at the lower right corner after the feature information is embedded in the current macroblock Whether the quantized DCT coefficients are all 0, if they are all 0, set a 3 in A to 0, a 4 , a 5 , a 6 remain unchanged, if they are not all 0, set a 3 in A to 0 1, a 4 , a 5 , a 6 remain unchanged; ①-6b、将修改后的A转化成十进制数,得到当前宏块修改后的CBP;①-6b, converting the modified A into a decimal number to obtain the modified CBP of the current macroblock; ①-7、对当前宏块进行熵编码;①-7. Entropy encoding is performed on the current macroblock; ①-8、令k=k+1,将I帧中下一个预编码完成的宏块作为当前宏块,再返回步骤①-2继续执行,直至I帧中的所有预编码完成的宏块处理完毕,得到嵌有特征信息的I帧的编码码流,其中,k=k+1中的“=”为赋值符号;①-8. Make k=k+1, use the next pre-encoded macroblock in the I frame as the current macroblock, and return to step ①-2 to continue until all pre-encoded macroblocks in the I frame are processed Complete, obtain the coded stream of the I frame that is embedded with feature information, wherein, "=" in k=k+1 is the assignment symbol; ②在解码端,从嵌有特征信息的I帧中的每个宏块中提取出特征信息,并确定每个宏块的编码模式和亮度预测模式,再对非正确解码块进行错误恢复,具体过程为:② At the decoding end, feature information is extracted from each macroblock in the I frame embedded with feature information, and the coding mode and brightness prediction mode of each macroblock are determined, and then error recovery is performed on incorrectly decoded blocks, specifically The process is: ②-1、对嵌有特征信息的I帧中的每个宏块进行熵解码,然后确定熵解码后的每个宏块是否为正确解码块,接着确定除熵解码后的第1个宏块外的每个正确解码块的包含有特征信息的向量,再从除熵解码后的第1个宏块外的每个正确解码块的包含有特征信息的向量中提取出特征信息,并确定除熵解码后的第1个宏块外的每个正确解码块的上一个宏块的编码模式和亮度预测模式,假设熵解码后的第k'个宏块为正确解码块,则②-1. Perform entropy decoding on each macroblock in the I frame embedded with feature information, then determine whether each macroblock after entropy decoding is a correct decoded block, and then determine the first macroblock after entropy-decoding The vector containing feature information of each correctly decoded block except the first macroblock after entropy decoding extracts the feature information from the vector containing feature information of each correctly decoded block except the first macroblock after entropy decoding, and determines The encoding mode and brightness prediction mode of the previous macroblock of each correctly decoded block outside the first macroblock after entropy decoding, assuming that the k'th macroblock after entropy decoding is a correctly decoded block, then 确定该宏块的包含有特征信息的向量的具体过程为:计算该宏块中的每个4×4块的所有经反量化后为交流DCT系数的量化DCT系数的绝对值的和,将和值最大的4×4块作为特征信息提取块,然后以zig-zag方式扫描特征信息提取块中的所有量化DCT系数,之后按zig-zag方式扫描的顺序将特征信息提取块中的第8个至第16个量化DCT系数排列构成一个包含9个元素的一维向量,再将该一维向量作为该宏块的包含有特征信息的向量,记为 其中,对应表示中的第1个元素、第2个元素和第9个元素;The specific process of determining the vector containing feature information of the macroblock is: calculating the sum of the absolute values of all the quantized DCT coefficients of each 4×4 block in the macroblock that are dequantized as AC DCT coefficients, and the sum The 4×4 block with the largest value is used as the feature information extraction block, and then all quantized DCT coefficients in the feature information extraction block are scanned in zig-zag mode, and then the eighth one in the feature information extraction block is scanned in the order of zig-zag mode The 16th quantized DCT coefficients are arranged to form a one-dimensional vector containing 9 elements, and then the one-dimensional vector is used as the vector containing feature information of the macroblock, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 9th element in ; 从该宏块的包含有特征信息的向量中提取出特征信息,并确定该宏块的上一个宏块的编码模式和亮度预测模式;The vector containing feature information from the macroblock Extract feature information from the macroblock, and determine the encoding mode and brightness prediction mode of the previous macroblock of the macroblock; 上述,2≤k'≤K;Above, 2≤k'≤K; 所述的步骤②-1中从该宏块的包含有特征信息的向量中提取出特征信息,并确定该宏块的上一个宏块的编码模式和亮度预测模式的具体过程为:In the step ②-1, the vector containing feature information from the macroblock The specific process of extracting feature information from the macroblock and determining the encoding mode and brightness prediction mode of the previous macroblock of the macroblock is as follows: ②-1a、对进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值,符号为向下取整符号;②-1a, yes Perform forward transformation to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight, symbol is the rounding down symbol; ②-1b、从中提取出由8个特征信息比特组成的特征信息,记为 其中,对应表示中的第1个元素、第2个元素和第8个元素,1≤j≤8,符号“||”为取绝对值运算符号;②-1b, from The feature information consisting of 8 feature information bits is extracted from the feature information, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 8th element in the , 1≤j≤8, the symbol "||" is the absolute value operation symbol; ②-1c、构建一个新的向量z(k'),z(k')=(z1z2…z9),其中,z1、z2和z9对应表示z(k')中的第1个元素、第2个元素和第9个元素, 2≤i'≤9;②-1c. Construct a new vector z(k'), z(k')=(z 1 z 2 ... z 9 ), where z 1 , z 2 and z 9 correspond to the z(k') 1st element, 2nd element and 9th element, 2≤i'≤9; ②-1d、对z(k')进行逆变换,得到向量f(k'),f(k')=(f1f2…f9),其中,f1、f2和f9对应表示f(k')中的第1个元素、第2个元素和第9个元素,f2=z2+f1,fi'=zi'+f1,f9=z9+f1,2≤i'≤9;②-1d. Perform inverse transformation on z(k') to obtain vector f(k'), f(k')=(f 1 f 2 …f 9 ), where f 1 , f 2 and f 9 correspond to represent The 1st element, the 2nd element and the 9th element in f(k'), f 2 =z 2 +f 1 , f i' =z i' +f 1 , f 9 =z 9 +f 1 , 2≤i'≤9; ②-1e、将由中的第1个元素第2个元素第3个元素和第4个元素组成的二进制串转化为十进制值,如果十进制值对应数字9,则表示该宏块的上一个宏块的编码模式为Intra16×16,然后用f(k')中的所有元素按序替换该宏块的上一个宏块中的特征信息提取块中的第8个至第16个量化DCT系数,接着确定该宏块的上一个宏块的亮度预测模式,该宏块的上一个宏块的亮度预测模式的数字标识为由中的第5个元素第6个元素第7个元素和第8个元素组成的二进制串转化而成的十进制值,结束特征信息提取及编码模式和亮度预测模式确定;②-1e, will be made by The first element in 2nd element 3rd element and the 4th element The composed binary string is converted into a decimal value. If the decimal value corresponds to the number 9, it means that the coding mode of the previous macroblock of this macroblock is Intra16×16, and then replace the macro with all elements in f(k') in order The feature information in the previous macroblock of the block is extracted from the 8th to 16th quantized DCT coefficients in the block, and then the brightness prediction mode of the previous macroblock of the macroblock is determined, and the brightness of the previous macroblock of the macroblock is determined. The numerical identification of the predictive mode is given by The 5th element in 6th element 7th element and the 8th element The decimal value converted from the composed binary string ends feature information extraction and determination of encoding mode and brightness prediction mode; 如果十进制值不对应数字9,则表示该宏块的上一个宏块的编码模式为Intra 4×4,然后执行步骤②-1f;If the decimal value does not correspond to the number 9, it means that the coding mode of the previous macroblock of this macroblock is Intra 4×4, and then perform step ②-1f; ②-1f、对f(k')进行正变换,得到向量 其中,对应表示中的第1个元素、第2个元素和第9个元素, 2≤i'≤9,αi为权值,符号为向下取整符号;②-1f, perform positive transformation on f(k') to get the vector in, with Corresponding representation The 1st element, the 2nd element and the 9th element in the , 2≤i'≤9, α i is the weight, symbol is the rounding down symbol; ②-1g、从中提取出由8个特征信息比特组成的特征信息,记为 其中,对应表示中的第1个元素、第2个元素和第8个元素,1≤j≤8,符号“| |”为取绝对值运算符号;②-1g, from The feature information consisting of 8 feature information bits is extracted from the feature information, which is denoted as in, with Corresponding representation The 1st element, the 2nd element and the 8th element in the , 1≤j≤8, the symbol "| |" is the absolute value operation symbol; ②-1h、构建一个新的向量z'(k'),z'(k')=(z1'z2'…z9'),其中,z1'、z2'和z9'对应表示z'(k')中的第1个元素、第2个元素和第9个元素, 2≤i'≤9;②-1h. Construct a new vector z'(k'), z'(k')=(z 1 'z 2 '...z 9 '), where z 1 ', z 2 ' and z 9 ' correspond to Indicates the 1st element, the 2nd element and the 9th element in z'(k'), 2≤i'≤9; ②-1i、对z'(k')进行逆变换,得到向量x(k'),x(k')=(x1x2…x9),其中,x1、x2和x9对应表示x(k')中的第1个元素、第2个元素和第9个元素,x2=z2'+x1,xi'=zi′′+x1,x9=z9'+x1,2≤i'≤9;②-1i. Perform inverse transformation on z'(k') to obtain vector x(k'), x(k')=(x 1 x 2 ... x 9 ), where x 1 , x 2 and x 9 correspond to Represents the 1st element, the 2nd element and the 9th element in x(k'), x 2 =z 2 '+x 1 , x i' =z i' '+x 1 , x 9 =z 9 '+x 1 , 2≤i'≤9; ②-1j、用x(k')中的所有元素按序替换该宏块的上一个宏块中的特征信息提取块中的第8个至第16个量化DCT系数;②-1j. Replace the 8th to 16th quantized DCT coefficients in the feature information extraction block in the previous macroblock of the macroblock in sequence with all elements in x(k'); ②-1k、构建一个包含16个元素的向量w(k'),w(k')的前8个元素为的8个元素,w(k')的后8个元素为的8个元素;②-1k, construct a vector w(k') containing 16 elements, the first 8 elements of w(k') are The 8 elements of w(k'), the last 8 elements of w(k') are 8 elements of ②-1l、确定该宏块的上一个宏块中编号为0的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第1个元素、第2个元素、第3个元素和第4个元素组成的二进制串转化而成的十进制值;②-11. Determine the luminance prediction mode of the 4×4 block numbered 0 in the previous macroblock of the macroblock, and the number of the luminance prediction mode of the 4×4 block is identified by the first in w(k') The decimal value converted from the binary string composed of the first element, the second element, the third element and the fourth element; 确定该宏块的上一个宏块中编号为4的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第5个元素、第6个元素、第7个元素和第8个元素组成的二进制串转化而成的十进制值;Determine the luminance prediction mode of the 4×4 block numbered 4 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the fifth element in w(k'), the first The decimal value converted from the binary string composed of 6 elements, the 7th element and the 8th element; 确定该宏块的上一个宏块中编号为8的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第9个元素、第10个元素、第11个元素和第12个元素组成的二进制串转化而成的十进制值;Determine the luminance prediction mode of the 4×4 block numbered 8 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the 9th element in w(k'), the 9th element The decimal value converted from the binary string composed of 10 elements, the 11th element and the 12th element; 确定该宏块的上一个宏块中编号为12的4×4块的亮度预测模式,该4×4块的亮度预测模式的数字标识为由w(k')中的第13个元素、第14个元素、第15个元素和第16个元素组成的二进制串转化而成的十进制值;Determine the luminance prediction mode of the 4×4 block numbered 12 in the previous macroblock of the macroblock, the number of the luminance prediction mode of the 4×4 block is identified by the 13th element in w(k'), the th The decimal value converted from the binary string composed of 14 elements, the 15th element and the 16th element; 结束特征信息提取及编码模式和亮度预测模式确定;End feature information extraction and encoding mode and brightness prediction mode determination; ②-2、将解码后的I帧中的第k个宏块定义为当前宏块,其中,1≤k≤K,k的初始值为1;②-2. Define the kth macroblock in the decoded I frame as the current macroblock, wherein, 1≤k≤K, and the initial value of k is 1; ②-3、判断当前宏块是否为解码后的I帧中的最后一个宏块,如果当前宏块不是最后一个宏块,则执行步骤②-4,如果当前宏块是最后一个宏块,则执行步骤②-5;②-3, judge whether the current macroblock is the last macroblock in the decoded I frame, if the current macroblock is not the last macroblock, then perform step ②-4, if the current macroblock is the last macroblock, then Execute steps ②-5; ②-4、判断当前宏块为正确解码块还是为非正确解码块,如果当前宏块为正确解码块,则对当前宏块不作处理,然后执行步骤②-6;②-4. Judging whether the current macroblock is a correctly decoded block or an incorrectly decoded block, if the current macroblock is a correctly decoded block, then the current macroblock is not processed, and then step ②-6 is performed; 如果当前宏块为非正确解码块,则判断当前宏块的下一个宏块为正确解码块还是为非正确解码块,如果当前宏块的下一个宏块为正确解码块,则利用当前宏块的编码模式和亮度预测模式恢复当前宏块,然后执行步骤②-6;如果当前宏块的下一个宏块为非正确解码块,则采用双线性内插法恢复当前宏块;If the current macroblock is an incorrectly decoded block, then determine whether the next macroblock of the current macroblock is a correctly decoded block or an incorrectly decoded block, and if the next macroblock of the current macroblock is a correctly decoded block, use the current macroblock The encoding mode and brightness prediction mode restore the current macroblock, and then perform step ②-6; if the next macroblock of the current macroblock is an incorrectly decoded block, use bilinear interpolation to restore the current macroblock; 所述的步骤②-4中利用当前宏块的编码模式和亮度预测模式恢复当前宏块的具体过程为:The specific process of using the encoding mode and brightness prediction mode of the current macroblock in the described step ②-4 to restore the current macroblock is: ②-4a、如果当前宏块的编码模式为Intra16×16,则利用当前宏块的亮度预测模式对当前宏块中的每个像素点的像素值进行预测,然后将当前宏块中的每个像素点的预测值作为对应像素点的最终恢复的像素值,完成当前宏块的恢复;②-4a. If the encoding mode of the current macroblock is Intra16×16, use the brightness prediction mode of the current macroblock to predict the pixel value of each pixel in the current macroblock, and then use The predicted value of the pixel is used as the final restored pixel value of the corresponding pixel to complete the restoration of the current macroblock; ②-4b、如果当前宏块的编码模式为Intra4×4,则利用当前宏块中编号为0的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;②-4b. If the encoding mode of the current macroblock is Intra4×4, use the brightness prediction mode of the 4×4 block numbered 0 in the current macroblock to each of the 8×8 blocks where the 4×4 block is located The pixel value of each pixel in the 4×4 block is predicted, and then the predicted value of each pixel in each 4×4 block is used as the final restored pixel corresponding to each pixel in the 4×4 block value; 利用当前宏块中编号为4的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;Use the brightness prediction mode of the 4×4 block numbered 4 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then Taking the predicted value of each pixel in each 4×4 block as the final restored pixel value of each pixel in the corresponding 4×4 block; 利用当前宏块中编号为8的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;Use the brightness prediction mode of the 4×4 block numbered 8 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then Taking the predicted value of each pixel in each 4×4 block as the final restored pixel value of each pixel in the corresponding 4×4 block; 利用当前宏块中编号为12的4×4块的亮度预测模式对该4×4块所在的8×8块中的每个4×4块中的每个像素点的像素值进行预测,然后将每个4×4块中的每个像素点的预测值作为对应4×4块中的每个像素点的最终恢复的像素值;Use the brightness prediction mode of the 4×4 block numbered 12 in the current macroblock to predict the pixel value of each pixel in each 4×4 block in the 8×8 block where the 4×4 block is located, and then Taking the predicted value of each pixel in each 4×4 block as the final restored pixel value of each pixel in the corresponding 4×4 block; ②-5、判断当前宏块为正确解码块还是为非正确解码块,如果当前宏块为正确解码块,则对当前宏块不作处理,至此完成解码后的I帧中的所有非正确解码块的恢复;如果当前宏块为非正确解码块,则采用双线性内插法恢复当前宏块,至此完成解码后的I帧中的所有非正确解码块的恢复;②-5. Determine whether the current macroblock is a correctly decoded block or an incorrectly decoded block. If the current macroblock is a correctly decoded block, the current macroblock is not processed. So far, all incorrectly decoded blocks in the decoded I frame are completed recovery; if the current macroblock is an incorrectly decoded block, the bilinear interpolation method is used to restore the current macroblock, and the recovery of all incorrectly decoded blocks in the decoded I frame is completed so far; ②-6、令k=k+1,将解码后的I帧中的下一个待处理的宏块作为当前宏块,然后返回步骤②-3继续执行,其中,k=k+1中的“=”为赋值符号。②-6, make k=k+1, use the next macroblock to be processed in the decoded I frame as the current macroblock, then return to step ②-3 to continue execution, wherein, " in k=k+1 =" is an assignment symbol.
CN201410287578.XA 2014-06-24 2014-06-24 A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data Active CN104144347B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410287578.XA CN104144347B (en) 2014-06-24 2014-06-24 A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410287578.XA CN104144347B (en) 2014-06-24 2014-06-24 A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data

Publications (2)

Publication Number Publication Date
CN104144347A CN104144347A (en) 2014-11-12
CN104144347B true CN104144347B (en) 2017-12-15

Family

ID=51853404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410287578.XA Active CN104144347B (en) 2014-06-24 2014-06-24 A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data

Country Status (1)

Country Link
CN (1) CN104144347B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108337514A (en) * 2017-12-28 2018-07-27 宁波工程学院 A kind of encrypted domain HEVC video data hidden methods
CN108683921B (en) * 2018-06-07 2020-04-07 四川大学 Video reversible information hiding method based on zero quantization DCT coefficient group

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621692A (en) * 2009-07-27 2010-01-06 宁波大学 H.264/AVC video information hiding method based on predictive mode
CN102223540A (en) * 2011-07-01 2011-10-19 宁波大学 Information hiding method facing to H.264/AVC (automatic volume control) video

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621692A (en) * 2009-07-27 2010-01-06 宁波大学 H.264/AVC video information hiding method based on predictive mode
CN102223540A (en) * 2011-07-01 2011-10-19 宁波大学 Information hiding method facing to H.264/AVC (automatic volume control) video

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
An Intra-frame Error Resilience Algorithm Based on Reversible Data Embedding in H.264/AVC;Ranran Li等;《Journal of Computational Information Systems》;20140215;第10卷;1489-1499 *
Video Error Resilience Scheme using Reversible Data Hiding Technique for Intra-Frame in H.264/AVC;Ranran Li等;《The 3rd International Conference on Multimedia Technology (ICMT 2013)》;20131231;462-469 *

Also Published As

Publication number Publication date
CN104144347A (en) 2014-11-12

Similar Documents

Publication Publication Date Title
CN100473167C (en) Image encoding method and image encoder
CN101415121B (en) A method and device for adaptive frame prediction
CN102223540B (en) Information hiding method facing to H.264/AVC (automatic volume control) video
CN101232619B (en) Video encoding method of embedding intraframe coding block
US8285064B2 (en) Method for processing images and the corresponding electronic device
CN104581176B (en) The insertion of H.264/AVC compression domain robust video watermark and extracting method without frame in error drift
CN101009835A (en) Background-based motion estimation coding method
CN107710759A (en) Method and device for the conversion coefficient encoding and decoding of non-square block
CN106210721B (en) A kind of quick code check code-transferring methods of HEVC
CN103442228B (en) Code-transferring method and transcoder thereof in from standard H.264/AVC to the fast frame of HEVC standard
CN101854548A (en) A video compression method for wireless multimedia sensor network
CN108965887B (en) Video information hiding method and device based on inter-block decoupling
CN115150628B (en) Method for coding coarse-to-fine depth video with super-priori guided mode prediction
CN104410861A (en) Video encoding method and device
CN108769700A (en) Reduce the robustness video steganography method of H.264 interframe drift distortion
CN106101714A (en) One and the tightly coupled H.264 video information hiding method of compression encoding process
CN108024114B (en) High-capacity lossless HEVC information hiding method based on flag bit parameter modification
CN107343202B (en) Feedback-free distributed video encoding and decoding method based on additional code rate
CN102256130B (en) Method for marking video frame image sequence number based on inserted macro block brightness particular values
CN115604488A (en) Method and device for loop filtering
CN104144347B (en) A kind of H.264/AVC video I frame error recovery methods based on hiding reversible data
CN104104956B (en) For layered video coding and the method for decoding, encoding apparatus and decoding apparatus
CN102378012A (en) Data hiding-based H.264 video transmission error code recovery method
CN104581173A (en) Soft decoding verification model platform
CN111212288A (en) Video data encoding and decoding method and device, computer equipment and storage medium

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