Picture display method and electronic device

CN122945913APending Publication Date: 2026-10-20HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510436056.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-07
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]然而,该图片显示方式需要占用较多的CPU和GPU资源,显示处理耗时较长,图片显示延迟较大,设备功耗较大

Benefits of technology

[0028]第四方面,提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行上述第一方面任一项中的图片显示方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure HDA0005349937550000011
    Figure HDA0005349937550000011
  • Figure HDA0005349937550000021
    Figure HDA0005349937550000021
  • Figure HDA0005349937550000031
    Figure HDA0005349937550000031
Patent Text Reader

Abstract

This application provides an image display method and an electronic device, relating to the field of terminal technology. In this method, the electronic device can obtain a compressed texture file from a file system, map the compressed texture file to a graphics processor, and sample the texture data in the compressed texture file using a sampler in the graphics processor, thereby displaying the image. This method reduces the steps of CPU decompression and image processing, as well as the CPU's transmission of texture data to the GPU, during image display, reducing transmission latency, saving processing and transmission resources, and lowering the power consumption of the electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to an image display method and an electronic device. Background Technology

[0002] Images in electronic devices are typically stored in compressed formats, such as JPG or BMP, within the file system. This saves storage space on electronic devices and makes it easier to manage and use images.

[0003] Currently, in the process of displaying images on electronic devices, the electronic devices need to decompress and process the compressed images through the central processing unit (CPU), upload the processed images to the graphics processing unit (GPU) for texture binding through the application programming interface, and finally display the images through sampling by the sampler.

[0004] However, this image display method requires a significant amount of CPU and GPU resources, resulting in long display processing times, large image display latency, and high device power consumption. Summary of the Invention

[0005] This application provides an image display method and an electronic device that can store compressed texture files in a file system and directly map them to a graphics processor. The image is then displayed after sampling the texture data from the compressed texture files using a sampler. This reduces the processing operations and power consumption of the central processing unit (CPU) and graphics processor, eliminates data transfer between the CPU and graphics processor, saves bandwidth, reduces image display latency, and lowers the power consumption of the electronic device.

[0006] To achieve the above objectives, the embodiments of this application adopt the following technical solutions:

[0007] Firstly, an image display method is provided, applied to an electronic device. The electronic device's file system stores a compressed texture file of the image. The method includes: the electronic device retrieving the compressed texture file from a file system and mapping it to a graphics processor; the electronic device sampling the texture data in the compressed texture file using a sampler, and then displaying the image.

[0008] In the image display method described above, the electronic device can obtain compressed texture files from the file system and map them to the graphics processor (GPU) via an optimized data channel. This significantly reduces intermediate processing steps and data transfer operations by the central processing unit (CPU), thereby reducing the processing load and power consumption of both the CPU and GPU. It effectively controls the amount of data transferred from the CPU to the GPU, saves bandwidth, shortens the image display latency, and ultimately optimizes the power consumption of the electronic device. Furthermore, after the compressed texture file is mapped to the GPU, the electronic device can directly sample the texture data from the compressed texture file using the sampler in the GPU. This reduces the need for the sampler to perform conversion processing on the compressed texture data, decreases the computational overhead of the sampler during the sampling process, and lowers the power consumption of the electronic device.

[0009] In one possible implementation of the first aspect, the file system also stores compressed image files of the image; that is, the file system stores compressed texture files and compressed image files of the image. The compressed image files can be used for image processing. For example, image processing includes forwarding or editing images.

[0010] Therefore, electronic devices can also store compressed image files containing images in the file system, which facilitates the editing and / or forwarding of images by the electronic devices.

[0011] In one possible implementation of the first aspect, the electronic device includes a shared memory region for a graphics processor and a central processing unit. The electronic device retrieves a compressed texture file from a file system and loads it into the shared memory region. Subsequently, the electronic device maps the compressed texture file from the shared memory region to the graphics processor.

[0012] Therefore, electronic devices can map compressed texture files in the file system to the graphics processor through shared memory areas, reducing the steps of central processing and data transfer, effectively controlling resource overhead, and improving resource utilization.

[0013] In one possible implementation of the first aspect, the electronic device retrieves a compressed texture file from the file system using memory addressing technology and loads the compressed texture file into a shared memory region. Subsequently, the graphics processor in the electronic device maps the compressed texture file from the shared memory region into the texture memory of the graphics processor using memory mapping technology.

[0014] Therefore, electronic devices can first obtain compressed texture files from the file system and load them into a shared memory region using DMA technology. Then, the electronic device can use memory mapping technology to map the compressed texture files from the shared memory region to the texture memory of the graphics processor, improving the efficiency of texture data transfer. During the mapping process, the electronic device reduces CPU decompression and image processing operations, and can directly use the texture data in the compressed texture file, significantly reducing resource consumption.

[0015] In one possible implementation of the first aspect, the electronic device decodes texture data in a compressed texture file via a sampler and samples the decoded texture data.

[0016] Therefore, the sampler can directly decode and sample compressed texture files mapped to the graphics processor without performing data conversion on the compressed texture files. This effectively controls the computational overhead in the texture data processing process, improves the sampling efficiency of texture data, and reduces latency.

[0017] In one possible implementation of the first aspect, the data structure of the compressed texture file of the image is adapted to the data structure that the sampler in the graphics processor supports processing; and / or, the data format of the compressed texture file of the image is adapted to the data format that the sampler in the graphics processor supports processing.

[0018] Therefore, the data structure of the compressed texture file of the image is compatible with the data structure supported by the sampler in the graphics processing unit (GPU). This allows the sampler to directly sample the compressed texture file without needing to perform data conversion processing to convert it into a data format or structure supported by the sampler, reducing computational overhead during the sampling process and improving sampling accuracy.

[0019] In one possible implementation of the first aspect, the method reduces the decoding and image processing operations of the central processing unit (CPU) and the steps of the CPU transferring texture data to the graphics processor.

[0020] Therefore, by reducing the number of steps involved in decompression and data transmission by the central processing unit (CPU) during image display, electronic devices reduce image transmission latency. Furthermore, by reducing the number of steps in which the CPU transmits texture data to the graphics processing unit (GPU), electronic devices reduce data transmission volume and conserve bandwidth resources. In addition, electronic devices reduce the additional workload on the CPU and GPU, lowering power consumption and improving the user experience.

[0021] In one possible implementation of the first aspect, the compressed texture file of the image is generated when storing a compressed image file of the image; or, the compressed texture file of the image is generated by any one or more of the following methods: batch generation, wherein multiple compressed texture files generated in the batch include the compressed texture file of the image; or, generation during an idle period of the electronic device; or, acquisition from another device and generation by the other device.

[0022] Therefore, electronic devices can generate compressed texture files for images in real time, avoiding the problem of image display delay caused by the inability to generate compressed texture files in time and the need to use compressed image files for display, thus improving image display efficiency.

[0023] Furthermore, electronic devices can also generate compressed texture files through any one or more combinations of the following methods: Electronic devices can generate multiple compressed texture files in batches during predefined time periods. These multiple compressed texture files can include compressed texture files of images, thereby improving the efficiency of compressed file generation, avoiding frequent calls to compression tools to generate compressed texture files, and improving resource utilization. Electronic devices can also generate compressed texture files of images during idle periods, avoiding the occupation of additional memory space when the electronic device's memory resources are scarce, thus avoiding increasing the system burden and reducing the performance of the electronic device. Electronic devices can also obtain compressed texture files of images from other devices, where the compressed texture files of the images are generated by other devices, thereby saving the resource overhead of generating compressed texture files and reducing the power consumption of the electronic device.

[0024] In one possible implementation of the first aspect, the compressed texture file is generated as follows: First, the electronic device acquires a compressed image file of the image. Then, the electronic device uses a texture generation tool or software development kit tool to convert the compressed image file into texture data, and packages the texture data into a compressed texture file that can be recognized by the graphics processor.

[0025] Therefore, electronic devices can acquire compressed image files and, using texture generation tools or software development kits, convert these compressed image files into texture data. This data is then packaged into a compressed texture file that can be recognized by the sampler and stored in the file system. This allows the compressed texture file to be directly mapped to the graphics processor during image display, reducing intermediate processing steps and data transfer by the central processing unit. Furthermore, this compressed texture file can be directly sampled by the sampler in the graphics processor, reducing additional sampling overhead.

[0026] In a second aspect, an electronic device is provided, comprising: a memory and one or more processors; the memory and the processors are coupled; wherein the memory stores computer program code, the computer program code including computer instructions, which, when executed by the processor, cause the electronic device to perform the image display method of any of the first aspects above.

[0027] Thirdly, a computer-readable storage medium is provided, including computer instructions that, when executed on an electronic device, cause the electronic device to perform the image display method described in any of the first aspects above.

[0028] Fourthly, a computer program product is provided, which, when run on a computer, causes the computer to execute the image display method described in any of the first aspects above.

[0029] It is understood that the beneficial effects achieved by the electronic device described in the second aspect, the computer-readable storage medium described in the third aspect, and the computer program product described in the fourth aspect can be referred to in the beneficial effects of the first aspect and any possible implementation thereof, and will not be repeated here. Attached Figure Description

[0030] Figure 1 A schematic diagram illustrating the process of displaying images on an electronic device, provided for related technologies;

[0031] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0032] Figure 3 A schematic diagram of the software structure of an electronic device provided in an embodiment of this application;

[0033] Figure 4 A flowchart illustrating an image display method provided in an embodiment of this application;

[0034] Figure 5 A flowchart illustrating another image display method provided in an embodiment of this application;

[0035] Figure 6 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0036] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. "Multiple" can be understood as "at least two"; "multiple items" can be understood as "at least two items."

[0037] In embodiments of this application, 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 limitation, 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.

[0038] In the embodiments of this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.

[0039] In the embodiments of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "set", "connected", and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of this application based on the specific circumstances.

[0040] Images in electronic devices are typically stored in a compressed format, such as JPG or BMP, within the file system. In response to a user-instructed action to display an image, the electronic device needs to process the compressed image in both CPU and GPU memory before displaying it.

[0041] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the process of displaying an image on an electronic device, provided for related technologies. For example... Figure 1As shown, during image display, the electronic device first retrieves the compressed image (i.e., compressed image file) from the file system. Then, it decompresses the compressed image file in CPU memory, converting it into uncompressed image data, and performs image processing (e.g., using Skimage). The electronic device then transfers the processed image data to GPU memory via a graphics application programming interface (API), such as OpenGL or DirectX. Afterward, the electronic device uses the GPU driver to convert the image data into texture data, binds the texture data to the image display area, and then the sampler samples the image for display.

[0042] Texture data describes the details of an image, such as its color and pattern.

[0043] The image display method described above requires additional CPU resources during the decompression and processing of compressed images, increasing image display latency and causing unnecessary resource waste. Furthermore, the process of transferring texture data from CPU memory to GPU memory via the interface consumes data transfer bandwidth, takes longer to process, and consumes additional power, increasing the power consumption of the electronic device and impacting the user experience.

[0044] In view of this, this application provides an image display method. In this method, the electronic device can store compressed image and texture data in a file system. The GPU can directly process the texture data, reducing CPU decompression and data transfer operations, thus reducing processing operations and power consumption of the central processing unit and graphics processor. It also eliminates data transfer from the central processing unit to the graphics processor, saving bandwidth, reducing image display latency, lowering the power consumption of the electronic device, and improving image display performance and efficiency.

[0045] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 2As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, antenna 1, antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a camera 191, a display screen 192, etc. The sensor module 180 may include a pressure sensor 180A, an accelerometer 180B, a proximity sensor 180C, a fingerprint sensor 180D, a touch sensor 180E, etc.

[0046] It is understood that the structure illustrated in this application does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0047] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, GPU 110A, image signal processor (ISP), CPU 110B, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0048] The GPU 110A is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs 110A, which execute program instructions to generate or modify display information.

[0049] For example, in this embodiment of the application, GPU110A can obtain a compressed texture file from a shared memory region, bind the compressed texture file to the image display region, and sample the compressed texture file through the sampler in GPU110A, thereby facilitating image display.

[0050] Electronic device 100 implements image display function through GPU 110A, display screen 192, and application processor.

[0051] Display screen 192 is used to display images, videos, etc. Display screen 192 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a Micro LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc.

[0052] For example, the electronic device displays the image data sampled and displayed by the sampler on the display screen 192, thereby facilitating the user's browsing of the images.

[0053] The CPU110B may include a controller, which can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0054] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0055] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.

[0056] For example, an electronic device can connect to other devices via an external memory interface to obtain compressed texture files generated by those other devices.

[0057] Internal memory 121 can be used to store executable program code, including instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.).

[0058] For example, the internal memory 121 in this application embodiment can store compressed image files and compressed texture files of images in the file system.

[0059] Touch sensor 180E, also known as a "touch panel," can be located on display screen 192. The touch sensor 180E and display screen 192 together form a touchscreen, also known as a "touch screen." Touch sensor 180E detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 192. In other embodiments, touch sensor 180E may also be located on the surface of electronic device 100, in a different position than display screen 192.

[0060] The electronic device 100 can open the image to be displayed via the touch sensor 180E, and then display the image on the display screen 192.

[0061] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100. However, this application embodiment does not limit the type of operating system for the electronic device. For example, system, system, system, Systems, etc.

[0062] Please see Figure 3 , Figure 3 This is a schematic diagram of the software structure of an electronic device provided in an embodiment of this application. Figure 3 As shown, the layered architecture divides the hardware and software structure into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, ... Taking the system as an example, The system is divided into four layers, from top to bottom: application layer, application framework layer, system library, and kernel layer.

[0063] The application layer may include application 201. Application 201 may be a third-party application and / or a system application. This application embodiment does not limit the content of the application layer.

[0064] For example, application 201 can provide an entry point for electronic device 100 to query images.

[0065] The application framework layer can provide application programming interfaces (APIs) and programming frameworks for applications.

[0066] In some embodiments, the application framework layer may include a view system 211. The view system 211 can be used to build the application. The view system 211 may include visual controls, such as controls for displaying text, controls for displaying images, etc.

[0067] For example, electronic device 100 can display images in conjunction with the GPU through a control for displaying images in view system 211.

[0068] The system library may include multiple functional modules. For example: surface manager 221, file system library 222, 3D graphics processing library 223 (e.g., OpenGL ES), 2D graphics engine 224 (e.g., SGL), etc.

[0069] The Surface Manager 221 is used to manage the display subsystem and provides the fusion of two-dimensional and three-dimensional layers for multiple applications.

[0070] File system library 222 supports a variety of commonly used image, audio, and video files. File system library 222 supports multiple file formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0071] For example, the electronic device stores image-related files, such as compressed image files and compressed texture files, through the file system library 222 and the memory.

[0072] The 3D graphics processing library 223 is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0073] 2D Graphics Engine 224 is a drawing engine for 2D graphics.

[0074] For example, the electronic device renders and synthesizes the data sampled by the sampler through multiple functional modules in the system library, so that the processed image can be displayed on the display screen 192.

[0075] The kernel layer is located below the native layer and is the layer between hardware and software. The kernel layer may include the display driver 231 and the GPU driver 232, and may also include other content. This application embodiment does not limit the content of the kernel layer.

[0076] The display driver 231 enables the operating system to communicate with the display device, such as a display screen.

[0077] Among them, GPU driver 232 is the software used to control and manage the GPU.

[0078] For example, the electronic device 100 in this application embodiment can be connected to the display screen 192 through the display driver 231 to display images.

[0079] It should be understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0080] The technical solutions involved in the following embodiments can all be implemented in the electronic device 100 having the above-described hardware or software architecture.

[0081] The electronic devices in this application embodiment can be smart screen devices, smart TVs (TVs), mobile phones, tablets, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), wearable devices (such as smartwatches and smart bracelets), and other devices with image display capabilities. This application embodiment does not impose any special limitations on the specific form of the electronic device. The method in this application embodiment can be applied to application scenarios such as game development, virtual reality (VR) and augmented reality (AR), autonomous driving, and mobile devices. This application embodiment does not limit the application scenarios of the method.

[0082] Below, embodiments of this application will be used to illustrate the use of... Figure 2 and Figure 3 Taking the illustrated electronic device as an example, and in conjunction with the accompanying drawings and application scenarios, the image display method provided in this application will be described in detail. It is understood that the illustrative flowcharts provided in this application mainly use an electronic device as the execution subject of the interaction to illustrate the method, but this application does not limit the execution subject of the interaction. For example, the device in the illustrative flowchart can also be a chip, chip system, or processor that supports the device in implementing the method, or it can be a logic module or software that can implement all or part of the functions of the device.

[0083] Based on the above description, the image display method in this application embodiment needs to use the compressed texture file of the image. The process of generating the compressed texture file of the image is described below.

[0084] Compressed texture files for images can be generated in various ways. Below, we will describe in detail the methods for generating compressed texture files for images, using several implementation examples.

[0085] In one implementation, the compressed texture file of the image is generated by the electronic device when storing the compressed image file of the image.

[0086] In some embodiments, the generation processes of compressed texture files and compressed image files can be executed in parallel. For example, an electronic device can generate compressed texture files and compressed image files in parallel using multithreading or distributed computing techniques. In other embodiments, the electronic device can generate compressed texture files after generating compressed image files. This application does not limit the generation order of compressed image files and compressed texture files.

[0087] In summary, electronic devices can generate compressed texture files for images in real time, avoiding image display delays caused by the failure to generate compressed texture files and improving image display efficiency.

[0088] In another implementation, the compressed texture file of the image is generated using one or more of the following methods:

[0089] The compressed texture files are generated in batches by electronic devices, including compressed texture files of images; or they are generated during idle periods of the electronic devices; or they are obtained from other devices and generated by those other devices.

[0090] Electronic devices can generate multiple compressed texture files in batches within a predefined time period. These compressed texture files can include compressed texture files of images, thereby improving the efficiency of compressed file generation, avoiding frequent calls to compression tools to generate compressed texture files, and improving resource utilization.

[0091] Electronic devices can also generate compressed texture files of images during idle periods, avoiding the use of extra memory space when the electronic device's memory resources are scarce, thus reducing the system burden and performance of the electronic device.

[0092] Electronic devices can also obtain compressed texture files of images from other devices, where the compressed texture files are generated by other devices, thereby saving the electronic devices the resource overhead of generating compressed texture files and reducing the power consumption of the electronic devices.

[0093] If the compressed texture file is not generated during the display of an image on the electronic device, the electronic device can refer to... Figure 1 The image is displayed as shown, and will not be described further here.

[0094] Based on the above description, compressed texture files for images can be generated in various ways. The following is a detailed description of how compressed texture files are formed using each method.

[0095] Electronic devices first acquire the compressed image file of the image, and then use texture generation tools or software development kits to convert the compressed image file into texture data, and package the texture data into a compressed texture file that can be recognized by the graphics processor.

[0096] The texture generation tool or software development kit (SDK) is used to convert compressed image files into texture data. In some embodiments, the electronic device can use an SSD, such as the UWBC toolchain, to convert compressed image files into texture data. In other embodiments, the electronic device can use a texture generation tool, such as PixPlant or Surforge, to convert compressed image files into texture data. This application does not limit the conversion method for converting compressed image files into texture data.

[0097] In this context, "compressed texture files recognizable by the graphics processor" refers to files whose data format and / or data structure the graphics processor can recognize, decode, and sample. In other words, the data structure supported by the graphics processor is compatible with the data structure of the compressed texture file, and / or the data format supported by the graphics processor is compatible with the data format of the compressed texture file.

[0098] In summary, electronic devices can acquire compressed image files and, using texture generation tools or software development kits, convert these compressed image files into texture data. This data is then packaged into a compressed texture file that can be recognized by the sampler and stored in the file system. This allows the compressed texture file to be directly mapped to the graphics processor during image display, reducing processing steps and data transfer by the central processing unit. Furthermore, this compressed texture file can be directly sampled by the sampler in the graphics processor, reducing additional sampling overhead.

[0099] Please see Figure 4 , Figure 4 This is a flowchart illustrating an image display method provided in an embodiment of this application. Figure 4 As shown, the image display method provided in this application embodiment may include:

[0100] S101, The electronic device obtains the compressed texture file of the image from the file system and maps it to the graphics processor.

[0101] The file system is used to store and manage files in the electronic device. In some embodiments, the file system is used to manage image files, such as JPG files, BMP files, compressed texture files, etc. In other embodiments, the file system is used to manage video or audio files, such as MP3 files, MP4 files, etc. The file system can also store and manage other types of files; the embodiments of this application do not limit the storage content of the file system.

[0102] The image can be a static image or a dynamic image. Alternatively, the image can be a video frame from a video file. This application does not limit the type or category of images.

[0103] The images can be taken by electronic devices or downloaded or saved by electronic devices. This application does not limit the source of the images.

[0104] Compressed texture files are texture data in a compressed texture format. Examples of compressed texture formats include Universal Block Compression (UBWC) and Block Compression (BC). Compressed texture formats are efficient compression formats that can significantly reduce the storage space of texture data and improve resource utilization.

[0105] Compressed texture files may include texture data, image identifiers, and other content. This application does not limit the specific content of the compressed texture file. The image identifier is used to uniquely identify the image, avoiding the sampling of incorrect texture files and the display of incorrect images.

[0106] In some embodiments of this application, in addition to storing compressed texture files of images, the file system also stores compressed image files of images.

[0107] The compressed image files are used for image processing. In some embodiments, the compressed image files are used for forwarding images. In other embodiments, the compressed image files are used for editing images; however, this application does not limit the purpose of the compressed files.

[0108] Compressed image files can be JPG files, BMP files, or other formats. This application does not limit the format of the compressed image files.

[0109] In summary, electronic devices can also store compressed image files in the file system, which facilitates the editing and / or forwarding of images by the electronic devices.

[0110] In one specific embodiment, the electronic device includes a shared memory region of a graphics processor and a central processing unit. The electronic device retrieves a compressed texture file from a file system and loads it into the shared memory region. The electronic device then maps the compressed texture file from the shared memory region to the graphics processor.

[0111] In this context, the shared memory region is a memory region allocated by the electronic device, which can be accessed by both the graphics processor and the central processing unit. In some embodiments, the shared memory region may be a memory region pre-allocated by the electronic device during system startup. In other embodiments, the shared memory region may be a memory region allocated by the electronic device during image reading; the allocation time of the shared memory region is not limited in this application embodiment.

[0112] Electronic devices can retrieve compressed texture files from the file system using memory addressing technology and load the compressed texture files into a shared memory area.

[0113] Among them, memory addressing technology is used to obtain and load data in memory. Memory addressing technology can be direct addressing, indirect addressing, or register addressing, etc., and the embodiments of this application do not limit the type of memory addressing technology.

[0114] The graphics processor uses memory mapping technology to map compressed texture files in a shared memory region to the texture memory of the graphics processor.

[0115] Memory mapping technology is used to map data from virtual memory to physical memory. For example, through memory mapping technology, electronic devices can map compressed texture files from a shared memory region (virtual memory) to the texture memory (physical memory) of the graphics processor.

[0116] Texture memory is a part of the graphics processing unit memory, used to store and process texture data.

[0117] In summary, electronic devices can directly read compressed texture files from the file system and map them into the texture memory of the graphics processor (GPU) through a shared memory mechanism. The electronic device can first obtain the compressed texture file from the file system and load it into the shared memory region using DMA technology. Then, the electronic device can use memory mapping technology to map the compressed texture file from the shared memory region into the GPU's texture memory. During the mapping process, the electronic device reduces CPU decompression and image processing operations, directly mapping texture data from the compressed texture file, improving texture data transfer efficiency, and significantly reducing resource consumption.

[0118] S102. The electronic device samples the texture data in the compressed texture file using a sampler.

[0119] The sampler can possess both decoding and sampling capabilities. An electronic device can decode compressed texture files into texture data using the sampler and then sample the decoded texture data. The sampler can sample color values ​​from the texture data and perform image rendering. In some embodiments, the sampler can be a nearest neighbor sampler. In other embodiments, the sampler can be a linear sampler. In still other embodiments, the sampler can be a mipmap sampler. This application does not limit the type or category of the sampler.

[0120] In summary, the sampler can directly decode and sample compressed texture files mapped to the graphics processor without performing data conversion on the compressed texture files. This effectively controls the computational overhead in the texture data processing process, improves the sampling efficiency of texture data, and reduces latency.

[0121] In some embodiments of this application, the data structure of the compressed texture file of the image is adapted to the data structure supported by the sampler in the graphics processor; and / or, the data format of the compressed texture file of the image is adapted to the data format supported by the sampler in the graphics processor.

[0122] The data structure of the compressed texture file is the storage structure of the texture data in memory. The storage structure of the compressed texture file may include block arrangement, data organization form, and pixel access mode, etc., and the embodiments of this application do not limit the storage structure of the compressed texture file.

[0123] The compressed texture file's data format is the data format after the electronic device compresses and encodes the texture data according to an algorithm or rule. In some embodiments, the compressed texture file's data format may be BC format. In other embodiments, the compressed texture file's data format may be adaptive scalable texture compression (ASTC) format. The compressed texture file's data format may also be other types of data formats. This application does not limit the data format of the compressed texture file.

[0124] It should be understood that electronic devices can adapt a suitable sampler according to the data structure and / or data format of the compressed texture file. Electronic devices can also pre-compress a compressed texture file that is compatible with the sampler's sampleable data structure and / or data format during the compression process, according to the data structure and / or data format supported by the sampler. The embodiments of this application do not limit the adaptation method between the compressed texture file and the sampler.

[0125] In summary, when generating compressed texture files for images, the data structure of the compressed texture file is adapted to the data structure supported by the sampler in the graphics processing unit (GPU); and / or, the data format of the compressed texture file is adapted to the data format supported by the sampler in the GPU. Furthermore, by pre-generating compressed texture files adapted to the formats and data structures supported by the GPU, the sampler in the GPU can directly sample the compressed texture file when the image is displayed, without requiring data conversion processing by the GPU or sampler to convert it into a data format or structure recognizable by the sampler. This reduces computational overhead during the sampling process and improves sampling accuracy.

[0126] S103, Electronic device displays images.

[0127] In summary, during image display, electronic devices can obtain compressed texture files from the file system and directly map them to the graphics processor. This reduces CPU processing and CPU-to-GPU data transfer operations, decreases processing operations and power consumption of the central processing unit and graphics processor, eliminates data transfer from the central processing unit to the graphics processor, saves bandwidth, reduces image display latency, lowers the power consumption of electronic devices, and improves image display performance and efficiency.

[0128] Moreover, after the compressed texture file is mapped to the graphics processor, the electronic device can directly sample the texture data in the compressed texture file through the sampler in the graphics processor and then display the image, without having to perform data conversion processing on the compressed texture file through the GPU to convert it into a data format or data structure that the sampler can recognize. This reduces the computational overhead in the sampling process and lowers the power consumption of the electronic device.

[0129] Compared with related technologies, for example Figure 1 The present invention describes a process for displaying images in an electronic device. In this image display method, the electronic device stores compressed texture files in a file system, thereby reducing the processing steps of the central processing unit and data transmission.

[0130] The decompression process of the central processing unit includes the central processing unit decompressing the compressed image file into uncompressed image data, such as color values ​​and pixel values.

[0131] The image processing of the central processing unit includes filtering, feature extraction, data conversion, and color conversion of uncompressed image data.

[0132] Below, in conjunction with Figure 5 This application describes an image display method proposed in its embodiments. For example... Figure 5 As shown, the image display method provided in this application reduces the steps of performing decompression and image processing on the central processing unit (CPU), and transmitting texture data from the CPU to the graphics processing unit (GPU). Figure 5 The dashed line portion is shown in the image.

[0133] In other words, electronic devices reduce image transmission latency by minimizing the steps involved in CPU decompression, image processing, and data transmission. They also reduce the amount of data transmitted, saving bandwidth and time, by reducing the steps involved in transferring texture data from the CPU to the GPU. Furthermore, electronic devices reduce the workload on the CPU and GPU, lowering power consumption and improving the user experience.

[0134] The image display method proposed in this application has broad application prospects in fields such as game development, VR and AR, autonomous driving, and mobile devices.

[0135] During gameplay, electronic devices need to display each frame of image in real time, loading a large amount of texture data. Using existing technologies, this requires the CPU to perform extensive data conversion, transforming the data into compressed texture data, which consumes significant CPU memory resources. The image display method proposed in this application reduces the CPU's decompression and image processing steps, directly using texture data through a sampler, thus lowering latency and improving game smoothness.

[0136] In VR or AR scenarios, to ensure user experience and improve image quality and smoothness, VR or AR devices need to meet the requirements of high bandwidth and low latency, thus requiring a large amount of broadband resources to transmit texture data. However, the image display method in this embodiment reduces the amount of broadband required for texture data transmission by VR or AR devices, saving bandwidth resources.

[0137] In autonomous driving scenarios, electronic devices need to display images related to road conditions in real time and process large amounts of image data, which consumes significant CPU and GPU resources. The image display method in this embodiment can reduce the workload of the CPU and GPU, improve image processing and display speed, and reduce latency.

[0138] During the display of images on a mobile phone or tablet, the image display method in this embodiment can shorten the image display time and reduce latency by reducing the steps of CPU decompression and image processing. Furthermore, it reduces the workload of the CPU and GPU, thereby lowering the power consumption of the mobile phone or tablet.

[0139] It is understood that, in order to achieve the above functions, the electronic device includes hardware and / or software modules that perform the respective functions. Based on the algorithmic steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is implemented in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in conjunction with the embodiments, but such implementation should not be considered beyond the scope of this application.

[0140] This embodiment can divide the electronic device into functional modules according to the above method example. For example, each function can be divided into its own functional modules, or two or more functions can be integrated into one processing module. The integrated modules can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.

[0141] This application also provides an electronic device; please refer to [link / reference]. Figure 6 , Figure 6 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. For example... Figure 6 As shown, the electronic device may include one or more processors 601, memory 602, and communication interface 603.

[0142] The memory 602, communication interface 603, and processor 601 are coupled together. For example, the memory 602, communication interface 603, and processor 601 can be coupled together via bus 604.

[0143] The communication interface 603 is used for data transmission with other devices. The memory 602 stores computer program code. The computer program code includes computer instructions, which, when executed by the processor 601, cause the electronic device to perform the screen projection method described in this embodiment.

[0144] The processor 601 may be a processor or controller, such as a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 601 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0145] Bus 604 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 604 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0146] This application also provides a computer-readable storage medium storing computer program code. When the processor executes the computer program code, the electronic device executes the relevant method steps in the above method embodiments.

[0147] This application also provides a computer program product that, when run on a computer, causes the computer to execute the relevant method steps described in the above method embodiments.

[0148] The electronic devices, computer storage media, or computer program products provided in this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0149] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0150] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0151] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0152] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0153] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially, or the contributing parts, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0154] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for displaying an image, characterized in that, Applied to an electronic device, wherein the electronic device's file system stores compressed texture files of images, the method includes: The compressed texture file is retrieved from the file system and mapped to the graphics processor; The texture data in the compressed texture file is sampled using a sampler; The image is displayed.

2. The method according to claim 1, characterized in that, The file system also stores compressed image files of the image; the compressed image files are used for image processing, which includes forwarding or editing the image.

3. The method according to claim 1 or 2, characterized in that, The electronic device includes a shared memory region of the graphics processor and the central processing unit, and the step of obtaining the compressed texture file from the file system and mapping it to the graphics processor includes: The compressed texture file is retrieved from the file system and loaded into the shared memory region; Map the compressed texture file from the shared memory region to the graphics processor.

4. The method according to claim 3, characterized in that, The step of obtaining the compressed texture file from the file system and loading it into the shared memory region includes: The compressed texture file is obtained from the file system using direct addressing access technology, and then loaded into the shared memory region. The step of mapping the compressed texture file from the shared memory region to the graphics processor includes: The graphics processor uses memory mapping technology to map compressed texture files in the shared memory region to the texture memory of the graphics processor.

5. The method according to any one of claims 1-4, characterized in that, The step of sampling texture data in the compressed texture file using a sampler includes: The sampler decodes the texture data in the compressed texture file and samples the decoded texture data.

6. The method according to any one of claims 1-5, characterized in that, The data structure of the compressed texture file of the image is adapted to the data structure supported by the sampler in the graphics processor; and / or, the data format of the compressed texture file of the image is adapted to the data format supported by the sampler in the graphics processor.

7. The method according to any one of claims 1-6, characterized in that, The method reduces the steps of performing decompression and image processing on the central processing unit, as well as the steps of the central processing unit transferring texture data to the graphics processor.

8. The method according to any one of claims 1-7, characterized in that, The compressed texture file of the image is generated when storing the compressed image file of the image; or, the compressed texture file of the image is generated through any one or more of the following methods: Batch generation, where multiple compressed texture files are generated in batches, including the compressed texture file of the image; or, Generated during the idle period of the electronic device; or, Obtained from other devices and generated by said other devices.

9. The method according to any one of claims 1-8, characterized in that, The compressed texture file is generated in the following way: Obtain the compressed image file of the image; The compressed image file is converted into texture data using texture generation tools or software development kits. The texture data is packaged into a compressed texture file that the graphics processor can recognize.

10. An electronic device, characterized in that, The electronic device includes: one or more processors; a memory; wherein the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code including computer instructions, and the one or more processors call the computer instructions to cause the electronic device to perform the method as described in any one of claims 1-9.

11. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-9.

12. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-9.