[x264-devel] Fix some bugs in mb_info code

Anton Mitrofanov git at videolan.org
Tue May 22 23:56:13 CEST 2012


x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sat May 12 13:57:49 2012 +0400| [1c97f3570fba02f768fbf649b9f7d48beb720048] | committer: Jason Garrett-Glaser

Fix some bugs in mb_info code

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

 common/deblock.c  |    6 +++---
 common/frame.c    |    4 ++--
 encoder/encoder.c |    4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/deblock.c b/common/deblock.c
index 7603a69..6022ead 100644
--- a/common/deblock.c
+++ b/common/deblock.c
@@ -506,9 +506,9 @@ void x264_frame_deblock_row( x264_t *h, int mb_y )
                 /* Any MB that was coded, or that analysis decided to skip, has quality commensurate with its QP.
                  * But if deblocking affects neighboring MBs that were force-skipped, blur might accumulate there.
                  * So reset their effective QP to max, to indicate that lack of guarantee. */
-                if( h->fdec->mb_info && M32( bs[0][0] ) )
+                if( h->fenc->mb_info && M32( bs[0][0] ) )
                 {
-#define RESET_EFFECTIVE_QP(xy) h->fdec->effective_qp[xy] |= 0xff * !!(h->fdec->mb_info[xy] & X264_MBINFO_CONSTANT);
+#define RESET_EFFECTIVE_QP(xy) h->fdec->effective_qp[xy] |= 0xff * !!(h->fenc->mb_info[xy] & X264_MBINFO_CONSTANT);
                     RESET_EFFECTIVE_QP(mb_xy);
                     RESET_EFFECTIVE_QP(h->mb.i_mb_left_xy[0]);
                 }
@@ -561,7 +561,7 @@ void x264_frame_deblock_row( x264_t *h, int mb_y )
                 int intra_deblock = intra_cur || intra_top;
 
                 /* This edge has been modified, reset effective qp to max. */
-                if( h->fdec->mb_info && M32( bs[1][0] ) )
+                if( h->fenc->mb_info && M32( bs[1][0] ) )
                 {
                     RESET_EFFECTIVE_QP(mb_xy);
                     RESET_EFFECTIVE_QP(h->mb.i_mb_top_xy);
diff --git a/common/frame.c b/common/frame.c
index fed2277..b0694f6 100644
--- a/common/frame.c
+++ b/common/frame.c
@@ -357,8 +357,8 @@ int x264_frame_copy_picture( x264_t *h, x264_frame_t *dst, x264_picture_t *src )
     dst->i_pic_struct = src->i_pic_struct;
     dst->extra_sei  = src->extra_sei;
     dst->opaque     = src->opaque;
-    dst->mb_info    = src->prop.mb_info;
-    dst->mb_info_free = src->prop.mb_info_free;
+    dst->mb_info    = h->param.analyse.b_mb_info ? src->prop.mb_info : NULL;
+    dst->mb_info_free = h->param.analyse.b_mb_info ? src->prop.mb_info_free : NULL;
 
     uint8_t *pix[3];
     int stride[3];
diff --git a/encoder/encoder.c b/encoder/encoder.c
index b42d5dc..4f233ff 100644
--- a/encoder/encoder.c
+++ b/encoder/encoder.c
@@ -3199,8 +3199,8 @@ static int x264_encoder_frame_end( x264_t *h, x264_t *thread_current,
 
     x264_emms();
 
-    if( h->fdec->mb_info_free )
-        h->fdec->mb_info_free( h->fdec->mb_info );
+    if( h->fenc->mb_info_free )
+        h->fenc->mb_info_free( h->fenc->mb_info );
 
     /* generate buffering period sei and insert it into place */
     if( h->i_thread_frames > 1 && h->fenc->b_keyframe && h->sps->vui.b_nal_hrd_parameters_present )



More information about the x264-devel mailing list