Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
9d0c03d6
Commit
9d0c03d6
authored
Dec 27, 2017
by
Hui Su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove probablity model for the comp_inter flag
Change-Id: I7c7f193dea8e99be31d048b3fe2b198887a52822
parent
5ef90ceb
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
40 deletions
+27
-40
av1/common/entropymode.c
av1/common/entropymode.c
+0
-9
av1/common/entropymode.h
av1/common/entropymode.h
+2
-1
av1/common/pred_common.h
av1/common/pred_common.h
+0
-4
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+0
-2
av1/decoder/decodemv.c
av1/decoder/decodemv.c
+0
-2
av1/encoder/block.h
av1/encoder/block.h
+1
-0
av1/encoder/encodeframe.c
av1/encoder/encodeframe.c
+8
-3
av1/encoder/rd.c
av1/encoder/rd.c
+5
-0
av1/encoder/rdopt.c
av1/encoder/rdopt.c
+11
-19
No files found.
av1/common/entropymode.c
View file @
9d0c03d6
...
...
@@ -1397,10 +1397,6 @@ static const aom_cdf_prob default_intra_inter_cdf[INTRA_INTER_CONTEXTS]
{
AOM_CDF2
(
26240
)
}
};
static
const
aom_prob
default_comp_inter_p
[
COMP_INTER_CONTEXTS
]
=
{
190
,
156
,
91
,
77
,
22
};
static
const
aom_cdf_prob
default_comp_inter_cdf
[
COMP_INTER_CONTEXTS
][
CDF_SIZE
(
2
)]
=
{
{
AOM_CDF2
(
24290
)
},
{
AOM_CDF2
(
19956
)
},
...
...
@@ -3302,7 +3298,6 @@ static const aom_cdf_prob default_angle_delta_cdf[DIRECTIONAL_MODES][CDF_SIZE(
#endif // CONFIG_EXT_INTRA_MOD
static
void
init_mode_probs
(
FRAME_CONTEXT
*
fc
)
{
av1_copy
(
fc
->
comp_inter_prob
,
default_comp_inter_p
);
av1_copy
(
fc
->
palette_y_size_cdf
,
default_palette_y_size_cdf
);
av1_copy
(
fc
->
palette_uv_size_cdf
,
default_palette_uv_size_cdf
);
av1_copy
(
fc
->
palette_y_color_index_cdf
,
default_palette_y_color_index_cdf
);
...
...
@@ -3417,10 +3412,6 @@ void av1_adapt_inter_frame_probs(AV1_COMMON *cm) {
const
FRAME_CONTEXT
*
pre_fc
=
cm
->
pre_fc
;
const
FRAME_COUNTS
*
counts
=
&
cm
->
counts
;
for
(
i
=
0
;
i
<
COMP_INTER_CONTEXTS
;
i
++
)
fc
->
comp_inter_prob
[
i
]
=
av1_mode_mv_merge_probs
(
pre_fc
->
comp_inter_prob
[
i
],
counts
->
comp_inter
[
i
]);
#if CONFIG_EXT_COMP_REFS
for
(
i
=
0
;
i
<
COMP_REF_TYPE_CONTEXTS
;
i
++
)
fc
->
comp_ref_type_prob
[
i
]
=
av1_mode_mv_merge_probs
(
...
...
av1/common/entropymode.h
View file @
9d0c03d6
...
...
@@ -147,7 +147,6 @@ typedef struct frame_contexts {
[
CDF_SIZE
(
INTERINTRA_MODES
)];
aom_cdf_prob
motion_mode_cdf
[
BLOCK_SIZES_ALL
][
CDF_SIZE
(
MOTION_MODES
)];
aom_cdf_prob
obmc_cdf
[
BLOCK_SIZES_ALL
][
CDF_SIZE
(
2
)];
aom_prob
comp_inter_prob
[
COMP_INTER_CONTEXTS
];
aom_cdf_prob
palette_y_size_cdf
[
PALATTE_BSIZE_CTXS
][
CDF_SIZE
(
PALETTE_SIZES
)];
aom_cdf_prob
palette_uv_size_cdf
[
PALATTE_BSIZE_CTXS
][
CDF_SIZE
(
PALETTE_SIZES
)];
aom_cdf_prob
palette_y_color_index_cdf
[
PALETTE_SIZES
]
...
...
@@ -320,7 +319,9 @@ typedef struct FRAME_COUNTS {
unsigned
int
motion_mode
[
BLOCK_SIZES_ALL
][
MOTION_MODES
];
unsigned
int
obmc
[
BLOCK_SIZES_ALL
][
2
];
unsigned
int
intra_inter
[
INTRA_INTER_CONTEXTS
][
2
];
#if CONFIG_ENTROPY_STATS
unsigned
int
comp_inter
[
COMP_INTER_CONTEXTS
][
2
];
#endif // CONFIG_ENTROPY_STATS
#if CONFIG_EXT_COMP_REFS
unsigned
int
comp_ref_type
[
COMP_REF_TYPE_CONTEXTS
][
2
];
unsigned
int
uni_comp_ref
[
UNI_COMP_REF_CONTEXTS
][
UNIDIR_COMP_REFS
-
1
][
2
];
...
...
av1/common/pred_common.h
View file @
9d0c03d6
...
...
@@ -192,10 +192,6 @@ int av1_get_intra_inter_context(const MACROBLOCKD *xd);
int
av1_get_reference_mode_context
(
const
AV1_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
);
static
INLINE
aom_prob
av1_get_reference_mode_prob
(
const
AV1_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
cm
->
fc
->
comp_inter_prob
[
av1_get_reference_mode_context
(
cm
,
xd
)];
}
static
INLINE
aom_cdf_prob
*
av1_get_reference_mode_cdf
(
const
AV1_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
)
{
return
xd
->
tile_ctx
->
comp_inter_cdf
[
av1_get_reference_mode_context
(
cm
,
xd
)];
...
...
av1/decoder/decodeframe.c
View file @
9d0c03d6
...
...
@@ -3137,8 +3137,6 @@ static void debug_check_frame_counts(const AV1_COMMON *const cm) {
sizeof
(
cm
->
counts
.
motion_mode
)));
assert
(
!
memcmp
(
cm
->
counts
.
intra_inter
,
zero_counts
.
intra_inter
,
sizeof
(
cm
->
counts
.
intra_inter
)));
assert
(
!
memcmp
(
cm
->
counts
.
comp_inter
,
zero_counts
.
comp_inter
,
sizeof
(
cm
->
counts
.
comp_inter
)));
#if CONFIG_EXT_COMP_REFS
assert
(
!
memcmp
(
cm
->
counts
.
comp_ref_type
,
zero_counts
.
comp_ref_type
,
sizeof
(
cm
->
counts
.
comp_ref_type
)));
...
...
av1/decoder/decodemv.c
View file @
9d0c03d6
...
...
@@ -1268,8 +1268,6 @@ static REFERENCE_MODE read_block_reference_mode(AV1_COMMON *cm,
const
int
ctx
=
av1_get_reference_mode_context
(
cm
,
xd
);
const
REFERENCE_MODE
mode
=
(
REFERENCE_MODE
)
aom_read_symbol
(
r
,
xd
->
tile_ctx
->
comp_inter_cdf
[
ctx
],
2
,
ACCT_STR
);
FRAME_COUNTS
*
counts
=
xd
->
counts
;
if
(
counts
)
++
counts
->
comp_inter
[
ctx
][
mode
];
return
mode
;
// SINGLE_REFERENCE or COMPOUND_REFERENCE
}
else
{
#if CONFIG_REF_ADAPT
...
...
av1/encoder/block.h
View file @
9d0c03d6
...
...
@@ -283,6 +283,7 @@ struct macroblock {
int
refmv_mode_cost
[
REFMV_MODE_CONTEXTS
][
2
];
int
drl_mode_cost0
[
DRL_MODE_CONTEXTS
][
2
];
int
comp_inter_cost
[
COMP_INTER_CONTEXTS
][
2
];
int
inter_compound_mode_cost
[
INTER_MODE_CONTEXTS
][
INTER_COMPOUND_MODES
];
#if CONFIG_JNT_COMP
int
compound_type_cost
[
BLOCK_SIZES_ALL
][
COMPOUND_TYPES
-
1
];
...
...
av1/encoder/encodeframe.c
View file @
9d0c03d6
...
...
@@ -885,8 +885,10 @@ static void update_stats(const AV1_COMMON *const cm, TileDataEnc *tile_data,
rdc
->
single_ref_used_flag
=
1
;
#endif // !CONFIG_REF_ADAPT
if
(
is_comp_ref_allowed
(
bsize
))
{
#if CONFIG_ENTROPY_STATS
counts
->
comp_inter
[
av1_get_reference_mode_context
(
cm
,
xd
)]
[
has_second_ref
(
mbmi
)]
++
;
#endif // CONFIG_ENTROPY_STATS
if
(
allow_update_cdf
)
update_cdf
(
av1_get_reference_mode_cdf
(
cm
,
xd
),
has_second_ref
(
mbmi
),
2
);
...
...
@@ -3906,7 +3908,6 @@ void av1_encode_frame(AV1_COMP *cpi) {
if
(
cpi
->
sf
.
frame_parameter_update
)
{
int
i
;
RD_OPT
*
const
rd_opt
=
&
cpi
->
rd
;
FRAME_COUNTS
*
counts
=
cpi
->
td
.
counts
;
RD_COUNTS
*
const
rdc
=
&
cpi
->
td
.
rd_counts
;
// This code does a single RD pass over the whole frame assuming
...
...
@@ -3961,12 +3962,16 @@ void av1_encode_frame(AV1_COMP *cpi) {
// Use a flag that includes 4x4 blocks
if
(
rdc
->
compound_ref_used_flag
==
0
)
{
cm
->
reference_mode
=
SINGLE_REFERENCE
;
av1_zero
(
counts
->
comp_inter
);
#if CONFIG_ENTROPY_STATS
av1_zero
(
cpi
->
td
.
counts
->
comp_inter
);
#endif // CONFIG_ENTROPY_STATS
#if !CONFIG_REF_ADAPT
// Use a flag that includes 4x4 blocks
}
else
if
(
rdc
->
single_ref_used_flag
==
0
)
{
cm
->
reference_mode
=
COMPOUND_REFERENCE
;
av1_zero
(
counts
->
comp_inter
);
#if CONFIG_ENTROPY_STATS
av1_zero
(
cpi
->
td
.
counts
->
comp_inter
);
#endif // CONFIG_ENTROPY_STATS
#endif // !CONFIG_REF_ADAPT
}
}
...
...
av1/encoder/rd.c
View file @
9d0c03d6
...
...
@@ -226,6 +226,11 @@ void av1_fill_mode_rates(AV1_COMMON *const cm, MACROBLOCK *x,
#endif // CONFIG_INTRABC
if
(
!
frame_is_intra_only
(
cm
))
{
for
(
i
=
0
;
i
<
COMP_INTER_CONTEXTS
;
++
i
)
{
av1_cost_tokens_from_cdf
(
x
->
comp_inter_cost
[
i
],
fc
->
comp_inter_cdf
[
i
],
NULL
);
}
for
(
i
=
0
;
i
<
INTRA_INTER_CONTEXTS
;
++
i
)
{
av1_cost_tokens_from_cdf
(
x
->
intra_inter_cost
[
i
],
fc
->
intra_inter_cdf
[
i
],
NULL
);
...
...
av1/encoder/rdopt.c
View file @
9d0c03d6
...
...
@@ -5785,11 +5785,11 @@ static void estimate_ref_frame_costs(
const AV1_COMMON *cm, const MACROBLOCKD *xd, const MACROBLOCK *x,
int segment_id, unsigned int *ref_costs_single,
#if CONFIG_EXT_COMP_REFS
unsigned int (*ref_costs_comp)[TOTAL_REFS_PER_FRAME]
,
unsigned int (*ref_costs_comp)[TOTAL_REFS_PER_FRAME]
#else
unsigned int *ref_costs_comp
,
unsigned int *ref_costs_comp
#endif // CONFIG_EXT_COMP_REFS
aom_prob *comp_mode_p
) {
) {
int seg_ref_active =
segfeature_active(&cm->seg, segment_id, SEG_LVL_REF_FRAME);
if (seg_ref_active) {
...
...
@@ -5803,19 +5803,9 @@ static void estimate_ref_frame_costs(
#else
memset(ref_costs_comp, 0, TOTAL_REFS_PER_FRAME * sizeof(*ref_costs_comp));
#endif // CONFIG_EXT_COMP_REFS
*comp_mode_p = 128;
} else {
int intra_inter_ctx = av1_get_intra_inter_context(xd);
if (cm->reference_mode == REFERENCE_MODE_SELECT) {
*comp_mode_p = av1_get_reference_mode_prob(cm, xd);
} else {
*comp_mode_p = 128;
}
ref_costs_single[INTRA_FRAME] = x->intra_inter_cost[intra_inter_ctx][0];
unsigned int base_cost = x->intra_inter_cost[intra_inter_ctx][1];
#if !CONFIG_REF_ADAPT
...
...
@@ -8843,7 +8833,8 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
#else
unsigned int ref_costs_comp[TOTAL_REFS_PER_FRAME];
#endif // CONFIG_EXT_COMP_REFS
aom_prob comp_mode_p;
int *comp_inter_cost =
x->comp_inter_cost[av1_get_reference_mode_context(cm, xd)];
int64_t best_intra_rd = INT64_MAX;
unsigned int best_pred_sse = UINT_MAX;
PREDICTION_MODE best_intra_mode = DC_PRED;
...
...
@@ -8927,7 +8918,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
}
estimate_ref_frame_costs(cm, xd, x, segment_id, ref_costs_single,
ref_costs_comp
, &comp_mode_p
);
ref_costs_comp);
for (i = 0; i < REFERENCE_MODES; ++i) best_pred_rd[i] = INT64_MAX;
for (i = 0; i < TX_SIZES_ALL; i++) rate_uv_intra[i] = INT_MAX;
...
...
@@ -9919,7 +9910,7 @@ void av1_rd_pick_inter_mode_sb(const AV1_COMP *cpi, TileDataEnc *tile_data,
if (this_rd == INT64_MAX) continue;
if (is_comp_ref_allowed(mbmi->sb_type))
compmode_cost =
av1_cost_bit(comp_mode_p,
comp_pred
)
;
compmode_cost =
comp_inter_cost[
comp_pred
]
;
if (cm->reference_mode == REFERENCE_MODE_SELECT) rate2 += compmode_cost;
}
...
...
@@ -10567,7 +10558,8 @@ void av1_rd_pick_inter_mode_sb_seg_skip(const AV1_COMP *cpi,
#else
unsigned int ref_costs_comp[TOTAL_REFS_PER_FRAME];
#endif // CONFIG_EXT_COMP_REFS
aom_prob comp_mode_p;
int *comp_inter_cost =
x->comp_inter_cost[av1_get_reference_mode_context(cm, xd)];
InterpFilter best_filter = SWITCHABLE;
int64_t this_rd = INT64_MAX;
int rate2 = 0;
...
...
@@ -10576,7 +10568,7 @@ void av1_rd_pick_inter_mode_sb_seg_skip(const AV1_COMP *cpi,
(void)mi_col;
estimate_ref_frame_costs(cm, xd, x, segment_id, ref_costs_single,
ref_costs_comp
, &comp_mode_p
);
ref_costs_comp);
for (i = 0; i < TOTAL_REFS_PER_FRAME; ++i) x->pred_sse[i] = INT_MAX;
for (i = LAST_FRAME; i < TOTAL_REFS_PER_FRAME; ++i)
...
...
@@ -10657,7 +10649,7 @@ void av1_rd_pick_inter_mode_sb_seg_skip(const AV1_COMP *cpi,
rate2 += av1_get_switchable_rate(cm, x, xd);
if (cm->reference_mode == REFERENCE_MODE_SELECT)
rate2 +=
av1_cost_bit(comp_mode_p,
comp_pred
)
;
rate2 +=
comp_inter_cost[
comp_pred
]
;
// Estimate the reference frame signaling cost and add it
// to the rolling cost variable.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment