Method and apparatus for image scaling

Information

  • Patent Application
  • 20080043148
  • Publication Number
    20080043148
  • Date Filed
    August 18, 2006
    18 years ago
  • Date Published
    February 21, 2008
    16 years ago
Abstract
A source image with an input vertical resolution and an input horizontal resolution is received using an input clock signal. An intermediate image with an output vertical resolution and the input horizontal resolution is generated using an intermediate clock signal by scaling the source image. An output image with the output vertical resolution and an output horizontal resolution is generated using an output clock signal by scaling the intermediate image. The frequency of the intermediate clock signal is equal to the frequency of the output clock signal multiplied by the ratio of the input horizontal resolution to the output horizontal resolution.
Description

BRIEF DESCRIPTION OF THE DRAWINGS

These and other features, aspects, and advantages of the present invention will become better understood with regard to the following description, appended claims, and accompanying drawings where:



FIG. 1 shows a conventional image scaler;



FIG. 2 is a flowchart showing a method for scaling an image according to one embodiment of the invention;



FIG. 3 shows a PLL used to scale an image by the method shown in FIG. 2.





DESCRIPTION OF THE PREFERRED EMBODIMENTS

Reference will now be made in detail to the present preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numbers are used in the drawings and the description to refer to the same or like parts.



FIG. 2 is a flowchart showing a method for scaling an image according to one embodiment of the invention. A source image with an input vertical resolution and an input horizontal resolution is received using an input clock signal (step 202). An intermediate image with an output vertical resolution and the input horizontal resolution is generated using an intermediate clock signal by scaling the source image (step 204). An output image with the output vertical resolution and an output horizontal resolution is generated using an output clock signal by scaling the intermediate image (step 206).


The frequency of the intermediate clock signal is equal to the frequency of the output clock signal multiplied by the ratio of the input horizontal resolution to the output horizontal resolution, represented as:







intermediate





clock

=

output





clock
×


input





horizontal





resolution


output





horizontal





resolution







For example, the resolution of the source image is 720×240, and the resolution of the output image is 640×480. In step 202, the source image is received using the input clock signal with a frequency of 13.5 MHz, which is determined by the resolution of the source image. In step 204, the received source image scales up the vertical resolution from 240 lines to 480 lines while the horizontal resolution thereof remains unchanged, and thus the intermediate image with a 720×480 resolution is generated using the intermediate clock signal with a frequency of 28.35 MHz. In step 206, the intermediate image scales down the horizontal resolution from 720 pixels to 640 pixels while the vertical resolution thereof remains unchanged, and therefore the output image is generated using the output clock signal with a frequency of 25.2 MHz.


In the preferred embodiment, the source image and the output image can have the same or different aspect ratios, and the scaling steps can selectively scale up or scale down the images. Moreover, the intermediate clock signal and the output clock signal can both be generated by a phase-locked loop, which is modified to have two frequency dividers for outputting clock signals with different frequencies, respectively. More particularly, a ratio of the factors of the two frequency dividers is equal to the ratio the input horizontal resolution to the output horizontal resolution as mentioned above. Therefore, the preferred embodiment can have both of the required clock signals with only one modified phase-locked loop, saving the occupied area thereof.



FIG. 3 shows a PLL used to scale an image by the method shown in FIG. 2. The phase-locked loop 300 has a pre-divider (1/N) 302, a phase frequency detector (PFD) 304, a charge pump/low pass filter (CP/LPF) 306, a voltage controlled oscillator (VCO) 308, a loop divider (M) 310, a first frequency divider (1/P1) 312 and a second frequency divider (1/P2) 314. The pre-divider 302 divides a frequency of a reference clock signal by N. The phase frequency detector 304 aligns a rising edge of the divided reference clock signal to a feedback from the voltage controlled oscillator 308 and the loop divider 310.


The first frequency divider 312 outputs the intermediate clock signal for generating the intermediate image, and the second frequency divider 314 outputs the output clock signal for generating the output image. The frequency of the intermediate clock signal is equal to the frequency of the output clock signal multiplied by the ratio of an input horizontal resolution of the source image to an output horizontal resolution of the output image. More precisely, the ratio of the factors of the two frequency dividers 312 and 314 is equal to the ratio of the input horizontal resolution to the output horizontal resolution


In other words, the preferred embodiment can also provide an image scaler, which uses a modified phase-locked loop instead of two conventional phase-locked loops. The image scaler is characterized by comprising the modified phase-locked loop 300, which has two frequency dividers 312 and 314 IS for outputting the intermediate clock signal and the output clock signal, respectively, and the frequency of the intermediate clock signal is equal to the frequency of the output clock signal multiplied by the ratio of the input horizontal resolution to the output horizontal resolution.


The following describes the comparison of minimal memory buffer size between the first conventional image scaler, the second conventional image scaler and the image scaler of the preferred embodiment as mentioned above. For the three image scalers, the resolution of the source image is 720×240, the resolution of the intermediate image is 720×480, and the resolution of the output image is 640×480.


The First Conventional Image Scaler:

The frequency of the input clock signal is 13.5 MHz, the frequency of the output clock signal is 25.2 MHz, and the frequency of the intermediate clock signal is 27 MHz.


Time for horizontal pixel buffer write is 720×(1/27M)=26666 ns.


Time for horizontal pixel buffer read is 640×(1/25.2M)=25396 ns.


The minimal horizontal pixel buffer size is (26666−25396)×27=47 pixels.


The Second Conventional Image Scaler:

The frequency of the input clock signal is 13.5 MHz, the frequency of the output clock signal is 25.2 MHz, and the frequency of the intermediate clock signal is 25.2 MHz.


Time for horizontal pixel buffer write is 720×(1/25.2M)=28571 ns.


Time for horizontal pixel buffer read is 640×(1/25.2M)=25396 ns.


The minimal horizontal pixel buffer size is (28571−25396)×25.2=80 pixels.


The Image Scaler of the Preferred Embodiment:

The frequency of the input clock signal is 13.5 MHz, the frequency of the output clock signal is 25.2 MHz, and the frequency of the intermediate clock signal is 25.2×(720/640)=28.35 MHz.


Time for horizontal pixel buffer write is 720×(1/28.35M)=25396 ns.


Time for horizontal pixel buffer read is 640×(1/25.2M)=25396 ns.


The minimal horizontal pixel buffer size is (25396−25396)×28.35=0 pixels.


Accordingly, the preferred embodiment theoretically can make the size of the horizontal pixel buffer approach zero, substantially decreasing the occupied area of a memory buffer. However, in practice, some spare bits of the memory buffer still can be reserved for accidental data waiting.


In conclusion, the preferred embodiment can provide a phase-lock loop used in an image scaler and the method thereof, which especially determines the frequency of the intermediate clock signal by the relationship of the input horizontal resolution and the output horizontal resolution, to reduce the size of the horizontal pixel buffer. By this architecture, the chip size of the image scaler can be decreased, and only one modified phase-locked loop is required to complete the image scaling.


It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention without departing from the scope or spirit of the invention. In view of the foregoing, it is intended that the present invention cover modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.

Claims
  • 1. A method for image scaling, comprising the steps of: receiving a source image with an input vertical resolution and an input horizontal resolution using an input clock signal;generating an intermediate image with an output vertical resolution and the input horizontal resolution using an intermediate clock signal by scaling the source image; andgenerating an output image with the output vertical resolution and an output horizontal resolution using an output clock signal by scaling the intermediate image;wherein a frequency of the intermediate clock signal is equal to a frequency of the output clock signal multiplied by a ratio of the input horizontal resolution to the output horizontal resolution.
  • 2. The method for image scaling as claimed in claim 1, wherein the intermediate clock signal and the output clock signal are generated by a phase-locked loop.
  • 3. The method for image scaling as claimed in claim 2, wherein the phase-locked loop has two frequency dividers for outputting the intermediate clock signal and the output clock signal, respectively.
  • 4. The method for image scaling as claimed in claim 3, wherein a ratio of factors of the two frequency dividers is equal to the ratio of the input horizontal resolution to the output horizontal resolution.
  • 5. The method for image scaling as claimed in claim 1, wherein the source image and the output image have the same or different aspect ratios.
  • 6. The method for image scaling as claimed in claim 1, wherein the generating steps are scaling up or scaling down the images.
  • 7. An image scaler for scaling a source image into an output image via an intermediate image, wherein the source image has an input vertical resolution and an input horizontal resolution, and is received using an input clock signal, the intermediate image has an output vertical resolution and the input horizontal resolution, and is generated using an intermediate clock signal, and the output image has the output vertical resolution and an output horizontal resolution, and is output using an output clock signal, the image scaler characterized by comprising: a phase-locked loop with two frequency dividers for outputting the intermediate clock signal and output clock signal, respectively, wherein a frequency of the intermediate clock signal is equal to a frequency of the output clock signal multiplied by a ratio of the input horizontal resolution to the output horizontal resolution.
  • 8. The image scaler as claimed in claim 7, wherein a ratio of factors of the two frequency dividers is equal to the ratio of the input horizontal resolution to the output horizontal resolution.
  • 9. The image scaler as claimed in claim 7, wherein the source image and the output image have the same or different aspect ratios.