]> git.videolan.org Git - x264.git/commitdiff
Pad non-mod16 resolutions using the correct field
authorHenrik Gramner <hengar-6@student.ltu.se>
Mon, 22 Mar 2010 01:59:50 +0000 (02:59 +0100)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Sat, 27 Mar 2010 19:47:30 +0000 (12:47 -0700)
Improves compression of interlaced videos with non-mod16 heights.

common/frame.c

index 362c4d6bf93b6f0dc8c466d09df55299be3a6dde..ab4aaffc63cbcedd4b698929168ecffdf9359290 100644 (file)
@@ -363,10 +363,9 @@ void x264_frame_expand_border_mod16( x264_t *h, x264_frame_t *frame )
         }
         if( i_pady )
         {
-            //FIXME interlace? or just let it pad using the wrong field
             for( y = i_height; y < i_height + i_pady; y++ )
                 memcpy( &frame->plane[i][y*frame->i_stride[i]],
-                        &frame->plane[i][(i_height-1)*frame->i_stride[i]],
+                        &frame->plane[i][(i_height-(~y&h->param.b_interlaced)-1)*frame->i_stride[i]],
                         i_width + i_padx );
         }
     }