CN106303525B - Double MPEG-4 compression detection method based on block effect measurement - Google Patents

Double MPEG-4 compression detection method based on block effect measurement Download PDF

Info

Publication number
CN106303525B
CN106303525B CN201610682055.4A CN201610682055A CN106303525B CN 106303525 B CN106303525 B CN 106303525B CN 201610682055 A CN201610682055 A CN 201610682055A CN 106303525 B CN106303525 B CN 106303525B
Authority
CN
China
Prior art keywords
block
frame
decompressed
value
decompressed 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.)
Active
Application number
CN201610682055.4A
Other languages
Chinese (zh)
Other versions
CN106303525A (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.)
Shanghai Jiaotong University
Original Assignee
Shanghai Jiaotong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jiaotong University filed Critical Shanghai Jiaotong University
Priority to CN201610682055.4A priority Critical patent/CN106303525B/en
Publication of CN106303525A publication Critical patent/CN106303525A/en
Application granted granted Critical
Publication of CN106303525B publication Critical patent/CN106303525B/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/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/103Selection of coding mode or of prediction mode
    • H04N19/114Adapting the group of pictures [GOP] structure, e.g. number of B-frames between two anchor frames
    • 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/117Filters, e.g. for pre-processing or post-processing
    • 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/169Methods 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/17Methods 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 an image region, e.g. an object
    • H04N19/176Methods 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 an image region, e.g. an object the region being a block, e.g. a macroblock
    • 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/169Methods 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/186Methods 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 colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides a double MPEG-4 compression detection method based on blocking effect measurement, which comprises the following steps: the input video is first decompressed into a sequence of frames, and the luminance component of each frame is extracted along with the macroblock coding information. The luminance component of each frame is adaptively deblock filtered. The cumulative sum of the absolute values of the differences between the filtered luminance component and the original luminance component is calculated as the measure of blockiness for each frame. And enhancing the block effect measurement by using the macroblock change abnormal mode to obtain a characteristic sequence. Finally, the characteristic sequence is periodically analyzed to judge whether the input video has undergone double MPEG-4 compression and to estimate the GOP size used for the first compression. The method can effectively utilize the abnormal block effect which periodically appears in the double MPEG-4 compressed video, so that the detection method has stronger robustness and wider application range. Compared with the traditional detection method, the method has more reliable detection effect on the motion video with complex texture.

Description

Double MPEG-4 compression detection method based on block effect measurement
Technical Field
The invention relates to the technical field of video double compression detection, in particular to a double MPEG-4 compression detection method based on block effect measurement.
Background
With the continuous development of multimedia storage technology and transmission technology, multimedia has become an important information transmission carrier and means, and is widely used in the fields of security, judicial expertise, education, medical treatment and the like. However, more and more video editing software with low cost and powerful functions can be easily obtained, and a falsifier can delete and falsifie video contents without professional knowledge. Therefore, it is necessary to verify the integrity as well as the authenticity of the video content. In addition, the codec based on the MPEG-4 standard has been widely applied to monitoring systems and network transmission, and video evidence obtaining technology for MPEG-4 is urgently needed to be proposed.
Since video tampering operation often needs to be performed after decompressing the original video into a frame sequence, the tampered frame sequence needs to be re-encoded into a video format. Accordingly, the tampered video typically undergoes a double compression process. Double compression detection becomes an important video passive evidence obtaining means. Furthermore, when the original video GOP structure is not considered by a tamperer, performing video double compression introduces a different GOP structure. The GOP structures of the first compression and the second compression are staggered, and abnormal compression frames are generated periodically. Such abnormally compressed frames undergo intra-coding in a first compression and inter-coding in a second compression, with the characteristic of abnormal blockiness that can be used for dual compression detection. In addition, the interval between two adjacent abnormally compressed frames is exactly equal to the GOP length used for the first compression.
Is retrieved by
Application No.: CN201510214826.2, a patent document entitled "video same bit rate dual compression detection method", proposes a video same bit rate dual compression detection method based on DCT coefficient distributions of different modes. The two defects of the technical scheme are as follows: only double compression at the same bit rate can be detected; the dual compression is required to use the same GOP structure.
Application No.: CN201410728786.9, a patent document entitled "a double-compression video tampering detection method based on blocking artifacts", proposes a recompression detection method using a re-encoded blocking artifact characteristic curve. The two defects of the technical scheme are as follows: dual coding is required to use the same GOP structure; the detection method requires multiple times of video compression, resulting in low computational efficiency.
Aiming at the defects of the patent, the invention provides a double-compression detection scheme with stronger detection robustness and higher operation efficiency.
Disclosure of Invention
In view of the shortcomings in the prior art, it is an object of the present invention to provide a dual MPEG-4 compression detection method based on a blocking effect metric.
The double MPEG-4 compression detection method based on the block effect measurement provided by the invention comprises the following steps:
step 1: extracting a video stream from an input video file, decompressing the video stream into pictures to obtain a plurality of decompressed frames, and extracting coding information contained in each decompressed frame;
step 2: filtering the luminance component of the decompressed frame by using a self-adaptive deblocking filter;
and step 3: calculating the block effect measurement of each frame through the filtered brightness component and the original brightness component to obtain a block effect measurement sequence of the input video;
and 4, step 4: enhancing the block effect measurement sequence through the macroblock change abnormal mode information to obtain a characteristic sequence;
and 5: and carrying out periodic analysis on the characteristic sequence to obtain a detection result, and estimating the GOP length used for the first compression.
Preferably, the step 1 comprises:
step 1.1: decompressing the video stream into picture for storage, recording each decompressed frame as DkK is 1, 2.. times.k, where K is the number of frames included in the input video, and the resolution of the decompressed frame is denoted as mxn;
step 1.2: counting the number of intra-frame coding macro blocks and the number of skip coding macro blocks contained in each frame, and respectively recording the number as i (k) and s (k);
step 1.3: the quantization factor value of each macroblock of each frame is extracted.
Preferably, the step 2 includes:
step 2.1: converting the decompressed frame into a color space, namely converting an RGB color space into a YCbCr color space, and extracting a brightness component; wherein: luminance component Y of the kth decompressed framekThe extraction formula of (a) is as follows:
Yk=0.299Rk+0.587Gk+0.114Bk
in the formula: rkFor the R channel component of the kth decompressed frame, GkFor the G channel component of the kth decompressed frame, BkDecompressing the B channel component of the frame for the kth;
step 2.2: decompressing the luminance component Y of the k-th framekDivision into non-overlapping 8 x 8 blocks, noted
Figure BDF0000009307170000021
A luminance block representing a k-th decompressed frame with a line index of i and a column index of j;
Figure BDF0000009307170000031
Figure BDF0000009307170000032
representing a rounding operation; each brightness block
Figure BDF0000009307170000033
Contains 64 elements, the coordinate of the luminance component of the upper left corner of the luminance block is (8 × i +1,8 × j + 1);
step 2.3: for each decompressed frame, the DCT coefficients for each 8 x 8 block are computed, denoted as
Figure BDF0000009307170000034
Wherein:
Figure BDF00000093071700000312
the DCT coefficient of the v column of the u row corresponding to the 8 x 8 brightness block with the row and column index (i, j) in the k decompressed frame;
step 2.4: the following is performed for each 8 × 8 block in turn:
for DCT coefficient value
Figure BDF0000009307170000036
Performing nearest rounding operation to obtain
Figure BDF0000009307170000037
Specifically, the method comprises the following steps:
if it is
Figure BDF0000009307170000038
If only the DC component is non-zero, setting the horizontal blocking effect flag HBS and the vertical blocking effect flag VBS of the 8 × 8 block to 1;
if it is
Figure BDF0000009307170000039
Only the topmost row hasSetting the VBS of the 8 multiplied by 8 block to be 1 and setting the HBS to be 0 if the DCT coefficient is not zero;
if it is
Figure BDF00000093071700000310
Setting the HBS of the 8 x 8 block to be 1 and the VBS to be 0 if only the leftmost column has the non-zero DCT coefficient;
otherwise, both HBS and VBS are set to 0;
step 2.5: the following is performed for each 8 × 8 block in turn:
detecting the HBS value of an 8 × 8 block horizontally adjacent to the right side of the 8 × 8 block, and if both HBS values are 1, filtering pixels near the boundary of the two 8 × 8 blocks by using a 7-tap low-pass filter;
detecting an 8 x 8 block vertically adjacent to the lower side of the 8 x 8 block, and if the VBS values of the 8 x 8 block and the 8 x 8 block are both 1, filtering pixels near the boundary of the two 8 x 8 blocks by using a 7-tap low-pass filter, wherein the specific form of the 7-tap low-pass filter is that
Figure BDF00000093071700000311
Step 2.6: the following is done for each 8 x 8 block in turn:
if the 8 × 8 block and the 8 × 8 block horizontally adjacent to the right side of the 8 × 8 block do not satisfy the condition that the HBS values are all 1, calculating an absolute value of a difference between adjacent pixel values at the boundary of the 8 × 8 block; if the absolute value is less than twice the quantization factor value of the macroblock to which the 8 × 8 block belongs, filtering pixels near the 8 × 8 block boundary to which the 8 × 8 block horizontally neighbors on the right side of the 8 × 8 block by using a 3-tap low-pass filter, otherwise, not filtering;
if the 8 × 8 block vertically adjacent to the lower side of the 8 × 8 block does not satisfy the condition that the VBS values are all 1, calculating an absolute value of a difference between adjacent pixel values at a boundary of the 8 × 8 block, and if the absolute value is less than twice of a quantization factor value of a macroblock to which the 8 × 8 block belongs, filtering pixels near the boundary of the 8 × 8 block vertically adjacent to the lower side of the 8 × 8 block by using a 3-tap low-pass filter, otherwise, not filtering; the 3-tap low-pass filter is in a specific form
Figure BDF0000009307170000041
Step 2.7: obtaining each frame of filtered brightness component through the adaptive deblocking filtering operation from step 2.2 to step 2.6
Figure BDF0000009307170000042
Preferably, the step 3 comprises:
step 3.1: calculating the absolute difference between the luminance component of each decompressed frame and the adaptively de-blocking filtered luminance component, and recording as Ik
Figure BDF0000009307170000043
Step 3.2: the cumulative sum of the corresponding absolute differences for each decompressed frame is calculated separately and taken as the blockiness measure m (k) for that frame, i.e.
Figure BDF0000009307170000044
Ik(x, y) denotes an x-th row and y-th column element of an absolute difference value of luminance components, x being 0,1, 2., M-1, y being 0,1, 2., N-1;
step 3.3: calculating an average blockiness metric value for a sequence of decompressed frames
Figure BDF0000009307170000045
Namely, it is
Figure BDF0000009307170000046
Step 3.4: the ratio of the blockiness metric to the average blockiness metric value for each decompressed frame is taken as the updated blockiness metric r (k), i.e. the
Figure BDF0000009307170000047
Preferably, the step 4 comprises:
step 4.1: judging whether each decompressed frame conforms to a macroblock change abnormal mode or not by using the extracted macroblock type information, wherein the macroblock change abnormal mode is defined as follows, wherein ^ represents logic and operation:
s(k)<s(k-1)∧s(k)<s(k+1)∧i(k)>i(k-1)∧i(k)>i(k+1)
if the macroblock change abnormal mode is met, setting the macroblock change abnormal flag of the decompressed frame to be 1, otherwise, setting the macroblock change abnormal flag of the decompressed frame to be 0;
step 4.2: for each decompressed frame the following operations are performed:
if the abnormal flag value of the macroblock change of the decompressed frame is 1, the block effect metric of the decompressed frame is still maintained
Figure BDF0000009307170000048
Figure BDF0000009307170000049
Representing the modified blockiness metric; r (k) represents the blockiness metric obtained in step 3;
if the macroblock change abnormal flag value of the decompressed frame is 0, the blockiness measure of the decompressed frame is updated to
Figure BDF00000093071700000410
Wherein the value range of alpha is [0.7,0.8 ]];
Step 4.3: calculating the difference value between the updated blockiness metric of each decompressed frame and the updated blockiness metric of the previous frame, and if the difference value is greater than 0, updating the blockiness metric of the decompressed frame into the difference value; if the difference is less than or equal to 0, the blockiness measure of the decompressed frame is updated to 0, and the updating process is expressed as follows:
Figure BDF0000009307170000051
rd(1)=0;rd(k) i.e. the final signature sequence.
Preferably, the step 5 comprises:
step 5.1: calculating a set C of first-time compressed GOP length alternative values, wherein if the length of the input video is less than 1500, namely K is less than 1500, C is {2, 3.., K/5 }; if the length of the input video is larger than or equal to 1500, namely K is larger than or equal to 1500, C is {2, 3.., 300 };
step 5.2: calculating the periodicity of each element C ∈ C in the set C, wherein: the periodicity metric function φ (c) is defined as:
φ(c)=φ1(c)-φ2(c),
wherein
Figure BDF0000009307170000052
Figure BDF0000009307170000053
Step 5.3: the maximum value Φ that the periodic metric function Φ (C) can reach in the set C, i.e. is calculated
Figure BDF0000009307170000054
If the maximum value phi is larger than a preset threshold value, namely phi is larger than TφIf so, judging that the input video has double compression; otherwise, the input video is determined as the original video and only undergoes one compression. Wherein the decision threshold TφThe value range is [0.01,0.1 ]];
Step 5.4: if the input video is determined to have double compression, the first compression uses an estimate of the GOP length
Figure BDF0000009307170000055
Is calculated as follows:
Figure BDF0000009307170000056
the invention provides a double MPEG-4 compression detection system based on a blocking effect measurement, which comprises:
the video decompression module: extracting a video stream from an input video file, decompressing the video stream into pictures to obtain a plurality of decompressed frames, and extracting coding information contained in each decompressed frame;
a decompressed frame filtering module: filtering the luminance component of the decompressed frame by using a self-adaptive deblocking filter;
a blockiness metric sequence acquisition module: calculating the block effect measurement of each frame through the filtered brightness component and the original brightness component to obtain a block effect measurement sequence of the input video;
a characteristic sequence acquisition module: enhancing the block effect measurement sequence through the macroblock change abnormal mode information to obtain a characteristic sequence;
a detection result analysis module: and carrying out periodic analysis on the characteristic sequence to obtain a detection result, and estimating the GOP length used for the first compression.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention makes up the defect that the prior art can not be applied to the double compression detection with the GOP structure dislocation phenomenon, so that the detection method has stronger robustness and wider application range.
2. The method provided by the invention does not need to carry out classifier learning in advance and repeatedly compress the input video, and the detection method has higher operation efficiency.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments with reference to the following drawings:
FIG. 1 is a flow chart of a dual MPEG-4 compression detection method based on a blocking artifact metric.
FIG. 2 is a block boundary and deblocking pixel.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that it would be obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit of the invention. All falling within the scope of the present invention.
The double MPEG-4 compression detection method based on the block effect measurement can be used for detecting double MPEG-4 compression with GOP structure dislocation. The input video is first decoded into a sequence of frames and the coding information for each frame is extracted. And performing color space conversion on the decompressed frames, and extracting the brightness component of each frame. The luminance component is filtered using an adaptive deblocking filter. A difference of the filtered luminance component and the original luminance component is calculated. And taking the accumulated sum of the absolute values of the corresponding difference values of each frame as the blockiness measurement of the frame to obtain the blockiness measurement sequence of the input video. And enhancing the block effect measurement sequence by using the macroblock change abnormal mode to obtain a characteristic sequence. And finally, periodically analyzing the characteristic sequence to obtain a final detection result and estimating the GOP length used by the first compression. The present invention takes advantage of the periodic anomalous blocking effect that exists in dual MPEG-4 compression with misaligned GOP structures. The trace has stronger robustness, so that the detection result of the method has higher reliability. The method mainly comprises the steps of video decoding, coding parameter extraction, self-adaptive block effect filtering, block effect metric value calculation, enhancement based on a macroblock change abnormal mode and periodic analysis of a characteristic sequence.
The invention provides a video dual MPEG-4 compression detection method based on a blocking effect measurement, which comprises the following steps:
step 1: extracting video stream from an input video file, decoding the video stream into a frame sequence, and extracting coding information contained in each frame;
step 2: filtering the luminance component of the decompressed frame by using a self-adaptive deblocking filter;
and step 3: calculating the block effect measurement of each frame by using the filtered brightness component and the original brightness component to obtain a block effect measurement sequence of the input video;
and 4, step 4: enhancing the block effect measurement sequence through the macroblock change abnormal mode information to obtain a characteristic sequence;
and 5: and periodically analyzing the characteristic sequence to obtain a detection result and estimating the GOP length used by the first compression.
The step 1 comprises the following steps:
step 1.1: decoding the input video into png format picture-preserving decompressed frames, recording eachDecompress the frame to DkK-1 where K is the number of frames included in the input video and the resolution of the decompressed frames is denoted as mxn;
step 1.2: counting the number of intra-coded macroblocks (I-MB) and the number of skipped coded macroblocks (S-MB) contained in each frame, which are respectively marked as I (k) and S (k);
step 1.3: the quantization factor value of each macroblock of each frame is extracted.
The step 2 comprises the following steps:
step 2.1: the decompressed frame is color space converted, the RGB color space is converted into the YCbCr space and the luminance component is extracted. The extraction formula of the luminance component is: y isk=0.299Rk+0.587Gk+0.114BkWherein R iskFor the R channel component of the kth decompressed frame, GkFor the G channel component of the kth decompressed frame, BkDecompressing the B channel component of the frame for the kth;
step 2.2: the luminance component Y of each framekDivision into non-overlapping 8 x 8 blocks
Figure BDF0000009307170000071
Where i and j are the respective column and row indices of the partitions and
Figure BDF0000009307170000072
and
Figure BDF0000009307170000073
representing a rounding operation;
step 2.3: for the luminance component of each decompressed frame, each 8 x 8 block is calculated
Figure BDF0000009307170000074
Is recorded as DCT coefficient
Figure BDF0000009307170000075
The formula for calculating the DCT coefficients is:
Figure BDF0000009307170000076
Figure BDF0000009307170000077
in the formula:
Figure BDF0000009307170000078
the xth row and yth column elements representing an 8 × 8 luma block with row and column indices (i, j) in the kth decompressed frame;
Figure BDF0000009307170000081
represents an 8 × 8 luminance block with a row-column index (i, j) in the kth decompressed frame
Figure BDF0000009307170000082
Corresponding DCT coefficients, u representing the row coordinates of the DCT coefficients; v represents the column coordinates of the DCT coefficients;
step 2.4: the following is done for each 8 x 8 block in turn: for DCT coefficient value
Figure BDF0000009307170000083
Performing nearest rounding operation to obtain
Figure BDF0000009307170000084
If it is
Figure BDF0000009307170000085
The 8 x 8 block is then divided into blocks only if the DC component is non-zero
Figure BDF0000009307170000086
Has both a horizontal blockiness flag bit (HBS) and a vertical blockiness flag bit (VBS) of 1, if, then
Figure BDF0000009307170000087
The 8 x 8 block is then divided into two rows, only the top row having non-zero DCT coefficients
Figure BDF0000009307170000088
VBS is set to 1 and HBS is set to 0. Finally, if
Figure BDF0000009307170000089
Only the left-most column has non-zero DCT coefficients, the 8 x 8 block is processed
Figure BDF00000093071700000810
HBS of (1) is set to 1, VBS is set to 0. Otherwise, the 8 x 8 block is divided
Figure BDF00000093071700000811
HBS and VBS of (1) are both set to 0.
Step 2.5: the following is done for each 8 x 8 block in turn: detecting 8 x 8 blocks
Figure BDF00000093071700000812
Horizontally adjacent to its right 8 x 8 block
Figure BDF00000093071700000813
HBS value of (a). If both are 1, filtering the pixel points near the boundary of two 8 × 8 blocks by using a 7-tap low-pass filter. The position of the pixel points to be filtered near the horizontal boundary of each 8 x 8 block is marked in fig. 2; detecting 8 x 8 blocks
Figure BDF00000093071700000814
8 x 8 block vertically adjacent to its lower side
Figure BDF00000093071700000815
If both VBS values are 1, a 7-tap low-pass filter is applied to pixels near the boundary of two 8 × 8 blocks for filtering. The pixel point locations near each 8 x 8 block vertical boundary that need to be filtered are marked in fig. 2. In the method, the 7-tap low-pass filter is in a specific form
Figure BDF00000093071700000816
Step 2.6: the following is done for each 8 x 8 block in turn: if 8 x 8 block
Figure BDF00000093071700000817
And itRight horizontally adjacent 8 x 8 block
Figure BDF00000093071700000818
The condition that the HBS values are all 1 is not satisfied. The absolute value of the difference between the pixel values on both sides of the horizontally adjacent 8 x 8 block boundary is calculated for each row in turn. If the absolute value of the difference between the pixel values on both sides of the line boundary is less than twice the quantization factor value of the macroblock to which the 8 x 8 block belongs. Filtering the pixel points on two sides of the boundary of the horizontally adjacent 8 multiplied by 8 blocks in the row by adopting a 3-tap low-pass filter; if 8 x 8 block
Figure BDF00000093071700000819
8 x 8 block vertically adjacent to its lower side
Figure BDF00000093071700000820
If the condition that the VBS values are all 1 is not satisfied, the absolute value of the difference between the pixel values on two sides of the vertically adjacent 8 x 8 block boundaries is calculated for each column in sequence. And if the absolute value of the difference between the pixel values at the two sides of the line boundary is less than twice of the quantization factor value of the macro block to which the 8 x 8 block belongs, filtering the pixel points at the two sides of the line of vertically adjacent 8 x 8 blocks by adopting a 3-tap low-pass filter. Otherwise, no filtering is performed. In the method, the specific form of the 3-tap low-pass filter is
Figure BDF00000093071700000821
Step 2.7: for each frame luminance component YkPerforming the adaptive deblocking filtering operation as described in steps 2.2 to 2.6 to obtain a filtered luminance component
Figure BDF00000093071700000822
The step 3 comprises the following steps:
step 3.1: calculating the absolute difference between the luminance component of each decompressed frame and its deblock filtered version, and noting as
Figure BDF0000009307170000091
Step 3.2: calculate each solutionThe cumulative sum of the corresponding absolute differences for a compressed frame is taken as the blockiness metric m (k) for that frame, i.e.
Figure BDF0000009307170000092
Step 3.3: calculating an average blockiness metric value for a sequence of decompressed frames
Figure BDF0000009307170000093
Namely, it is
Figure BDF0000009307170000094
Step 3.4: the ratio of the blockiness measure of each decompressed frame to the average blockiness measure value is taken as the final blockiness measure r (k), i.e. the ratio of the blockiness measure of each decompressed frame to the average blockiness measure value
Figure BDF0000009307170000095
The step 4 comprises the following steps:
step 4.1: and judging whether each frame accords with the macroblock change abnormal mode or not by using the extracted macroblock type information. The mode is defined as follows, where Λ represents the logical and operation:
s(k)<s(k-1)∧s(k)<s(k+1)∧i(k)>i(k-1)'i(k)>i(k+1)
and judging each frame, setting the macroblock change abnormal flag of the frame to be 1 if the macroblock change abnormal flag conforms to the mode, and otherwise, setting the macroblock change abnormal flag to be 0.
Step 4.2: the following operations are performed for each frame: if the macroblock change exception flag value for a video frame is 1, the blockiness metric for that frame remains
Figure BDF0000009307170000096
If the macroblock change exception flag value of a video frame is 0, the blockiness metric of the frame is updated to
Figure BDF0000009307170000097
In the method, the value range of alpha is [0.7,0.8 ]]。
Step 4.3: calculating updated blockiness metric of each frame from blockiness metric of previous frameThe difference value. If the difference is greater than 0, the blockiness metric of the frame is updated to the difference. If the difference is less than or equal to 0, the blockiness measure of the frame is updated to 0. This update process can be expressed as
Figure BDF0000009307170000098
rd(1)=0。rd(k) I.e. the final signature sequence.
The step 5 comprises the following steps:
step 5.1: a set C of first compressed GOP length alternative values is calculated. If the input video length is less than 1500, i.e., K < 1500, then C ═ 2, 3. If the input video length is greater than or equal to 1500, i.e., K ≧ 1500, C ═ 2, 3.
Step 5.2: the periodicity of each element C ∈ C in the set C is calculated. The periodicity metric function is defined as phi (c) to phi1(c)-φ2(c) Wherein
Figure BDF0000009307170000099
While
Figure BDF00000093071700000910
Step 5.3: calculating the maximum value of phi that the periodic metric function phi (C) can reach in the set C, i.e. phi
Figure BDF0000009307170000101
If the maximum value is greater than a predetermined threshold value, i.e., > TφThen it is determined that there is double compression of the input video. Otherwise, the input video is determined to be the original video and only undergoes one compression. In the method, the threshold value TφHas a value range of [0.01,0.1 ]]。
Step 5.4: if the input video is determined to have double compression. Then the first compression uses an estimate of the GOP length of
Figure BDF0000009307170000102
The foregoing description of specific embodiments of the present invention has been presented. It is to be understood that the present invention is not limited to the specific embodiments described above, and that various changes or modifications may be made by one skilled in the art within the scope of the appended claims without departing from the spirit of the invention. The embodiments and features of the embodiments of the present application may be combined with each other arbitrarily without conflict.

Claims (3)

1. A double MPEG-4 compression detection method based on blocking effect measurement is characterized by comprising the following steps:
step 1: extracting a video stream from an input video file, decompressing the video stream into pictures to obtain a plurality of decompressed frames, and extracting coding information contained in each decompressed frame;
the step 1 comprises the following steps:
step 1.1: decompressing the video stream into picture for storage, recording each decompressed frame as DkK is 1, 2.. times.k, where K is the number of frames included in the input video, and the resolution of the decompressed frame is denoted as mxn;
step 1.2: counting the number of intra-frame coding macro blocks and the number of skip coding macro blocks contained in each frame, and respectively recording the number as i (k) and s (k);
step 1.3: extracting a quantization factor value of each macro block of each frame;
step 2: filtering the luminance component of the decompressed frame by using a self-adaptive deblocking filter;
and step 3: calculating the block effect measurement of each frame through the filtered brightness component and the original brightness component to obtain a block effect measurement sequence of the input video;
and 4, step 4: enhancing the block effect measurement sequence through the macroblock change abnormal mode information to obtain a characteristic sequence;
the step 4 comprises the following steps:
step 4.1: judging whether each decompressed frame conforms to a macroblock change abnormal mode or not by using the extracted macroblock type information, wherein the macroblock change abnormal mode is defined as follows, wherein ^ represents logic and operation:
s(k)<s(k-1)∧s(k)<s(k+1)∧i(k)>i(k-1)∧i(k)>i(k+1);
if the macroblock change abnormal mode is met, setting the macroblock change abnormal flag of the decompressed frame to be 1, otherwise, setting the macroblock change abnormal flag of the decompressed frame to be 0;
step 4.2: for each decompressed frame the following operations are performed:
if the abnormal flag value of the macroblock change of the decompressed frame is 1, the block effect metric of the decompressed frame is still maintained
Figure FDA0002667109950000011
Figure FDA0002667109950000012
Representing the modified blockiness metric; r (k) represents the blockiness metric obtained in step 3;
if the macroblock change abnormal flag value of the decompressed frame is 0, the blockiness measure of the decompressed frame is updated to
Figure FDA0002667109950000013
Wherein the value range of alpha is [0.7,0.8 ]];
Step 4.3: calculating the difference value between the updated blockiness metric of each decompressed frame and the updated blockiness metric of the previous frame, and if the difference value is greater than 0, updating the blockiness metric of the decompressed frame into the difference value; if the difference is less than or equal to 0, the blockiness measure of the decompressed frame is updated to 0, and the updating process is expressed as follows:
Figure FDA0002667109950000021
rd(1)=0;rd(k) the final characteristic sequence is obtained;
and 5: carrying out periodic analysis on the characteristic sequence to obtain a detection result, and estimating the GOP length used for the first compression;
the step 5 comprises the following steps:
step 5.1:
calculating a set C of first compressed GOP length candidate values, and if the number of frames included in the input video is less than 1500, and K is the number of frames included in the input video, that is, K is less than 1500, then C is {2, 3. If the number of frames contained in the input video is greater than or equal to 1500, that is, K is greater than or equal to 1500, C is {2, 3.., 300 };
step 5.2: calculating the periodicity of each element C ∈ C in the set C, wherein: the periodicity metric function φ (c) is defined as:
φ(c)=φ1(c)-φ2(c);
wherein
Figure FDA0002667109950000022
Figure FDA0002667109950000023
Step 5.3: the maximum value Φ that the periodic metric function Φ (C) can reach in the set C, i.e. is calculated
Figure FDA0002667109950000024
If the maximum value phi is larger than a preset threshold value, namely phi is larger than TφIf so, judging that the input video has double compression; otherwise, the input video is judged as the original video and only undergoes one-time compression; wherein the decision threshold TφThe value range is [0.01,0.1 ]];
Step 5.4: if the input video is determined to have double compression, the first compression uses an estimate of the GOP length
Figure FDA0002667109950000025
Is calculated as follows:
Figure FDA0002667109950000026
2. the dual MPEG-4 compression detection method based on blockiness metric of claim 1, wherein said step 2 includes:
step 2.1: converting the decompressed frame into a color space, namely converting an RGB color space into a YCbCr color space, and extracting a brightness component; wherein: first, theLuminance component Y of k decompressed frameskThe extraction formula of (a) is as follows:
Yk=0.299Rk+0.587Gk+0.114Bk
in the formula: rkFor the R channel component of the kth decompressed frame, GkFor the G channel component of the kth decompressed frame, BkDecompressing the B channel component of the frame for the kth;
step 2.2: decompressing the luminance component Y of the k-th framekDivision into non-overlapping 8 x 8 blocks, noted
Figure FDA0002667109950000031
Figure FDA0002667109950000032
A luminance block representing a k-th decompressed frame with a line index of i and a column index of j;
Figure FDA0002667109950000033
Figure FDA0002667109950000034
Figure FDA0002667109950000035
representing a rounding operation; each brightness block
Figure FDA0002667109950000036
Contains 64 elements, the coordinate of the luminance component of the upper left corner of the luminance block is (8 × i +1,8 × j + 1);
step 2.3: for each decompressed frame, the DCT coefficients for each 8 x 8 block are computed, denoted as
Figure FDA0002667109950000037
Wherein:
Figure FDA0002667109950000038
Figure FDA0002667109950000039
the DCT coefficient of the v column of the u row corresponding to the 8 x 8 brightness block with the row and column index (i, j) in the k decompressed frame;
step 2.4: the following is performed for each 8 × 8 block in turn:
for DCT coefficient value
Figure FDA00026671099500000310
Performing nearest rounding operation to obtain
Figure FDA00026671099500000311
Figure FDA00026671099500000312
Specifically, the method comprises the following steps:
if it is
Figure FDA00026671099500000313
If only the DC component is non-zero, setting the horizontal blocking effect flag HBS and the vertical blocking effect flag VBS of the 8 × 8 block to 1;
if it is
Figure FDA00026671099500000314
Setting the VBS of the 8 x 8 block to be 1 and setting the HBS to be 0 only if the topmost row has the non-zero DCT coefficient;
if it is
Figure FDA00026671099500000315
Setting the HBS of the 8 x 8 block to be 1 and the VBS to be 0 if only the leftmost column has the non-zero DCT coefficient;
otherwise, both HBS and VBS are set to 0;
step 2.5: the following is performed for each 8 × 8 block in turn:
detecting the HBS value of an 8 × 8 block horizontally adjacent to the right side of the 8 × 8 block, and if both HBS values are 1, filtering pixels near the boundary of the two 8 × 8 blocks by using a 7-tap low-pass filter;
detecting a 8 x 8 block vertically adjacent to the lower side of the 8 x 8 blockAnd 8 × 8 blocks, and if the VBS values of the two blocks are both 1, filtering pixels near the boundary of the two 8 × 8 blocks by adopting a 7-tap low-pass filter, wherein the specific form of the 7-tap low-pass filter is
Figure FDA00026671099500000316
Step 2.6: the following is done for each 8 x 8 block in turn:
if the 8 × 8 block and the 8 × 8 block horizontally adjacent to the right side of the 8 × 8 block do not satisfy the condition that the HBS values are all 1, calculating an absolute value of a difference between adjacent pixel values at the boundary of the 8 × 8 block; if the absolute value is less than twice the quantization factor value of the macroblock to which the 8 × 8 block belongs, filtering pixels near the 8 × 8 block boundary to which the 8 × 8 block horizontally neighbors on the right side of the 8 × 8 block by using a 3-tap low-pass filter, otherwise, not filtering;
if the 8 × 8 block vertically adjacent to the lower side of the 8 × 8 block does not satisfy the condition that the VBS values are all 1, calculating an absolute value of a difference between adjacent pixel values at a boundary of the 8 × 8 block, and if the absolute value is less than twice of a quantization factor value of a macroblock to which the 8 × 8 block belongs, filtering pixels near the boundary of the 8 × 8 block vertically adjacent to the lower side of the 8 × 8 block by using a 3-tap low-pass filter, otherwise, not filtering; the 3-tap low-pass filter is in a specific form
Figure FDA0002667109950000041
Step 2.7: obtaining each frame of filtered brightness component through the adaptive deblocking filtering operation from step 2.2 to step 2.6
Figure FDA0002667109950000042
3. The dual MPEG-4 compression detection method based on blockiness metric of claim 1, wherein said step 3 comprises:
step 3.1: calculating the absolute difference between the luminance component of each decompressed frame and the adaptively de-blocking filtered luminance component, and recording as Ik
Figure FDA0002667109950000043
Step 3.2: the cumulative sum of the corresponding absolute differences for each decompressed frame is calculated separately and taken as the blockiness measure m (k) for that frame, i.e.
Figure FDA0002667109950000044
Ik(x, y) denotes an x-th row and y-th column element of an absolute difference value of luminance components, x being 0,1, 2., M-1, y being 0,1, 2., N-1;
step 3.3: calculating an average blockiness metric value for a sequence of decompressed frames
Figure FDA0002667109950000045
Namely, it is
Figure FDA0002667109950000046
Step 3.4: the ratio of the blockiness metric to the average blockiness metric value for each decompressed frame is taken as the updated blockiness metric r (k), i.e. the
Figure FDA0002667109950000047
CN201610682055.4A 2016-08-17 2016-08-17 Double MPEG-4 compression detection method based on block effect measurement Active CN106303525B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610682055.4A CN106303525B (en) 2016-08-17 2016-08-17 Double MPEG-4 compression detection method based on block effect measurement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610682055.4A CN106303525B (en) 2016-08-17 2016-08-17 Double MPEG-4 compression detection method based on block effect measurement

Publications (2)

Publication Number Publication Date
CN106303525A CN106303525A (en) 2017-01-04
CN106303525B true CN106303525B (en) 2020-11-17

Family

ID=57678838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610682055.4A Active CN106303525B (en) 2016-08-17 2016-08-17 Double MPEG-4 compression detection method based on block effect measurement

Country Status (1)

Country Link
CN (1) CN106303525B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104837028A (en) * 2015-04-29 2015-08-12 上海交通大学 Video same-bit-rate dual-compression detection method
CN105554508A (en) * 2015-12-11 2016-05-04 南京昊烽信息科技有限公司 Method and system for detecting video inter-frame tampering for eliminating GOP periodic noise effects

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104837028A (en) * 2015-04-29 2015-08-12 上海交通大学 Video same-bit-rate dual-compression detection method
CN105554508A (en) * 2015-12-11 2016-05-04 南京昊烽信息科技有限公司 Method and system for detecting video inter-frame tampering for eliminating GOP periodic noise effects

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Exposing Video Forgeries By Detecting Mpeg Double Compression;孙锬锋,王婉等;《2012 IEEE International Conference on Acoustics,Speech and Signal Processing》;20190806;第1389-1392页 *

Also Published As

Publication number Publication date
CN106303525A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
US20180338161A1 (en) In Loop Chroma Deblocking Filter
US8295633B2 (en) System and method for an adaptive de-blocking filter after decoding of compressed digital video
JP4358436B2 (en) Method and apparatus for encoding video information
US7957467B2 (en) Content-adaptive block artifact removal in spatial domain
Li et al. A convolutional neural network-based approach to rate control in HEVC intra coding
CN102164278B (en) Video coding method and device for removing flicker of I frame
US20090022416A1 (en) Reduction of compression artefacts in displayed images, analysis of encoding parameters
TW201933868A (en) Video coding method/apparatus and corresponding non-transitory computer-readable medium
KR20070116717A (en) Method and device for measuring mpeg noise strength of compressed digital image
JP4995344B2 (en) Filtering device
TW201828708A (en) Non-local adaptive loop filter combining multiple denoising technologies and grouping image patches in parallel
JP4749377B2 (en) Block noise removal device
EP1506525B1 (en) System for and method of sharpness enhancement for coded digital video
US7043092B1 (en) Video decoding device and method using a deblocking filtering step
KR100897644B1 (en) Image processor, image processing method, and recording medium
US20100246990A1 (en) System and method for measuring blockiness level in compressed digital video
CN108156461B (en) Bayer image compression method and device
CN106303525B (en) Double MPEG-4 compression detection method based on block effect measurement
CN111770334A (en) Data encoding method and device, and data decoding method and device
US20070223591A1 (en) Frame Deblocking in Video Processing Systems
US20140233648A1 (en) Methods and systems for detection of block based video dropouts
WO2018177395A1 (en) Method and apparatus for filtering video frames
JP5375590B2 (en) Quantization control circuit, quantization parameter changing method, and encoding apparatus
US20120133836A1 (en) Frame level quantization estimation
Do et al. A new adaptive image post-treatment for deblocking and deringing based on total variation method

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