Differences between revisions 5 and 6
Revision 5 as of 2008-11-25 04:00:38
Size: 2403
Editor: localhost
Comment:
Revision 6 as of 2008-11-25 10:52:54
Size: 2544
Editor: jason
Comment:
Deletions are marked like this. Additions are marked like this.
Line 9: Line 9:
=== Video Formatting ===
Line 10: Line 12:

=== Video Clipping ===

The CX2388x also has hardware support for clipping regions of arbitrary complexity.

Raw Video

The CX2388x video stream (function 0) allows for raw pixel data to be transferred either from an analog frontend or VIP-compliant device into host memory. The raw video stream supports a variety of pixel formats, and can utilize either packed or planar color formats. One DMA channel is used to transfer either packed pixel data or the Y color plane, while two additional channels are provided to transfer the U and V color planes (obviously for planar formats only). A fourth DMA channel can be used to transfer vertical blanking interval (VBI) data, which is typically used to convey teletext or closed captioning.

The ioctl(2) interface is provided by /usr/local/include/cx88/cx88_video_ioctl.h, and works in a similar fashion to the MPEG TS ioctl interface. The video stream does expose a richer set of controls than MPEG TS, because raw video is fundamentally more flexible from a hardware standpoint. Besides using an actual hardware decoder, there are few meaningful transformations that can be made in hardware to an MPEG stream.

The buffering scheme for raw video works in a slightly different way than for MPEG--the CX88_VIDEO_CONFIGURE ioctl requires the number of frames, and each buffer that is allocated by the driver (or provided by the application) will constitute a single frame for its color or VBI channel. Additionally, the CX88_VIDEO_FORMAT ioctl should be issued before CX88_VIDEO_CONFIGURE in order to obtain buffer geometry for each channel.

Video Formatting

The CX2388x video function can perform image scaling and cropping in hardware, and the CX88_VIDEO_FORMAT ioctl takes advantage of this by allowing the application to specify the scaled size of the image through the in_rows and in_cols fields of the ioctl parameter structure. Scaling is typically used to make the image smaller rather than larger, though (for example) an NTSC frame can be scaled as high as 720x480, while an unscaled NTSC frame would have 640 and 480 in the in_cols and in_rows fields, respectively. The in_x_offset, in_y_offset, in_x_size, and in_y_size can then be used to set the cropping region with respect to the scaled image. Buffer sizes for each channel can be computed using the out_geoms field, in which the num_lines subfield will typically be the same as in_y_size, and the line_size field will typically be in_x_size * <bytes per pixel>.

Video Clipping

The CX2388x also has hardware support for clipping regions of arbitrary complexity.

Overview/RawVideo (last edited 2008-12-03 14:22:30 by localhost)