Picture loading method and device, computer equipment, storage medium and program product

By decapsulating HEIF images and converting them into YUV and RGBA formats using the libyuv library, the time-consuming HEIF image decoding problem is solved, achieving faster image loading speed and better user experience.

CN120832196APending Publication Date: 2025-10-24SWEET POTATO TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511051787.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-29
Publication Date
2025-10-24

AI Technical Summary

Technical Problem

The existing H.265 decoding algorithm takes a long time to decode HEIF images and has low decoding efficiency, resulting in slow image loading speed.

Method used

A new image decoding algorithm is used to decode HEIF images. The image parameters are obtained by decapsulation, and the libyuv library is used to convert the HEIF image into a first image in YUV format, and then into a second image in RGBA format, reducing decoding time and improving decoding efficiency.

Benefits of technology

The decoding and loading speeds of HEIF images have been improved, ensuring smooth image loading and enhancing the user's image consumption experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120832196A_ABST
    Figure CN120832196A_ABST
Patent Text Reader

Abstract

The invention relates to a picture loading method and device, computer equipment, a storage medium and a program product. The method comprises the following steps: decapsulating a to-be-loaded target picture to obtain a picture format of the target picture and picture parameters of the picture; if the picture format of the target picture is an HEIF picture format based on HEVC, decoding the target picture based on the picture parameters to obtain a first picture in a YUV format; based on the picture parameters, calling a code library to convert the first picture into a second picture in an RGBA format; and loading and displaying the second picture. For the HEIF picture coded by HEVC, when the HEIF picture is decoded, on one hand, the picture parameters of the HEIF picture are analyzed for subsequent accurate decoding, and on the other hand, rapid format conversion can be realized through the code library, so that the decoding quality of the HEIF picture is ensured, the decoding speed of the HEIF picture can be improved, the decoding time consumption can be reduced, and the decoding efficiency can be improved. Therefore, the loading speed of the HEIF picture can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, and in particular to a picture loading method and device, a computer device, a storage medium, and a program product. BACKGROUND

[0002] Social software is a platform for connecting users for information exchange and social interaction. In the social software, users can share content in the form of text, video, and the like. In the picture consumption scenario, the speed of picture loading directly determines the picture consumption experience of users in the social software. Therefore, how to improve the loading fluency of pictures is a very important link in the picture consumption chain.

[0003] Traditionally, for pictures in a high efficiency image file format (HEIF), an H.265 decoding algorithm is usually used for decoding when decoding the pictures.

[0004] However, the existing H.265 decoding algorithm has faced the problems of long decoding time consumption and low decoding efficiency when decoding HEIF pictures, thereby causing slow picture loading speed. SUMMARY

[0005] Therefore, it is necessary to provide a picture loading method, device, computer device, computer readable storage medium, and computer program product capable of shortening picture decoding time consumption, improving picture decoding efficiency, and thereby improving picture loading speed, in view of the above technical problems.

[0006] In a first aspect, the present application provides a picture loading method, comprising:

[0007] performing unpacking processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture;

[0008] if the picture format of the target picture is a HEIF picture format based on HEVC coding, then based on the picture parameters, decoding the target picture to obtain a first picture in YUV format;

[0009] based on the picture parameters, calling a code library to convert the first picture into a second picture in RGBA format;

[0010] loading and displaying the second picture.

[0011] In one embodiment, based on the picture parameters, decoding the target picture to obtain a first picture in YUV format, comprises:

[0012] based on the rotation parameters and / or the clipping parameters, decoding the target picture to obtain a first picture in YUV format.

[0013] Based on the picture parameter, the code library is called to convert the first picture into a second picture in RGBA format, including:

[0014] Based on the transparent channel parameter, the code library is called to convert the first picture into a second picture in RGBA format.

[0015] In one embodiment, based on the transparent channel parameter, the code library is called to convert the first picture into a second picture in RGBA format, including:

[0016] The code library is called to convert the first picture into a first candidate picture in RGB format.

[0017] The transparent channel parameter is copied to the transparent channel of the first candidate picture to obtain the second picture.

[0018] In one embodiment, the method further includes:

[0019] A preset memory is created, and the line spacing of the preset memory is a preset multiple of the width of the second picture.

[0020] The second picture is stored in the preset memory.

[0021] In one embodiment, the second picture is loaded and displayed, including:

[0022] Based on the color space parameter, the second picture is rendered, and the rendered second picture is displayed.

[0023] In a second aspect, the present application further provides a picture loading device, including:

[0024] An unpackaging module is configured to perform unpackaging processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture.

[0025] A first decoding conversion module is configured to, if the picture format of the target picture is an HEIF picture format based on HEVC coding, perform decoding on the target picture based on the picture parameters to obtain a first picture in YUV format.

[0026] A second decoding conversion module is configured to call a code library to convert the first picture into a second picture in RGBA format based on the picture parameters.

[0027] A loading and displaying module is configured to load and display the second picture.

[0028] In a third aspect, the present application further provides a computer device including a memory and a processor, the memory stores a computer program, and the processor implements the steps of the picture loading method in the first aspect when executing the computer program.

[0029] In a fourth aspect, the present application also provides a computer readable storage medium, having stored thereon a computer program, which, when executed by a processor, implements the steps of the picture loading method in the first aspect.

[0030] In a fifth aspect, the present application also provides a computer program product, comprising a computer program which, when executed by a processor, implements the steps of the picture loading method in the first aspect.

[0031] The picture loading method, device, computer device, storage medium and computer program product, first perform unpacking processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture; if the picture format of the target picture is an HEIF picture format based on HEVC coding, then based on the picture parameters, the target picture is decoded to obtain a first picture in YUV format, and then based on the picture parameters, a code library is called to convert the first picture into a second picture in RGBA format, and then the second picture is loaded and displayed. That is, for the target picture in the HEIF picture format based on HEVC coding, when decoding, not only the picture parameters of the target picture are parsed, but also based on the picture parameters and the code library, the target picture is decoded into the first picture in YUV format, and then based on the picture parameters, the code library is called to convert the first picture into the second picture in RGBA format. On the one hand, by parsing the picture parameters of the HEIF picture, the picture parameters are used for subsequent accurate decoding, and on the other hand, by the code library, fast format conversion can be realized, which not only ensures the decoding quality of the HEIF picture, but also improves the decoding speed of the HEIF picture, reduces the decoding time consumption, and improves the decoding efficiency, so as to improve the loading speed of the HEIF picture. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the embodiment or related art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.

[0033] Figure 1 An application environment diagram of the picture loading method in an embodiment;

[0034] Figure 2 A flowchart of the picture loading method in an embodiment;

[0035] Figure 3 A flowchart of the picture loading method in another embodiment;

[0036] Figure 4Figure 2 is a flowchart illustrating a method for loading pictures according to another embodiment;

[0037] Figure 5 Figure 3 is a flowchart illustrating a method for loading pictures according to an embodiment;

[0038] Figure 6 Figure 4 is a flowchart illustrating a method for decoding pictures according to an embodiment;

[0039] Figure 7 Figure 5 is a block diagram illustrating a structure of a picture loading apparatus according to an embodiment;

[0040] Figure 8 Figure 6 is a block diagram illustrating an internal structure of a computer device according to an embodiment. DETAILED DESCRIPTION

[0041] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0042] High Efficiency Image File Format (HEIF) is a modern file format for storing pictures and picture sequences (such as dynamic photos or burst shots), which was published by MPEG (Moving Picture Experts Group) under the International Organization for Standardization (ISO / IEC) in 2015 (standard number: ISO / IEC 23008-12). The HEIF file format is usually based on the HEVC (High Efficiency Video Coding, H.265 for short) compression algorithm to compress pictures and can support efficient coding of static pictures and picture sequences.

[0043] Traditionally, for pictures in the HEIF file format, when decoding pictures, the H.265 decoding algorithm is usually used for decoding, i.e., the H.265 decoding algorithm provided by the open source libHEIF library is used for decoding. There is nothing wrong with using the H.265 decoding algorithm itself, but as the requirements for picture loading speed of social software are getting higher and higher, if the H.265 decoding algorithm provided by the open source library is still used for decoding, the decoding time will be very long, resulting in low decoding efficiency and slow picture loading speed.

[0044] Based on this, the embodiment of the present application proposes a new picture decoding algorithm, which is used to replace the decoding algorithm of HEIF pictures in social software, that is, the new picture decoding algorithm is used on the HEIF picture decoder, so as to shorten the picture decoding time, improve the decoding efficiency, and further improve the picture loading rate, which can ensure that the user can load the picture faster and more smoothly when consuming picture content in social software, and finally bring better picture consumption experience to the user.

[0045] The picture loading method provided by the embodiment of the present application can be applied to an application environment as shown in Figure 1 . Among them, at least one social software can be installed in the terminal 102, and the user can share content in the form of pictures, texts and videos by using the social software. When the user browses the picture / text content shared on the social software platform, the pictures in the content need to be loaded. The terminal 102 can download the pictures from the server 104 corresponding to the social software when loading the pictures, and decode and render the downloaded pictures to load and display the pictures, so as to meet the user's browsing demand for pictures.

[0046] The terminal 102 can communicate with the server 104 corresponding to the social software through the network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be realized by an independent server or a server cluster composed of multiple servers.

[0047] In an exemplary embodiment, as shown in Figure 2 , a picture loading method is provided, and the method is applied to the terminal in Figure 1 for example, which includes the following steps 202 to 206. Among them:

[0048] Step 202, performing unpacking processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture.

[0049] Exemplarily, when a user browses pictures / graphic content through a social software in a terminal, the user can load and display a target picture in the content. For example, when the social software detects the user's loading operation on the target picture, it can generate a picture loading request based on the identifier of the target picture, wherein the picture loading request can carry the identifier of the target picture, and the identifier of the target picture can include but is not limited to the uniform resource locator (URL) address of the target picture; then, the social software can send the picture loading request to the corresponding resource server. After receiving the picture loading request, the resource server can extract the URL address of the target picture from the picture loading request and obtain the target picture according to the URL address. The resource server sends the target picture to the social software so that the social software can download the target picture from the resource server; it should be noted that the downloaded target picture is usually an encoded and compressed picture. When the social software loads and displays the target picture, it needs to first decode the target picture, and then render and display the decoded picture.

[0050] Exemplarily, when the social software in the terminal decodes the target image to be loaded, it can call the image decoder to decode the target image, wherein the image decoder can be the image decoder in the social software or the image decoder in the terminal. If it is the image decoder of the terminal, the image decoder can support the image decoding tasks of different social software.

[0051] Exemplarily, when decoding the target image, the target image can be first decapsulated to obtain the image format and image parameters of the target image, wherein the image format of the target image is used for subsequent decoding using a decoding algorithm of the corresponding format, and the image format may include HEIF format, JPG format, JPEG format, etc.; the image parameters of the target image may include relevant parameters needed in the image decoding process, including but not limited to at least one of transparent channel parameters, rotation parameters, cropping parameters, and color space parameters.

[0052] Exemplarily, if the target image has a transparent channel, the transparent channel parameters of the target image are decoded to obtain transparent channel data; for example, the transparent channel can be decoded by calling the decode_image_planar function of the libheif library to obtain the transparent channel data.

[0053] Exemplarily, if the target picture exists rotation information and / or clipping information, a rotation parameter and / or a clipping parameter of the target picture are decoded to obtain the rotation information and / or the clipping information; for example, the rotation information and / or the clipping information can be obtained by parsing an irot / clap box and performing one pixel-level processing.

[0054] Exemplarily, if the target picture exists multiple color spaces, each color space parameter of the target picture is decoded to obtain each color space data; wherein, the HEIF picture not only supports an sRGB color space, but also can support other common color spaces, for example, a Display P3, an HDR and the like, for the HEIF picture, when performing unpacking, each color space information needs to be parsed to obtain each color space data.

[0055] In step 204, if the picture format of the target picture is a HEIF picture format based on HEVC coding, the target picture is decoded based on the picture parameter to obtain a first picture in a YUV format.

[0056] Exemplarily, the HEIF picture format can support encapsulation of an H.265 coding stream, and can also support JPEG, JPEG2000, AVC (Advanced Video Coding, also referred to as H.264), AV1, VVC (also referred to as H.266) and the like, therefore, the size of the HEIF decoding library is usually large; as an optional implementation manner, only HEVC coded HEIF picture format can be decoded, that is, a new picture decoding algorithm proposed in the present application is used to quickly decode the target picture in the HEVC coded HEIF picture format; exemplarily, for the HEIF decoding library, other coding formats except H.265 in the HEIF decoding source code can be cropped to reduce the size of the HEIF decoding library.

[0057] Exemplarily, when the new picture decoding algorithm proposed in the embodiment of the present application is used to decode and process a target picture in HEIF picture format based on HEVC coding, the target picture can be converted into a first picture in YUV format based on the picture parameter and by calling a code library. The code library can be libyuv library, which is an open source C / C++ library mainly used for processing and converting YUV image data to realize color space conversion. Libyuv can provide conversion functions between multiple image formats (i.e. color spaces), including YUV, RGB, ARGB, I420, NV12 and the like, and provide image scaling, rotation, cropping and the like, which are suitable for various image processing requirements. Libyuv optimizes the image conversion algorithm using single instruction multiple data (SIMD) instruction set, which can significantly improve the image conversion speed.

[0058] When the libyuv library is used, for Android system development, the libyuv library can be integrated into the application software through JNI (Java Native Interface). The source code of the libyuv library needs to be downloaded, compiled into a so library file, and the library is referenced in the Android project. When the picture format conversion is performed through the libyuv library, the functions in the libyuv library can be directly called for image processing by including the header file (such as libyuv.h) of libyuv.

[0059] Exemplarily, the code library includes a conversion algorithm capable of directly converting the target picture into the first picture in YUV format.

[0060] Exemplarily, if the picture format of the target picture is not HEIF picture format based on HEVC coding, a decoding algorithm corresponding to the picture format of the target picture can be used to decode and process the target picture. For example, in the case where the picture format of the target picture is JPEG picture format, a JPEG decoding algorithm can be used to decode and process the target picture. The JPEG decoding algorithm can be a conventional decoding algorithm disclosed in related technologies.

[0061] In step 206, the first picture is converted into a second picture in RGBA format based on the picture parameter and by calling the code library.

[0062] Exemplarily, the code library includes a conversion algorithm capable of directly converting the first picture into the second picture in RGBA format. The second picture in RGBA format can be decoded binary data.

[0063] In step 208, the second picture is loaded and displayed.

[0064] Exemplarily, the second picture in the RGBA format can be binary data after decoding. When the second picture is loaded and displayed, the binary data of the second picture can be converted into Bitmap bitmap data, and then the screen is rendered and displayed based on the Bitmap bitmap data to obtain the second picture after loading and displaying.

[0065] Exemplarily, for the target picture in the HEIF picture format, when the target picture includes multiple color space parameters, each color space data can be obtained by unpacking the target picture. On this basis, when the screen rendering is performed, the second picture can be rendered based on the color space data, and the second picture after rendering is displayed, so that the second picture after loading and displaying can present the display effect of each color space, that is, the display effect of the original target picture is restored.

[0066] The above picture loading method first performs unpacking processing on the target picture to be loaded to obtain the picture format of the target picture and the picture parameters of the target picture. If the picture format of the target picture is the HEIF picture format based on HEVC coding, the target picture is decoded based on the picture parameters to obtain a first picture in the YUV format, and then the first picture is converted into a second picture in the RGBA format based on the picture parameters and the code library. That is, for the target picture in the HEIF picture format based on HEVC coding, when decoding is performed, not only the picture parameters of the target picture are parsed, but also the target picture is decoded into a first picture in the YUV format based on the picture parameters and the code library, and then the first picture is converted into a second picture in the RGBA format based on the picture parameters and the code library. On the one hand, by parsing the picture parameters of the HEIF picture, the picture parameters are used for subsequent accurate decoding. On the other hand, by using the code library, fast format conversion can be realized, the decoding quality of the HEIF picture is ensured, the decoding speed of the HEIF picture is improved, the decoding time is reduced, and the decoding efficiency is improved, so that the loading speed of the HEIF picture can be improved.

[0067] In an exemplary embodiment, for the HEVC coded HEIF picture, an optional implementation for decoding and format conversion is provided, as shown in Figure 3 The steps 204 of "decoding the target picture based on the picture parameters to obtain a first picture in the YUV format" and the step 206 of "converting the first picture into a second picture in the RGBA format based on the picture parameters and the code library" can include steps 302 to 304. Wherein:

[0068] Step 302: decoding the target picture based on the rotation parameters and / or the clipping parameters to obtain a first picture in the YUV format.

[0069] Exemplarily, in a case where the target picture comprises the rotation parameter and / or the clipping parameter, the rotation parameter and / or the clipping parameter of the target picture can be obtained through the unpacking, and on this basis, the target picture can be decoded based on the rotation parameter and / or the clipping parameter of the target picture to obtain the first picture in YUV format during the decoding and format conversion processing. The first picture is a picture restored from the target picture through rotation and / or clipping.

[0070] Exemplarily, the implementation manner of decoding the target picture based on the rotation parameter and / or the clipping parameter of the target picture to obtain the first picture in YUV format can comprise: first decoding the target picture to obtain a first candidate picture in YUV format, and then, based on the rotation parameter and / or the clipping parameter of the target picture, performing restoration processing on the first candidate picture in YUV format to obtain the first picture in YUV format; or, first performing restoration processing on the target picture based on the rotation parameter and / or the clipping parameter of the target picture to obtain a first candidate picture, and then, decoding the first candidate picture to obtain the first picture in YUV format, wherein the format of the first candidate picture can be the same as or different from the format of the target picture. That is, in the process of decoding the target picture, if the target picture comprises the rotation parameter and / or the clipping parameter, the target picture is restored based on the rotation parameter and / or the clipping parameter to obtain a normal picture after decoding.

[0071] It should be noted that, in the process of decoding the target picture, in a case where the target picture comprises a plurality of color spaces, the target picture can be decoded based on the original color space of the target picture, or can be decoded based on the default color space of the target picture, etc., which is not limited in the embodiments of the present application.

[0072] Exemplarily, in a case where the target picture does not comprise the rotation parameter and the clipping parameter, the target picture can be directly decoded to obtain the first picture in YUV format, and the first picture is a picture without rotation and clipping restoration of the target picture. That is, the target picture itself has not performed the rotation operation and the clipping operation, and naturally does not comprise the rotation parameter and the clipping parameter, so that the target picture does not need to be restored through rotation and clipping during the decoding.

[0073] In step 304, based on the transparent channel parameter, a code library is called to convert the first picture into the second picture in RGBA format.

[0074] Exemplarily, in the case of obtaining the first picture in the decoded YUV format, the code library can be called to convert the first picture in the YUV format into the second picture in the RGBA format. Wherein, after decoding, the first picture can be in the YUV420 format, and by calling the format conversion function in the code library, the first picture in the YUV420 format can be directly or indirectly converted into the second picture in the RGBA format. Here, the format conversion can also be referred to as color conversion, i.e. color space conversion.

[0075] Exemplarily, the format (or color) conversion function in the code library can be called first to convert the first picture into the first candidate picture in the RGB format, and then the transparent channel parameter can be copied to the transparent channel of the first candidate picture in the RGB format to obtain the second picture in the RGBA format.

[0076] Exemplarily, the code library can include but is not limited to a plurality of functions such as I420ToARGB, I420ToABGR, NV12ToARGB, etc. to support indirect conversion from YUV to RGBA. The format / color conversion logic has been implemented inside these functions, so in actual use, only the conversion function required by the code library needs to be called to realize the format conversion processing of the first picture. These functions can very efficiently perform color space conversion and improve conversion efficiency. The following provides an optional conversion process from YUV to RGBA, including the following steps:

[0077] 1. Conversion from YUV to YCbCr

[0078] Wherein, Y (luminance) remains unchanged, and U (chrominance, blue difference value) and V (chrominance, red difference value) need to be adjusted according to the specific format, such as extraction from UV or UYVY format.

[0079] 2. Conversion from YCbCr to RGB

[0080] The conversion formula from YCbCr to RGB is used for conversion to obtain the candidate picture in the RGB format. Common conversion formulas include BT.601, BT.709, etc.

[0081] 3. Processing of Alpha channel

[0082] If the original picture does not have an Alpha channel, it can usually be set to full transparency (for example, the A channel in RGBA is 255 or 1.0). However, in the present embodiment, the HEIF picture has an Alpha channel, and the transparent channel data of the target picture, i.e. the Alpha channel data, has been parsed in the process of unpacking. At this time, the transparent channel data of the target picture can be directly copied to the transparent channel of the first candidate picture to obtain the second picture.

[0083] Exemplarily, the libyuv library can also include direct conversion functions such as I420ToARGBMatrix, which can directly convert a first picture in YUV420 format into a second picture in RGBA format without going through an intermediate conversion process such as YCbCr format. Using direct conversion functions can further improve the efficiency of color space conversion, and thus can improve the picture decoding speed to improve the picture loading speed.

[0084] In this embodiment, when decoding a picture, a first picture in YUV format can be obtained by decoding the target picture based on the rotation parameter and / or the cropping parameter, and then the first picture can be converted into a second picture in RGBA format based on the transparent channel parameter and by calling the code library. That is, for HEIF pictures, the HEIF pictures are decoded by combining the picture parameters of the HEIF pictures and the code library, which not only improves the decoding quality of the HEIF pictures, but also improves the decoding speed of the HEIF pictures, reduces the decoding time consumption, and improves the decoding efficiency, thereby improving the loading speed of the HEIF pictures.

[0085] In addition, the code library used is the libyuv library, which can eliminate the intermediate conversion process of the color space in the decoding process compared with the libheif library. For example, when decoding a HEIF picture and converting it into an RGBA format, the libheif library needs to first convert the YUV420 after decoding the code stream into YUV444, and then convert the YUV444 into the final RGBA. Therefore, by using the libyuv library, the intermediate YUV444 conversion can be eliminated, and YUV420 can be directly converted into RGBA, thereby accelerating the HEIF decoding.

[0086] In an exemplary embodiment, in the process of traditional decoding to obtain an RGBA format, the memory row pitch (stride) of the width of the RGBA format is aligned by default by 16 pixels, while the libheif decoding library needs to output the stride of the RGBA equal to 4*width. Therefore, when the width of the input HEIF picture is not a multiple of 16, a copy processing of the stride alignment of the RGBA is needed. Due to the alignment operation, the decoding time consumption is further increased, resulting in low decoding efficiency. Based on this, the present embodiment optimizes and improves this process. When creating the memory of the RGBA, the stride is directly set to 4*width (for 8bitdepth), thereby eliminating the processing process of the memory stride alignment. Figure 4 As shown in FIG. 4, the above method can further include steps 402 to 404. Wherein:

[0087] Step 402, creating a preset memory.

[0088] The line spacing of the preset memory is a preset multiple of the width of the second picture. The preset multiple can be 4 times or a multiple of 4.

[0089] The preset memory can be created before decoding, or can be created after the first picture in YUV format is obtained, or can be created after the second picture in RGBA format is obtained. The timing of creating the memory is not limited in the embodiments of the present application.

[0090] Step 404, storing the second picture into the preset memory.

[0091] In the case of creating the preset memory and obtaining the second picture in RGBA format, the second picture can be stored in the preset memory. Since the line spacing of the preset memory is a preset multiple of the width of the second picture, the RGBA line spacing alignment operation is not required when the second picture is stored in the preset memory, thereby reducing the decoding operation, simplifying the decoding process, shortening the decoding time, and further improving the decoding rate.

[0092] In an exemplary embodiment, a complete embodiment of a picture loading method is provided. In the embodiment, a new HEIF decoding library is created to complete the tasks of HEIF format unpackaging and H.265 code stream decoding to obtain RGBA, wherein the H.265 code stream can include an Instantaneous Decoding Refresh (IDR frame), also known as a key frame. Figure 5 As shown in FIG. 1, the complete process of picture loading is shown, including the following steps:

[0093] Step 1, opening a social software and starting to load a target picture.

[0094] Step 2, the internal picture library of the social software initiates a picture loading request to a resource server, and the picture loading request carries a URL address of the target picture.

[0095] Step 3, the internal picture library of the social software downloads the target picture from the resource server.

[0096] Step 4, after the picture is downloaded, a picture decoder is called to decode, and a decoded first picture is obtained.

[0097] Referring to FIG. 1, the decoding process can include: Figure 6

[0098] Step 41, the picture decoder unpackages the target picture to obtain the picture format of the target picture and the picture parameters of the target picture. ​

[0099] The picture parameters of the target picture include at least one of a transparent channel parameter, a rotation parameter, a clipping parameter, and a color space parameter. It should be noted that when the target picture contains which picture parameter, the corresponding picture parameter data is obtained by parsing the picture parameter during unpacking.

[0100] Step 42, based on the rotation parameter and / or the clipping parameter, the target picture is decoded to obtain a first picture in YUV format.

[0101] Exemplarily, the first picture can be in YUV420 format.

[0102] Step 43, based on the transparent channel parameter, a code library is called to convert the first picture into a second picture in RGBA format.

[0103] Exemplarily, the code library can be called to convert the first picture into a first candidate picture in RGB format, and then the transparent channel parameter is copied to the transparent channel of the first candidate picture to obtain the second picture. Further, a preset memory can be created, and the second picture can be stored in the preset memory; wherein the line spacing of the preset memory is a preset multiple of the width of the second picture, for example, the preset multiple can be 4 times.

[0104] Step 5, based on the color space parameter, the second picture is rendered, and the rendered second picture is displayed.

[0105] Exemplarily, the second picture can be binary data in RGBA format, when loading and displaying, the binary data can be converted into a Bitmap bitmap, and then the Bitmap bitmap is rendered based on the color space parameter, so as to display the rendered second picture.

[0106] The picture loading method provided by the embodiments of the present application integrates a new picture decoding algorithm into the HEIF decoder, and then integrates the HEIF decoder into the picture library of the social software client, so that when the social software loads a certain HEIF picture, the picture library can call the new decoder to decode the HEIF picture, and the new decoder can call the new picture decoding algorithm to decode the HEIF picture. By using the method, the decoding speed of the HEIF picture can be improved, and the loading speed of the HEIF picture can be improved, thereby providing better picture consumption experience for users.

[0107] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.

[0108] Based on the same inventive concept, the embodiments of the present application also provide a picture loading device for implementing the picture loading method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more picture loading device embodiments provided below can refer to the limitations of the picture loading method described above, which will not be repeated here.

[0109] In one exemplary embodiment, as shown in Figure 7 A picture loading device is provided, comprising: an unpacking module 702, a first decoding conversion module 704 and a second decoding conversion module 706, and a loading display module 708, wherein:

[0110] The unpacking module 702 is configured to perform unpacking processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture.

[0111] The first decoding conversion module 704 is configured to, if the picture format of the target picture is an HEIF picture format based on HEVC coding, perform decoding on the target picture based on the picture parameters to obtain a first picture in YUV format.

[0112] The second decoding conversion module 706 is configured to call a code library to convert the first picture to a second picture in RGBA format based on the picture parameters.

[0113] The loading display module 708 is configured to load and display the second picture.

[0114] In one embodiment, the picture parameters include at least one of a transparent channel parameter, a rotation parameter, a clipping parameter, and a color space parameter.

[0115] In one embodiment, the first decoding conversion module 704 is specifically configured to perform decoding on the target picture based on the rotation parameter and / or the clipping parameter to obtain the first picture in YUV format.

[0116] In one of the embodiments, the second decoding and converting module 706 is specifically configured to convert the first picture into a second picture in RGBA format based on the transparent channel parameter and the code library.

[0117] In one of the embodiments, the second decoding and converting module 706 is specifically configured to convert the first picture into a first candidate picture in RGB format, copy the transparent channel parameter to a transparent channel of the first candidate picture, and obtain the second picture.

[0118] In one of the embodiments, the apparatus further includes:

[0119] The memory module is configured to create a preset memory, and an interval between lines of the preset memory is a preset multiple of a width of the second picture.

[0120] The storage module is configured to store the second picture into the preset memory.

[0121] In one of the embodiments, the loading and displaying module 708 is specifically configured to render the second picture based on the color space parameter, and display the rendered second picture.

[0122] The above modules in the picture loading apparatus can be all or partially implemented by software, hardware, and combinations thereof. The above modules can be embedded in or independent of a processor in a computer device in hardware form, or can be stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the above modules.

[0123] In one of the exemplary embodiments, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 8The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected through a system bus. The communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to perform wired or wireless communication with external terminals. The wireless communication can be implemented through WIFI, mobile cellular network, Near Field Communication (NFC), or other technologies. The computer program is executed by the processor to implement a picture loading method. The display unit of the computer device is configured to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, a trackball, or a touchpad arranged on the shell of the computer device, or an external keyboard, a touchpad, a mouse, or the like.

[0124] Those skilled in the art can understand that Figure 8 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0125] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:

[0126] The target picture to be loaded is unpacked to obtain a picture format of the target picture and picture parameters of the target picture;

[0127] If the picture format of the target picture is an HEIF picture format based on HEVC coding, the target picture is decoded based on the picture parameters to obtain a first picture in YUV format;

[0128] Based on the picture parameters, a code library is called to convert the first picture into a second picture in RGBA format;

[0129] The second picture is loaded and displayed.

[0130] In one embodiment, the picture parameters include at least one of a transparent channel parameter, a rotation parameter, a cropping parameter, and a color space parameter.

[0131] In one embodiment, the computer program, when executed by the processor, further implements the following steps: decoding the target picture based on the rotation parameter and / or the cropping parameter to obtain a first picture in YUV format; and converting the first picture into a second picture in RGBA format based on the transparent channel parameter by calling a code library.

[0132] In one embodiment, the computer program, when executed by the processor, further implements the following steps: converting the first picture into a first candidate picture in RGB format by calling the code library; and copying the transparent channel parameter to a transparent channel of the first candidate picture to obtain the second picture.

[0133] In one embodiment, the computer program, when executed by the processor, further implements the following steps: creating a preset memory; the line spacing of the preset memory is a preset multiple of the width of the second picture; and storing the second picture in the preset memory.

[0134] In one embodiment, the computer program, when executed by the processor, further implements the following steps: rendering the second picture based on the color space parameter, and displaying the rendered second picture.

[0135] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program. The computer program, when executed by a processor, implements the following steps:

[0136] unpacking a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture;

[0137] if the picture format of the target picture is a HEIF picture format based on HEVC coding, decoding the target picture based on the picture parameters to obtain a first picture in YUV format;

[0138] converting the first picture into a second picture in RGBA format based on the picture parameters by calling a code library;

[0139] loading and displaying the second picture.

[0140] In one embodiment, the picture parameters include at least one of a transparent channel parameter, a rotation parameter, a cropping parameter, and a color space parameter.

[0141] In one embodiment, the computer program, when executed by the processor, further implements the following steps: decoding the target picture based on the rotation parameter and / or the cropping parameter to obtain a first picture in YUV format; and converting the first picture into a second picture in RGBA format based on the transparent channel parameter by calling a code library.

[0142] In one embodiment, the computer program, when executed by the processor, further implements the following steps: calling a code library to convert the first picture into a first candidate picture in RGB format; copying the transparent channel parameter to a transparent channel of the first candidate picture to obtain the second picture.

[0143] In one embodiment, the computer program, when executed by the processor, further implements the following steps: creating a preset memory; a line spacing of the preset memory is a preset multiple of a width of the second picture; and storing the second picture into the preset memory.

[0144] In one embodiment, the computer program, when executed by the processor, further implements the following steps: rendering the second picture based on the color space parameter, and displaying the rendered second picture.

[0145] In one embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the following steps:

[0146] unpacking a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture;

[0147] if the picture format of the target picture is HEIF picture format based on HEVC coding, decoding the target picture based on the picture parameters to obtain a first picture in YUV format;

[0148] based on the picture parameters, calling a code library to convert the first picture into a second picture in RGBA format;

[0149] loading and displaying the second picture.

[0150] In one embodiment, the picture parameters include at least one of a transparent channel parameter, a rotation parameter, a clipping parameter, and a color space parameter.

[0151] In one embodiment, the computer program, when executed by the processor, further implements the following steps: decoding the target picture based on the rotation parameter and / or the clipping parameter to obtain a first picture in YUV format; and calling a code library to convert the first picture into a second picture in RGBA format based on the transparent channel parameter.

[0152] In one embodiment, the computer program, when executed by the processor, further implements the following steps: calling a code library to convert the first picture into a first candidate picture in RGB format; copying the transparent channel parameter to a transparent channel of the first candidate picture to obtain the second picture.

[0153] In one embodiment, the computer program, when executed by the processor, further implements the following steps: creating a preset memory; the line spacing of the preset memory is a preset multiple of the width of the second picture; and storing the second picture into the preset memory.

[0154] In one embodiment, the computer program, when executed by the processor, further implements the following steps: rendering the second picture based on the color space parameter, and displaying the rendered second picture.

[0155] It should be noted that the data involved in the present application (including but not limited to data for analysis, stored data, displayed data, etc.) are all authorized information and data, and the collection, use and processing of related data need to comply with relevant regulations.

[0156] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium. When the computer program is executed, it can include the processes of the above-mentioned embodiments. Any reference to a memory, database or other medium used in the embodiments provided by the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (ROM), a magnetic tape, a floppy disk, a flash memory, an optical storage, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (MRAM), a ferroelectric memory (FRAM), a phase change memory (PCM), a graphene memory, etc. The volatile memory can include a random access memory (RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., but is not limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0157] Any combination of the technical features in the above embodiments can be made. For the sake of brevity, the foregoing description has not described all possible combinations of the technical features in the above embodiments, however, as long as the combination of the technical features does not contradict, it should be considered within the scope of the present disclosure.

[0158] The above embodiments only express several implementation manners of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the patent scope of the present application. It should be pointed out that, for ordinary skilled persons in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A picture loading method, characterized by, The method comprises: performing unpacking processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture; if the picture format of the target picture is an HEIF picture format based on HEVC coding, decoding the target picture based on the picture parameters to obtain a first picture in YUV format; based on the picture parameters, calling a code library to convert the first picture into a second picture in RGBA format; loading and displaying the second picture.

2. The method of claim 1, wherein, The picture parameters comprise at least one of a transparent channel parameter, a rotation parameter, a clipping parameter, and a color space parameter.

3. The method of claim 2, wherein, The decoding of the target picture based on the picture parameters to obtain a first picture in YUV format comprises: decoding the target picture based on the rotation parameter and / or the clipping parameter to obtain a first picture in YUV format; based on the picture parameters, calling a code library to convert the first picture into a second picture in RGBA format comprises: based on the transparent channel parameter, calling the code library to convert the first picture into a second picture in RGBA format.

4. The method of claim 3, wherein, The calling of the code library to convert the first picture into a second picture in RGBA format based on the transparent channel parameter comprises: calling the code library to convert the first picture into a first candidate picture in RGB format; copying the transparent channel parameter to a transparent channel of the first candidate picture to obtain the second picture.

5. The method of claim 3, wherein, The method further comprises: creating a preset memory; the line spacing of the preset memory is a preset multiple of the width of the second picture; storing the second picture in the preset memory.

6. The method of claim 2, wherein, The loading and displaying of the second picture comprises: based on the color space parameter, rendering the second picture and displaying the rendered second picture.

7. An image loading apparatus, characterized by comprising: The apparatus comprises: an unpacking module configured to perform unpacking processing on a target picture to be loaded to obtain a picture format of the target picture and picture parameters of the target picture; a first decoding conversion module configured to, if the picture format of the target picture is an HEIF picture format based on HEVC coding, decode the target picture based on the picture parameters to obtain a first picture in YUV format; a second decoding conversion module configured to, based on the picture parameters, call a code library to convert the first picture into a second picture in RGBA format; a loading and displaying module configured to load and display the second picture.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.