Reorder enum i4X4 predcition modes

To match the order of  directional intra prediction modes for larger
blocks, also renamed the i4x4 prediction modes to mirror the larger
variants.

Change-Id: I77cea4d0add6c7758460bf9c7a2fe59aca601f0b
This commit is contained in:
Yaowu Xu 2013-04-11 15:52:28 -07:00
Родитель 7de5edd14a
Коммит c2ad69bcf4
3 изменённых файлов: 76 добавлений и 79 удалений

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

@ -131,18 +131,15 @@ typedef enum {
typedef enum {
B_DC_PRED, /* average of above and left pixels */
B_V_PRED, /* vertical prediction */
B_H_PRED, /* horizontal prediction */
B_D45_PRED,
B_D135_PRED,
B_D117_PRED,
B_D153_PRED,
B_D27_PRED,
B_D63_PRED,
B_TM_PRED,
B_VE_PRED, /* vertical prediction */
B_HE_PRED, /* horizontal prediction */
B_LD_PRED,
B_RD_PRED,
B_VR_PRED,
B_VL_PRED,
B_HD_PRED,
B_HU_PRED,
#if CONFIG_NEWBINTRAMODES
B_CONTEXT_PRED,
#endif
@ -466,15 +463,15 @@ typedef struct macroblockd {
static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
switch (mode) {
case DC_PRED: return B_DC_PRED;
case V_PRED: return B_VE_PRED;
case H_PRED: return B_HE_PRED;
case V_PRED: return B_V_PRED;
case H_PRED: return B_H_PRED;
case TM_PRED: return B_TM_PRED;
case D45_PRED: return B_LD_PRED;
case D135_PRED: return B_RD_PRED;
case D117_PRED: return B_VR_PRED;
case D153_PRED: return B_HD_PRED;
case D27_PRED: return B_HU_PRED;
case D63_PRED: return B_VL_PRED;
case D45_PRED: return B_D45_PRED;
case D135_PRED: return B_D135_PRED;
case D117_PRED: return B_D117_PRED;
case D153_PRED: return B_D153_PRED;
case D27_PRED: return B_D27_PRED;
case D63_PRED: return B_D63_PRED;
default:
assert(0);
return B_MODE_COUNT; // Dummy value
@ -485,16 +482,16 @@ static B_PREDICTION_MODE pred_mode_conv(MB_PREDICTION_MODE mode) {
static TX_TYPE txfm_map(B_PREDICTION_MODE bmode) {
switch (bmode) {
case B_TM_PRED :
case B_RD_PRED :
case B_D135_PRED :
return ADST_ADST;
case B_VE_PRED :
case B_VR_PRED :
case B_V_PRED :
case B_D117_PRED :
return ADST_DCT;
case B_HE_PRED :
case B_HD_PRED :
case B_HU_PRED :
case B_H_PRED :
case B_D153_PRED :
case B_D27_PRED :
return DCT_ADST;
#if CONFIG_NEWBINTRAMODES

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

@ -72,18 +72,18 @@ static const unsigned int kf_uv_mode_cts [VP9_YMODES] [VP9_UV_MODES] = {
static const unsigned int bmode_cts[VP9_NKF_BINTRAMODES] = {
#if CONFIG_NEWBINTRAMODES
#if CONTEXT_PRED_REPLACEMENTS == 6
/* DC TM VE HE CONTEXT */
/* DC TM V H CONTEXT */
43891, 17694, 10036, 3920, 20000
#elif CONTEXT_PRED_REPLACEMENTS == 4
/* DC TM VE HE LD RD CONTEXT */
/* DC TM V H D45 D135 CONTEXT */
43891, 17694, 10036, 3920, 3363, 2546, 14000
#elif CONTEXT_PRED_REPLACEMENTS == 0
/* DC TM VE HE LD RD VR VL HD HU CONTEXT */
43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723, 50000
/* DC V H D45 D135 D117 D153 D27 D63 TM CONTEXT */
43891, 10036, 3920, 3363, 2546, 5119, 2471, 1723, 3221, 17694, 50000
#endif
#else
/* DC TM VE HE LD RD VR VL HD HU */
43891, 17694, 10036, 3920, 3363, 2546, 5119, 3221, 2471, 1723
/* DC V H D45 D135 D117 D153 D27 D63 TM */
43891, 10036, 3920, 3363, 2546, 5119, 2471, 1723, 3221, 17694
#endif
};
@ -156,13 +156,13 @@ const vp9_prob vp9_mbsplit_probs [VP9_NUMMBSPLITS - 1] = { 110, 111, 150};
const vp9_tree_index vp9_kf_bmode_tree[VP9_KF_BINTRAMODES * 2 - 2] = {
-B_DC_PRED, 2, /* 0 = DC_NODE */
-B_TM_PRED, 4, /* 1 = TM_NODE */
-B_VE_PRED, 6, /* 2 = VE_NODE */
-B_V_PRED, 6, /* 2 = V_NODE */
8, 12, /* 3 = COM_NODE */
-B_HE_PRED, 10, /* 4 = HE_NODE */
-B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */
-B_LD_PRED, 14, /* 6 = LD_NODE */
-B_VL_PRED, 16, /* 7 = VL_NODE */
-B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */
-B_H_PRED, 10, /* 4 = H_NODE */
-B_D135_PRED, -B_D117_PRED, /* 5 = D135_NODE */
-B_D45_PRED, 14, /* 6 = D45_NODE */
-B_D63_PRED, 16, /* 7 = D63_NODE */
-B_D153_PRED, -B_D27_PRED /* 8 = D153_NODE */
};
const vp9_tree_index vp9_bmode_tree[VP9_NKF_BINTRAMODES * 2 - 2] = {
@ -171,36 +171,36 @@ const vp9_tree_index vp9_bmode_tree[VP9_NKF_BINTRAMODES * 2 - 2] = {
-B_DC_PRED, 2,
-B_TM_PRED, 4,
6, -(B_CONTEXT_PRED - CONTEXT_PRED_REPLACEMENTS),
-B_VE_PRED, -B_HE_PRED
-B_V_PRED, -B_H_PRED
#elif CONTEXT_PRED_REPLACEMENTS == 4
-B_DC_PRED, 2,
-B_TM_PRED, 4,
6, 8,
-B_VE_PRED, -B_HE_PRED,
-B_V_PRED, -B_H_PRED,
10, -(B_CONTEXT_PRED - CONTEXT_PRED_REPLACEMENTS),
-B_RD_PRED, -B_LD_PRED,
-B_D135_PRED, -B_D45_PRED,
#elif CONTEXT_PRED_REPLACEMENTS == 0
-B_DC_PRED, 2, /* 0 = DC_NODE */
-B_TM_PRED, 4, /* 1 = TM_NODE */
-B_VE_PRED, 6, /* 2 = VE_NODE */
-B_V_PRED, 6, /* 2 = V_NODE */
8, 12, /* 3 = COM_NODE */
-B_HE_PRED, 10, /* 4 = HE_NODE */
-B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */
-B_LD_PRED, 14, /* 6 = LD_NODE */
-B_VL_PRED, 16, /* 7 = VL_NODE */
-B_HD_PRED, 18,
-B_HU_PRED, -B_CONTEXT_PRED
-B_H_PRED, 10, /* 4 = H_NODE */
-B_D135_PRED, -B_D117_PRED, /* 5 = D135_NODE */
-B_D45_PRED, 14, /* 6 = D45_NODE */
-B_D63_PRED, 16, /* 7 = D63_NODE */
-B_D153_PRED, 18, /* 8 = D153_NODE */
-B_D27_PRED, -B_CONTEXT_PRED /* 9 = D27_NODE */
#endif
#else
-B_DC_PRED, 2, /* 0 = DC_NODE */
-B_TM_PRED, 4, /* 1 = TM_NODE */
-B_VE_PRED, 6, /* 2 = VE_NODE */
-B_V_PRED, 6, /* 2 = V_NODE */
8, 12, /* 3 = COM_NODE */
-B_HE_PRED, 10, /* 4 = HE_NODE */
-B_RD_PRED, -B_VR_PRED, /* 5 = RD_NODE */
-B_LD_PRED, 14, /* 6 = LD_NODE */
-B_VL_PRED, 16, /* 7 = VL_NODE */
-B_HD_PRED, -B_HU_PRED /* 8 = HD_NODE */
-B_H_PRED, 10, /* 4 = H_NODE */
-B_D135_PRED, -B_D117_PRED, /* 5 = D135_NODE */
-B_D45_PRED, 14, /* 6 = D45_NODE */
-B_D63_PRED, 16, /* 7 = D63_NODE */
-B_D153_PRED, -B_D27_PRED /* 8 = D153_NODE */
#endif
};

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

@ -57,17 +57,17 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
*/
switch (imin) {
case 1:
return B_HD_PRED;
return B_D153_PRED;
case 2:
return B_RD_PRED;
return B_D135_PRED;
case 3:
return B_VR_PRED;
return B_D117_PRED;
case 5:
return B_VL_PRED;
return B_D63_PRED;
case 6:
return B_LD_PRED;
return B_D45_PRED;
case 7:
return B_HU_PRED;
return B_D27_PRED;
default:
assert(0);
}
@ -93,13 +93,13 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
*/
switch (imin) {
case 1:
return B_HD_PRED;
return B_D153_PRED;
case 3:
return B_VR_PRED;
return B_D117_PRED;
case 5:
return B_VL_PRED;
return B_D63_PRED;
case 7:
return B_HU_PRED;
return B_D27_PRED;
default:
assert(0);
}
@ -126,21 +126,21 @@ B_PREDICTION_MODE vp9_find_dominant_direction(uint8_t *ptr,
switch (imin) {
case 0:
return B_HE_PRED;
return B_H_PRED;
case 1:
return B_HD_PRED;
return B_D153_PRED;
case 2:
return B_RD_PRED;
return B_D135_PRED;
case 3:
return B_VR_PRED;
return B_D117_PRED;
case 4:
return B_VE_PRED;
return B_V_PRED;
case 5:
return B_VL_PRED;
return B_D63_PRED;
case 6:
return B_LD_PRED;
return B_D45_PRED;
case 7:
return B_HU_PRED;
return B_D27_PRED;
default:
assert(0);
}
@ -293,7 +293,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
break;
case B_VE_PRED: {
case B_V_PRED: {
unsigned int ap[4];
ap[0] = above[0];
@ -311,7 +311,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
break;
case B_HE_PRED: {
case B_H_PRED: {
unsigned int lp[4];
lp[0] = left[0];
@ -328,7 +328,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
}
break;
case B_LD_PRED: {
case B_D45_PRED: {
uint8_t *ptr = above;
predictor[0 * ps + 0] = (ptr[0] + ptr[1] * 2 + ptr[2] + 2) >> 2;
@ -350,7 +350,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
break;
case B_RD_PRED: {
case B_D135_PRED: {
uint8_t pp[9];
pp[0] = left[3];
@ -382,7 +382,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
break;
case B_VR_PRED: {
case B_D117_PRED: {
uint8_t pp[9];
pp[0] = left[3];
@ -414,7 +414,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
break;
case B_VL_PRED: {
case B_D63_PRED: {
uint8_t *pp = above;
predictor[0 * ps + 0] = (pp[0] + pp[1] + 1) >> 1;
@ -436,7 +436,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
}
break;
case B_HD_PRED: {
case B_D153_PRED: {
uint8_t pp[9];
pp[0] = left[3];
@ -470,7 +470,7 @@ void vp9_intra4x4_predict(MACROBLOCKD *xd,
break;
case B_HU_PRED: {
case B_D27_PRED: {
uint8_t *pp = left;
predictor[0 * ps + 0] = (pp[0] + pp[1] + 1) >> 1;
predictor[0 * ps + 1] = (pp[0] + pp[1] * 2 + pp[2] + 2) >> 2;