Nothing Special   »   [go: up one dir, main page]

CN104166614B - The frame per second detection method and relevant apparatus of a kind of mobile device - Google Patents

The frame per second detection method and relevant apparatus of a kind of mobile device Download PDF

Info

Publication number
CN104166614B
CN104166614B CN201310185743.6A CN201310185743A CN104166614B CN 104166614 B CN104166614 B CN 104166614B CN 201310185743 A CN201310185743 A CN 201310185743A CN 104166614 B CN104166614 B CN 104166614B
Authority
CN
China
Prior art keywords
frame
pixel
video memory
sampling time
mobile device
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310185743.6A
Other languages
Chinese (zh)
Other versions
CN104166614A (en
Inventor
尹程果
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201310185743.6A priority Critical patent/CN104166614B/en
Publication of CN104166614A publication Critical patent/CN104166614A/en
Application granted granted Critical
Publication of CN104166614B publication Critical patent/CN104166614B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the present invention discloses the frame per second detection method and relevant apparatus of a kind of mobile device, for detecting display frame rate in real time.Method may include:When preset sampling time section timing starts, according to the pixel value of pixel of the physics video memory of preset sampling time interval acquisition mobile device in the first frame and the pixel value of the pixel in the second frame;Judge whether physics video memory changes according to the pixel value of the pixel value of the pixel of the first frame and the pixel of the second frame;If so, the frame per second statistical value of mobile device is increased into a statistics step-length;Judge whether the timing duration of sampling time section has been completed, if it is not, triggering performs again according to the pixel value of the pixel value of pixel of the physics video memory of preset sampling time interval acquisition mobile device in the first frame and the pixel in the second frame;At the end of sampling time section timing, output frame rate statistical value, according to sampling time section and the real time frame rate of frame per second statistical value acquisition mobile device.

Description

The frame per second detection method and relevant apparatus of a kind of mobile device
Technical field
The present invention relates to video control technology field, more particularly to a kind of frame per second detection method of mobile device and related dress Put.
Background technology
The application program installed at present on mobile phone terminal such as Games Software, video calling software is more and more, in order to The fluency of enough inspection softwares, for example, in screen sliding software sensitivity level, it is often necessary to accurately know current phone terminal Frame per second, and also have some evaluating softwares also usually using the frame per second of mobile phone terminal as measurement handset capability one side, This is equally also required to the frame per second for knowing current phone terminal.
A kind of method that frame per second to mobile phone terminal is counted in the prior art be present, using by video camera to mobile phone The mode that the screen of terminal is continuously shot, one section of video is obtained, followed by computer(PC, Personal Computer) The video jukebox software of upper installation, based on the video of recording by carry out frames statistic manually frame by frame, so as to obtain mobile phone terminal In the frame per second of shooting time.
But the present inventor has found during the present invention is realized:It is existing this to be carried out by means of video camera Shooting, by manually being counted to obtain the mode of frame per second using PC, it is necessary to which the artificial realization that places one's entire reliance upon, can not be automatically performed survey Examination process, time and effort consuming;And this frame per second statistical method needs to use video camera and PC to realize, count inconvenience, And what is come out is the frame per second in shooting time mobile phone terminal, it is impossible to the frame per second of current phone terminal is understood whenever and wherever possible, The real time frame rate of mobile phone terminal can not be known.
The content of the invention
The embodiments of the invention provide the frame per second detection method and relevant apparatus of a kind of mobile device, is moved for detecting in real time The screen display frame per second of dynamic equipment.
In order to solve the above technical problems, the embodiment of the present invention provides following technical scheme:
In a first aspect, the embodiment of the present invention provides a kind of frame per second detection method of mobile device, including:
When preset sampling time section timing starts, the physics of mobile device is obtained according to preset sampling time interval For video memory in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame, first frame is in the sampling The frame that sampling time before time interval collects, second frame are the sampling time after the sampling time interval The frame collected;
The thing is judged according to the pixel value of the pixel value of the pixel of first frame and the pixel of second frame Whether reason video memory changes;
If so, the frame per second statistical value of the mobile device is increased into a statistics step-length;
Judge whether the timing duration of the sampling time section has been completed, if it is not, triggering is according to the preset sampling time The physics video memory of interval acquiring mobile device is in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame Perform again;At the end of the sampling time section timing, the frame per second statistical value is exported, according to the sampling time section and institute State the real time frame rate that frame per second statistical value obtains the mobile device.
Second aspect, the embodiment of the present invention also provide a kind of frame per second detection device of mobile device, including:
Pixel value acquisition module, for when preset sampling time section timing starts, according between the preset sampling time Every the pixel value of pixel and the pixel value of pixel in second frame of the physics video memory in the first frame for obtaining mobile device, institute The frame that the first frame collects for the sampling time before the sampling time interval is stated, second frame is in the sampling Between be spaced after the frame that collects of sampling time;
Video memory judge module, for the pixel value of the pixel according to first frame and the pixel of second frame Pixel value judges whether the physics video memory changes;
Statistical module, for when the physics video memory changes, the frame per second statistical value of the mobile device to be increased One statistics step-length;
Timing module, for judging whether the timing duration of the sampling time section has been completed, if it is not, triggering the picture Plain value acquisition module performs again;
Frame per second detecting module, the frame per second at the end of the sampling time section timing, exporting the mobile device are united Evaluation, the real time frame rate of the mobile device is obtained according to the sampling time section and the frame per second statistical value.
As can be seen from the above technical solutions, the embodiment of the present invention has advantages below:
In embodiments of the present invention, sampling time section and sampling time interval are pre-set, then when sampling time section meter When starting, the sampling time distribution collection that is obtained according to sampling time interval before and after sampling time interval arrive two The pixel value of the pixel of frame, obtain the pixel value of the pixel value of the pixel of the first frame and the pixel of the second frame, Ran Hougen Judge whether physics video memory changes according to the pixel value of the pixel of the first frame and the pixel value of pixel of the second frame, if It is the frame per second statistical value of mobile device to be increased into a statistics step-length, whether is the following timing duration for judging sampling time section It has been completed that, if it is not, continuing the pixel of two frames that a sampling time distribution collection arrives before and after obtaining according to sampling time interval Pixel value, and continue the judgement whether physics video memory changes, until sampling time section timing terminates, output frame rate Statistical value, the real time frame rate of current mobile device is obtained according to sampling time section and frame per second statistical value.By in sampling time section It is interior that the data content of the physics video memory of mobile device is extracted and compared according to sampling time interval timing, so as to calculate The frame per second of physics video memory, it is possible to achieve real-time detection is carried out to the screen display frame per second of mobile device anywhere or anytime.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, make required in being described below to embodiment Accompanying drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the present invention, for For those skilled in the art, other accompanying drawings can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of process blocks schematic diagram of the frame per second detection method of mobile device provided in an embodiment of the present invention;
Fig. 2 is the process blocks schematic diagram of the frame per second detection method of another mobile device provided in an embodiment of the present invention;
Fig. 3 is virtual address space and the reading that the physics video memory of mobile device is mapped to process in the embodiment of the present invention Go out the implementation schematic diagram of the pixel value of pixel;
Fig. 4 is the process blocks schematic diagram of the frame per second detection method of another mobile device provided in an embodiment of the present invention;
Fig. 5 is that whole pixels of the first frame and whole pixels of the second frame are carried out in the embodiment of the present invention Checksum implementation schematic diagram;
Fig. 6 is the schematic flow sheet of the real time frame rate detection method of mobile device in the embodiment of the present invention;
Fig. 7-a are a kind of composition structural representation of the real time frame rate detection device of mobile device provided in an embodiment of the present invention Figure;
Fig. 7-b are that the composition structure of the real time frame rate detection device of another mobile device provided in an embodiment of the present invention is shown It is intended to;
Fig. 7-c are that the composition structure of the real time frame rate detection device of another mobile device provided in an embodiment of the present invention is shown It is intended to;
Fig. 7-d are that the composition structure of the real time frame rate detection device of another mobile device provided in an embodiment of the present invention is shown It is intended to;
Fig. 8 is that the real time frame rate detection method of mobile device provided in an embodiment of the present invention is applied to the composition structure of terminal Schematic diagram.
Embodiment
The embodiments of the invention provide the frame per second detection method and relevant apparatus of a kind of mobile device, is moved for detecting in real time The screen display frame per second of dynamic equipment.
To enable goal of the invention, feature, the advantage of the present invention more obvious and understandable, below in conjunction with the present invention Accompanying drawing in embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that disclosed below Embodiment be only part of the embodiment of the present invention, and not all embodiments.Based on the embodiment in the present invention, this area The every other embodiment that technical staff is obtained, belongs to the scope of protection of the invention.
Term " first ", " second " in description and claims of this specification and above-mentioned accompanying drawing etc. are to be used to distinguish Similar object, without for describing specific order or precedence.It should be appreciated that the term so used is in appropriate feelings It can be exchanged under condition, this is only to describe object used differentiation in description in embodiments of the invention to same alike result Mode.In addition, term " comprising " and " having " and their any deformation, it is intended that cover it is non-exclusive include, so as to Process, method, system, product or equipment comprising a series of units are not necessarily limited to those units, but may include unclear Other units that ground is listed or for these processes, method, product or equipment inherently.
It is described in detail individually below.
One embodiment of the real time frame rate detection method of mobile device of the present invention, can include:When preset sampling Between section timing when starting, obtain the pixel of the physics video memory of mobile device in the first frame according to preset sampling time interval The pixel value of pixel value and pixel in the second frame, above-mentioned first frame are the sampling time before above-mentioned sampling time interval The frame collected, the frame that above-mentioned second frame collects for the sampling time after above-mentioned sampling time interval;According to above-mentioned The pixel value of the pixel of the pixel value of the pixel of one frame and above-mentioned second frame judges whether above-mentioned physics video memory changes; If so, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step-length;Judge the timing duration of above-mentioned sampling time section Whether complete, if it is not, triggering obtains the physics video memory of mobile device in the first frame according to preset sampling time interval The pixel value of the pixel value of pixel and pixel in the second frame performs again;At the end of above-mentioned sampling time section timing, Above-mentioned frame per second statistical value is exported, the real-time frame of above-mentioned mobile device is obtained according to above-mentioned sampling time section and above-mentioned frame per second statistical value Rate.
Refer to shown in Fig. 1, the real time frame rate detection method for the mobile device that one embodiment of the invention provides, can wrap Include:
101st, when preset sampling time section timing starts, mobile device is obtained according to preset sampling time interval Physics video memory is in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame.
Wherein, the frame that above-mentioned first frame collects for the sampling time before above-mentioned sampling time interval, above-mentioned second The frame that frame collects for the sampling time after above-mentioned sampling time interval.
In embodiments of the present invention, in order to accurately obtain the real time frame rate of mobile device, movement is being set every time Before standby real time frame rate is detected, sampling time section and sampling time interval, wherein sampling time can be pre-set Section refers to that selection is used for the period for calculating real time frame rate, can specifically be specified by user, naturally it is also possible to set by movement It is standby to be set according to the hardware configuration performance of itself, for example, can be according to the speed and centre of the internal memory of mobile device Manage device(CPU, Central Processing Unit)Frequency set, in addition can also be according to user generally to application The timing statisticses section that sets is set when program carries out fluency test, as user can set sampling time section as 1 second(s), Or mobile device sets sampling time section as 1s according to the internal memory reading speed of oneself and CPU running frequency.Sampling time Interval refers to the pixel value that the pixel time how long obtains a physics video memory present frame is spaced in sampling time section, adopts Sample time interval equally can specifically be specified by user, naturally it is also possible to by mobile device according to the hardware configuration performance of itself To set, for example, it can be set according to the speed of the internal memory of mobile device and CPU frequency, in addition can also basis Statistics number that user generally sets when carrying out fluency test to application program in the timing statisticses section that sets is set, such as User can set sampling time section as 1s, count 50 times in 1s, then sampling time interval can be set as 20 milliseconds(ms), Or mobile device sets sampling time section according to the internal memory reading speed of oneself and CPU running frequency and united as 1s, in 1s Meter 50 times, then sampling time interval can be set as 20ms.In addition, in embodiments of the present invention, when sampling time section is with sampling Between the setting that is spaced can also take other modes, if for example, the real time frame rate of detection mobile device is to be able to detect The fluent movements degree of the game class application program of installation on the mobile apparatus, sampling time section and sampling time interval can bases Sampling time section is set as 1s, is set as sampling time interval by the game class application program installed on detection mobile device 10ms, and for example, if the real time frame rate of detection mobile device is to be able to the video calling class of detection installation on the mobile apparatus The video pictures of application program show fluency, and sampling time section and sampling time interval can pacify according on detection mobile device Sampling time section is set as 2s, sampling time interval is set as into 40ms by the video calling class software of dress, that is to say, that sampling The setting of period and sampling time interval can also be determined by installing application program on the mobile apparatus, only be said herein It is bright, do not limit.
In some embodiments of the invention, when preset sampling time section timing starts, during according to preset sampling Between interval acquiring mobile device physics video memory front and rear two frame pixel pixel value.In order to more accurately illustrate Sampling time before one sampling time interval and two frames in sampling time afterwards, by the two in the embodiment of the present invention Frame definition is " the first frame " and " the second frame ", then respectively in the sampling time of the first frame and the sampling time of the second frame, obtains respectively What is got is physics video memory in the pixel of the first frame and the pixel in the second frame, the two pixels respectively corresponding to pixel It is worth and is:In the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame.Some in the embodiment of the present invention The pixel value of pixel refers to the brightness value in the digital picture of the pixel, wherein, pass through the picture of the pixel of the first frame Element value can represents data content of the physics video memory of mobile device at the sampling time of the first frame, passes through the picture of the second frame The pixel value can of vegetarian refreshments represents data content of the physics video memory of mobile device at the sampling time of the second frame.
In some embodiments of the invention, the data content stored in the physics video memory of mobile device is to seeming that video card is defeated The information of each pixel gone out onto display, and physics video memory is the important component of video card, and display chip has been handled Pixel data can be saved in after pixel data in physics video memory, then read out pixel from physics video memory by digital analog converter Data simultaneously convert digital signals into analog signal, are finally come out by the screen display of mobile device.In the embodiment of the present invention, when Pixel data can be saved in physics video memory by display chip after having handled pixel data, therefore can pass through the physics of mobile device It is buffered in the pixel value for getting pixel in physics video memory in preset sampling time section according to preset sampling time interval.
In some embodiments of the invention, the clocking method of sampling time section and every sampling time interval timing touch The mode that hair step 101 starts to perform can specifically be realized by timer come clocked flip, for example, sampling time section is 1s, Sampling time interval is 20ms, then when the timer time of sampling time section starts, timer just triggers step 101 every 20ms Perform once.
102nd, according in the judgement of the pixel value of the pixel value of the pixel of above-mentioned first frame and the pixel of above-mentioned second frame State whether physics video memory changes.
Wherein, step 103 is performed when above-mentioned physics video memory changes.
In embodiments of the present invention, the sampling time before a sampling time interval is obtained by step 101 statistics Collect data content in the physics video memory of mobile device for the pixel of the first frame pixel value, the sampling time interval it It is the pixel value of the pixel of the second frame, Ran Hougen that sampling time afterwards, which collects data content in the physics video memory of mobile device, Judge whether physics video memory changes according to the pixel value of the pixel of the first frame and the pixel value of pixel of the second frame.Its In, in the embodiment of the present invention when physics video memory changes, digital analog converter reads out pixel data simultaneously from physics video memory Analog signal is converted digital signals into, screen-picture will produce change when finally being come out by the screen display of mobile device, Therefore whether the embodiment of the present invention is changed by physics video memory and gets the screen-picture of mobile device and display whether to become Change, so as to be changed the statistics of number to the frame per second of mobile device, and according to sampling time section so as to calculating mobile device Real time frame rate, refer to the description of subsequent embodiment.It should be noted that in embodiments of the present invention according to above-mentioned first frame The pixel value of the pixel of the pixel value of pixel and above-mentioned second frame judge above-mentioned physics video memory whether change have it is a variety of Implementation, for example, can be collected respectively for two sampling times before and after a sampling time interval The pixel value of pixel is compared frame by frame, can also be for being adopted at one so as to get whether physics video memory changes The pixel value for the pixel that two sampling times before and after sample time interval collect respectively carries out summation inspection code Compare, so as to get whether physics video memory changes, specifically can flexibly be set with application scenarios in actual applications, this Place for illustrative purposes only, does not limit.
It should be noted that in some embodiments of the invention, in step 102 when above-mentioned physics video memory becomes Step 103 is performed during change, refers to the description of subsequent step.In addition, when above-mentioned physics video memory does not change, it is necessary to again Triggering step 101 performs again, and what is simply got with the increase of the timer time of timer is between the latter sampling time The pixel value of the pixel for the frame that sampling time before and after collects.
103rd, when above-mentioned physics video memory changes, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step It is long.
Wherein, by the judgement whether to be changed to physics video memory, show so as to get the screen-picture of mobile device Show whether changed, for example, the screen-picture of mobile device, which is shown, when physics video memory changes is become Change, when physics video memory does not change, the screen-picture of mobile device is displayed without changing.When above-mentioned physics video memory When changing, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step-length.Wherein, statistics step-length refers to frame per second The increasing degree of statistical value, counting the value of step-length can specifically be determined by the amplitude of variation of frame per second statistical value.For example, statistics When step-length is arranged to 1, when changing physics video memory, the frame per second statistical value of mobile device is just increased by 1, and for example, statistics When step-length is arranged to 2, when changing physics video memory, the frame per second statistical value of mobile device is just increased by 2.
104th, judge whether the timing duration of above-mentioned sampling time section has been completed.
Wherein, if the timing duration of above-mentioned sampling time section has not been completed, triggering step 101 performs again, when upper Step 105 is triggered at the end of stating sampling time section timing to perform.
In some embodiments of the invention, after in the sampling time, section timing starts, whenever a sampling time interval Later, it is required for triggering step 101 to start to perform, this can sequence trigger switch subsequent step 102 to 104 after step 101 performs Execution, moved in circles so as to realize in a sampling time section repeatedly, until the timing of above-mentioned sampling time section terminates.
105th, at the end of above-mentioned sampling time section timing, above-mentioned frame per second statistical value is exported, according to above-mentioned sampling time section The real time frame rate of above-mentioned mobile device is obtained with above-mentioned frame per second statistical value.
In embodiments of the present invention, step 101 to step 104 can be after in the sampling time, section timing starts, during according to sampling Between be spaced and repeatedly move in circles executions, up to the timing of above-mentioned sampling time section terminates.When above-mentioned sampling time section timing terminates When, above-mentioned frame per second statistical value is exported, the reality of above-mentioned mobile device is obtained according to above-mentioned sampling time section and above-mentioned frame per second statistical value When frame per second.For example, if sampling time section is redefined for 1s, the frame per second statistical value of output is 30 statistics step-lengths, then leads to It is 30 frames to cross frame per second statistical value divided by sampling time section can or the real time frame rate to mobile device.
Therefore sampling time section and sampling time interval are pre-set, then when the sampling time, section timing started, The pixel for two frames that the sampling time distribution collection before and after sampling time interval arrives is obtained according to sampling time interval The pixel value of point, obtains the pixel value of the pixel value of the pixel of the first frame and the pixel of the second frame, then according to the first frame The pixel value of pixel and the pixel value of pixel of the second frame judge whether physics video memory changes, if so, will be mobile The frame per second statistical value of equipment increases a statistics step-length, next judges whether the timing duration of sampling time section has been completed, If it is not, continue the pixel value of the pixel for two frames that a sampling time distribution collection arrives before and after obtaining according to sampling time interval, And continue the judgement whether physics video memory changes, until sampling time section timing terminates, output frame rate statistical value, root The real time frame rate of current mobile device is obtained according to sampling time section and frame per second statistical value.By in sampling time section according to sampling Time interval timing is extracted and compared to the data content of the physics video memory of mobile device, so as to calculate physics video memory Frame per second, it is possible to achieve real-time detection is carried out to the screen display frame per second of mobile device anywhere or anytime.
Refer to shown in Fig. 2, the real time frame rate detection method for the mobile device that another embodiment of the present invention provides can be with Including:
201st, according to preset sampling time interval by above-mentioned mobile device the first frame physics video memory and second frame Physics video memory is mapped to the virtual address space of process.
In some embodiments of the invention, each process has the virtual address space of oneself, the address space of process Size can be determined by the CPU of mobile device digit.When preset sampling time section timing starts, adopted according to preset The physics video memory for the first frame that sample time interval respectively collects the sampling time before sampling time interval is mapped to process Virtual address space, the physics video memory for the second frame for collecting the sampling time after sampling time interval be mapped to process Virtual address space.The virtual address space that physics video memory is mapped to process can specifically be realized by way of mmap. Wherein, the data content in physics video memory is mapped into internal memory by mmap, and data content is mapped on multiple pages, if in data The size sum of the not all page of size of appearance, the space that last page is not used will be reset.
202nd, the pixel of the pixel of the first frame is read out from the virtual address space of above-mentioned process in a manner of array The pixel value of the pixel of value and the second frame.
Wherein, the physics video memory of the first frame is mapped to after the virtual address space of process, it is possible to pass through array Mode reads out the pixel value of the pixel of the first frame from the virtual address space of process, likewise, the physics of the second frame is shown After the virtual address space for depositing the process of being mapped to, it is possible to read out by way of array from the virtual address space of process The pixel value of the pixel of second frame.
How the physics video memory of mobile device to be mapped to the virtual address space of process in order to describe in detail and is read out The pixel value of pixel, refer to as shown in figure 3, for the physics video memory of mobile device is mapped into process in the embodiment of the present invention Virtual address space and read out the implementation schematic diagram of the pixel value of pixel, physics is shown by mmap modes first The virtual address space for the process of being mapped to is deposited,, can by the continuous change of i and j values then by array Array [i] [j] To read out the pixel value of pixel from the virtual address space of process, so as to realize the access to physics video memory.
In addition in some embodiments of the invention, physics video memory is got in the first frame by step 201 and step 202 The pixel value of pixel and the pixel value of pixel in the second frame can also have other implementations, for example, can Think following steps:Physics video memory of the above-mentioned mobile device in the first frame is accessed, reads thing of the above-mentioned mobile device in the first frame The file data in video memory is managed, obtains the pixel value of the pixel of above-mentioned first frame;Above-mentioned mobile device is accessed in the second frame Physics video memory, file data of the above-mentioned mobile device in the physics video memory of the second frame is read, obtains the pixel of above-mentioned second frame The pixel value of point.That is, then step 201 reads picture using the virtual address space for the process that is mapped to 202 using array The mode of the pixel value of vegetarian refreshments, the mode of data content in rdma read can be analogous to, its reading efficiency is higher, in foregoing citing It is direct access physics video memory, is that have accessed physics video memory in a manner of reading " file system ", regards physics video memory as one " file system ", the file data in physics video memory is read by way of reading file, this mode is compared to rdma read Mode efficiency it is slightly lower, but can also equally get the pixel value and the second frame of the pixel of the frame of mobile device first Pixel pixel value.
203rd, each first pixel of more above-mentioned first frame and each second pixel of above-mentioned second frame are respective Whether pixel value is identical.
Wherein, if the respective pixel value phase of each second pixel of each first pixel and the second pin of the first frame Together, then illustrate that above-mentioned physics video memory does not change, if each the second of each first pixel and the second pin of the first frame The pixel that pixel value differs in the respective pixel value of pixel be present, then illustrate that the physics video memory changes, it is above-mentioned Location of pixels of the location of pixels of first pixel in the first frame with above-mentioned second pixel in the second frame is identical.
That is, when step 203 is by sampling of the location of pixels identical pixel before sampling time interval Between and sampling time interval after sampling time collect the first pixel and the second pixel respectively, pass through individual element position Put compare the pixel that former and later two sampling times collect respectively pixel value it is whether different, if each location of pixels is front and rear The pixel value for the pixel that two sampling times collect respectively is all identical, then it is assumed that the physics video memory of mobile device does not occur Change, if there is the pixel value for the pixel that former and later two sampling times collect respectively different in all location of pixels, recognize Changed for the physics video memory of mobile device.
In addition in some embodiments of the invention, each first pixel of more above-mentioned first frame of step 203 is passed through With whether each respective pixel value of second pixel of above-mentioned second frame identical can also other implementations, citing comes Say, can be following steps:Go out from whole pixel point samplings of above-mentioned first frame respectively according to identical probability sampling method One pixel point set, go out the second pixel point set from whole pixel point samplings of above-mentioned second frame;More above-mentioned first pixel Whether each 3rd pixel of set is identical with the respective pixel value of each 4th pixel of above-mentioned second pixel point set, If identical, illustrate that above-mentioned physics video memory does not change, if differing, illustrate that above-mentioned physics video memory changes, its In, the location of pixels phase of location of pixels and above-mentioned 4th pixel in the second frame of above-mentioned 3rd pixel in the first frame Together.That is, two samplings before and after sampling time interval is all judged relative to individual element position in step 203 Whether the pixel value for the pixel that the time collects is identical, and the location of pixels of whole can also be taken out in the embodiment of the present invention Sample, partial pixel position is obtained, then compare two in these partial pixel positions before and after sampling time interval again Whether the pixel value for the pixel that the sampling time collects respectively is identical, specifically, can be by using identical probability sampling Method goes out the first pixel point set from whole pixel point samplings of the first frame respectively, goes out from whole pixel point samplings of the second frame Two pixel point sets, then each 3rd pixel of more above-mentioned first pixel point set and above-mentioned second pixel point set Whether the respective pixel value of each 4th pixel is identical.
204th, when above-mentioned physics video memory changes, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step It is long.
Wherein, by the judgement whether to be changed to physics video memory, show so as to get the screen-picture of mobile device Show whether changed, for example, the screen-picture of mobile device, which is shown, when physics video memory changes is become Change, when physics video memory does not change, the screen-picture of mobile device is displayed without changing.When above-mentioned physics video memory When changing, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step-length.Wherein, statistics step-length refers to frame per second The increasing degree of statistical value, counting the value of step-length can specifically be determined by frame per second statistical value.
205th, judge whether the timing duration of above-mentioned sampling time section has been completed.
Wherein, if the timing duration of above-mentioned sampling time section has not been completed, triggering step 201 performs again, when upper Step 206 is triggered at the end of stating sampling time section timing to perform.
In some embodiments of the invention, after in the sampling time, section timing starts, whenever a sampling time interval Later, it is required for triggering step 201 to start to perform, this can sequence trigger switch subsequent step 202 to 205 after step 201 performs Execution, moved in circles so as to realize in a sampling time section repeatedly, until the timing of above-mentioned sampling time section terminates.
206th, at the end of above-mentioned sampling time section timing, above-mentioned frame per second statistical value is exported, according to above-mentioned sampling time section The real time frame rate of above-mentioned mobile device is obtained with above-mentioned frame per second statistical value.
In embodiments of the present invention, step 201 to step 205 can be after in the sampling time, section timing starts, during according to sampling Between be spaced and repeatedly move in circles executions, up to the timing of above-mentioned sampling time section terminates.When above-mentioned sampling time section timing terminates When, above-mentioned frame per second statistical value is exported, the reality of above-mentioned mobile device is obtained according to above-mentioned sampling time section and above-mentioned frame per second statistical value When frame per second.
Refer to shown in Fig. 4, the real time frame rate detection method for the mobile device that another embodiment of the present invention provides can be with Including:
401st, above-mentioned mobile device is accessed in the physics video memory of the first frame, reads physics of the above-mentioned mobile device in the first frame File data in video memory, obtain the pixel value of the pixel of above-mentioned first frame.
402nd, above-mentioned mobile device is accessed in the physics video memory of the second frame, reads physics of the above-mentioned mobile device in the second frame File data in video memory, obtain the pixel value of the pixel of above-mentioned second frame.
In embodiments of the present invention, step 201 is mapped to the virtual address spaces of process to 202 uses in previous embodiment Then the mode of the pixel value of pixel is read using array, the mode of data content in rdma read can be analogous to, it reads effect Rate is higher.Step 401 and being achieved in that for 402 samplings directly access physics video memory, are in a manner of reading " file system " Physics video memory is have accessed, physics video memory is regarded as one " file system ", physics video memory is read by way of reading file In file data, this mode is slightly lower compared to the mode efficiency of rdma read, but can also equally get movement The pixel value of the pixel value of the pixel of the frame of equipment first and the pixel of the second frame.
403rd, the summation inspection code of whole pixels of above-mentioned first frame and whole pixels of above-mentioned second frame are calculated respectively The summation inspection code of point.
Wherein, calculating the summation inspection code of pixel can be realized by way of checksum, be needed in checksum Calculate the sum of the pixel value of each pixel.
404th, the summation inspection code of whole pixels of above-mentioned first frame and whole pixels of above-mentioned second frame are judged Whether summation inspection code is equal.
Wherein, if whole pixels of the summation inspection code of whole pixels of above-mentioned first frame and above-mentioned first frame it is total It is equal with check code, then illustrate that above-mentioned physics video memory does not change, if unequal, illustrate that above-mentioned physics video memory becomes Change.
Refer to shown in Fig. 5, be to whole pixels of the first frame and whole pixels of the second frame in the embodiment of the present invention Point carries out checksum implementation schematic diagram.Where it is assumed that the resolution ratio of image is that M × N, M and N are certainly in physical memory So number, in the pixel of the first frame it is x for location of pixels 11,
Location of pixels 1 is x in the pixel of the second frame1', in the pixel of the first frame it is x for location of pixels 22, pixel Position 2 is x in the pixel of the second frame2', the summation inspection code for calculating whole pixels of above-mentioned first frame is sum ', is calculated The summation inspection code for going out whole pixels of the second frame is sum, is then verified(check), judge sum ' and sum whether phase Deng if so, then illustrating that above-mentioned physics video memory does not change, if unequal, illustrating that above-mentioned physics video memory changes.
In addition in some embodiments of the invention, by step 403 and step 404 by judging the complete of above-mentioned first frame Whether the summation inspection code of whole pixels of the summation inspection code of portion's pixel and above-mentioned second frame is equal to may determine that shifting Whether the physics video memory of dynamic equipment changes, it is necessary to which what is illustrated is whether the physics video memory for judging mobile device changes also There are other implementations, for example, can be following steps:According to identical probability sampling method respectively from above-mentioned first frame Whole pixel point samplings go out the first pixel point set, go out the second pixel point set from whole pixel point samplings of above-mentioned second frame; In the summation inspection code and above-mentioned second pixel point set that calculate whole pixels in above-mentioned first pixel point set respectively The summation inspection code of whole pixels;Judge the summation inspection code of whole pixels in above-mentioned first pixel point set and above-mentioned Whether the summation inspection code of whole pixels in the second pixel point set is equal;If so, then illustrate that above-mentioned physics video memory does not have Change, if unequal, illustrate that above-mentioned physics video memory changes.That is, foregoing be achieved in that to whole Location of pixels is sampled, and obtains partial pixel position, i.e. the first pixel point set and the second pixel point set, next respectively Calculate the summation inspection code of the first pixel point set and whole pixels in the second pixel point set.Pass through probability sampling method Probability sampling is carried out to whole pixels in physics video memory, can faster judge whether physics video memory changes.
405th, when above-mentioned physics video memory changes, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step It is long.
Wherein, by the judgement whether to be changed to physics video memory, show so as to get the screen-picture of mobile device Show whether changed, for example, the screen-picture of mobile device, which is shown, when physics video memory changes is become Change, when physics video memory does not change, the screen-picture of mobile device is displayed without changing.When above-mentioned physics video memory When changing, the frame per second statistical value of above-mentioned mobile device is increased into a statistics step-length.Wherein, statistics step-length refers to frame per second The increasing degree of statistical value, counting the value of step-length can specifically be determined by frame per second statistical value.
406th, judge whether the timing duration of above-mentioned sampling time section has been completed.
Wherein, if the timing duration of above-mentioned sampling time section has not been completed, triggering step 401 performs again, when upper Step 407 is triggered at the end of stating sampling time section timing to perform.
In some embodiments of the invention, after in the sampling time, section timing starts, whenever a sampling time interval Later, it is required for triggering step 401 to start to perform, this can sequence trigger switch subsequent step 402 to 406 after step 401 performs Execution, moved in circles so as to realize in a sampling time section repeatedly, until the timing of above-mentioned sampling time section terminates.
407th, at the end of above-mentioned sampling time section timing, above-mentioned frame per second statistical value is exported, according to above-mentioned sampling time section The real time frame rate of above-mentioned mobile device is obtained with above-mentioned frame per second statistical value.
In embodiments of the present invention, step 401 to step 405 can be after in the sampling time, section timing starts, during according to sampling Between be spaced and repeatedly move in circles executions, up to the timing of above-mentioned sampling time section terminates.When above-mentioned sampling time section timing terminates When, above-mentioned frame per second statistical value is exported, the reality of above-mentioned mobile device is obtained according to above-mentioned sampling time section and above-mentioned frame per second statistical value When frame per second.
Therefore sampling time section and sampling time interval are pre-set, then when the sampling time, section timing started, The pixel for two frames that the sampling time distribution collection before and after sampling time interval arrives is obtained according to sampling time interval The pixel value of point, obtains the pixel value of the pixel value of the pixel of the first frame and the pixel of the second frame, then according to the first frame The pixel value of pixel and the pixel value of pixel of the second frame judge whether physics video memory changes, if so, will be mobile The frame per second statistical value of equipment increases a statistics step-length, next judges whether the timing duration of sampling time section has been completed, If it is not, continue the pixel value of the pixel for two frames that a sampling time distribution collection arrives before and after obtaining according to sampling time interval, And continue the judgement whether physics video memory changes, until sampling time section timing terminates, output frame rate statistical value, root The real time frame rate of current mobile device is obtained according to sampling time section and frame per second statistical value.By in sampling time section according to sampling Time interval timing is extracted and compared to the data content of the physics video memory of mobile device, so as to calculate physics video memory Frame per second, it is possible to achieve real-time detection is carried out to the screen display frame per second of mobile device anywhere or anytime.
For ease of being better understood from and implementing the such scheme of the embodiment of the present invention, corresponding application scenarios of illustrating below come It is specifically described.
Refer to the flow signal as shown in fig. 6, for the real time frame rate detection method of mobile device in the embodiment of the present invention Figure, can include:
601st, preset counter Num and frame per second register FPS are initialized, wherein the sampling time interval set It is 1s for 20ms, sampling time section, then is 50 in the maximum occurrences of the sampling time section inside counting device, minimum value is 0, just The Num meaning for being entered as 50, representing assignment for symbol " <-" in figure 6 during beginningization, " Num < -50 " is expressed as Num's is entered as 50, and " <-" occurred in subsequent step also illustrates that assignment, and FPS is used for the frame per second statistics for storing mobile device Value, FPS can start counting up from less than or equal to 0, and FPS is entered as 0 during initialization, set and counts step-length as 1.
602, when the sampling time, section timing started, every 20ms trigger subsequent step 603 to step 606, in order to It is easy to describe, step 603 to step 606 has been drawn into a big dotted line frame, therefore can simplifies and be described as triggering every 20ms Once the execution step in dotted line frame performs once.
603rd, judge whether Num is more than 0, if Num is less than or equal to 0, illustrate that the timing of sampling time section finishes, Retriggered step 601 and step 607 start to perform, if Num is more than 0, are illustrating the timing duration of sampling time section also Carry out, triggering step 604 starts to perform.
604th, Num is entered as again:Num-1, and read frame buffer(frame buffer), collect current Physics video memory in pixel pixel value, then perform step 605.
605th, judge whether the physics video memory of mobile device changes, it judges that the mode that physics video memory changes can Refering to the description in previous embodiment, if physics video memory changes triggering, step 606 starts to perform;
606th, when physics video memory changes, FPS is entered as again:FPS+1.
607th, at the end of sampling time section timing, the frame per second statistical value stored in FPS is exported, according to the above-mentioned sampling time Section and above-mentioned frame per second statistical value obtain the real time frame rate of above-mentioned mobile device, if sampling time section is 1s, the reality of mobile device When frame per second be the frame per second statistical value stored in FPS.
Therefore sampling time section and sampling time interval are pre-set, then when the sampling time, section timing started, The pixel for two frames that the sampling time distribution collection before and after sampling time interval arrives is obtained according to sampling time interval The pixel value of point, obtains the pixel value of the pixel value of the pixel of the first frame and the pixel of the second frame, then according to the first frame The pixel value of pixel and the pixel value of pixel of the second frame judge whether physics video memory changes, if so, will be mobile The frame per second statistical value of equipment increases a statistics step-length, next judges whether the timing duration of sampling time section has been completed, If it is not, continue the pixel value of the pixel for two frames that a sampling time distribution collection arrives before and after obtaining according to sampling time interval, And continue the judgement whether physics video memory changes, until sampling time section timing terminates, output frame rate statistical value, root The real time frame rate of current mobile device is obtained according to sampling time section and frame per second statistical value.By in sampling time section according to sampling Time interval timing is extracted and compared to the data content of the physics video memory of mobile device, so as to calculate physics video memory Frame per second, it is possible to achieve real-time detection is carried out to the screen display frame per second of mobile device anywhere or anytime.
It should be noted that for foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as a series of Combination of actions, but those skilled in the art should know, the present invention is not limited by described sequence of movement because According to the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art should also know Know, embodiment described in this description belongs to preferred embodiment, and involved action and module are not necessarily of the invention It is necessary.
For ease of preferably implementing the such scheme of the embodiment of the present invention, the phase for implementing such scheme is also provided below Close device.
Refer to shown in Fig. 7-a, a kind of real time frame rate detection device 700 of mobile device provided in an embodiment of the present invention, It can include:Pixel value acquisition module 701, video memory judge module 702, statistical module 703, timing module 704, frame per second detection mould Block 705, wherein,
Pixel value acquisition module 701, for when preset sampling time section timing starts, according to the preset sampling time The physics video memory of interval acquiring mobile device in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame, The frame that first frame collects for the sampling time before the sampling time interval, second frame are in the sampling The frame that sampling time after time interval collects;
Video memory judge module 702, for the pixel of first frame that is got according to pixel value acquisition module 701 The pixel value of the pixel of pixel value and second frame judges whether the physics video memory changes;
Statistical module 703, for when video memory judge module 702 judge learn that the physics video memory changes when, by institute Stating the frame per second statistical value of mobile device increases a statistics step-length;
Timing module 704, for judging whether the timing duration of the sampling time section has been completed, if it is not, triggering institute Pixel value acquisition module 701 is stated to perform again;
Frame per second detecting module 705, at the end of the sampling time section timing, output statistical module 703 to count on The mobile device frame per second statistical value, the mobile device is obtained according to the sampling time section and the frame per second statistical value Real time frame rate.
In some embodiments of the invention, video memory judge module 702, specifically for each the of first frame Whether one pixel is identical with each respective pixel value of second pixel of second frame, if identical, illustrates the thing Reason video memory does not change, if differing, illustrates that the physics video memory changes, wherein, first pixel exists Location of pixels of the location of pixels with second pixel in the second frame in first frame is identical.
Refer to as shown in Fig. 7-b, in some embodiments of the invention, the real time frame rate detection device of mobile device 700, it can also include:
Setting module 706, for the speed of the internal memory according to the mobile device and the frequency setting of central processor CPU The sampling time section and the sampling time interval.
In some embodiments of the invention, pixel value acquisition module 701, can include:
Mapping submodule 7011, for according to preset sampling time interval by the mobile device the first frame physics The physics video memory of video memory and the second frame is mapped to the virtual address space of process;
First reading submodule 7012, for reading out from the virtual address space of the process in a manner of array The pixel value of the pixel of the pixel value of the pixel of one frame and the second frame.
In some embodiments of the invention, video memory judge module 702, can include:
First calculating sub module 7021, summation inspection code and institute for whole pixels for calculating first frame respectively State the summation inspection code of whole pixels of the second frame;
First judging submodule 7022, for the summation inspection code and described for the whole pixels for judging first frame Whether the summation inspection code of whole pixels of two frames is equal;If so, then illustrate that the physics video memory does not change, if not It is equal, then illustrate that the physics video memory changes.
Refer to as shown in Fig. 7-c, in some embodiments of the invention, pixel value acquisition module 701, can include:
Video memory accesses submodule 7013, for accessing physics video memory of the mobile device in the first frame, accesses the shifting Physics video memory of the dynamic equipment in the second frame;
Second reading submodule 7014, for reading number of files of the mobile device in the physics video memory of the first frame According to obtaining the pixel value of the pixel of first frame;Read file of the mobile device in the physics video memory of the second frame Data, obtain the pixel value of the pixel of second frame.
In some embodiments of the invention, video memory judge module 702, can include:
Sample submodule 7023, for according to identical probability sampling method respectively from whole pixels of first frame Sample out the first pixel point set, go out the second pixel point set from whole pixel point samplings of second frame;
Second calculating sub module 7024, for calculating the summation of whole pixels in the first pixel point set respectively The summation inspection code of check code and whole pixels in the second pixel point set;
Second judging submodule 7025, for judging the summation inspection of whole pixels in the first pixel point set Whether the summation inspection code of whole pixels in code and the second pixel point set is equal;If so, then illustrate the physics Video memory does not change, if unequal, illustrates that the physics video memory changes.
Refer to as shown in Fig. 7-d, in some embodiments of the invention, pixel value acquisition module 701, can include:
Video memory accesses submodule 7013, for accessing physics video memory of the mobile device in the first frame, accesses the shifting Physics video memory of the dynamic equipment in the second frame;
Second reading submodule 7014, for reading number of files of the mobile device in the physics video memory of the first frame According to obtaining the pixel value of the pixel of first frame;Read file of the mobile device in the physics video memory of the second frame Data, obtain the pixel value of the pixel of second frame.
In some embodiments of the invention, video memory judge module 702, can include:
Sample submodule 7023, for according to identical probability sampling method respectively from whole pixels of first frame Sample out the first pixel point set, go out the second pixel point set from whole pixel point samplings of second frame;
Comparison sub-module 7026, each 3rd pixel and second picture for the first pixel point set Whether the respective pixel value of each 4th pixel of vegetarian refreshments set is identical, if identical, illustrates that the physics video memory is not sent out Changing, if differing, illustrate that the physics video memory changes, wherein, the picture of the 3rd pixel in the first frame Location of pixels of the plain position with the 4th pixel in the second frame is identical.
It should be noted that the content such as information exchange, implementation procedure between each module/unit of said apparatus, due to The inventive method embodiment is based on same design, and its technique effect brought is identical with the inventive method embodiment, particular content Reference can be made to the narration in the foregoing shown embodiment of the method for the present invention, here is omitted.
To sum up, sampling time section and sampling time interval are pre-set, then when the sampling time, section timing started, according to Sampling time interval obtains the pixel for two frames that the sampling time distribution collection before and after sampling time interval arrives Pixel value, the pixel value of the pixel value of the pixel of the first frame and the pixel of the second frame is obtained, then according to the picture of the first frame The pixel value of the pixel of the pixel value of vegetarian refreshments and the second frame judges whether physics video memory changes, if so, by mobile device Frame per second statistical value increase by one statistics step-length, next judge whether the timing duration of sampling time section has been completed, if it is not, Continue the pixel value of the pixel for two frames that a sampling time distribution collection arrives before and after obtaining according to sampling time interval, and continue The judgement whether physics video memory changes is carried out, until sampling time section timing terminates, output frame rate statistical value, according to sampling Period and frame per second statistical value obtain the real time frame rate of current mobile device.By in sampling time section according between the sampling time The data content of the physics video memory of mobile device is extracted and compared every timing, so as to calculate the frame per second of physics video memory, It can realize and real-time detection is carried out to the screen display frame per second of mobile device anywhere or anytime.
Below mainly with the frame per second detection method of the mobile device of the embodiment of the present invention be applied to terminal in come for example, The terminal can include smart mobile phone, tablet personal computer, E-book reader, dynamic image expert's compression standard audio aspect 3 (Moving Picture Experts Group Audio Layer III, MP3)Player, dynamic image expert's compression standard Audio aspect 4(Moving Picture Experts Group Audio Layer IV, MP4)Player, portable meter on knee Calculation machine and desktop computer etc..
Fig. 8 is refer to, it illustrates the structural representation of the terminal involved by the embodiment of the present invention, specifically:
Terminal can include radio frequency(Radio Frequency, RF)Circuit 20, include one or more computers The memory 21 of readable storage medium storing program for executing, input block 22, display unit 23, sensor 24, voicefrequency circuit 25, Wireless Fidelity (wireless fidelity, WiFi) module 26, the processor 27 for including one or more than one processing core and The grade part of power supply 28.It will be understood by those skilled in the art that the restriction of the terminal structure shown in Fig. 8 not structure paired terminal, It can include than illustrating more or less parts, either combine some parts or different parts arrangement.Wherein:
RF circuits 20 can be used for receive and send messages or communication process in, the reception and transmission of signal, especially, by under base station After row information receives, transfer to one or more than one processor 27 is handled;In addition, it is sent to base by up data are related to Stand.Generally, RF circuits 20 include but is not limited to antenna, at least one amplifier, tuner, one or more oscillators, user Identity module(SIM)Card, transceiver, coupler, low-noise amplifier(Low Noise Amplifier, LNA), duplexer Deng.In addition, RF circuits 20 can also be communicated by radio communication with network and other equipment.The radio communication, which can use, appoints One communication standard or agreement, including but not limited to global system for mobile communications (Global System of Mobile Communication, GSM), general packet radio service (General Packet Radio Service, GPRS), code division it is more Location (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), Email, Short Message Service (Short Messaging Service, SMS) etc..
Memory 21 can be used for storage software program and module, and processor 27 is stored in the soft of memory 21 by operation Part program and module, so as to perform various function application and data processing.Memory 21 can mainly include storing program area And storage data field, wherein, storing program area can storage program area, the application program needed at least one function(Such as sound Sound playing function, image player function etc.)Deng;Storage data field can store uses created data according to terminal(Such as Voice data, phone directory etc.)Deng.In addition, memory 21 can include high-speed random access memory, can also include non-volatile Property memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.Correspondingly, deposit Reservoir 21 can also include Memory Controller, to provide the access of processor 27 and input block 22 to memory 21.
Input block 22 can be used for the numeral or character information for receiving input, and generation is set with user and function control It is formed with keyboard, mouse, action bars, optics or the input of trace ball signal of pass.Specifically, in a specific embodiment, Input block 22 may include touch sensitive surface 221 and other input equipments 222.Touch sensitive surface 221, also referred to as touch display screen or Person's Trackpad, collect touch operation of the user on or near it(For example user uses any suitable things such as finger, stylus The operation of body or annex on touch sensitive surface 221 or near touch sensitive surface 221), and phase is driven according to formula set in advance The attachment means answered.Optionally, touch sensitive surface 221 may include both touch detecting apparatus and touch controller.Wherein, touch The touch orientation of detection means detection user is touched, and detects the signal that touch operation is brought, transmits a signal to touch controller; Touch controller receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 27, and The order sent of reception processing device 27 and it can be performed.Furthermore, it is possible to using resistance-type, condenser type, infrared ray and surface The polytypes such as sound wave realize touch sensitive surface 221.Except touch sensitive surface 221, input block 22 can also be set including other inputs Standby 222.Specifically, other input equipments 222 can include but is not limited to physical keyboard, function key(Such as volume control button, Switch key etc.), trace ball, mouse, the one or more in action bars etc..
Display unit 23 can be used for display by user input information or be supplied to user information and terminal it is various Graphical user interface, these graphical user interface can be made up of figure, text, icon, video and its any combination.Display Unit 23 may include display panel 231, optionally, can use liquid crystal display (Liquid Crystal Display, LCD), the form such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) configures display panel 231.Further, touch sensitive surface 221 can cover display panel 231, when touch sensitive surface 221 detects touching on or near it After touching operation, processor 27 is sent to determine the type of touch event, is followed by subsequent processing device 27 and is existed according to the type of touch event Corresponding visual output is provided on display panel 231.Although in fig. 8, touch sensitive surface 221 and display panel 231 are as two Individual independent part realizes input and input function, but in some embodiments it is possible to by touch sensitive surface 221 and display surface Plate 231 is integrated and realizes input and output function.
Terminal may also include at least one sensor 24, such as optical sensor, motion sensor and other sensors.Tool Body, optical sensor may include ambient light sensor and proximity transducer, wherein, ambient light sensor can be according to ambient light Light and shade adjusts the brightness of display panel 231, proximity transducer can when terminal is moved in one's ear, close display panel 231 and/ Or backlight.As one kind of motion sensor, gravity accelerometer can detect in all directions(Generally three axles)Accelerate The size of degree, size and the direction of gravity are can detect that when static, the application available for identification mobile phone posture(For example horizontal/vertical screen is cut Change, dependent game, magnetometer pose calibrating), Vibration identification correlation function(Such as pedometer, percussion)Deng;May be used also as terminal The other sensors such as the gyroscope of configuration, barometer, hygrometer, thermometer, infrared ray sensor, will not be repeated here.
Voicefrequency circuit 25, loudspeaker 251, microphone 252 can provide the COBBAIF between user and terminal.Voicefrequency circuit Electric signal after the voice data received conversion can be transferred to loudspeaker 251 by 25, and sound letter is converted to by loudspeaker 251 Number output;On the other hand, the voice signal of collection is converted to electric signal by microphone 252, is changed after being received by voicefrequency circuit 25 For voice data, then after voice data output processor 27 is handled, through RF circuits 20 to be sent to such as another terminal, or Voice data is exported to memory 21 further to handle.Voicefrequency circuit 25 is also possible that earphone jack, outer to provide If the communication of earphone and terminal.
WiFi belongs to short range wireless transmission technology, and terminal can help user's transceiver electronicses postal by WiFi module 26 Part, browse webpage and access streaming video etc., it has provided the user wireless broadband internet and accessed.Although Fig. 8 is shown WiFi module 26, but it is understood that, it is simultaneously not belonging to must be configured into for terminal, can not change as needed completely Omitted in the essential scope of invention.
Processor 27 is the control centre of terminal, using various interfaces and the various pieces of connection whole mobile phone, is led to Cross operation or perform the software program and/or module being stored in memory 21, and call the number being stored in memory 21 According to the various functions and processing data of terminal being performed, so as to carry out integral monitoring to mobile phone.Optionally, processor 27 may include One or more processing cores;Preferably, processor 27 can integrate application processor and modem processor, wherein, application Processor mainly handles operating system, user interface and application program etc., and modem processor mainly handles radio communication.Can With understanding, above-mentioned modem processor can not also be integrated into processor 27.
Terminal also includes the power supply 28 to all parts power supply(Such as battery), it is preferred that power supply can pass through power supply pipe Reason system and processor 27 are logically contiguous, so as to realize management charging, electric discharge and power managed etc. by power-supply management system Function.Power supply 28 can also include one or more direct current or AC power, recharging system, power failure monitor electricity The random component such as road, power supply changeover device or inverter, power supply status indicator.
Although being not shown, terminal can also include camera, bluetooth module etc., will not be repeated here.Specifically in this implementation In example, the display unit of terminal is touch-screen display, and the memory 21 of terminal seemingly, can store sampling with above-mentioned class database Period, sampling time interval, frame per second statistical value.
And one or more than one program storage in memory 21, and are configured to by one in the terminal of the present embodiment Individual either more than one processor 27 performs the following operational order that said one or more than one program are included:
When preset sampling time section timing starts, the physics of mobile device is obtained according to preset sampling time interval For video memory in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame, first frame is in the sampling The frame that sampling time before time interval collects, second frame are the sampling time after the sampling time interval The frame collected;
The thing is judged according to the pixel value of the pixel value of the pixel of first frame and the pixel of second frame Whether reason video memory changes;
If so, the frame per second statistical value of the mobile device is increased into a statistics step-length;
Judge whether the timing duration of the sampling time section has been completed, if it is not, triggering is according to the preset sampling time The physics video memory of interval acquiring mobile device is in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame Perform again;At the end of the sampling time section timing, the frame per second statistical value is exported, according to the sampling time section and institute State the real time frame rate that frame per second statistical value obtains the mobile device.
Specifically, the pixel of the physics video memory in the first frame that mobile device is obtained according to preset sampling time interval The pixel value of the pixel value of point and the pixel in the second frame, including:
According to preset sampling time interval by the mobile device in the physics video memory of the first frame and the physics of the second frame Video memory is mapped to the virtual address space of process;
Read out in a manner of array from the virtual address space of the process pixel of the first frame pixel value and The pixel value of the pixel of second frame.
Specifically, the pixel of the physics video memory in the first frame that mobile device is obtained according to preset sampling time interval The pixel value of the pixel value of point and the pixel in the second frame, including:
Physics video memory of the mobile device in the first frame is accessed, reads physics video memory of the mobile device in the first frame In file data, obtain the pixel value of the pixel of first frame;
Physics video memory of the mobile device in the second frame is accessed, reads physics video memory of the mobile device in the second frame In file data, obtain the pixel value of the pixel of second frame.
Specifically, the pixel according to first frame pixel value and second frame pixel pixel value Judge whether the physics video memory changes, including:
Compare each first pixel of first frame and each respective pixel of second pixel of second frame Whether value is identical, if identical, illustrates that the physics video memory does not change, if differing, illustrates the physics video memory Change, wherein, first pixel location of pixels in the first frame and second pixel are in the second frame Location of pixels is identical.
Specifically, the pixel according to first frame pixel value and second frame pixel pixel value Judge whether the physics video memory changes, including:
The summation inspection code of whole pixels of first frame and whole pixels of second frame are calculated respectively Summation inspection code;
Judge the summation of the summation inspection code of whole pixels of first frame and whole pixels of second frame Whether check code is equal;If so, then illustrating that the physics video memory does not change, if unequal, illustrate that the physics shows Deposit and change.
Specifically, the pixel according to first frame pixel value and second frame pixel pixel value Judge whether the physics video memory changes, including:
Go out the first pixel point set from whole pixel point samplings of first frame respectively according to identical probability sampling method Close, go out the second pixel point set from whole pixel point samplings of second frame;
The summation inspection code of whole pixels in the first pixel point set and second pixel are calculated respectively The summation inspection code of whole pixels in set;
Judge the summation inspection code of whole pixels in the first pixel point set and the second pixel point set In whole pixels summation inspection code it is whether equal;If so, then illustrate that the physics video memory does not change, if not phase Deng then illustrating that the physics video memory changes.
Specifically, the pixel according to first frame pixel value and second frame pixel pixel value Judge whether the physics video memory changes, including:
Go out the first pixel point set from whole pixel point samplings of first frame respectively according to identical probability sampling method Close, go out the second pixel point set from whole pixel point samplings of second frame;
Compare each 3rd pixel and each 4th of the second pixel point set of the first pixel point set Whether the respective pixel value of pixel is identical, if identical, illustrates that the physics video memory does not change, if differing, Illustrate that the physics video memory changes, wherein, the 3rd pixel location of pixels in the first frame and the 4th picture The location of pixels of vegetarian refreshments in the second frame is identical.
Further, the sampling time section and the sampling time interval are according to the speed of the internal memory of the mobile device With the frequency setting of central processor CPU.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is can To instruct the hardware of correlation to complete by program, the program can be stored in a computer-readable recording medium, storage Medium can include:Read-only storage(ROM), random access memory(RAM), disk or CD etc..
Detailed Jie has been carried out to the frame per second detection method and relevant apparatus of a kind of mobile device provided by the present invention above Continue, for those of ordinary skill in the art, according to the thought of the embodiment of the present invention, in specific embodiments and applications There will be changes, in summary, this specification content should not be construed as limiting the invention.

Claims (16)

1. the real time frame rate detection method of a kind of mobile device, it is characterised in that methods described performs in mobile device, bag Include:
When preset sampling time section timing starts, the physics video memory of mobile device is obtained according to preset sampling time interval In the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame, first frame is in the sampling time The frame that sampling time before interval collects, second frame are the sampling time collection after the sampling time interval The frame arrived, the setting of the sampling time section and the sampling time interval is by the application program on the mobile device To determine;
Judge that the physics shows according to the pixel value of the pixel value of the pixel of first frame and the pixel of second frame Deposit and whether change;
If so, the frame per second statistical value of the mobile device is increased into a statistics step-length;
Judge whether the timing duration of the sampling time section has been completed, if it is not, triggering is according to preset sampling time interval The pixel value of pixel value of the physics video memory of acquisition mobile device in the pixel of the first frame and the pixel in the second frame is again Perform;At the end of the sampling time section timing, the frame per second statistical value is exported, according to the sampling time section and the frame Rate statistical value obtains the real time frame rate of the mobile device.
2. according to the method for claim 1, it is characterised in that described to obtain mobile set according to preset sampling time interval The pixel value of the pixel value of pixel of the standby physics video memory in the first frame and the pixel in the second frame, including:
According to preset sampling time interval by the mobile device in the physics video memory of the first frame and the physics video memory of the second frame It is mapped to the virtual address space of process;
The pixel value and second of the pixel of the first frame is read out from the virtual address space of the process in a manner of array The pixel value of the pixel of frame.
3. according to the method for claim 1, it is characterised in that described to obtain mobile set according to preset sampling time interval The pixel value of the pixel value of pixel of the standby physics video memory in the first frame and the pixel in the second frame, including:
Physics video memory of the mobile device in the first frame is accessed, reads the mobile device in the physics video memory of the first frame File data, obtain the pixel value of the pixel of first frame;
Physics video memory of the mobile device in the second frame is accessed, reads the mobile device in the physics video memory of the second frame File data, obtain the pixel value of the pixel of second frame.
4. according to the method in any one of claims 1 to 3, it is characterised in that the pixel according to first frame The pixel value of the pixel value of point and the pixel of second frame judges whether the physics video memory changes, including:
Each respective pixel value of second pixel of each first pixel and second frame that compare first frame is It is no identical, if identical, illustrate that the physics video memory does not change, if differing, illustrate that the physics video memory occurs Change, wherein, the pixel of location of pixels and second pixel in the second frame of first pixel in the first frame Position is identical.
5. according to the method in any one of claims 1 to 3, it is characterised in that the pixel according to first frame The pixel value of the pixel value of point and the pixel of second frame judges whether the physics video memory changes, including:
The summation of the summation inspection code of whole pixels of first frame and whole pixels of second frame is calculated respectively Check code;
Judge the summation inspection of the summation inspection code of whole pixels of first frame and whole pixels of second frame Whether code is equal;If so, then illustrating that the physics video memory does not change, if unequal, illustrate the physics video memory hair Changing.
6. according to the method in any one of claims 1 to 3, it is characterised in that the pixel according to first frame The pixel value of the pixel value of point and the pixel of second frame judges whether the physics video memory changes, including:
Go out the first pixel point set from whole pixel point samplings of first frame respectively according to identical probability sampling method, from Whole pixel point samplings of second frame go out the second pixel point set;
The summation inspection code of whole pixels in the first pixel point set and the second pixel point set are calculated respectively In whole pixels summation inspection code;
In the summation inspection code and the second pixel point set that judge whole pixels in the first pixel point set Whether the summation inspection code of whole pixels is equal;If so, then illustrate that the physics video memory does not change, if unequal, Then illustrate that the physics video memory changes.
7. according to the method in any one of claims 1 to 3, it is characterised in that the pixel according to first frame The pixel value of the pixel value of point and the pixel of second frame judges whether the physics video memory changes, including:
Go out the first pixel point set from whole pixel point samplings of first frame respectively according to identical probability sampling method, from Whole pixel point samplings of second frame go out the second pixel point set;
Compare each 3rd pixel of the first pixel point set and each 4th pixel of the second pixel point set Whether the respective pixel value of point is identical, if identical, illustrates that the physics video memory does not change, if differing, illustrates The physics video memory changes, wherein, the 3rd pixel location of pixels in the first frame and the 4th pixel Location of pixels in the second frame is identical.
8. according to the method in any one of claims 1 to 3, it is characterised in that the sampling time section and the sampling Time interval is according to the speed of the internal memory of the mobile device and the frequency setting of central processor CPU.
9. the real time frame rate detection device of a kind of mobile device, it is characterised in that described device performs in mobile device, bag Include:
Pixel value acquisition module, for when preset sampling time section timing starts, being obtained according to preset sampling time interval The physics video memory of mobile device is taken in the pixel value of the pixel of the first frame and the pixel value of pixel in the second frame, described The frame that one frame collects for the sampling time before the sampling time interval, second frame are between the sampling time Every the frame that the sampling time afterwards collects, the setting of the sampling time section and the sampling time interval is by installed in described Application program on mobile device determines;
Video memory judge module, for the pixel according to first frame pixel value and second frame pixel pixel Value judges whether the physics video memory changes;
Statistical module, for when the physics video memory changes, the frame per second statistical value of the mobile device to be increased into one Count step-length;
Timing module, for judging whether the timing duration of the sampling time section has been completed, if it is not, triggering the pixel value Acquisition module performs again;
Frame per second detecting module, at the end of the sampling time section timing, exporting the frame per second statistical value of the mobile device, The real time frame rate of the mobile device is obtained according to the sampling time section and the frame per second statistical value.
10. device according to claim 9, it is characterised in that the pixel value acquisition module, including:
Mapping submodule, for according to preset sampling time interval by the mobile device in the physics video memory of the first frame and The physics video memory of two frames is mapped to the virtual address space of process;
First reading submodule, for reading out the picture of the first frame from the virtual address space of the process in a manner of array The pixel value of the pixel of the pixel value of vegetarian refreshments and the second frame.
11. device according to claim 9, it is characterised in that the pixel value acquisition module, including:
Video memory accesses submodule, for accessing physics video memory of the mobile device in the first frame, accesses the mobile device and exists The physics video memory of second frame;
Second reading submodule, for reading file data of the mobile device in the physics video memory of the first frame, obtain institute State the pixel value of the pixel of the first frame;File data of the mobile device in the physics video memory of the second frame is read, is obtained The pixel value of the pixel of second frame.
12. the device according to any one of claim 9 to 11, it is characterised in that the video memory judge module, it is specific to use In first frame each first pixel and second frame each respective pixel value of second pixel whether It is identical, if identical, illustrate that the physics video memory does not change, if differing, illustrate that the physics video memory becomes Change, wherein, the pixel position of location of pixels and second pixel in the second frame of first pixel in the first frame Put identical.
13. the device according to any one of claim 9 to 11, it is characterised in that the video memory judge module, including:
First calculating sub module, summation inspection code and second frame for whole pixels for calculating first frame respectively Whole pixels summation inspection code;
First judging submodule, for whole pixels for judging first frame summation inspection code and second frame it is complete Whether the summation inspection code of portion's pixel is equal;If so, then illustrate that the physics video memory does not change, if unequal, Illustrate that the physics video memory changes.
14. the device according to any one of claim 9 to 11, it is characterised in that the video memory judge module, including:
Sample submodule, for going out the from whole pixel point samplings of first frame respectively according to identical probability sampling method One pixel point set, go out the second pixel point set from whole pixel point samplings of second frame;
Second calculating sub module, for calculate respectively whole pixels in the first pixel point set summation inspection code and The summation inspection code of whole pixels in the second pixel point set;
Second judging submodule, for judging the summation inspection code of whole pixels in the first pixel point set and described Whether the summation inspection code of whole pixels in the second pixel point set is equal;If so, then illustrate that the physics video memory does not have Change, if unequal, illustrate that the physics video memory changes.
15. the device according to any one of claim 9 to 11, it is characterised in that the video memory judge module, including:
Sample submodule, for going out the from whole pixel point samplings of first frame respectively according to identical probability sampling method One pixel point set, go out the second pixel point set from whole pixel point samplings of second frame;
Comparison sub-module, each 3rd pixel and the second pixel point set for the first pixel point set The respective pixel value of each 4th pixel it is whether identical, if identical, illustrate that the physics video memory does not change, if Differ, then illustrate that the physics video memory changes, wherein, the 3rd pixel location of pixels in the first frame and institute It is identical to state the location of pixels of the 4th pixel in the second frame.
16. the device according to any one of claim 9 to 11, it is characterised in that the real time frame rate of the mobile device Detection device, in addition to:
Setting module, for being adopted described in the speed of the internal memory according to the mobile device and the frequency setting of central processor CPU Sample period and the sampling time interval.
CN201310185743.6A 2013-05-17 2013-05-17 The frame per second detection method and relevant apparatus of a kind of mobile device Active CN104166614B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310185743.6A CN104166614B (en) 2013-05-17 2013-05-17 The frame per second detection method and relevant apparatus of a kind of mobile device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310185743.6A CN104166614B (en) 2013-05-17 2013-05-17 The frame per second detection method and relevant apparatus of a kind of mobile device

Publications (2)

Publication Number Publication Date
CN104166614A CN104166614A (en) 2014-11-26
CN104166614B true CN104166614B (en) 2017-12-15

Family

ID=51910440

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310185743.6A Active CN104166614B (en) 2013-05-17 2013-05-17 The frame per second detection method and relevant apparatus of a kind of mobile device

Country Status (1)

Country Link
CN (1) CN104166614B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104965773B (en) * 2015-07-09 2019-06-04 网易(杭州)网络有限公司 Terminal, Caton detection method, device and game Caton detection method, device
CN106547504B (en) * 2015-09-21 2019-08-30 腾讯科技(深圳)有限公司 Fluency appraisal procedure and device
CN105653407A (en) * 2015-12-08 2016-06-08 网易(杭州)网络有限公司 Terminal, jam measuring method, device, game jam measuring method and apparatus
WO2017128314A1 (en) * 2016-01-29 2017-08-03 深圳市大疆创新科技有限公司 Method, system and device for video data transmission, and photographic apparatus
WO2017145818A1 (en) * 2016-02-24 2017-08-31 ソニー株式会社 Signal processing device, signal processing method, and program
CN105912444A (en) * 2016-04-29 2016-08-31 网易(杭州)网络有限公司 Refresh rate testing method and device of picture change of mobile terminal game screen
CN106371786B (en) * 2016-08-31 2019-04-30 福建省天奕网络科技有限公司 A kind of method and system of frame per second dynamic acquisition
CN109656645A (en) * 2017-10-11 2019-04-19 阿里巴巴集团控股有限公司 Presentation time determines the determination method and device of method and page rendering deadline
CN107800989B (en) * 2017-10-16 2021-01-05 深圳市天视通电子科技有限公司 Video display method and system based on dynamic frame rate detection and network video recorder
CN107864378A (en) * 2017-11-10 2018-03-30 维沃移动通信有限公司 A kind of frame rate detection method, device, mobile terminal and server
CN113259654B (en) * 2020-02-10 2023-01-20 北京达佳互联信息技术有限公司 Video frame rate detection method and device, electronic equipment and storage medium
CN111461044B (en) * 2020-04-07 2021-01-08 北京波谱华光科技有限公司 Video synthesis method, system and computer storage medium
CN112206508A (en) * 2020-09-25 2021-01-12 腾讯科技(深圳)有限公司 Image detection method and device and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217573A (en) * 2007-12-29 2008-07-09 厦门大学 A method to speed up message captures of the network card
CN102956208A (en) * 2011-08-23 2013-03-06 华为技术有限公司 Method, device and system for counting image frame rates of terminal
CN102968971A (en) * 2012-11-08 2013-03-13 京东方科技集团股份有限公司 Liquid crystal display driving method, time sequence control device and liquid crystal display device
CN103037216A (en) * 2011-10-04 2013-04-10 索尼公司 Image processing apparatus and method, program and recording medium
CN103108169A (en) * 2013-02-27 2013-05-15 Tcl通讯(宁波)有限公司 Mobile terminal which display video frame rate in real time and achieving method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006115470A (en) * 2004-09-16 2006-04-27 Ntt Docomo Inc Video evaluation device, frame rate determination device, video process device, video evaluation method, and video evaluation program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101217573A (en) * 2007-12-29 2008-07-09 厦门大学 A method to speed up message captures of the network card
CN102956208A (en) * 2011-08-23 2013-03-06 华为技术有限公司 Method, device and system for counting image frame rates of terminal
CN103037216A (en) * 2011-10-04 2013-04-10 索尼公司 Image processing apparatus and method, program and recording medium
CN102968971A (en) * 2012-11-08 2013-03-13 京东方科技集团股份有限公司 Liquid crystal display driving method, time sequence control device and liquid crystal display device
CN103108169A (en) * 2013-02-27 2013-05-15 Tcl通讯(宁波)有限公司 Mobile terminal which display video frame rate in real time and achieving method thereof

Also Published As

Publication number Publication date
CN104166614A (en) 2014-11-26

Similar Documents

Publication Publication Date Title
CN104166614B (en) The frame per second detection method and relevant apparatus of a kind of mobile device
CN107731146A (en) Brightness adjusting method and related product
CN109828688A (en) Screen damage processing method, mobile terminal and computer readable storage medium
CN108255382A (en) A kind of suspension menu content recommends method and device
CN107450841B (en) Interactive object control method and device
CN104159140B (en) A kind of methods, devices and systems of Video processing
CN104699501B (en) A kind of method and device for running application program
CN107770768A (en) A kind of data network restoration methods, mobile terminal
CN103399657B (en) The control method of mouse pointer, device and terminal unit
CN108319421A (en) A kind of display triggering method and mobile terminal
CN107817988A (en) The management method and Related product of PUSH message
CN109739394A (en) A kind of processing method of SAR value, mobile terminal
CN106055237B (en) One kind slides booster response method and equipment
CN109523977A (en) Backlight adjusting method, device, mobile terminal and storage medium
CN107066090A (en) The method and mobile terminal of a kind of control fingerprint recognition module
CN108196781A (en) The display methods and mobile terminal at interface
CN106648460B (en) Step counting data filtering method and intelligent terminal
CN107330867A (en) Image combining method, device, computer-readable recording medium and computer equipment
CN106155888A (en) The detection method of webpage loading performance and device in a kind of Mobile solution
CN107632985A (en) Webpage preloads method and device
CN109189538A (en) Method and device for sending directional red packet
CN106412250B (en) One kind falling statistical method and device
CN108234760A (en) Athletic posture recognition methods, mobile terminal and computer readable storage medium
CN107864378A (en) A kind of frame rate detection method, device, mobile terminal and server
US20150070360A1 (en) Method and mobile terminal for drawing sliding trace

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant