[x264-devel] commit: Hack around a potential failure point in VBV (Jason Garrett-Glaser )

git version control git at videolan.org
Wed Jan 28 08:31:01 CET 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Tue Jan 27 23:27:56 2009 -0800| [71c5a8dca6e5f7bf2330d028989eeeab27701151] | committer: Jason Garrett-Glaser 

Hack around a potential failure point in VBV
pred_b_from_p can become absurdly large in static scenes, leading to rare collapses of quality with VBV+B-frames+threads.
This isn't a final fix, but should resolve the problem in most cases in the meantime.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=71c5a8dca6e5f7bf2330d028989eeeab27701151
---

 encoder/ratecontrol.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/encoder/ratecontrol.c b/encoder/ratecontrol.c
index af0a00a..c69ebb5 100644
--- a/encoder/ratecontrol.c
+++ b/encoder/ratecontrol.c
@@ -1147,6 +1147,10 @@ void x264_ratecontrol_end( x264_t *h, int bits )
             {
                 update_predictor( rc->pred_b_from_p, qp2qscale(rc->qpa_rc),
                                   h->fref1[h->i_ref1-1]->i_satd, rc->bframe_bits / rc->bframes );
+                /* In some cases, such as completely blank scenes, pred_b_from_p can go nuts */
+                /* Hackily cap the predictor coeff in case this happens. */
+                /* FIXME FIXME FIXME */
+                rc->pred_b_from_p->coeff = X264_MIN( rc->pred_b_from_p->coeff, 10. );
                 rc->bframe_bits = 0;
             }
         }



More information about the x264-devel mailing list