[x264-devel] CABAC trellis opts part 1: minor change in output

Loren Merritt git at videolan.org
Mon Jan 16 02:12:00 CET 2012


x264 | branch: master | Loren Merritt <pengvado at akuvian.org> | Thu Dec 22 17:55:06 2011 +0000| [e176619d010fc32c970c7ab7a769bbfbe2665f61] | committer: Jason Garrett-Glaser

CABAC trellis opts part 1: minor change in output
Due to different tie-break order.

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

 encoder/rdo.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/encoder/rdo.c b/encoder/rdo.c
index 2cd6110..53a46e4 100644
--- a/encoder/rdo.c
+++ b/encoder/rdo.c
@@ -532,8 +532,8 @@ int quant_trellis_cabac( x264_t *h, dctcoef *dct,
             // no need to modify level_tree for ctx=0: it starts with an infinite loop of 0s.
             int sigindex = !dc && i_coefs == 64 ? significant_coeff_flag_offset_8x8[b_interlaced][i] :
                            b_chroma && dc && i_coefs == 8 ? coeff_flag_offset_chroma_422_dc[i] : i;
-            const uint32_t cost_sig0 = x264_cabac_size_decision_noup2( &cabac_state_sig[sigindex], 0 )
-                                     * (uint64_t)i_lambda2 >> ( CABAC_SIZE_BITS - LAMBDA_BITS );
+            uint64_t cost_sig0 = x264_cabac_size_decision_noup2( &cabac_state_sig[sigindex], 0 )
+                               * (uint64_t)i_lambda2 >> ( CABAC_SIZE_BITS - LAMBDA_BITS );
             for( int j = 1; j < 8; j++ )
             {
                 if( nodes_cur[j].score != TRELLIS_SCORE_MAX )
@@ -583,7 +583,7 @@ int quant_trellis_cabac( x264_t *h, dctcoef *dct,
         // but it's only around .003 dB, and skipping them ~doubles the speed of trellis.
         // could also try q-2: that sometimes helps, but also sometimes decimates blocks
         // that are better left coded, especially at QP > 40.
-        for( int abs_level = q; abs_level >= q-1; abs_level-- )
+        for( int abs_level = q-1; abs_level <= q; abs_level++ )
         {
             int unquant_abs_level = (((dc?unquant_mf[0]<<1:unquant_mf[zigzag[i]]) * abs_level + 128) >> 8);
             int d = i_coef - unquant_abs_level;



More information about the x264-devel mailing list