[MPlayer-dev-eng] [PATCH 5/5] vo_xv: Support NV12/21

Alexander Strasser eclipse7 at gmx.net
Thu Jun 15 02:37:23 EEST 2017


On 2017-06-15 00:50 +0200, Alexander Strasser wrote:
> Based-on-a-patch-by: Ville Syrjälä >syrjala sci fi<
> Signed-off-by: Alexander Strasser <eclipse7 at gmx.net>
> ---
>  libvo/vo_xv.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
> index 3febbf748..222c72f5f 100644
> --- a/libvo/vo_xv.c
> +++ b/libvo/vo_xv.c
[...]
> @@ -398,9 +399,14 @@ static int draw_slice(uint8_t * image[], int stride[], int w, int h,
>          idx_p1 = 2; idx_p2 = 1;
>      case IMGFMT_I420:
>      case IMGFMT_IYUV:
> +        num_planes = 3;
>          x /= 2;
> -        y /= 2;
>          w /= 2;
> +    case IMGFMT_NV12:
> +    case IMGFMT_NV21:

> +        x &= ~1;
> +        w &= ~1;

After reading this hunk again; I think it is wrong. Those two lines should
only be in the path for NV12/21.

I wonder if the choice of the switch is that good after all. Maybe it's still
OK I have to try again after rewriting and separating the tail parts for 
NV12/21 and the others.


  Alexander


> +        y /= 2;
>          h /= 2;
>  
>          dst = xvimage[current_buf]->data + xvimage[current_buf]->offsets[1] +
> @@ -408,10 +414,12 @@ static int draw_slice(uint8_t * image[], int stride[], int w, int h,
>              memcpy_pic(dst, image[idx_p1], w, h, xvimage[current_buf]->pitches[1],
>                         stride[idx_p1]);
>  
> +        if (num_planes == 3) {
>          dst = xvimage[current_buf]->data + xvimage[current_buf]->offsets[2] +
>              xvimage[current_buf]->pitches[2] * y + x;
>              memcpy_pic(dst, image[idx_p2], w, h, xvimage[current_buf]->pitches[2],
>                         stride[idx_p2]);
> +        }
>          break;
>      }
[...]


More information about the MPlayer-dev-eng mailing list