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
a2517555
Commit
a2517555
authored
Aug 15, 2014
by
Marco
Committed by
Gerrit Code Review
Aug 15, 2014
Browse files
Merge "vp8: Modify to use closest reference in zero_mv bias."
parents
2bfbe9a8
21a0dade
Changes
3
Hide whitespace changes
Inline
Side-by-side
vp8/encoder/onyx_if.c
View file @
a2517555
...
...
@@ -3150,10 +3150,8 @@ static void update_reference_frames(VP8_COMP *cpi)
cm
->
alt_fb_idx
=
cm
->
gld_fb_idx
=
cm
->
new_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
GOLDEN_FRAME
]
=
cm
->
current_video_frame
;
cpi
->
current_ref_frames
[
ALTREF_FRAME
]
=
cm
->
current_video_frame
;
#endif
}
else
/* For non key frames */
{
...
...
@@ -3165,9 +3163,7 @@ static void update_reference_frames(VP8_COMP *cpi)
cm
->
yv12_fb
[
cm
->
alt_fb_idx
].
flags
&=
~
VP8_ALTR_FRAME
;
cm
->
alt_fb_idx
=
cm
->
new_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
ALTREF_FRAME
]
=
cm
->
current_video_frame
;
#endif
}
else
if
(
cm
->
copy_buffer_to_arf
)
{
...
...
@@ -3181,10 +3177,8 @@ static void update_reference_frames(VP8_COMP *cpi)
yv12_fb
[
cm
->
alt_fb_idx
].
flags
&=
~
VP8_ALTR_FRAME
;
cm
->
alt_fb_idx
=
cm
->
lst_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
ALTREF_FRAME
]
=
cpi
->
current_ref_frames
[
LAST_FRAME
];
#endif
}
}
else
/* if (cm->copy_buffer_to_arf == 2) */
...
...
@@ -3195,10 +3189,8 @@ static void update_reference_frames(VP8_COMP *cpi)
yv12_fb
[
cm
->
alt_fb_idx
].
flags
&=
~
VP8_ALTR_FRAME
;
cm
->
alt_fb_idx
=
cm
->
gld_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
ALTREF_FRAME
]
=
cpi
->
current_ref_frames
[
GOLDEN_FRAME
];
#endif
}
}
}
...
...
@@ -3211,9 +3203,7 @@ static void update_reference_frames(VP8_COMP *cpi)
cm
->
yv12_fb
[
cm
->
gld_fb_idx
].
flags
&=
~
VP8_GOLD_FRAME
;
cm
->
gld_fb_idx
=
cm
->
new_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
GOLDEN_FRAME
]
=
cm
->
current_video_frame
;
#endif
}
else
if
(
cm
->
copy_buffer_to_gf
)
{
...
...
@@ -3227,10 +3217,8 @@ static void update_reference_frames(VP8_COMP *cpi)
yv12_fb
[
cm
->
gld_fb_idx
].
flags
&=
~
VP8_GOLD_FRAME
;
cm
->
gld_fb_idx
=
cm
->
lst_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
GOLDEN_FRAME
]
=
cpi
->
current_ref_frames
[
LAST_FRAME
];
#endif
}
}
else
/* if (cm->copy_buffer_to_gf == 2) */
...
...
@@ -3241,10 +3229,8 @@ static void update_reference_frames(VP8_COMP *cpi)
yv12_fb
[
cm
->
gld_fb_idx
].
flags
&=
~
VP8_GOLD_FRAME
;
cm
->
gld_fb_idx
=
cm
->
alt_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
GOLDEN_FRAME
]
=
cpi
->
current_ref_frames
[
ALTREF_FRAME
];
#endif
}
}
}
...
...
@@ -3256,9 +3242,7 @@ static void update_reference_frames(VP8_COMP *cpi)
cm
->
yv12_fb
[
cm
->
lst_fb_idx
].
flags
&=
~
VP8_LAST_FRAME
;
cm
->
lst_fb_idx
=
cm
->
new_fb_idx
;
#if CONFIG_MULTI_RES_ENCODING
cpi
->
current_ref_frames
[
LAST_FRAME
]
=
cm
->
current_video_frame
;
#endif
}
#if CONFIG_TEMPORAL_DENOISING
...
...
@@ -3494,6 +3478,31 @@ static void encode_frame_to_data_rate
}
#endif
// Find the reference frame closest to the current frame.
cpi
->
closest_reference_frame
=
LAST_FRAME
;
if
(
cm
->
frame_type
!=
KEY_FRAME
)
{
int
i
;
MV_REFERENCE_FRAME
closest_ref
=
INTRA_FRAME
;
if
(
cpi
->
ref_frame_flags
&
VP8_LAST_FRAME
)
{
closest_ref
=
LAST_FRAME
;
}
else
if
(
cpi
->
ref_frame_flags
&
VP8_GOLD_FRAME
)
{
closest_ref
=
GOLDEN_FRAME
;
}
else
if
(
cpi
->
ref_frame_flags
&
VP8_ALTR_FRAME
)
{
closest_ref
=
ALTREF_FRAME
;
}
for
(
i
=
1
;
i
<=
3
;
i
++
)
{
vpx_ref_frame_type_t
ref_frame_type
=
(
vpx_ref_frame_type_t
)
((
i
==
3
)
?
4
:
i
);
if
(
cpi
->
ref_frame_flags
&
ref_frame_type
)
{
if
((
cm
->
current_video_frame
-
cpi
->
current_ref_frames
[
i
])
<
(
cm
->
current_video_frame
-
cpi
->
current_ref_frames
[
closest_ref
]))
{
closest_ref
=
i
;
}
}
}
cpi
->
closest_reference_frame
=
closest_ref
;
}
/* Set various flags etc to special state if it is a key frame */
if
(
cm
->
frame_type
==
KEY_FRAME
)
{
...
...
@@ -4420,7 +4429,8 @@ static void encode_frame_to_data_rate
{
for
(
mb_col
=
0
;
mb_col
<
cm
->
mb_cols
;
mb_col
++
)
{
if
(
tmp
->
mbmi
.
mode
==
ZEROMV
)
if
(
tmp
->
mbmi
.
mode
==
ZEROMV
&&
tmp
->
mbmi
.
ref_frame
==
LAST_FRAME
)
cpi
->
zeromv_count
++
;
tmp
++
;
}
...
...
vp8/encoder/onyx_int.h
View file @
a2517555
...
...
@@ -684,9 +684,10 @@ typedef struct VP8_COMP
int
mr_low_res_mb_cols
;
/* Indicate if lower-res mv info is available */
unsigned
char
mr_low_res_mv_avail
;
#endif
/* The frame number of each reference frames */
unsigned
int
current_ref_frames
[
MAX_REF_FRAMES
];
#endif
MV_REFERENCE_FRAME
closest_reference_frame
;
struct
rd_costs_struct
{
...
...
vp8/encoder/pickinter.c
View file @
a2517555
...
...
@@ -505,16 +505,11 @@ static int evaluate_inter_mode(unsigned int* sse, int rate2, int* distortion2,
this_rd
=
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
rate2
,
*
distortion2
);
/* Adjust rd to bias to ZEROMV */
if
(
this_mode
==
ZEROMV
)
// Adjust rd for ZEROMV and LAST, if LAST is the closest reference frame.
if
(
this_mode
==
ZEROMV
&&
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
==
LAST_FRAME
&&
cpi
->
closest_reference_frame
==
LAST_FRAME
)
{
/* Bias to ZEROMV on LAST_FRAME reference when it is available. */
if
((
cpi
->
ref_frame_flags
&
VP8_LAST_FRAME
&
cpi
->
common
.
refresh_last_frame
)
&&
x
->
e_mbd
.
mode_info_context
->
mbmi
.
ref_frame
!=
LAST_FRAME
)
rd_adj
=
100
;
// rd_adj <= 100
this_rd
=
((
int64_t
)
this_rd
)
*
rd_adj
/
100
;
}
...
...
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