Skip to content

Commit

Permalink
fixup! Initial implementation of yuv444in420 encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ns6089 committed Jun 29, 2024
1 parent b41f2fd commit fc48f22
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/platform/windows/display_vram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,15 +530,22 @@ namespace platf::dxgi {
out_Y_or_YUV_viewports[0] = { offsetX, offsetY, out_width_f, out_height_f, 0.0f, 1.0f }; // Y plane
out_Y_or_YUV_viewports[1] = out_Y_or_YUV_viewports[0]; // left half of U plane
out_Y_or_YUV_viewports[1].TopLeftY += out_height;
out_Y_or_YUV_viewports[1].Width /= 2;
out_Y_or_YUV_viewports[1].Width = out_width / 2 - offsetX;
out_Y_or_YUV_viewports[2] = out_Y_or_YUV_viewports[1]; // left half of V plane
out_Y_or_YUV_viewports[2].TopLeftX += out_Y_or_YUV_viewports[1].Width;
out_Y_or_YUV_viewports[2].TopLeftX += out_width / 2;

out_Y_or_YUV_viewports_for_clear = out_Y_or_YUV_viewports; // TODO: do this properly
out_Y_or_YUV_viewports_for_clear[0] = { 0, 0, (float) out_width, (float) out_height, 0.0f, 1.0f }; // Y plane
out_Y_or_YUV_viewports_for_clear[1] = out_Y_or_YUV_viewports_for_clear[0]; // left half of U plane
out_Y_or_YUV_viewports_for_clear[1].TopLeftY += out_height;
out_Y_or_YUV_viewports_for_clear[1].Width /= 2;
out_Y_or_YUV_viewports_for_clear[2] = out_Y_or_YUV_viewports_for_clear[1]; // left half of V plane
out_Y_or_YUV_viewports_for_clear[2].TopLeftX += out_Y_or_YUV_viewports_for_clear[1].Width;

out_UV_viewport = out_Y_or_YUV_viewports[0];
out_UV_viewport.Width /= 2;
out_UV_viewport_for_clear = out_UV_viewport; // TODO: do this properly
out_UV_viewport.TopLeftX = 0;
out_UV_viewport.Width = out_width_f - out_Y_or_YUV_viewports[1].Width;

out_UV_viewport_for_clear = { 0, 0, (float) out_width / 2, (float) out_height, 0.0f, 1.0f };
}
else {
out_Y_or_YUV_viewports[0] = { offsetX, offsetY, out_width_f, out_height_f, 0.0f, 1.0f }; // Y plane
Expand Down

0 comments on commit fc48f22

Please sign in to comment.