CN105208363B - Method to trembling the compensation of tone integral quantization in color space conversion - Google Patents
Method to trembling the compensation of tone integral quantization in color space conversion Download PDFInfo
- Publication number
- CN105208363B CN105208363B CN201510596097.1A CN201510596097A CN105208363B CN 105208363 B CN105208363 B CN 105208363B CN 201510596097 A CN201510596097 A CN 201510596097A CN 105208363 B CN105208363 B CN 105208363B
- Authority
- CN
- China
- Prior art keywords
- pixel
- pixel value
- quantizing
- calculation procedure
- row
- 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
Links
Landscapes
- Image Processing (AREA)
- Color Image Communication Systems (AREA)
Abstract
This application discloses a kind of method to trembling the compensation of tone integral quantization in color space conversion, including:Pixel conversion step, the initial data that form is YUV is obtained by video decoding process, the initial data is converted into the RGB888 color formats with 24bit pixel values when mobile terminal renders;First quantizing pixel value calculation procedure, calculate the quantizing pixel value for each pixel of RGB565 color formats being converted to;Quantization error value calculation procedure, calculate the quantization error value of line n pixel;Compensated pixel value calculation procedure, the RGB888 pixel values of the quantization error value being calculated each pixel corresponding with (n+1) row are summed, are compensated pixel value;Second quantizing pixel value calculation procedure, the quantizing pixel value of each pixel of (n+1) row is calculated;Quantify RGB565 obtaining steps, by iterative calculation, complete the calculating of quantizing pixel value corresponding to each pixel of all rows, the RGB565 color formats after being quantified;Image display step, rendering module carry out image to the RGB565 color formats after quantization and shown.
Description
Technical field
The application is related to technical field of image processing, specifically, is related to a kind of to trembling color adjustment in color space conversion
Quantify the method for compensation.
Background technology
In the prior art, simulation changes into RGB, form R-8bit, G-8bit, B- in the image that data signal exports
8bit, and mobile system can also support R-5bit at present, G-6bit, B-5bit, be advantageous in that with 565 this forms each
Pixel is converted to 16bit by 24bit before, reduces data volume, saves the occupancy of many bandwidth, improves the effect of transmission
Rate, but the image exported after quantifying is made due to sheet of diplopia occurs when the quantization of data precision is lost and causes to continuously display
It is ineffective into what is shown.
RGB color format need to be converted to that is, the yuv format of mobile terminal broadcast decoder output at present, during display, due to
RGB888 or RGB8888 occupied bandwidths are higher, and data volume is larger, typically carry out rendering display using RGB565 color formats, this
When need color quantizing, but quantify data volume can be caused to reduce, loss of significance can be brought, occur diplopia when causing continuously to render,
Influence viewing quality.
The content of the invention
In view of this, technical problems to be solved in this application there is provided a kind of to trembling color adjustment in color space conversion
The method that loss of significance caused by quantization compensates, solve mobile system in the prior art and use RGB565 color format amounts
Change the problem of output image is unintelligible, and display effect is bad, the defects of being caused to quantization of the invention is compensated so that video
Image clearly is shown.
In order to solve the above-mentioned technical problem, the application has following technical scheme:
The present invention provides a kind of method to trembling the compensation of tone integral quantization in color space conversion, including:
Pixel conversion step:The initial data that form is YUV is obtained by video decoding process, should when mobile terminal renders
Initial data is converted to the RGB888 color formats with 24bit pixel values;
First quantizing pixel value calculation procedure:Calculate and each pixel of n-th (n=1,2,3 ..., n) rows is converted into RGB565 face
The quantizing pixel value of each pixel after color form;
Quantization error value calculation procedure:The original pixel value of each pixel of n-th (n=1,2,3 ..., n) rows is calculated with quantifying picture
The difference of element value, obtains quantization error value, and the compensation as (n+1) row pixel value refers to;
Compensated pixel value calculation procedure:By the quantization error value being calculated each pixel corresponding with (n+1) row
RGB888 pixel values are summed, and are compensated pixel value;
Second quantizing pixel value calculation procedure:By the clamped operation of compensated pixel value after the compensation of (n+1) row to 0~255
Between, and the compensated pixel value newly obtained is quantified, obtain the quantizing pixel value of each pixel of (n+1) row;
Quantify RGB565 obtaining steps:Iteration carries out the quantization error calculation procedure, the compensated pixel value calculates step
Rapid and described second quantizing pixel value calculation procedure, the calculating until completing quantizing pixel value corresponding to all each pixels of row,
RGB565 color formats after being quantified;
Image display step:Rendering module carries out image to the RGB565 color formats after quantization and shown.
Preferably, wherein, the first quantizing pixel value calculation procedure is further:
Pass through formula:Rn'=Rn>>3
Gn'=Gn>>2
Bn'=Bn>>3 each pixels of calculating n-th (n=1,2,3 ..., n) rows are converted to RGB565 color formats
The quantizing pixel value of each pixel afterwards;
In formula, RnGnBnRepresent the original pixel value corresponding to each pixel of line n RGB888 color formats, Rn'Gn'
Bn' represent quantizing pixel value corresponding to each pixel of line n RGB565 color formats, symbol>>Represent and carry out pixel value to the right
Shifting function.
Preferably, wherein, the quantization error value calculation procedure is further:
Pass through formula:ΔRn=Rn-Rn'
ΔGn=Gn-Gn'
ΔBn=Bn-Bn' calculate original pixel value and the quantization of each pixel of n-th (n=1,2,3 ..., n) rows
The difference of pixel value, obtains quantization error value, and the compensation as (n+1) row pixel value refers to;
In formula, Δ RnΔGnΔBnFor quantization error value, RnGnBnRepresent each pixel pair of line n RGB888 color formats
The original pixel value answered, Rn'Gn'Bn' represent quantizing pixel value corresponding to each pixel of line n RGB565 color formats.
Preferably, wherein, the second quantizing pixel value calculation procedure is further:
Pass through formula:RRn+1=clip (Rn+1+ΔRn,0,255)
GGn+1=clip (Gn+1+ΔGn,0,255)
BBn+1=clip (Bn+1+ΔBn, 0,255) by (n+1) row compensation after the clamped behaviour of compensated pixel value
Between accomplishing 0~255,
And pass through formula:Rn+1'=RRn+1>>3
Gn+1'=GGn+1>>2
Bn+1'=BBn+1>>3 are quantified the compensated pixel value newly obtained, and it is each to obtain (n+1) row
The quantizing pixel value of pixel;
In formula, RRn+1GGn+1BBn+1Represent respectively by the clamped operation of compensated pixel value after the compensation of (n+1) row to 0~
The compensated pixel value obtained after between 255, Rn+1'Gn+1'Bn+1' the quantization of each pixel of after quantization (n+1) row is represented respectively
Pixel value.
Compared with prior art, method and system described herein, following effect has been reached:
First, method of the present invention to trembling the compensation of tone integral quantization in color space conversion, by being shown to mobile system
Video file video artefacts caused by quantizing process compensate, solve mobile system and use RGB565 color formats
The problem of display effect is bad, the display effect of approximate RGB888 color formats is realized by compensation so that mobile system regards
The display of frequency image becomes apparent from.
Second, the present invention is simple and easy to the method that the compensation of tone integral quantization is trembled in color space conversion, computation complexity
It is low, easily the video display defect of mobile system can be compensated, make the better image of its output display.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, forms the part of the application, this Shen
Schematic description and description please is used to explain the application, does not form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is a kind of method flow diagram to trembling the compensation of tone integral quantization in color space conversion of the present invention.
Embodiment
Some vocabulary has such as been used to censure specific components among specification and claim.Those skilled in the art should
It is understood that hardware manufacturer may call same component with different nouns.This specification and claims are not with name
The difference of title is used as the mode for distinguishing component, but is used as the criterion of differentiation with the difference of component functionally.Such as logical
The "comprising" of piece specification and claim mentioned in is an open language, therefore should be construed to " include but do not limit
In "." substantially " refer in receivable error range, those skilled in the art can be described within a certain error range solution
Technical problem, basically reach the technique effect.In addition, " coupling " one word is herein comprising any direct and indirect electric property coupling
Means.Therefore, if the first device of described in the text one is coupled to a second device, representing the first device can directly electrical coupling
The second device is connected to, or the second device is electrically coupled to indirectly by other devices or coupling means.Specification
Subsequent descriptions for implement the application better embodiment, so it is described description be for the purpose of the rule for illustrating the application,
It is not limited to scope of the present application.The protection domain of the application is worked as to be defined depending on appended claims institute defender.
Shown in Figure 1 is a kind of herein described tool to trembling the method for tone integral quantization compensation in color space conversion
Body embodiment, method comprises the following steps described in the present embodiment:
Step 101, pixel conversion step:The initial data that form is YUV, mobile terminal wash with watercolours are obtained by video decoding process
The initial data is converted into the RGB888 color formats with 24bit pixel values during dye;
Step 102, the first quantizing pixel value calculation procedure:Calculate and be converted to each pixel of n-th (n=1,2,3 ..., n) rows
The quantizing pixel value of each pixel after RGB565 color formats;
Step 103, quantization error value calculation procedure:Calculate the original pixel value of each pixel of n-th (n=1,2,3 ..., n) rows
With the difference of quantizing pixel value, quantization error value is obtained, the compensation as (n+1) row pixel value refers to;
Step 104, compensated pixel value calculation procedure:The quantization error value being calculated is corresponding with (n+1) row each
The RGB888 pixel values summation of pixel, is compensated pixel value;
Step 105, the second quantizing pixel value calculation procedure:By the clamped operation of compensated pixel value after the compensation of (n+1) row
Quantified between 0~255, and by the compensated pixel value newly obtained, obtain the quantizing pixel value of each pixel of (n+1) row;
Step 106, quantify RGB565 obtaining steps:Iteration carries out the quantization error calculation procedure, the compensation pixel
It is worth calculation procedure and the second quantizing pixel value calculation procedure, until completing quantizing pixel value corresponding to all each pixels of row
Calculating, the RGB565 color formats after being quantified;
Step 107, image display step:Rendering module carries out image to the RGB565 color formats after quantization and shown.
In step 102, the first quantizing pixel value calculation procedure is further:
Pass through formula (1):Rn'=Rn>>3
Gn'=Gn>>2
Bn'=Bn>>3 each pixels of calculating n-th (n=1,2,3 ..., n) rows are converted to RGB565 color lattice
The quantizing pixel value of each pixel after formula;In formula, RnGnBnCorresponding to each pixel for representing line n RGB888 color formats
Original pixel value, Rn'Gn'Bn' represent quantizing pixel value corresponding to each pixel of line n RGB565 color formats, symbol>>Represent
Pixel value is subjected to right shift operation, such as>>3 represent to move right 3, such as pixel value is 188, is represented in binary as
10111100, move right and be changed into 10111 after 3, the decimal system is changed into 23.
In above-mentioned steps 103, the quantization error value calculation procedure is further:
Pass through formula (2):ΔRn=Rn-Rn'
ΔGn=Gn-Gn'
ΔBn=Bn-Bn' calculate the original pixel value and amount of each pixel of n-th (n=1,2,3 ..., n) rows
Change the difference of pixel value, obtain quantization error value, the compensation as (n+1) row pixel value refers to;In formula, Δ RnΔGnΔ
BnFor quantization error value, RnGnBnRepresent the original pixel value corresponding to each pixel of line n RGB888 color formats, Rn'Gn'
Bn' represent quantizing pixel value corresponding to each pixel of line n RGB565 color formats.
In step 105, the second quantizing pixel value calculation procedure is further:
Pass through formula (3):RRn+1=clip (Rn+1+ΔRn,0,255)
GGn+1=clip (Gn+1+ΔGn,0,255)
BBn+1=clip (Bn+1+ΔBn,0,255)
By the clamped operation of compensated pixel value after the compensation of (n+1) row between 0~255,
And pass through formula (4):Rn+1'=RRn+1>>3
Gn+1'=GGn+1>>2
Bn+1'=BBn+1>>3 are quantified the compensated pixel value newly obtained, obtain (n+1) OK
The quantizing pixel value of each pixel;
In formula, RRn+1GGn+1BBn+1Represent respectively by the clamped operation of compensated pixel value after the compensation of (n+1) row to 0~
The compensated pixel value obtained after between 255, Rn+1'Gn+1'Bn+1' the quantization of each pixel of after quantization (n+1) row is represented respectively
Pixel value.
In step 105, clamped operation is specially:The value that concrete operations obtain then is arranged to 0 if less than 0;If it exceeds
255, then it is arranged to 255;Initial value is then taken in the range of 0~255.
Below by taking the illustrated embodiment of table 1 as an example, the present invention will be further described.
Table 1
As shown in table 1, R1, G1, B1 represent the first row pixel, and Rn, Gn, Bn represent line n pixel value, wherein being all
Each pixel value of 8bit, wherein the first row does not tremble color processing, trembles color algorithm and is proceeded by from the second row, all rows afterwards all by
Step is iterated using the result of lastrow.
First row element is handled according to formula (1) (2), wherein RnGnBnOriginal RGB888 colors lattice corresponding to expression
The pixel of formula, Rn'Gn'Bn' be expressed as quantify after RGB565 color formats respective pixel values, Δ RnΔGnΔBnRepresent each picture
Element and the difference after quantization, i.e. quantization error value, the difference of each pixel is preserved, i.e., often quantified corresponding to row pixel
Error amount is all cached.
For the second row element, according to formula (3), the respective pixel using the quantization error value that lastrow obtains to the row
Color compensating is carried out, is asked using the pixel value of the quantization error value that the first row obtains RGB888 color formats corresponding with the second row
With so as to be compensated pixel value.New retrieved image will be obtained between the clamped operation of pixel after the compensation of second row to 0~255
Element value, and the compensated pixel value newly obtained is quantified, so as to obtain the quantizing pixel value of each pixel of the second row.
Iteration carries out step 103~step 105, trembles color algorithm until all row respective pixels and completes.
Finally transfer to rendering module to carry out image the RGB565 color formats after quantization again to show.
It is R-8bit, G-8bit, B- that rgb format in the image of data signal output is changed into for the simulation in background technology
8bit, and mobile system can also support R-5bit at present, G-6bit, B-5bit, be advantageous in that often with this forms of RGB565
Individual pixel saves the occupancy for into 16bit, saving many bandwidth, improves the efficiency of transmission, but the image exported after quantifying is unclear
It is clear, it is very empty, cause to show it is ineffective the problem of.The image of the invention to caused by quantization by the above method, which is shown, to be lacked
It is trapped into and has gone compensation so that the image of mobile system output becomes apparent from.
By various embodiments above, beneficial effect existing for the application is:
First, method of the present invention to trembling the compensation of tone integral quantization in color space conversion, by being shown to mobile system
Video file video artefacts caused by quantizing process compensate, solve mobile system and use RGB565 color formats
The problem of display effect is bad, the display effect of approximate RGB888 color formats is realized by compensation so that mobile system regards
The display of frequency image becomes apparent from.
Second, the present invention is simple and easy to the method that the compensation of tone integral quantization is trembled in color space conversion, computation complexity
It is low, easily the video display defect of mobile system can be compensated, make the better image of its output display.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, apparatus or computer program
Product.Therefore, the application can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the application can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
Some preferred embodiments of the application have shown and described in described above, but as previously described, it should be understood that the application
Be not limited to form disclosed herein, be not to be taken as the exclusion to other embodiment, and available for various other combinations,
Modification and environment, and above-mentioned teaching or the technology or knowledge of association area can be passed through in the scope of the invention is set forth herein
It is modified., then all should be in this Shen and the change and change that those skilled in the art are carried out do not depart from spirit and scope
Please be in the protection domain of appended claims.
Claims (1)
- A kind of 1. method to trembling the compensation of tone integral quantization in color space conversion, it is characterised in that including:Pixel conversion step:The initial data that form is YUV is obtained by video decoding process, it is when mobile terminal renders that this is original Data are converted to the RGB888 color formats with 24bit pixel values;First quantizing pixel value calculation procedure:Calculate and each pixel of n-th (n=1,2,3 ..., n) rows is converted into RGB565 color lattice The quantizing pixel value of each pixel after formula;The first quantizing pixel value calculation procedure is further:Pass through formula:After each pixel of calculating n-th (n=1,2,3 ..., n) rows is converted to RGB565 color formats The quantizing pixel value of each pixel;In formula, RnGnBnRepresent the original pixel value corresponding to each pixel of line n RGB888 color formats, Rn'Gn'Bn' table Show quantizing pixel value corresponding to each pixel of line n RGB565 color formats, symbol>>Represent and pixel value is subjected to right shift Operation;Quantization error value calculation procedure:Calculate the original pixel value and quantizing pixel value of each pixel of n-th (n=1,2,3 ..., n) rows Difference, obtain quantization error value, as (n+1) row pixel value compensation refer to;Compensated pixel value calculation procedure:By the RGB888 of the quantization error value being calculated each pixel corresponding with (n+1) row Pixel value is summed, and is compensated pixel value;Second quantizing pixel value calculation procedure:By the clamped operation of compensated pixel value after the compensation of (n+1) row between 0~255, And quantified the compensated pixel value newly obtained, obtain the quantizing pixel value of each pixel of (n+1) row;Quantify RGB565 obtaining steps:Iteration carry out the quantization error calculation procedure, the compensated pixel value calculation procedure with And the second quantizing pixel value calculation procedure, the calculating until completing quantizing pixel value corresponding to all each pixels of row, obtain RGB565 color formats after quantization;The second quantizing pixel value calculation procedure is further:Pass through formula:It is clamped to operate between 0~255, be specially:When obtained compensated pixel value is less than 0, then 0 is arranged to;Obtained compensation Pixel value is then arranged to 255 more than 255;When obtained compensated pixel value is in the range of 0~255, then initial value is taken;And pass through formula:The compensated pixel value newly obtained is quantified, obtains each pixel of (n+1) row Quantizing pixel value;In formula, RRn+1GGn+1BBn+1Represent the clamped operation of compensated pixel value after the compensation of (n+1) row to 0~255 respectively Between after obtained compensated pixel value, Rn+1'Gn+1'Bn+1' the quantization picture of each pixel of after quantization (n+1) row is represented respectively Element value;Image display step:Rendering module carries out image to the RGB565 color formats after quantization and shown;Wherein, the quantization error value calculation procedure is further:Pass through formula:Calculate the original pixel value and quantizing pixel of each pixel of n-th (n=1,2,3 ..., n) rows The difference of value, obtains quantization error value, and the compensation as (n+1) row pixel value refers to;In formula, Δ RnΔGnΔBnFor quantization error value, RnGnBnCorresponding to each pixel for representing line n RGB888 color formats Original pixel value, Rn'Gn'Bn' represent quantizing pixel value corresponding to each pixel of line n RGB565 color formats.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510596097.1A CN105208363B (en) | 2015-09-17 | 2015-09-17 | Method to trembling the compensation of tone integral quantization in color space conversion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510596097.1A CN105208363B (en) | 2015-09-17 | 2015-09-17 | Method to trembling the compensation of tone integral quantization in color space conversion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105208363A CN105208363A (en) | 2015-12-30 |
CN105208363B true CN105208363B (en) | 2018-02-09 |
Family
ID=54955759
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510596097.1A Active CN105208363B (en) | 2015-09-17 | 2015-09-17 | Method to trembling the compensation of tone integral quantization in color space conversion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105208363B (en) |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1262947B1 (en) * | 2001-06-01 | 2013-10-09 | Thomson Licensing | Method and apparatus for processing video picture data for a display device |
EP1619651A1 (en) * | 2004-07-23 | 2006-01-25 | Deutsche Thomson-Brandt Gmbh | Method and device for processing video data by combining error diffusion and dithering |
KR100713530B1 (en) * | 2006-04-25 | 2007-05-02 | 삼성전자주식회사 | Apparatus and method for processing a image for preventing lower in a image quality on conveting a image bitmap format |
CN104036746A (en) * | 2014-06-10 | 2014-09-10 | 深圳市长江力伟股份有限公司 | Method for image debounce of LCOS |
-
2015
- 2015-09-17 CN CN201510596097.1A patent/CN105208363B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN105208363A (en) | 2015-12-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107836118B (en) | Method, apparatus and computer readable storage medium for pixel pre-processing and encoding | |
JP6516851B2 (en) | Pixel pre-processing and encoding | |
AU2016212243B2 (en) | A method and apparatus of encoding and decoding a color picture | |
RU2710873C2 (en) | Method and device for colour image decoding | |
US20050237316A1 (en) | Image processing method for a TFT LCD | |
CN108235037B (en) | Encoding and decoding image data | |
CN108352076B (en) | Encoding and decoding method and corresponding devices | |
US20180005358A1 (en) | A method and apparatus for inverse-tone mapping a picture | |
TW201701658A (en) | Method and device for encoding both a HDR picture and a SDR picture obtained from said HDR picture using color mapping functions | |
CN107533832B (en) | Image processing apparatus, image processing method, and program | |
CN105208363B (en) | Method to trembling the compensation of tone integral quantization in color space conversion | |
EP3051489A1 (en) | A method and apparatus of encoding and decoding a color picture | |
CN115918071A (en) | Adapting a transformation process to a neural network based intra-prediction mode | |
WO2015144566A1 (en) | An image processing method and a corresponding device | |
JP2018019239A (en) | Imaging apparatus, control method therefor and program | |
CN106954074B (en) | Video data processing method and device | |
US20160337666A1 (en) | Methods and apparatus to perform fractional-pixel interpolation filtering for media coding | |
KR20070111111A (en) | Method of compressing and decompressing image and equipment thereof | |
CN100466741C (en) | A method and device for carrying out coding using correlation between video signal frames in video code processing | |
CN113194316A (en) | Image coding and decoding method and device | |
JP2004072293A (en) | Image data processor and its control method | |
KR100602249B1 (en) | Video Processing Device and the Method thereof | |
EP2499831B1 (en) | A method of digital signal processing | |
TW202404342A (en) | Method for generating high dynamic range image, and image processing system | |
CN116309049A (en) | Image processing method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 100191 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6, Applicant after: Storm group Limited by Share Ltd Address before: 100191 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6, Applicant before: Beijing Baofeng Technology Co., Ltd. |
|
COR | Change of bibliographic data | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PP01 | Preservation of patent right | ||
PP01 | Preservation of patent right |
Effective date of registration: 20190705 Granted publication date: 20180209 |