]> git.videolan.org Git - x264.git/commitdiff
More correct padding constants for lowres planes
authorJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 31 Dec 2009 18:45:27 +0000 (13:45 -0500)
committerJason Garrett-Glaser <darkshikari@gmail.com>
Thu, 14 Jan 2010 04:46:59 +0000 (23:46 -0500)
Since lowres analysis isn't interlace-aware, we don't need to double the vertical padding for interlaced video.

common/frame.c
encoder/slicetype.c

index 1060a21a994280921aa14ef3bc0a68419e7c5905..08ef87f9129ea99848cedaf092cfb223da0f523d 100644 (file)
@@ -124,11 +124,11 @@ x264_frame_t *x264_frame_new( x264_t *h, int b_fdec )
             frame->i_stride_lowres = ALIGN( frame->i_width_lowres + 2*PADH, align );
             frame->i_lines_lowres = frame->i_lines[0]/2;
 
-            luma_plane_size = frame->i_stride_lowres * (frame->i_lines[0]/2 + 2*i_padv);
+            luma_plane_size = frame->i_stride_lowres * (frame->i_lines[0]/2 + 2*PADV);
 
             CHECKED_MALLOC( frame->buffer_lowres[0], 4 * luma_plane_size );
             for( i = 0; i < 4; i++ )
-                frame->lowres[i] = frame->buffer_lowres[0] + (frame->i_stride_lowres * i_padv + PADH) + i * luma_plane_size;
+                frame->lowres[i] = frame->buffer_lowres[0] + (frame->i_stride_lowres * PADV + PADH) + i * luma_plane_size;
 
             for( j = 0; j <= !!h->param.i_bframe; j++ )
                 for( i = 0; i <= h->param.i_bframe; i++ )
index 0b26f67f170fbbdf1a9f185e9b8843e2854b8c98..4ccff1104abee4fe86becf6f90581aa0b8a0a37a 100644 (file)
@@ -231,14 +231,13 @@ void x264_weights_analyse( x264_t *h, x264_frame_t *fenc, x264_frame_t *ref, int
     if( weights[0].weightfn && b_lookahead )
     {
         //scale lowres in lookahead for slicetype_frame_cost
-        int i_padv = PADV<<h->param.b_interlaced;
         uint8_t *src = ref->buffer_lowres[0];
         uint8_t *dst = h->mb.p_weight_buf[0];
         int width = ref->i_width_lowres + PADH*2;
-        int height = ref->i_lines_lowres + i_padv*2;
+        int height = ref->i_lines_lowres + PADV*2;
         x264_weight_scale_plane( h, dst, ref->i_stride_lowres, src, ref->i_stride_lowres,
                                  width, height, &weights[0] );
-        fenc->weighted[0] = h->mb.p_weight_buf[0] + PADH + ref->i_stride_lowres * i_padv;
+        fenc->weighted[0] = h->mb.p_weight_buf[0] + PADH + ref->i_stride_lowres * PADV;
     }
 }