From: Anton Mitrofanov Date: Sat, 12 May 2012 09:57:49 +0000 (+0400) Subject: Fix some bugs in mb_info code X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=1c97f3570fba02f768fbf649b9f7d48beb720048;p=x264.git Fix some bugs in mb_info code --- diff --git a/common/deblock.c b/common/deblock.c index 7603a69c..6022ead0 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 fed22771..b0694f6e 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 b42d5dc8..4f233ff7 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 )