[XviD-devel] BUG: real n-vops with b-frames combination b0rks
Andrew Dunstan
a_dunstan at hotmail.com
Sun Feb 12 07:53:35 CET 2006
>From: "bond" <b-o-n-d at gmx.net>
>Reply-To: xvid-devel at xvid.org
>To: <xvid-devel at xvid.org>
>Subject: [XviD-devel] BUG: real n-vops with b-frames combination b0rks
>Date: Tue, 31 Jan 2006 18:35:41 +0100
>
>for a long time xvid didnt insert real n-vops into the video stream when
>b-frames have been enabled (be it packed bitstream or not). since 1.1 this
>has been changed
>you can get xvid to insert real n-vops by increasing the framedropratio
>option (maximum is a value of 100)
<snip>
>3) the third problem is that when getting xvid to insert real n-vops the
>targeted bitrate isnt hit at all anymore in 2pass.
Here's a patch that seems to fix this issue (maybe reason 4 as well, not
sure):
--- src/encoder.c 19 Jan 2006 22:25:18 -0000 1.123
+++ src/encoder.c 12 Feb 2006 07:36:42 -0000
@@ -1384,7 +1384,8 @@
if ( FrameCodeP(pEnc, &bs) == 0 ) {
/* N-VOP, we mustn't code b-frames yet */
- call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER,
NULL, NULL, stats);
+ if ((pEnc->mbParam.global_flags & XVID_GLOBAL_PACKED) ||
pEnc->mbParam.max_bframes == 0)
+ call_plugins(pEnc, pEnc->current, &pEnc->sOriginal, XVID_PLG_AFTER,
NULL, NULL, stats);
goto done;
}
}
@@ -1797,7 +1798,7 @@
(pParam->frame_drop_ratio * mb_width * mb_height) / 100 &&
( (pEnc->bframenum_head >= pEnc->bframenum_tail) ||
!(pEnc->mbParam.global_flags & XVID_GLOBAL_CLOSED_GOP)) )
{
- current->sStat.kblks = current->sStat.mblks = 0;
+ current->sStat.kblks = current->sStat.mblks = current->sStat.iTextBits =
0;
current->sStat.ublks = mb_width * mb_height;
BitstreamReset(bs);
More information about the XviD-devel
mailing list