[Mesa-dev] frontends/va/postproc: Use the actual image height when blitting

Ilia Mirkin imirkin at alum.mit.edu
Mon Nov 30 18:07:04 UTC 2020


Many (most?) codecs decode stuff in 16px increments. So even though
the video is 1080 in height, the decoded surface is 1088. However the
video decoder should know that only 1080 pixels are valid. The src/dst
regions should account for this.

I suspect that there's an issue in the vl_compositor_cs logic which
might not account for ... something? It's trying to scale texture
coordinates, so using the full texture width/height is clearly right
for scaling. However perhaps the thing being scaled is wrong if it's
in the coordinate system of the destination surface rather than the
video texture. It's a bit hard to follow the shaders without
pseudocode like there is in vl_compositor_gfx. Perhaps writing such
pseudocode will make the problem more apparent?

Cheers,

  -ilia

On Mon, Nov 30, 2020 at 12:35 PM Thong Thai <thong.thai at amd.com> wrote:
>
> Hi Ilia,
>
> This was the issue I was trying to fix:
> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6736#note_626808
>
> It's doing a blit from 1088px (the actual video is only 1080px) to
> 1440px. The blit code scales and uses both the 1080 box height and 1088
> resource height, but I'm guessing the small difference is the problem
> I'm dealing with:
>
>                        u_bitcast_f2u(x_scale / src->width0),
>                        u_bitcast_f2u(y_scale / src->height0),
>
> p y_scale / src->height0
> $4 = 0.000689338252
>
> p y_scale / 1080
> $6 = 0.000694444461
>
> I'm not sure how to properly fix it though... any ideas would be
> appreciated.
>
> Thanks,
>
> Thong Thai
>
> On 2020-11-30 10:52 a.m., Liu, Leo wrote:
> > +Thong.
> >
> > -----Original Message-----
> > From: mesa-dev <mesa-dev-bounces at lists.freedesktop.org> On Behalf Of Ilia Mirkin
> > Sent: November 25, 2020 5:48 PM
> > To: ML Mesa-dev <mesa-dev at lists.freedesktop.org>; Thai, Thong <Thong.Thai at amd.com>
> > Subject: Re: [Mesa-dev] frontends/va/postproc: Use the actual image height when blitting
> >
> > Hi Thong,
> >
> > In this change:
> >
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcgit.freedesktop.org%2Fmesa%2Fmesa%2Fcommit%2F%3Fid%3D49465babdb35d88ed8a283e925d6cd346255d50c&data=04%7C01%7Cleo.liu%40amd.com%7C92b8ad99a46447208c3008d891943b09%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637419413135677095%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=g1pJUxsSM68kEjNZ6VDJGufaOF1Wwcezl1ehezq8mqo%3D&reserved=0
> >
> > You appear to change the height of the underlying resource while doing a blit. This is never legal though -- the height of the resource is effectively immutable (and subject to various constraints). I'm not sure what issue you're having, but this is not the way to fix it.
> >
> > Cheers,
> >
> >    -ilia
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fmesa-dev&data=04%7C01%7Cleo.liu%40amd.com%7C92b8ad99a46447208c3008d891943b09%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637419413135687091%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ug6N9kvs1JzjDhHPpB%2F9ttrCaahVgm7NJ6Bk0zCxc4A%3D&reserved=0


More information about the mesa-dev mailing list