[x264-devel] [PATCHv2 0/2] nv21 input support
Yu Xiaolei
dreifachstein at gmail.com
Thu May 22 15:07:04 CEST 2014
On 03/16/2014 01:14 PM, Geek.Song wrote:
> On Sat, Mar 15, 2014 at 12:16 AM, Yu Xiaolei <dreifachstein at gmail.com <mailto:dreifachstein at gmail.com>> wrote:
> + 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, h->param.i_height>>v_shift );
> +
> + }
>
>
> I think :
>
> stride[1]/sizeof(pixel), h->param.i_width, h->param.i_height>>v_shift );
>
> should be:
>
> stride[1]/sizeof(pixel), h->param.i_width>>1, h->param.i_height>>v_shift );
fixed
>
> diff --git a/x264.h b/x264.h
> index 2e4a98d..77d9ce4 100644
> --- a/x264.h
> +++ b/x264.h
> @@ -41,7 +41,7 @@
>
> #include "x264_config.h"
>
> -#define X264_BUILD 142
> +#define X264_BUILD 143
>
> /* Application developers planning to link against a shared library version of
> * libx264 from a Microsoft Visual Studio or similar development environment
> @@ -212,16 +212,17 @@ static const char * const x264_nal_hrd_names[] = { "none", "vbr", "cbr", 0 };
> #define X264_CSP_I420 0x0001 /* yuv 4:2:0 planar */
> #define X264_CSP_YV12 0x0002 /* yvu 4:2:0 planar */
> #define X264_CSP_NV12 0x0003 /* yuv 4:2:0, with one y plane and one packed u+v */
> -#define X264_CSP_I422 0x0004 /* yuv 4:2:2 planar */
> -#define X264_CSP_YV16 0x0005 /* yvu 4:2:2 planar */
> -#define X264_CSP_NV16 0x0006 /* yuv 4:2:2, with one y plane and one packed u+v */
> -#define X264_CSP_V210 0x0007 /* 10-bit yuv 4:2:2 packed in 32 */
> -#define X264_CSP_I444 0x0008 /* yuv 4:4:4 planar */
> -#define X264_CSP_YV24 0x0009 /* yvu 4:4:4 planar */
> -#define X264_CSP_BGR 0x000a /* packed bgr 24bits */
> -#define X264_CSP_BGRA 0x000b /* packed bgr 32bits */
> -#define X264_CSP_RGB 0x000c /* packed rgb 24bits */
> -#define X264_CSP_MAX 0x000d /* end of list */
> +#define X264_CSP_NV21 0x0004 /* yuv 4:2:0, with one y plane and one packed v+u */
> +#define X264_CSP_I422 0x0005 /* yuv 4:2:2 planar */
> +#define X264_CSP_YV16 0x0006 /* yvu 4:2:2 planar */
> +#define X264_CSP_NV16 0x0007 /* yuv 4:2:2, with one y plane and one packed u+v */
> +#define X264_CSP_V210 0x0008 /* 10-bit yuv 4:2:2 packed in 32 */
> +#define X264_CSP_I444 0x0009 /* yuv 4:4:4 planar */
> +#define X264_CSP_YV24 0x000a /* yvu 4:4:4 planar */
> +#define X264_CSP_BGR 0x000b /* packed bgr 24bits */
> +#define X264_CSP_BGRA 0x000c /* packed bgr 32bits */
> +#define X264_CSP_RGB 0x000d /* packed rgb 24bits */
> +#define X264_CSP_MAX 0x000e /* end of list */
> #define X264_CSP_VFLIP 0x1000 /* the csp is vertically flipped */
> #define X264_CSP_HIGH_DEPTH 0x2000 /* the csp has a depth of 16 bits per pixel component */
>
>
> You need not modify the definition of other X264_CSP_XXXs, you just append X264_CSP_NV21 before X264_CSP_MAX.
Many places in x264 assume that yuv420 format values are between X264_CPS_I420 and X264_CSP_NV12
such as x264.c (1287):
if( output_csp == X264_CSP_I420 && (csp < X264_CSP_I420 || csp > X264_CSP_NV12) )
So NV21 should have been inserted before NV12.
This version also includes cli support code.
The second patch adds a neon implementation.
More information about the x264-devel
mailing list