[Mesa-dev] [PATCH 1/7] vdpau/vl 422 chroma width/height mix up

Christian König deathsimple at vodafone.de
Sun Aug 18 04:23:44 PDT 2013


Am 17.08.2013 23:51, schrieb Emil Velikov:
> From: Andy Furniss <adf.lists at gmail.com>
>
> I was looking into some minor 422 issues/discrepencies I noticed long
> ago using vdpau on my rv790.
>
> I noticed that there is code that is halving height rather than width -
> 422 is full height AFAIK.
>
> Making the changes below doesn't actually make any noticable difference
> to what I was looking into.
>
> Maybe there are more but here's three I've found so far

That indeed seems to be wrong, but we never actually used the different 
planar subsampled formats so it probably won't make any difference.

Anyway the patch is: Reviewed-by: Christian König <christian.koenig at amd.com>

> ---
>   src/gallium/auxiliary/vl/vl_mpeg12_decoder.c | 4 ++--
>   src/gallium/auxiliary/vl/vl_video_buffer.c   | 2 +-
>   src/gallium/state_trackers/vdpau/surface.c   | 2 +-
>   3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
> index 1eb9708..de890fe 100644
> --- a/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
> +++ b/src/gallium/auxiliary/vl/vl_mpeg12_decoder.c
> @@ -1063,8 +1063,8 @@ vl_create_mpeg12_decoder(struct pipe_context *context,
>         dec->chroma_height = dec->base.height / 2;
>         dec->num_blocks = dec->num_blocks * 2;
>      } else if (dec->base.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) {
> -      dec->chroma_width = dec->base.width;
> -      dec->chroma_height = dec->base.height / 2;
> +      dec->chroma_width = dec->base.width / 2;
> +      dec->chroma_height = dec->base.height;
>         dec->num_blocks = dec->num_blocks * 2 + dec->num_blocks;
>      } else {
>         dec->chroma_width = dec->base.width;
> diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
> index 6ef95e4..9600ce9 100644
> --- a/src/gallium/auxiliary/vl/vl_video_buffer.c
> +++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
> @@ -239,7 +239,7 @@ vl_video_buffer_template(struct pipe_resource *templ,
>            templ->width0 /= 2;
>            templ->height0 /= 2;
>         } else if (tmpl->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) {
> -         templ->height0 /= 2;
> +         templ->width0 /= 2;
>         }
>      }
>   }
> diff --git a/src/gallium/state_trackers/vdpau/surface.c b/src/gallium/state_trackers/vdpau/surface.c
> index bd11fc3..1bebe6c 100644
> --- a/src/gallium/state_trackers/vdpau/surface.c
> +++ b/src/gallium/state_trackers/vdpau/surface.c
> @@ -172,7 +172,7 @@ vlVdpVideoSurfaceSize(vlVdpSurface *p_surf, int component,
>            *width /= 2;
>            *height /= 2;
>         } else if (p_surf->templat.chroma_format == PIPE_VIDEO_CHROMA_FORMAT_422) {
> -         *height /= 2;
> +         *width /= 2;
>         }
>      }
>      if (p_surf->templat.interlaced)



More information about the mesa-dev mailing list