Commit 39b06eb8 authored by Angie Chiang's avatar Angie Chiang

Add plane to tx_type read/write/update functions

This is for lv_map experiment

Change-Id: Ie000f7850efac32ffb46b9a4679cff2814c6246a
parent de58e49f
......@@ -744,7 +744,7 @@ void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
int supertx_enabled,
#endif
#if CONFIG_LV_MAP
int block,
int block, int plane,
#endif
aom_reader *r) {
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
......@@ -763,6 +763,8 @@ void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
#if !CONFIG_LV_MAP
TX_TYPE *tx_type = &mbmi->tx_type;
#else
// only y plane's tx_type is transmitted
if (plane > 0) return;
TX_TYPE *tx_type = &mbmi->txk_type[block];
#endif
......
......@@ -37,7 +37,7 @@ void av1_read_tx_type(const AV1_COMMON *const cm, MACROBLOCKD *xd,
int supertx_enabled,
#endif
#if CONFIG_LV_MAP
int block,
int block, int plane,
#endif
aom_reader *r);
......
......@@ -76,7 +76,7 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
return 0;
}
av1_read_tx_type(cm, xd, block, r);
av1_read_tx_type(cm, xd, block, plane, r);
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
const SCAN_ORDER *const scan_order =
get_scan(cm, tx_size, tx_type, is_inter_block(mbmi));
......
......@@ -1424,7 +1424,7 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
const int supertx_enabled,
#endif
#if CONFIG_LV_MAP
int block,
int block, int plane,
#endif
aom_writer *w) {
MB_MODE_INFO *mbmi = &xd->mi[0]->mbmi;
......@@ -1444,7 +1444,9 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
TX_TYPE tx_type = mbmi->tx_type;
#else
// Only y plane's tx_type is transmitted
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, tx_size);
if (plane > 0) return;
PLANE_TYPE plane_type = get_plane_type(plane);
TX_TYPE tx_type = get_tx_type(plane_type, xd, block, tx_size);
#endif
if (!FIXED_TX_TYPE) {
......
......@@ -42,7 +42,7 @@ void av1_write_tx_type(const AV1_COMMON *const cm, const MACROBLOCKD *xd,
const int supertx_enabled,
#endif
#if CONFIG_LV_MAP
int block,
int block, int plane,
#endif
aom_writer *w);
......
......@@ -5756,7 +5756,7 @@ static void tx_partition_set_contexts(const AV1_COMMON *const cm,
void av1_update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd,
#if CONFIG_LV_MAP
int block,
int block, int plane,
#endif
BLOCK_SIZE bsize, TX_SIZE tx_size,
FRAME_COUNTS *counts) {
......@@ -5765,6 +5765,8 @@ void av1_update_tx_type_count(const AV1_COMMON *cm, MACROBLOCKD *xd,
#if !CONFIG_LV_MAP
TX_TYPE tx_type = mbmi->tx_type;
#else
// Only y plane's tx_type is updated
if (plane > 0) return;
TX_TYPE tx_type = get_tx_type(PLANE_TYPE_Y, xd, block, tx_size);
#endif
#if CONFIG_EXT_TX
......
......@@ -46,7 +46,7 @@ void av1_set_variance_partition_thresholds(struct AV1_COMP *cpi, int q);
void av1_update_tx_type_count(const struct AV1Common *cm, MACROBLOCKD *xd,
#if CONFIG_LV_MAP
int block,
int block, int plane,
#endif
BLOCK_SIZE bsize, TX_SIZE tx_size,
FRAME_COUNTS *counts);
......
......@@ -90,7 +90,7 @@ void av1_write_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
aom_write(w, eob == 0, cm->fc->txb_skip[tx_size][txb_ctx->txb_skip_ctx]);
if (eob == 0) return;
av1_write_tx_type(cm, xd, block, w);
av1_write_tx_type(cm, xd, block, plane, w);
nz_map = cm->fc->nz_map[tx_size][plane_type];
eob_flag = cm->fc->eob_flag[tx_size][plane_type];
......@@ -456,7 +456,8 @@ static void update_and_record_txb_context(int plane, int block, int blk_row,
return;
}
av1_update_tx_type_count(cm, xd, block, mbmi->sb_type, tx_size, td->counts);
av1_update_tx_type_count(cm, xd, block, plane, mbmi->sb_type, tx_size,
td->counts);
for (c = 0; c < eob; ++c) {
tran_low_t v = qcoeff[scan[c]];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment