|
static pstatus_t | general_LumaToYUV444 (const BYTE *const WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], const RECTANGLE_16 *WINPR_RESTRICT roi) |
|
static pstatus_t | general_ChromaFilter (BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16 *WINPR_RESTRICT roi) |
|
static pstatus_t | general_ChromaV1ToYUV444 (const BYTE *const WINPR_RESTRICT pSrcRaw[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pDstRaw[3], const UINT32 dstStep[3], const RECTANGLE_16 *WINPR_RESTRICT roi) |
|
static pstatus_t | general_ChromaV2ToYUV444 (const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nTotalWidth, UINT32 nTotalHeight, BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16 *WINPR_RESTRICT roi) |
|
static pstatus_t | general_YUV420CombineToYUV444 (avc444_frame_type type, const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], UINT32 nWidth, UINT32 nHeight, BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const RECTANGLE_16 *WINPR_RESTRICT roi) |
|
static pstatus_t | general_YUV444SplitToYUV420 (const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pMainDst[3], const UINT32 dstMainStep[3], BYTE *WINPR_RESTRICT pAuxDst[3], const UINT32 dstAuxStep[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static pstatus_t | general_YUV444ToRGB_8u_P3AC4R_general (const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t *WINPR_RESTRICT roi) |
|
static pstatus_t | general_YUV444ToRGB_8u_P3AC4R_BGRX (const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t *WINPR_RESTRICT roi) |
|
static pstatus_t | general_YUV444ToRGB_8u_P3AC4R (const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t *WINPR_RESTRICT roi) |
|
static pstatus_t | general_YUV420ToRGB_8u_P3AC4R (const BYTE *const WINPR_RESTRICT pSrc[3], const UINT32 srcStep[3], BYTE *WINPR_RESTRICT pDst, UINT32 dstStep, UINT32 DstFormat, const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE BYTE | RGB2Y (BYTE R, BYTE G, BYTE B) |
|
static INLINE BYTE | RGB2U (BYTE R, BYTE G, BYTE B) |
|
static INLINE BYTE | RGB2V (INT32 R, INT32 G, INT32 B) |
|
static pstatus_t | general_RGBToYUV444_8u_P3AC4R (const BYTE *WINPR_RESTRICT pSrc, UINT32 SrcFormat, const UINT32 srcStep, BYTE *WINPR_RESTRICT pDst[3], UINT32 dstStep[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE pstatus_t | general_RGBToYUV420_BGRX (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE pstatus_t | general_RGBToYUV420_RGBX (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE pstatus_t | general_RGBToYUV420_ANY (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static pstatus_t | general_RGBToYUV420_8u_P3AC4R (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst[3], const UINT32 dstStep[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE void | general_RGBToAVC444YUV_BGRX_DOUBLE_ROW (const BYTE *WINPR_RESTRICT srcEven, const BYTE *WINPR_RESTRICT srcOdd, BYTE *WINPR_RESTRICT b1Even, BYTE *WINPR_RESTRICT b1Odd, BYTE *WINPR_RESTRICT b2, BYTE *WINPR_RESTRICT b3, BYTE *WINPR_RESTRICT b4, BYTE *WINPR_RESTRICT b5, BYTE *WINPR_RESTRICT b6, BYTE *WINPR_RESTRICT b7, UINT32 width) |
|
static INLINE pstatus_t | general_RGBToAVC444YUV_BGRX (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE void | general_RGBToAVC444YUV_RGBX_DOUBLE_ROW (const BYTE *WINPR_RESTRICT srcEven, const BYTE *WINPR_RESTRICT srcOdd, BYTE *WINPR_RESTRICT b1Even, BYTE *WINPR_RESTRICT b1Odd, BYTE *WINPR_RESTRICT b2, BYTE *WINPR_RESTRICT b3, BYTE *WINPR_RESTRICT b4, BYTE *WINPR_RESTRICT b5, BYTE *WINPR_RESTRICT b6, BYTE *WINPR_RESTRICT b7, UINT32 width) |
|
static INLINE pstatus_t | general_RGBToAVC444YUV_RGBX (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE void | general_RGBToAVC444YUV_ANY_DOUBLE_ROW (const BYTE *WINPR_RESTRICT srcEven, const BYTE *WINPR_RESTRICT srcOdd, UINT32 srcFormat, BYTE *WINPR_RESTRICT b1Even, BYTE *WINPR_RESTRICT b1Odd, BYTE *WINPR_RESTRICT b2, BYTE *WINPR_RESTRICT b3, BYTE *WINPR_RESTRICT b4, BYTE *WINPR_RESTRICT b5, BYTE *WINPR_RESTRICT b6, BYTE *WINPR_RESTRICT b7, UINT32 width) |
|
static INLINE pstatus_t | general_RGBToAVC444YUV_ANY (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE pstatus_t | general_RGBToAVC444YUV (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE void | general_RGBToAVC444YUVv2_ANY_DOUBLE_ROW (const BYTE *WINPR_RESTRICT srcEven, const BYTE *WINPR_RESTRICT srcOdd, UINT32 srcFormat, BYTE *WINPR_RESTRICT yLumaDstEven, BYTE *WINPR_RESTRICT yLumaDstOdd, BYTE *WINPR_RESTRICT uLumaDst, BYTE *WINPR_RESTRICT vLumaDst, BYTE *WINPR_RESTRICT yEvenChromaDst1, BYTE *WINPR_RESTRICT yEvenChromaDst2, BYTE *WINPR_RESTRICT yOddChromaDst1, BYTE *WINPR_RESTRICT yOddChromaDst2, BYTE *WINPR_RESTRICT uChromaDst1, BYTE *WINPR_RESTRICT uChromaDst2, BYTE *WINPR_RESTRICT vChromaDst1, BYTE *WINPR_RESTRICT vChromaDst2, UINT32 width) |
|
static INLINE pstatus_t | general_RGBToAVC444YUVv2_ANY (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE void | general_RGBToAVC444YUVv2_BGRX_DOUBLE_ROW (const BYTE *WINPR_RESTRICT srcEven, const BYTE *WINPR_RESTRICT srcOdd, BYTE *WINPR_RESTRICT yLumaDstEven, BYTE *WINPR_RESTRICT yLumaDstOdd, BYTE *WINPR_RESTRICT uLumaDst, BYTE *WINPR_RESTRICT vLumaDst, BYTE *WINPR_RESTRICT yEvenChromaDst1, BYTE *WINPR_RESTRICT yEvenChromaDst2, BYTE *WINPR_RESTRICT yOddChromaDst1, BYTE *WINPR_RESTRICT yOddChromaDst2, BYTE *WINPR_RESTRICT uChromaDst1, BYTE *WINPR_RESTRICT uChromaDst2, BYTE *WINPR_RESTRICT vChromaDst1, BYTE *WINPR_RESTRICT vChromaDst2, UINT32 width) |
|
static INLINE pstatus_t | general_RGBToAVC444YUVv2_BGRX (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
static INLINE pstatus_t | general_RGBToAVC444YUVv2 (const BYTE *WINPR_RESTRICT pSrc, UINT32 srcFormat, UINT32 srcStep, BYTE *WINPR_RESTRICT pDst1[3], const UINT32 dst1Step[3], BYTE *WINPR_RESTRICT pDst2[3], const UINT32 dst2Step[3], const prim_size_t *WINPR_RESTRICT roi) |
|
void | primitives_init_YUV (primitives_t *WINPR_RESTRICT prims) |
|
void | primitives_init_YUV_opt (primitives_t *WINPR_RESTRICT prims) |
|
static INLINE pstatus_t general_RGBToAVC444YUV_ANY |
( |
const BYTE *WINPR_RESTRICT |
pSrc, |
|
|
UINT32 |
srcFormat, |
|
|
UINT32 |
srcStep, |
|
|
BYTE *WINPR_RESTRICT |
pDst1[3], |
|
|
const UINT32 |
dst1Step[3], |
|
|
BYTE *WINPR_RESTRICT |
pDst2[3], |
|
|
const UINT32 |
dst2Step[3], |
|
|
const prim_size_t *WINPR_RESTRICT |
roi |
|
) |
| |
|
static |
Note: According to [MS-RDPEGFX 2.2.4.4 RFX_AVC420_BITMAP_STREAM] the width and height of the MPEG-4 AVC/H.264 codec bitstream MUST be aligned to a multiple of 16. Hence the passed destination YUV420/CHROMA420 buffers must have been allocated accordingly !!
[MS-RDPEGFX 3.3.8.3.2 YUV420p Stream Combination] defines the following "Bx areas":
YUV420 frame (main view): B1: From Y444 all pixels B2: From U444 all pixels in even rows with even columns B3: From V444 all pixels in even rows with even columns
Chroma420 frame (auxillary view): B45: From U444 and V444 all pixels from all odd rows (The odd U444 and V444 rows must be interleaved in 8-line blocks in B45 !!!) B6: From U444 all pixels in even rows with odd columns B7: From V444 all pixels in even rows with odd columns
Microsoft's horrible unclear description in MS-RDPEGFX translated to pseudo code looks like this:
for (y = 0; y < fullHeight; y++) { for (x = 0; x < fullWidth; x++) { B1[x,y] = Y444[x,y]; } }
for (y = 0; y < halfHeight; y++) { for (x = 0; x < halfWidth; x++) { B2[x,y] = U444[2 * x, 2 * y]; B3[x,y] = V444[2 * x, 2 * y]; B6[x,y] = U444[2 * x + 1, 2 * y]; B7[x,y] = V444[2 * x + 1, 2 * y]; } }
for (y = 0; y < halfHeight; y++) { yU = (y / 8) * 16; // identify first row of correct 8-line U block in B45 yU += (y % 8); // add offset rows in destination block yV = yU + 8; // the corresponding v line is always 8 rows ahead
for (x = 0; x < fullWidth; x++) { B45[x,yU] = U444[x, 2 * y + 1]; B45[x,yV] = V444[x, 2 * y + 1]; } }
static INLINE pstatus_t general_RGBToAVC444YUVv2_ANY |
( |
const BYTE *WINPR_RESTRICT |
pSrc, |
|
|
UINT32 |
srcFormat, |
|
|
UINT32 |
srcStep, |
|
|
BYTE *WINPR_RESTRICT |
pDst1[3], |
|
|
const UINT32 |
dst1Step[3], |
|
|
BYTE *WINPR_RESTRICT |
pDst2[3], |
|
|
const UINT32 |
dst2Step[3], |
|
|
const prim_size_t *WINPR_RESTRICT |
roi |
|
) |
| |
|
static |
Note: According to [MS-RDPEGFX 2.2.4.4 RFX_AVC420_BITMAP_STREAM] the width and height of the MPEG-4 AVC/H.264 codec bitstream MUST be aligned to a multiple of 16. Hence the passed destination YUV420/CHROMA420 buffers must have been allocated accordingly !!
[MS-RDPEGFX 3.3.8.3.3 YUV420p Stream Combination for YUV444v2 mode] defines the following "Bx
areas":
YUV420 frame (main view): B1: From Y444 all pixels B2: From U444 all pixels in even rows with even rows and columns B3: From V444 all pixels in even rows with even rows and columns
Chroma420 frame (auxillary view): B45: From U444 and V444 all pixels from all odd columns B67: From U444 and V444 every 4th pixel in odd rows B89: From U444 and V444 every 4th pixel (initial offset of 2) in odd rows
Chroma Bxy areas correspond to the left and right half of the YUV420 plane. for (y = 0; y < fullHeight; y++) { for (x = 0; x < fullWidth; x++) { B1[x,y] = Y444[x,y]; }
for (x = 0; x < halfWidth; x++) { B4[x,y] = U444[2 * x, 2 * y]; B5[x,y] = V444[2 * x, 2 * y]; } }
for (y = 0; y < halfHeight; y++) { for (x = 0; x < halfWidth; x++) { B2[x,y] = U444[2 * x, 2 * y]; B3[x,y] = V444[2 * x, 2 * y]; B6[x,y] = U444[4 * x, 2 * y + 1]; B7[x,y] = V444[4 * x, 2 * y + 1]; B8[x,y] = V444[4 * x + 2, 2 * y + 1]; B9[x,y] = V444[4 * x + 2, 2 * y] + 1; } }