This disclosure relates to techniques for scaling image/video data within a graphics/video processing system.
Display devices are capable of displaying a variety of different types of image data, including image data captured by digital video or still photo cameras, image data obtained from video or still photo archives, image data produced by software applications, or even image data obtained from broadcast or streaming media, to name just a few examples. A display device may be integrated with, coupled to, or otherwise associated with a variety of devices, such as desktop or laptop computers, computer workstations, mobile devices such as personal digital assistants (PDAs) or mobile telephones, wireless communication devices, multi-media devices, cameras, or dedicated viewing stations such as televisions. A display device may comprise a liquid crystal display (LCD), a cathode ray tube (CRT) display, a plasma display, a projection display, or the like.
In many cases, a display device may have an inherent maximum resolution that is limited by the number of pixels of image data capable of being displayed. In general, display devices may produce a range of image resolutions at or below the inherent maximum resolution. If the image data or information, however, defines values for fewer than all of the display pixels, the device may scale the image data upward to a larger resolution. For example, a display device may produce additional pixels by interpolation to scale the image data to a larger format. As display devices become larger, image scaling becomes increasingly important. For mobile applications, even though users may desire larger displays, channel limitations tend to reduce the amount of image data that can be transmitted to a mobile device, resulting in smaller format images. Hence, image upscaling may be desirable for certain mobile applications.
Many techniques currently exist to achieve image upscaling or downscaling. Common interpolation techniques include bilinear interpolation, bicubic interpolation, cubic spline interpolation, and edge directed interpolation (EDI).
In general, this disclosure is directed to techniques for providing a dual lookup table design for edge-directed image scaling, such as upscaling or downscaling. This design provides support for gradient-based edge-directed algorithms, such as interpolation or decimation algorithms. In one form of interpolation algorithm, coefficients of an interpolation filter are adaptive to local gradient levels of image data, and may be stored in one of the lookup tables. This interpolation algorithm may produce sharper scaled images as compared to bicubic or cubic spline interpolation algorithms. Furthermore, the fidelity of the interpolated image, with respect to the original high-resolution image, may be enhanced. In some aspects, an edge-directed scaling method may involve certain complex operations, such as pixel-wise square-root and/or inverse operations. However, a dual lookup table design may support low complexity, memory-efficient implementations of edge-directed scaling.
In one aspect, the disclosure provides a method comprising obtaining one or more gradient values that each indicates a gradient between values of at least two pixels in a source image, generating one or more inverse gradient values from a first lookup table based on the one or more gradient values, and generating one or more edge-directed scaling filter coefficients from a second lookup table based on the one or more inverse gradient values. The method may further comprise generating an edge-directed scaling filter based on the edge-directed scaling filter coefficients, and applying the edge-directed scaling filter to the at least two pixels to generate an interpolated pixel.
In another aspect, the disclosure provides a device comprising a storage medium configured to store a first lookup table and a second lookup table, and one or more processors configured to obtain one or more gradient values that each indicates a gradient between values of at least two pixels in a source image. The one or more processors are also configured to generate one or more inverse gradient values from a first lookup table based on the one or more gradient values, and to generate one or more edge-directed scaling filter coefficients from a second lookup table based on the one or more inverse gradient values. The one or more processors may be further configured to generate an edge-directed scaling filter based on the coefficients, and to apply the filter to the at least two pixels to generate an interpolated pixel.
In another aspect, the disclosure is directed to a computer-readable medium containing instructions. The instructions cause a programmable processor to obtain one or more gradient values that each indicates a gradient between values of at least two pixels in a source image, generate one or more inverse gradient values from a first lookup table based on the one or more gradient values, and generate one or more edge-directed scaling filter coefficients from a second lookup table based on the one or more inverse gradient values. The computer-readable medium may contain further instructions that cause the programmable processor to generate an edge-directed scaling filter based on the edge-directed scaling filter coefficients, and apply the edge-directed scaling filter to the at least two pixels to generate an interpolated pixel.
The details of one or more aspects of the disclosure are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the disclosure will be apparent from the description and drawings, and from the claims.
In some cases, graphics device 100 may be capable of executing various applications, such as graphics applications, video applications, audio applications, and/or other multi-media applications. For example, graphics device 100 may be used for graphics applications, video game applications, video playback applications, digital camera applications, instant messaging applications, video teleconferencing applications, mobile applications, or video streaming applications.
Graphics device 100 may be capable of processing a variety of different data types and formats. For example, graphics device 100 may process still image data, moving image (video) data, or other multi-media data, as will be described in more detail below. The image data may include computer-generated graphics data. In the example of
In graphics device 100, graphics processing system 102 is coupled both to storage medium 104 and to display device 106. Storage medium 104 may include any permanent or volatile memory that is capable of storing instructions and/or data, such as, for example, synchronous dynamic random access memory (SDRAM), read-only memory (ROM), non-volatile random access memory (NVRAM), embedded dynamic random access memory (eDRAM), static random access memory (SRAM), or flash memory. Display device 106 may be any device capable of displaying image data for display purposes, such as an LCD (liquid crystal display), plasma display device, or other television (TV) display device.
Graphics processor 110 may be a dedicated graphics rendering device utilized to render, manipulate, and display computerized graphics. Graphics processor 110 may implement various complex graphics-related algorithms. For example, the complex algorithms may correspond to representations of two-dimensional or three-dimensional computerized graphics. Graphics processor 110 may implement a number of so-called “primitive” graphics operations, such as forming points, lines, and triangles or other polygon surfaces, to create complex, three-dimensional images on a display, such as display device 106.
Graphics processor 110 may carry out instructions that are stored in storage medium 104. Storage medium 104 is capable of storing application instructions 118 for an application (such as a graphics or video application), table information 112, and image data 120. Application instructions 118 may be loaded from storage medium 104 into graphics processing system 102 for execution. For example, one or more of control processor 108, graphics processor 110, and display processor 114 may execute instructions 118. In one aspect, application instructions 118 may comprise one or more downloadable modules that are downloaded dynamically, over the air, into storage medium 104.
Storage medium 104 further includes image data 120. Image data 120 includes data associated with one or more images, including still or moving images that may be processed within graphics processing system 102 and/or displayed on display device 106. Storage medium 104 also includes table information 112. Table information 112 may contain one or more tables, such as lookup tables, that may be loaded into and used by graphics processing system 102 when processing the image data 120.
For example, display processor 114 may use table information 112 to scale image data 120 for display purposes, as will be described in more detail below. Display processor 114 may, in many cases, either upscale or downscale image data 120 to generate corresponding scaled (such as upscaled or downscaled) image data 122 that is to be displayed on display device 106. In some cases, application instructions 118 may include certain instructions that, when executed by display processor 114, scale image data 120 to generate scaled image data 122.
When generating downscaled image data, display processor 114 may use one or more decimation algorithms or techniques. When generating upscaled image data, display processor 114 may use one or more algorithms or techniques, which may include interpolation. Common interpolation techniques may include bilinear interpolation, bicubic interpolation, cubic spline interpolation, or edge-directed interpolation (EDI). Some techniques, such as NEDI (New Edge-Directed Interpolation [Xin Li, Michael T. Orchard, IEEE Transactions on Image Processing, October 2001]), may require complex calculations that consume an excessive amount of system resources within graphics device 100, especially if graphics device 100 is a small mobile device. Further, some existing interpolation techniques may be unsuitable when image data 120 includes color image information, and these techniques may result in color bleeding or other artifacts.
In one aspect, graphics device 100 is capable of performing gradient-based edge-directed scaling, such as interpolation. A gradient-based edge-directed scaling algorithm may be implemented in one-dimensional or multi-dimensional (e.g., two-dimensional) scenarios. In certain cases, a one-dimensional implementation may be more favorable for hardware implementations in graphics device 100. Two-dimensional scaling may be implemented by two separate one-dimensional scaling processes, according to one aspect of this disclosure. For purposes of illustration only, and without limitation, the remainder of this disclosure assumes a one-dimensional scaling process.
In one aspect, graphics device 100 uses table information 112 to implement a gradient-based edge-directed scaling algorithm with respect to image data 120 and generate scaled image data 122. In this aspect, one or more of processors 108, 110, and 114 may receive one or more gradient values used for scaling of image data 120, each gradient value being associated with at least two pixels of image data 120. Processors 108, 110, and/or 114 may then obtain, as output from a first lookup table, one or more predetermined inverse gradient values by at least using the one or more gradient values as input into the first lookup table, and also obtain, as output from a second lookup table, one or more predetermined edge-directed scaling filter coefficients by at least using the one or more inverse gradient values as input into the second lookup table. Hence, the gradient values form first lookup table indices. The first lookup table maps the gradient values to corresponding predetermined inverse gradient values. The predetermined inverse gradient values then form second lookup table indices. The second lookup tables maps the predetermined inverse gradient values to corresponding, predetermined edge-directed scaling filter coefficients. The first lookup table and the second lookup table may be included within table information 112 and loaded into graphics processing system 102. The use of one or more lookup tables may help avoid various implementation complexities within graphics device 100 that may be associated with edge-directed interpolation.
In a scaling algorithm (such as a gradient-based edge-directed scaling algorithm) that supports arbitrary scaling factors, two major steps are often included: (1) location determination; and (2) the determination of the scaling filter coefficients. In general, location determination refers to determination of a location of a pixel that is to be interpolated as well as the identification of the pixels from the original image that should be involved in the interpolation of this pixel in the scaled image. Determination of scaling filter coefficients generally refers to determination of the filter coefficients that are to be used to form a scaling filter. The formed scaling filter may then be used to interpolate pixels in a scaled image. The details of each step are described below.
For clarity, the meaning of certain symbols is provided below:
With respect to location determination, it is possible to interpolate pixels on a row in the scaled image data 122 based on the pixels on the corresponding row in the original image data 120. For the pixel at location i in the scaled image data 122, its location x(i) in the original image data 120 is determined according to
x(i)=sx*i+tx (1),
where sx is defined as (original image width/scaled image width). The parameter tx is a constant which is predefined, naming an initial phase in a fixed-point implementation.
Equation (1) is a graphics-based location mapping. Different scaling factors may correspond to different sx values. Arbitrary scaling factors can be supported according to this mapping. The pixels in the original image data 120 that are used for the scaling may be determined by the location x(i). Half of the used pixels may be at one side of the location and the other half may be at the other side of the location.
After locating the pixels in the original image data 120 that are involved in scaling, determination may then be made of the scaling (e.g., upscaling, downscaling) filter coefficients. The scaling filter coefficients are used to form, or generate, a scaling filter that is used to scale the image data. For example, upscaling filter coefficients may be determined in order to complete interpolation, while downscaling coefficients may be determined to complete decimation. In cubic spline interpolation, the coefficients of the scaling filter are typically determined by location x(i), and often by the fractional part of x(i). In the edge-directed scaling algorithm, the coefficients of the cubic spline interpolation filter may, in some cases, be weighted according to local gradient levels. This principle may be illustrated in reference to
In this example, the pixels on the left side appear to change more slowly in intensity. Intuitively, if surrounding pixels are changing slowly in magnitude, the pixel to be interpolated may be more predictable. Based upon this observation, heavier weights can be assigned to the pixels that change slowly in magnitude. Thus, if A(Y) and B(Y) are the two candidate curves for interpolation of the pixel at site Y, B(Y) can be selected as the final scaling result.
In one aspect, the concept that heavier weights can be assigned to the slower-changing pixels is implemented through equations (2) to (5). Firstly, with the calculated gradients Δgl and Δgr, we may define the inverse gradients as
h
l=(1+αΔgl)−1/2 (2)
and
h
r=(1+αΔgr)−1/2 (3),
where α represents a scalar parameter, which controls the contribution of the gradients Δgl and Δgr to the inverse gradients hl and hr and eventually to the weighting method of filter coefficients. A larger α value generally leads to a sharper interpolated image. We tune α in a way such that the scaled image is sharp as well as of high fidelity. For example, the scaled image may exhibit high peak-signal-to-noise ratio (PSNR) values. Based on inverse gradients hl and hr, a weighting vector may be constructed as
where N is the number of taps of a scaling filter.
A cubic spline scaling filter may then be weighted by the weighting vector according to
where {circle around (x)} represents element-wise multiplication of two vectors, and ()T represents the transposing operator. The division operation may normalize the weighted filter coefficients to guarantee that the weighted interpolation filter has a gain of one at frequency zero (direct current, or DC, component). This may be important for a low-pass filter since the energy leakage at the DC component will change the average luminance level of the scaled image.
In one aspect, graphics device 100 (
As shown in
Gradient values calculator 300 is capable of calculating one or more gradient values that may be used for scaling purposes. Each gradient value may be calculated based upon the locations of two separate pixels within image data 120.
Gradient quantization module 302 is capable of performing non-uniform quantization of the gradient values calculated by gradient values calculator 300. In one aspect, the non-uniform quantization may comprise a non-linear quantization. As will be described in more detail below, the non-uniform quantization of the gradient values may generate a finite, often small, number of gradient values, which ultimately may help lower or minimize the size of table information 112, since these values may be used to access data within table information 112.
Inverse gradient lookup module 304 is capable of performing a first table lookup of predetermined, quantized inverse gradient values. This first table lookup may be performed on a first table within table information 112. Inverse gradient lookup module 304 may use the quantized gradient values generated by gradient quantization module 302 as an input into this first table to look up the predetermined, quantized inverse gradient values. For example, inverse gradient lookup module 304 may use the quantized gradient values as indices into the first table. The first lookup table maps the input indices provided by the quantized gradient values to predetermined, inverse gradient values. Hence, the first table provides, as output, the corresponding inverse gradient values. These inverse gradient values are predetermined and quantized values that may be stored within the first table. For example, these values may comprise pre-calculated values that are calculated based upon formulas and loaded into the first lookup table. In some cases, the values are pre-loaded into the first lookup table during manufacture of device 100. Each output inverse gradient value is quantized, such that is may have a finite size. The size of the first table may be reduced when the gradient values, which may be used as input into the table, are quantized by gradient quantization module 302.
As noted above, each output inverse gradient value may comprise a pre-calculated value. The first table, or Table One, may be used to substitute for a square-root computation and an inverse computation to provide inverse gradient values as output, as will be described in more detail below. In particular, the mapping between quantized gradient values and inverse gradient values may approximate a square root computation and an inverse computation, such that the inverse gradient values represent the output of such computations when the corresponding quantized gradient value is the input to the computations. For example, the mapping between quantized gradient values and inverse gradient values may approximate the square root and inverse computations shown in equations (2) and (3) above.
Address calculator 306 calculates an address that is used by filter coefficient lookup module 308 to perform a second table lookup of predetermined edge-directed scaling filters. A second lookup table, or Table Two, may be used when performing this second table lookup, and this second table may be stored within table information 112 (
Filter coefficient lookup module 308 is capable of performing a second table lookup of scaling filter coefficients. This second table lookup may be performed on a second table within table information 112. Scaling filter lookup module 304 may use the address from address calculator as an index into this second table to look up the scaling filter coefficients. In some aspects, the lookup operation performed by filter coefficient lookup module 308 may replace the computations in equations (4) and (5) shown above.
Once the predetermined edge-directed scaling filter coefficients have been read out of Table Two, they may be used by image scaling filter 310 to create a scaling filter that may be used to scale the image data 120 and generate an interpolated pixel in scaled image data 122 for display on display device 106. The use of Table One and Table Two may comprise a dual lookup table structure and may decrease the complexity of scaling within graphics device 100. The quantization of various values, such as gradient and/or inverse gradient values, may help minimize the sizes of these tables within table information 112. At the same time, an edge-directed scaling filter implementation may be performed within graphics device 100, which may provide improved scaling performance over certain other techniques, such as a cubic spline technique.
After image scaling filter 310 has used the scaling filter generate an interpolated pixel in scaled image data 122, additional interpolated pixels may be generated by repeating the processes implemented modules 300, 302, 304, 306, 308, and 310 for a plurality of source pixels from source image data 120. Edge-directed scaling filter coefficients may be repeatedly generated and applied to the plurality of source pixels in horizontal and/or vertical directions to generate the interpolated pixels. A “sliding window” may be used to repeatedly apply filter coefficients to source pixels when generating the interpolated pixels, such that one individual filter coefficient is applied to an individual source pixel within the “sliding window”. The “sliding window” may contain multiple source pixels, and may first be moved in a horizontal direction (left-to-right) across pixels within a row of the source image. The “sliding window” may also be moved in a vertical direction (up-down) to slide across the various pixels in the source image. As the “sliding window” moves, generated filter coefficients may be applied to the source pixels within the “sliding window”. In such fashion, the entire source image may be scaled by generating a plurality of interpolated pixels for a scaled image.
Gradient values calculator 300 first performs a subtraction operation for two adjacent pixels, and then performs an absolute-value operation. In the example of
Gradient quantization module 302 then performs non-uniform quantization of the gradient values. In the example of
Referring again to
Address calculator 306 calculates a lookup address that may be used by filter coefficient lookup module 308 to perform a lookup, in Table Two, of filter coefficients for the pixel that is to be interpolated. Address calculator 306 calculates an address for Table Two by using the inverse gradient values (unsigned, two-bit values) associated with P−1, P0 and with P1,P2 as input. Address calculator 306 also uses filter phase information as input.
In one aspect, the unsigned, five-bit value of phase “s” may specify any one of thirty-two different phase values. In this aspect, it may be assumed that the distance between any two adjacent pixels in the original image (such as between pixels P0 and P1 in
In one aspect, the phase may be derived from a status of a phase accumulator, which provides the value of phase “s” to address calculator 306. For example, the status of a phase accumulator associated with the Nth pixel in a horizontal dimension in the scaled image can be expressed as
temp64=Phase_init—x+X_phase_stepsize*N (6),
and the phase “s” may be derived as
s=((temp64+224)>>24)−(((temp64+224)>>29)<<5) (7),
where X_phase_stepsize may be defined as
X_phase stepsize=(in_width<<29)/out_width (8),
where in_width specifies the input width in the horizontal dimension, and out_width specifies the output width in the horizontal dimension.
In the above equation (7), the constant value of “29” may be introduced to obtain a fixed-point representation of the corresponding floating number. Consequently, unit “1” may be represented by the constant “229”. In equation (7), the constant “224” may be used for rounding purposes. As for initial phase termPhase_init_x, there are several different methods that may be used to calculate it. In one aspect, it may be assumed that Phase_init_x is equal to zero.
Referring again to
As stated above, in this example, Table One includes 28-m entries. Inverse gradient lookup module 304 performs a lookup of two predetermined inverse gradient values using the two quantized gradient values as input. One quantized gradient value is shown in
In one aspect, Table One may be developed to substitute for the arithmetic operations involved in equations (2) and (3) shown previously (above). From equations (2) and (3), it can be observed that a direct implementation of them would contain square-root and inverse operations. These kinds of operations may not be favored by a hardware implementation within graphics device 100, in certain cases. As shown in
In equation form, an inverse gradient value output of Table One can be expressed in terms of input as
where 2m is the quantization factor that is used to quantize the input gradient values. One can see that this equation is a fixed-point and clamped version of the original equations (2) and (3). Equation (9) can be evolved from equations (2) and (3) as follows. First, by expressing the gradient levels Δgl,/r as their quantized versions 2m xl/r, equations (2) and (3) become
In one aspect, the range of hl/r in equation (10) is [0, 1]. Then, if hl/r is quantized with a factor of ⅛ and the results floored, equation (10) becomes
where yl/r represents the quantized inverse gradient values, and the scalar 0.5 in equation (11) is used for rounding purposes. Lastly, a clamping operation “clamping (yl/r, 4, 7)” may be performed. If yl/r<4, yl/r may be replaced by 4. If yl/r>7, yl/r may be replaced by 7.
Thus, in certain cases, yl/r can have any integer values that are between 4 and 7 (inclusive). In addition, to save bits, it is possible to shift the range [4, 7] to [0, 3] by subtracting a scalar value of four from yl/r, such that the final result is expressed in equation (9), according to one aspect.
Based upon equation (9), in certain example scenarios, Table One's distinct outputs may correspond to integer values of 0, 1, 2, or 3. One potential objective of limiting the number of distinct outputs of Table One may be to reduce the size of Table Two (shown in
In one example scenario, with respect to
As is shown in the example of
In one aspect, as Table One may be used to replace the computations in equations (2) and (3) (shown previously above), Table Two may be built to replace the computations in equations (4) and (5). For example, a division operation is involved in equation (5), which may have high complexity for hardware implementation within graphics device 100. By using Table One to replace certain computations and Table Two to replace others, such that these tables contain predetermined (such as pre-calculated) values, the complexity for implementation within graphics device 100 may be significantly reduced.
In addition, by controlling the number of distinct outputs of Table One, the size of Table Two may be significantly reduced, to help minimize the size of table information 112 within storage medium 104. As noted previously, table information 112 may include both Table One and Table Two. In the example of
In
With the obtained inverse gradient values, the scaling filter coefficients are calculated according to equation (5). The entries contained within Table Two may be predetermined (e.g., pre-calculated) and loaded into memory to form the contents of Table Two.
Each entry 400A-400N within Table Two contains one or more phases. For example, as shown in
Address calculator 306 uses the quantized inverse gradient values and phase information to calculate an address of a specific phase within a given entry 400A-440N of Table Two. For example, in one scenario, address calculator 306 may generate an address that identifies phase 402A within entry 400A of Table Two, such that filter coefficient lookup module 308 may perform of lookup of edge-directed scaling filter coefficients 404A-404N associated with phase 402A. These edge-directed scaling filter coefficients may then be provided as output from Table Two (see, e.g.,
Each phase 402A-402N in entry 400A contains a plurality of edge-directed scaling filter coefficients, and each phase 412A-412N in entry 400N contains a plurality of edge-directed scaling filter coefficients. Phase 402A includes filter coefficients 404A-404N; phase 402N includes filter coefficients 406A-406N; phase 412A includes filter coefficients 414A-414N; and phase 412N includes filter coefficients 416A-416N. These filter coefficients may be provided as output from Table Two. In one aspect, the number of filter coefficients associated with each phase may depend on the type of image scaling filter 310 that is used. For example, if image scaling filter 310 is a four-tap filter, then four filter coefficients for a phase may be provided as output from Table Two for use by image scaling filter 310 (where each tap is associated with one of the filter coefficients). If, however, image scaling filter 310 is an eight-tap filter, then eight filter coefficients for a phase may be provided as output. In one aspect, each of the values of the edge-directed scaling filter coefficients in entries 400A-400N (such as coefficients 404A-404N, 406A-406N, 414A-414N, and/or 416A-416N) may comprise a positive integer value, a negative integer value, or a value or zero. In other aspects, other values may be used for the filter coefficients.
In one example scenario, where Table Two includes sixteen entries, the order and indexing of these entries within Table Two, based upon the outputs of Table One, are shown below in Table B. In one aspect, address calculator 306 may calculate these indexes. Each index may then be associated with one of the entries within Table Two, such as, for example, one of entries 400A-400N.
Thus, in one scenario, the calculation of the address by address calculator 306 of the scaling filter coefficients within Table Two may contains two parts. In the first part, the entry index is determined according to ((yl<<2)+yr). This may determine the corresponding entry within Table Two, such as one of entries 400A-400N. Address calculator 306 may then determine the starting address of the scaling filter coefficients in the corresponding entry according to the phase (such as “Phase s” shown in
In one example, the filter coefficients may be used for interpolation. For example, in reference to
In one aspect, the filter coefficients may also be used for decimation. In this aspect, pixels in the original image are downscaled. In downscaling, the phase step is typically greater than one, where in upscaling, the phase step is typically less than one. The phase step may be defined for horizontal and vertical dimensions respectively. For the horizontal dimension, it may be defined as (input_width/output_width), and in the vertical dimension, it may be defined as (input_height/output_height). The various techniques described above with respect to scaling may be applied to both upscaling and downscaling operations, where the phase step for downscaling may often be greater than one.
As described previously, one objective of limiting the number of distinct outputs of Table One may be to reduce the size of Table Two, given that Table One's outputs are among Table Two's inputs. In one aspect, a significant reduction of Table One's distinct outputs (for quantized inverse gradient values) results in negligible or no performance degradation of operation of graphics device 100. This may be partially due to the nonlinear property of the matching curve (equation (2)), and may also be partially due to the fact that many gradient levels in a natural image tend to distribute in a certain range. For example, gradient values that are larger than one hundred are generally rare in a natural image.
In
In
Because, in many cases, gradient values larger than one hundred are generally rare in a natural image, and because a range of values between [16, 100] often covers most structure-representing gradient levels in a natural image, quantization of both gradient values and inverse gradient values can be performed while maintaining the sharpness of the scaled image. In addition, through use of quantization, and use of two lookup tables (Table One and Table Two), an edge-directed scaling technique may be implemented within graphics device 100 without requiring the complexity of complicated algorithms or calculations that may otherwise need to be performed by graphics device 100.
At 600, gradient quantization module 302 (
At 602 of
In one aspect, the one or more quantized inverse gradient values that are stored in Table One comprise predetermined values. In some cases, these predetermined inverse gradient values are calculated and pre-stored in Table One based upon one or more non-uniform quantization algorithms. The one or more non-uniform quantization algorithms may include one or more clamping functions, as was described previously.
At 604 of
In one aspect, filter coefficient lookup module 308 and address calculator 306 may generate the one or more predetermined edge-directed scaling filter coefficients from Table Two based on the one or more inverse gradient values and also phase information.
At 606 of
In one aspect, graphics device 100 repeats the obtaining of the one or more gradient values (600), generating the one or more inverse gradient values (602), and generating the one or more edge-directed scaling filter coefficients (604) for a plurality of pixels from image data 120 in the source image in order to generate a plurality of interpolated pixels in scaled image data 122 of the scaled image. Device may also repeat the generating of an edge-directed filter (606) and applying the edge-directed filter (608) during this process.
At 700, gradient quantization module 302 (
At 702 of
At 704 of
At 706, filter coefficient lookup module 308 (
At 708, image scaling filter 310 (
After image scaling filter 310 has generated the interpolated pixel, graphics device 100 may repeat 700, 702, 704, 706, and 708 to apply generated edge-directed scaling filter coefficients, in a repeated fashion, to a plurality of source pixels in the source image in a horizontal and/or a vertical direction to generate interpolated pixels of the scaled image. A “sliding window” may be used to repeatedly apply filter coefficients to source pixels in the source image when generating the interpolated pixels, such that one individual filter coefficient is applied to an individual source pixel within the “sliding window”. The “sliding window” may contain multiple source pixels, and may first be moved in a horizontal direction (left-to-right) across pixels within a row of the source image. The “sliding window” may also be moved in a vertical direction (up-down) to slide across the various pixels in the source image. As the “sliding window” moves, generated filter coefficients may then be applied to the source pixels within the “sliding window”. In such fashion, the entire source image may be scaled by generating a plurality of interpolated pixels for a scaled image.
The implementation of a dual lookup table design, such as by using a first lookup table that stores predetermined inverse gradient values and a second lookup table that stored predetermined edge-directed scaling filters, may provide various benefits and advantages. For example, a dual lookup table design may help minimize or avoid the use complex computations and arithmetic operations within graphics device 100. Thus, the hardware complexity for certain scaling functionality within graphics device 100 may be minimized. In addition, the use of quantization, such as non-uniform quantization, may help reduce the size of the lookup tables, while still maintaining the performance an edge-directed scaling algorithm. Quantized gradient values may serve as input into the first lookup table, which may then provide, as output, quantized inverse gradient values. These quantized inverse gradient values may then serve as input into the second lookup table. Because the inverse gradient values are quantized, the size of the second lookup table can be significantly decreased.
The techniques described in this disclosure may be implemented within a general purpose microprocessor, digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA), or other equivalent logic devices. Accordingly, the terms “processor” or “controller,” as used herein, may refer to any of the foregoing structures or any other structure suitable for implementation of the techniques described herein.
The various components illustrated herein may be realized by any suitable combination of hardware, software, firmware, or any combination thereof. In the figures, various components are depicted as separate units or modules. However, all or several of the various components described with reference to these figures may be integrated into combined units or modules within common hardware and/or software. Accordingly, the representation of features as components, units or modules is intended to highlight particular functional features for ease of illustration, and does not necessarily require realization of such features by separate hardware or software components. In some cases, various units may be implemented as programmable processes performed by one or more processors.
Any features described herein as modules, devices, or components, including graphics device 100 and/or its constituent components, may be implemented together in an integrated logic device or separately as discrete but interoperable logic devices. In various aspects, such components may be formed at least in part as one or more integrated circuit devices, which may be referred to collectively as an integrated circuit device, such as an integrated circuit chip or chipset. Such circuitry may be provided in a single integrated circuit chip device or in multiple, interoperable integrated circuit chip devices, and may be used in any of a variety of image, display, audio, or other multi-media applications and devices. In some aspects, for example, such components may form part of a mobile device, such as a wireless communication device handset.
If implemented in software, the techniques may be realized at least in part by a computer-readable medium comprising code with instructions that, when executed by one or more processors, performs one or more of the methods described above. The computer-readable medium may form part of a computer program product, which may include packaging materials. The computer-readable medium may comprise random access memory (RAM) such as synchronous dynamic random access memory (SDRAM), read-only memory (ROM), non-volatile random access memory (NVRAM), electrically erasable programmable read-only memory (EEPROM), embedded dynamic random access memory (eDRAM), static random access memory (SRAM), flash memory, magnetic or optical data storage media.
The techniques additionally, or alternatively, may be realized at least in part by a computer-readable communication medium that carries or communicates code in the form of instructions or data structures and that can be accessed, read, and/or executed by one or more processors. Any connection may be properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Combinations of the above should also be included within the scope of computer-readable media. Any software that is utilized may be executed by one or more processors, such as one or more DSP's, general purpose microprocessors, ASIC's, FPGA's, or other equivalent integrated or discrete logic circuitry.
Various aspects of the disclosure have been described. These and other aspects are within the scope of the following claims.