Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
289be521
Commit
289be521
authored
12 years ago
by
Paul Wilkins
Committed by
On2 (Google) Code Review
12 years ago
Browse files
Options
Download
Plain Diff
Merge "Experimental change to two pass prediction decay calculation." into experimental
parents
e9818bb6
f63894f6
v1.14.0-linphone
1.4.X
experimental
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m29-baseline
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
stable-vp9-decoder
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
vp9-preview
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
v1.3.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp8/encoder/firstpass.c
+29
-32
vp8/encoder/firstpass.c
with
29 additions
and
32 deletions
vp8/encoder/firstpass.c
+
29
−
32
View file @
289be521
...
...
@@ -50,11 +50,11 @@ extern void vp8cx_frame_init_quantizer(VP8_COMP *cpi);
extern
void
vp8_set_mbmode_and_mvs
(
MACROBLOCK
*
x
,
MB_PREDICTION_MODE
mb
,
int_mv
*
mv
);
extern
void
vp8_alloc_compressor_data
(
VP8_COMP
*
cpi
);
#define IIFACTOR
9.37
5
#define IIKFACTOR1
8.7
5
#define IIKFACTOR2
9.37
5
#define RMAX
87.5
#define GF_RMAX
300
.0
#define IIFACTOR
12.
5
#define IIKFACTOR1
12.
5
#define IIKFACTOR2
12.
5
#define RMAX
96.0
#define GF_RMAX
96
.0
#define ERR_DIVISOR 150.0
#define KF_MB_INTRA_MIN 300
...
...
@@ -1033,7 +1033,7 @@ static int estimate_max_q(VP8_COMP *cpi,
// Error per MB based correction factor
err_correction_factor
=
calc_correction_factor
(
cpi
,
fpstats
,
err_per_mb
,
ERR_DIVISOR
,
0
.
36
,
0
.
90
,
Q
)
*
ERR_DIVISOR
,
0
.
40
,
0
.
90
,
Q
)
*
speed_correction
*
cpi
->
twopass
.
est_max_qcorrection_factor
*
cpi
->
twopass
.
section_max_qfactor
;
...
...
@@ -1137,14 +1137,15 @@ static int estimate_cq( VP8_COMP *cpi,
// Error per MB based correction factor
err_correction_factor
=
calc_correction_factor
(
cpi
,
fpstats
,
err_per_mb
,
100
.
0
,
0
.
36
,
0
.
90
,
Q
);
100
.
0
,
0
.
40
,
0
.
90
,
Q
)
*
speed_correction
*
clip_iifactor
;
bits_per_mb_at_this_q
=
vp8_bits_per_mb
(
INTER_FRAME
,
Q
)
+
overhead_bits_per_mb
;
bits_per_mb_at_this_q
=
(
int
)(
.
5
+
err_correction_factor
*
speed_correction
*
clip_iifactor
*
(
double
)
bits_per_mb_at_this_q
);
// Mode and motion overhead
...
...
@@ -1258,33 +1259,29 @@ void vp8_end_second_pass(VP8_COMP *cpi)
static
double
get_prediction_decay_rate
(
VP8_COMP
*
cpi
,
FIRSTPASS_STATS
*
next_frame
)
{
double
prediction_decay_rate
;
double
second_ref_decay
;
double
motion_decay
;
double
motion_pct
=
next_frame
->
pcnt_motion
;
double
mb_sr_err_diff
;
// Initial basis is the % mbs inter coded
prediction_decay_rate
=
next_frame
->
pcnt_inter
;
// High % motion -> somewhat higher decay rate
motion_decay
=
(
1
.
0
-
(
motion_pct
/
20
.
0
));
if
(
motion_decay
<
prediction_decay_rate
)
prediction_decay_rate
=
motion_decay
;
// Adjustment to decay rate based on speed of motion
{
double
this_mv_rabs
;
double
this_mv_cabs
;
double
distance_factor
;
this_mv_rabs
=
fabs
(
next_frame
->
mvr_abs
*
motion_pct
);
this_mv_cabs
=
fabs
(
next_frame
->
mvc_abs
*
motion_pct
);
distance_factor
=
sqrt
((
this_mv_rabs
*
this_mv_rabs
)
+
(
this_mv_cabs
*
this_mv_cabs
))
/
250
.
0
;
distance_factor
=
((
distance_factor
>
1
.
0
)
?
0
.
0
:
(
1
.
0
-
distance_factor
));
if
(
distance_factor
<
prediction_decay_rate
)
prediction_decay_rate
=
distance_factor
;
}
prediction_decay_rate
=
pow
(
next_frame
->
pcnt_inter
,
0
.
5
);
// Look at the observed drop in prediction quality between the last frame
// and the GF buffer (which contains an older frame).
mb_sr_err_diff
=
(
next_frame
->
sr_coded_error
-
next_frame
->
coded_error
)
/
(
cpi
->
common
.
MBs
);
second_ref_decay
=
1
.
0
-
(
mb_sr_err_diff
/
512
.
0
);
second_ref_decay
=
pow
(
second_ref_decay
,
0
.
5
);
if
(
second_ref_decay
<
prediction_decay_rate
)
prediction_decay_rate
=
second_ref_decay
;
if
(
prediction_decay_rate
<
0
.
85
)
prediction_decay_rate
=
0
.
85
;
else
if
(
prediction_decay_rate
>
1
.
0
)
prediction_decay_rate
=
1
.
0
;
return
prediction_decay_rate
;
}
...
...
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets