Animation processing method and device, electronic equipment, storage medium and chip
By responding to sliding operations during animation processing, dynamically determining and rendering the image frame to be rendered solves the problem of high computational overhead in animation rendering, achieving more efficient rendering and smoother animation display.
Patent Information
- Application Number
- CN202511632300.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-02-27
AI Technical Summary
In existing technologies, rendering each frame of an image during animation processing results in significant computational overhead, impacting animation rendering efficiency.
By responding to the swiping operation on the display interface, the screen swiping distance and resolution are obtained, the image frames to be rendered are determined, and only these image frames are rendered to generate the rendering animation.
It reduces the number of image frames rendered, lowers the computational overhead of animation rendering, and improves rendering efficiency and animation smoothness.
Smart Images

Figure CN121582415A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the field of animation processing, and in particular, to an animation processing method and device, an electronic device, a storage medium, and a chip. BACKGROUND
[0002] An animation is composed of a plurality of image frames, and the animation is displayed more smoothly by rendering the image frames.
[0003] In related technologies of animation processing, each image frame in an animation is usually rendered, resulting in a large calculation overhead of animation rendering. SUMMARY
[0004] The present disclosure provides an animation processing method and device, an electronic device, a storage medium, and a chip to solve the problems in related technologies.
[0005] A first aspect embodiment of the present disclosure provides an animation processing method, which includes: In response to a sliding operation on a display interface, obtaining a screen sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation; Determining a to-be-rendered image frame in the image frames according to the screen sliding distance and the resolution; Performing rendering processing on the to-be-rendered image frame to obtain a rendered animation, and displaying the rendered animation on the display interface.
[0006] In some embodiments, the determining the to-be-rendered image frame in the image frames according to the screen sliding distance and the resolution includes: Obtaining a sliding direction of the screen sliding distance; Determining an interface length of the display interface according to the sliding direction and the resolution; Determining the to-be-rendered image frame in the image frames according to the screen sliding distance and the interface length.
[0007] In some embodiments, the determining the interface length of the display interface according to the sliding direction and the resolution includes: Obtaining a direction resolution of at least two directions in the resolution; Determining a target direction resolution consistent with the sliding direction in the direction resolution of the at least two directions as the interface length.
[0008] In some embodiments, the determining the to-be-rendered image frame in the image frames according to the screen sliding distance and the interface length includes: acquire a preset intersection length of the image frames; the preset intersection length is a length of an overlapping area between two image frames; determine a rendering number of the image frames according to the picture sliding distance, the interface length and the preset intersection length; determine a to-be-rendered image frame in the image frames according to the rendering number.
[0009] In some embodiments, the determining the to-be-rendered image frame in the image frames according to the rendering number comprises: acquiring a first position of a first image frame and a second position of a last image frame in the image frames; determining the to-be-rendered image frame in the image frames according to the first position, the second position and the rendering number.
[0010] In some embodiments, the rendering processing of the to-be-rendered image frame to obtain a rendering animation comprises: splicing the to-be-rendered image frame according to the preset intersection length to obtain a spliced image frame; acquiring a display position of the image frames, and determining a display image frame of the display position according to the spliced image frame; combining the display image frame into the rendering animation according to the display position.
[0011] In some embodiments, the splicing the to-be-rendered image frame according to the preset intersection length to obtain a spliced image frame comprises: performing overlapping processing on the to-be-rendered image frame according to the preset intersection length to obtain an overlapping area of the to-be-rendered image frame; performing difference degree calculation on the overlapping area to obtain a difference degree value of different positions in the overlapping area; splicing the to-be-rendered image frame according to the difference degree value to obtain the spliced image frame.
[0012] In some embodiments, the splicing the to-be-rendered image frame according to the difference degree value to obtain the spliced image frame comprises: determining a position corresponding to a minimum value in the difference degree value as a splicing position; splicing the to-be-rendered image frame according to the splicing position to obtain a spliced image frame.
[0013] A second aspect embodiment of the present disclosure provides an animation processing device, the device comprising: an acquisition unit, configured to acquire a picture sliding distance of a display interface, a resolution of the display interface and a plurality of image frames displayed on the display interface during a sliding operation on the display interface in response to the sliding operation. determining, according to the screen sliding distance and the resolution, a to-be-rendered image frame in the image frames; rendering, by a processing unit, the to-be-rendered image frame to obtain a rendered animation, and displaying the rendered animation on the display interface.
[0014] In some embodiments, the determining unit comprises: an obtaining module configured to obtain a sliding direction of the screen sliding distance; a first determining module configured to determine, according to the sliding direction and the resolution, an interface length of the display interface; The first determining module is further configured to determine, according to the screen sliding distance and the interface length, a to-be-rendered image frame in the image frames.
[0015] In some embodiments, the first determining module is further configured to: obtain a direction resolution of at least two directions in the resolution; determine, as the interface length, a target direction resolution in the direction resolutions that is consistent with the sliding direction.
[0016] In some embodiments, the first determining module is further configured to: obtain a preset intersection length of the image frames; the preset intersection length is a length of an overlapping area between two image frames; determine, according to the screen sliding distance, the interface length and the preset intersection length, a rendering number of the image frames; determine, according to the rendering number, a to-be-rendered image frame in the image frames.
[0017] In some embodiments, the first determining module is further configured to: obtain a first position of a first frame and a second position of a last frame in the image frames; determine, according to the first position, the second position and the rendering number, a to-be-rendered image frame in the image frames.
[0018] In some embodiments, the processing unit comprises: a splicing module configured to splice, according to the preset intersection length, the to-be-rendered image frame to obtain a spliced image frame; a second determining module configured to obtain a display position of the image frames, and determine, according to the spliced image frame, a display image frame of the display position; a combining module configured to combine, according to the display position, the display image frame into the rendered animation.
[0019] In some embodiments, the splicing module is further configured to: According to the preset intersection length, the image frames to be rendered are subjected to an overlap processing, to obtain an overlap region of the image frames to be rendered; The overlap region is subjected to a difference degree calculation, to obtain a difference degree value of different positions in the overlap region; According to the difference degree value, the image frames to be rendered are spliced, to obtain the spliced image frames.
[0020] In some embodiments, the splicing module is further configured to: The position corresponding to the minimum value in the difference degree value is determined as a splicing position; According to the splicing position, the image frames to be rendered are spliced, to obtain the spliced image frames.
[0021] A third aspect embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect embodiment of the present disclosure.
[0022] A fourth aspect embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to perform the method described in the first aspect embodiment of the present disclosure.
[0023] A fifth aspect embodiment of the present disclosure provides a chip, comprising one or more interfaces and one or more processors; the interface is used to receive a signal from a memory of an electronic device and send a signal to the processor, and the signal comprises computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device performs the method described in the first aspect embodiment of the present disclosure.
[0024] In summary, according to the animation processing method provided by the present disclosure, the method comprises: in response to a sliding operation on a display interface, obtaining a screen sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation; determining image frames to be rendered in the image frames according to the screen sliding distance and the resolution; rendering only the image frames to be rendered to obtain a rendered animation; and displaying the rendered animation on the display interface. This avoids rendering all image frames, reduces the number of image frames required for rendering, and thus reduces the computational overhead of animation rendering.
[0025] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF DRAWINGS
[0026] The accompanying drawings, which are incorporated herein and constitute part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, function to explain the principles of the disclosure, but do not limit the disclosure.
[0027] Figure 1 A flowchart of an animation processing method provided for an embodiment of the present disclosure; Figure 2 A flowchart of another animation processing method provided for an embodiment of the present disclosure; Figure 3 A flowchart of another animation processing method provided for an embodiment of the present disclosure; Figure 4 A flowchart of another animation processing method provided for an embodiment of the present disclosure; Figure 5 A flowchart of another animation processing method provided for an embodiment of the present disclosure; Figure 6 A flowchart of a whole process of animation processing provided for an embodiment of the present disclosure; Figure 7 A display diagram of an image frame to be rendered provided for an embodiment of the present disclosure; Figure 8 A structural schematic diagram of an animation processing apparatus provided for an embodiment of the present disclosure; Figure 9 A structural schematic diagram of another animation processing apparatus provided for an embodiment of the present disclosure; Figure 10 A structural schematic diagram of an electronic device provided for an embodiment of the present disclosure; Figure 11 A structural schematic diagram of a chip provided for an embodiment of the present disclosure; Figure 12 A structural schematic diagram of another chip provided for an embodiment of the present disclosure. DETAILED DESCRIPTION
[0028] Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, examples of which are shown in the drawings, wherein the same or similar notations represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to explain the present disclosure, and cannot be understood as limiting the present disclosure.
[0029] An animation is composed of image frames one by one, and the rendering of the image frames makes the animation display more smooth.
[0030] In the related art of animation processing, each image frame of the animation is usually rendered, resulting in a large calculation overhead of animation rendering.
[0031] Therefore, in order to solve the problems in the related art, the present disclosure proposes an animation processing method, by responding to a sliding operation on a display interface, obtaining a screen sliding distance of the display interface, a resolution of the display interface and a plurality of image frames displayed on the display interface in a sliding operation process, determining a to-be-rendered image frame in the image frames according to the screen sliding distance and the resolution, rendering only the to-be-rendered image frame, obtaining a rendered animation, and displaying the rendered animation on the display interface, avoiding rendering all image frames, reducing the number of required rendered image frames, and thus reducing the computational overhead of animation rendering.
[0032] The embodiments of the present disclosure are not exhaustive, but only illustrate some embodiments, and are not specific limitations on the protection scope of the present disclosure. In the case of no contradiction, each step in an embodiment can be implemented as an independent embodiment, and the steps can be combined arbitrarily, for example, the scheme after removing some steps in an embodiment can also be implemented as an independent embodiment, and the order of the steps in an embodiment can be exchanged arbitrarily, in addition, the optional implementation manners in an embodiment can be combined arbitrarily; in addition, the embodiments can be combined arbitrarily, for example, some or all steps of different embodiments can be combined arbitrarily, an embodiment can be combined with optional implementation manners of other embodiments. In the embodiments of the present disclosure, the terms and / or descriptions of the embodiments are consistent and can be referred to each other if there is no special description and logical conflict, and the technical features in different embodiments can be combined to form new embodiments according to their inherent logical relationship. The terms used in the embodiments of the present disclosure are only for the purpose of describing the specific embodiments, and not as a limitation on the present disclosure. In the embodiments of the present disclosure, unless otherwise specified, the elements expressed in singular form, such as "one", "a", "the", "above", "said", "preceding", "this" and the like, can represent "one and only one", or "one or more", "at least one" and the like. For example, in the case of using articles such as "a", "an", "the" and the like in English, the noun after the article can be understood as singular expression, or as plural expression. In some embodiments, the terms "in response to", "in response to determining", "in the case of", "when", "when", "if", "if" and the like can be replaced with each other. In some embodiments, the terms "greater than", "greater than or equal to", "not less than", "more than", "more than or equal to", "not less than", "higher than", "higher than or equal to", "not lower than", "above", and the like can be replaced with each other, and the terms "less than", "less than or equal to", "not greater than", "fewer than", "fewer than or equal to", "not more than", "lower than", "lower than or equal to", "not higher than", "below", and the like can be replaced with each other. The prefix words "first", "second", and the like in the embodiments of the present disclosure are merely used to distinguish different description objects, and do not constitute limitation on the position, order, priority, quantity, or content of the description objects. The description of the description objects should refer to the description in the context of the claims or embodiments, and should not constitute redundant limitation because of the use of the prefix words.
[0033] In the embodiments of the present disclosure, "a plurality of" means two or more. In the embodiments of the present disclosure, the terms "import", "input", "read in", and the like can be replaced with each other.
[0034] In some embodiments, the apparatus and the like can be interpreted as entities, and can also be interpreted as virtual, and the names thereof are not limited to the names recorded in the embodiments. The terms "apparatus", "equipment", "device", "circuit", "network element", "node", "function", "unit", "section", "system", "network", "chip", "chip system", "entity", "subject", and the like can be replaced with each other.
[0035] In some embodiments, the terms "terminal", "terminal device", "user equipment (UE)", "user terminal", "mobile station (MS)", "mobile terminal (MT)", subscriber station (subscriber station), mobile unit, subscriber unit, wireless unit, remote unit, mobile device, wireless device, wireless communication device, remote device, mobile subscriber station, access terminal, mobile terminal, wireless terminal, remote terminal, handset, user agent, mobile client, client, and the like can be replaced with each other. Figure 1 A flowchart of an animation processing method provided by an embodiment of the present disclosure is shown. The method can be applied to application scenarios such as intelligent terminals, and can be executed by a terminal or an animation processor in the terminal integrated with an animation processing function, or by other devices suitable for animation processing, which is not limited by the present disclosure. As shown in Figure 1 The animation processing method includes steps S101-S103. In step S101, in response to a sliding operation on a display interface, a picture sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation are acquired.
[0036] In embodiments of the present disclosure, the display interface refers to the area on the terminal that displays image content, including but not limited to smartphones, smartwatches, desktop computers, laptops, and tablets. The sliding operation refers to a continuous position change operation performed by the user on the display interface through an input device such as a touch screen, mouse, touchpad, etc. For example, scrolling through a long image on a smartphone screen by sliding left and right, or scrolling a page on a computer using a mouse. The picture sliding distance refers to the displacement of the display content in the display interface relative to the display interface during the sliding operation, usually measured in pixels (px). For example, if the user slides right on a screen with a resolution of 1920x1080, the display content moves left by 500px, and the picture sliding distance is 500px. The resolution of the display interface refers to the number of pixels in the horizontal, vertical, and other directions of the display interface, usually represented as "horizontal pixel count x vertical pixel count" (such as 1920x1080), reflecting the pixel density and size of the display interface. The horizontal resolution corresponds to the number of pixels in the horizontal direction, and the vertical resolution corresponds to the number of pixels in the vertical direction. An image frame refers to a sequence of original static pictures that make up the animated content to be displayed. During the sliding operation, these image frames are usually continuous and adjacent, such as a set of horizontally sliding cards, a set of page images for a long comic, or a set of offline cached snapshots for a continuous list. They are pre-loaded or stored in memory, waiting to be selected and rendered.
[0037] In embodiments of the present disclosure, the terminal receives the user's sliding operation through a touch screen, mouse, or other input device. The system needs to detect and record the following information: picture sliding distance: calculate the distance between the starting point and the ending point of the user's sliding operation, usually measured using the coordinate system of the touch screen. For example, if the user slides from the left side of the screen to the right side, the system can calculate the horizontal sliding distance. Display interface resolution: the system obtains the resolution information of the display device, usually through a hardware interface or the operating system to obtain the size and pixel count of the display screen. Resolution is one of the key factors affecting image display quality, and resolution determines the specific display method of each image frame on the display interface. Display image frame: during the user's sliding process, the system needs to detect and update the displayed image frame in real time.
[0038] By obtaining the sliding distance, resolution, and image frame in real time, it can be accurately determined which image frames need to be rendered, avoiding indiscriminate processing of all image frames, and reducing computational complexity from the source.
[0039] Step S102, determining the image frame to be rendered in the image frame according to the picture sliding distance and the resolution.
[0040] In embodiments of the present disclosure, the image frames to be rendered refer to the image frame set that needs to be rendered and displayed on the interface during the sliding operation, rather than all the image frames contained in the animation. For example, an animation composed of 10 frames may only need to render 3-4 frames to meet the display requirements during sliding.
[0041] In embodiments of the present disclosure, the system determines whether the sliding is in the horizontal direction (left and right) or the vertical direction (up and down). According to the sliding direction, the corresponding value is selected from the screen resolution as the interface length. For example, for left and right sliding, the width of the screen is the interface length; for up and down sliding, the height of the screen is the interface length. This value represents the size of "one screen" in the sliding direction. The system compares the sliding distance of the picture with the interface length. This ratio or relative relationship intuitively reflects how much content the user attempts to browse this time. For example, if the sliding distance is equal to the interface length, it means that the user wants to completely switch to the next screen (next page). In actual applications, in order to create a smooth visual transition, a preset intersection length (i.e., an overlapping area) is usually designed between adjacent image frames. This area makes part of the content of the two frames repeated. The system needs to consider this factor when calculating. The effective new content display area needs to subtract this overlapping part. Therefore, the actual number of new frames is determined by the ratio of the sliding distance to (the interface length minus the preset intersection length). Based on the above calculation, the system can determine how many new image frames are needed to meet the display requirements this time. For example, a short and fast sliding may only need to render part of an additional frame; while a long sliding gesture (such as quickly flipping through multiple pages) may need to determine multiple consecutive frames. The system then selects the corresponding number of subsequent (or front) frames in sequence from the loaded image frame sequence according to the position of the currently displayed frame (such as the position information of the first frame and the last frame), and marks them as image frames to be rendered.
[0042] By dynamically selecting the image frames to be rendered according to the sliding distance of the picture and the resolution, the system can avoid unnecessary image frame rendering, thereby reducing the consumption of computing resources and improving rendering efficiency.
[0043] Step S103, rendering the image frames to be rendered to obtain a rendered animation, and displaying the rendered animation on the display interface.
[0044] In embodiments of the present disclosure, rendering refers to the process of converting the selected image frames to be rendered into pixel pictures that can be displayed on the display interface. The rendered animation refers to the continuous image sequence that can be directly used for display after the above rendering process.
[0045] In embodiments of the present disclosure, the system first acquires a predefined preset intersection length (i.e. the width of the overlapping area between two pages). According to the overlapping area, the "current page", "next page" and "next-next page" are logically aligned and placed in an overlapping manner to form a virtual canvas wider than a single screen. Then, the system calculates the difference in the overlapping area. By comparing the color and data information of each pixel position in the overlapping part of the two frames of images, an optimal splicing position (i.e. the line with the smallest difference) is found. Along this line, the splicing can maximize the avoidance of harsh seams or visual misalignment, making the transition of the two frames of images seamless, like a coherent whole. After splicing, the system "cuts" out the part of the image that should be displayed in the screen view according to the specific display position of the current sliding (i.e. the sliding offset) from the synthesized virtual canvas. For example, at the beginning of the sliding, the screen displays the spliced image of the right half of the "current page" and the left half of the "next page"; as the sliding continues, the displayed content moves smoothly to the "next page". This dynamically determined image block for each display position is the display image frame. The above process generates corresponding display image frames for each moment of the animation. The system quickly sends these display image frames generated in time sequence and logically in position to the display buffer. The screen reads these continuously changing image frames from the buffer at a very high refresh rate (such as 60Hz, 90Hz or 120Hz) and presents them. In the user's view, this is a rendering animation with smooth scrolling of the content following the movement of the finger.
[0046] Only the display image frames are rendered, not all image frames, and the core rendering stage can dynamically adjust the detail intensity according to the sliding speed, avoiding redundant calculation of non-displayed frames.
[0047] In summary, in embodiments of the present disclosure, the animation processing method proposed by the present disclosure includes acquiring the screen sliding distance of the display interface, the resolution of the display interface and a plurality of image frames displayed on the display interface during the sliding operation of the display interface in response to the sliding operation of the display interface, determining the display image frames in the image frames according to the screen sliding distance and the resolution, rendering only the display image frames to obtain a rendering animation, and displaying the rendering animation on the display interface. This avoids rendering all image frames, reduces the number of image frames required for rendering, and thus reduces the computational overhead of animation rendering.
[0048] Figure 2 Further, a flowchart of an animation processing method proposed by the present disclosure is shown. Based on the embodiment shown in Figure 1 The step S102 is further explained, Figure 2 may include the following steps: Step S201, acquiring the sliding direction of the screen sliding distance.
[0049] In embodiments of the present disclosure, the sliding direction refers to the displacement direction of the display content relative to the interface when the user performs a sliding operation on the display interface.
[0050] In embodiments of the present disclosure, when the user's finger contacts the screen, the system starts to continuously capture and record the coordinate points of a series of touch events. These points are arranged in time sequence to form a track. The system selects a representative starting point (usually the initial point of the finger pressing) and an ending point (which can be the current moving point or the point of the finger lifting). The displacement difference in the horizontal direction (X-axis) from the starting point to the ending point is calculated, and the displacement difference in the vertical direction (Y-axis) is also calculated. The system compares the absolute value of the calculated horizontal displacement difference and the absolute value of the vertical displacement difference. In order to effectively avoid misjudgment (for example, the user intended to vertically scroll but the finger had a little natural horizontal jitter), a direction tolerance threshold is usually introduced. This threshold is an empirical value used to ensure that only when the displacement in a certain direction is significantly greater than the displacement in another direction, the direction is determined. If the horizontal displacement is much greater than the vertical displacement (exceeding the threshold), the sliding direction is determined to be horizontal; otherwise, if the vertical displacement is much greater than the horizontal displacement, the sliding direction is determined to be vertical. If the two displacement amounts are similar and neither exceeds the threshold, it is determined to be an invalid sliding or clicking operation. Once the determination is completed, the system outputs the direction result. However, it should be clear that this statement is not intended to limit the sliding mode to only horizontal and vertical directions, but can also be in other directions.
[0051] By accurately obtaining the sliding direction, the system can provide a more smooth interactive experience according to the user's intention.
[0052] Step S202, determining the interface length of the display interface according to the sliding direction and the resolution.
[0053] In embodiments of the present disclosure, the interface length refers to the size of the display interface in the direction along the sliding operation, in units of pixels, representing the maximum pixel range that the display interface can present in that direction. For example, when sliding horizontally, the interface length is the total number of horizontal direction pixels of the display interface; when sliding vertically, it is the total number of vertical direction pixels.
[0054] In embodiments of the present disclosure, the resolution of a display interface is usually represented in the form of "horizontal pixel number x vertical pixel number" (e.g., 1920 x 1080), where the "horizontal pixel number" represents the total number of pixels in the horizontal direction (left-right direction), and the "vertical pixel number" represents the total number of pixels in the vertical direction (up-down direction). For example, in the resolution "2560 x 1440", the horizontal pixel number is 2560 (horizontal direction), and the vertical pixel number is 1440 (vertical direction). Based on the sliding direction (horizontal or vertical), the matching component is selected from the two directional components of the resolution as the interface length: if the sliding direction is horizontal (left or right sliding), the "horizontal pixel number" in the resolution is determined as the interface length. For example, when sliding horizontally, the interface length corresponding to the resolution 1920 x 1080 is 1920 pixels (the maximum display range in the horizontal direction); if the sliding direction is vertical (up or down sliding), the "vertical pixel number" in the resolution is determined as the interface length. For example, when sliding vertically, the interface length corresponding to the resolution 1920 x 1080 is 1080 pixels (the maximum display range in the vertical direction). The pixel number obtained by matching (horizontal or vertical) is taken as the final interface length. However, it should be clear that this statement is not intended to limit the sliding direction to only horizontal or vertical, and it is not intended to limit the resolution to only contain horizontal pixel numbers and vertical pixel numbers, but it can also contain pixel numbers in other directions.
[0055] By locking the only relevant resolution component in the sliding direction, the dimension data irrelevant to the sliding direction does not need to be processed, thereby reducing the redundant steps of data analysis and calculation.
[0056] In step S203, a to-be-rendered image frame in the image frame is determined according to the picture sliding distance and the interface length.
[0057] In embodiments of the present disclosure, the system compares the slide distance with the interface length. For example, the slide distance is 2.8 times the interface length, which intuitively indicates that the user wants to view new content more than two screens but less than three screens. In order to achieve smooth transition, there is usually a preset intersection length (i.e. overlap area) between adjacent image frames. The system needs to consider this factor when calculating. The effective new content display area is the interface length minus the length of the overlap. The system divides the slide distance by the effective interface length to obtain a calibrated and more accurate value, which more truly reflects the number of new image frames that need to be introduced. The calibrated value is rounded up as necessary (e.g. up to the nearest integer) to determine the rendering number in integer form. This number explicitly indicates how many new frames are needed for the slide animation to meet the visual continuity. The system obtains the position information (such as the index number) of the first and last frames in the current image frame sequence. According to the slide direction (forward or backward) and the calculated rendering number, the corresponding number of image frames are sequentially selected from the end (or beginning) of the current sequence. For example, if the current display is to the 5th picture (the last frame) and the rendering number is 3, the system will determine the 6th, 7th and 8th pictures as the image frames to be rendered in this slide.
[0058] By accurately rendering image frames according to the slide distance and the interface length, the system can ensure smooth display of images and avoid delays, stalls or visual discomfort for the user when sliding.
[0059] As a refinement of step S202, when performing the step of determining the interface length of the display interface according to the slide direction and the resolution, the following implementation can be used but is not limited thereto, including: obtaining the direction resolution of at least two directions in the resolution; determining the target direction resolution consistent with the slide direction as the interface length from the direction resolution of the at least two directions.
[0060] In embodiments of the present disclosure, the direction resolution refers to the number of pixels of the display interface in a specific spatial direction, which is a basic component of the total resolution of the display interface. For example, the direction resolutions corresponding to the horizontal and vertical directions are the number of horizontal pixels and the number of vertical pixels, respectively. However, it should be clear that the direction resolution can include any other direction resolution in addition to the horizontal resolution and the vertical resolution. The target direction resolution refers to the resolution of the direction consistent with the slide direction selected from the direction resolution of at least two directions.
[0061] In the embodiments of the present disclosure, after the direction of the user sliding is obtained, the system selects the direction resolution consistent with the sliding direction from the acquired resolutions as the target direction resolution. For example, if the sliding direction is horizontal, the resolution of the horizontal direction is selected as the target direction resolution. If the sliding direction is vertical, the resolution of the vertical direction is selected as the target direction resolution. The target direction resolution corresponds to the effective display area length of the user sliding operation, that is, the interface length affected by the sliding operation. Finally, the system determines the interface length according to the target direction resolution. The interface length refers to the area length that can be slid by the user, which is consistent with the target direction resolution. For example, if the user performs horizontal sliding, the interface length is equal to the horizontal direction resolution. The embodiments of the present disclosure only take the landscape and portrait as examples, and do not represent that the direction is only the landscape and portrait. In actual application, the sliding direction can be any direction.
[0062] By acquiring the direction resolutions of at least two directions and combining the sliding direction to determine the interface length, the system can adapt to devices with different resolutions and sliding directions.
[0063] Figure 3 Further, a flowchart of an animation processing method is shown. Based on the embodiment shown in Figure 2 The step S203 is further explained, Figure 3 may include the following steps: In step S301, a preset intersection length of the image frame is acquired; the preset intersection length is the length of the overlapping area between two image frames.
[0064] In the embodiments of the present disclosure, the preset intersection length refers to a predefined value, and the preset intersection length specifies the length of the overlapping area between adjacent two frames in a continuous image frame sequence. The overlapping area refers to the intersection part of the pixel range of two adjacent image frames in the sliding direction, that is, the area in which the same pixel position exists in the previous frame and the next frame. For example, the pixel range of the first frame arranged in the landscape is 0-1080px, and the pixel range of the second frame is 880-1880px. The pixels in the range of 880-1080px of the two frames completely overlap, and the range is the overlapping area.
[0065] In the embodiments of the present disclosure, the preset intersection length can be predefined by a user experience designer or a developer according to the expected animation visual effect. The preset intersection length is directly written in the configuration file of the application program or the constant definition part of the program. When the animation processing flow is started, the system only needs to simply read the configuration value from this fixed storage location.
[0066] By setting the preset intersection length of the image frame, the system can ensure that the transition between the image frames is smoother.
[0067] Step S302, determining the rendering quantity of the image frame according to the picture sliding distance, the interface length and the preset intersection length.
[0068] In the embodiments of the present disclosure, the rendering quantity refers to the specific number of image frames (such as 2 frames, 3 frames, etc.) that need to be rendered during the sliding operation to ensure the continuity and integrity of the animation on the display interface. It is a value calculated based on the sliding amplitude, the interface size and the inter-frame overlapping relationship, rather than a fixed value or the number of all frames.
[0069] In the embodiments of the present disclosure, after the sliding operation, the total range that the display interface needs to cover includes two parts: one is the length of the interface itself (the basic display range), and the other is the additional displacement range (the picture sliding distance) caused by the sliding. Therefore, the total coverage range = interface length + picture sliding distance. For example, the interface length is 1080px (horizontal sliding, screen horizontal resolution 1080px), and the picture sliding distance of the user sliding to the right is 500px (the display content is displaced to the left by 500px), so the total coverage range is 1080px + 500px = 1580px (that is, the interface needs to cover 1580px of the pixel range to completely display the content after sliding). Calculate the "effective contribution length" of a single frame in the sliding direction. Since there is a preset intersection length (overlapping area) between adjacent image frames, the "non-overlapping pixel length" (that is, the effective contribution length) that each newly added frame can actually contribute to the total coverage range = the size of a single frame in the sliding direction - the preset intersection length. Among them, the "single frame size" is usually consistent with the interface length (such as horizontal frame size = horizontal interface length 1080px), which ensures that a single frame can fill the interface. For example, the horizontal size of a single frame is 1080px (consistent with the interface length), and the preset intersection length is 200px (adjacent frames overlap by 200px), so the effective contribution length of each frame is 1080px - 200px = 880px (that is, each newly added frame can cover an additional 880px of non-overlapping range). Based on the principle of "minimum frame number covering the total range", divide the total coverage range by the effective contribution length of a single frame to obtain the required rendering quantity (if the result is a decimal, round up to ensure that the total range is completely covered). For example, the total coverage range is 1580px, and the effective contribution length of a single frame is 880px: the effective coverage range of 1 frame is 880px (insufficient for 1580px); the effective coverage range of 2 frames is 880px + 880px = 1760px (can cover 1580px); therefore, the rendering quantity is determined to be 2 frames.
[0070] The determination of the rendering quantity takes into account both the minimum frame and the full coverage, while reducing the load, ensuring that every pixel of the display interface during the sliding process is covered by a corresponding rendering frame, avoiding picture breakage caused by insufficient frames, and ensuring the visual coherence of the animation.
[0071] Step S303: determining the to-be-rendered image frame in the image frame according to the rendering quantity.
[0072] In an embodiment of the present disclosure, the system first acquires and locks the logical range of the complete image frame sequence corresponding to the current animation, which is determined by the first position of the first frame and the second position of the last frame. This makes the total pool of frames available for selection clear. The system adopts a uniform sampling strategy. The core of this strategy is to regard the entire frame sequence as a continuous interval and divide this interval into several subintervals of equal or approximately equal length according to the rendering quantity.
[0073] In each subinterval, the system selects a representative image frame as the to-be-rendered image frame. A common way is to select the frame corresponding to the starting point, midpoint, or endpoint of each subinterval as the sampling point. In this way, the selected frames can be evenly distributed in the time dimension, thereby maximizing the preservation of the timing characteristics and motion continuity of the original animation. By traversing all subintervals, all selected sampling frames are collected, thereby forming an ordered set of to-be-rendered image frames with a quantity equal to the rendering quantity.
[0074] The to-be-rendered image frame can be dynamically adjusted according to the rendering quantity and the playback progress, thereby avoiding meaningless rendering and resource waste, improving rendering efficiency, and optimizing the utilization of system resources.
[0075] As a refinement of step S303, when performing the determination of the to-be-rendered image frame in the image frame according to the rendering quantity, the following implementation methods can be adopted but are not limited thereto, including: acquiring the first position of the first frame and the second position of the last frame in the image frame; and determining the to-be-rendered image frame in the image frame according to the first position, the second position, and the rendering quantity.
[0076] In an embodiment of the present disclosure, the first position of the first frame refers to the position of the first image frame in the image frame sequence, which usually corresponds to the start time of the playback sequence. The first position of the first frame is a key reference point for determining the rendering progress. The second position of the last frame refers to the position of the last image frame in the image frame sequence, which usually corresponds to the end time of the playback sequence. The second position of the last frame is used to determine the termination point of the playback and the range of the rendering region.
[0077] In embodiments of the present disclosure, the system reads the start point and end point information of the image frame sequence corresponding to the current sliding animation by accessing the data structure of the animation image frame sequence. Specifically: the system queries and obtains the identifier (for example, index number 0 or start time stamp 0 ms) of the sequence start frame from the memory unit storing the sequence metadata. The system queries and obtains the identifier (for example, index number N or end time stamp T ms) of the sequence end frame from the same storage unit. After obtaining the sequence boundary (first position, second position) and the rendering number, the system performs a uniform sampling algorithm to determine the frames to be rendered. The design and execution of the algorithm do not depend on any specific numerical example, and the process is as follows: the system first calculates the total number of frames or the total time span contained from the first position to the second position. This defines the total range of sampling. The system divides the total length calculated above by the rendering number to obtain a sampling interval (or step). This interval determines how far apart to select a frame for rendering in the sequence. The system takes the first position as the starting point and the calculated sampling interval as the step size to generate a series of sampling points (position coordinates or time points) in the sequence total range. Each sampling point corresponds to an image frame that needs to be selected. The system maps these sampling points back to the complete image frame sequence, and according to the position information of each sampling point, locates and extracts the corresponding image frame from the sequence. The set of all these extracted frames is the final determined "image frames to be rendered".
[0078] By obtaining the first position of the first frame and the second position of the last frame, the system can accurately control the rendering area and ensure that only necessary image frames are rendered, thereby improving rendering efficiency.
[0079] Figure 4 Further, a flowchart of an animation processing method is shown. Based on the embodiment shown in Figure 1 Step S103 is further explained, Figure 4 may include the following steps: Step S401, according to the preset intersection length, the image frames to be rendered are spliced to obtain a spliced image frame.
[0080] In embodiments of the present disclosure, the spliced image frame refers to a single continuous image frame obtained by aligning the overlap area according to the preset intersection length, eliminating transition traces, and synthesizing all the image frames to be rendered.
[0081] In embodiments of the present disclosure, the system first reads the parameter value of the preset intersection length. For each pair of adjacent image frames to be rendered, the system calculates the size of the region that needs to overlap with the next frame based on the end portion of the previous frame according to the preset intersection length. Then, the system spatially aligns the start portion of the next frame with the end portion of the previous frame according to the calculated overlap size to form an overlapping region between the two frames. This alignment process ensures that the two frames can accurately correspond in content. After forming the overlapping region, the system performs detailed image analysis on the region. This process is achieved by comparing the color values, brightness values, or texture features of corresponding pixel points in the two image frames in the overlapping region. The system calculates the degree of difference of each corresponding pixel point through a specific image processing algorithm and generates a difference distribution map reflecting the consistency of the two frames in the region. This analysis provides data support for determining the optimal splicing position. The system processes the obtained difference distribution data to find the region or feature line with the smallest difference. The position corresponding to this smallest difference is considered as the optimal splicing position because the content of the two frames at this position is the closest and the visual mutation after splicing is the smallest. After determining the optimal splicing position, the system cuts the end portion of the previous frame and the start portion of the next frame at this position and fuses the two portions into a continuous image.
[0082] By splicing the image frames to be rendered and fusing them using the preset intersection length, the system can eliminate the abrupt edges between frames and achieve a smooth and continuous display effect.
[0083] Step S402, obtain the display position of the image frame, and determine the display image frame of the display position according to the spliced image frame.
[0084] In embodiments of the present disclosure, the display position of the image frame refers to the specific position of the image frame on the screen during image display. The display image frame refers to a pixel region precisely cut from the spliced image frame that completely matches the display position, and its size strictly matches the resolution of the display interface. It is the real-time picture unit finally presented on the display interface and directly determines the content of user visual perception.
[0085] In embodiments of the present disclosure, the system accesses a database or configuration file storing animation timing information to obtain display position information of each original image frame constituting a complete animation. These information constitutes a complete timeline or spatial sequence of the animation playback. The system parses and sorts these display position information to establish a complete display position sequence, explicitly specifying the order and time interval of each position in the animation playback process. After obtaining the complete display position sequence, the system performs a matching mapping process of splicing image frames and display positions: the system analyzes the range of original frames covered by each splicing image frame (i.e. which original frames are spliced to form the splicing frame), and establishes the correspondence between the splicing frame and the display position. Each display position is mapped to one or more splicing image frames. For each display position, the system determines which splicing image frame should be used to extract display content according to its specific position in the position sequence. For display positions located in the central region of the splicing frame, the corresponding part of the splicing frame is directly used as the display image frame; for display positions located in the transition region of multiple splicing frames, the system will mix and extract content from multiple splicing frames according to the position weight. According to the determined content extraction strategy, the system extracts the appropriate region content from the corresponding splicing image frame to generate the final display image frame of the display position.
[0086] It is ensured that each display position can obtain the optimal image content, especially in the splicing transition region, the system can provide smooth content mixing, thereby presenting a high-consistency visual output quality in the final animation, enhancing the user's viewing experience.
[0087] Step S403: combining the display image frames into the rendered animation according to the display positions.
[0088] In the embodiments of this disclosure, the system first performs a comprehensive timing analysis of all display position information. By parsing the timestamp or sequence number information of each display position, the system establishes a complete animation timeline, clarifying the sequential order and interval relationship of each display position in the time dimension. This stage provides an accurate time reference for subsequent frame sequence assembly. After establishing the complete timeline, the system executes an ordered assembly process of display image frames. This process is implemented as follows: the system precisely places each display image frame into the corresponding position on the timeline according to its associated display position information. This matching process ensures that each frame can be called and displayed at the correct time point. The system detects the continuity of the frame sequence between adjacent display positions. For positions with large time intervals, appropriate transition effects or tweening frames are automatically inserted to ensure the smoothness of animation playback. The system performs an integrity check on the assembled frame sequence to ensure that all display positions have corresponding display image frames and that the entire sequence is continuous and complete in the time dimension. The system loads the assembled frame sequence into a dedicated output buffer and configures an appropriate buffering strategy to adapt to the refresh rate and performance characteristics of the target display device. Based on the complexity of the final animation and the performance metrics of the target platform, the system automatically optimizes rendering parameters, including frame rate, resolution, and color depth, to ensure smooth playback on various devices. The system then encapsulates the optimized frame sequence into a standard animation format and delivers it to the display system for final rendering and playback.
[0089] By controlling the display position of image frames, the system can generate smooth and natural rendering animations, avoiding screen jitter or stuttering and improving the visual experience.
[0090] Figure 5 A flowchart of an animation processing method proposed in this disclosure is further shown. Based on Figure 4 The illustrated embodiment further explains step S401. Figure 5 This may include the following steps: Step S501: According to the preset intersection length, the image frames to be rendered are overlapped to obtain the overlapping area of the image frames to be rendered.
[0091] In the embodiments of this disclosure, the overlap processing refers to the arrangement of two adjacent image frames with partial overlap according to a preset intersection length, so that a transition area with a certain degree of overlap is formed between the two frames.
[0092] In embodiments of the present disclosure, the system first analyzes the sliding direction of the image frame sequence to determine the spatial orientation of the overlap processing. For horizontal sliding, the overlap processing is performed in the horizontal direction; for vertical sliding, the processing is performed in the vertical direction. According to the sliding direction and the preset intersection length, the system calculates the specific area range of each image frame that needs to overlap with the adjacent frame. Taking the end part of the previous frame as the reference, the system marks the image area that needs to overlap with the next frame. The system aligns the start part of the next frame with the marked area of the previous frame. This alignment process ensures that the contents of the two frames in the overlap area can achieve accurate spatial or temporal correspondence, laying the foundation for subsequent processing. After completing the inter-frame alignment, the system accurately identifies the overlap area formed: the system accurately delineates the boundary range of the overlap area and clearly defines the corresponding position and size of the area in the two image frames. The processed overlap area information is output in a standardized data format.
[0093] By introducing the overlap area between image frames, the system can achieve smooth visual transition and avoid abrupt switching between image frames.
[0094] Step S502, difference degree calculation is performed on the overlap area to obtain the difference degree value of different positions in the overlap area.
[0095] In embodiments of the present disclosure, difference degree calculation refers to comparing and analyzing each position in the overlap area to calculate the difference of the position in the two adjacent image frames. The difference degree value reflects the visual difference between the image frames at that position, and is usually used to evaluate the smoothness and naturalness of the transition. The difference degree value is the result of difference degree calculation, representing the visual difference of the image frames at a certain position in the overlap area. A smaller difference degree value means that the transition at that position is smoother, while a larger difference degree value may mean that the transition is not natural or there is a significant visual break.
[0096] In embodiments of the present disclosure, the pixel data of the front frame and the back frame in the overlapping area is read and converted into the same pixel format. A Gaussian filter algorithm is used to remove noise from the front frame and the back frame in the overlapping area. For example, for each pixel, the average value of the 3x3 pixel area around it is taken as the new value of the pixel to filter isolated noisy pixels caused by hardware acquisition errors or compression distortion, avoiding such noise interference with the difference calculation result. According to the size of the overlapping area and the accuracy requirement, the overlapping area is divided into several calculation units. If high accuracy is pursued (e.g. fine texture scene), a single pixel can be used as a unit. If efficiency is pursued (e.g. large size overlapping area), a 3x3 or 5x5 pixel rectangular area can be used as a unit (the feature value of all pixels in the unit is averaged). The division of the unit can balance the calculation accuracy and efficiency, avoiding excessive calculation of a single pixel or loss of detailed differences caused by a large unit. The selection of the visual feature dimension directly determines whether the difference value can reflect the "difference perceived by the user". The features sensitive to the human eye should be selected first. Specifically, color is the most intuitive difference between frames and needs to be calculated for three channels (red, green, and blue). For each calculation unit, the average values of the front frame and the back frame in the red, green, and blue channels are extracted. The channel difference is used as the basis for color difference (i.e. the difference between the back frame value and the front frame value in the same channel), ensuring that the sensitive range of the human eye to color changes is covered (e.g. a small difference in the red channel can be perceived). Luminance is a key supplementary feature that affects visual continuity, especially in scenes with light-dark transitions (e.g. panoramic pictures from bright to dark): the three channel values are converted to luminance values; the luminance difference between the front frame and the back frame in the same calculation unit is calculated as an auxiliary difference dimension, avoiding stitching marks caused by similar colors but large luminance differences (e.g. the same color but the front frame is bright and the back frame is dark). The weight of the color difference is set to 70% and the weight of the luminance difference is set to 30%, ensuring that the difference value reflects the color difference that is most easily perceived by the user, while also considering the luminance consistency. According to the logic of calculation unit → feature dimension → quantized difference, all positions in the overlapping area are traversed to obtain the difference value of each position. Specifically, each calculation unit in the overlapping area is processed in order according to the horizontal or vertical overlapping area sequence to ensure that there is no omission or repetition. For a single calculation unit, the original difference values of the color difference and the luminance difference are calculated first (e.g. the original color difference value is 10 and the original luminance difference value is 5), then the comprehensive difference value is calculated according to the preset weight (color 70%, luminance 30%), and finally the comprehensive difference value is mapped to the standard interval of 0~100 (e.g. the comprehensive difference value is 8, which is mapped to 8, and the upper limit is 100 when the comprehensive difference value is 120), obtaining the difference value of the calculation unit (corresponding to a position in the overlapping area).Bind the coordinate position of each difference value in the overlapping area (such as x=890px of the horizontal overlapping area and y=500px of the vertical overlapping area) to form a corresponding table of position-difference value (such as x=880px→5, x=881px→6, …, x=1080px→4) to ensure that the position with the minimum difference can be quickly located subsequently. The difference value obtained by the original calculation may have "abnormal fluctuations" (such as local high value caused by noise residue), which needs to be optimized to ensure that the data is continuous and reliable. Specifically, set a "reasonable difference range" (such as 0~60, and more than 60 is regarded as abnormal), and replace the difference value (such as 90 caused by noise that is not completely filtered) that exceeds the range with the average value of the difference values of the three adjacent calculation units to avoid the influence of abnormal values on the subsequent splicing position judgment (such as mistakenly taking the noise position as the position with the maximum difference). Use the "neighborhood average method" to smooth all difference values. For the difference value of each position, take the average value of the difference values of the four adjacent positions as the final value to eliminate local "jump" (such as a position value of 5 and an adjacent position value of 20), so that the change trend of the difference value is more continuous and meets the natural logic of the transition between frames (such as the transition of panoramic scenes will not suddenly increase the difference). Store the "position-difference value" corresponding table after optimization to the system cache and establish a "difference value sorting index" (such as sorting according to the difference value from small to large and associating the corresponding position) to facilitate the quick query of the position corresponding to the minimum difference value in the subsequent steps and reduce the search time.
[0097] Through the difference calculation, the system can identify and optimize the position with large difference between image frames, so as to ensure that the transition in the overlapping area is more smooth and natural and avoid the discordance or jarring feeling in the animation.
[0098] In step S503, the image frame to be rendered is spliced according to the difference value to obtain the spliced image frame.
[0099] In the embodiments of the present disclosure, the system embeds a stitching decision unit in the video memory controller, which shares the same cache address with the difference value calculation pipeline. When the difference value sequence is generated, the decision unit immediately searches for the minimum value in the sequence and takes the pixel corresponding to the minimum value as the reference to expand a fixed guard band above and below to form a horizontal stitching band. The pixels in the guard band are sent to the hardware blending module, which performs gradient weighting on the two frames of pixels by row: at the upper edge of the stitching band, the previous frame has a full weight and the next frame has a zero weight; inside the stitching band, the weight linearly transitions row by row; and at the lower edge, the weights of the two frames are exchanged. The weighted pixel rows are written back to the video memory in real time to cover the original overlapping area and form a gradient transition band that cannot be detected by the naked eye. After blending is completed, the decision unit triggers address remapping to combine the pixels above the upper edge of the previous frame stitching band, the pixels below the lower edge of the next frame stitching band, and the gradient transition band itself into a continuous address pixel block, which is the stitched image frame.
[0100] When stitching the image frames, the calculation of the difference value can ensure seamless connection between the image frames and enhance the continuity of the animation or image sequence.
[0101] As a refinement of step S503, when performing the stitching of the to-be-rendered image frames according to the difference value to obtain the stitched image frame, the following implementation, but not limited to, can be adopted, including: determining the position corresponding to the minimum value in the difference value as the stitching position; and stitching the to-be-rendered image frames according to the stitching position to obtain the stitched image frame.
[0102] In the embodiments of this disclosure, the system comprehensively analyzes the acquired difference value data to determine the optimal stitching position. First, the system scans all difference values within the entire overlapping area and identifies the minimum values. These minimum values represent the positions where the matching degree between the two image frames is highest. Next, the system performs cluster analysis on these minimum values to find the most concentrated regional clusters. Within these regional clusters, the system further selects the point with the absolute minimum difference value as the final stitching position. This selection process ensures that the stitching position is not only locally optimal but also located in an area with high overall matching quality, providing the best foundation for subsequent stitching. After determining the optimal stitching position, the system performs precise image stitching processing. The system uses the stitching position as a boundary line to cut and combine the two image frames to be rendered. On one side of the stitching position, the system uses the content of the first image frame; on the other side, it uses the content of the second image frame. To ensure a natural transition at the stitching point, the system sets a gradient blending region around the stitching position. Within this region, the content of the two image frames is smoothly blended with a gradual in-and-out motion centered on the stitching position. The blending intensity is dynamically adjusted based on the distance from the splicing position. The closer the area is to the splicing position, the greater the blending intensity, thus ensuring a natural and smooth visual transition.
[0103] By selecting the position with the smallest difference value as the stitching point, the smoothness of the transition between image frames can be significantly improved. The position corresponding to the smallest difference value usually provides the best visual connection point, making the stitched image frames more natural, and the transition area no longer appears abrupt or discontinuous.
[0104] In the embodiments of this disclosure, in order to facilitate a better understanding of the entire animation processing process, such as Figure 6 As shown, Figure 6 This is a flowchart illustrating the entire animation processing process provided in this embodiment. Based on the user's swipe operation, the swipe distance T (i.e., screen swipe distance) and swipe direction θ are calculated; the total number of displayed frames N is calculated; based on the swipe distance T and the GUI resolution, along the swipe direction θ, the minimum number of interfaces (i.e., keyframes) K (i.e., the number of renders) to be rendered is calculated. To facilitate a better understanding of the minimum number of interfaces to be rendered, as... Figure 7 As shown, Figure 7For the display of a to-be-rendered image frame provided by the embodiment of the present disclosure, taking a total distance of 900 pixels, an interface length of 300 pixels, and a minimum interface distance (i.e., a preset intersection length) of 50 pixels as an example. At least K=4 frames of interfaces need to be rendered. For each two interfaces, there is a 50-pixel interval. For the last interface, the entire 900-pixel range needs to be covered, and therefore there is a 150-pixel interval with the previous frame. For each two key frame interfaces, the image difference value of the interface part is calculated to obtain a difference image I. The L1 loss (i.e., the difference value) of each row is calculated by traversing each row of the difference image I, and the row with the minimum loss is taken as the interface for splicing adjacent key frames. The position of each frame for display is calculated according to the total number of frames for display. The two key frames before and after the position are obtained, splicing is performed at the splicing interface, and then the result is sent for display.
[0105] Corresponding to the animation processing method described above, the present application also provides an animation processing device. Since the device embodiment of the present application corresponds to the method embodiment described above, the details not disclosed in the device embodiment can be referred to the method embodiment described above, which will not be described in detail in the present application.
[0106] Figure 8 A structural schematic diagram of an animation processing device 600 provided by the embodiment of the present disclosure is provided, and the animation processing device comprises: An acquisition unit 61 is configured to, in response to a sliding operation on a display interface, acquire a picture sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation. A determination unit 62 is configured to determine a to-be-rendered image frame in the image frames according to the picture sliding distance and the resolution. A processing unit 63 is configured to perform rendering processing on the to-be-rendered image frame to obtain a rendered animation, and display the rendered animation on the display interface.
[0107] In summary, in the embodiment of the present disclosure, the animation processing device provided by the present disclosure comprises: in response to a sliding operation on a display interface, acquiring a picture sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation; determining a to-be-rendered image frame in the image frames according to the picture sliding distance and the resolution; performing rendering only on the to-be-rendered image frame to obtain a rendered animation; and displaying the rendered animation on the display interface. This avoids rendering all image frames, reduces the number of image frames required for rendering, and thus reduces the computational overhead of animation rendering.
[0108] Further, in a possible implementation manner of the embodiment of the present disclosure, as shown in Figure 9 The determination unit 62 comprises: The acquisition module 621 is configured to acquire a sliding direction of the picture sliding distance. The first determination module 622 is configured to determine an interface length of the display interface according to the sliding direction and the resolution. The first determination module 622 is further configured to determine a to-be-rendered image frame in the image frames according to the picture sliding distance and the interface length.
[0109] Further, in a possible implementation of the embodiment of the present disclosure, as shown in Figure 9 The first determination module 622 is further configured to: acquire a direction resolution of at least two directions in the resolution; determine a target direction resolution consistent with the sliding direction in the direction resolution of the at least two directions as the interface length.
[0110] Further, in a possible implementation of the embodiment of the present disclosure, as shown in Figure 9 The first determination module 622 is further configured to: acquire a preset intersection length of the image frames; the preset intersection length is a length of an overlapping area between two image frames; determine a rendering number of the image frames according to the picture sliding distance, the interface length and the preset intersection length; determine a to-be-rendered image frame in the image frames according to the rendering number.
[0111] Further, in a possible implementation of the embodiment of the present disclosure, as shown in Figure 9 The first determination module 622 is further configured to: acquire a first position of a first frame and a second position of a last frame in the image frames; determine a to-be-rendered image frame in the image frames according to the first position, the second position and the rendering number.
[0112] Further, in a possible implementation of the embodiment of the present disclosure, as shown in Figure 9 The processing unit 63 includes: The splicing module 631 is configured to splice the to-be-rendered image frame according to the preset intersection length to obtain a spliced image frame. The second determination module 632 is configured to acquire a display position of the image frames, and determine a display image frame of the display position according to the spliced image frame. The combination module 633 is configured to combine the display image frame into the rendering animation according to the display position.
[0113] Further, in a possible implementation of the embodiment of the present disclosure, as shown in Figure 9 the splicing module 631 is further configured to: perform overlap processing on the to-be-rendered image frame according to the preset intersection length, to obtain an overlap region of the to-be-rendered image frame; perform difference degree calculation on the overlap region, to obtain a difference degree value of different positions in the overlap region; splice the to-be-rendered image frame according to the difference degree value, to obtain a spliced image frame.
[0114] Further, in a possible implementation of the embodiment of the present disclosure, as shown in Figure 9 the splicing module 631 is further configured to: determine a position corresponding to a minimum value in the difference degree value as a splicing position; splice the to-be-rendered image frame according to the splicing position, to obtain a spliced image frame.
[0115] Since the apparatus provided by the embodiment of the present disclosure corresponds to the method provided by the above several embodiments, the implementation of the method is also applicable to the apparatus provided by the present embodiment, and will not be described in detail in the present embodiment.
[0116] In the embodiments provided by the present application, the method and the apparatus provided by the embodiments of the present application are introduced. In order to realize the functions in the method provided by the embodiments of the present application, the electronic device can include hardware structure, software module, and realize the above functions in the form of hardware structure, software module, or hardware structure plus software module. Some of the above functions can be executed in the form of hardware structure, software module, or hardware structure plus software module.
[0117] Figure 10 is a block diagram of an electronic device 700 for implementing the above animation processing method according to an example embodiment. For example, the electronic device 700 can be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0118] Referring to Figure 10 , the electronic device 700 can include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, and a communication component 716.
[0119] The processing component 702 generally controls the overall operations of the electronic device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 can include one or more processors 720 to execute instructions and to complete the steps of the methods described above, in whole or in part. Moreover, the processing component 702 can include one or more modules to facilitate the interaction between the processing component 702 and other components. For example, the processing component 702 can include a multimedia module to facilitate the interaction between the multimedia component 708 and the processing component 702.
[0120] The memory 704 is configured to store various types of data to support operations of the electronic device 700. Examples of these data include instructions to operate any applications or methods on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so on. The memory 704 can be implemented by any type of volatile or non-volatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0121] The power component 706 provides power to the various components of the electronic device 700. The power component 706 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 700.
[0122] The multimedia component 708 includes a screen providing an output interface between the electronic device 700 and a user. In some embodiments, the screen can include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes the touch panel, the screen can be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense a touch, a slide, and a gesture on the touch panel. The touch sensor can not only sense a boundary of a touching or a sliding action, but also detect duration and pressure related to the touching or sliding action. In some embodiments, the multimedia component 708 includes a front camera and / or a back camera. The front camera and / or the back camera can receive external multimedia data when the electronic device 700 is in an operating mode, such as a shooting mode or a video mode. Each of the front camera and the back camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0123] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC) that is configured to receive an external audio signal when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.
[0124] The I / O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which can be a keypad, a click wheel, buttons, and the like. The buttons can include, but are not limited to, a home button, a volume button, a start button, and a lock button.
[0125] The sensor component 714 includes one or more sensors for providing various state assessments for the electronic device 700. For example, the sensor component 714 can detect an open / closed position of the electronic device 700, relative positioning of components, such as a display and a keypad of the electronic device 700, a change in position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, the orientation or acceleration / deceleration of the electronic device 700, and a temperature change of the electronic device 700. The sensor component 714 can include a proximity sensor configured to detect the presence of a nearby object without any physical touch. The sensor component 714 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 714 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0126] The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (New Radio), or a combination thereof. In an example embodiment, the communication component 716 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an example embodiment, the communication component 716 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0127] In an example embodiment, the electronic device 700 can be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic elements for performing the above-described methods.
[0128] In an example embodiment, a non-transitory computer-readable storage medium including instructions, for example, the memory 704 including instructions, is also provided, which can be executed by the processor 720 of the electronic device 700 to complete the above-described method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0129] Embodiments of the present disclosure also provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the method described in the above-described embodiments of the present disclosure.
[0130] To implement the above-described embodiments, the present disclosure also provides a chip, which includes: the chip includes processing circuitry configured to perform the method provided in the above-described embodiments.
[0131] Figure 11 is a structural schematic diagram of a chip provided by an embodiment of the present disclosure. Referring to Figure 11 , but is not limited thereto.
[0132] The chip 800 includes processing circuitry 801 and interface circuitry 802, the interface circuitry 802 being configured to read instructions, and the interface circuitry 802 being configured to send the instructions to the processing circuitry 801, so that the processing circuitry 801 performs the above-described method.
[0133] Optionally, as Figure 12 , the chip 800 further includes a memory 803 for storing instructions. Figure 12 is a structural schematic diagram of another chip provided by an embodiment of the present disclosure. The chip 800 can further include a memory 803 for storing instructions, and the interface circuitry 802 can be configured to read the instructions stored in the memory 803.
[0134] Optionally, the interface circuitry 802 is connected with the memory 803, and the interface circuitry 802 can be configured to receive signals from the memory 803 or other devices, and the interface circuitry 802 can be configured to send signals to the memory 803 or other devices. For example, the interface circuitry 802 can read the instructions stored in the memory 803 and send the instructions to the processing circuitry 801.
[0135] Optionally, the number of memories 803 can be one or more. The number of interface circuits 802 can also be one or more.
[0136] In some embodiments, the interface circuit 802 performs at least one of the communication steps of sending and / or receiving in the above-described methods, and the processing circuit 801 performs the other steps.
[0137] In some embodiments, the interface circuit, interface, transceiver pin, transceiver, and the like can be replaced with each other.
[0138] Optionally, all or part of the memory 803 can also be outside the chip 800.
[0139] Those skilled in the art will further appreciate that the various illustrative logical blocks and steps (steps) listed in the embodiments of the present application can be implemented by electronic hardware, computer software, or a combination of both. Whether such functions are implemented by hardware or software depends on the specific application and design requirements of the whole system. Those skilled in the art can use various methods to implement the functions for each specific application, but such implementation should not be understood as beyond the scope of the embodiments of the present application.
[0140] It should be noted that the terms "first", "second", and the like in the description of the present disclosure and claims and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0141] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "illustrative embodiment", "example", "specific example" or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0142] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0143] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processing module, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (control method), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic device, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0144] It should be understood that various parts of the embodiments of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0145] Those skilled in the art of the present technology can understand that all or part of the steps carried out by the above-mentioned embodiment method can be completed by programs instructing related hardware, and the programs can be stored in a computer readable storage medium. When the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0146] In addition, each functional unit in each embodiment of the present application can be integrated into one processing module, or each unit can exist physically independently, or two or more units can be integrated into one module. The integrated module can be realized in the form of hardware or in the form of a software functional module. If the integrated module is realized in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0147] Although the embodiments of the present application have been shown and described above, it should be understood that the above-mentioned embodiments are exemplary and cannot be understood as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above-mentioned embodiments within the scope of the present application.
Claims
1. An animation processing method characterized by comprising: The method comprises: in response to a sliding operation on a display interface, acquiring a picture sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation; determining a to-be-rendered image frame in the image frames according to the picture sliding distance and the resolution; performing rendering processing on the to-be-rendered image frame to obtain a rendering animation, and displaying the rendering animation on the display interface.
2. The method of claim 1, wherein, The determining of the to-be-rendered image frame in the image frames according to the picture sliding distance and the resolution comprises: acquiring a sliding direction of the picture sliding distance; determining an interface length of the display interface according to the sliding direction and the resolution; determining the to-be-rendered image frame in the image frames according to the picture sliding distance and the interface length.
3. The method of claim 2, wherein, The determining of the interface length of the display interface according to the sliding direction and the resolution comprises: acquiring direction resolutions of at least two directions in the resolution; determining a target direction resolution consistent with the sliding direction in the direction resolutions of the at least two directions as the interface length.
4. The method of claim 2, wherein, The determining of the to-be-rendered image frame in the image frames according to the picture sliding distance and the interface length comprises: acquiring a preset intersection length of the image frames; the preset intersection length is a length of an overlapping area between two image frames; determining a rendering number of the image frames according to the picture sliding distance, the interface length, and the preset intersection length; determining the to-be-rendered image frame in the image frames according to the rendering number.
5. The method of claim 4, wherein, The determining of the to-be-rendered image frame in the image frames according to the rendering number comprises: acquiring a first position of a first image frame and a second position of a last image frame in the image frames; determining the to-be-rendered image frame in the image frames according to the first position, the second position, and the rendering number.
6. The method of claim 4, wherein, The rendering processing of the to-be-rendered image frame to obtain a rendering animation comprises: splicing the to-be-rendered image frame according to the preset intersection length to obtain a spliced image frame; acquiring a display position of the image frames, and determining a display image frame of the display position according to the spliced image frame; combining the display image frame into the rendering animation according to the display position.
7. The method of claim 6, wherein, The splicing of the to-be-rendered image frame according to the preset intersection length to obtain a spliced image frame comprises: performing overlapping processing on the to-be-rendered image frame according to the preset intersection length to obtain an overlapping area of the to-be-rendered image frame; performing difference calculation on the overlapping area to obtain a difference value of different positions in the overlapping area; splicing the to-be-rendered image frame according to the difference value to obtain the spliced image frame.
8. The method of claim 7, wherein, The splicing of the to-be-rendered image frame according to the difference value to obtain a spliced image frame comprises: determining a splicing position corresponding to a minimum value in the difference value as a splicing position; splicing the to-be-rendered image frame according to the splicing position to obtain the spliced image frame.
9. An animation processing apparatus characterized by comprising: The device comprises: The acquisition unit is configured to, in response to a sliding operation on the display interface, acquire a picture sliding distance of the display interface, a resolution of the display interface, and a plurality of image frames displayed on the display interface during the sliding operation; The determination unit is configured to determine, according to the picture sliding distance and the resolution, a to-be-rendered image frame in the image frames; The processing unit is configured to perform rendering processing on the to-be-rendered image frame to obtain a rendered animation, and display the rendered animation on the display interface.
10. The apparatus of claim 9, wherein, The determination unit includes: The acquisition module is configured to acquire a sliding direction of the picture sliding distance; The first determination module is configured to determine, according to the sliding direction and the resolution, an interface length of the display interface; The first determination module is further configured to determine, according to the picture sliding distance and the interface length, a to-be-rendered image frame in the image frames.
11. The apparatus of claim 10, wherein, The first determination module is further configured to: acquire a preset intersection length of the image frames; the preset intersection length is a length of an overlapping area between two image frames; determine, according to the picture sliding distance, the interface length, and the preset intersection length, a rendering number of the image frames; determine, according to the rendering number, a to-be-rendered image frame in the image frames.
12. An electronic device, comprising: comprise: at least one processor; and a memory connected in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
13. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method of any one of claims 1-8.
14. A chip, characterized by The chip includes processing circuitry and interface circuitry; wherein the interface circuitry is configured to read instructions, and the interface circuitry sends the instructions to the processing circuitry to enable the processing circuitry to perform the method of any one of claims 1-8.