sensor_format_video_cbycry_t

Updated: April 19, 2023

Format for a YCbCr 4:2:2 packed frame type

Synopsis:

#include <sensor/sensor_api.h>
typedef struct sensor_format_video_cbycry_t {
    uint64_t bufsize;
    uint32_t height;
    uint32_t width;
    uint32_t stride;
    uint32_t packing;
    uint32_t bpp;
    bool le;
} sensor_format_video_cbycry_t;

Data:

uint64_t bufsize
The size of the buffer as a 64-bit integer.
uint32_t height
The height of the image, in pixels.
uint32_t width
The width of the image, in pixels.
uint32_t stride
The number of bytes between the first pixel of the first row in memory and the first pixel of the second row in memory.

Stride is often called pitch.

uint32_t packing
The inter-pixel distance, in bits.
uint32_t bpp
The number of bits used to encode a pixel value.
bool le
The endian order used for packing the data.

A value of true indicates that the bytes are packed in little-endian order; a value of false indicates that the bytes are packed in big-endian order.

Library:

libsensor

Description:

Use this format when SENSOR_FORMAT_VIDEO_CBYCRY is reported as the sensor_format_t.

Each set of 2 pixel values in the CbYCrY frame is part of a macro-pixel. A macro-pixel is thus made up of four components in the following order: a Cb (blue-difference chroma) component and Y (luma) component (which comprise the first pixel value), and a Cr (red-difference chroma) component and Y (luma) component (which comprise the second pixel value). Each macro-pixel is stored contiguously on the same line.

Each pixel contains a number of bits indicated by bpp and is stored in the packing field. The endian order le indicates if the bit packing was done in little-endian or big-endian order.

For example, le = true, bpp = 16, and packing = 16 describes a macro-pixel stored as follows:
 Bit:        0 1 2 3 4 5 6 7  01234567 0 1 2 3 4 5 6 7  01234567
 Scanline n: CbCbCbCbCbCbCbCb YYYYYYYY CrCrCrCrCrCrCrCr YYYYYYYY = 32 bits