[x264-devel] commit: More correct padding constants for lowres planes ( Jason Garrett-Glaser )

git version control git at videolan.org
Thu Jan 14 05:51:06 CET 2010


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Thu Dec 31 13:45:27 2009 -0500| [e9f998b97db6e498faa62a60c6fddf3cabfea214] | committer: Jason Garrett-Glaser 

More correct padding constants for lowres planes
Since lowres analysis isn't interlace-aware, we don't need to double the vertical padding for interlaced video.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=e9f998b97db6e498faa62a60c6fddf3cabfea214
---

 common/frame.c      |    4 ++--
 encoder/slicetype.c |    5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/common/frame.c b/common/frame.c
index 1060a21..08ef87f 100644
--- a/common/frame.c
+++ b/common/frame.c
@@ -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++ )
diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index 0b26f67..4ccff11 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -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;
     }
 }
 



More information about the x264-devel mailing list