[vlc-devel] [PATCH] dxva2: support IMC3

Laurent Aimar fenrir at elivagar.org
Sat Feb 11 00:12:16 CET 2012


On Mon, Feb 06, 2012 at 03:52:42PM -0500, Rafaël Carré wrote:
> @@ -467,6 +468,24 @@ static int Extract(vlc_va_t *external, picture_t *picture, AVFrame *ff)
>          CopyFromYv12(picture, plane, pitch,
>                       va->width, va->height,
>                       &va->surface_cache);
> +    } else if (va->render == MAKEFOURCC('I','M','C','3')) {
> +        uint8_t *plane[3] = {
> +            lock.pBits,
> +            (uint8_t*)lock.pBits + lock.Pitch * va->surface_height,
> +            (uint8_t*)lock.pBits + lock.Pitch * va->surface_height
> +                                 + lock.Pitch * (va->surface_height/2)
> +        };
> +        size_t  pitch[3] = {
> +            lock.Pitch,
> +            lock.Pitch,
> +            lock.Pitch,
> +        };
> +        CopyFromYv12(picture, plane, pitch,
> +                     va->width, va->height,
> +                     &va->surface_cache);
> +        uint8_t *v = picture->p[1].p_pixels;
> +        picture->p[1].p_pixels = picture->p[2].p_pixels;
> +        picture->p[2].p_pixels = v;

Merging it with the YV12 case would be simpler.
Also, swapping the ptr in the plane[] array is cleaner.

Regards

-- 
fenrir



More information about the vlc-devel mailing list