[x264-devel] [PATCHv3 1/1] nv21 input support

Geek.Song ffmpeg at gmail.com
Fri Oct 31 08:23:31 CET 2014


On Fri, Oct 31, 2014 at 3:37 AM, Henrik Gramner <henrik at gramner.com> wrote:
> Apologies for the slow reply.
>
> I'm pretty sure that the plane width should NOT be right shifted by 1.
> The chroma planes are indeed half-width, but they are packed together
> which doubles the effective width, so your original code was probably
> correct in that aspect. The same applies for the checkasm code. Did
> you test this?

Because the implementation:

+void x264_plane_copy_swap_c( pixel *dst, intptr_t i_dst,
+                             pixel *src, intptr_t i_src, int w, int h )
+{
+    for( int y=0; y<h; y++, dst+=i_dst, src+=i_src)
+        for ( int x=0; x<w; x++ )
+        {
+            dst[2*x]    = src[2*x+1];
+            dst[2*x+1]  = src[2*x];
+        }
+}
+

so SHIFTed by 1 MUST be applied to width;

-- 
-----------------------------------------------------------------------------------------
My key fingerprint: d1:03:f5:32:26:ff:d7:3c:e4:42:e3:51:ec:92:78:b2


More information about the x264-devel mailing list