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 *pYUVData[3], const UINT32 iStride[3], const RECTANGLE_16 *rect, UINT32 nDstStep, BYTE *pDstData, DWORD DstFormat)
 
static INLINE BOOL avc444_yuv_to_rgb (const BYTE *pYUVData[3], const UINT32 iStride[3], const RECTANGLE_16 *rect, UINT32 nDstStep, BYTE *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 *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 *rect, YUV_CONTEXT *context, const BYTE *pYUVData[3], const UINT32 iStride[3], UINT32 DstFormat, BYTE *dest, UINT32 nDstStep)
 
static BOOL submit_object (PTP_WORK *work_object, PTP_WORK_CALLBACK cb, const void *param, YUV_CONTEXT *context)
 
static void free_objects (PTP_WORK *work_objects, UINT32 waitCount)
 
static BOOL intersects (UINT32 pos, const RECTANGLE_16 *regionRects, UINT32 numRegionRects)
 
static RECTANGLE_16 clamp (YUV_CONTEXT *context, const RECTANGLE_16 *rect, UINT32 srcHeight)
 
static BOOL pool_decode (YUV_CONTEXT *context, PTP_WORK_CALLBACK cb, const BYTE *pYUVData[3], const UINT32 iStride[3], UINT32 yuvHeight, UINT32 DstFormat, BYTE *dest, UINT32 nDstStep, const RECTANGLE_16 *regionRects, UINT32 numRegionRects)
 
static INLINE BOOL check_rect (const YUV_CONTEXT *yuv, const RECTANGLE_16 *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 *rect, YUV_CONTEXT *context, BYTE type, const BYTE *pYUVData[3], const UINT32 iStride[3], BYTE *pYUVDstData[3], const UINT32 iDstStride[3])
 
static BOOL pool_decode_rect (YUV_CONTEXT *context, BYTE type, const BYTE *pYUVData[3], const UINT32 iStride[3], BYTE *pYUVDstData[3], const UINT32 iDstStride[3], const RECTANGLE_16 *regionRects, UINT32 numRegionRects)
 
BOOL yuv444_context_decode (YUV_CONTEXT *context, BYTE type, const BYTE *pYUVData[3], const UINT32 iStride[3], UINT32 srcYuvHeight, BYTE *pYUVDstData[3], const UINT32 iDstStride[3], DWORD DstFormat, BYTE *dest, UINT32 nDstStep, const RECTANGLE_16 *regionRects, UINT32 numRegionRects)
 
BOOL yuv420_context_decode (YUV_CONTEXT *context, const BYTE *pYUVData[3], const UINT32 iStride[3], UINT32 yuvHeight, DWORD DstFormat, BYTE *dest, UINT32 nDstStep, const RECTANGLE_16 *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 *rect, YUV_CONTEXT *context, const BYTE *pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[], BYTE *pYUVLumaData[], BYTE *pYUVChromaData[])
 
static BOOL pool_encode (YUV_CONTEXT *context, PTP_WORK_CALLBACK cb, const BYTE *pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[], BYTE *pYUVLumaData[], BYTE *pYUVChromaData[], const RECTANGLE_16 *regionRects, UINT32 numRegionRects)
 
BOOL yuv420_context_encode (YUV_CONTEXT *context, const BYTE *pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[3], BYTE *pYUVData[3], const RECTANGLE_16 *regionRects, UINT32 numRegionRects)
 
BOOL yuv444_context_encode (YUV_CONTEXT *context, BYTE version, const BYTE *pSrcData, UINT32 nSrcStep, UINT32 SrcFormat, const UINT32 iStride[3], BYTE *pYUVLumaData[3], BYTE *pYUVChromaData[3], const RECTANGLE_16 *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 pYUVData[3],
const UINT32  iStride[3],
const RECTANGLE_16 rect,
UINT32  nDstStep,
BYTE 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 pYUVData[3],
const UINT32  iStride[3],
const RECTANGLE_16 rect,
UINT32  nDstStep,
BYTE 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 *  yuv,
const RECTANGLE_16 rect,
UINT32  nDstWidth,
UINT32  nDstHeight 
)
static
Here is the caller graph for this function:

◆ clamp()

static RECTANGLE_16 clamp ( YUV_CONTEXT *  context,
const RECTANGLE_16 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 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 *  context,
PTP_WORK_CALLBACK  cb,
const BYTE pYUVData[3],
const UINT32  iStride[3],
UINT32  yuvHeight,
UINT32  DstFormat,
BYTE dest,
UINT32  nDstStep,
const RECTANGLE_16 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 rect,
YUV_CONTEXT *  context,
const BYTE pYUVData[3],
const UINT32  iStride[3],
UINT32  DstFormat,
BYTE dest,
UINT32  nDstStep 
)
static
Here is the caller graph for this function:

◆ pool_decode_rect()

static BOOL pool_decode_rect ( YUV_CONTEXT *  context,
BYTE  type,
const BYTE pYUVData[3],
const UINT32  iStride[3],
BYTE pYUVDstData[3],
const UINT32  iDstStride[3],
const RECTANGLE_16 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 rect,
YUV_CONTEXT *  context,
BYTE  type,
const BYTE pYUVData[3],
const UINT32  iStride[3],
BYTE pYUVDstData[3],
const UINT32  iDstStride[3] 
)
static
Here is the caller graph for this function:

◆ pool_encode()

static BOOL pool_encode ( YUV_CONTEXT *  context,
PTP_WORK_CALLBACK  cb,
const BYTE pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[],
BYTE pYUVLumaData[],
BYTE pYUVChromaData[],
const RECTANGLE_16 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 rect,
YUV_CONTEXT *  context,
const BYTE pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[],
BYTE pYUVLumaData[],
BYTE pYUVChromaData[] 
)
static
Here is the caller graph for this function:

◆ submit_object()

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

◆ yuv420_context_decode()

BOOL yuv420_context_decode ( YUV_CONTEXT *  context,
const BYTE pYUVData[3],
const UINT32  iStride[3],
UINT32  yuvHeight,
DWORD  DstFormat,
BYTE dest,
UINT32  nDstStep,
const RECTANGLE_16 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 *  context,
const BYTE pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[3],
BYTE pYUVData[3],
const RECTANGLE_16 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 *  context,
BYTE  type,
const BYTE pYUVData[3],
const UINT32  iStride[3],
UINT32  srcYuvHeight,
BYTE pYUVDstData[3],
const UINT32  iDstStride[3],
DWORD  DstFormat,
BYTE dest,
UINT32  nDstStep,
const RECTANGLE_16 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 *  context,
BYTE  version,
const BYTE pSrcData,
UINT32  nSrcStep,
UINT32  SrcFormat,
const UINT32  iStride[3],
BYTE pYUVLumaData[3],
BYTE pYUVChromaData[3],
const RECTANGLE_16 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 *  context,
UINT32  width,
UINT32  height 
)
Here is the call graph for this function:
Here is the caller graph for this function: