- /* Allocate memory */
- switch( p_vout->render.i_chroma )
- {
- case YUV_420_PICTURE: /* YUV 420: 1,1/4,1/4 samples per pixel */
- case YUV_422_PICTURE: /* YUV 422: 1,1/2,1/2 samples per pixel */
- case YUV_444_PICTURE: /* YUV 444: 1,1,1 samples per pixel */
-
- i_data_size = p_picture->i_size + 2 * p_picture->i_chroma_size;
-
- /* The Y plane */
- p_picture->planes[ Y_PLANE ].i_bytes =
- p_picture->i_size * sizeof(pixel_data_t);
- p_picture->planes[ Y_PLANE ].i_line_bytes =
- p_vout->render.i_width * sizeof(pixel_data_t);
- p_picture->planes[ Y_PLANE ].p_data =
- memalign( 16, i_data_size * sizeof(pixel_data_t) * 4 );
- /* The U plane */
- p_picture->planes[ U_PLANE ].i_bytes =
- p_picture->i_chroma_size * sizeof(pixel_data_t);
- p_picture->planes[ U_PLANE ].i_line_bytes =
- p_picture->i_chroma_width * sizeof(pixel_data_t);
- p_picture->planes[ U_PLANE ].p_data =
- p_picture->planes[ Y_PLANE ].p_data + p_picture->i_size;
- /* The V plane */
- p_picture->planes[ V_PLANE ].i_bytes =
- p_picture->i_chroma_size * sizeof(pixel_data_t);
- p_picture->planes[ V_PLANE ].i_line_bytes =
- p_picture->i_chroma_width * sizeof(pixel_data_t);
- p_picture->planes[ V_PLANE ].p_data =
- p_picture->planes[ U_PLANE ].p_data + p_picture->i_chroma_size;
-
- p_picture->i_planes = 3;
-
- break;
-
- default:
- p_picture->i_planes = 0;
-
- break;
- }