Merge "Renaming TXFM_MODE to TX_MODE (like TX_SIZE, TX_TYPE)."
This commit is contained in:
commit
e71a4a77bb
@ -174,7 +174,7 @@ void vp9_create_common(VP9_COMMON *oci) {
|
||||
|
||||
vp9_init_mbmode_probs(oci);
|
||||
|
||||
oci->txfm_mode = ONLY_4X4;
|
||||
oci->tx_mode = ONLY_4X4;
|
||||
oci->comp_pred_mode = HYBRID_PREDICTION;
|
||||
|
||||
// Initialize reference frame sign bias structure to defaults
|
||||
|
@ -521,7 +521,7 @@ void vp9_adapt_mode_probs(VP9_COMMON *cm) {
|
||||
fc->switchable_interp_prob[i], 0);
|
||||
}
|
||||
|
||||
if (cm->txfm_mode == TX_MODE_SELECT) {
|
||||
if (cm->tx_mode == TX_MODE_SELECT) {
|
||||
int j;
|
||||
unsigned int branch_ct_8x8p[TX_SIZE_MAX_SB - 3][2];
|
||||
unsigned int branch_ct_16x16p[TX_SIZE_MAX_SB - 2][2];
|
||||
|
@ -57,6 +57,15 @@ typedef enum {
|
||||
TX_SIZE_MAX_SB, // Number of transforms available to SBs
|
||||
} TX_SIZE;
|
||||
|
||||
typedef enum {
|
||||
ONLY_4X4 = 0,
|
||||
ALLOW_8X8 = 1,
|
||||
ALLOW_16X16 = 2,
|
||||
ALLOW_32X32 = 3,
|
||||
TX_MODE_SELECT = 4,
|
||||
NB_TXFM_MODES = 5,
|
||||
} TX_MODE;
|
||||
|
||||
typedef enum {
|
||||
DCT_DCT = 0, // DCT in both horizontal and vertical
|
||||
ADST_DCT = 1, // ADST in vertical, DCT in horizontal
|
||||
|
@ -106,15 +106,6 @@ typedef enum {
|
||||
NB_PREDICTION_TYPES = 3,
|
||||
} COMPPREDMODE_TYPE;
|
||||
|
||||
typedef enum {
|
||||
ONLY_4X4 = 0,
|
||||
ALLOW_8X8 = 1,
|
||||
ALLOW_16X16 = 2,
|
||||
ALLOW_32X32 = 3,
|
||||
TX_MODE_SELECT = 4,
|
||||
NB_TXFM_MODES = 5,
|
||||
} TXFM_MODE;
|
||||
|
||||
typedef struct VP9Common {
|
||||
struct vpx_internal_error_info error;
|
||||
|
||||
@ -179,7 +170,7 @@ typedef struct VP9Common {
|
||||
int mode_info_stride;
|
||||
|
||||
/* profile settings */
|
||||
TXFM_MODE txfm_mode;
|
||||
TX_MODE tx_mode;
|
||||
|
||||
int base_qindex;
|
||||
int last_kf_gf_q; /* Q used on the last GF or KF */
|
||||
|
@ -59,19 +59,19 @@ static TX_SIZE read_selected_txfm_size(VP9_COMMON *cm, MACROBLOCKD *xd,
|
||||
return txfm_size;
|
||||
}
|
||||
|
||||
static TX_SIZE read_txfm_size(VP9D_COMP *pbi, TXFM_MODE txfm_mode,
|
||||
static TX_SIZE read_txfm_size(VP9D_COMP *pbi, TX_MODE tx_mode,
|
||||
BLOCK_SIZE_TYPE bsize, int select_cond,
|
||||
vp9_reader *r) {
|
||||
VP9_COMMON *const cm = &pbi->common;
|
||||
MACROBLOCKD *const xd = &pbi->mb;
|
||||
|
||||
if (txfm_mode == TX_MODE_SELECT && bsize >= BLOCK_SIZE_SB8X8 && select_cond)
|
||||
if (tx_mode == TX_MODE_SELECT && bsize >= BLOCK_SIZE_SB8X8 && select_cond)
|
||||
return read_selected_txfm_size(cm, xd, bsize, r);
|
||||
else if (txfm_mode >= ALLOW_32X32 && bsize >= BLOCK_SIZE_SB32X32)
|
||||
else if (tx_mode >= ALLOW_32X32 && bsize >= BLOCK_SIZE_SB32X32)
|
||||
return TX_32X32;
|
||||
else if (txfm_mode >= ALLOW_16X16 && bsize >= BLOCK_SIZE_MB16X16)
|
||||
else if (tx_mode >= ALLOW_16X16 && bsize >= BLOCK_SIZE_MB16X16)
|
||||
return TX_16X16;
|
||||
else if (txfm_mode >= ALLOW_8X8 && bsize >= BLOCK_SIZE_SB8X8)
|
||||
else if (tx_mode >= ALLOW_8X8 && bsize >= BLOCK_SIZE_SB8X8)
|
||||
return TX_8X8;
|
||||
else
|
||||
return TX_4X4;
|
||||
@ -162,7 +162,7 @@ static void read_intra_mode_info(VP9D_COMP *pbi, MODE_INFO *m,
|
||||
|
||||
mbmi->segment_id = read_intra_segment_id(pbi, mi_row, mi_col, r);
|
||||
mbmi->mb_skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
|
||||
mbmi->txfm_size = read_txfm_size(pbi, cm->txfm_mode, bsize, 1, r);
|
||||
mbmi->txfm_size = read_txfm_size(pbi, cm->tx_mode, bsize, 1, r);
|
||||
mbmi->ref_frame[0] = INTRA_FRAME;
|
||||
|
||||
if (bsize >= BLOCK_SIZE_SB8X8) {
|
||||
@ -463,7 +463,7 @@ static void read_inter_mode_info(VP9D_COMP *pbi, MODE_INFO *mi,
|
||||
mbmi->mb_skip_coeff = read_skip_coeff(pbi, mbmi->segment_id, r);
|
||||
mbmi->ref_frame[0] = read_reference_frame(pbi, mbmi->segment_id, r);
|
||||
mbmi->ref_frame[1] = NONE;
|
||||
mbmi->txfm_size = read_txfm_size(pbi, cm->txfm_mode, bsize,
|
||||
mbmi->txfm_size = read_txfm_size(pbi, cm->tx_mode, bsize,
|
||||
(!mbmi->mb_skip_coeff || mbmi->ref_frame[0] == INTRA_FRAME), r);
|
||||
|
||||
if (mbmi->ref_frame[0] != INTRA_FRAME) {
|
||||
|
@ -48,11 +48,11 @@ static int decode_unsigned_max(struct vp9_read_bit_buffer *rb, int max) {
|
||||
return data > max ? max : data;
|
||||
}
|
||||
|
||||
static TXFM_MODE read_tx_mode(vp9_reader *r) {
|
||||
TXFM_MODE txfm_mode = vp9_read_literal(r, 2);
|
||||
if (txfm_mode == ALLOW_32X32)
|
||||
txfm_mode += vp9_read_bit(r);
|
||||
return txfm_mode;
|
||||
static TX_MODE read_tx_mode(vp9_reader *r) {
|
||||
TX_MODE tx_mode = vp9_read_literal(r, 2);
|
||||
if (tx_mode == ALLOW_32X32)
|
||||
tx_mode += vp9_read_bit(r);
|
||||
return tx_mode;
|
||||
}
|
||||
|
||||
static void read_tx_probs(struct tx_probs *tx_probs, vp9_reader *r) {
|
||||
@ -372,17 +372,17 @@ static void read_coef_probs_common(vp9_coeff_probs_model *coef_probs,
|
||||
vp9_diff_update_prob(r, &coef_probs[i][j][k][l][m]);
|
||||
}
|
||||
|
||||
static void read_coef_probs(FRAME_CONTEXT *fc, TXFM_MODE txfm_mode,
|
||||
static void read_coef_probs(FRAME_CONTEXT *fc, TX_MODE tx_mode,
|
||||
vp9_reader *r) {
|
||||
read_coef_probs_common(fc->coef_probs[TX_4X4], r);
|
||||
|
||||
if (txfm_mode > ONLY_4X4)
|
||||
if (tx_mode > ONLY_4X4)
|
||||
read_coef_probs_common(fc->coef_probs[TX_8X8], r);
|
||||
|
||||
if (txfm_mode > ALLOW_8X8)
|
||||
if (tx_mode > ALLOW_8X8)
|
||||
read_coef_probs_common(fc->coef_probs[TX_16X16], r);
|
||||
|
||||
if (txfm_mode > ALLOW_16X16)
|
||||
if (tx_mode > ALLOW_16X16)
|
||||
read_coef_probs_common(fc->coef_probs[TX_32X32], r);
|
||||
}
|
||||
|
||||
@ -899,10 +899,10 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
|
||||
vpx_internal_error(&cm->error, VPX_CODEC_MEM_ERROR,
|
||||
"Failed to allocate bool decoder 0");
|
||||
|
||||
cm->txfm_mode = xd->lossless ? ONLY_4X4 : read_tx_mode(&r);
|
||||
if (cm->txfm_mode == TX_MODE_SELECT)
|
||||
cm->tx_mode = xd->lossless ? ONLY_4X4 : read_tx_mode(&r);
|
||||
if (cm->tx_mode == TX_MODE_SELECT)
|
||||
read_tx_probs(&cm->fc.tx_probs, &r);
|
||||
read_coef_probs(&cm->fc, cm->txfm_mode, &r);
|
||||
read_coef_probs(&cm->fc, cm->tx_mode, &r);
|
||||
|
||||
vp9_prepare_read_mode_info(pbi, &r);
|
||||
|
||||
|
@ -441,7 +441,7 @@ static void pack_inter_mode_mvs(VP9_COMP *cpi, MODE_INFO *m,
|
||||
vp9_write(bc, rf != INTRA_FRAME,
|
||||
vp9_get_pred_prob_intra_inter(pc, xd));
|
||||
|
||||
if (mi->sb_type >= BLOCK_SIZE_SB8X8 && pc->txfm_mode == TX_MODE_SELECT &&
|
||||
if (mi->sb_type >= BLOCK_SIZE_SB8X8 && pc->tx_mode == TX_MODE_SELECT &&
|
||||
!(rf != INTRA_FRAME &&
|
||||
(skip_coeff || vp9_segfeature_active(seg, segment_id, SEG_LVL_SKIP)))) {
|
||||
write_selected_txfm_size(cpi, mi->txfm_size, mi->sb_type, bc);
|
||||
@ -553,7 +553,7 @@ static void write_mb_modes_kf(const VP9_COMP *cpi,
|
||||
|
||||
write_skip_coeff(cpi, segment_id, m, bc);
|
||||
|
||||
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8 && c->txfm_mode == TX_MODE_SELECT)
|
||||
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8 && c->tx_mode == TX_MODE_SELECT)
|
||||
write_selected_txfm_size(cpi, m->mbmi.txfm_size, m->mbmi.sb_type, bc);
|
||||
|
||||
if (m->mbmi.sb_type >= BLOCK_SIZE_SB8X8) {
|
||||
@ -905,7 +905,7 @@ static void update_coef_probs_common(vp9_writer* const bc, VP9_COMP *cpi,
|
||||
}
|
||||
|
||||
static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
|
||||
const TXFM_MODE txfm_mode = cpi->common.txfm_mode;
|
||||
const TX_MODE tx_mode = cpi->common.tx_mode;
|
||||
|
||||
vp9_clear_system_state();
|
||||
|
||||
@ -915,13 +915,13 @@ static void update_coef_probs(VP9_COMP* const cpi, vp9_writer* const bc) {
|
||||
update_coef_probs_common(bc, cpi, TX_4X4);
|
||||
|
||||
// do not do this if not even allowed
|
||||
if (txfm_mode > ONLY_4X4)
|
||||
if (tx_mode > ONLY_4X4)
|
||||
update_coef_probs_common(bc, cpi, TX_8X8);
|
||||
|
||||
if (txfm_mode > ALLOW_8X8)
|
||||
if (tx_mode > ALLOW_8X8)
|
||||
update_coef_probs_common(bc, cpi, TX_16X16);
|
||||
|
||||
if (txfm_mode > ALLOW_16X16)
|
||||
if (tx_mode > ALLOW_16X16)
|
||||
update_coef_probs_common(bc, cpi, TX_32X32);
|
||||
}
|
||||
|
||||
@ -1062,12 +1062,12 @@ static void encode_txfm_probs(VP9_COMP *cpi, vp9_writer *w) {
|
||||
VP9_COMMON *const cm = &cpi->common;
|
||||
|
||||
// Mode
|
||||
vp9_write_literal(w, MIN(cm->txfm_mode, ALLOW_32X32), 2);
|
||||
if (cm->txfm_mode >= ALLOW_32X32)
|
||||
vp9_write_bit(w, cm->txfm_mode == TX_MODE_SELECT);
|
||||
vp9_write_literal(w, MIN(cm->tx_mode, ALLOW_32X32), 2);
|
||||
if (cm->tx_mode >= ALLOW_32X32)
|
||||
vp9_write_bit(w, cm->tx_mode == TX_MODE_SELECT);
|
||||
|
||||
// Probabilities
|
||||
if (cm->txfm_mode == TX_MODE_SELECT) {
|
||||
if (cm->tx_mode == TX_MODE_SELECT) {
|
||||
int i, j;
|
||||
unsigned int ct_8x8p[TX_SIZE_MAX_SB - 3][2];
|
||||
unsigned int ct_16x16p[TX_SIZE_MAX_SB - 2][2];
|
||||
@ -1388,7 +1388,7 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
|
||||
vp9_start_encode(&header_bc, data);
|
||||
|
||||
if (xd->lossless)
|
||||
cm->txfm_mode = ONLY_4X4;
|
||||
cm->tx_mode = ONLY_4X4;
|
||||
else
|
||||
encode_txfm_probs(cpi, &header_bc);
|
||||
|
||||
|
@ -1955,7 +1955,7 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
|
||||
cpi->mb.optimize = 0;
|
||||
cpi->common.filter_level = 0;
|
||||
cpi->zbin_mode_boost_enabled = 0;
|
||||
cpi->common.txfm_mode = ONLY_4X4;
|
||||
cpi->common.tx_mode = ONLY_4X4;
|
||||
} else {
|
||||
// printf("Not lossless\n");
|
||||
cpi->mb.fwd_txm8x4 = vp9_short_fdct8x4;
|
||||
@ -1965,10 +1965,10 @@ static void switch_lossless_mode(VP9_COMP *cpi, int lossless) {
|
||||
}
|
||||
}
|
||||
|
||||
static void switch_txfm_mode(VP9_COMP *cpi) {
|
||||
static void switch_tx_mode(VP9_COMP *cpi) {
|
||||
if (cpi->sf.tx_size_search_method == USE_LARGESTALL &&
|
||||
cpi->common.txfm_mode >= ALLOW_32X32)
|
||||
cpi->common.txfm_mode = ALLOW_32X32;
|
||||
cpi->common.tx_mode >= ALLOW_32X32)
|
||||
cpi->common.tx_mode = ALLOW_32X32;
|
||||
}
|
||||
|
||||
static void encode_frame_internal(VP9_COMP *cpi) {
|
||||
@ -2015,7 +2015,7 @@ static void encode_frame_internal(VP9_COMP *cpi) {
|
||||
|
||||
vp9_initialize_rd_consts(cpi, cm->base_qindex + cm->y_dc_delta_q);
|
||||
vp9_initialize_me_consts(cpi, cm->base_qindex);
|
||||
switch_txfm_mode(cpi);
|
||||
switch_tx_mode(cpi);
|
||||
|
||||
if (cpi->oxcf.tuning == VP8_TUNE_SSIM) {
|
||||
// Initialize encode frame context.
|
||||
@ -2229,17 +2229,17 @@ static int get_frame_type(VP9_COMP *cpi) {
|
||||
return frame_type;
|
||||
}
|
||||
|
||||
static void select_txfm_mode(VP9_COMP *cpi) {
|
||||
static void select_tx_mode(VP9_COMP *cpi) {
|
||||
if (cpi->oxcf.lossless) {
|
||||
cpi->common.txfm_mode = ONLY_4X4;
|
||||
cpi->common.tx_mode = ONLY_4X4;
|
||||
} else if (cpi->common.current_video_frame == 0) {
|
||||
cpi->common.txfm_mode = TX_MODE_SELECT;
|
||||
cpi->common.tx_mode = TX_MODE_SELECT;
|
||||
} else {
|
||||
if (cpi->sf.tx_size_search_method == USE_LARGESTALL) {
|
||||
cpi->common.txfm_mode = ALLOW_32X32;
|
||||
cpi->common.tx_mode = ALLOW_32X32;
|
||||
} else if (cpi->sf.tx_size_search_method == USE_FULL_RD) {
|
||||
int frame_type = get_frame_type(cpi);
|
||||
cpi->common.txfm_mode =
|
||||
cpi->common.tx_mode =
|
||||
cpi->rd_tx_select_threshes[frame_type][ALLOW_32X32]
|
||||
> cpi->rd_tx_select_threshes[frame_type][TX_MODE_SELECT] ?
|
||||
ALLOW_32X32 : TX_MODE_SELECT;
|
||||
@ -2250,7 +2250,7 @@ static void select_txfm_mode(VP9_COMP *cpi) {
|
||||
total += cpi->txfm_stepdown_count[i];
|
||||
if (total) {
|
||||
double fraction = (double)cpi->txfm_stepdown_count[0] / total;
|
||||
cpi->common.txfm_mode = fraction > 0.90 ? ALLOW_32X32 : TX_MODE_SELECT;
|
||||
cpi->common.tx_mode = fraction > 0.90 ? ALLOW_32X32 : TX_MODE_SELECT;
|
||||
// printf("fraction = %f\n", fraction);
|
||||
} // else keep unchanged
|
||||
}
|
||||
@ -2338,7 +2338,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
||||
cpi->mb.e_mbd.lossless = 1;
|
||||
}
|
||||
|
||||
select_txfm_mode(cpi);
|
||||
select_tx_mode(cpi);
|
||||
cpi->common.comp_pred_mode = pred_type;
|
||||
cpi->common.mcomp_filter_type = filter_type;
|
||||
encode_frame_internal(cpi);
|
||||
@ -2384,7 +2384,7 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
||||
}
|
||||
}
|
||||
|
||||
if (cpi->common.txfm_mode == TX_MODE_SELECT) {
|
||||
if (cpi->common.tx_mode == TX_MODE_SELECT) {
|
||||
int count4x4 = 0;
|
||||
int count8x8_lp = 0, count8x8_8x8p = 0;
|
||||
int count16x16_16x16p = 0, count16x16_lp = 0;
|
||||
@ -2416,16 +2416,16 @@ void vp9_encode_frame(VP9_COMP *cpi) {
|
||||
|
||||
if (count4x4 == 0 && count16x16_lp == 0 && count16x16_16x16p == 0
|
||||
&& count32x32 == 0) {
|
||||
cpi->common.txfm_mode = ALLOW_8X8;
|
||||
cpi->common.tx_mode = ALLOW_8X8;
|
||||
reset_skip_txfm_size(cpi, TX_8X8);
|
||||
} else if (count8x8_8x8p == 0 && count16x16_16x16p == 0
|
||||
&& count8x8_lp == 0 && count16x16_lp == 0 && count32x32 == 0) {
|
||||
cpi->common.txfm_mode = ONLY_4X4;
|
||||
cpi->common.tx_mode = ONLY_4X4;
|
||||
reset_skip_txfm_size(cpi, TX_4X4);
|
||||
} else if (count8x8_lp == 0 && count16x16_lp == 0 && count4x4 == 0) {
|
||||
cpi->common.txfm_mode = ALLOW_32X32;
|
||||
cpi->common.tx_mode = ALLOW_32X32;
|
||||
} else if (count32x32 == 0 && count8x8_lp == 0 && count4x4 == 0) {
|
||||
cpi->common.txfm_mode = ALLOW_16X16;
|
||||
cpi->common.tx_mode = ALLOW_16X16;
|
||||
reset_skip_txfm_size(cpi, TX_16X16);
|
||||
}
|
||||
}
|
||||
@ -2585,7 +2585,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
|
||||
vp9_set_pred_flag_mbskip(cm, bsize, mi_row, mi_col, mi->mbmi.mb_skip_coeff);
|
||||
|
||||
if (output_enabled) {
|
||||
if (cm->txfm_mode == TX_MODE_SELECT &&
|
||||
if (cm->tx_mode == TX_MODE_SELECT &&
|
||||
mbmi->sb_type >= BLOCK_SIZE_SB8X8 &&
|
||||
!(mbmi->ref_frame[0] != INTRA_FRAME &&
|
||||
(mbmi->mb_skip_coeff ||
|
||||
@ -2600,7 +2600,7 @@ static void encode_superblock(VP9_COMP *cpi, TOKENEXTRA **t, int output_enabled,
|
||||
}
|
||||
} else {
|
||||
int x, y;
|
||||
TX_SIZE sz = (cm->txfm_mode == TX_MODE_SELECT) ? TX_32X32 : cm->txfm_mode;
|
||||
TX_SIZE sz = (cm->tx_mode == TX_MODE_SELECT) ? TX_32X32 : cm->tx_mode;
|
||||
// The new intra coding scheme requires no change of transform size
|
||||
if (mi->mbmi.ref_frame[0] != INTRA_FRAME) {
|
||||
if (sz == TX_32X32 && bsize < BLOCK_SIZE_SB32X32)
|
||||
|
@ -179,7 +179,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
|
||||
Bias = Bias * cpi->twopass.section_intra_rating / 20;
|
||||
|
||||
// yx, bias less for large block size
|
||||
if (cpi->common.txfm_mode != ONLY_4X4)
|
||||
if (cpi->common.tx_mode != ONLY_4X4)
|
||||
Bias >>= 1;
|
||||
|
||||
filt_high = ((filt_mid + filter_step) > max_filter_level) ? max_filter_level : (filt_mid + filter_step);
|
||||
|
@ -834,15 +834,15 @@ static void choose_largest_txfm_size(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
MACROBLOCKD *const xd = &x->e_mbd;
|
||||
MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
|
||||
if (max_txfm_size == TX_32X32 &&
|
||||
(cm->txfm_mode == ALLOW_32X32 ||
|
||||
cm->txfm_mode == TX_MODE_SELECT)) {
|
||||
(cm->tx_mode == ALLOW_32X32 ||
|
||||
cm->tx_mode == TX_MODE_SELECT)) {
|
||||
mbmi->txfm_size = TX_32X32;
|
||||
} else if (max_txfm_size >= TX_16X16 &&
|
||||
(cm->txfm_mode == ALLOW_16X16 ||
|
||||
cm->txfm_mode == ALLOW_32X32 ||
|
||||
cm->txfm_mode == TX_MODE_SELECT)) {
|
||||
(cm->tx_mode == ALLOW_16X16 ||
|
||||
cm->tx_mode == ALLOW_32X32 ||
|
||||
cm->tx_mode == TX_MODE_SELECT)) {
|
||||
mbmi->txfm_size = TX_16X16;
|
||||
} else if (cm->txfm_mode != ONLY_4X4) {
|
||||
} else if (cm->tx_mode != ONLY_4X4) {
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
} else {
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
@ -901,29 +901,29 @@ static void choose_txfm_size_from_rd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
}
|
||||
|
||||
if (max_txfm_size == TX_32X32 &&
|
||||
(cm->txfm_mode == ALLOW_32X32 ||
|
||||
(cm->txfm_mode == TX_MODE_SELECT &&
|
||||
(cm->tx_mode == ALLOW_32X32 ||
|
||||
(cm->tx_mode == TX_MODE_SELECT &&
|
||||
rd[TX_32X32][1] < rd[TX_16X16][1] && rd[TX_32X32][1] < rd[TX_8X8][1] &&
|
||||
rd[TX_32X32][1] < rd[TX_4X4][1]))) {
|
||||
mbmi->txfm_size = TX_32X32;
|
||||
} else if (max_txfm_size >= TX_16X16 &&
|
||||
(cm->txfm_mode == ALLOW_16X16 ||
|
||||
cm->txfm_mode == ALLOW_32X32 ||
|
||||
(cm->txfm_mode == TX_MODE_SELECT &&
|
||||
(cm->tx_mode == ALLOW_16X16 ||
|
||||
cm->tx_mode == ALLOW_32X32 ||
|
||||
(cm->tx_mode == TX_MODE_SELECT &&
|
||||
rd[TX_16X16][1] < rd[TX_8X8][1] &&
|
||||
rd[TX_16X16][1] < rd[TX_4X4][1]))) {
|
||||
mbmi->txfm_size = TX_16X16;
|
||||
} else if (cm->txfm_mode == ALLOW_8X8 ||
|
||||
cm->txfm_mode == ALLOW_16X16 ||
|
||||
cm->txfm_mode == ALLOW_32X32 ||
|
||||
(cm->txfm_mode == TX_MODE_SELECT && rd[TX_8X8][1] < rd[TX_4X4][1])) {
|
||||
} else if (cm->tx_mode == ALLOW_8X8 ||
|
||||
cm->tx_mode == ALLOW_16X16 ||
|
||||
cm->tx_mode == ALLOW_32X32 ||
|
||||
(cm->tx_mode == TX_MODE_SELECT && rd[TX_8X8][1] < rd[TX_4X4][1])) {
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
} else {
|
||||
mbmi->txfm_size = TX_4X4;
|
||||
}
|
||||
|
||||
*distortion = d[mbmi->txfm_size];
|
||||
*rate = r[mbmi->txfm_size][cm->txfm_mode == TX_MODE_SELECT];
|
||||
*rate = r[mbmi->txfm_size][cm->tx_mode == TX_MODE_SELECT];
|
||||
*skip = s[mbmi->txfm_size];
|
||||
|
||||
txfm_cache[ONLY_4X4] = rd[TX_4X4][0];
|
||||
@ -1009,23 +1009,23 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
}
|
||||
|
||||
if (max_txfm_size == TX_32X32 &&
|
||||
(cm->txfm_mode == ALLOW_32X32 ||
|
||||
(cm->txfm_mode == TX_MODE_SELECT &&
|
||||
(cm->tx_mode == ALLOW_32X32 ||
|
||||
(cm->tx_mode == TX_MODE_SELECT &&
|
||||
rd[TX_32X32][1] <= rd[TX_16X16][1] &&
|
||||
rd[TX_32X32][1] <= rd[TX_8X8][1] &&
|
||||
rd[TX_32X32][1] <= rd[TX_4X4][1]))) {
|
||||
mbmi->txfm_size = TX_32X32;
|
||||
} else if (max_txfm_size >= TX_16X16 &&
|
||||
(cm->txfm_mode == ALLOW_16X16 ||
|
||||
cm->txfm_mode == ALLOW_32X32 ||
|
||||
(cm->txfm_mode == TX_MODE_SELECT &&
|
||||
(cm->tx_mode == ALLOW_16X16 ||
|
||||
cm->tx_mode == ALLOW_32X32 ||
|
||||
(cm->tx_mode == TX_MODE_SELECT &&
|
||||
rd[TX_16X16][1] <= rd[TX_8X8][1] &&
|
||||
rd[TX_16X16][1] <= rd[TX_4X4][1]))) {
|
||||
mbmi->txfm_size = TX_16X16;
|
||||
} else if (cm->txfm_mode == ALLOW_8X8 ||
|
||||
cm->txfm_mode == ALLOW_16X16 ||
|
||||
cm->txfm_mode == ALLOW_32X32 ||
|
||||
(cm->txfm_mode == TX_MODE_SELECT &&
|
||||
} else if (cm->tx_mode == ALLOW_8X8 ||
|
||||
cm->tx_mode == ALLOW_16X16 ||
|
||||
cm->tx_mode == ALLOW_32X32 ||
|
||||
(cm->tx_mode == TX_MODE_SELECT &&
|
||||
rd[TX_8X8][1] <= rd[TX_4X4][1])) {
|
||||
mbmi->txfm_size = TX_8X8;
|
||||
} else {
|
||||
@ -1040,7 +1040,7 @@ static void choose_txfm_size_from_modelrd(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
bs, mbmi->txfm_size);
|
||||
} else {
|
||||
*distortion = d[mbmi->txfm_size];
|
||||
*rate = r[mbmi->txfm_size][cm->txfm_mode == TX_MODE_SELECT];
|
||||
*rate = r[mbmi->txfm_size][cm->tx_mode == TX_MODE_SELECT];
|
||||
*skip = s[mbmi->txfm_size];
|
||||
}
|
||||
|
||||
@ -1437,7 +1437,7 @@ static int64_t rd_pick_intra_sby_mode(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
if (cpi->sf.tx_size_search_method == USE_FULL_RD && this_rd < INT64_MAX) {
|
||||
for (i = 0; i < NB_TXFM_MODES; i++) {
|
||||
int64_t adj_rd = this_rd + local_txfm_cache[i] -
|
||||
local_txfm_cache[cpi->common.txfm_mode];
|
||||
local_txfm_cache[cpi->common.tx_mode];
|
||||
if (adj_rd < txfm_cache[i]) {
|
||||
txfm_cache[i] = adj_rd;
|
||||
}
|
||||
@ -3077,7 +3077,7 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
*returndist = dist_y + (dist_uv >> 2);
|
||||
if (cpi->sf.tx_size_search_method == USE_FULL_RD) {
|
||||
for (i = 0; i < NB_TXFM_MODES; i++) {
|
||||
ctx->txfm_rd_diff[i] = txfm_cache[i] - txfm_cache[cm->txfm_mode];
|
||||
ctx->txfm_rd_diff[i] = txfm_cache[i] - txfm_cache[cm->tx_mode];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3872,7 +3872,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
|
||||
for (i = 0; i < NB_TXFM_MODES; i++) {
|
||||
int64_t adj_rd = INT64_MAX;
|
||||
if (this_mode != I4X4_PRED) {
|
||||
adj_rd = this_rd + txfm_cache[i] - txfm_cache[cm->txfm_mode];
|
||||
adj_rd = this_rd + txfm_cache[i] - txfm_cache[cm->tx_mode];
|
||||
} else {
|
||||
adj_rd = this_rd;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user