Method, device and equipment for processing animation frame rate and storage medium

CN115775290BActive Publication Date: 2026-10-30BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111040051.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-06
Publication Date
2026-10-30
Estimated Expiration
2041-09-06

AI Technical Summary

Technical Problem

[0003]目前,同一界面上展示的多个动画元素都是按照自身的绘制周期进行绘制的,这会使一秒钟绘制的帧率较大,比如,一个20帧的动画绘制时,还有一个30帧的动画绘制,如果两个动画交叉进行绘制,则绘制帧率会达到50帧,绘制帧率过大不仅会增加功耗,还会导致终端设备的CPU(Central Processing Unit,中央处理器)和GPU(Graphics ProcessingUnit,图形处理器)负载较大,容易造成终端设备卡顿

Benefits of technology

[0016]本公开实施例提供的技术方案与现有技术相比具有如下优点:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115775290B_ABST
    Figure CN115775290B_ABST
Patent Text Reader

Abstract

The present disclosure provides an animation frame rate processing method, device and equipment and a storage medium. The method comprises: determining whether there is an animation being drawn when an animation rendering access signal is received, and if the animation being drawn is stored, obtaining a current drawing frame rate; and drawing the animation being drawn and an animation corresponding to the animation rendering access signal by aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal. The animation frame rate processing method provided by the present disclosure can align the current drawing frame rate of the animation being drawn with the animation drawing frame rate corresponding to the animation rendering access signal, thereby reducing the global animation frame rate and achieving the purpose of reducing the CPU and GPU load, so as to effectively reduce the probability of terminal device freezing. At the same time, the reduction of the global animation frame rate also reduces the power consumption of drawing the animation, which is conducive to improving the endurance of the terminal device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of animation rendering technology, and in particular to a method, apparatus, device and storage medium for processing animation frame rate. Background Technology

[0002] With the development of video applications, the number of animated elements displayed on video presentation interfaces is increasing. For example, the same video presentation interface may include multiple animated elements such as jumping musical notes, scrolling text, and other animations.

[0003] Currently, multiple animated elements displayed on the same interface are drawn according to their own drawing cycles. This results in a high frame rate per second. For example, if one animation is drawing at 20 frames per second and another at 30 frames per second, and the two animations are drawn in an overlapping manner, the drawing frame rate will reach 50 frames per second. An excessively high drawing frame rate not only increases power consumption but also leads to a heavy load on the CPU (Central Processing Unit) and GPU (Graphics Processing Unit) of the terminal device, which can easily cause the terminal device to lag. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides an animation frame rate processing method. By aligning the current drawing frame rate of the currently being drawn animation with the animation drawing frame rate corresponding to the animation rendering access signal, the global animation frame rate is reduced, thereby reducing the CPU and GPU load.

[0005] In a first aspect, this disclosure provides a method for processing animation frame rates, the method comprising:

[0006] When an animation rendering access signal is received, determine whether there is an animation currently being drawn;

[0007] If it is determined that an animation is currently being drawn, then obtain the current drawing frame rate;

[0008] By aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

[0009] Secondly, this disclosure also provides an animation frame rate processing apparatus, the apparatus comprising:

[0010] The determination module is used to determine whether an animation is currently being drawn when an animation rendering access signal is received;

[0011] The acquisition module is used to acquire the current drawing frame rate if it is determined that an animation is currently being drawn.

[0012] The alignment module is used to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and then draw the animation being drawn and the animation corresponding to the animation rendering access signal.

[0013] Thirdly, this disclosure provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the above-described animation frame rate processing method.

[0014] Fourthly, this disclosure provides an apparatus comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the above-described animation frame rate processing method.

[0015] Fifthly, this disclosure provides a computer program product, which includes a computer program / instruction, and when the computer program / instruction is executed by a processor, it implements the above-described animation frame rate processing method.

[0016] The technical solution provided in this disclosure has the following advantages compared with the prior art:

[0017] This disclosure provides a method for processing animation frame rates. First, upon receiving an animation rendering access signal, it is determined whether an animation is currently being rendered. If an animation is stored, the current rendering frame rate is obtained. Then, by aligning the current rendering frame rate with the animation rendering frame rate corresponding to the animation rendering access signal, both the currently rendering animation and the animation corresponding to the animation rendering access signal are rendered. As can be seen, the animation frame rate processing method provided by this disclosure can align the current rendering frame rate of the currently rendering animation with the animation rendering frame rate corresponding to the animation rendering access signal, thereby reducing the global animation frame rate and reducing the CPU and GPU load, thus effectively reducing the probability of stuttering on the terminal device. Simultaneously, the reduction in the global animation frame rate also reduces the power consumption of rendering animation, which is beneficial for improving the battery life of the terminal device. Attached Figure Description

[0018] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0019] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an animation frame rate processing method according to an embodiment of the present disclosure.

[0021] Figure 2 This is a schematic diagram showing the comparison before and after frame rate alignment of two animations with the same drawing frame rate, provided as an embodiment of the present disclosure.

[0022] Figure 3 A flowchart illustrating an animation frame rate processing method provided in another embodiment of this disclosure;

[0023] Figure 4 This is a schematic diagram comparing two animations before and after frame rate alignment, provided as an embodiment of the present disclosure. Figure 1 ;

[0024] Figure 5 This is a schematic diagram comparing two animations before and after frame rate alignment, provided as an embodiment of the present disclosure. Figure 2 ;

[0025] Figure 6 This is a schematic diagram comparing two animations before and after frame rate alignment, provided as an embodiment of the present disclosure. Figure 3 ;

[0026] Figure 7 A schematic diagram of the structure of an animation frame rate processing device provided in an embodiment of this disclosure;

[0027] Figure 8 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present disclosure. Detailed Implementation

[0028] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0029] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0030] To reduce the load on the CPU and GPU and decrease the probability of lag on terminal devices, this disclosure provides an animation frame rate processing method. First, upon receiving an animation rendering access signal, it is determined whether an animation is currently being rendered. If an animation is stored, the current rendering frame rate is obtained. Then, by aligning the current rendering frame rate with the animation rendering frame rate corresponding to the animation rendering access signal, both the currently rendering animation and the animation corresponding to the animation rendering access signal are rendered. As can be seen, the animation frame rate processing method provided in this disclosure can align the current rendering frame rate of the currently rendering animation with the animation rendering frame rate corresponding to the animation rendering access signal, thereby reducing the global animation frame rate and achieving the goal of reducing the load on the CPU and GPU, thus effectively reducing the probability of lag on terminal devices. Simultaneously, the reduction in the global animation frame rate also reduces the power consumption of rendering animation, which is beneficial for improving the battery life of terminal devices.

[0031] Based on this, the present disclosure provides a method for processing animation frame rate, referring to... Figure 1 This is a flowchart illustrating an animation frame rate processing method provided in an embodiment of the present disclosure. The method can be executed by an animation frame rate processing device, which can be implemented in software and / or hardware and is generally integrated into terminal devices such as tablet computers and smartphones.

[0032] like Figure 1 As shown, the method for processing the animation frame rate includes:

[0033] S101: When an animation rendering access signal is received, determine whether there is currently an animation being drawn.

[0034] In this embodiment of the disclosure, the animation rendering access signal can be represented by the Vsync signal.

[0035] In Android systems, the VSync signal is typically used to schedule the copy operation from the Back Buffer to the Frame Buffer. At a certain point in time, a screen refresh cycle is completed, resulting in a brief refresh blank period. During this period, the VSync signal is generated, the copy operation is completed first, and then the CPU / GPU is notified to draw the next frame. In other words, the CPU / GPU only begins drawing the image when the VSync signal is generated. Therefore, in this embodiment of the disclosure, the presence of a new animation to be drawn can be determined by listening to the VSync signal. When the VSync signal is received, it indicates that a new animation is ready to be drawn.

[0036] Furthermore, upon receiving the VSync signal, it continues to determine whether an animation is currently being drawn.

[0037] For example, it can be determined whether an animation is currently being drawn by listening to the corresponding process, which will not be described in detail in this disclosure.

[0038] S102: If it is determined that there is currently an animation being drawn, then obtain the current drawing frame rate.

[0039] In this embodiment of the disclosure, when it is determined that there is currently an animation being drawn, the current drawing frame rate is further obtained.

[0040] Typically, animation rendering follows a pattern. For example, when the rendering frame rate is 30 FPS (frames per second), it can be rendered according to the pattern 01010101, where positions "0" are not rendered and positions "1" are rendered frames. Therefore, by way of example, in this embodiment of the present disclosure, the current rendering frame rate corresponding to the currently rendered animation can be determined based on the rendering pattern of the currently being rendered animation.

[0041] It should be noted that the current frame rate of the currently drawing animation can be the current frame rate of a single animation, or it can be the frame rate determined by aligning the frame rates of multiple animations using the scheme disclosed herein. For example, if there is only one animation being drawn, then the current frame rate is the frame rate corresponding to that animation; if there are at least two animations being drawn, then the current frame rate is the frame rate after aligning the frame rates of at least two animations currently being drawn.

[0042] S103: By aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

[0043] The animation rendering frame rate corresponding to the animation rendering access signal can be obtained when the animation rendering access signal is detected. Typically, each animation element displayed on the same interface as the video is pre-registered, allowing all animation registration signals to be intercepted and the corresponding rendering frame rate of each animation to be recorded.

[0044] For example, the animation registration signal may include an animation identifier and a corresponding drawing frame rate. By intercepting the animation registration signal, the animation identifier and drawing frame rate are obtained from it, and the correspondence between the animation identifier and the drawing frame rate is recorded. Therefore, when an animation rendering access signal is detected, the above correspondence can be queried based on the animation identifier contained in the animation rendering access signal to determine the animation drawing frame rate corresponding to the animation rendering access signal. Additionally, if only one animation is currently being drawn, the current drawing frame rate of the currently drawing animation can also be obtained by querying the above correspondence based on the identifier of the currently drawing animation.

[0045] In this embodiment of the disclosure, when aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, different alignment strategies can be selected for alignment processing by determining whether the current drawing frame rate is consistent with the animation drawing frame rate corresponding to the animation rendering access signal.

[0046] For example, when the current drawing frame rate is the same as the animation drawing frame rate corresponding to the animation rendering access signal, the drawing timing of the animation corresponding to the animation rendering access signal can be delayed, and the drawing of the animation corresponding to the animation rendering access signal can be started when the currently drawing animation enters the drawing frame.

[0047] Figure 2 This is a schematic diagram showing the comparison before and after frame rate alignment of two animations with the same drawing frame rate, provided in an embodiment of this disclosure. Figure 2 In the diagram, Animation 1 is the currently being drawn animation, and Animation 2 is the animation corresponding to the animation rendering input signal. Both Animation 1 and Animation 2 have a drawing frame rate of 30 FPS. Figure 2 As shown, before frame rate alignment, when animation 2 is a drawing frame and animation 1 is not, both animation 1 and animation 2 need to be drawn, resulting in a global drawing frame rate as high as 60 FPS. If animation 2 is drawn with a 1-frame delay, waiting for animation 1 to enter a drawing frame before starting drawing, then from... Figure 2 As can be seen, the rendering frames of Animation 1 and Animation 2 are aligned, and the global rendering frame rate remains at 30 FPS. Comparing the global rendering frame rate before and after frame rate alignment, it can be seen that the global rendering frame rate is significantly reduced after frame rate alignment, while the rendering frame rate for each animation remains unchanged. The reduction in the global rendering frame rate also reduces the CPU / GPU load on the terminal device.

[0048] For example, when the current drawing frame rate is different from the animation drawing frame rate corresponding to the animation rendering access signal, a corresponding alignment strategy can be determined based on the relationship between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal. Specifically, if the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal are integer multiples of each other, frame rate alignment is performed by aligning the first drawing frame. If the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal are not integer multiples of each other, the drawing interval can be dynamically adjusted based on the alignment of the first drawing frame by intermittently adjusting the misaligned frame rate intervals of the current drawing frame rate and / or the animation drawing frame rate corresponding to the animation rendering access signal, so as to maximize the alignment between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal.

[0049] The animation frame rate processing method of this disclosure first determines whether an animation is currently being drawn upon receiving an animation rendering access signal. If an animation is being drawn, the current drawing frame rate is obtained. Then, by aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, both the currently drawing animation and the animation corresponding to the animation rendering access signal are drawn. It is evident that the animation frame rate processing method provided by this disclosure can align the current drawing frame rate of the currently drawing animation with the animation drawing frame rate corresponding to the animation rendering access signal, thereby reducing the global animation frame rate and reducing the CPU and GPU load, thus effectively reducing the probability of stuttering on the terminal device. Simultaneously, the reduction in the global animation frame rate also reduces the power consumption of drawing animations, which is beneficial for improving the battery life of the terminal device.

[0050] Figure 3 A flowchart illustrating an animation frame rate processing method according to another embodiment of this disclosure is shown below. Figure 3 As shown, based on the foregoing embodiments, step 103 may include the following steps:

[0051] S201: Determine the number of frames between two adjacent drawing frames in the current drawing frame rate, and use it as the first interval frame number.

[0052] The interval frame count refers to the number of frames contained in a repeated drawing cycle. For example, for a drawing frame rate of 011011011011, the interval frame count is 3; for a drawing frame rate of 01010101, the interval frame count is 2.

[0053] What is understandable is that determining the number of frames between two adjacent rendering frames in the current rendering frame rate is equivalent to determining the number of frames contained in a repeating rendering cycle in the current rendering frame rate. For example, assuming the current rendering frame rate is 011011011011, then 011 is a repeating rendering cycle, which contains three frames: 0, 1, and 1. Therefore, the number of frames between the current rendering frame rate is 3.

[0054] S202: Determine the number of frames between two adjacent drawing frames in the animation drawing frame rate corresponding to the animation rendering access signal, and use it as the second interval frame number.

[0055] S203: Based on the modulo result of the first interval frame number and the second interval frame number, the current drawing frame rate is aligned with the animation drawing frame rate corresponding to the animation rendering access signal.

[0056] In this embodiment of the disclosure, after obtaining the first interval frame number of the current drawing frame rate and the second interval frame number of the animation drawing frame rate corresponding to the animation rendering access signal, a modulo operation can be performed based on the first and second interval frame numbers to obtain the modulo result. During the modulo operation, the smaller value between the first and second interval frame numbers is used as the divisor. For example, if the first interval frame number is 3 and the second interval frame number is 2, then the modulo operation is performed with 2 as the divisor and 3 as the dividend, resulting in a modulo result of 1.

[0057] Next, based on the modulo results of the first and second interval frame numbers, the current drawing frame rate is aligned with the animation drawing frame rate corresponding to the animation rendering access signal.

[0058] In one optional implementation, if the modulo result of the first interval frame number and the second interval frame number is determined to be 0, then when the current drawing frame rate is detected to enter the first drawing frame, the first drawing frame of the animation drawing frame rate corresponding to the animation rendering access signal is aligned with the first drawing frame.

[0059] The first drawing frame refers to the drawing frame that is the fastest to be drawn among all the remaining drawing frames that have not been drawn in the current drawing frame rate.

[0060] Figure 4 This is a schematic diagram comparing two animations before and after frame rate alignment, provided as an embodiment of the present disclosure. Figure 1 , Figure 4 In the animation, animation 3 has a frame rate of 40 FPS and a rendering frame rate of 110110110110, while animation 4 has a frame rate of 20 FPS and a rendering frame rate of 001001001001. The animations are rendered from left to right. Figure 4 It can be seen that if frame rate alignment is not performed between animations 3 and 4, the global rendering frame rate is 111111111111, or 60 FPS. When performing frame rate alignment, if animation 4 is aligned to animation 3, the first "1" in the rendering frame rate of animation 3 corresponds to the fastest frame to be rendered, i.e., the first rendering frame. If animation 3 is aligned to animation 4, the first "1" in the rendering frame rate of animation 4 corresponds to the fastest frame to be rendered, i.e., the first rendering frame. Figure 2 This disclosure is explained using the example of aligning animation 4 to animation 3, but this should not be construed as a limitation of the disclosure. From Figure 4 As can be seen, after aligning the first drawing frame of Animation 4 with the first drawing frame, the other drawing frames in Animation 4 are also aligned with the other drawing frames in the current drawing frame rate. The global drawing frame rate after alignment is 110110110110, which is still 40 FPS. Compared with before alignment, the global drawing frame rate is significantly reduced.

[0061] In one optional implementation, if it is determined that the modulo result of the first interval frame number and the second interval frame number is not 0, then a reference frame rate and a frame rate to be aligned are determined from the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; wherein, the reference frame rate is the larger drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal, and the frame rate to be aligned is the smaller drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; the frame rate to be aligned is then aligned to the reference frame rate.

[0062] For example, assuming the current rendering frame rate is 30 FPS and the animation rendering access signal corresponds to an animation rendering frame rate of 20 FPS, the current rendering frame rate can be used as the base frame rate, and the animation rendering access signal's corresponding animation rendering frame rate can be used as the frame rate to be aligned. The frame rate to be aligned can then be aligned to the base frame rate. Alignment can be performed by jumping forward or backward.

[0063] In one optional implementation, aligning the frame rate to be aligned with the reference frame rate may include: when the reference frame rate is detected to enter a second drawing frame, aligning the first drawing frame in the frame rate to be aligned with the second drawing frame; when the reference frame rate is detected to enter a third drawing frame, determining whether the current frame in the frame rate to be aligned is a drawing frame; wherein the third drawing frame is located after the second drawing frame; if it is determined that the current frame in the frame rate to be aligned is not a drawing frame, then determining whether the next frame in the frame rate to be aligned is a drawing frame; if it is determined that the next frame in the frame rate to be aligned is a drawing frame, then aligning it with the third drawing frame in the reference frame rate by jumping and swapping the next frame in the frame rate to be aligned with the current frame.

[0064] The second drawing frame refers to the drawing frame that is drawn first among all the remaining undrawn frames in the base frame rate. The third drawing frame is the drawing frame after the second drawing frame. The current frame in the frame rate to be aligned is the frame corresponding to the third drawing frame in the base frame rate.

[0065] Figure 5 This is a schematic diagram comparing two animations before and after frame rate alignment, provided as an embodiment of the present disclosure. Figure 2 , Figure 5 In the animation, animation 5 has a frame rate of 30 FPS and a rendering frame rate of 010101010101, while animation 6 has a frame rate of 20 FPS and a rendering frame rate of 001001001001. The animations are rendered from left to right. Figure 5It can be seen that if frame rate alignment is not performed between animations 5 and 6, the global rendering frame rate is 011101011101, or 40 FPS. Since the frame rate of animation 5 is greater than that of animation 6, the rendering frame rate corresponding to animation 5 is used as the base frame rate, and the frame rate corresponding to animation 6 is used as the frame rate to be aligned. During frame rate alignment, in the rendering frame rate corresponding to animation 5, the first "1" corresponds to the frame that enters rendering the fastest, i.e., the second rendering frame. The first rendering frame in the rendering frame rate corresponding to animation 6 is aligned with the second rendering frame. When the rendering frame rate corresponding to animation 5 enters the third rendering frame (i.e., the second rendering frame), the frame rate is aligned with the second rendering frame. Figure 5 When the second 1 in the drawing frame rate corresponding to animation 5 is used, the current frame corresponding to the third drawing frame in the drawing frame rate corresponding to animation 6 is 0 (see...). Figure 5 If the frame rate is not a drawing frame (the frame rate corresponding to the jump before the jump), then determine whether the next frame in animation 6 is a drawing frame. Figure 5 As can be seen, if the next frame after the current frame is the drawing frame, then the next frame and the current frame are swapped via a jump. See the result after the jump. Figure 5 The frame rate after the jump is shown in the image. From Figure 5 As can be seen, after the jump between the current frame and the next frame, the frame corresponding to the third drawing frame in the drawing frame rate corresponding to animation 6 is transformed into a drawing frame, which can be drawn simultaneously. A similar method can be used for frame rate alignment for subsequent frames until the animation is complete. From Figure 5 As can be seen, the two frames enclosed by the dashed lines jump forward, and the drawing frame is drawn one frame earlier. After the drawing frame rate of animation 5 is aligned with the drawing frame rate of animation 6 after the jump forward, the resulting global drawing frame rate is 010101010101, which is still 30 FPS. Compared with the 40 FPS before alignment, the global drawing frame rate is reduced.

[0066] In one optional implementation, aligning the frame rate to be aligned with the reference frame rate may include: when the reference frame rate is detected to enter the fourth drawing frame, aligning the first drawing frame in the frame rate to be aligned with the fourth drawing frame; when it is determined that the current frame in the reference frame rate is not a drawing frame, and the current frame in the frame rate to be aligned is a drawing frame, determining whether the next frame in the reference frame rate and the frame rate to be aligned is a drawing frame; if it is determined that the next frame in the reference frame rate is a drawing frame, and the next frame in the frame rate to be aligned is not a drawing frame, then aligning the current frame and the next frame in the frame rate to be aligned with the next frame in the reference frame rate by jumping and swapping the current frame and the next frame in the frame rate to be aligned.

[0067] The fourth drawing frame refers to the drawing frame that is the fastest to be drawn among all the remaining drawing frames that have not been drawn at the base frame rate.

[0068] Figure 6This is a schematic diagram comparing two animations before and after frame rate alignment, provided as an embodiment of the present disclosure. Figure 3 , Figure 6 In the animation, animation 7 has a frame rate of 30 FPS and a rendering frame rate of 010101010101010, while animation 8 has a frame rate of 24 FPS and a rendering frame rate of 011000110001100. The animations are rendered from left to right. Figure 6 It can be seen that if frame rate alignment is not performed on animations 7 and 8, the global rendering frame rate is 011101110101110, or 40 FPS. Since the frame rate of animation 7 is higher than that of animation 8, the rendering frame rate corresponding to animation 7 is used as the baseline frame rate, and the frame rate corresponding to animation 8 is used as the frame rate to be aligned. During frame rate alignment, in the rendering frame rate corresponding to animation 7, the first "1" corresponds to the frame that enters rendering the fastest, i.e., the fourth rendering frame. The first rendering frame in the rendering frame rate corresponding to animation 8 is aligned with the fourth rendering frame. From Figure 6 It can be seen that in the rendering frame rate corresponding to animation 7, the current frame adjacent to the fourth rendering frame is 0, which is not a rendering frame. However, in the rendering frame rate corresponding to animation 8, the current frame adjacent to the first rendering frame is 1, which is a rendering frame. Therefore, we need to determine whether the next frame of animations 7 and 8 is a rendering frame. Figure 6 As can be seen, the next frame in the drawing frame rate corresponding to animation 7 is 1, which is a drawing frame, while the next frame in the drawing frame rate corresponding to animation 8 is 0, which is not a drawing frame. Therefore, the next frame in the drawing frame rate corresponding to animation 8 is swapped with the current frame. The result after the swap is shown in [link to documentation]. Figure 6 The frame rate after the jump is shown in the image. From Figure 6 As can be seen, after the jump between the current frame and the next frame, animation 8 corresponds to the drawing frames in animation 7, and can be drawn simultaneously. A similar method can be used for frame rate alignment for subsequent frames until the animation is complete. Figure 6 As can be seen, the two frames enclosed by the dashed lines jump backward, delaying the drawing of the frame by one frame, while the two frames enclosed by the solid lines jump forward, advancing the drawing of the frame by one frame. After aligning the drawing frame rate of animation 7 with that of animation 8 after the jump, the resulting global drawing frame rate is 010101010101, which is still 30 FPS. Compared to the 40 FPS before alignment, the global drawing frame rate has decreased.

[0069] S204: During the process of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

[0070] In this embodiment of the disclosure, during the alignment process between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal, both the currently drawing animation and the animation corresponding to the animation rendering access signal are drawn. In other words, the animation drawing process is a process of aligning and drawing simultaneously, drawing one frame at a time.

[0071] The animation frame rate processing method of this disclosure determines the number of frames between two adjacent drawing frames in the current drawing frame rate as the first interval frame number, and determines the number of frames between two adjacent drawing frames in the animation drawing frame rate corresponding to the animation rendering access signal as the second interval frame number. Then, based on the modulo result of the first interval frame number and the second interval frame number, the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal are aligned. During the alignment process, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn. Thus, the frame rate alignment between the two animations is achieved, which can effectively reduce the global drawing frame rate, thereby reducing the CPU and GPU load of the terminal device and reducing the phenomenon of lag on the terminal device.

[0072] In one optional implementation, when an animation rendering exit signal is received, it is determined whether the animation drawing frame rate corresponding to the animation rendering exit signal is less than the current drawing frame rate; if it is determined that the animation drawing frame rate corresponding to the animation rendering exit signal is not less than the current drawing frame rate, it is determined whether the number of animations currently being drawn is greater than 1; if it is determined that the number is greater than 1, the frame rate of the currently being drawn animation is re-aligned.

[0073] It is understandable that the animation frame rate processing method disclosed herein aligns the rendering frame rate of each animation as closely as possible to the maximum rendering frame rate among the corresponding rendering frame rates of each animation. In other words, it aligns the rendering frames as closely as possible so that the global rendering frame rate is as equal as possible to the maximum rendering frame rate among all animations. When the rendering frames of other animations are all aligned with the rendering frames of the maximum rendering frame rate, then the global rendering frame rate is the same as the maximum rendering frame rate.

[0074] In this embodiment of the disclosure, when an animation rendering exit signal is received, an animation is exiting the rendering process. At this time, the animation rendering exit frame rate of the exiting animation (i.e., the exiting animation) can be compared with the current rendering frame rate. If the exiting animation's frame rate is not less than the current rendering frame rate, it indicates that the exiting animation is the one with the maximum rendering frame rate. In this case, the maximum rendering frame rate needs to be re-determined from the currently rendering animations for frame rate re-alignment. Before re-aligning the frame rate, it can be determined whether the number of currently rendering animations is greater than one, i.e., whether multiple animations are currently being rendered. If so, the frame rate of the currently rendering animation is re-aligned; otherwise, no re-alignment is performed. Thus, when an animation exits, it is possible to determine whether the remaining animations need to be re-aligned, and when re-alignment is needed, frame rate re-alignment is performed, continuously maintaining the lowest global frame rate.

[0075] Animation frame rates have a certain upper limit, usually 60 FPS. Higher frame rates have little impact on animation playback. Therefore, in one optional implementation, by aligning the current frame rate with the animation frame rate corresponding to the animation rendering access signal, before drawing the animation being drawn and the animation corresponding to the animation rendering access signal, it can be determined whether the current frame rate is lower than the full load frame rate. Then, when it is determined that the current frame rate is lower than the full load frame rate, the current frame rate is aligned with the animation frame rate corresponding to the animation rendering access signal before drawing the animation being drawn and the animation corresponding to the animation rendering access signal.

[0076] The full load frame rate can be the maximum rendering frame rate that the CPU or GPU of the terminal device can support.

[0077] For example, the full load frame rate can be set to 60 FPS.

[0078] In this embodiment, it is first determined whether the current drawing frame rate is lower than the full load frame rate. Only when the current drawing frame rate is determined to be lower than the full load frame rate is the current drawing frame rate aligned with the animation drawing frame rate corresponding to the animation rendering access signal. The animation being drawn and the animation corresponding to the animation rendering access signal are then drawn. If the current drawing frame rate is the full load frame rate, the global drawing frame rate is the full load drawing frame rate regardless of whether frame rate alignment is performed. In this case, the frame rate alignment process will not reduce the global drawing frame rate, so the alignment process is not very meaningful, thus avoiding unnecessary resource consumption caused by alignment process.

[0079] Based on the above method embodiments, this disclosure also provides an animation frame rate processing apparatus, with reference to... Figure 7This is a schematic diagram of the structure of an animation frame rate processing device provided in an embodiment of this disclosure. The animation frame rate processing device 30 includes: a determining module 301, an acquiring module 302, and an alignment module 303, wherein...

[0080] The determination module 301 is used to determine whether there is currently an animation being drawn when an animation rendering access signal is received;

[0081] The acquisition module 302 is used to acquire the current drawing frame rate if it is determined that there is an animation being drawn.

[0082] Alignment module 303 is used to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and then draw the animation being drawn and the animation corresponding to the animation rendering access signal.

[0083] In one alternative implementation, the alignment module 303 includes:

[0084] The first determining unit is used to determine the number of interval frames between two adjacent drawing frames in the current drawing frame rate, as the first interval frame number;

[0085] The second determining unit is used to determine the number of interval frames between two adjacent drawing frames in the animation drawing frame rate corresponding to the animation rendering access signal, as the second interval frame number;

[0086] An alignment unit is used to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal based on the modulo result of the first interval frame number and the second interval frame number.

[0087] The drawing unit is used to draw the animation being drawn and the animation corresponding to the animation rendering access signal during the process of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal.

[0088] In one optional implementation, the alignment unit is specifically used to: if it is determined that the modulo result of the first interval frame number and the second interval frame number is 0, then when the current drawing frame rate is detected to enter the first drawing frame, align the first drawing frame of the animation drawing frame rate corresponding to the animation rendering access signal with the first drawing frame.

[0089] In one alternative implementation, the alignment unit is specifically used for:

[0090] If it is determined that the modulo result of the first interval frame number and the second interval frame number is not 0, then a reference frame rate and a frame rate to be aligned are determined from the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; wherein, the reference frame rate is the larger drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal, and the frame rate to be aligned is the smaller drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal;

[0091] Align the frame rate to be aligned with the reference frame rate.

[0092] In an alternative implementation, the alignment unit is further used for:

[0093] When the reference frame rate is detected to enter the second drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the second drawing frame;

[0094] When the reference frame rate is detected to enter the third drawing frame, it is determined whether the current frame in the frame rate to be aligned is a drawing frame; wherein, the third drawing frame is located after the second drawing frame;

[0095] If it is determined that the current frame in the frame rate to be aligned is not a drawing frame, then it is determined whether the next frame in the frame rate to be aligned is a drawing frame.

[0096] If it is determined that the next frame in the frame rate to be aligned is a drawing frame, then the next frame in the frame rate to be aligned is swapped with the current frame to align with the third drawing frame in the reference frame rate.

[0097] In an alternative implementation, the alignment unit is further used for:

[0098] When the reference frame rate is detected to enter the fourth drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the fourth drawing frame.

[0099] When it is determined that the current frame in the reference frame rate is not a drawing frame, and the current frame in the frame rate to be aligned is a drawing frame, it is determined whether the next frame in the reference frame rate and the frame rate to be aligned is a drawing frame.

[0100] If it is determined that the next frame in the reference frame rate is a drawing frame and the next frame in the frame rate to be aligned is not a drawing frame, then the current frame and the next frame in the frame rate to be aligned are swapped to align with the next frame in the reference frame rate.

[0101] In one optional implementation, the animation frame rate processing device further includes:

[0102] The first judgment module is used to determine whether the animation rendering frame rate corresponding to the animation rendering exit signal is less than the current rendering frame rate when an animation rendering exit signal is received.

[0103] The second judgment module is used to determine whether the number of animations currently being drawn is greater than 1 if it is determined that the animation drawing frame rate corresponding to the animation rendering exit signal is not less than the current drawing frame rate.

[0104] The realignment module is used to trigger the realignment of the frame rate of the currently being drawn animation if it is determined that the number is greater than 1.

[0105] In one optional implementation, the animation frame rate processing device further includes:

[0106] The third judgment module is used to determine whether the current rendering frame rate is lower than the full load frame rate;

[0107] Accordingly, the alignment module 303 is specifically used to: when it is determined that the current drawing frame rate is lower than the full load frame rate, to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and to draw the animation being drawn and the animation corresponding to the animation rendering access signal.

[0108] The animation frame rate processing apparatus provided in this disclosure can execute the animation frame rate processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.

[0109] In addition to the methods and apparatus described above, this disclosure also provides a computer-readable storage medium storing instructions that, when executed on a terminal device, cause the terminal device to implement the animation frame rate processing method described in this disclosure.

[0110] This disclosure also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, they implement the animation frame rate processing method described in this disclosure.

[0111] Figure 8 This is a schematic diagram of the structure of a terminal device provided in an embodiment of the present disclosure.

[0112] The following is a detailed reference. Figure 8The diagram illustrates a structural schematic suitable for implementing the terminal device 400 in the embodiments of this disclosure. The terminal device 400 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 8 The terminal device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0113] like Figure 8 As shown, the terminal device 400 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. The RAM 403 also stores various programs and data required for the operation of the terminal device 400. The processing unit 401, ROM 402, and RAM 403 are interconnected via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0114] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows terminal device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 8 A terminal device 400 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0115] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the animation frame rate processing method of embodiments of this disclosure.

[0116] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0117] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0118] The aforementioned computer-readable medium may be included in the aforementioned terminal device; or it may exist independently and not assembled into the terminal device.

[0119] The aforementioned computer-readable medium carries one or more programs, which, when executed by the terminal device, cause the terminal device to: upon receiving an animation rendering access signal, determine whether an animation is currently being drawn; if it is determined that an animation is currently being drawn, obtain the current drawing frame rate; and draw the animation being drawn and the animation corresponding to the animation rendering access signal by aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal.

[0120] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0122] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.

[0123] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.

[0124] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0125] According to one or more embodiments of this disclosure, this disclosure provides a method for processing animation frame rates, including:

[0126] When an animation rendering access signal is received, determine whether there is an animation currently being drawn;

[0127] If it is determined that an animation is currently being drawn, then obtain the current drawing frame rate;

[0128] By aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

[0129] According to one or more embodiments of this disclosure, in the animation frame rate processing method provided by this disclosure, the step of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and drawing the animation being drawn and the animation corresponding to the animation rendering access signal, includes:

[0130] Determine the number of frames between two adjacent rendering frames in the current rendering frame rate, and use it as the first interval frame number;

[0131] In addition, the number of frames between two adjacent drawing frames in the animation drawing frame rate corresponding to the animation rendering access signal is determined as the second interval frame number;

[0132] Based on the modulo results of the first interval frame number and the second interval frame number, the current drawing frame rate is aligned with the animation drawing frame rate corresponding to the animation rendering access signal;

[0133] During the process of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

[0134] According to one or more embodiments of this disclosure, in the animation frame rate processing method provided by this disclosure, the step of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal based on the modulo result of the first interval frame number and the second interval frame number includes:

[0135] If the modulo result of the first interval frame number and the second interval frame number is determined to be 0, then when the current drawing frame rate is detected to enter the first drawing frame, the first drawing frame of the animation drawing frame rate corresponding to the animation rendering access signal is aligned with the first drawing frame.

[0136] According to one or more embodiments of this disclosure, in the animation frame rate processing method provided by this disclosure, the step of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal based on the modulo result of the first interval frame number and the second interval frame number includes:

[0137] If it is determined that the modulo result of the first interval frame number and the second interval frame number is not 0, then a reference frame rate and a frame rate to be aligned are determined from the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; wherein, the reference frame rate is the larger drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal, and the frame rate to be aligned is the smaller drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal;

[0138] Align the frame rate to be aligned with the reference frame rate.

[0139] According to one or more embodiments of this disclosure, in the animation frame rate processing method provided by this disclosure, aligning the frame rate to be aligned with the reference frame rate includes:

[0140] When the reference frame rate is detected to enter the second drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the second drawing frame;

[0141] When the reference frame rate is detected to enter the third drawing frame, it is determined whether the current frame in the frame rate to be aligned is a drawing frame; wherein, the third drawing frame is located after the second drawing frame;

[0142] If it is determined that the current frame in the frame rate to be aligned is not a drawing frame, then it is determined whether the next frame in the frame rate to be aligned is a drawing frame.

[0143] If it is determined that the next frame in the frame rate to be aligned is a drawing frame, then the next frame in the frame rate to be aligned is swapped with the current frame to align with the third drawing frame in the reference frame rate.

[0144] According to one or more embodiments of this disclosure, in the animation frame rate processing method provided by this disclosure, aligning the frame rate to be aligned with the reference frame rate includes:

[0145] When the reference frame rate is detected to enter the fourth drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the fourth drawing frame.

[0146] When it is determined that the current frame in the reference frame rate is not a drawing frame, and the current frame in the frame rate to be aligned is a drawing frame, it is determined whether the next frame in the reference frame rate and the frame rate to be aligned is a drawing frame.

[0147] If it is determined that the next frame in the reference frame rate is a drawing frame and the next frame in the frame rate to be aligned is not a drawing frame, then the current frame and the next frame in the frame rate to be aligned are swapped to align with the next frame in the reference frame rate.

[0148] According to one or more embodiments of this disclosure, the animation frame rate processing method provided in this disclosure further includes:

[0149] When an animation rendering exit signal is received, it is determined whether the animation drawing frame rate corresponding to the animation rendering exit signal is less than the current drawing frame rate.

[0150] If it is determined that the animation rendering exit signal corresponds to an animation drawing frame rate that is not less than the current drawing frame rate, then it is determined whether the number of animations currently being drawn is greater than 1.

[0151] If the number is determined to be greater than 1, then the frame rate of the currently being drawn animation is re-aligned.

[0152] According to one or more embodiments of this disclosure, in the animation frame rate processing method provided by this disclosure, before aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and before drawing the animation being drawn and the animation corresponding to the animation rendering access signal, the method further includes:

[0153] Determine whether the current rendering frame rate is lower than the full load frame rate;

[0154] Accordingly, the step of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and then drawing the animation being drawn and the animation corresponding to the animation rendering access signal, includes:

[0155] When it is determined that the current drawing frame rate is lower than the full load frame rate, the current drawing frame rate is aligned with the animation drawing frame rate corresponding to the animation rendering access signal, and the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

[0156] According to one or more embodiments of this disclosure, this disclosure provides an animation frame rate processing apparatus, comprising:

[0157] The determination module is used to determine whether an animation is currently being drawn when an animation rendering access signal is received;

[0158] The acquisition module is used to acquire the current drawing frame rate if it is determined that an animation is currently being drawn.

[0159] The alignment module is used to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and then draw the animation being drawn and the animation corresponding to the animation rendering access signal.

[0160] According to one or more embodiments of this disclosure, in the animation frame rate processing apparatus provided by this disclosure, the alignment module includes:

[0161] The first determining unit is used to determine the number of interval frames between two adjacent drawing frames in the current drawing frame rate, as the first interval frame number;

[0162] The second determining unit is used to determine the number of interval frames between two adjacent drawing frames in the animation drawing frame rate corresponding to the animation rendering access signal, as the second interval frame number;

[0163] An alignment unit is used to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal based on the modulo result of the first interval frame number and the second interval frame number.

[0164] The drawing unit is used to draw the animation being drawn and the animation corresponding to the animation rendering access signal during the process of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal.

[0165] According to one or more embodiments of this disclosure, in the animation frame rate processing apparatus provided by this disclosure, the alignment unit is specifically used to: if it is determined that the modulo result of the first interval frame number and the second interval frame number is 0, then when the current drawing frame rate is detected to enter the first drawing frame, align the first drawing frame of the animation drawing frame rate corresponding to the animation rendering access signal with the first drawing frame.

[0166] According to one or more embodiments of this disclosure, in the animation frame rate processing apparatus provided by this disclosure, the alignment unit is specifically used for:

[0167] If it is determined that the modulo result of the first interval frame number and the second interval frame number is not 0, then a reference frame rate and a frame rate to be aligned are determined from the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; wherein, the reference frame rate is the larger drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal, and the frame rate to be aligned is the smaller drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal;

[0168] Align the frame rate to be aligned with the reference frame rate.

[0169] According to one or more embodiments of this disclosure, in the animation frame rate processing apparatus provided by this disclosure, the alignment unit is further configured to:

[0170] When the reference frame rate is detected to enter the second drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the second drawing frame;

[0171] When the reference frame rate is detected to enter the third drawing frame, it is determined whether the current frame in the frame rate to be aligned is a drawing frame; wherein, the third drawing frame is located after the second drawing frame;

[0172] If it is determined that the current frame in the frame rate to be aligned is not a drawing frame, then it is determined whether the next frame in the frame rate to be aligned is a drawing frame.

[0173] If it is determined that the next frame in the frame rate to be aligned is a drawing frame, then the next frame in the frame rate to be aligned is swapped with the current frame to align with the third drawing frame in the reference frame rate.

[0174] According to one or more embodiments of this disclosure, in the animation frame rate processing apparatus provided by this disclosure, the alignment unit is further configured to:

[0175] When the reference frame rate is detected to enter the fourth drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the fourth drawing frame.

[0176] When it is determined that the current frame in the reference frame rate is not a drawing frame, and the current frame in the frame rate to be aligned is a drawing frame, it is determined whether the next frame in the reference frame rate and the frame rate to be aligned is a drawing frame.

[0177] If it is determined that the next frame in the reference frame rate is a drawing frame and the next frame in the frame rate to be aligned is not a drawing frame, then the current frame and the next frame in the frame rate to be aligned are swapped to align with the next frame in the reference frame rate.

[0178] According to one or more embodiments of this disclosure, the animation frame rate processing apparatus provided in this disclosure further includes:

[0179] The first judgment module is used to determine whether the animation rendering frame rate corresponding to the animation rendering exit signal is less than the current rendering frame rate when an animation rendering exit signal is received.

[0180] The second judgment module is used to determine whether the number of animations currently being drawn is greater than 1 if it is determined that the animation drawing frame rate corresponding to the animation rendering exit signal is not less than the current drawing frame rate.

[0181] The realignment module is used to trigger the realignment of the frame rate of the currently being drawn animation if it is determined that the number is greater than 1.

[0182] According to one or more embodiments of this disclosure, the animation frame rate processing apparatus provided in this disclosure further includes:

[0183] The third judgment module is used to determine whether the current rendering frame rate is lower than the full load frame rate;

[0184] Accordingly, the alignment module is specifically used to: when it is determined that the current drawing frame rate is lower than the full load frame rate, to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and to draw the animation being drawn and the animation corresponding to the animation rendering access signal.

[0185] According to one or more embodiments of this disclosure, this disclosure provides an apparatus including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements an animation frame rate processing method as described in any of the present disclosure.

[0186] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium storing a computer program for performing an animation frame rate processing method as described in any of the present disclosure.

[0187] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0188] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing animation frame rate, characterized in that, The method includes: When an animation rendering access signal is received, determine whether there is an animation currently being drawn; If it is determined that an animation is currently being drawn, then obtain the current drawing frame rate; By aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn. The alignment process includes: when the current drawing frame rate value is the same as the animation drawing frame rate value and the animation rendering access signal and the animation being drawn are not simultaneously in the drawing frame, the animation rendering access signal is delayed by one frame, and the drawing of the animation rendering access signal is started when the animation being drawn enters the drawing frame.

2. The method according to claim 1, characterized in that, The step of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and then drawing the animation being drawn and the animation corresponding to the animation rendering access signal, includes: Determine the number of frames between two adjacent rendering frames in the current rendering frame rate, and use it as the first interval frame number; In addition, the number of frames between two adjacent drawing frames in the animation drawing frame rate corresponding to the animation rendering access signal is determined as the second interval frame number; Based on the modulo results of the first interval frame number and the second interval frame number, the current drawing frame rate is aligned with the animation drawing frame rate corresponding to the animation rendering access signal; During the process of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

3. The method according to claim 2, characterized in that, The alignment process, which aligns the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal based on the modulo result of the first and second interval frame numbers, includes: If the modulo result of the first interval frame number and the second interval frame number is determined to be 0, then when the current drawing frame rate is detected to enter the first drawing frame, the first drawing frame of the animation drawing frame rate corresponding to the animation rendering access signal is aligned with the first drawing frame.

4. The method according to claim 2, characterized in that, The alignment process, which aligns the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal based on the modulo result of the first and second interval frame numbers, includes: If it is determined that the modulo result of the first interval frame number and the second interval frame number is not 0, then a reference frame rate and a frame rate to be aligned are determined from the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; wherein, the reference frame rate is the larger drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal, and the frame rate to be aligned is the smaller drawing frame rate between the current drawing frame rate and the animation drawing frame rate corresponding to the animation rendering access signal; Align the frame rate to be aligned with the reference frame rate.

5. The method according to claim 4, characterized in that, Aligning the frame rate to be aligned with the reference frame rate includes: When the reference frame rate is detected to enter the second drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the second drawing frame; When the reference frame rate is detected to enter the third drawing frame, it is determined whether the current frame in the frame rate to be aligned is a drawing frame; wherein, the third drawing frame is located after the second drawing frame; If it is determined that the current frame in the frame rate to be aligned is not a drawing frame, then it is determined whether the next frame in the frame rate to be aligned is a drawing frame. If it is determined that the next frame in the frame rate to be aligned is a drawing frame, then the next frame in the frame rate to be aligned is swapped with the current frame to align with the third drawing frame in the reference frame rate.

6. The method according to claim 4, characterized in that, Aligning the frame rate to be aligned with the reference frame rate includes: When the reference frame rate is detected to enter the fourth drawing frame, the first drawing frame in the frame rate to be aligned is aligned with the fourth drawing frame. When it is determined that the current frame in the reference frame rate is not a drawing frame, and the current frame in the frame rate to be aligned is a drawing frame, it is determined whether the next frame in the reference frame rate and the frame rate to be aligned is a drawing frame. If it is determined that the next frame in the reference frame rate is a drawing frame and the next frame in the frame rate to be aligned is not a drawing frame, then the current frame and the next frame in the frame rate to be aligned are swapped to align with the next frame in the reference frame rate.

7. The method according to claim 1, characterized in that, The method further includes: When an animation rendering exit signal is received, it is determined whether the animation drawing frame rate corresponding to the animation rendering exit signal is less than the current drawing frame rate. If it is determined that the animation rendering exit signal corresponds to an animation drawing frame rate that is not less than the current drawing frame rate, then it is determined whether the number of animations currently being drawn is greater than 1. If the number is determined to be greater than 1, then the frame rate of the currently being drawn animation is re-aligned.

8. The method according to claim 1, characterized in that, Before aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, the process further includes: Determine whether the current rendering frame rate is lower than the full load frame rate; Accordingly, the step of aligning the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and then drawing the animation being drawn and the animation corresponding to the animation rendering access signal, includes: When it is determined that the current drawing frame rate is lower than the full load frame rate, the current drawing frame rate is aligned with the animation drawing frame rate corresponding to the animation rendering access signal, and the animation being drawn and the animation corresponding to the animation rendering access signal are drawn.

9. An animation frame rate processing device, characterized in that, The device includes: The determination module is used to determine whether an animation is currently being drawn when an animation rendering access signal is received; The acquisition module is used to acquire the current drawing frame rate if it is determined that an animation is currently being drawn. The alignment module is used to align the current drawing frame rate with the animation drawing frame rate corresponding to the animation rendering access signal, and to draw the animation being drawn and the animation corresponding to the animation rendering access signal. The alignment process includes: when the current drawing frame rate value is the same as the animation drawing frame rate value and the animation rendering access signal and the animation being drawn are not simultaneously in the drawing frame, the animation rendering access signal is delayed by one frame, and the drawing of the animation rendering access signal is started when the animation being drawn enters the drawing frame.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when executed on a terminal device, cause the terminal device to implement the animation frame rate processing method as described in any one of claims 1-8.

11. A computer device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the animation frame rate processing method as described in any one of claims 1-8.

12. A computer program product, characterized in that, The computer program product includes a computer program / instruction that, when executed by a processor, implements the animation frame rate processing method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Image display method and device

    CN107786748A

  • Page animation rendering method and device

    CN108665520A