Dynamic image playing method, device, storage medium and computer equipment
By acquiring and displaying forward and reverse sequence information of dynamic images and directly obtaining animated decoded images, the problem of slow loading speed of animated images in traditional dynamic image playback methods is solved, and more efficient animated image playback is achieved.
Patent Information
- Application Number
- CN201911323823.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-20
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2039-12-22
AI Technical Summary
Due to the hardware and software limitations of the application environment, the traditional dynamic image playback method results in slow loading of animated images.
By obtaining the identifier of the dynamic image to be played, searching for its corresponding decoded image set, and reading the forward and reverse sequence information, displaying the forward and reverse decoded images in the decoded image set frame by frame, and directly obtaining the decoded image corresponding to the moving image. Reduce the number of image frames and improve loading speed.
It effectively improves the loading speed of animated images, reduces the number of image frames, reduces CPU usage and loading time, and improves the efficiency of animated image playback.
Smart Images

Figure CN113096218B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of multimedia processing technology, and in particular to a dynamic image playback method, device, storage medium and computer equipment. Background Art
[0002] With the development of Internet technology, various types of applications have emerged in an endless stream, greatly enriching people's lives. In short video applications, content is presented through pictures, among which pictures can specifically include dynamic pictures and static pictures. In simple terms, static pictures are still pictures, and dynamic pictures are composed of multiple frames of static pictures.
[0003] Traditional dynamic image playback methods generally adopt the method of decoding a picture, displaying a picture, then decoding the next picture, displaying the next picture, and so on to achieve the dynamic image effect. Although the above dynamic image playback method can achieve the dynamic image effect, in actual application, due to the hardware limitation and / or software limitation of the application environment, this dynamic image playback method has the problem of slow dynamic image loading speed. Summary of the invention
[0004] Based on this, in order to solve the above technical problems, a dynamic image playback method, device, storage medium and computer equipment are provided to improve the dynamic image loading speed.
[0005] A dynamic image playing method, comprising:
[0006] Get the dynamic image ID to be played;
[0007] Searching for a decoded image set corresponding to the to-be-played dynamic image identifier, and reading the forward sequence information and reverse sequence information of the decoded image set;
[0008] Displaying each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information;
[0009] When the display of the last frame of the forward-order decoded image is finished, each frame of the reverse-order decoded image in the decoded image set is displayed frame by frame based on the reverse-order sequence information.
[0010] A dynamic image playing device, the device comprising:
[0011] A data acquisition module, used to acquire the identifier of the dynamic image to be played;
[0012] A data search module, used to search for a decoded image set corresponding to the to-be-played dynamic image identifier, and read the forward sequence information and reverse sequence information of the decoded image set;
[0013] A positive sequence display module, used for displaying each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information;
[0014] The reverse order display module is used to display each frame of the reverse order decoded image in the decoded image set frame by frame based on the reverse order sequence information when the display of the last frame of the forward order decoded image is finished.
[0015] A computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following steps:
[0016] Get the dynamic image ID to be played;
[0017] Searching for a decoded image set corresponding to the to-be-played dynamic image identifier, and reading the forward sequence information and reverse sequence information of the decoded image set;
[0018] Displaying each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information;
[0019] When the display of the last frame of the forward-order decoded image is finished, each frame of the reverse-order decoded image in the decoded image set is displayed frame by frame based on the reverse-order sequence information.
[0020] 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 performs the following steps:
[0021] Get the dynamic image ID to be played;
[0022] Searching for a decoded image set corresponding to the to-be-played dynamic image identifier, and reading the forward sequence information and reverse sequence information of the decoded image set;
[0023] Displaying each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information;
[0024] When the display of the last frame of the forward-order decoded image is finished, each frame of the reverse-order decoded image in the decoded image set is displayed frame by frame based on the reverse-order sequence information.
[0025] The above-mentioned dynamic image playback method, device, storage medium and computer equipment obtain the dynamic image identifier to be played, search for the decoded image set corresponding to the dynamic image identifier to be played, and read the forward sequence information and reverse sequence information of the decoded image set to directly obtain the decoded image corresponding to the dynamic image. There is no need to perform decoding processing before displaying each frame of the image, which saves time for subsequent dynamic image loading. Each frame of the forward decoded image in the decoded image set is displayed frame by frame based on the forward sequence information. When the last frame of the forward decoded image is displayed, each frame of the reverse decoded image in the decoded image set is displayed frame by frame based on the reverse sequence information. The forward sequence and reverse sequence are combined to achieve the dynamic image effect, remove the repeated image frames in the dynamic image, and reduce the number of image frames in the dynamic image, so that the dynamic image loading speed can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A diagram showing an application environment of a dynamic image playing method in an embodiment;
[0027] Figure 2 A schematic diagram of a flow chart of a dynamic image playing method in one embodiment;
[0028] Figure 3 A schematic diagram of a cover animated image in one embodiment;
[0029] Figure 4 is a schematic diagram of a cover animated image feature in one embodiment;
[0030] Figure 5 A schematic diagram of a dynamic image playback process in one embodiment;
[0031] Figure 6 is a schematic diagram of a dynamic image playback process in another embodiment;
[0032] Figure 7 is a structural block diagram of a dynamic image playback device in one embodiment;
[0033] Figure 8 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0034] 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.
[0035] Figure 1 FIG. 1 is an application environment diagram of a dynamic image playing method in an embodiment. Figure 1, the application scenario includes a mobile terminal 102 and a server 104, and the mobile terminal 102 is connected to the server 104 through a network. The server 104 obtains the dynamic image identifier to be played; searches for the decoded image set corresponding to the dynamic image identifier to be played, and reads the forward sequence information and reverse sequence information of the decoded image set; displays each forward decoded image frame by frame in the decoded image set based on the forward sequence information; when the last forward decoded image frame is displayed, displays each reverse decoded image frame by frame in the decoded image set based on the reverse sequence information. Among them, the mobile terminal 102 can be a mobile phone, a tablet computer, etc., the number of mobile terminals 102 can be multiple, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers. In the embodiment of the present application, the dynamic image playback method can be executed by the server 104, or by the mobile terminal 102, or by the server 104 and the mobile terminal 102. Specifically, the mobile terminal 102 can execute the dynamic image playback method in the embodiment of the present application by a processor.
[0036] like Figure 2 As shown, in one embodiment, a dynamic image playing method is provided. This embodiment mainly applies the method to the above Figure 1 The server 104 in FIG. Figure 2 , the method specifically comprises the following steps:
[0037] S202, obtaining the identifier of the dynamic image to be played.
[0038] Among them, dynamic images may include GIF (Graphics Interchange Format) dynamic images, WebP dynamic images, etc. The identification of the dynamic image to be played refers to the identification used to distinguish dynamic images in different states in the short video application when the user plays the dynamic image through the short video application. For example, the user clicks on an installed short video application on the mobile terminal to enter the main interface of the short video application. The main interface is a recommended dynamic image that is being played. When the user wants to play the next dynamic image through a sliding gesture, the next dynamic image is the image corresponding to the identification of the dynamic image to be played. For another example, the user clicks on an installed short video application on the mobile terminal to enter the main interface of the short video application. The main interface includes multiple recommended dynamic images. When the user selects a dynamic image that he wants to play from multiple recommended dynamic images through a clicking operation, the selected dynamic image is the image corresponding to the identification of the dynamic image to be played.
[0039] S204, searching for a decoded image set corresponding to the to-be-played dynamic image identifier, and reading the forward sequence information and the reverse sequence information of the decoded image set.
[0040] Decoding refers to the process of the receiver restoring the received symbols or codes into information, which corresponds to the encoding process. Since the image in the animated image is a compressed bitmap graphic format, before the image is rendered and displayed, the original pixel data of the image must be obtained to perform subsequent drawing operations, that is, the animated image needs to be decoded to obtain a decoded image. The decoded image set includes multiple decoded images after decoding each image frame in the animated image.
[0041] The positive sequence information refers to sorting the images in the decoded image set in the positive order, and the reverse sequence information refers to sorting the images in the decoded image set in the reverse order. For example, the decoded image set includes image frame 1, image frame 2, image frame 3, image frame 4 and image frame 5, the positive sequence information refers to the decoded images in the order of image frame 1, image frame 2, image frame 3, image frame 4 and image frame 5, and the reverse sequence information refers to the decoded images in the order of image frame 5, image frame 4, image frame 3, image frame 2 and image frame 1.
[0042] S206 , displaying each frame of the decoded image in the decoded image set frame by frame based on the positive sequence information.
[0043] Taking the decoded image set including image frame 1, image frame 2, image frame 3, image frame 4 and image frame 5 as an example, the positive sequence information refers to the decoded images in the order of image frame 1, image frame 2, image frame 3, image frame 4 and image frame 5. Displaying each positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information means displaying the images frame by frame in the order of image frame 1, image frame 2, image frame 3, image frame 4 and image frame 5.
[0044] S208, when the display of the last frame of the forward-order decoded image is finished, display each frame of the reverse-order decoded image in the decoded image set frame by frame based on the reverse-order sequence information.
[0045] Taking the decoded image set including image frame 1, image frame 2, image frame 3, image frame 4 and image frame 5 as an example, the reverse sequence information refers to the decoded images in the order of image frame 5, image frame 4, image frame 3, image frame 2 and image frame 1. After displaying each frame of the decoded image in the decoded image set frame by frame based on the forward sequence information, each frame of the decoded image in the decoded image set is displayed frame by frame based on the reverse sequence information, that is, the images are displayed frame by frame in the order of image frame 1, image frame 2, image frame 3, image frame 4, image frame 5, image frame 4, image frame 3, image frame 2 and image frame 1, so as to ensure the continuity of image display and avoid image frame jumps.
[0046] The above-mentioned dynamic image playback method obtains the dynamic image identifier to be played, searches for the decoded image set corresponding to the dynamic image identifier to be played, and reads the forward sequence information and reverse sequence information of the decoded image set to directly obtain the decoded image corresponding to the dynamic image. There is no need to perform decoding processing before displaying each frame of the image, which saves time for subsequent dynamic image loading. Each frame of the forward decoded image in the decoded image set is displayed frame by frame based on the forward sequence information. When the last frame of the forward decoded image is displayed, each frame of the reverse decoded image in the decoded image set is displayed frame by frame based on the reverse sequence information. The forward sequence and reverse sequence are combined to achieve the dynamic image effect, remove the repeated image frames in the dynamic image, and reduce the number of image frames in the dynamic image, thereby effectively improving the dynamic image loading speed.
[0047] In one embodiment, searching for a decoded image set corresponding to the to-be-played dynamic image identifier includes: searching for images in pre-cached data based on the to-be-played dynamic image identifier; when a decoded image set corresponding to the to-be-played dynamic image identifier exists in the pre-cached data, obtaining the decoded image set. Cache refers to a memory that can perform high-speed data exchange, and is a buffer for data exchange. In the data processing process of the mobile terminal, for example, when the CPU (Central Processing Unit) needs to read data, it first queries the data from the cache. Reading data from the cache is faster than reading data from the memory. Therefore, cache data helps to improve the subsequent data processing speed. Cache data refers to data stored in the cache, and specifically, data can be stored according to the corresponding relationship between the dynamic image identifier and the decoded image set. For example, the dynamic image corresponding to the to-be-played dynamic image identifier is A. The dynamic image A is searched in the cache data according to the corresponding relationship between the dynamic image identifier and the decoded image set. When the decoded image set corresponding to the dynamic image A exists in the cache data, it is not necessary to decode each frame of the dynamic image A, and the decoded image set is directly obtained, which can save time for subsequent dynamic image loading.
[0048] In one embodiment, the dynamic image playing method further includes: when there is no decoded image set corresponding to the dynamic image identifier to be played in the pre-cached data, obtaining the dynamic image corresponding to the dynamic image identifier to be played; decoding the image frame in the dynamic image to obtain the decoded image set corresponding to the dynamic image identifier to be played. Cache data refers to data stored in the cache, and the data can be stored according to the correspondence between the dynamic image identifier and the decoded image set. For example, the dynamic image corresponding to the dynamic image identifier to be played is B, and the dynamic image B is searched in the cache data according to the correspondence between the dynamic image identifier and the decoded image set. When there is no decoded image set corresponding to the dynamic image B in the cache data, it is necessary to obtain the dynamic image B, and decode the image frames in the obtained dynamic image B to obtain the decoded image set corresponding to the dynamic image B. For example, when a user initiates a request to play a certain dynamic image through a short video application of a mobile terminal, and there is no decoded image of the dynamic image in the cache of the mobile terminal, at this time, the mobile terminal can initiate an image download request to the cloud server, and the image download request carries the dynamic image identifier to be downloaded, and requests the server to return the dynamic image data to the mobile terminal. Specifically, the animated image can be obtained by extracting image frames from a preset video file based on a preset rule, or by combining multiple frames of static images.
[0049] In one embodiment, decoding the image frames in the dynamic image to obtain the decoded image set corresponding to the dynamic image identifier to be played includes: decoding the current frame image in the dynamic image to obtain the decoded image of the current frame and display the decoded image of the current frame; decoding the next frame image in the dynamic image to obtain the decoded image of the next frame and display the decoded image of the next frame; obtaining the decoded image set corresponding to the dynamic image identifier to be played according to the decoded image of the current frame and the decoded image of the next frame; after obtaining the decoded image set corresponding to the dynamic image identifier to be played, it also includes: adding the decoded image set corresponding to the dynamic image identifier to be played to the pre-cached data. The acquired dynamic image is decoded according to the image frame, one frame is decoded, and one frame is displayed, so as to achieve the effect of decoding and displaying at the same time, without waiting for all the image frames to be decoded before displaying, which can shorten the waiting time. After all the image frames of the dynamic image are decoded, all the decoded images are added to the cache data, so that when the decoded image set of the dynamic image needs to be read, it can be directly read from the cache without decoding the dynamic image again, which can effectively shorten the time required for loading the dynamic image.
[0050] In one embodiment, when the dynamic image corresponding to the dynamic image identifier to be played includes 2m frames of images, the decoded image set includes m frames of images; when the dynamic image corresponding to the dynamic image identifier to be played includes 2m+1 frames of images, the decoded image set includes m+1 frames of images; wherein m is a positive integer. In a short video application, before entering a video, a cover dynamic image is generally displayed first, such as Figure 3 As shown. For example, if a video cover animation includes N frames of images, the content of the first frame of the video cover animation is the same as the content of the Nth frame of the image, the content of the second frame of the image is the same as the content of the N-1th frame of the image, the content of the third frame of the image is the same as the content of the N-2th frame of the image, and so on. Figure 4 shown.
[0051] For example, a video cover animation includes 9 frames of images, the content of the first frame is the same as the content of the ninth frame, the content of the second frame is the same as the content of the eighth frame, the content of the third frame is the same as the content of the seventh frame, and the content of the fourth frame is the same as the content of the sixth frame. When the cover animation is played by a traditional dynamic image playback method, Figure 5 As shown, first download the 9 frames corresponding to the cover animated image, then decode the 1st frame and display it; decode the 2nd frame and display it; decode the 3rd frame and display it; decode the 4th frame and display it; decode the 5th frame and display it; decode the 6th frame and display it; decode the 7th frame and display it…decode the 9th frame and display it, then decode the 1st frame and display it…and so on in a loop.
[0052] And adopt the dynamic image playing method in this application, such as Figure 6 As shown, after downloading the 9 frames of images corresponding to the cover animated image, decode the 1st frame of the image and display the 1st frame of the image; decode the 2nd frame of the image and display the 2nd frame of the image; decode the 3rd frame of the image and display the 3rd frame of the image; decode the 4th frame of the image and display the 4th frame of the image; decode the 5th frame of the image and display the 5th frame of the image. Add the decoded image frames to the cache, and no longer decode the repeated image frames. Subsequently, directly call the corresponding image frames from the cache for display. That is, the dynamic image playback processing flow in the present application is: decode the 1st frame of the image and display the 1st frame of the image; decode the 2nd frame of the image and display the 2nd frame of the image; decode the 3rd frame of the image and display the 3rd frame of the image; decode the 4th frame of the image and display the 4th frame of the image; decode the 5th frame of the image and display the 5th frame of the image; display the 4th frame of the image - display the 3rd frame of the image - display the 2nd frame of the image - display the 1st frame of the image - display the 2nd frame of the image - display the 3rd frame of the image - display the 4th frame of the image - display the 5th frame of the image - display the 4th frame of the image - display the 3rd frame of the image... and play in this way in a loop.
[0053] The dynamic image playback method in this application can significantly reduce the number of bytes of dynamic images. For example, the number of bytes of a 5-frame dynamic image is about 57% of the number of bytes of a 9-frame dynamic image. In addition, the time required to load a 5-frame dynamic image is about 30% less than the time required to load a 9-frame dynamic image. Moreover, the CPU usage of dynamic images is greatly reduced. Compared with 9-frame dynamic images, the CPU usage of 5-frame dynamic images is reduced from about 40% to 5%.
[0054] In one embodiment, the dynamic image playback method further includes: real-time monitoring of the operation request of the dynamic image interface; when the operation request to leave the dynamic image interface is monitored, the decoded image set data is deleted. The dynamic image interface refers to the functional interface of the dynamic image after entering the short video application. The operation request of the dynamic image interface refers to the operation initiated by the user based on the dynamic image interface of the short video application, such as the operation of watching the next dynamic image, the operation of leaving the dynamic image interface, etc. Specifically, the correspondence between the operation and the instruction can be established in advance, for example, the operation of sliding right once corresponds to the instruction to jump to the next dynamic image, and the operation of sliding right twice continuously corresponds to the instruction to leave the dynamic image interface, etc. When the operation request to leave the dynamic image interface is monitored, the decoded image set data is deleted to release the storage space. For example, the decoded image set data is stored in the cache, and the cache capacity is limited. Therefore, when leaving the dynamic image interface, the decoded image set data corresponding to the dynamic image is deleted, which can timely release the cache space and facilitate the subsequent storage and reading of the cache data.
[0055] In one embodiment, obtaining the identifier of the dynamic image to be played includes: real-time monitoring of the operation request of the dynamic image interface; when the operation request to enter the dynamic image interface is monitored, obtaining the identifier of the dynamic image to be played corresponding to the dynamic image interface. Obtain the correspondence between the pre-established operation and the instruction, for example, the operation of double-clicking the short video application icon corresponds to the instruction to enter the dynamic image interface. When the operation request to enter the dynamic image interface is monitored, obtain the identifier of the dynamic image to be played corresponding to the dynamic image interface, find the decoded image set corresponding to the dynamic image identifier to be played, and read the forward sequence information and reverse sequence information of the decoded image set; based on the forward sequence information, display each frame of the forward decoded image in the decoded image set frame by frame; when the display of the last frame of the forward decoded image is finished, display each frame of the reverse decoded image in the decoded image set frame by frame based on the reverse sequence information.
[0056] It should be understood that although Figure 2The 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 2 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.
[0057] Based on the same idea as the above method, Figure 7 A schematic diagram of the structure of a dynamic image playback device according to an embodiment is shown. This embodiment is described by taking the device being set in the server 104 as an example.
[0058] like Figure 7 As shown, the dynamic image playback device in this embodiment includes:
[0059] The data acquisition module 702 is used to acquire the dynamic image identifier to be played;
[0060] The data search module 704 is used to search for a decoded image set corresponding to the dynamic image identifier to be played, and read the forward sequence information and reverse sequence information of the decoded image set;
[0061] A positive sequence display module 706, configured to display each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information;
[0062] The reverse order display module 708 is used to display each frame of the reverse order decoded image in the decoded image set frame by frame based on the reverse order sequence information when the display of the last frame of the forward order decoded image is finished.
[0063] In one embodiment, the data search module is further used to search for images in the pre-cached data based on the dynamic image identifier to be played; when a decoded image set corresponding to the dynamic image identifier to be played exists in the pre-cached data, the decoded image set is obtained.
[0064] In one embodiment, the data search module is also used to obtain the dynamic image corresponding to the dynamic image identifier to be played when there is no decoded image set corresponding to the dynamic image identifier to be played in the pre-cached data; decode the image frames in the dynamic image to obtain the decoded image set corresponding to the dynamic image identifier to be played.
[0065] In one embodiment, the data search module is also used to decode the current frame image in the dynamic image, obtain the current frame decoded image, and display the current frame decoded image; decode the next frame image in the dynamic image, obtain the next frame decoded image, and display the next frame decoded image; obtain the decoded image set corresponding to the dynamic image identifier to be played based on the current frame decoded image and the next frame decoded image; the dynamic image playback device also includes a data storage module, which is used to add the decoded image set corresponding to the dynamic image identifier to be played to the pre-cached data.
[0066] In one embodiment, when the dynamic image corresponding to the dynamic image identifier to be played includes 2m frames of images, the decoded image set includes m frames of images; when the dynamic image corresponding to the dynamic image identifier to be played includes 2m+1 frames of images, the decoded image set includes m+1 frames of images; wherein m is a positive integer.
[0067] In one embodiment, the dynamic image playback device further includes a data deletion module, which is used to monitor the operation request of the dynamic image interface in real time; when the operation request to leave the dynamic image interface is monitored, the decoded image set data is deleted.
[0068] In one embodiment, the data acquisition module is further used to monitor the operation request of the dynamic image interface in real time; when the operation request to enter the dynamic image interface is monitored, the dynamic image identifier to be played corresponding to the dynamic image interface is acquired.
[0069] Figure 8 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The mobile terminal 102 or the server 104 in FIG. Figure 8 As shown, the computer device includes a processor 802, a memory 804, a network interface 806, an input device 808, a display screen 810, a camera 812, a sound collection device 814 and a speaker 816 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 a dynamic image playback method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute a dynamic image playback 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 may be a key, trackball or touchpad provided on the housing of the computer device, or may be an external keyboard, touchpad or mouse, etc.
[0070] Those skilled in the art will understand that Figure 8The 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.
[0071] In one embodiment, the dynamic image playback device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 8 The memory of the computer device can store various program modules constituting the dynamic image playback device, for example, Figure 7 The data acquisition module, data search module, forward order display module and reverse order display module shown in the figure. The computer program composed of each program module enables the processor to execute the steps of the dynamic image playback method of each embodiment of the present application described in this specification.
[0072] For example, Figure 8 The computer device shown can be Figure 7 The data acquisition module in the dynamic image playback device shown acquires the dynamic image identifier to be played. The computer device can search for the decoded image set corresponding to the dynamic image identifier to be played through the data search module, and read the forward sequence information and reverse sequence information of the decoded image set. The computer device can display each forward decoded image frame by frame in the decoded image set based on the forward sequence information through the forward display module. The computer device can display each reverse decoded image frame by frame in the decoded image set based on the reverse sequence information when the last forward decoded image frame is displayed through the reverse display module.
[0073] 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-mentioned dynamic image playback method. The steps of the dynamic image playback method here may be the steps of the dynamic image playback method in each of the above-mentioned embodiments.
[0074] 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-mentioned dynamic image playback method. The steps of the dynamic image playback method here can be the steps of the dynamic image playback method in the above-mentioned embodiments.
[0075] 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).
[0076] 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.
[0077] 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. A method for playing a dynamic image, comprising: Get the dynamic image ID to be played; Searching for a decoded image set corresponding to the to-be-played dynamic image identifier, and reading the forward sequence information and reverse sequence information of the decoded image set; when the dynamic image corresponding to the to-be-played dynamic image identifier includes 2m frames of images, the decoded image set includes m frames of images; when the dynamic image corresponding to the to-be-played dynamic image identifier includes 2m+1 frames of images, the decoded image set includes m+1 frames of images; wherein m is a positive integer; Displaying each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information; When the display of the last frame of the forward-order decoded image is finished, each frame of the reverse-order decoded image in the decoded image set is displayed frame by frame based on the reverse-order sequence information.
2. The method according to claim 1, characterized in that The step of searching for a decoded image set corresponding to the to-be-played dynamic image identifier comprises: Searching for an image in pre-cached data based on the identifier of the dynamic image to be played; When the decoded image set corresponding to the to-be-played dynamic image identifier exists in the pre-cached data, the decoded image set is acquired.
3. The method according to claim 2, characterized in that The method further comprises: When the decoded image set corresponding to the to-be-played dynamic image identifier does not exist in the pre-cached data, acquiring the dynamic image corresponding to the to-be-played dynamic image identifier; The image frames in the dynamic image are decoded to obtain a decoded image set corresponding to the dynamic image identifier to be played.
4. The method according to claim 3, characterized in that The decoding process of the image frames in the dynamic image to obtain the decoded image set corresponding to the dynamic image identifier to be played includes: Decoding the current frame image in the dynamic image to obtain a decoded current frame image, and displaying the decoded current frame image; Decoding a next frame of the dynamic image to obtain a next frame of decoded image, and displaying the next frame of decoded image; Obtaining a decoded image set corresponding to the to-be-played dynamic image identifier according to the current frame decoded image and the next frame decoded image; After obtaining the decoded image set corresponding to the to-be-played dynamic image identifier, the method further includes: The decoded image set corresponding to the to-be-played dynamic image identifier is added to the pre-cached data.
5. The method according to claim 1, characterized in that The method further comprises: Listen to the operation requests of the dynamic image interface in real time; When an operation request to leave the dynamic image interface is detected, the decoded image set data is deleted.
6. The method according to claim 1, characterized in that The obtaining of the identification of the dynamic image to be played comprises: Listen to the operation requests of the dynamic image interface in real time; When an operation request to enter the dynamic image interface is intercepted, an identifier of a dynamic image to be played corresponding to the dynamic image interface is obtained.
7. A dynamic image playback device, characterized in that: The device comprises: A data acquisition module, used to acquire the identifier of the dynamic image to be played; A data search module is used to search for a decoded image set corresponding to the to-be-played dynamic image identifier, and read the positive sequence information and the reverse sequence information of the decoded image set; when the dynamic image corresponding to the to-be-played dynamic image identifier includes 2m frames of images, the decoded image set includes m frames of images; when the dynamic image corresponding to the to-be-played dynamic image identifier includes 2m+1 frames of images, the decoded image set includes m+1 frames of images; wherein m is a positive integer; A positive sequence display module, used for displaying each frame of the positive sequence decoded image in the decoded image set frame by frame based on the positive sequence information; The reverse order display module is used to display each frame of the reverse order decoded image in the decoded image set frame by frame based on the reverse order sequence information when the display of the last frame of the forward order decoded image is finished.
8. The device according to claim 7, characterized in that The data search module is also used for: Searching for an image in pre-cached data based on the identifier of the dynamic image to be played; When the decoded image set corresponding to the to-be-played dynamic image identifier exists in the pre-cached data, the decoded image set is acquired.
9. The device according to claim 8, characterized in that The data search module is also used for: When the decoded image set corresponding to the to-be-played dynamic image identifier does not exist in the pre-cached data, acquiring the dynamic image corresponding to the to-be-played dynamic image identifier; The image frames in the dynamic image are decoded to obtain a decoded image set corresponding to the dynamic image identifier to be played.
10. The device according to claim 9, characterized in that The data search module is specifically used for: Decoding the current frame image in the dynamic image to obtain a decoded current frame image, and displaying the decoded current frame image; Decoding a next frame of the dynamic image to obtain a next frame of decoded image, and displaying the next frame of decoded image; Obtaining a decoded image set corresponding to the to-be-played dynamic image identifier according to the current frame decoded image and the next frame decoded image; The dynamic image playback device also includes a data storage module, which is used for: The decoded image set corresponding to the to-be-played dynamic image identifier is added to the pre-cached data.
11. The device according to claim 7, characterized in that The dynamic image playback device also includes a data deletion module, which is used to: Listen to the operation requests of the dynamic image interface in real time; When an operation request to leave the dynamic image interface is detected, the decoded image set data is deleted.
12. The device according to claim 7, characterized in that The data acquisition module is specifically used for: Listen to the operation requests of the dynamic image interface in real time; When an operation request to enter the dynamic image interface is intercepted, an identifier of a dynamic image to be played corresponding to the dynamic image interface is obtained.
13. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the method according to any one of claims 1 to 6.
14. 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 6.
