CN107147947B - Key frame recognition methods and device - Google Patents
Key frame recognition methods and device Download PDFInfo
- Publication number
- CN107147947B CN107147947B CN201710330148.5A CN201710330148A CN107147947B CN 107147947 B CN107147947 B CN 107147947B CN 201710330148 A CN201710330148 A CN 201710330148A CN 107147947 B CN107147947 B CN 107147947B
- Authority
- CN
- China
- Prior art keywords
- frame
- logical frame
- logical
- played
- array
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000003860 storage Methods 0.000 claims description 27
- 238000012790 confirmation Methods 0.000 claims description 11
- 238000005516 engineering process Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 108091081062 Repeated sequence (DNA) Proteins 0.000 description 2
- 230000008901 benefit Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 210000004209 hair Anatomy 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 238000010845 search algorithm Methods 0.000 description 1
Classifications
-
- 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 or rendering scenes according to encoded video stream scene graphs
- H04N21/44008—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving operations for analysing video streams, e.g. detecting features or characteristics in the video stream
-
- 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 or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
- H04N21/440281—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of key frame recognition methods, this method includes:After each logical frame plays, confirm first position of the logical frame for playing and terminating in the Array for structural body of generated logical frame, and the second position of next logical frame to be played in Array for structural body is determined according to first position, judge in Array for structural body, whether the number of the corresponding key frame for adding up to occur before current logic frame in first position and the second position is identical, if identical, then confirm and plays between the logical frame terminated and next logical frame to be played without key frame, and play next logical frame to be played, if differing, then search the first key frame played between the logical frame terminated and next logical frame to be played, and play first key frame.The invention also discloses a kind of key frame identification device, the speed for searching key frame can be improved, reduce the time complexity of lookup, improve the fluency that picture plays.
Description
Technical field
The invention belongs to field of terminal technology more particularly to a kind of key frame recognition methods and devices.
Background technology
With the development of network and terminal technology, disparate networks game, the exploitation of single-play game are quickly grown.In game
Picture is rendered by the logical frame of each game example, and each logical frame needs to inquire next logic after playing
Frame.The case where one logical frame of generally existing often occupies the timeslice of multiple logical frames in game, if occupied time
There is key frame in piece, then play key frame, therefore how to search key frame to become the critical issue that game picture is shown.
In the prior art, key frame is searched by exhaustion, that is, the logical frame corresponding time for enumerating a broadcasting arrives
All logical frames in current time section judge whether each logical frame is key frame, if encountering key frame, is played
Key frame enumerates end, if key frame is encountered, plays the corresponding frame of current time, its linear time of such technology
Complexity is too high, tends not to the reading demand for meeting " tens of thousands of frames per second " in game, to cause display picture not smooth.
Invention content
A kind of key frame recognition methods of present invention offer and device, to by way of construction logic frame structure body array
Key frame is searched, the time complexity of lookup is reduced, improves the fluency of picture.
A kind of key frame recognition methods provided by the invention, including:
After each logical frame plays, structure of the logical frame in generated logical frame of the broadcasting end is confirmed
First position in body array, and determine next logical frame to be played in the Array for structural body according to the first position
In the second position, the Array for structural body includes:Add up by the logical frame of playing sequence arrangement and before each logical frame
The number of the key frame occurred;
Judge in the Array for structural body, the first position and the second position are corresponding in current logic
Whether the number of the accumulative key frame occurred is identical before frame;
If identical, described play between the logical frame terminated and next logical frame to be played without key is confirmed
Frame, and play next logical frame to be played;
If differing, the head played between the logical frame terminated and next logical frame to be played is searched
A key frame, and play the first key frame.
A kind of key frame identification device provided by the invention, including:
First confirmation module, for after each logical frame plays, confirming the logical frame terminated that plays
First position in the Array for structural body of the logical frame of generation, and next logic to be played is determined according to the first position
The second position of the frame in the Array for structural body, the Array for structural body include:By playing sequence arrangement logical frame and
The number of the accumulative key frame occurred before each logical frame;
Judgment module, for judging in the Array for structural body, the first position and the second position are right respectively
Whether the number for the key frame for adding up to occur before current logic frame answered is identical;
Second confirmation module, if for the first position and the second position it is corresponding current logic frame it
The number of the preceding accumulative key frame occurred is identical, then confirm it is described play terminate logical frame with it is described next to be played
Without key frame between logical frame;
Playing module, for playing next logical frame to be played;
Searching module, if it is corresponding tired before current logic frame to be used for the first position and the second position
The number for counting the key frame occurred differs, then searches the logical frame terminated that plays and patrolled with described next to be played
Collect the first key frame between frame;
The playing module is additionally operable to play the first key frame.
From the embodiments of the present invention it is found that key frame recognition methods provided by the invention and device, in each logical frame
After broadcasting, by confirming the first position of logical frame that the broadcasting terminates and next in generated Array for structural body
The second position of logical frame to be played, and judge that first position and the second position are corresponding tired before current logic frame
Count whether the number of key frame occurred is identical, to judge logical frame and next logic to be played that the broadcasting terminates
Next logical frame to be played is played, is terminated if so, then searching the broadcasting if nothing with the presence or absence of key frame between frame
Logical frame and next logical frame to be played between first key frame, and play the first key frame, can simplify and sentence
Process that is disconnected, searching key frame, improves the speed for searching key frame, reduces the time complexity of lookup, largely accelerate
Calculating time improves the fluency that picture plays.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those skilled in the art without having to pay creative labor, can be with root
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is the flow diagram for the key frame recognition methods that first embodiment of the invention provides;
Fig. 2 is the flow diagram for the key frame recognition methods that second embodiment of the invention provides;
Fig. 3 is the structural schematic diagram for the key frame identification device that third embodiment of the invention provides;
Fig. 4 is the structural schematic diagram for the key frame identification device that fourth embodiment of the invention provides
Fig. 5 is the terminal hardware structure chart that key frame recognition methods is executed in the present invention.
Specific implementation mode
In order to make the invention's purpose, features and advantages of the invention more obvious and easy to understand, below in conjunction with the present invention
Attached drawing in embodiment, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described reality
It is only a part of the embodiment of the present invention to apply example, and not all embodiments.Based on the embodiments of the present invention, people in the art
The every other embodiment that member is obtained without making creative work, shall fall within the protection scope of the present invention.
The typical case scene of the following embodiment of the present invention is in game running, in each logical frame of game picture
After broadcasting, which may occupy the playing duration of other logical frames because of reproduction time length, it is therefore desirable to judge
It whether there is key frame between the logical frame terminated and next logical frame to be played playing, directly played under this if without if
One logical frame to be played, searches if having and plays key frame.The description of specific technical solution is referring to following each embodiments.
Fig. 1 is referred to, Fig. 1 is the flow diagram for the key frame recognition methods that first embodiment of the invention provides, the pass
Key frame recognition methods can be applicable in terminal, which includes PC machine (personal computer), mobile phone, tablet computer, intelligence
Energy game machine etc..This method includes:
101, after each logical frame plays, confirm logical frame that the broadcasting terminates generated logical frame knot
First position in structure body array, and determine next logical frame to be played in the Array for structural body according to the first position
The second position;
The Array for structural body includes:By the logical frame (FrameIndex) of playing sequence arrangement and before each logical frame
The number (NumKeyFrame) of the accumulative key frame occurred.Specifically, if logical frame A, logical frame B, logical frame C, logical frame
D, logical frame E presses playing sequence, and wherein logical frame B is continuously played 2 times, then the specific format of the Array for structural body such as table 1:
Table 1
FrameIndex | A | B | B | C | D | E |
NumKeyFrame | 0 | 1 | 1 | 1 | 1 | 1 |
The Array for structural body one array element of each row correspondence, two tuples of each array element correspondence (FrameIndex,
NumKeyFrame).In order to search conveniently, array element is set for array element and indexes (ArrayIndex), indicates logical frame
The storage location of playing sequence and logical frame.FrameIndex in ArrayIndex and the Array for structural body and
The correspondence of NumKeyFrame such as table 2:
Table 2
ArrayIndex | 0 | 1 | 2 | 3 | 4 | 5 |
FrameIndex | A | B | B | C | D | E |
NumKeyFrame | 0 | 1 | 1 | 1 | 1 | 1 |
The structure of the Array for structural body of the logical frame is described below in detail, which specifically includes following two
Point:
Logical frame (FrameIndex), also known as logic frame index, each logical frame are arranged in Array for structural body by playing sequence
Row, it is corresponding with the position of array element index ArrayIndex instructions, that is, logical frame A, logical frame B, logical frame C, logical frame
D, logical frame E is stored in by playing sequence in the Array for structural body, and wherein logical frame B is repeated playing once, using with for the first time
Different another array element storages is played, the value of array element index increases by 1.
Add up the number (NumKeyFrame) of the key frame occurred before each logical frame, it should be noted that when
Preceding logical frame is if key frame, the then corresponding NumKeyFrame stored counts of current logic frame, that is, by current logic frame
The number of NumKeyFrame increases by 1.For example, logical frame B is key frame in table 1, before without key frame, then by logical frame B's
NumKeyFrame records are revised as 1 by 0.When logical frame B is repeated playing again, not repeat count key frame, therefore the structure
The NumKeyFrame of each logical frame played after logical frame B in array is recorded as 1.
Position of the logical frame in Array for structural body is the letter for the Array for structural body that can be preserved by the logical frame itself
Breath determination, its own position in Array for structural body is stored in each logical frame, which is in the Array for structural body
It is recorded in while generation in each logical frame.For example, it is C to play the logical frame terminated, its recorded in logical frame C is in table 2
Array for structural body in corresponding ArrayIndex be 3, it is determined that the first position of logical frame C be 3.
In the embodiment of the present invention, the logical frame which terminates is F, structures of the logical frame F in generated logical frame
First position in array indexes ArrayIndex1 with array element and indicates, next logical frame to be played is F ', logical frame
The second positions of the F ' in the Array for structural body indexes ArrayIndex2 with array element and indicates.
Specifically, according to the slice of the broadcasting time difference, each logical frame between ArrayIndex1, logical frame F and logical frame F '
Duration determines ArrayIndex2 jointly.
102, judge in the Array for structural body, the first position is corresponding with the second position in current logic frame
Whether the number for adding up the key frame occurred before is identical;
The corresponding NumKeyFrame of ArrayIndex1 are searched in the Array for structural body, and, search ArrayIndex2
Corresponding NumKeyFrame judges that ArrayIndex1 corresponding NumKeyFrame and ArrayIndex2 are corresponding
Whether NumKeyFrame is identical.
For example, it is specific as shown in table 1, if the first position is 1, the corresponding NumKeyFrame in Array for structural body
It is 1, if the second position is 4, corresponding NumKeyFrame is 1 in Array for structural body, judges this two
Whether NumKeyFrame is identical.
If identical, 103 are thened follow the steps;If differing, 104 are thened follow the steps.
103, confirm between the logical frame and next logical frame to be played that the broadcasting terminates without key frame, and play
Next logical frame to be played;
If the corresponding NumKeyFrame of ArrayIndex1 NumKeyFrames corresponding with ArrayIndex2 is identical, really
Recognize between logical frame F and logical frame F ' without key frame, can all skip, directly plays logical frame F '.
104, the first key frame between the logical frame and next logical frame to be played that the broadcasting terminates is searched, and
Play the first key frame.
If the corresponding NumKeyFrame of ArrayIndex1 NumKeyFrames corresponding with ArrayIndex2 is differed,
The first key frame between logical frame F and logical frame F ' can be searched by Predistribution Algorithm, and plays the first key frame.
In an example, referring to table 2, the logical frame that end is played in Array for structural body is B, and logical frame B is first
Secondary broadcasting, corresponding first position are 1, and corresponding NumKeyFrame is 1, the second of next logical frame D to be played
4 are set to, corresponding NumKeyFrame is 1, this two NumKeyFrame are identical, therefore, directly plays logical frame D.
In another example, referring to table 2, the logical frame that end is played in Array for structural body is A, and logical frame A is corresponded to
First position be 0, corresponding NumKeyFrame is 0, and the second position of next logical frame D to be played is 4, corresponding
NumKeyFrame is 1, this two NumKeyFrame differences, therefore, searches the first key between logical frame A and logical frame D
Frame, that is, logical frames different from logical frame A first NumKeyFrame is first key frame.In table 2, first
Logical frames different from logical frame A NumKeyFrame is B, that is, logical frame B is the key frame found, plays logical frame B.
In the embodiment of the present invention, after each logical frame plays, by confirming in generated Array for structural body
The second position of the first position for the logical frame that the broadcasting terminates and next logical frame to be played, and judge first position and
Whether the number of the corresponding key frame for adding up to occur before current logic frame in the second position is identical, to judge that this is broadcast
It puts and it is next to play this if nothing with the presence or absence of key frame between the logical frame of end and next logical frame to be played
Logical frame to be played, if so, then searching the head between the logical frame and next logical frame to be played that the broadcasting terminates
A key frame, and the first key frame is played, the process that can simplify judgement, search key frame improves the speed for searching key frame,
The time complexity searched is reduced, largely accelerates and calculates the time, improves the fluency that picture plays.
Fig. 2 is referred to, Fig. 2 is the key frame recognition methods that second embodiment of the invention provides, and be can be applied in terminal, should
Method includes:
201, when client terminal start-up load Initial page, according to reproduction time sequential storage logical frame to be played, and remember
The accumulative number of key frames occurred, obtains the Array for structural body of logical frame before recording each logical frame;
The client can be game class client, the client terminal start-up, and game initial picture starts after loading and rendering
Display is on a terminal screen.Game picture is carried in client terminal start-up, while generating the structure of each logical frame of the game picture
Array.According to the logical frame that reproduction time sequential storage is to be played in the Array for structural body, and, record each logical frame it
The number of key frames of preceding accumulative appearance.
Specifically, which includes:Add up by the logical frame of playing sequence arrangement and before each logical frame
The number of the key frame occurred.The each row of the Array for structural body correspond to an array element, and each array element corresponds to binary
Group (FrameIndex, NumKeyFrame).
The Array for structural body specifically includes following two parts:
Logical frame (FrameIndex), also known as logic frame index, each logical frame is arranged in table by playing sequence, with array
Element index is corresponding, that is, logical frame A, logical frame B, logical frame C, logical frame D, logical frame E are stored in the knot by playing sequence
In structure body array, wherein logical frame B is repeated playing once, is stored using the array element different from playing for the first time, array member
Plain index value increases by 1;
Add up the number (NumKeyFrame) of the key frame occurred before each logical frame, it should be noted that when
Preceding logical frame then executes stored count if key frame, and the number of the NumKeyFrame of current logic frame is increased by 1.
Array element is set for array element and indexes (ArrayIndex), indicates the playing sequence and logical frame of logical frame
Storage location.
The concrete structure of the Array for structural body of logical frame is identical as the table 1 of aforementioned first embodiment, ArrayIndex with
Correspondence between FrameIndex, NumKeyFrame is identical as the table 2 of aforementioned first embodiment.
Further, it if same logical frame repeats playing repeatedly, in the Array for structural body, is repeated playing according to this
The playing sequence of logical frame stores the logic repeated playing using the array element of quantity identical as logical frame broadcasting time
Frame a, that is, logical frame plays how many times, and just correspondence is patrolled using how many a array elements what is repeated playing according to playing sequence
Frame is collected to record respectively.For example, in table 2, logical frame B plays 2 times, just according to playing sequence, in ArrayIndex1 and
The storage logical frame B of two positions 2 times of ArrayIndex2.
202, it is that each logical frame generates array element index according to storage location, and records logical frame in each logical frame
Position in each leisure Array for structural body;
Array element index is generated according to storage location for the logical frame of storage, can be indexed according to array element rapidly true
Position of the logical frame in the Array for structural body is determined, to accelerate to judge, search the speed of key frame.
Meanwhile the position in each comfortable Array for structural body of logical frame is recorded in each logical frame, by inquiring each logic
Frame can know storage location of each logical frame in the Array for structural body.It further increases and confirms logical frame in the structure
The convenience of position in array.
203, after each logical frame plays, confirm logical frame that the broadcasting terminates in the generated structure number
First position in group, and of next logical frame to be played in the Array for structural body is determined according to the first position
Two positions;
In the embodiment of the present invention, the logical frame which terminates is F, structures of the logical frame F in generated logical frame
First position in array indexes ArrayIndex1 with array element and indicates, next logical frame to be played is F ', logical frame
The second positions of the F ' in the Array for structural body indexes ArrayIndex2 with array element and indicates.
It can know ArrayIndex1 by the information of query logic frame F records.For example, in table 2, patrolling for end is played
It is E to collect frame, and logical frame E corresponding ArrayIndex in Array for structural body are 4, and logical frame E generates same in Array for structural body
When also record pass through the record information of query logic frame E, it may be determined that logical frame E's from position in Array for structural body
Position is 4.
After each logical frame plays, ArrayIndex2 can be according to ArrayIndex1, logical frame F and logic
The broadcasting time difference between frame F ', and, the isochronous surface length of preset each logical frame determines jointly.
Specifically, after logical frame F is played, the beginning of the broadcast start time T1, logical frame F ' of logical frame F are obtained
The average time slice length L of reproduction time T2, each logical frame, the wherein broadcast start time T2 of logical frame F ' is logic
The end reproduction time of frame F.The isochronous surface that multiple logical frames may be occupied between time interval [T1, T2], according to patrolling
Collect the average duration slice length of frame, the second positions of the calculating logic frame F ' in the Array for structural body.
It is ArrayIndex1 to enable the first position, and it is ArrayIndex2 to enable the second position, then:
ArrayIndex2=ArrayIndex1+ (T2-T1)/L
204, judge in the Array for structural body, the first position is corresponding with the second position in current logic frame
Whether the number for adding up the key frame occurred before is identical;
The corresponding NumKeyFrame of ArrayIndex1 are searched in the Array for structural body, and, search ArrayIndex2
Corresponding NumKeyFrame judges that the ArrayIndex1 corresponding NumKeyFrame and ArrayIndex2 searched are corresponding
Whether NumKeyFrame is identical.
If identical, 205 are thened follow the steps;If differing, 206 are thened follow the steps.
205, confirm between the logical frame and next logical frame to be played that the broadcasting terminates without key frame, and play
Next logical frame to be played;
If the corresponding NumKeyFrame of ArrayIndex1 NumKeyFrames corresponding with ArrayIndex2 is identical, really
Recognize between logical frame F and logical frame F ' without key frame, can all skip, directly plays logical frame F '.
If the probability that key frame occurs is p, by comparing the key frame for adding up to occur before current logic frame
Number, confirm between the logical frame and next logical frame to be played that the broadcasting terminates without key frame, can all skip,
Next logical frame to be played is directly played, time complexity can be reduced, the time complexity after reduction is non-key
The probability (1-p) of frame is multiplied by query time O (1), that is, O (1-p).
206, the first key frame between the logical frame and next logical frame to be played that the broadcasting terminates is searched, and
Play the first key frame.
If the corresponding NumKeyFrame of ArrayIndex1 NumKeyFrames corresponding with ArrayIndex2 is differed,
By binary chop algorithm, the changed positions first NumKeyFrame between logical frame F and logical frame F ' are searched.I.e.
The corresponding logical frame of array element of ArrayIndex minimums is searched, and meets the logical frame in the Array for structural body
The value of NumKeyFrame is (F.NumKeyFrame+1), wherein F.NumKeyFrame is in Array for structural body
The number of the key frame for being accumulated to logical frame F of the corresponding position records of ArrayIndex1.
Wherein, binary chop algorithm is also known as binary search algorithm, suitable for infrequently changing and searching frequently has sequence
Table, the binary chop algorithm are to search the position that object element first appears, advantage is to compare in the array for having repeat element
Number is few, and search speed is fast, and average behavior is good.
Specifically, in the present embodiment, by the Array for structural body two positions ArrayIndex1 and ArrayIndex2 points
Not corresponding NumKeyFrame values compare, if identical, illustrate between ArrayIndex1 and ArrayIndex2 without key
Frame directly plays the logical frame at ArrayIndex2;If it is different, then illustrate ArrayIndex1 and ArrayIndex2 it
Between have key frame, need the position that key frame is first appeared between binary chop ArrayIndex1 and ArrayIndex2 at this time,
That is the value of NumKeyFrame is patrolling for (F.NumKeyFrame+1) for the first time between lookup ArrayIndex1 and ArrayIndex2
Collect frame.Binary chop algorithm search key frame process be:The average value of ArrayIndex1 and ArrayIndex2 are taken first
Mid, if the NumberKeyFrame value ratios (F.NumKeyFrame+1) at the positions mid are small, [mid+1,
ArrayIndex2] between search NumKeyFrame value for the first time be (F.NumKeyFrame+1) element;If the positions mid
The NumberKeyFrame value ratios (F.NumKeyFrame+1) at place are big or equal with (F.NumKeyFrame+1), then exist
The value that NumKeyFrame is searched between [ArrayIndex1, mid] is the logical frame of (F.NumKeyFrame+1) for the first time, until
The left margin of binary chop is more than or equal to right margin, then stops searching.At this point, the logical frame at left margin is first
The value of NumKeyFrame is the logical frame of (F.NumKeyFrame+1), so the logical frame at the left margin is to occur for the first time
Key frame, the logical frame of lookup is determined as between the logical frame and next logical frame to be played that the broadcasting terminates
First key frame, and play the logical frame.
If the probability that key frame occurs is p, by by binary chop algorithm, searching the logic that the broadcasting terminates
First key frame between frame and next logical frame to be played, and the first key frame is played, it is multiple that the time can be reduced
Miscellaneous degree, the time complexity after reduction are that the Probability p of key frame is multiplied by query time O (logn), i.e. O (p*logn).
In the embodiment of the present invention, after each logical frame plays, by confirming in generated Array for structural body
The second position of the first position for the logical frame that the broadcasting terminates and next logical frame to be played, and judge first position and
Whether the number of the corresponding key frame for adding up to occur before current logic frame in the second position is identical, to judge that this is broadcast
It puts and it is next to play this if nothing with the presence or absence of key frame between the logical frame of end and next logical frame to be played
Logical frame to be played, if so, then searching the head between the logical frame and next logical frame to be played that the broadcasting terminates
A key frame, and the first key frame is played, the process that can simplify judgement, search key frame improves the speed for searching key frame,
The time complexity searched is reduced, largely accelerates and calculates the time, improves the fluency that picture plays.
Fig. 3 is referred to, Fig. 3 is that the key frame identification device that third embodiment of the invention provides only shows for convenience of description
Go out and the relevant part of the embodiment of the present invention.The device can be built in terminal, which includes:
First confirmation module 301, judgment module 302, the second confirmation module 303, playing module 304 and searching module 305.
Wherein, the first confirmation module 301, for after each logical frame plays, confirming the logic that the broadcasting terminates
First position of the frame in the Array for structural body of generated logical frame, and determined according to the first position next to be played
The second position of the logical frame in the Array for structural body, the Array for structural body include:By playing sequence arrangement logical frame and
The number of the accumulative key frame occurred before each logical frame;
The Array for structural body may include:Add up to occur by the logical frame of playing sequence arrangement and before each logical frame
The number for the key frame crossed.
Logical frame (FrameIndex), also known as logic frame index, each logical frame is arranged in table by playing sequence, with array
Element index is corresponding.
Add up the number (NumKeyFrame) of the key frame occurred before each logical frame, it should be noted that when
The number of the NumKeyFrame of current logic frame is increased by 1 by preceding logical frame if key frame, then stored count.
In order to search conveniently, array element is set for array element and indexes (ArrayIndex), indicates the broadcasting of logical frame
The storage location of sequence and logical frame.
Judgment module 302, for judging in the Array for structural body, the first position is corresponding with the second position
Whether the number for adding up the key frame occurred before current logic frame is identical.
Judge that the corresponding NumKeyFrame in first position and the second position are corresponding in the Array for structural body
Whether NumKeyFrame is identical.
Second confirmation module 303, if for the judgment module judge the result is that:The first position and the second position point
The number of the not corresponding key frame for adding up to occur before current logic frame is identical, then confirms the logical frame that the broadcasting terminates
Without key frame between next logical frame to be played.
If can all be skipped without key frame between logical frame and next logical frame to be played that the broadcasting terminates,
Directly play next logical frame to be played.
Playing module 304, for playing next logical frame to be played.
Searching module 305, if for the judgment module judge the result is that:The first position and the second position are right respectively
The number of key frame for adding up to occur before current logic frame answered differs, then search logical frame that the broadcasting terminates with
First key frame between next logical frame to be played.
Playing module 304 is additionally operable to play the first key frame.
The method that device in the embodiment of the present invention is used to execute embodiment described in earlier figures 1, techniques not described details
Identical as aforementioned embodiment illustrated in fig. 1, details are not described herein again.
In the embodiment of the present invention, after each logical frame plays, by confirming in generated Array for structural body
The second position of the first position for the logical frame that the broadcasting terminates and next logical frame to be played, and judge first position and
Whether the number of the corresponding key frame for adding up to occur before current logic frame in the second position is identical, to judge that this is broadcast
It puts and whether is closed there are key frame between the logical frame of end and next logical frame to be played, if nothing, it is next to play this
Logical frame to be played, if so, then searching the head between the logical frame and next logical frame to be played that the broadcasting terminates
A key frame, and the first key frame is played, the process that can simplify judgement, search key frame improves the speed for searching key frame,
The time complexity searched is reduced, largely accelerates and calculates the time, improves the fluency that picture plays.
Fig. 4 is referred to, Fig. 4 is that the key frame identification device that fourth embodiment of the invention provides only shows for convenience of description
Go out and the relevant part of the embodiment of the present invention.The device can be built in terminal, and device shown in the present embodiment is as shown in figure 3
Device the difference is that, the device also one progress includes:
Generation module 406 is used for when client terminal start-up loads initial picture, to be played according to reproduction time sequential storage
Logical frame, and record the accumulative number of key frames occurred before each logical frame, obtain the Array for structural body of logical frame.
Generation module 406 is additionally operable to generate array element index according to storage location for each logical frame.
The client can be game class client, the client terminal start-up, and game initial picture starts after loading and rendering
Display is on a terminal screen.Game picture is carried in client terminal start-up, while generating the structure of each logical frame of the game picture
Array.According to the logical frame that reproduction time sequential storage is to be played in the Array for structural body, and record each logical frame it
The number of key frames of preceding accumulative appearance.Meanwhile array element index, Ke Yixun are generated according to storage location for the logical frame of storage
Speed indexes the position for determining logical frame in the Array for structural body according to array element, to accelerate to judge, search key frame
Speed.
The device can further include:
Logging modle 407, for recording the position in each comfortable Array for structural body of logical frame in each logical frame.
It can know storage location of each logical frame in the Array for structural body by inquiring each logical frame.Further carry
Height confirms the convenience of logical frame position in the Array for structural body.
Further, generation module 406 repeat playing repeatedly if being additionally operable to same logical frame, in the Array for structural body
In, according to the playing sequence of the logical frame repeated playing, deposited using the array element of quantity identical as logical frame broadcasting time
Store up the logical frame repeated playing.
That is, a logical frame plays how many times, just corresponds to and replayed using how many a array element counterweights according to playing sequence
The logical frame put records respectively.For example, in table 2, logical frame B plays 2 times, just according to playing sequence, in ArrayIndex1 and
The storage logical frame B of two positions 2 times of ArrayIndex2.
Further, searching module 305 are specifically used for, by binary chop algorithm, searching the logical frame that the broadcasting terminates
Between next logical frame to be played, the number of the first key frame for adding up to occur before current logic frame occurs
The position of variation.
The device further includes:
Determining module 408 next is waited for for the logical frame of the position to be determined as logical frame that the broadcasting terminates with this
First key frame between the logical frame of broadcasting.
The binary chop algorithm is to search the position that object element first appears in the array for having repeat element.Specifically
Two position ArrayIndex1 of Array for structural body NumKeyFrame values corresponding with ArrayIndex2 are compared on ground
Compared with if it is different, then illustrating there is key frame between ArrayIndex1 and ArrayIndex2, needing binary chop at this time
The position of key frame is first appeared between ArrayIndex1 and ArrayIndex2, that is, search ArrayIndex1 and
The value of NumKeyFrame is the element of (F.NumKeyFrame+1) for the first time between ArrayIndex2.Binary chop algorithm is searched
The process of key frame is:The average value mid of ArrayIndex1 and ArrayIndex2 is taken first, if at the positions mid
NumberKeyFrame value ratios (F.NumKeyFrame+1) are small, then are searched between [mid+1, ArrayIndex2]
The value of NumKeyFrame is the logical frame of (F.NumKeyFrame+1) for the first time;If the NumberKeyFrame at the positions mid
Value is bigger or equal with (F.NumKeyFrame+1) than (F.NumKeyFrame+1), then is looked between [ArrayIndex1, mid]
It is the logical frame of (F.NumKeyFrame+1) for the first time to look for the value of NumKeyFrame, until the left margin of binary chop is more than or equal to
Right margin then stops searching, and the value that the logical frame at left margin is first NumKeyFrame at this time is (F.NumKeyFrame
+ 1) logical frame of lookup is determined as by logical frame so the logical frame at the left margin is the key frame occurred for the first time
First key frame between logical frame and next logical frame to be played that the broadcasting terminates, and play the logical frame.
First confirmation module 301 is specifically used for after each logical frame plays, obtains the logical frame that the broadcasting terminates
Broadcast start time T1 and next logical frame to be played broadcast start time T2, and, each logical frame
Average time slice length L;
It is ArrayIndex1 to enable the first position, and it is ArrayIndex2 to enable the second position, then:
ArrayIndex2=ArrayIndex1+ (T2-T1)/L.
Techniques not described details in the embodiment of the present invention, it is identical referring to each embodiment shown in 1~Fig. 3 of earlier figures, this
Place repeats no more.
In the embodiment of the present invention, after each logical frame plays, by confirming in generated Array for structural body
The second position of the first position for the logical frame that the broadcasting terminates and next logical frame to be played, and judge first position and
Whether the number of the corresponding key frame for adding up to occur before current logic frame in the second position is identical, to judge that this is broadcast
It puts and whether is closed there are key frame between the logical frame of end and next logical frame to be played, if nothing, it is next to play this
Logical frame to be played, if so, then searching the head between the logical frame and next logical frame to be played that the broadcasting terminates
A key frame, and the first key frame is played, the process that can simplify judgement, search key frame improves the speed for searching key frame,
The time complexity searched is reduced, largely accelerates and calculates the time, improves the fluency that picture plays.
Fig. 5 is the terminal structure schematic diagram provided in an embodiment of the present invention for executing key frame recognition methods.
Terminal described in the present embodiment, including:
At least one input equipment 51;At least one output equipment 52;At least one processor 53, such as central processing
Device;And memory 54.
Above-mentioned input equipment 51, output equipment 52, processor 53 and memory 54 are connected by bus 55.
Wherein, input equipment 51 concretely camera, touch panel, physical button or mouse etc..Output equipment
52 concretely display screens.
Memory 54 can be high random access memory body (RAM, Random Access Memory) memory, also may be used
For non-labile memory (non-volatile memory), such as magnetic disk storage.Memory 54 can for storing one group
Program code is executed, processor 53 is coupled with memory 54, and above-mentioned input equipment 51, output equipment 52 and processor 53 are for leading to
The executable program code stored in memory 54 is crossed, following operation is executed:
The code is executed by processor 53, executes the key frame identification as described in 1~embodiment illustrated in fig. 2 of earlier figures
Method.
Specifically, i.e., after each logical frame plays, confirm that the logical frame terminated that plays is patrolled generated
The first position in the Array for structural body of frame is collected, and determines next logical frame to be played described according to the first position
The second position in Array for structural body, the Array for structural body include:By the logical frame of playing sequence arrangement and in each logic
The number of the accumulative key frame occurred before frame;Judge in the Array for structural body, the first position and described second
Whether the number of the corresponding key frame for adding up to occur before current logic frame in position is identical;If identical, confirm
It is described to play between the logical frame terminated and next logical frame to be played without key frame, and play described next wait for
The logical frame of broadcasting;If differing, search it is described play the logical frame and the next logical frame to be played that terminate it
Between first key frame, and play the first key frame.
In multiple embodiments provided herein, it should be understood that disclosed method and apparatus can pass through it
Its mode is realized.For example, the embodiment of device described above is only schematical, for example, the division of the module,
Only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple module or components can be with
In conjunction with or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed
Mutual coupling or direct-coupling or communication linkage can be by some interfaces, the INDIRECT COUPLING of device or module or
Communication linkage can be electrical, machinery or other forms.
The module illustrated as separating component may or may not be physically separated, aobvious as module
The component shown may or may not be physical module, you can be located at a place, or may be distributed over multiple
On network module.Some or all of module therein can be selected according to the actual needs to realize the mesh of this embodiment scheme
's.
In addition, each function module in each embodiment of the present invention can be integrated in a processing module, it can also
That modules physically exist alone, can also two or more modules be integrated in a module.Above-mentioned integrated mould
The form that hardware had both may be used in block is realized, can also be realized in the form of software function module.
If the integrated module is realized in the form of software function module and sells or use as independent product
When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention
Portion or part steps.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
It should be noted that for each method embodiment above-mentioned, describe, therefore it is all expressed as a series of for simplicity
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the described action sequence because
According to the present invention, certain steps may be used other sequences or be carried out at the same time.Secondly, those skilled in the art should also know
It knows, embodiment described in this description belongs to preferred embodiment, and involved action and module might not all be this hairs
Necessary to bright.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment
Point, it may refer to the associated description of other embodiments.
It is the description to key frame recognition methods and key frame identification device provided by the present invention above, for this field
Those skilled in the art, the thought of embodiment, has change in specific embodiments and applications according to the present invention
Place, to sum up, the content of the present specification should not be construed as limiting the invention.
Claims (10)
1. a kind of key frame recognition methods, which is characterized in that including:
After each logical frame plays, structure number of the logical frame in generated logical frame of the broadcasting end is confirmed
First position in group, and determine next logical frame to be played in the Array for structural body according to the first position
The second position, the Array for structural body include:Add up to occur by the logical frame of playing sequence arrangement and before each logical frame
The number for the key frame crossed;
Judge in the Array for structural body, it is accumulative before the corresponding logical frame in the first position and the second position
Whether the number of the key frame occurred is identical;
If identical, confirm it is described play between the logical frame terminated and next logical frame to be played without key frame,
And play next logical frame to be played;
If differing, the first pass played between the logical frame terminated and next logical frame to be played is searched
Key frame, and play the first key frame.
2. according to the method described in claim 1, it is characterized in that, described after each logical frame plays, described in confirmation
First position of the logical frame terminated in the Array for structural body of generated logical frame is played, includes before:
When client terminal start-up loads initial picture, according to reproduction time sequential storage logical frame to be played, and records and each patrol
The accumulative number of key frames occurred, obtains the Array for structural body of logical frame before collecting frame;
For each logical frame array element index is generated according to storage location;
The position in each leisure Array for structural body of logical frame is recorded in each logical frame.
3. according to the method described in claim 2, it is characterized in that, the method further includes:
If same logical frame repeats playing repeatedly, in the Array for structural body, according to the logical frame repeated playing
Playing sequence, the logical frame that repeats playing described in the array element storage using quantity identical as logical frame broadcasting time.
4. method according to any one of claims 1 to 3, which is characterized in that described to search the logic for playing and terminating
First key frame between frame and next logical frame to be played, including:
By binary chop algorithm, between searching the logical frame and next logical frame to be played for playing end,
The changed position of number of the first accumulative key frame occurred;
By the logical frame of the position be determined as it is described play the logical frame and the next logical frame to be played that terminate it
Between first key frame.
5. according to the method described in claim 4, it is characterized in that, it is described determined according to the first position it is next to be played
The second position of the logical frame in the Array for structural body, including:
After each logical frame plays, the broadcast start time T1, described next of the logical frame for playing and terminating is obtained
The broadcast start time T2 of a logical frame to be played, and, the average time slice length L of each logical frame;
It is ArrayIndex1 to enable the first position, and it is ArrayIndex2 to enable the second position, then:
ArrayIndex2=ArrayIndex1+ (T2-T1)/L.
6. a kind of key frame identification device, which is characterized in that described device includes:
First confirmation module, for after each logical frame plays, confirming that the logical frame terminated that plays is generating
Logical frame Array for structural body in first position, and determine that next logical frame to be played exists according to the first position
The second position in the Array for structural body, the Array for structural body include:By the logical frame of playing sequence arrangement and each
The number of the accumulative key frame occurred before logical frame;
Judgment module, for judging in the Array for structural body, the first position and the second position are corresponding
Whether the number of the accumulative key frame occurred is identical before logical frame;
Second confirmation module, if occurring for accumulative before the corresponding logical frame in the first position and the second position
The number for the key frame crossed is identical, then confirms described play between the logical frame terminated and next logical frame to be played
Without key frame;
Playing module, for playing next logical frame to be played;
Searching module, if occurring for accumulative before the corresponding logical frame in the first position and the second position
The number of key frame differs, then searches described play between the logical frame terminated and next logical frame to be played
First key frame;
The playing module is additionally operable to play the first key frame.
7. device according to claim 6, which is characterized in that described device further includes:
Generation module is used for when client terminal start-up loads initial picture, according to reproduction time sequential storage logic to be played
Frame, and add up the number of key frames occurred before recording each logical frame, obtain the Array for structural body of logical frame;
The generation module is additionally operable to generate array element index according to storage location for each logical frame;
Logging modle, for recording the position in each leisure Array for structural body of logical frame in each logical frame.
8. device according to claim 7, which is characterized in that the generation module repeats if being additionally operable to same logical frame
It plays repeatedly, then in the Array for structural body, according to the playing sequence of the logical frame repeated playing, use and logical frame
The logical frame repeated playing described in the array element storage of the identical quantity of broadcasting time.
9. according to claim 6 to 8 any one of them device, which is characterized in that
The searching module, be specifically used for searching by binary chop algorithm it is described play the logical frame that terminates with it is described next
Between a logical frame to be played, the changed position of number of the first accumulative key frame occurred;
Described device further includes:
Determining module next waits broadcasting for the logical frame of the position to be determined as the logical frame terminated that plays with described
First key frame between the logical frame put.
10. device according to claim 9, which is characterized in that first confirmation module is specifically used in each logic
After frame plays, the broadcast start time T1 of the logical frame for playing and terminating, next logic to be played are obtained
The broadcast start time T2 of frame, and, the average time slice length L of each logical frame;
It is ArrayIndex1 to enable the first position, and it is ArrayIndex2 to enable the second position, then:
ArrayIndex2=ArrayIndex1+ (T2-T1)/L.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710330148.5A CN107147947B (en) | 2017-05-11 | 2017-05-11 | Key frame recognition methods and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710330148.5A CN107147947B (en) | 2017-05-11 | 2017-05-11 | Key frame recognition methods and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107147947A CN107147947A (en) | 2017-09-08 |
CN107147947B true CN107147947B (en) | 2018-07-13 |
Family
ID=59777789
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710330148.5A Active CN107147947B (en) | 2017-05-11 | 2017-05-11 | Key frame recognition methods and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107147947B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114022948A (en) * | 2020-07-17 | 2022-02-08 | 北京中关村科金技术有限公司 | Lip language preprocessing method, device and storage medium |
CN111744177B (en) * | 2020-07-28 | 2021-06-25 | 腾讯科技(深圳)有限公司 | Game data processing method and device, storage medium and electronic equipment |
CN114845164A (en) * | 2021-02-02 | 2022-08-02 | 中国移动通信有限公司研究院 | Data processing method, device and equipment |
CN114699767A (en) * | 2022-04-15 | 2022-07-05 | 北京字跳网络技术有限公司 | Game data processing method, device, medium and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102340705A (en) * | 2010-07-19 | 2012-02-01 | 中兴通讯股份有限公司 | System and method for obtaining key frame |
CN102611894A (en) * | 2012-03-02 | 2012-07-25 | 华为技术有限公司 | Method, device and system for detecting video transmission packet loss |
CN103974061A (en) * | 2014-05-27 | 2014-08-06 | 合一网络技术(北京)有限公司 | Play test method and system |
CN104391973A (en) * | 2014-12-05 | 2015-03-04 | 国家电网公司 | Multimedia system for key frame extraction and processing method |
CN104869477A (en) * | 2015-05-14 | 2015-08-26 | 无锡天脉聚源传媒科技有限公司 | Method and device for segmented playing of video |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7143353B2 (en) * | 2001-03-30 | 2006-11-28 | Koninklijke Philips Electronics, N.V. | Streaming video bookmarks |
JP2006074531A (en) * | 2004-09-03 | 2006-03-16 | Canon Inc | Data recording reproducing device and method |
CN101841692B (en) * | 2010-04-23 | 2011-11-23 | 深圳市茁壮网络股份有限公司 | Method for fast forwarding and fast rewinding video stream |
-
2017
- 2017-05-11 CN CN201710330148.5A patent/CN107147947B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102340705A (en) * | 2010-07-19 | 2012-02-01 | 中兴通讯股份有限公司 | System and method for obtaining key frame |
CN102611894A (en) * | 2012-03-02 | 2012-07-25 | 华为技术有限公司 | Method, device and system for detecting video transmission packet loss |
CN103974061A (en) * | 2014-05-27 | 2014-08-06 | 合一网络技术(北京)有限公司 | Play test method and system |
CN104391973A (en) * | 2014-12-05 | 2015-03-04 | 国家电网公司 | Multimedia system for key frame extraction and processing method |
CN104869477A (en) * | 2015-05-14 | 2015-08-26 | 无锡天脉聚源传媒科技有限公司 | Method and device for segmented playing of video |
Also Published As
Publication number | Publication date |
---|---|
CN107147947A (en) | 2017-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107147947B (en) | Key frame recognition methods and device | |
US20200042507A1 (en) | Information Processing Method and Apparatus | |
EP3767483B1 (en) | Method, device, system, and server for image retrieval, and storage medium | |
JP3340532B2 (en) | Video search method and apparatus | |
CN101443849B (en) | Video browsing user interface | |
CN105389590B (en) | Video clustering recommendation method and device | |
US11907659B2 (en) | Item recall method and system, electronic device and readable storage medium | |
CN102368255A (en) | Information storage and retrieval | |
CN102609465B (en) | Information recommendation method based on potential communities | |
US6389424B1 (en) | Insertion method in a high-dimensional index structure for content-based image retrieval | |
CN106294418B (en) | Search method and searching system | |
US8661040B2 (en) | Grid-based data clustering method | |
CN104636349A (en) | Method and equipment for compression and searching of index data | |
CN106557499A (en) | HBase secondary indexs creation method and device | |
CN107203532A (en) | Construction method, the implementation method of search and the device of directory system | |
CN104902292A (en) | Television report-based public opinion analysis method and system | |
CN106201218A (en) | Method and device for clearing picture files in chat records and mobile device | |
CN105354283A (en) | Resource searching method and apparatus | |
CN111147940B (en) | Video playing method and device, computer equipment and medium | |
CN104834728B (en) | A kind of method for pushing and device for subscribing to video | |
CN104778202B (en) | The analysis method and system of event evolutionary process based on keyword | |
CN107992526B (en) | Anchor recommendation method, storage device and computer device | |
CN107229701B (en) | Ranking update method, device and computer equipment | |
CN107203550B (en) | Data processing method and database server | |
CN108681549A (en) | Method and device for acquiring multimedia resources |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |