+ int i_plane;
+
+ /* Copy image and skip lines */
+ for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+ {
+ u8 *p_in, *p_out_end, *p_out;
+
+ p_in = p_pic->p[i_plane].p_pixels;
+ p_out = p_outpic->p[i_plane].p_pixels;
+ p_out_end = p_out + p_outpic->p[i_plane].i_pitch
+ * p_outpic->p[i_plane].i_lines;
+
+ /* For BOTTOM field we need to add the first line */
+ if( i_field == 1 )
+ {
+ FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+ p_in += p_pic->p[i_plane].i_pitch;
+ p_out += p_pic->p[i_plane].i_pitch;
+ }
+
+ p_out_end -= 2 * p_outpic->p[i_plane].i_pitch;
+
+ for( ; p_out < p_out_end ; )
+ {
+ FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+
+ p_out += p_pic->p[i_plane].i_pitch;
+
+ Merge( p_out, p_in, p_in + 2 * p_pic->p[i_plane].i_pitch,
+ p_pic->p[i_plane].i_pitch );
+
+ p_in += 2 * p_pic->p[i_plane].i_pitch;
+ p_out += p_pic->p[i_plane].i_pitch;
+ }
+
+ FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+
+ /* For TOP field we need to add the last line */
+ if( i_field == 0 )
+ {
+ p_in += p_pic->p[i_plane].i_pitch;
+ p_out += p_pic->p[i_plane].i_pitch;
+ FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+ }
+ }
+}
+
+static void RenderMean( vout_thread_t *p_vout,
+ picture_t *p_outpic, picture_t *p_pic )
+{
+ int i_plane;
+
+ /* Copy image and skip lines */
+ for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+ {
+ u8 *p_in, *p_out_end, *p_out;
+
+ p_in = p_pic->p[i_plane].p_pixels;
+
+ p_out = p_outpic->p[i_plane].p_pixels;
+ p_out_end = p_out + p_outpic->p[i_plane].i_pitch
+ * p_outpic->p[i_plane].i_lines;
+
+ /* All lines: mean value */
+ for( ; p_out < p_out_end ; )
+ {
+ Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch,
+ p_pic->p[i_plane].i_pitch );
+
+ p_out += p_pic->p[i_plane].i_pitch;
+ p_in += 2 * p_pic->p[i_plane].i_pitch;
+ }
+ }
+}
+
+static void RenderBlend( vout_thread_t *p_vout,
+ picture_t *p_outpic, picture_t *p_pic )
+{
+ int i_plane;
+
+ /* Copy image and skip lines */
+ for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+ {
+ u8 *p_in, *p_out_end, *p_out;
+
+ p_in = p_pic->p[i_plane].p_pixels;
+
+ p_out = p_outpic->p[i_plane].p_pixels;
+ p_out_end = p_out + p_outpic->p[i_plane].i_pitch
+ * p_outpic->p[i_plane].i_lines;
+
+ /* First line: simple copy */
+ FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+ p_out += p_pic->p[i_plane].i_pitch;
+
+ /* Remaining lines: mean value */
+ for( ; p_out < p_out_end ; )
+ {
+ Merge( p_out, p_in, p_in + p_pic->p[i_plane].i_pitch,
+ p_pic->p[i_plane].i_pitch );
+
+ p_out += p_pic->p[i_plane].i_pitch;
+ p_in += p_pic->p[i_plane].i_pitch;
+ }
+ }