[x265] [PATCH] slicetype: do not re-calculate AQ cost of B-frames

Steve Borho steve at borho.org
Tue Mar 24 23:18:03 CET 2015


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1427235333 18000
#      Tue Mar 24 17:15:33 2015 -0500
# Node ID 59a1cce104ac15d855f2b17aa5f9a997be642b69
# Parent  41904c8881a20ff502cc55898343f8a757ad36fb
slicetype: do not re-calculate AQ cost of B-frames

diff -r 41904c8881a2 -r 59a1cce104ac source/encoder/slicetype.cpp
--- a/source/encoder/slicetype.cpp	Tue Mar 24 17:15:13 2015 -0500
+++ b/source/encoder/slicetype.cpp	Tue Mar 24 17:15:33 2015 -0500
@@ -1753,9 +1753,12 @@
  * re-running lookahead. */
 int64_t Lookahead::frameCostRecalculate(Lowres** frames, int p0, int p1, int b)
 {
+    if (frames[b]->sliceType == X265_TYPE_B)
+        return frames[b]->costEstAq[b - p0][p1 - b];
+
     int64_t score = 0;
     int *rowSatd = frames[b]->rowSatds[b - p0][p1 - b];
-    double *qp_offset = (frames[b]->sliceType == X265_TYPE_B) ? frames[b]->qpAqOffset : frames[b]->qpCuTreeOffset;
+    double *qp_offset = frames[b]->qpCuTreeOffset;
 
     x265_emms();
     for (int cuy = m_8x8Height - 1; cuy >= 0; cuy--)


More information about the x265-devel mailing list