]> granicus.if.org Git - libvpx/commitdiff
Fix mismatch in SUPERTX experiment
authorYue Chen <chenyue1212@gmail.com>
Sun, 28 Dec 2014 04:26:26 +0000 (20:26 -0800)
committerDeb Mukherjee <debargha@google.com>
Sun, 28 Dec 2014 10:27:16 +0000 (02:27 -0800)
Disable SUPERTX mode when lossless mode is enabled because the largest
lossless transform size is 4X4.

Change-Id: I4167959a282728d62354119ced99ca29febabfd1

vp9/decoder/vp9_decodeframe.c
vp9/encoder/vp9_bitstream.c
vp9/encoder/vp9_encodeframe.c

index bd875c4bec9278595d78852f8b6e99caf5e4155f..bf57150fbaea5adc3438ea9bb8929c7c829525b1 100644 (file)
@@ -998,7 +998,7 @@ static void decode_partition(VP9_COMMON *const cm, MACROBLOCKD *const xd,
   if (cm->frame_type != KEY_FRAME &&
       partition != PARTITION_NONE &&
       bsize <= MAX_SUPERTX_BLOCK_SIZE &&
-      !supertx_enabled) {
+      !supertx_enabled && !xd->lossless) {
     const int supertx_context =
         partition_supertx_context_lookup[partition];
     supertx_enabled = vp9_read(
@@ -2045,7 +2045,7 @@ static void read_supertx_probs(FRAME_CONTEXT *fc, vp9_reader *r) {
 static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data,
                                   size_t partition_size) {
   VP9_COMMON *const cm = &pbi->common;
-#if !CONFIG_TX_SKIP
+#if !CONFIG_TX_SKIP || CONFIG_SUPERTX
   MACROBLOCKD *const xd = &pbi->mb;
 #endif
   FRAME_CONTEXT *const fc = &cm->fc;
@@ -2099,7 +2099,8 @@ static int read_compressed_header(VP9Decoder *pbi, const uint8_t *data,
     read_ext_tx_probs(fc, &r);
 #endif
 #if CONFIG_SUPERTX
-    read_supertx_probs(fc, &r);
+    if (!xd->lossless)
+      read_supertx_probs(fc, &r);
 #endif
 #if CONFIG_TX_SKIP
   for (i = 0; i < 2; i++)
index 8b3689477c93715087212d80aaea4878bf6dd730..3f18f85a7d9948b61e9cb98ea2e6d6f4077a7a86 100644 (file)
@@ -722,7 +722,8 @@ static void write_modes_sb(VP9_COMP *cpi,
                  mi_col, num_8x8_blocks_wide_lookup[bsize],
                  cm->mi_rows, cm->mi_cols);
   if (!supertx_enabled && cm->frame_type != KEY_FRAME &&
-      partition != PARTITION_NONE && bsize <= MAX_SUPERTX_BLOCK_SIZE) {
+      partition != PARTITION_NONE && bsize <= MAX_SUPERTX_BLOCK_SIZE &&
+      !xd->lossless) {
     TX_SIZE supertx_size = bsize_to_tx_size(bsize);
     vp9_prob prob =
         cm->fc.supertx_prob[partition_supertx_context_lookup[partition]]
@@ -1523,7 +1524,7 @@ static void write_uncompressed_header(VP9_COMP *cpi,
 
 static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
   VP9_COMMON *const cm = &cpi->common;
-#if !CONFIG_TX_SKIP
+#if !CONFIG_TX_SKIP || CONFIG_SUPERTX
   MACROBLOCKD *const xd = &cpi->mb.e_mbd;
 #endif
   FRAME_CONTEXT *const fc = &cm->fc;
@@ -1601,7 +1602,8 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
     update_ext_tx_probs(cm, &header_bc);
 #endif
 #if CONFIG_SUPERTX
-    update_supertx_probs(cm, &header_bc);
+    if (!xd->lossless)
+      update_supertx_probs(cm, &header_bc);
 #endif
 #if CONFIG_TX_SKIP
     for (i = 0; i < 2; i++)
index e863e7c67dc78a83107d52d5fa1a22108c5089ed..76b35e65c888fe7ec8eb79dbab9b2ead015cfd82 100644 (file)
@@ -1485,7 +1485,7 @@ static void encode_sb(VP9_COMP *cpi, const TileInfo *const tile,
 #if CONFIG_SUPERTX
   if (cm->frame_type != KEY_FRAME &&
       bsize <= MAX_SUPERTX_BLOCK_SIZE &&
-      partition != PARTITION_NONE) {
+      partition != PARTITION_NONE && !xd->lossless) {
     int supertx_enabled;
     TX_SIZE supertx_size = bsize_to_tx_size(bsize);
     supertx_enabled = check_supertx_sb(bsize, supertx_size, pc_tree);
@@ -2901,7 +2901,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
 #endif
       }
 #if CONFIG_SUPERTX
-      if (cm->frame_type != KEY_FRAME && sum_rdc.rdcost < INT64_MAX) {
+      if (cm->frame_type != KEY_FRAME && sum_rdc.rdcost < INT64_MAX &&
+          !xd->lossless) {
         TX_SIZE supertx_size = bsize_to_tx_size(bsize);  // b_width_log2(bsize);
         best_partition = pc_tree->partitioning;
         pc_tree->partitioning = PARTITION_SPLIT;
@@ -2989,7 +2990,7 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
       }
 #if CONFIG_SUPERTX
       if (cm->frame_type != KEY_FRAME && sum_rdc.rdcost < INT64_MAX &&
-          i == 4 && bsize <= MAX_SUPERTX_BLOCK_SIZE) {
+          i == 4 && bsize <= MAX_SUPERTX_BLOCK_SIZE  && !xd->lossless) {
         TX_SIZE supertx_size = bsize_to_tx_size(bsize);
         best_partition = pc_tree->partitioning;
         pc_tree->partitioning = PARTITION_SPLIT;
@@ -3119,7 +3120,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
     }
 #if CONFIG_SUPERTX
     if (cm->frame_type != KEY_FRAME && !abort_flag &&
-        sum_rdc.rdcost < INT64_MAX && bsize <= MAX_SUPERTX_BLOCK_SIZE) {
+        sum_rdc.rdcost < INT64_MAX && bsize <= MAX_SUPERTX_BLOCK_SIZE &&
+        !xd->lossless) {
       TX_SIZE supertx_size = bsize_to_tx_size(bsize);
       best_partition = pc_tree->partitioning;
       pc_tree->partitioning = PARTITION_HORZ;
@@ -3236,7 +3238,8 @@ static void rd_pick_partition(VP9_COMP *cpi, const TileInfo *const tile,
     }
 #if CONFIG_SUPERTX
     if (cm->frame_type != KEY_FRAME && !abort_flag &&
-        sum_rdc.rdcost < INT64_MAX && bsize <= MAX_SUPERTX_BLOCK_SIZE) {
+        sum_rdc.rdcost < INT64_MAX && bsize <= MAX_SUPERTX_BLOCK_SIZE &&
+        !xd->lossless) {
       TX_SIZE supertx_size = bsize_to_tx_size(bsize);
       best_partition = pc_tree->partitioning;
       pc_tree->partitioning = PARTITION_VERT;