Picture display method and related device
By super-compressing and encoding thumbnails into super-compressed texture data and rendering them directly, the performance problem of electronic devices when displaying batches of thumbnails is solved, achieving faster display and lower memory usage, thus improving the user experience.
Patent Information
- Application Number
- CN202410808229.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2025-12-23
AI Technical Summary
In existing technologies, electronic devices perform poorly when displaying a batch of thumbnails on a single screen, resulting in a poor user browsing experience. This is especially true in monthly or yearly view scenarios, where the number of thumbnails is large, requiring electronic devices to create a large number of view controls and frequently call I/O interfaces, leading to lag and performance degradation.
By super-compressing and encoding the texture data of the thumbnail into super-compressed texture data, and then decoding it into texture data before display, the number of view controls is reduced. By directly rendering binary data in ASTC format, frequent decoding processes are avoided, thus improving performance.
It saves memory and power consumption, improves the performance of electronic devices in displaying batch thumbnails, reduces lag, and enhances the user browsing experience.
Smart Images

Figure CN121193933A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of electronic devices and electronic technology, and in particular, to a picture display method and related apparatus. BACKGROUND
[0002] A user can browse media data (for example, images, videos, etc.) in an electronic device. In order to enable the user to see a batch of media data at the same time, the electronic device can provide a preview interface (which can also be referred to as a thumbnail display interface) in which a preview view displaying a plurality of media data can be loaded. For example, a day view of a current gallery application. What the user sees in the preview interface is a preview picture, which is not the original data (which can also be referred to as source data) saved by the electronic device. The preview picture displayed in the preview interface is a smaller picture generated based on the original data, that is, a thumbnail. This is because the source data of the media data is generally large, and in the case of a large batch of browsing, the electronic device has a large overhead for loading the source data, therefore, when saving the source data file of the media data, the electronic device generates a corresponding thumbnail and saves the thumbnail in the local disk.
[0003] Currently, the number of thumbnails displayed by the preview interface of the gallery is different in different view scenarios. In a month view or year view scenario, the number of thumbnails displayed on a single screen in the corresponding preview interface is large, and the performance of the electronic device for displaying a batch of thumbnails on a single screen is poor, which affects the user browsing experience.
[0004] Therefore, how to improve the performance of the electronic device for displaying a batch of thumbnails on a single screen is a problem to be solved. SUMMARY
[0005] The present application provides a picture display method and related apparatus, which can improve the performance of the electronic device for displaying a batch of thumbnails on a single screen.
[0006] In a first aspect, the present application provides a picture display method, which can include: an electronic device receiving and responding to a first operation of a user for a gallery application, obtaining super-compressed texture data of a first group of thumbnails from a database of the electronic device, the first group of thumbnails including at least two thumbnails, the at least two thumbnails including a first thumbnail, the super-compressed texture data of the first thumbnail being texture data obtained by texture encoding of the first thumbnail by the electronic device and obtained by re-encoding of the texture data; the electronic device decoding the super-compressed texture data of the first group of thumbnails to obtain texture data of the first group of thumbnails; the electronic device rendering the texture data of the first group of thumbnails and displaying a thumbnail display interface of the gallery application, the thumbnail display interface displaying the first group of thumbnails.
[0007] In this way, the electronic device stores the super compressed texture data of the thumbnails, and the super compressed texture data occupies less memory than the texture data. Therefore, the memory of the electronic device can be saved. Then, the super compressed texture data of the first set of thumbnails can be directly sent to rendering after being decoded into texture data by the electronic device, without being decoded into image data in the RGBX format. Moreover, the compression rate of the super compressed texture data is lower than that of binary data in the JPEG format, and therefore, compared with decoding binary data in the JPEG format into thumbnails in the RGBX format, the electronic device spends less time in the decoding process. The electronic device can display the first set of thumbnails in the thumbnail display interface more quickly, and therefore, the performance of the electronic device in displaying a batch of thumbnails can be improved.
[0008] With reference to the first aspect, in a possible implementation manner, the electronic device renders the texture data of the first set of thumbnails, and displays the thumbnail display interface of the gallery application, including: the electronic device splices the texture data of the first set of thumbnails into one large image; and the electronic device renders the large image, and displays the thumbnail display interface, and the large image is displayed in the thumbnail display interface.
[0009] In this way, one large image only needs one view control to be carried, and in the prior art, the first set of thumbnails needs k view controls to be carried. The electronic device splices the first set of thumbnails into one large image before sending the large image to display, and therefore, the number of view controls can be reduced. Therefore, the performance of the electronic device in displaying a batch of thumbnails can be improved, and the power consumption of the electronic device can be saved.
[0010] With reference to the first aspect, in a possible implementation manner, before the electronic device receives and responds to the first operation of the user for the gallery application, the method can further include: the electronic device obtaining a first thumbnail, and performing block processing on the first thumbnail to obtain a plurality of sub-blocks, the plurality of sub-blocks including a first sub-block and a second sub-block; the electronic device determining a target coding mode corresponding to the first sub-block from a plurality of preset coding modes; wherein the electronic device encodes the second sub-block based on the plurality of preset coding modes, and the number of bits occupied by the coding data corresponding to the weight of the second sub-block in the texture data of the plurality of second sub-blocks obtained by encoding the second sub-block is the same, and the number of bits occupied by the coding data corresponding to the endpoint of the second sub-block is the same, and the relative positions of the coding data corresponding to the weight of the second sub-block and the coding data of the endpoint are fixed; the electronic device encodes the first sub-block based on the target coding mode corresponding to the first sub-block to obtain a texture code stream of the first sub-block; wherein the texture code stream of the first sub-block includes the coding data corresponding to the weight of the first sub-block and the coding data of the endpoint, and the texture code streams of the plurality of sub-blocks constitute texture data of the first thumbnail; the electronic device extracts the coding data corresponding to the weight of the plurality of sub-blocks and the coding data of the endpoint from the texture data of the first thumbnail; and the electronic device encodes the coding data corresponding to the weight of the plurality of sub-blocks and encodes the coding data corresponding to the endpoint of the plurality of sub-blocks to obtain hyper-compressed texture data of the first thumbnail.
[0011] In this way, the electronic device can compress the obtained thumbnail into hyper-compressed texture data, and then store the hyper-compressed texture data, which can save the memory of the electronic device.
[0012] With reference to the first aspect, in a possible implementation manner, after the electronic device obtains the hyper-compressed texture data of the first thumbnail, the method can further include: the electronic device storing the hyper-compressed texture data of the first thumbnail into a database.
[0013] In this way, the electronic device does not directly store the thumbnail into the database, but stores the hyper-compressed texture data corresponding to the thumbnail into the database, which can save the memory of the electronic device.
[0014] With reference to the first aspect, in a possible implementation manner, the database stores metadata of a first set of thumbnails, the metadata of the first set of thumbnails including a date and time corresponding to each thumbnail in the first set of thumbnails and an identity ID, the date and time corresponding to the first thumbnail being a first date and time, the ID corresponding to the first thumbnail being a first ID, the first date and time being the date and time at which the electronic device saves the first thumbnail, and the first ID being a number generated by the electronic device to identify the first thumbnail when the first thumbnail is saved. In this way, the electronic device can distinguish different thumbnails through the date and time and the ID corresponding to the thumbnail.
[0015] In a possible implementation manner of the first aspect, the storage order of the first group of thumbnails in the thumbnail database is consistent with the display order of the first group of thumbnails. In this way, since the thumbnails are stored in order, the electronic device 100 can read multiple thumbnails at a time when reading the thumbnails. Thus, the number of times that the electronic device calls the input / output interface can be reduced, and the performance of the electronic device in batch displaying the thumbnails can be improved.
[0016] In a possible implementation manner of the first aspect, the electronic device stores the super-compressed texture data of the first thumbnail into the database, and specifically can include: the electronic device saves the super-compressed texture data of the first thumbnail into the database according to the order of the first date and time and the first ID, and the index information of the super-compressed texture data in the database is the first date and time and the first ID. In this way, the electronic device can find the super-compressed texture data corresponding to the thumbnail according to the date and time and the ID corresponding to the thumbnail in the database.
[0017] In a possible implementation manner of the first aspect, the super-compressed texture data of the first group of thumbnails includes the super-compressed texture data of the first thumbnail, the texture data of the first group of thumbnails includes the texture data of the first thumbnail, and the electronic device decodes the super-compressed texture data of the first group of thumbnails to obtain the texture data of the first group of thumbnails, which can include: the electronic device decodes the super-compressed texture data of the first thumbnail to obtain the reconstruction data of the encoded data of the weights corresponding to the multiple sub-blocks in the first thumbnail and the reconstruction data of the encoded data of the endpoints; and the electronic device encapsulates the reconstruction data of the encoded data of the weights corresponding to the multiple sub-blocks and the reconstruction data of the encoded data of the endpoints to obtain the texture data of the first thumbnail. In this way, the electronic device can decode the super-compressed texture data into the texture data.
[0018] In a possible implementation manner of the first aspect, the first operation can include any one of the following: an operation of the user opening a gallery application, an operation of the user switching a view scene in a thumbnail display interface, and a sliding operation of the user in the thumbnail display interface.
[0019] In a possible implementation manner of the first aspect, the first application can be configured to: receive and respond to a first operation of a user on the first application, obtain super-compressed texture data of a first group of thumbnails from the database, the first group of thumbnails including at least two thumbnails, the at least two thumbnails including a first thumbnail, the super-compressed texture data of the first thumbnail being texture data obtained by performing texture encoding on the first thumbnail by the media library and obtained by performing encoding again on the texture data, k being an integer greater than or equal to 1.
[0020] In a possible implementation manner of the first aspect, the first application can be configured to: receive and respond to a first operation of a user on the first application, obtain super-compressed texture data of a first group of thumbnails from the database, the first group of thumbnails including at least two thumbnails, the at least two thumbnails including a first thumbnail, the super-compressed texture data of the first thumbnail being texture data obtained by performing texture encoding on the first thumbnail by the media library and obtained by performing encoding again on the texture data, k being an integer greater than or equal to 1.
[0021] The media library can be configured to decode the super compressed texture data of the first set of thumbnails to obtain texture data of the first set of thumbnails.
[0022] The graphics subsystem can be configured to render the texture data of the first set of thumbnails.
[0023] The first application can be configured to display a thumbnail display interface, and the thumbnail display interface displays the first set of thumbnails.
[0024] In this way, the database stores super compressed texture data of the thumbnails, and the super compressed texture data occupies less memory than the texture data. Therefore, the memory of the electronic device can be saved. Then, the media library can directly send the texture data obtained by decoding the super compressed texture data of the first set of thumbnails to the graphics subsystem for rendering, without decoding the texture data into image data in RGBX format. In addition, the compression rate of the super compressed texture data is lower than that of binary data in JPEG format, and therefore, compared with decoding binary data in JPEG format into thumbnails in RGBX format, the electronic device spends less time in the decoding process. The electronic device can display the first set of thumbnails in the thumbnail display interface more quickly, and therefore, the performance of the electronic device in displaying a batch of thumbnails can be improved.
[0025] With reference to the second aspect, in a possible implementation manner, the electronic device further includes a splicing module, and the splicing module can be configured to splice the texture data of the first set of thumbnails into one large image.
[0026] The graphics subsystem can be further configured to render the large image.
[0027] The first application can be further configured to display a thumbnail display interface, and the thumbnail display interface displays the large image.
[0028] In this way, only one view control is needed to carry the large image, and in the prior art, k view controls are needed to carry the first set of thumbnails. The electronic device splices the first set of thumbnails into one large image for display, which can reduce the number of view controls. Therefore, the performance of the electronic device in displaying a batch of thumbnails can be improved, and the power consumption of the electronic device can be saved.
[0029] With reference to the second aspect, in a possible implementation manner, the media library can further be configured to: acquire the first thumbnail, and perform block processing on the first thumbnail to obtain a plurality of sub-blocks, the plurality of sub-blocks including a first sub-block and a second sub-block; determine a target encoding mode corresponding to the first sub-block from a plurality of preset encoding modes; wherein the media library encodes the second sub-block based on the plurality of preset encoding modes, and the number of bits occupied by the encoding data corresponding to the weight of the second sub-block in the texture data of the plurality of second sub-blocks obtained by encoding the second sub-block is the same, and the number of bits occupied by the encoding data corresponding to the endpoint is the same, and the relative positions of the encoding data corresponding to the weight and the encoding data corresponding to the endpoint are fixed; encode the first sub-block based on the target encoding mode corresponding to the first sub-block to obtain a texture code stream of the first sub-block; wherein the texture code stream of the first sub-block includes the encoding data corresponding to the weight and the encoding data corresponding to the endpoint of the first sub-block, and the texture code streams of the plurality of sub-blocks constitute the texture data of the first thumbnail; extract the encoding data corresponding to the weight and the encoding data corresponding to the endpoint of the plurality of sub-blocks from the texture data of the first thumbnail; encode the encoding data corresponding to the weight and the encoding data corresponding to the endpoint of the plurality of sub-blocks to obtain the hyper-compressed texture data of the first thumbnail.
[0030] In this way, the media library can compress the acquired thumbnail into hyper-compressed texture data.
[0031] With reference to the second aspect, in a possible implementation manner, the media library can further be configured to: store the hyper-compressed texture data of the first thumbnail into the database.
[0032] In this way, the electronic device does not directly store the thumbnail into the database, but stores the hyper-compressed texture data corresponding to the thumbnail into the database, which can save the memory of the electronic device.
[0033] With reference to the second aspect, in a possible implementation manner, the database stores metadata of a first set of thumbnails, the metadata of the first set of thumbnails including a date and time corresponding to each thumbnail in the first set of thumbnails and an identity ID, the date and time corresponding to the first thumbnail being a first date and time, and the ID corresponding to the first thumbnail being a first ID, the first date and time being a date and time at which the electronic device saves the first thumbnail, and the first ID being a number generated by the electronic device to identify the first thumbnail when the electronic device saves the first thumbnail. In this way, the electronic device can distinguish different thumbnails through the date and time and the ID corresponding to the thumbnail.
[0034] In a possible implementation manner of the second aspect, the storage order of the first group of thumbnails in the thumbnail database is consistent with the display order of the first group of thumbnails. In this way, since the thumbnails are stored in order, the electronic device 100 can read multiple thumbnails at a time when reading the thumbnails. Thus, the number of times that the electronic device calls the input / output interface can be reduced, and the performance of the electronic device in batch displaying the thumbnails can be improved.
[0035] In a possible implementation manner of the second aspect, the media library can further be configured to: save the super-compressed texture data of the first thumbnail to the database according to the order of the first date and time and the first ID, and the index information of the super-compressed texture data in the database is the first date and time and the first ID.
[0036] In this way, the electronic device can find the super-compressed texture data corresponding to the thumbnail in the database according to the date and time and the ID corresponding to the thumbnail.
[0037] In a possible implementation manner of the second aspect, the media library can further be configured to: decode the super-compressed texture data of the first thumbnail to obtain the reconstructed data of the encoded data of the weights of the multiple sub-blocks and the reconstructed data of the encoded data of the end point in the first thumbnail; and package the reconstructed data of the encoded data of the weights of the multiple sub-blocks and the reconstructed data of the encoded data of the end point to obtain the texture data of the first thumbnail.
[0038] In this way, the media library can decode the super-compressed texture data into the texture data.
[0039] In a possible implementation manner of the second aspect, the first operation can include any one of the following: an operation of opening a gallery application by the user, an operation of switching a view scene in a thumbnail display interface by the user, and a sliding operation in the thumbnail display interface by the user.
[0040] In a third aspect, the present application provides an electronic device, which can include one or more processors, one or more display screens, and a memory, the one or more display screens, the memory, and the one or more processors being coupled together, and the memory storing code, which, when executed by the processor, causes the electronic device to perform the method in any one of the possible implementation manners of the first aspect.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium, which includes computer instructions, which, when executed on a computer, cause the computer to perform the method in any one of the possible implementation manners of the first aspect.
[0042] In a fifth aspect, the present application provides a computer program product, which, when executed on a computer, causes the computer to perform the method in any one of the possible implementation manners of the first aspect.
[0043] In a sixth aspect, the present application provides a chip or chip system applied to an electronic device, comprising a processing circuit and an interface circuit, the interface circuit is configured to receive code instructions and transmit the code instructions to the processing circuit, and the processing circuit is configured to execute the code instructions to perform the method in any possible implementation manner of the first aspect.
[0044] It can be understood that the electronic device provided in the third aspect, the computer readable storage medium provided in the fourth aspect, the computer program product provided in the fifth aspect, and the chip or chip system provided in the sixth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method, which will not be described here again. BRIEF DESCRIPTION OF DRAWINGS
[0045] Figure 1 is a schematic diagram of a thumbnail display interface in a day view scene provided by an embodiment of the present application;
[0046] Figure 2 is a schematic diagram of a thumbnail display interface in a month view scene provided by an embodiment of the present application;
[0047] Figure 3 is a schematic diagram of a thumbnail display interface in a year view scene provided by an embodiment of the present application;
[0048] Figure 4 is a schematic diagram of a thumbnail generation process and a thumbnail loading process provided by an embodiment of the present application;
[0049] Figure 5 is a schematic diagram of a white block appearing in a thumbnail display interface in a year view scene provided by an embodiment of the present application;
[0050] Figure 6 is a schematic diagram of another thumbnail generation process, a thumbnail loading process in a day view scene, and a thumbnail loading process in a year or month view scene provided by an embodiment of the present application;
[0051] Figure 7 is a schematic diagram of another thumbnail generation process and a thumbnail loading process in a year or month view scene provided by an embodiment of the present application;
[0052] Figure 8 is a schematic diagram of data format change in a process from saving to displaying a thumbnail provided by an embodiment of the present application;
[0053] Figure 9A is a schematic diagram of a structure of an electronic device provided by an embodiment of the present application;
[0054] Figure 9B is a software structure framework of an electronic device provided by an embodiment of the present application;
[0055] Figure 10 is a flowchart of a picture display method provided by an embodiment of the present application;
[0056] Figure 11 is a flowchart of a picture display method provided by an embodiment of the present application;
[0057] Figure 12A is a schematic diagram of a texture encoding process provided by an embodiment of the present application;
[0058] Figure 12B is a schematic diagram of a syntax structure of a texture code stream of a first sub-block provided by an embodiment of the present application;
[0059] Figure 13 is a schematic diagram of a super-compression encoding process provided by an embodiment of the present application;
[0060] Figure 14 is a schematic diagram of a super-compression encoding process provided by an embodiment of the present application;
[0061] Figure 15 is a schematic diagram of two super-compression texture code stream encoding modes provided by an embodiment of the present application;
[0062] Figure 16 is a schematic diagram of a table building process provided by an embodiment of the present application;
[0063] Figure 17 is a schematic diagram of a thumbnail database storage provided by an embodiment of the present application;
[0064] Figure 18A 、 Figure 18B is a schematic diagram of a spliced texture large picture provided by an embodiment of the present application;
[0065] Figure 19 is a flowchart of a picture display method provided by an embodiment of the present application. DETAILED DESCRIPTION
[0066] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0067] The terminology used in the description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the embodiments and the appended claims herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. The terms "first", "second", and the like, do not denote any ordinal, quantity, or importance, but are used to distinguish one element from another. The terms "first", "second", and the like, are used herein to distinguish one element from another unless the context clearly indicates otherwise. By way of illustration, a first object and a second object are two different objects unless the context clearly dictates otherwise. The term "and / or" used in the context of the description of the embodiments herein is to be interpreted as an association of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone.
[0068] In the description of the embodiments of the present application, the meaning of "a plurality of" is two or more, unless otherwise specified. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.
[0069] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or aspect described in this application as "exemplary" or "for example" should not be construed as being more preferred or advantageous than other embodiments or aspects. Rather, use of the words "exemplary" or "for example" is intended to present concepts in a concrete manner.
[0070] The term "and / or" in the present application is only a description of the associated relationship of the associated objects, which means that there can be three relationships. For example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone.
[0071] The term "user interface (UI)" in the embodiments of the present application is a medium interface for interaction and information exchange between an application program or an operating system and a user, which realizes conversion between an internal form of information and a form acceptable by the user. The user interface is source code written in a specific computer language such as Java, extensible markup language (XML), and the like. The interface source code is parsed and rendered on an electronic device, and finally presented as content recognizable by the user. A commonly used form of the user interface is a graphic user interface (GUI), which refers to a user interface related to computer operation displayed in a graphic manner. It can be a visual interface element such as text, an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, and the like displayed in a display screen of the electronic device.
[0072] In order to better understand the technical solutions provided in the present application, before the technical solutions of the present application are described, first, the electronic device 100 with the photo gallery or album function to which the present application is applicable is briefly introduced in conjunction with the accompanying drawings. In the embodiments of the present application, the electronic device 100 can be referred to as a terminal, and can also be referred to as a user equipment (UE). The embodiments of the present application do not limit this. The electronic device 100 involved in the present application can include but is not limited to a mobile phone, a tablet computer, a notebook computer, a palm computer, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR), a vehicle-mounted device, and the like. The embodiments of the present application do not limit the specific form and type of the electronic device 100.
[0073] Currently, the electronic device 100 displays a thumbnail display interface in different view scenes in a photo gallery application. For example, the electronic device 100 can display thumbnail display interfaces in scenes such as a day view, a month view, and a year view in the photo gallery application. In the electronic device 100, a user can preview thumbnails presented in chronological order. The user can also select to preview thumbnails in the year, month, and day dimensions. The preview views in the year, month, and day dimensions can be referred to as a year view, a month view, and a day view, respectively. The thumbnail display interfaces in different view scenes display thumbnails of different sizes and different orders of magnitude, and different views can be jumped between each other, so that the user can quickly find the corresponding pictures.
[0074] Figure 1The thumbnail display interface 101 in the day view scenario of the electronic device 100 is exemplarily shown. As Figure 1 shown, the thumbnail display interface 101 can be used to display thumbnails of photos taken on a specific date. The thumbnail display interface 101 can also include a text prompt 102. For example, the text prompt 102 can be “February 23, 2023”, which indicates that the thumbnails displayed in the thumbnail display interface 101 correspond to photos taken or saved on “February 20, 2023”. The thumbnails displayed in the thumbnail display interface 101 can include a thumbnail 104 corresponding to photo 1.
[0075] Alternatively, the electronic device 100 can arrange the thumbnails corresponding to the photos taken or saved on February 20, 2023 in the thumbnail display interface 101 in a distribution relationship of 8 rows and 4 columns.
[0076] Alternatively, the user can also swipe up or down in the thumbnail display interface 101 to view thumbnails corresponding to photos (or pictures) taken or saved on other dates.
[0077] As Figure 1 shown, the thumbnail display interface 101 can also include a view switching control 103. The view switching control 103 is used to switch between different view scenarios. Exemplarily, the view switching control 103 can include a day view control 103a, a month view control 103b, and a year view control 103c. The current day view control 103a is in a selected state, indicating that the electronic device 100 currently displays the thumbnail display interface in the day view scenario. The month view control 103b is used to instruct the electronic device 100 to switch to display the thumbnail display interface in the month view scenario. The year view control 103c is used to instruct the electronic device 100 to switch to display the thumbnail display interface in the year view scenario.
[0078] In some possible examples, the user can click the month view control 103b. In response to the user operation, the electronic device 100 can display the thumbnail display interface in the month view scenario.
[0079] Figure 2 The thumbnail display interface 200 in the month view scenario of the electronic device 100 is exemplarily shown. As Figure 2As shown, the thumbnail display interface 200 can be used to display thumbnails of photos acquired in a specific month. The thumbnail display interface 200 may also include text prompts 201. For example, the text prompt 201 could be "February 2023," indicating that the thumbnails of the multiple photos displayed on the thumbnail display interface 200 were taken or saved in "February 2023." The thumbnails of the multiple photos displayed on the thumbnail display interface 200 may include a thumbnail 202 corresponding to photo 1.
[0080] Optionally, the electronic device 100 can arrange thumbnails corresponding to multiple photos taken or saved in February 2023 in a 16-row, 8-column layout on the thumbnail display interface 200.
[0081] Optionally, users can also swipe up or down on the thumbnail display interface 200 to view thumbnails of photos taken or saved in other months.
[0082] like Figure 2 As shown, the thumbnail display interface 200 may also include a view switching control 103. Currently, the moon view control 103b in the view switching control 103 is selected, indicating that the electronic device 100 is currently displaying a thumbnail display interface in the moon view scene. For details regarding the view switching control 103, please refer to the above description. Figure 1 The description will not be repeated here.
[0083] In some feasible examples, the user can click on the year view control 103c. In response to this user action, the electronic device 100 can display a thumbnail display interface for the year view scene.
[0084] Figure 3 An exemplary thumbnail display interface 300 is shown in a yearly view scene of an electronic device 100. For example... Figure 3 As shown, the thumbnail display interface 300 can be used to display thumbnails of photos acquired in a specific year. The thumbnail display interface 300 may also include text prompts 301. For example, the text prompt 301 could be "2023," indicating that the thumbnails of the multiple photos displayed on the thumbnail display interface 300 were taken or saved in "2023." The thumbnails of the multiple photos displayed on the thumbnail display interface 300 may include a thumbnail 302 corresponding to photo 1.
[0085] Optionally, the electronic device 100 can arrange thumbnails corresponding to multiple photos taken or saved in 2023 in a 32-row, 16-column layout on the thumbnail display interface 300.
[0086] Optionally, users can also swipe up or down on the thumbnail display interface 300 to view thumbnails corresponding to photos taken or saved in other years.
[0087] like Figure 3 As shown, the thumbnail display interface 300 may also include a view switching control 103. Currently, the year view control 103c in the view switching control 103 is selected, indicating that the current electronic device 100 is displaying a thumbnail display interface in the year view scenario. For details regarding the view switching control 103, please refer to the above description. Figure 1 The description will not be repeated here.
[0088] In some feasible examples, since the number of thumbnails displayed in the thumbnail display interface gradually increases from the day view scene to the year view scene, while the size of the display screen of the electronic device 100 remains unchanged, the size of the thumbnails displayed in the thumbnail display interface gradually decreases from the day view scene to the year view scene. For example, for the same photograph, the thumbnail size displayed in the month view scene is smaller than the thumbnail size displayed in the day view scene. The thumbnail size displayed in the year view scene is smaller than the thumbnail size displayed in the month view scene. For instance, the size of thumbnail 302 corresponding to photograph 1 in the year view scene is smaller than the size of thumbnail 202 corresponding to photograph 1 in the month view scene. The size of thumbnail 202 corresponding to photograph 1 in the month view scene is smaller than the size of thumbnail 104 corresponding to photograph 1 in the day view scene.
[0089] In this embodiment, the number of thumbnails displayed by the electronic device 100 in the day view, month view, and year view scenarios is not limited. It is understood that the number of thumbnails that can be displayed in the thumbnail display interface in the day view, month view, and year view scenarios is related to the size of the electronic device 100's display screen. The larger the size of the electronic device 100's display screen, the more thumbnails can be displayed in the thumbnail display interface in the day view, month view, and year view scenarios.
[0090] Taking the year view scenario as an example, when a user is in the thumbnail display interface of the year view scenario (e.g., Figure 3When a finger touches and slides up or down in the thumbnail display interface 300 shown, the view control used to display images in the thumbnail display interface receives the touch event, and the corresponding display area requests a refresh of thumbnails arranged in reverse chronological order. The refresh request process includes reading the thumbnail resources, decoding the images, drawing, and rendering, ultimately causing each thumbnail to be displayed in its corresponding display area.
[0091] Currently, the electronic device 100 can display far more thumbnails in monthly and yearly view scenarios than in daily view scenarios. When the electronic device 100 needs to load and display a large number of thumbnails, it needs to create numerous view controls, repeatedly call the I / O interface to obtain image resources, perform multiple image decoding operations, and repeatedly render and display the view controls. Specifically, the thumbnail generation and loading processes can be as follows: Figure 4 As shown. Figure 4 Image (a) exemplarily illustrates the thumbnail generation process in a current electronic device 100. For example... Figure 4 As shown in (a), saving a thumbnail by electronic device 100 may include the following steps: ①. Electronic device 100 may downsample the source data of an image captured or downloaded based on a user save operation to obtain a thumbnail in RGBX format. ②. Electronic device 100 may encode the RGBX format thumbnail into binary data in Joint Photographic Experts Group (JPEG) format. ③. Electronic device 100 may save the JPEG format binary data locally. Figure 4 As shown in (b), the electronic device 100 may load and display thumbnails by the following steps: ①. The electronic device 100 reads saved JPEG format binary data from a local file. ②. The electronic device 100 decodes the JPEG format binary data into RGBX format thumbnails. ③. The electronic device 100 renders the RGBX format thumbnails and displays them on the user interface.
[0092] In the embodiments of this application, the RGBX format may include RGB format and RGBA format. It should be understood that this application does not limit the storage order of R, G, B, A (alpha, used to characterize transparency), that is, RGBX can be ARGB, ABGR, etc.
[0093] When electronic device 100 needs to display a large number of thumbnails in a short period of time, the rendering, display, I / O interface calls to obtain image resources, and image decoding operations of electronic device 100 compete for CPU resources. This results in longer time for electronic device 100 to obtain image resources, decode images, and create view controls. When users quickly swipe or drag the scroll bar in the thumbnail display interface of the gallery used to display a large number of thumbnails, situations may occur where the image has not been decoded after the view control is created, or the view control cannot be created in time, causing the electronic device to lag when displaying thumbnails, for example, a large number of white blocks appear in the thumbnail display interface. For scenarios displaying a large number of thumbnails in monthly and yearly view scenarios, taking the yearly view scenario as an example, when users quickly swipe or drag the scroll bar in the thumbnail display interface 300 of the yearly view scenario, a large number of white blocks appear in the thumbnail display interface. Figure 5 As shown, a white block appears in area 501 of the thumbnail display interface 300. This results in a poor user experience.
[0094] To improve the performance of electronic devices displaying batch thumbnails, and to avoid white blocks and lag issues in the thumbnail display interface during user browsing scenarios, this application provides an image display method. Figure 6 This example illustrates the thumbnail generation and thumbnail loading processes in the image display method provided in this application embodiment. For instance... Figure 6 As shown in (a) of the diagram, the thumbnail generation process in the electronic device 100 may include the following steps: ①. The electronic device 100 can downsample the source data of an image captured or downloaded based on a user save operation to obtain a thumbnail in RGBX format. ②. The electronic device 100 can encode the RGBX format thumbnail into binary data in adaptive scalable texture compression (ASTC) format. The ASTC format binary data can be simply referred to as texture ASTC. ③. The electronic device 100 saves the ASTC format binary data locally. Figure 6 As shown in (b) above, for a daytime view scene, the electronic device 100 needs to load and display thumbnails, which may include the following steps: ①. The electronic device 100 reads saved ASTC format binary data from a local file. ②. The electronic device 100 renders the ASTC format binary data and displays it on the user interface. Figure 6In the step (c) shown in the method for displaying pictures, for a month view scene or a year view scene, the electronic device 100 loading and displaying the thumbnails can include the following steps: ①. The electronic device 100 reads the saved ASTC format binary data from the local file. ②. The electronic device 100 splices the n pieces of ASTC format binary data into one texture ASTC. That is, the n small pictures are spliced into one large picture. ③. The electronic device 100 renders the spliced large picture and displays it to the user interface.
[0095] In this way, since the ASTC format binary data can be directly decoded by the GPU special circuit, the electronic device 100 does not need to decode before sending the data to the GPU for rendering. For a day view scene, the texture data obtained by the electronic device 100 can be directly rendered and displayed without decoding, which can save decoding time.
[0096] In addition, the ASTC format binary data can be spliced according to a certain image arrangement rule. The splicing is a rearrangement of the code stream data, which has small data volume and low operation amount. The spliced ASTC code stream can also be directly decoded by the GPU. For a month view scene or a year view scene, the displayed thumbnails in the thumbnail display interface are spliced into one or more large pictures. One view control can carry one large picture. In this way, the electronic device 100 only needs a small number of view controls (for example, 1 or 2, etc.) to display a large number of thumbnails. Moreover, the texture data obtained by the electronic device 100 can be directly rendered and displayed without decoding, which can save decoding time. In the prior art, Figure 4 In the method for displaying pictures shown in the figure, the thumbnails are encoded in JPEG format. When the user previews the thumbnails, the JPEG format binary data corresponding to each image needs to be decoded one by one, and the decoded RGBX format thumbnails can be sent to the GPU for rendering and display. Compared with the RGBX data of multiple images, the spliced ASTC code stream has a smaller total amount. Taking the 4x4 block division specification in ASTC as an example, the maximum code stream size is only one fourth of the RGBA, which significantly reduces the IO throughput from the memory to the video memory. In this way, by using the method for displaying pictures provided in the above embodiment, the electronic device 100 can improve the performance and frame rate of loading and displaying a large number of thumbnails, so as to avoid or reduce the occurrence of white blocks and lag during the user's browsing of a large number of thumbnails. Figure 6
[0097] Currently, for the RGBX format thumbnails, the compression ratio of JPEG encoding can be more than ten times, while the compression ratio of ASTC encoding is only 4 to 9 times. In this way, compared with the JPEG format binary data, the ASTC format binary data will occupy more memory.
[0098] Exemplarily, the compression rate = original code stream size ÷ final code stream size.
[0099] For example, in the scenario of encoding a thumbnail in RGBX format in JPEG format, the original code stream is the thumbnail in RGBX format, and the final code stream is binary data in JPEG format. In the scenario of encoding a thumbnail in RGBX format in ASTC format, the original code stream is the thumbnail in RGBX format, and the final code stream is binary data in ASTC format.
[0100] In addition, when the electronic device 100 stores the thumbnail, encodes the thumbnail into texture data, and then super-compresses the texture data, the memory occupied by the thumbnail can be reduced. Moreover, when the electronic device 100 reads binary data in ASTC format, if the local file storing the binary data in ASTC format is large, the time for the electronic device 100 to call an IO interface to read the binary data in ASTC format will be longer for the year / month view scenario that needs to read a large amount of binary data in ASTC format. In this way, the loading efficiency of the electronic device 100 is affected.
[0101] The embodiment of the present application provides another picture display method, which can include the following steps. First, when storing a thumbnail corresponding to a photographed or saved image, the electronic device 100 can first perform texture encoding on the thumbnail to obtain texture data. Then, the electronic device 100 super-compresses the texture data to obtain super-compressed texture data. When the electronic device 100 loads and displays the thumbnail based on a user operation, the electronic device 100 first acquires the super-compressed texture data. Then, the electronic device 100 decodes the super-compressed texture data into texture data, splices the texture data corresponding to a plurality of thumbnails into a texture large image, and finally renders and displays the texture large image.
[0102] In the picture display method, the thumbnail generation process can refer to (a) in Figure 7 As shown in (a) in Figure 7 The thumbnail generation process in the electronic device 100 can include the following steps. ①. The electronic device 100 can down-sample source data of an image photographed or downloaded based on a user saving operation to obtain a thumbnail in RGBX format. ②. The electronic device 100 can encode the thumbnail in RGBX format into binary data in ASTC format, which can be referred to as texture ASTC. ③. The electronic device 100 super-compresses the binary data in ASTC format to obtain super-compressed texture data. ④. The electronic device 100 saves the super-compressed texture data to a local device.
[0103] In the picture display method, the thumbnail loading process in the year-month view scene can refer to (b) in Figure 7 , as shown in (b) in Figure 7 , the thumbnail loading process in the electronic device 100 can include the following steps: ①. The electronic device 100 reads the saved super-compressed texture data from the local file. ②. The electronic device 100 decodes the super-compressed texture data into binary data in ASTC format. ③. The electronic device 100 splices n binary data in ASTC format into a texture ASTC. That is, splice n small pictures into a single large picture. ④. The electronic device 100 renders the single large picture obtained by splicing and displays it to the user interface.
[0104] In view of the problem that the code stream of the encoded texture is large, that is, the code stream of the binary data in ASTC format is large, the binary data in ASTC format needs to be compressed to reduce the storage overhead. In the embodiment of the present application, the process of encoding the thumbnail in RGBX format to obtain the binary data in ASTC format can also be referred to as texture compression. The process of compressing the binary data in ASTC format can be referred to as super-compression.
[0105] As shown in Figure 8 , the texture super-compression involved in the embodiment of the present application can include texture super-compression encoding and texture super-compression decoding. The texture super-compression encoding can include texture encoding and super-compression encoding; wherein the texture encoding can be performed by a texture encoder, and the texture encoder can encode the input thumbnail in RGBX format into a texture code stream. The super-compression encoding can be performed by a super-compression encoder, and the super-compression encoder can encode the texture code stream into a super-compression code stream. Illustratively, the texture code stream can include encoded data of various information; the super-compression texture code stream can include super-compressed data of various information (i.e. data after re-encoding of the encoded data of various information).
[0106] Illustratively, the texture super-compression decoding can include super-compression decoding and texture decoding; wherein the texture decoding can be performed by a texture decoder, and the super-compression decoding can be performed by a super-compression decoder. Illustratively, the super-compression decoding can decode the super-compressed data into texture data, and the texture decoding can decode the texture data into data that can be rendered. The decoded data can be sent to rendering and display.
[0107] Illustratively, the texture encoder, the super-compression encoder and the super-compression decoder can be implemented by a CPU or a professional chip, and the texture decoder can be hardened in a GPU.
[0108] In the embodiment of the present application, the super-compression texture code stream can be referred to as a super-compression code stream, or a texture super-compression code stream, and the specific name of the super-compression texture code stream is not limited in the embodiment of the present application.
[0109] The specific implementation of texture super-compression will be described in detail in the following Figure 12A - Figure 16 , and will not be described here in detail.
[0110] An example electronic device 100 provided by an embodiment of the present application is described below.
[0111] Figure 9A is a structural schematic diagram of the electronic device 100 provided by an embodiment of the present application.
[0112] The embodiments are described below with the electronic device 100 as an example. It should be understood that the electronic device 100 can have more or fewer components than those shown in the figure, can combine two or more components, or can have a different component configuration. The various components shown in the figure can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0113] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an 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 headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0114] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown in the figure, or combine certain components, or split certain components, or different component arrangements. The components shown in the figure can be implemented in hardware, software, or a combination of software and hardware.
[0115] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.
[0116] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0117] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that the processor 110 has just used or repeatedly uses. If the processor 110 needs to use the instructions or data again, it can directly call from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.
[0118] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0119] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 can contain multiple sets of I2C bus. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces respectively. For example, the processor 110 can be coupled to the touch sensor 180K through an I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, and the touch function of the electronic device 100 is realized.
[0120] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can contain multiple sets of I2S bus. The processor 110 can be coupled to the audio module 170 through the I2S bus, and communication between the processor 110 and the audio module 170 is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface, and the function of answering a phone through a Bluetooth headset is realized.
[0121] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled through the PCM bus interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface, and the function of answering a phone through a Bluetooth headset is realized. Both the I2S interface and the PCM interface can be used for audio communication.
[0122] The UART interface is a universal serial data bus, which is used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface, and the Bluetooth function is realized. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface, and the function of playing music through a Bluetooth headset is realized.
[0123] The MIPI interface can be used to connect the processor 110 and the display screen 194, the camera 193 and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to implement the photographing function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to implement the display function of the electronic device 100.
[0124] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 and the camera 193, the display screen 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
[0125] The SIM interface can be used to communicate with the SIM card interface 195 to implement the function of transmitting data to the SIM card or reading data in the SIM card.
[0126] The USB interface 130 is an interface that conforms to the USB standard specification, and can be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices and the like.
[0127] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.
[0128] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger.
[0129] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, and the like.
[0130] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0131] The antenna 1 and the antenna 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example, the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antennas can be used in combination with a tuning switch.
[0132] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and convert the signals into electromagnetic waves radiated through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 150 can be arranged in the processor 110. In some embodiments, at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 can be arranged in the same device.
[0133] The modem processor can include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be an independent device. In some other embodiments, the modem processor can be independent of the processor 110, and arranged in the same device as the mobile communication module 150 or other functional modules.
[0134] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.
[0135] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).
[0136] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.
[0137] The display screen 194 is configured to display images, videos, and the like. The display screen 194 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 flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.
[0138] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.
[0139] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.
[0140] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then transmitted to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.
[0141] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0142] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture expert group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.
[0143] The NPU is a neural-network (NN) calculation processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also constantly self-learn. Through the NPU, the electronic device 100 can realize intelligent cognition applications such as image recognition, face recognition, voice recognition, text understanding, etc.
[0144] The external memory 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 memory interface 120 to realize data storage functions. For example, music, video, etc. Files are saved in the external memory card.
[0145] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various function applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. Among them, the program storage area can store an operating system, at least one application required by a function (such as a face recognition function, a fingerprint recognition function, a mobile payment function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.). In addition, the internal memory 121 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0146] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.
[0147] The audio module 170 is configured to convert digital audio information into an analog audio signal output, and to convert an analog audio input into a digital audio signal. The audio module 170 can also be configured to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some of the functions of the audio module 170 can be disposed in the processor 110.
[0148] The speaker 170A, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0149] The receiver 170B, also referred to as a "earpiece", is configured to convert an audio electrical signal into a sound signal. When the electronic device 100 receives a call or a voice message, the user can listen to the voice by holding the receiver 170B close to the ear.
[0150] The microphone 170C, also referred to as a "microphone", "transducer", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, the user can make a sound by holding the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, noise reduction functions can also be realized. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, in addition to collecting sound signals, noise reduction, and can also identify the source of the sound, realize directional recording function, etc.
[0151] The earphone interface 170D is configured to connect a wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0152] The pressure sensor 180A is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. The pressure sensor 180A can be of various types, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates of conductive material. When a force is applied to the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view a short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0153] The gyroscope sensor 180B can be configured to determine the motion attitude of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake photography. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of shaking of the electronic device 100, calculates the distance that the lens module needs to compensate based on the angle, and lets the lens offset the shaking of the electronic device 100 by reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and motion sensing game scenarios.
[0154] The barometric pressure sensor 180C is configured to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude based on the air pressure value measured by the barometric pressure sensor 180C, and assists in positioning and navigation.
[0155] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of a flip cover by using the magnetic sensor 180D. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Further, based on the detected opening and closing state of the cover or the flip cover, the electronic device 100 can set a feature such as automatic unlocking of the flip cover.
[0156] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). When the electronic device 100 is stationary, the acceleration sensor 180E can detect the magnitude and direction of gravity. The acceleration sensor 180E can also be used to identify the attitude of the electronic device, and can be applied to landscape / portrait screen switching and pedometer applications.
[0157] Distance sensor 180F is configured to measure distance. Electronic device 100 can measure distance by infrared or laser. In some embodiments, electronic device 100 can utilize distance sensor 180F to measure distance for fast focusing when taking a picture.
[0158] Proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode can be an infrared light emitting diode. Electronic device 100 emits infrared light outwardly through the light emitting diode. Electronic device 100 detects infrared reflected light from nearby objects using the photodiode. When sufficient reflected light is detected, electronic device 100 can determine that there is an object near electronic device 100. When insufficient reflected light is detected, electronic device 100 can determine that there is no object near electronic device 100. Electronic device 100 can utilize proximity light sensor 180G to detect that a user is holding electronic device 100 close to the ear for a phone call, so as to automatically turn off the screen to save power. Proximity light sensor 180G can also be used for automatic unlocking and locking of the screen in a holster mode or a pocket mode.
[0159] Ambient light sensor 180L is configured to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 according to the sensed ambient light brightness. Ambient light sensor 180L can also be used to automatically adjust white balance when taking a picture. Ambient light sensor 180L can also cooperate with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touch.
[0160] Fingerprint sensor 180H is configured to collect a fingerprint. Electronic device 100 can utilize the collected fingerprint characteristics to implement fingerprint unlocking, access application lock, fingerprint picture taking, fingerprint call answering, and the like.
[0161] Temperature sensor 180J is configured to detect temperature. In some embodiments, electronic device 100 utilizes the temperature detected by temperature sensor 180J to implement temperature handling strategies. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, electronic device 100 implements performance reduction of a processor located near temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, electronic device 100 heats battery 142 to avoid abnormal shutdown of electronic device 100 caused by low temperature. In other embodiments, when the temperature is lower than yet another threshold, electronic device 100 implements voltage boosting of the output voltage of battery 142 to avoid abnormal shutdown caused by low temperature.
[0162] Touch sensor 180K, also called "touch panel". Touch sensor 180K can be disposed on display screen 194, and touch screen, also called "touch panel", is composed of touch sensor 180K and display screen 194. Touch sensor 180K is used to detect touch operation applied on or near it. Touch sensor 180K can transmit detected touch operation to application processor to determine touch event type. Visual output related to touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K can also be disposed on the surface of electronic device 100, which is different from the position of display screen 194.
[0163] Keys 190 include power on key, volume key, etc. Keys 190 can be mechanical keys. They can also be touch keys. Electronic device 100 can receive key input and generate key signal input related to user settings and function control of electronic device 100.
[0164] Motor 191 can generate vibration prompt. Motor 191 can be used for incoming call vibration prompt, and also can be used for touch vibration feedback. For example, touch operation applied to different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. Touch operation applied to different regions of display screen 194 can also correspond to different vibration feedback effects of motor 191. Different application scenarios (such as time reminder, receiving information, alarm, game, etc.) can also correspond to different vibration feedback effects. Touch vibration feedback effect can also support customization.
[0165] Indicator 192 can be an indicator light, which can be used to indicate charging state, power change, and also can be used to indicate messages, missed calls, notifications, etc.
[0166] SIM card interface 195 is used to connect SIM card. SIM card can be inserted into or pulled out of SIM card interface 195 to realize contact and separation with electronic device 100. Electronic device 100 can support one or N SIM card interfaces, N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. SIM card interface 195 can also be compatible with different types of SIM cards. SIM card interface 195 can also be compatible with external storage cards. Electronic device 100 interacts with network through SIM card to realize functions such as call and data communication.
[0167] Figure 9B is a software structure block diagram of electronic device 100 of embodiments of the present application.
[0168] The layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, the application layer, the framework layer, the system service layer, and the kernel layer.
[0169] The application layer can include a series of application packages. In some examples, the application layer can also be referred to as the application program layer.
[0170] As Figure 9B shown, the application package can include camera, gallery, phone, desktop, and other applications (also referred to as applications).
[0171] Optionally, in some examples, the gallery also includes a display module, which can be used to display a thumbnail display interface. The thumbnail display interface is used to display thumbnails of multiple photos obtained by the electronic device 100.
[0172] The display module can also be used to issue a thumbnail loading request to the framework layer based on user operations on the gallery application (e.g., switching view scenes, obtaining an open gallery), which is used to request loading of batch thumbnails.
[0173] The framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. The framework layer can include some pre-defined functions.
[0174] Optionally, in one possible implementation, the APIs and programming frameworks provided by the framework layer can support multiple languages, such as C, C++, Java, JS, and other programming languages.
[0175] As Figure 9B shown, the framework layer can include a loading framework. The loading framework can include a reading module and a splicing module. The reading module can be used to read texture data corresponding to the thumbnails. The splicing module can be used to splice the texture data of multiple thumbnails read by the reading module into a texture large image according to the layout distribution information of the thumbnail display interface.
[0176] As Figure 9B shown, the framework layer can also include a UI framework. The UI framework can receive the thumbnail loading request issued by the gallery application. Then, the UI framework can pass the thumbnail loading request to the loading framework in the framework layer.
[0177] As Figure 9B shown, the framework layer can also include a graphics subsystem. The graphics subsystem can be used to render the texture large image spliced by the splicing module.
[0178] The system service layer is a core capability set of the operating system of the electronic device 100. The system service layer can provide services to the application layer through the framework layer.
[0179] As shown in Figure 9B , the system service layer can include a media library, which can be used to provide access to the application layer and services for obtaining media resources (e.g., pictures, videos, audio, files, etc.) in the electronic device. The media library can also include a data processing module. The data processing module can process videos or pictures taken by the electronic device. For example, the data processing module can downsample pictures taken by the camera to obtain a thumbnail in RGBX format. Then, the data processing module can be used to perform texture super compression on the thumbnail in RGBX format to obtain a super compressed code stream.
[0180] In some examples, the data processing module can also be used to decode the super compressed code stream to obtain a texture code stream.
[0181] In the embodiments of the present application, the media library can also call the kernel capabilities provided by the kernel subsystem to store the super compressed code stream processed by the data processing module in the thumbnail database in the file system module. For example, the media library can send an instruction to the file system, which can carry the super compressed code stream to be saved, and the instruction is used to instruct the file system to store the super compressed code stream carried in the instruction.
[0182] In some examples, the thumbnail data can be implemented as a key value database (KVDB). The KVDB can store or index data based on key value pairs of data.
[0183] The kernel layer can include one or more kernel subsystems, which can provide basic kernel capabilities to the upper layer, including process / thread management, memory management, file system, and other kernel capabilities.
[0184] As shown in Figure 9B , the kernel subsystem can include a file system module, which is used to save files in the electronic device 100, such as a file storing the thumbnail database.
[0185] Based on the above-mentioned hardware and software structure of the electronic device 100, the embodiments of the present application provide a picture display method. Figure 10 An example of a flowchart of a picture display method provided by the embodiments of the present application is shown. As shown in Figure 10 , the electronic device 100 can include a data processing module, a display module, a reading module, a splicing module, a data processing module, a file system module, and an application module. The picture display method provided by the embodiments of the present application can include the following steps:
[0186] Steps S1000-S1004: The electronic device 100 saves the thumbnail.
[0187] S1000. The electronic device 100 acquires source data and sends the source data to a data processing module.
[0188] The source data acquired by the electronic device 100 can be a picture acquired by a camera of the electronic device 100, or a picture downloaded by the electronic device 100 based on a save operation of a user. The embodiments of the present application do not limit this.
[0189] The electronic device 100 can send the acquired source data to the data processing module.
[0190] In some examples, the electronic device 100 can also directly save the source data.
[0191] S1001. The data processing module down-samples the source data to obtain a thumbnail.
[0192] When saving the source data, the electronic device 100 generates a thumbnail corresponding to the source data. In some examples, the electronic device 100 can down-sample the source data by a data processing module in a media library to obtain the thumbnail. The thumbnail can be an image in RGBX format.
[0193] S1002. The data processing module encodes the thumbnail to obtain texture data.
[0194] The data processing module can encode the thumbnail to obtain texture data. For example, the data processing module can sample and encode the thumbnail by ASTC to obtain the texture data. Generally, the texture data corresponding to the thumbnail occupies less memory than the thumbnail.
[0195] How the electronic device 100 encodes the thumbnail into texture data can be seen from the description of the data processing module in the following Figure 12A , which will not be described here in detail.
[0196] S1003. The data processing module super-compresses the texture data to obtain super-compressed texture data.
[0197] The data processing module of the electronic device 100 can further encode the encoded texture data, i.e., super-compress the texture data to obtain super-compressed texture data.
[0198] How the data processing module of the electronic device 100 super-compresses the texture data can be seen from the description of the data processing module in the following Figure 13 - Figure 16 , which will not be described here in detail.
[0199] S1004. The electronic device 100 saves the super compressed texture data into the file system module.
[0200] The electronic device 100 can save the super compressed texture data into the file system module. Specifically, the file system module in the electronic device 100 can store multiple thumbnails in order according to the display order in the KVDB of the file system module.
[0201] In a possible implementation, the key information of the super compressed texture data corresponding to the thumbnail in the KVDB can be a datetime_id string composed of the date and time of the thumbnail and the primary key ID. When storing the thumbnail, the electronic device 100 stores in order according to the datetime_id string corresponding to the thumbnail. In this way, the KVDB in the electronic device 100 can provide the ability to query a batch of thumbnails according to a range. For example, the gallery application can initiate a thumbnail loading request, which carries the maximum value max and the minimum value min of the key information. The KVDB can return the super compressed texture data corresponding to all thumbnails with key information ranging from min to max.
[0202] The date and time of the thumbnail can be the date and time when the electronic device 100 takes or downloads the source data corresponding to the thumbnail. For example, the date when the electronic device 100 takes the picture 1 is February 20, 2023, and the time is 08:30:45. Then, the date and time of the thumbnail generated by the electronic device 100 based on the picture 1 is February 20, 2023, and the time is 08:30:45. Step S1005-Step S1009: The electronic device 100 displays the thumbnail. Figure 1 The date and time of the thumbnail recorded by the electronic device 100 can be in the format of “year-month-day_hour-minute-second”, that is, the date and time of the thumbnail recorded by the electronic device 100 can be “20230220_083045”. It can be understood that the present application does not limit the format of the date and time of the thumbnail saved by the electronic device. Figure 1 The primary key ID of the thumbnail can be composed of numbers, and the electronic device 100 can generate the primary key ID of the thumbnail saved by the electronic device 100 in a sequential increasing manner. That is, the more recent the date and time of the thumbnail saved by the electronic device 100, the larger the value of the primary key ID corresponding to the thumbnail.
[0203] Step S1005-Step S1009: The electronic device 100 displays the thumbnail.
[0204] S1005. The application module initiates a thumbnail loading request.
[0205]
[0206] An application module of the electronic device 100, such as a gallery application, a photo album application, and the like, can initiate a thumbnail loading request. The thumbnail loading request initiated by the application module can carry a date time and a primary key ID of a thumbnail to be acquired.
[0207] S1006. The reading module acquires the super compressed texture data from the file system module based on the thumbnail loading request.
[0208] The reading module of the electronic device 100 can query the super compressed texture data corresponding to the thumbnail from the KVDB in the file system module based on the date time and the primary key ID of the thumbnail carried in the thumbnail loading request, and acquire the super compressed texture data.
[0209] Optionally, in a possible implementation, since the KVDB can provide the capability of querying a batch of thumbnails according to a range, the reading module can acquire the date time and the primary key ID corresponding to the thumbnail from the metadata database in the electronic device 100 based on the thumbnail loading request. It can be understood that if the thumbnail loading request needs to load multiple thumbnails, the reading module can acquire the date time and the primary key ID corresponding to the multiple thumbnails from the metadata database. The reading module can assemble the date time and the primary key corresponding to each of the multiple thumbnails into a datetime_id string. Then, the reading module can send a query request to the KVDB, and the query request can carry the maximum value max and the minimum value min of the datetime_id string assembled from the multiple thumbnails. The KVDB can return the super compressed texture data corresponding to all the thumbnails within the range from min to max of the datetime_id string.
[0210] In a possible implementation, the KVDB can send the corresponding super compressed texture data to the data processing module based on the query request of the reading module.
[0211] Optionally, in another possible implementation, the KVDB can send the corresponding super compressed texture data to the reading module based on the query request of the reading module. Then, the reading module can send the super compressed texture data to the data processing module.
[0212] Optionally, in yet another possible implementation, the KVDB can send the corresponding super compressed texture data to a piece of memory, such as buffer1, based on the query request of the reading module. Then, the address of the buffer1 is sent to the reading module. The reading module can send the address of the buffer1 to the data processing module and instruct the data processing module to decode the super compressed texture data in the buffer1.
[0213] S1007. The data processing module decodes the super compressed texture data into texture data.
[0214] In a possible implementation, the data processing module can receive the super compressed texture data sent by the reading module or the KVDB. The data processing module can decode the super compressed texture data into texture data.
[0215] Optionally, in another possible implementation, the data processing module can receive the address of the buffer 1 and an instruction 1 for instructing the data processing module to decode the super compressed texture data in the buffer 1. The instruction 1 is used to instruct the data processing module to decode the super compressed texture data in the buffer 1. Based on the instruction 1, the data processing module can decode the super compressed texture data stored in the buffer 1 into texture data.
[0216] Further, in a possible implementation, the data processing module can send the decoded texture data to the reading module, and then the reading module sends the texture data to the stitching module.
[0217] Optionally, in a possible implementation, after the data processing module decodes the super compressed texture data into texture data in the buffer 1, the data processing module can send the address of the buffer 1 to the stitching module and instruct the stitching module to stitch the texture data in the buffer 1 into a texture large image.
[0218] S1008. The stitching module stitches the texture data into a texture large image.
[0219] In a possible implementation, the stitching module can receive the texture data sent by the reading module. Then, the stitching module can stitch the texture data corresponding to the plurality of thumbnails into a texture large image.
[0220] Optionally, in another possible implementation, the stitching module can receive the instruction 2 sent by the data processing module, and the instruction 2 can carry the address of the buffer 1. The instruction 2 is used to instruct the stitching module to stitch the texture data in the buffer 1 into a texture large image. Based on the instruction 2, the stitching module can stitch the texture data in the buffer 1 into a texture large image.
[0221] S1009. The display module displays the texture large image.
[0222] The stitching module can send the stitched texture large image to the graphics subsystem, and the graphics subsystem can render the texture large image. The graphics subsystem can send the rendered texture large image to the display module, and the display module can display the rendered texture large image.
[0223] Figure 11An exemplary flowchart of a picture display method provided by the embodiments of the present application is shown. In Figure 11 The picture display method is shown, the source data is a photo taken by the camera of the electronic device 100, and the application module is a gallery. The picture display method provided by the embodiments of the present application is described in detail. As shown in Figure 11 The electronic device 100 can include a camera, a gallery, a UI framework, a graphics subsystem, a loading framework, a media library, and a file system module. The gallery can include a display module. The loading framework can include a reading module and a splicing module. The media library can include a data processing module. The file system module can include a thumbnail database, which can be implemented as a KVDB. The picture display method can include the following steps:
[0224] Step S1100-Step S1105: The electronic device 100 saves a thumbnail.
[0225] S1100. The camera takes a photo and saves the photo.
[0226] The camera of the electronic device 100 can receive a user operation of taking a photo. In response to the user operation, the camera of the electronic device 100 can obtain a photo and return the photo to the camera. The camera can save the photo.
[0227] S1101. The data processing module down-samples the photo to obtain a thumbnail.
[0228] Step S1101 can refer to the description in step S1001, which will not be described here.
[0229] S1102. The data processing module encodes the thumbnail to obtain texture data.
[0230] The data processing module can encode the thumbnail using an ASTC encoding method to obtain texture data.
[0231] In a possible implementation, the specific implementation of the data processing module encoding the thumbnail to obtain texture data can refer to Figure 12A . As shown in Figure 12A The data processing module encoding the thumbnail to obtain texture data can include the following steps:
[0232] S1201. The thumbnail in RGBX format is divided into sub-blocks.
[0233] The data processing module can perform block processing on the thumbnail in RGBX format to obtain a plurality of sub-blocks (or a plurality of blocks, a plurality of block images, etc.).
[0234] Exemplarily, the data processing module can divide the thumbnail image in the RGBX format into a plurality of sub-blocks with the same size; for example, the size of each sub-block is 4*4, 8*8, etc., which is not limited in the present application. It should be noted that the height and width of each sub-block can be the same or different, which is not limited in the present application.
[0235] Exemplarily, the data processing module can perform block processing on the thumbnail image in the RGBX format according to the size of the pre-configured block; or perform block processing on the image according to the texture complexity or application scenario of the thumbnail image in the RGBX format, which is not limited in the present application.
[0236] S1202. Set the encoding mode of the sub-block.
[0237] The data processing module can support selecting an optimal encoding mode from N (N is an integer greater than 2) encoding modes in the texture compression standard to perform texture encoding on each sub-block. Exemplarily, the encoding mode (or preset encoding mode) can be used to indicate the encoding mode of the block, the color endpoint mode, and the number of partitions.
[0238] Exemplarily, the encoding mode of the sub-block can be used to indicate the plane information (such as the number of planes) of the sub-block and the encoding mode of the weight corresponding to the sub-block (such as the size of the weight matrix corresponding to the sub-block (which is the same as the size of the block obtained by performing block processing on the thumbnail image in the RGBX format in S1201), the quantization parameter of the weight corresponding to the block, the entropy encoding mode of the weight corresponding to the block, etc.).
[0239] Exemplarily, the color endpoint mode is used to indicate the encoding mode of the endpoint corresponding to the block (for example, the quantization parameter of the endpoint corresponding to the block, the preprocessing mode (such as difference, absolute value), the entropy encoding mode of the endpoint corresponding to the block, etc.).
[0240] The plurality of sub-blocks obtained by block processing the thumbnail image in the RGBX format can include a first sub-block. The following describes an example in which the target encoding mode corresponding to the first sub-block is that the encoding mode of the block (block mode) is “66”, the color endpoint mode (CEM) is “12”, and the maximum number of partitions is 2.
[0241] That is, the data processing module can fix the coding mode of the first sub-block as "66". Illustratively, when the coding mode of the sub-block is "66", the weight syntax (i.e. the coding data of the weight) of each sub-block can be fixed as 32 bits (so that better image quality can be preserved); and the size of the weight matrix of the sub-block can be fixed as 4*4, and the number of planes can be fixed as 1 (when the number of planes is 1, each component of the pixel value of the pixel point in the first sub-block is not split, but all components of the pixel value of the pixel point in the first sub-block are fitted as a whole).
[0242] S1203. Set the color endpoint mode of the sub-block, determine the number of planes and the number of partitions.
[0243] Illustratively, the data processing module can set the CEM of the first sub-block as "12". Illustratively, when the CEM is "12", the endpoint syntax (i.e. the coding data of the endpoint) of each sub-block can be fixed as 64 bits, and the entropy coding mode of the endpoint is an entropy coding mode with a compression rate of 1, i.e. the value of the endpoint is converted into a binary representation.
[0244] The data processing module can fix the number of planes of the first sub-block as "1", and fix the number of partitions corresponding to the first sub-block as 1. For example, the size of the first sub-block is 4*4, and the first sub-block can include 16 pixel points. A mathematical fitting method (such as Principal Components Analysis (PCA)) can be used to fit the pixel values (including all components) of the 16 pixel points into a straight line, and the values of the two endpoints of the straight line are determined. Each endpoint value contains the same components as the pixel values of the pixel points of the first sub-block; for example, the value of endpoint 1 is RGB1, and the value of endpoint 2 is RGB2. Then, a set of weights can be determined, so that the pixel value of each pixel point in the first sub-block can be calculated by weighting the values of the two endpoints and the value of a weight in the set of weights; in this way, the values of the weights corresponding to the 16 pixel points can be obtained. The values of the weights corresponding to some of the 16 pixel points can be the same.
[0245] For example, a set of weights includes the values of 5 weights: 0.0, 0.25, 0.5, 0.75 and 1. The values of the weights corresponding to pixel point 1, pixel point 2, pixel point 5 and pixel point 6 are 0.0; the values of the weights corresponding to pixel point 3, pixel point 7, pixel point 9 and pixel point 10 are 0.25; the value of the weight corresponding to pixel point 11 is 0.5; the values of the weights corresponding to pixel point 4, pixel point 5, pixel point 13 and pixel point 14 are 0.75; the values of the weights corresponding to pixel point 12, pixel point 15 and pixel point 16 are 1.
[0246] S1204. The sub-block code stream is generated.
[0247] For example, the data processing module can determine whether the encoding error corresponding to the entropy encoding of the value of the first sub-block corresponding weight and the value of the endpoint when the number of partitions is 1 is less than the error threshold. If it is less than the error threshold, it means that the encoding error corresponding to the entropy encoding of the value of the first sub-block corresponding weight and the value of the endpoint when the number of partitions is 1 is small. Then the data processing module can entropy encode the value of the first sub-block corresponding weight based on the entropy encoding method indicated by the encoding mode of the block corresponding to "66", and entropy encode the value of the first sub-block corresponding endpoint based on the entropy encoding method indicated by the CEM corresponding to "12", to obtain the texture code stream of the first sub-block.
[0248] For example, when the data processing module determines that the encoding error is less than the threshold, the data processing module entropy encodes the values of the two endpoints corresponding to the first sub-block. When the data processing module determines that the encoding error is greater than or equal to the threshold, the data processing module entropy encodes the values of the four endpoints corresponding to the first sub-block.
[0249] In addition, other information corresponding to the first sub-block can also be entropy encoded and written into the texture code stream of the first sub-block.
[0250] Figure 12B The syntax structure diagram of the texture code stream of the first sub-block is shown for example. Figure 12B The odd rows are bit numbers, and the even rows are semantics.
[0251] Referring to Figure 12B For example, the texture code stream of the first sub-block occupies 16 bytes, i.e. 128 bits; from low to high, it is marked as 1-127 bits. Among them, the weight (i.e. the encoding data of the first sub-block corresponding weight) occupies the bit positions numbered 96-127, a total of 32 bits. The color endpoint data (i.e. the encoding data of the first sub-block corresponding endpoint) occupies the bit positions numbered 17-80. The bit positions numbered 11 and 12 are 2 bits, which can be used to jointly represent the partition information (part). The bit positions numbered 0-10 are 11 bits, which can be used to jointly represent the encoding mode of the block (i.e. the target encoding mode of the first sub-block).
[0252] It can be understood that the encoding mode of the first sub-block is not limited by the embodiments of the application.
[0253] S1205. The texture code stream is obtained.
[0254] The data processing module can encode other sub-blocks in the plurality of sub-blocks obtained by partitioning the thumbnail. The encoding mode of the other sub-blocks can be the same as or different from the first sub-block. The encoding process of the other sub-blocks can refer to the description of the encoding process of the first sub-block, which will not be described here.
[0255] After the data processing module encodes each sub-block in the plurality of sub-blocks obtained by partitioning the thumbnail, the data processing module can obtain a texture code stream corresponding to each sub-block. Finally, the data processing module can form a texture code stream of the thumbnail in RGBX format from the texture code streams corresponding to the plurality of sub-blocks.
[0256] In the embodiments of the present application, the texture code stream of the thumbnail in RGBX format can also be referred to as texture data.
[0257] S1103. The data processing module super-compresses the texture data to obtain super-compressed texture data.
[0258] The data processing module can super-compress the texture data obtained by encoding to obtain super-compressed texture data. Illustratively, the data processing module can include a super-compression encoder, which can obtain a texture code stream (which can also be referred to as texture data) and parse the code stream header. The super-compression encoder extracts the encoding data of the weights corresponding to the plurality of sub-blocks and the encoding data of the endpoints from the texture code stream. Then, the super-compression encoder encodes the encoding data of the weights corresponding to the plurality of blocks and the encoding data of the endpoints corresponding to the plurality of blocks to obtain a super-compressed texture code stream (which can also be referred to as super-compressed texture data).
[0259] Since, for all sub-blocks in the texture code stream, the syntax values of other parts in the sub-blocks are the same and fixed values except for the weights, endpoints, and partition information, these fixed syntaxes can not be carried in the code stream, and thus only the three types of syntaxes that are not the same, i.e., the weights, endpoints, and partition information in each sub-block, need to be super-compressed, so as to obtain the super-compressed texture code stream.
[0260] Illustratively, the specific process of super-compressing the texture data by the data processing module to obtain super-compressed texture data can refer to Figure 13 .
[0261] As shown in Figure 13 , the data processing module super-compresses the texture data to obtain super-compressed texture data, which can include the following steps:
[0262] S1301. Obtain a texture code stream and parse the code stream header.
[0263] The data processing module can parse the texture code stream to obtain the encoding data of the weight corresponding to each sub-block, the encoding data of the end point, and the encoding data of other information (e.g., partition information, image size, block information, encoding mode identifier, etc.) in the texture code stream. For example, referring to Figure 14 , the data processing module can perform syntax extraction on the texture code stream to extract the encoding data of the weight corresponding to each sub-block, the encoding data of the end point, and the encoding data of the partition information, etc.
[0264] S1302. Extract the weight of the sub-block.
[0265] The data processing module can perform syntax extraction on the texture code stream to extract the encoding data of the weight corresponding to each sub-block. Then, referring to Figure 14 , the data processing module can perform table-based compression on the encoding data of the weight corresponding to each sub-block. Specifically, the data processing module can perform table-based compression on the encoding data of the weight corresponding to multiple sub-blocks to obtain table data. Then, the data processing module can perform entropy encoding on the table data to obtain the weight code stream corresponding to each sub-block. How the data processing module extracts the weight of the sub-block can be referred to the description in Figure 15 , which will not be described here. The specific process of how the data processing module performs table-based compression on the encoding data of the weight corresponding to multiple sub-blocks can be referred to the description in Figure 16 , which will not be described here.
[0266] S1303. Extract the end point of the sub-block.
[0267] The data processing module can perform syntax extraction on the texture code stream to extract the encoding data of the end point corresponding to each sub-block. Then, referring to Figure 14 , the data processing module can perform transform encoding on the encoding data of the end point corresponding to each sub-block to obtain the end point code stream corresponding to each sub-block.
[0268] S1304. Determine whether there is no remaining sub-block, if yes, execute step S1305, if not, execute step S1302.
[0269] The data processing module can extract the weight code stream and the end point code stream of each sub-block according to the above steps S1302 and S1303. And determine whether there is a remaining sub-block, if there is a remaining sub-block, the data processing module extracts the weight code stream and the end point code stream of the sub-block according to the above steps S1302 and S1303. If there is no remaining sub-block, the data processing module can execute step S1305.
[0270] S1305. Encode the extracted weight of the sub-block and the end point of the sub-block to obtain the super-compressed texture code stream.
[0271] Referring to Figure 14The data processing module can perform entropy coding on the coding data of the partition information extracted by the syntax to obtain a partition information code stream corresponding to each sub-block. Then, the data processing module can perform code stream encapsulation on the weight code stream corresponding to each sub-block, the endpoint code stream, and the partition information code stream to obtain the super-compressed texture code stream.
[0272] In a possible implementation, the data processing module can store the weight code stream and the endpoint code stream corresponding to each block, and then store the weight code stream and the endpoint code stream corresponding to the next block, until the last block. For example, as shown in the super-compressed texture code stream encoding mode 1 in FIG. 15. Figure 15 The data processing module can store the weight code stream of the sub-block 0 (corresponding to the block 0 weight in FIG. 15) and the endpoint code stream of the sub-block 0 (corresponding to the block 0 endpoint in FIG. 15) behind the code stream header. Then, the weight code stream of the sub-block 1 (corresponding to the block 1 weight in FIG. 15) and the endpoint code stream of the sub-block 1 (corresponding to the block 1 endpoint in FIG. 15) are stored, and so on, until the weight code stream of the sub-block n (corresponding to the block n weight in FIG. 15) and the endpoint code stream of the sub-block n (corresponding to the block n endpoint in FIG. 15) are stored. Figure 15 Figure 15 Figure 15
[0273] Optionally, in another possible implementation, the data processing module can first store the weight code streams corresponding to all sub-blocks, and then store the endpoint code streams corresponding to all sub-blocks. For example, as shown in the super-compressed texture code stream encoding mode 2 in FIG. 15. Figure 15 The data processing module can sequentially store the weight code stream of the sub-block 0 (corresponding to the block 0 weight in FIG. 15), the weight code stream of the sub-block 1 (corresponding to the block 1 weight in FIG. 15), and so on, until the weight code stream of the sub-block n (corresponding to the block n weight in FIG. 15) is stored. Then, the data processing module sequentially stores the endpoint code stream of the sub-block 0 (corresponding to the block 0 endpoint in FIG. 15), the endpoint code stream of the sub-block 1 (corresponding to the block 1 endpoint in FIG. 15), and so on, until the endpoint code stream of the sub-block n (corresponding to the block n endpoint in FIG. 15) is stored. Figure 15 Figure 15 Figure 16
[0274] It can be understood that the super-compressed texture code stream encoding mode is not limited in the embodiments of the present application.
[0275] Figure 16 FIG. 16 is a schematic diagram of the table building process shown in an example. As shown in FIG. 16, the table building process of the electronic device 100 can include the following steps. Figure 16
[0276] S1601, traverse the coding data of the weight corresponding to the i th first sub-block, and the initial value of i is 1.
[0277] Exemplarily, i is a positive integer. It is assumed that the total number of sub-blocks contained in the thumbnail is N (N is an integer greater than or equal to 2), and i is less than or equal to N.
[0278] Exemplarily, the data processing module of the electronic device 100 can traverse the encoding data of the weight corresponding to the i-th first sub-block in the texture code stream of the thumbnail in the order of input (for example, input to the texture super-compressor) of bits in the texture code stream of the i-th first sub-block.
[0279] S1602, find the encoding data of a weight from the weight table for the j-th time, and the initial value of j is 1.
[0280] Exemplarily, the weight table can contain the encoding data of H (H is 0 or a positive integer) weights. Exemplarily, the index table can contain H indexes. Exemplarily, initially, the weight table and the index table are both empty, that is, H is equal to 0.
[0281] Exemplarily, when H is greater than 0, j is less than or equal to H.
[0282] Exemplarily, the data processing module can find the encoding data of a weight from the weight table from back to front each time.
[0283] Exemplarily, when the encoding data of a weight is found from the weight table for the j-th time, S1603 can be performed; when the encoding data of a weight is not found from the weight table for the j-th time (that is, H is equal to 0), S1612 is performed.
[0284] S1603, replace the encoding data of the weight corresponding to the i-th first sub-block with the encoding data of a weight found from the weight table for the j-th time.
[0285] S1604, determine the j-th quality loss corresponding to the i-th first sub-block.
[0286] Exemplarily, the data processing module can perform texture decoding on the replaced encoding data of the weight corresponding to the i-th first sub-block and the encoding data of the endpoint corresponding to the i-th first sub-block to obtain the j-th reconstructed image of the i-th first sub-block. Then, the data processing module can determine the j-th quality loss corresponding to the i-th first sub-block based on the error between the image of the i-th first sub-block and the reconstructed image of the i-th first sub-block.
[0287] For example, the quality loss can be a sum of absolute difference (SAD), that is, the data processing module can calculate the absolute value of the difference between the image of the i-th first sub-block and the j-th reconstructed image of the i-th first sub-block, pixel by pixel, for each component in RGBX, respectively, and then sum all the absolute values, and finally the result is taken as the quality loss. In this case, the first loss threshold can be taken as 0, and the second loss threshold can be taken as 55.
[0288] S1605, determine whether the j-th quality loss corresponding to the i-th first sub-block is less than the first loss threshold.
[0289] For example, when the j-th quality loss corresponding to the i-th first sub-block is less than the first loss threshold, it means that the encoding data of one weight found from the weight table the j-th time is closer to the encoding data of the weight corresponding to the i-th first sub-block, and the data processing module can end the traversal of the encoding data of other weights from the weight table, that is, execute S1606.
[0290] For example, when the j-th quality loss corresponding to the i-th first sub-block is greater than or equal to the first loss threshold, the data processing module can continue to traverse the encoding data of other weights from the weight table, that is, execute S1609, to determine whether there is other encoding data of weights in the weight table that is closer to the encoding data of the weight corresponding to the i-th first sub-block.
[0291] S1606, write the index of the encoding data of one weight found from the weight table the j-th time into the index table.
[0292] For example, the index of the encoding data of one weight found from the weight table the j-th time can be used to represent the position of the encoding data of one weight found from the weight table the j-th time in the weight table. After executing S1606, the data processing module can execute S1607.
[0293] S1607, determine whether i is equal to N.
[0294] For example, the data processing module can determine whether i is equal to N, that is, whether there is still an unprocessed sub-block (that is, a sub-block whose index of the corresponding weight has not been written into the index table). When i is less than N, the data processing module determines that there is still an unprocessed block, and can execute S1608. When i is equal to N, the data processing module can determine that there is no unprocessed sub-block, and the table is completed.
[0295] S1608, add 1 to i.
[0296] For example, after executing S1608, the data processing module can return to execute S1601.
[0297] S1609, determining whether j is equal to H.
[0298] For example, the data processing module can determine whether j is equal to H, that is, whether the traversal of the encoding data of all weights in the weight table is completed. When j is less than H, the data processing module can determine that the traversal of the encoding data of all weights in the weight table is not completed, and can execute S1610. When j is equal to H, the data processing module can determine that the traversal of the encoding data of all weights in the weight table is completed, and can execute S1611.
[0299] S1610, adding 1 to j.
[0300] For example, after the data processing module executes S1610, the data processing module can return to execute S1602.
[0301] S1611, determining whether the minimum quality loss corresponding to the first sub-block is less than the second loss threshold.
[0302] For example, the data processing module can determine the minimum quality loss from the H quality losses corresponding to the first sub-block. Then, the data processing module can determine whether the minimum quality loss corresponding to the first sub-block is less than the second loss threshold. When the minimum quality loss corresponding to the first sub-block is less than the second loss threshold, the data processing module can execute S1613. When the minimum quality loss corresponding to the first sub-block is greater than or equal to the second loss threshold, the data processing module can execute S1612.
[0303] S1612, writing the encoding data of the weight corresponding to the first sub-block into the weight table, and writing the index of the encoding data of the weight corresponding to the first sub-block in the weight table into the index table.
[0304] After the data processing module executes S1612, the data processing module can return to execute S1607.
[0305] S1613, writing the index of the encoding data of the weight found from the weight table for the kth time into the index table. The kth quality loss corresponding to the first sub-block is the minimum quality loss.
[0306] Wherein, k is a positive integer less than or equal to H.
[0307] It should be noted that step S1605 is an optional step, that is, the data processing module can also not execute this step S1605.
[0308] It should be noted that in step S1609, in order to improve the speed, the traversal number can be less than H.
[0309] It should be noted that in step S1612, the data processing module can write the index relative value into the index table, and the index relative value refers to the index value of the current sub-block corresponding weight coding data in the weight table minus the index value of the last sub-block in the weight table. When it is the first sub-block, the index relative value directly subtracts 0 from the index value 0 of the current block.
[0310] It should be noted that before S1603, the data processing module can perform texture decoding on the coding data of the weight corresponding to the i-th first sub-block and the coding data of the endpoint corresponding to the i-th first sub-block, to obtain the reference reconstructed image of the i-th first sub-block. Then, the data processing module can replace step S1604 with: determining the difference value between the reference reconstructed image of the i-th first sub-block and the j-th reconstructed image of the i-th first sub-block. For example, the data processing module can calculate the absolute value of each component difference of the RGBX of the reference reconstructed image of the i-th first sub-block and the j-th reconstructed image of the i-th first sub-block as the difference value. Then, step S1605 can be replaced with: judging whether the difference value is greater than a difference threshold (the difference threshold can be set according to requirements, such as 5; the present application does not limit this). When the difference value is greater than the difference threshold, the data processing module can consider that the coding data of one weight found from the weight table for the j-th time cannot replace the coding data of the weight corresponding to the i-th first sub-block; at this time, the data processing module can execute S1609. When the difference value is less than or equal to the difference threshold, the data processing module can execute S1606.
[0311] The data processing module encodes the coding data of the weight corresponding to each sub-block according to the weight table and the index table. Magic After obtaining the weight table and the index table through steps S1601-S1613, the data processing module can encode the coding data of the weight corresponding to each sub-block based on the coding data of the weight corresponding to each sub-block, the weight table and the index table, to obtain a weight code stream.
[0312] For example, the data processing module can pre-set a plurality of weight modes (weight mode); for example:
[0313] weight mode is 0: the data processing module can directly write the coding data (binary bits) of the weight contained in the weight table into the super-compressed texture code stream (corresponding to the entropy encoding mode with a compression ratio of 1), and entropy encode the index table (corresponding to the entropy encoding mode with a compression ratio greater than 1).
[0314] weight mode is 1: the data processing module can write all the coding data of the weight corresponding to each sub-block extracted from the texture code stream into the super-compressed texture code stream (i.e., corresponding to the entropy encoding mode with a compression ratio of 1).
[0315] weight mode is 2: the data processing module can entropy encode the encoding data of the weights corresponding to all sub-blocks extracted from the texture code stream (corresponding to an entropy encoding mode with a compression rate greater than 1).
[0316] weight mode is 3: the data processing module can entropy encode both the weight table and the index table (corresponding to an entropy encoding mode with a compression rate greater than 1).
[0317] In one possible manner, the data processing module can select an optimal weight mode from a plurality of weight modes, and encode the encoding data of the weights corresponding to the plurality of sub-blocks to obtain a weight code stream. The data processing module can determine the code rate of the weight code stream obtained by encoding the encoding data of the weights corresponding to the plurality of sub-blocks based on the plurality of weight modes, and determine the weight mode corresponding to the minimum code rate as the optimal weight mode.
[0318] In one possible manner, the data processing module can fixedly select one weight mode to encode the encoding data of the weights corresponding to the plurality of sub-blocks to obtain a weight code stream. For example, the data processing module can fixedly use weight mode 3 to encode the encoding data of the weights corresponding to the plurality of sub-blocks to obtain a weight code stream.
[0319] In one possible implementation, the data processing module can transform encode the encoding data of the end points corresponding to each sub-block to obtain an end point code stream corresponding to each sub-block, and can include the following steps. The data processing module can separate the end points of all sub-blocks into two parts according to two categories, and construct two sub-graphs. Then, the data processing module can transform encode each sub-graph. Specifically, the data processing module can extract the RGBX data of each end point from each sub-block code stream of the entire texture code stream. If the transparent component A of all sub-blocks does not exist or is a fixed value (for ASTC, if the original image input has no transparent component A, the transparent component A is 255, indicating complete opacity), only the end points of all sub-blocks are processed, otherwise, the transparent component A is entropy encoded and compressed as part of the super-compressed texture code stream.
[0320] In a possible implementation, the data processing module can perform entropy coding on the encoded data of the partition information extracted by the syntax to obtain the partition information code stream corresponding to each sub-block, which can include: the data processing module can read the 2-bit partition information of each sub-block, and mark the number of the current partition with 1 bit (0: 1 partition; 1: 2 partitions). Then, the data processing module can simplify the partition information of each sub-block to 1 bit. The data processing module can write all the partition information into the partition information stream, and if the obtained partition information stream is less than one byte, 0 can be filled in. Finally, the data processing module can perform entropy coding on the partition information stream to generate the partition information code stream.
[0321] If the sub-block is 2-partition, the current 2-partition index needs to be recorded, the partition index value is recorded, the set of 2-partition index values of all sub-blocks is entropy coded to generate 2-partition index information.
[0322] Finally, the data processing module can encapsulate the obtained weight code stream, endpoint code stream and partition information code stream. For example, the data processing module can directly perform entropy coding on the weight code stream, endpoint code stream and partition information code stream, finally encapsulate the code words generated by the three syntax elements according to certain rules, and form the super-compressed texture code stream by adding the overall information description of the code stream.
[0323] For example, the code stream structure of the super-compressed texture code stream finally obtained by the data processing module can refer to Table 1. Table 1 is an example of the code stream structure of the super-compressed texture code stream:
[0324] Table 1: Code stream structure of super-compressed texture code stream
[0325] PicInfo SutInfo PartitionInfo EpStream WeightStream Figure 17
[0326] It should be understood that Table 1 is only an example of the code stream structure of the super-compressed texture code stream of the present application, and the present application does not limit the arrangement position of each syntax in Table 1.
[0327] For example, the description information of each syntax in Table 1 can refer to Table 2 as follows:
[0328] Table 2: Syntax table of super-compressed texture code stream
[0329]
[0330]
[0331] In Table 2, M (Mandatory): mandatory (mandatory), (O) Optional: optional, v represents indefinite length.
[0332] That is, the super-compressed texture code stream must include: PicInfo, SutIno, EpStream and WeightStream; Magic and PartitionInfo are optional.
[0333] Exemplarily, Magic, PicInfo and SutIno can constitute a code stream header.
[0334] Exemplarily, Magic can be used to indicate whether the code stream is a super-compressed texture code stream. In Table 2, Magic is fixed to a fixed value of 32 bits. Alternatively, Magic can be set to a hexadecimal number, for example, 0x5CA1AB14.
[0335] Exemplarily, the syntax contained in PicInfo and the corresponding description can refer to the description in Table 3 as follows:
[0336] Table 3 Syntax table of PicInfo
[0337]
[0338] Exemplarily, the syntax contained in SutInfo and the corresponding description can refer to the description in Table 4 as follows:
[0339] Table 4 Syntax table of SutInfo
[0340]
[0341]
[0342] That is, the super-compressed data of the image size, block information, coding mode identifier and the like in the above other information can be written into the code stream header of the super-compressed texture code stream.
[0343] Exemplarily, the syntax contained in PartitionInfo and the corresponding description can refer to the description in Table 5 as follows:
[0344] Table 5 Syntax table of PartitionInfo
[0345]
[0346] That is, the super-compressed data of the partition information in the above other information can be written into PartitionInfo, and PartitionInfo can also be referred to as a partition information code stream.
[0347] Exemplarily, the syntax contained in EpStream and the corresponding description can refer to the description in Table 6 as follows:
[0348] Table 6 Syntax Table of EpStream
[0349]
[0350] S1104. Electronic device 100 stores ultra-compressed texture data.
[0351] The electronic device 100 can store the ultra-compressed texture bitstream processed by the data processing module; this ultra-compressed texture bitstream can also be referred to as ultra-compressed texture data. The electronic device 100 can save this ultra-compressed texture data to the file system module via a media library.
[0352] S1105. The file system module sequentially inserts ultra-compressed texture data into the thumbnail database.
[0353] Electronic device 100 can store ultra-compressed texture data in an orderly manner in the KVDB of the file system module through the file system module.
[0354] In one possible implementation, the electronic device 100 determines the display order of the thumbnails based on the date and time sequence of the thumbnails and the order of their corresponding primary key IDs. When the electronic device 100 determines the thumbnail display order based on date and time information and primary key IDs, the media library can instruct the file system module to store the ultra-compressed texture data corresponding to the thumbnails in reverse chronological order of date and time and primary key IDs.
[0355] In one possible implementation, the ultra-compressed texture data can be stored as a heap (data structure heap) large object file. For example... Figure 1 As shown, in KVDB, the storage unit for large heap object files is a page. Each page stores multiple thumbnails of super-compressed texture data in an ordered manner. For example, thumbnails... Figure 1 This includes ultra-compressed textures, ultra-compressed texture data with abbreviation 6, and so on. Taking a unit size of 32KB as an example, before ultra-compression, the size of an image in a single year view scene is 4.015KB, and the size of an image in a single month view scene is 16.015KB. A 32KB page can only store one month view or seven year views, wasting ROM space of 15.985KB and 3.895KB respectively. When the file system module saves images, it saves them into the page; when reading images, it reads the page directly, and the page size is larger than the ROM space occupied by the image itself, leading to a decrease in IO performance. After ultra-compression, it can basically guarantee that two month view thumbnails and 8-10 year view thumbnails can be stored in one page. This not only saves local ROM but also improves IO performance when reading data.
[0356] Steps S1106-S1112: Electronic device 100 displays thumbnails.
[0357] S1106. The gallery initiates a thumbnail loading request.
[0358] The electronic device 100 can receive a user operation on the gallery, for example, the user switches to a view scene switching operation in the gallery application, which can include any one of the operations of switching from a day view scene to a month view scene or to a year view scene, switching from a month view scene to a day view scene or a year view scene, switching from a year view scene to a day view scene or a month view scene, etc. For example, the user can click the month view control 103b or the year view control 103c in the thumbnail display interface 101 shown. Figure 2 For another example, the user can click the day view control 103a or the year view control 103c in the thumbnail display interface 200 shown. Figure 3 For another example, the user can click the day view control 103a or the year view control 103c in the thumbnail display interface 300 shown. Figure 18A For another example, the user can click the day view control 103a or the month view control 103b in the thumbnail display interface 300 shown.
[0359] It can be understood that the application does not specifically limit the user operation on the gallery application.
[0360] In response to the operation, the gallery can initiate a thumbnail loading request. Before the gallery initiates the thumbnail loading request, the gallery can also query the metadata corresponding to the thumbnails to obtain the date and time and the primary key ID corresponding to each thumbnail. The thumbnail loading request initiated by the gallery can carry the date and time and the primary key ID corresponding to the thumbnails.
[0361] In one possible implementation, the electronic device 100 can determine the number of view controls required in the thumbnail display interface of the gallery based on the number of thumbnails stored in the electronic device 100, and assign each view control to display specific thumbnails. Then, based on the user operation, the gallery determines which view controls need to be displayed in the current display area of the thumbnail display interface, and which thumbnails are currently displayed in the view control. In this way, the thumbnail loading request initiated by the gallery can carry the date and time and the primary key ID of the specific thumbnails that need to be displayed.
[0362] S1107. The reading module sends a thumbnail query request to the media library.
[0363] The reading module of the electronic device 100 can assemble the date and time and the primary key ID corresponding to each of the plurality of thumbnails carried in the thumbnail loading request into a datetime_id string in the received gallery-initiated thumbnail loading request. In this way, the reading module can obtain a plurality of datetime_id strings and determine the largest datetime_id string and the smallest datetime_id string in the plurality of datetime_id strings. The largest datetime_id string represents the datetime_id string corresponding to the thumbnail with the latest date and time and the largest primary key ID value in the plurality of thumbnails. The smallest datetime_id string represents the datetime_id string corresponding to the thumbnail with the earliest date and time and the smallest primary key ID value in the plurality of thumbnails.
[0364] For ease of description, the largest datetime_id string can be recorded as datetime_id(max), and the smallest datetime_id string can be recorded as datetime_id(min).
[0365] Then, the reading module can set the query range as datetime_id(min)—datetime_id(max). The reading module can obtain the super-compressed texture data corresponding to the thumbnails with the key information in the query range in the thumbnail database based on the query range.
[0366] For example, if the largest datetime_id string in the assembly information corresponding to the plurality of thumbnails is "20240220100000_208" and the smallest datetime_id string is "20230220100000_000", the reading module sets the query range as "20230220100000_000"—"20240220100000_208". The reading module can obtain the super-compressed texture data corresponding to all the thumbnails with the key information in the query range according to the query range.
[0367] Specifically, the reading module can set a query command of the KVDB, which can carry datetime_id(min) and datetime_id(max). After the KVDB receives the query command, it only needs to query twice, once for the location of datetime_id(max), and then again for the location of datetime_id(min). Finally, the KVDB can return the whole block of storage buffer data in the query range to the data processing module. The whole block of storage buffer data contains the hyper-compressed texture data corresponding to all the thumbnails in the query range.
[0368] S1108. The data processing module decodes the hyper-compressed texture data into texture data and sends the texture data to the reading module.
[0369] The data processing module can decode the obtained hyper-compressed texture data into texture data. Specifically, the data processing module can perform entropy decoding on the hyper-compressed texture data to obtain reconstructed data of table data, reconstructed data of transform data, and reconstructed data of encoding data of other information. Then, the data processing module can determine, according to the reconstructed data of the table data, reconstructed data of encoding data of weights corresponding to a plurality of blocks; the data processing module can perform inverse transform on the reconstructed data of the transform data to obtain reconstructed data of encoding data of endpoints corresponding to the plurality of blocks. Subsequently, the data processing module can encapsulate the reconstructed data of encoding data of weights corresponding to the plurality of blocks, the reconstructed data of encoding data of endpoints corresponding to the plurality of blocks, and the reconstructed data of encoding data of other information to obtain a texture bitstream, that is, the texture data.
[0370] It should be noted that the hyper-compression encoding can be lossless encoding, in which case the reconstructed data of encoding data of weights is the same as the encoding data of weights, the reconstructed data of encoding data of endpoints is the same as the encoding data of endpoints, and the reconstructed data of encoding data of other information is the same as the encoding data of other information.
[0371] Then, the data processing module can send the texture data to the reading module. How the data processing module obtains the hyper-compressed texture data and how the data processing module sends the texture data to the reading module can be referred to the descriptions in steps S1006 and S1007 above, which will not be repeated here.
[0372] S1109. The reading module obtains the texture data and sends the texture data to the stitching module.
[0373] The reading module can send the obtained texture data to the stitching module.
[0374] Step S1109 can be referred to the description in step S1007, which will not be repeated here.
[0375] S1110. The stitching module stitches the texture data into a texture big picture and sends the texture big picture to the graphics subsystem.
[0376] The stitching module can stitch the texture data of multiple thumbnails into one texture big picture. For example, as shown in (a) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1701-1702 (40 thumbnails in total) into a stitched texture big picture ① according to the display order of the thumbnails. As shown in (b) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1703-1704 (40 thumbnails in total) into a stitched texture big picture ② according to the display order of the thumbnails. As shown in (c) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1705-1706 (40 thumbnails in total) into a stitched texture big picture ③ according to the display order of the thumbnails. Figure 18B As shown in (a) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1701-1702 (40 thumbnails in total) into a stitched texture big picture ① according to the display order of the thumbnails. As shown in (b) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1703-1704 (40 thumbnails in total) into a stitched texture big picture ② according to the display order of the thumbnails. As shown in (c) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1705-1706 (40 thumbnails in total) into a stitched texture big picture ③ according to the display order of the thumbnails.
[0377] Figure 18B As shown in (a) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1701-1702 (40 thumbnails in total) into a stitched texture big picture ① according to the display order of the thumbnails. As shown in (b) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1703-1704 (40 thumbnails in total) into a stitched texture big picture ② according to the display order of the thumbnails. As shown in (c) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1705-1706 (40 thumbnails in total) into a stitched texture big picture ③ according to the display order of the thumbnails. Figure 18B Figure 18A As shown in (a) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1701-1702 (40 thumbnails in total) into a stitched texture big picture ① according to the display order of the thumbnails. As shown in (b) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1703-1704 (40 thumbnails in total) into a stitched texture big picture ② according to the display order of the thumbnails. As shown in (c) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1705-1706 (40 thumbnails in total) into a stitched texture big picture ③ according to the display order of the thumbnails.
[0378] As shown in (a) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1701-1702 (40 thumbnails in total) into a stitched texture big picture ① according to the display order of the thumbnails. As shown in (b) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1703-1704 (40 thumbnails in total) into a stitched texture big picture ② according to the display order of the thumbnails. As shown in (c) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1705-1706 (40 thumbnails in total) into a stitched texture big picture ③ according to the display order of the thumbnails. Figure 18A As shown in (a) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1701-1702 (40 thumbnails in total) into a stitched texture big picture ① according to the display order of the thumbnails. As shown in (b) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1703-1704 (40 thumbnails in total) into a stitched texture big picture ② according to the display order of the thumbnails. As shown in (c) of FIG. 17, the stitching module can stitch the texture data of thumbnails 1705-1706 (40 thumbnails in total) into a stitched texture big picture ③ according to the display order of the thumbnails.
[0379] Figure 18A The thumbnail display interface 200 in the current display region shows that the mosaic texture large image ④ in the view control 4 is only partially displayed. When the user slides up, the mosaic texture large image ④ in the view control 4 can be fully displayed in the current display region of the thumbnail display interface 200 in response to the user operation.
[0380] S1111. The graphics subsystem renders the texture large image.
[0381] The texture large image obtained by the mosaic module can be sent to the graphics subsystem, and the graphics subsystem can render the texture large image.
[0382] S1112. The display module displays the rendered texture large image.
[0383] The display module can display the rendered texture large image. For example, as shown in FIG. 11C, the display module can display the rendered texture large image in the thumbnail display interface. Figure 2
[0384] It can be understood that in the embodiments of the present application, the electronic device 100 can determine which view controls are displayed in the current display region of the thumbnail display interface based on the first operation. For example, the electronic device 100 can display the view control 1 in the current display region of the thumbnail display interface based on the first operation. Then, the view control 1 can determine the query range according to the k sets of assembly information corresponding to the k thumbnails allocated to the view control 1 by the electronic device 100, and obtain the thumbnails in the query range. That is, the view control 1 can obtain the thumbnails and display the assembled thumbnails according to the steps S1106-S1112.
[0385] In a possible implementation, the view control 1 of the electronic device 100 can instruct the graphics subsystem to render the assembled texture image. After the graphics subsystem completes the rendering, the view control 1 can display the rendered texture large image.
[0386] In the picture display method provided in the embodiments of the present application, the electronic device 100 saves the texture data to the local device after super-compression. In this way, the space occupied by the saved thumbnails can be reduced in the process of generating and browsing the thumbnails on the actual single device, and the consumption of the internal memory of the whole machine by the application can be reduced. Meanwhile, in the process of loading the thumbnails by the electronic device 100, the IO overhead in batch reading of data can be reduced by reading the super-compressed data. For the scene of frequent calling of IO (for example, the year-month view), the IO performance can be improved, so that the probability of white blocks in the process of browsing the thumbnails can be reduced, and the experience in browsing can be optimized.
[0387] It can be understood that the picture display method provided in the embodiments of the present application is described by taking the display of the thumbnail in the gallery as an example. In the present application, the application capable of displaying the thumbnail is not limited, for example, the file management application can also display the thumbnail. The process of displaying the thumbnail by other applications capable of displaying the thumbnail can refer to the process of displaying the thumbnail by the gallery application, and the embodiments of the present application will not be described here.
[0388] In the embodiments of the present application, the first application can be an application capable of displaying the thumbnail, such as a gallery application or a file management application. The first group of thumbnails can be k thumbnails. The first thumbnail can be any one of the thumbnails shown in the above Figure 3 or Figure 11 , for example, the thumbnail 202.
[0389] Optionally, in the embodiments of the present application, the electronic device 100 can further include a distributed data management module. When the electronic device saves the thumbnail, for example, when the camera of the electronic device takes a photo, the data processing module in the media library generates the thumbnail based on the taken photo, performs texture compression on the thumbnail to obtain texture data, and then performs super compression on the texture data to obtain super compressed texture data. The media library issues a storage instruction to the distributed data management module, and the distributed data management module can store the super compressed texture data processed by the media library in order in the thumbnail database of the file system module. The thumbnail database can also be referred to as a thumbnail database file.
[0390] Optionally, in another possible implementation, the reading module can issue a thumbnail loading request to the distributed data management module, and the distributed data management module determines the time and date and the ID in a group of thumbnails required to be read by the reading module based on the thumbnail loading request. Then, the distributed data management module can set a query range based on the date and time and the ID of the group of thumbnails, and batch read the super compressed texture data corresponding to the group of thumbnails from the thumbnail data at one time. Then, the reading module can send the super compressed texture data corresponding to the group of thumbnails to the splicing module, and the splicing module decodes the super compressed texture data corresponding to the group of thumbnails into texture data. The splicing module can splice the decoded texture data into a texture large picture. That is, Figure 19 Step S1108 in the above can also be performed by the splicing module. The embodiments of the present application do not limit this.
[0391] Figure 19 An exemplary picture display method provided by the embodiments of the present application is shown. As shown in Figure 12A , the picture display method provided by the embodiments of the present application can include the following steps:
[0392] S1901. The electronic device 100 receives and responds to a first operation of a user on the gallery application, obtains super-compressed texture data of a first set of thumbnails, the first set of thumbnails including at least two thumbnails, the at least two thumbnails including a first thumbnail, the super-compressed texture data of the first thumbnail being obtained by the electronic device 100 encoding a texture of the first thumbnail to obtain texture data, and re-encoding the texture data.
[0393] The first operation can include any one of an operation of the user opening the gallery application, an operation of the user switching a view scene in a thumbnail display interface, and a sliding operation of the user in the thumbnail display interface.
[0394] In a possible implementation, before the electronic device 100 receives and responds to the first operation of the user on the gallery application, the method can further include: the electronic device 100 obtains a first thumbnail, and performs block processing on the first thumbnail to obtain a plurality of sub-blocks, the plurality of sub-blocks including a first sub-block and a second sub-block; the electronic device 100 determines a target encoding mode corresponding to the first sub-block from a plurality of preset encoding modes; wherein the electronic device 100 encodes the second sub-block based on the plurality of preset encoding modes, and the number of bits occupied by the encoding data of the weight corresponding to the second sub-block and the number of bits occupied by the encoding data of the endpoint of the plurality of second sub-blocks of the second sub-block are the same, and the relative positions of the encoding data of the weight corresponding to the second sub-block and the encoding data of the endpoint are fixed; the electronic device 100 encodes the first sub-block based on the target encoding mode corresponding to the first sub-block to obtain a texture code stream of the first sub-block; wherein the texture code stream of the first sub-block includes the encoding data of the weight corresponding to the first sub-block and the encoding data of the endpoint, and the texture code streams of the plurality of sub-blocks constitute the texture data of the first thumbnail; the electronic device 100 extracts the encoding data of the weight corresponding to the plurality of sub-blocks and the encoding data of the endpoint from the texture data of the first thumbnail; and the electronic device 100 encodes the encoding data of the weight corresponding to the plurality of sub-blocks and the encoding data of the endpoint corresponding to the plurality of sub-blocks to obtain the super-compressed texture data of the first thumbnail.
[0395] For how the electronic device 100 encodes the first thumbnail into the texture data, refer to the above step S1102 and the description of the above Figure 12B and Figure 13 - Figure 16 herein.
[0396] For how the electronic device 100 re-encodes the texture data into the super-compressed texture data, refer to the above step S1103 and the description of the above herein.
[0397] In a possible implementation, after the electronic device 100 obtains the super compressed texture data of the first thumbnail, the method can further include: storing, by the electronic device 100, the super compressed texture data of the first thumbnail into a database.
[0398] In a possible implementation, the metadata of the first set of thumbnails is stored in the database, and the metadata of the first set of thumbnails includes a date and time corresponding to each thumbnail in the first set of thumbnails and an identity ID, the date and time corresponding to the first thumbnail is a first date and time, the ID corresponding to the first thumbnail is a first ID, the first date and time is a date and time at which the electronic device saves the first thumbnail, and the first ID is a number generated by the electronic device to identify the first thumbnail when the first thumbnail is saved. In this way, the electronic device can distinguish different thumbnails through the date and time and the ID corresponding to the thumbnails.
[0399] In a possible implementation, the storage order of the first set of thumbnails in the thumbnail database is consistent with the display order of the first set of thumbnails.
[0400] In a possible implementation, the electronic device 100 stores the super compressed texture data of the first thumbnail into the database, and specifically can include: saving, by the electronic device 100, the super compressed texture data of the first thumbnail into the database in the order of the first date and time and the first ID, and the index information of the super compressed texture data in the database is the first date and time and the first ID.
[0401] For how the electronic device 100 stores the super compressed texture data of the first thumbnail, refer to the description in the above step S1105, which will not be repeated here.
[0402] S1902. The electronic device 100 decodes the super compressed texture data of the first set of thumbnails to obtain the texture data of the first set of thumbnails.
[0403] In a possible implementation, the super compressed texture data of the first set of thumbnails includes the super compressed texture data of the first thumbnail, the texture data of the first set of thumbnails includes the texture data of the first thumbnail, and the electronic device 100 decodes the super compressed texture data of the first set of thumbnails to obtain the texture data of the first set of thumbnails can include: decoding, by the electronic device 100, the super compressed texture data of the first thumbnail to obtain the reconstructed data of the encoded data of the plurality of sub-blocks corresponding weights and the reconstructed data of the encoded data of the endpoints; and packaging, by the electronic device 100, the reconstructed data of the encoded data of the plurality of sub-blocks corresponding weights and the reconstructed data of the encoded data of the endpoints to obtain the texture data of the first thumbnail. In this way, the electronic device 100 can decode the super compressed texture data into the texture data.
[0404] As to how the electronic device 100 decodes the super compressed texture data of the first set of thumbnails, refer to the description in step S1108 above, and details are not described herein again.
[0405] S1903. The electronic device 100 renders the texture data of the first set of thumbnails, and displays a thumbnail display interface of the gallery application, and the thumbnail display interface displays the first set of thumbnails.
[0406] In a possible implementation, the electronic device 100 renders the texture data of the first set of thumbnails, and displays a thumbnail display interface of the gallery application, including: the electronic device 100 splices the texture data of the first set of thumbnails into a large picture; and the electronic device 100 renders the large picture, and displays the thumbnail display interface, and the thumbnail display interface displays the large picture. As to how the electronic device 100 splices the texture data of the first set of thumbnails into a large picture, refer to the description in step S1110 above, and details are not described herein again.
[0407] According to the picture display method provided in the embodiments of the present application, the electronic device 100 stores super compressed texture data of thumbnails, and the super compressed texture data occupies less memory than the texture data. Therefore, the memory of the electronic device 100 can be saved. Then, the electronic device 100 can directly send the texture data obtained by decoding the super compressed texture data of the first set of thumbnails to the rendering without decoding the texture data into image data in RGBX format. Moreover, the compression rate of the super compressed texture data is lower than that of the binary data in JPEG format, and therefore, compared with decoding the binary data in JPEG format into thumbnails in RGBX format, the electronic device 100 spends less time in the decoding process. The electronic device 100 can display the first set of thumbnails in the thumbnail display interface more quickly, and therefore, the performance of the electronic device 100 in displaying a batch of thumbnails can be improved.
[0408] Moreover, only one view control is needed to carry a large picture, and in the prior art, k view controls are needed to carry the first set of thumbnails. The electronic device 100 splices the first set of thumbnails into a large picture before sending the large picture to be displayed, and therefore, the number of view controls can be reduced. Therefore, the performance of the electronic device 100 in displaying a batch of thumbnails can be improved, and the power consumption of the electronic device can be saved.
[0409] The embodiments of the present application further provide a computer readable storage medium, which stores computer program codes, and when the processor executes the computer program codes, the communication device executes the method in any of the preceding embodiments.
[0410] The embodiments of the present application further provide a computer program product, which, when running on a computer, causes the computer to execute the method in any of the preceding embodiments.
[0411] The above-described embodiments are merely intended to illustrate the technical solutions of the present application, but not to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0412] In the above-described embodiments, the term "when" can be interpreted as meaning "if" or "after" or "in response to determining" or "in response to detecting" according to the context. Similarly, the phrase "upon determining" or "if detecting (the stated condition or event)" can be interpreted as meaning "if determining" or "in response to determining" or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)" according to the context.
[0413] In the above-described embodiments, all or part of the processes can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the processes can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer instructions generate all or part of the processes described in the embodiments of the present application. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center through a wired (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available media can be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk), etc.
[0414] Those skilled in the art can understand that all or part of the processes in the above-described embodiments can be implemented by a computer program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-described embodiments. The aforementioned storage medium includes ROM or random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
Claims
1. A method for displaying an image, characterized in that, include: The electronic device receives and responds to a user's first operation on the gallery application, and obtains the super-compressed texture data of a first set of thumbnails. The first set of thumbnails includes at least two thumbnails, and the at least two thumbnails include a first thumbnail. The super-compressed texture data of the first thumbnail is obtained by the electronic device performing texture encoding on the first thumbnail and then encoding the texture data again. The electronic device decodes the supercompressed texture data of the first set of thumbnails to obtain the texture data of the first set of thumbnails. The electronic device renders the texture data of the first set of thumbnails and displays the thumbnail display interface of the gallery application, in which the first set of thumbnails is displayed.
2. The method according to claim 1, characterized in that, The electronic device renders the texture data of the first set of thumbnails and displays the thumbnail display interface of the gallery application, including: The electronic device stitches together the texture data of the first set of thumbnails into a large image; The electronic device renders the large image and displays the thumbnail display interface, in which the large image is displayed.
3. The method according to claim 2, characterized in that, Before the electronic device receives and responds to the user's first action on the gallery application, the method further includes: The electronic device acquires the first thumbnail and divides the first thumbnail into blocks to obtain multiple sub-blocks, the multiple sub-blocks including a first sub-block and a second sub-block; The electronic device determines the target encoding pattern corresponding to the first sub-block from multiple preset encoding patterns; wherein, in the multiple texture data of the second sub-block obtained by the electronic device based on the multiple preset encoding patterns, the encoded data of the weight corresponding to the second sub-block has the same percentage of characteristics, and the encoded data of the endpoint corresponding to the second sub-block has the same percentage of characteristics, and the relative position of the encoded data of the weight corresponding to the second sub-block and the encoded data of the endpoint is fixed. The electronic device encodes the first sub-block based on the target encoding mode corresponding to the first sub-block to obtain the texture bitstream of the first sub-block; wherein, the texture bitstream of the first sub-block includes the encoded data of the weight corresponding to the first sub-block and the encoded data of the endpoints, and the texture bitstreams of the multiple sub-blocks constitute the texture data of the first thumbnail. The electronic device extracts the encoded data of the weights and the encoded data of the endpoints corresponding to the multiple sub-blocks from the texture data of the first thumbnail; The electronic device encodes the weights corresponding to the plurality of sub-blocks and the endpoints corresponding to the plurality of sub-blocks to obtain the super-compressed texture data of the first thumbnail.
4. The method according to claim 3, characterized in that, After the electronic device obtains the super-compressed texture data of the first thumbnail, the method further includes: The electronic device stores the ultra-compressed texture data of the first thumbnail in a database.
5. The method according to claim 4, characterized in that, The database stores metadata of the first set of thumbnails. The metadata of the first set of thumbnails includes the date and time corresponding to the first set of thumbnails and the identity ID. The date and time corresponding to the first thumbnail is a first date and time, and the ID corresponding to the first thumbnail is a first ID. The first date and time is the date and time when the electronic device saves the first thumbnail, and the first ID is a number generated by the electronic device when saving the first thumbnail to identify the first thumbnail.
6. The method according to claim 5, characterized in that, The storage order of the first group of thumbnails in the thumbnail database is consistent with the display order of the first group of thumbnails.
7. The method according to claim 6, characterized in that, The electronic device stores the ultra-compressed texture data of the first thumbnail in a database, specifically including: The electronic device saves the super-compressed texture data of the first thumbnail to the database in the order of the first date and time and the first ID. The index information of the super-compressed texture data in the database is the first date and time and the first ID.
8. The method according to claim 1, characterized in that, The first set of thumbnails' supercompressed texture data includes the supercompressed texture data of the first thumbnails, and the first set of thumbnails' texture data includes the texture data of the first thumbnails. The electronic device decodes the first set of thumbnails' supercompressed texture data to obtain the texture data of the first set of thumbnails, including: The electronic device decodes the supercompressed texture data of the first thumbnail to obtain the reconstructed data of the encoded data of the weights of multiple sub-blocks in the first thumbnail and the reconstructed data of the encoded data of the endpoints. The electronic device encapsulates the reconstructed data of the encoded data corresponding to the weights of the plurality of sub-blocks and the reconstructed data of the encoded data of the endpoints to obtain the texture data of the first thumbnail.
9. The method according to any one of claims 1-8, characterized in that, The first operation includes any one of the following: the user opening the gallery application, the user switching view scenes in the thumbnail display interface, or the user swiping in the thumbnail display interface.
10. An electronic device, characterized in that, The electronic device includes a first application, a media library, a graphics subsystem, and a database, wherein... The database is used to: store ultra-compressed texture data of thumbnails; The first application is configured to: receive and respond to a first operation performed by a user on the first application, obtain super-compressed texture data of a first set of thumbnails from the database, the first set of thumbnails including at least two thumbnails, the at least two thumbnails including a first thumbnail, the super-compressed texture data of the first thumbnail being texture data obtained by the media library by texture encoding the first thumbnail, and then further encoding the texture data; The media library is used to: decode the ultra-compressed texture data of the first set of thumbnails to obtain the texture data of the first set of thumbnails; The graphics subsystem is used to: render the texture data of the first set of thumbnails; The first application is used to: display a thumbnail display interface, wherein the thumbnail display interface displays the first group of thumbnails.
11. The electronic device according to claim 10, characterized in that, The electronic device also includes a processing module. The processing module is used to: stitch together the texture data of the first group of thumbnails into a large image; The graphics subsystem is also used to: render the large image; The first application is also used to: display the thumbnail display interface, in which the large image is displayed.
12. The electronic device according to claim 11, characterized in that, The media library is also used for: The first thumbnail is obtained and divided into blocks to obtain multiple sub-blocks, including a first sub-block and a second sub-block. From multiple preset encoding modes, the target encoding mode corresponding to the first sub-block is determined; wherein, in the multiple texture data of the second sub-block obtained by the media library based on the multiple preset encoding modes, the proportion of the encoded data of the weight corresponding to the second sub-block is the same, and the proportion of the encoded data of the endpoint corresponding to the second sub-block is the same, and the relative position of the encoded data of the weight corresponding to the second sub-block and the encoded data of the endpoint is fixed. The first sub-block is encoded based on the target encoding mode corresponding to the first sub-block to obtain the texture bitstream of the first sub-block; wherein, the texture bitstream of the first sub-block includes the encoded data of the weight corresponding to the first sub-block and the encoded data of the endpoints, and the texture bitstreams of the multiple sub-blocks constitute the texture data of the first thumbnail. From the texture data of the first thumbnail, extract the encoded data of the weights and the encoded data of the endpoints corresponding to the multiple sub-blocks; Encode the weights corresponding to the multiple sub-blocks and encode the endpoints corresponding to the multiple sub-blocks to obtain the super-compressed texture data of the first thumbnail.
13. The electronic device according to claim 12, characterized in that, The media library is also used for: Store the super-compressed texture data of the first thumbnail in the database.
14. The electronic device according to claim 13, characterized in that, The database stores metadata of the first group of thumbnails. The metadata of the first group of thumbnails includes the date and time and identity ID corresponding to each thumbnail in the first group of thumbnails. The date and time corresponding to the first thumbnail is a first date and time, and the ID corresponding to the first thumbnail is a first ID. The first date and time is the date and time when the electronic device saves the first thumbnail, and the first ID is a number generated by the electronic device when saving the first thumbnail to identify the first thumbnail.
15. The electronic device according to claim 14, characterized in that, The storage order of the first group of thumbnails in the thumbnail database is consistent with the display order of the first group of thumbnails.
16. The electronic device according to claim 15, characterized in that, The media library is also used for: The super-compressed texture data of the first thumbnail is saved to the database in the order of the first date and time and the first ID. The index information of the super-compressed texture data in the database is the first date and time and the first ID.
17. The electronic device according to claim 10, characterized in that, The media library is also used for: Decode the supercompressed texture data of the first thumbnail to obtain the reconstructed data of the encoded data of the weights of multiple sub-blocks in the first thumbnail and the reconstructed data of the encoded data of the endpoints. The reconstructed data of the encoded data of the weights corresponding to the multiple sub-blocks and the reconstructed data of the encoded data of the endpoints are encapsulated to obtain the texture data of the first thumbnail.
18. The electronic device according to any one of claims 10-17, characterized in that, The first operation includes any one of the following: the user opening the gallery application, the user switching view scenes in the thumbnail display interface, or the user swiping in the thumbnail display interface.
19. An electronic device, characterized in that, The electronic device includes: one or more processors, one or more displays, and a memory, wherein the one or more displays and the memory are coupled to the one or more processors, and the memory stores code; when the code is executed by the processor, the electronic device performs the method as described in claims 1-9.
20. A computer-readable storage medium, characterized in that, Includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in claims 1-9.
21. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-9.