+static void GetOutputFormat( vout_thread_t *p_vout,
+ video_format_t *p_dst, const video_format_t *p_src )
+{
+ *p_dst = *p_src;
+
+ if( p_vout->p_sys->b_half_height )
+ {
+ p_dst->i_height /= 2;
+ p_dst->i_visible_height /= 2;
+ p_dst->i_y_offset /= 2;
+ p_dst->i_sar_den *= 2;
+ }
+
+ if( p_src->i_chroma == VLC_FOURCC('I','4','2','2') )
+ {
+ switch( p_vout->p_sys->i_mode )
+ {
+ case DEINTERLACE_MEAN:
+ case DEINTERLACE_LINEAR:
+ case DEINTERLACE_X:
+ p_dst->i_chroma = VLC_FOURCC('I','4','2','2');
+ break;
+ default:
+ p_dst->i_chroma = VLC_FOURCC('I','4','2','0');
+ break;
+ }
+ }
+}
+
+static bool IsChromaSupported( vlc_fourcc_t i_chroma )
+{
+ return i_chroma == VLC_FOURCC('I','4','2','0') ||
+ i_chroma == VLC_FOURCC('I','Y','U','V') ||
+ i_chroma == VLC_FOURCC('Y','V','1','2') ||
+ i_chroma == VLC_FOURCC('I','4','2','2');
+}
+