Specific embodiment
Explanation is the relatively good implementation to complete invention below, its object is to describe essence spirit of the invention, but
Not to limit the present invention.Actual summary of the invention must refer to after scope of the claims.
It will be appreciated that using in this manual " include ", " include " and etc. words, be specific to indicate to exist
Technical characteristic, numerical value, method and step, operation processing, element and/or component, but being not precluded can be special plus more technologies
Sign, numerical value, method and step, operation processing, element, component or above any combination.
Fig. 1 is to show an electronic device as described in the examples to execute sub-pixel rendering method according to the present invention
Block diagram.Electronic device 100 includes an at least processor 110 and a reservoir 120.Processor 110 can be in several ways
Implement, for example, with special hardware circuit or common hardware (such as single-processor, have parallel processing ability multiprocessor,
Graphics processor or other processors with operational capability), to be converted to source images it is suitable for that there is specific sub- picture
The target image of the display of element arrangement.Wherein, in an embodiment of the present invention, the height of the sub-pixel of display (not shown)
It is the 2/3 of the height of the source pixel of source images, and its width is the 3/4 of the width of the source pixel of source images.The source image of source images
Plain line number is identical as the object pixel line number of target image, and in every row every 3 adjacent source images source pixel by processor
110 are rendered into the object pixel of 2 target images.Each object pixel of target image includes 3 and corresponds respectively to R, G and B
The sub-pixel in channel, each source pixel of source images also include 3 pixel values for corresponding respectively to R, G and channel B, object pixel
The pixel value of the pixel value corresponding channel that is based respectively on source pixel of sub-pixel in each channel calculated.Reservoir 120 can
For nonvolatile memory (such as ROM, flash memory etc.), to store an at least source images and to turn source images
Information needed for being changed to the target image for being suitable for the display with particular sub-pixel arrangement.For example, source images are turned
Information needed for being changed to the target image for being suitable for the display with particular sub-pixel arrangement includes that source pixel is converted to son
The related algorithm of pixel, for based on distance and the relevant parameter of sub-pixel rendering method based on area etc..
In one embodiment, electronic device 100 is a display pannel controller, is coupled to graphics processing unit
(Graphics Processing Unit, GPU) is between (not shown) and display (not shown).Electronic device 100 connects from GPU
Source images are received, and the source images received are converted to and sends display to after target image and shows.
The sub-pixel rendering method (will be described hereinafter) based on distance and/or the son based on area can be used in processor 110
Pixel rendering method (will be described) hereinafter, and source images are converted to the mesh for being suitable for the display with particular sub-pixel arrangement
Logo image.Sub-pixel rendering method based on distance is first described below.
Fig. 2 is the flow chart for showing the sub-pixel rendering method described in an embodiment according to the present invention based on distance, under
Face will be described in detail the sub-pixel rendering method shown in Fig. 2 based on distance in conjunction with Fig. 3~Figure 12.
Firstly, processor 110 obtains source images from reservoir 120 in step S201.In one embodiment, processor 110
First from GPU receive source images, and by the source images received storage into reservoir 120 after, just enter step S201.Then locate
It manages device 110 and executes step S205.
In step S205, when the display of displaying target image has recess and/or fillet, processor 110 is to source
The source pixel for being located at recess or fillet in image carries out anti-aliasing processing.Specifically, whether processor 110 first judges display
With recess or fillet.As shown in figure 3,310 be positioned at the recess at display edge and 320 for positioned at display edge
Fillet.In one embodiment, if display has recess and/or fillet, all and recess can be stored in reservoir 120
And/or the coordinate information of the source pixel in source images corresponding to fillet.If processor 110 can be obtained from reservoir 120
Get the coordinate information with the source pixel in source images corresponding to recess and/or fillet, then it represents that display has recess
And/or fillet.When display has recess and/or fillet, processor 110 will be located at recess and/or fillet in source images
The pixel value of source pixel is multiplied by attenuation coefficient, to carry out anti-aliasing processing.In one example, processor 110 will be located at edge and
For recess and/or the source images of fillet source pixel pixel value multiplied by attenuation coefficient, showed with softening edge pixel
Sawtooth.Subsequent step can be according to each son of the object pixel of the calculated for pixel values target image of the source pixel of the source images through softening
The pixel value of pixel.Wherein, attenuation coefficient is related to the area that edge pixel is cut by circular arc, and can pass through formula below
It obtains:
Areaarch=(2*offset-1)/(2*step)
Wherein, AreaarchFor attenuation coefficient, offset is location index of the source pixel in sawtooth, and step is sawtooth
Width.
For example, as shown in figure 4, region 410 is the region of not photophore, region 420 (being described with dotted line) is circle
One of sawtooth in multiple sawtooth of angle or recess, and solid line 450 is then in region 420 close to ideal circular arc tangential line.
For source pixel 421, region 421a is the region in circular arc tangential line, and region 421b is then outside circular arc tangential line
Region.According to the content of Fig. 4, it can be seen that, the width in region 420 is 5 source pixels, and source pixel 421 is then region 420
1st source pixel (i.e. offset is 1).Therefore, attenuation coefficient corresponding to source pixel 421 can be calculated to obtain according to above-mentioned formula
For Areaarch=(2*1-1)/(2*5)=1/10.In other words, area corresponding to the 421a of region is the entire surface of source pixel 421
Long-pending 1/10, and the pixel value of the pixel 421 after softening is original 1/10.In another example, source pixel 423 pair
The attenuation coefficient answered is Areaarch=(2*3-1)/(2*5)=5/10, i.e., the pixel value of the source pixel 423 after softening are original
First 5/10, in other words, area corresponding to the 423a of region are the 5/10 of the entire area of source pixel 423, and after softening
The pixel value of source pixel 423 is 5/10 originally.And so on.
In one embodiment, processor 110 by source images in the target image without the source pixel of corresponding sub-pixel
Pixel value be set as 0, imply that source images corresponding to the region (region 410 in Fig. 4) that will not have photophore in display
In the pixel value of source pixel be set as 0.
In addition, corresponding to the correlation of the source pixel of saw tooth region in the storage of reservoir 120 in one embodiment of the invention
When information, the coordinate that can only store the starting point of saw tooth region, offset direction and source image corresponding to the direction x or the direction y
The offset of element.For example, region 420 as shown in Figure 4 can only store pair when storage corresponds to the sawtooth in region 420
Should in the coordinate of source pixel 421, corresponding to the offset direction in the direction x and the information of the offset of 5 source pixels.
After processor 110 carries out anti-aliasing processing to the source pixel for being located at recess and/or fillet, enter step
S210.In step S210, processor 110 determines the coordinate (x of an object pixel to be rendered in target imagespr, y), so
After enter step S215.
In step S215, processor 110 calculate separately in source images with object pixel (xspr, y) each sub-pixel it is corresponding
Source pixel edge code (edge code) object pixel (x to be rendered with determinationspr, y) each sub-pixel around line
Manage information.Specifically, in order to object pixel (xspr, y) each sub-pixel correctly rendered, processor 110 is to source
In image with the object pixel (x to be rendered of target imagespr, y) the corresponding source pixel of each sub-pixel centered on a form hold
Row edge detection is to obtain and object pixel (x to be renderedspr, y) the corresponding source pixel of each sub-pixel edge code, and
Object pixel (x is determined according to obtained edge codespr, y) each sub-pixel texture information, and to different texture
Object pixel (xspr, y) each sub-pixel rendered using different rendering methods respectively to obtain object pixel (xspr,
Y) pixel value of each sub-pixel.It calculates and object pixel (xspr, y) the corresponding source images of each sub-pixel in source pixel x
When coordinate, according to object pixel (x to be renderedspr, y) and it is located at the odd-numbered line of target image or the difference of even number line, calculation method meeting
It is different.
For description object pixel (x better further belowspr, y) each sub-pixel pixel value calculating process, here first
Explain the definition about even number line, odd-numbered line, even column and odd column.With object pixel (xspr, y) for, work as xspr%2
Object pixel (x is indicated when=0spr, y) and it is located at the even column of target image, work as xsprObject pixel (x is indicated when %2=1spr, y)
Positioned at the odd column of target image, wherein %2 expression rems to 2, and works as object pixel (xspr, y) be located at the 1st column when xspr=
0, as object pixel (xspr, y) be located at the 2nd column when xspr=1, and so on;Object pixel (x is indicated as y%2=0spr, y)
Positioned at the even number line of target image, object pixel (x is indicated as y%2=1spr, y) and it is located at the odd-numbered line of target image,
Middle %2 expression rems to 2, and works as object pixel (xspr, y) be located at 1 row when y=0, as object pixel (xspr, y) and it is located at the
Y=1 when 2 row, and so on.Above-mentioned determining even number line/even column and odd-numbered line/odd column method are equally applicable to source images
In source pixel, description is not repeated herein.
As object pixel (x to be renderedspr, y) be located at target image even number line when, corresponding to source images in source
The x coordinate of pixel obtains (source pixel corresponding to the channel R and G of object pixel and the sub-pixel of channel B by formula below
It is different):
And as object pixel (x to be renderedspr, y) when being located at the odd-numbered line of target image, corresponding to source pixel
X coordinate obtains (channel R and G of object pixel is different from source pixel corresponding to the sub-pixel of channel B) by formula below:
Wherein, floor () indicates downward round numbers.With object pixel (xspr, y) the corresponding source images of each sub-pixel in
Source pixel be (x, y).With source pixel (x, y) for center pixel, institute in form can be found out according to the coordinate of source pixel (x, y)
The coordinate of active pixel.By taking 3 × 3 form as an example, the coordinate of the source pixel above source pixel (x, y) is (x, y-1), source pixel
The coordinate of the source pixel of the left (x, y) is (x-1, y), and so on all 8 source images around available source pixel (x, y)
The coordinate of element.The pixel value of corresponding source pixel can be obtained from source images according to the coordinate of source pixel.When processor 110 is counted
When calculating the pixel value for being located at the sub-pixel at edge, processor 110 first will carry out mirror image processing to the source pixel for being located at edge, to take
Obtain the pixel value for the virtual source pixel being located at outside edge.For example, as shown in figure 5, the source pixel 0 of the shadow region in the lower right corner
~15 be the source pixel in source images.Due to that can use and be located at when processor 110 calculates the object pixel for being located at edge
Virtual source pixel outside source images can be used that is, when calculating the pixel value for being located at sub-pixel corresponding with the source pixel 4 of source images
To the pixel value for the virtual source pixel for being located at 4 left side of source pixel, thus the pixel of the virtual source pixel in 4 left side of source pixel will be located at
Value is mapped as being located at the pixel value of the source pixel 5 on 4 right side of source pixel, and so on, so that processor 110 corresponds to side in calculating
When the pixel value of the sub-pixel of edge, related operation can be carried out according to the pixel value of virtual source pixel.
It is got and object pixel (x from source imagesspr, y) the corresponding form of some sub-pixel after, processor 110 start
Carry out the calculating of edge code.With object pixel (xspr, y) the pixel value of the corresponding source pixel of the sub-pixel be individually subtracted
Multiple pixel values for closing on source pixel in one of multiple directions of form obtain multiple first differences;Source pixel is closed on multiple
Pixel value the pixel value of the source pixel be individually subtracted obtain multiple second differences;According to the first difference compared with first threshold
As a result the first coding is obtained;The second coding is obtained according to the comparison result of the second difference and second threshold;By the first coding and the
Two coded combinations obtain the coding of one of multiple directions;The coding for finally combining the multiple direction obtains edge code.
Below with object pixel (xspr, y) the corresponding sub-pixel in the channel R corresponding 3 × 3 form for illustrate.
Edge code can be made up of the coding of four hex bits, and each position for forming the coding of edge code is divided from left to right
Not Dui Yingyu 3 × 3 level (h) direction of form, upper left bottom right (1) direction, vertical direction (v) and upper right lower-left (r) side
To coding, wherein each characterization one direction texture information.It is worth noting that, although being with four in above-described embodiment
As an example, but the present invention is not limited thereto for position, this needs the direction number characterized to determine by edge code.Citing comes
It says, as shown in fig. 6, the coding in horizontal direction (h) is (i.e. shown in figure by the 3rd, 4 and the 5th source pixel in nine grids
V3~V5) it is calculated, the coding in upper left bottom right (1) direction (is schemed by the 0th, 4 and the 8th source pixel in nine grids
Shown in V0, V4, V8) be calculated, the coding in vertical direction (v) is by the 1st, 4 and the 7th source pixel in nine grids
(V1, V4, V7 i.e. shown in figure) be calculated and the coding in upper right lower-left (r) direction be by the 2nd, 4 in nine grids with
And the 6th source pixel (V2, V4, V6 i.e. shown in figure) is calculated.Wherein, the first two position of the coding of all directions is logical
It crosses produced by subtracting the pixel value of center pixel from the pixel value of surrounding pixel, and latter two position encoded then passes through therefrom imago
The pixel value of element subtracts produced by the pixel value of surrounding pixel.For example, by taking horizontal direction (h) as an example, horizontal direction (h)
It is encoded to H (f (V3-V4), f (V5-V4), f (V4-V3), f (V4-V5)).Wherein, f () indicates a function, when in bracket
Value exports 1 when being greater than a given threshold, exports 0 when the value in bracket is less than a given threshold;H () indicates a function, will
The number of four binary digits in parantheses is converted to the number of a hex bit.For example, it is assumed that threshold value be 10, when V3 be 151,
When V4 is 148, V5 is 150, V3-V4 is equal to 3, thus V3-V4 is less than 10, so f (V3-V4) exports 0, V5-V4 and is equal to 2, because
And V5-V4 is less than 10, so f (V5-V4) exports 0, V4-V3 and is equal to -3, thus V4-V3 is less than 10, so 0, V4-V5 of output etc.
In -2, thus V4-V5 is less than 10, so output 0;So horizontal direction (h) is encoded to 0x0 (i.e. Binary Zero 000).Now
It is to show that 9 kinds of situations of the coding that corresponds to horizontal direction (h) described in an embodiment according to the present invention are shown with reference to Fig. 7, Fig. 7
It is intended to.As shown in 701 in Fig. 7,0x0 indicates that the brightness value (i.e. pixel value, similarly hereinafter) of V3, V4 and V5 are not much different;V3, V4 and V5
All with white filling signal.V3, V4 and V5 can also illustrate (not shown), the filling of V3, V4 and V5 square with filled black
Color is identical to indicate that the brightness value of V3, V4 and V5 are not much different.When V3 is 151, V4 120, V5 are 150, V3-V4 is equal to
31, thus V3-V4 is greater than 10, so f (V3-V4) exports 1, V5-V4 and is equal to 30, thus V5-V4 is greater than 10, so f (V5-V4)
It exports 1, V4-V3 and is equal to -31, thus V4-V3 is less than 10, so 0, V4-V5 of output is equal to -30, thus V4-V5 is less than 10, institute
To export 0, so horizontal direction (h) is encoded to 0xC (i.e. binary one 100), as shown in 703 in Fig. 7, coding 0xC indicates V3
The brightness value of V4 is both greater than with the brightness value of V5.Similarly, as shown in 702 in Fig. 7, coding 0x3 indicates the brightness value of V3 and V5
The both less than brightness value of V4;As indicated by 704, coding 0x1 indicates that the brightness value of V3 and V4 is both greater than the brightness value of V5;Such as 705 institutes
Show, coding 0x4 indicates that the brightness value of V3 and V4 is both less than the brightness value of V5;As shown at 706, coding 0x6 indicates the brightness value of V3
The brightness value of brightness value, V4 less than V4 is less than the brightness value of V5;As shown in 707, coding 0x2 indicates the brightness value of V4 and V5
Brightness value greater than V3;As shown in 708, coding 0x8 indicates that the brightness value of V4 and V5 is both less than the brightness value of V3;As shown in 709,
Encoding 0x9 indicates brightness value of the brightness value greater than V5 of brightness value of the brightness value greater than V4 of V3, V4.
The coding in upper left bottom right (1) direction, vertical direction (v) and upper right lower-left (r) direction can similarly be acquired.It will be horizontal
(h) coding in direction, upper left bottom right (1) direction, vertical direction (v) and upper right lower-left (r) direction is by sequence from left to right
Arrangement can be obtained one and include the edge code of four hex bits, and pass through the edge code finally exported
Learn object pixel (xspr, y) the channel R sub-pixel around texture information.In one embodiment, when horizontal direction (h)
When edge code is 0x4 or 0x8, object pixel (x is indicatedspr, y) sub-pixel around texture it is weaker.When edge, code is
0x0111,0x0222,0x0333,0x0444,0x0CCC, 0xCC0C, 0x1102,0x2201,0x3303,0x4408 or 0x8804
When (as shown in figure 16), indicate object pixel (xspr, y) sub-pixel around texture it is stronger.And when edge code is 0x3030
When (as shown in Figure 8 A) or 0xC0C0 (as shown in Figure 8 B), object pixel (x is indicatedspr, y) sub-pixel around texture information
For special style.
Object pixel (x has been calculated in processor 110spr, y) each sub-pixel edge code and determine object pixel (xspr,
Y) after the texture information around each sub-pixel, S216 is entered step.In step S216, processor 110 judges target respectively
Pixel (xspr, y) each sub-pixel around texture information whether be special style.In one embodiment, that is, judge object pixel
(xspr, y) the edge code of sub-pixel whether be 0x3030 or 0xC0C0;Entering step S220 if it is "No" (below can be detailed
State), S218 is then entered step if it is "Yes".
For description object pixel (x better further belowspr, y) each sub-pixel pixel value calculating process, here first
Explain the positional relationship between each sub-pixel of the object pixel in the source pixel and target image in source images.Such as Figure 10
Shown, the "○" in Figure 10 represents the source pixel in source images.As shown in figure 11, " △ " in Figure 11 indicates mesh in target image
The sub-pixel in the channel R of pixel is marked, " ◇ " indicates the sub-pixel in the channel G of object pixel in target image, and " " then table
Show the sub-pixel of the channel B of object pixel in target image.And according to the content of Fig. 9 it is found that in an embodiment of the present invention, mesh
The height of the sub-pixel of object pixel is 2/3 (object pixel line number and source image of the height of the source pixel of source images in logo image
Plain line number is identical), and in target image each channel of the sub-pixel of object pixel width be source images source pixel channel
3/4 (number of object pixel is the 2/3 of source pixel number in every row) of width.In other words, as shown in figure 12, when source images are aobvious
When being shown in target image, the position of the source pixel of source images can't be with the position of the sub-pixel of the object pixel of target image
It overlaps, therefore when calculating the pixel value of sub-pixel in the channel R of object pixel of target image, the channel G and channel B, place
It manages device 110 and the pixel value of left and right two source pixel most adjacent to the sub-pixel with object pixel is subjected to interpolation calculation to obtain
The pixel value of the sub-pixel of object pixel.Step S218 is described below.
In step S218, the direct interpolation calculation object pixel (x of processor 110spr, y) sub-pixel pixel value.In detail
For thin, processor 110 is to calculate object pixel (x by formula belowspr, y) sub-pixel pixel value.When target figure
Object pixel (the x of picturespr, y) be located at target image even number line when, the object pixel (x of target imagespr, y) the channel R and G
It is calculated with the pixel value of the sub-pixel of channel B by following formula:
When
*factorave, when
*factorkep, when
*factorave, when
And object pixel (the x when target imagespr, y) be located at target image odd-numbered line when, the target of target image
Pixel (xspr, y) the channel R and G and the pixel value of sub-pixel of channel B calculated by following formula:
Work as edgecode=0x3030
Work as edgecode=0xC0C0
Wherein,Refer to that coordinate is (x in target imagespr, y) object pixel the channel R or the channel G
Sub-pixel pixel value,Refer to that coordinate is (x in target imagespr, y) object pixel channel B sub-pixel
Pixel value, R ' (G ')X, yRefer to that coordinate is the channel R of the source pixel of (x, y) or the pixel value in the channel G, B ' in source imagesX, yIt is
Refer to that coordinate in source images is the pixel value of the channel B of the source pixel of (x, y), it is each in formulaAll contain downward rounding
Number operation, factorkepFor a preset value, factoraveRefer to edge code for a preset value and edgecode.And in
In the embodiment of the present invention, factorkepValue be 1.0 and factoraveValue be 0.5.It will be appreciated, however, that
factorkepAnd factoraveValue be that can be adjusted according to the demand of user, be not limited with the present invention.Wherein, in
In one example, as the x of the sub-pixel in the channel R of object pixelsprCoordinate be 5 when, processor 110 be take x coordinate be 7 source image
The pixel value of element is multiplied by factorkepValue, with obtain correspond to object pixel sub-pixel pixel value.
In step S220, processor 110 can calculate object pixel (x to be rendered according to texture information and based on distancespr,
Y) pixel value of sub-pixel.Specifically, corresponding to the object pixel (x to be rendered of even number linespr, y) the channel R, the channel G
And the pixel value of the sub-pixel of channel B can be acquired by formula below:
And object pixel (the x to be rendered corresponding to odd-numbered linespr, y) the channel R, the channel G and channel B sub- picture
The pixel value of element can be obtained by formula below:
Wherein,Refer to object pixel (xspr, y) the channel R or the channel G sub-pixel pixel value,Refer to object pixel (xspr, y) channel B sub-pixel pixel value, R ' (G ')(x, y)Refer to that coordinate is (x, y)
The channel R of source pixel or the pixel value in the channel G, B '(x, y)Refer to the channel B corresponded in source pixel that coordinate is (x, y)
Pixel value, it is each in formulaDownward round numbers operation (for example, 3 × 3/2 are equal to 4) is all contained, wherein %2 is indicated to 2
It rems, therefore xspr%2=0 indicates even column and xspr%2=1 indicates odd column.In one embodiment, work as target picture
Element (xspr, y) the corresponding texture information of sub-pixel it is weaker when, i.e., when level (h) direction of edge code be encoded to 0x8 or
When 0x4, object pixel (x is being calculatedspr, y) sub-pixel pixel value when need be smoothed.Specifically, work as level
(h) direction is encoded to 0x8 and xspr0x4 and x are encoded to when %2=0 or when horizontal direction (h)sprWhen %2=1
Use factorsmoothReplace factorrg(b)**, wherein factorsmoothFor a preset value, factorrg(b)**It indicates
factorrg00、factorrg01、factorrg10、factorrg11、factorb00、factorb01、factorb10Or factorb11,
And factorsmooth、factorrg00、factorrg01、factorrg10、factorrg11、factorb00、factorb01、
factorb10And factorb11It is preset value.
For example, when the channel the R sub-pixel for the object pixel for being located at (3,1) in the calculating target image of processor 110
When pixel value, it can be acquired according to the pixel value in the channel R for the source pixel for being located at (3,1) and (4,1) in source images, with such
It pushes away.
In one embodiment of the invention, factorrg00、factorrg01、factorrg10、factorrg11、factorb00、
factorb01、factorb10、factorb11Value be all 0.7.Alternatively, another embodiment according to the present invention, factorrg00、
factorrg10、factorrg11、factorb00、factorb01、factorb10Value be 1.0, and factorrg01、factorb11's
Value is then 0.7.In other words, the sub-pixel applied to the channel R of the object pixel of different row/columns, the channel G and channel B
The value of factor is that the user of demand can be shown according to to(for) color is different and change.In addition, in response to the son of object pixel
When texture around pixel is more gentle or does not have texture, the value of factor also can directly apply 0.5.
Object pixel (x has been calculated in processor 110spr, y) all sub-pixels pixel value after, enter step S225.?
In step S225, processor 110 checks whether there are also the object pixels not rendered in target image.If it is "No", then it represents that
The sub-pixel of all object pixels of target image is all rendered complete, and processing terminate.Then processor 110 can will render
Target image be sent to display and shown.Otherwise, return step S210 continues to next object pixel not rendered
It is rendered.
The sub-pixel rendering method based on area is described below.Figure 13 is to show root described in an embodiment according to the present invention
According to texture information and the flow chart of method that is rendered based on area to sub-pixel.Below in conjunction with Figure 14~Figure 16 to Figure 13
It is illustrated.
Figure 14 is shown the arrangement of the source pixel of source images and target image described in another embodiment according to the present invention
The schematic diagram that the arrangement of corresponding sub-pixel overlaps.Figure 15 A~Figure 15 D is to show root described in an embodiment according to the present invention
According to texture information and the schematic diagram of the pixel value of the sub-pixel of the channel B based on areal calculation object pixel.Figure 16 is display root
Need to be sharpened the schematic diagram of the corresponding texture information of edge code of processing according to 12 kinds described in one embodiment of the invention.
As shown in figure 13, step S1301, S1305, S1310, S1316, S1318 and S1325 respectively with the step in Fig. 2
The operation of S201, S205, S210, S216, S218 and S225 are identical, will no longer carry out repeated description herein.It is right separately below
S1315 and step S1320 are described.Figure 13 is using the object pixel to be rendered based on areal calculation in step S1320
(xspr, y) sub-pixel pixel value, and Fig. 2 is to calculate object pixel to be rendered using based on distance in step S220
(xspr, y) sub-pixel pixel value, therefore the step S215 in step S1315 and Fig. 2 in Figure 13 is not also identical, i.e. Figure 13 with
The embodiment of Fig. 2 is calculating and object pixel (xspr, y) the corresponding source images of sub-pixel in source pixel coordinate when use
Formula it is also different, it is specific as follows shown in:
As object pixel (x to be renderedspr, y) be in target image even number line when, corresponding to source images in
The x coordinate of source pixel obtains the (channel R and G of object pixel source pixel corresponding with the sub-pixel of channel B by formula below
May be different):
And as object pixel (x to be renderedspr, y) be in target image odd-numbered line when, corresponding to source images
In the x coordinate of source pixel (the channel object pixel R and G source image corresponding with the sub-pixel of channel B is obtained by formula below
Element may be different):
Wherein, floor () indicates downward round numbers.With object pixel (x to be renderedspr, y) the corresponding source figure of sub-pixel
Source pixel as in is (x, y), and wherein %2 expression rems to 2, therefore xspr%2=0 indicates even column and xspr%2=
1 indicates odd column.
Step S1320 is described again below.In step S1320, processor 110 is according to texture information and is based on areal calculation
Object pixel (x to be renderedspr, y) sub-pixel pixel value.Specifically, as shown in figure 14, " △ " indicates mesh to be rendered
The channel R of pixel or the sub-pixel in the channel G are marked, and " " then indicates the sub-pixel of the channel B of object pixel to be rendered, and
The center of the small square of each dotted line frame is the position where a source pixel of source images.Processor 110 is corresponded in calculating
When the pixel value of the sub-pixel of the object pixel to be rendered of a target image, the target picture to be rendered with target image is first had to
Its corresponding form in source images is obtained centered on the sub-pixel of element, it is notable that form here and aforementioned
It is different that the form that edge code is taken is calculated in step S1315.Below by taking 3 × 3 form as an example, it is described in detail below.
When the sub-pixel in the channel R or the channel G that the sub-pixel of object pixel to be rendered is object pixel, it is located at mesh
The sub-pixel of the object pixel to be rendered of the even number line even column of logo image, even number line odd column and odd-numbered line even column is in source
The source pixel for including in corresponding form in image are as follows:
And the sub-pixel to be rendered of the odd-numbered line odd column positioned at target image wraps in corresponding form in source images
The source pixel contained are as follows:
Wherein, R ' (G ')(x, y)Refer to coordinate for the pixel value in the source pixel of (x, y) corresponding to the channel R or the channel G.
In addition, being located at target image when the sub-pixel for the channel B that the sub-pixel of object pixel to be rendered is object pixel
Even number line even column, odd-numbered line even column and odd-numbered line odd column object pixel to be rendered sub-pixel in source images
The source pixel for including in corresponding form are as follows:
And the sub-pixel of the object pixel to be rendered positioned at the even number line odd column of target image is corresponding in source images
Form in include source pixel are as follows:
Wherein, B '(x, y)Refer to that coordinate is the pixel value of the channel B of the source pixel of (x, y) in source images.
(such as Figure 14 after the sub-pixel source pixel that corresponding form includes in source images for obtaining object pixel to be rendered
In 3 × 3 dotted line frames small square), top, lower section, the left side of sub-pixel of the processor 110 based on object pixel to be rendered
The sub-pixel of the object pixel to be rendered of side and right is to obtain a diamond-shaped area.As shown in Figure 15 A~Figure 15 D, " △ " generation
The channel R/channel G sub-pixel of table object pixel to be rendered, " " represents the sub-pixel of the channel B of object pixel to be rendered,
And 9 small squares represent the source pixel that the sub-pixel of object pixel to be rendered includes in corresponding form in source images.
4 kinds of different types of diamond-shaped areas are shared, the diamond shape 1550 in Figure 15 A is the sub-pixel when the channel B of object pixel to be rendered
Acquired diamond-shaped area when position in the target image is even number line even column, the diamond shape 1560 in Figure 15 B is to be rendered
The position of the sub-pixel of the channel B of object pixel in the target image diamond-shaped area acquired when being even number line odd column, figure
Diamond shape in 15C is the position of the sub-pixel of the channel B of object pixel to be rendered in the target image when being odd column even number line
Diamond shape in acquired diamond-shaped area and Figure 15 D be the sub-pixel of the channel B of object pixel to be rendered in the target image
Position acquired diamond-shaped area when being odd-numbered line odd column.
Then, the area ratio of the surrounding source pixel according to shared by diamond-shaped area of processor 110 calculates corresponding target image
Object pixel to be rendered sub-pixel pixel value.That is the face that judges surrounding source pixel shared by the diamond-shaped area of processor 110
Product ratio, finally the area ratio shared in corresponding source pixel according to each sub-regions is multiplied by corresponding source pixel
Pixel value is simultaneously added up, to obtain the pixel value of the sub-pixel of object pixel to be rendered.
As shown in fig. 15, when processor 110 is intended to obtain the pixel of the sub-pixel 1501 of the channel B of object pixel to be rendered
When value, processor 110 is primarily based on top, lower section, left and the right side of the sub-pixel 1501 of the channel B of object pixel to be rendered
Side object pixel the channel R/channel G sub-pixel 1502~1505 obtain a diamond-shaped area 1550, with according to diamond-shaped area in
Shared area acquires the pixel value of the sub-pixel of object pixel to be rendered in the source pixel of multiple source images.Diamond-shaped area 1550
It is to be made of respectively subregion 1550a~1550f, and the form that subregion 1550a~1550f respectively accounts for 3 × 3 includes
In the source pixel of source images right side two column source pixels a part (source pixel 1511 of source images i.e. shown in figure~
1516).Processor 110 then finds out subregion 1550a area ratio shared in the source pixel 1511 of source images, son respectively
Area ratio region 1550b shared in the source pixel 1512 of source images, subregion 1550c are in the source pixel 1513 of source images
In shared area ratio, sub-pixel 1550d area ratio shared in the source pixel 1514 of source images, sub-pixel 1550e
Shared area ratio and sub-pixel 1550f are shared in the source pixel 1516 of source images in the source pixel 1515 of source images
Area ratio, then area ratio corresponding to each sub-regions is multiplied by aforementioned obtained 3 × 3 source pixel respectively and is divided
Not corresponding channel B pixel value simultaneously adds up the value for corresponding to each subregion, and the B that can finally obtain object pixel to be rendered is logical
The pixel value of the sub-pixel 1501 in road.For example, area ratio subregion 1550d shared in the source pixel 1514 of source images
Example is 54/144, if channel B pixel value corresponding to the source pixel 1514 of source images is 144, corresponding to subregion 1550d
Value is then 54, and so on.
As shown in fig. 15b, when the pixel value of the sub-pixel 1521 of the channel B of the object pixel to be obtained of processor 110, place
The R that reason device 110 is primarily based on the top of sub-pixel 1521 of the channel B of object pixel to be rendered, lower section, left and right is logical
Road/the channel G sub-pixel 1522~1525 obtains a diamond-shaped area 1560, with according to diamond-shaped area in the source pixel of multiple source images
In shared area acquire object pixel to be rendered channel B sub-pixel 1521 pixel value.Diamond-shaped area 1560 is difference
It is made of subregion 1560a~1560e, and subregion 1560a~1560e is respectively in the source pixel for the source images for accounting for 3 × 3
A part (source pixels 1531~1535 of source images i.e. shown in figure) of 2nd, 4~6,8 pixel.Then, processor 110
Subregion 1560a area ratio shared in the source pixel 1531 of source images, subregion 1560b are found out respectively in source images
Area ratio shared area ratio, subregion 1560c shared in the source pixel 1533 of source images, son in source pixel 1532
Area ratio and sub-pixel 1560e pixel 1560d shared in the source pixel 1534 of source images is in the source pixel of source images
Shared area ratio in 1535, then area ratio corresponding to each sub-regions is multiplied by the source figure of aforementioned obtained 3*3
The source pixel of picture corresponding channel B pixel value and add up correspond to each subregion pixel value, can finally obtain
The pixel value of the sub-pixel 1521 of the channel B of object pixel to be rendered.
The mode of the pixel value of the sub-pixel of calculating object pixel to be rendered and Figure 15 A, figure as shown in Figure 15 C, Figure 15 D
15B is similar, is a difference in that the area of the source pixel of source images shared by each region of diamond shape is different, is not described with essence herein
Simple explanation.It is worth noting that, the sub-pixel in each channel of foregoing object pixel to be rendered and the source image of source images
The area configuration information of element is stored in reservoir 120 in advance, and processor 110 can be according to corresponding to the sub-pixel of object pixel
Row and column accesses corresponding area configuration information in reservoir 120, and by corresponding to each sub-regions 3 × 3 source images
Source pixel pixel value substitute into, in the hope of the pixel value of the sub-pixel of corresponding object pixel to be rendered.It is worth noting that,
Configuration of the diamond-shaped area of the sub-pixel in the channel the R or channel G corresponding to object pixel to be rendered in 3 × 3 source pixel
It is opposite with configuration of the diamond-shaped area of the sub-pixel of the channel B of object pixel to be rendered in 3 × 3 source pixel.In other words,
When " △ " and " " is exchanged, i.e., when " " is for the channel R/channel G sub-pixel, " △ " corresponding to object pixel to be rendered
When the sub-pixel of the channel B corresponding to object pixel to be rendered, Figure 15 A is when the channel R or the channel G of object pixel to be rendered
Sub-pixel be odd-numbered line odd column when situation, Figure 15 B be when object pixel to be rendered the channel R or the channel G sub- picture
Situation when element is odd-numbered line even column, Figure 15 C are when the channel R of object pixel to be rendered or the sub-pixel in the channel G are even
Situation and Figure 15 D when ordered series of numbers odd-numbered line are when the channel R of object pixel to be rendered or the sub-pixel in the channel G are even number
Situation when row even column.
For example, the source image of the source images around the sub-pixel in the channel R of the object pixel to be rendered of (1,1)
Element are as follows:
It and is corresponding to odd-numbered line and odd column according to content above-mentioned available (1,1), therefore processor 110 is by root
It is calculated according to the pixel value of aforementioned acquired source pixel multiplied by the area configuration of the diamond-shaped area of Figure 15 A and corresponds to target to be rendered
The pixel value of the sub-pixel in the channel R of pixel.
In addition, an embodiment according to the present invention, in the sub-pixel rendering method based on area, when object pixel to be rendered
Sub-pixel corresponding to texture information be 12 kinds of patterns shown in Figure 16 it is any when (wherein the white in figure represents "
1 ", black represents " 0 "), i.e., when texture corresponding to the sub-pixel of object pixel to be rendered is stronger, processor 110 more treats wash with watercolours
The sub-pixel of dye object pixel is sharpened processing, so that target image is more clear.Specifically, when target to be rendered
When texture corresponding to the sub-pixel of pixel is stronger, processor 110 treats post-processing object pixel using a Diamond filter
Sub-pixel corresponding 3 × 3 source pixel in source images carries out convolution algorithm, obtains a sharpening parameter.Then face will be based on
The pixel value for the sub-pixel of object pixel to be rendered that product acquires is added with parameter is sharpened, it is obtained be worth be exactly after sharpening to
The pixel value of the sub-pixel of post-processing object pixel.Here is an example of the Diamond filter in one embodiment of the invention:
Another embodiment according to the present invention, when processor 110 respectively according to based on distance sub-pixel rendering method and
Sub-pixel rendering method based on area obtains the sub- picture of the channel R for corresponding to object pixel to be rendered, the channel G and channel B
After the pixel value of element, processor 110 can merge two calculated results according to set weight more in the hope of last pixel value.Citing
For, processor 110 can give the weight of two calculated results each 0.5 respectively, with the average sub-pixel rendering side based on distance
Pixel value acquired by method and sub-pixel rendering method based on area.
In conclusion sub-pixel rendering method according to the present invention and device, in the situation for not changing image quality
Under, the source pixel that interpolation is only source images in the hope of quantity is carried out by two source pixels to source images or multiple source pixels
2/3 object pixel of quantity, will can so save the photophore of 1/3 quantity.In addition, in acquiring each object pixel to be rendered
Sub-pixel pixel value when, method of the present invention according to the texture information around the sub-pixel of object pixel to have spy
The pixel of different texture (such as edge code described in aforementioned specification is special style) carries out specially treated, and using different
When the pixel value for the sub-pixel that method (such as based on distance and/or area) calculates object pixel to be rendered, according to different texture
Information (such as texture described in aforementioned specification weaker or stronger situation) is accordingly to calculating resulting target picture to be rendered
The pixel value of the sub-pixel of element carries out smooth or Edge contrast, to obtain optimal image conversion effect.Furthermore in response to display
Device have fillet perhaps recess when method of the present invention more can be in advance to the source pixel for corresponding to fillet or notched region
Reverse sawtooth processing is carried out, so that the image quality finally exported is more preferably.
Although the present invention is illustrated using above embodiments, it should be noted that these descriptions are not to limit
The present invention.It is obviously modified and similar set up on the contrary, the invention covers those skilled in the art.So applying right
Sharp claimed range must be explained in a manner of most wide to include all obvious modifications and similar set up.