Animation processing method, device, computer readable storage medium and computer equipment

Through the method of sharing video memory space in animation files, the problem of large video memory space occupies when multiple animation files are displayed is solved, and the video memory space saving and animation processing efficiency are improved.

CN112150586BActive Publication Date: 2024-11-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910502884.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-11
Publication Date
2024-11-22
Estimated Expiration
2039-07-25

AI Technical Summary

Technical Problem

When displaying multiple animation files in the prior art, it is necessary to apply for video memory space independently for each animation file, resulting in a large footprint of video memory space. Especially when the number of animation files increases, video memory space usage increases rapidly, resulting in performance problems.

Method used

By allowing multiple animation files to share the same video memory space, the pixel data in the shared video memory space is updated according to the rendering data of the target animation file, and the overlay display of animation files is realized, avoiding the application of video memory space for each animation file separately.

Benefits of technology

Effectively save video memory space, especially when the playback screens of multiple animation files overlap or exceed the rendered screen range, greatly reduce video memory space usage, avoid crash problems, and improve animation processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112150586B_ABST
    Figure CN112150586B_ABST
Patent Text Reader

Abstract

The present application relates to an animation processing method, device, computer-readable storage medium and computer equipment, the method comprising: obtaining target rendering data corresponding to a target animation file; determining a to-be-drawn area belonging to the target animation file in a shared video memory space storing rendering data corresponding to an existing animation file; updating pixel data in the to-be-drawn area according to the target rendering data; displaying a rendering screen according to the pixel data stored in the shared video memory space, the rendering screen at least including a playback screen of the target animation file. The solution provided by the present application can greatly reduce the video memory space occupied when multiple animation files are superimposed, and improve rendering performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an animation processing method, device, computer-readable storage medium and computer equipment. Background Art

[0002] Animation refers to an animation effect added to video content or image content, which can be used to enrich the content of videos or images. For example, stickers added to video content during video editing are animations. Before displaying animations, the animation files need to be parsed and rendered.

[0003] At present, when multiple animations need to be displayed in one screen, it is usually necessary to apply for video memory space for each animation file independently, store the rendering data of each animation file separately, and then merge the rendering data of each animation file into a large video memory space. Obviously, when the number of animation files to be added increases, the size of the video memory space occupied will also increase, occupying a large amount of video memory space. Summary of the invention

[0004] Based on this, it is necessary to provide an animation processing method, apparatus, computer-readable storage medium and computer device to address the technical problem that in the existing rendering method, the size of the video memory space increases with the number of superimposed animation files, resulting in a large amount of video memory space being occupied.

[0005] An animation processing method, comprising:

[0006] Get the target rendering data corresponding to the target animation file;

[0007] In a shared video memory space storing rendering data corresponding to an existing animation file, determining a to-be-drawn area belonging to the target animation file;

[0008] According to the target rendering data, updating the pixel data in the to-be-drawn area;

[0009] A rendering picture is displayed according to the pixel data stored in the shared video memory space, and the rendering picture at least includes a playback picture of the target animation file.

[0010] An animation processing device, comprising:

[0011] An acquisition module is used to acquire target rendering data corresponding to a target animation file;

[0012] A determination module, used to determine the to-be-drawn area belonging to the target animation file in the shared video memory space storing the rendering data corresponding to the existing animation file;

[0013] An updating module, used for updating the pixel data in the to-be-drawn area according to the target rendering data;

[0014] The display module is used to display a rendering picture according to the pixel data stored in the shared video memory space, and the rendering picture at least includes a playback picture of the target animation file.

[0015] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the above animation processing method.

[0016] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above animation processing method.

[0017] The above-mentioned animation processing method, device, computer equipment and storage medium, when it is necessary to superimpose and display the playback screens of multiple animation files, by allowing multiple target animation files to share the same video memory space, that is, the shared video memory space, so that no matter how many animation files are added, the size of the video memory space occupied is only the size of the shared video memory space. The shared video memory space stores the rendering data corresponding to the existing animation files. When the target rendering data corresponding to the target animation file is obtained, the area to be drawn of the target animation file can be determined in the shared video memory space according to the target rendering data. It is only necessary to cover the pixel data in the area to be drawn with the target rendering data of the target animation file to achieve the update of the pixel data in the shared video memory space, and the rendering screen can be displayed according to the pixel data stored in the updated shared video memory space, and the rendering screen at least includes the playback screen of the target animation file. This method does not require a separate video memory space to be applied for each animation file to store its own rendering data, which can save video memory space, especially when the playback screens of multiple animation files overlap or exceed the range of the rendering screen, it can greatly save video memory space.

[0018] An animation processing method, comprising:

[0019] Get the file ID of the target animation file;

[0020] When there is cached binary data corresponding to the file identifier in the memory, directly obtaining the cached binary data in the memory;

[0021] When there is no cached binary data corresponding to the file identifier in the memory, the target animation file corresponding to the file identifier is obtained, the target animation file is parsed to obtain binary data, and the binary data is cached in the memory corresponding to the file identifier.

[0022] In one embodiment, the method further comprises:

[0023] Calculate rendering data corresponding to the target animation file according to the binary data;

[0024] Rendering is performed according to the rendering data and a rendering picture is displayed.

[0025] An animation processing device, comprising:

[0026] A file identification acquisition module, used to acquire the file identification of a target animation file;

[0027] A cache data acquisition module, used for directly acquiring the binary data cached in the memory when there is cached binary data corresponding to the file identifier in the memory;

[0028] The parsing module is used to obtain the target animation file corresponding to the file identifier when there is no cached binary data corresponding to the file identifier in the memory, parse the target animation file to obtain binary data, and cache the binary data corresponding to the file identifier in the memory.

[0029] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the above animation processing method.

[0030] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above animation processing method.

[0031] The above-mentioned animation processing method, device, computer-readable storage medium and computer equipment can, after obtaining the file identifier of the target animation file, search from the memory cache based on the file identifier whether there is corresponding binary data. If so, the binary data cached in the memory can be directly obtained. If not, the target animation file is obtained according to the file identifier, and after parsing the target animation file to obtain binary data, the file identifier and the binary data are cached in the memory accordingly. In this way, the binary data of the target animation file that has been loaded into the memory is cached. When the same file identifier is obtained again, the corresponding binary data can be directly obtained from the cache based on the file identifier, without repeatedly decoding the target animation file, which can improve the loading efficiency of the target animation file, and can also avoid the memory occupation problem caused by repeatedly loading the same target animation file into the memory, thereby reducing memory occupation. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 A diagram of an application environment of an animation processing method in an embodiment;

[0033] Figure 2 is a flowchart of an animation processing method in one embodiment;

[0034] Figure 3 A schematic diagram of a process for obtaining target rendering data corresponding to a target animation file in one embodiment;

[0035] Figure 4 A schematic diagram of a process for obtaining binary data corresponding to a target animation file in one embodiment;

[0036] Figure 5 A schematic diagram of a method for superimposing and displaying multiple animation files;

[0037] Figure 6 A schematic diagram of updating pixel data in a shared video memory space in one embodiment;

[0038] Figure 7 A schematic diagram of superimposing and displaying multiple animation files in one embodiment;

[0039] Figure 8 is a flowchart of an animation processing method in a specific embodiment;

[0040] Fig. 9 is a flowchart of an animation processing method in another embodiment;

[0041] Fig.10 This is a schematic diagram of the memory occupied when obtaining the same animation file;

[0042] Fig.11 A schematic diagram of memory occupied when the same animation file is obtained in one embodiment;

[0043] Fig.12 is a structural block diagram of an animation processing device in an embodiment;

[0044] Fig.13 is a structural block diagram of an animation processing device in another embodiment;

[0045] Fig.14 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0047] Figure 1 FIG. 1 is an application environment diagram of an animation processing method in an embodiment. Figure 1, the animation processing method is applied to an animation processing system. The animation processing system includes a terminal 110 and a server 120. The terminal 110 and the server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server 120 can be implemented with an independent server or a server cluster composed of multiple servers. The terminal 110 can obtain the target rendering data corresponding to the target animation file; in the shared video memory space storing the rendering data corresponding to the existing animation file, determine the area to be drawn belonging to the target animation file; according to the target rendering data, update the pixel data in the area to be drawn; display the rendering picture according to the pixel data stored in the shared video memory space, and the rendering picture at least includes the playback picture of the target animation file. In some embodiments, the terminal 110 can obtain the target animation file stored on the server 120, and load and parse the target animation file to obtain the target rendering data corresponding to the target animation file.

[0048] It should be noted that the above application environment is only an example. In some embodiments, a client for playing videos may be installed on the terminal 110. The client integrates an animation playing SDK (Software Development Kit). The animation playing SDK can be used to implement the above animation processing method.

[0049] like Figure 2 As shown, in one embodiment, an animation processing method is provided. This embodiment mainly applies the method to the above Figure 1 The terminal 110 in FIG. Figure 2 , the animation processing method specifically includes the following steps:

[0050] S202: Obtain target rendering data corresponding to the target animation file.

[0051] Among them, the rendering data is the pixel data used to display the rendering picture. The rendering data includes the pixel value of each pixel in the rendering picture. For example, for a certain pixel, its pixel value is 0X3826. The terminal can parse the pixel value and convert it into the intensity of each color component of RGB to stimulate the display to display the corresponding color. The target rendering data is the rendering data corresponding to the target animation file, and the target rendering data includes the rendering data corresponding to each animation frame of the target animation file. For example, the playback time of the target animation file is 2 seconds and the frame rate is 30. The target rendering data of the target animation file includes the rendering data corresponding to 60 animation frames, wherein the rendering data of each animation frame includes the pixel values ​​of each pixel corresponding to the frame. In the actual process of playing the target animation file, the rendering data of each animation frame is calculated frame by frame according to the binary data corresponding to the target animation file.

[0052] Animation files are files in target formats, such as PAG (Portable Animated Graphics, a portable animation graphics format) files. PAG files are files obtained by exporting the animation attribute data of animation engineering files in PAG format, and animation engineering files are files (such as .aep files) designed by AE (Adobe After Effect, an image and video processing software). In some embodiments, the animation attribute data in the animation engineering file can be read by an animation export plug-in (such as PAGExporter), and the animation file can be exported in PAG format. The methods of exporting animation files in PAG format include vector export methods and sequence frame export methods, wherein the sequence frame export methods include bitmap sequence frame export methods and video sequence frame export methods.

[0053] In some embodiments, when multiple animation files need to be displayed in sequence, the animation file displayed previously is an existing animation file, and the animation file superimposed on the existing animation file is the target animation file, which can be used as the current animation file to be processed.

[0054] The animation playback process includes decoding, rendering and displaying on the screen. Decoding includes physical file decoding and data parsing. Physical file decoding refers to the process of decoding the original animation file to obtain a binary sequence and loading the binary sequence into the memory in the form of an animation object. The animation object contains all the animation attribute data of the animation file; data parsing refers to the process of reading the animation object from the memory and obtaining the description data of the current animation frame according to the animation object when a certain animation frame needs to be played. Rendering refers to the process of calculating the rendering data of the animation frame according to the description data corresponding to the animation frame. Displaying on the screen refers to the process of transmitting the rendering data of the animation frame to the display to stimulate the display to display the animation frame.

[0055] Specifically, after acquiring the target animation file, the terminal may decode and render the target animation file in sequence to obtain rendering data corresponding to each animation frame, thereby obtaining target rendering data corresponding to the entire target animation file.

[0056] In some embodiments, when editing video content, the sticker added to the video may be an animation file, and thus the target animation file obtained here may be the obtained target sticker.

[0057] like Figure 3 As shown, in one embodiment, the step of obtaining target rendering data corresponding to the target animation file includes:

[0058] S302, obtaining binary data corresponding to the target animation file.

[0059] S304: Calculate description data corresponding to the target animation file according to the binary data.

[0060] The binary data is a binary sequence of animation attribute data of the target animation file, and the description data is data used to describe the animation file, such as layer information, shape, color information, width and height information of the animation file.

[0061] S306, converting the description data into target rendering data corresponding to the target animation file for drawing.

[0062] Specifically, the terminal can decode the target animation file to obtain the corresponding binary sequence, and convert the binary sequence into an animation object and load it into the memory. When the playback screen of the target animation file needs to be displayed, the terminal can sequentially execute the data structure organization method of the animation file in accordance with the playback order of each animation frame, parse the binary sequence corresponding to the target animation file stored in the memory, obtain the description data corresponding to the current animation frame in the target animation file, convert the description data corresponding to the current animation frame into rendering data for drawing the current animation frame, and display the current animation frame according to the rendering data until the last frame is displayed, and the entire target animation file is played. From this process, it can be seen that the terminal can parse the description data of each animation frame from the binary data according to the playback order of each animation frame, and then calculate the rendering data of each animation frame, which is the target rendering data corresponding to the entire target animation file.

[0063] like Figure 4 As shown, in one embodiment, the step of obtaining binary data corresponding to the target animation file includes:

[0064] S402: Obtain the file identifier of the target animation file.

[0065] Specifically, the terminal may receive a file identifier of a target animation file, where the file identifier may be a file path of the animation file, where the file path may be a resource identifier corresponding to the animation file, etc. The file identifier may also be file summary information generated according to the file content of the animation file.

[0066] In one embodiment, the step of obtaining the file identifier of the target animation file includes: obtaining the file path of the target animation file; and performing encryption operation on the file path to obtain the file identifier of the target animation file.

[0067] Specifically, the file path of the animation file can be used to represent the file content of the animation file, which is more efficient than directly generating a file identifier based on the file content. After receiving the file path of the target animation file, the terminal can perform an encryption operation on the file path to obtain the file identifier corresponding to the target animation file. For example, the file path is used as the file content of the animation file, and it is encrypted to generate the MD5 (Message Digest Algorithm 5) of the target animation file as the file identifier.

[0068] S404: When there is cached binary data corresponding to the file identifier in the memory, directly obtain the cached binary data in the memory.

[0069] In one embodiment, the terminal can also cache the decoded binary sequence and the corresponding file path into the memory. Therefore, before obtaining the target animation file, the terminal can also check whether there is a cached binary sequence corresponding to the file identifier of the obtained target animation file. If so, the binary sequence cached in the memory is directly obtained without repeatedly reading the target animation file and decoding it, which can reduce decoding time and save memory usage.

[0070] In one embodiment, the animation processing method further includes:

[0071] When there is no cached binary data corresponding to the file identifier in the memory, the target animation file corresponding to the file identifier is obtained; the target animation file is parsed to obtain the binary data; and the binary data and the file identifier are cached in the memory in correspondence.

[0072] Specifically, when the terminal does not find the corresponding binary data in the memory according to the received file identifier, the terminal needs to obtain the target animation file according to the received file identifier, parse the target animation file to obtain the corresponding binary data, and then cache the file identifier and the binary data obtained by the parsing in the memory. So that when the same animation file is obtained next time, the binary sequence cached in the memory can be directly obtained, eliminating the process of parsing the target animation file and improving rendering efficiency.

[0073] In one embodiment, when the terminal receives a file path, the terminal may generate a file identifier according to the file path, and then search the memory for binary data corresponding to the file identifier according to the file identifier.

[0074] In one embodiment, the animation processing method further includes: when a file identifier of a newly added animation file that is the same as the target animation file is obtained, directly obtaining binary data corresponding to the file identifier cached in the memory.

[0075] Specifically, the purpose of caching the binary data of the target animation file and the file identifier in the memory is to directly obtain the binary sequence cached in the memory according to the file identifier when the file identifier of a new animation file that is the same as the target animation file is obtained next time, thereby eliminating the process of parsing the target animation file, improving rendering efficiency, and saving memory.

[0076] In one embodiment, the terminal can also cache description data corresponding to an existing animation file, so that when the superimposed target animation file is the same as the existing animation file, the rendering data of each animation frame included in the target animation file can be directly calculated based on the cached description data, thereby obtaining the target rendering data corresponding to the entire target animation file.

[0077] In one embodiment, the target animation file is different from the existing animation file, and the method further includes: caching description data corresponding to the target animation file; when a new animation file identical to the target animation file is obtained, calculating rendering data corresponding to the new animation file based on the cached description data.

[0078] Specifically, when the superimposed target animation file is an animation file that is different from the existing animation file, the target animation file is decoded to obtain a corresponding binary sequence, the binary sequence is converted into an animation object and loaded into the memory, and the binary sequence corresponding to the target animation file stored in the memory is parsed in sequence according to the playback order of each animation frame and the data structure organization of the animation file. After obtaining the description data corresponding to the current animation frame in the target animation file, the terminal can not only cache the binary sequence, but also cache the description data corresponding to each animation frame included in the target animation file, so that when the newly superimposed animation file is the same as the current target animation file, that is, the newly added target animation file is the same as the existing animation file, the cached description data corresponding to the existing animation file is directly obtained, and the rendering data corresponding to the newly added animation file is calculated based on the description data.

[0079] It should be noted that "existing animation file" and "target animation file" are relatively changing concepts. After the playback screen of the target animation file is displayed, the target animation file also becomes an "existing animation file", and the newly added animation file becomes the new "target animation file".

[0080] S204: Determine a to-be-drawn area belonging to the target animation file in a shared video memory space storing rendering data corresponding to an existing animation file.

[0081] An existing animation file refers to an animation file whose corresponding rendering data has been stored in the shared video memory space. In some embodiments, an existing animation file may also be a file that has displayed a corresponding animation screen through a display according to pixel data stored in the shared existing memory space. If it is necessary to display the animation screens corresponding to multiple animation files in a superimposed manner through a display, then after obtaining the target animation file, it is necessary to display the animation screen corresponding to the target animation file in a superimposed manner on the existing animation screen according to the target rendering data corresponding to the target animation file. There may be multiple existing animation files, and the animation screens corresponding to multiple existing animation files may be displayed partially or completely overlapping.

[0082] The video memory space is used to store the rendering data corresponding to the animation file, that is, the pixel data of each pixel point to be transmitted to the display. In the embodiment provided in the present application, multiple animation files share the same video memory space. The same storage space is called a shared video memory space, which is used to store the rendering data after the rendering data corresponding to multiple animation files are superimposed. The display will display a rendering picture in which the animation pictures corresponding to multiple animation files are superimposed together according to the current pixel data in the shared video memory space. The size of the shared video memory space can be created according to actual needs. For example, when it is necessary to add multiple animation files to the video content to be edited, a shared video memory space can be created according to the size of the video picture; when it is necessary to add multiple animation files to the video to be recorded, a shared video memory space can be created according to the size of the recording picture.

[0083] like Figure 5 As shown in FIG. 1 , it is a schematic diagram of a method of superimposing and displaying multiple animation files. This method has the problem of occupying a large amount of video memory space. Figure 5When it is necessary to display the animation pictures corresponding to multiple animation files in a superimposed manner, it is necessary to create a corresponding video memory space for each animation file. When it is necessary to display the playback pictures corresponding to animation file 1, animation file 2, and animation file 3 in sequence in a superimposed manner, it generally includes three processing flows: first, it is necessary to calculate the rendering data corresponding to animation file 1, and store the rendering data corresponding to animation file 1 in the corresponding video memory space 1, then calculate the rendering data corresponding to animation file 2, and store the rendering data corresponding to animation file 2 in the corresponding video memory space, then calculate the rendering data corresponding to animation file 3, and store the rendering data corresponding to animation file 3 in the corresponding video memory space; secondly, merge the rendering data corresponding to each animation file stored in video memory space 1, video memory space 2, and video memory space 3 and store them in another main video memory space Surface; finally, after the pixel data stored in the main video memory space Surface is transmitted to the display, the display displays the rendering picture superimposed with multiple animation files. It can be seen that in the above method, the more animation files are superimposed and displayed, the larger the video memory space is required. Compared with the above method, the embodiment of the present application adopts a method of multiple animation files sharing video memory space, which can save video memory space to a certain extent, especially in the scenario of superimposing and displaying animated pictures of a large number of animation files, or when there are many overlapping parts of the animation pictures corresponding to the animation files, only the shared new video memory space is occupied, which can save a lot of video memory space and avoid the problem of flash back caused by excessive video memory space occupied when displaying overlapping pictures.

[0084] The target animation file's to-be-drawn area refers to a storage area in the shared video memory space used to store rendering data corresponding to the target animation file. Before displaying the animation screen corresponding to the target animation file, the rendering data corresponding to the existing animation file is stored in the to-be-drawn area.

[0085] The terminal can find the area to be drawn of the target animation file from the shared video memory space according to the target rendering data of the target animation file. Since the content of each animation frame is different, each animation frame corresponds to a different area to be drawn in the shared video memory space. Specifically, the target rendering data includes rendering data corresponding to each animation frame. The terminal can determine the pixel points corresponding to each animation frame according to the rendering data corresponding to each animation frame, and find the area for storing the pixel values ​​of these pixel points from the shared video memory space. The area for storing the pixel values ​​of each pixel point constitutes the area to be drawn corresponding to this animation frame. In this way, the terminal can determine the area to be drawn belonging to each animation frame in the shared video memory space in turn, thereby determining the area to be drawn of the entire target animation file.

[0086] For example, according to the target rendering data of the target animation file, the rendering data of the first frame includes the pixel value of pixel point A and the pixel value of pixel point B. Then the area to be drawn of the first frame includes at least the area in the shared video memory space for storing the pixel values ​​of pixel point A and pixel point B.

[0087] In one embodiment, the animation processing method further includes: obtaining the size of the target screen to be superimposed with the playback screen of the target animation file; and creating a video memory space matching the size as a shared video memory space of the target screen.

[0088] Specifically, when the terminal wants to overlay the playback screen of the target animation file on the target screen that has already displayed the animation screen of the existing animation file, it is necessary to create a video memory space that matches the size of the target screen as a shared video memory space for multiple animation files. For example, the target screen is a 10*10 rectangle, corresponding to a 10*10 video memory space, with a total of 10*10=100 pixels. If each pixel occupies 2 bytes, then the video memory space required for the target screen is 10*10*2=200 bytes. If each pixel occupies 4 bytes, then the video memory space required for the target screen is 10*10*4=400 bytes.

[0089] S206: Update pixel data in the area to be drawn according to the target rendering data.

[0090] Specifically, the terminal can find the rendering data corresponding to each animation frame of the target animation file from the target rendering data, the rendering data including the pixel values ​​of the pixel points corresponding to each animation frame. When drawing the current animation frame, according to the rendering data of the current animation frame, the area to be drawn corresponding to the pixel points corresponding to the animation frame is found from the shared video memory space, and the pixel values ​​of the pixel points corresponding to the animation frame are used to overwrite the existing pixel data in the corresponding area to be drawn.

[0091] For example: the existing animation file is M, and the target animation file is N. When the existing animation file M is displayed to the 5th frame, that is, the rendering data of the 5th frame of the existing animation file M is currently stored in the shared video memory space, including the pixel value 0X3826 of pixel point A. If the target animation file N needs to be superimposed at this time, the rendering data of the 1st frame of the target animation file is obtained from the target rendering data of the target animation file N, that is, the pixels corresponding to the 1st frame and the pixel values ​​corresponding to each pixel point. If the rendering data of the 1st frame also includes pixel point A, and its pixel value is OX3278, then the pixel value of pixel point A needs to be updated with OX3278, and the updated pixel value is stored in the area for storing the pixel value of pixel point A in the shared video memory space.

[0092] After displaying the rendered image based on the updated pixel data in the shared video memory space, when you want to continue displaying the next superimposed image, you need to obtain the rendering data of the 6th frame of the existing animation file M and the rendering data of the 2nd frame of the target animation file N; then find the same pixel point B corresponding to these two animation frames, and update the existing pixel data in the area in the shared video memory space used to store the pixel value of pixel point B according to the pixel value of pixel point B in the 2nd frame of the target animation file N. For the different pixel points corresponding to the two animation frames, for example, the rendering data of the existing animation file M includes the pixel value of pixel point C1, and the target animation file N includes the pixel value of pixel point C2, it is necessary to find the areas for storing the pixel values ​​of pixel points C1 and C2 respectively in the shared video memory space, and use the pixel value of pixel point C1 in the rendering data of the 6th frame of the existing animation file M to overwrite the pixel data stored in the corresponding area, and use the pixel value of pixel point C2 in the rendering data of the 2nd frame of the target animation file N to overwrite the pixel data stored in the corresponding area, and so on. The terminal can continuously update the pixel data stored in the shared video memory space according to the target rendering data of the target animation file and the rendering data of the existing animation file.

[0093] In some embodiments, when there is no need to loop play of the rendered image obtained by superimposing the animation image of an existing animation file with the animation image of a target animation file, and after the superimposed rendered image is displayed based on the rendering data of the last frame of the existing animation file, if there is still rendering data corresponding to unprocessed animation frames in the target animation file, the terminal can directly update the pixel data in the shared video memory space based on the rendering data corresponding to the unprocessed animation frames in the target animation file.

[0094] For example, if the frame rate of the animation files is 30, the animation duration of the existing animation file M is 2 seconds, including 60 animation frames, and the animation duration of the target animation file N is 4 seconds, including 120 animation frames. Assume that in a certain scene, when the existing animation file M is played to the 1st second, the target animation file N is superimposed, that is, at this time, the rendering data M29 of the 29th frame of the existing animation file M is stored in the shared video memory space. The terminal needs to obtain the rendering data M30 of the 30th frame of the existing animation file M and the rendering data N1 of the 1st frame of the target animation file N respectively, and store the rendering data after overlaying N1 and M30 into the shared video memory space to overwrite the existing rendering data N29 in the shared video memory space. After the second second, there is no corresponding rendering data for the existing animation file M, and there are still unprocessed animation frames (frames 61 to 120) in the target animation file. The terminal only needs to directly obtain the rendering data corresponding to the animation frames after the 60th frame of the target animation file N, update the pixel data stored in the shared video memory space frame by frame, and display the rendering screen corresponding to the playback screen of only the animation frames of the target animation file N in sequence until the target animation file N is completely displayed.

[0095] In one embodiment, when there is no need to loop play of the rendered picture obtained by superimposing the animation picture of an existing animation file with the animation picture of a target animation file, and after the superimposed rendered picture is displayed according to the rendering data of the last frame of the target animation file, there are still animation frames in the existing animation file that have not been rendered and displayed, the terminal can also re-acquire the rendering data corresponding to the target animation file, superimpose the re-acquired rendering data with the rendering data corresponding to the animation frames of the existing animation file that have not been rendered and displayed, and display the superimposed picture until the rendering and display of all the animation frames included in the existing animation file are completed.

[0096] For example: the frame rate of the animation files is 30, the animation duration of the existing animation file M is 4 seconds, including 120 animation frames, and the animation duration of the target animation file N is 2 seconds, including 60 animation frames. Assuming that the superposition starts from the first frame of each, after the second second, the existing animation file still has rendering data corresponding to the unprocessed animation frame, but the target animation file N no longer has the corresponding rendering data. In this case, the terminal can re-acquire the rendering data of the first frame of the target animation file N, superimpose the rendering data of the first frame with the rendering data of the 61st frame of the existing animation file to obtain the rendering data corresponding to the superimposed screen of the 61st frame, and store the rendering data in the shared video memory space for display. And so on, until the existing animation file no longer has rendering data corresponding to the unprocessed animation frame after the fourth second, the processing flow ends.

[0097] In one embodiment, when there is no need to loop play of the rendered picture obtained by superimposing the animation picture of an existing animation file with the animation picture of a target animation file, and after the superimposed rendered picture is displayed according to the rendering data of the last frame of the existing animation file, if there are still animation frames in the target animation file that have not been rendered and displayed, the terminal can re-acquire the rendering data corresponding to the existing animation file, superimpose the rendering data with the rendering data corresponding to the animation frames of the target animation file that have not been rendered and displayed, and display the superimposed picture until all the animation frames included in the target animation file are rendered and displayed.

[0098] For example: the frame rate of the animation files is 30, the animation duration of the existing animation file M is 2 seconds, including 60 animation frames, and the animation duration of the target animation file N is 4 seconds, including 120 animation frames. Assuming that the superposition starts from the first frame of each, after the second second, there are still undisplayed animation frames in the target animation file, but the existing animation file N has been displayed, then the rendering data of the first frame of the existing animation file N can be re-acquired, and the rendering data of the first frame can be superimposed with the rendering data of the 61st frame of the target animation file to obtain the rendering data corresponding to the superimposed screen of the 61st frame, and the rendering data is stored in the shared video memory space for display. And so on, until there are no undisplayed animation frames in the target animation file after the fourth second, the processing flow ends.

[0099] like Figure 6 FIG. 1 is a schematic diagram of updating pixel data in a shared video memory space in one embodiment. Figure 6 , the left side is a schematic diagram of the pixel data of the 5th frame of an existing animation file stored in the shared video memory space, the middle side is a schematic diagram of the rendering data of the 1st frame of the target animation file, and the right side is a schematic diagram of the updated pixel data obtained after the pixel data in the shared video memory space is updated according to the rendering data of the 1st frame of the target animation file.

[0100] like Figure 7 FIG. 1 is a schematic diagram of an embodiment of superimposing and displaying multiple animation files. Figure 5 When the playback pictures corresponding to animation file 1, animation file 2 and animation file 3 need to be superimposed in sequence and displayed, only two processing flows are required: first, the rendering data corresponding to animation file 1 is calculated, and then the rendering data corresponding to animation file 1 is stored in the shared video memory space. When the playback picture of animation file 2 needs to be superimposed, the rendering data corresponding to animation file 2 is calculated, and the area to be drawn in the shared video memory space for storing the rendering data corresponding to animation file 2 is determined, and the existing pixel data stored in the area to be drawn is overwritten with the rendering data of animation file 2. When the playback picture of animation file 3 needs to be superimposed, the rendering data corresponding to animation file 3 is calculated, and the area to be drawn in the shared video memory space for storing the rendering data corresponding to animation file 3 is determined, and the existing pixel data stored in the area to be drawn is overwritten with the rendering data of animation file 3, so as to realize the superimposed display of the playback pictures corresponding to the three animation files. Obviously, no matter how many animation files need to be superimposed, the size of the video memory space occupied will not exceed the size of the shared video memory space, which can save a lot of video memory space.

[0101] S208, displaying a rendering picture according to the pixel data stored in the shared video memory space, where the rendering picture at least includes a playback picture of the target animation file.

[0102] The pixel data stored in the shared video memory space will be transmitted to the display, stimulating the display to display the corresponding rendering screen according to the pixel data. Since the target animation file is superimposed on the existing animation file, the rendering screen displayed by the display at least includes the playback screen of the target animation file.

[0103] In one embodiment, the method further includes: caching pixel data in the shared video memory space after the update; and repeatedly displaying a rendering screen including at least a playback screen of the target animation file according to the cached pixel data.

[0104] Specifically, after each update of the pixel data in the shared video memory space, what is stored in the shared video memory space is the pixel data after the rendering data corresponding to the two animation frames are superimposed, that is, the rendering data corresponding to the superimposed picture. The terminal can cache the rendering data corresponding to each superimposed picture, so that when the superimposed picture needs to be played repeatedly in a loop, the cached rendering data can be directly obtained for display. When it is necessary to loop-play the rendering picture obtained by superimposing the animation picture of an existing animation file with the animation picture of a target animation file, then after overlaying and superimposing the rendering data corresponding to the animation frame of each existing animation file with the rendering data corresponding to the animation frame of the target animation file to obtain the rendering data of each superimposed picture, the rendering data corresponding to each superimposed picture is cached, so that the superimposed picture can be displayed directly according to the cached rendering data in the next cycle.

[0105] For example, if the frame rate of the animation files is 30, the animation duration of the existing animation file M is 2 seconds, including 60 animation frames, and the animation duration of the target animation file N is 4 seconds, including 120 animation frames. Assuming that the loop playback duration is 4 seconds, that is, the loop playback is performed every 4 seconds, and the animation screen of the target animation file N is superimposed on the animation screen of the existing animation file M starting from the first frame of each, the processing flow is:

[0106] Obtain rendering data N1 corresponding to the first frame of the target animation file N, and obtain rendering data M1 of the first frame of the existing animation file; overlay rendering data M1 with rendering data N1 to obtain rendering data S1 corresponding to the overlay screen; cache rendering data S1, and update existing pixel data stored in the shared video memory space according to S1; then, obtain rendering data N2 corresponding to the second frame of the target animation file N, and obtain rendering data M2 of the second frame of the existing animation file; overlay rendering data M2 with rendering data N2 to obtain rendering data S2 corresponding to the overlay screen; cache rendering data S2, and update existing pixel data stored in the shared video memory space according to S2. Since the rendering data of the existing animation file M has been obtained after the second second, the rendering data corresponding to the overlay screen after the second second is the rendering data of the target animation file, that is, S61 is N61, S62 is N62, ..., S120 is N120. When loop playback is required after the 4th second, the cached rendering data S1, S2, S3, ..., S120 are directly obtained to display the superimposed picture after the existing animation file and the target animation file are superimposed.

[0107] In one embodiment, a rendering screen is displayed based on pixel data stored in a shared video memory space, including: when the pixel data stored in the shared video memory space after an update does not include rendering data of an existing animation file, a rendering screen in which the playback screen of the target animation file completely covers the playback screen of the existing animation file is displayed based on the pixel data stored in the shared video memory space.

[0108] Specifically, when the pixel data stored in the updated shared video memory space does not include the rendering data of the existing animation file, it means that the rendering data of the existing animation file stored in the shared video memory space is completely overwritten by the target rendering data of the target animation file. The displayed rendering screen does not include the playback screen of the existing animation file, but the playback screen of the target animation file completely covers the playback screen of the existing animation file.

[0109] Of course, if the playback screen of the target animation file has transparency, the pixel data stored in the shared video memory space is new rendering data obtained by superimposing the target rendering data corresponding to the target animation file and the rendering data of the existing animation file. The displayed rendering screen includes the playback screen of the existing animation file with transparent attributes.

[0110] In one embodiment, a rendering screen is displayed based on pixel data stored in a shared video memory space, including: when the pixel data stored in the shared video memory space after an update includes partial rendering data of an existing animation file, a rendering screen in which a playback screen of the target animation file partially covers the playback screen of the existing animation file is displayed based on the pixel data stored in the shared video memory space.

[0111] Specifically, when the pixel data stored in the updated shared video memory space includes partial rendering data of an existing animation file, it means that the rendering data of the existing animation file stored in the shared video memory space is partially overwritten by the target rendering data of the target animation file. The displayed rendering screen only includes partial playback screen of the existing animation file, that is, the playback screen of the target animation file partially covers the playback screen of the existing animation file.

[0112] In one embodiment, a rendering screen is displayed based on pixel data stored in a shared video memory space, including: when the pixel data stored in the shared video memory space after an update includes all rendering data of an existing animation file, a rendering screen including a playback screen of a target animation file and a playback screen of an existing animation file is displayed based on the pixel data stored in the shared video memory space.

[0113] Specifically, when the pixel data stored in the updated shared video memory space includes all the rendering data of the existing animation file, it means that the rendering data of the existing animation file stored in the shared video memory space is not completely overwritten by the target rendering data of the target animation file. The displayed rendering screen includes all the playback screens of the existing animation file and all the playback screens of the target animation file.

[0114] In a specific application scenario, the terminal can obtain an animation file selected by a user and add the obtained animation file to the video content. The file added to the video content is an existing animation file. When the terminal obtains the animation file selected by the user again, the animation file is the target animation file. The terminal can obtain the binary data corresponding to the target animation file, calculate the corresponding target rendering data based on the binary data, and display the rendering picture superimposed on the animation picture of the existing animation file based on the target rendering data.

[0115] The above animation processing method, when it is necessary to superimpose and display the playback screens of multiple animation files, allows multiple target animation files to share the same video memory space, that is, the shared video memory space, so that no matter how many animation files are added, the size of the video memory space occupied is only the size of the shared video memory space. The shared video memory space stores the rendering data corresponding to the existing animation files. When the target rendering data corresponding to the target animation file is obtained, the area to be drawn of the target animation file can be determined in the shared video memory space according to the target rendering data. It is only necessary to cover the pixel data in the area to be drawn with the target rendering data of the target animation file to achieve the update of the pixel data in the shared video memory space, and the rendering screen can be displayed according to the pixel data stored in the updated shared video memory space, and the rendering screen at least includes the playback screen of the target animation file. This method does not require a separate video memory space to be applied for each animation file to store its own rendering data, which can save video memory space, especially when the playback screens of multiple animation files overlap or exceed the range of the rendering screen, which can greatly save video memory space.

[0116] like Figure 8 As shown, in a specific embodiment, the animation processing method specifically includes the following steps:

[0117] S802, obtaining the file path of the target animation file.

[0118] S804, performing encryption operation on the file path to obtain a file identifier of the target animation file.

[0119] S806: When there is cached binary data corresponding to the file identifier in the memory, directly obtain the cached binary data in the memory.

[0120] S808, when there is no cached binary data corresponding to the file identifier in the memory, obtain the target animation file corresponding to the file identifier; parse the target animation file to obtain binary data; cache the binary data and the file identifier in the memory; when the file identifier of a newly added animation file that is the same as the target animation file is obtained, directly obtain the binary data corresponding to the file identifier cached in the memory.

[0121] S810, calculating description data corresponding to the target animation file according to the binary data.

[0122] S812, cache description data corresponding to the target animation file; when a new animation file identical to the target animation file is obtained, calculate rendering data corresponding to the new animation file according to the cached description data.

[0123] S814, converting the description data into target rendering data corresponding to the target animation file for drawing.

[0124] S816: Determine the area to be drawn that belongs to the target animation file in the shared video memory space storing the rendering data corresponding to the existing animation file.

[0125] S818: Update pixel data in the area to be drawn according to the target rendering data.

[0126] S820, cache the pixel data in the shared video memory space after the update.

[0127] S822, when the pixel data stored in the updated shared video memory space does not include the rendering data of the existing animation file, displaying the rendering picture of the target animation file completely covering the playback picture of the existing animation file according to the pixel data stored in the shared video memory space.

[0128] S824, when the pixel data stored in the shared video memory space after the update includes part of the rendering data of the existing animation file, the rendering picture of the target animation file partially covering the playback picture of the existing animation file is displayed according to the pixel data stored in the shared video memory space.

[0129] S826, when the pixel data stored in the shared video memory space after the update includes all the rendering data of the existing animation file, a rendering picture including the playback picture of the target animation file and the playback picture of the existing animation file is displayed according to the pixel data stored in the shared video memory space.

[0130] S828: Repeatedly displaying a rendering screen including at least a playback screen of the target animation file according to the cached pixel data.

[0131] The above animation processing method, when it is necessary to superimpose and display the playback screens of multiple animation files, allows multiple target animation files to share the same video memory space, that is, the shared video memory space, so that no matter how many animation files are added, the size of the video memory space occupied is only the size of the shared video memory space. The shared video memory space stores the rendering data corresponding to the existing animation files. When the target rendering data corresponding to the target animation file is obtained, the area to be drawn of the target animation file can be determined in the shared video memory space according to the target rendering data. It is only necessary to cover the pixel data in the area to be drawn with the target rendering data of the target animation file to achieve the update of the pixel data in the shared video memory space, and the rendering screen can be displayed according to the pixel data stored in the updated shared video memory space, and the rendering screen at least includes the playback screen of the target animation file. This method does not require a separate video memory space to be applied for each animation file to store its own rendering data, which can save video memory space, especially when the playback screens of multiple animation files overlap or exceed the range of the rendering screen, which can greatly save video memory space.

[0132] Figure 8FIG. 1 is a flow chart of an animation processing method in one embodiment. It should be understood that although Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 8 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0133] like Fig. 9 As shown, in one embodiment, an animation processing method is provided. This embodiment mainly applies the method to the above Figure 1 The terminal 110 in FIG. Fig. 9 , the animation processing method specifically includes the following steps:

[0134] S902: Obtain the file identifier of the target animation file.

[0135] The file identifier is used to uniquely identify an animation file, and the same animation files have the same file identifier. The terminal can receive the file identifier of the target animation file, and the file identifier can be the file path of the animation file, and the file path can be, for example, a resource identifier corresponding to the animation file. The file identifier can also be file summary information generated according to the file content of the animation file.

[0136] In one embodiment, the step of obtaining the file identifier of the target animation file includes: obtaining the file path of the target animation file; and performing encryption operation on the file path to obtain the file identifier of the target animation file.

[0137] Specifically, the file path of the animation file can be used to represent the file content of the animation file, which is more efficient than directly generating a file identifier based on the file content. After receiving the file path of the target animation file, the terminal can perform an encryption operation on the file path to obtain the file identifier corresponding to the target animation file. For example, the file path is used as the file content of the animation file, and it is encrypted to generate the MD5 (Message Digest Algorithm 5) of the target animation file as the file identifier.

[0138] S904: When there is cached binary data corresponding to the file identifier in the memory, directly obtain the cached binary data in the memory.

[0139] In one embodiment, the terminal can also cache the decoded binary sequence and the corresponding file path into the memory. Therefore, before obtaining the target animation file, the terminal can also check whether there is a cached binary sequence corresponding to the file identifier of the obtained target animation file. If so, the binary sequence cached in the memory is directly obtained without repeatedly reading the target animation file and decoding it, which can reduce decoding time and save memory usage.

[0140] S906, when there is no cached binary data corresponding to the file identifier in the memory, the target animation file corresponding to the file identifier is obtained, the target animation file is parsed to obtain binary data, and the binary data is cached in the memory corresponding to the file identifier.

[0141] Specifically, when the terminal does not find the corresponding binary data in the memory according to the received file identifier, the terminal needs to obtain the target animation file according to the received file identifier, parse the target animation file to obtain the corresponding binary data, and then cache the file identifier and the binary data obtained by the parsing in the memory accordingly. So that the next time the same animation file is obtained, the binary sequence cached in the memory can be directly obtained.

[0142] like Fig.10 The following is a schematic diagram of the memory occupied when the same animation file is obtained. Fig.10 When the animation file 1 is obtained, the animation file 1 needs to be decoded to obtain a binary sequence, and the binary sequence is loaded into the memory. When the animation file 2 to be superimposed is the same as the animation file 1, the animation file 2 still needs to be decoded to obtain a binary sequence, and the obtained binary sequence is loaded into the memory. Similarly, when the animation file 3 to be superimposed is the same as the animation file 1, it still needs to be decoded repeatedly and will occupy memory. The more the number of identical animation files superimposed, the longer the decoding time caused by repeated decoding will be, and at the same time, a large amount of memory will be occupied.

[0143] like Fig.11 FIG. 1 is a schematic diagram of memory usage when the same animation file is obtained in an embodiment provided by the present application. Fig.11When the animation file 1 is obtained, it is necessary to decode the animation file 1 to obtain a binary sequence, load the binary sequence into the memory, and cache the file identifier of the animation file 1 and the binary sequence in the memory. When the animation file 2 to be superimposed is the same as the animation file 1, it is still necessary to search whether there is a cached binary sequence corresponding to it according to the file identifier of the animation file 2. If it exists, the cached binary sequence is directly obtained. There is no need to repeat the process of reading the animation file 2 and decoding the animation file 2, and there is no need to repeatedly occupy the memory. Similarly, when the animation file 3 to be superimposed is the same as the animation file 1, it is necessary to search whether there is a cached binary sequence corresponding to it according to the file identifier of the animation file 3. It can not only reduce the decoding time, but also reuse the memory, which can save a lot of memory space.

[0144] In one embodiment, the animation processing method further includes: when a file identifier of a newly added animation file that is the same as the target animation file is obtained, directly obtaining binary data corresponding to the file identifier cached in the memory.

[0145] In one embodiment, when the terminal receives a file path, the terminal may generate a file identifier according to the file path, and then search the memory for binary data corresponding to the file identifier according to the file identifier.

[0146] In one embodiment, the animation processing method further includes: calculating rendering data corresponding to the target animation file according to the binary data; rendering according to the rendering data and displaying the rendering picture.

[0147] The animation playback process includes decoding, rendering and screen display. Decoding includes physical file decoding and data parsing. Physical file decoding refers to the process of decoding the original animation file to obtain a binary sequence and loading the binary sequence into the memory in the form of an animation object. The animation object contains all the animation attribute data of the animation file; data parsing refers to the process of reading the animation object from the memory and obtaining the description data of the current animation frame according to the animation object when a certain animation frame needs to be played. Rendering refers to the process of calculating the rendering data of the animation frame according to the description data corresponding to the animation frame. Screen display refers to the process of transmitting the rendering data to the display to stimulate the display to display the animation frame.

[0148] Specifically, after acquiring the target animation file, the terminal may decode and render the target animation file in sequence to obtain rendering data corresponding to each animation frame, and then display each animation frame in sequence according to the obtained rendering data.

[0149] In one embodiment, the method also includes: determining the area to be drawn belonging to the target animation file in a shared video memory space storing rendering data corresponding to an existing animation file; updating pixel data in the area to be drawn according to the rendering data corresponding to the target animation file; and displaying a rendering picture according to the pixel data stored in the shared video memory space, the rendering picture at least including a playback picture of the target animation file.

[0150] Specifically, when it is necessary to display the playback screens of multiple animation files in a superimposed manner, a shared video memory space can be applied for storing the pixel data corresponding to the superimposed screen after the playback screens of multiple animation files are superimposed in sequence. When the rendering data corresponding to the newly added target animation file is obtained, the area to be drawn of the target animation file is determined in the shared video memory space. The shared video memory space stores the rendering data corresponding to the existing animation files. It is only necessary to update the pixel data in the area to be drawn according to the rendering data corresponding to the target animation file, that is, to cover the pixel data in the area to be drawn with the target rendering data of the newly added target animation file, and then the rendering screen can be displayed according to the pixel data stored in the updated shared video memory space, and the rendering screen at least includes the playback screen of the target animation file.

[0151] The above-mentioned animation processing method, after obtaining the file identifier of the target animation file, can search from the memory cache whether there is corresponding binary data according to the file identifier. If so, the binary data cached in the memory can be directly obtained. If not, the target animation file is obtained according to the file identifier, and after parsing the target animation file to obtain the binary data, the file identifier and the binary data are cached in the memory accordingly. In this way, the binary data of the target animation file that has been loaded into the memory is cached. When the same file identifier is obtained again, the corresponding binary data can be directly obtained from the cache according to the file identifier. There is no need to repeatedly decode the target animation file, which can improve the loading efficiency of the target animation file, and can also avoid the memory occupation problem caused by repeatedly loading the same target animation file into the memory, thereby reducing memory occupation.

[0152] In one embodiment, Fig.12 As shown, an animation processing device 1200 is provided, the device includes an acquisition module 1202, a determination module 1204, an update module 1206 and a display module 1208, wherein:

[0153] The acquisition module 1202 is used to acquire target rendering data corresponding to the target animation file;

[0154] A determination module 1204 is used to determine the to-be-drawn area belonging to the target animation file in the shared video memory space storing the rendering data corresponding to the existing animation file;

[0155] An updating module 1206, used to update pixel data in the area to be drawn according to the target rendering data;

[0156] The display module 1208 is used to display a rendering picture according to the pixel data stored in the shared video memory space, and the rendering picture at least includes a playback picture of the target animation file.

[0157] In one embodiment, the acquisition module 1202 is further used to acquire binary data corresponding to the target animation file; calculate description data corresponding to the target animation file according to the binary data; and convert the description data into target rendering data for drawing the target animation file.

[0158] In one embodiment, if the target animation file is different from the existing animation file, the animation processing device 1200 also includes a description data cache module for caching the description data corresponding to the target animation file; when a new animation file that is the same as the target animation file is obtained, the rendering data corresponding to the new animation file is calculated based on the cached description data.

[0159] In one embodiment, the acquisition module 1202 is further used to acquire the file identifier of the target animation file; when there is cached binary data corresponding to the file identifier in the memory, the cached binary data in the memory is directly acquired.

[0160] In one embodiment, the acquisition module 1202 is also used to acquire the target animation file corresponding to the file identifier when there is no cached binary data corresponding to the file identifier in the memory; parse the target animation file to obtain the binary data; and cache the binary data and the file identifier in the memory.

[0161] In one embodiment, the animation processing device 1200 further includes a binary data acquisition module, which is used to directly acquire the binary data corresponding to the file identifier cached in the memory when the file identifier of the newly added animation file that is the same as the target animation file is acquired.

[0162] In one embodiment, the acquisition module 1202 is further used to acquire the file path of the target animation file; and perform encryption operation on the file path to obtain the file identifier of the target animation file.

[0163] In one embodiment, the animation processing device 1200 further includes a creation module for obtaining the size of a target screen to be superimposed with the playback screen of the target animation file; and creating a video memory space matching the size as a shared video memory space of the target screen.

[0164] In one embodiment, the display module 1208 is also used to display a rendering picture in which the playback screen of the target animation file completely covers the playback screen of the existing animation file according to the pixel data stored in the shared video memory space when the pixel data stored in the updated shared video memory space does not include the rendering data of the existing animation file; when the pixel data stored in the updated shared video memory space includes part of the rendering data of the existing animation file, then the display module 1208 is further used to display a rendering picture in which the playback screen of the target animation file partially covers the playback screen of the existing animation file according to the pixel data stored in the shared video memory space; when the pixel data stored in the updated shared video memory space includes all the rendering data of the existing animation file, then the display module 1208 is further used to display a rendering picture including the playback screen of the target animation file and the playback screen of the existing animation file according to the pixel data stored in the shared video memory space.

[0165] In one embodiment, the animation processing device 1200 further includes a pixel data cache module for caching pixel data in the updated shared video memory space; and repeatedly displaying a rendering screen including at least a playback screen of the target animation file according to the cached pixel data.

[0166] The animation processing device 1200, when it is necessary to display the playback screens of multiple animation files in a superimposed manner, allows multiple target animation files to share the same video memory space, i.e., a shared video memory space. In this way, no matter how many animation files are added, the size of the video memory space occupied is only the size of the shared video memory space. The shared video memory space stores the rendering data corresponding to the existing animation files. When the target rendering data corresponding to the target animation file is obtained, the area to be drawn of the target animation file can be determined in the shared video memory space according to the target rendering data. It is only necessary to cover the pixel data in the area to be drawn with the target rendering data of the target animation file to update the pixel data in the shared video memory space. Then, the rendering screen can be displayed according to the pixel data stored in the updated shared video memory space, and the rendering screen at least includes the playback screen of the target animation file. This method does not require a separate video memory space to be applied for each animation file to store its own rendering data, and can save video memory space, especially when the playback screens of multiple animation files overlap or exceed the range of the rendering screen, it can greatly save video memory space.

[0167] In one embodiment, Fig.13 As shown, an animation processing device 1300 is provided, the device includes a file identification acquisition module 1302, a cache data acquisition module 1304 and a parsing module 1306, wherein:

[0168] The file identification acquisition module 1302 is used to acquire the file identification of the target animation file;

[0169] The cache data acquisition module 1304 is used to directly acquire the cached binary data in the memory when there is cached binary data corresponding to the file identifier in the memory;

[0170] The parsing module 1306 is used to obtain the target animation file corresponding to the file identifier, parse the target animation file to obtain the binary data, and cache the binary data and the file identifier in the memory when there is no cached binary data corresponding to the file identifier in the memory.

[0171] In one embodiment, the file identification acquisition module 1302 is further used to acquire the file path of the target animation file; and perform encryption operation on the file path to obtain the file identification of the target animation file.

[0172] In one embodiment, the cache data acquisition module 1304 is further configured to directly acquire binary data corresponding to the file identifier cached in the memory when the file identifier of a newly added animation file that is the same as the target animation file is acquired.

[0173] In one embodiment, the animation processing device 1300 further includes a rendering and display module, which is used to calculate rendering data corresponding to the target animation file according to the binary data; and render and display the rendering picture according to the rendering data.

[0174] In one embodiment, the animation processing device 1300 also includes a rendering display module, which is used to calculate the rendering data corresponding to the target animation file based on binary data; determine the area to be drawn belonging to the target animation file in the shared video memory space that stores the rendering data corresponding to the existing animation file; update the pixel data in the area to be drawn according to the rendering data corresponding to the target animation file; and display the rendering picture according to the pixel data stored in the shared video memory space, and the rendering picture at least includes the playback picture of the target animation file.

[0175] After obtaining the file identifier of the target animation file, the above-mentioned animation processing device 1300 can search from the memory cache whether there is corresponding binary data according to the file identifier. If so, the binary data cached in the memory can be directly obtained. If not, the target animation file is obtained according to the file identifier, and after parsing the target animation file to obtain binary data, the file identifier and the binary data are cached in the memory accordingly. In this way, the binary data of the target animation file that has been loaded into the memory is cached. When the same file identifier is obtained again, the corresponding binary data can be directly obtained from the cache according to the file identifier. There is no need to repeatedly decode the target animation file, which can improve the loading efficiency of the target animation file, and can also avoid the memory occupation problem caused by repeatedly loading the same target animation file into the memory, thereby reducing memory occupation.

[0176] Fig.14The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The terminal 110 in FIG. Fig.14 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the animation processing method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the animation processing method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0177] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0178] In one embodiment, the animation processing device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.14 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the animation processing device, such as: Fig.12 The acquisition module 1202, the determination module 1204, the update module 1206 and the display module 1208 are shown. For example, Fig.13 The file identification acquisition module 1302, cache data acquisition module 1304 and parsing module 1306 are shown. The computer program composed of various program modules enables the processor to execute the steps of the animation processing method of each embodiment of the present application described in this specification.

[0179] For example, Fig.14 The computer device shown can be Fig.12 The acquisition module 1202 in the animation processing apparatus 1200 shown in the figure performs step S202. The computer device may perform step S204 through the determination module 1204. The computer device may perform step S206 through the update module 1206. The computer device may perform step S208 through the display module 1208.

[0180] For example, Fig.14The computer device shown can be Fig.13 The file identification acquisition module 1302 in the animation processing device 1300 shown in the figure executes step S902. The computer device may execute step S904 through the cache data acquisition module 1304. The computer device may execute step S906 through the parsing module 1306.

[0181] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above animation processing method. The steps of the animation processing method here may be the steps of the animation processing method in the above embodiments.

[0182] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the above animation processing method. The steps of the animation processing method here can be the steps in the animation processing method of each embodiment above.

[0183] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0184] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0185] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An animation processing method, comprising: Get the file ID of the target animation file; When there is cached binary data corresponding to the file identifier in the memory, directly obtaining the cached binary data in the memory; When there is no cached binary data corresponding to the file identifier in the memory, the target animation file corresponding to the file identifier is obtained, the target animation file is parsed to obtain binary data, and the binary data is cached in the memory corresponding to the file identifier; Calculate description data corresponding to the target animation file according to the binary data, and convert the description data into target rendering data corresponding to the target animation file for drawing; In a shared video memory space storing rendering data corresponding to an existing animation file, determining a to-be-drawn area belonging to the target animation file; According to the target rendering data, updating the pixel data in the to-be-drawn area; A rendering picture is displayed according to the pixel data stored in the shared video memory space, and the rendering picture at least includes a playback picture of the target animation file.

2. The method according to claim 1, characterized in that The target animation file is different from the existing animation file, and the method further includes: Cache the description data corresponding to the target animation file; When a new animation file that is the same as the target animation file is obtained, The rendering data corresponding to the newly added animation file is calculated according to the cached description data.

3. The method according to claim 1, characterized in that The method further comprises: When the file identifier of the newly added animation file that is the same as the target animation file is obtained, Directly obtain the binary data corresponding to the file identifier cached in the memory.

4. The method according to claim 1, characterized in that: The step of obtaining the file identifier of the target animation file includes: Get the file path of the target animation file; The file path is encrypted to obtain the file identifier of the target animation file.

5. The method according to claim 1, characterized in that The method further comprises: Obtaining the size of the target screen on which the target animation file is to be superimposed; A video memory space matching the size is created as the shared video memory space of the target picture.

6. The method according to claim 1, characterized in that The displaying of the rendering picture according to the pixel data stored in the shared video memory space includes: When the pixel data stored in the shared video memory space after the update does not include the rendering data of the existing animation file, a rendering picture in which the playback picture of the target animation file completely covers the playback picture of the existing animation file is displayed according to the pixel data stored in the shared video memory space; When the pixel data stored in the shared video memory space after the update includes part of the rendering data of the existing animation file, a rendering picture in which the playback picture of the target animation file partially covers the playback picture of the existing animation file is displayed according to the pixel data stored in the shared video memory space; When the pixel data stored in the shared video memory space after update includes all the rendering data of the existing animation file, a rendering picture including the playback picture of the target animation file and the playback picture of the existing animation file is displayed according to the pixel data stored in the shared video memory space.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Cache the pixel data in the shared video memory space after the update; A rendering screen including at least a playback screen of the target animation file is repeatedly displayed according to the cached pixel data.

8. An animation processing device, characterized in that: The device comprises: An acquisition module, used to acquire the file identifier of a target animation file; The acquisition module is further configured to directly acquire the binary data cached in the memory when there is cached binary data corresponding to the file identifier in the memory; when there is no cached binary data corresponding to the file identifier in the memory, acquire the target animation file corresponding to the file identifier, parse the target animation file to obtain the binary data, and cache the binary data corresponding to the file identifier in the memory; The acquisition module is further used to calculate the description data corresponding to the target animation file according to the binary data, and convert the description data into target rendering data corresponding to the target animation file for drawing; A determination module, used to determine the to-be-drawn area belonging to the target animation file in the shared video memory space storing the rendering data corresponding to the existing animation file; An updating module, used for updating the pixel data in the to-be-drawn area according to the target rendering data; The display module is used to display a rendering picture according to the pixel data stored in the shared video memory space, and the rendering picture at least includes a playback picture of the target animation file.

9. The device according to claim 8, characterized in that The target animation file is different from the existing animation file, and the device further comprises: The description data cache module is used to cache the description data corresponding to the target animation file; when a new animation file identical to the target animation file is obtained, the rendering data corresponding to the new animation file is calculated according to the cached description data.

10. The device according to claim 8, characterized in that The acquisition module is further configured to directly acquire binary data corresponding to the file identifier cached in the memory when a file identifier of a newly added animation file identical to the target animation file is acquired.

11. The device according to claim 8, characterized in that The acquisition module is further used to acquire the file path of the target animation file; and perform encryption operation on the file path to obtain the file identifier of the target animation file.

12. The device according to claim 8, characterized in that The device also includes: The creation module is used to obtain the size of the target screen to be superimposed with the playback screen of the target animation file; and create a video memory space matching the size as the shared video memory space of the target screen.

13. The device according to claim 8, characterized in that The display module is also used to display a rendering picture in which the playback screen of the target animation file completely covers the playback screen of the existing animation file according to the pixel data stored in the shared video memory space when the pixel data stored in the shared video memory space after the update does not include the rendering data of the existing animation file; when the pixel data stored in the shared video memory space after the update includes part of the rendering data of the existing animation file, then the rendering picture in which the playback screen of the target animation file partially covers the playback screen of the existing animation file according to the pixel data stored in the shared video memory space; when the pixel data stored in the shared video memory space after the update includes all the rendering data of the existing animation file, then the rendering picture including the playback screen of the target animation file and the playback screen of the existing animation file is displayed according to the pixel data stored in the shared video memory space.

14. The device according to any one of claims 8 to 13, characterized in that The device also includes: A pixel data cache module is used to cache the updated pixel data in the shared video memory space; and repeatedly display a rendering screen including at least a playback screen of the target animation file according to the cached pixel data.

15. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

16. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.