[go: up one dir, main page]

CN116233441A - H.265/HEVC video self-adaptive steganography method based on improved RDO - Google Patents

H.265/HEVC video self-adaptive steganography method based on improved RDO Download PDF

Info

Publication number
CN116233441A
CN116233441A CN202211648610.3A CN202211648610A CN116233441A CN 116233441 A CN116233441 A CN 116233441A CN 202211648610 A CN202211648610 A CN 202211648610A CN 116233441 A CN116233441 A CN 116233441A
Authority
CN
China
Prior art keywords
carrier
integer
current
type
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211648610.3A
Other languages
Chinese (zh)
Other versions
CN116233441B (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 of Technology
Original Assignee
Ningbo University of Technology
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 of Technology filed Critical Ningbo University of Technology
Priority to CN202211648610.3A priority Critical patent/CN116233441B/en
Publication of CN116233441A publication Critical patent/CN116233441A/en
Application granted granted Critical
Publication of CN116233441B publication Critical patent/CN116233441B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • H04N19/122Selection of transform size, e.g. 8x8 or 2x4x8 DCT; Selection of sub-band transforms of varying structure or type
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/189Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding
    • H04N19/192Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the adaptation method, adaptation tool or adaptation type used for the adaptive coding the adaptation method, adaptation tool or adaptation type being iterative or recursive
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process
    • H04N19/467Embedding additional information in the video signal during the compression process characterised by the embedded information being invisible, e.g. watermarking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Editing Of Facsimile Originals (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses an H.265/HEVC video self-adaptive steganography method based on improved RDO, wherein secret information embedding comprises three parts of extracting carriers, calculating distortion cost and STC self-adaptive embedding, and according to the block size and the characteristics of PU dividing modes, proper PU dividing modes are extracted from all encoding units with the size smaller than 64 multiplied by 64 in P frames in a classified manner to serve as carriers, the distortion cost of the carriers in the simulated embedding is calculated, and according to the distortion cost, the data hiding mode with the minimum total distortion cost is realized by using STC algorithm to realize self-adaptive steganography information embedding for the carriers; because the method comprehensively considers factors such as video bit rate increase, video picture quality, inter-frame distortion transfer and the like when calculating the distortion cost value, the bit rate increase caused by steganography can be effectively reduced, and the steganographically-contained video has better picture quality, lower code rate and higher safety.

Description

基于改进RDO的H.265/HEVC视频自适应隐写方法Adaptive steganography method for H.265/HEVC video based on improved RDO

技术领域Technical Field

本发明涉及一种视频隐写技术,尤其是涉及一种基于改进RDO(Rate DistortionOptimization,率失真优化)的H.265/HEVC视频自适应隐写方法。The present invention relates to a video steganography technology, and in particular to an H.265/HEVC video adaptive steganography method based on improved RDO (Rate Distortion Optimization).

背景技术Background Art

在数字媒体技术迅速发展的今天,多媒体处理技术的普及使多媒体已成为人们获取信息的重要手段,视频数据更是呈爆炸式增长,尤其是在社交网络和娱乐行业,视频越来越成为主流媒体。人们在享受着信息化时代带来的红利的同时,也越来越重视多媒体在公开信道中传输的电子信息内容的安全问题。With the rapid development of digital media technology, the popularity of multimedia processing technology has made multimedia an important means for people to obtain information, and video data has exploded, especially in social networks and the entertainment industry, where video has become more and more mainstream media. While people are enjoying the dividends brought by the information age, they are also paying more and more attention to the security of electronic information content transmitted by multimedia in public channels.

为了解决这些安全问题,研究者们先后提出了信息隐藏和数字加密等手段。信息隐藏技术又包括数字水印和隐写,信息隐藏技术已被应用于许多领域,如所有权声明保护、隐私保护和隐蔽通信等。视频隐写与视频编码标准密切相关,高效视频编码(HEVC)是由ITUTVCEG和ISO/IEC MPEG发布的视频编码标准。HEVC能在H.264/AVC的基础上,将压缩效率提高一倍,即在保证相同视频图像质量的前提下视频流的码率减少50%。HEVC视频隐写技术可以自然地隐藏用户行为导致的通信,保证用户行为的合理性,降低暴露隐藏通信的风险。然而,现有的基于PU(Prediction Unit,预测单元)的HEVC视频隐写技术大多存在比特率严重增长,为了视频质量牺牲比特率以及隐写算法安全性较低等问题,如Zhang等人使用改进EMD(Exploiting Modification Direction)算法来提高嵌入效率,但导致了比特率增长较严重;同时,对PU划分模式的修改没有限制,隐写时每种PU划分模式都可以修改为其他任意一种PU划分模式,这种随意修改也将导致安全性能的下降。因此,开发一种低比特率增长的高安全性的HEVC视频隐写方法具有重要的现实意义。In order to solve these security problems, researchers have proposed information hiding and digital encryption. Information hiding technology includes digital watermarking and steganography. Information hiding technology has been applied to many fields, such as ownership claim protection, privacy protection and covert communication. Video steganography is closely related to video coding standards. High Efficiency Video Coding (HEVC) is a video coding standard released by ITU-TVCEG and ISO/IEC MPEG. HEVC can double the compression efficiency on the basis of H.264/AVC, that is, the bit rate of the video stream is reduced by 50% while ensuring the same video image quality. HEVC video steganography technology can naturally hide the communication caused by user behavior, ensure the rationality of user behavior, and reduce the risk of exposing hidden communications. However, most of the existing HEVC video steganography technologies based on PU (Prediction Unit) have problems such as serious bit rate increase, sacrificing bit rate for video quality, and low security of steganography algorithms. For example, Zhang et al. used the improved EMD (Exploiting Modification Direction) algorithm to improve the embedding efficiency, but it led to a serious increase in bit rate. At the same time, there is no restriction on the modification of PU partition mode. During steganography, each PU partition mode can be modified to any other PU partition mode. This arbitrary modification will also lead to a decrease in security performance. Therefore, it is of great practical significance to develop a high-security HEVC video steganography method with low bit rate increase.

发明内容Summary of the invention

本发明所要解决的技术问题是提供一种基于改进RDO的H.265/HEVC视频自适应隐写方法,其能减少隐写导致的比特率增长,同时能够提高视频视觉质量,并且具有高安全性。The technical problem to be solved by the present invention is to provide an H.265/HEVC video adaptive steganography method based on improved RDO, which can reduce the bit rate increase caused by steganography, while improving the video visual quality and having high security.

本发明解决上述技术问题所采用的技术方案为:一种基于改进RDO的H.265/HEVC视频自适应隐写方法,包括隐秘信息嵌入和隐秘信息提取两部分;其特征在于:The technical solution adopted by the present invention to solve the above technical problems is: an H.265/HEVC video adaptive steganography method based on improved RDO, including two parts: secret information embedding and secret information extraction; the characteristics are:

所述的隐秘信息嵌入的具体过程为:The specific process of embedding the secret information is as follows:

步骤1_1:采用H.265/HEVC标准编码器对原始视频进行压缩编码,在压缩编码过程中保存每帧中的每个编码树单元中的每个编码单元的预测模式和深度、每个编码单元对应的PU划分模式,在压缩编码结束后得到H.265/HEVC视频;其中,编码树单元的尺寸为64×64,编码单元的尺寸为64×64或32×32或16×16或8×8;Step 1_1: Use the H.265/HEVC standard encoder to compress and encode the original video. During the compression and encoding process, the prediction mode and depth of each coding unit in each coding tree unit in each frame and the PU partition mode corresponding to each coding unit are saved. After the compression and encoding, the H.265/HEVC video is obtained; wherein the size of the coding tree unit is 64×64, and the size of the coding unit is 64×64, 32×32, 16×16, or 8×8;

步骤1_2:按序遍历H.265/HEVC视频中的所有帧,将当前遍历的帧定义为当前帧;Step 1_2: traverse all frames in the H.265/HEVC video in order, and define the currently traversed frame as the current frame;

步骤1_3:判断当前帧是否为P帧,如果当前帧为P帧,则执行步骤1_4;如果当前帧不为P帧,则直接执行步骤1_7;Step 1_3: Determine whether the current frame is a P frame. If the current frame is a P frame, execute step 1_4; if the current frame is not a P frame, directly execute step 1_7;

步骤1_4:按序遍历当前帧中的所有尺寸的编码单元,将当前遍历的编码单元定义为当前单元;Step 1_4: traverse the coding units of all sizes in the current frame in order, and define the currently traversed coding unit as the current unit;

步骤1_5:如果当前单元的尺寸为64×64,则对当前单元不做处理,然后执行步骤1_6;如果当前单元的尺寸为32×32或16×16,则将当前单元对应的PU划分模式作为载体并归类为第一类载体,并记录当前单元在H.265/HEVC视频中的索引位置、当前单元的深度以及当前单元对应的PU划分模式,然后执行步骤1_6;如果当前单元的尺寸为8×8,则将当前单元对应的PU划分模式作为载体并归类为第二类载体,并记录当前单元在H.265/HEVC视频中的索引位置、当前单元的深度以及当前单元对应的PU划分模式,然后执行步骤1_6;Step 1_5: If the size of the current unit is 64×64, the current unit is not processed, and then step 1_6 is executed; if the size of the current unit is 32×32 or 16×16, the PU partition mode corresponding to the current unit is used as a carrier and classified as a first type of carrier, and the index position of the current unit in the H.265/HEVC video, the depth of the current unit, and the PU partition mode corresponding to the current unit are recorded, and then step 1_6 is executed; if the size of the current unit is 8×8, the PU partition mode corresponding to the current unit is used as a carrier and classified as a second type of carrier, and the index position of the current unit in the H.265/HEVC video, the depth of the current unit, and the PU partition mode corresponding to the current unit are recorded, and then step 1_6 is executed;

步骤1_6:遍历当前帧中的下一个编码单元,作为当前单元,然后返回步骤1_5继续执行,直至当前帧中的所有编码单元全部遍历完毕,然后执行步骤1_7;Step 1_6: traverse the next coding unit in the current frame as the current unit, then return to step 1_5 to continue executing until all coding units in the current frame are traversed, and then execute step 1_7;

步骤1_7:遍历H.265/HEVC视频中的下一帧,作为当前帧,然后返回步骤1_3继续执行,直至H.265/HEVC视频中的所有帧全部遍历完毕后执行步骤1_8;Step 1_7: traverse the next frame in the H.265/HEVC video as the current frame, then return to step 1_3 to continue executing, and execute step 1_8 after all frames in the H.265/HEVC video have been traversed;

步骤1_8:将归类为第一类载体与归类为第二类载体的所有载体即PU划分模式分别进行映射,具体过程为:Step 1_8: Map all carriers classified as the first type of carriers and all carriers classified as the second type of carriers, that is, PU partitioning modes, respectively. The specific process is as follows:

第一类载体共有八种PU划分模式,分别为2N×2N、N×N、2N×N、2N×nU、2N×nD、N×2N、nL×2N、nR×2N划分模式,2N×N、2N×nU、2N×nD划分模式均为水平划分模式,N×2N、nL×2N、nR×2N划分模式均为垂直划分模式;对于归类为第一类载体的任一个载体,若该载体为2N×2N划分模式或N×N划分模式,则对该载体不进行映射;若该载体为2N×N划分模式,则将该载体映射为整数0;若该载体为2N×nU划分模式,则将该载体映射为整数1;若该载体为2N×nD划分模式,则将该载体映射为整数2;若该载体为N×2N划分模式,则将该载体映射为整数3;若该载体为nL×2N划分模式,则将该载体映射为整数4;若该载体为nR×2N划分模式,则将该载体映射为整数5;然后将归类为第一类载体的所有载体映射后得到的所有整数,按载体即PU划分模式对应的编码单元在H.265/HEVC视频中的索引位置的先后顺序排列,构成第一类载体序列;再执行步骤1_9;There are eight PU partition modes for the first type of carriers, namely 2N×2N, N×N, 2N×N, 2N×nU, 2N×nD, N×2N, nL×2N, and nR×2N partition modes. The 2N×N, 2N×nU, and 2N×nD partition modes are all horizontal partition modes, and the N×2N, nL×2N, and nR×2N partition modes are all vertical partition modes. For any carrier classified as the first type of carrier, if the carrier is in the 2N×2N partition mode or the N×N partition mode, the carrier is not mapped; if the carrier is in the 2N×N partition mode, the carrier is mapped to the integer 0; if the carrier is in the 2N×nU partition mode, the carrier is mapped to the integer 0; If the carrier is a 2N×nD partition mode, the carrier is mapped to an integer 1; if the carrier is a 2N×nD partition mode, the carrier is mapped to an integer 2; if the carrier is an N×2N partition mode, the carrier is mapped to an integer 3; if the carrier is an nL×2N partition mode, the carrier is mapped to an integer 4; if the carrier is an nR×2N partition mode, the carrier is mapped to an integer 5; then all integers obtained after mapping all carriers classified as the first type of carriers are arranged in the order of the index positions of the coding units corresponding to the carrier, i.e., the PU partition mode, in the H.265/HEVC video to form a first type of carrier sequence; then execute step 1_9;

第二类载体共有四种PU划分模式,分别为2N×2N、2N×N、N×2N、N×N划分模式;对于归类为第二类载体的任一个载体,若该载体为2N×2N划分模式,则对该载体不进行映射;若该载体为2N×N划分模式,则将该载体映射为整数0;若该载体为N×2N划分模式,则将该载体映射为整数1;若该载体为N×N划分模式,则将该载体映射为整数2;然后将归类为第二类载体的所有载体映射后得到的所有整数,按载体即PU划分模式对应的编码单元在H.265/HEVC视频中的索引位置的先后顺序排列,构成第二类载体序列;再执行步骤1_9;There are four PU partition modes for the second type of carrier, namely 2N×2N, 2N×N, N×2N, and N×N partition modes; for any carrier classified as the second type of carrier, if the carrier is in the 2N×2N partition mode, the carrier is not mapped; if the carrier is in the 2N×N partition mode, the carrier is mapped to an integer 0; if the carrier is in the N×2N partition mode, the carrier is mapped to an integer 1; if the carrier is in the N×N partition mode, the carrier is mapped to an integer 2; then all integers obtained after mapping all carriers classified as the second type of carrier are arranged in the order of the index positions of the coding units corresponding to the carrier, i.e., the PU partition mode, in the H.265/HEVC video to form a second type of carrier sequence; then execute step 1_9;

步骤1_9:计算第一类载体序列中的每个整数对应的载体修改为同类载体序列中的其它整数对应的载体即PU划分模式的代价值,对于第一类载体序列中的任一个整数对应的载体,将其作为当前载体,设定当前载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式的代价值记为ρt m,n,kStep 1_9: Calculate the cost of modifying the carrier corresponding to each integer in the first type of carrier sequence to the carrier corresponding to other integers in the same type of carrier sequence, that is, the PU partition mode. For any carrier corresponding to an integer in the first type of carrier sequence, use it as the current carrier, set the current carrier to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and modify the current carrier to the carrier corresponding to any other integer t in the same type of carrier sequence, that is, the PU partition mode. The cost value is recorded as ρ t m,n,k ,

Figure BDA0004010952290000031
Figure BDA0004010952290000031

计算第二类载体序列中的每个整数对应的载体修改为同类载体序列中的其它整数对应的载体即PU划分模式的代价值,对于第二类载体序列中的任一个整数对应的载体,将其作为当前载体,设定当前载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式的代价值记为

Figure BDA0004010952290000041
Calculate the cost of changing the carrier corresponding to each integer in the second type of carrier sequence to the carrier corresponding to other integers in the same type of carrier sequence, that is, the PU partition mode. For any carrier corresponding to an integer in the second type of carrier sequence, use it as the current carrier, set the current carrier to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and change the current carrier to the carrier corresponding to any other integer s in the same type of carrier sequence, that is, the PU partition mode. The cost value is recorded as
Figure BDA0004010952290000041

Figure BDA0004010952290000042
Figure BDA0004010952290000042

其中,1≤m≤M,M表示H.265/HEVC视频中包含的帧的总帧数,1≤n≤N,N表示H.265/HEVC视频中的第m帧中包含的编码树单元的总个数,1≤n≤N,1≤k≤K,K表示H.265/HEVC视频中的第m帧中的第n个编码树单元中包含的编码单元的总个数,若当前载体属于第一类载体,则当前载体对应的整数为0时t为1、2、3、4或5,当前载体对应的整数为1时t为0、2、3、4或5,当前载体对应的整数为2时t为0、1、3、4或5,当前载体对应的整数为3时t为0、1、2、4或5,当前载体对应的整数为4时t为0、1、2、3或5,当前载体对应的整数为5时t为0、1、2、3或4,exp()表示以自然基数e为底的指数函数,α表示帧间失真传递率,0<α<1,GOPSize表示H.265/HEVC视频中一个图像组GOP内的总帧数,Poc表示当前载体对应的编码单元所在的帧在该帧所在的图像组GOP内的位置,即当前载体对应的编码单元所在的帧为该帧所在的图像组GOP内的第Poc帧,1≤Poc≤GOPSize,

Figure BDA0004010952290000043
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的失真,
Figure BDA0004010952290000044
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的比特数,
Figure BDA0004010952290000045
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的拉格朗日因子,
Figure BDA0004010952290000046
表示失真控制因子,
Figure BDA0004010952290000047
表示比特率控制因子,
Figure BDA0004010952290000048
若当前载体属于第二类载体,则当前载体对应的整数为0时s为1或2,当前载体对应的整数为1时s为0或2,当前载体对应的整数为2时s为0或1,
Figure BDA0004010952290000049
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的失真,
Figure BDA00040109522900000410
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的比特数,
Figure BDA00040109522900000411
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的拉格朗日因子;Wherein, 1≤m≤M, M represents the total number of frames contained in the H.265/HEVC video, 1≤n≤N, N represents the total number of coding tree units contained in the m-th frame in the H.265/HEVC video, 1≤n≤N, 1≤k≤K, K represents the total number of coding units contained in the n-th coding tree unit in the m-th frame in the H.265/HEVC video, if the current carrier belongs to the first type of carrier, then when the integer corresponding to the current carrier is 0, t is 1, 2, 3, 4 or 5, when the integer corresponding to the current carrier is 1, t is 0, 2, 3, 4 or 5, when the integer corresponding to the current carrier is 2, t is 0, 1, 3, 4 or 5, and the integer corresponding to the current carrier is When the integer corresponding to the current carrier is 3, t is 0, 1, 2, 4 or 5. When the integer corresponding to the current carrier is 4, t is 0, 1, 2, 3 or 5. When the integer corresponding to the current carrier is 5, t is 0, 1, 2, 3 or 4. exp() represents an exponential function with the natural base e as the base. α represents the inter-frame distortion transmission rate, 0<α<1. GOPSize represents the total number of frames in a picture group GOP in H.265/HEVC video. Poc represents the position of the frame where the coding unit corresponding to the current carrier is located in the picture group GOP where the frame is located. That is, the frame where the coding unit corresponding to the current carrier is located is the Poc-th frame in the picture group GOP where the frame is located. 1≤Poc≤GOPSize.
Figure BDA0004010952290000043
It indicates the distortion after changing the current carrier to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000044
Indicates the number of bits after the current carrier is modified to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000045
It indicates the Lagrangian factor after the current carrier is modified to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000046
represents the distortion control factor,
Figure BDA0004010952290000047
represents the bit rate control factor,
Figure BDA0004010952290000048
If the current carrier belongs to the second type of carrier, then when the integer corresponding to the current carrier is 0, s is 1 or 2; when the integer corresponding to the current carrier is 1, s is 0 or 2; when the integer corresponding to the current carrier is 2, s is 0 or 1.
Figure BDA0004010952290000049
It indicates the distortion after changing the current carrier to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure BDA00040109522900000410
Indicates the number of bits after the current carrier is modified to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure BDA00040109522900000411
Indicates the Lagrangian factor after the current carrier is modified to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode;

步骤1_10:计算第一类载体序列中的每个整数加1或保持不变或减1时的失真代价值,对于第一类载体序列中的任一个整数,将其作为当前整数,设定当前整数对应的载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前整数加1时的失真代价值记为

Figure BDA0004010952290000051
将当前整数保持不变时的失真代价值记为
Figure BDA0004010952290000052
将当前整数减1时的失真代价值记为
Figure BDA0004010952290000053
若当前整数zm,n,k为0,则
Figure BDA0004010952290000054
Figure BDA0004010952290000055
为无穷大;若当前整数zm,n,k为1,则
Figure BDA0004010952290000056
Figure BDA0004010952290000057
若当前整数zm,n,k为2,则
Figure BDA0004010952290000058
为无穷大、
Figure BDA0004010952290000059
Figure BDA00040109522900000510
若当前整数zm,n,k为3,则
Figure BDA00040109522900000511
Figure BDA00040109522900000512
为无穷大;若当前整数zm,n,k为4,则
Figure BDA00040109522900000513
若当前整数zm,n,k为5,则
Figure BDA00040109522900000514
为无穷大、
Figure BDA00040109522900000515
Step 1_10: Calculate the distortion cost value when each integer in the first type of carrier sequence is increased by 1, remains unchanged, or decreased by 1. For any integer in the first type of carrier sequence, take it as the current integer, set the carrier corresponding to the current integer to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and record the distortion cost value when the current integer is increased by 1 as
Figure BDA0004010952290000051
The distortion cost when the current integer remains unchanged is recorded as
Figure BDA0004010952290000052
The distortion cost when the current integer is reduced by 1 is recorded as
Figure BDA0004010952290000053
If the current integer z m,n,k is 0, then
Figure BDA0004010952290000054
Figure BDA0004010952290000055
is infinite; if the current integer z m,n,k is 1, then
Figure BDA0004010952290000056
Figure BDA0004010952290000057
If the current integer z m,n,k is 2, then
Figure BDA0004010952290000058
For infinity,
Figure BDA0004010952290000059
Figure BDA00040109522900000510
If the current integer z m,n,k is 3, then
Figure BDA00040109522900000511
Figure BDA00040109522900000512
is infinite; if the current integer z m,n,k is 4, then
Figure BDA00040109522900000513
If the current integer z m,n,k is 5, then
Figure BDA00040109522900000514
For infinity,
Figure BDA00040109522900000515

计算第二类载体序列中的每个整数加1或保持不变或减1时的失真代价值,对于第二类载体序列中的任一个整数,将其作为当前整数,设定当前整数对应的载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前整数加1时的失真代价值记为

Figure BDA00040109522900000516
将当前整数保持不变时的失真代价值记为
Figure BDA00040109522900000517
将当前整数减1时的失真代价值记为
Figure BDA00040109522900000518
若当前整数
Figure BDA00040109522900000519
为0,则
Figure BDA00040109522900000520
Figure BDA00040109522900000521
为无穷大;若当前整数
Figure BDA00040109522900000522
为1,则
Figure BDA00040109522900000523
Figure BDA00040109522900000524
若当前整数
Figure BDA00040109522900000525
为2,则
Figure BDA00040109522900000526
为无穷大、
Figure BDA00040109522900000527
Figure BDA00040109522900000528
Calculate the distortion cost value when each integer in the second type of carrier sequence is increased by 1, remains unchanged, or decreased by 1. For any integer in the second type of carrier sequence, take it as the current integer, set the carrier corresponding to the current integer to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and record the distortion cost value when the current integer is increased by 1 as
Figure BDA00040109522900000516
The distortion cost when the current integer remains unchanged is recorded as
Figure BDA00040109522900000517
The distortion cost when the current integer is reduced by 1 is recorded as
Figure BDA00040109522900000518
If the current integer
Figure BDA00040109522900000519
If is 0,
Figure BDA00040109522900000520
Figure BDA00040109522900000521
is infinite; if the current integer
Figure BDA00040109522900000522
is 1, then
Figure BDA00040109522900000523
Figure BDA00040109522900000524
If the current integer
Figure BDA00040109522900000525
is 2, then
Figure BDA00040109522900000526
For infinity,
Figure BDA00040109522900000527
Figure BDA00040109522900000528

步骤1_11:利用同一个嵌入负载率payload随机生成两个不同的二进制隐秘信息序列,对应记为X1和X2;然后根据第一类载体序列中的每个整数加1或保持不变或减1时的失真代价值,利用STC工具包将X1嵌入到第一类载体序列中的所有整数中,得到第一类含密载体序列;同样,根据第二类载体序列中的每个整数加1或保持不变或减1时的失真代价值,利用STC工具包将X2嵌入到第二类载体序列中的所有整数中,得到第二类含密载体序列;其中,payload∈(0,0.5],X1的长度为Num1×payload,X2的长度为Num2×payload,Num1表示第一类载体中的载体的总个数,Num2表示第二类载体中的载体的总个数;Step 1_11: Use the same embedding load rate payload to randomly generate two different binary secret information sequences, which are denoted as X1 and X2 respectively; then, according to the distortion cost value when each integer in the first type of carrier sequence is increased by 1, remains unchanged, or decreased by 1, use the STC toolkit to embed X1 into all integers in the first type of carrier sequence to obtain the first type of secret carrier sequence; similarly, according to the distortion cost value when each integer in the second type of carrier sequence is increased by 1, remains unchanged, or decreased by 1, use the STC toolkit to embed X2 into all integers in the second type of carrier sequence to obtain the second type of secret carrier sequence; where payload∈(0,0.5], the length of X1 is Num1 ×payload, the length of X2 is Num2 ×payload, Num1 represents the total number of carriers in the first type of carrier, and Num2 represents the total number of carriers in the second type of carrier;

步骤1_12:将第一类含密载体序列与第二类含密载体序列中的所有整数分别转化为PU划分模式,具体过程为:Step 1_12: Convert all integers in the first type of secret carrier sequence and the second type of secret carrier sequence into PU partition patterns respectively. The specific process is as follows:

第一类含密载体序列共有六种整数,分别为0、1、2、3、4、5,将整数0转化为2N×N划分模式,将整数1转化为2N×nU划分模式,将整数2转化为2N×nD划分模式,将整数3转化为N×2N划分模式,将整数4转化为nL×2N划分模式,将整数5转化为nR×2N划分模式;然后将第一类含密载体序列中的所有整数转化后得到的所有PU划分模式,按序替换第一类载体中相同位置的载体,构成第一类含密载体;The first type of secret carrier sequence has six integers, namely 0, 1, 2, 3, 4, and 5. The integer 0 is converted into a 2N×N partitioning mode, the integer 1 is converted into a 2N×nU partitioning mode, the integer 2 is converted into a 2N×nD partitioning mode, the integer 3 is converted into an N×2N partitioning mode, the integer 4 is converted into an nL×2N partitioning mode, and the integer 5 is converted into an nR×2N partitioning mode. Then, all the PU partitioning modes obtained after converting all the integers in the first type of secret carrier sequence are used to replace the carriers in the same position in the first type of carriers in order to form the first type of secret carriers.

第二类含密载体序列共有三种整数,分别为0、1、2、3,将整数0转化为2N×N划分模式,将整数1转化为N×2N划分模式,将整数2转化为N×N划分模式;然后将第二类含密载体序列中的所有整数转化后得到的所有PU划分模式,按序替换第二类载体中相同位置的载体,构成第二类含密载体;The second type of secret carrier sequence has three integers, namely 0, 1, 2, and 3. The integer 0 is converted into a 2N×N partition mode, the integer 1 is converted into an N×2N partition mode, and the integer 2 is converted into an N×N partition mode. Then, all the PU partition modes obtained after converting all the integers in the second type of secret carrier sequence are used to replace the carriers at the same position in the second type of carriers in order to form the second type of secret carriers.

步骤1_13:采用H.265/HEVC标准编码器对原始视频进行压缩编码,在压缩编码的预测过程中用隐写后的第一类含密载体与第二类含密载体替换相应位置的原始的PU划分模式,经过压缩编码得到含密视频码流;Step 1_13: Use the H.265/HEVC standard encoder to compress and encode the original video. In the prediction process of compression encoding, the original PU partitioning pattern at the corresponding position is replaced with the first type of secret carrier and the second type of secret carrier after steganography, and the secret video code stream is obtained through compression encoding;

所述的隐秘信息提取的具体过程为:The specific process of extracting secret information is as follows:

步骤2_1:采用H.265/HEVC标准解码器对含密视频码流进行解码,在解码过程中保存每帧中的每个编码树单元中的每个编码单元的预测模式和深度、每个编码单元对应的PU划分模式,在解码结束后得到解码视频;Step 2_1: Use the H.265/HEVC standard decoder to decode the encrypted video stream. During the decoding process, save the prediction mode and depth of each coding unit in each coding tree unit in each frame, and the PU partition mode corresponding to each coding unit, and obtain the decoded video after decoding;

步骤2_2:按照步骤1_2至步骤1_8获取第一类载体序列和第二类载体序列的过程,以相同的方式获取解码视频对应的含密的第一类载体序列和含密的第二类载体序列;Step 2_2: Obtain the encrypted first-type carrier sequence and the encrypted second-type carrier sequence corresponding to the decoded video in the same manner as the process of obtaining the first-type carrier sequence and the second-type carrier sequence in step 1_2 to step 1_8;

步骤2_3:利用STC工具包对步骤2_2得到的含密的第一类载体序列进行解码,提取得到第一隐秘信息,记为

Figure BDA0004010952290000061
同样,利用STC工具包对步骤2_2得到的含密的第二类载体序列进行解码,提取得到第二隐秘信息,记为
Figure BDA0004010952290000062
Step 2_3: Use the STC toolkit to decode the first type of carrier sequence obtained in step 2_2, and extract the first secret information, which is recorded as
Figure BDA0004010952290000061
Similarly, the STC toolkit is used to decode the secret second type carrier sequence obtained in step 2_2, and the second secret information is extracted, which is recorded as
Figure BDA0004010952290000062

所述的步骤1_9中,α取值为0.5,

Figure BDA0004010952290000063
取值为0.3,
Figure BDA0004010952290000064
取值为0.7。In the steps 1-9, the value of α is 0.5.
Figure BDA0004010952290000063
The value is 0.3.
Figure BDA0004010952290000064
The value is 0.7.

所述的步骤1_9中,

Figure BDA0004010952290000065
Figure BDA0004010952290000066
的值取决于是否采用Merge帧间预测模式,当采用Merge帧间预测模式时,
Figure BDA0004010952290000071
Figure BDA0004010952290000072
的值为SATD值;当采用非Merge帧间预测模式时,
Figure BDA0004010952290000073
Figure BDA0004010952290000074
的值为编码失真。In the steps 1-9,
Figure BDA0004010952290000065
and
Figure BDA0004010952290000066
The value of depends on whether the Merge inter-frame prediction mode is used. When the Merge inter-frame prediction mode is used,
Figure BDA0004010952290000071
and
Figure BDA0004010952290000072
The value is the SATD value; when the non-Merge inter-frame prediction mode is used,
Figure BDA0004010952290000073
and
Figure BDA0004010952290000074
The value of is the coding distortion.

所述的步骤1_9中,

Figure BDA0004010952290000075
Figure BDA0004010952290000076
的值取决于是否采用Merge帧间预测模式,当采用Merge帧间预测模式时,
Figure BDA0004010952290000077
Figure BDA0004010952290000078
的值为Merge索引的编码比特数;当采用非Merge帧间预测模式时,
Figure BDA0004010952290000079
Figure BDA00040109522900000710
的值为表示预测模式和残差变换系数的编码比特数。In the steps 1-9,
Figure BDA0004010952290000075
and
Figure BDA0004010952290000076
The value of depends on whether the Merge inter-frame prediction mode is used. When the Merge inter-frame prediction mode is used,
Figure BDA0004010952290000077
and
Figure BDA0004010952290000078
The value is the number of coded bits of the Merge index; when the non-Merge inter-frame prediction mode is used,
Figure BDA0004010952290000079
and
Figure BDA00040109522900000710
The value represents the number of coding bits for the prediction mode and the residual transform coefficient.

所述的步骤1_9中,

Figure BDA00040109522900000711
Figure BDA00040109522900000712
的值通过μ·ω·2(QP-12)/3.0计算得到,其中,μ的取值依赖于当前载体对应的编码单元所在的帧是否为该帧所在的图像组GOP内的参考帧,若该帧为其所在的图像组GOP内的参考帧,则μ=1.0-Clip3(0.0,0.5,0.05NB),若该帧为其所在的图像组GOP内的非参考帧,则μ=1.0,NB表示H.265/HEVC视频中一个图像组GOP内的B帧的总帧数,Clip3()为Clip操作函数,ω表示加权因子,ω的值由编码配置和当前载体对应的编码单元所在的帧在该帧所在的图像组GOP内的位置Poc决定,QP表示当前载体对应的编码单元所在的帧的编码量化参数。In the steps 1-9,
Figure BDA00040109522900000711
and
Figure BDA00040109522900000712
The value of is calculated by μ·ω·2 (QP-12)/3.0 , where the value of μ depends on whether the frame where the coding unit corresponding to the current carrier is located is a reference frame in the picture group GOP where the frame is located. If the frame is a reference frame in the picture group GOP where the frame is located, then μ=1.0-Clip3( 0.0,0.5,0.05NB ); if the frame is a non-reference frame in the picture group GOP where the frame is located, then μ=1.0, NB represents the total number of B frames in a picture group GOP in the H.265/HEVC video, Clip3() is the Clip operation function, ω represents the weighting factor, and the value of ω is determined by the encoding configuration and the position Poc of the frame where the coding unit corresponding to the current carrier is located in the picture group GOP where the frame is located, and QP represents the encoding quantization parameter of the frame where the coding unit corresponding to the current carrier is located.

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

1)本发明方法通过对帧间失真影响和比特率增长等因素的分析,设计了多因素结合的自适应失真代价值计算函数(参见步骤1_9中的代价值计算公式),并使用STC算法对PU划分模式进行自适应数据隐藏(参见步骤1_11),能够有效地提高隐写后的视频画面质量与算法的安全性。1) The method of the present invention designs an adaptive distortion cost calculation function combining multiple factors (see the cost calculation formula in step 1_9) by analyzing the influence of inter-frame distortion and bit rate growth, and uses the STC algorithm to adaptively hide data in the PU partition mode (see step 1_11), which can effectively improve the video picture quality after steganography and the security of the algorithm.

2)本发明方法通过考虑HEVC编码中PU划分模式的决策过程,参考率失真优化(RDO)对PU划分模式的影响,在嵌入过程中引入率失真代价(RD cost)并调整失真与比特率的权重,来抑制隐写导致的比特率严重增长,从而降低视频码率增长。2) The method of the present invention considers the decision process of the PU partition mode in HEVC encoding, refers to the influence of rate-distortion optimization (RDO) on the PU partition mode, introduces rate-distortion cost (RD cost) in the embedding process and adjusts the weight of distortion and bit rate to suppress the serious increase of bit rate caused by steganography, thereby reducing the increase of video bit rate.

3)本发明方法中的HEVC视频隐写和提取过程都是在预测单元中完成,因此用标准HEVC视频解码器对数据隐藏后的视频码流进行解码,在得到高清含密视频的同时也可以保证隐秘信息有效地提取,具有更广泛的应用前景,可以轻松应用于现实生活中的实时通信当中。3) The HEVC video steganography and extraction processes in the method of the present invention are all completed in the prediction unit. Therefore, the video code stream after data hiding is decoded using a standard HEVC video decoder. While obtaining high-definition secret video, the secret information can also be effectively extracted. This method has a wider application prospect and can be easily applied to real-time communications in real life.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明方法的总体实现框图;FIG1 is a block diagram of the overall implementation of the method of the present invention;

图2为使用Zhang方法对原始视频进行数据隐写后得到的含密视频及使用本发明方法对原始视频进行数据隐藏后得到的含密视频在BRI上的结果。FIG. 2 shows the encrypted video obtained by steganographically writing data on the original video using the Zhang method and the encrypted video obtained by hiding data on the original video using the method of the present invention on BRI.

具体实施方式DETAILED DESCRIPTION

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

本发明提出的一种基于改进RDO的H.265/HEVC视频自适应隐写方法,其总体实现框图如图1所示,其包括隐秘信息嵌入和隐秘信息提取两部分。The present invention proposes an H.265/HEVC video adaptive steganography method based on improved RDO, and its overall implementation block diagram is shown in Figure 1, which includes two parts: secret information embedding and secret information extraction.

所述的隐秘信息嵌入的具体过程为:The specific process of embedding the secret information is as follows:

步骤1_1:采用H.265/HEVC标准编码器对原始视频进行压缩编码,在压缩编码过程中保存每帧中的每个编码树单元(CTU,Coding Tree Unit)中的每个编码单元(CU,CodingUnit)的预测模式和深度、每个编码单元对应的PU(Prediction Unit,预测单元)划分模式,在压缩编码结束后得到H.265/HEVC视频;其中,编码树单元的尺寸为64×64,编码单元的尺寸为64×64或32×32或16×16或8×8。Step 1_1: Use the H.265/HEVC standard encoder to compress and encode the original video. During the compression encoding process, the prediction mode and depth of each coding unit (CU) in each coding tree unit (CTU) in each frame, and the PU (Prediction Unit) division mode corresponding to each coding unit are saved, and the H.265/HEVC video is obtained after the compression encoding is completed; wherein the size of the coding tree unit is 64×64, and the size of the coding unit is 64×64 or 32×32 or 16×16 or 8×8.

步骤1_2:按序遍历H.265/HEVC视频中的所有帧,将当前遍历的帧定义为当前帧。Step 1_2: Traverse all frames in the H.265/HEVC video in order, and define the currently traversed frame as the current frame.

步骤1_3:判断当前帧是否为P帧,如果当前帧为P帧,则执行步骤1_4;如果当前帧不为P帧,则直接执行步骤1_7。Step 1_3: Determine whether the current frame is a P frame. If the current frame is a P frame, execute step 1_4; if the current frame is not a P frame, directly execute step 1_7.

步骤1_4:按序遍历当前帧中的所有尺寸的编码单元,将当前遍历的编码单元定义为当前单元。Step 1_4: traverse coding units of all sizes in the current frame in order, and define the currently traversed coding unit as the current unit.

步骤1_5:如果当前单元的尺寸为64×64,则对当前单元不做处理,然后执行步骤1_6;如果当前单元的尺寸为32×32或16×16,则将当前单元对应的PU划分模式作为载体并归类为第一类载体,并记录当前单元在H.265/HEVC视频中的索引位置、当前单元的深度以及当前单元对应的PU划分模式,然后执行步骤1_6;如果当前单元的尺寸为8×8,则将当前单元对应的PU划分模式作为载体并归类为第二类载体,并记录当前单元在H.265/HEVC视频中的索引位置、当前单元的深度以及当前单元对应的PU划分模式,然后执行步骤1_6。Step 1_5: If the size of the current unit is 64×64, the current unit is not processed, and then step 1_6 is executed; if the size of the current unit is 32×32 or 16×16, the PU partition mode corresponding to the current unit is used as a carrier and classified as a first-class carrier, and the index position of the current unit in the H.265/HEVC video, the depth of the current unit, and the PU partition mode corresponding to the current unit are recorded, and then step 1_6 is executed; if the size of the current unit is 8×8, the PU partition mode corresponding to the current unit is used as a carrier and classified as a second-class carrier, and the index position of the current unit in the H.265/HEVC video, the depth of the current unit, and the PU partition mode corresponding to the current unit are recorded, and then step 1_6 is executed.

步骤1_6:遍历当前帧中的下一个编码单元,作为当前单元,然后返回步骤1_5继续执行,直至当前帧中的所有编码单元全部遍历完毕,然后执行步骤1_7。Step 1_6: traverse the next coding unit in the current frame as the current unit, then return to step 1_5 to continue executing until all coding units in the current frame are traversed, and then execute step 1_7.

步骤1_7:遍历H.265/HEVC视频中的下一帧,作为当前帧,然后返回步骤1_3继续执行,直至H.265/HEVC视频中的所有帧全部遍历完毕后执行步骤1_8。Step 1_7: Traverse the next frame in the H.265/HEVC video as the current frame, then return to step 1_3 to continue executing, and execute step 1_8 after all frames in the H.265/HEVC video have been traversed.

步骤1_8:将归类为第一类载体与归类为第二类载体的所有载体即PU划分模式分别进行映射,具体过程为:Step 1_8: Map all carriers classified as the first type of carriers and all carriers classified as the second type of carriers, that is, PU partitioning modes, respectively. The specific process is as follows:

第一类载体共有八种PU划分模式,分别为2N×2N、N×N、2N×N、2N×nU、2N×nD、N×2N、nL×2N、nR×2N划分模式,2N×N、2N×nU、2N×nD划分模式均为水平划分模式,N×2N、nL×2N、nR×2N划分模式均为垂直划分模式;对于归类为第一类载体的任一个载体,若该载体为2N×2N划分模式或N×N划分模式,则对该载体不进行映射;若该载体为2N×N划分模式,则将该载体映射为整数0;若该载体为2N×nU划分模式,则将该载体映射为整数1;若该载体为2N×nD划分模式,则将该载体映射为整数2;若该载体为N×2N划分模式,则将该载体映射为整数3;若该载体为nL×2N划分模式,则将该载体映射为整数4;若该载体为nR×2N划分模式,则将该载体映射为整数5;然后将归类为第一类载体的所有载体映射后得到的所有整数,按载体即PU划分模式对应的编码单元在H.265/HEVC视频中的索引位置的先后顺序排列,构成第一类载体序列;再执行步骤1_9。There are eight PU partition modes for the first type of carriers, namely 2N×2N, N×N, 2N×N, 2N×nU, 2N×nD, N×2N, nL×2N, and nR×2N partition modes. The 2N×N, 2N×nU, and 2N×nD partition modes are all horizontal partition modes, and the N×2N, nL×2N, and nR×2N partition modes are all vertical partition modes. For any carrier classified as the first type of carrier, if the carrier is in the 2N×2N partition mode or the N×N partition mode, the carrier is not mapped; if the carrier is in the 2N×N partition mode, the carrier is mapped to the integer 0; if the carrier is in the 2N×nU partition mode, the carrier is mapped to the integer 0; If the carrier is a PU partition mode, the carrier is mapped to an integer 1; if the carrier is a 2N×nD partition mode, the carrier is mapped to an integer 2; if the carrier is an N×2N partition mode, the carrier is mapped to an integer 3; if the carrier is an nL×2N partition mode, the carrier is mapped to an integer 4; if the carrier is an nR×2N partition mode, the carrier is mapped to an integer 5; then all integers obtained after mapping all carriers classified as the first type of carriers are arranged in the order of index positions of the coding units corresponding to the carrier, i.e., the PU partition mode, in the H.265/HEVC video to form a first type of carrier sequence; then execute step 1_9.

第二类载体共有四种PU划分模式,分别为2N×2N、2N×N、N×2N、N×N划分模式;对于归类为第二类载体的任一个载体,若该载体为2N×2N划分模式,则对该载体不进行映射;若该载体为2N×N划分模式,则将该载体映射为整数0;若该载体为N×2N划分模式,则将该载体映射为整数1;若该载体为N×N划分模式,则将该载体映射为整数2;然后将归类为第二类载体的所有载体映射后得到的所有整数,按载体即PU划分模式对应的编码单元在H.265/HEVC视频中的索引位置的先后顺序排列,构成第二类载体序列;再执行步骤1_9。There are four PU partition modes for the second type of carriers, namely 2N×2N, 2N×N, N×2N, and N×N partition modes; for any carrier classified as the second type of carrier, if the carrier is in the 2N×2N partition mode, the carrier is not mapped; if the carrier is in the 2N×N partition mode, the carrier is mapped to the integer 0; if the carrier is in the N×2N partition mode, the carrier is mapped to the integer 1; if the carrier is in the N×N partition mode, the carrier is mapped to the integer 2; then all integers obtained after mapping all carriers classified as the second type of carriers are arranged in the order of the index positions of the coding units corresponding to the carrier, i.e., the PU partition mode, in the H.265/HEVC video to form a second type of carrier sequence; then execute steps 1_9.

步骤1_9:在HEVC编码中,PU划分模式是通过RDO技术决策的,为了能准确衡量修改PU划分模式造成的比特率增长与画面质量下降,本发明采用改进RDO的RD代价(RD cost)作为失真代价的一部分,即分别对失真与比特数赋予权重控制因子,使其在嵌入过程中青睐于嵌入比特率影响较小、视觉失真合理的载体。计算第一类载体序列中的每个整数对应的载体修改为同类载体序列中的其它整数对应的载体即PU划分模式的代价值,对于第一类载体序列中的任一个整数对应的载体,将其作为当前载体,设定当前载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式的代价值记为

Figure BDA0004010952290000101
Figure BDA0004010952290000102
Step 1_9: In HEVC encoding, the PU partition mode is determined by RDO technology. In order to accurately measure the bit rate increase and picture quality degradation caused by modifying the PU partition mode, the present invention adopts the RD cost (RD cost) of the improved RDO as part of the distortion cost, that is, to assign weight control factors to the distortion and the number of bits respectively, so that it favors the carrier with less impact on the embedding bit rate and reasonable visual distortion during the embedding process. Calculate the cost value of the PU partition mode by modifying the carrier corresponding to each integer in the first type of carrier sequence to the carrier corresponding to other integers in the same type of carrier sequence. For the carrier corresponding to any integer in the first type of carrier sequence, take it as the current carrier, set the current carrier to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and modify the current carrier to the carrier corresponding to any other integer t in the same type of carrier sequence, that is, the cost value of the PU partition mode is recorded as
Figure BDA0004010952290000101
Figure BDA0004010952290000102

计算第二类载体序列中的每个整数对应的载体修改为同类载体序列中的其它整数对应的载体即PU划分模式的代价值,对于第二类载体序列中的任一个整数对应的载体,将其作为当前载体,设定当前载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式的代价值记为

Figure BDA0004010952290000103
Calculate the cost of changing the carrier corresponding to each integer in the second type of carrier sequence to the carrier corresponding to other integers in the same type of carrier sequence, that is, the PU partition mode. For any carrier corresponding to an integer in the second type of carrier sequence, use it as the current carrier, set the current carrier to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and change the current carrier to the carrier corresponding to any other integer s in the same type of carrier sequence, that is, the PU partition mode. The cost value is recorded as
Figure BDA0004010952290000103

Figure BDA0004010952290000104
Figure BDA0004010952290000104

其中,1≤m≤M,M表示H.265/HEVC视频中包含的帧的总帧数,1≤n≤N,N表示H.265/HEVC视频中的第m帧中包含的编码树单元的总个数,1≤n≤N,1≤k≤K,K表示H.265/HEVC视频中的第m帧中的第n个编码树单元中包含的编码单元的总个数,若当前载体属于第一类载体,则当前载体对应的整数为0时t为1、2、3、4或5,当前载体对应的整数为1时t为0、2、3、4或5,当前载体对应的整数为2时t为0、1、3、4或5,当前载体对应的整数为3时t为0、1、2、4或5,当前载体对应的整数为4时t为0、1、2、3或5,当前载体对应的整数为5时t为0、1、2、3或4,即当前载体对应有5个代价值,exp()表示以自然基数e为底的指数函数,e=2.71…,α表示帧间失真传递率,0<α<1,在本实施例中α取值为0.5,GOPSize表示H.265/HEVC视频中一个图像组GOP内的总帧数,在本实施例中GOPSize的值取4,Poc表示当前载体对应的编码单元所在的帧在该帧所在的图像组GOP内的位置,即当前载体对应的编码单元所在的帧为该帧所在的图像组GOP内的第Poc帧,1≤Poc≤GOPSize,

Figure BDA0004010952290000105
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的失真,
Figure BDA0004010952290000106
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的比特数,
Figure BDA0004010952290000111
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的拉格朗日因子,
Figure BDA0004010952290000112
表示失真控制因子,
Figure BDA0004010952290000113
表示比特率控制因子,
Figure BDA0004010952290000114
经实验测试发现
Figure BDA0004010952290000115
时视频具有较低的比特率增长且视频质量影响较低,嵌入效果较好,若当前载体属于第二类载体,则当前载体对应的整数为0时s为1或2,当前载体对应的整数为1时s为0或2,当前载体对应的整数为2时s为0或1,即当前载体对应有2个代价值,
Figure BDA0004010952290000116
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的失真,
Figure BDA0004010952290000117
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的比特数,
Figure BDA0004010952290000118
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的拉格朗日因子,
Figure BDA0004010952290000119
Figure BDA00040109522900001110
均为改进RDO的RD cost。Wherein, 1≤m≤M, M represents the total number of frames contained in the H.265/HEVC video, 1≤n≤N, N represents the total number of coding tree units contained in the m-th frame in the H.265/HEVC video, 1≤n≤N, 1≤k≤K, K represents the total number of coding units contained in the n-th coding tree unit in the m-th frame in the H.265/HEVC video, and if the current carrier belongs to the first type of carrier, when the integer corresponding to the current carrier is 0, t is 1, 2, 3, 4 or 5, when the integer corresponding to the current carrier is 1, t is 0, 2, 3, 4 or 5, when the integer corresponding to the current carrier is 2, t is 0, 1, 3, 4 or 5, when the integer corresponding to the current carrier is 3, t is 0, 1, 2, 4 or 5, and when the integer corresponding to the current carrier is 4 t is 0, 1, 2, 3 or 5. When the integer corresponding to the current carrier is 5, t is 0, 1, 2, 3 or 4, that is, the current carrier corresponds to 5 cost values. exp() represents an exponential function with the natural base e as the base, e=2.71…, α represents the inter-frame distortion transmission rate, 0<α<1, and in this embodiment, α is 0.5. GOPSize represents the total number of frames in a picture group GOP in the H.265/HEVC video. In this embodiment, the value of GOPSize is 4. Poc represents the position of the frame where the coding unit corresponding to the current carrier is located in the picture group GOP where the frame is located, that is, the frame where the coding unit corresponding to the current carrier is located is the Poc-th frame in the picture group GOP where the frame is located, 1≤Poc≤GOPSize,
Figure BDA0004010952290000105
It indicates the distortion after changing the current carrier to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000106
Indicates the number of bits after the current carrier is modified to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000111
It indicates the Lagrangian factor after the current carrier is modified to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000112
represents the distortion control factor,
Figure BDA0004010952290000113
represents the bit rate control factor,
Figure BDA0004010952290000114
Experimental tests found that
Figure BDA0004010952290000115
When the video has a lower bit rate growth and a lower impact on video quality, the embedding effect is better. If the current carrier belongs to the second type of carrier, when the integer corresponding to the current carrier is 0, s is 1 or 2, when the integer corresponding to the current carrier is 1, s is 0 or 2, and when the integer corresponding to the current carrier is 2, s is 0 or 1, that is, the current carrier corresponds to 2 cost values.
Figure BDA0004010952290000116
It indicates the distortion after changing the current carrier to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000117
Indicates the number of bits after the current carrier is modified to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000118
It indicates the Lagrangian factor after the current carrier is modified to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure BDA0004010952290000119
and
Figure BDA00040109522900001110
Both are RD costs of improved RDO.

在本实施例中,步骤1_9中,α取值为0.5,

Figure BDA00040109522900001111
取值为0.3,
Figure BDA00040109522900001112
取值为0.7。In this embodiment, in step 1_9, α is set to 0.5.
Figure BDA00040109522900001111
The value is 0.3.
Figure BDA00040109522900001112
The value is 0.7.

在本实施例中,步骤1_9中,

Figure BDA00040109522900001113
Figure BDA00040109522900001114
的值取决于是否采用Merge帧间预测模式,当采用Merge帧间预测模式时,
Figure BDA00040109522900001115
Figure BDA00040109522900001116
的值为SATD(Sum of AbsoluteTransformed Difference)值;当采用非Merge帧间预测模式(AMVP技术)时,
Figure BDA00040109522900001117
Figure BDA00040109522900001118
的值为编码失真。在采用HM编码器对HEVC视频进行压缩编码过程中,将AMP_ENC_SPEEDUP快速模式关闭,即令AMP_ENC_SPEEDUP=0即可直接获取各PU划分模式对应的失真。In this embodiment, in steps 1-9,
Figure BDA00040109522900001113
and
Figure BDA00040109522900001114
The value of depends on whether the Merge inter-frame prediction mode is used. When the Merge inter-frame prediction mode is used,
Figure BDA00040109522900001115
and
Figure BDA00040109522900001116
The value is the SATD (Sum of Absolute Transformed Difference) value; when the non-Merge inter-frame prediction mode (AMVP technology) is used,
Figure BDA00040109522900001117
and
Figure BDA00040109522900001118
The value of is the coding distortion. When the HM encoder is used to compress and encode the HEVC video, the AMP_ENC_SPEEDUP fast mode is turned off, that is, AMP_ENC_SPEEDUP=0, and the distortion corresponding to each PU division mode can be directly obtained.

在本实施例中,步骤1_9中,

Figure BDA00040109522900001119
Figure BDA00040109522900001120
的值取决于是否采用Merge帧间预测模式,当采用Merge帧间预测模式时,
Figure BDA00040109522900001121
Figure BDA00040109522900001122
的值为Merge索引的编码比特数;当采用非Merge帧间预测模式(AMVP技术)时,
Figure BDA00040109522900001123
Figure BDA00040109522900001124
的值为表示预测模式和残差变换系数的编码比特数。在采用HM编码器对HEVC视频进行压缩编码过程中,将AMP_ENC_SPEEDUP快速模式关闭,即令AMP_ENC_SPEEDUP=0即可直接获取各PU划分模式对应的比特数。In this embodiment, in steps 1-9,
Figure BDA00040109522900001119
and
Figure BDA00040109522900001120
The value of depends on whether the Merge inter-frame prediction mode is used. When the Merge inter-frame prediction mode is used,
Figure BDA00040109522900001121
and
Figure BDA00040109522900001122
The value is the number of coded bits of the Merge index; when the non-Merge inter-frame prediction mode (AMVP technology) is used,
Figure BDA00040109522900001123
and
Figure BDA00040109522900001124
The value of represents the number of coding bits for the prediction mode and the residual transform coefficient. In the process of compressing and encoding the HEVC video using the HM encoder, the AMP_ENC_SPEEDUP fast mode is turned off, that is, AMP_ENC_SPEEDUP=0, and the number of bits corresponding to each PU partition mode can be directly obtained.

在本实施例中,步骤1_9中,

Figure BDA0004010952290000121
Figure BDA0004010952290000122
的值通过μ·ω·2(QP-12)/3.0计算得到,其中,μ的取值依赖于当前载体对应的编码单元所在的帧是否为该帧所在的图像组GOP内的参考帧,若该帧为其所在的图像组GOP内的参考帧,则μ=1.0-Clip3(0.0,0.5,0.05NB),若该帧为其所在的图像组GOP内的非参考帧,则μ=1.0,NB表示H.265/HEVC视频中一个图像组GOP内的B帧的总帧数(LDP配置中P帧在HM中也算作B帧),Clip3()为Clip操作函数,ω表示加权因子,ω的值由编码配置和当前载体对应的编码单元所在的帧在该帧所在的图像组GOP内的位置Poc决定,QP表示当前载体对应的编码单元所在的帧的编码量化参数。在采用HM编码器对HEVC视频进行压缩编码过程中,将AMP_ENC_SPEEDUP快速模式关闭,即令AMP_ENC_SPEEDUP=0即可直接获取各PU划分模式对应的拉格朗日因子。In this embodiment, in steps 1-9,
Figure BDA0004010952290000121
and
Figure BDA0004010952290000122
The value of is calculated by μ·ω·2 (QP-12)/3.0 , where the value of μ depends on whether the frame where the coding unit corresponding to the current carrier is located is a reference frame in the picture group GOP where the frame is located. If the frame is a reference frame in the picture group GOP where the frame is located, then μ=1.0-Clip3( 0.0,0.5,0.05NB ); if the frame is a non-reference frame in the picture group GOP where the frame is located, then μ=1.0, NB represents the total number of B frames in a picture group GOP in H.265/HEVC video (P frames in LDP configuration are also counted as B frames in HM), Clip3() is the Clip operation function, ω represents the weighting factor, and the value of ω is determined by the encoding configuration and the position Poc of the frame where the coding unit corresponding to the current carrier is located in the picture group GOP where the frame is located, and QP represents the encoding quantization parameter of the frame where the coding unit corresponding to the current carrier is located. In the process of compressing and encoding the HEVC video using the HM encoder, the AMP_ENC_SPEEDUP fast mode is turned off, that is, AMP_ENC_SPEEDUP=0, so that the Lagrangian factors corresponding to each PU partitioning mode can be directly obtained.

步骤1_10:计算第一类载体序列中的每个整数加1或保持不变或减1时的失真代价值,对于第一类载体序列中的任一个整数,将其作为当前整数,设定当前整数对应的载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前整数加1时的失真代价值记为

Figure BDA0004010952290000123
将当前整数保持不变时的失真代价值记为
Figure BDA0004010952290000124
将当前整数减1时的失真代价值记为
Figure BDA0004010952290000125
若当前整数zm,n,k为0,则
Figure BDA0004010952290000126
Figure BDA0004010952290000127
为无穷大;若当前整数zm,n,k为1,则
Figure BDA0004010952290000128
Figure BDA0004010952290000129
若当前整数zm,n,k为2,则
Figure BDA00040109522900001210
为无穷大、
Figure BDA00040109522900001211
Figure BDA00040109522900001212
若当前整数zm,n,k为3,则
Figure BDA00040109522900001213
Figure BDA00040109522900001214
为无穷大;若当前整数zm,n,k为4,则
Figure BDA00040109522900001215
若当前整数zm,n,k为5,则
Figure BDA00040109522900001216
为无穷大、
Figure BDA00040109522900001217
为了防止PU划分模式大幅度修改导致对视频内容的不准确识别,在此规定PU划分模式的修改在同方向内进行,即水平划分模式与垂直划分模式之间不能相互修改。Step 1_10: Calculate the distortion cost value when each integer in the first type of carrier sequence is increased by 1, remains unchanged, or decreased by 1. For any integer in the first type of carrier sequence, take it as the current integer, set the carrier corresponding to the current integer to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and record the distortion cost value when the current integer is increased by 1 as
Figure BDA0004010952290000123
The distortion cost when the current integer remains unchanged is recorded as
Figure BDA0004010952290000124
The distortion cost when the current integer is reduced by 1 is recorded as
Figure BDA0004010952290000125
If the current integer z m,n,k is 0, then
Figure BDA0004010952290000126
Figure BDA0004010952290000127
is infinite; if the current integer z m,n,k is 1, then
Figure BDA0004010952290000128
Figure BDA0004010952290000129
If the current integer z m,n,k is 2, then
Figure BDA00040109522900001210
For infinity,
Figure BDA00040109522900001211
Figure BDA00040109522900001212
If the current integer z m,n,k is 3, then
Figure BDA00040109522900001213
Figure BDA00040109522900001214
is infinite; if the current integer z m,n,k is 4, then
Figure BDA00040109522900001215
If the current integer z m,n,k is 5, then
Figure BDA00040109522900001216
For infinity,
Figure BDA00040109522900001217
In order to prevent the PU partition mode from being modified significantly and causing inaccurate recognition of the video content, it is stipulated here that the modification of the PU partition mode is performed in the same direction, that is, the horizontal partition mode and the vertical partition mode cannot be modified mutually.

计算第二类载体序列中的每个整数加1或保持不变或减1时的失真代价值,对于第二类载体序列中的任一个整数,将其作为当前整数,设定当前整数对应的载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前整数加1时的失真代价值记为

Figure BDA0004010952290000131
将当前整数保持不变时的失真代价值记为
Figure BDA0004010952290000132
将当前整数减1时的失真代价值记为
Figure BDA0004010952290000133
若当前整数
Figure BDA0004010952290000134
为0,则
Figure BDA0004010952290000135
Figure BDA0004010952290000136
为无穷大;若当前整数
Figure BDA0004010952290000137
为1,则
Figure BDA0004010952290000138
Figure BDA0004010952290000139
若当前整数
Figure BDA00040109522900001310
为2,则
Figure BDA00040109522900001311
为无穷大、
Figure BDA00040109522900001312
Figure BDA00040109522900001313
Calculate the distortion cost value when each integer in the second type of carrier sequence is increased by 1, remains unchanged, or decreased by 1. For any integer in the second type of carrier sequence, take it as the current integer, set the carrier corresponding to the current integer to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and record the distortion cost value when the current integer is increased by 1 as
Figure BDA0004010952290000131
The distortion cost when the current integer remains unchanged is recorded as
Figure BDA0004010952290000132
The distortion cost when the current integer is reduced by 1 is recorded as
Figure BDA0004010952290000133
If the current integer
Figure BDA0004010952290000134
If is 0,
Figure BDA0004010952290000135
Figure BDA0004010952290000136
is infinite; if the current integer
Figure BDA0004010952290000137
If is 1,
Figure BDA0004010952290000138
Figure BDA0004010952290000139
If the current integer
Figure BDA00040109522900001310
is 2, then
Figure BDA00040109522900001311
For infinity,
Figure BDA00040109522900001312
Figure BDA00040109522900001313

步骤1_11:利用同一个嵌入负载率payload随机生成两个不同的二进制隐秘信息序列,对应记为X1和X2;然后根据第一类载体序列中的每个整数加1或保持不变或减1时的失真代价值,利用STC(Syndrome-Trellis Codes,校验子格编码)工具包将X1嵌入到第一类载体序列中的所有整数中,得到第一类含密载体序列;同样,根据第二类载体序列中的每个整数加1或保持不变或减1时的失真代价值,利用STC工具包将X2嵌入到第二类载体序列中的所有整数中,得到第二类含密载体序列;其中,payload∈(0,0.5],在本实施例中payload取值为0.5,X1的长度为Num1×payload,X2的长度为Num2×payload,Num1表示第一类载体中的载体的总个数,Num2表示第二类载体中的载体的总个数。Step 1_11: Use the same embedding load rate payload to randomly generate two different binary secret information sequences, which are denoted as X1 and X2 respectively; then, according to the distortion cost value when each integer in the first type of carrier sequence is increased by 1, remains unchanged, or decreased by 1, use the STC (Syndrome-Trellis Codes) toolkit to embed X1 into all integers in the first type of carrier sequence to obtain the first type of secret carrier sequence; similarly, according to the distortion cost value when each integer in the second type of carrier sequence is increased by 1, remains unchanged, or decreased by 1, use the STC toolkit to embed X2 into all integers in the second type of carrier sequence to obtain the second type of secret carrier sequence; wherein, payload∈(0,0.5], in this embodiment, the value of payload is 0.5, the length of X1 is Num1 ×payload, the length of X2 is Num2 ×payload, Num1 represents the total number of carriers in the first type of carrier, and Num2 represents the total number of carriers in the second type of carrier.

步骤1_12:将第一类含密载体序列与第二类含密载体序列中的所有整数分别转化为PU划分模式,具体过程为:Step 1_12: Convert all integers in the first type of secret carrier sequence and the second type of secret carrier sequence into PU partition patterns respectively. The specific process is as follows:

第一类含密载体序列共有六种整数,分别为0、1、2、3、4、5,将整数0转化为2N×N划分模式,将整数1转化为2N×nU划分模式,将整数2转化为2N×nD划分模式,将整数3转化为N×2N划分模式,将整数4转化为nL×2N划分模式,将整数5转化为nR×2N划分模式;然后将第一类含密载体序列中的所有整数转化后得到的所有PU划分模式,按序替换第一类载体中相同位置的载体,构成第一类含密载体。There are six integers in the first type of secret carrier sequence, namely 0, 1, 2, 3, 4, and 5. The integer 0 is converted into a 2N×N partitioning pattern, the integer 1 is converted into a 2N×nU partitioning pattern, the integer 2 is converted into a 2N×nD partitioning pattern, the integer 3 is converted into an N×2N partitioning pattern, the integer 4 is converted into an nL×2N partitioning pattern, and the integer 5 is converted into an nR×2N partitioning pattern. Then all the PU partitioning patterns obtained after converting all the integers in the first type of secret carrier sequence are used to replace the carriers in the same position in the first type of carriers in sequence to form the first type of secret carriers.

第二类含密载体序列共有三种整数,分别为0、1、2、3,将整数0转化为2N×N划分模式,将整数1转化为N×2N划分模式,将整数2转化为N×N划分模式;然后将第二类含密载体序列中的所有整数转化后得到的所有PU划分模式,按序替换第二类载体中相同位置的载体,构成第二类含密载体。The second type of secret carrier sequence has three integers, namely 0, 1, 2, and 3. The integer 0 is converted into a 2N×N partition pattern, the integer 1 is converted into an N×2N partition pattern, and the integer 2 is converted into an N×N partition pattern. Then all the PU partition patterns obtained after converting all the integers in the second type of secret carrier sequence are used to replace the carriers in the same position in the second type of carriers in sequence to form the second type of secret carriers.

步骤1_13:采用H.265/HEVC标准编码器对原始视频进行压缩编码,在压缩编码的预测过程中用隐写后的第一类含密载体与第二类含密载体替换相应位置的原始的PU划分模式,经过压缩编码得到含密视频码流。Step 1_13: Use the H.265/HEVC standard encoder to compress and encode the original video. In the prediction process of compression coding, the original PU division pattern at the corresponding position is replaced by the steganographic first-type secret carrier and the second-type secret carrier, and the secret video code stream is obtained through compression coding.

所述的隐秘信息提取的具体过程为:The specific process of extracting secret information is as follows:

步骤2_1:采用H.265/HEVC标准解码器对含密视频码流进行解码,在解码过程中保存每帧中的每个编码树单元中的每个编码单元的预测模式和深度、每个编码单元对应的PU划分模式,在解码结束后得到解码视频。Step 2_1: Use the H.265/HEVC standard decoder to decode the encrypted video stream. During the decoding process, save the prediction mode and depth of each coding unit in each coding tree unit in each frame, and the PU partition mode corresponding to each coding unit, and obtain the decoded video after the decoding is completed.

步骤2_2:按照步骤1_2至步骤1_8获取第一类载体序列和第二类载体序列的过程,以相同的方式获取解码视频对应的含密的第一类载体序列和含密的第二类载体序列。Step 2_2: According to the process of obtaining the first type of carrier sequence and the second type of carrier sequence from step 1_2 to step 1_8, the encrypted first type of carrier sequence and the encrypted second type of carrier sequence corresponding to the decoded video are obtained in the same manner.

步骤2_3:利用STC工具包对步骤2_2得到的含密的第一类载体序列进行解码,提取得到第一隐秘信息,记为

Figure BDA0004010952290000141
同样,利用STC工具包对步骤2_2得到的含密的第二类载体序列进行解码,提取得到第二隐秘信息,记为
Figure BDA0004010952290000142
其中,
Figure BDA0004010952290000143
Figure BDA0004010952290000144
ExtSTC()表示STC解码,y1表示含密的第一类载体序列,H表示STC的奇偶校验矩阵,在发送者和接收者间共享,y2表示含密的第二类载体序列。Step 2_3: Use the STC toolkit to decode the first type of carrier sequence obtained in step 2_2, and extract the first secret information, which is recorded as
Figure BDA0004010952290000141
Similarly, the STC toolkit is used to decode the secret second type carrier sequence obtained in step 2_2, and the second secret information is extracted, which is recorded as
Figure BDA0004010952290000142
in,
Figure BDA0004010952290000143
Figure BDA0004010952290000144
Ext STC () represents STC decoding, y 1 represents the first type of carrier sequence containing secrets, H represents the parity check matrix of STC, which is shared between the sender and the receiver, and y 2 represents the second type of carrier sequence containing secrets.

为了进一步说明本发明方法的可行性和有效性,对本发明方法进行实验。In order to further illustrate the feasibility and effectiveness of the method of the present invention, experiments were conducted on the method of the present invention.

实验选用了分辨率为1920×1080的几个具有代表性的视频序列,分别为BasketballDrive、BQTerrace、Cactus、ParkScene。本发明方法是在H.265/HEVC参考软件HM16.15下进行的,使用自带的encoder_lowdelay_P_main.cfg配置文件进行编码,其中,视频序列的编码结构为IPPP,一个图像组GOP的长度为4,一个图像组GOP内包含20帧(即每个视频序列各选取前20帧),编码量化参数QP固定为32,其余编码参数与原配置文件保持一致。The experiment selected several representative video sequences with a resolution of 1920×1080, namely BasketballDrive, BQTerrace, Cactus, and ParkScene. The method of the present invention is carried out under the H.265/HEVC reference software HM16.15, and the built-in encoder_lowdelay_P_main.cfg configuration file is used for encoding, wherein the encoding structure of the video sequence is IPPP, the length of a group of images GOP is 4, and a group of images GOP contains 20 frames (that is, the first 20 frames of each video sequence are selected), the encoding quantization parameter QP is fixed to 32, and the other encoding parameters are consistent with the original configuration file.

为了进一步说明本发明方法的有效性,在此使用了峰值信噪比(Peak Signal-to-Noise Ratio,PSNR)、结构相似性(Structural Similarity,SSIM)、均方误差(MeanSquared Error,MSE)、比特率增长(BitRate Increase,BRI)和隐写分析检测率五个指标来评价HEVC视频数据隐写的效果,其中,PSNR和SSIM值越大,表示视频画面质量越佳;MSE越小,表示视频画面质量越佳;BRI越小,表示隐写方法对视频码率的影响越小;隐写分析检测率越接近50%,表示隐写方法越能欺骗隐写分析检测。In order to further illustrate the effectiveness of the method of the present invention, five indicators, namely Peak Signal-to-Noise Ratio (PSNR), Structural Similarity (SSIM), Mean Squared Error (MSE), Bit Rate Increase (BRI) and steganalysis detection rate, are used to evaluate the steganographic effect of HEVC video data. The larger the PSNR and SSIM values, the better the video picture quality; the smaller the MSE, the better the video picture quality; the smaller the BRI, the smaller the impact of the steganography method on the video bit rate; the closer the steganalysis detection rate is to 50%, the more the steganography method can deceive steganalysis detection.

表1给出了仅使用HM编码器对原始视频进行压缩后得到的视频、使用Zhang方法对原始视频进行数据隐写后得到的含密视频、使用本发明方法对原始视频进行数据隐写后得到的含密视频在PSNR、SSIM、MSE上的结果比较。Table 1 shows the comparison of the PSNR, SSIM, and MSE results of the video obtained by compressing the original video using only the HM encoder, the encrypted video obtained by steganographically writing the original video using the Zhang method, and the encrypted video obtained by steganographically writing the original video using the method of the present invention.

表1三种方法得到的PSNR、SSIM、MSE比较Table 1 Comparison of PSNR, SSIM, and MSE obtained by three methods

Figure BDA0004010952290000151
Figure BDA0004010952290000151

在表1中,“Original”指使用HM编码器对原始视频进行压缩的方法,Zhang方法指Z.Zhang,Z.Li,J.Liu,H.Yan,and L.Yu,Steganography algorithm based on modifiedemd-coded pu partition modes for hevc videos[J],EURASIP Journal on Image andVideo Processing,2021(1):1–20.(一种基于改进EMD编码的PU划分模式的HEVC视频隐写方法)。In Table 1, “Original” refers to the method of compressing the original video using the HM encoder, and Zhang’s method refers to Z. Zhang, Z. Li, J. Liu, H. Yan, and L. Yu, Steganography algorithm based on modified EMD-coded PU partition modes for HEVC videos[J], EURASIP Journal on Image and Video Processing, 2021(1): 1–20. (A HEVC video steganography method based on improved EMD-coded PU partition mode).

从表1所列的数据中可以得出,使用本发明方法得到的含密视频序列在视频画面质量的各项评价指标上都要优于对比方法。It can be concluded from the data listed in Table 1 that the encrypted video sequence obtained by the method of the present invention is superior to the comparative method in various evaluation indicators of video picture quality.

图2给出了使用Zhang方法对原始视频进行数据隐写后得到的含密视频及使用本发明方法(proposed)对原始视频进行数据隐藏后得到的含密视频在BRI上的结果。从图2所示的数据中可以得出,使用本发明方法得到的含密视频序列的比特率增长较小,其码率影响要比对比方法更小,说明本发明方法具有优秀的抑制比特率增长的效果。Figure 2 shows the results of the encrypted video obtained by using Zhang's method to steganographically write data on the original video and the encrypted video obtained by using the proposed method to hide data on the original video on BRI. From the data shown in Figure 2, it can be concluded that the bit rate increase of the encrypted video sequence obtained by the proposed method is small, and its bit rate impact is smaller than that of the comparison method, indicating that the proposed method has an excellent effect of suppressing the bit rate increase.

表2给出了使用Zhang方法对原始视频进行数据隐写后得到的含密视频及使用本发明方法对原始视频进行数据隐写后得到的含密视频在对Zhai方法的隐写分析的抗隐写分析的结果。Zhai方法指L.Zhai,L.Wang,and Y.Ren,Universal detection ofvideosteganography in multiple domains based on the consistency ofmotionvectors[J],IEEE Transactions on Information Forensics andSecurity,vol.15,pp.1762–1777,2019.(一种基于运动矢量一致性的多域视频隐写的通用检测方法)。Table 2 shows the results of the anti-steganographic analysis of the secret video obtained by using Zhang's method to steganographic the original video and the secret video obtained by using the method of the present invention to steganographic the original video. The Zhai method refers to L. Zhai, L. Wang, and Y. Ren, Universal detection of video steganography in multiple domains based on the consistency of motion vectors [J], IEEE Transactions on Information Forensics and Security, vol. 15, pp. 1762–1777, 2019. (A universal detection method for multi-domain video steganography based on the consistency of motion vectors).

表2两种方法抗隐写分析性能比较比较Table 2 Comparison of the anti-steganalysis performance of the two methods

隐写分析检测方法Steganalysis Detection Methods 本发明方法Method of the present invention Zhang方法Zhang Method Zhai方法Zhai Method 50%50% 94%94%

从表2所列的数据中可以得出,使用本发明方法得到的含密视频序列的抗隐写分析性能要高于对比方法,说明本发明方法的安全性更高。It can be concluded from the data listed in Table 2 that the anti-steganalysis performance of the encrypted video sequence obtained by the method of the present invention is higher than that of the comparison method, indicating that the security of the method of the present invention is higher.

Claims (5)

1.一种基于改进RDO的H.265/HEVC视频自适应隐写方法,包括隐秘信息嵌入和隐秘信息提取两部分;其特征在于:1. An H.265/HEVC video adaptive steganography method based on improved RDO, including two parts: secret information embedding and secret information extraction; the characteristics are: 所述的隐秘信息嵌入的具体过程为:The specific process of embedding the secret information is as follows: 步骤1_1:采用H.265/HEVC标准编码器对原始视频进行压缩编码,在压缩编码过程中保存每帧中的每个编码树单元中的每个编码单元的预测模式和深度、每个编码单元对应的PU划分模式,在压缩编码结束后得到H.265/HEVC视频;其中,编码树单元的尺寸为64×64,编码单元的尺寸为64×64或32×32或16×16或8×8;Step 1_1: Use the H.265/HEVC standard encoder to compress and encode the original video. During the compression and encoding process, the prediction mode and depth of each coding unit in each coding tree unit in each frame and the PU partition mode corresponding to each coding unit are saved. After the compression and encoding, the H.265/HEVC video is obtained; wherein the size of the coding tree unit is 64×64, and the size of the coding unit is 64×64, 32×32, 16×16, or 8×8; 步骤1_2:按序遍历H.265/HEVC视频中的所有帧,将当前遍历的帧定义为当前帧;Step 1_2: traverse all frames in the H.265/HEVC video in order, and define the currently traversed frame as the current frame; 步骤1_3:判断当前帧是否为P帧,如果当前帧为P帧,则执行步骤1_4;如果当前帧不为P帧,则直接执行步骤1_7;Step 1_3: Determine whether the current frame is a P frame. If the current frame is a P frame, execute step 1_4; if the current frame is not a P frame, directly execute step 1_7; 步骤1_4:按序遍历当前帧中的所有尺寸的编码单元,将当前遍历的编码单元定义为当前单元;Step 1_4: traverse the coding units of all sizes in the current frame in order, and define the currently traversed coding unit as the current unit; 步骤1_5:如果当前单元的尺寸为64×64,则对当前单元不做处理,然后执行步骤1_6;如果当前单元的尺寸为32×32或16×16,则将当前单元对应的PU划分模式作为载体并归类为第一类载体,并记录当前单元在H.265/HEVC视频中的索引位置、当前单元的深度以及当前单元对应的PU划分模式,然后执行步骤1_6;如果当前单元的尺寸为8×8,则将当前单元对应的PU划分模式作为载体并归类为第二类载体,并记录当前单元在H.265/HEVC视频中的索引位置、当前单元的深度以及当前单元对应的PU划分模式,然后执行步骤1_6;Step 1_5: If the size of the current unit is 64×64, the current unit is not processed, and then step 1_6 is executed; if the size of the current unit is 32×32 or 16×16, the PU partition mode corresponding to the current unit is used as a carrier and classified as a first-class carrier, and the index position of the current unit in the H.265/HEVC video, the depth of the current unit, and the PU partition mode corresponding to the current unit are recorded, and then step 1_6 is executed; if the size of the current unit is 8×8, the PU partition mode corresponding to the current unit is used as a carrier and classified as a second-class carrier, and the index position of the current unit in the H.265/HEVC video, the depth of the current unit, and the PU partition mode corresponding to the current unit are recorded, and then step 1_6 is executed; 步骤1_6:遍历当前帧中的下一个编码单元,作为当前单元,然后返回步骤1_5继续执行,直至当前帧中的所有编码单元全部遍历完毕,然后执行步骤1_7;Step 1_6: traverse the next coding unit in the current frame as the current unit, then return to step 1_5 to continue executing until all coding units in the current frame are traversed, and then execute step 1_7; 步骤1_7:遍历H.265/HEVC视频中的下一帧,作为当前帧,然后返回步骤1_3继续执行,直至H.265/HEVC视频中的所有帧全部遍历完毕后执行步骤1_8;Step 1_7: traverse the next frame in the H.265/HEVC video as the current frame, then return to step 1_3 to continue executing, and execute step 1_8 after all frames in the H.265/HEVC video have been traversed; 步骤1_8:将归类为第一类载体与归类为第二类载体的所有载体即PU划分模式分别进行映射,具体过程为:Step 1_8: Map all carriers classified as the first type of carriers and all carriers classified as the second type of carriers, that is, PU partitioning modes, respectively. The specific process is as follows: 第一类载体共有八种PU划分模式,分别为2N×2N、N×N、2N×N、2N×nU、2N×nD、N×2N、nL×2N、nR×2N划分模式,2N×N、2N×nU、2N×nD划分模式均为水平划分模式,N×2N、nL×2N、nR×2N划分模式均为垂直划分模式;对于归类为第一类载体的任一个载体,若该载体为2N×2N划分模式或N×N划分模式,则对该载体不进行映射;若该载体为2N×N划分模式,则将该载体映射为整数0;若该载体为2N×nU划分模式,则将该载体映射为整数1;若该载体为2N×nD划分模式,则将该载体映射为整数2;若该载体为N×2N划分模式,则将该载体映射为整数3;若该载体为nL×2N划分模式,则将该载体映射为整数4;若该载体为nR×2N划分模式,则将该载体映射为整数5;然后将归类为第一类载体的所有载体映射后得到的所有整数,按载体即PU划分模式对应的编码单元在H.265/HEVC视频中的索引位置的先后顺序排列,构成第一类载体序列;再执行步骤1_9;There are eight PU partition modes for the first type of carriers, namely 2N×2N, N×N, 2N×N, 2N×nU, 2N×nD, N×2N, nL×2N, and nR×2N partition modes. The 2N×N, 2N×nU, and 2N×nD partition modes are all horizontal partition modes, and the N×2N, nL×2N, and nR×2N partition modes are all vertical partition modes. For any carrier classified as the first type of carrier, if the carrier is in the 2N×2N partition mode or the N×N partition mode, the carrier is not mapped; if the carrier is in the 2N×N partition mode, the carrier is mapped to the integer 0; if the carrier is in the 2N×nU partition mode, the carrier is mapped to the integer 0; If the carrier is a 2N×nD partition mode, the carrier is mapped to an integer 1; if the carrier is a 2N×nD partition mode, the carrier is mapped to an integer 2; if the carrier is an N×2N partition mode, the carrier is mapped to an integer 3; if the carrier is an nL×2N partition mode, the carrier is mapped to an integer 4; if the carrier is an nR×2N partition mode, the carrier is mapped to an integer 5; then all integers obtained after mapping all carriers classified as the first type of carriers are arranged in the order of the index positions of the coding units corresponding to the carrier, i.e., the PU partition mode, in the H.265/HEVC video to form a first type of carrier sequence; then execute step 1_9; 第二类载体共有四种PU划分模式,分别为2N×2N、2N×N、N×2N、N×N划分模式;对于归类为第二类载体的任一个载体,若该载体为2N×2N划分模式,则对该载体不进行映射;若该载体为2N×N划分模式,则将该载体映射为整数0;若该载体为N×2N划分模式,则将该载体映射为整数1;若该载体为N×N划分模式,则将该载体映射为整数2;然后将归类为第二类载体的所有载体映射后得到的所有整数,按载体即PU划分模式对应的编码单元在H.265/HEVC视频中的索引位置的先后顺序排列,构成第二类载体序列;再执行步骤1_9;There are four PU partition modes for the second type of carrier, namely 2N×2N, 2N×N, N×2N, and N×N partition modes; for any carrier classified as the second type of carrier, if the carrier is in the 2N×2N partition mode, the carrier is not mapped; if the carrier is in the 2N×N partition mode, the carrier is mapped to an integer 0; if the carrier is in the N×2N partition mode, the carrier is mapped to an integer 1; if the carrier is in the N×N partition mode, the carrier is mapped to an integer 2; then all integers obtained after mapping all carriers classified as the second type of carrier are arranged in the order of the index positions of the coding units corresponding to the carrier, i.e., the PU partition mode, in the H.265/HEVC video to form a second type of carrier sequence; then execute step 1_9; 步骤1_9:计算第一类载体序列中的每个整数对应的载体修改为同类载体序列中的其它整数对应的载体即PU划分模式的代价值,对于第一类载体序列中的任一个整数对应的载体,将其作为当前载体,设定当前载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式的代价值记为
Figure FDA0004010952280000021
Step 1_9: Calculate the cost of modifying the carrier corresponding to each integer in the first type of carrier sequence to the carrier corresponding to other integers in the same type of carrier sequence, that is, the PU partition mode. For any carrier corresponding to an integer in the first type of carrier sequence, use it as the current carrier, set the current carrier to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and modify the current carrier to the carrier corresponding to any other integer t in the same type of carrier sequence, that is, the PU partition mode. The cost value is recorded as
Figure FDA0004010952280000021
Figure FDA0004010952280000022
Figure FDA0004010952280000022
计算第二类载体序列中的每个整数对应的载体修改为同类载体序列中的其它整数对应的载体即PU划分模式的代价值,对于第二类载体序列中的任一个整数对应的载体,将其作为当前载体,设定当前载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式的代价值记为
Figure FDA0004010952280000023
Calculate the cost of modifying the carrier corresponding to each integer in the second type of carrier sequence to the carrier corresponding to other integers in the same type of carrier sequence, that is, the PU partition mode. For any carrier corresponding to an integer in the second type of carrier sequence, use it as the current carrier, set the current carrier to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and modify the current carrier to the carrier corresponding to any other integer s in the same type of carrier sequence, that is, the PU partition mode. The cost value is recorded as
Figure FDA0004010952280000023
Figure FDA0004010952280000031
Figure FDA0004010952280000031
其中,1≤m≤M,M表示H.265/HEVC视频中包含的帧的总帧数,1≤n≤N,N表示H.265/HEVC视频中的第m帧中包含的编码树单元的总个数,1≤n≤N,1≤k≤K,K表示H.265/HEVC视频中的第m帧中的第n个编码树单元中包含的编码单元的总个数,若当前载体属于第一类载体,则当前载体对应的整数为0时t为1、2、3、4或5,当前载体对应的整数为1时t为0、2、3、4或5,当前载体对应的整数为2时t为0、1、3、4或5,当前载体对应的整数为3时t为0、1、2、4或5,当前载体对应的整数为4时t为0、1、2、3或5,当前载体对应的整数为5时t为0、1、2、3或4,exp()表示以自然基数e为底的指数函数,α表示帧间失真传递率,0<α<1,GOPSize表示H.265/HEVC视频中一个图像组GOP内的总帧数,Poc表示当前载体对应的编码单元所在的帧在该帧所在的图像组GOP内的位置,即当前载体对应的编码单元所在的帧为该帧所在的图像组GOP内的第Poc帧,1≤Poc≤GOPSize,
Figure FDA0004010952280000032
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的失真,
Figure FDA0004010952280000033
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的比特数,
Figure FDA0004010952280000034
表示将当前载体修改为同类载体序列中的其它任一个整数t对应的载体即PU划分模式后的拉格朗日因子,
Figure FDA0004010952280000035
表示失真控制因子,
Figure FDA0004010952280000036
表示比特率控制因子,
Figure FDA0004010952280000037
若当前载体属于第二类载体,则当前载体对应的整数为0时s为1或2,当前载体对应的整数为1时s为0或2,当前载体对应的整数为2时s为0或1,
Figure FDA0004010952280000038
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的失真,
Figure FDA0004010952280000039
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的比特数,
Figure FDA00040109522800000310
表示将当前载体修改为同类载体序列中的其它任一个整数s对应的载体即PU划分模式后的拉格朗日因子;
Wherein, 1≤m≤M, M represents the total number of frames contained in the H.265/HEVC video, 1≤n≤N, N represents the total number of coding tree units contained in the m-th frame in the H.265/HEVC video, 1≤n≤N, 1≤k≤K, K represents the total number of coding units contained in the n-th coding tree unit in the m-th frame in the H.265/HEVC video, if the current carrier belongs to the first type of carrier, then when the integer corresponding to the current carrier is 0, t is 1, 2, 3, 4 or 5, when the integer corresponding to the current carrier is 1, t is 0, 2, 3, 4 or 5, when the integer corresponding to the current carrier is 2, t is 0, 1, 3, 4 or 5, and the integer corresponding to the current carrier is When the integer corresponding to the current carrier is 3, t is 0, 1, 2, 4 or 5. When the integer corresponding to the current carrier is 4, t is 0, 1, 2, 3 or 5. When the integer corresponding to the current carrier is 5, t is 0, 1, 2, 3 or 4. exp() represents an exponential function with the natural base e as the base. α represents the inter-frame distortion transmission rate, 0<α<1. GOPSize represents the total number of frames in a picture group GOP in H.265/HEVC video. Poc represents the position of the frame where the coding unit corresponding to the current carrier is located in the picture group GOP where the frame is located. That is, the frame where the coding unit corresponding to the current carrier is located is the Poc-th frame in the picture group GOP where the frame is located. 1≤Poc≤GOPSize.
Figure FDA0004010952280000032
It indicates the distortion after changing the current carrier to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure FDA0004010952280000033
Indicates the number of bits after the current carrier is modified to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure FDA0004010952280000034
It indicates the Lagrangian factor after the current carrier is modified to the carrier corresponding to any other integer t in the same carrier sequence, that is, the PU partition mode.
Figure FDA0004010952280000035
represents the distortion control factor,
Figure FDA0004010952280000036
represents the bit rate control factor,
Figure FDA0004010952280000037
If the current carrier belongs to the second type of carrier, then when the integer corresponding to the current carrier is 0, s is 1 or 2; when the integer corresponding to the current carrier is 1, s is 0 or 2; when the integer corresponding to the current carrier is 2, s is 0 or 1.
Figure FDA0004010952280000038
It indicates the distortion after changing the current carrier to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure FDA0004010952280000039
Indicates the number of bits after the current carrier is modified to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode.
Figure FDA00040109522800000310
Indicates the Lagrangian factor after the current carrier is modified to the carrier corresponding to any other integer s in the same carrier sequence, that is, the PU partition mode;
步骤1_10:计算第一类载体序列中的每个整数加1或保持不变或减1时的失真代价值,对于第一类载体序列中的任一个整数,将其作为当前整数,设定当前整数对应的载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前整数加1时的失真代价值记为
Figure FDA0004010952280000041
将当前整数保持不变时的失真代价值记为
Figure FDA0004010952280000042
将当前整数减1时的失真代价值记为
Figure FDA0004010952280000043
若当前整数zm,n,k为0,则
Figure FDA0004010952280000044
Figure FDA0004010952280000045
为无穷大;若当前整数zm,n,k为1,则
Figure FDA0004010952280000046
Figure FDA0004010952280000047
若当前整数zm,n,k为2,则
Figure FDA0004010952280000048
为无穷大、
Figure FDA0004010952280000049
Figure FDA00040109522800000410
若当前整数zm,n,k为3,则
Figure FDA00040109522800000411
Figure FDA00040109522800000412
为无穷大;若当前整数zm,n,k为4,则
Figure FDA00040109522800000413
若当前整数zm,n,k为5,则
Figure FDA00040109522800000414
为无穷大、
Figure FDA00040109522800000415
Step 1_10: Calculate the distortion cost value when each integer in the first type of carrier sequence is increased by 1, remains unchanged, or decreased by 1. For any integer in the first type of carrier sequence, take it as the current integer, set the carrier corresponding to the current integer to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and record the distortion cost value when the current integer is increased by 1 as
Figure FDA0004010952280000041
The distortion cost when the current integer remains unchanged is recorded as
Figure FDA0004010952280000042
The distortion cost when the current integer is reduced by 1 is recorded as
Figure FDA0004010952280000043
If the current integer z m,n,k is 0, then
Figure FDA0004010952280000044
Figure FDA0004010952280000045
is infinite; if the current integer z m,n,k is 1, then
Figure FDA0004010952280000046
Figure FDA0004010952280000047
If the current integer z m,n,k is 2, then
Figure FDA0004010952280000048
For infinity,
Figure FDA0004010952280000049
Figure FDA00040109522800000410
If the current integer z m,n,k is 3, then
Figure FDA00040109522800000411
Figure FDA00040109522800000412
is infinite; if the current integer z m,n,k is 4, then
Figure FDA00040109522800000413
If the current integer z m,n,k is 5, then
Figure FDA00040109522800000414
For infinity,
Figure FDA00040109522800000415
计算第二类载体序列中的每个整数加1或保持不变或减1时的失真代价值,对于第二类载体序列中的任一个整数,将其作为当前整数,设定当前整数对应的载体为H.265/HEVC视频中的第m帧中的第n个编码树单元中的第k个编码单元对应的PU划分模式,将当前整数加1时的失真代价值记为
Figure FDA00040109522800000416
将当前整数保持不变时的失真代价值记为
Figure FDA00040109522800000417
将当前整数减1时的失真代价值记为
Figure FDA00040109522800000418
若当前整数
Figure FDA00040109522800000419
为0,则
Figure FDA00040109522800000420
Figure FDA00040109522800000421
为无穷大;若当前整数
Figure FDA00040109522800000422
为1,则
Figure FDA00040109522800000423
Figure FDA00040109522800000424
若当前整数
Figure FDA00040109522800000425
为2,则
Figure FDA00040109522800000426
为无穷大、
Figure FDA00040109522800000427
Figure FDA00040109522800000428
Calculate the distortion cost value when each integer in the second type of carrier sequence is increased by 1, remains unchanged, or decreased by 1. For any integer in the second type of carrier sequence, take it as the current integer, set the carrier corresponding to the current integer to the PU partition mode corresponding to the kth coding unit in the nth coding tree unit in the mth frame of the H.265/HEVC video, and record the distortion cost value when the current integer is increased by 1 as
Figure FDA00040109522800000416
The distortion cost when the current integer remains unchanged is recorded as
Figure FDA00040109522800000417
The distortion cost when the current integer is reduced by 1 is recorded as
Figure FDA00040109522800000418
If the current integer
Figure FDA00040109522800000419
If is 0,
Figure FDA00040109522800000420
Figure FDA00040109522800000421
is infinite; if the current integer
Figure FDA00040109522800000422
is 1, then
Figure FDA00040109522800000423
Figure FDA00040109522800000424
If the current integer
Figure FDA00040109522800000425
is 2, then
Figure FDA00040109522800000426
For infinity,
Figure FDA00040109522800000427
Figure FDA00040109522800000428
步骤1_11:利用同一个嵌入负载率payload随机生成两个不同的二进制隐秘信息序列,对应记为X1和X2;然后根据第一类载体序列中的每个整数加1或保持不变或减1时的失真代价值,利用STC工具包将X1嵌入到第一类载体序列中的所有整数中,得到第一类含密载体序列;同样,根据第二类载体序列中的每个整数加1或保持不变或减1时的失真代价值,利用STC工具包将X2嵌入到第二类载体序列中的所有整数中,得到第二类含密载体序列;其中,payload∈(0,0.5],X1的长度为Num1×payload,X2的长度为Num2×payload,Num1表示第一类载体中的载体的总个数,Num2表示第二类载体中的载体的总个数;Step 1_11: Use the same embedding load rate payload to randomly generate two different binary secret information sequences, which are denoted as X1 and X2 respectively; then, according to the distortion cost value when each integer in the first type of carrier sequence is increased by 1, remains unchanged, or decreased by 1, use the STC toolkit to embed X1 into all integers in the first type of carrier sequence to obtain the first type of secret carrier sequence; similarly, according to the distortion cost value when each integer in the second type of carrier sequence is increased by 1, remains unchanged, or decreased by 1, use the STC toolkit to embed X2 into all integers in the second type of carrier sequence to obtain the second type of secret carrier sequence; where payload∈(0,0.5], the length of X1 is Num1 ×payload, the length of X2 is Num2 ×payload, Num1 represents the total number of carriers in the first type of carrier, and Num2 represents the total number of carriers in the second type of carrier; 步骤1_12:将第一类含密载体序列与第二类含密载体序列中的所有整数分别转化为PU划分模式,具体过程为:Step 1_12: Convert all integers in the first type of secret carrier sequence and the second type of secret carrier sequence into PU partition patterns respectively. The specific process is as follows: 第一类含密载体序列共有六种整数,分别为0、1、2、3、4、5,将整数0转化为2N×N划分模式,将整数1转化为2N×nU划分模式,将整数2转化为2N×nD划分模式,将整数3转化为N×2N划分模式,将整数4转化为nL×2N划分模式,将整数5转化为nR×2N划分模式;然后将第一类含密载体序列中的所有整数转化后得到的所有PU划分模式,按序替换第一类载体中相同位置的载体,构成第一类含密载体;The first type of secret carrier sequence has six integers, namely 0, 1, 2, 3, 4, and 5. The integer 0 is converted into a 2N×N partitioning mode, the integer 1 is converted into a 2N×nU partitioning mode, the integer 2 is converted into a 2N×nD partitioning mode, the integer 3 is converted into an N×2N partitioning mode, the integer 4 is converted into an nL×2N partitioning mode, and the integer 5 is converted into an nR×2N partitioning mode. Then, all the PU partitioning modes obtained after converting all the integers in the first type of secret carrier sequence are used to replace the carriers in the same position in the first type of carriers in order to form the first type of secret carriers. 第二类含密载体序列共有三种整数,分别为0、1、2、3,将整数0转化为2N×N划分模式,将整数1转化为N×2N划分模式,将整数2转化为N×N划分模式;然后将第二类含密载体序列中的所有整数转化后得到的所有PU划分模式,按序替换第二类载体中相同位置的载体,构成第二类含密载体;The second type of secret carrier sequence has three integers, namely 0, 1, 2, and 3. The integer 0 is converted into a 2N×N partition mode, the integer 1 is converted into an N×2N partition mode, and the integer 2 is converted into an N×N partition mode. Then, all the PU partition modes obtained after converting all the integers in the second type of secret carrier sequence are used to replace the carriers at the same position in the second type of carriers in order to form the second type of secret carriers. 步骤1_13:采用H.265/HEVC标准编码器对原始视频进行压缩编码,在压缩编码的预测过程中用隐写后的第一类含密载体与第二类含密载体替换相应位置的原始的PU划分模式,经过压缩编码得到含密视频码流;Step 1_13: Use the H.265/HEVC standard encoder to compress and encode the original video. In the prediction process of compression encoding, the original PU partitioning pattern at the corresponding position is replaced with the first type of secret carrier and the second type of secret carrier after steganography, and the secret video code stream is obtained through compression encoding; 所述的隐秘信息提取的具体过程为:The specific process of extracting secret information is as follows: 步骤2_1:采用H.265/HEVC标准解码器对含密视频码流进行解码,在解码过程中保存每帧中的每个编码树单元中的每个编码单元的预测模式和深度、每个编码单元对应的PU划分模式,在解码结束后得到解码视频;Step 2_1: Use the H.265/HEVC standard decoder to decode the encrypted video stream. During the decoding process, save the prediction mode and depth of each coding unit in each coding tree unit in each frame, and the PU partition mode corresponding to each coding unit, and obtain the decoded video after decoding; 步骤2_2:按照步骤1_2至步骤1_8获取第一类载体序列和第二类载体序列的过程,以相同的方式获取解码视频对应的含密的第一类载体序列和含密的第二类载体序列;Step 2_2: Obtain the encrypted first-type carrier sequence and the encrypted second-type carrier sequence corresponding to the decoded video in the same manner as the process of obtaining the first-type carrier sequence and the second-type carrier sequence in step 1_2 to step 1_8; 步骤2_3:利用STC工具包对步骤2_2得到的含密的第一类载体序列进行解码,提取得到第一隐秘信息,记为
Figure FDA0004010952280000051
同样,利用STC工具包对步骤2_2得到的含密的第二类载体序列进行解码,提取得到第二隐秘信息,记为
Figure FDA0004010952280000052
Step 2_3: Use the STC toolkit to decode the first type of carrier sequence obtained in step 2_2, and extract the first secret information, which is recorded as
Figure FDA0004010952280000051
Similarly, the STC toolkit is used to decode the secret second type carrier sequence obtained in step 2_2, and the second secret information is extracted, which is recorded as
Figure FDA0004010952280000052
2.根据权利要求1所述的基于改进RDO的H.265/HEVC视频自适应隐写方法,其特征在于所述的步骤1_9中,α取值为0.5,
Figure FDA0004010952280000053
取值为0.3,
Figure FDA0004010952280000054
取值为0.7。
2. According to the H.265/HEVC video adaptive steganography method based on improved RDO according to claim 1, it is characterized in that in the steps 1_9, the value of α is 0.5,
Figure FDA0004010952280000053
The value is 0.3.
Figure FDA0004010952280000054
The value is 0.7.
3.根据权利要求1或2所述的基于改进RDO的H.265/HEVC视频自适应隐写方法,其特征在于所述的步骤1_9中,
Figure FDA0004010952280000055
Figure FDA0004010952280000056
的值取决于是否采用Merge帧间预测模式,当采用Merge帧间预测模式时,
Figure FDA0004010952280000061
Figure FDA0004010952280000062
的值为SATD值;当采用非Merge帧间预测模式时,
Figure FDA0004010952280000063
Figure FDA0004010952280000064
的值为编码失真。
3. The H.265/HEVC video adaptive steganography method based on improved RDO according to claim 1 or 2, characterized in that in the steps 1-9,
Figure FDA0004010952280000055
and
Figure FDA0004010952280000056
The value of depends on whether the Merge inter-frame prediction mode is used. When the Merge inter-frame prediction mode is used,
Figure FDA0004010952280000061
and
Figure FDA0004010952280000062
The value is the SATD value; when the non-Merge inter-frame prediction mode is used,
Figure FDA0004010952280000063
and
Figure FDA0004010952280000064
The value of is the coding distortion.
4.根据权利要求3所述的基于改进RDO的H.265/HEVC视频自适应隐写方法,其特征在于所述的步骤1_9中,
Figure FDA0004010952280000065
Figure FDA0004010952280000066
的值取决于是否采用Merge帧间预测模式,当采用Merge帧间预测模式时,
Figure FDA0004010952280000067
Figure FDA0004010952280000068
的值为Merge索引的编码比特数;当采用非Merge帧间预测模式时,
Figure FDA0004010952280000069
Figure FDA00040109522800000610
的值为表示预测模式和残差变换系数的编码比特数。
4. The H.265/HEVC video adaptive steganography method based on improved RDO according to claim 3, characterized in that in the steps 1-9,
Figure FDA0004010952280000065
and
Figure FDA0004010952280000066
The value of depends on whether the Merge inter-frame prediction mode is used. When the Merge inter-frame prediction mode is used,
Figure FDA0004010952280000067
and
Figure FDA0004010952280000068
The value is the number of coded bits of the Merge index; when the non-Merge inter-frame prediction mode is used,
Figure FDA0004010952280000069
and
Figure FDA00040109522800000610
The value represents the number of coding bits for the prediction mode and the residual transform coefficient.
5.根据权利要求4所述的基于改进RDO的H.265/HEVC视频自适应隐写方法,其特征在于所述的步骤1_9中,
Figure FDA00040109522800000611
Figure FDA00040109522800000612
的值通过μ·ω·2(QP-12)/3.0计算得到,其中,μ的取值依赖于当前载体对应的编码单元所在的帧是否为该帧所在的图像组GOP内的参考帧,若该帧为其所在的图像组GOP内的参考帧,则μ=1.0-Clip3(0.0,0.5,0.05NB),若该帧为其所在的图像组GOP内的非参考帧,则μ=1.0,NB表示H.265/HEVC视频中一个图像组GOP内的B帧的总帧数,Clip3()为Clip操作函数,ω表示加权因子,ω的值由编码配置和当前载体对应的编码单元所在的帧在该帧所在的图像组GOP内的位置Poc决定,QP表示当前载体对应的编码单元所在的帧的编码量化参数。
5. The H.265/HEVC video adaptive steganography method based on improved RDO according to claim 4, characterized in that in the steps 1-9,
Figure FDA00040109522800000611
and
Figure FDA00040109522800000612
The value of is calculated by μ·ω·2 (QP-12)/3.0 , where the value of μ depends on whether the frame where the coding unit corresponding to the current carrier is located is a reference frame in the picture group GOP where the frame is located. If the frame is a reference frame in the picture group GOP where the frame is located, then μ=1.0-Clip3( 0.0,0.5,0.05NB ); if the frame is a non-reference frame in the picture group GOP where the frame is located, then μ=1.0, NB represents the total number of B frames in a picture group GOP in the H.265/HEVC video, Clip3() is the Clip operation function, ω represents the weighting factor, and the value of ω is determined by the encoding configuration and the position Poc of the frame where the coding unit corresponding to the current carrier is located in the picture group GOP where the frame is located, and QP represents the encoding quantization parameter of the frame where the coding unit corresponding to the current carrier is located.
CN202211648610.3A 2022-12-21 2022-12-21 Adaptive steganography method for H.265/HEVC video based on improved RDO Active CN116233441B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211648610.3A CN116233441B (en) 2022-12-21 2022-12-21 Adaptive steganography method for H.265/HEVC video based on improved RDO

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211648610.3A CN116233441B (en) 2022-12-21 2022-12-21 Adaptive steganography method for H.265/HEVC video based on improved RDO

Publications (2)

Publication Number Publication Date
CN116233441A true CN116233441A (en) 2023-06-06
CN116233441B CN116233441B (en) 2025-06-10

Family

ID=86583325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211648610.3A Active CN116233441B (en) 2022-12-21 2022-12-21 Adaptive steganography method for H.265/HEVC video based on improved RDO

Country Status (1)

Country Link
CN (1) CN116233441B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120128724A (en) * 2025-03-04 2025-06-10 宁波工程学院 Non-additive HEVC video steganography method based on inter-frame distortion transfer chain

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104159117A (en) * 2014-07-22 2014-11-19 宁波大学 Method for hiding HEVC video information
US20170310999A1 (en) * 2016-04-25 2017-10-26 Magnum Semiconductor, Inc. Method and apparatus for rate-distortion optimized coefficient quantization including sign data hiding
US20190037227A1 (en) * 2017-07-28 2019-01-31 Intel Corporation Techniques for hardware video encoding
CN111614958A (en) * 2020-05-26 2020-09-01 郑州师范学院 A video steganography method based on half-pixel motion compensation
CN114727112A (en) * 2022-02-24 2022-07-08 宁波大学 Adaptive Information Hiding Method for H.265/HEVC Video Based on Distortion Compensation Optimization
WO2022199180A1 (en) * 2021-03-23 2022-09-29 天翼云科技有限公司 Method for dynamic image steganography, apparatus, device, and storage medium
CN115334316A (en) * 2022-06-29 2022-11-11 宁波工程学院 A HEVC Video Adaptive Steganography Method Without Intra-frame Distortion Drift

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104159117A (en) * 2014-07-22 2014-11-19 宁波大学 Method for hiding HEVC video information
US20170310999A1 (en) * 2016-04-25 2017-10-26 Magnum Semiconductor, Inc. Method and apparatus for rate-distortion optimized coefficient quantization including sign data hiding
US20190037227A1 (en) * 2017-07-28 2019-01-31 Intel Corporation Techniques for hardware video encoding
CN111614958A (en) * 2020-05-26 2020-09-01 郑州师范学院 A video steganography method based on half-pixel motion compensation
WO2022199180A1 (en) * 2021-03-23 2022-09-29 天翼云科技有限公司 Method for dynamic image steganography, apparatus, device, and storage medium
CN114727112A (en) * 2022-02-24 2022-07-08 宁波大学 Adaptive Information Hiding Method for H.265/HEVC Video Based on Distortion Compensation Optimization
CN115334316A (en) * 2022-06-29 2022-11-11 宁波工程学院 A HEVC Video Adaptive Steganography Method Without Intra-frame Distortion Drift

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
KUAN HUANG ET AL: "Combined features for steganalysis against PU partition mode-based steganography in HEVC", MULTIMEDIA TOOLS AND APPLICATIONS, 28 July 2020 (2020-07-28) *
ZHENZHEN ZHANG ET AL: "Steganography algorithm based on modified EMD-coded PU partition modes for HEVC videos", EURASIP JOURNAL ON IMAGE AND VIDEO PROCESSING, 12 February 2021 (2021-02-12) *
徐达文: "一种基于预测模式的H.264/AVC视频信息隐藏改进算法", 光电工程, 30 November 2011 (2011-11-30) *
李松斌;王凌睿;刘鹏;黄永峰;: "一种基于运动矢量空间编码的HEVC信息隐藏方法", 计算机学报, no. 07, 23 July 2015 (2015-07-23) *
盛琪;王让定;黄美玲;李倩;徐达文;: "一种针对HEVC预测模式隐写的检测算法", 光电子・激光, no. 04, 15 April 2017 (2017-04-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120128724A (en) * 2025-03-04 2025-06-10 宁波工程学院 Non-additive HEVC video steganography method based on inter-frame distortion transfer chain

Also Published As

Publication number Publication date
CN116233441B (en) 2025-06-10

Similar Documents

Publication Publication Date Title
EP1249132B1 (en) A method for encoding images, and an image coder
CN102223540B (en) Information hiding method facing to H.264/AVC (automatic volume control) video
CN104581176B (en) The insertion of H.264/AVC compression domain robust video watermark and extracting method without frame in error drift
CN115604488B (en) Loop filtering method and device
CN111711822B (en) Video steganography method, system and device based on macro block complexity
CN109427032B (en) Scalable video watermark embedding and extracting method based on compressed domain
WO2009146933A2 (en) Method and device for image compression
CN108769700A (en) Reduce the robustness video steganography method of H.264 interframe drift distortion
Nguyen et al. A novel steganography scheme for video H. 264/AVC without distortion drift
CN109819260A (en) Video Steganography Method and Device Based on Multi-Embedding Domain Fusion
Cao et al. Cover block decoupling for content-adaptive H. 264 steganography
CN104853215A (en) Video steganography method based on motion vector local optimality preservation
Hu et al. Complexity-guided slimmable decoder for efficient deep video compression
CN114598887A (en) Anti-recompression video watermarking method for controlling bit rate increase
CN114727112B (en) H.265/HEVC video self-adaptive information hiding method based on distortion compensation optimization
CN104853186A (en) Improved video steganalysis method based on motion vector reply
Yang et al. Centralized error distribution-preserving adaptive steganography for HEVC
CN105979269A (en) Motion vector domain video steganography method based on novel embedding cost
CN116233441A (en) H.265/HEVC video self-adaptive steganography method based on improved RDO
CN105704489A (en) Adaptive video motion vector steganographic method based on macro-block complexity
Tang et al. Reversible data hiding based on a modified difference expansion for H. 264/AVC video streams
US8295349B2 (en) Methods and apparatuses for video compression intra prediction mode determination
CN108024114A (en) A kind of lossless HEVC information concealing methods of large capacity based on the modification of flag bit parameter
CN110248193A (en) A kind of reversible information hidden method based on improvement difference expansion
CN110072109B (en) A H.264/AVC Video Information Hiding Method for Minimizing Distortion at Macroblock Level

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant