CN100361161C - Cartoon display method - Google Patents

Cartoon display method Download PDF

Info

Publication number
CN100361161C
CN100361161C CNB200510131814XA CN200510131814A CN100361161C CN 100361161 C CN100361161 C CN 100361161C CN B200510131814X A CNB200510131814X A CN B200510131814XA CN 200510131814 A CN200510131814 A CN 200510131814A CN 100361161 C CN100361161 C CN 100361161C
Authority
CN
China
Prior art keywords
pixel
frame
animation
circulation
loaded
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
CNB200510131814XA
Other languages
Chinese (zh)
Other versions
CN1776746A (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.)
Beijing Kingsoft Software Co Ltd
Original Assignee
Beijing Kingsoft Software 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 Beijing Kingsoft Software Co Ltd filed Critical Beijing Kingsoft Software Co Ltd
Priority to CNB200510131814XA priority Critical patent/CN100361161C/en
Publication of CN1776746A publication Critical patent/CN1776746A/en
Application granted granted Critical
Publication of CN100361161C publication Critical patent/CN100361161C/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)
  • Display Devices Of Pinball Game Machines (AREA)

Abstract

The present invention relates to a cartoon display method which comprises the steps that an image frame display rule is preset for selecting part of all image frames which form a cartoon for display output. The serial numbers of image frames which need loading and displaying in current display circulation are obtained according to the image display rule, and then the image frames which need loading and displaying are judged whether to be loaded to a memory or not, wherein if the image frames are loaded to the memory, the image frames can be displayed directly, or the image frames with the serial number are loaded to the memory to output to display. The present invention guarantees the output fluency of cartoons, and stabilize the output quality of cartoons.

Description

A kind of cartoon display method
Technical field
The present invention relates to the computer picture display technique, especially a kind of cartoon display method.
Background technology
In recreation, in order to satisfy the demand of player's personalization, often need to design a large amount of pixels, and enrich the output of pixel by the system of changing the outfit of complexity.Therefore, often to face following problem in the animation display technology.
The picture that has has comprised a large amount of pixels, has for example comprised a plurality of player roles in a game picture, and each role has the moulding that has nothing in common with each other, and the motion action that has nothing in common with each other simultaneously.Existing animation export technique comprises dynamic load and static load mode.Described dynamic load is meant when using some pixels, just this pixel is loaded into internal memory from hardware memory space; Described static the loading is meant when program begins, and all pixels are loaded in the internal memory, waits for application call.When comprising a large amount of pixel in the picture,, adopt the dynamic load mode if use the mode of dynamic load to export picture, if the picture pixel is too much, lot of data can cause the obstruction of hardware input I/O and cause the program obstruction, causes cartoon picture output discontinuous, influences the animation output quality; If use the static mode that loads to export animation, this method needs pre-loaded lot of data, and causes start-up routine overlong time and the too much problem of committed memory.
In order to address the above problem, the following scheme of the many employings of the animation display technology in the existing recreation: when program began, the loading section pixel is in internal memory, and was concrete, can pre-determine the pixel that will load according to demand in program; In the program process,, load the pixel that will use behind the Free up Memory if the current pixel that will show no longer in the middle of the internal memory, is then eliminated the part pixel in the internal memory.The defective of existing method is: owing to when starting, need the loading section pixel, therefore cause the long program start time; And in the program operation process, prior art can't be predicted the frequency of utilization of each pixel, therefore the pixel that might have does not often use but committed memory space, cause the waste of memory headroom, perhaps load the repetitive operation of pixel, waste unnecessary system resource.
Summary of the invention
For addressing the above problem, the purpose of this invention is to provide a kind of cartoon display method, Hardware I/O that this method can reduce in the animation loading procedure blocks, and reduces the EMS memory occupation capacity.
For solving the problems of the technologies described above, the invention provides a kind of cartoon display method, comprising: preset frame and show rule, the partial frame that is used for choosing all frames of forming animation shows output; Show rule according to described frame, obtain the numbering that needs the frame of loaded and displayed in the current demonstration circulation; Judge whether the described frame of loaded and displayed that needs has been loaded into internal memory, if then directly show; Otherwise the frame that loads this numbering shows to the internal memory line output of going forward side by side.
Wherein, described rule is to choose the frame that is numbered the equal difference arrangement in the animation to show.A kind of algorithm of this rule is: X 1=floor (floor (X/F) * F+mod (X, F)/P 1) * P 1, wherein F is the animation totalframes, P 1Be animation quality coefficient, X 1Be the current frame number of choosing demonstration, when X is played in order F frame current demonstration circulation corresponding to frame number.Wherein, animation quality coefficient P 1With the Geometric Sequence setting, to reduce number corresponding to different frame; And then before animation display by determining animation quality coefficient P 1
On the said method basis, the MAP that adopts the C++ java standard library to provide stores the information of the pixel that loads, and by traveling through MAP, judges that the current pixel that will load is whether in internal memory.
On the said method basis, further limit the heap(ed) capacity that each shows pixel in the circulation.And then, if the pixel that needs to show fails to be loaded into internal memory, then call this animation the last pixel that loads in the circulation that shows in internal memory in the demonstration circulation of determining.Concrete, the method for restriction pixel heap(ed) capacity can adopt: judge whether the total volume and the current pixel capacity sum that will load that have loaded pixel are not less than threshold value, if greater than the operation that then stops to load in this demonstration circulation pixel.
On the said method basis, load the preceding judgement of pixel memory headroom size, if the memory headroom deficiency is then eliminated untapped at most pixel in the internal memory.
Above technical scheme as can be seen, in the cartoon display method provided by the invention, frame in one width of cloth animation is deleted according to the rule that presets, and to the flow set threshold value of frame, and then show output, reached the purpose of saving internal memory and Control Flow, when the machines configurations of animation/program run is high, the present invention has guaranteed the continuity of animation output, avoids occurring the phenomenon that animation output pauses.When especially applying the present invention in the recreation, this method can reduce the requirement of recreation to computer configuration, makes active computer can not become the bottleneck of the game running of the high configuration of requirement.
Further, on the said method basis, the present invention also provides a plurality of animation frame to delete the degree option, can make the user delete degree according to machines configurations and application demand decision frame, promptly can select to delete that for the lower user of machines configurations more frame is used to guarantee the fluency of animation output.Preferably, adopted the computing method of Geometric Sequence to determine the degree of deleting of frame among the present invention.This algorithm has further guaranteed the fluency of animation output, stablizes the animation output quality.
Further, the present invention controls by each being shown the flow in the circulation, exists one to show the calculating of finishing pixel in the circulation in having guaranteed fully reasonably to use, the loading of pixel, and the drafting of pixel is in order to avoid carry out unnecessary work.After for example loading pixel, lack enough resources and draw pixel, or, do not load enough pixels, cause the resource free time to wait this method further to improve internal memory and use reasonably maximization, guaranteed the quality of animation display showing in cycling time; And,, thereby guaranteed the integrality of picture simultaneously because the present invention calls the last identical pixel that loads compensating the pixel of failing to load in the current demonstration circulation.
The present invention also adopts and does not use the principle of eliminating internally to deposit into the line pipe reason at most, has further reduced system loading, has improved the fluency of animation output.
Description of drawings
Fig. 1 is an embodiment of the invention process flow diagram.
Embodiment
The invention provides a kind of method of animation display.Described animation is made up of one group of picture continuous and that have fade effect, and every pictures is called a frame, and an animation is generally used for showing a complete action, and frame number is many more, and action shows smoothly more.Described frame for example is each picture (pixel) that shows demonstration in the circulation, and the animation that butterfly's wing is agitated is made of continuously the different picture in several width of cloth wings position, is shown as the effect that wing is agitated when picture is play continuously.Comprised several and show circulation in animation, the drafting of cartoon picture is to be the cyclic process in cycle with time, finishes a subframe and represent and necessary logical operation in each shows circulation; Each shows that in the circulation, all animations all show a frame in the picture, and the round-robin time can customize as required, and for example, the animation display round-robin cycle is set to 50 milliseconds usually in the existing recreation.
On above known concept basis, specify the preferred embodiments of the present invention.Minimizing Hardware I/O blocks and the saving memory headroom in order to reach in the animation display output procedure, and to guarantee the purpose of animation display smoothness, the core of present embodiment comprises the content of three aspects.
1) frame in the width of cloth animation is deleted, so that save memory headroom in the animation output procedure.
Suppose that a width of cloth animation is made up of 10 frames that are numbered 1 to 10.Principle of the present invention be according to certain rule under the constant situation of animation duration, can only load and show and be numbered 1,3,5,7,9 frame, perhaps a loaded and displayed is numbered 1,5,9 frame.
Concrete, as the following algorithm examples that provides, the X frame that a width of cloth animation is drawn in the request of establishing calculates according to following formula, the frame X that actual loaded shows 1For:
X 1=floor(floor(X/F)*F+mod(X,F)/P 1)*P 1
Wherein F is the totalframes of this animation, promptly forms the picture sum of this animation; Floor is a bracket function, and mod is for getting complementary function, the frame that the X request of referring to is drawn, X 1Refer to the frame of actual displayed output, P 1Be the animation quality coefficient that is provided with in the present embodiment.In above-mentioned algorithm, pass through FACTOR P 1Realization adopts the algorithm of Geometric Sequence that P is set to the control of animation frame degree of taper may in the present embodiment 1, to P 1Value is provided with a scope; And then for the user provides the option of an animation quality, for example the option content can comprise senior animation quality, intermediate animation quality, rudimentary animation quality etc.; Those options correspond respectively to P 1Several values.The user can revise P by selecting the option content indirection according to the configuration quality of own machine 1Value, if machines configurations is low, then the user can select rudimentary animation quality, the frame number of the final loaded and displayed of this animation is just few so, promptly by above the algorithmic formula of lifting as can be known, the animation quality is low more, X and X 1Space-number high more, the frame number of loaded and displayed is few more.
The algorithm that adopts Geometric Sequence of above giving an actual example carries out deleting of frame to what different quality required, in the present invention, real needs according to service application can adopt other algorithms, and for example other linear or nonlinear algorithms select the partial frame in the animation to show output.Specific algorithm and parameter configuration mode those skilled in the art can customize voluntarily.
For example: represent the process that wing is agitated if comprise in certain animation, use 10 demonstration circulations to finish the process that described wing is agitated, and preset the picture of 10 frames; frame number is 1 ... 10; wing place picture position has nothing in common with each other in every frame; but the wing position is continuous mutually in the frame of front and back, and then when order output shows 1 to 10 frame, can present the effect that wing is agitated.Adopt above-mentioned animation output frame to delete method, to the 10 frame indentation row reduction of original animation, animation quality coefficient P 1Equal at 2 o'clock, promptly show the 1st, 3,5,7,9 frames, show in the circulation at the 2nd, system is still the 1st frame by the frame that above-mentioned formula calculates current loading, do not need to carry out again the operation that the 1st frame loads this moment, export and directly call the 1st frame that has been loaded in the internal memory, promptly selected each frame is keeping continuous two to show round-robin output, the rest may be inferred this animation still uses 10 show that circulation finished wing and agitated representing of process.Be that the animation quality coefficient equals 2 and 4 o'clock frame load condition respectively in the following table.
Show circulation p1=2 p1=4
x x1 x x1
1 1 1 1 1
2 2 1 2 1
3 3 3 3 1
4 4 3 4 1
5 5 5 5 5
6 6 5 6 5
7 7 7 7 5
8 8 7 8 5
9 9 9 9 9
10 10 9 10 9
2) control each and show pixel heap(ed) capacity in the circulation.
Each shows in the circulation, all can load the pixel of a constant volume to internal memory.Described pixel correspondence the frame in the animation, is the minimum drawing unit of image.Further by each being shown the flow in the circulation controls, guaranteed to show in the circulation that at one reasonably Resources allocation is finished the calculating of pixel, the loading of pixel and the drafting of pixel among the present invention; And,, then call this animation the last pixel that loads in the circulation that shows in internal memory if in the demonstration circulation of determining, need the pixel of certain animation of showing to fail to be loaded into internal memory.
In order to realize this purpose, threshold value Q can be set in the specific implementation can load the max cap. of pixel as each circulation time that shows, this threshold value Q can be by concrete business demand, practical experience value, and definite according to the computing velocity of internal memory and hard disk; A parameter Q1 is set, is used to write down the total volume that each demonstration circulation time pixel loads.When the load capacity Q1 of pixel is greater than or equal to the max cap. Q of setting, then in current demonstration circulation, stop to load pixel to internal memory.If the pixel that needs to show fails to be loaded in the internal memory, search then that the employed pixel of this animation shows in the last demonstration circulation in current demonstration circulation.When this shows loop ends, with the zero clearing of Q1 value, the next calculating that shows circulation pixel heap(ed) capacity of beginning.
For example, comprise in certain animation and represent the process that wing is agitated, use 5 demonstration circulations to finish the process that described wing is agitated, and each shows that circulation shows the picture of a frame; frame number is respectively 1,2,3,4,5; wing place picture position has nothing in common with each other in every frame, but the wing position is continuous mutually in the frame of front and back, and then can present the effect that wing is agitated when order output shows 1 to 5 frame.Being located at next the demonstration in the circulation will show the 3rd frame, then need load each pixel in the 3rd frame picture to internal memory.Suppose under the situation that adopts above-mentioned flow control, because being loaded into the pixel amount of internal memory, the 3rd frame reached the thresholding that presets, make that the wing pixel is failed to be loaded in the internal memory in the 3rd frame, then return the wing pixel of having preserved in the internal memory that loads and show in the 2nd demonstration circulation, promptly the 2nd frame shows output in the 3rd demonstration circulates.
This for example in, before loading pixel, whether judge the total volume that loaded pixel and the current pixel capacity sum that will load, if then call this animation the last pixel that is loaded in circulating that shows in internal memory more than or equal to threshold value.Otherwise, the current pixel that will load of loaded and displayed.Do not get rid of the method that other are provided with the EMS memory occupation thresholding among the present invention, as memory usage etc.
3) to the management of internal memory.
Each shows that circulation all comprises the operation that loads pixel in the internal memory, when memory headroom is not enough, adopts and uses superseded principle to unload those untapped at most pixels at most, with the releasing memory space, is used to load new pixel.
Below specifically introduced the part technological means that is adopted among the present invention.Following with reference to Fig. 1, the treatment scheme of cartoon display method of the present invention is described.
Operation begins carry out step 11: when memory headroom was not enough, untapped at most pixel in the unloading internal memory loaded new pixel with the releasing memory space;
Step 12: according to the frame X of actual loaded in the current demonstration circulation of the algorithm computation that presets 1Judgment frame X 1Whether be loaded into internal memory, then carry out step 13 if not, otherwise between export demonstration; The MAP that adopts the C++ java standard library to provide in the present embodiment stores the information of the pixel that loads, and by traveling through MAP, can judge that the current pixel that will load is whether in internal memory;
Step 13: calculate the pixel capacity that has loaded in the current demonstration circulation;
Step 14: judge whether current load capacity reaches and preset thresholding, then carry out step 15 if not, if the time then carry out step 16;
Step 15: the pixel that continues to load animation X1 frame;
Step 16:, return the last employed frame of animation of drawing for the pixel of failing to load.
EO.
More than be the preferred embodiments of the present invention, among this embodiment organic combination has been carried out in memory management and flow control, when promptly taking not use superseded principle releasing memory space at most, select the frame that will load and show in the width of cloth animation according to the rule that presets, and in the process of conducting frame loading the pixel load traffic in the frame is controlled.Because the many aspects in animation display adopt described technological means, thereby have reached reduction system operating load, improve the purpose of animation output fluency.
More than a kind of cartoon display method provided by the present invention is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (7)

1, a kind of cartoon display method is characterized in that:
Preset frame and show rule, the partial frame that is used for choosing all frames of forming animation shows output;
Described rule is specially: X 1=floor (floor (X/F) * F+mod (X, F)/P 1) * P 1, wherein F is the animation totalframes, P 1Be animation quality coefficient, X 1Be the current frame number of choosing demonstration, when X is played in order F frame current demonstration circulation corresponding to frame number;
Show rule according to described frame, obtain the numbering that needs the frame of loaded and displayed in the current demonstration circulation;
Judge whether the described frame of loaded and displayed that needs has been loaded into internal memory, if then directly show; Otherwise the frame that loads this numbering shows to the internal memory line output of going forward side by side.
2, cartoon display method as claimed in claim 1 is characterized in that:
Described animation quality coefficient P 1With the Geometric Sequence setting, to reduce number corresponding to different frame; And,
Determine animation quality coefficient P before the animation display earlier 1
3, cartoon display method as claimed in claim 1 is characterized in that:
The MAP that uses the C++ java standard library to provide stores the information of the pixel that loads, and by traveling through MAP, judges that the current pixel that will load is whether in internal memory.
4, cartoon display method as claimed in claim 1 is characterized in that, further comprises:
Limit the heap(ed) capacity that each shows pixel in the circulation.
5, cartoon display method as claimed in claim 4 is characterized in that:
Further, show pixel heap(ed) capacity in the circulation,, then call this animation the last pixel that loads in the circulation that shows in internal memory in the demonstration circulation of determining if the pixel that needs to show fails to be loaded into internal memory owing to limit each.
6, cartoon display method as claimed in claim 5 is characterized in that, the method for described restriction pixel heap(ed) capacity is:
Judge whether the total volume and the current pixel capacity sum that will load that have loaded pixel are not less than threshold value, if greater than the operation that then stops to load in this demonstration circulation pixel.
7, cartoon display method as claimed in claim 1 is characterized in that, further comprises:
Judge the memory headroom size before loading pixel, if the memory headroom deficiency is then eliminated untapped at most pixel in the internal memory.
CNB200510131814XA 2005-12-15 2005-12-15 Cartoon display method Active CN100361161C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200510131814XA CN100361161C (en) 2005-12-15 2005-12-15 Cartoon display method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200510131814XA CN100361161C (en) 2005-12-15 2005-12-15 Cartoon display method

Publications (2)

Publication Number Publication Date
CN1776746A CN1776746A (en) 2006-05-24
CN100361161C true CN100361161C (en) 2008-01-09

Family

ID=36766217

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200510131814XA Active CN100361161C (en) 2005-12-15 2005-12-15 Cartoon display method

Country Status (1)

Country Link
CN (1) CN100361161C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100428279C (en) * 2006-11-10 2008-10-22 北京金山软件有限公司 Cartoon realizing method and cartoon drawing system thereof
CN101640780B (en) * 2008-07-30 2013-03-20 鸿富锦精密工业(深圳)有限公司 Image browsing system and method
CN103577663A (en) * 2012-07-18 2014-02-12 人人游戏网络科技发展(上海)有限公司 Information sending and displaying method and device thereof
CN106162299B (en) * 2015-03-31 2020-04-17 青岛海信电器股份有限公司 OSD animation material data playing method and device
CN107464209B (en) * 2017-03-24 2019-01-11 深圳市保千里电子有限公司 A kind of dispatching method and system of animation
CN107398070B (en) 2017-07-19 2018-06-12 腾讯科技(深圳)有限公司 Display control method and device, the electronic equipment of a kind of game picture
CN114363699B (en) * 2019-07-29 2024-03-12 创新先进技术有限公司 Animation file playing method and device and terminal equipment

Also Published As

Publication number Publication date
CN1776746A (en) 2006-05-24

Similar Documents

Publication Publication Date Title
CN100361161C (en) Cartoon display method
CN102541538B (en) Picture displaying method and device based on mobile terminal
CN105205014A (en) Data storage method and device
AU2008258132B2 (en) Load balancing in multiple processor rendering systems
CN112905326A (en) Task processing method and device
CN103309748A (en) Adaptive scheduling host system and scheduling method of GPU virtual resources in cloud game
CN114740965B (en) Processing method for reducing terminal power consumption, device thereof, terminal and readable storage medium
CN105320570A (en) Resource management method and system
CN112596843A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107122176A (en) A kind of pattern drawing method and device
CN102521866A (en) Character animation implementation method and system
CN107077376A (en) Frame buffer implementation method, device, electronic equipment and computer program product
CN108694083B (en) Data processing method and device for server
CN105022758B (en) A kind of text texture management method and apparatus
CN109978979A (en) Improve the method, apparatus and electronic equipment of real-time rendering interaction fluency
CN110209447A (en) A kind of list page data display method and list page data presentation device
CN115686800B (en) Dynamic core scheduling method and device for multi-core system
CN109448092B (en) Load balancing cluster rendering method based on dynamic task granularity
CN105678828A (en) Method and apparatus for creating transition animations
KR101347178B1 (en) Apparatus and method for drawing vector image
CN114661473A (en) Task processing method and device, storage medium and electronic equipment
CN114237903A (en) Memory allocation optimization method, memory allocation optimization device, electronic equipment, memory allocation optimization medium and program product
CN116468597B (en) Image rendering method and device based on multiple GPUs and readable storage medium
CN112463389A (en) Resource management method and device for distributed machine learning task
CN112395036A (en) Page rendering method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant