From ebe9e5209b35906380de49b7d7511a1c047057e2 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 28 Apr 2025 22:31:13 +0200 Subject: [PATCH 1/2] [primitives,test] do compare YUV444 rgb after conversion --- libfreerdp/primitives/test/TestPrimitivesYUV.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libfreerdp/primitives/test/TestPrimitivesYUV.c b/libfreerdp/primitives/test/TestPrimitivesYUV.c index 33258acca..0fa9d6a5f 100644 --- a/libfreerdp/primitives/test/TestPrimitivesYUV.c +++ b/libfreerdp/primitives/test/TestPrimitivesYUV.c @@ -41,6 +41,10 @@ static BOOL similar(const BYTE* src, const BYTE* dst, size_t size) static BOOL similarRGB(size_t y, const BYTE* src, const BYTE* dst, size_t size, UINT32 format, BOOL use444) { + /* Skip YUV420, too lossy */ + if (!use444) + return TRUE; + const UINT32 bpp = FreeRDPGetBytesPerPixel(format); BYTE fill = PADDING_FILL_VALUE; if (!FreeRDPColorHasAlpha(format)) @@ -595,7 +599,6 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) (!check_padding(yuv[2], uvsize, padding, "V"))) goto fail; -#if 0 // TODO: lossy conversion, we have a lot of outliers that prevent the check to pass for (size_t y = 0; y < roi.height; y++) { BYTE* srgb = &rgb[y * stride]; @@ -604,7 +607,6 @@ static BOOL TestPrimitiveYUV(primitives_t* prims, prim_size_t roi, BOOL use444) if (!similarRGB(y, srgb, drgb, roi.width, DstFormat, use444)) goto fail; } -#endif PROFILER_FREE(rgbToYUV420) PROFILER_FREE(rgbToYUV444) From 889f73be4a8139eadc06fc3dfb7cd62720790117 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 28 Apr 2025 22:30:26 +0200 Subject: [PATCH 2/2] [channels,rdpgfx] log chosen capabilities --- channels/rdpgfx/client/rdpgfx_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/channels/rdpgfx/client/rdpgfx_main.c b/channels/rdpgfx/client/rdpgfx_main.c index 2e64ae7a3..0eb2d5a9a 100644 --- a/channels/rdpgfx/client/rdpgfx_main.c +++ b/channels/rdpgfx/client/rdpgfx_main.c @@ -384,9 +384,9 @@ static UINT rdpgfx_recv_caps_confirm_pdu(GENERIC_CHANNEL_CALLBACK* callback, wSt Stream_Read_UINT32(s, capsSet.flags); /* capsData (4 bytes) */ gfx->TotalDecodedFrames = 0; gfx->ConnectionCaps = capsSet; - DEBUG_RDPGFX(gfx->log, - "RecvCapsConfirmPdu: version: %s [0x%08" PRIX32 "] flags: 0x%08" PRIX32 "", - rdpgfx_caps_version_str(capsSet.version), capsSet.version, capsSet.flags); + WLog_Print(gfx->log, WLOG_DEBUG, + "RecvCapsConfirmPdu: version: %s [0x%08" PRIX32 "] flags: 0x%08" PRIX32 "", + rdpgfx_caps_version_str(capsSet.version), capsSet.version, capsSet.flags); if (!context) return ERROR_BAD_CONFIGURATION; @@ -562,9 +562,9 @@ static UINT rdpgfx_recv_reset_graphics_pdu(GENERIC_CHANNEL_CALLBACK* callback, w } Stream_Seek(s, pad); /* pad (total size is 340 bytes) */ - DEBUG_RDPGFX(gfx->log, - "RecvResetGraphicsPdu: width: %" PRIu32 " height: %" PRIu32 " count: %" PRIu32 "", - pdu.width, pdu.height, pdu.monitorCount); + WLog_Print(gfx->log, WLOG_DEBUG, + "RecvResetGraphicsPdu: width: %" PRIu32 " height: %" PRIu32 " count: %" PRIu32 "", + pdu.width, pdu.height, pdu.monitorCount); #if defined(WITH_DEBUG_RDPGFX) for (UINT32 index = 0; index < pdu.monitorCount; index++) @@ -718,8 +718,8 @@ static UINT rdpgfx_send_cache_import_offer_pdu(RdpgfxClientContext* context, header.flags = 0; header.cmdId = RDPGFX_CMDID_CACHEIMPORTOFFER; header.pduLength = RDPGFX_HEADER_SIZE + 2ul + pdu->cacheEntriesCount * 12ul; - DEBUG_RDPGFX(gfx->log, "SendCacheImportOfferPdu: cacheEntriesCount: %" PRIu16 "", - pdu->cacheEntriesCount); + WLog_Print(gfx->log, WLOG_DEBUG, "SendCacheImportOfferPdu: cacheEntriesCount: %" PRIu16 "", + pdu->cacheEntriesCount); s = Stream_New(NULL, header.pduLength); if (!s)