CN106231318A - A kind of video scrambling method and device based on quantization transform coefficient - Google Patents
A kind of video scrambling method and device based on quantization transform coefficient Download PDFInfo
- Publication number
- CN106231318A CN106231318A CN201610871985.4A CN201610871985A CN106231318A CN 106231318 A CN106231318 A CN 106231318A CN 201610871985 A CN201610871985 A CN 201610871985A CN 106231318 A CN106231318 A CN 106231318A
- Authority
- CN
- China
- Prior art keywords
- block
- transform coefficient
- bit
- quantization transform
- thread
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/40—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using video transcoding, i.e. partial or full decoding of a coded input stream followed by re-encoding of the decoded output stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0618—Block ciphers, i.e. encrypting groups of characters of a plain text message using fixed encryption transformation
- H04L9/0631—Substitution permutation network [SPN], i.e. cipher composed of a number of stages or rounds each involving linear and nonlinear transformations, e.g. AES algorithms
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
- H04N19/18—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods 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/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/234—Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
- H04N21/2347—Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving video stream encryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
- H04N21/4405—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving video stream decryption
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/18—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
Abstract
The invention discloses a kind of video scrambling method and device based on quantization transform coefficient, the method, according to the sign symbol of quantization transform coefficient in transform block and positional information, constructs bit bit string, generates block of plaintext data to be encrypted;The block of plaintext data generated is encrypted, generates the ciphertext after encryption;Bit corresponding for non-zero quantised transform coefficient in ciphertext after encryption is converted to new sign symbol, carries out entropy code.The inventive system comprises block of plaintext data generation module, encrypting module and entropy code module.The method and device of the present invention, by scrambling the sign symbol of quantization transform coefficient, meets information scrambling or information descrambling function, simultaneously by rationally decomposing scrambling/descrambling, meets software multithread condition, it is achieved transcoding real-time.
Description
Technical field
The invention belongs to video scrambling technique field, particularly relate to a kind of video scrambling method based on quantization transform coefficient
And device.
Background technology
In video monitoring, information security becomes to become more and more important.Prevent the video figure transmitting in video monitoring system and storing
As, on the premise of being accessed by unauthorized user, still seeing that image information is just particularly important.Reach this purpose
(i.e. code stream is the most compatible at format compatible to be necessary for that headend equipment IPC (IP Camera) is encoded video image out
MPEG-4/H.264/H.265 standard, still can be decoded by the decoder of MPEG compatible-4/H.264/H.265 standard) premise
Under, carry out scrambling process.
Owing to current IPC coding chip does not the most support video scrambling function, need in IPC so video scrambling processes
The code stream exported coding chip by the form of software carries out fast transcoding, i.e. meets real-time while transcoding scrambles
Energy.
Video image is scrambled by technology now, and most straightforward approach is to use similar DES (Data Encryption
Standard) video is equally scrambled by algorithm with general text data, improves the whole efficiency of scrambling.But these are traditional
AES calculates complexity, and the data volume of video data is huge causes arithmetic speed slow.Therefore by after quantization with entropy
Before coding scrambling quantization transform coefficient and become the most studied a kind of method for scrambling, the method will not be to compression ratio
Bigger image is had, it is thus possible to obtain extraordinary cipher round results with code check.
But prior art is when scrambling quantization transform coefficient, it is all directly quantization transform coefficient to be added
Disturb.Such method for scrambling keeps the code check before and after scrambling constant, but uses software to realize in the processor CPU in IPC
Time, due to quantization transform coefficient coding and the serial of decoding, this transcoding method for scrambling cannot be carried out parallel processing, has a strong impact on
Real-time.
Summary of the invention
It is an object of the invention to provide a kind of video scrambling method and device based on quantization transform coefficient, by quantization
The sign symbol of conversion coefficient carries out scrambling to reach video scrambling effect, it is possible to avoid algorithm present in prior art multiple
Miscellaneous, that overhead is bigger defect.
To achieve these goals, technical solution of the present invention is as follows:
A kind of video scrambling method based on quantization transform coefficient, described video scrambling method includes:
According to the sign symbol of quantization transform coefficient in transform block and positional information, construct bit bit string, generate to be encrypted
Block of plaintext data;
The block of plaintext data generated is encrypted, generates the ciphertext after encryption;
Bit corresponding for non-zero quantised transform coefficient in ciphertext after encryption is converted to new sign symbol, carries out entropy
Coding.
Further, the described block of plaintext data to generating is encrypted, and uses symmetric encipherment algorithm, in plain text with ciphertext
Length is identical.
Further, described block of plaintext data is the bit bit string with regular length, described according to quantization in transform block
The sign symbol of conversion coefficient and positional information, construct bit bit string, including:
According to the sequential scan conversion set quantization transform coefficient in fast, successively by the sign symbol of quantization transform coefficient
Corresponding bit value order arrangement, constructs bit bit string;
During the bit string length deficiency regular length that quantization transform coefficient is corresponding in conversion is fast, it is filled into fixing long
Degree;
When the bit string length that quantization transform coefficient is corresponding in conversion is fast exceedes regular length, enter according to regular length
Row splits, and is split as multiple bit bit string;
Described bit corresponding to non-zero quantised transform coefficient in ciphertext after encryption is converted to new sign symbol, also
Including:
Remove bit and the bit of filling that in the ciphertext after encryption, zero valued coefficients is corresponding.
Video scrambling method of the present invention, is believing according to sign symbol and the position of quantization transform coefficient in transform block
Breath, constructs bit bit string, before generating block of plaintext data to be encrypted, also includes:
The entropy code stream received is carried out entropy decoding, obtains sign symbol and the position letter of quantization transform coefficient in transform block
Breath.
Further, described video scrambling method uses different thread parallels to process, including:
First thread carries out entropy decoding to the entropy code stream received, obtain quantization transform coefficient in transform block sign symbol and
Positional information;
Second thread, according to the sign symbol of quantization transform coefficient in transform block and positional information, constructs bit bit string, raw
Become block of plaintext data to be encrypted, to generate block of plaintext data be encrypted, generate encryption after ciphertext, will encryption after close
The bit that in literary composition, non-zero quantised transform coefficient is corresponding is converted to new sign symbol;
3rd thread carries out entropy code;
Described second thread process sequential is after first thread processes sequential, and described 3rd thread process sequential is second
After thread process sequential, described first thread and the 3rd thread share the context statistical information of same transform block.
The invention allows for a kind of video scrambling device based on quantization transform coefficient, described video scrambling device bag
Include:
Block of plaintext data generation module, for according to the sign symbol of quantization transform coefficient in transform block and positional information,
Structure bit bit string, generates block of plaintext data to be encrypted;
Encrypting module, for being encrypted the block of plaintext data generated, generates the ciphertext after encryption;
Entropy code module, for being converted to new by bit corresponding for non-zero quantised transform coefficient in the ciphertext after encryption
Sign symbol, carries out entropy code.
Further, the block of plaintext data generated is encrypted by described encrypting module, uses symmetric encipherment algorithm, in plain text
Identical with the length of ciphertext.
Further, described block of plaintext data is the bit bit string with regular length, and described block of plaintext data generates mould
Tuber is according to the sign symbol of quantization transform coefficient in transform block and positional information, during structure bit bit string, performs following operation:
According to the sequential scan conversion set quantization transform coefficient in fast, successively by the sign symbol of quantization transform coefficient
Corresponding bit value order arrangement, constructs bit bit string;
During the bit string length deficiency regular length that quantization transform coefficient is corresponding in conversion is fast, it is filled into fixing long
Degree;
When the bit string length that quantization transform coefficient is corresponding in conversion is fast exceedes regular length, enter according to regular length
Row splits, and is split as multiple bit bit string;
Bit corresponding for non-zero quantised transform coefficient in ciphertext after encryption is converted to new by described entropy code module
Sign symbol, also performs to operate as follows:
Remove bit and the bit of filling that in the ciphertext after encryption, zero valued coefficients is corresponding.
Video scrambling device of the present invention also includes:
Entropy decoder module, for the entropy code stream received carries out entropy decoding, in acquisition transform block, quantization transform coefficient is just
Minus symbol and positional information.
Further, described video scrambling device entropy decoder module, block of plaintext data generation module, encrypting module and entropy are compiled
Code module processes according to following thread parallel:
First thread carries out entropy decoding to the entropy code stream received, obtain quantization transform coefficient in transform block sign symbol and
Positional information;
Second thread, according to the sign symbol of quantization transform coefficient in transform block and positional information, constructs bit bit string, raw
Become block of plaintext data to be encrypted, to generate block of plaintext data be encrypted, generate encryption after ciphertext, will encryption after close
The bit that in literary composition, non-zero quantised transform coefficient is corresponding is converted to new sign symbol;
3rd thread carries out entropy code;
Described second thread process sequential is after first thread processes sequential, and described 3rd thread process sequential is second
After thread process sequential, described first thread and the 3rd thread share the context statistical information of same transform block.
The present invention proposes a kind of video scrambling method and device based on quantization transform coefficient, after to dct transform
The sign symbol of quantization transform coefficient scramble, the especially symbol to non-zero quantised transform coefficient uses symmetric cryptography to calculate
Method scrambles, on the premise of meeting and H.264/H.265 waiting video format compatible and do not change code check, it is achieved cell block entropy code
The high intensity of stream scrambles/descrambles transcoding, meets Information hiding (scrambling) or Information recovering (descrambling) function, simultaneously by adding
Disturb/descrambling module rationally decomposes, meet software multithread condition, create conditions for meeting real-time performance transcoding requirement, it is achieved that
Transcoding real-time.
Accompanying drawing explanation
Fig. 1 is prior art normal video image coding and decoding FB(flow block);
Fig. 2 is video image encoding and decoding FB(flow block) of the present invention;
Fig. 3 is present invention video scrambling based on quantization transform coefficient method flow diagram;
Fig. 4 a~Fig. 4 d is that the embodiment of the present invention builds block of plaintext data schematic diagram;
Fig. 5 is symbol and flag corresponding conversion schematic diagram in embodiment of the present invention scrambling processes;
Fig. 6 is another kind embodiment of the present invention scrambling and descrambling procedure FB(flow block);
Fig. 7 is parallel processing schematic diagram of the present invention;
Fig. 8 is this present invention video scrambling based on quantization transform coefficient apparatus structure schematic diagram.
Detailed description of the invention
Being described in further details technical solution of the present invention with embodiment below in conjunction with the accompanying drawings, following example are not constituted
Limitation of the invention.
As it is shown in figure 1, during normal encoding video pictures, be required for through discrete cosine transform (DCT), quantify and entropy volume
The process of code;When decoding, need through entropy decoding, inverse quantization and the process of inverse discrete cosine transform (IDCT).
To H.264 encoding, coding ultimate unit is macro block (MicroBlock), and luminance part Pixel Dimensions is 16x16.Right
H.265 encoding, coding ultimate unit is code tree unit (Coding TreeUnit), its maximum code tree unit luminance part
Pixel Dimensions is 64x64, and minimum code tree unit luminance part Pixel Dimensions is 8x8.The most H.264 transform block chi during quantization transform
Very little have two kinds, be respectively 4x4 conversion and 8x8 convert, H.265 during quantization transform transform block size have 4x4,8x8,16x16,
32x32。
To 16x16 macro block H.264, convert according to 8x8, contain 4 8x8 conversion the most altogether;Convert according to 4x4, then
Contain 16 4x4 conversion altogether.8x8 conversion has 64 quantization transform coefficient (Quantized Transform
Coefficience), 4x4 conversion has 16 quantization transform coefficients.
The coding unit (Coding Unit) forming the leaf node of H.265 Quadtree Partition, corresponds to converter unit
(Transorm Unit), the transform block in converter unit can form transform block by Quadtree Partition further, and transform block is a size of
4x4,8x8,16x16,32x32, have 16,64,128,256 conversion coefficients respectively.
For quantization transform coefficient, for convenience, in the present embodiment, also referred to as coefficient or conversion coefficient, after
Repeat no more.
The most H.264 the entropy code (CAVLC or CABAC) in, the most H.265 in entropy code (CABAC), to quantization
During conversion coefficient (Quantized Transform Coefficience) entropy code, first it is to quantify according to certain sequential scan
Conversion coefficient, then carries out entropy code, needs to encode the position of all nonzero coefficients, the absolute value of each nonzero coefficient during coding
Numerical value and sign symbol.So the syntactic element in the entropy code stream of a transform block comprises the position of all non-zero quantised transform coefficients
Put, sign symbol, absolute value.By decoding these syntactic elements, sign symbol and the position of all nonzero coefficients can be obtained
Information.
The general thought of the present invention is before the sign symbol of quantization transform coefficient is carried out entropy code, to quantization transform system
The sign symbol of number scrambles.As in figure 2 it is shown, by when encoding video pictures, through discrete cosine transform (DCT), amount
After change, the symbol of quantization transform coefficient is scrambled, be then passed through entropy code output;When decoding, advanced after entropy decodes
Row descrambling, is then passed through inverse quantization and inverse discrete cosine transform (IDCT) decodes video image.
The present embodiment, for the scrambling of the sign symbol of quantization transform coefficient, uses the CFB pattern (Cipher of standard
Feedback) AES encryption algorithm, the AES decipherment algorithm of the CFB pattern of descrambling employing standard.Other can also be used symmetrical
AES, i.e. plaintext are identical with the length of ciphertext, and plaintext and ciphertext are according to bit one to one.The present embodiment with
Illustrate as a example by the AES encryption algorithm of CFB pattern, it is also possible to use electronic codebook mode (ECB), CBC (CBC), defeated
Go out to feed back the AES encryption algorithm of (OFB) pattern, or other symmetric encipherment algorithms such as ROT13 etc..
AES encryption algorithm uses key key encryption to block of plaintext data Xi, obtains encrypted data chunk Yi.To adding during deciphering
Ciphertext data block Yi uses the deciphering of key key, is restored back to block of plaintext data, repeats no more here for AES deciphering and decipherment algorithm.
As it is shown on figure 3, a kind of video scrambling method based on quantization transform coefficient of the present embodiment, comprise the steps:
Step S1, according to the sign symbol of quantization transform coefficient in transform block and positional information, construct bit bit string, generate
Block of plaintext data to be encrypted.
The present embodiment, in order to use AES enciphering and deciphering algorithm to scramble quantization transform coefficient, keeps code check constant simultaneously,
Need to construct block of plaintext data.When constructing block of plaintext data, according to sign symbol and the positional information of quantization transform coefficient, press
According to flag and sign symbol transformational relation, sign symbol is changed into corresponding flag.
The present embodiment lists two kinds of flags and sign symbol transformational relation, it is achieved sign symbol turns with flag
Change, be respectively described as follows:
The first rule: to quantization transform coefficient, represent that this nonzero coefficient, for " just ", represents with bit " 0 " with bit " 1 "
This nonzero coefficient is " bearing ", and zero value transform bit " 0 " identifies.Conversion is skipped the coefficient of (not having shift step), entirely
Portion uses " 0 " labelling.
The second rule: to quantization transform coefficient, represent this nonzero coefficient with bit " 1 ", goes back no matter its symbol is " just "
It is for " bearing ", zero value transform bit " 0 " mark.The coefficient skipping conversion, all uses " 0 " labelling.
According to aes algorithm, clear data block length must be 128 bits.The present embodiment becomes according to the sequential scan set
Quantization transform coefficient in changing soon, successively by bit value order arrangement corresponding for the sign symbol of quantization transform coefficient, structure ratio
Special bit string.Describe sign symbol and the positional information of coefficient in foundation quantization transform block below by way of concrete example, generate long
Degree is the block of plaintext data to be encrypted of 128 bits:
As shown in fig. 4 a, the transform block to a 4x4, obtain according to after the DTC scanning sequency scanning H.264/H.265 specified
To one-dimensional quantization variation coefficient, have 16 coefficients, the nonzero coefficient mark double byte of the present embodiment one 16 bit of design,
As Fig. 4 b, DC coefficient symbols flag is placed on highest significant position MSB, the like, the AC coefficient symbols flag that frequency is the highest
It is placed on least significant bit LSB.Such as Fig. 4 c, the transform block to a 8x8, it is divided into 2x2 4x4 transform block, the QTC scanning of 4x4 block
Order is assumed as shown in fig. 4c, then the flag of the nonzero coefficient of this 2x2 4x4 transform block is as shown in figure 4d, each 4x4 block
The nonzero coefficient of coefficient identifies according to the mode such as Fig. 4 b, then in the scanning sequency according to Fig. 4 c, first puts first 4x4 and becomes
Change the flag of block, then put the flag of second 4x4 transform block, the like.
In like manner, to 16x16 transform block, 32x32 transform block, it is first according to H.264/H.265 regulation scanning sequency scanning and becomes
Changing block, then bottom 4*4 conversion coefficient is scanned two-dimensional coefficient matrix one-dimensional, the coefficient of each scan position uses one
Bit identifies this coefficient symbols being, thus obtains the coefficient symbols labelling bit string of each encoding block, repeats no more here.
A length of 128 bits of block of plaintext data Xi in aes algorithm, to a 4x4 transform block, the coefficient obtained after conversion is
It mostly is 16.To a 8x8 block, the coefficient obtained after conversion is up to 64.To a 16x16 block, obtain after conversion is
Number up to 256, needs to be divided into 2 block of plaintext data.To 32x32 block, conversion obtains coefficient and is up to 1024, needs to divide
It is 8 block of plaintext data.
During the bit string length deficiency regular length that i.e. quantization transform coefficient is corresponding in conversion is fast, it is filled into fixing long
Degree;The bit that quantization transform coefficient is corresponding in conversion is fast wears length when exceeding regular length, splits according to regular length,
It is split as multiple bit bit string.
H.264 with macro block as coding units, luminance block a size of 16x16, chrominance block is two 16x16 (4:4:4), or two
Individual 16x8 (4:2:2), or two 8x8 (4:2:0).
H.265 it is coding unit for maximum code tree unit, its brightness a size of 8x8,16x16,32x32,64x64, color
Degree block is two 8x8,16x16,32x32,64x64 (4:4:4), or two 8x4,16x8,32x16,64x32 (4:2:2), or
4x4、8x8、16x16、32x32(4:2:0)。
The when of using aes algorithm to form block of plaintext data, according to the order of chrominance block after first luminance block coefficient symbols
Flag conspires to create Bit String, less than filling bit " 0 " after 128 bits.One or more coding unit coefficient symbols identify
Bit string forms Bit String together.
Step S2, to generate block of plaintext data be encrypted, generate encryption after ciphertext.
The present embodiment, for the scrambling of the sign symbol of quantization transform coefficient, uses the CFB pattern (Cipher of standard
Feedback) AES encryption algorithm, the AES decipherment algorithm of the CFB pattern of descrambling employing standard.AES encryption algorithm is to plaintext number
Use key key encryption according to block Xi, obtain encrypted data chunk Yi.During deciphering, encrypted data chunk Yi is used the deciphering of key key, extensive
Return block of plaintext data again.
Step S3, bit corresponding to non-zero quantised transform coefficient in the ciphertext after encryption is converted to new positive and negative symbol
Number, carry out entropy code.
As it is shown in figure 5, as a example by 8 quantization transform coefficients (actual should add to 128), in step sl according to setting
Fixed rule is transformed into block of plaintext data Xi, and concrete transformational rule is symbol " just " corresponding bit value " 1 ", and it is right that symbol " is born "
Should ratio feature " 0 ", bit value corresponding to zero valued coefficients is " 0 ", i.e. converts according to the first rule, obtains 10101000, should
Block of plaintext data is a string bit.Being encrypted the most in step s 2, generating ciphertext Yi is 01011101.
In this step, for the ciphertext after encryption, zero valued coefficients pair is removed according to the positional information of quantization transform coefficient
The bit answered and the bit of filling, i.e. remove last two (residues 010111), the ratio corresponding to remaining nonzero coefficient
Special position resolves the positive negativity of its symbol according to the rule (the i.e. first rule) set before AES encryption, obtains needing to carry out entropy code
The corresponding new sign symbol of nonzero coefficient is " negative and positive negative and positive is the most just ", then uses new sign symbol to carry out entropy code.
So far, the scrambling for quantization transform coefficient is completed.Corresponding, in decoding end, then flow process is contrary, first carries out
Entropy decodes, then according to decoded for entropy sign symbol is transformed to ciphertext Yi, is decrypted subsequently, switches back to original positive and negative
Symbol.Concrete implementation process is contrary with scrambling processes, repeats no more here.
It should be noted that the present embodiment is introduced as a example by H.264/H.265, but the program is not limited only to
H.264/H.265, the videos such as MPEG-2 video, MPEG-1 video, or Future Video Coding in the future it are also applied for
Encoding and decoding standard.
The most above-mentioned block of plaintext data Xi is in the case of colorimetric plane resolution is less than luminance plane resolution, such as
4:2:0 chroma format, the most only luminance component, do not have the 4:0:0 gray level image of chromatic component.So above-mentioned plaintext
Xi can comprise luminance component block and corresponding chromatic component block, it is also possible to only comprises luminance component block, does not comprise chromatic component
Block, a reason is that chromatic component block resolution is low, it is not necessary to scramble chromatic component;Another is original is possible some figure
As not having chromatic component part.
Owing to not possessing video scrambling function current video encoder (such as IPC), video decoding apparatus (as
NVR) the most not there is video descrambling function.I.e. coding and decoding video ASIC in coding/decoding apparatus does not have hardware scrambling and descrambling merit
Energy.Add scrambling or descrambling function needs to use software to realize, therefore at coding side, it usually needs first to normal without scrambling situation
Entropy code stream after lower entropy code is decoded, and uses the video scrambling method based on quantization transform coefficient of the present embodiment the most again
Scramble.Corresponding, for decoding end, need first to carry out entropy decoding, then descramble, then formed normal after entropy code
Entropy code stream, is decoded by decoding end equipment.Visible, it is only necessary on existing video equipment, to carry out software upgrading, so that it may to realize
The technical scheme that the present embodiment is illustrated, completely compatible existing video equipment.
As shown in Figure 6, the nothing scrambling entropy code stream of existing video encoder output, it is necessary first to decode through entropy, obtain
The quantization transform coefficient of Current Transform block, the positional information i.e. obtaining all nonzero coefficients (decodes entropy code stream and i.e. obtains all non-
The mapping table of zero coefficient, nonzero coefficient absolute value numerical value, nonzero coefficient symbol), then change with sign symbol according to flag
Relation, identifies the corresponding flag of Current Transform block nonzero coefficient, generates block of plaintext data;According to transform block size not
With, { Xi, Xi+1} use AES encryption and encrypted ones key to generate the corresponding one or more block of plaintext data of current data block
Obtain corresponding ciphertext block data { Yi, Yi+1};Ciphertext is resolved with sign symbol transformational relation finally according to original flag
The symbol of the nonzero coefficient in data block, rejects zero valued coefficients position symbol and the position symbol of filling, to nonzero coefficient simultaneously
Symbol carries out entropy code.
When entropy code stream after scrambling is descrambled, first decode the quantization transform coefficient of Current Transform block, obtain all non-zeros
(decoding scrambling entropy code stream just has been known for the mapping table of all nonzero coefficients, nonzero coefficient absolute value to the positional information of coefficient
Numerical value, nonzero coefficient symbol), the flag of current block nonzero coefficient is identified according to flag and sign symbol transformational relation,
Generate one or more ciphertext block data { Yi, Yi+1} that Current Transform block is corresponding;Use AES deciphering and the password of correspondence
Key deciphering obtains corresponding block of plaintext data { Xi, Xi+1};Finally according to original flag and sign symbol transformational relation solution
Nonzero coefficient position symbol in analysis block of plaintext data, carries out entropy code again to nonzero coefficient symbol.
It is easily understood that employing said method, first to decode through entropy when scrambling/descrambling, be then passed through scrambling/solution
Disturb, then carry out again the process of entropy code.Therefore for the transformation of existing video equipment, multi-threading parallel process can be passed through,
As it is shown in fig. 7, three threads can be set up:
Thread 1 for transform block entropy code stream decoding (decode all nonzero coefficient positions, all nonzero coefficient absolute values,
All nonzero coefficient symbols);
Thread 2 uses aes algorithm for the scrambling/descrambling of transform block nonzero coefficient symbol logo position;
The thread 3 coefficient entropy code again after transform block nonzero coefficient symbol scrambles (encodes all nonzero coefficient positions
Put, all nonzero coefficient absolute values, all nonzero coefficient symbols of having scrambled).
The sequential that the present embodiment thread 1,2,3 processes is different, completes the entropy code stream to transform block 1 (being called for short block 1) at thread 1
After decoding, thread 2 just starts to process the scrambling/descrambling of the nonzero coefficient symbol logo position of block 1, in like manner processes block 1 at thread 2
After completing, thread 3 just starts to process the entropy code process again of block 1.
It is easily understood that when entropy code and entropy code stream decoding, the context statistical information of same transform block is permissible
Share, context statistical information, the most based on context obtain symbol probability table, along with the appearance of symbol, each in probability tables
The probability of symbol can change.In time sequencing, the entropy code of the block 1 of thread 3 is inherently disposed at entropy code stream decoding
Rear startup, meets and shares sequential condition.
When it should be noted that decoding, the quantization transform coefficient of the technical program can directly obtain after quantifying conversion
, it is also possible to it is decoded obtaining from the entropy code stream of prior art;And when decoding, for the video equipment of prior art,
After descrambling, in addition it is also necessary to re-start entropy code and process.Therefore the compatible existing video equipment of the technical program, simultaneously can
Carry out parallel process, create conditions for meeting real-time performance transcoding requirement.
As shown in Figure 8, corresponding to a kind of based on quantization transform coefficient the video scrambling device of said method, including:
Block of plaintext data generation module, for according to the sign symbol of quantization transform coefficient in transform block and positional information,
Structure bit bit string, generates block of plaintext data to be encrypted;
Encrypting module, for being encrypted the block of plaintext data generated, generates the ciphertext after encryption;
Entropy code module, for being converted to new by bit corresponding for non-zero quantised transform coefficient in the ciphertext after encryption
Sign symbol, carries out entropy code.
Corresponding with said method, in the device of the present embodiment, the block of plaintext data generated is encrypted by encrypting module,
Use symmetric encipherment algorithm, the most identical with the length of ciphertext.
Block of plaintext data is the bit bit string with regular length, and block of plaintext data generation module quantifies according in transform block
The sign symbol of conversion coefficient and positional information, during structure bit bit string, perform to operate as follows:
According to the sequential scan conversion set quantization transform coefficient in fast, successively by the sign symbol of quantization transform coefficient
Corresponding bit value order arrangement, constructs bit bit string;
During the bit string length deficiency regular length that quantization transform coefficient is corresponding in conversion is fast, it is filled into fixing long
Degree;
When the bit string length that quantization transform coefficient is corresponding in conversion is fast exceedes regular length, enter according to regular length
Row splits, and is split as multiple bit bit string;
Bit corresponding for non-zero quantised transform coefficient in ciphertext after encryption is converted to by the present embodiment entropy code module
New sign symbol, also performs to operate as follows:
Remove bit and the bit of filling that in the ciphertext after encryption, zero valued coefficients is corresponding.
For compatible existing equipment, the present embodiment video scrambling device also includes:
Entropy decoder module, for the entropy code stream received carries out entropy decoding, in acquisition transform block, quantization transform coefficient is just
Minus symbol and positional information.
Further, video scrambling device entropy decoder module, block of plaintext data generation module, encrypting module and entropy code module are pressed
Process according to following thread parallel:
First thread carries out entropy decoding to the entropy code stream received, obtain quantization transform coefficient in transform block sign symbol and
Positional information;
Second thread, according to the sign symbol of quantization transform coefficient in transform block and positional information, constructs bit bit string, raw
Become block of plaintext data to be encrypted, to generate block of plaintext data be encrypted, generate encryption after ciphertext, will encryption after close
The bit that in literary composition, non-zero quantised transform coefficient is corresponding is converted to new sign symbol;
3rd thread carries out entropy code;
Wherein, the second thread process sequential is after first thread processes sequential, and the 3rd thread process sequential is at the second line
After journey processes sequential, first thread and the 3rd thread share the context statistical information of same transform block.
It should be noted that the video scrambling device of the present embodiment is applied in headend equipment IPC, or video flowing coding sets
In Bei.Corresponding, in decoding device, such as DVR NVR, there is the video descrambler of correspondence, for scrambling
After video flowing descramble, the process of descrambling has been described above in about the description of method for scrambling, repeats no more here.
Above example is only limited in order to technical scheme to be described, without departing substantially from present invention essence
In the case of god and essence thereof, those of ordinary skill in the art are when making various corresponding change and change according to the present invention
Shape, but these change accordingly and deform the protection domain that all should belong to appended claims of the invention.
Claims (10)
1. a video scrambling method based on quantization transform coefficient, it is characterised in that described video scrambling method includes:
According to the sign symbol of quantization transform coefficient in transform block and positional information, construct bit bit string, generate to be encrypted bright
Literary composition data block;
The block of plaintext data generated is encrypted, generates the ciphertext after encryption;
Bit corresponding for non-zero quantised transform coefficient in ciphertext after encryption is converted to new sign symbol, carries out entropy volume
Code.
Video scrambling method based on quantization transform coefficient the most according to claim 1, it is characterised in that described to generation
Block of plaintext data be encrypted, use symmetric encipherment algorithm, in plain text the most identical with the length of ciphertext.
Video scrambling method based on quantization transform coefficient the most according to claim 2, it is characterised in that described plaintext number
It is the bit bit string with regular length according to block, described according to the sign symbol of quantization transform coefficient in transform block and position letter
Breath, constructs bit bit string, including:
According to the sequential scan conversion set quantization transform coefficient in fast, successively that the sign symbol of quantization transform coefficient is corresponding
Bit value order arrangement, construct bit bit string;
During the bit string length deficiency regular length that quantization transform coefficient is corresponding in conversion is fast, it is filled into regular length;
When the bit string length that quantization transform coefficient is corresponding in conversion is fast exceedes regular length, tear open according to regular length
Point, it is split as multiple bit bit string;
Described bit corresponding to non-zero quantised transform coefficient in ciphertext after encryption is converted to new sign symbol, also wraps
Include:
Remove bit and the bit of filling that in the ciphertext after encryption, zero valued coefficients is corresponding.
Video scrambling method based on quantization transform coefficient the most according to claim 1, it is characterised in that described video adds
Disturb method, according to the sign symbol of quantization transform coefficient in transform block and positional information, construct bit bit string, generate to be encrypted
Block of plaintext data before, also include:
The entropy code stream received is carried out entropy decoding, obtains sign symbol and the positional information of quantization transform coefficient in transform block.
Video scrambling method based on quantization transform coefficient the most according to claim 4, it is characterised in that described video adds
Method of disturbing uses different thread parallels to process, including:
First thread carries out entropy decoding to the entropy code stream received, and obtains sign symbol and the position of quantization transform coefficient in transform block
Information;
Second thread, according to the sign symbol of quantization transform coefficient in transform block and positional information, constructs bit bit string, and generation is treated
The block of plaintext data of encryption, is encrypted the block of plaintext data generated, and generates the ciphertext after encryption, by the ciphertext after encryption
The bit that non-zero quantised transform coefficient is corresponding is converted to new sign symbol;
3rd thread carries out entropy code;
Described second thread process sequential is after first thread processes sequential, and described 3rd thread process sequential is at the second thread
After processing sequential, described first thread and the 3rd thread share the context statistical information of same transform block.
6. a video scrambling device based on quantization transform coefficient, it is characterised in that described video scrambling device includes:
Block of plaintext data generation module, for according to the sign symbol of quantization transform coefficient in transform block and positional information, structure
Bit bit string, generates block of plaintext data to be encrypted;
Encrypting module, for being encrypted the block of plaintext data generated, generates the ciphertext after encryption;
Entropy code module, new positive and negative for bit corresponding to non-zero quantised transform coefficient in the ciphertext after encryption is converted to
Symbol, carries out entropy code.
Video scrambling device based on quantization transform coefficient the most according to claim 6, it is characterised in that described encryption mould
The block of plaintext data generated is encrypted by block, uses symmetric encipherment algorithm, the most identical with the length of ciphertext.
Video scrambling device based on quantization transform coefficient the most according to claim 7, it is characterised in that described plaintext number
Being the bit bit string with regular length according to block, described block of plaintext data generation module is according to quantization transform coefficient in transform block
Sign symbol and positional information, during structure bit bit string, perform to operate as follows:
According to the sequential scan conversion set quantization transform coefficient in fast, successively that the sign symbol of quantization transform coefficient is corresponding
Bit value order arrangement, construct bit bit string;
During the bit string length deficiency regular length that quantization transform coefficient is corresponding in conversion is fast, it is filled into regular length;
When the bit string length that quantization transform coefficient is corresponding in conversion is fast exceedes regular length, tear open according to regular length
Point, it is split as multiple bit bit string;
Bit corresponding to non-zero quantised transform coefficient in ciphertext after encryption is converted to new positive and negative by described entropy code module
Symbol, also performs to operate as follows:
Remove bit and the bit of filling that in the ciphertext after encryption, zero valued coefficients is corresponding.
Video scrambling device based on quantization transform coefficient the most according to claim 6, it is characterised in that described video adds
Disturb device also to include:
Entropy decoder module, for the entropy code stream received carries out entropy decoding, obtains the positive and negative symbol of quantization transform coefficient in transform block
Number and positional information.
Video scrambling device based on quantization transform coefficient the most according to claim 9, it is characterised in that described video
Scrambling apparatus entropy decoder module, block of plaintext data generation module, encrypting module and entropy code module according to following thread parallel at
Reason:
First thread carries out entropy decoding to the entropy code stream received, and obtains sign symbol and the position of quantization transform coefficient in transform block
Information;
Second thread, according to the sign symbol of quantization transform coefficient in transform block and positional information, constructs bit bit string, and generation is treated
The block of plaintext data of encryption, is encrypted the block of plaintext data generated, and generates the ciphertext after encryption, by the ciphertext after encryption
The bit that non-zero quantised transform coefficient is corresponding is converted to new sign symbol;
3rd thread carries out entropy code;
Described second thread process sequential is after first thread processes sequential, and described 3rd thread process sequential is at the second thread
After processing sequential, described first thread and the 3rd thread share the context statistical information of same transform block.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610871985.4A CN106231318B (en) | 2016-09-30 | 2016-09-30 | Video scrambling method and device based on quantized transform coefficients |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610871985.4A CN106231318B (en) | 2016-09-30 | 2016-09-30 | Video scrambling method and device based on quantized transform coefficients |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106231318A true CN106231318A (en) | 2016-12-14 |
CN106231318B CN106231318B (en) | 2020-04-28 |
Family
ID=58076841
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610871985.4A Active CN106231318B (en) | 2016-09-30 | 2016-09-30 | Video scrambling method and device based on quantized transform coefficients |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106231318B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108366259A (en) * | 2018-01-15 | 2018-08-03 | 华南理工大学 | A kind of reversible steganography method of three coefficient of H.264/AVC video of high-fidelity |
CN112003859A (en) * | 2020-08-21 | 2020-11-27 | 江苏徐工工程机械研究院有限公司 | Data encryption method and device and data decryption method and device |
CN112565779A (en) * | 2020-12-12 | 2021-03-26 | 四川大学 | Video steganography method based on distortion drift |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060265689A1 (en) * | 2002-12-24 | 2006-11-23 | Eugene Kuznetsov | Methods and apparatus for processing markup language messages in a network |
US20100195769A1 (en) * | 2005-06-30 | 2010-08-05 | Nokia Corporation | Method And Apparatus For Generating M-ary CPM Waveforms From A Superposition Of PAM Waveforms |
WO2012172114A1 (en) * | 2011-06-16 | 2012-12-20 | Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. | Context initialization in entropy coding |
CN102905133A (en) * | 2012-10-15 | 2013-01-30 | 南京邮电大学 | Video stream-oriented hybrid encoding and encrypting method |
US20130114732A1 (en) * | 2011-11-07 | 2013-05-09 | Vid Scale, Inc. | Video and data processing using even-odd integer transforms |
CN103141101A (en) * | 2010-09-30 | 2013-06-05 | 富士通株式会社 | Motion-video encoding apparatus, motion-video encoding method, motion-video encoding computer program, motion-video decoding apparatus, motion-video decoding method, and motion-video decoding computer program |
CN103428495A (en) * | 2013-08-02 | 2013-12-04 | 中国联合网络通信集团有限公司 | Image encryption method and device and image decryption method and device |
CN103856786A (en) * | 2012-12-04 | 2014-06-11 | 中山大学深圳研究院 | Streaming media video encryption method and device based on H.264 |
CN104038761A (en) * | 2014-06-05 | 2014-09-10 | 宁波工程学院 | Encrypted domain H.264/AVC video data hiding method based on CABAC binary string mapping |
CN104093018A (en) * | 2011-03-10 | 2014-10-08 | 华为技术有限公司 | Coding method and device of transformation coefficients and decoding method and device of transformation coefficients |
CN104247422A (en) * | 2011-11-07 | 2014-12-24 | 华为技术有限公司 | Angular Table for Improving Intra Prediction |
-
2016
- 2016-09-30 CN CN201610871985.4A patent/CN106231318B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060265689A1 (en) * | 2002-12-24 | 2006-11-23 | Eugene Kuznetsov | Methods and apparatus for processing markup language messages in a network |
US20100195769A1 (en) * | 2005-06-30 | 2010-08-05 | Nokia Corporation | Method And Apparatus For Generating M-ary CPM Waveforms From A Superposition Of PAM Waveforms |
CN103141101A (en) * | 2010-09-30 | 2013-06-05 | 富士通株式会社 | Motion-video encoding apparatus, motion-video encoding method, motion-video encoding computer program, motion-video decoding apparatus, motion-video decoding method, and motion-video decoding computer program |
CN104093018A (en) * | 2011-03-10 | 2014-10-08 | 华为技术有限公司 | Coding method and device of transformation coefficients and decoding method and device of transformation coefficients |
WO2012172114A1 (en) * | 2011-06-16 | 2012-12-20 | Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. | Context initialization in entropy coding |
CN103733622A (en) * | 2011-06-16 | 2014-04-16 | 弗劳恩霍夫应用研究促进协会 | Context initialization in entropy coding |
US20130114732A1 (en) * | 2011-11-07 | 2013-05-09 | Vid Scale, Inc. | Video and data processing using even-odd integer transforms |
CN104247422A (en) * | 2011-11-07 | 2014-12-24 | 华为技术有限公司 | Angular Table for Improving Intra Prediction |
CN102905133A (en) * | 2012-10-15 | 2013-01-30 | 南京邮电大学 | Video stream-oriented hybrid encoding and encrypting method |
CN103856786A (en) * | 2012-12-04 | 2014-06-11 | 中山大学深圳研究院 | Streaming media video encryption method and device based on H.264 |
CN103428495A (en) * | 2013-08-02 | 2013-12-04 | 中国联合网络通信集团有限公司 | Image encryption method and device and image decryption method and device |
CN104038761A (en) * | 2014-06-05 | 2014-09-10 | 宁波工程学院 | Encrypted domain H.264/AVC video data hiding method based on CABAC binary string mapping |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108366259A (en) * | 2018-01-15 | 2018-08-03 | 华南理工大学 | A kind of reversible steganography method of three coefficient of H.264/AVC video of high-fidelity |
CN112003859A (en) * | 2020-08-21 | 2020-11-27 | 江苏徐工工程机械研究院有限公司 | Data encryption method and device and data decryption method and device |
CN112565779A (en) * | 2020-12-12 | 2021-03-26 | 四川大学 | Video steganography method based on distortion drift |
CN112565779B (en) * | 2020-12-12 | 2021-10-29 | 四川大学 | Video steganography method based on distortion drift |
Also Published As
Publication number | Publication date |
---|---|
CN106231318B (en) | 2020-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Li et al. | On the design of perceptual MPEG-video encryption algorithms | |
Shahid et al. | Visual protection of HEVC video by selective encryption of CABAC binstrings | |
Shahid et al. | Fast protection of H. 264/AVC by selective encryption of CAVLC and CABAC for I and P frames | |
CN1893350B (en) | Method and device for encryption and decryption of digital data | |
Lian et al. | Secure advanced video coding based on selective encryption algorithms | |
US8503671B2 (en) | Method and apparatus for using counter-mode encryption to protect image data in frame buffer of a video compression system | |
Lian et al. | A novel image encryption scheme based-on JPEG encoding | |
CN1852443B (en) | Data processing device | |
CN1992879A (en) | Coding/decoding method and system for scalable video bitstream | |
Liu | Efficient selective encryption for JPEG 2000 images using private initial table | |
Xu et al. | Efficient reversible data hiding in encrypted H. 264/AVC videos | |
Lian et al. | Efficient video encryption scheme based on advanced video coding | |
CN106231318A (en) | A kind of video scrambling method and device based on quantization transform coefficient | |
Asghar et al. | Sufficient encryption based on entropy coding syntax elements of H. 264/SVC | |
Raju et al. | Fast and secure real-time video encryption | |
Dolati et al. | A selective encryption for H. 264/AVC videos based on scrambling | |
CN111372083B (en) | SHVC video encryption method based on interlayer processing | |
Xu et al. | Reversible data hiding in encrypted H. 264/AVC video streams | |
Song et al. | Efficient protection using chaos for context-adaptive binary arithmetic coding in H. 264/advanced video coding | |
Lian et al. | A fast video encryption scheme based-on chaos | |
CN104301727B (en) | Quality controllable H.264 video-aware AES based on CABAC | |
Saleh et al. | Moving objects encryption of high efficiency video coding (HEVC) using AES algorithm | |
Hooda et al. | A comprehensive survey of video encryption algorithms | |
Zhang et al. | Fast HEVC selective encryption scheme based on improved CABAC coding algorithm | |
Li et al. | Layered encryption for scalable video coding |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 |