Skip to content

Commit

Permalink
[Encode] Changed rules for AYUV & Y410 reconstructed surfaces allocation
Browse files Browse the repository at this point in the history
This is allow to enable 8k encoding (8192x8192)

Change-Id: I773d8652bd8f0f4a507b788c5904eac5d08e262f
  • Loading branch information
alariono authored and Sherry-Lin committed Jul 11, 2019
1 parent bcb3349 commit 6cc9954
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions media_driver/agnostic/common/hw/vdbox/mhw_vdbox_hcp_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ class MhwVdboxHcpInterfaceGeneric : public MhwVdboxHcpInterface
cmd.DW1.SurfaceId = params->ucSurfaceStateId;
cmd.DW1.SurfacePitchMinus1 = params->psSurface->dwPitch - 1;

/* Handling of reconstructed surface is different for Y410 & AYUV formats */
if ((params->ucSurfaceStateId != CODECHAL_HCP_SRC_SURFACE_ID) &&
(params->psSurface->Format == Format_Y410))
cmd.DW1.SurfacePitchMinus1 = params->psSurface->dwPitch / 2 - 1;

if ((params->ucSurfaceStateId != CODECHAL_HCP_SRC_SURFACE_ID) &&
(params->psSurface->Format == Format_AYUV))
cmd.DW1.SurfacePitchMinus1 = params->psSurface->dwPitch / 4 - 1;

cmd.DW2.YOffsetForUCbInPixel = params->psSurface->UPlaneOffset.iYOffset;

MHW_MI_CHK_STATUS(Mos_AddCommand(cmdBuffer, &cmd, cmd.byteSize));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,7 @@ MOS_STATUS MhwVdboxHcpInterfaceG11::AddHcpEncodeSurfaceStateCmd(
mhw_vdbox_hcp_g11_X::HCP_SURFACE_STATE_CMD *cmd =
(mhw_vdbox_hcp_g11_X::HCP_SURFACE_STATE_CMD*)cmdBuffer->pCmdPtr;

MHW_MI_CHK_STATUS(MhwVdboxHcpInterfaceGeneric<mhw_vdbox_hcp_g11_X>::AddHcpDecodeSurfaceStateCmd(cmdBuffer, params));
MHW_MI_CHK_STATUS(MhwVdboxHcpInterfaceGeneric<mhw_vdbox_hcp_g11_X>::AddHcpEncodeSurfaceStateCmd(cmdBuffer, params));

bool surf10bit= (params->psSurface->Format == Format_P010) ||
(params->psSurface->Format == Format_P210) ||
Expand Down
7 changes: 7 additions & 0 deletions media_driver/agnostic/gen11/hw/vdbox/mhw_vdbox_vdenc_g11_X.h
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,13 @@ class MhwVdboxVdencInterfaceG11 : public MhwVdboxVdencInterfaceGeneric<TVdencCmd
if (cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatY416Variant ||
cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatAyuvVariant)
{
/* Y410/Y416 Reconstructed format handling */
if (cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatY416Variant)
cmd.Dwords25.DW1.SurfacePitch = params->psSurface->dwPitch / 2 - 1;
/* AYUV Reconstructed format handling */
if (cmd.Dwords25.DW1.SurfaceFormat == vdencSurfaceFormatAyuvVariant)
cmd.Dwords25.DW1.SurfacePitch = params->psSurface->dwPitch / 4 - 1;

cmd.Dwords25.DW2.YOffsetForUCb = params->dwReconSurfHeight;
cmd.Dwords25.DW3.YOffsetForVCr = params->dwReconSurfHeight << 1;
}
Expand Down

0 comments on commit 6cc9954

Please sign in to comment.