Skip to content
GitLab
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
829ec56b
Commit
829ec56b
authored
Dec 18, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Dec 18, 2013
Browse files
Merge "Reusing FRAME_COUNTS in the encoder."
parents
dc2c62eb
1d23a659
Changes
4
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_bitstream.c
View file @
829ec56b
...
...
@@ -1256,23 +1256,23 @@ static size_t write_compressed_header(VP9_COMP *cpi, uint8_t *data) {
if
(
use_hybrid_pred
)
for
(
i
=
0
;
i
<
COMP_INTER_CONTEXTS
;
i
++
)
vp9_cond_prob_diff_update
(
&
header_bc
,
&
fc
->
comp_inter_prob
[
i
],
c
pi
->
comp_inter
_count
[
i
]);
c
m
->
counts
.
comp_inter
[
i
]);
}
}
if
(
cm
->
reference_mode
!=
COMPOUND_REFERENCE
)
{
for
(
i
=
0
;
i
<
REF_CONTEXTS
;
i
++
)
{
vp9_cond_prob_diff_update
(
&
header_bc
,
&
fc
->
single_ref_prob
[
i
][
0
],
c
pi
->
single_ref
_count
[
i
][
0
]);
c
m
->
counts
.
single_ref
[
i
][
0
]);
vp9_cond_prob_diff_update
(
&
header_bc
,
&
fc
->
single_ref_prob
[
i
][
1
],
c
pi
->
single_ref
_count
[
i
][
1
]);
c
m
->
counts
.
single_ref
[
i
][
1
]);
}
}
if
(
cm
->
reference_mode
!=
SINGLE_REFERENCE
)
for
(
i
=
0
;
i
<
REF_CONTEXTS
;
i
++
)
vp9_cond_prob_diff_update
(
&
header_bc
,
&
fc
->
comp_ref_prob
[
i
],
c
pi
->
comp_ref
_count
[
i
]);
c
m
->
co
unts
.
co
mp_ref
[
i
]);
for
(
i
=
0
;
i
<
BLOCK_SIZE_GROUPS
;
++
i
)
prob_diff_update
(
vp9_intra_mode_tree
,
cm
->
fc
.
y_mode_prob
[
i
],
...
...
vp9/encoder/vp9_encodeframe.c
View file @
829ec56b
...
...
@@ -762,17 +762,17 @@ static void update_stats(VP9_COMP *cpi) {
// the reference frame counts used to work out probabilities.
if
(
is_inter_block
(
mbmi
)
&&
!
seg_ref_active
)
{
if
(
cm
->
reference_mode
==
REFERENCE_MODE_SELECT
)
c
pi
->
comp_inter
_count
[
vp9_get_reference_mode_context
(
cm
,
xd
)]
c
m
->
counts
.
comp_inter
[
vp9_get_reference_mode_context
(
cm
,
xd
)]
[
has_second_ref
(
mbmi
)]
++
;
if
(
has_second_ref
(
mbmi
))
{
c
pi
->
comp_ref
_count
[
vp9_get_pred_context_comp_ref_p
(
cm
,
xd
)]
c
m
->
co
unts
.
co
mp_ref
[
vp9_get_pred_context_comp_ref_p
(
cm
,
xd
)]
[
mbmi
->
ref_frame
[
0
]
==
GOLDEN_FRAME
]
++
;
}
else
{
c
pi
->
single_ref
_count
[
vp9_get_pred_context_single_ref_p1
(
xd
)][
0
]
c
m
->
counts
.
single_ref
[
vp9_get_pred_context_single_ref_p1
(
xd
)][
0
]
[
mbmi
->
ref_frame
[
0
]
!=
LAST_FRAME
]
++
;
if
(
mbmi
->
ref_frame
[
0
]
!=
LAST_FRAME
)
c
pi
->
single_ref
_count
[
vp9_get_pred_context_single_ref_p2
(
xd
)][
1
]
c
m
->
counts
.
single_ref
[
vp9_get_pred_context_single_ref_p2
(
xd
)][
1
]
[
mbmi
->
ref_frame
[
0
]
!=
GOLDEN_FRAME
]
++
;
}
}
...
...
@@ -2011,9 +2011,9 @@ static void init_encode_frame_mb_context(VP9_COMP *cpi) {
vp9_zero
(
cm
->
counts
.
inter_mode
);
vp9_zero
(
cm
->
counts
.
partition
);
vp9_zero
(
cpi
->
intra_inter_count
);
vp9_zero
(
c
pi
->
comp_inter
_count
);
vp9_zero
(
c
pi
->
single_ref
_count
);
vp9_zero
(
c
pi
->
comp_ref
_count
);
vp9_zero
(
c
m
->
counts
.
comp_inter
);
vp9_zero
(
c
m
->
counts
.
single_ref
);
vp9_zero
(
c
m
->
co
unts
.
co
mp_ref
);
vp9_zero
(
cm
->
counts
.
tx
);
vp9_zero
(
cm
->
counts
.
mbskip
);
...
...
@@ -2431,16 +2431,16 @@ void vp9_encode_frame(VP9_COMP *cpi) {
int
comp_count_zero
=
0
;
for
(
i
=
0
;
i
<
COMP_INTER_CONTEXTS
;
i
++
)
{
single_count_zero
+=
c
pi
->
comp_inter
_count
[
i
][
0
];
comp_count_zero
+=
c
pi
->
comp_inter
_count
[
i
][
1
];
single_count_zero
+=
c
m
->
counts
.
comp_inter
[
i
][
0
];
comp_count_zero
+=
c
m
->
counts
.
comp_inter
[
i
][
1
];
}
if
(
comp_count_zero
==
0
)
{
cpi
->
common
.
reference_mode
=
SINGLE_REFERENCE
;
vp9_zero
(
c
pi
->
comp_inter
_count
);
vp9_zero
(
c
m
->
counts
.
comp_inter
);
}
else
if
(
single_count_zero
==
0
)
{
cpi
->
common
.
reference_mode
=
COMPOUND_REFERENCE
;
vp9_zero
(
c
pi
->
comp_inter
_count
);
vp9_zero
(
c
m
->
counts
.
comp_inter
);
}
}
...
...
vp9/encoder/vp9_onyx_if.c
View file @
829ec56b
...
...
@@ -3089,9 +3089,6 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
vp9_copy
(
counts
->
y_mode
,
cpi
->
y_mode_count
);
vp9_copy
(
counts
->
uv_mode
,
cpi
->
y_uv_mode_count
);
vp9_copy
(
counts
->
intra_inter
,
cpi
->
intra_inter_count
);
vp9_copy
(
counts
->
comp_inter
,
cpi
->
comp_inter_count
);
vp9_copy
(
counts
->
single_ref
,
cpi
->
single_ref_count
);
vp9_copy
(
counts
->
comp_ref
,
cpi
->
comp_ref_count
);
if
(
!
cpi
->
common
.
error_resilient_mode
&&
!
cpi
->
common
.
frame_parallel_decoding_mode
)
{
vp9_adapt_mode_probs
(
&
cpi
->
common
);
...
...
vp9/encoder/vp9_onyx_int.h
View file @
829ec56b
...
...
@@ -432,9 +432,6 @@ typedef struct VP9_COMP {
int64_t
rd_comp_pred_diff
[
REFERENCE_MODES
];
int64_t
rd_prediction_type_threshes
[
4
][
REFERENCE_MODES
];
unsigned
int
intra_inter_count
[
INTRA_INTER_CONTEXTS
][
2
];
unsigned
int
comp_inter_count
[
COMP_INTER_CONTEXTS
][
2
];
unsigned
int
single_ref_count
[
REF_CONTEXTS
][
2
][
2
];
unsigned
int
comp_ref_count
[
REF_CONTEXTS
][
2
];
int64_t
rd_tx_select_diff
[
TX_MODES
];
// FIXME(rbultje) can this overflow?
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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