There are several stages of digital processing that are performed on input video, before obtaining the final pixels of an image or frame that is then applied to a display screen. Most digital video players can interface with different types of video sources, including different broadcast and video coding formats, for example National Television Standards Committee, NTSC, and Motion Picture Experts Group, MPEG, formats. A converter is therefore typically provided in an initial stage, to perform a conversion from an NTSC analog signal or an MPEG digital signal, into an uncompressed digital video stream. This stream is then fed to an integrated circuit (IC) referred to here simply as a digital television (TV) chip. The digital TV chip is often physically located inside a personal computer (PC), a television set-top box, or the display device.
The digital TV chip has a display processing engine (DPE), also referred to as a video pipeline or a display processing pipeline. The DPE receives the uncompressed video stream, and processes the stream to make it suitable for a particular display device. The DPE also has a number of stages. One of these stages may perform noise reduction. Another enhances the stream, e.g. with respect to sharpness or contrast. Both may be designed to improve how the stream will appear when displayed. The DPE may also have a format adjustment stage. The format adjustment stage changes the resolution of the video stream, its refresh rate, and/or its scan rate, to suit a particular type of display device (such as a high definition television, HDTV, display device, liquid crystal display (LCD), plasma, and cathode ray tube (CRT)).
A video stream is received by the DPE typically in raster scan order, e.g. transferred from external memory in the order of the horizontal lines of the display screen as they are scanned left to right (or right to left), top to bottom (or bottom to top). The external memory may include off-chip, random access memory (RAM) devices, such as dynamic RAM devices. The memory devices may be part of the main or system memory of a PC, such as one that uses a PENTIUM® processor by Intel Corp., Santa Clara, Calif. The enhanced stream may then be forwarded by the DPE directly to the display device.
Format adjustment by the DPE may be performed in part by a scaling stage. The scaling operation is designed to shrink or expand the video frames in horizontal and/or vertical directions. In some applications, such as converting from an older, broadcast television standard to HDTV, the scaling operation needs to be of finer granularity. Fine granularity scaling is typically performed using a special type of digital filter called a polyphase filter.
A DPE may implement vertical scaling, i.e. stretching or shrinking in the vertical direction of a frame, using a polyphase filter, as follows. Consider a DPE that has five, local (on-chip) line memories, each being large enough to store the pixels of an entire horizontal line of an image or frame that fills the entire display screen. An output from each of the five line memories is coupled to a 5-tap (five input) polyphase filter. The polyphase filter produces a single pixel value at its output, for every column of five input pixels, obtained from the line memories. Consistent with raster scan order, the DPE typically loads five complete rows of the image or frame sequentially, from off-chip memory into its line memories. Once the line memories have been loaded, the polyphase filter output is enabled and taken as a new set of pixel values (for the scaled image). Note that depending on the magnitude of the downscaling or upscaling, the DPE may need to read additional rows of the frame into its line memories (which may replace ones that were read earlier), to generate greater or fewer output pixels for the scaled image.
As an example of the above technique, consider video having 1920×1080 pixel resolution (suitable for HD television). Each line memory in that case is about 2000 pixels wide, to fit a complete row of 1920 pixels (the horizontal width of the frame). Thus, for a 4:2:2 Y-Cr-Cb color configuration at 8 bits/pixel, this operation requires the following line memory sizes:
The embodiments of the invention are illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar elements. It should be noted that references to “an” embodiment of the invention in this disclosure are not necessarily to the same embodiment, and they mean at least one.
An embodiment of the invention is directed to techniques for vertical scaling of digital images or digital video using polyphase filters. Other embodiments are also described.
The transfer of video frame pixel data from the memory, to fill the on-chip buffer 112 of the DTV chip for processing, may occur in multiple memory transactions, e.g. multiple memory burst transfers. For example, the memory 104 may include double data rate (DDR) random access memory (RAM) for which there is a well defined mechanism for memory burst transfers. Burst transfers are aligned with certain memory address boundaries. For example, a burst may be word aligned, that is the burst includes an integer number of words starting at a given address (where each word includes two or more bytes). Alternatively, the burst transfer may be aligned with larger or smaller chunks of memory. A memory burst transfer is more efficient than transferring the same number of words using multiple, smaller transactions.
Operation of the environment depicted in
If the strip width is an integer multiple of the width of the buffer 112 and an integer multiple of the burst size, then memory access penalties associated with reading excess data beyond what is needed to fill the buffer (which data is essentially discarded) are thus avoided, so that memory transfer cycles are saved. This savings becomes more significant with larger frames (e.g., HD frames), and higher frame rate for high quality video (e.g., more than 30 frames per second).
In addition to the savings in overhead associated with memory transactions, an embodiment of the invention allows for reduced on-chip buffer or line memory size, thereby reducing the chip real estate needed for video processing. For example, taking the case of 1920×1080 HD video described in the Background section above, the line memory size needed using an embodiment of the invention is as follows (for the example of a 5 tap polyphase filter, and 4:2:2 Y, Cr, Cb color configuration, and 8 bits/pixel):
Referring now to
Returning to
To produce an initial output by the polyphase filter, an initial set of N line segments would need to be read from a given strip or region 204 (see
In general, the strip width may be selected to make efficient transfers to the on-chip buffer, based on the memory bus width. For example, the strip width may be an integer multiple of a memory burst size. It has been determined, however, that with external memory, the line memory width need not be more than a single memory burst width. Keeping each line memory width exactly equal to a single memory burst width avoids access penalties associated with unaligned memory reads, but may also be a desirable tradeoff between chip real estate and greater buffering. As an example, for 64 bit DDR memories and 8-bit pixels, the strip width should be 64 bytes, with a burst size of 8 bytes, and a line memory width in the on-chip buffer of 8 bytes.
Turning now to
The transfer may be implemented by a direct memory access (DMA) channel that links the chip 312 to the main memory. As to vertical scaling, this may be performed, as described above, by a polyphase filter with N taps, each tap being coupled to a respective on-chip line segment buffer. The on-chip buffer is to store up to N line segments of a strip, where each line segment buffer may be of the same width as the memory burst width.
According to another embodiment of the invention, the frame buffer memory is on-chip with the polyphase filter and its on-chip/local buffer. In that case, the on-chip buffer may be part of the scratch memory that is typically inside an on-chip DMA engine.
The vertical scaling as mentioned above is implemented by an n-input, one-dimensional operator. In that case, an output pixel of the operator depends on a column of n pixels, and not on those of neighboring columns. The entire frame may be processed in this manner during a first pass. This may be combined with a second pass in which another one-dimensional operator is applied, this time for horizontal scaling. The combination of the two passes achieves the desired two-dimensional scaling. An application of this type of format adjustment is the conversion from NTSC 4:3 to HD 16:9 (via two-dimensional, anamorphic scaling).
Also, there may be more than one input video stream that is fed to the display processing pipeline of the DTV chip. For example, one stream is to be shown full screen on a television display device while another is to be shown as a picture-in-picture (PIP) or as a picture-over-picture (POP), on the same display screen.
Referring now to
An embodiment of the invention may be a machine readable medium having stored thereon instructions which program a processor to perform some of the operations described above, e.g. performing image processing such as vertical scaling upon image portions that have been transferred from memory. In other embodiments, some of these operations might be performed by specific hardware components that contain hardwired logic. Those operations might alternatively be performed by any combination of programmed computer components and custom hardware components.
A machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), not limited to Compact Disc Read-Only Memory (CD-ROMs), Read-Only Memory (ROMs), Random Access Memory (RAM), Erasable Programmable Read-Only Memory (EPROM), and a transmission over the Internet.
Further, a design may go through various stages, from creation to simulation to fabrication. Data representing a design may represent the design in a number of manners. First, as is useful in simulations, the hardware may be represented using a hardware description language or another functional description language. Additionally, a circuit level model with logic and/or transistor gates may be produced at some stages of the design process. Furthermore, most designs, at some stage, reach a level of data representing the physical placement of various devices in the hardware model. In the case where conventional microelectronic fabrication techniques are used, data representing a hardware model may be the data specifying the presence or absence of various features on different mask layers for masks used to produce the integrated circuit. In any representation of the design, the data may be stored in any form of a machine-readable medium.
The invention is not limited to the specific embodiments described above. For example, although the embodiments of the invention were described above with reference to video, the technique of dividing the frame into strips and transferring portions of the strip to an on-chip buffer for further on-chip processing may also be applied to still images. Also, any reference to “pixel” is not limited to the example used above of a single, 8-bit value. Accordingly, other embodiments are within the scope of the claims.