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
Guillaume Martres
aom-rav1e
Commits
94800ae0
Commit
94800ae0
authored
Mar 25, 2014
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Mar 25, 2014
Browse files
Merge "Moving setup_{key, inter}_frame() to vp9_onyx_if.c."
parents
0d7ee834
20a40bd0
Changes
3
Hide whitespace changes
Inline
Side-by-side
vp9/encoder/vp9_onyx_if.c
View file @
94800ae0
...
...
@@ -144,6 +144,22 @@ static void set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv) {
}
}
static
void
setup_key_frame
(
VP9_COMP
*
cpi
)
{
vp9_setup_past_independence
(
&
cpi
->
common
);
// All buffers are implicitly updated on key frames.
cpi
->
refresh_golden_frame
=
1
;
cpi
->
refresh_alt_ref_frame
=
1
;
}
static
void
setup_inter_frame
(
VP9_COMMON
*
cm
)
{
if
(
cm
->
error_resilient_mode
||
cm
->
intra_only
)
vp9_setup_past_independence
(
cm
);
assert
(
cm
->
frame_context_idx
<
FRAME_CONTEXTS
);
cm
->
fc
=
cm
->
frame_contexts
[
cm
->
frame_context_idx
];
}
void
vp9_initialize_enc
()
{
static
int
init_done
=
0
;
...
...
@@ -2647,12 +2663,12 @@ static void encode_without_recode_loop(VP9_COMP *cpi,
// other inter-frames the encoder currently uses only two contexts;
// context 1 for ALTREF frames and context 0 for the others.
if
(
cm
->
frame_type
==
KEY_FRAME
)
{
vp9_
setup_key_frame
(
cpi
);
setup_key_frame
(
cpi
);
}
else
{
if
(
!
cm
->
intra_only
&&
!
cm
->
error_resilient_mode
&&
!
cpi
->
use_svc
)
{
if
(
!
cm
->
intra_only
&&
!
cm
->
error_resilient_mode
&&
!
cpi
->
use_svc
)
cpi
->
common
.
frame_context_idx
=
cpi
->
refresh_alt_ref_frame
;
}
vp9_
setup_inter_frame
(
c
pi
);
setup_inter_frame
(
c
m
);
}
// Variance adaptive and in frame q adjustment experiments are mutually
// exclusive.
...
...
@@ -2705,12 +2721,12 @@ static void encode_with_recode_loop(VP9_COMP *cpi,
// other inter-frames the encoder currently uses only two contexts;
// context 1 for ALTREF frames and context 0 for the others.
if
(
cm
->
frame_type
==
KEY_FRAME
)
{
vp9_
setup_key_frame
(
cpi
);
setup_key_frame
(
cpi
);
}
else
{
if
(
!
cm
->
intra_only
&&
!
cm
->
error_resilient_mode
&&
!
cpi
->
use_svc
)
{
if
(
!
cm
->
intra_only
&&
!
cm
->
error_resilient_mode
&&
!
cpi
->
use_svc
)
cpi
->
common
.
frame_context_idx
=
cpi
->
refresh_alt_ref_frame
;
}
vp9_
setup_inter_frame
(
c
pi
);
setup_inter_frame
(
c
m
);
}
}
...
...
@@ -2995,7 +3011,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi,
// Set various flags etc to special state if it is a key frame.
if
(
frame_is_intra_only
(
cm
))
{
vp9_
setup_key_frame
(
cpi
);
setup_key_frame
(
cpi
);
// Reset the loop filter deltas and segmentation map.
vp9_reset_segment_features
(
&
cm
->
seg
);
...
...
vp9/encoder/vp9_ratectrl.c
View file @
94800ae0
...
...
@@ -151,25 +151,6 @@ void vp9_restore_coding_context(VP9_COMP *cpi) {
cm
->
fc
=
cc
->
fc
;
}
void
vp9_setup_key_frame
(
VP9_COMP
*
cpi
)
{
VP9_COMMON
*
cm
=
&
cpi
->
common
;
vp9_setup_past_independence
(
cm
);
/* All buffers are implicitly updated on key frames. */
cpi
->
refresh_golden_frame
=
1
;
cpi
->
refresh_alt_ref_frame
=
1
;
}
void
vp9_setup_inter_frame
(
VP9_COMP
*
cpi
)
{
VP9_COMMON
*
cm
=
&
cpi
->
common
;
if
(
cm
->
error_resilient_mode
||
cm
->
intra_only
)
vp9_setup_past_independence
(
cm
);
assert
(
cm
->
frame_context_idx
<
FRAME_CONTEXTS
);
cm
->
fc
=
cm
->
frame_contexts
[
cm
->
frame_context_idx
];
}
static
int
estimate_bits_at_q
(
int
frame_kind
,
int
q
,
int
mbs
,
double
correction_factor
)
{
const
int
bpm
=
(
int
)(
vp9_rc_bits_per_mb
(
frame_kind
,
q
,
correction_factor
));
...
...
vp9/encoder/vp9_ratectrl.h
View file @
94800ae0
...
...
@@ -87,9 +87,6 @@ struct VP9_COMP;
void
vp9_save_coding_context
(
struct
VP9_COMP
*
cpi
);
void
vp9_restore_coding_context
(
struct
VP9_COMP
*
cpi
);
void
vp9_setup_key_frame
(
struct
VP9_COMP
*
cpi
);
void
vp9_setup_inter_frame
(
struct
VP9_COMP
*
cpi
);
double
vp9_convert_qindex_to_q
(
int
qindex
);
void
vp9_rc_init_minq_luts
();
...
...
Write
Preview
Supports
Markdown
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