The stream index file generates and visits with this document the method for frame and shearing lens
The present invention relates to the method that a kind of stream index file generated and visited with this document frame and shearing lens, especially refer to a kind of based on the program stream of MPEG-2 code stream, flow substantially and set up index file, and use the method for this document random access arbitrary frame and the searching method of high speed shearing lens, belong to the multimedia messages process field.
At present, digital information has developed into the multimedia messages of information types such as containing video, audio frequency, picture, text from the plain text in past.In multimedia database, effective managerial demand of video media makes things convenient for the user to the video data fast access to the support of video data structureization.Along with the raising of desktop computer performance, the continuous reduction of storage medium expense, the expansion of broadband network, the application of digital of digital video data becomes more and more widely.Each digital video material all is made of a series of frames continuous in time, and the application of many relevant multimedia videos is all wished to navigate to a certain particular frame in the video sequence fast.Though the VCD software player in present all multi-microcomputer environment all provides the function of corresponding F.F., rewind down, this random access ability all has certain limitation on rapidity, accuracy, can't satisfy the needs of many more senior multimedia application.For example: a large-scale video database system wishes to provide the content-based retrieval mode for the user, video stream file in the storehouse is through after the structurized analyzing and processing, camera lens collection in the video flowing has all been added index, the user is browsing when retrieval if need forward another camera lens to from a camera lens, will wish that system can be with the F.F. or fall back on initial first frame of target mirror head soon exactly of the fastest response speed; Such system generally all responds a plurality of users' request concomitantly with client/service mode, at this moment realize that by video flowing being set up suitable index rapidity, accuracy to the visit of particular frame video content are a kind of effective solutions.
It is the basic function of video information management system to video data structureization that camera lens is cut apart.Manual completely mark is a uninteresting manpower work consuming time, provide various supermatic structural analysis instruments that initial data is handled, the content structure of setting up and describe video information with automation or semi-automatic mode is a kind of important system requirements.
Frame in the MPEG code stream is carried out decompress(ion) contract to show it is many basic operations that relate to the multimedia application of video.Because MPEG code stream coding, having only type of coding is that the content of the figure of I can independent decoding and displaying, and the figure of other type need be correctly decoded at relative some frame, after this figure can be correctly decoded.The F.F. of the mpeg program stream studio equipments that this is also general just, the resolution cell of rewind down are generally the reason of a set of pictures (GOP), its essence is carried out be to the search of the most approaching I figure in target location, rather than any one accurate frame searched for.
But, in order to satisfy specific application demand, need search for the location sometimes to a concrete frame.For example: shearing lens is a kind of the most general camera lens switching mode, and camera lens in two adjacent interframe sudden change takes place.It all is basic key technology that camera lens is segmented in many Video Applications, as automated cataloging system of news etc.; Shot transition in some news category record programs nearly all adopts this mode to give prominence to the serious formal property of content.By the news hookup of Chinese Central Television (CCTV) every day being made the manual mark statistics of camera lens, find that the shot transition more than 95% is the shear type.To the editor of this class camera lens, often need a concrete frame is searched for the location accurately.
Seeking a camera lens in the fragment of a video, need search out the transition frames between the camera lens usually, is that the method for resolution cell obviously is coarse and utilize above-mentioned with a GOP (GOP).In addition,, adopt multistage resolution detection mode to come content characteristic amount between the comparison consecutive frame usually, the MPEG-2 code stream is set up the basis that suitable index file is multistage resolution detection mode in order to improve the speed of analyzing search.
Main purpose of the present invention is to provide a kind of generation method of MPEG-2 code stream index file, MPEG-2 program stream, basic stream are set up index, scan the position of the figure head that the original position of finding video packing elementary stream packet header and a corresponding frame begin by content to the video data in the MPEG-2 stream, finish MPEG-2 stream encryption order to the conversion of playing order, make frame in the index put in order with to play order consistent.
Another object of the present invention is to provide the method for the arbitrary frame in a kind of random access MPEG2 code stream, utilize the different characteristics of the contained information of different coding type frame in the MPEG-2 code stream, by utilizing primitive character information to reduce the time complexity of feature extraction, thereby realize the arbitrary frame in the random access MPEG2 code stream.
The present invention's purpose again is to provide on a kind of compression domain shot boundary searching method more fast, compare with camera lens partitioning algorithm on the existing compression domain, it utilizes MPEG-2 code stream index file, adopts multistage resolution detection method that camera lens is cut search; Utilization is skipped the frame of video of some to the analysis result of other frame of video, thereby the data volume that whole search procedure is handled significantly reduces.
The present invention is achieved through the following technical solutions:
A kind of generation method of MPEG2 code stream index file, it comprises: the program stream of MPEG-2 or MPEG-1, transport stream, packetized datastream or master data stream file, and may further comprise the steps:
1, opens a basic stream file and set up the temporary file of a sky;
2, the totalframes counter that contains in the program stream being set is 0, and end mark is FALSE;
If 3 screen buffers are empty, then search for, resolve basic stream file, basic stream is read in screen buffer;
4, the various mpeg header information datas in search, the parsing screen buffer if run into the end mark of EOS sign indicating number or basic stream file, are then changeed step 15; If run into a video PES packet header, write down the original position in this packet header; If run into figure head, write down the original position of these figure head, and change step 5;
5, resolve this figure head;
6, if the coding of graphics type is the category-B type, the present frame of then decoding is the frame type of coding of B frame, changes step 9; Otherwise change step 7;
7, if end mark is FALSE, then forward reference frame is exchanged to the content of reference frame with the back;
8, the decoding present frame is that the back is to reference frame;
If 9 end marks are FALSE, then the start position information with coding of graphics type, figure head is deposited into the object that the decoding present frame points to; If stream type is a program stream, also the start position information in this packet header is deposited into the object of decoding present frame sensing simultaneously, whether the gop structure of checking MPEG2 code stream non-regular situation occurs, if then failure is withdrawed from;
If the totalframes counter that contains in 10 program streams is not 0, and the figure chip architecture is frame type, and perhaps end mark is FALSE, if then the coding of graphics type is the category-B type, then playing present frame is the frame type of coding of B frame, otherwise the broadcast present frame is a forward reference frame; Change step 13;
If 11 photo current structures are not frame type, then end mark negate;
If 12 end marks are FALSE, then will play the information of present frame point at objects and put in the output buffer, value+1 of the totalframes counter that contains in the program stream;
If 13 output buffers surpass certain full scale, then take out a certain amount of data, construct some index, and be written in the temporary file by predetermined file format;
14, change step 3;
15, if output buffer is not empty, then take out wherein all data, construct some index, and be written in the temporary file by predetermined file format;
16, set up the index file of a sky, by the index file form data of description is written in the file, the content of temporary file is appended to index file, and closes index file, temporary file is closed and deleted to basic stream file.
Two tuples<the G of above-mentioned MPEG code stream, D〉the element D of index I is the set of index of arranging by DISPLAY ORDER; The structure that element G is is<FrameRate, Frames, tagRegular, Gop_NP, Gop_NB, BL_GopIndex, BaseFrmNum, TypeStream 〉, wherein: FrameRate is the frame per second of mpeg stream, the totalframes of Frames for containing in this program stream, whether the gop structure of the mpeg stream of tagRegular sign index is regular, Gop_NP, Gop_NB is respectively the P frame contained among each GOP of indexed mpeg stream and the number of B frame, and BL_GopIndex is the byte number of all frames costs among GOP of index in index I, BaseFrmNum be in the mpeg program stream by the frame number of first I frame of playing sequence, TypeStream is the type of index stream.Described index is I index or P index; I index is for containing the index form of the I type figure slice, thin piece group of I figure to reference frame in the figure slice, thin piece group that constitutes GOP, it is a four-tuple<tag, numB, ipPos, dif_Bs 〉; Described P index is for containing the index form of the P type figure slice, thin piece group of P figure to reference frame in the figure slice, thin piece group that constitutes GOP, it is a four-tuple<tag, numB, ipPos, dif_Bs 〉; In the described four-tuple, tag is the type of index, the number of the B frame that comprises in the figure slice, thin piece group of numB for this index correspondence, ipPos is the associated description information of the position in stream of I frame or P frame in the corresponding figure slice, thin piece group of this index, dif_Bs is an in order positive manifold of being made up of numB element, and each element wherein is the associated description information of the position of each B frame in the figure slice, thin piece group with respect to the alternate position spike of ipPos.The index file form is for being the storage format of Data Structures with element G among the index I.
The method of arbitrary frame in a kind of random access MPEG2 code stream, it comprises: the program stream of MPEG-2 or MPEG-1, transport stream, packetized datastream or master data stream file, and may further comprise the steps:
1, opens basic stream file, adopt the index file of the corresponding code stream that the generation method of above-mentioned MPEG2 code stream index file set up;
2, from the index file of corresponding code stream, extract relevant parameter, obtain frame number and be index position in the D element in index I of I type figure slice, thin piece group correspondence of the frame place GOP of required frame number;
3, mobile phase answer code stream the file pointer of index file to the corresponding position of the position that step 2 is obtained, and read the content of an index size;
4, the file pointer that moves basic stream file respective frame corresponding position in code stream in the corresponding figure slice, thin piece group of index that is read utilizes the decode data of this frame of mpeg decode engine;
If step 14 is then changeed in numbering=0 of 5 searched frames in set of pictures;
6, establish previous index and be current index;
7, if the numbering of searched frame in set of pictures less than the frame number value that each index comprises, then changeed step 11;
8, from the index file of corresponding code stream, read the content of an index size;
9, the file pointer that moves basic stream file respective frame corresponding position in code stream in the corresponding figure slice, thin piece group of index that is read utilizes the decode data of this frame of mpeg decode engine;
10, the frame number value that numbering-each index comprise of the numbering=searched frame of searched frame in set of pictures in set of pictures changeed step 6;
11, if step 14 is then changeed in numbering=0 of searched frame in set of pictures;
12, from the index file of corresponding code stream, read the content of an index size, the file pointer that moves basic stream file respective frame corresponding position in code stream in the corresponding figure slice, thin piece group of index that reads utilizes the decode data of this frame of mpeg decode engine;
13, the position of the file pointer that moves basic stream file corresponding B frame in the corresponding position of respective frame in code stream in the corresponding figure slice, thin piece group of index that reads utilizes the decode data of this frame of mpeg decode engine;
14, find out the frame of last decoding; Finish.
A kind of high speed shearing lens border search method, it comprises: the program stream of MPEG-2 or MPEG-1, transport stream, packetized datastream or master data stream file, and may further comprise the steps:
1, opens basic stream file, adopt the index file of the corresponding code stream that the generation method of above-mentioned MPEG2 code stream index file set up;
If 2 have detected all GOP, forward step 5 to; Otherwise, carry out the GOP level and detect, if satisfy the similitude requirement of setting, then continue to detect I
K+1, I
K+2Between the content similarity degree; Otherwise I is described
k, I
K+1Between may have the switching of camera lens, carry out step 3;
3, carry out figure slice, thin piece group level and detect, establish SP
l, SP
L+1Be two adjacent figure slice, thin piece groups, and SP
L+1Be P type figure slice, thin piece group, detect SP
l, SP
L+1Reference frame R in the figure slice, thin piece group
m, R
M+1Between the content similarity degree, if the similitude requirement of satisfy setting, then continue to detect the reference frame R of next figure slice, thin piece group
M+2With R
M+1Between the content similarity, otherwise the explanation R
m, R
M+1Between may have the switching of camera lens, when finding SP
L+1Be I type figure slice, thin piece group, SP
lThen be last figure slice, thin piece group of a GOP, carry out step 4;
4, carry out the frame level and detect,, turn back to step 2 after then analyzing, otherwise turn back to step 3 if this B frame sequence belongs to last figure slice, thin piece group of a GOP;
5, write down the position that all camera lenses switch, finish.
Above-mentioned GOP level detects: to two I frame I at a distance of a GOP length
k, I
K+1Between the detection of content similarity degree; Figure slice, thin piece group level detects: to being in two I frame I
k, I
K+1Between the detection undertaken by the resolution of figure slice, thin piece group of frame; The frame level detects: to all the B frame sequence B between two reference frames
1B
2... B
nAnalyze, determine the generation and the accurate position thereof of shearing lens.
The frame level detects according to the following step:
1, the correlation function Relevance between reference frame of definition (df, db):
Wherein df, db are the frame number of two adjacent reference frames, and NFwdBack (d) and NFwdBackSkip (d) are respectively the function that calculates bi-directional predicted macroblock number and two-way skip macroblock number among the frame d;
R
i, R
jDui Ying broadcast frame number is f, b respectively;
2, if: Relevance (f, b) 〉=K
2SumofMacroBlocks, wherein K
2, K
2 ∈(0,1) is the threshold parameter of system,
Then: frame R
i, R
jBetween do not have the switching of camera lens;
3 otherwise, for B
k(k=1,2 ... n), if:
NBackSkip(d)+NBackward(d)>K
3·(NFwdSkip(d)+NForward(d))
And: Relevance (f, b)≤K
4SumofMacroBlocks
Then at frame B
k(k=1,2 ..n) and the switching of camera lens taken place between its former frame;
Wherein: K
4, K
4 ∈(0,1) is the threshold parameter of system, NBackSkip (d), and NBackward (d) NFwdSkip (d) and NForward (d) are respectively: back among the frame d to the skip macroblock number, backward prediction macroblock number, forward direction skip macroblock number and forward prediction macroblock number; K wherein
3, (K
3>1) is the threshold parameter of system;
4, for B
n, if: Relevance (f, b)≤K
4SumofMacroBlocks and: K
3(NBackSkip (d)+NBackward (d))<NFwdSkip (d)+NForward (d) then judges at B
nWith a frame R thereafter
jBetween the switching of camera lens has taken place.
The present invention has finished MPEG2 code stream coding order to the conversion of playing order by to setting up index based on the program stream of MPEG2 code stream, basic stream, makes frame in the index put in order with to play order consistent; And, utilize the different characteristics of the contained information of frame of different coding type in the MPEG2 code stream, realized random access to any frame in the MPEG2 code stream; In addition, the present invention utilizes MPEG2 code stream index file, adopts the detection method of multistage resolution that camera lens is cut detection; Utilization is skipped the frame of video of some to the analysis result of other frame of video, thereby the deal with data amount of whole detection process is significantly reduced, and compares with camera lens partitioning algorithm on the existing compression domain, and it has improved the speed to the search of MPEG2 code stream analysis.
Below, the present invention is described in further detail in conjunction with the accompanying drawings:
Fig. 1 is one of the flow chart of the generation method of MPEG2 code stream index file.
Fig. 2 be MPEG2 code stream index file the generation method flow chart two.
Fig. 3 is the schematic flow sheet of the method for the arbitrary frame in the random access MPEG2 code stream.
Fig. 4 is the schematic flow sheet of high speed shearing lens border search method.
Referring to Fig. 1 and Fig. 2, be the flow chart of the generation method of MPEG-2 code stream index file of the present invention.This method is based on the program stream of MPEG-2 or MPEG-1, or basic stream file sets up index, according to flow chart:
At first open a basic stream file and the temporary file of setting up a sky, at this moment, basic stream file is one and is used to deposit the file of sky of index stream that its gop structure is the MPEG2 code stream of rule, the gop structure that is meant of so-called rule is constant at whole program stream, and the number of the B frame that comprises between the reference frame by the DISPLAY ORDER arrangement is identical.
Secondly, the totalframes counter of program stream is set to 0, and end mark is set to FALSE.
If screen buffer is empty, then search for, resolve basic stream file, basic stream is read in screen buffer.
Then, various mpeg header information datas in search, the parsing screen buffer, if run into the end mark of EOS sign indicating number or basic stream file, finish operations such as all search, parsing, take out all data in the output buffer, construct some index, and be written in the temporary file by predetermined file format, set up the index file of a sky again, by the index file form data of description is written in the file, the content of temporary file is appended to index file, and closes index file and basic stream file, close and delete temporary file.
If run into a video PES packet header, write down the original position in this packet header.If run into figure head, write down the original position of these figure head, otherwise continue the various mpeg header information datas in search, the parsing screen buffer.
Resolve this figure head; If the coding of graphics type is the category-B type, the present frame of then decoding is the frame type of coding of B frame, otherwise if end mark is FALSE, then forward reference frame is exchanged to the content of reference frame with the back, and the decoding present frame is that the back is to reference frame.
If end mark is FALSE, then the start position information with coding of graphics type, figure head is deposited into the object that the decoding present frame points to; If the type of stream is a program stream, also the start position information in this packet header is deposited into the object of decoding present frame sensing simultaneously.
Whether the gop structure of checking MPEG2 code stream non-regular situation occurs, if then failure is withdrawed from.
If the totalframes counter that contains in the program stream is not 0, and the figure chip architecture is frame type, and perhaps end mark is FALSE, if then the coding of graphics type is the category-B type, then playing present frame is the frame type of coding of B frame, otherwise the broadcast present frame is a forward reference frame.
If the totalframes counter is not 0, and the photo current structure is not frame type, and perhaps end mark is FALSE, then end mark negate; If end mark is FALSE, then will play the information of present frame point at objects and put in the output buffer, make the value of the totalframes counter that contains in the program stream increase progressively 1.
If output buffer surpasses certain full scale, then take out a certain amount of data, construct some index, and be written in the temporary file by predetermined file format.
Each steps such as various mpeg header information datas in repeat search, the parsing screen buffer withdraw from up to whole search end or failure.
Above-mentioned MPEG code stream has index I, and it is one two tuple,<G, D 〉; Element G is the architectural feature of code stream and all description entrys of feature of index I, and element D is all index of arranging by DISPLAY ORDER.The structure that element G is is<FrameRate, Frames, tagRegular, Gop_NP, Gop_NB, BL_GopIndex, BaseFrmNum, TypeStream 〉, wherein: FrameRate is the frame per second of mpeg stream, the totalframes of Frames for containing in this program stream, whether the gop structure of the mpeg stream of tagRegular sign index is regular, Gop_NP, Gop_NB is respectively the P frame contained among each GOP of indexed mpeg stream and the number of B frame, and BL_GopIndex is the byte number of all frames costs among GOP of index in index I, BaseFrmNum be in the mpeg program stream by the frame number of first I frame of playing sequence, TypeStream is the type of index stream.
Index in the MPEG code stream is I index or P index, and I index is for containing the index form of the I type figure slice, thin piece group of I figure to reference frame in the figure slice, thin piece group that constitutes GOP; P index is for containing the index form of the P type figure slice, thin piece group of P figure to reference frame in the figure slice, thin piece group that constitutes GOP; Two kinds of above-mentioned index are four-tuple<tag all, numB, ipPos, dif_Bs 〉, in this four-tuple, tag is the type of index, the number of the B frame that comprises in the figure slice, thin piece group of numB for this index correspondence, ipPos is the associated description information of the position in stream of I frame or P frame in the corresponding figure slice, thin piece group of this index, dif_Bs is an in order positive manifold of being made up of numB element, and each element wherein is the associated description information of the position of each B frame in the figure slice, thin piece group with respect to the alternate position spike of ipPos.
The index file form then is to be the storage format of Data Structures with element G among the index I.
Referring to Fig. 3, be the flow chart of the method for arbitrary frame in the random access MPEG2 code stream of the present invention.This method is based on the program stream of MPEG-2 or MPEG-1 or basic stream file and associated index file, according to flow chart:
At first, open the index file of the corresponding code stream that the generation method of basic stream file and employing MPEG2 code stream index file correspondingly set up.
Secondly, from the index file of corresponding code stream, extract relevant parameter, obtain index position in the D element in index I of frame number, and read the content of an index size for the I type figure slice, thin piece group correspondence of the frame place GOP of the frame number that needs.
Then, the file pointer that moves basic stream file respective frame corresponding position in code stream in the corresponding figure slice, thin piece group of index that is read utilizes the decode data of this frame of mpeg decode engine.
If numbering=0 of searched frame in set of pictures then finds out the frame of last decoding, finish; Otherwise, establish previous index and be current index.
If the frame number that the numbering of searched frame in set of pictures comprises less than each index, and, then find out the frame of last decoding as if numbering=0 of searched frame in set of pictures, finish;
Otherwise, from the index file of corresponding code stream, read a big or small content of index; The file pointer that moves basic stream file respective frame corresponding position in code stream in the corresponding figure slice, thin piece group of index that is read utilizes the decode data of this frame of mpeg decode engine.
Make the frame number that numbering-each index comprise of the numbering=searched frame of searched frame in set of pictures in set of pictures, establish previous index and be current index; As if numbering=0 of searched frame in set of pictures, then find out the frame of last decoding, finish.
From the index file of corresponding code stream, read the content of an index size, the file pointer that moves basic stream file respective frame corresponding position in code stream in the corresponding figure slice, thin piece group of index that reads utilizes the decode data of this frame of mpeg decode engine.
The position of the file pointer that moves basic stream file corresponding B frame in the corresponding position of respective frame in code stream in the corresponding figure slice, thin piece group of index that reads utilizes the decode data of this frame of mpeg decode engine.
Find out the frame of last decoding, finish.
Referring to Fig. 4, be the flow chart of high speed shearing lens border search method of the present invention.This method is based on the program stream of MPEG-2 or MPEG-1, or basic stream file and associated index file, according to flow chart:
At first, open basic stream file, adopt the index file of the corresponding code stream that the generation method of above-mentioned a kind of MPEG2 code stream index file set up; If detected all GOP, write down the position that all camera lenses switch, finish; Otherwise, carry out the GOP level and detect, if satisfy the similitude requirement of setting, then continue to detect I
K+1, I
K+2Between the content similarity degree; Otherwise I is described
k, I
K+1Between may have the switching of camera lens, carry out figure slice, thin piece group level and detect.
Carry out figure slice, thin piece group level and detect, establish SP
l, SP
L+1Be two adjacent figure slice, thin piece groups, and SP
L+1Be P type figure slice, thin piece group, detect SP
l, SP
L+1Reference frame R in the figure slice, thin piece group
m, R
M+1Between the content similarity degree, if the similitude requirement of satisfy setting, then continue to detect the reference frame R of next figure slice, thin piece group
M+2With R
M+1Between the content similarity, otherwise the explanation R
m, R
M+1Between may have the switching of camera lens, when finding SP
L+1Be I type figure slice, thin piece group, SP
lThen be last figure slice, thin piece group of a GOP, carry out the frame level and detect.
Carry out the frame level and detect,, forward to after then analyzing and carry out the detection of GOP level, detect otherwise turn back to figure slice, thin piece group level if this B frame sequence belongs to last figure slice, thin piece group of a GOP.
Above-mentioned GOP level detects: to two I frame I at a distance of a GOP length
k, I
K+1Between the detection of content similarity degree; Figure slice, thin piece group level detects: to being in two I frame I
k, I
K+1Between the detection undertaken by the resolution of figure slice, thin piece group of frame; The frame level detects: to all the B frame sequence B between two reference frames
1B
2... B
nAnalyze, determine the generation and the accurate position thereof of shearing lens.
The frame level detects according to following method:
The detection of frame level confirms to provide the scope that detects for the frame level in a figure slice, thin piece group.The frame level confirms to utilize the information in the original compression territory of the B frame in the figure slice, thin piece group, judges the accurate position whether shearing lens takes place extremely to take place.
B frame in the mpeg stream is made of dissimilar macro blocks, includes intra-frame macro block (Intra), forward prediction macroblock (Forward), backward prediction macroblock (Backward), bi-directional predicted macro block (FwdBack), forward direction skip macroblock (FwdSkip), back to skip macroblock (BackSkip), two-way skip macroblock (FwdBackSkip).
Press the frame sequence R that playing sequence is arranged for one
iB
1B
2... B
nR
j, if exist k (k=1,2 ... n), contain a lot of bi-directional predicted macro blocks among the frame Bk, according to the encryption algorithm of MPEG, if B
kTwo reference frame R
i, R
jBetween content have very big correlation.For this reason, define correlation function Relevance between a reference frame (df, db).
Wherein df, db are the frame number of two adjacent reference frames, and NFwdBack (d), NFwdBackSkip (d) obtain bi-directional predicted macroblock number and two-way skip macroblock number among the frame d respectively.
If R
i, R
jDui Ying broadcast frame number is f, b respectively,
If:
Relevance(f,b)≥K
2·SumofMacroBlocks
Then: frame R
i, R
jBetween do not have the switching of camera lens.
Wherein: K
2, K
2 ∈(0,1) is the threshold parameter of system.
Otherwise:
For B
k(k=1,2 ... n), if:
NBackSkip(d)+NBackward(d)>K
3·(NFwdSkip(d)+NForward(d))
Relevance(f,b)≤K
4·SumofMacroBlocks
Wherein: K
4, K
4 ∈(0,1) is the threshold parameter of system
Then: at B
k(k=1,2 ... n) and the switching of camera lens taken place between its former frame.
Wherein: NBackSkip (d), NBackward (d), NFwdSkip (d), NForward (d) are respectively back to the skip macroblock number among the frame d, backward prediction macroblock number, forward direction skip macroblock number and forward prediction macroblock number, wherein K
3, (K
3>1) is the threshold parameter of system.
In addition, for B
n,
If:
Relevance(f,b)≤K
4·SumofMacroBlocks
K
3·(NBackSkip(d)+NBackward(d))<NFwdSkip(d)+NForward(d)
Then: at B
nWith a frame R thereafter
jBetween the switching of camera lens has taken place.