Main Page   Modules   Data Structures   Data Fields   Related Pages  

rte_video_stream_params Struct Reference

#include <codec.h>


Data Fields

rte_framefmt framefmt
rte_pixfmt pixfmt
rte_bool spatial_order
rte_bool temporal_order
double frame_rate
double sample_aspect
unsigned int width
unsigned int height
unsigned int offset
unsigned int u_offset
unsigned int v_offset
unsigned int stride
unsigned int uv_stride
unsigned int frame_size


Detailed Description

Video input stream parameters.


Field Documentation

rte_bool rte_video_stream_params::spatial_order
 

Applies only when framefmt is RTE_FRAMEFMT_INTERLACED or RTE_FRAMEFMT_ALTERNATING. When 0, the interlaced frame or the stream starts with a top field, when 1 with a bottom field.

rte_bool rte_video_stream_params::temporal_order
 

Applies only when framefmt is RTE_FRAMEFMT_INTERLACED or RTE_FRAMEFMT_ALTERNATING. When 0, the first field of an interlaced frame or the stream is the older field, when 1 the second field is older.

double rte_video_stream_params::frame_rate
 

frame_rate (for example 24.0, 25.0, 30000 / 1001.0) is the nominal frame sampling rate, usually derived from the video standard. The codec may compare this value against frame timestamps to detect frame dropping.

double rte_video_stream_params::sample_aspect
 

Sampling aspect ratio, y / x. Examples:

  • Square pixels: 1.0
  • ITU-R Rec. 601 PAL or SECAM: 54.0 / 59.0
  • ITU-R Rec. 601 NTSC: 11.0 / 10.0 for anamorphic 16:9 multiply by 3.0 / 4.0.
The codec may store this information in the stream for correct playback.

unsigned int rte_video_stream_params::width
 

The image size in pixels. The encoded image size can be different due to scaling options. When the format is RTE_PIXFMT_YUV420 this refers to the luminance plane, and both width and height must be multiples of two. When the format is RTE_PIXFMT_YUYV (or its variants) width must be a multiple of two. Still a codec may modify the proposed width and height if only descrete values or other multiples are possible.

unsigned int rte_video_stream_params::height
 

The image size in pixels. The encoded image size can be different due to scaling options. When the format is RTE_PIXFMT_YUV420 this refers to the luminance plane, and both width and height must be multiples of two. When the format is RTE_PIXFMT_YUYV (or its variants) width must be a multiple of two. Still a codec may modify the proposed width and height if only descrete values or other multiples are possible.

unsigned int rte_video_stream_params::offset
 

Distance in bytes from the start of the image to the top- and leftmost pixel to be encoded: x0 * bytes per pixel + y1 * stride. Usually this value is zero. When the format is RTE_PIXFMT_YUV420 this refers to the luminance plane only. Aligning at addresses which are a multiple of a power of two may speed up encoding.

unsigned int rte_video_stream_params::u_offset
 

u_offset and v_offset apply only when the format is RTE_PIXFMT_YUV420, expressing the offset of the U (Cb) and V (Cr) plane from the start of the image in bytes.

unsigned int rte_video_stream_params::v_offset
 

u_offset and v_offset apply only when the format is RTE_PIXFMT_YUV420, expressing the offset of the U (Cb) and V (Cr) plane from the start of the image in bytes.

unsigned int rte_video_stream_params::stride
 

The distance from one pixel to the adjacent pixel in the next line, in bytes. If this is an interlaced image stride points to the opposite field. When the format is RTE_PIXFMT_YUV420 this refers to the luminance plane only. Aligning lines at addresses which are a multiple of a power of two may speed up encoding. Usually stride is width * bytes per pixel, but a codec may accept any larger or smaller value.

unsigned int rte_video_stream_params::uv_stride
 

uv_stride applies only when the format is RTE_PIXFMT_YUV420, the distance from one pixel to the adjacent pixel in the next line, in bytes, of both the U (Cb) and V (Cr) plane. (No separate values to keep encoders simple.) Usually this value is stride / 2.

Watch your color subsampling in interlaced pictures: U/V line 0, 1 belong to frame line 0+1, 2+3 when framefmt is RTE_FRAMEFMT_PROGRESSIVE or RTE_FRAMEFMT_ALTERNATING; to frame line 0+2, 1+3 when @ p framefmt is RTE_FRAMEFMT_INTERLACED.

unsigned int rte_video_stream_params::frame_size
 

Indicates the size of the frame buffer relative to its start which can be safely accessed by the encoder. The image as described by width, height, the offsets and strides must lie completely within these bounds. When frame_size is zero only the actual image data can be accessed (which may be less efficient depending on alignment, and such a configuration may be rejected by a codec altogether).


Generated at Wed Mar 22 23:35:36 2006 for RTE Library by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001