+void x264_plane_copy_interleave_c( pixel *dst, int i_dst,
+ pixel *srcu, int i_srcu,
+ pixel *srcv, int i_srcv, int w, int h )
+{
+ for( int y=0; y<h; y++, dst+=i_dst, srcu+=i_srcu, srcv+=i_srcv )
+ for( int x=0; x<w; x++ )
+ {
+ dst[2*x] = srcu[x];
+ dst[2*x+1] = srcv[x];
+ }
+}
+
+void x264_plane_copy_deinterleave_c( pixel *dstu, int i_dstu,
+ pixel *dstv, int i_dstv,
+ pixel *src, int i_src, int w, int h )
+{
+ for( int y=0; y<h; y++, dstu+=i_dstu, dstv+=i_dstv, src+=i_src )
+ for( int x=0; x<w; x++ )
+ {
+ dstu[x] = src[2*x];
+ dstv[x] = src[2*x+1];
+ }
+}
+
+void x264_plane_copy_deinterleave_rgb_c( pixel *dsta, int i_dsta,
+ pixel *dstb, int i_dstb,
+ pixel *dstc, int i_dstc,
+ pixel *src, int i_src, int pw, int w, int h )
+{
+ for( int y=0; y<h; y++, dsta+=i_dsta, dstb+=i_dstb, dstc+=i_dstc, src+=i_src )
+ {
+ for( int x=0; x<w; x++ )
+ {
+ dsta[x] = src[x*pw];
+ dstb[x] = src[x*pw+1];
+ dstc[x] = src[x*pw+2];
+ }
+ }
+}
+
+static void store_interleave_chroma( pixel *dst, int i_dst, pixel *srcu, pixel *srcv, int height )
+{
+ for( int y=0; y<height; y++, dst+=i_dst, srcu+=FDEC_STRIDE, srcv+=FDEC_STRIDE )
+ for( int x=0; x<8; x++ )
+ {
+ dst[2*x] = srcu[x];
+ dst[2*x+1] = srcv[x];
+ }
+}
+
+static void load_deinterleave_chroma_fenc( pixel *dst, pixel *src, int i_src, int height )
+{
+ x264_plane_copy_deinterleave_c( dst, FENC_STRIDE, dst+FENC_STRIDE/2, FENC_STRIDE, src, i_src, 8, height );
+}
+
+static void load_deinterleave_chroma_fdec( pixel *dst, pixel *src, int i_src, int height )
+{
+ x264_plane_copy_deinterleave_c( dst, FDEC_STRIDE, dst+FDEC_STRIDE/2, FDEC_STRIDE, src, i_src, 8, height );
+}
+
+static void prefetch_fenc_null( pixel *pix_y, int stride_y,
+ pixel *pix_uv, int stride_uv, int mb_x )