]> granicus.if.org Git - libvpx/commitdiff
Return rate and distortion cost values from non-RD mode decision
authorJingning Han <jingning@google.com>
Thu, 13 Mar 2014 19:52:59 +0000 (12:52 -0700)
committerJingning Han <jingning@google.com>
Thu, 13 Mar 2014 19:52:59 +0000 (12:52 -0700)
This commit allows the non-RD mode decision process to return the
rate and distortion costs associated with the selected mode.

Change-Id: Ibe0f67d323f65839fd9cb0a726c1219bf7b55da9

vp9/encoder/vp9_pickmode.c

index cd4632696a9c13fd405a15a468e9ef99c9afb5e0..dc8b000f5560c9ac4fe3b347359f8dae3a897bc0 100644 (file)
@@ -327,6 +327,8 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
 
       if (this_rd < best_rd) {
         best_rd = this_rd;
+        *returnrate = rate;
+        *returndistortion = dist;
         best_mode = this_mode;
         best_ref_frame = ref_frame;
       }
@@ -353,6 +355,8 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
 
       if (this_rd + intra_mode_cost < best_rd) {
         best_rd = this_rd;
+        *returnrate = rate;
+        *returndistortion = dist;
         mbmi->mode = this_mode;
         mbmi->ref_frame[0] = INTRA_FRAME;
         mbmi->uv_mode = this_mode;