CN110365962B - Color gamut conversion processing method and device and electronic equipment - Google Patents

Color gamut conversion processing method and device and electronic equipment Download PDF

Info

Publication number
CN110365962B
CN110365962B CN201910647555.8A CN201910647555A CN110365962B CN 110365962 B CN110365962 B CN 110365962B CN 201910647555 A CN201910647555 A CN 201910647555A CN 110365962 B CN110365962 B CN 110365962B
Authority
CN
China
Prior art keywords
color gamut
picture
gamut conversion
resource occupation
occupation degree
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
CN201910647555.8A
Other languages
Chinese (zh)
Other versions
CN110365962A (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 CN201910647555.8A priority Critical patent/CN110365962B/en
Publication of CN110365962A publication Critical patent/CN110365962A/en
Application granted granted Critical
Publication of CN110365962B publication Critical patent/CN110365962B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/643Hue control means, e.g. flesh tone control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses a color gamut conversion processing method and device and electronic equipment. The method comprises the following steps: acquiring a picture to be subjected to color gamut conversion processing; detecting the resource occupation degree of the picture for color gamut conversion; if the resource occupation degree meets a first target condition, finishing color gamut conversion of the picture based on a GPU; and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU. By the method, the specific scheduling of the GPU or the scheduling of the CPU to complete the color gamut conversion processing can be flexibly determined based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, so that the flexibility of processing resource scheduling in the color gamut conversion process is improved.

Description

Color gamut conversion processing method and device and electronic equipment
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a color gamut conversion processing method and apparatus, and an electronic device.
Background
With the development of society, the application range of electronic devices with screens is continuously expanded. For example, images such as pictures and videos are displayed on the screen. And the related electronic devices cannot perform scheduling of processing resources well in the color gamut conversion process, which results in poor user experience.
Disclosure of Invention
In view of the above problems, the present application provides a color gamut conversion processing method, device and electronic device to improve the above problems.
In a first aspect, the present application provides a color gamut conversion processing method applied to an electronic device, the method including: acquiring a picture to be subjected to color gamut conversion processing; detecting the resource occupation degree of the picture for color gamut conversion; if the resource occupation degree meets a first target condition, finishing color gamut conversion of the picture based on a GPU; and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU.
In a second aspect, the present application provides a color gamut conversion processing apparatus, operable on an electronic device, the apparatus comprising: the picture acquisition unit is used for acquiring a picture to be subjected to color gamut conversion processing; the information acquisition unit is used for detecting the resource occupation degree of the picture for color gamut conversion; the processing unit is used for completing the color gamut conversion of the picture based on a GPU if the resource occupation degree meets a first target condition; and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU.
In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the methods described above.
In a fourth aspect, the present application provides a computer-readable storage medium having program code stored therein, wherein the method described above is performed when the program code is executed.
The application provides a color gamut conversion processing method, a color gamut conversion processing device and electronic equipment, which are characterized in that a picture to be subjected to color gamut conversion processing is obtained at first, then the resource occupation degree of the picture for color gamut conversion is detected, if the resource occupation degree meets a first target condition, the color gamut conversion of the picture is completed based on a GPU, and if the resource occupation degree meets a second target condition, the color gamut conversion of the picture is completed based on a CPU. By the method, the specific scheduling of the GPU or the scheduling of the CPU to complete the color gamut conversion processing can be flexibly determined based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, so that the flexibility of processing resource scheduling in the color gamut conversion process is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 illustrates an environment diagram of image processing proposed in an embodiment of the present application;
fig. 2 is a flowchart illustrating a color gamut conversion processing method proposed in an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a picture to be displayed in another color gamut conversion processing method proposed in an embodiment of the present application;
fig. 4 is a schematic diagram illustrating another to-be-displayed picture in another color gamut conversion processing method proposed in the embodiment of the present application;
fig. 5 is a flowchart illustrating a color gamut conversion processing method according to another embodiment of the present application;
fig. 6 is a schematic diagram illustrating a pure color region in a color gamut conversion processing method according to another embodiment of the present application;
fig. 7 is a schematic diagram illustrating a control in another color gamut conversion processing method according to another embodiment of the present application;
fig. 8 is a flowchart illustrating a color gamut conversion processing method according to still another embodiment of the present application;
fig. 9 is a block diagram showing a configuration of a gamut conversion processing apparatus according to an embodiment of the present application;
fig. 10 is a block diagram showing a structure of another gamut conversion processing apparatus according to another embodiment of the present application;
fig. 11 is a block diagram showing another color gamut conversion processing apparatus according to still another embodiment of the present application;
fig. 12 is a block diagram showing a configuration of an electronic device of the present application for executing a color gamut conversion processing method according to an embodiment of the present application;
fig. 13 is a storage unit for storing or carrying program codes for implementing an image processing method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
With the improvement of the hardware performance of the electronic device, more electronic devices can support the display of pictures with higher definition. However, the inventor has found in research that factors affecting the picture display effect include, in addition to the information of the picture itself, the degree of matching between the picture information and the screen on which the picture display is performed.
Take the color gamut space as an example. A color gamut, i.e. a color gamut space, is a method of encoding a color and also refers to the sum of colors that a technical system is capable of producing. In computer graphics processing, a color gamut is some complete subset of colors. The color gamut space may include an sRGB color gamut, an Adobe RGB color gamut, or a DCI-P3 color gamut. Among them, sRGB is one of the earliest color gamut standards and is supported by W3C, Exif, Intel, Pantone, Corel and many other industry vendors from the industry. The Adobe RGB gamut mainly improves the display on the cyan-green system, and therefore can cover approximately 50% of the CIE 1931XYZ color space. DCI-P3 is a color gamut applied to digital cinema, which is a color gamut standard that dominates the human visual experience and matches as closely as possible the full color gamut that can be exhibited in a movie scene. It is also not the broadest standard in color gamut (bt.2020 is the current latest standard), but has a broader red/green family range above the rec.709 standard.
However, the inventor finds that, when the color gamut space of the picture is inconsistent with the color gamut space of the screen, directly displaying the picture with the inconsistent color gamut space on the screen may cause a display effect that the picture is originally captured to be unable to be displayed. For example, when a picture corresponding to a wider color gamut space is displayed on a screen corresponding to a narrower color gamut space, the displayed picture may become more oversaturated. When a picture with a narrower color gamut space is displayed on a screen with a wider color gamut space, the displayed picture becomes more dim. Then, in order to improve the display effect problem caused by color gamut non-adaptation, the electronic device may convert the color gamut space of the picture so as to convert the picture into a color gamut space adapted to the screen. However, the inventors have further found that certain processing resources of the electronic device need to be consumed in the conversion process of the color gamut space. Therefore, the inventor proposes that the GPU or the CPU can be flexibly scheduled to complete the color gamut conversion processing based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, thereby improving the flexibility of processing resource scheduling in the color gamut conversion process.
The environment in which the embodiments of the present application operate is described below.
As shown in fig. 1, in the embodiment of the present application, a color gamut conversion process of a picture in an interface (e.g., activity) is performed in a Canvas (Canvas), and the picture to be subjected to the color gamut conversion is first subjected to a processing of a graphics processing function library (Skia) to obtain a corresponding bitmap, and then subjected to the color gamut conversion based on the bitmap. In the process of color gamut conversion, color gamut conversion processing may be performed based on a CPU or based on a GPU. Further, it is also possible to perform the gamut conversion processing on a partial area based on the CPU and perform the gamut conversion processing on another partial area based on the GPU.
The present disclosure will now be described with reference to specific embodiments.
Referring to fig. 2, a color gamut conversion processing method provided by the present application is applied to an electronic device, and the method includes:
step S110: and acquiring a picture to be subjected to color gamut conversion processing.
The picture to be subjected to the color gamut conversion processing is a picture to be displayed and needing the color gamut conversion.
As one mode, the picture to be displayed is a picture which is not displayed yet and is selected by the user. For example, as shown in fig. 3, icons of a plurality of pictures are displayed in the interface 99, and when it is detected that one of the icons is selected by the user, it is determined that the picture corresponding to the selected icon is the picture to be displayed. As one mode, after it is detected that one of the icons is touched by the user, it is determined that the touched icon is selected by the user. Alternatively, when an in-interface pressing operation acting on the display icon is detected, and an icon exists in an area divided by keeping the pressing operation moving for a certain distance, a picture corresponding to the icon in the area is used as a picture to be displayed. For example, as shown in fig. 4, a pressing operation of the user on the touch point 98 is detected, and the pressing operation is kept moving to the touch point 97, then 4 icons in an area surrounded by a dashed line frame in the figure are selected icons, and a picture corresponding to the selected icon is a picture to be displayed.
As another mode, the picture to be displayed is a picture showing a preview image and selected by the user to be enlarged for full-screen display.
After the color gamut space of the picture to be displayed is acquired, the color gamut space of the picture to be displayed is further compared with the color gamut space of the screen, and if the color gamut space of the picture to be displayed is inconsistent with the color gamut space of the screen, the picture to be displayed can be determined as the picture to be subjected to color gamut conversion processing.
There are various ways for an electronic device to obtain the color gamut space of a picture to be displayed.
In one embodiment, EXIF (exchangeable Image file) information of a picture is directly read, and a color gamut space of the picture is read from the EXIF information. The EXIF information is a format specifically set for digital photographs. Such a format can be used to record attribute information of digital photographs, such as the brand and model of a camera, the photographing time of a photograph, the size of an aperture set at the time of photographing, shutter speed, ISO, and the like, and color gamut space, and the like.
Alternatively, the color gamut space of the picture may be acquired directly based on the ICC profile file of the picture.
As still another way, the electronic device may generate EXIF information and an image information accompanying file when acquiring an image. In this file is stored information that the picture will subsequently be modified for re-editing, e.g. the gamut space or saturation of the picture, etc. And then carrying out hash operation on the acquired picture information to obtain a globally unique identifier, and inserting the identifier into the image information accompanying file. And the image information accompanying file is synchronized to the cloud end, so that when the acquired picture is displayed on other electronic equipment, even if the picture is edited again and the information in the EXIF information is not the information when the picture is initially acquired (for example, color gamut space changes due to color editing), other electronic equipment can acquire the image information accompanying file through the cloud end to find the information when the picture is initially acquired (for example, color gamut space), so that the display effect when the picture is acquired can be better recovered.
Further, as one way, a file may be configured in the system of the electronic device for storing the current color gamut space of the screen. In this way, the electronic device can acquire the color gamut space of the screen by reading the file.
Then, based on the foregoing manner, under the condition that the obtained color gamut space of the picture to be displayed is not consistent with the color gamut space of the application program where the picture to be displayed is located, or the obtained color gamut space of the picture to be displayed is not consistent with the color gamut space of the screen, the picture to be displayed is the picture to be subjected to the color gamut conversion processing. For example, if the color gamut space of the picture to be displayed is an sRGB color gamut (for example, the color gamut space described in the ICC profile file of the inquired picture is an sRGB color gamut), and the color gamut space of the application to which the picture to be displayed belongs is an Adobe RGB color gamut (where, the color gamut space of the application may be inquired by inquiring the configuration file of the application), when the sRGB color gamut and the Adobe RGB color gamut are different color gamut spaces, the picture to be displayed may be identified as the picture to be subjected to the color gamut conversion processing. Or, if the color gamut space of the picture to be displayed is the sRGB color gamut (for example, the color gamut space of the picture is obtained by the aforementioned companion file), and the color gamut space of the screen is the DCI-P3 color gamut, and if the sRGB color gamut is different from the DCI-P3 color gamut, the picture to be displayed can be identified as the picture to be subjected to the color gamut conversion processing.
Step S120: and detecting the resource occupation degree of the picture for color gamut conversion.
It is understood that the process of the electronic device performing the color gamut conversion process can be regarded as a process of data operation. This means that processing resources are consumed to perform data operations, and the more data that needs to be operated on, the more processing resources that need to be consumed. In order to facilitate subsequent processing resource allocation, the electronic device may first detect how much processing resources are consumed by the image to be subjected to color gamut conversion to complete color gamut conversion, that is, how much resources are occupied during the color gamut conversion.
As one mode, the step of detecting the resource occupation degree of the picture for color gamut conversion includes:
acquiring a characteristic parameter for representing the resource occupation degree of color gamut conversion, wherein the characteristic parameter is a parameter for representing the resource occupation degree of the picture, the larger the value of the characteristic parameter is, the larger the represented resource occupation degree is, and if the characteristic parameter is larger than a specified threshold value, judging that the resource occupation degree meets a first target condition; and if the characteristic parameter is not larger than a specified threshold value, judging that the resource occupation degree meets a second target condition.
Optionally, the characteristic parameter is a size of the picture, and the specified threshold is a specified size threshold. It should be noted that the size represents the size of the display area actually occupied by the picture, and to a certain extent, the larger the size, the larger the display area occupied by the picture is, which may also mean that the more the content included in the picture is, the more the portions that need to be subjected to color gamut conversion are. As a way, the resource occupation degrees of the color gamut conversion processing on the pictures with different sizes may be calculated in advance, and a mapping relationship between the resource occupation degrees and the picture sizes is established, so that after the electronic device acquires the picture to be subjected to the color gamut conversion processing, the electronic device may directly acquire the corresponding resource occupation degrees by searching the mapping relationship.
Optionally, the characteristic parameter may also be a resolution of the picture, and correspondingly, the specified threshold is a specified resolution threshold. It can be understood that the higher the resolution of the picture is, the clearer the picture is, the greater the resource occupation degree carried by the picture is, and the more processing resources are consumed in the process of performing the color gamut conversion processing.
It should be noted that even if the corresponding sizes are the same, the processing resources occupied by the pictures in the processing process may be different due to the compression ratio or resolution of the pictures. In this way, the electronic device may pre-establish a data table of a mapping relationship among the size, the resolution, and the resource occupation degree of the picture, and then, after obtaining the picture to be subjected to color gamut conversion, simultaneously query the size and the resolution to obtain the corresponding resource occupation degree required for color gamut conversion. And then comparing the corresponding resource occupation degree with the target resource occupation degree, and if the corresponding resource occupation degree is greater than the target resource occupation degree, representing that the GPU is required to perform color gamut conversion operation.
For example, as shown in the table:
size of Resolution ratio Degree of resource occupancy
a*b Aaa*bbb m%
c*d Ccc*ddd n%
In the above table, the field of size represents the size of the picture, the field of resolution represents the resolution of the picture, and the field of resource occupancy represents the resource occupancy that the picture needs to consume for performing the color gamut conversion. As one mode, the resource occupation degree can be represented by the utilization rate of the CPU. Then in this manner, the higher the CPU utilization, the higher the resource occupancy as characterized. For example, if it is recognized that the size of the picture to be subjected to the color gamut conversion processing is a × b and the resolution thereof is Aaa × bbb, the corresponding resource occupancy may be correspondingly obtained as m%, and then m% may be compared with the target resource occupancy to determine whether the color gamut conversion is performed by the CPU or the GPU.
It should be noted that the target resource occupancy level may be determined in various ways.
As one way, the target resource occupancy level may be set in a preconfigured way. Alternatively, the configuration may be dynamically configured according to the remaining amount of processing resources of the electronic device. Optionally, the remaining amount of the current processing resource of the electronic device is used as the target resource occupation degree. For example, taking the utilization rate of the CPU as an example, if the current utilization rate of the CPU is 95%, the remaining amount of the current processing resource of the corresponding electronic device is 5% of the utilization rate of the CPU. Then in this manner, the 5% CPU utilization may be taken as the target resource occupancy level. Then, when the resource occupation degree of the color gamut conversion of the obtained picture to be subjected to the color gamut conversion is lower than the CPU utilization rate of 5%, the color gamut conversion processing is performed through the CPU, so that the extra overhead used by calling the GPU is reduced, and the color gamut conversion processing of the picture can be completed under the condition that other performances of the electronic equipment are not influenced. And if the resource occupation degree of the color gamut conversion of the image subjected to the color gamut conversion is not lower than 5% of the CPU utilization rate, the color gamut conversion processing is completed based on the GPU.
Furthermore, it should be noted that, in a related manner, in order to ensure that there is sufficient CPU resources for data processing, the electronic device configures a buffer area, so that the usage rate of the CPU does not really reach 100%. Then in this way, the target resource occupation level is the processing resource remaining in the electronic device minus the processing resource corresponding to the corresponding buffer interval. For example, if the configured buffer interval is 3% of the CPU utilization, in this way, if the remaining amount of the current processing resource of the electronic device is 5% of the CPU utilization, the corresponding target resource occupation level is 2% of the CPU utilization by subtracting 3% of the CPU utilization from 5% of the CPU utilization.
Step S130: and if the resource occupation degree meets a first target condition, finishing the color gamut conversion of the picture based on the GPU.
Step S140: and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU.
It should be noted that the target condition in this embodiment represents the size of the resource occupation degree of the picture to be subjected to color gamut conversion, and if the resource occupation degree meets the first target condition, the resource occupation degree of the picture to be subjected to color gamut conversion is represented to be relatively large, so that in order to reduce the burden of the CPU to a certain extent and avoid excessively occupying the processing resources of the CPU to cause unsmooth electronic device, the picture to be subjected to color gamut conversion may be handed to the GPU to complete the color gamut conversion of the picture.
Correspondingly, if the resource occupation degree meets the second target condition, the resource occupation degree of the picture to be subjected to the color gamut conversion processing is represented to be relatively small, because even if the GPU is called, the CPU is required to be responsible for sending the control instruction to the GPU, which means that a certain amount of processing resources of the CPU are still consumed, under the condition that the resource occupation degree of the picture to be subjected to the color gamut conversion processing is relatively small, the color gamut conversion of the picture to be subjected to the color gamut conversion can be directly completed by the CPU, and the CPU resources consumed by calling the GPU are avoided.
It should be noted that, in the embodiment of the present application, the first target condition is not satisfied, and it may be understood that the second target condition is satisfied.
The application provides a color gamut conversion processing method, at first can acquire the picture that waits to carry out the color gamut conversion processing, then detect the resource occupation degree that the picture carries out the color gamut conversion, if the resource occupation degree satisfies first target condition, accomplish based on GPU the color gamut conversion of picture, if the resource occupation degree satisfies second target condition, accomplish based on CPU the color gamut conversion of picture. By the method, the specific scheduling of the GPU or the scheduling of the CPU to complete the color gamut conversion processing can be flexibly determined based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, so that the flexibility of processing resource scheduling in the color gamut conversion process is improved.
Referring to fig. 5, a color gamut conversion processing method provided by the present application is applied to an electronic device, and the method includes:
step S210: and acquiring a picture to be subjected to color gamut conversion processing.
Step S220: and detecting the resource occupation degree of the picture for color gamut conversion.
Step S230: and if the resource occupation degree meets a first target condition, identifying whether the picture to be subjected to the color gamut conversion processing stores a pre-calibrated pure color area.
It should be noted that the CPU and the GPU have respective advantages in the data processing process. Among them, the CPU is better at handling non-repetitive and complex operations, while the GPU is better at handling actions with high repetition. The inventors have found in their studies that, if the gamut conversion processing is performed for a pure color region, the same gamut conversion processing operation is performed over and over. For example, if the color values (RGB values) of each pixel of the picture are the same, after the color gamut space corresponding to a certain pixel is converted into the human parameters, the conversion of the color gamut spaces of other pixels is a repetitive operation. Then gamut conversion for the pure color regions is more suitable to be handed to the GPU for processing.
Furthermore, it actually needs to consume a certain time for identifying the color value of the pixel of the picture, and then, in order to improve the efficiency of identification, the color value of the pixel of the picture can be identified in advance. For example, the marking of the solid color regions may be performed as soon as the picture is downloaded locally or as it is captured. Furthermore, after the marking operation of the pure color area is performed, a coordinate system with a certain fixed point pixel of the picture as a (0, 0) point can be further established, and a mapping relation between the coordinates and the pixels is further established, so that the range of the pure color area is marked through the coordinates, and the electronic device can identify that the contents of the range are handed to the CPU for color gamut conversion processing, and the contents are handed to the GPU for color gamut conversion processing.
In this manner, the regions in which the same number of color values of the identified pixels exceeds the target number are the solid color regions. Optionally, the electronic device may divide a picture to be subjected to pure color region identification into a plurality of sub-regions in advance, and then identify whether there are pixels with the same color value and the number exceeding the target number in each sub-region, and if so, directly take the sub-regions with the pixel points with the same color value and the number exceeding the target number as the pure color regions. For example, as shown in fig. 6, a picture to be subjected to pure color region identification is divided into 6 regions, namely, a region a, a region B, a region C, a region D, a region E, and a region F. If the number of the targets is 5000, the areas B, C, and E can be identified as pure color areas when the numbers of the pixels having the same number of color values, which correspond to the areas a, B, C, D, E, and F in sequence, are 4000, 6000, 8000, 3000, 2000, and 6000.
As one way, after the calibration of the pure color region of the picture is completed, the calibrated pure color region may be stored through a configuration file of the picture. For example, a configuration file may be created to store the calibrated solid color regions. In this way, the electronic device can obtain all the pure color areas of the picture by reading the configuration file of the application program.
It should be noted that some applications may perform calibration of a pure color region of a picture by themselves, but a configuration file of some applications is only accessible by the application itself, and in such a case that the color gamut spaces corresponding to all content interfaces of the application are stored by the configuration file, the electronic device may not be able to effectively acquire the configured color gamut spaces of all content interfaces in the application. In this case, a common configuration file may be created in the electronic device that is accessible to third party applications other than the system program. The common configuration file may be used to store some non-confidential information, such as the developer of the application, the solid color area of the picture included in the application, the version number of the application, or the color gamut space configured by the application, etc. In this way, when it is detected that an application is installed, the installed application may actively store the developer of its own application, the solid color area of the included picture (the picture downloaded from the network or the picture captured by the call camera), the version number of the application, or the color gamut space configured by the application into the common configuration file. Of course, when storing, the identity of the application is also stored so that the application to which the information stored in the common configuration file belongs can be identified. Wherein, the identifier of the application program can be a package name.
Based on the above manner, when the electronic device needs to acquire a certain application program, the pure color regions of the pictures included in the application program can be acquired by querying the common configuration file, so that even when the electronic device cannot directly acquire the configuration file of the application program, the pure color regions of all the pictures in the application program can still be acquired.
It should be noted that the information stored in the common configuration file is not limited to the developer of the application program, the version number of the application program, or the color gamut space configured by the application program, etc. as mentioned in the foregoing exemplary description, but may also include more information. For example, it may also include the authority information that the application needs to acquire.
Optionally, whether to start writing the private configuration information of the application program into the public configuration file is globally specific to the electronic device. Or for a single application. In this manner for a single application. The electronic device may be provided with a configuration interface so that the user can control which applications write application private configuration information to the public configuration file and which applications do not write private configuration information to the public configuration file. And for which application programs write the private configuration information of the application programs into the public configuration file, the distinction can be made by establishing a list, wherein the application programs in the list need to write the private configuration information into the public configuration file.
For example, as shown in fig. 7, a plurality of applications and the state of the control corresponding to each application are displayed in the interface shown in fig. 7. It is to be understood that if the state of the control corresponding to the application is "off" as shown in the figure, it indicates that the application is removed or not added to the list, and if the state of the control corresponding to the application is "on" as shown in the figure, it indicates that the application is added to the list. For example, for an application named "application a," the state of its corresponding control is "on," which means that "application a" will be present in the aforementioned list. For an application named "application B," the state of its corresponding control is "off," which means that application "application B" does not exist in the aforementioned list. It will be appreciated that applications present in the list then characterise that gamut conversion is enabled when the interface is presented.
Therein, it is understood that the electronic device may establish a variable and then use the variable value to identify the state of the control. For example, if the variable value is 0, it indicates that the application program does not need to write the configuration information unique to the application program into the common configuration file, and if the variable value is 1, it indicates that the configuration information unique to the application program needs to be written into the common configuration file. Alternatively, the variable values may be stored in a pre-established data table. In this case, the electronic device may determine whether the private configuration information of the application needs to be written into the public configuration file by means of a table lookup.
In addition, after a certain application program is installed in the electronic device, the storage location of the corresponding configuration file is relatively fixed, and as another way, the variable value may also be stored in the configuration file of the corresponding application program. In this case, after detecting that an application is installed, and detecting that the installed application is set as a set application, the electronic device may search for a file in a txt format in a configuration folder of the application, add a variable to the searched file in the txt format, and use a value of the variable as the variable value. By the method, the state detection of the control can be realized by using the configuration file of the application program under the condition that the file is not newly added, and the state of the control corresponding to one application program can be well distinguished because the configuration file of the application program is used.
In this case, in order to avoid an influence on the original function of the configuration file, as one way, a variable may be added to the configuration file in an annotated manner. For example, for a txt format file, where the content is annotated with character bits starting with "//" or "/". Then in this case, in the case where the variable of the electronic device configuration is hqv, the content inserted into the txt file may be "// hqv ═ 1", that is, characterizing the on-gamut conversion.
It should be noted that, after some application programs are updated or reinstalled, their corresponding configuration files may be modified or replaced by other files. In this case, if it is detected that the set application program is updated or reinstalled, it may be detected whether a file in the previously selected txt format still exists, and if so, it may be further detected whether a previously inserted variable may be read out from the previously selected txt corresponding to the updated or reinstalled application program, and if the reading fails, the variable may be inserted again in the manner described above. And if detecting that the previously selected txt format file does not exist, reselecting the txt file.
The above will be described with reference to a specific application program.
If the electronic device detects that the application named as application a is installed, it further detects whether application a is configured as an application in the aforementioned list. If it is detected that the application a is configured as an application on the aforementioned list. The electronic device will further search for a txt formatted file in the folder storing the configuration file of application a. After any name is found to be tx.txt, a piece of data is inserted into the tx.txt, and the data content is "// hqv ═ 1" to represent that the application needs to write the configuration information private to the application into the public configuration file, then if the control corresponding to the application a is detected to be touched, the electronic device correspondingly modifies the originally inserted content to "// hqv ═ 0" to represent that the application a is switched to be unnecessary to write the configuration information private to the public configuration file.
Then, after detecting that the application a is updated or reinstalled, the electronic device detects whether there is a tx.txt file in the configuration file corresponding to the application a, and if so, further detects whether the content of "// hqv ═ 1" or "// hqv ═ 1" can be read from the tx.txt, and if so, the previous configuration is still valid, and if not, the electronic device inserts "// hqv ═ 1" into the tx.txt by default. And if the electronic equipment finds that the txt file cannot be found, the electronic equipment can reselect a txt file.
It should be noted that, for each file of the selected storage variable corresponding to each application program, the file may be stored in the electronic device in a data table manner, so that the electronic device may search the file. It should be noted that the above txt format file and the variable values are exemplary, and the application is not limited in particular. The electronic device can be specifically set according to the format file which can be found. For example, the variable values may also be stored using a file in xml format.
In this case, the electronic device may first detect which application currently running in the foreground is, and then further detect whether the application currently running in the foreground is in the list, and if so, determine that the electronic device is currently in the video playing state. As one mode, if the electronic device is an Android operating system, the name of the application program currently running in the foreground may be obtained by executing a getreporting tasks method of the ActivityManager. In addition, the electronic device may further acquire a list of programs used by the user through the usagetstatsmanager, and identify a most recently used application program recorded in the list as a current foreground application. Moreover, the Android can monitor the change of the focus of the window through the barrier-free function of the Android, and the package name corresponding to the focus window is taken as the application program which runs in the foreground at the present time.
Step S231: and if so, distributing the pure color area to the GPU to complete color gamut conversion.
Step S232: and allocating the areas except the pure color area in the picture to a CPU to complete color gamut conversion.
Step S233: and if not, completing the color gamut conversion of the picture based on the GPU.
It should be noted that, as a way to facilitate the consistency of the color gamut conversion process, steps S231 and S232 may be performed simultaneously without being sequential. In addition, the step sequence may also be adjusted according to the size of the pure color region, for example, if the pure color region is larger than the non-pure color region, step S231 may be executed first, and then step S232 is executed, and if the pure color region is smaller than the non-pure color region, step S232 may be executed first, and then step S231 is executed, so that the color gamut conversion processing of the pure color region and the non-pure color region can be completed synchronously.
Step S240: and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU.
According to the color gamut conversion processing method, the GPU or the CPU can be flexibly scheduled to complete the color gamut conversion processing based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, and therefore the flexibility of processing resource scheduling in the color gamut conversion process is improved. And under the condition that the target condition is met, whether a pure color region exists in the picture to be subjected to color gamut conversion processing can be further identified, and then the characteristics that the CPU is good at processing operations with high complexity and the GPU is good at processing operations with large processing capacity and high repeatability are utilized, the color gamut conversion operation of the pure color region is handed to the GPU for processing, and the color gamut conversion of the non-pure color region is still reserved for the CPU for processing, so that the flexibility of processing resource scheduling is further improved, the processing resources can be utilized to the maximum extent, and the effectiveness of resource utilization is improved.
Referring to fig. 8, a color gamut conversion processing method provided by the present application is applied to an electronic device, and the method includes:
step S310: and acquiring a picture to be subjected to color gamut conversion processing, wherein the picture is selected to be displayed in a full screen mode.
Step S320: and detecting the resource occupation degree of the picture for color gamut conversion.
Step S330: and if the resource occupation degree meets a first target condition, finishing the color gamut conversion of the picture based on the GPU.
Step S331: and acquiring the application program in the running state at present, and suspending the thread of the GPU which is called by the application program in the running state.
It is understood that if the picture is displayed in full screen, the content of the presentation for other applications is switched to the background. Thus, even if its corresponding thread invoking the GPU is suspended, the user experience is not affected.
As one mode, if the electronic device is an Android operating system, the name of the application program currently running in the foreground may be obtained by executing a getreporting tasks method of the ActivityManager. In addition, the electronic device may further acquire a list of programs used by the user through the usagetstatsmanager, and identify a most recently used application program recorded in the list as a current foreground application. Moreover, the Android can monitor the change of the focus of the window through the barrier-free function of the Android, and the package name corresponding to the focus window is taken as the application program which runs in the foreground at the present time.
Step S332: acquiring a target application program in the application programs in the running state; and reducing the CPU utilization rate of the target application program.
And as one mode, taking an application program with a priority lower than that of an application program for displaying the picture in a full screen mode as a target application program.
Step S340: and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU.
According to the color gamut conversion processing method, the GPU or the CPU can be flexibly scheduled to complete the color gamut conversion processing based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, and therefore the flexibility of processing resource scheduling in the color gamut conversion process is improved. And before the color gamut conversion processing, other threads which are not displayed on the foreground and call the GPU can be suspended, so that the color gamut conversion efficiency of the picture to be subjected to the color gamut conversion processing is further improved.
Referring to fig. 9, the present application provides a color gamut conversion processing apparatus 400, operating on an electronic device, where the apparatus 400 includes:
a picture obtaining unit 410, configured to obtain a picture to be subjected to color gamut conversion processing.
An information obtaining unit 420, configured to detect a resource occupation degree of the picture for color gamut conversion.
An information obtaining unit 420, configured to specifically obtain a feature parameter for representing a resource occupancy level for performing color gamut conversion, where the feature parameter is a parameter for representing the resource occupancy level of the picture, and a larger value of the feature parameter indicates a larger resource occupancy level; if the characteristic parameter is larger than a specified threshold value, judging that the resource occupation degree meets a first target condition; and if the characteristic parameter is not larger than a specified threshold value, judging that the resource occupation degree meets a second target condition. The characteristic parameter is the size of the picture, the specified threshold is a specified size threshold or the characteristic parameter is the resolution of the picture, and the specified threshold is a specified resolution threshold.
A processing unit 430, configured to complete color gamut conversion of the picture based on a GPU if the resource occupancy level meets a first target condition; and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on a CPU.
As one mode, as shown in fig. 10, the apparatus 400 further includes:
the picture identifying unit 440 is configured to identify whether the picture to be subjected to color gamut conversion stores a pre-calibrated pure color region. In this manner, the processing unit 430 is configured to assign the pure color regions to the GPU to perform color gamut conversion, if any; and allocating the areas except the pure color area in the picture to a CPU to complete color gamut conversion. If not, the processing unit 430 is configured to complete the color gamut conversion of the picture based on the GPU.
As one mode, as shown in fig. 11, the apparatus 400 further includes:
the application program management unit 450 is configured to, in a case that the picture is a picture selected for full-screen display, obtain an application program currently in an operating state if the resource occupation degree meets a first target condition;
and suspending the thread of the GPU which is called by the application program in the running state. The application program acquisition module is also used for acquiring a target application program in the application programs in the running state; and reducing the CPU utilization rate of the target application program. Optionally, the application management unit 450 is specifically configured to use an application with a priority lower than that of an application that displays the picture in a full screen as a target application.
An electronic device provided by the present application will be described below with reference to fig. 12.
Referring to fig. 12, based on the image processing method and apparatus, another electronic device 100 capable of executing the terminal control method is further provided in the embodiment of the present application. The electronic device 100 includes one or more processors 102 (only one shown), a memory 104, a network module 106, an image processing module 108, a camera 110, and a screen 112 that support image display based on multiple color gamut spaces, coupled to each other. The memory 104 stores programs that can execute the content of the foregoing embodiments, and the processor 102 can execute the programs stored in the memory 104.
Processor 102 may include one or more processing cores, among other things. The processor 102 interfaces with various components throughout the electronic device 100 using various interfaces and circuitry to perform various functions of the electronic device 100 and process data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 104 and invoking data stored in the memory 104. Alternatively, the processor 102 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 102 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing display content; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 102, but may be implemented by a communication chip.
The Memory 104 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, code sets, or instruction sets. The memory 104 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like. The storage data area may also store data created by the terminal 100 in use, such as a phonebook, audio-video data, chat log data, and the like.
The network module 106 is configured to receive and transmit electromagnetic waves, and achieve interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as a wireless access point. The network module 106 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The network module 106 may communicate with various networks, such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network.
The image processing module 108 may be used to encode images captured by the camera 110 or decode data requested by the network module 106 from the network for transmission to the screen 112 for display. But also for converting the gamut space of the picture. Specifically, the image processing module 108 may be a GPU, a dedicated DSP, an FPGA, an ASIC chip, or the like.
Referring to fig. 13, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable medium 800 has stored therein a program code that can be called by a processor to execute the method described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from or written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
To sum up, the method, the device and the electronic device for color gamut conversion processing provided by the application firstly acquire a picture to be subjected to color gamut conversion processing, then detect the resource occupation degree of the picture for color gamut conversion, if the resource occupation degree meets a first target condition, finish the color gamut conversion of the picture based on the GPU, if the resource occupation degree meets a second target condition, finish the color gamut conversion of the picture based on the CPU. By the method, the specific scheduling of the GPU or the scheduling of the CPU to complete the color gamut conversion processing can be flexibly determined based on the resource occupation degree of the picture to be subjected to the color gamut conversion processing in the color gamut conversion process, so that the flexibility of processing resource scheduling in the color gamut conversion process is improved.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (5)

1. A color gamut conversion processing method applied to an electronic device, the method comprising:
acquiring a picture to be subjected to color gamut conversion processing;
acquiring a characteristic parameter for representing the resource occupation degree of color gamut conversion, wherein the characteristic parameter is a parameter for representing the resource occupation degree of the picture, and the larger the value of the characteristic parameter is, the larger the represented resource occupation degree is;
if the characteristic parameter is larger than a specified threshold value, judging that the resource occupation degree meets a first target condition;
if the characteristic parameter is not larger than a specified threshold value, judging that the resource occupation degree meets a second target condition;
if the resource occupation degree meets a first target condition, identifying whether the picture to be subjected to color gamut conversion processing stores a pre-calibrated pure color area;
if yes, the pure color area is distributed to a GPU to complete color gamut conversion;
distributing the areas except the pure color area in the picture to a CPU to complete color gamut conversion;
and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on the CPU.
2. The method of claim 1, wherein the characteristic parameter is a size of the picture, the specified threshold is a specified size threshold or the characteristic parameter is a resolution of the picture, and the specified threshold is a specified resolution threshold.
3. A color gamut conversion processing apparatus that is operable in an electronic device, the apparatus comprising:
the picture acquisition unit is used for acquiring a picture to be subjected to color gamut conversion processing;
the information acquisition unit is used for acquiring a characteristic parameter for representing the resource occupation degree of the image for color gamut conversion, wherein the characteristic parameter is a parameter for representing the resource occupation degree of the image, and the larger the value of the characteristic parameter is, the larger the represented resource occupation degree is; if the characteristic parameter is larger than a specified threshold value, judging that the resource occupation degree meets a first target condition; if the characteristic parameter is not larger than a specified threshold value, judging that the resource occupation degree meets a second target condition;
the processing unit is used for identifying whether the picture to be subjected to the color gamut conversion processing stores a pre-calibrated pure color area or not if the resource occupation degree meets a first target condition; if yes, the pure color area is distributed to a GPU to complete color gamut conversion; distributing the areas except the pure color area in the picture to a CPU to complete color gamut conversion; and if the resource occupation degree meets a second target condition, finishing the color gamut conversion of the picture based on the CPU.
4. An electronic device comprising one or more processors, a video codec, and a memory;
one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-2.
5. A computer-readable storage medium, having a program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-2.
CN201910647555.8A 2019-07-17 2019-07-17 Color gamut conversion processing method and device and electronic equipment Active CN110365962B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910647555.8A CN110365962B (en) 2019-07-17 2019-07-17 Color gamut conversion processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910647555.8A CN110365962B (en) 2019-07-17 2019-07-17 Color gamut conversion processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110365962A CN110365962A (en) 2019-10-22
CN110365962B true CN110365962B (en) 2021-08-17

Family

ID=68221149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910647555.8A Active CN110365962B (en) 2019-07-17 2019-07-17 Color gamut conversion processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110365962B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328824B (en) * 2020-07-21 2024-06-18 北京沃东天骏信息技术有限公司 Picture detection method and system, computer system and computer readable medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289782A (en) * 2010-06-18 2011-12-21 索尼公司 Information processing apparatus, and method and program for controlling information processing apparatus
CN103870148A (en) * 2012-12-18 2014-06-18 中兴通讯股份有限公司 Mobile terminal and method for displaying interface thereof
CN104980752A (en) * 2015-06-11 2015-10-14 武汉大千信息技术有限公司 Method for realizing multipath self-adaptive parallel transcoding through CPU and GPU and system thereof
CN105120293A (en) * 2015-08-26 2015-12-02 中国航空工业集团公司洛阳电光设备研究所 Image cooperative decoding method and apparatus based on CPU and GPU
CN106258011A (en) * 2014-04-30 2016-12-28 高通股份有限公司 For reducing, the CPU/GPU DCVS of the power consumption during graphic frame processes is collaborative to be optimized
CN109379628A (en) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 Method for processing video frequency, device, electronic equipment and computer-readable medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289782A (en) * 2010-06-18 2011-12-21 索尼公司 Information processing apparatus, and method and program for controlling information processing apparatus
CN103870148A (en) * 2012-12-18 2014-06-18 中兴通讯股份有限公司 Mobile terminal and method for displaying interface thereof
CN106258011A (en) * 2014-04-30 2016-12-28 高通股份有限公司 For reducing, the CPU/GPU DCVS of the power consumption during graphic frame processes is collaborative to be optimized
CN104980752A (en) * 2015-06-11 2015-10-14 武汉大千信息技术有限公司 Method for realizing multipath self-adaptive parallel transcoding through CPU and GPU and system thereof
CN105120293A (en) * 2015-08-26 2015-12-02 中国航空工业集团公司洛阳电光设备研究所 Image cooperative decoding method and apparatus based on CPU and GPU
CN109379628A (en) * 2018-11-27 2019-02-22 Oppo广东移动通信有限公司 Method for processing video frequency, device, electronic equipment and computer-readable medium

Also Published As

Publication number Publication date
CN110365962A (en) 2019-10-22

Similar Documents

Publication Publication Date Title
CN110377391B (en) Picture display method and device, mobile terminal and storage medium
CN108737482B (en) Document sharing method, device and system
US11810529B2 (en) Screen color gamut control method, electronic device and storage medium
CN110446062B (en) Receiving processing method for big data file transmission, electronic device and storage medium
US20220139296A1 (en) Image information processing method, electronic device and storage medium
JP7169449B2 (en) Video enhancement control method, device, electronic device and storage medium
CN105279006B (en) Screen capture method and terminal based on Android system
JP2022509191A (en) Video decoding control methods, devices, electronic devices and storage media
CN106453572A (en) Method and system for synchronizing images based on cloud server
US10418000B2 (en) Method and apparatus for screen capture on a display device
CN113766120A (en) Shooting mode switching method and electronic equipment
CN111083496A (en) Data processing method and related product
CN110569008A (en) screen data processing method and device and electronic equipment
US8971647B2 (en) Image compression apparatus, image compression method, and storage medium
CN110377773B (en) Picture processing method and device, mobile terminal and storage medium
CN114816308B (en) Information partition display method and related equipment
CN110365962B (en) Color gamut conversion processing method and device and electronic equipment
CN113038141B (en) Video frame processing method and electronic equipment
US10079959B2 (en) Creating image data for a tile on an image
CN110378973B (en) Image information processing method and device and electronic equipment
JP2012060459A (en) Image processing apparatus, image processing method, program, and recording medium
CN110941413B (en) Display screen generation method and related device
CN109309839B (en) Data processing method and device, electronic equipment and storage medium
CN110362188B (en) Picture processing method and device, mobile terminal and storage medium
CN114724522A (en) Method and device for adjusting backlight brightness of display device, display device and 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