[vlc-devel] [PATCH] copy: add conversions to I420 and NV12

Jean-Baptiste Kempf jb at videolan.org
Tue Apr 28 15:59:23 CEST 2015


On 28 Apr, Steve Lhomme wrote :
> >> +static void SSE_CopyFromNv12ToI420(picture_t *dst,
> >> +                             uint8_t *src[2], size_t src_pitch[2],
> >> +                             unsigned width, unsigned height,
> >> +                             copy_cache_t *cache, unsigned cpu)
> >> +{
> >> +    SSE_CopyPlane(dst->p[0].p_pixels, dst->p[0].i_pitch,
> >> +                  src[0], src_pitch[0],
> >> +                  cache->buffer, cache->size,
> >> +                  width, height, cpu);
> >> +    SSE_SplitPlanes(dst->p[1].p_pixels, dst->p[1].i_pitch,
> >> +                    dst->p[2].p_pixels, dst->p[2].i_pitch,
> >> +                    src[1], src_pitch[1],
> >> +                    cache->buffer, cache->size,
> >> +                    (width+1)/2, (height+1)/2, cpu);
> >> +    asm volatile ("emms");
> >> +}
> >
> > This one is exactly SSE_CopyFromNv12 with p[1] and p[2] inverted.
> > I fear it is wrong since Nv12 and I420 are inverted wrt U and V order.
> 
> I did not test all the routines (no YV12 for ex) but this is the one
> that's really needed and tested.

Sorry, but NV12 is the semi-packed version of YV12, not of I420.

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device



More information about the vlc-devel mailing list