]> granicus.if.org Git - libvpx/commitdiff
Avoid a potential assertion fail in optimize_b()
authorhui su <huisu@google.com>
Tue, 7 Jun 2016 22:45:04 +0000 (15:45 -0700)
committerhui su <huisu@google.com>
Tue, 7 Jun 2016 22:45:04 +0000 (15:45 -0700)
The eob of a block is not perperly set when skip_recode is true,
thus triggering assert(eob <= default_eob) to fail.

Change-Id: Ifecbe33dce2dc4903e0a80bd384dc09bf0dd8a44

vp9/encoder/vp9_encodemb.c

index d53bddb1ca55ba27aaa0712f791cbe03ff9baeb3..936e6254b52bcfec92ec171beba946a16a2ca506 100644 (file)
@@ -913,7 +913,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
                              pd->dequant, eob, scan_order->scan,
                              scan_order->iscan);
       }
-      if (args->ctx != NULL) {
+      if (args->ctx != NULL && !x->skip_recode) {
        *a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
       }
       if (!x->skip_encode && *eob)
@@ -929,7 +929,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
                        pd->dequant, eob, scan_order->scan,
                        scan_order->iscan);
       }
-      if (args->ctx != NULL) {
+      if (args->ctx != NULL && !x->skip_recode) {
         *a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
       }
       if (!x->skip_encode && *eob)
@@ -945,7 +945,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
                        pd->dequant, eob, scan_order->scan,
                        scan_order->iscan);
       }
-      if (args->ctx != NULL) {
+      if (args->ctx != NULL && !x->skip_recode) {
         *a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
       }
       if (!x->skip_encode && *eob)
@@ -964,7 +964,7 @@ void vp9_encode_block_intra(int plane, int block, BLOCK_SIZE plane_bsize,
                        pd->dequant, eob, scan_order->scan,
                        scan_order->iscan);
       }
-      if (args->ctx != NULL) {
+      if (args->ctx != NULL && !x->skip_recode) {
         *a = *l = optimize_b(x, plane, block, tx_size, entropy_ctx) > 0;
       }
       if (!x->skip_encode && *eob) {