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
cac3e158
Commit
cac3e158
authored
11 years ago
by
Jim Bankoski
Browse files
Options
Download
Patches
Plain Diff
cpplint issues in vp9_picklpf.c
Change-Id: I62e631ca95fefbb1a993479a5e3926dc81359fe7
parent
c6960b60
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
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
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
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
vp9/encoder/vp9_picklpf.c
+15
-28
vp9/encoder/vp9_picklpf.c
with
15 additions
and
28 deletions
vp9/encoder/vp9_picklpf.c
+
15
−
28
View file @
cac3e158
...
@@ -54,7 +54,8 @@ static int calc_partial_ssl_err(YV12_BUFFER_CONFIG *source,
...
@@ -54,7 +54,8 @@ static int calc_partial_ssl_err(YV12_BUFFER_CONFIG *source,
src
+=
srcoffset
;
src
+=
srcoffset
;
dst
+=
dstoffset
;
dst
+=
dstoffset
;
// Loop through the Y plane raw and reconstruction data summing (square differences)
// Loop through the raw Y plane and reconstruction data summing the square
// differences.
for
(
i
=
0
;
i
<
linestocopy
;
i
+=
16
)
{
for
(
i
=
0
;
i
<
linestocopy
;
i
+=
16
)
{
for
(
j
=
0
;
j
<
source
->
y_width
;
j
+=
16
)
{
for
(
j
=
0
;
j
<
source
->
y_width
;
j
+=
16
)
{
unsigned
int
sse
;
unsigned
int
sse
;
...
@@ -72,20 +73,6 @@ static int calc_partial_ssl_err(YV12_BUFFER_CONFIG *source,
...
@@ -72,20 +73,6 @@ static int calc_partial_ssl_err(YV12_BUFFER_CONFIG *source,
// Enforce a minimum filter level based upon baseline Q
// Enforce a minimum filter level based upon baseline Q
static
int
get_min_filter_level
(
VP9_COMP
*
cpi
,
int
base_qindex
)
{
static
int
get_min_filter_level
(
VP9_COMP
*
cpi
,
int
base_qindex
)
{
int
min_filter_level
;
int
min_filter_level
;
/*int q = (int) vp9_convert_qindex_to_q(base_qindex);
if (cpi->source_alt_ref_active && cpi->common.refresh_golden_frame && !cpi->common.refresh_alt_ref_frame)
min_filter_level = 0;
else
{
if (q <= 10)
min_filter_level = 0;
else if (q <= 64)
min_filter_level = 1;
else
min_filter_level = (q >> 6);
}
*/
min_filter_level
=
0
;
min_filter_level
=
0
;
return
min_filter_level
;
return
min_filter_level
;
...
@@ -93,11 +80,7 @@ static int get_min_filter_level(VP9_COMP *cpi, int base_qindex) {
...
@@ -93,11 +80,7 @@ static int get_min_filter_level(VP9_COMP *cpi, int base_qindex) {
// Enforce a maximum filter level based upon baseline Q
// Enforce a maximum filter level based upon baseline Q
static
int
get_max_filter_level
(
VP9_COMP
*
cpi
,
int
base_qindex
)
{
static
int
get_max_filter_level
(
VP9_COMP
*
cpi
,
int
base_qindex
)
{
// PGW August 2006: Highest filter values almost always a bad idea
int
max_filter_level
=
MAX_LOOP_FILTER
;
// jbb chg: 20100118 - not so any more with this overquant stuff allow high values
// with lots of intra coming in.
int
max_filter_level
=
MAX_LOOP_FILTER
;
// * 3 / 4;
(
void
)
base_qindex
;
(
void
)
base_qindex
;
if
(
cpi
->
twopass
.
section_intra_rating
>
8
)
if
(
cpi
->
twopass
.
section_intra_rating
>
8
)
...
@@ -128,7 +111,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
...
@@ -128,7 +111,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
int
filt_best
;
int
filt_best
;
int
filt_direction
=
0
;
int
filt_direction
=
0
;
int
Bias
=
0
;
// Bias against raising loop filter
and
in favo
u
r of lowering it
int
Bias
=
0
;
// Bias against raising loop filter in favor of lowering it
.
// Make a copy of the unfiltered / processed recon buffer
// Make a copy of the unfiltered / processed recon buffer
vpx_yv12_copy_y
(
cm
->
frame_to_show
,
&
cpi
->
last_frame_uf
);
vpx_yv12_copy_y
(
cm
->
frame_to_show
,
&
cpi
->
last_frame_uf
);
...
@@ -136,7 +119,8 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
...
@@ -136,7 +119,8 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
lf
->
sharpness_level
=
cm
->
frame_type
==
KEY_FRAME
?
0
lf
->
sharpness_level
=
cm
->
frame_type
==
KEY_FRAME
?
0
:
cpi
->
oxcf
.
Sharpness
;
:
cpi
->
oxcf
.
Sharpness
;
// Start the search at the previous frame filter level unless it is now out of range.
// Start the search at the previous frame filter level unless it is now out of
// range.
filt_mid
=
clamp
(
lf
->
filter_level
,
min_filter_level
,
max_filter_level
);
filt_mid
=
clamp
(
lf
->
filter_level
,
min_filter_level
,
max_filter_level
);
// Define the initial step size
// Define the initial step size
...
@@ -153,9 +137,8 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
...
@@ -153,9 +137,8 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
vpx_yv12_copy_y
(
&
cpi
->
last_frame_uf
,
cm
->
frame_to_show
);
vpx_yv12_copy_y
(
&
cpi
->
last_frame_uf
,
cm
->
frame_to_show
);
while
(
filter_step
>
0
)
{
while
(
filter_step
>
0
)
{
Bias
=
(
best_err
>>
(
15
-
(
filt_mid
/
8
)))
*
filter_step
;
// PGW change 12/12/06 for small images
Bias
=
(
best_err
>>
(
15
-
(
filt_mid
/
8
)))
*
filter_step
;
// jbb chg: 20100118 - in sections with lots of new material coming in don't bias as much to a low filter value
if
(
cpi
->
twopass
.
section_intra_rating
<
20
)
if
(
cpi
->
twopass
.
section_intra_rating
<
20
)
Bias
=
Bias
*
cpi
->
twopass
.
section_intra_rating
/
20
;
Bias
=
Bias
*
cpi
->
twopass
.
section_intra_rating
/
20
;
...
@@ -163,8 +146,12 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
...
@@ -163,8 +146,12 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
if
(
cpi
->
common
.
tx_mode
!=
ONLY_4X4
)
if
(
cpi
->
common
.
tx_mode
!=
ONLY_4X4
)
Bias
>>=
1
;
Bias
>>=
1
;
filt_high
=
((
filt_mid
+
filter_step
)
>
max_filter_level
)
?
max_filter_level
:
(
filt_mid
+
filter_step
);
filt_high
=
((
filt_mid
+
filter_step
)
>
max_filter_level
)
filt_low
=
((
filt_mid
-
filter_step
)
<
min_filter_level
)
?
min_filter_level
:
(
filt_mid
-
filter_step
);
?
max_filter_level
:
(
filt_mid
+
filter_step
);
filt_low
=
((
filt_mid
-
filter_step
)
<
min_filter_level
)
?
min_filter_level
:
(
filt_mid
-
filter_step
);
if
((
filt_direction
<=
0
)
&&
(
filt_low
!=
filt_mid
))
{
if
((
filt_direction
<=
0
)
&&
(
filt_low
!=
filt_mid
))
{
// Get Low filter error score
// Get Low filter error score
...
@@ -176,7 +163,8 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
...
@@ -176,7 +163,8 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
// Re-instate the unfiltered frame
// Re-instate the unfiltered frame
vpx_yv12_copy_y
(
&
cpi
->
last_frame_uf
,
cm
->
frame_to_show
);
vpx_yv12_copy_y
(
&
cpi
->
last_frame_uf
,
cm
->
frame_to_show
);
// If value is close to the best so far then bias towards a lower loop filter value.
// If value is close to the best so far then bias towards a lower loop
// filter value.
if
((
filt_err
-
Bias
)
<
best_err
)
{
if
((
filt_err
-
Bias
)
<
best_err
)
{
// Was it actually better than the previous best?
// Was it actually better than the previous best?
if
(
filt_err
<
best_err
)
if
(
filt_err
<
best_err
)
...
@@ -215,4 +203,3 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
...
@@ -215,4 +203,3 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi, int partial) {
lf
->
filter_level
=
filt_best
;
lf
->
filter_level
=
filt_best
;
}
}
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