Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
d7bbe1a2
Commit
d7bbe1a2
authored
Nov 06, 2015
by
Marco Paniconi
Committed by
Gerrit Code Review
Nov 06, 2015
Browse files
Options
Browse Files
Download
Plain Diff
Merge "vp9: Updates to noise estimation."
parents
892130f7
1c724d01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
vp9/encoder/vp9_noise_estimate.c
vp9/encoder/vp9_noise_estimate.c
+15
-10
No files found.
vp9/encoder/vp9_noise_estimate.c
View file @
d7bbe1a2
...
...
@@ -28,11 +28,11 @@ void vp9_noise_estimate_init(NOISE_ESTIMATE *const ne,
ne
->
level
=
kLow
;
ne
->
value
=
0
;
ne
->
count
=
0
;
ne
->
thresh
=
2
0
;
ne
->
thresh
=
9
0
;
if
(
width
*
height
>=
1920
*
1080
)
{
ne
->
thresh
=
7
0
;
ne
->
thresh
=
20
0
;
}
else
if
(
width
*
height
>=
1280
*
720
)
{
ne
->
thresh
=
4
0
;
ne
->
thresh
=
13
0
;
}
}
...
...
@@ -55,8 +55,8 @@ int enable_noise_estimation(VP9_COMP *const cpi) {
cpi
->
resize_state
==
ORIG
&&
!
cpi
->
use_svc
&&
cpi
->
oxcf
.
content
!=
VP9E_CONTENT_SCREEN
&&
cpi
->
common
.
width
>
352
&&
cpi
->
common
.
height
>
288
)
cpi
->
common
.
width
>
=
640
&&
cpi
->
common
.
height
>
=
480
)
return
1
;
else
return
0
;
...
...
@@ -86,6 +86,8 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
int
frame_period
=
10
;
int
thresh_consec_zeromv
=
8
;
unsigned
int
thresh_sum_diff
=
128
;
unsigned
int
thresh_sum_spatial
=
(
200
*
200
)
<<
8
;
unsigned
int
thresh_spatial_var
=
(
32
*
32
)
<<
8
;
int
num_frames_estimate
=
20
;
int
min_blocks_estimate
=
cm
->
mi_rows
*
cm
->
mi_cols
>>
7
;
// Estimate is between current source and last source.
...
...
@@ -108,8 +110,7 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
uint64_t
avg_est
=
0
;
int
bsize
=
BLOCK_16X16
;
static
const
unsigned
char
const_source
[
16
]
=
{
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
,
128
};
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
// Loop over sub-sample of 16x16 blocks of frame, and for blocks that have
// been encoded as zero/small mv at least x consecutive frames, compute
// the variance to update estimate of noise in the source.
...
...
@@ -164,8 +165,12 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
const
unsigned
int
spatial_variance
=
cpi
->
fn_ptr
[
bsize
].
vf
(
src_y
,
src_ystride
,
const_source
,
0
,
&
sse2
);
avg_est
+=
variance
/
(
10
+
spatial_variance
);
num_samples
++
;
// Avoid blocks with high brightness and high spatial variance.
if
((
sse2
-
spatial_variance
)
<
thresh_sum_spatial
&&
spatial_variance
<
thresh_spatial_var
)
{
avg_est
+=
variance
/
((
spatial_variance
>>
9
)
+
1
);
num_samples
++
;
}
}
}
}
...
...
@@ -184,7 +189,7 @@ void vp9_update_noise_estimate(VP9_COMP *const cpi) {
// duplicate frames).
if
(
num_samples
>
min_blocks_estimate
&&
avg_est
>
0
)
{
// Normalize.
avg_est
=
(
avg_est
<<
8
)
/
num_samples
;
avg_est
=
avg_est
/
num_samples
;
// Update noise estimate.
ne
->
value
=
(
int
)((
3
*
ne
->
value
+
avg_est
)
>>
2
);
ne
->
count
++
;
...
...
Write
Preview
Markdown
is supported
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