/*****************************************************************************
* frame.c: frame handling
*****************************************************************************
- * Copyright (C) 2003-2014 x264 project
+ * Copyright (C) 2003-2015 x264 project
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Loren Merritt <lorenm@u.washington.edu>
switch( external_csp & X264_CSP_MASK )
{
case X264_CSP_NV12:
+ case X264_CSP_NV21:
case X264_CSP_I420:
case X264_CSP_YV12:
return X264_CSP_NV12;
case X264_CSP_NV16:
case X264_CSP_I422:
case X264_CSP_YV16:
+ case X264_CSP_V210:
return X264_CSP_NV16;
case X264_CSP_I444:
case X264_CSP_YV24:
#if ARCH_X86 || ARCH_X86_64
if( h->param.cpu&X264_CPU_CACHELINE_64 )
align = 64;
- else if( h->param.cpu&X264_CPU_CACHELINE_32 || h->param.cpu&X264_CPU_AVX2 )
+ else if( h->param.cpu&X264_CPU_CACHELINE_32 || h->param.cpu&X264_CPU_AVX )
align = 32;
#endif
#if ARCH_PPC
}
#endif
- dst->i_type = src->i_type;
+ if( BIT_DEPTH != 10 && i_csp == X264_CSP_V210 )
+ {
+ x264_log( h, X264_LOG_ERROR, "v210 input is only compatible with bit-depth of 10 bits\n" );
+ return -1;
+ }
+
+ if( src->i_type < X264_TYPE_AUTO || src->i_type > X264_TYPE_KEYFRAME )
+ {
+ x264_log( h, X264_LOG_WARNING, "forced frame type (%d) at %d is unknown\n", src->i_type, h->frames.i_input );
+ dst->i_forced_type = X264_TYPE_AUTO;
+ }
+ else
+ dst->i_forced_type = src->i_type;
+
+ dst->i_type = dst->i_forced_type;
dst->i_qpplus1 = src->i_qpplus1;
dst->i_pts = dst->i_reordered_pts = src->i_pts;
dst->param = src->param;
uint8_t *pix[3];
int stride[3];
- if ( i_csp >= X264_CSP_BGR )
+ if( i_csp == X264_CSP_V210 )
+ {
+ stride[0] = src->img.i_stride[0];
+ pix[0] = src->img.plane[0];
+
+ h->mc.plane_copy_deinterleave_v210( dst->plane[0], dst->i_stride[0],
+ dst->plane[1], dst->i_stride[1],
+ (uint32_t *)pix[0], stride[0]/sizeof(uint32_t), h->param.i_width, h->param.i_height );
+ }
+ else if( i_csp >= X264_CSP_BGR )
{
stride[0] = src->img.i_stride[0];
pix[0] = src->img.plane[0];
h->mc.plane_copy( dst->plane[1], dst->i_stride[1], (pixel*)pix[1],
stride[1]/sizeof(pixel), h->param.i_width, h->param.i_height>>v_shift );
}
+ else if( i_csp == X264_CSP_NV21 )
+ {
+ get_plane_ptr( h, src, &pix[1], &stride[1], 1, 0, v_shift );
+ h->mc.plane_copy_swap( dst->plane[1], dst->i_stride[1], (pixel*)pix[1],
+ stride[1]/sizeof(pixel), h->param.i_width>>1, h->param.i_height>>v_shift );
+ }
else if( i_csp == X264_CSP_I420 || i_csp == X264_CSP_I422 || i_csp == X264_CSP_YV12 || i_csp == X264_CSP_YV16 )
{
int uv_swap = i_csp == X264_CSP_YV12 || i_csp == X264_CSP_YV16;