]> granicus.if.org Git - libvpx/commitdiff
vp9: encoder-breakout: Modify UV thresholds.
authorMarco <marpan@google.com>
Thu, 28 Jan 2016 20:10:38 +0000 (12:10 -0800)
committerMarco <marpan@google.com>
Thu, 28 Jan 2016 20:12:40 +0000 (12:12 -0800)
Set UV thresholds to 0 for encoder breakout if
block is detected as skin.

Change-Id: Iaaa30b5cc8bae4cf611f8ea8eba693b730e32a3f

vp9/encoder/vp9_pickmode.c

index 7f51cc127dec42beb8cf2e371c40e3354dc250af..829066c9feb6841ef68b6f1c4d9df3bc8729119b 100644 (file)
@@ -812,7 +812,7 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
       mi->mv[0].as_mv.col > 64 ||
       mi->mv[0].as_mv.col < -64)
     motion_low = 0;
-  if (x->encode_breakout > 0 && motion_low == 1 && !x->sb_is_skin) {
+  if (x->encode_breakout > 0 && motion_low == 1) {
     // Set a maximum for threshold to avoid big PSNR loss in low bit rate
     // case. Use extreme low threshold for static frames to limit
     // skipping.
@@ -852,6 +852,12 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
   if (var <= thresh_ac && (sse - var) <= thresh_dc) {
     unsigned int sse_u, sse_v;
     unsigned int var_u, var_v;
+    unsigned int thresh_ac_uv = thresh_ac;
+    unsigned int thresh_dc_uv = thresh_dc;
+    if (x->sb_is_skin) {
+      thresh_ac_uv = 0;
+      thresh_dc_uv = 0;
+    }
 
     // Skip UV prediction unless breakout is zero (lossless) to save
     // computation with low impact on the result
@@ -867,14 +873,14 @@ static void encode_breakout_test(VP9_COMP *cpi, MACROBLOCK *x,
                                     xd->plane[1].dst.stride, &sse_u);
 
     // U skipping condition checking
-    if (((var_u << 2) <= thresh_ac) && (sse_u - var_u <= thresh_dc)) {
+    if (((var_u << 2) <= thresh_ac_uv) && (sse_u - var_u <= thresh_dc_uv)) {
       var_v = cpi->fn_ptr[uv_size].vf(x->plane[2].src.buf,
                                       x->plane[2].src.stride,
                                       xd->plane[2].dst.buf,
                                       xd->plane[2].dst.stride, &sse_v);
 
       // V skipping condition checking
-      if (((var_v << 2) <= thresh_ac) && (sse_v - var_v <= thresh_dc)) {
+      if (((var_v << 2) <= thresh_ac_uv) && (sse_v - var_v <= thresh_dc_uv)) {
         x->skip = 1;
 
         // The cost of skip bit needs to be added.