man pages section 3: Multimedia Library Functions

## mlib_VideoColorYUV420seq_to_YUYV422int(3MLIB)

#### Name

mlib_VideoColorYUV420seq_to_YUYV422int– convert YUV sequential to interleaved

#### Synopsis

```cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>

void mlib_VideoColorYUV420seq_to_YUYV422int(mlib_u32 *YUYV
const mlib_u8 *Y, const mlib_u8 *U, const mlib_u8 *V,
mlib_s32 w, mlib_s32 h, mlib_s32 dlb,
mlib_s32 ylb, mlib_s32 uvlb);```

#### Description

The Y, U, V pixel streams are combined into a YUYV pixel stream. All pixel components are 8-bit unsigned integers. The Y buffer has dimensions w and h. The U and V buffers have dimensions w/2 and h/2. Dimensions w and h are assumed to be even. Successive rows of the output buffer YUYV use successive rows of Y and the same rows of U and V.

The following equation is used:

```YUYV[r][c/2]   = (Y[r][c]     << 24) |
(U[r/2][c/2] << 16) |
(Y[r][c+1]   << 8) |
(V[r/2][c/2])

YUYV[r+1][c/2] = (Y[r+1][c]   << 24) |
(U[r/2][c/2] << 16) |
(Y[r+1][c+1] << 8) |
(V[r/2][c/2])```

where r = 0, 2, 4, ..., h-2; and c = 0, 2, 4, ..., w-2.

#### Parameters

The function takes the following arguments:

YUYV

Pointer to output buffer.

Y

Pointer to Y input buffer.

U

Pointer to U input buffer.

V

Pointer to V input buffer.

w

Image width in pixels.

h

Image height in lines.

dlb

Linebytes for YUYV buffer.

ylb

Linebytes for Y buffer.

uvlb

Linebytes for U and V buffers.

None.

#### Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE

ATTRIBUTE VALUE

Interface Stability

Committed

MT-Level

MT-Safe