diff --git a/encoder/analyse.c b/encoder/analyse.c index efd12377d76cc5714cdf99a9bb35e522681ca5d2..5e32e223eacf7102e5431d1a07161eef2661d6b5 100644 --- a/encoder/analyse.c +++ b/encoder/analyse.c @@ -450,7 +450,7 @@ static void mb_analyse_init( x264_t *h, x264_mb_analysis_t *a, int qp ) IS_INTRA( h->mb.i_mb_type_topleft ) || IS_INTRA( h->mb.i_mb_type_topright ) || (h->sh.i_type == SLICE_TYPE_P && IS_INTRA( h->fref[0][0]->mb_type[h->mb.i_mb_xy] )) || - (h->mb.i_mb_xy - h->sh.i_first_mb < 3*(h->stat.frame.i_mb_count[I_4x4] + h->stat.frame.i_mb_count[I_8x8] + h->stat.frame.i_mb_count[I_16x16])) ) + (h->mb.i_mb_xy - h->sh.i_first_mb < 3*(h->stat.frame.i_mb_count[I_4x4] + h->stat.frame.i_mb_count[I_8x8] + h->stat.frame.i_mb_count[I_16x16] + h->stat.frame.i_mb_count[I_PCM])) ) { /* intra is likely */ } else { diff --git a/encoder/encoder.c b/encoder/encoder.c index 18b04113eaabea70073b6af2168a2e9a8ebc9aaf..95761b936d9c2594b8329287487c9107cab90ebe 100644 --- a/encoder/encoder.c +++ b/encoder/encoder.c @@ -4275,14 +4275,14 @@ void x264_encoder_close ( x264_t *h ) int64_t i_i8x8 = SUM3b( h->stat.i_mb_count, I_8x8 ); int64_t i_intra = i_i8x8 + SUM3b( h->stat.i_mb_count, I_4x4 ) + SUM3b( h->stat.i_mb_count, I_16x16 ); - int64_t i_all_intra = i_intra + SUM3b( h->stat.i_mb_count, I_PCM); + int64_t i_all_intra = i_intra + SUM3b( h->stat.i_mb_count, I_PCM ); int64_t i_skip = SUM3b( h->stat.i_mb_count, P_SKIP ) + SUM3b( h->stat.i_mb_count, B_SKIP ); const int i_count = h->stat.i_frame_count[SLICE_TYPE_I] + h->stat.i_frame_count[SLICE_TYPE_P] + h->stat.i_frame_count[SLICE_TYPE_B]; int64_t i_mb_count = (int64_t)i_count * h->mb.i_mb_count; - int64_t i_inter = i_mb_count - i_skip - i_intra; + int64_t i_inter = i_mb_count - i_skip - i_all_intra; const double duration = h->stat.f_frame_duration[SLICE_TYPE_I] + h->stat.f_frame_duration[SLICE_TYPE_P] + h->stat.f_frame_duration[SLICE_TYPE_B]; @@ -4297,7 +4297,7 @@ void x264_encoder_close ( x264_t *h ) if( i_skip ) fieldstats += sprintf( fieldstats, " skip:%.1f%%", h->stat.i_mb_field[2] * 100.0 / i_skip ); x264_log( h, X264_LOG_INFO, "field mbs: intra: %.1f%%%s\n", - h->stat.i_mb_field[0] * 100.0 / i_intra, buf ); + h->stat.i_mb_field[0] * 100.0 / i_all_intra, buf ); } if( h->pps->b_transform_8x8_mode ) @@ -4305,7 +4305,7 @@ void x264_encoder_close ( x264_t *h ) buf[0] = 0; if( h->stat.i_mb_count_8x8dct[0] ) sprintf( buf, " inter:%.1f%%", 100. * h->stat.i_mb_count_8x8dct[1] / h->stat.i_mb_count_8x8dct[0] ); - x264_log( h, X264_LOG_INFO, "8x8 transform intra:%.1f%%%s\n", 100. * i_i8x8 / i_intra, buf ); + x264_log( h, X264_LOG_INFO, "8x8 transform intra:%.1f%%%s\n", 100. * i_i8x8 / X264_MAX( i_intra, 1 ), buf ); } if( (h->param.analyse.i_direct_mv_pred == X264_DIRECT_PRED_AUTO || diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c index b106be160e7d818160368c2ce3a10725f3b40a57..9a6ea1c9ff97887bcd1a34d46790f4f4adea4658 100644 --- a/encoder/ratecontrol.c +++ b/encoder/ratecontrol.c @@ -1829,9 +1829,9 @@ int x264_ratecontrol_end( x264_t *h, int bits, int *filler ) x264_emms(); h->stat.frame.i_mb_count_skip = mbs[P_SKIP] + mbs[B_SKIP]; - h->stat.frame.i_mb_count_i = mbs[I_16x16] + mbs[I_8x8] + mbs[I_4x4]; + h->stat.frame.i_mb_count_i = mbs[I_16x16] + mbs[I_8x8] + mbs[I_4x4] + mbs[I_PCM]; h->stat.frame.i_mb_count_p = mbs[P_L0] + mbs[P_8x8]; - for( int i = B_DIRECT; i < B_8x8; i++ ) + for( int i = B_DIRECT; i <= B_8x8; i++ ) h->stat.frame.i_mb_count_p += mbs[i]; h->fdec->f_qp_avg_rc = rc->qpa_rc /= h->mb.i_mb_count;