[x264-devel] commit: Fix bug in calculation of I-frame costs with AQ. ( Jason Garrett-Glaser )

git version control git at videolan.org
Thu Aug 20 22:10:03 CEST 2009


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Thu Aug 20 13:08:25 2009 -0700| [856fbd471e2d9b0fd045caba4b87ba763c03b14b] | committer: Jason Garrett-Glaser 

Fix bug in calculation of I-frame costs with AQ.

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

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

diff --git a/encoder/slicetype.c b/encoder/slicetype.c
index d16ee22..672d6e9 100644
--- a/encoder/slicetype.c
+++ b/encoder/slicetype.c
@@ -257,6 +257,8 @@ lowres_intra_mb:
             {
                 fenc->i_intra_mbs[b-p0] += b_intra;
                 fenc->i_cost_est[0][0] += i_icost;
+                if( h->param.rc.i_aq_mode )
+                    fenc->i_cost_est_aq[0][0] += (i_icost * fenc->i_inv_qscale_factor[i_mb_xy] + 128) >> 8;
             }
         }
     }
@@ -305,6 +307,7 @@ static int x264_slicetype_frame_cost( x264_t *h, x264_mb_analysis_t *a,
         {
             frames[b]->i_intra_mbs[b-p0] = 0;
             frames[b]->i_cost_est[0][0] = 0;
+            frames[b]->i_cost_est_aq[0][0] = 0;
         }
         if( p1 != p0 )
             dist_scale_factor = ( ((b-p0) << 8) + ((p1-p0) >> 1) ) / (p1-p0);



More information about the x264-devel mailing list