Commit 25fcd907 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: remove EraseYUVBorders()

We don't need it anymore now that we don't do interpolation with these extra pixels
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 1a34bf05)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent cef832d6
...@@ -416,33 +416,9 @@ static int Direct3D11MapPoolTexture(picture_t *picture) ...@@ -416,33 +416,9 @@ static int Direct3D11MapPoolTexture(picture_t *picture)
return CommonUpdatePicture(picture, NULL, mappedResource.pData, mappedResource.RowPitch); return CommonUpdatePicture(picture, NULL, mappedResource.pData, mappedResource.RowPitch);
} }
/* add black pixels in the padding to ease the interpolation artefacts */
static void EraseYUVBorders(int i_planes, plane_t planes[PICTURE_PLANE_MAX])
{
for (int i = 0; i < i_planes; i++)
{
uint8_t val = (i == 0) ? 0x00 : 0x80;
if (planes[i].i_visible_lines < planes[i].i_lines)
{
memset(planes[i].p_pixels + (planes[i].i_visible_lines * planes[i].i_pitch), val, planes[i].i_visible_pitch);
}
if (planes[i].i_visible_pitch < planes[i].i_pitch)
{
for (int j=0; j<planes[i].i_visible_lines; j++)
{
planes[i].p_pixels[j * planes[i].i_pitch + (planes[i].i_visible_pitch + 0) ] = val;
if (i_planes == 2)
planes[i].p_pixels[j * planes[i].i_pitch + (planes[i].i_visible_pitch + 1) ] = val;
}
}
}
}
static void Direct3D11UnmapPoolTexture(picture_t *picture) static void Direct3D11UnmapPoolTexture(picture_t *picture)
{ {
picture_sys_t *p_sys = picture->p_sys; picture_sys_t *p_sys = picture->p_sys;
EraseYUVBorders(picture->i_planes, picture->p);
ID3D11DeviceContext_Unmap(p_sys->context, p_sys->resource[KNOWN_DXGI_INDEX], 0); ID3D11DeviceContext_Unmap(p_sys->context, p_sys->resource[KNOWN_DXGI_INDEX], 0);
} }
...@@ -1125,8 +1101,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic ...@@ -1125,8 +1101,6 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
for (i = 0; i < picture->i_planes; i++) for (i = 0; i < picture->i_planes; i++)
plane_CopyPixels(&planes[i], &picture->p[i]); plane_CopyPixels(&planes[i], &picture->p[i]);
EraseYUVBorders(picture->i_planes, planes);
for (i = 0; i < picture->i_planes; i++) for (i = 0; i < picture->i_planes; i++)
ID3D11DeviceContext_Unmap(sys->d3d_dev.d3dcontext, sys->stagingSys.resource[i], 0); ID3D11DeviceContext_Unmap(sys->d3d_dev.d3dcontext, sys->stagingSys.resource[i], 0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment