FreeRDP
yuv.c File Reference
#include <winpr/sysinfo.h>
#include <winpr/assert.h>
#include <winpr/pool.h>
#include <freerdp/settings.h>
#include <freerdp/codec/region.h>
#include <freerdp/primitives.h>
#include <freerdp/log.h>
#include <freerdp/codec/yuv.h>

Macros

#define TAG   FREERDP_TAG("codec")
 
#define TILE_SIZE   64
 

Functions

static INLINE BOOL avc420_yuv_to_rgb (const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], const RECTANGLE_16 *WINPR_RESTRICT rect, UINT32 nDstStep, BYTE *WINPR_RESTRICT pDstData, DWORD DstFormat)
 
static INLINE BOOL avc444_yuv_to_rgb (const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], const RECTANGLE_16 *WINPR_RESTRICT rect, UINT32 nDstStep, BYTE *WINPR_RESTRICT pDstData, DWORD DstFormat)
 
static void CALLBACK yuv420_process_work_callback (PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
 
static void CALLBACK yuv444_process_work_callback (PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
 
BOOL yuv_context_reset (YUV_CONTEXT *WINPR_RESTRICT context, UINT32 width, UINT32 height)
 
YUV_CONTEXT * yuv_context_new (BOOL encoder, UINT32 ThreadingFlags)
 
void yuv_context_free (YUV_CONTEXT *context)
 
static INLINE YUV_PROCESS_WORK_PARAM pool_decode_param (const RECTANGLE_16 *WINPR_RESTRICT rect, YUV_CONTEXT *WINPR_RESTRICT context, const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], UINT32 DstFormat, BYTE *WINPR_RESTRICT dest, UINT32 nDstStep)
 
static BOOL submit_object (PTP_WORK *WINPR_RESTRICT work_object, PTP_WORK_CALLBACK cb, const void *WINPR_RESTRICT param, YUV_CONTEXT *WINPR_RESTRICT context)
 
static void free_objects (PTP_WORK *work_objects, UINT32 waitCount)
 
static BOOL intersects (UINT32 pos, const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
static RECTANGLE_16 clamp (YUV_CONTEXT *WINPR_RESTRICT context, const RECTANGLE_16 *WINPR_RESTRICT rect, UINT32 srcHeight)
 
static BOOL pool_decode (YUV_CONTEXT *WINPR_RESTRICT context, PTP_WORK_CALLBACK cb, const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], UINT32 yuvHeight, UINT32 DstFormat, BYTE *WINPR_RESTRICT dest, UINT32 nDstStep, const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
static INLINE BOOL check_rect (const YUV_CONTEXT *WINPR_RESTRICT yuv, const RECTANGLE_16 *WINPR_RESTRICT rect, UINT32 nDstWidth, UINT32 nDstHeight)
 
static void CALLBACK yuv444_combine_work_callback (PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
 
static INLINE YUV_COMBINE_WORK_PARAM pool_decode_rect_param (const RECTANGLE_16 *WINPR_RESTRICT rect, YUV_CONTEXT *WINPR_RESTRICT context, BYTE type, const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], BYTE *WINPR_RESTRICT pYUVDstData[3], const UINT32 iDstStride[3])
 
static BOOL pool_decode_rect (YUV_CONTEXT *WINPR_RESTRICT context, BYTE type, const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], BYTE *WINPR_RESTRICT pYUVDstData[3], const UINT32 iDstStride[3], const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
BOOL yuv444_context_decode (YUV_CONTEXT *WINPR_RESTRICT context, BYTE type, const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], UINT32 srcYuvHeight, BYTE *WINPR_RESTRICT pYUVDstData[3], const UINT32 iDstStride[3], DWORD DstFormat, BYTE *WINPR_RESTRICT dest, UINT32 nDstStep, const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
BOOL yuv420_context_decode (YUV_CONTEXT *WINPR_RESTRICT context, const BYTE *WINPR_RESTRICT pYUVData[3], const UINT32 iStride[3], UINT32 yuvHeight, DWORD DstFormat, BYTE *WINPR_RESTRICT dest, UINT32 nDstStep, const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
static void CALLBACK yuv420_encode_work_callback (PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
 
static void CALLBACK yuv444v1_encode_work_callback (PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
 
static void CALLBACK yuv444v2_encode_work_callback (PTP_CALLBACK_INSTANCE instance, void *context, PTP_WORK work)
 
static INLINE YUV_ENCODE_WORK_PARAM pool_encode_fill (const RECTANGLE_16 *WINPR_RESTRICT rect, YUV_CONTEXT *WINPR_RESTRICT context, const BYTE *WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[], BYTE *WINPR_RESTRICT pYUVLumaData[], BYTE *WINPR_RESTRICT pYUVChromaData[])
 
static BOOL pool_encode (YUV_CONTEXT *WINPR_RESTRICT context, PTP_WORK_CALLBACK cb, const BYTE *WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[], BYTE *WINPR_RESTRICT pYUVLumaData[], BYTE *WINPR_RESTRICT pYUVChromaData[], const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
BOOL yuv420_context_encode (YUV_CONTEXT *WINPR_RESTRICT context, const BYTE *WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[3], BYTE *WINPR_RESTRICT pYUVData[3], const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 
BOOL yuv444_context_encode (YUV_CONTEXT *WINPR_RESTRICT context, BYTE version, const BYTE *WINPR_RESTRICT pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[3], BYTE *WINPR_RESTRICT pYUVLumaData[3], BYTE *WINPR_RESTRICT pYUVChromaData[3], const RECTANGLE_16 *WINPR_RESTRICT regionRects, UINT32 numRegionRects)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("codec")

◆ TILE_SIZE

#define TILE_SIZE   64

Function Documentation

◆ avc420_yuv_to_rgb()

static INLINE BOOL avc420_yuv_to_rgb ( const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
const RECTANGLE_16 *WINPR_RESTRICT  rect,
UINT32  nDstStep,
BYTE *WINPR_RESTRICT  pDstData,
DWORD  DstFormat 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ avc444_yuv_to_rgb()

static INLINE BOOL avc444_yuv_to_rgb ( const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
const RECTANGLE_16 *WINPR_RESTRICT  rect,
UINT32  nDstStep,
BYTE *WINPR_RESTRICT  pDstData,
DWORD  DstFormat 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_rect()

static INLINE BOOL check_rect ( const YUV_CONTEXT *WINPR_RESTRICT  yuv,
const RECTANGLE_16 *WINPR_RESTRICT  rect,
UINT32  nDstWidth,
UINT32  nDstHeight 
)
static
Here is the caller graph for this function:

◆ clamp()

static RECTANGLE_16 clamp ( YUV_CONTEXT *WINPR_RESTRICT  context,
const RECTANGLE_16 *WINPR_RESTRICT  rect,
UINT32  srcHeight 
)
static
Here is the caller graph for this function:

◆ free_objects()

static void free_objects ( PTP_WORK *  work_objects,
UINT32  waitCount 
)
static
Here is the caller graph for this function:

◆ intersects()

static BOOL intersects ( UINT32  pos,
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pool_decode()

static BOOL pool_decode ( YUV_CONTEXT *WINPR_RESTRICT  context,
PTP_WORK_CALLBACK  cb,
const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
UINT32  yuvHeight,
UINT32  DstFormat,
BYTE *WINPR_RESTRICT  dest,
UINT32  nDstStep,
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pool_decode_param()

static INLINE YUV_PROCESS_WORK_PARAM pool_decode_param ( const RECTANGLE_16 *WINPR_RESTRICT  rect,
YUV_CONTEXT *WINPR_RESTRICT  context,
const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
UINT32  DstFormat,
BYTE *WINPR_RESTRICT  dest,
UINT32  nDstStep 
)
static
Here is the caller graph for this function:

◆ pool_decode_rect()

static BOOL pool_decode_rect ( YUV_CONTEXT *WINPR_RESTRICT  context,
BYTE  type,
const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
BYTE *WINPR_RESTRICT  pYUVDstData[3],
const UINT32  iDstStride[3],
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pool_decode_rect_param()

static INLINE YUV_COMBINE_WORK_PARAM pool_decode_rect_param ( const RECTANGLE_16 *WINPR_RESTRICT  rect,
YUV_CONTEXT *WINPR_RESTRICT  context,
BYTE  type,
const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
BYTE *WINPR_RESTRICT  pYUVDstData[3],
const UINT32  iDstStride[3] 
)
static
Here is the caller graph for this function:

◆ pool_encode()

static BOOL pool_encode ( YUV_CONTEXT *WINPR_RESTRICT  context,
PTP_WORK_CALLBACK  cb,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[],
BYTE *WINPR_RESTRICT  pYUVLumaData[],
BYTE *WINPR_RESTRICT  pYUVChromaData[],
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pool_encode_fill()

static INLINE YUV_ENCODE_WORK_PARAM pool_encode_fill ( const RECTANGLE_16 *WINPR_RESTRICT  rect,
YUV_CONTEXT *WINPR_RESTRICT  context,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[],
BYTE *WINPR_RESTRICT  pYUVLumaData[],
BYTE *WINPR_RESTRICT  pYUVChromaData[] 
)
static
Here is the caller graph for this function:

◆ submit_object()

static BOOL submit_object ( PTP_WORK *WINPR_RESTRICT  work_object,
PTP_WORK_CALLBACK  cb,
const void *WINPR_RESTRICT  param,
YUV_CONTEXT *WINPR_RESTRICT  context 
)
static
Here is the caller graph for this function:

◆ yuv420_context_decode()

BOOL yuv420_context_decode ( YUV_CONTEXT *WINPR_RESTRICT  context,
const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
UINT32  yuvHeight,
DWORD  DstFormat,
BYTE *WINPR_RESTRICT  dest,
UINT32  nDstStep,
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv420_context_encode()

BOOL yuv420_context_encode ( YUV_CONTEXT *WINPR_RESTRICT  context,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[3],
BYTE *WINPR_RESTRICT  pYUVData[3],
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv420_encode_work_callback()

static void CALLBACK yuv420_encode_work_callback ( PTP_CALLBACK_INSTANCE  instance,
void *  context,
PTP_WORK  work 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv420_process_work_callback()

static void CALLBACK yuv420_process_work_callback ( PTP_CALLBACK_INSTANCE  instance,
void *  context,
PTP_WORK  work 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv444_combine_work_callback()

static void CALLBACK yuv444_combine_work_callback ( PTP_CALLBACK_INSTANCE  instance,
void *  context,
PTP_WORK  work 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv444_context_decode()

BOOL yuv444_context_decode ( YUV_CONTEXT *WINPR_RESTRICT  context,
BYTE  type,
const BYTE *WINPR_RESTRICT  pYUVData[3],
const UINT32  iStride[3],
UINT32  srcYuvHeight,
BYTE *WINPR_RESTRICT  pYUVDstData[3],
const UINT32  iDstStride[3],
DWORD  DstFormat,
BYTE *WINPR_RESTRICT  dest,
UINT32  nDstStep,
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv444_context_encode()

BOOL yuv444_context_encode ( YUV_CONTEXT *WINPR_RESTRICT  context,
BYTE  version,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[3],
BYTE *WINPR_RESTRICT  pYUVLumaData[3],
BYTE *WINPR_RESTRICT  pYUVChromaData[3],
const RECTANGLE_16 *WINPR_RESTRICT  regionRects,
UINT32  numRegionRects 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv444_process_work_callback()

static void CALLBACK yuv444_process_work_callback ( PTP_CALLBACK_INSTANCE  instance,
void *  context,
PTP_WORK  work 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv444v1_encode_work_callback()

static void CALLBACK yuv444v1_encode_work_callback ( PTP_CALLBACK_INSTANCE  instance,
void *  context,
PTP_WORK  work 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv444v2_encode_work_callback()

static void CALLBACK yuv444v2_encode_work_callback ( PTP_CALLBACK_INSTANCE  instance,
void *  context,
PTP_WORK  work 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv_context_free()

void yuv_context_free ( YUV_CONTEXT *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv_context_new()

YUV_CONTEXT* yuv_context_new ( BOOL  encoder,
UINT32  ThreadingFlags 
)

do it here to avoid a race condition between threads

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yuv_context_reset()

BOOL yuv_context_reset ( YUV_CONTEXT *WINPR_RESTRICT  context,
UINT32  width,
UINT32  height 
)
Here is the call graph for this function:
Here is the caller graph for this function: