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
a4b7a713
Commit
a4b7a713
authored
10 years ago
by
Tim Kopp
Browse files
Options
Download
Patches
Plain Diff
Update running avg for VP9 denoiser
Change-Id: I9577d648542064052795bf5770428fbd5c276b7b
parent
2a720673
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
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
nextgen
nextgenv2
sandbox/Jingning/experimental
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
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
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/encoder/vp9_denoiser.c
+37
-0
vp9/encoder/vp9_denoiser.c
with
37 additions
and
0 deletions
vp9/encoder/vp9_denoiser.c
+
37
−
0
View file @
a4b7a713
...
...
@@ -20,9 +20,46 @@ int vp9_denoiser_filter() {
return
0
;
}
int
update_running_avg
(
uint8_t
*
mc_avg
,
int
mc_avg_stride
,
uint8_t
*
avg
,
int
avg_stride
,
uint8_t
*
sig
,
int
sig_stride
,
BLOCK_SIZE
bs
)
{
// Indices: 0, 1, 2, 3, 4, 5 ,6, 7,
static
const
uint8_t
adjustments
[]
=
{
0
,
0
,
0
,
0
,
3
,
3
,
3
,
3
,
// 8, 9,10,11,12,13,14,15,16
4
,
4
,
4
,
4
,
4
,
4
,
4
,
4
,
6
};
int
r
,
c
;
int
diff
;
int
adjustment
;
int
total_adj
=
0
;
for
(
r
=
0
;
r
<
heights
[
bs
];
++
r
)
{
for
(
c
=
0
;
c
<
widths
[
bs
];
++
c
)
{
diff
=
mc_avg
[
c
]
-
sig
[
c
];
adjustment
=
adjustments
[
MIN
(
abs
(
diff
),
16
)];
if
(
diff
>
0
)
{
avg
[
c
]
=
MIN
(
UINT8_MAX
,
sig
[
c
]
+
adjustment
);
total_adj
+=
adjustment
;
}
else
{
avg
[
c
]
=
MAX
(
0
,
sig
[
c
]
-
adjustment
);
total_adj
-=
adjustment
;
}
}
sig
+=
sig_stride
;
avg
+=
avg_stride
;
mc_avg
+=
mc_avg_stride
;
}
return
total_adj
;
}
void
vp9_denoiser_denoise
(
VP9_DENOISER
*
denoiser
,
MACROBLOCK
*
mb
,
MODE_INFO
**
grid
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bs
)
{
update_running_avg
(
denoiser
->
mc_running_avg_y
.
buf
,
denoiser
->
mc_running_avg_y
.
stride
,
denoiser
->
running_avg_y
.
buf
,
denoiser
->
running_avg_y
.
stride
,
mb
->
plane
[
0
].
src
.
buf
,
mb
->
plane
[
0
].
src
.
stride
,
bs
);
return
;
}
...
...
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