Fix mismatch in SUPERTX experiment

Disable SUPERTX mode when lossless mode is enabled because the largest
lossless transform size is 4X4.

Change-Id: I4167959a282728d62354119ced99ca29febabfd1
This commit is contained in:
Yue Chen 2014-12-27 20:26:26 -08:00 committed by Deb Mukherjee
parent b0ef621f84
commit 695c4bc321
3 changed files with 17 additions and 11 deletions

View 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++)

View 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++)

View 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;