]> git.videolan.org Git - x264.git/commitdiff
Fix some bugs in mb_info code
authorAnton Mitrofanov <BugMaster@narod.ru>
Sat, 12 May 2012 09:57:49 +0000 (13:57 +0400)
committerJason Garrett-Glaser <jason@x264.com>
Tue, 15 May 2012 01:53:18 +0000 (18:53 -0700)
common/deblock.c
common/frame.c
encoder/encoder.c

index 7603a69c6dd970ed7fc02a7ee9b5a7aafed022c2..6022ead0fb4bcbc0e0701fd51b5d9e11dc6aa935 100644 (file)
@@ -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);
index fed22771234e060a1eb28173e900404a43e790d2..b0694f6ece83c24bed59e62a7415082d2fde1b01 100644 (file)
@@ -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];
index b42d5dc82bf01830cf33d74a4927e2d12283c548..4f233ff76b0a338e4697fe5c2b184f3d92db5f12 100644 (file)
@@ -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 )