Change to use LUT for mode-to-txfm conversion

Change-Id: Ieb989830f49e6708ee7728eddebf7a2144c37c6f
This commit is contained in:
Yaowu Xu 2013-06-25 18:15:42 -07:00
Родитель 0441e0a2fc
Коммит 25fe05fd92
2 изменённых файлов: 27 добавлений и 36 удалений

Просмотреть файл

@ -338,6 +338,7 @@ typedef struct macroblockd {
signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];
/* 0 = Intra, Last, GF, ARF */
signed char ref_lf_deltas[MAX_REF_LF_DELTAS];
/* 0 = ZERO_MV, MV */
signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
/* 0 = ZERO_MV, MV */
@ -504,53 +505,25 @@ static BLOCK_SIZE_TYPE get_subsize(BLOCK_SIZE_TYPE bsize,
return subsize;
}
// transform mapping
static TX_TYPE txfm_map(MB_PREDICTION_MODE bmode) {
switch (bmode) {
case TM_PRED :
case D135_PRED :
return ADST_ADST;
extern const TX_TYPE mode2txfm_map[MB_MODE_COUNT];
case V_PRED :
case D117_PRED :
case D63_PRED:
return ADST_DCT;
case H_PRED :
case D153_PRED :
case D27_PRED :
return DCT_ADST;
default:
return DCT_DCT;
}
}
static TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
static INLINE TX_TYPE get_tx_type_4x4(const MACROBLOCKD *xd, int ib) {
MODE_INFO *const mi = xd->mode_info_context;
MB_MODE_INFO *const mbmi = &mi->mbmi;
if (xd->lossless || mbmi->ref_frame[0] != INTRA_FRAME)
return DCT_DCT;
if (mbmi->sb_type < BLOCK_SIZE_SB8X8) {
return txfm_map(mi->bmi[ib].as_mode.first);
} else {
assert(mbmi->mode <= TM_PRED);
return txfm_map(mbmi->mode);
}
return mode2txfm_map[mbmi->sb_type < BLOCK_SIZE_SB8X8 ?
mi->bmi[ib].as_mode.first : mbmi->mode];
}
static TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd) {
return xd->mode_info_context->mbmi.mode <= TM_PRED
? txfm_map(xd->mode_info_context->mbmi.mode)
: DCT_DCT;
static INLINE TX_TYPE get_tx_type_8x8(const MACROBLOCKD *xd) {
return mode2txfm_map[xd->mode_info_context->mbmi.mode];
}
static TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd) {
return xd->mode_info_context->mbmi.mode <= TM_PRED
? txfm_map(xd->mode_info_context->mbmi.mode)
: DCT_DCT;
static INLINE TX_TYPE get_tx_type_16x16(const MACROBLOCKD *xd) {
return mode2txfm_map[xd->mode_info_context->mbmi.mode];
}
void vp9_setup_block_dptrs(MACROBLOCKD *xd,

Просмотреть файл

@ -16,6 +16,24 @@
#include "vp9/common/vp9_onyxc_int.h"
#include "vpx_mem/vpx_mem.h"
const TX_TYPE mode2txfm_map[MB_MODE_COUNT] = {
DCT_DCT, // DC
ADST_DCT, // V
DCT_ADST, // H
DCT_DCT, // D45
ADST_ADST, // D135
ADST_DCT, // D117
DCT_ADST, // D153
DCT_ADST, // D27
ADST_DCT, // D63
ADST_ADST, // TM
DCT_DCT, // NEARESTMV
DCT_DCT, // NEARMV
DCT_DCT, // ZEROMV
DCT_DCT // NEWMV
};
static void d27_predictor(uint8_t *ypred_ptr, int y_stride,
int bw, int bh,
uint8_t *yabove_row, uint8_t *yleft_col) {