CN110786007A - Method and apparatus for processing image data - Google Patents
Method and apparatus for processing image data Download PDFInfo
- Publication number
- CN110786007A CN110786007A CN201880038962.2A CN201880038962A CN110786007A CN 110786007 A CN110786007 A CN 110786007A CN 201880038962 A CN201880038962 A CN 201880038962A CN 110786007 A CN110786007 A CN 110786007A
- Authority
- CN
- China
- Prior art keywords
- data
- color space
- pixel data
- components
- pixel
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000012545 processing Methods 0.000 title claims abstract description 21
- 238000006243 chemical reaction Methods 0.000 claims abstract description 55
- 238000013507 mapping Methods 0.000 claims description 17
- 238000007667 floating Methods 0.000 claims description 10
- 238000004364 calculation method Methods 0.000 description 28
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000003384 imaging method Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N1/00—Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
- H04N1/46—Colour picture communication systems
- H04N1/56—Processing of colour picture signals
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Color Image Communication Systems (AREA)
- Processing Of Color Television Signals (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
A method and apparatus for processing image data are provided. The method of processing image data includes: acquiring first pixel data of a first color space; decomposing the first pixel data into a first part of data and a second part of data, wherein the first part of data is high-K bit data or low-K bit data in the first pixel data, and the second part of data is the rest data except the first part of data in the first pixel data; converting the first part of data from a first color space to a second color space to obtain an intermediate result; determining difference data between the second pixel data and the intermediate result according to the second part of data; second pixel data is determined based on the intermediate result and the difference data. When color space conversion is carried out on pixel data with a certain bit width, color space conversion modes of pixel data with other bit widths can be multiplexed, so that the expense for carrying out color space conversion on pixel data with different bit widths is reduced.
Description
Copyright declaration
The disclosure of this patent document contains material which is subject to copyright protection. The copyright is owned by the copyright owner. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the patent and trademark office official records and records.
Technical Field
The present application relates to the field of image processing, and more particularly, to a method and apparatus for processing image data.
Background
In the conventional technology, due to different requirements, different pixel data may be required for each module, and the pixel data of different color spaces (or color space models) often need to be converted into each other.
There are typically many different bit widths of pixel data in the same color space. When color space conversion is performed on pixel data with different bit widths, a special conversion mode is generally required to be set for the pixel data with each bit width in the conventional technology, and the cost is high.
Disclosure of Invention
The application provides a method and a device for processing image data, which are used for reducing the cost of performing color space conversion on pixel data with different bit widths.
In a first aspect, a method of processing image data is provided, comprising: acquiring first pixel data, wherein the first pixel data is pixel data of a first color space; decomposing the first pixel data into a first part of data and a second part of data, wherein the first part of data is high-K bit data or low-K bit data in the first pixel data, the second part of data is residual data except the first part of data in the first pixel data, K is a positive integer, and K is less than the bit width of the first pixel data; converting the first part of data from a first color space to a second color space to obtain an intermediate result; determining difference data indicating a difference between second pixel data and the intermediate result according to the second partial data, wherein the second pixel data is corresponding data of the first pixel data in the second color space; determining the second pixel data according to the intermediate result and the difference data.
In a second aspect, there is provided an apparatus for processing image data, comprising: a data interface for acquiring first pixel data, wherein the first pixel data is pixel data of a first color space; the conversion module is used for decomposing the first pixel data into a first part of data and a second part of data, wherein the first part of data is high-K bit data or low-K bit data in the first pixel data, the second part of data is residual data except the first part of data in the first pixel data, K is a positive integer, and K is smaller than the bit width of the first pixel data; the computing module is used for converting the first part of data from a first color space to a second color space to obtain an intermediate result; determining difference data indicating a difference between second pixel data and the intermediate result according to the second partial data, wherein the second pixel data is corresponding data of the first pixel data in the second color space; determining the second pixel data according to the intermediate result and the difference data.
When pixel data with a certain bit width is calculated, the technical scheme multiplexes calculation modes of pixel data with other bit widths, so that the overhead of performing color space conversion on the pixel data with different bit widths is reduced.
Drawings
Fig. 1 is an exemplary diagram of a scene requiring color space conversion of pixel data.
Fig. 2 is a diagram illustrating an example of the calculation process of 8bit-YUV2RGB conversion.
Fig. 3 is a schematic flowchart of a method for processing image data according to an embodiment of the present application.
Fig. 4 is a diagram of an example of a calculation process for multiplexing 10bit-YUV2RGB conversion and 8bit-YUV2RGB conversion according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an apparatus for processing image data according to an embodiment of the present application.
Detailed Description
Fig. 1 illustrates an exemplary scenario requiring color space conversion of pixel data. The imaging device 12 in fig. 1 may be, for example, an Image Signal Processor (ISP) of a camera. The imaging device 12 can perform image acquisition and convert the acquired signal into pixel data of a YUV color space and output the pixel data of the YUV color space to the video signal processing apparatus 14.
The video signal processing device 14 typically pre-processes the received pixel data in YUV color space using a pre-processing module. The YUV2RGB module 142 is a basic and important preprocessing module, and is mainly used for converting pixel data in a YUV color space into pixel data in an RGB color space.
For ease of understanding, a possible implementation of YUV2RGB is given below by taking pixel data of 8bit-YUV420 as an example.
For 8bit-YUV420, a group of UV can be shared by two rows and two columns in the RGB image, and 4 pixel points are shared in total. As shown in FIG. 2, the 4 pixels (i.e., RGB) can be calculated by first using a pair of UV components
mn,RGB
m(n+1),RGB
(m+1)n,RGB
(m+1)(n+1)) Sharing 3 color components ruv, guv and buv, simultaneously calculating R, G, B components of the 4 pixel points according to the 4Y components, and finally converting the 8bit-YUV pixel data into 8bit-RGB pixel data.
Specifically, the pixel data of the RGB color space can be calculated using the following equations (1) and (2):
y-16 is more than or equal to 0, CY, CVR, CUG, CVG and CUB are conversion parameters for converting floating point numbers into fixed point numbers, and the setting of the conversion parameters can be different in different standards, specifically referring to the traditional technology. SHIFT is the fractional bit width of a floating-point number configured according to fix-point. Wherein, the symbol<<Represents a left shift; > represents a right move. Adding an arithmetic operation to equation (1)
Can realize
Rounding off the results of (a); the addition of the arithmetic operation "> SHIFT" in equation (2) can be omitted
The fractional part of the result of the calculation of (a).
The above describes the conversion from 8bit-YUV420 to 8bit-RGB, but the bit widths of the pixel data output by the imaging devices 12 of different specifications may be different. For example, the imaging device 12 may output 8bit-YUV420, 8bit-YUV422, 10bit-YUV420, or 10bit-YUV422 pixel data. For pixel data with different bit widths, when color space conversion is performed, a special conversion mode is generally required to be set for each bit width of pixel data in the conventional technology, and the overhead is high.
With reference to fig. 3, a method for processing image data according to an embodiment of the present application is provided to reduce overhead when performing color space conversion on pixel data with different bit widths.
The method of fig. 3 may be performed by any type of device that requires color-space conversion of pixel data, such as the video signal processing device 14 of fig. 1.
As shown in fig. 3, the method of fig. 3 may include steps S31 through S35, which are described in detail below.
In step S31, first pixel data is acquired. The first pixel data may be pixel data of a first color space. The embodiment of the application aims to convert first pixel data from a first color space to a second color space to obtain second pixel data. The embodiment of the present application does not specifically limit the types of the first color space and the second color space. For example, the first color space is a YUV color space, and the second color space is an RGB color space; as another example, the first color space is an RGB color space and the second color space is a YUV color space.
In step S32, the first pixel data is decomposed into first partial data and second partial data. The first partial data may be high K-bit data or low K-bit data in the first pixel data. The second portion of data may be remaining data of the first pixel data except for the first portion of data. Wherein K is a positive integer and is less than the bit width of the first pixel data.
For example, assuming that the first pixel data is pixel data in the 10bit-YUV420 format, the bit width (or bit width of each component) of the first pixel data is 10 bits. The pixel data having a bit width of 10 bits may be decomposed into first partial data and second partial data, via step S32. For example: the first part of data may be composed of upper 8 bits of data in pixel data with a bit width of 10 bits, and the second part of data may be composed of lower 2 bits of data in pixel data with a bit width of 10 bits. Or, the first part of data may be composed of lower 8-bit data in pixel data with a bit width of 10 bits, and the second part of data may be composed of upper 2-bit data in pixel data with a bit width of 10 bits.
In step S33, the first portion of data is converted from the first color space to the second color space, resulting in an intermediate result. Step S33 regards the first part of data in the first pixel data as pixel data with bit width K to directly perform color space conversion, so that a color space conversion manner of pixel data with bit width K can be multiplexed, for example, in an embodiment, because the first part of data is composed of high 8-bit data in pixel data with 10 bits, a method of converting color space into 8-bit-RGB by multiplexing 8-bit-YUV 420 can be performed.
Taking the first part of data as pixel data in YUV color space as an example, the intermediate result may be corresponding data of the first part of data in RGB color space. Similarly, taking the first part of data as pixel data in RGB color space as an example, the intermediate result may be corresponding data of the first part of data in YUV color space. The intermediate results may include intermediate results corresponding to respective components in the first color space. For example, if the first color space is a YUV color space, the intermediate result may include intermediate results corresponding to a Y component, a U component, and a V component.
In step S34, difference data (or compensation value) is determined according to the second portion of data.
The intermediate result obtained in step S33 is different from the second pixel data obtained by directly subjecting the first pixel data to the color space, and the value of the difference data is related to the second partial data. Therefore, the embodiment of the present application calculates the difference data according to the second partial data.
The difference data may be calculated according to the second portion of data in various ways, and may be calculated online according to a formula, or a mapping relationship between the second portion of data and the difference data may be stored in advance (for example, a lookup table for indicating a mapping relationship between the second portion of data and the difference data is stored in advance), and in actual calculation, the difference data may be obtained by querying the mapping relationship.
The implementation mode of pre-storing the mapping relation can improve the calculation efficiency, and the occupation amount of the data calculation process on the storage space can be reduced according to the on-line calculation mode of the formula. These two implementations will be described in detail below with reference to specific embodiments, which will not be described in detail herein.
The disparity data may include disparity data corresponding to respective components in the first color space. For example, if the first color space is a YUV color space, the disparity data may include disparity data corresponding to a Y component, a U component, and a V component.
In step S35, second pixel data is determined based on the intermediate result and the difference data. For example, the intermediate result may be added to the difference data to obtain the second pixel data. Alternatively, the intermediate result and the difference data may be added, and the addition result may be shifted according to the requirement of spotting to obtain the second pixel data.
When the pixel data with the higher bit-width ratio K is subjected to color space conversion, the pixel data is decomposed into first partial data and second partial data, the first partial data multiplexes a color space conversion mode of the pixel data with the bit width of K, and the second partial data compensates an intermediate result obtained by converting the first partial data, so that the second pixel data calculated by the embodiment of the application is the same as a second pixel data result obtained by directly performing color space conversion on the first pixel data. Therefore, when color space conversion is performed on pixel data with a certain bit width, the embodiment of the application can multiplex color space conversion modes of pixel data with other bit widths, and reduce the overhead when color space conversion is performed on pixel data with different bit widths.
In some scenarios (such as the scenario shown in fig. 1), it is necessary to perform color space conversion on pixel data using hardware circuitry. For hardware design, processing pixel data with different bit widths generally requires designing computing units with different bit widths to meet computing requirements. For example, for pixel data of 8bit-YUV and 10bit-YUV, two independent computing units can be designed, one is specially used for converting the pixel data of 8bit-YUV into pixel data of 8bit-RGB, and the other is specially used for converting the pixel data of 10bit-YUV into pixel data of 10 bit-RGB. The above implementation consumes excessive computing resources of the hardware.
The method of fig. 3 can be applied to such a scenario that a hardware circuit is required to perform color space conversion, so as to reduce the consumption of hardware resources when pixel data with different bit widths are subjected to color space conversion. For example, a calculation unit (or hardware circuit) dedicated to converting pixel data having a bit width of K from the first color space to the second color space may be provided. When pixel data with the bit width of K needs to be converted from the first color space to the second color space, the conversion can be realized by directly utilizing the computing unit. When the first pixel data with the bit width larger than K needs to be converted from the first color space to the second color space, the computing unit may be used to directly convert the high-K bit or low-K bit pixel data in the first pixel data from the first color space to the second color space, and compensate the computing result of the computing unit by using the remaining data. Therefore, when the pixel data with the bit width larger than K is subjected to color space conversion, the computing unit with the bit width of K can be multiplexed, and therefore hardware resources can be saved.
The following takes a hardware circuit in which 10bit-YUV420 multiplexes 8bit-YUV420 as an example, and a manner of converting pixel data of 10bit-YUV420 from a YUV color space to an RGB color space is exemplified in detail.
As shown in fig. 4, the conversion process of the pixel data of 10bit-YUV420 is substantially the same as the calculation process of 8bit-YUV2RGB described in fig. 2, except that the UV component of the pixel data needs to be split into upper 8 bits of data U according to the following formula (3)
hAnd V
hAnd low 2bit data U
lAnd V
l。
Next, U may be utilized based on equation (4)
hAnd V
hThe calculation results in an intermediate result ruv corresponding to the UV component
h、guv
h、buv
h。
U
lAnd V
lThe difference data ruv corresponding to the UV component can be calculated according to equation (5)
add、guv
add、buv
add. Alternatively, the difference data ruv corresponding to the UV component may be obtained by pre-calculation or online table lookup
add、guv
add、buv
add。
Ruv can then be expressed according to equation (6)
h、guv
h、buv
hAnd ruv
add、guv
add、buv
addThe addition results are obtained as calculation results ruv, guv, buv of 10bit UV component.
The calculation of Y is similar, and the Y can be firstly split into high 8-bit data Y according to the formula (7)
hAnd low 2bit data Y
l. Intermediate result Y corresponding to Y component
hThe difference data Y corresponding to the Y component can be calculated according to the formula (8)
addCan be calculated according to equation (9).
y
h=(CY×(Y
h-16)) (8)
y
add=Y
l*CY (9)
Finally, the intermediate result Y corresponding to the Y component can be obtained by using the formula (10)
hData of the difference y
addAnd ruv, guv, buv are added to obtain 10bit-RGB pixel data:
compared with the calculation method of 8bit-YUV2RGB shown in FIG. 2, the calculation method of 10bit-YUV2RGB is basically the same, except that the difference data y is used
add、ruv
add、guv
add、buv
addAnd compensating an intermediate result obtained by calculating the high 8-bit data. The manner of calculation of the difference data has been given by equation (5) and equation (9). It can be proved that the calculation result obtained by the above calculation process is consistent with the result of directly calculating the 10bit-YUV 420. Therefore, when 10-bit YUV pixel data is calculated, the embodiment of the application can multiplex an 8-bit YUV2RGB hardware circuit and obtain a consistent calculation result, thereby saving hardware resources.
In this embodiment, the pixel data with the first pixel data being 10bit-YUV420 is taken as an example for explanation, actually, the first pixel data may also be pixel data with bit widths of 11bit and 12bit, and the format of the first pixel data may also be YUV422 or YUV 444. In addition, in this embodiment, the example is described in which the hardware circuit for multiplexing the upper 8-bit data of the first pixel data performs direct conversion and the lower 2-bit data compensates the conversion result of the upper 8-bit data, but actually, the hardware circuit for multiplexing the lower 8-bit data of the first pixel data may perform direct conversion and the upper 2-bit data compensates the conversion result of the upper 8-bit data. The hardware circuit multiplexing 8-bit YUV2RGB of the above embodiment is an example, and may also be a hardware circuit multiplexing 6-bit/10-bit/11-bit/12-bit YUV2RGB, which is determined according to the design and the requirement of the hardware circuit.
Method embodiments of the present application are described in detail above in conjunction with fig. 1-4, and apparatus embodiments of the present application are described in detail below in conjunction with fig. 5. It is to be understood that the description of the method embodiments corresponds to the description of the apparatus embodiments, and therefore reference may be made to the preceding method embodiments for parts not described in detail.
As shown in fig. 5, an embodiment of the present application provides an apparatus 50 for processing image data. The apparatus 50 may include a data interface 52, a conversion module 54, and a calculation module 56. These interfaces and modules may be in the form of software, hardware, or a combination of software and hardware, which is not limited in this application. In certain embodiments, conversion module 54 and/or calculation module 56 may be a processor. The device 50 may be, for example, the video signal processing device 14 shown in fig. 1.
The data interface 52 may be used to obtain first pixel data, wherein the first pixel data is pixel data of a first color space.
For example, the first color space is a YUV color space, and the second color space is an RGB color space; as another example, the first color space is an RGB color space and the second color space is a YUV color space.
The conversion module 54 may be used to decompose the first pixel data into a first portion of data and a second portion of data. The first part of data is high-K bit data or low-K bit data in the first pixel data, and the second part of data is the rest data except the first part of data in the first pixel data, wherein K is a positive integer and is less than the bit width of the first pixel data.
For example, assuming that the first pixel data is pixel data in the 10bit-YUV420 format, the bit width (or bit width of each component) of the first pixel data is 10 bits. The pixel data with a bit width of 10 bits can be decomposed into a first part of data and a second part of data by the conversion module 54. For example: the first part of data may be composed of upper 8 bits of data in pixel data with a bit width of 10 bits, and the second part of data may be composed of lower 2 bits of data in pixel data with a bit width of 10 bits. Or, the first part of data may be composed of lower 8-bit data in pixel data with a bit width of 10 bits, and the second part of data may be composed of upper 2-bit data in pixel data with a bit width of 10 bits.
The calculation module 56 may be configured to convert the first portion of data from the first color space to the second color space, resulting in an intermediate result; based on the second partial data, difference data is determined, the difference data being indicative of a difference of the second pixel data and the intermediate result. The second pixel data is corresponding data of the first pixel data in a second color space; second pixel data is determined based on the intermediate result and the difference data.
The difference data may be calculated according to the second portion of data in various ways, and may be calculated online according to a formula, or a mapping relationship between the second portion of data and the difference data may be stored in advance (for example, a lookup table for indicating a mapping relationship between the second portion of data and the difference data is stored in advance), and in actual calculation, the difference data may be obtained by querying the mapping relationship. The mapping relationship may be recorded in a pre-established lookup table.
The implementation mode of pre-storing the mapping relation can improve the calculation efficiency, and the occupation amount of the data calculation process on the storage space can be reduced according to the on-line calculation mode of the formula. These two implementations will be described in detail below with reference to specific embodiments, which will not be described in detail herein.
The disparity data may include disparity data corresponding to respective components in the first color space. For example, if the first color space is a YUV color space, the disparity data may include disparity data corresponding to a Y component, a U component, and a V component.
Optionally, the calculation module 56 may be configured to look up a pre-established mapping relationship according to the second partial data to determine the difference data. The mapping relationship may be used to indicate a correspondence of the second portion of data to the difference data.
Alternatively, the conversion module 54 may be a hardware circuit dedicated to converting pixel data having a bit width of K from the first color space to the second color space.
Optionally, the first pixel data is pixel data with a format of YUV420 and a bit width of N, the first pixel data includes a set of UV components and a plurality of Y components sharing the set of UV components, the first part of data includes high K-bit data of the set of UV components and the plurality of Y components, the second part of data includes low N-K-bit data of the set of UV components and the plurality of Y components; or, the first part of data comprises a group of UV components and low-K data of a plurality of Y components, and the second part of data comprises a group of UV components and high-N-K data of a plurality of Y components, wherein N is a positive integer larger than K.
Optionally, the first portion of data includes upper 8 bits of data U of a set of UV components
h、V
hThe second part of data comprises a group of low 2 bits data U of UV component
l、V
lIntermediate results include U
hAnd V
hCorresponding intermediate result ruv
h、guv
hAnd buv
hThe difference data includes U
lAnd V
lCorresponding difference data ruv
add、guv
addAnd buv
add,ruv
h、guv
hAnd buv
hThe following formula is satisfied:
ruv
add、guv
addand buv
addThe following formula is satisfied:
the CVR, the CUG, the CVG and the CUB are conversion parameters for converting floating point numbers into fixed point numbers, and the SHIFT represents the decimal bit width of the floating point numbers.
Optionally, the first portion of data comprises a plurality of upper 8 bits of data Y of Y component
hAnd lower 2-bit data Y of a plurality of Y components
lIntermediate results include Y
hCorresponding intermediate result y
hThe difference data includes Y
lCorresponding difference data y
add,y
hThe following formula is satisfied:
y
h=CY×(Y
h-16)
y
addthe following formula is satisfied:
y
add=Y
l*CY
where CY is a conversion parameter for converting a floating point number to a fixed point number.
Optionally, component R, G, B of the second pixel data satisfies the following equation:
optionally, the bit width of the first pixel data is N, where N is a positive integer greater than K, and the conversion module 54 may be specifically configured to shift each component in the first pixel data to the right by N-K bits to obtain a first part of data; the difference between the first pixel data and the first partial data is determined as a second partial data.
Optionally, the conversion module 54 may be specifically configured to perform a bitwise and operation on each component of the first pixel data and the target data to obtain a second portion of data, where a high K bit of the target data is 0 and a low N-K bit thereof is 1.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware or any other combination. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a Digital Video Disk (DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (22)
1. A method of processing image data, comprising:
acquiring first pixel data, wherein the first pixel data is pixel data of a first color space;
decomposing the first pixel data into a first part of data and a second part of data, wherein the first part of data is high-K bit data or low-K bit data in the first pixel data, the second part of data is residual data except the first part of data in the first pixel data, K is a positive integer, and K is less than the bit width of the first pixel data;
converting the first part of data from a first color space to a second color space to obtain an intermediate result;
determining difference data indicating a difference between second pixel data and the intermediate result according to the second partial data, wherein the second pixel data is corresponding data of the first pixel data in the second color space;
determining the second pixel data according to the intermediate result and the difference data.
2. The method of claim 1, wherein determining difference data from the second portion of data comprises:
and searching a pre-established mapping relation according to the second part of data to determine the difference data, wherein the mapping relation is used for indicating the corresponding relation between the second part of data and the difference data.
3. The method of claim 2, wherein the mapping relationship is recorded in a pre-established lookup table.
4. The method of any of claims 1-3, wherein converting the first portion of data from a first color space to a second color space comprises:
converting the first portion of data from the first color space to the second color space using hardware circuitry, the hardware circuitry being circuitry dedicated to converting pixel data having a bit width K from the first color space to the second color space.
5. The method according to any of claims 1-4, wherein the first color space is a YUV color space and the second color space is an RGB color space; or, the first color space is an RGB color space, and the second color space is a YUV color space.
6. The method of claim 5, wherein the first pixel data is pixel data with a bit width of N and a format of YUV420, the first pixel data comprises a set of UV components and a plurality of Y components sharing the set of UV components, the first portion of data comprises high-K bit data of the set of UV components and the plurality of Y components, the second portion of data comprises low-N-K bit data of the set of UV components and the plurality of Y components; or, the first part of data includes the group of UV components and the low K bits of the plurality of Y components, and the second part of data includes the group of UV components and the high N-K bits of the plurality of Y components, where N is a positive integer greater than K.
7. The method of claim 6, wherein the first portion of data comprises an upper 8bit data U of the set of UV components
h、V
hThe second part of data includes lower 2 bits of data U of the group of UV components
l、V
lSaid intermediate result includes U
hAnd V
hCorresponding intermediate result ruv
h、guv
hAnd buv
hSaid difference data comprises U
lAnd V
lCorresponding difference data ruv
add、guv
addAnd buv
add,ruv
h、guv
hAnd buv
hThe following formula is satisfied:
ruv
add、guv
addand buv
addThe following formula is satisfied:
the CVR, the CUG, the CVG and the CUB are conversion parameters for converting floating point numbers into fixed point numbers, and the SHIFT represents the decimal bit width of the floating point numbers.
8. The method of claim 7, wherein the first portion of data comprises an upper 8 bits of data Y of the plurality of Y components
hAnd lower 2-bit data Y of the plurality of Y components
lSaid intermediate result comprising Y
hCorresponding intermediate result y
hSaid difference data comprising Y
lCorresponding difference data y
add,y
hThe following formula is satisfied:
y
h=CY×(Y
h-16)
y
addthe following formula is satisfied:
y
add=Y
l*CY
where CY is a conversion parameter for converting a floating point number to a fixed point number.
10. the method of any of claims 1-9, wherein the first pixel data has a bit width of N, where N is a positive integer greater than K,
the decomposing the first pixel data into a first part data and a second part data includes:
shifting each component in the first pixel data to the right by N-K bits to obtain the first part of data;
determining a difference between the first pixel data and the first partial data as the second partial data.
11. The method of claim 10, wherein determining the difference between the first pixel data and the first portion of data as the second portion of data comprises:
and carrying out bitwise AND operation on each component of the first pixel data and target data to obtain the second part of data, wherein the high K bit of the target data is 0, and the low N-K bit of the target data is 1.
12. An apparatus for processing image data, comprising:
a data interface for acquiring first pixel data, wherein the first pixel data is pixel data of a first color space;
the conversion module is used for decomposing the first pixel data into a first part of data and a second part of data, wherein the first part of data is high-K bit data or low-K bit data in the first pixel data, the second part of data is residual data except the first part of data in the first pixel data, K is a positive integer, and K is smaller than the bit width of the first pixel data;
the computing module is used for converting the first part of data from a first color space to a second color space to obtain an intermediate result; determining difference data indicating a difference between second pixel data and the intermediate result according to the second partial data, wherein the second pixel data is corresponding data of the first pixel data in the second color space; determining the second pixel data according to the intermediate result and the difference data.
13. The apparatus of claim 12, wherein the computing module is configured to look up a pre-established mapping relationship according to the second portion of data to determine the difference data, wherein the mapping relationship is used to indicate a corresponding relationship between the second portion of data and the difference data.
14. The apparatus of claim 13, wherein the mapping relationship is recorded in a pre-established lookup table.
15. The apparatus according to any of claims 12-14, wherein the conversion module is a hardware circuit dedicated to converting pixel data having a bit width K from a first color space to a second color space.
16. The apparatus according to any of claims 12-15, wherein the first color space is a YUV color space and the second color space is a RGB color space; or, the first color space is an RGB color space, and the second color space is a YUV color space.
17. The apparatus according to claim 16, wherein the first pixel data is pixel data having a bit width of N and a format of YUV420, the first pixel data comprises a set of UV components and a plurality of Y components sharing the set of UV components, the first portion of data comprises high K-bit data of the set of UV components and the plurality of Y components, the second portion of data comprises low N-K-bit data of the set of UV components and the plurality of Y components; or, the first part of data includes the group of UV components and the low K bits of the plurality of Y components, and the second part of data includes the group of UV components and the high N-K bits of the plurality of Y components, where N is a positive integer greater than K.
18. The apparatus of claim 17, wherein the first portion of data comprises an upper 8 bits of data U for the set of UV components
h、V
hThe second part of data includes lower 2 bits of data U of the group of UV components
l、V
lSaid intermediate result includes U
hAnd V
hCorresponding intermediate result ruv
h、guv
hAnd buv
hSaid difference data comprises U
lAnd V
lCorresponding difference data ruv
add、guv
addAnd buv
add,ruv
h、guv
hAnd buv
hThe following formula is satisfied:
ruv
add、guv
addand buv
addThe following formula is satisfied:
the CVR, the CUG, the CVG and the CUB are conversion parameters for converting floating point numbers into fixed point numbers, and the SHIFT represents the decimal bit width of the floating point numbers.
19. The apparatus of claim 18, wherein the first portion of data comprises an upper 8 bits of data Y of the plurality of Y components
hAnd lower 2-bit data Y of the plurality of Y components
lSaid intermediate result comprising Y
hCorresponding intermediate result y
hSaid difference data comprising Y
lCorresponding difference data y
add,y
hThe following formula is satisfied:
y
h=CY×(Y
h-16)
y
addthe following formula is satisfied:
y
add=Y
l*CY
where CY is a conversion parameter for converting a floating point number to a fixed point number.
21. the apparatus according to any one of claims 12 to 20, wherein the bit width of the first pixel data is N, where N is a positive integer greater than K, and the conversion module is specifically configured to shift each component in the first pixel data by N-K bits to the right to obtain the first partial data; determining a difference between the first pixel data and the first partial data as the second partial data.
22. The apparatus of claim 21, wherein the conversion module is specifically configured to perform a bitwise and operation on each component of the first pixel data and target data to obtain the second partial data, wherein a high K bit of the target data is 0, and a low N-K bit thereof is 1.
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2018/113133 WO2020087377A1 (en) | 2018-10-31 | 2018-10-31 | Method and device for processing image data |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN110786007A true CN110786007A (en) | 2020-02-11 |
Family
ID=69383058
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201880038962.2A Pending CN110786007A (en) | 2018-10-31 | 2018-10-31 | Method and apparatus for processing image data |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110786007A (en) |
| WO (1) | WO2020087377A1 (en) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1581280A (en) * | 2003-08-03 | 2005-02-16 | 瑞昱半导体股份有限公司 | Color conversion device and method thereof |
| CN103907345A (en) * | 2011-11-01 | 2014-07-02 | 歌乐株式会社 | Image processing device, image pickup apparatus, and storage medium storing image processing program |
| CN106973277A (en) * | 2017-03-22 | 2017-07-21 | 深信服科技股份有限公司 | A kind of rgb format image turns the method and device of YUV420 forms |
| US20170280029A1 (en) * | 2016-03-23 | 2017-09-28 | Karl Storz Imaging, Inc. | Image transformation and display for fluorescent and visible imaging |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5708481A (en) * | 1996-07-31 | 1998-01-13 | Chrontel, Inc. | Fast current-mode analog circuit for converting video data signals between color space formats |
| CN1106118C (en) * | 1998-09-29 | 2003-04-16 | 华邦电子股份有限公司 | Color space signal conversion device and method |
| CN102280096B (en) * | 2011-07-15 | 2013-09-18 | 杭州米加科技有限公司 | Method for combining image scaling and color space switching |
-
2018
- 2018-10-31 WO PCT/CN2018/113133 patent/WO2020087377A1/en not_active Ceased
- 2018-10-31 CN CN201880038962.2A patent/CN110786007A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1581280A (en) * | 2003-08-03 | 2005-02-16 | 瑞昱半导体股份有限公司 | Color conversion device and method thereof |
| CN103907345A (en) * | 2011-11-01 | 2014-07-02 | 歌乐株式会社 | Image processing device, image pickup apparatus, and storage medium storing image processing program |
| US20170280029A1 (en) * | 2016-03-23 | 2017-09-28 | Karl Storz Imaging, Inc. | Image transformation and display for fluorescent and visible imaging |
| CN106973277A (en) * | 2017-03-22 | 2017-07-21 | 深信服科技股份有限公司 | A kind of rgb format image turns the method and device of YUV420 forms |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2020087377A1 (en) | 2020-05-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR102033229B1 (en) | Pixel preprocessing and encoding | |
| CN107836118B (en) | Method, apparatus and computer readable storage medium for pixel preprocessing and encoding | |
| JP5736389B2 (en) | Multi-channel signal transmission and detection in reduced channel format | |
| JP4156631B2 (en) | Image processing method and image processing apparatus | |
| CN101990095B (en) | Method and apparatus for generating compressed file, camera module associated therewith, and terminal including the same | |
| US8224103B2 (en) | Image encoding method and device, image decoding method and device, and imaging device | |
| US20110032984A1 (en) | Methods circuits and systems for transmission of video | |
| JP3976353B2 (en) | Digital camera | |
| US9030568B2 (en) | Data processing apparatuses, data processing method, program, and camera system | |
| JP2011130402A (en) | Image encoding method, image decoding method, and device | |
| US20160133232A1 (en) | Image processing method and display apparatus | |
| US20110199520A1 (en) | Image processing apparatus and image processing method | |
| US12282842B2 (en) | Neural network processing apparatus, neural network processing method, and neural network processing program | |
| US7826111B2 (en) | Color conversion method using a colors look-up table | |
| WO2008010023A1 (en) | A method for gamma correction and a device having gamma correction capabilities | |
| CN110769211A (en) | Image raster data transmission and storage method | |
| US8565542B2 (en) | Data processing apparatus and data processing method | |
| CN110786007A (en) | Method and apparatus for processing image data | |
| CN111738950A (en) | Image processing method and device | |
| KR20240142440A (en) | How to limit the effects of quantization in the color gamut correction process applied to video content | |
| US8665486B2 (en) | Look-up table for transfer function | |
| US8630488B2 (en) | Creating a duotone color effect using an ICC profile | |
| US8576246B2 (en) | Image processing method and device | |
| US20080252655A1 (en) | Techniques for efficient dithering | |
| CN115379219B (en) | Image compression method and device |
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 | ||
| AD01 | Patent right deemed abandoned | ||
| AD01 | Patent right deemed abandoned |
Effective date of abandoning: 20220311 |