Wallpaper processing method and device, electronic equipment and readable storage medium
Patent Information
- Application Number
- CN202311421628.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-10-30
AI Technical Summary
然而现有技术中,如何将动态壁纸同时应用于电子设备的熄屏显示界面、锁屏界面以及桌面,没有相关的解决方案
[0010]In this embodiment, the first dynamic wallpaper applied to the always-on display, lock screen, and desktop includes at least a second video compressed from a first video. The first video has a resolution greater than the screen resolution, and the second video has a resolution less than or equal to the screen resolution. The second video is applied at least in the always-on display. Video frames from the second video applied to the always-on display can be enlarged and displayed in the always-on display, where the resolution of the enlarged video frames is equal to the resolution of the first video. Upon receiving a first input to trigger screen switching to the target interface, the system responds to the first input by determining the first display position of the first video frame of the target interface based on the current display position of the always-on display and the preset target video frame display position. Then, the first display position is used as the starting display position, and the target video frame display position is used as the ending display position to display the video frames from the first dynamic wallpaper applied to the target interface in the target interface. Therefore, this embodiment provides a method for applying dynamic wallpapers to the always-on display, lock screen, and desktop. In this application method, on the one hand, for the second video compressed from the first live wallpaper, the video frames applied to the always-on display interface can be enlarged and displayed on the always-on display interface. This reduces the probability of video frames moving off the screen due to the movement of the always-on display area, thereby improving the display effect of the live wallpaper. On the other hand, the first display position of the first video frame on the target interface is determined based on the current display position of the always-on display interface when the first input triggering the screen to switch to the target interface is received, as well as the preset display position of the target video frame. This increases the probability of the target interface and the always-on display interface being aligned, thereby improving the display effect of the live wallpaper.
Smart Images

Figure CN117369932B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology, specifically relating to a wallpaper processing method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] With the development of electronic devices, users' expectations and requirements for wallpapers on these devices are gradually increasing. Based on this, live wallpapers in video format can be provided. However, in current technology, there is no solution for how to simultaneously apply live wallpapers to the always-on display, lock screen, and desktop of electronic devices. Summary of the Invention
[0003] The purpose of this application is to provide a wallpaper processing method, apparatus, electronic device, and readable storage medium, which enables the application of dynamic wallpapers on the always-on display interface, lock screen interface, and desktop of electronic devices.
[0004] In a first aspect, embodiments of this application provide a wallpaper processing method, the method comprising: A first dynamic wallpaper is obtained and applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, and the always-on area moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video obtained by compressing a first video. The first video has a first video resolution greater than the screen resolution, and the second video has a second video resolution less than or equal to the screen resolution. The second video is applied at least to the always-on display interface. The video frames in the second video applied to the always-on display interface are enlarged and displayed on the always-on display interface, wherein the resolution of the enlarged video frames is equal to the resolution of the first video; In response to a first input for triggering screen switching to a target interface, the first display position of the first video frame of the target interface is determined based on the current display position of the always-on display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop; Using the first display position as the starting display position and the target video frame display position as the ending display position, the video frame of the first dynamic wallpaper applied to the target interface is displayed on the target interface.
[0005] Secondly, embodiments of this application provide a wallpaper processing apparatus, the apparatus comprising: The acquisition module is used to acquire a first dynamic wallpaper applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, and the always-on area moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video obtained by compressing a first video. The first video has a first video resolution greater than the screen resolution, and the second video has a second video resolution less than or equal to the screen resolution. The second video is applied at least to the always-on display interface. A first display module is configured to magnify and display video frames from the second video applied to the always-on display interface, wherein the resolution of the magnified video frames is equal to the resolution of the first video. The determining module is configured to respond to a first input for triggering screen switching to the target interface, and determine the first display position of the first video frame of the target interface based on the current display position of the screen-off display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop; The second display module is used to display the video frame of the first dynamic wallpaper applied to the target interface, with the first display position as the starting display position and the target video frame display position as the ending display position.
[0006] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores programs or instructions executable on the processor, and the programs or instructions, when executed by the processor, implement the steps of the method described in the first aspect.
[0007] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0008] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0009] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method described in the first aspect.
[0010] In this embodiment, the first dynamic wallpaper applied to the always-on display, lock screen, and desktop includes at least a second video compressed from a first video. The first video has a resolution greater than the screen resolution, and the second video has a resolution less than or equal to the screen resolution. The second video is applied at least in the always-on display. Video frames from the second video applied to the always-on display can be enlarged and displayed in the always-on display, where the resolution of the enlarged video frames is equal to the resolution of the first video. Upon receiving a first input to trigger screen switching to the target interface, the system responds to the first input by determining the first display position of the first video frame of the target interface based on the current display position of the always-on display and the preset target video frame display position. Then, the first display position is used as the starting display position, and the target video frame display position is used as the ending display position to display the video frames from the first dynamic wallpaper applied to the target interface in the target interface. Therefore, this embodiment provides a method for applying dynamic wallpapers to the always-on display, lock screen, and desktop. In this application method, on the one hand, for the second video compressed from the first live wallpaper, the video frames applied to the always-on display interface can be enlarged and displayed on the always-on display interface. This reduces the probability of video frames moving off the screen due to the movement of the always-on display area, thereby improving the display effect of the live wallpaper. On the other hand, the first display position of the first video frame on the target interface is determined based on the current display position of the always-on display interface when the first input triggering the screen to switch to the target interface is received, as well as the preset display position of the target video frame. This increases the probability of the target interface and the always-on display interface being aligned, thereby improving the display effect of the live wallpaper. Attached Figure Description
[0011] Figure 1 This is a flowchart of the wallpaper processing method provided in the embodiments of this application; Figure 2 This is a schematic diagram of video frame movement provided in an embodiment of this application; Figure 3 This is a schematic diagram of video frame compression provided in an embodiment of this application; Figure 4 This is a schematic diagram of a screen provided in an embodiment of this application; Figure 5 This is a structural diagram of the wallpaper processing apparatus provided in the embodiments of this application; Figure 6 This is one of the structural diagrams of the electronic device provided in the embodiments of this application; Figure 7 This is the second structural diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0012] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0013] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0014] The wallpaper processing method provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0015] Figure 1 This is a flowchart of the wallpaper processing method provided in an embodiment of this application. Figure 1 As shown, wallpaper processing methods may include: Step 101: Obtain a first dynamic wallpaper applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, and the always-on area moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video compressed from a first video. The first video has a first video resolution greater than the screen resolution, and the second video has a second video resolution less than or equal to the screen resolution. The second video is applied at least to the always-on display interface.
[0016] This application does not limit the method of obtaining the first live wallpaper. In some embodiments, the first live wallpaper may be designed by a user interface (UI) designer. In other embodiments, the first live wallpaper may be downloaded. In still other embodiments, the first live wallpaper may be obtained by processing other live wallpapers.
[0017] The First Live Wallpaper can be applied to the always-on display, lock screen, and desktop. It displays across these interfaces, featuring synchronized animation effects that seamlessly transition between them. Essentially, the First Live Wallpaper plays a video, with the wallpaper displayed at any given moment representing a single frame of the video.
[0018] The Always On Display (AOD) interface is the display area in the screen-off region. The screen-off region is the illuminated area of the electronic device when the screen is off. The AOD interface is also called the always-on display interface, the always-on screen area, etc. The screen-off area is a portion of the screen, and correspondingly, the AOD interface is a portion of the screen's interface. To prevent screen burn-in, the AOD area can change periodically, allowing the AOD interface to move along a preset trajectory on the screen. The lock screen is the interface when the electronic device is locked. The desktop is the interface when the electronic device is unlocked.
[0019] Switching between user interfaces on electronic devices can be achieved in the following ways: Method 1: Enter the lock screen from the always-on display and then enter the desktop. For example: When the electronic device is in a screen-off state, turn on the always-on display and play a live wallpaper; if the user presses the power button, the electronic device can respond to this operation, switch to the lock screen state, enter the lock screen state, and play the live wallpaper; if the user unlocks the electronic device, the electronic device responds to this operation, switch to the unlock state, enter the desktop state, and play the live wallpaper on the desktop.
[0020] Method 2: Directly access the desktop from the always-on display. For example: When the electronic device is in a screen-off state, the always-on display is turned on, and a live wallpaper plays on the screen; when the user unlocks the electronic device, the device responds to this operation, directly switches to the unlocked state, enters the desktop, and plays the live wallpaper on the desktop.
[0021] The first live wallpaper includes a second video compressed from a first video, wherein the resolution of the first video is greater than the screen resolution, and the resolution of the second video is less than or equal to the screen resolution. Optionally, the first live wallpaper may also include an uncompressed video, which can be applied to the lock screen or desktop and does not need to be decompressed when displayed on the lock screen or desktop.
[0022] In this embodiment of the application, video (or screen) resolution refers to the number of pixels in the vertical and horizontal dimensions of the video (or screen), measured in pixels (px). Video (or screen) resolution includes height and width; the height of the video (or screen) resolution refers to the number of pixels in the vertical direction, and the width of the video (or screen) resolution refers to the number of pixels in the horizontal direction.
[0023] The first video resolution being greater than the screen resolution can specifically manifest in any of the following ways: 1) The height of the first video resolution is greater than the height of the screen resolution, and the width of the first video resolution is equal to the width of the screen resolution; 2) The height of the first video resolution is equal to the height of the screen resolution, and the width of the first video resolution is greater than the width of the screen resolution; 3) The height of the first video resolution is greater than the height of the screen resolution, and the width of the first video resolution is greater than the width of the screen resolution.
[0024] For ease of description, the height of the first video resolution will be referred to as the first height, and the width of the first video resolution will be referred to as the first width; the height of the screen resolution will be referred to as the second height, and the width of the screen resolution will be referred to as the second width.
[0025] The video resolution of the first video is greater than the screen resolution, indicating that the video size of the first video is large. In order to reduce the video size of the first dynamic wallpaper and thus reduce the rendering and decompression pressure of the first dynamic video, this application embodiment can use a second video obtained by compressing the first video with a video resolution less than or equal to the screen resolution to determine the first dynamic wallpaper.
[0026] In practice, each video frame of the first video can be compressed according to the first ratio coefficient to obtain the second video, which is the compressed first video.
[0027] Understandably, in order to make the video resolution of the compressed first video less than or equal to the screen resolution, the compression method of the video frames is different for different forms of "the first video resolution is greater than the screen resolution", and thus the first ratio coefficient is also different. In other words, the specific manifestation of the first ratio coefficient is related to the specific manifestation of "the first video resolution is greater than the screen resolution".
[0028] Specifically, when the first video resolution is greater than the screen resolution in the manner described in 1) above, in order to make the video resolution of the compressed first video less than or equal to the screen resolution, it is necessary to compress each video frame in the first video at least in terms of height. Therefore, the first ratio coefficient may include at least a first value, which is used to compress the video frame vertically. The first value may be greater than or equal to a first ratio of the first height to the second height. It can be understood that when the first value equals the first ratio, the height of the compressed video frame's video resolution is equal to the height of the screen resolution; when the first value is greater than the first ratio, the height of the compressed video frame's video resolution is less than the height of the screen resolution.
[0029] When the specific manifestation of the first video resolution being greater than the screen resolution is as described in 2) above, in order to make the video resolution of the compressed first video less than or equal to the screen resolution, it is necessary to compress each video frame in the first video at least in width. Therefore, the first scaling factor can include at least a second value, which is used to compress video frames horizontally. The second value can be greater than or equal to a second ratio of the first width to the second width. It can be understood that when the second value is equal to the second ratio, the width of the compressed video frame's video resolution is equal to the width of the screen resolution; when the second value is greater than the second ratio, the width of the compressed video frame's video resolution is less than the width of the screen resolution.
[0030] When the specific manifestation of the first video resolution being greater than the screen resolution is as described in 3) above, in order to make the video resolution of the compressed first video less than or equal to the screen resolution, it is necessary to compress each video frame in the first video in terms of height and width. Therefore, the first scaling factor may include the first value and the second value mentioned above.
[0031] Furthermore, considering the impact of video frame compression on display quality, a first compression threshold and a second compression threshold can be preset as the maximum of the first and second values. Specifically, the first value is greater than or equal to a first ratio and less than or equal to the first compression threshold, and the second value is greater than or equal to a second ratio and less than or equal to the second compression threshold. Understandably, under these conditions, the display quality of the compressed video frame is within acceptable limits.
[0032] As can be seen from the foregoing, the first scaling factor may include at least one of a first value and a second value, wherein the first value is used to compress video frames vertically and the second value is used to compress video frames horizontally.
[0033] Based on this, in a specific implementation, each video frame in the first video can be compressed vertically according to the first value; and / or, each video frame in the first video can be compressed horizontally according to the second value to obtain the compressed first video, i.e., the second video.
[0034] It is worth noting that the first live wallpaper in this application embodiment may include, but is not limited to, a second video, which is applied at least to the always-on display interface. In some embodiments, the first live wallpaper may include only the second video. In other embodiments, the first live wallpaper may also include other videos besides the second video. Furthermore, the video resolution of the other videos may be the same as or different from the video resolution of the second video, which can be determined according to the actual situation, and this application embodiment does not limit this.
[0035] Understandably, for a first live wallpaper with different content, the application scope of a second video can differ, specifically including at least the following situations: Scenario 1: The first live wallpaper may consist of only the second video, which is applied to the always-on display, lock screen, and desktop.
[0036] Scenario 2: The second live wallpaper may include a second video and a fourth video. The second video can be applied to the always-on display and the lock screen, and the fourth video can be applied to the desktop.
[0037] Scenario 3: The first live wallpaper may include a second video, a fifth video, and a sixth video. The second video can be applied to the always-on display, the fifth video can be applied to the lock screen, and the sixth video can be applied to the desktop.
[0038] Furthermore, the video resolutions of the fourth, fifth, and sixth videos can be greater than, less than, or equal to the screen resolution. This application does not limit the acquisition method of the fourth, fifth, and sixth videos; they can be directly created or obtained by compressing other videos, but are not limited to these methods.
[0039] It's worth noting that when a live wallpaper includes multiple videos, considering the continuity of the animation effects, these multiple videos can be obtained by splitting and processing a single video, meaning the playback of these multiple videos is continuous. However, the processing methods for these multiple videos may differ. For example, the second video in the first live wallpaper might be obtained by compressing the split video. It should be noted that maintaining the original video format is also considered a video processing method.
[0040] Understandably, in scenario 1, the video played by the first live wallpaper on all interfaces—the always-on display, the lock screen, and the desktop—is a compressed video. In other words, the video played by the first live wallpaper on the always-on display, the lock screen, and the desktop is a compressed video.
[0041] In scenario 2, the video played by the first live wallpaper on the always-on display and lock screen is a compressed video, while the video played on the desktop can be an uncompressed video.
[0042] In scenario 3, the video played by the first live wallpaper on the always-on display is a compressed video, while the videos played on the desktop and lock screen can both be uncompressed videos. In this case, the video played by the first live wallpaper on the always-on display is a compressed video, while the videos played on the desktop and lock screen can be uncompressed videos.
[0043] As can be seen, compared to scenario 1, scenario 2 includes uncompressed video in the first live wallpaper, which improves the display clarity of the first live wallpaper; compared to scenario 2, scenario 1 consists entirely of compressed video in the first live wallpaper, which further reduces the video size and decoding burden of the live wallpaper. The comparisons between scenarios 2 and 3, as well as between scenarios 1 and 3, are similar.
[0044] After obtaining the first live wallpaper, you can apply the first live wallpaper through steps 102 to 104.
[0045] Step 102: Enlarge the video frame of the second video applied to the screen-off display interface, wherein the resolution of the enlarged video frame is equal to the resolution of the first video.
[0046] Since the resolution of the second video is smaller than the screen resolution, in order to make the video frames displayed on the always-on display screen fit the screen, the video frames from the second video that are used in the always-on display screen can be enlarged on the always-on display screen.
[0047] Magnified display can also be called stretched display. In practice, these video frames can be stretched according to a first proportional coefficient. Similar to video frame compression, in practice, each video frame can be stretched vertically according to a first value; and / or, each video frame can be stretched horizontally according to a second value, so that the resolution of the stretched video frame is equal to the video resolution of the first video.
[0048] Step 103: In response to the first input for triggering screen switching to the target interface, determine the first display position of the first video frame of the target interface based on the current display position of the screen-off display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop.
[0049] As can be seen from the foregoing, there are two ways to switch the interface of an electronic device. For method 1, the target interface is the lock screen desktop, and for method 2, the target interface is the desktop.
[0050] Users can trigger a switch from the always-on display to the target screen using the first input. When the target screen is the lock screen, the first input triggers the electronic device to enter the lock screen state from the always-on state. When the target screen is the home screen, the first input triggers the electronic device to enter the unlocked state from the always-on state; the first input can be understood as the unlock input.
[0051] Since the always-on display only occupies a portion of the screen, while the lock screen and desktop occupy the entire screen, to ensure the continuity of the second live wallpaper display, when the screen interface switches from the always-on display to the target interface, the target interface and the always-on display need to be aligned. This means that the last image displayed on the always-on display must be consistent with or continuous with the image displayed in the third position of the first video frame on the target interface. The third position is the last display position of the always-on display.
[0052] After receiving the first input, the electronic device can first determine the display position of the first video frame (i.e., the first frame) of the target interface, which is called the first display position or the initial position of the wallpaper first frame. By displaying the first frame of the target interface at the first display position, the target interface and the always-on display interface can be aligned.
[0053] In practice, the current display position of the always-on display interface when the first input is received can be obtained first, as well as the preset target video frame display position. The target video frame display position is preset by the UI designer and can be the display position when the wallpaper is initialized, that is, the original display position of the wallpaper. Therefore, the target video frame display position can also be called the original position of the wallpaper.
[0054] Then, based on the current display position and the preset target video frame display position, the first display position is determined. The determination of the first display position can be found in the relevant description below, and will not be repeated here.
[0055] By using step 103, when switching from the always-on display interface to the target interface, the target interface and the always-on display interface can be aligned, thereby ensuring the continuity of the animation effects of the first live wallpaper.
[0056] Step 104: Using the first display position as the starting display position and the target video frame display position as the ending display position, display the video frame from the first dynamic wallpaper applied to the target interface on the target interface.
[0057] After determining the first display position, the video frame displayed on the target interface can be smoothly transitioned from the first display position to the target video frame display position. In this way, the display effect of the video frame can be maximized while achieving alignment between the first frame of the target interface and the always-on display interface.
[0058] Based on the foregoing, it's understandable that the video applied to the always-on display and the target screen may differ depending on the specific circumstances of the first dynamic wallpaper. The video applied to the target screen may be compressed or uncompressed. When the video applied to the target screen is compressed, displaying the video frames on the target screen can be achieved by magnifying the video frames. The specific implementation principle is the same as step 102, and will not be repeated here to avoid repetition.
[0059] The wallpaper processing method of this application embodiment, for a first dynamic wallpaper obtained and applied to an always-on display interface, a lock screen interface, and a desktop, includes at least a second video compressed from a first video. The first video has a first video resolution greater than the screen resolution, and the second video has a second video resolution less than or equal to the screen resolution. The second video is applied at least in the always-on display interface. Video frames from the second video applied to the always-on display interface can be enlarged and displayed in the always-on display interface, wherein the resolution of the enlarged video frames is equal to the resolution of the first video. Upon receiving a first input to trigger screen switching to a target interface, in response to the first input, a first display position of the first video frame of the target interface can be determined based on the current display position of the always-on display interface and a preset target video frame display position. Then, with the first display position as the starting display position and the target video frame display position as the ending display position, the video frames from the first dynamic wallpaper applied to the target interface can be displayed in the target interface. As can be seen, this application provides a method for applying dynamic wallpapers on the always-on display, lock screen, and desktop. Specifically, in this application method, on the one hand, the second video compressed from the first dynamic wallpaper can be enlarged and displayed on the always-on display, thereby reducing the probability of video frames moving off the screen due to the movement of the always-on display area, thus improving the display effect of the dynamic wallpaper. On the other hand, the first display position of the first video frame on the target interface is determined based on the current display position of the always-on display when the first input triggers the screen to switch to the target interface, and the preset target video frame display position. This increases the probability of the target interface aligning with the always-on display, thereby improving the display effect of the dynamic wallpaper.
[0060] The following explains how the first display position is determined.
[0061] In some embodiments, a correspondence can be pre-defined between the display position of the always-on display interface, the display position of the target video frame, and the display position of the first video frame of the target interface. In this way, the first display position can be obtained by looking up the above correspondence, thereby improving the efficiency of determining the first display position.
[0062] In other embodiments, determining the first display position of the first video frame of the target interface based on the current display position of the always-on display interface and the preset target video frame display position includes: Based on the current display position of the always-on display interface, the wallpaper offset distance is determined, wherein the wallpaper offset distance is the distance between the first display position of the first video frame of the target interface and the display position of the target video frame; The first display position is determined based on the wallpaper offset distance and the target video frame display position.
[0063] In this embodiment, the wallpaper offset distance can be determined first based on the current display position of the always-on display interface. Then, the first display position can be deduced based on the wallpaper offset distance and the display position of the target video frame. This improves the accuracy of determining the first display position.
[0064] In some implementations, a pre-defined correspondence between the display position of the always-on display and the wallpaper offset distance can be established. In this way, the wallpaper offset distance corresponding to the current display position of the always-on display can be determined by looking up this correspondence.
[0065] In other embodiments, determining the wallpaper offset distance based on the current display position of the always-on display interface may include: The first wallpaper offset distance in the first direction is calculated using the first formula; The first formula is: First wallpaper offset distance, in pixels (px); The length of the screen resolution in the first direction, in pixels (px); The distance of the target video frame display position relative to the center point of the screen in the first direction, in pixels (px); The distance in pixels (px) between the current display position of the always-on display interface and the target edge of the screen in a first direction is: when the first direction is vertical and the center point of the target video frame display position is above the center point of the screen, the target edge is the top edge of the screen; when the first direction is vertical and the center point of the target video frame display position is below the center point of the screen, the target edge is the bottom edge of the screen; when the first direction is horizontal and the center point of the target video frame display position is to the left of the center point of the screen, the target edge is the left side of the screen; and when the first direction is horizontal and the center point of the target video frame display position is to the right of the center point of the screen, the target edge is the right side of the screen.
[0066] It should be noted that, in the embodiments of this application, the distance of X relative to Y can be understood as the distance between the center point of X and the center point of Y.
[0067] The first direction can be represented vertically or horizontally, and its specific representation is related to the screen resolution of the stretched second video and the screen resolution.
[0068] like Figure 2 As shown, if the screen resolution of the stretched second video is greater than the screen resolution only in height, the first direction is vertical, and the wallpaper offset distance only includes the vertical wallpaper offset distance.
[0069] If the screen resolution of the stretched second video is greater than the screen resolution only in width, the first direction is horizontal, and the wallpaper offset distance only includes the horizontal wallpaper offset distance.
[0070] If the screen resolution of the stretched second video is greater than the screen resolution in both width and height, the first direction is represented as horizontal or vertical, and the wallpaper offset distance includes the horizontal wallpaper offset distance and the vertical wallpaper offset distance.
[0071] When the first direction is longitudinal. This is represented by the height of the screen resolution. When the first direction is longitudinal, The width represented by the screen resolution .
[0072] For a clearer understanding of how the wallpaper offset distance is calculated, please refer to [link / reference needed]. Figure 2 . Figure 2 (a) in the image shows the first frame of the target interface. Figure 2 The wallpaper in (b) is displayed at the target video frame display position. Figure 2In this context, the center point of the target video frame display position is located above the center point of the screen. This refers to the distance between the current display position of the always-on display interface and the top of the screen.
[0073] Depend on Figure 2 It can be seen that, , and The sum is the screen height. Half of, therefore, in , and Given the information, the vertical wallpaper offset distance can be calculated using the first formula.
[0074] Given that the wallpaper offset distance and the target video frame display position are known, these two parameters can be used to determine the display position of the first frame of the target interface, i.e., the first display position.
[0075] The above method can accurately calculate the wallpaper offset distance in each direction, thereby improving the playback effect of the first dynamic wallpaper.
[0076] The specific implementation of step 104 is explained below.
[0077] Step 104 may include: The first video frame of the first live wallpaper applied to the target interface is displayed at the first display position; Based on the motion effect curve, determine the P moving distances from the first display position to the target video frame display position, where P is a natural number; Based on the first display position and the P moving distances, P display positions are determined, and the Pth display position of the P display positions is the display position of the target video frame; The second to the (P+1)th video frames of the first dynamic wallpaper applied to the target interface are displayed sequentially at the P display positions in chronological order. The remaining video frames, excluding the first P+1 video frames, are displayed at the target video frame display position from the video frames applied to the target interface in the first dynamic wallpaper.
[0078] In this implementation, the first display position is used as the display position of the first frame of the target interface, and the display position of the target video frame is used as the display position of the last video frame of the target interface. During the smooth transition of the display position of the video frame of the target interface from the first display position to the display position of the target video frame, each display position can be determined based on the motion effect curve.
[0079] Motion curves can be pre-defined by the motion graphics designer. Motion curves indicate the movement of video frames. Motion curves can be linear, meaning the movement distance of each video frame is equally divided and fixed. Motion curves can also be non-linear, for example, setting the movement distance of the first part of the video frames to be larger and the movement distance of the later video frames to be smaller.
[0080] In practice, the movement distance of the video frame can be determined first based on the motion effect curve. Then, based on the display position of the current video frame and the movement distance of the next video frame, the display position of the next video frame can be determined. In this way, the video frame can smoothly transition from the first display position to the target video frame display position according to the motion effect curve.
[0081] Understandably, the sum of P movement distances represents the wallpaper offset distance. In some implementations, after each position is determined, a video frame can be displayed, and the next position can be determined. In other implementations, P display positions can be determined first, and then video frames can be displayed sequentially at each of the P display positions.
[0082] After a smooth transition to the target video frame display position, the remaining video frames can be displayed at the target video frame display position.
[0083] By aligning the always-on display interface and the target interface at the first display position using the above method, the video frame can smoothly transition to the target video frame display position according to the dynamic curve, thus improving the animation effect of the live wallpaper.
[0084] The following is a detailed explanation of step 101.
[0085] In some embodiments, step 101 may include: Obtain the first video; A first scaling factor is determined based on the first video resolution and the screen resolution; The first video is compressed according to the first scaling factor to obtain the second video; Generate a first live wallpaper that includes the second video; Wherein, the magnification factor of the video frame displayed in the always-on display interface is the first magnification factor.
[0086] The embodiments of this application do not limit the method of acquiring the first video. In some embodiments, the first video can be captured by shooting. In other embodiments, the first video can be downloaded.
[0087] In other embodiments, the first video may also be obtained through other video processing. Optionally, obtaining the first video includes: Obtain a third video, wherein the resolution of the third video is equal to the screen resolution; Based on the preset trajectory, determine the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction; Based on the maximum movement distance, offset resources are added to each video frame in the third video to obtain the first video.
[0088] The embodiments of this application do not limit the method of obtaining the third video; the third video can be captured or downloaded.
[0089] After obtaining the third video, the first video can be generated based on the third video.
[0090] In practice, the movement trajectory of the always-on display interface can be obtained first, i.e., the preset trajectory. Then, the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction can be determined based on the preset trajectory.
[0091] In the first implementation, the preset trajectory can be a longitudinal movement trajectory, and further, as shown in the example below. Figure 4 As shown, with a camera positioned above the screen and a fingerprint recognition area positioned below the screen, the preset trajectory can be the vertical movement trajectory between the camera and the fingerprint recognition area. In this implementation, the always-on display interface only moves vertically across the screen.
[0092] For the first implementation, determining the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction according to the preset trajectory may include: The first maximum upward movement distance of the always-on display interface from the center point of the screen is determined by the second formula. The second maximum downward movement distance of the always-on display interface from the center point of the screen is determined by the third formula. The second formula is: The third formula is: This represents the first maximum movement distance, in pixels (px). The height is the screen resolution, in pixels (px). The distance between the camera and the top edge of the screen is expressed in dp. Screen density; The height of the always-on display interface is in pixels (px). This is the second maximum travel distance, in pixels (px). The distance from the fingerprint recognition area to the bottom edge of the screen is expressed in dp.
[0093] The maximum travel distance in this implementation includes a first maximum travel distance and a second maximum travel distance.
[0094] To better understand the calculation of the first and second maximum travel distances, please refer to [link / reference needed]. Figure 4 .like Figure 4 As shown, the screen can be divided vertically by its center point. The upper area includes the camera, and the lower area includes the fingerprint recognition area. Considering the height of the always-on display area and the distance from the camera to the top of the screen, the first maximum movement distance can be calculated using the second formula. Considering the height of the always-on display area and the distance from the fingerprint recognition area to the bottom of the screen, the second maximum movement distance can be calculated using the third formula.
[0095] In some second implementations, the preset trajectory can be a horizontal movement trajectory between the left and right sides of the screen. In this implementation, the always-on display only moves horizontally across the screen. The maximum movement distance in this implementation includes a third maximum movement distance to the left of the always-on display from the center point of the screen, and a fourth maximum movement distance to the right of the always-on display from the center point of the screen, both of which are: half the screen width minus half the width of the always-on display.
[0096] In the third implementation, the preset trajectory can be a curved trajectory. In this implementation, the always-on display interface can move horizontally and vertically on the screen. The maximum movement distance in this implementation includes the first to fourth maximum movement distances mentioned above.
[0097] After determining the maximum movement distance of the always-on display relative to the center point of the screen in each direction, corresponding offset resources can be added to each video frame of the third video based on the maximum movement distance to ensure that the live wallpaper does not move off the screen during the movement of the always-on display.
[0098] Optionally, in the first implementation described above, the step of adding offset resources to each video frame in the third video based on the maximum moving distance to obtain the first video may include: a) Add a first offset resource above each video frame in the third video, wherein the first offset resource includes N pixel values, where N is an integer greater than or equal to the second maximum movement distance; b) Add a second offset resource below each video frame in the third video, wherein the second offset resource includes M pixel values, where M is an integer greater than or equal to the first maximum movement distance.
[0099] For easier understanding, please refer to Figure 3 .exist Figure 3 In (a), to prevent the video frame from moving off-screen when the always-on display moves upward, an additional layer can be added above the video frame. The pixel values; to prevent video frames from moving off-screen when the always-on display moves down, a pixel value can be added below the video frame. The pixel values. Then, by compressing the video frames, we can obtain... Figure 3 (b) is used to reduce video size and decompression costs.
[0100] for Figure 3 The height of the first video's resolution is: Therefore, the first ratio 'a' can be calculated using formula (1): (1) Optionally, in the second implementation described above, the step of adding offset resources to each video frame in the third video based on the maximum moving distance to obtain the first video may include: c) Add a third offset resource to the left of each video frame in the third video, wherein the first offset resource includes U pixel values, where U is an integer greater than or equal to the third maximum moving distance; d) Add a fourth offset resource to the right of each video frame in the third video, wherein the second offset resource includes T pixel values, where T is an integer greater than or equal to the fourth maximum movement distance.
[0101] The third implementation method described above may include (a) to (d) mentioned above.
[0102] It should be noted that the offset resources added to a video frame can be obtained by copying the resources of that video frame. The resources of a video frame include the video background and video elements. Considering that the always-on display only shows a portion of the video frame's content, the offset resources can be obtained by copying the video background to reduce the chance of video elements being truncated.
[0103] By using the above method, the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction is determined based on the movement trajectory of the always-on display interface. This is then used to increase the offset resources of each video frame in the third video, thereby obtaining a first video with a video resolution greater than the screen resolution. In this way, when rendering live wallpapers, the situation where the wallpaper moves off-screen due to the movement of the always-on display interface can be reduced, thereby improving the rendering effect of live wallpapers.
[0104] After obtaining the first video, the first scaling factor can be determined based on the first resolution of the first video and the screen resolution.
[0105] The first scaling factor can be used to compress each video frame in the first video so that the video resolution of the compressed first video is less than or equal to the screen resolution.
[0106] In some embodiments, determining the first scaling factor based on the first video resolution and the screen resolution may include: Obtain the first height and first width of the first video resolution; Obtain the second height and the second width of the screen resolution; The first proportionality coefficient is determined based on the first ratio of the first height to the second height and the second ratio of the first width to the second width.
[0107] It should be noted that this embodiment applies to the "first video resolution is greater than the screen resolution" manifestations of 1), 2), and 3) above. It can be understood that for 1), the second ratio is 1; and for 2), the first ratio is 1.
[0108] In some implementations, the first ratio and the second ratio can be directly used as the first proportional coefficient. In this way, the video resolution of the compressed first video can be equal to the screen resolution, thereby reducing the video size and decoding pressure of the application's live wallpaper.
[0109] In other embodiments, any value between the first ratio and the first compression threshold, and any value between the second ratio and the second compression threshold, can be selected as the first ratio coefficient. In this way, the video resolution of the compressed first video can be smaller than the screen resolution, thereby reducing the video size and decoding pressure of the applied dynamic wallpaper.
[0110] The first scaling factor determined by the above method can make the video resolution of the compressed first video, i.e. the second video, smaller than the screen resolution. In this way, the video size of the first live wallpaper can be reduced, thereby reducing the decoding pressure during the rendering process of the first live wallpaper.
[0111] In some application scenarios, the first video can be the video in the second live wallpaper, and the third video can be the video in the third live wallpaper.
[0112] In some embodiments, the difference between the second live wallpaper and the first live wallpaper may be that the first live wallpaper includes a compressed first video, while the second live wallpaper includes an uncompressed first video. In this embodiment, the first live wallpaper can be obtained by replacing the first video in the second live wallpaper with the second video. Of course, it is understood that in other embodiments, the first live wallpaper may also include videos other than the second live wallpaper, depending on the actual situation, and this application does not limit this.
[0113] The difference between the third and second live wallpapers lies in the following: the third live wallpaper includes a third video with a resolution equal to the screen resolution, while the second live wallpaper includes a video obtained by adding offset resources to the video frames of the third video. In this embodiment, the second live wallpaper can be obtained by replacing the third video in the third live wallpaper with a first video. Of course, it is understood that in other embodiments, the second live wallpaper may also include videos other than the third live wallpaper, depending on the actual situation, and this application does not limit this.
[0114] In this embodiment, considering that compressing and stretching video frames before displaying them would result in lower video frame clarity and affect the display effect of the live wallpaper, in some embodiments, when the second video is applied to the always-on display interface and the lock screen interface, it may further include: Save the last video frame in the first video; Replacing the last video frame in the second video displayed on the lock screen with the last video frame in the first video also includes: In this embodiment, the always-on display and lock screen play compressed video. Considering that the user's perception of clarity is not significant during playback, but becomes noticeable after the last video frame, the electronic device can save the last video frame from the first video. Subsequently, the last video frame displayed on the lock screen can be replaced with the saved last video frame from the first video.
[0115] Since the first video is uncompressed, the above method can improve the display effect of the lock screen interface.
[0116] It should be noted that the various optional embodiments described in this application can be combined with each other or implemented individually without conflict, and this application does not limit this.
[0117] To facilitate understanding of the wallpaper processing method provided in the above embodiments, the following describes the wallpaper processing method using a specific scenario embodiment.
[0118] The application scenario of this example is as follows: the always-on display area moves vertically between the camera and fingerprint recognition area on the screen. The live wallpaper includes compressed and uncompressed videos; the compressed video from the live wallpaper is played on the always-on display and lock screen, while the uncompressed video from the live wallpaper is displayed on the desktop.
[0119] The wallpaper processing method in this scenario embodiment may include: Step 1: UI designers can rely on screen size to design display effects. To prevent screen burn-in, the position of the always-on display area can be changed every minute, causing the always-on display interface to move.
[0120] Without obstructing the camera and fingerprint recognition areas, the range of movement for the always-on display is divided around the screen's center point. The required vertical increase in video size is determined based on this division. The maximum vertical movement distance of the always-on display can be calculated using the aforementioned second and third formulas.
[0121] Step 2: Based on the range of movement of the always-on display interface, the UI designer needs to add offset resource dimensions to the video, which is the same size as the screen. The added content can be a video background.
[0122] The video frame resource is compared with the previous one by increasing the pixel value of aodDownMaxOffsetY upwards and increasing the pixel value of aodUpMaxOffsetY downwards. This ensures that the video frame does not move off the screen during the alignment process with the always-on display interface.
[0123] The increased pixel value will increase the size of the output video. The original long video can be compressed vertically to match the screen resolution. The compression ratio is a, which can be calculated by formula (1).
[0124] Step 3: Wallpaper initialization will proceed according to... Figure 2 (b) is displayed on the desktop window, which is the original position of the wallpaper, i.e., the position where the target video frame is displayed.
[0125] Since the position of the always-on display interface changes constantly, the current position information of the always-on display interface can be obtained through the settings communication protocol, and the wallpaper offset distance can be calculated according to the first formula.
[0126] The initial position of the first frame of the wallpaper can be set by the offset distance, that is, the first display position, so as to align the first frame of the wallpaper with the animation of the always-on display interface.
[0127] During the wallpaper rendering animation process, the position distance of each frame of the animation is calculated using the motion curve given by the motion effects designer (the sum of the distances moved by each frame is the wallpaper offset distance), and the wallpaper is enlarged by a factor of a to smoothly transition to the original position of the wallpaper.
[0128] This scenario example optimizes one-shot live wallpapers using a video-based solution, reducing file size by over 30%. The compressed video also significantly reduces decoding complexity, improving wallpaper rendering speed and ensuring smooth animation. Furthermore, it aligns the always-on display with the target screen when switching between them, enhancing the live wallpaper's display quality.
[0129] It should be noted that the embodiments of this application are not limited to one-shot live wallpapers, but are also applicable to wallpapers that require large-size video scenes. For example, if the interactive animation of the live wallpaper is a desktop swipe, then the video resources can be processed by horizontal compression.
[0130] Secondly, compressed videos will have some loss of quality, but it is not noticeable during animation. You can simply replace the last frame of the lock screen with a high-definition image.
[0131] If the designer has very strict requirements for the display effect, the video used in the always-on display and lock screen can be split into two segments: the first segment is compressed, and the second segment is uncompressed. The compressed video segment can use the compression and alignment scheme described above, and the current video position is recorded. After the compressed video finishes playing, the wallpaper is no longer enlarged, and the subsequent uncompressed video is played directly to ensure that the final still image is clear.
[0132] The wallpaper processing method provided in this application can be executed by a wallpaper processing device. This application uses a wallpaper processing device executing the wallpaper processing method as an example to illustrate the wallpaper processing device provided in this application.
[0133] like Figure 5 As shown, the wallpaper processing device may include: The acquisition module 501 is used to acquire a first dynamic wallpaper applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, and the always-on area moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video compressed from a first video. The first video has a resolution greater than the screen resolution, and the second video has a resolution less than or equal to the screen resolution. The second video is applied at least on the always-on display interface. The first display module 502 is used to magnify and display video frames of the second video applied to the always-on display interface, wherein the resolution of the magnified video frames is equal to the resolution of the first video. The determining module 503 is used to respond to the first input for triggering the screen to switch to the target interface, and determine the first display position of the first video frame of the target interface according to the current display position of the screen-off display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop; The second display module 504 is used to display the video frame of the first dynamic wallpaper applied to the target interface, with the first display position as the starting display position and the target video frame display position as the ending display position.
[0134] In some embodiments, the second display module includes: The first display submodule is used to display the first video frame of the first dynamic wallpaper applied to the target interface at the first display position; The first determining submodule is used to determine P moving distances from the first display position to the target video frame display position based on the motion effect curve, where P is a natural number; The second determining submodule is used to determine P display positions based on the first display position and the P moving distances, wherein the Pth display position of the P display positions is the target video frame display position; The second display submodule is used to display the second to the P+1th video frames of the first dynamic wallpaper applied to the target interface in the P display positions in chronological order. The third display submodule is used to display the remaining video frames in the first dynamic wallpaper applied to the target interface, excluding the first P+1 video frames, at the target video frame display position.
[0135] In some embodiments, the determining module includes: The third determining submodule is used to determine the wallpaper offset distance based on the current display position of the always-on display interface, wherein the wallpaper offset distance is the distance between the first display position of the first video frame of the target interface and the display position of the target video frame; The fourth determining submodule is used to determine the first display position based on the wallpaper offset distance and the target video frame display position.
[0136] In some embodiments, the third determining submodule is configured to: The first wallpaper offset distance in the first direction is calculated using the first formula; The first formula is: First wallpaper offset distance; The length of the screen resolution in the first direction; The distance of the target video frame display position relative to the center point of the screen in the first direction; The target edge is the distance between the current display position of the always-on display interface and the target edge of the screen in a first direction. When the first direction is vertical and the center point of the target video frame display position is above the center point of the screen, the target edge is the top edge of the screen. When the first direction is vertical and the center point of the target video frame display position is below the center point of the screen, the target edge is the bottom edge of the screen. When the first direction is horizontal and the center point of the target video frame display position is to the left of the center point of the screen, the target edge is the left side of the screen. When the first direction is horizontal and the center point of the target video frame display position is to the right of the center point of the screen, the target edge is the right side of the screen.
[0137] In some embodiments, the acquisition module includes: The first acquisition submodule is used to acquire the first video; The fifth determining submodule is used to determine a first proportional coefficient based on the first video resolution and the screen resolution; The compression submodule is used to compress the first video according to the first ratio coefficient to obtain the second video; A generation submodule is used to generate a first dynamic wallpaper that includes the second video; Among them, the magnification factor of the video frame displayed in the always-on display interface is the first magnification factor.
[0138] In some embodiments, the first acquisition submodule includes: The first acquisition unit is used to acquire a third video, wherein the resolution of the third video is equal to the screen resolution; The first determining unit is used to determine the maximum moving distance of the screen-off display interface relative to the center point of the screen in each direction according to the preset trajectory. An additional unit is used to add offset resources to each video frame in the third video according to the maximum movement distance to obtain the first video.
[0139] In some embodiments, when the preset trajectory is a vertical movement trajectory between the camera and a fingerprint recognition area, the camera is positioned above the screen and the fingerprint recognition area is positioned below the screen, the first determining unit is configured to: The first maximum upward movement distance of the always-on display interface from the center point of the screen is determined by the second formula. The second maximum downward movement distance of the always-on display interface from the center point of the screen is determined by the third formula. The second formula is: The third formula is: This is the first maximum travel distance; The height is the screen resolution. The distance between the camera and the top edge of the screen; Screen density; The height of the always-on display interface; This is the second maximum travel distance; The distance between the fingerprint recognition area and the bottom edge of the screen.
[0140] In some embodiments, the adding unit is configured to: A first offset resource is added above each video frame in the third video, wherein the first offset resource includes N pixel values, where N is an integer greater than or equal to the second maximum movement distance; A second offset resource is added below each video frame in the third video, wherein the second offset resource includes M pixel values, where M is an integer greater than or equal to the first maximum movement distance.
[0141] In some embodiments, the fifth determining submodule includes: The second acquisition unit is used to acquire the first height and the first width of the first video resolution; The third acquisition unit is used to acquire the second height and the second width of the screen resolution; The second determining unit is configured to determine the first proportionality coefficient based on a first ratio of the first height to the second height and a second ratio of the first width to the second width.
[0142] In some embodiments, when the second video is applied to the always-on display interface and the lock screen interface, the wallpaper processing device further includes: A storage module is used to save the last video frame in the first video. The replacement module is used to replace the last video frame in the second video displayed on the lock screen with the last video frame in the first video.
[0143] The wallpaper processing device in this application embodiment can be an electronic device or a component of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the device.
[0144] The wallpaper processing device in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0145] The wallpaper processing apparatus provided in this application embodiment can implement the various processes implemented in the method embodiment, and will not be described again here to avoid repetition.
[0146] Optionally, such as Figure 6 As shown, this application embodiment also provides an electronic device 600, including a processor 601 and a memory 602. The memory 602 stores a program or instructions that can run on the processor 601. When the program or instructions are executed by the processor 601, they implement the various steps of the above-described wallpaper processing method embodiment and can achieve the same technical effect. To avoid repetition, they will not be described again here.
[0147] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0148] Figure 7A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0149] The electronic device 700 includes, but is not limited to, components such as: radio frequency unit 701, network module 702, audio output unit 703, input unit 704, sensor 705, display unit 706, user input unit 707, interface unit 708, memory 709, and processor 710.
[0150] Those skilled in the art will understand that the electronic device 700 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 710 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 7 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0151] The processor 710 is configured to acquire a first dynamic wallpaper applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, which moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video compressed from a first video. The first video has a first video resolution greater than the screen resolution, and the second video has a second video resolution less than or equal to the screen resolution. The second video is applied at least to the always-on display interface. Display unit 706 is configured to magnify and display video frames of the second video applied to the always-on display interface, wherein the resolution of the magnified video frames is equal to the resolution of the first video. The processor 710 is configured to respond to a first input for triggering screen switching to a target interface, and determine the first display position of the first video frame of the target interface based on the current display position of the always-on display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop; Display unit 706 is configured to display video frames from the first dynamic wallpaper applied to the target interface, with the first display position as the starting display position and the target video frame display position as the ending display position.
[0152] In some embodiments, the processor 710 is configured to: display the first video frame of the first dynamic wallpaper applied to the target interface at the first display position; and determine P moving distances from the first display position to the display position of the target video frame, where P is a natural number, based on the motion effect curve. Display unit 706 is configured to: determine P display positions based on the first display position and the P moving distances, wherein the Pth display position is the target video frame display position; sequentially display the second to the (P+1)th video frames of the first dynamic wallpaper applied to the target interface in chronological order at the P display positions; and display the remaining video frames of the first dynamic wallpaper applied to the target interface, excluding the first (P+1)th video frames, at the target video frame display position.
[0153] In some embodiments, the processor 710 is configured to: determine a wallpaper offset distance based on the current display position of the always-on display interface, wherein the wallpaper offset distance is the distance between the first display position of the first video frame of the target interface and the display position of the target video frame; and determine the first display position based on the wallpaper offset distance and the display position of the target video frame.
[0154] In some embodiments, the processor 710 is configured to: The first wallpaper offset distance in the first direction is calculated using the first formula; The first formula is: First wallpaper offset distance; The length of the screen resolution in the first direction; The distance of the target video frame display position relative to the center point of the screen in the first direction; The target edge is the distance between the current display position of the always-on display interface and the target edge of the screen in a first direction. When the first direction is vertical and the center point of the target video frame display position is above the center point of the screen, the target edge is the top edge of the screen. When the first direction is vertical and the center point of the target video frame display position is below the center point of the screen, the target edge is the bottom edge of the screen. When the first direction is horizontal and the center point of the target video frame display position is to the left of the center point of the screen, the target edge is the left side of the screen. When the first direction is horizontal and the center point of the target video frame display position is to the right of the center point of the screen, the target edge is the right side of the screen.
[0155] In some embodiments, the processor 710 is configured to: acquire the first video; determine a first scaling factor based on the resolution of the first video and the screen resolution; compress the first video according to the first scaling factor to obtain the second video; and generate a first dynamic wallpaper including the second video; wherein the scaling factor of the video frame magnified in the always-on display interface is the first scaling factor.
[0156] In some embodiments, the processor 710 is configured to: acquire a third video, wherein the resolution of the third video is equal to the screen resolution; determine the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction according to the preset trajectory; and add offset resources to each video frame in the third video according to the maximum movement distance to obtain a first video.
[0157] In some embodiments, when the preset trajectory is a vertical movement trajectory between the camera and the fingerprint recognition area, the camera is located above the screen and the fingerprint recognition area is located below the screen, the processor 710 is configured to: determine, by a second formula, a first maximum upward movement distance of the always-on display interface from the center point of the screen; and determine, by a third formula, a second maximum downward movement distance of the always-on display interface from the center point of the screen. The second formula is: The third formula is: This is the first maximum travel distance; The height is the screen resolution. The distance between the camera and the top edge of the screen; Screen density; The height of the always-on display interface; This is the second maximum travel distance; The distance between the fingerprint recognition area and the bottom edge of the screen.
[0158] In some embodiments, the processor 710 is configured to: add a first offset resource above each video frame in the third video, wherein the first offset resource includes N pixel values, where N is an integer greater than or equal to the second maximum movement distance; and add a second offset resource below each video frame in the third video, wherein the second offset resource includes M pixel values, where M is an integer greater than or equal to the first maximum movement distance.
[0159] In some embodiments, the processor 710 is configured to: obtain a first height and a first width of the first video resolution; obtain a second height and a second width of the screen resolution; and determine a first scaling factor based on a first ratio of the first height to the second height and a second ratio of the first width to the second width.
[0160] In some embodiments, the processor 710 is configured to: save the last video frame in the first video; and replace the last video frame in the second video displayed on the lock screen with the last video frame in the first video.
[0161] It should be understood that, in this embodiment, the input unit 704 may include a graphics processing unit (GPU) 7041 and a microphone 7042. The GPU 7041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 707 includes at least one of a touch panel 7071 and other input devices 7072. The touch panel 7071 is also called a touch screen. The touch panel 7071 may include a touch detection device and a touch controller. Other input devices 7072 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, power buttons, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0162] The memory 709 can be used to store software programs and various data. The memory 709 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 709 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 709 in the embodiments of this application includes, but is not limited to, these and any other suitable types of memory.
[0163] Processor 710 may include one or more processing units; optionally, processor 710 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 710.
[0164] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described wallpaper processing method embodiments and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0165] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0166] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described wallpaper processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0167] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0168] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the wallpaper processing method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0169] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0170] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0171] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A wallpaper processing method, characterized in that, include: A first dynamic wallpaper is obtained and applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, which is the illuminated area of the electronic device when the screen is off. The always-on area moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video compressed from a first video. The first video has a resolution greater than the screen resolution, and the second video has a resolution less than or equal to the screen resolution. The second video is applied at least to the always-on display interface. The video frames in the second video applied to the always-on display interface are enlarged and displayed on the always-on display interface, wherein the resolution of the enlarged video frames is equal to the resolution of the first video; In response to a first input for triggering screen switching to a target interface, the first display position of the first video frame of the target interface is determined based on the current display position of the always-on display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop; Using the first display position as the starting display position and the target video frame display position as the ending display position, the video frame of the first dynamic wallpaper applied to the target interface is displayed on the target interface.
2. The method according to claim 1, characterized in that, The step of displaying the video frame from the first dynamic wallpaper applied to the target interface, with the first display position as the starting display position and the target video frame display position as the ending display position, includes: The first video frame of the first live wallpaper applied to the target interface is displayed at the first display position; Based on the motion effect curve, determine the P moving distances from the first display position to the target video frame display position, where P is a natural number; Based on the first display position and the P moving distances, P display positions are determined, and the Pth display position of the P display positions is the display position of the target video frame; The second to the (P+1)th video frames of the first dynamic wallpaper applied to the target interface are displayed sequentially at the P display positions in chronological order. The remaining video frames, excluding the first P+1 video frames, are displayed at the target video frame display position from the video frames applied to the target interface in the first dynamic wallpaper.
3. The method according to claim 1, characterized in that, Determining the first display position of the first video frame of the target interface based on the current display position of the always-on display interface and the preset target video frame display position includes: Based on the current display position of the always-on display interface, the wallpaper offset distance is determined, wherein the wallpaper offset distance is the distance between the first display position of the first video frame of the target interface and the display position of the target video frame; The first display position is determined based on the wallpaper offset distance and the target video frame display position.
4. The method according to claim 3, characterized in that, Determining the wallpaper offset distance based on the current display position of the always-on display interface includes: The first wallpaper offset distance in the first direction is calculated using the first formula; The first formula is: First wallpaper offset distance; The length of the screen resolution in the first direction; The distance of the target video frame display position relative to the center point of the screen in the first direction; The target edge is the distance between the current display position of the always-on display interface and the target edge of the screen in a first direction. When the first direction is vertical and the center point of the target video frame display position is above the center point of the screen, the target edge is the top edge of the screen. When the first direction is vertical and the center point of the target video frame display position is below the center point of the screen, the target edge is the bottom edge of the screen. When the first direction is horizontal and the center point of the target video frame display position is to the left of the center point of the screen, the target edge is the left side of the screen. When the first direction is horizontal and the center point of the target video frame display position is to the right of the center point of the screen, the target edge is the right side of the screen.
5. The method according to any one of claims 1 to 4, characterized in that, The process of acquiring the first dynamic wallpaper applied to the always-on display, lock screen, and desktop includes: Obtain the first video; A first scaling factor is determined based on the first video resolution and the screen resolution; The first video is compressed according to the first scaling factor to obtain the second video; Generate a first live wallpaper that includes the second video; Wherein, the magnification factor of the video frame displayed in the always-on display interface is the first magnification factor.
6. The method according to claim 5, characterized in that, The step of obtaining the first video includes: Obtain a third video, wherein the resolution of the third video is equal to the screen resolution; Based on the preset trajectory, determine the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction; Based on the maximum movement distance, offset resources are added to each video frame in the third video to obtain the first video.
7. The method according to claim 6, characterized in that, When the preset trajectory is a vertical movement trajectory between the camera and the fingerprint recognition area, with the camera positioned above the screen and the fingerprint recognition area positioned below the screen, determining the maximum movement distance of the always-on display interface relative to the center point of the screen in each direction based on the preset trajectory includes: The first maximum upward movement distance of the always-on display interface from the center point of the screen is determined by the second formula. The second maximum downward movement distance of the always-on display interface from the center point of the screen is determined by the third formula. The second formula is: The third formula is: This is the first maximum travel distance; The height is the screen resolution. The distance between the camera and the top edge of the screen; Screen density; The height of the always-on display interface; This is the second maximum travel distance; The distance between the fingerprint recognition area and the bottom edge of the screen.
8. The method according to claim 7, characterized in that, The step of adding offset resources to each video frame in the third video based on the maximum movement distance to obtain the first video includes: A first offset resource is added above each video frame in the third video, wherein the first offset resource includes N pixel values, where N is an integer greater than or equal to the second maximum movement distance; A second offset resource is added below each video frame in the third video, wherein the second offset resource includes M pixel values, where M is an integer greater than or equal to the first maximum movement distance.
9. The method according to claim 5, characterized in that, Determining the first scaling factor based on the first video resolution and the screen resolution includes: Obtain the first height and first width of the first video resolution; Obtain the second height and the second width of the screen resolution; The first proportionality coefficient is determined based on the first ratio of the first height to the second height and the second ratio of the first width to the second width.
10. The method according to claim 1, characterized in that, When the second video is applied to the always-on display and the lock screen, it further includes: Save the last video frame in the first video; Replace the last video frame in the second video displayed on the lock screen with the last video frame in the first video.
11. A wallpaper processing device, characterized in that, include: The acquisition module is used to acquire a first dynamic wallpaper applied to the always-on display interface, the lock screen interface, and the desktop. The always-on display interface is the display interface of the always-on area, which is the illuminated area of the electronic device when the screen is off. The always-on area moves on the screen according to a preset trajectory. The first dynamic wallpaper includes at least a second video compressed from a first video. The first video has a resolution greater than the screen resolution, and the second video has a resolution less than or equal to the screen resolution. The second video is applied at least to the always-on display interface. A first display module is configured to magnify and display video frames from the second video applied to the always-on display interface, wherein the resolution of the magnified video frames is equal to the resolution of the first video. The determining module is configured to respond to a first input for triggering screen switching to a target interface, and determine the first display position of the first video frame of the target interface based on the current display position of the screen-off display interface and the preset target video frame display position, wherein the target interface is the lock screen interface or the desktop; The second display module is used to display the video frame of the first dynamic wallpaper applied to the target interface, with the first display position as the starting display position and the target video frame display position as the ending display position.
12. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the wallpaper processing method as described in any one of claims 1 to 10.
13. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the wallpaper processing method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Video playing method, video playing device, electronic equipment and storage medium
CN111669664A
Wallpaper display method and device, equipment, storage medium and program product
CN115543159A