Remove NEAREST_NEARMV / NEAR_NEARESTMV modes

Change-Id: I640cf08ac583ff5092a18e81cd0e33f05609db6b
This commit is contained in:
Debargha Mukherjee 2017-04-17 16:05:04 -07:00
Родитель d80d63f477
Коммит bb6e13432e
10 изменённых файлов: 42 добавлений и 146 удалений

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

@ -273,8 +273,8 @@ static const int mode_lf_lut[] = {
#endif // CONFIG_ALT_INTRA #endif // CONFIG_ALT_INTRA
1, 1, 0, 1, // INTER_MODES (ZEROMV == 0) 1, 1, 0, 1, // INTER_MODES (ZEROMV == 0)
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
1, 1, 1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (ZERO_ZEROMV == 0) 1, 1, 1, 1, 1, 1, 0, 1 // INTER_COMPOUND_MODES (ZERO_ZEROMV == 0)
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
}; };
static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) { static void update_sharpness(loop_filter_info_n *lfi, int sharpness_lvl) {

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

@ -155,8 +155,6 @@ static INLINE PREDICTION_MODE compound_ref0_mode(PREDICTION_MODE mode) {
NEWMV, // SR_NEW_NEWMV NEWMV, // SR_NEW_NEWMV
#endif // CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
NEARESTMV, // NEAREST_NEARESTMV NEARESTMV, // NEAREST_NEARESTMV
NEARESTMV, // NEAREST_NEARMV
NEARMV, // NEAR_NEARESTMV
NEARMV, // NEAR_NEARMV NEARMV, // NEAR_NEARMV
NEARESTMV, // NEAREST_NEWMV NEARESTMV, // NEAREST_NEWMV
NEWMV, // NEW_NEARESTMV NEWMV, // NEW_NEARESTMV
@ -196,8 +194,6 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
NEWMV, // SR_NEW_NEWMV NEWMV, // SR_NEW_NEWMV
#endif // CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
NEARESTMV, // NEAREST_NEARESTMV NEARESTMV, // NEAREST_NEARESTMV
NEARMV, // NEAREST_NEARMV
NEARESTMV, // NEAR_NEARESTMV
NEARMV, // NEAR_NEARMV NEARMV, // NEAR_NEARMV
NEWMV, // NEAREST_NEWMV NEWMV, // NEAREST_NEWMV
NEARESTMV, // NEW_NEARESTMV NEARESTMV, // NEW_NEARESTMV
@ -211,8 +207,8 @@ static INLINE PREDICTION_MODE compound_ref1_mode(PREDICTION_MODE mode) {
} }
static INLINE int have_nearmv_in_inter_mode(PREDICTION_MODE mode) { static INLINE int have_nearmv_in_inter_mode(PREDICTION_MODE mode) {
return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAREST_NEARMV || return (mode == NEARMV || mode == NEAR_NEARMV || mode == NEAR_NEWMV ||
mode == NEAR_NEARESTMV || mode == NEAR_NEWMV || mode == NEW_NEARMV); mode == NEW_NEARMV);
} }
static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) { static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) {

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

@ -1015,13 +1015,13 @@ static const aom_prob
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
static const aom_prob default_inter_compound_mode_probs static const aom_prob default_inter_compound_mode_probs
[INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = { [INTER_MODE_CONTEXTS][INTER_COMPOUND_MODES - 1] = {
{ 2, 173, 68, 192, 64, 192, 128, 180, 180 }, // 0 = both zero mv { 2, 173, 68, 192, 128, 180, 180 }, // 0 = both zero mv
{ 7, 145, 160, 192, 64, 192, 128, 180, 180 }, // 1 = 1 zero + 1 predicted { 7, 145, 160, 192, 128, 180, 180 }, // 1 = 1 zero + 1 predicted
{ 7, 166, 126, 192, 64, 192, 128, 180, 180 }, // 2 = two predicted mvs { 7, 166, 126, 192, 128, 180, 180 }, // 2 = two predicted mvs
{ 7, 94, 132, 192, 64, 192, 128, 180, 180 }, // 3 = 1 pred/zero, 1 new { 7, 94, 132, 192, 128, 180, 180 }, // 3 = 1 pred/zero, 1 new
{ 8, 64, 64, 192, 64, 192, 128, 180, 180 }, // 4 = two new mvs { 8, 64, 64, 192, 128, 180, 180 }, // 4 = two new mvs
{ 17, 81, 52, 192, 64, 192, 128, 180, 180 }, // 5 = one intra neighbour { 17, 81, 52, 192, 128, 180, 180 }, // 5 = one intra neighbour
{ 25, 29, 50, 192, 64, 192, 128, 180, 180 }, // 6 = two intra neighbours { 25, 29, 50, 192, 128, 180, 180 }, // 6 = two intra neighbours
}; };
#if CONFIG_COMPOUND_SINGLEREF #if CONFIG_COMPOUND_SINGLEREF
@ -1330,11 +1330,8 @@ const aom_tree_index av1_inter_compound_mode_tree
-INTER_COMPOUND_OFFSET(ZERO_ZEROMV), 2, -INTER_COMPOUND_OFFSET(ZERO_ZEROMV), 2,
-INTER_COMPOUND_OFFSET(NEAREST_NEARESTMV), 4, -INTER_COMPOUND_OFFSET(NEAREST_NEARESTMV), 4,
6, -INTER_COMPOUND_OFFSET(NEW_NEWMV), 6, -INTER_COMPOUND_OFFSET(NEW_NEWMV),
8, 12, -INTER_COMPOUND_OFFSET(NEAR_NEARMV), 8,
-INTER_COMPOUND_OFFSET(NEAR_NEARMV), 10, 10, 12,
-INTER_COMPOUND_OFFSET(NEAREST_NEARMV),
-INTER_COMPOUND_OFFSET(NEAR_NEARESTMV),
14, 16,
-INTER_COMPOUND_OFFSET(NEAREST_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARESTMV), -INTER_COMPOUND_OFFSET(NEAREST_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARESTMV),
-INTER_COMPOUND_OFFSET(NEAR_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARMV) -INTER_COMPOUND_OFFSET(NEAR_NEWMV), -INTER_COMPOUND_OFFSET(NEW_NEARMV)
}; };

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

@ -341,8 +341,6 @@ typedef enum ATTRIBUTE_PACKED {
#endif // CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
// Compound ref compound modes // Compound ref compound modes
NEAREST_NEARESTMV, NEAREST_NEARESTMV,
NEAREST_NEARMV,
NEAR_NEARESTMV,
NEAR_NEARMV, NEAR_NEARMV,
NEAREST_NEWMV, NEAREST_NEWMV,
NEW_NEARESTMV, NEW_NEARESTMV,

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

@ -68,8 +68,6 @@ static const int mode_2_counter[MB_MODE_COUNT] = {
1, // SR_NEW_NEWMV 1, // SR_NEW_NEWMV
#endif // CONFIG_COMPOUND_SINGLEREF #endif // CONFIG_COMPOUND_SINGLEREF
0, // NEAREST_NEARESTMV 0, // NEAREST_NEARESTMV
0, // NEAREST_NEARMV
0, // NEAR_NEARESTMV
0, // NEAR_NEARMV 0, // NEAR_NEARMV
1, // NEAREST_NEWMV 1, // NEAREST_NEWMV
1, // NEW_NEARESTMV 1, // NEW_NEARESTMV

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

@ -1679,18 +1679,6 @@ static INLINE int assign_mv(AV1_COMMON *cm, MACROBLOCKD *xd,
mv[1].as_int = nearest_mv[1].as_int; mv[1].as_int = nearest_mv[1].as_int;
break; break;
} }
case NEAREST_NEARMV: {
assert(is_compound);
mv[0].as_int = nearest_mv[0].as_int;
mv[1].as_int = near_mv[1].as_int;
break;
}
case NEAR_NEARESTMV: {
assert(is_compound);
mv[0].as_int = near_mv[0].as_int;
mv[1].as_int = nearest_mv[1].as_int;
break;
}
case NEAR_NEARMV: { case NEAR_NEARMV: {
assert(is_compound); assert(is_compound);
mv[0].as_int = near_mv[0].as_int; mv[0].as_int = near_mv[0].as_int;
@ -1962,10 +1950,10 @@ static void read_inter_block_mode_info(AV1Decoder *const pbi,
lower_mv_precision(&nearestmv[0].as_mv, allow_hp); lower_mv_precision(&nearestmv[0].as_mv, allow_hp);
lower_mv_precision(&nearestmv[1].as_mv, allow_hp); lower_mv_precision(&nearestmv[1].as_mv, allow_hp);
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
} else if (mbmi->mode == NEAREST_NEWMV || mbmi->mode == NEAREST_NEARMV) { } else if (mbmi->mode == NEAREST_NEWMV) {
nearestmv[0] = xd->ref_mv_stack[ref_frame_type][0].this_mv; nearestmv[0] = xd->ref_mv_stack[ref_frame_type][0].this_mv;
lower_mv_precision(&nearestmv[0].as_mv, allow_hp); lower_mv_precision(&nearestmv[0].as_mv, allow_hp);
} else if (mbmi->mode == NEW_NEARESTMV || mbmi->mode == NEAR_NEARESTMV) { } else if (mbmi->mode == NEW_NEARESTMV) {
nearestmv[1] = xd->ref_mv_stack[ref_frame_type][0].comp_mv; nearestmv[1] = xd->ref_mv_stack[ref_frame_type][0].comp_mv;
lower_mv_precision(&nearestmv[1].as_mv, allow_hp); lower_mv_precision(&nearestmv[1].as_mv, allow_hp);
} }

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

@ -73,8 +73,8 @@ static struct av1_token partition_encodings[PARTITION_TYPES];
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
static const struct av1_token static const struct av1_token
inter_compound_mode_encodings[INTER_COMPOUND_MODES] = { inter_compound_mode_encodings[INTER_COMPOUND_MODES] = {
{ 2, 2 }, { 50, 6 }, { 51, 6 }, { 24, 5 }, { 52, 6 }, { 2, 2 }, { 12, 4 }, { 52, 6 }, { 53, 6 },
{ 53, 6 }, { 54, 6 }, { 55, 6 }, { 0, 1 }, { 7, 3 } { 54, 6 }, { 55, 6 }, { 0, 1 }, { 7, 3 }
}; };
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
#if CONFIG_PALETTE #if CONFIG_PALETTE

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

@ -957,8 +957,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
rd->thresh_mult[THR_COMP_NEAREST_NEARLA] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTLA] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARLA] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARLA] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWLA] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWLA] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTLA] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTLA] += 1500;
@ -968,8 +966,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_ZERO_ZEROLA] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROLA] += 2500;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
rd->thresh_mult[THR_COMP_NEAREST_NEARL2A] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTL2A] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARL2A] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARL2A] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWL2A] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWL2A] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTL2A] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTL2A] += 1500;
@ -978,8 +974,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_NEW_NEWL2A] += 2000; rd->thresh_mult[THR_COMP_NEW_NEWL2A] += 2000;
rd->thresh_mult[THR_COMP_ZERO_ZEROL2A] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROL2A] += 2500;
rd->thresh_mult[THR_COMP_NEAREST_NEARL3A] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTL3A] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARL3A] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARL3A] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWL3A] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWL3A] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTL3A] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTL3A] += 1500;
@ -989,8 +983,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_ZERO_ZEROL3A] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROL3A] += 2500;
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
rd->thresh_mult[THR_COMP_NEAREST_NEARGA] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTGA] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARGA] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARGA] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWGA] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWGA] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTGA] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTGA] += 1500;
@ -1000,8 +992,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_ZERO_ZEROGA] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROGA] += 2500;
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
rd->thresh_mult[THR_COMP_NEAREST_NEARLB] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTLB] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARLB] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARLB] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWLB] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWLB] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTLB] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTLB] += 1500;
@ -1010,8 +1000,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_NEW_NEWLB] += 2000; rd->thresh_mult[THR_COMP_NEW_NEWLB] += 2000;
rd->thresh_mult[THR_COMP_ZERO_ZEROLB] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROLB] += 2500;
rd->thresh_mult[THR_COMP_NEAREST_NEARL2B] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTL2B] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARL2B] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARL2B] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWL2B] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWL2B] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTL2B] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTL2B] += 1500;
@ -1020,8 +1008,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_NEW_NEWL2B] += 2000; rd->thresh_mult[THR_COMP_NEW_NEWL2B] += 2000;
rd->thresh_mult[THR_COMP_ZERO_ZEROL2B] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROL2B] += 2500;
rd->thresh_mult[THR_COMP_NEAREST_NEARL3B] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTL3B] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARL3B] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARL3B] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWL3B] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWL3B] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTL3B] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTL3B] += 1500;
@ -1030,8 +1016,6 @@ void av1_set_rd_speed_thresholds(AV1_COMP *cpi) {
rd->thresh_mult[THR_COMP_NEW_NEWL3B] += 2000; rd->thresh_mult[THR_COMP_NEW_NEWL3B] += 2000;
rd->thresh_mult[THR_COMP_ZERO_ZEROL3B] += 2500; rd->thresh_mult[THR_COMP_ZERO_ZEROL3B] += 2500;
rd->thresh_mult[THR_COMP_NEAREST_NEARGB] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARESTGB] += 1200;
rd->thresh_mult[THR_COMP_NEAR_NEARGB] += 1200; rd->thresh_mult[THR_COMP_NEAR_NEARGB] += 1200;
rd->thresh_mult[THR_COMP_NEAREST_NEWGB] += 1500; rd->thresh_mult[THR_COMP_NEAREST_NEWGB] += 1500;
rd->thresh_mult[THR_COMP_NEW_NEARESTGB] += 1500; rd->thresh_mult[THR_COMP_NEW_NEARESTGB] += 1500;

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

@ -224,8 +224,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
#endif // CONFIG_ALT_INTRA #endif // CONFIG_ALT_INTRA
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
{ NEAR_NEARESTMV, { LAST_FRAME, ALTREF_FRAME } },
{ NEAREST_NEARMV, { LAST_FRAME, ALTREF_FRAME } },
{ NEAR_NEARMV, { LAST_FRAME, ALTREF_FRAME } }, { NEAR_NEARMV, { LAST_FRAME, ALTREF_FRAME } },
{ NEW_NEARESTMV, { LAST_FRAME, ALTREF_FRAME } }, { NEW_NEARESTMV, { LAST_FRAME, ALTREF_FRAME } },
{ NEAREST_NEWMV, { LAST_FRAME, ALTREF_FRAME } }, { NEAREST_NEWMV, { LAST_FRAME, ALTREF_FRAME } },
@ -235,8 +233,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ ZERO_ZEROMV, { LAST_FRAME, ALTREF_FRAME } }, { ZERO_ZEROMV, { LAST_FRAME, ALTREF_FRAME } },
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
{ NEAR_NEARESTMV, { LAST2_FRAME, ALTREF_FRAME } },
{ NEAREST_NEARMV, { LAST2_FRAME, ALTREF_FRAME } },
{ NEAR_NEARMV, { LAST2_FRAME, ALTREF_FRAME } }, { NEAR_NEARMV, { LAST2_FRAME, ALTREF_FRAME } },
{ NEW_NEARESTMV, { LAST2_FRAME, ALTREF_FRAME } }, { NEW_NEARESTMV, { LAST2_FRAME, ALTREF_FRAME } },
{ NEAREST_NEWMV, { LAST2_FRAME, ALTREF_FRAME } }, { NEAREST_NEWMV, { LAST2_FRAME, ALTREF_FRAME } },
@ -245,8 +241,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ NEW_NEWMV, { LAST2_FRAME, ALTREF_FRAME } }, { NEW_NEWMV, { LAST2_FRAME, ALTREF_FRAME } },
{ ZERO_ZEROMV, { LAST2_FRAME, ALTREF_FRAME } }, { ZERO_ZEROMV, { LAST2_FRAME, ALTREF_FRAME } },
{ NEAR_NEARESTMV, { LAST3_FRAME, ALTREF_FRAME } },
{ NEAREST_NEARMV, { LAST3_FRAME, ALTREF_FRAME } },
{ NEAR_NEARMV, { LAST3_FRAME, ALTREF_FRAME } }, { NEAR_NEARMV, { LAST3_FRAME, ALTREF_FRAME } },
{ NEW_NEARESTMV, { LAST3_FRAME, ALTREF_FRAME } }, { NEW_NEARESTMV, { LAST3_FRAME, ALTREF_FRAME } },
{ NEAREST_NEWMV, { LAST3_FRAME, ALTREF_FRAME } }, { NEAREST_NEWMV, { LAST3_FRAME, ALTREF_FRAME } },
@ -256,8 +250,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ ZERO_ZEROMV, { LAST3_FRAME, ALTREF_FRAME } }, { ZERO_ZEROMV, { LAST3_FRAME, ALTREF_FRAME } },
#endif // CONFIG_EXT_REFS #endif // CONFIG_EXT_REFS
{ NEAR_NEARESTMV, { GOLDEN_FRAME, ALTREF_FRAME } },
{ NEAREST_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } },
{ NEAR_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } }, { NEAR_NEARMV, { GOLDEN_FRAME, ALTREF_FRAME } },
{ NEW_NEARESTMV, { GOLDEN_FRAME, ALTREF_FRAME } }, { NEW_NEARESTMV, { GOLDEN_FRAME, ALTREF_FRAME } },
{ NEAREST_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } }, { NEAREST_NEWMV, { GOLDEN_FRAME, ALTREF_FRAME } },
@ -267,8 +259,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ ZERO_ZEROMV, { GOLDEN_FRAME, ALTREF_FRAME } }, { ZERO_ZEROMV, { GOLDEN_FRAME, ALTREF_FRAME } },
#if CONFIG_EXT_REFS #if CONFIG_EXT_REFS
{ NEAR_NEARESTMV, { LAST_FRAME, BWDREF_FRAME } },
{ NEAREST_NEARMV, { LAST_FRAME, BWDREF_FRAME } },
{ NEAR_NEARMV, { LAST_FRAME, BWDREF_FRAME } }, { NEAR_NEARMV, { LAST_FRAME, BWDREF_FRAME } },
{ NEW_NEARESTMV, { LAST_FRAME, BWDREF_FRAME } }, { NEW_NEARESTMV, { LAST_FRAME, BWDREF_FRAME } },
{ NEAREST_NEWMV, { LAST_FRAME, BWDREF_FRAME } }, { NEAREST_NEWMV, { LAST_FRAME, BWDREF_FRAME } },
@ -277,8 +267,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ NEW_NEWMV, { LAST_FRAME, BWDREF_FRAME } }, { NEW_NEWMV, { LAST_FRAME, BWDREF_FRAME } },
{ ZERO_ZEROMV, { LAST_FRAME, BWDREF_FRAME } }, { ZERO_ZEROMV, { LAST_FRAME, BWDREF_FRAME } },
{ NEAR_NEARESTMV, { LAST2_FRAME, BWDREF_FRAME } },
{ NEAREST_NEARMV, { LAST2_FRAME, BWDREF_FRAME } },
{ NEAR_NEARMV, { LAST2_FRAME, BWDREF_FRAME } }, { NEAR_NEARMV, { LAST2_FRAME, BWDREF_FRAME } },
{ NEW_NEARESTMV, { LAST2_FRAME, BWDREF_FRAME } }, { NEW_NEARESTMV, { LAST2_FRAME, BWDREF_FRAME } },
{ NEAREST_NEWMV, { LAST2_FRAME, BWDREF_FRAME } }, { NEAREST_NEWMV, { LAST2_FRAME, BWDREF_FRAME } },
@ -287,8 +275,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ NEW_NEWMV, { LAST2_FRAME, BWDREF_FRAME } }, { NEW_NEWMV, { LAST2_FRAME, BWDREF_FRAME } },
{ ZERO_ZEROMV, { LAST2_FRAME, BWDREF_FRAME } }, { ZERO_ZEROMV, { LAST2_FRAME, BWDREF_FRAME } },
{ NEAR_NEARESTMV, { LAST3_FRAME, BWDREF_FRAME } },
{ NEAREST_NEARMV, { LAST3_FRAME, BWDREF_FRAME } },
{ NEAR_NEARMV, { LAST3_FRAME, BWDREF_FRAME } }, { NEAR_NEARMV, { LAST3_FRAME, BWDREF_FRAME } },
{ NEW_NEARESTMV, { LAST3_FRAME, BWDREF_FRAME } }, { NEW_NEARESTMV, { LAST3_FRAME, BWDREF_FRAME } },
{ NEAREST_NEWMV, { LAST3_FRAME, BWDREF_FRAME } }, { NEAREST_NEWMV, { LAST3_FRAME, BWDREF_FRAME } },
@ -297,8 +283,6 @@ static const MODE_DEFINITION av1_mode_order[MAX_MODES] = {
{ NEW_NEWMV, { LAST3_FRAME, BWDREF_FRAME } }, { NEW_NEWMV, { LAST3_FRAME, BWDREF_FRAME } },
{ ZERO_ZEROMV, { LAST3_FRAME, BWDREF_FRAME } }, { ZERO_ZEROMV, { LAST3_FRAME, BWDREF_FRAME } },
{ NEAR_NEARESTMV, { GOLDEN_FRAME, BWDREF_FRAME } },
{ NEAREST_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } },
{ NEAR_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } }, { NEAR_NEARMV, { GOLDEN_FRAME, BWDREF_FRAME } },
{ NEW_NEARESTMV, { GOLDEN_FRAME, BWDREF_FRAME } }, { NEW_NEARESTMV, { GOLDEN_FRAME, BWDREF_FRAME } },
{ NEAREST_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } }, { NEAREST_NEWMV, { GOLDEN_FRAME, BWDREF_FRAME } },
@ -5153,8 +5137,6 @@ static int set_and_cost_bmi_mvs(
thismvcost += av1_mv_bit_cost(&this_mv[1].as_mv, &best_ref_mv[1]->as_mv, thismvcost += av1_mv_bit_cost(&this_mv[1].as_mv, &best_ref_mv[1]->as_mv,
mvjcost, mvcost, MV_COST_WEIGHT_SUB); mvjcost, mvcost, MV_COST_WEIGHT_SUB);
break; break;
case NEAREST_NEARMV:
case NEAR_NEARESTMV:
case NEAREST_NEARESTMV: case NEAREST_NEARESTMV:
case NEAR_NEARMV: case NEAR_NEARMV:
this_mv[0].as_int = frame_mv[mode][mbmi->ref_frame[0]].as_int; this_mv[0].as_int = frame_mv[mode][mbmi->ref_frame[0]].as_int;
@ -5456,36 +5438,25 @@ static int check_best_zero_mv(
} }
} }
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
else if ((this_mode == NEAREST_NEARESTMV || this_mode == NEAREST_NEARMV || else if ((this_mode == NEAREST_NEARESTMV || this_mode == NEAR_NEARMV ||
this_mode == NEAR_NEARESTMV || this_mode == NEAR_NEARMV ||
this_mode == ZERO_ZEROMV) && this_mode == ZERO_ZEROMV) &&
frame_mv[this_mode][ref_frames[0]].as_int == zeromv[0].as_int && frame_mv[this_mode][ref_frames[0]].as_int == zeromv[0].as_int &&
frame_mv[this_mode][ref_frames[1]].as_int == zeromv[1].as_int) { frame_mv[this_mode][ref_frames[1]].as_int == zeromv[1].as_int) {
int16_t rfc = compound_mode_context[ref_frames[0]]; int16_t rfc = compound_mode_context[ref_frames[0]];
int c1 = cost_mv_ref(cpi, NEAREST_NEARMV, rfc);
int c2 = cost_mv_ref(cpi, NEAREST_NEARESTMV, rfc); int c2 = cost_mv_ref(cpi, NEAREST_NEARESTMV, rfc);
int c3 = cost_mv_ref(cpi, ZERO_ZEROMV, rfc); int c3 = cost_mv_ref(cpi, ZERO_ZEROMV, rfc);
int c4 = cost_mv_ref(cpi, NEAR_NEARESTMV, rfc);
int c5 = cost_mv_ref(cpi, NEAR_NEARMV, rfc); int c5 = cost_mv_ref(cpi, NEAR_NEARMV, rfc);
if (this_mode == NEAREST_NEARMV) { if (this_mode == NEAREST_NEARESTMV) {
if (c1 > c3) return 0;
} else if (this_mode == NEAREST_NEARESTMV) {
if (c2 > c3) return 0; if (c2 > c3) return 0;
} else if (this_mode == NEAR_NEARESTMV) {
if (c4 > c3) return 0;
} else if (this_mode == NEAR_NEARMV) { } else if (this_mode == NEAR_NEARMV) {
if (c5 > c3) return 0; if (c5 > c3) return 0;
} else { } else {
assert(this_mode == ZERO_ZEROMV); assert(this_mode == ZERO_ZEROMV);
if ((c3 >= c2 && frame_mv[NEAREST_NEARESTMV][ref_frames[0]].as_int == 0 && if ((c3 >= c2 && frame_mv[NEAREST_NEARESTMV][ref_frames[0]].as_int == 0 &&
frame_mv[NEAREST_NEARESTMV][ref_frames[1]].as_int == 0) || frame_mv[NEAREST_NEARESTMV][ref_frames[1]].as_int == 0) ||
(c3 >= c1 && frame_mv[NEAREST_NEARMV][ref_frames[0]].as_int == 0 &&
frame_mv[NEAREST_NEARMV][ref_frames[1]].as_int == 0) ||
(c3 >= c5 && frame_mv[NEAR_NEARMV][ref_frames[0]].as_int == 0 && (c3 >= c5 && frame_mv[NEAR_NEARMV][ref_frames[0]].as_int == 0 &&
frame_mv[NEAR_NEARMV][ref_frames[1]].as_int == 0) || frame_mv[NEAR_NEARMV][ref_frames[1]].as_int == 0))
(c3 >= c4 && frame_mv[NEAR_NEARESTMV][ref_frames[0]].as_int == 0 &&
frame_mv[NEAR_NEARESTMV][ref_frames[1]].as_int == 0))
return 0; return 0;
} }
} }
@ -5923,20 +5894,12 @@ static int64_t rd_pick_inter_best_sub8x8_mode(
frame_mv[NEARESTMV][frame].as_int; frame_mv[NEARESTMV][frame].as_int;
if (ref == 0) { if (ref == 0) {
frame_mv[NEAREST_NEARMV][frame].as_int =
frame_mv[NEARESTMV][frame].as_int;
frame_mv[NEAR_NEARESTMV][frame].as_int =
frame_mv[NEARMV][frame].as_int;
frame_mv[NEAREST_NEWMV][frame].as_int = frame_mv[NEAREST_NEWMV][frame].as_int =
frame_mv[NEARESTMV][frame].as_int; frame_mv[NEARESTMV][frame].as_int;
frame_mv[NEAR_NEWMV][frame].as_int = frame_mv[NEARMV][frame].as_int; frame_mv[NEAR_NEWMV][frame].as_int = frame_mv[NEARMV][frame].as_int;
frame_mv[NEAR_NEARMV][frame].as_int = frame_mv[NEAR_NEARMV][frame].as_int =
frame_mv[NEARMV][frame].as_int; frame_mv[NEARMV][frame].as_int;
} else if (ref == 1) { } else if (ref == 1) {
frame_mv[NEAREST_NEARMV][frame].as_int =
frame_mv[NEARMV][frame].as_int;
frame_mv[NEAR_NEARESTMV][frame].as_int =
frame_mv[NEARESTMV][frame].as_int;
frame_mv[NEW_NEARESTMV][frame].as_int = frame_mv[NEW_NEARESTMV][frame].as_int =
frame_mv[NEARESTMV][frame].as_int; frame_mv[NEARESTMV][frame].as_int;
frame_mv[NEW_NEARMV][frame].as_int = frame_mv[NEARMV][frame].as_int; frame_mv[NEW_NEARMV][frame].as_int = frame_mv[NEARMV][frame].as_int;
@ -7366,16 +7329,6 @@ static InterpFilter predict_interp_filter(
single_filter[NEARESTMV][refs[1]]) single_filter[NEARESTMV][refs[1]])
best_filter = single_filter[NEARESTMV][refs[0]]; best_filter = single_filter[NEARESTMV][refs[0]];
break; break;
case NEAREST_NEARMV:
if (single_filter[NEARESTMV][refs[0]] ==
single_filter[NEARMV][refs[1]])
best_filter = single_filter[NEARESTMV][refs[0]];
break;
case NEAR_NEARESTMV:
if (single_filter[NEARMV][refs[0]] ==
single_filter[NEARESTMV][refs[1]])
best_filter = single_filter[NEARMV][refs[0]];
break;
case NEAR_NEARMV: case NEAR_NEARMV:
if (single_filter[NEARMV][refs[0]] == single_filter[NEARMV][refs[1]]) if (single_filter[NEARMV][refs[0]] == single_filter[NEARMV][refs[1]])
best_filter = single_filter[NEARMV][refs[0]]; best_filter = single_filter[NEARMV][refs[0]];
@ -8568,7 +8521,7 @@ static int64_t handle_inter_mode(
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (mbmi_ext->ref_mv_count[ref_frame_type] > 0) { if (mbmi_ext->ref_mv_count[ref_frame_type] > 0) {
if (this_mode == NEAREST_NEWMV || this_mode == NEAREST_NEARMV) { if (this_mode == NEAREST_NEWMV) {
cur_mv[0] = mbmi_ext->ref_mv_stack[ref_frame_type][0].this_mv; cur_mv[0] = mbmi_ext->ref_mv_stack[ref_frame_type][0].this_mv;
lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv); lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv);
@ -8577,7 +8530,7 @@ static int64_t handle_inter_mode(
mbmi->mv[0].as_int = cur_mv[0].as_int; mbmi->mv[0].as_int = cur_mv[0].as_int;
} }
if (this_mode == NEW_NEARESTMV || this_mode == NEAR_NEARESTMV) { if (this_mode == NEW_NEARESTMV) {
cur_mv[1] = mbmi_ext->ref_mv_stack[ref_frame_type][0].comp_mv; cur_mv[1] = mbmi_ext->ref_mv_stack[ref_frame_type][0].comp_mv;
lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv); lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv);
@ -8589,8 +8542,7 @@ static int64_t handle_inter_mode(
if (mbmi_ext->ref_mv_count[ref_frame_type] > 1) { if (mbmi_ext->ref_mv_count[ref_frame_type] > 1) {
int ref_mv_idx = mbmi->ref_mv_idx + 1; int ref_mv_idx = mbmi->ref_mv_idx + 1;
if (this_mode == NEAR_NEWMV || this_mode == NEAR_NEARESTMV || if (this_mode == NEAR_NEWMV || this_mode == NEAR_NEARMV) {
this_mode == NEAR_NEARMV) {
cur_mv[0] = mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_idx].this_mv; cur_mv[0] = mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_idx].this_mv;
lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv); lower_mv_precision(&cur_mv[0].as_mv, cm->allow_high_precision_mv);
@ -8599,8 +8551,7 @@ static int64_t handle_inter_mode(
mbmi->mv[0].as_int = cur_mv[0].as_int; mbmi->mv[0].as_int = cur_mv[0].as_int;
} }
if (this_mode == NEW_NEARMV || this_mode == NEAREST_NEARMV || if (this_mode == NEW_NEARMV || this_mode == NEAR_NEARMV) {
this_mode == NEAR_NEARMV) {
cur_mv[1] = mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_idx].comp_mv; cur_mv[1] = mbmi_ext->ref_mv_stack[ref_frame_type][ref_mv_idx].comp_mv;
lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv); lower_mv_precision(&cur_mv[1].as_mv, cm->allow_high_precision_mv);
@ -9906,10 +9857,6 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
if (frame_mv[NEAREST_NEARESTMV][ALTREF_FRAME].as_int != zeromv.as_int) if (frame_mv[NEAREST_NEARESTMV][ALTREF_FRAME].as_int != zeromv.as_int)
mode_skip_mask[ALTREF_FRAME] |= (1 << NEAREST_NEARESTMV); mode_skip_mask[ALTREF_FRAME] |= (1 << NEAREST_NEARESTMV);
if (frame_mv[NEAREST_NEARMV][ALTREF_FRAME].as_int != zeromv.as_int)
mode_skip_mask[ALTREF_FRAME] |= (1 << NEAREST_NEARMV);
if (frame_mv[NEAR_NEARESTMV][ALTREF_FRAME].as_int != zeromv.as_int)
mode_skip_mask[ALTREF_FRAME] |= (1 << NEAR_NEARESTMV);
if (frame_mv[NEAR_NEARMV][ALTREF_FRAME].as_int != zeromv.as_int) if (frame_mv[NEAR_NEARMV][ALTREF_FRAME].as_int != zeromv.as_int)
mode_skip_mask[ALTREF_FRAME] |= (1 << NEAR_NEARMV); mode_skip_mask[ALTREF_FRAME] |= (1 << NEAR_NEARMV);
#endif // CONFIG_EXT_INTER #endif // CONFIG_EXT_INTER
@ -11180,17 +11127,9 @@ PALETTE_EXIT:
nearmv[0] = mbmi_ext->ref_mv_stack[rf_type][i + 1].this_mv; nearmv[0] = mbmi_ext->ref_mv_stack[rf_type][i + 1].this_mv;
nearmv[1] = mbmi_ext->ref_mv_stack[rf_type][i + 1].comp_mv; nearmv[1] = mbmi_ext->ref_mv_stack[rf_type][i + 1].comp_mv;
// Try switching to the NEAR_NEAREST type modes first // Try switching to the NEAR_NEARMV mode
if (nearestmv[0].as_int == best_mbmode.mv[0].as_int && if (nearmv[0].as_int == best_mbmode.mv[0].as_int &&
nearmv[1].as_int == best_mbmode.mv[1].as_int) { nearmv[1].as_int == best_mbmode.mv[1].as_int) {
best_mbmode.mode = NEAREST_NEARMV;
best_mbmode.ref_mv_idx = i;
} else if (nearmv[0].as_int == best_mbmode.mv[0].as_int &&
nearestmv[1].as_int == best_mbmode.mv[1].as_int) {
best_mbmode.mode = NEAR_NEARESTMV;
best_mbmode.ref_mv_idx = i;
} else if (nearmv[0].as_int == best_mbmode.mv[0].as_int &&
nearmv[1].as_int == best_mbmode.mv[1].as_int) {
best_mbmode.mode = NEAR_NEARMV; best_mbmode.mode = NEAR_NEARMV;
best_mbmode.ref_mv_idx = i; best_mbmode.ref_mv_idx = i;
} }

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

@ -39,37 +39,33 @@ enum {
#if CONFIG_EXT_INTER #if CONFIG_EXT_INTER
enum { enum {
INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) | (1 << NEWMV) | INTER_ALL = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEAR_NEARMV) | (1 << NEAREST_NEARESTMV) | (1 << NEAR_NEARMV) | (1 << NEW_NEWMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) | (1 << NEW_NEWMV) |
(1 << NEAREST_NEWMV) | (1 << NEAR_NEWMV) | (1 << NEW_NEARMV) | (1 << NEAREST_NEWMV) | (1 << NEAR_NEWMV) | (1 << NEW_NEARMV) |
(1 << NEW_NEARESTMV) | (1 << ZERO_ZEROMV), (1 << NEW_NEARESTMV) | (1 << ZERO_ZEROMV),
INTER_NEAREST = (1 << NEARESTMV) | (1 << NEAREST_NEARESTMV) | INTER_NEAREST = (1 << NEARESTMV) | (1 << NEAREST_NEARESTMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) |
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV), (1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV),
INTER_NEAREST_NEW = (1 << NEARESTMV) | (1 << NEWMV) | INTER_NEAREST_NEW = (1 << NEARESTMV) | (1 << NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) | (1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) |
(1 << NEAR_NEARESTMV) | (1 << NEAREST_NEARMV) |
(1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV), (1 << NEW_NEARMV) | (1 << NEAR_NEWMV),
INTER_NEAREST_ZERO = (1 << NEARESTMV) | (1 << ZEROMV) | INTER_NEAREST_ZERO = (1 << NEARESTMV) | (1 << ZEROMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) | (1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV), (1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV),
INTER_NEAREST_NEW_ZERO = INTER_NEAREST_NEW_ZERO = (1 << NEARESTMV) | (1 << ZEROMV) | (1 << NEWMV) |
(1 << NEARESTMV) | (1 << ZEROMV) | (1 << NEWMV) | (1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) | (1 << NEW_NEWMV) | (1 << NEW_NEWMV) | (1 << NEW_NEARESTMV) |
(1 << NEAREST_NEARMV) | (1 << NEAR_NEARESTMV) | (1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) | (1 << NEW_NEARMV) |
(1 << NEAREST_NEWMV) | (1 << NEW_NEARMV) | (1 << NEAR_NEWMV), (1 << NEAR_NEWMV),
INTER_NEAREST_NEAR_NEW = INTER_NEAREST_NEAR_NEW = (1 << NEARESTMV) | (1 << NEARMV) | (1 << NEWMV) |
(1 << NEARESTMV) | (1 << NEARMV) | (1 << NEWMV) | (1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) |
(1 << NEAREST_NEARESTMV) | (1 << NEW_NEWMV) | (1 << NEAREST_NEARMV) | (1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) |
(1 << NEAR_NEARESTMV) | (1 << NEW_NEARESTMV) | (1 << NEAREST_NEWMV) | (1 << NEW_NEARMV) | (1 << NEAR_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV) | (1 << NEAR_NEARMV), (1 << NEAR_NEARMV),
INTER_NEAREST_NEAR_ZERO = INTER_NEAREST_NEAR_ZERO = (1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) |
(1 << NEARESTMV) | (1 << NEARMV) | (1 << ZEROMV) | (1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) |
(1 << NEAREST_NEARESTMV) | (1 << ZERO_ZEROMV) | (1 << NEAREST_NEARMV) | (1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV) |
(1 << NEAR_NEARESTMV) | (1 << NEAREST_NEWMV) | (1 << NEW_NEARESTMV) | (1 << NEW_NEARMV) | (1 << NEAR_NEWMV) |
(1 << NEW_NEARMV) | (1 << NEAR_NEWMV) | (1 << NEAR_NEARMV), (1 << NEAR_NEARMV),
}; };
#else #else
enum { enum {