CN110349243B - Image processing method, device, electronic equipment and storage medium - Google Patents

Image processing method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110349243B
CN110349243B CN201910637251.3A CN201910637251A CN110349243B CN 110349243 B CN110349243 B CN 110349243B CN 201910637251 A CN201910637251 A CN 201910637251A CN 110349243 B CN110349243 B CN 110349243B
Authority
CN
China
Prior art keywords
image data
processed
image processing
compressed texture
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910637251.3A
Other languages
Chinese (zh)
Other versions
CN110349243A (en
Inventor
李森林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201910637251.3A priority Critical patent/CN110349243B/en
Publication of CN110349243A publication Critical patent/CN110349243A/en
Application granted granted Critical
Publication of CN110349243B publication Critical patent/CN110349243B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Graphics (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Generation (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application discloses an image processing method, an image processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps of receiving an image processing instruction, obtaining image data to be processed in various compression texture formats according to the image processing instruction, obtaining type information of a graphic processor, selecting target image data to be processed from the image data to be processed in various compression texture formats according to the type information, and finally inputting the target image data to be processed to the graphic processor for image rendering. Therefore, in the image processing process, the compressed texture format of the image data can be actively selected, and the efficiency of image processing is improved.

Description

Image processing method, device, electronic equipment and storage medium
Technical Field
The present application relates to the field of electronic technologies, and in particular, to an image processing method, an image processing device, an electronic device, and a storage medium.
Background
In the existing image processing technology, compression Texture processing is generally performed on an image through a Unity3D device, the Unity3D device can convert the image into a required Texture2D format, and in the Texture2D configuration option, different compression Texture formats can be set for different platforms, for example, an iOS platform is set to PVRTC4, an Android platform is set to ETC1, and the like.
However, before processing an image, a specified image compressed texture format needs to be generated, and in different GPU types, a compressed texture format for inputting images of different types needs to be specified, otherwise, in the case that the GPU does not support the compressed texture format of an image, phenomena such as abnormal game images may be caused.
Disclosure of Invention
The embodiment of the application provides an image processing method, an image processing device, electronic equipment and a storage medium. Wherein the image processing method can improve the efficiency of image processing.
In order to solve the technical problems, the application provides the following technical scheme:
in a first aspect, an embodiment of the present application provides an image processing method, where the image processing method includes:
receiving an image processing instruction, and acquiring image data to be processed in various compressed texture formats according to the image processing instruction;
acquiring type information of a graphic processor;
selecting target image data to be processed from the image data to be processed in the plurality of compression texture formats according to the type information;
and inputting the target image data to be processed to the graphic processor so as to perform image rendering.
In a second aspect, an embodiment of the present application provides an image processing apparatus, wherein the image processing apparatus includes:
the first acquisition module is used for receiving an image processing instruction and acquiring image data to be processed in various compressed texture formats according to the image processing instruction;
the second acquisition module is used for acquiring type information of the graphic processor;
the selecting module is used for selecting target image data to be processed from the image data to be processed in the multiple compression texture formats according to the type information;
and the rendering module is used for inputting the target image data to be processed to the graphic processor so as to render the image.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the steps of the image processing method described above when the processor executes the program.
In a fourth aspect, an embodiment of the present application provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the above-described image processing method.
In the embodiment of the application, the image processing instruction is received, the image data to be processed in various compression texture formats are obtained according to the image processing instruction, the type information of the graphic processor is obtained, the target image data to be processed is selected from the image data to be processed in various compression texture formats according to the type information, and finally the target image data to be processed is input to the graphic processor for image rendering. Therefore, the memory occupied during image processing is low, the image quality of image rendering is high, and the efficiency during image processing is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of an image processing method according to an embodiment of the application.
Fig. 2 is a schematic diagram of a second flow of an image processing method according to an embodiment of the present application.
Fig. 3 is a schematic diagram of a first structure of an image processing apparatus according to an embodiment of the present application.
Fig. 4 is a second schematic structural diagram of an image processing apparatus according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to fall within the scope of the application.
In the description that follows, specific embodiments of the application will be described with reference to steps and symbols performed by one or more computers, unless otherwise indicated. Thus, these steps and operations will be referred to in several instances as being performed by a computer, which as referred to herein performs operations that include processing units by the computer that represent electronic signals that represent data in a structured form. This operation transforms the data or maintains it in place in the computer's memory system, which may reconfigure or otherwise alter the computer's operation in a manner well known to those skilled in the art. The data structure maintained by the data is the physical location of the memory, which has specific characteristics defined by the data format. However, the principles of the present application are described in the foregoing text and are not meant to be limiting, and one skilled in the art will recognize that various steps and operations described below may also be implemented in hardware.
The terms "first," "second," and "third," etc. in this disclosure are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to the particular steps or modules listed and certain embodiments may include additional steps or modules not listed or inherent to such process, method, article, or apparatus.
The embodiment of the application provides an image processing method, an image processing device, electronic equipment and a storage medium. The following will describe in detail.
The image processing method is suitable for electronic equipment such as smart phones, computers, smart televisions, smart wearable equipment and the like, and the electronic equipment using the image processing method is within the protection scope of the application.
Referring to fig. 1, fig. 1 is a schematic flow chart of an image processing method according to an embodiment of the application. The image processing method can improve the efficiency of image processing. The image processing method includes the steps of:
in step 101, an image processing instruction is received, and image data to be processed in a plurality of compressed texture formats is acquired according to the image processing instruction.
The image is required to be processed when playing a game, or when watching a video, loading a web page, or the like. At this time, an image processing instruction is generated, and the electronic apparatus processes the input image data in accordance with the image processing instruction.
In some embodiments, the input image data may be original image, for example, in a format such as PNG, JPG, BMP, GIF, which is not processed by GPU (graphics processor), and requires CPU (central processing unit) to decompress the image data into bitmap, then obtain the image data to be processed in the corresponding texture format according to the bitmap, for example, R5G6B5, A4R4G4B4, A1R5G5B5, R8G8B8, A8R8G8B8, and then input the image data to the graphics processor for image rendering.
In some embodiments, the input image data may also be compressed texture image data, such as ETC1, ETC2, PVRTC, ASTC, DXT, and various compressed texture image data may be acquired as the image data to be processed.
It should be noted that the image data in the multiple compressed texture formats may be image data stored locally in the electronic device, for example, a stand-alone type of image data downloaded in the electronic device is excellent
In step 102, type information of a graphics processor is acquired.
Graphics processors are also different from vendor to vendor, e.g., the high-pass Adreno family of graphics processors is its unique GPU type, or the Tegra family of graphics processors of Injeida, the Bay Trail family of graphics processors of Intel, etc.
The type information of the graphics processors is different, and the compression texture format of the supported image data is naturally different, for example, the image data of PVRTC compression texture format can be supported by an electronic device using a PowerVR series graphics processor, and the image data of ASTC compression texture format can be supported by an electronic device using an Adreno series graphics processor.
In step 103, target image data to be processed is selected among the plurality of compressed texture formats of image data to be processed according to the type information.
After the image data to be processed in a plurality of compressed texture formats such as ETC1, ETC2, PVRTC, ASTC, DXT are acquired, the compressed texture format supported by the graphics processor may be selected according to the type information of the graphics processor, and then the image data to be processed in the compressed texture format supported by the graphics processor is selected as the target image data to be processed.
For example, the graphics processor of the electronic device supports three compressed texture formats of image data, ETC1, ETC2, ASTC, and may select three compressed texture formats of image data, ETC1, ETC2, ASTC, of the image data to be processed as target image data to be processed. If the graphic processor of the electronic device only supports the image data of the ETC1 compressed texture format, selecting the image data of the ETC1 compressed texture format as target image data to be processed.
In step 104, target image data to be processed is input to a graphics processor for image rendering.
After selecting the target image data to be processed, selecting one of the image data in a compressed texture format and inputting the image data into the graphics processor, so that the graphics processor processes the image data, and finally, image rendering is realized.
For example, if the current graphics processor of the electronic device is the Tegra series of inflight or the Bay Trail series of intel, the DXT texture recognition algorithm is adopted to fetch the compressed texture data, and the compressed texture data is directly delivered to the GPU for rendering.
If the graphic processor of the current electronic device is image data capable of supporting multiple compression texture formats, the target image data to be processed can be selected according to comprehensive factors such as image quality, speed, duration and the like of the drawn image, and the selected target image data is input into the image processor for rendering.
In summary, in the image processing method provided in the embodiment of the present application, by receiving an image processing instruction, obtaining image data to be processed in a plurality of compressed texture formats according to the image processing instruction, obtaining type information of a graphics processor, selecting target image data to be processed from the image data to be processed in the plurality of compressed texture formats according to the type information, and finally inputting the target image data to be processed to the graphics processor for image rendering. Therefore, the memory occupied during image processing is low, the image quality of image rendering is high, and the efficiency during image processing is improved.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating a second flow of an image processing method according to an embodiment of the present application, where the image processing method can improve efficiency of image processing. The image processing method includes the steps of:
in step 201, an image processing instruction is received, and image data to be processed in a plurality of compressed texture formats is acquired according to the image processing instruction.
In the processing of an image, image data of various compressed texture formats, for example, image data of compressed texture formats such as ETC1, ETC2, PVRTC, ASTC, DXT, may be acquired.
Different compression texture formats have different characteristics, for example, the ETC1 compression texture format is a standard picture compression texture format, and ETC1 only supports RGB channels and does not support alpha transparent channels; ETC2 compressed texture format is a standard picture compressed texture format, ETC2 supports alpha transparent channels in addition to RGB channels. The ASTC compressed texture format may be supported by the electronics of the high-pass Adreno family of graphics processors and the PVRTC compressed texture format may be supported by the electronics using the PowerVR family of graphics processors.
The image processing instruction can be used for obtaining the image data to be processed in various compressed texture formats, wherein the image data to be processed can be stored locally by the electronic equipment or can be stored in a cloud.
In step S202, the control graphic processor generates a presentation interface.
Before processing the image data to be processed, it is necessary to acquire type information of a graphics processor of the electronic device.
At this point, the graphics processor may be controlled to generate a presentation interface, which may be transparent, to prevent obscuring the user's view, resulting in a poor user experience.
For example, in an electronic device carrying an Android system, the obtaining of the graphics processor type information may be implemented through a Java API provided by Android, specifically, the graphics processor type information is obtained by means of OpenGL, which is a cross-language and cross-platform application programming interface for rendering 2D and 3D vector graphics. The renderer may be set to a glsurface view by implementing a glsurface view. Render interface, and then install to an Activity (an application component, providing a screen that a user may use to interact to accomplish a task), where hanging on an Activity may be understood as an interface in an Android, which may be set to be transparent.
In step 203, parameter information of the display interface is obtained, and type information of the graphics processor is obtained according to the parameter information.
For example, the type information of the graphics processor may be obtained from the glsurface view. The type information of the graphics processor may also be obtained from a system information signature of the electronic device.
In step S204, processable compressed texture image data of the graphic processor is acquired according to the type information.
The compressed texture formats supported by different types of graphics processors are also different, for example, image data in the PVRTC compressed texture format may be supported by an electronic device using a PowerVR family of graphics processors and image data in the ASTC compressed texture format may be supported by an electronic device using an Adreno family of graphics processors.
Compressed texture image data in a compressed texture format supportable by a graphic processor of the electronic device can be acquired according to the type information.
In step 205, a priority is set for the processable compressed texture image data of different compressed texture formats.
It will be appreciated that the graphics processor of the electronic device may support image data in multiple compressed texture formats, and that the graphics processor may have different durations and efficiencies for processing image data in different compressed texture formats, and may also have different picture effects after processing image data in different compressed texture formats.
For example, the priority of compressed texture image data may be set according to the speed at which the graphics processor processes compressed texture data of different compressed texture formats, the faster the processing speed, the higher the priority of the corresponding compressed texture image data. The compressed texture image data may be prioritized according to the display effect of the screen after the graphics processor processes the compressed texture image data, and the better the quality of the screen, the higher the priority of the corresponding compressed texture image data.
In some embodiments, when the graphics processor may support multiple compression texture formats, the priority of the compression texture data may also be set according to the situation during image processing, for example, when playing a game, the loading speed is required when the game is just opened, at this time, the priority may be set according to the processing speed of the graphics processor on the compression texture image data, after entering the game, the image quality is required to be higher in the game, at this time, the priority may be set according to the output image quality, and at different stages of game operation, the target image data to be processed may be selected using priorities formulated by different standards.
In step 206, it is determined whether there is processable compressed texture image data in the image data to be processed according to the type information.
After the compressed texture image data processable by the image processor is prioritized, it may be determined whether or not compressed texture image data processable by the image processor exists in the image data to be processed.
If there is compressed texture image data that can be processed by the graphics processor in the image data to be processed, step 207 is entered.
If there is no compressed texture image data that can be processed by the graphics processor in the image data to be processed, the process proceeds to step 209.
In step 207, target image data to be processed is selected among the image data to be processed according to the priority.
It will be appreciated that the target image data to be processed that the graphics processor can support may be selected from among the image data to be processed based on compressed texture image data that the graphics processor can process.
For example, the graphics processor of the electronic device supports three compressed texture formats of image data, ETC1, ETC2, ASTC, and may select three compressed texture formats of image data, ETC1, ETC2, ASTC, of the image data to be processed as target image data to be processed. If the graphic processor of the electronic device only supports the image data of the ETC1 compressed texture format, selecting the image data of the ETC1 compressed texture format as target image data to be processed.
The priority can also be set according to the level of the compressed texture format supported by the graphics processor, for example, if the electronic device with the Android system supports two compressed texture formats, ETC2 and ETC1, the image data level of the compressed texture format of ETC2 is set higher, because in the case that the electronic device supports ETC2, it is indicated that the graphics processor of the electronic device supports OpenGL3.0, openGL is a bottom 3D graphics library with convenient calling, the version corresponding to OpenGL3.0 must be more comprehensive than the version of OpenGL2.0, and if the graphics processor of the electronic device does not support OpenGL3.0, only the image data of the compressed texture format of ETC1 can be selected to be the higher priority, because in the case that the graphics processor supports the compressed texture format of ETC1, the graphics processor must support the version of OpenGL 2.0.
In step 208, target image data to be processed is selected among the image data to be processed according to the priority.
Image data in a compressed texture format with higher priority can be selected and set as target image data to be processed. For example, the level of priority is 10, and the image data to be processed having a priority higher than 5 is selected as the target processed image data, i.e., the image data to be processed having a priority higher than the preset threshold is selected as the target processed image data.
The image data to be processed with the highest priority can be directly selected as target image data to be processed.
In step 209, target image data to be processed is input to the graphics processor for image rendering.
Inputting the target image data to be processed into a graphic processor, and the image processor adopts a corresponding recognition algorithm to the target image data to be processed, and takes out the image data in a corresponding compressed texture format to be input into the graphic processor for drawing so as to perform image rendering.
For example, if the current device graphics processor is the Tegra series of inflight or the Bay Trail series of intel, the DXT texture recognition algorithm is adopted to fetch the compressed texture data, and the compressed texture data is directly delivered to the GPU for rendering.
If the compressed texture format supported by the graphics processor does not exist in the image data to be processed, the process proceeds to step 210, where the original image data is obtained according to the image processing instruction.
It will be appreciated that the input image data may be in original image, for example, in a format such as PNG, JPG, BMP, GIF, which is not processed by GPU (graphics processor), and requires CPU (central processing unit) to decompress it into bitmap, and then obtain the image data to be processed in a corresponding texture format, for example, R5G6B5, A4R4G4B4, A1R5G5B5, R8G8B8, A8R8G8B8, and so on, according to the bitmap.
In step 211, the raw image data is input to a graphics processor for image rendering.
For example, for a 512 x 512 texture picture, a file in R5G6B5 format needs to occupy 512KB of capacity (512 x 2/1024), and for a file in R8G8B8A8 format, a capacity of 1MB is required. In the case of a 1024 x 1024 texture picture, the format files of R5G6B5 and R8G8B8A8 require capacities of 2MB and 4MB, respectively.
Although the image texture data in the original image is directly input to the image processor for processing, more memory resources are occupied when the image is processed, and abnormal operation of an application program caused by that the electronic equipment does not support all the images to be processed in the compressed texture format can be avoided.
In summary, in the embodiment of the present application, image processing instructions are used to obtain image data to be processed in multiple compressed texture formats, and then the graphics processor is controlled to generate a display interface, obtain parameter information of the display interface, obtain type information of the image processor according to the parameter information, obtain compressed texture image data processable by the graphics processor according to the type information, and set priority for compressed texture image data in different compressed texture formats.
If the processable compressed texture image data exist in the image data to be processed, selecting target compressed image data to be processed from the image data to be processed according to the priority, and inputting the target image data to be processed to a graphics processor for image rendering; if the compressed texture image data which can be processed by the graphic processor does not exist in the image data to be processed, acquiring an original image according to the image processing instruction, and inputting the original image data to the graphic processor for image rendering.
The image processing method can actively select the compressed texture format of the image data and select the compressed texture format, so that the memory resources occupied during image processing are low, and the efficiency during image processing is improved.
Correspondingly, the embodiment of the application also provides an image processing device corresponding to the image processing method. Referring to fig. 3, fig. 3 is a schematic diagram of a first structure of an image processing apparatus according to an embodiment of the application. The image processing apparatus includes: a first acquisition module 310, a second acquisition module 320, a selection module 330, and a rendering module 340.
The first obtaining module 310 is configured to receive an image processing instruction, and obtain image data to be processed in multiple compressed texture formats according to the image processing instruction.
In the processing of an image, image data of various compressed texture formats, for example, image data of compressed texture formats such as ETC1, ETC2, PVRTC, ASTC, DXT, may be acquired.
Different compression texture formats have different characteristics, for example, the ETC1 compression texture format is a standard picture compression texture format, and ETC1 only supports RGB channels and does not support alpha transparent channels; ETC2 compressed texture format is a standard picture compressed texture format, ETC2 supports alpha transparent channels in addition to RGB channels. The ASTC compressed texture format may be supported by the electronics of the high-pass Adreno family of graphics processors and the PVRTC compressed texture format may be supported by the electronics using the PowerVR family of graphics processors.
The first obtaining module 310 may obtain, through the image processing instruction, image data to be processed in multiple compressed texture formats, where the image data to be processed may be stored locally by the electronic device or may be stored in a cloud.
And a second obtaining module 320, configured to obtain type information of the graphics processor.
Graphics processors are also different from vendor to vendor, e.g., the high-pass Adreno family of graphics processors is its unique GPU type, or the Tegra family of graphics processors of Injeida, the Bay Trail family of graphics processors of Intel, etc.
The type information of the graphics processors is different, and the compression texture format of the supported image data is naturally different, for example, the image data of PVRTC compression texture format can be supported by an electronic device using a PowerVR series graphics processor, and the image data of ASTC compression texture format can be supported by an electronic device using an Adreno series graphics processor.
In addition, referring to fig. 4, fig. 4 is a schematic diagram of a second structure of the image processing apparatus according to the embodiment of the application. The second obtaining module 320 includes an interface generating sub-module 321 and a type obtaining sub-module 322.
The interface generating sub-module 321 is configured to control the graphics processor to generate a display interface, where the display interface is a transparent interface.
Before processing the image data to be processed, it is necessary to acquire type information of a graphics processor of the electronic device.
The interface generation sub-module 321 may control the graphics processor to generate a presentation interface, which may be transparent, to prevent obscuring the user's view, resulting in a poor user experience.
For example, in an electronic device carrying an Android system, the obtaining of the graphics processor type information may be implemented through a Java API provided by Android, specifically, the graphics processor type information is obtained by means of OpenGL, which is a cross-language and cross-platform application programming interface for rendering 2D and 3D vector graphics. The renderer may be set to a glsurface view by implementing a glsurface view. Render interface, and then install to an Activity (an application component, providing a screen that a user may use to interact to accomplish a task), where hanging on an Activity may be understood as an interface in an Android, which may be set to be transparent.
And the type acquisition sub-module 322 is configured to acquire parameter information of the display interface, and acquire type information of the imager according to the parameter information.
The type acquisition sub-module 322 may acquire the type information of the graphics processor from the glsurface view. The type information of the graphics processor may also be obtained from a system information signature of the electronic device.
And a selection module 330, configured to select target image data to be processed from the plurality of compressed texture formats of image data to be processed according to the type information.
After the image data to be processed in a plurality of compressed texture formats such as ETC1, ETC2, PVRTC, ASTC, DXT are acquired, the compressed texture format supported by the graphics processor may be selected according to the type information of the graphics processor, and then the image data to be processed in the compressed texture format supported by the graphics processor is selected as the target image data to be processed.
For example, the graphics processor of the electronic device supports three compressed texture formats of image data, ETC1, ETC2, ASTC, and may select three compressed texture formats of image data, ETC1, ETC2, ASTC, of the image data to be processed as target image data to be processed. If the graphic processor of the electronic device only supports the image data of the ETC1 compressed texture format, selecting the image data of the ETC1 compressed texture format as target image data to be processed.
Referring to fig. 4, the selection module 330 includes an acquisition sub-module 331 and a selection sub-module 332.
And the obtaining sub-module 331 is configured to obtain compressed texture graphics data that can be processed by the graphics processor according to the type information.
The compressed texture formats supported by different types of graphics processors are also different, for example, image data in the PVRTC compressed texture format may be supported by an electronic device using a PowerVR family of graphics processors and image data in the ASTC compressed texture format may be supported by an electronic device using an Adreno family of graphics processors.
The acquiring sub-module 331 may acquire compressed texture image data in a compressed texture format that can be supported by the graphic processor of the electronic device according to the type information.
A selecting sub-module 332, configured to select target image data to be processed from the image data to be processed according to the processable compressed texture image data.
The selecting submodule 332 is specifically configured to set priorities for the processable compressed texture image data in different compressed texture formats; and selecting target image data to be processed from the image data to be processed according to the priority.
The graphic processor of the electronic device can support image data in various compression texture formats, the graphic processor has different duration and efficiency for processing the image data in different compression texture formats, and the picture effect after processing the image data in different compression texture formats is different.
For example, the priority of compressed texture image data may be set according to the speed at which the graphics processor processes compressed texture data of different compressed texture formats, the faster the processing speed, the higher the priority of the corresponding compressed texture image data. The compressed texture image data may be prioritized according to the display effect of the screen after the graphics processor processes the compressed texture image data, and the better the quality of the screen, the higher the priority of the corresponding compressed texture image data.
And the rendering module 340 is configured to input the target image data to be processed to the graphics processor, so as to perform image rendering.
After selecting the target image data to be processed, the rendering module 340 may select one of the image data in a compressed texture format and input the selected image data to the graphics processor, so that the graphics processor processes the image data, and finally image rendering is achieved.
For example, if the current graphics processor of the electronic device is the Tegra series of inflight or the Bay Trail series of intel, the DXT texture recognition algorithm is adopted to fetch the compressed texture data, and the compressed texture data is directly delivered to the GPU for rendering.
If the graphic processor of the current electronic device is image data capable of supporting multiple compression texture formats, the target image data to be processed can be selected according to comprehensive factors such as image quality, speed, duration and the like of the drawn image, and the selected target image data is input into the image processor for rendering.
Referring to fig. 4, the image processing apparatus further includes a determining module 350. The judging module 350 is configured to judge whether the processable compressed texture image data exists in the image data to be processed according to the type information.
If the selection module 350 determines that the processable compressed texture image data exists in the image data to be processed, the rendering module 340 processes the target image data to be processed.
If the selection module 350 determines that the processable compressed texture image data does not exist in the image data to be processed, acquiring original image data according to the image processing instruction, and inputting the original image data to the graphics processor for image rendering.
In summary, in the embodiment of the present application, image processing instructions are used to obtain image data to be processed in multiple compressed texture formats, and then the graphics processor is controlled to generate a display interface, obtain parameter information of the display interface, obtain type information of the image processor according to the parameter information, obtain compressed texture image data processable by the graphics processor according to the type information, and set priority for compressed texture image data in different compressed texture formats.
If the processable compressed texture image data exist in the image data to be processed, selecting target compressed image data to be processed from the image data to be processed according to the priority, and inputting the target image data to be processed to a graphics processor for image rendering; if the compressed texture image data which can be processed by the graphic processor does not exist in the image data to be processed, acquiring an original image according to the image processing instruction, and inputting the original image data to the graphic processor for image rendering.
The image processing method can actively select the compressed texture format of the image data and select the compressed texture format, so that the memory resources occupied during image processing are low, and the efficiency during image processing is improved.
Correspondingly, the embodiment of the application also provides an electronic device, referring to fig. 5, and fig. 5 is a schematic structural diagram of the electronic device provided by the embodiment of the application.
The electronic device 400 includes: a display unit 401, an input unit 402, a memory 403, a central processing unit 405, a power supply 404, a sensor 406, and the like. It will be appreciated by those skilled in the art that the electronic device structure shown in the figures is not limiting of the electronic device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components. Wherein:
the display unit 401 may be used to display information input by a user or information provided to the user and various graphical user interfaces of the electronic device, which may be composed of graphics, text, icons, video, and any combination thereof. The display unit 401 may include a display panel, and alternatively, the display panel may be configured in the form of a liquid crystal display (LCD, liquid Crystal Display), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch-sensitive surface may overlay a display panel, and upon detection of a touch operation thereon or thereabout, the touch-sensitive surface is transferred to the central processor 404 to determine the type of touch event, and the central processor 404 then provides a corresponding visual output on the display panel based on the type of touch event. Although in fig. 5 the touch sensitive surface and the display panel are implemented as two separate components for input and output functions, in some embodiments the touch sensitive surface may be integrated with the display panel to implement the input and output functions.
The input unit 402 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, in one particular embodiment, the input unit 402 may include a touch-sensitive surface, as well as other input devices. The touch-sensitive surface, also referred to as a touch display screen or a touch pad, may collect touch operations thereon or thereabout by a user (e.g., operations thereon or thereabout by a user using any suitable object or accessory such as a finger, stylus, etc.), and actuate the corresponding connection means according to a predetermined program. Alternatively, the touch-sensitive surface may comprise two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the central processor 404, and can receive and execute commands sent from the central processor 404. In addition, touch sensitive surfaces may be implemented in a variety of types, such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 402 may also include other input devices. In particular, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The memory 403 may be used to store software programs and modules, and the processor 404 may execute various functional applications and data processing by executing the software programs and modules stored in the memory 403. The memory 404 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device (such as audio data, phonebooks, etc.), and the like. In addition, memory 403 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 403 may also include a memory controller to provide access to the memory 403 by the processor 404 and the input unit 402.
The electronic device also includes a power supply 405 (e.g., a battery) for powering the various components, which may preferably be logically connected to the central processor 404 via a power management system so as to perform functions such as managing charging, discharging, and power consumption via the power management system. The power supply 405 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The electronic device may also include at least one sensor 406, such as a light sensor, a pressure sensor, a motion sensor, and other sensors. In particular, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel according to the brightness of ambient light, and a proximity sensor that may turn off the display panel and/or backlight when the electronic device is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and the direction when the mobile phone is stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device are not described in detail herein.
Although not shown, the electronic device may further include a camera, a bluetooth module, etc., which will not be described herein. In particular, in this embodiment, the central processor 404 in the electronic device loads executable files corresponding to the processes of one or more application programs into the memory 403 according to the following instructions, and the central processor 404 executes the application programs stored in the memory 403, so as to implement various functions:
receiving an image processing instruction, and acquiring image data to be processed in various compressed texture formats according to the image processing instruction;
acquiring type information of a graphic processor;
selecting target image data to be processed from the image data to be processed in the plurality of compression texture formats according to the type information;
and inputting the target image data to be processed to the graphic processor so as to perform image rendering.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a storage medium having stored therein a plurality of instructions capable of being loaded by a processor to perform steps in any one of the image processing methods provided by the embodiment of the present application. For example, the instructions may perform the steps of:
receiving an image processing instruction, and acquiring image data to be processed in various compressed texture formats according to the image processing instruction;
acquiring type information of a graphic processor;
selecting target image data to be processed from the image data to be processed in the plurality of compression texture formats according to the type information;
and inputting the target image data to be processed to the graphic processor so as to perform image rendering.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
The instructions stored in the storage medium may perform steps in any image processing method provided by the embodiments of the present application, so that the beneficial effects that any image processing method provided by the embodiments of the present application can be achieved, which are detailed in the previous embodiments and are not described herein.
The foregoing has described in detail the image processing method, apparatus, electronic device and storage medium provided by the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are only used to help understand the method and core idea of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, the present description should not be construed as limiting the present application.

Claims (10)

1. An image processing method, the method comprising:
receiving an image processing instruction, and acquiring image data to be processed in various compressed texture formats according to the image processing instruction;
acquiring type information of a graphic processor;
selecting target image data to be processed from the image data to be processed in the plurality of compressed texture formats according to the type information, including: acquiring compressed texture graphic data which can be processed by the graphic processor according to the type information; selecting target image data to be processed from the image data to be processed according to the processable compressed texture image data;
and inputting the target image data to be processed to the graphic processor so as to perform image rendering.
2. The image processing method according to claim 1, wherein the selecting target image data to be processed among the image data to be processed from the processable compressed texture image data includes:
prioritizing said processable compressed texture image data of different compressed texture formats;
and selecting target image data to be processed from the image data to be processed according to the priority.
3. The image processing method according to claim 1, wherein before selecting target image data to be processed among the image data to be processed from the processable compressed texture image data, the method further comprises:
judging whether the processable compressed texture image data exists in the image data to be processed according to the type information;
if not, acquiring original image data according to the image processing instruction;
and inputting the original image data to the graphic processor for image rendering.
4. The image processing method according to claim 1, wherein the acquiring type information of the graphic processor includes:
controlling the graphic processor to generate a display interface, wherein the display interface is a transparent interface;
acquiring parameter information of the display interface;
and acquiring the type information of the graphic processor according to the parameter information.
5. An image processing apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for receiving an image processing instruction and acquiring image data to be processed in various compressed texture formats according to the image processing instruction;
the second acquisition module is used for acquiring type information of the graphic processor;
the selecting module is used for selecting target image data to be processed from the image data to be processed in the multiple compression texture formats according to the type information;
the rendering module is used for inputting the target image data to be processed to the graphic processor so as to render the image;
wherein the selection module comprises:
an acquisition sub-module for acquiring compressed texture graphic data which can be processed by the graphic processor according to the type information;
and the selecting sub-module is used for selecting target to-be-processed image data from the to-be-processed image data according to the processable compressed texture image data.
6. The image processing apparatus according to claim 5, wherein,
the selection submodule is specifically configured to:
prioritizing said processable compressed texture image data of different compressed texture formats;
and selecting target image data to be processed from the image data to be processed according to the priority.
7. The image processing apparatus according to claim 5, wherein the apparatus further comprises:
the judging module is used for judging whether the processable compressed texture image data exists in the image data to be processed according to the type information;
and when the judging module judges that the result is negative, the rendering module is used for acquiring original image data according to the image processing instruction, and inputting the original image data to the graphic processor for image rendering.
8. The image processing apparatus of claim 5, wherein the second acquisition module comprises:
the interface generation sub-module is used for controlling the graphic processor to generate a display interface, and the display interface is a transparent interface;
and the type acquisition sub-module is used for acquiring the parameter information of the display interface and acquiring the type information of the graphic processor according to the parameter information.
9. An electronic device, comprising:
a memory storing executable program code, a processor coupled to the memory;
the processor invokes the executable program code stored in the memory to perform the steps in the image processing method as claimed in any one of claims 1 to 4.
10. A storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the steps of the image processing method of any one of claims 1 to 4.
CN201910637251.3A 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium Active CN110349243B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910637251.3A CN110349243B (en) 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910637251.3A CN110349243B (en) 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110349243A CN110349243A (en) 2019-10-18
CN110349243B true CN110349243B (en) 2023-10-20

Family

ID=68175386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910637251.3A Active CN110349243B (en) 2019-07-15 2019-07-15 Image processing method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110349243B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113220249A (en) * 2020-02-05 2021-08-06 腾讯科技(深圳)有限公司 Image display method and device and storage medium
CN114832373B (en) * 2021-12-21 2023-03-07 许磊 Texture, audio and video compression and reconstruction method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408634A (en) * 2015-07-29 2017-02-15 三星电子株式会社 Texture processing apparatus and method
WO2017045540A1 (en) * 2015-09-14 2017-03-23 阿里巴巴集团控股有限公司 Picture processing method, apparatus, terminal device, and system for smart terminal
CN108460822A (en) * 2017-02-15 2018-08-28 上海银河数娱网络科技有限公司 Texture Processing Methods and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106408634A (en) * 2015-07-29 2017-02-15 三星电子株式会社 Texture processing apparatus and method
WO2017045540A1 (en) * 2015-09-14 2017-03-23 阿里巴巴集团控股有限公司 Picture processing method, apparatus, terminal device, and system for smart terminal
CN108460822A (en) * 2017-02-15 2018-08-28 上海银河数娱网络科技有限公司 Texture Processing Methods and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
图形处理器流水线数据压缩技术研究综述;韩立敏等;《计算机应用研究》;20170802(第03期);全文 *

Also Published As

Publication number Publication date
CN110349243A (en) 2019-10-18

Similar Documents

Publication Publication Date Title
CN106406712B (en) Information display method and device
EP3627730A1 (en) Radio frequency interference processing method and electronic device
CN108595218B (en) Method and device for loading dynamic library of system
CN109067981B (en) Split screen application switching method and device, storage medium and electronic equipment
CN107390922B (en) Virtual touch method, device, storage medium and terminal
EP3916529A1 (en) Message sending method, and terminal device
CN108132790B (en) Method, apparatus and computer storage medium for detecting a garbage code
CN109062468B (en) Split screen display method and device, storage medium and electronic equipment
CN109948581B (en) Image-text rendering method, device, equipment and readable storage medium
WO2019024641A1 (en) Data synchronization method and apparatus, storage medium and electronic device
CN108984142B (en) Split screen display method and device, storage medium and electronic equipment
CN110349243B (en) Image processing method, device, electronic equipment and storage medium
CN110471870B (en) Multi-system operation method and device, electronic equipment and storage medium
US11989399B2 (en) Display method and electronic device
CN114710816A (en) Network switching method and device, electronic equipment and storage medium
CN109062469B (en) Split screen display method and device, storage medium and electronic equipment
CN106933576B (en) Terminal unlocking method and device and computer equipment
CN111930509A (en) Data processing method and device for intelligent glasses, storage medium and electronic equipment
CN112925654B (en) Picture decoding method, device, computer equipment and storage medium
CN112513803A (en) Electronic device for controlling display of virtual input interface in environment of multiple output screens and method of operating the same
CN115828845A (en) Multimedia data viewing method, device, medium and equipment
CN111464829B (en) Method, device and equipment for switching media data and storage medium
CN114596633A (en) Sitting posture detection method and terminal
CN112988338B (en) Application switching method and device, storage medium and electronic equipment
CN113890992A (en) Image processing method, image processing device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant