From 738a04d0bc8f0678c00b798c86791b81881aa60c Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sat, 27 Jan 2024 10:56:23 +1100 Subject: [PATCH] [host] dxgi: fix packed texture height calculation --- host/platform/Windows/capture/DXGI/src/pp/rgb24.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/host/platform/Windows/capture/DXGI/src/pp/rgb24.c b/host/platform/Windows/capture/DXGI/src/pp/rgb24.c index ae6ed87e..57db422e 100644 --- a/host/platform/Windows/capture/DXGI/src/pp/rgb24.c +++ b/host/platform/Windows/capture/DXGI/src/pp/rgb24.c @@ -82,7 +82,7 @@ static bool rgb24_configure(void * opaque, this.width = ALIGN_TO((*cols * 3 + 3) / 4, 64); /* adjust for the aligned width */ - this.height = ((*rows * *cols) + this.width - 1) / this.width; + this.height = (((*rows * *cols) * 3 + 3) / 4) / this.width; char sOutputWidth[6], sOutputHeight[6]; snprintf(sOutputWidth , sizeof(sOutputWidth) , "%d", this.width ); @@ -148,6 +148,7 @@ static bool rgb24_configure(void * opaque, DEBUG_INFO("RGBA to RGB packing enabled, %.2f MiB per frame saved", (float)((*width * *height - this.width * this.height) * 4) / 1048576 ); + DEBUG_INFO("Packed size: %ux%u", this.width, this.height); } // This texture is actually going to contain the packed BGR24 output