Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
e140c508
Commit
e140c508
authored
Apr 27, 2017
by
Sebastien Alaiwan
Committed by
Jingning Han
May 05, 2017
Browse files
Merge ref-mv into codebase
Change-Id: I96e386678f6227f3ca735c9be2725cb9795b3296
parent
911c964a
Changes
25
Hide whitespace changes
Inline
Side-by-side
av1/common/blockd.h
View file @
e140c508
...
...
@@ -260,9 +260,7 @@ static INLINE int have_newmv_in_inter_mode(PREDICTION_MODE mode) {
typedef
struct
{
PREDICTION_MODE
as_mode
;
int_mv
as_mv
[
2
];
// first, second inter predictor motion vectors
#if CONFIG_REF_MV
int_mv
pred_mv
[
2
];
#endif
#if CONFIG_EXT_INTER
int_mv
ref_mv
[
2
];
#endif // CONFIG_EXT_INTER
...
...
@@ -413,9 +411,7 @@ typedef struct {
#endif // CONFIG_MOTION_VAR
int_mv
mv
[
2
];
int_mv
pred_mv
[
2
];
#if CONFIG_REF_MV
uint8_t
ref_mv_idx
;
#endif
#if CONFIG_EXT_PARTITION_TYPES
PARTITION_TYPE
partition
;
#endif
...
...
@@ -631,11 +627,9 @@ typedef struct macroblockd {
// block dimension in the unit of mode_info.
uint8_t
n8_w
,
n8_h
;
#if CONFIG_REF_MV
uint8_t
ref_mv_count
[
MODE_CTX_REF_FRAMES
];
CANDIDATE_MV
ref_mv_stack
[
MODE_CTX_REF_FRAMES
][
MAX_REF_MV_STACK_SIZE
];
uint8_t
is_sec_rect
;
#endif
#if CONFIG_PVQ
daala_dec_ctx
daala_dec
;
...
...
av1/common/entropy.c
View file @
e140c508
...
...
@@ -6260,7 +6260,6 @@ void av1_average_tile_mv_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
aom_cdf_prob *fc_cdf_ptr;
#if CONFIG_REF_MV
int j;
for (j = 0; j < NMV_CONTEXTS; ++j) {
AVERAGE_TILE_CDFS(nmvc[j].joint_cdf)
...
...
@@ -6271,15 +6270,6 @@ void av1_average_tile_mv_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
AVERAGE_TILE_CDFS(nmvc[j].comps[k].fp_cdf);
}
}
#else
AVERAGE_TILE_CDFS(nmvc.joint_cdf)
for (k = 0; k < 2; ++k) {
AVERAGE_TILE_CDFS(nmvc.comps[k].class_cdf)
AVERAGE_TILE_CDFS(nmvc.comps[k].class0_fp_cdf)
AVERAGE_TILE_CDFS(nmvc.comps[k].fp_cdf)
}
#endif
}
void av1_average_tile_intra_cdfs(FRAME_CONTEXT *fc, FRAME_CONTEXT *ec_ctxs[],
...
...
@@ -6324,17 +6314,13 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
aom_cdf_prob *fc_cdf_ptr;
// FIXME: comp_inter_cdf not defined
// FIXME: comp_inter_cdf not defined
// FIXME: comp_ref_cdf and comp_bwd_ref not defined
// FIXME: comp_ref_cdf and comp_bwd_ref not defined
// FIXME: single_ref_cdf not defined
// FIXME: single_ref_cdf not defined
#if CONFIG_REF_MV
// FIXME: cdfs not defined for newmv_mode, zeromv_mode, drl_mode, new2mv_mode
#else
AVERAGE_TILE_CDFS(inter_mode_cdf)
#endif
// FIXME: cdfs not defined for newmv_mode, zeromv_mode, drl_mode, new2mv_mode
// FIXME: cdfs not defined for motion_mode_prob, obmc_prob
...
...
av1/common/entropymode.c
View file @
e140c508
...
...
@@ -732,7 +732,6 @@ static const aom_prob
};
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_REF_MV
static
const
aom_prob
default_newmv_prob
[
NEWMV_MODE_CONTEXTS
]
=
{
200
,
180
,
150
,
150
,
110
,
70
,
60
,
};
...
...
@@ -747,7 +746,6 @@ static const aom_prob default_refmv_prob[REFMV_MODE_CONTEXTS] = {
static
const
aom_prob
default_drl_prob
[
DRL_MODE_CONTEXTS
]
=
{
128
,
160
,
180
,
128
,
160
};
#endif // CONFIG_REF_MV
static
const
aom_prob
default_inter_mode_probs
[
INTER_MODE_CONTEXTS
][
INTER_MODES
-
1
]
=
{
...
...
@@ -3268,12 +3266,10 @@ static void init_mode_probs(FRAME_CONTEXT *fc) {
av1_copy
(
fc
->
txfm_partition_prob
,
default_txfm_partition_probs
);
#endif
av1_copy
(
fc
->
skip_probs
,
default_skip_probs
);
#if CONFIG_REF_MV
av1_copy
(
fc
->
newmv_prob
,
default_newmv_prob
);
av1_copy
(
fc
->
zeromv_prob
,
default_zeromv_prob
);
av1_copy
(
fc
->
refmv_prob
,
default_refmv_prob
);
av1_copy
(
fc
->
drl_prob
,
default_drl_prob
);
#endif // CONFIG_REF_MV
av1_copy
(
fc
->
inter_mode_probs
,
default_inter_mode_probs
);
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
av1_copy
(
fc
->
motion_mode_prob
,
default_motion_mode_prob
);
...
...
@@ -3494,7 +3490,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
#endif // CONFIG_EXT_INTER && CONFIG_COMPOUND_SINGLEREF
#if CONFIG_REF_MV
for
(
i
=
0
;
i
<
NEWMV_MODE_CONTEXTS
;
++
i
)
fc
->
newmv_prob
[
i
]
=
av1_mode_mv_merge_probs
(
pre_fc
->
newmv_prob
[
i
],
counts
->
newmv_mode
[
i
]);
...
...
@@ -3508,11 +3503,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
for
(
i
=
0
;
i
<
DRL_MODE_CONTEXTS
;
++
i
)
fc
->
drl_prob
[
i
]
=
av1_mode_mv_merge_probs
(
pre_fc
->
drl_prob
[
i
],
counts
->
drl_mode
[
i
]);
#else
for
(
i
=
0
;
i
<
INTER_MODE_CONTEXTS
;
i
++
)
aom_tree_merge_probs
(
av1_inter_mode_tree
,
pre_fc
->
inter_mode_probs
[
i
],
counts
->
inter_mode
[
i
],
fc
->
inter_mode_probs
[
i
]);
#endif
#if CONFIG_MOTION_VAR || CONFIG_WARPED_MOTION
for
(
i
=
BLOCK_8X8
;
i
<
BLOCK_SIZES
;
++
i
)
...
...
av1/common/entropymode.h
View file @
e140c508
...
...
@@ -185,12 +185,10 @@ typedef struct frame_contexts {
aom_prob
coeff_lps
[
TX_SIZES
][
PLANE_TYPES
][
LEVEL_CONTEXTS
];
#endif
#if CONFIG_REF_MV
aom_prob
newmv_prob
[
NEWMV_MODE_CONTEXTS
];
aom_prob
zeromv_prob
[
ZEROMV_MODE_CONTEXTS
];
aom_prob
refmv_prob
[
REFMV_MODE_CONTEXTS
];
aom_prob
drl_prob
[
DRL_MODE_CONTEXTS
];
#endif // CONFIG_REF_MV
aom_prob
inter_mode_probs
[
INTER_MODE_CONTEXTS
][
INTER_MODES
-
1
];
#if CONFIG_EXT_INTER
...
...
@@ -228,11 +226,7 @@ typedef struct frame_contexts {
aom_prob
txfm_partition_prob
[
TXFM_PARTITION_CONTEXTS
];
#endif
aom_prob
skip_probs
[
SKIP_CONTEXTS
];
#if CONFIG_REF_MV
nmv_context
nmvc
[
NMV_CONTEXTS
];
#else
nmv_context
nmvc
;
#endif
#if CONFIG_INTRABC
nmv_context
ndvc
;
#endif
...
...
@@ -360,12 +354,10 @@ typedef struct FRAME_COUNTS {
av1_blockz_count_model
blockz_count
[
TX_SIZES
][
PLANE_TYPES
];
#endif
#if CONFIG_REF_MV
unsigned
int
newmv_mode
[
NEWMV_MODE_CONTEXTS
][
2
];
unsigned
int
zeromv_mode
[
ZEROMV_MODE_CONTEXTS
][
2
];
unsigned
int
refmv_mode
[
REFMV_MODE_CONTEXTS
][
2
];
unsigned
int
drl_mode
[
DRL_MODE_CONTEXTS
][
2
];
#endif
unsigned
int
inter_mode
[
INTER_MODE_CONTEXTS
][
INTER_MODES
];
#if CONFIG_EXT_INTER
...
...
@@ -406,11 +398,7 @@ typedef struct FRAME_COUNTS {
unsigned
int
txfm_partition
[
TXFM_PARTITION_CONTEXTS
][
2
];
#endif
unsigned
int
skip
[
SKIP_CONTEXTS
][
2
];
#if CONFIG_REF_MV
nmv_context_counts
mv
[
NMV_CONTEXTS
];
#else
nmv_context_counts
mv
;
#endif
#if CONFIG_INTRABC
nmv_context_counts
dv
;
#endif
...
...
av1/common/entropymv.c
View file @
e140c508
...
...
@@ -232,17 +232,11 @@ void av1_inc_mv(const MV *mv, nmv_context_counts *counts, const int usehp) {
void
av1_adapt_mv_probs
(
AV1_COMMON
*
cm
,
int
allow_hp
)
{
int
i
,
j
;
#if CONFIG_REF_MV
int
idx
;
for
(
idx
=
0
;
idx
<
NMV_CONTEXTS
;
++
idx
)
{
nmv_context
*
nmvc
=
&
cm
->
fc
->
nmvc
[
idx
];
const
nmv_context
*
pre_nmvc
=
&
cm
->
pre_fc
->
nmvc
[
idx
];
const
nmv_context_counts
*
counts
=
&
cm
->
counts
.
mv
[
idx
];
#else
nmv_context
*
nmvc
=
&
cm
->
fc
->
nmvc
;
const
nmv_context
*
pre_nmvc
=
&
cm
->
pre_fc
.
nmvc
;
const
nmv_context_counts
*
counts
=
&
cm
->
counts
.
mv
;
#endif // CONFIG_REF_MV
aom_tree_merge_probs
(
av1_mv_joint_tree
,
pre_nmvc
->
joints
,
counts
->
joints
,
nmvc
->
joints
);
for
(
i
=
0
;
i
<
2
;
++
i
)
{
...
...
@@ -271,9 +265,7 @@ void av1_adapt_mv_probs(AV1_COMMON *cm, int allow_hp) {
comp
->
hp
=
av1_mode_mv_merge_probs
(
pre_comp
->
hp
,
c
->
hp
);
}
}
#if CONFIG_REF_MV
}
#endif // CONFIG_REF_MV
}
#if CONFIG_EC_MULTISYMBOL && !CONFIG_EC_ADAPT
...
...
@@ -296,15 +288,11 @@ void av1_set_mv_cdfs(nmv_context *ctx) {
#endif
void
av1_init_mv_probs
(
AV1_COMMON
*
cm
)
{
#if CONFIG_REF_MV
int
i
;
for
(
i
=
0
;
i
<
NMV_CONTEXTS
;
++
i
)
{
// NB: this sets CDFs too
cm
->
fc
->
nmvc
[
i
]
=
default_nmv_context
;
}
#else
cm
->
fc
->
nmvc
=
default_nmv_context
;
#endif // CONFIG_REF_MV
#if CONFIG_INTRABC
cm
->
fc
->
ndvc
=
default_nmv_context
;
#endif // CONFIG_INTRABC
...
...
av1/common/enums.h
View file @
e140c508
...
...
@@ -419,7 +419,6 @@ typedef enum {
#define SKIP_CONTEXTS 3
#if CONFIG_REF_MV
#define NMV_CONTEXTS 3
#define NEWMV_MODE_CONTEXTS 7
...
...
@@ -438,7 +437,6 @@ typedef enum {
#define SKIP_NEARESTMV_OFFSET 9
#define SKIP_NEARMV_OFFSET 10
#define SKIP_NEARESTMV_SUB8X8_OFFSET 11
#endif
#define INTER_MODE_CONTEXTS 7
#if CONFIG_DELTA_Q
...
...
@@ -455,14 +453,12 @@ typedef enum {
/* Segment Feature Masks */
#define MAX_MV_REF_CANDIDATES 2
#if CONFIG_REF_MV
#define MAX_REF_MV_STACK_SIZE 16
#if CONFIG_EXT_PARTITION
#define REF_CAT_LEVEL 640
#else
#define REF_CAT_LEVEL 255
#endif // CONFIG_EXT_PARTITION
#endif // CONFIG_REF_MV
#define INTRA_INTER_CONTEXTS 4
#define COMP_INTER_CONTEXTS 5
...
...
@@ -508,11 +504,7 @@ typedef uint8_t TXFM_CONTEXT;
#define SINGLE_REFS (FWD_REFS + BWD_REFS)
#define COMP_REFS (FWD_REFS * BWD_REFS)
#if CONFIG_REF_MV
#define MODE_CTX_REF_FRAMES (TOTAL_REFS_PER_FRAME + COMP_REFS)
#else
#define MODE_CTX_REF_FRAMES TOTAL_REFS_PER_FRAME
#endif
#if CONFIG_SUPERTX
#define PARTITION_SUPERTX_CONTEXTS 2
...
...
av1/common/mv.h
View file @
e140c508
...
...
@@ -269,14 +269,12 @@ static INLINE TransformationType get_gmtype(const WarpedMotionParams *gm) {
}
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_REF_MV
typedef
struct
candidate_mv
{
int_mv
this_mv
;
int_mv
comp_mv
;
uint8_t
pred_diff
[
2
];
int
weight
;
}
CANDIDATE_MV
;
#endif
static
INLINE
int
is_zero_mv
(
const
MV
*
mv
)
{
return
*
((
const
uint32_t
*
)
mv
)
==
0
;
...
...
av1/common/mvref_common.c
View file @
e140c508
...
...
@@ -14,8 +14,6 @@
#include
"av1/common/warped_motion.h"
#endif // CONFIG_WARPED_MOTION
#if CONFIG_REF_MV
static
uint8_t
add_ref_mv_candidate
(
const
MODE_INFO
*
const
candidate_mi
,
const
MB_MODE_INFO
*
const
candidate
,
const
MV_REFERENCE_FRAME
rf
[
2
],
uint8_t
*
refmv_count
,
...
...
@@ -556,7 +554,6 @@ static void setup_ref_mv_list(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
}
}
#endif
// This function searches the neighbourhood of a given MB/SB
// to try and find candidate reference vectors.
...
...
@@ -568,9 +565,6 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int_mv
zeromv
)
{
const
int
*
ref_sign_bias
=
cm
->
ref_frame_sign_bias
;
int
i
,
refmv_count
=
0
;
#if !CONFIG_REF_MV
const
POSITION
*
const
mv_ref_search
=
mv_ref_blocks
[
mi
->
mbmi
.
sb_type
];
#endif
int
different_ref_found
=
0
;
int
context_counter
=
0
;
#if CONFIG_MV_COMPRESS
...
...
@@ -596,7 +590,6 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
const
BLOCK_SIZE
bsize
=
mi
->
mbmi
.
sb_type
;
const
int
bw
=
block_size_wide
[
AOMMAX
(
bsize
,
BLOCK_8X8
)];
const
int
bh
=
block_size_high
[
AOMMAX
(
bsize
,
BLOCK_8X8
)];
#if CONFIG_REF_MV
POSITION
mv_ref_search
[
MVREF_NEIGHBOURS
];
const
int
num_8x8_blocks_wide
=
num_8x8_blocks_wide_lookup
[
bsize
];
const
int
num_8x8_blocks_high
=
num_8x8_blocks_high_lookup
[
bsize
];
...
...
@@ -639,7 +632,6 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
mv_ref_search
[
i
].
col
*=
2
;
}
#endif // CONFIG_CB4X4
#endif // CONFIG_REF_MV
// The nearest 2 blocks are treated differently
// if the size < 8x8 we get the mv from the bmi substructure,
...
...
@@ -673,12 +665,10 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
!
xd
->
mi
[
mv_ref
->
col
+
mv_ref
->
row
*
xd
->
mi_stride
]
?
NULL
:
&
xd
->
mi
[
mv_ref
->
col
+
mv_ref
->
row
*
xd
->
mi_stride
]
->
mbmi
;
#if CONFIG_REF_MV
if
(
candidate
==
NULL
)
continue
;
if
((
mi_row
%
MAX_MIB_SIZE
)
+
mv_ref
->
row
>=
MAX_MIB_SIZE
||
(
mi_col
%
MAX_MIB_SIZE
)
+
mv_ref
->
col
>=
MAX_MIB_SIZE
)
continue
;
#endif
different_ref_found
=
1
;
if
(
candidate
->
ref_frame
[
0
]
==
ref_frame
)
...
...
@@ -727,12 +717,10 @@ static void find_mv_refs_idx(const AV1_COMMON *cm, const MACROBLOCKD *xd,
!
xd
->
mi
[
mv_ref
->
col
+
mv_ref
->
row
*
xd
->
mi_stride
]
?
NULL
:
&
xd
->
mi
[
mv_ref
->
col
+
mv_ref
->
row
*
xd
->
mi_stride
]
->
mbmi
;
#if CONFIG_REF_MV
if
(
candidate
==
NULL
)
continue
;
if
((
mi_row
%
MAX_MIB_SIZE
)
+
mv_ref
->
row
>=
MAX_MIB_SIZE
||
(
mi_col
%
MAX_MIB_SIZE
)
+
mv_ref
->
col
>=
MAX_MIB_SIZE
)
continue
;
#endif
// If the candidate is INTRA we don't want to consider its mv.
IF_DIFF_REF_FRAME_ADD_MV
(
candidate
,
ref_frame
,
ref_sign_bias
,
...
...
@@ -780,14 +768,10 @@ void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
int_mv
*
mv_ref_list
,
int
block
,
int
mi_row
,
int
mi_col
,
int16_t
*
mode_context
)
{
int
i
,
refmv_count
=
0
;
#if !CONFIG_REF_MV
const
POSITION
*
const
mv_ref_search
=
mv_ref_blocks
[
mi
->
mbmi
.
sb_type
];
#endif
int
context_counter
=
0
;
const
int
bw
=
block_size_wide
[
mi
->
mbmi
.
sb_type
];
const
int
bh
=
block_size_high
[
mi
->
mbmi
.
sb_type
];
const
TileInfo
*
const
tile
=
&
xd
->
tile
;
#if CONFIG_REF_MV
POSITION
mv_ref_search
[
MVREF_NEIGHBOURS
];
const
int
num_8x8_blocks_wide
=
mi_size_wide
[
mi
->
mbmi
.
sb_type
];
const
int
num_8x8_blocks_high
=
mi_size_high
[
mi
->
mbmi
.
sb_type
];
...
...
@@ -823,7 +807,6 @@ void av1_update_mv_context(const AV1_COMMON *cm, const MACROBLOCKD *xd,
mv_ref_search
[
7
].
col
=
-
3
;
mv_ref_search
[
8
].
row
=
num_8x8_blocks_high
-
1
;
mv_ref_search
[
8
].
col
=
-
3
;
#endif
// Blank the reference vector list
memset
(
mv_ref_list
,
0
,
sizeof
(
*
mv_ref_list
)
*
MAX_MV_REF_CANDIDATES
);
...
...
@@ -859,12 +842,10 @@ Done:
void
av1_find_mv_refs
(
const
AV1_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
MODE_INFO
*
mi
,
MV_REFERENCE_FRAME
ref_frame
,
#if CONFIG_REF_MV
uint8_t
*
ref_mv_count
,
CANDIDATE_MV
*
ref_mv_stack
,
#if CONFIG_EXT_INTER
int16_t
*
compound_mode_context
,
#endif // CONFIG_EXT_INTER
#endif
int_mv
*
mv_ref_list
,
int
mi_row
,
int
mi_col
,
find_mv_refs_sync
sync
,
void
*
const
data
,
int16_t
*
mode_context
)
{
...
...
@@ -872,23 +853,17 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
#if CONFIG_GLOBAL_MOTION
BLOCK_SIZE
bsize
=
mi
->
mbmi
.
sb_type
;
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_REF_MV
int
idx
,
all_zero
=
1
;
#if CONFIG_GLOBAL_MOTION
MV_REFERENCE_FRAME
rf
[
2
];
#endif // CONFIG_GLOBAL_MOTION
#endif // CONFIG_REF_MV
#if CONFIG_EXT_INTER
av1_update_mv_context
(
cm
,
xd
,
mi
,
ref_frame
,
mv_ref_list
,
-
1
,
mi_row
,
mi_col
,
#if CONFIG_REF_MV
compound_mode_context
);
#else
mode_context
);
#endif // CONFIG_REF_MV
#endif // CONFIG_EXT_INTER
#if CONFIG_GLOBAL_MOTION
#if CONFIG_REF_MV
av1_set_ref_frame
(
rf
,
ref_frame
);
zeromv
[
0
].
as_int
=
gm_get_motion_vector
(
&
cm
->
global_motion
[
rf
[
0
]],
cm
->
allow_high_precision_mv
,
bsize
,
...
...
@@ -900,24 +875,14 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
bsize
,
mi_col
,
mi_row
,
0
)
.
as_int
:
0
;
#else
zeromv
[
0
].
as_int
=
gm_get_motion_vector
(
&
cm
->
global_motion
[
ref_frame
],
cm
->
allow_high_precision_mv
,
bsize
,
mi_col
,
mi_row
,
0
)
.
as_int
;
zeromv
[
1
].
as_int
=
0
;
#endif // CONFIG_REF_MV
#else
zeromv
[
0
].
as_int
=
zeromv
[
1
].
as_int
=
0
;
#endif // CONFIG_GLOBAL_MOTION
#if CONFIG_REF_MV
if
(
ref_frame
<=
ALTREF_FRAME
)
#endif // CONFIG_REF_MV
find_mv_refs_idx
(
cm
,
xd
,
mi
,
ref_frame
,
mv_ref_list
,
-
1
,
mi_row
,
mi_col
,
sync
,
data
,
mode_context
,
zeromv
[
0
]);
#if CONFIG_REF_MV
setup_ref_mv_list
(
cm
,
xd
,
ref_frame
,
ref_mv_count
,
ref_mv_stack
,
mv_ref_list
,
-
1
,
mi_row
,
mi_col
,
mode_context
);
/* Note: If global motion is enabled, then we want to set the ALL_ZERO flag
...
...
@@ -947,7 +912,6 @@ void av1_find_mv_refs(const AV1_COMMON *cm, const MACROBLOCKD *xd,
}
if
(
all_zero
)
mode_context
[
ref_frame
]
|=
(
1
<<
ALL_ZERO_FLAG_OFFSET
);
#endif
}
void
av1_find_best_ref_mvs
(
int
allow_hp
,
int_mv
*
mvlist
,
int_mv
*
nearest_mv
,
...
...
@@ -963,10 +927,8 @@ void av1_find_best_ref_mvs(int allow_hp, int_mv *mvlist, int_mv *nearest_mv,
void
av1_append_sub8x8_mvs_for_idx
(
const
AV1_COMMON
*
cm
,
MACROBLOCKD
*
xd
,
int
block
,
int
ref
,
int
mi_row
,
int
mi_col
,
#if CONFIG_REF_MV
CANDIDATE_MV
*
ref_mv_stack
,
uint8_t
*
ref_mv_count
,
#endif
#if CONFIG_EXT_INTER
int_mv
*
mv_list
,
#endif // CONFIG_EXT_INTER
...
...
@@ -978,13 +940,11 @@ void av1_append_sub8x8_mvs_for_idx(const AV1_COMMON *cm, MACROBLOCKD *xd,
b_mode_info
*
bmi
=
mi
->
bmi
;
int
n
;
int_mv
zeromv
;
#if CONFIG_REF_MV
CANDIDATE_MV
tmp_mv
;
uint8_t
idx
;
uint8_t
above_count
=
0
,
left_count
=
0
;
MV_REFERENCE_FRAME
rf
[
2
]
=
{
mi
->
mbmi
.
ref_frame
[
ref
],
NONE_FRAME
};
*
ref_mv_count
=
0
;
#endif
assert
(
MAX_MV_REF_CANDIDATES
==
2
);
...
...
@@ -999,7 +959,6 @@ void av1_append_sub8x8_mvs_for_idx(const AV1_COMMON *cm, MACROBLOCKD *xd,
find_mv_refs_idx
(
cm
,
xd
,
mi
,
mi
->
mbmi
.
ref_frame
[
ref
],
mv_list
,
block
,
mi_row
,
mi_col
,
NULL
,
NULL
,
NULL
,
zeromv
);
#if CONFIG_REF_MV
scan_blk_mbmi
(
cm
,
xd
,
mi_row
,
mi_col
,
block
,
rf
,
-
1
,
0
,
ref_mv_stack
,
ref_mv_count
);
above_count
=
*
ref_mv_count
;
...
...
@@ -1020,7 +979,6 @@ void av1_append_sub8x8_mvs_for_idx(const AV1_COMMON *cm, MACROBLOCKD *xd,
for
(
idx
=
0
;
idx
<
AOMMIN
(
MAX_MV_REF_CANDIDATES
,
*
ref_mv_count
);
++
idx
)
mv_list
[
idx
].
as_int
=
ref_mv_stack
[
idx
].
this_mv
.
as_int
;
#endif
near_mv
->
as_int
=
0
;
switch
(
block
)
{
...
...
av1/common/mvref_common.h
View file @
e140c508
...
...
@@ -18,11 +18,7 @@
extern
"C"
{
#endif
#if CONFIG_REF_MV
#define MVREF_NEIGHBOURS 9
#else
#define MVREF_NEIGHBOURS 8
#endif
typedef
struct
position
{
int
row
;
...
...
@@ -109,158 +105,6 @@ static const int counter_to_context[19] = {
BOTH_INTRA
// 18
};
#if !CONFIG_REF_MV
static
const
POSITION
mv_ref_blocks
[
BLOCK_SIZES
][
MVREF_NEIGHBOURS
]
=
{
// 4X4
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
-
1
},
{
-
2
,
0
},
{
0
,
-
2
},
{
-
2
,
-
1
},
{
-
1
,
-
2
},
{
-
2
,
-
2
}
},
// 4X8
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
-
1
},
{
-
2
,
0
},
{
0
,
-
2
},
{
-
2
,
-
1
},
{
-
1
,
-
2
},
{
-
2
,
-
2
}
},
// 8X4
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
-
1
},
{
-
2
,
0
},
{
0
,
-
2
},
{
-
2
,
-
1
},
{
-
1
,
-
2
},
{
-
2
,
-
2
}
},
// 8X8
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
-
1
},
{
-
2
,
0
},
{
0
,
-
2
},
{
-
2
,
-
1
},
{
-
1
,
-
2
},
{
-
2
,
-
2
}
},
// 8X16
{
{
0
,
-
1
},
{
-
1
,
0
},
{
1
,
-
1
},
{
-
1
,
-
1
},
{
0
,
-
2
},
{
-
2
,
0
},
{
-
2
,
-
1
},
{
-
1
,
-
2
}
},
// 16X8
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
1
},
{
-
1
,
-
1
},
{
-
2
,
0
},
{
0
,
-
2
},
{
-
1
,
-
2
},
{
-
2
,
-
1
}
},
// 16X16
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
1
},
{
1
,
-
1
},
{
-
1
,
-
1
},
{
-
3
,
0
},
{
0
,
-
3
},
{
-
3
,
-
3
}
},
// 16X32
{
{
0
,
-
1
},
{
-
1
,
0
},
{
2
,
-
1
},
{
-
1
,
-
1
},
{
-
1
,
1
},
{
0
,
-
3
},
{
-
3
,
0
},
{
-
3
,
-
3
}
},
// 32X16
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
2
},
{
-
1
,
-
1
},
{
1
,
-
1
},
{
-
3
,
0
},
{
0
,
-
3
},
{
-
3
,
-
3
}
},
// 32X32
{
{
-
1
,
1
},
{
1
,
-
1
},
{
-
1
,
2
},
{
2
,
-
1
},
{
-
1
,
-
1
},
{
-
3
,
0
},
{
0
,
-
3
},
{
-
3
,
-
3
}
},
// 32X64
{
{
0
,
-
1
},
{
-
1
,
0
},
{
4
,
-
1
},
{
-
1
,
2
},
{
-
1
,
-
1
},
{
0
,
-
3
},
{
-
3
,
0
},
{
2
,
-
1
}
},
// 64X32
{
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
4
},
{
2
,
-
1
},
{
-
1
,
-
1
},
{
-
3
,
0
},
{
0
,
-
3
},
{
-
1
,
2
}
},
// 64X64
{
{
-
1
,
3
},
{
3
,
-
1
},
{
-
1
,
4
},
{
4
,
-
1
},
{
-
1
,
-
1
},
{
-
1
,
0
},
{
0
,
-
1
},
{
-
1
,
6
}
},
#if CONFIG_EXT_PARTITION
// TODO(debargha/jingning) Making them twice the 32x64, .. ones above
// 64x128
{
{
0
,
-
2
},
{
-
2
,
0
},
{
8
,
-
2
},
{
-
2
,
4
},
{
-
2
,
-
2
},
{
0
,
-
6
},
{
-
6
,
0
},
{
4
,
-
2
}
},
// 128x64
{
{
-
2
,
0
},
{
0
,
-
2
},
{
-
2
,
8
},
{
4
,
-
2
},
{
-
2
,
-
2
},
{
-
6
,
0
},