[x264-devel] [PATCH] fix mb_type statistic bug in X264

zhengzhi Duan royzzduan at foxmail.com
Thu Feb 4 04:26:17 UTC 2021


From: royduan <royduan at tencent.com>

---
 encoder/ratecontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index e52270ba..e667a24e 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1831,7 +1831,7 @@ int x264_ratecontrol_end( x264_t *h, int bits, int *filler )
     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_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;
-- 
2.28.0.windows.1



More information about the x264-devel mailing list