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
d339595c
Commit
d339595c
authored
Jun 06, 2017
by
Urvang Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temporal_filter.c: Dedup hbd / non-hbd code.
Change-Id: I403f7ab5aa27894d56d9efdbb52c7ded223dd11a
parent
7e2dce03
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
54 deletions
+6
-54
av1/encoder/temporal_filter.c
av1/encoder/temporal_filter.c
+6
-54
No files found.
av1/encoder/temporal_filter.c
View file @
d339595c
...
...
@@ -413,10 +413,10 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
mbd
->
mi
[
0
]
->
bmi
[
0
].
as_mv
[
0
].
as_mv
.
col
,
predictor
,
scale
,
mb_col
*
16
,
mb_row
*
16
);
// Apply the filter (YUV)
#if CONFIG_HIGHBITDEPTH
if
(
mbd
->
cur_buf
->
flags
&
YV12_FLAG_HIGHBITDEPTH
)
{
int
adj_strength
=
strength
+
2
*
(
mbd
->
bd
-
8
);
// Apply the filter (YUV)
av1_highbd_temporal_filter_apply
(
f
->
y_buffer
+
mb_y_offset
,
f
->
y_stride
,
predictor
,
16
,
16
,
adj_strength
,
filter_weight
,
accumulator
,
count
);
...
...
@@ -429,7 +429,7 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
mb_uv_width
,
mb_uv_height
,
adj_strength
,
filter_weight
,
accumulator
+
512
,
count
+
512
);
}
else
{
// Apply the filter (YUV)
#endif // CONFIG_HIGHBITDEPTH
av1_temporal_filter_apply_c
(
f
->
y_buffer
+
mb_y_offset
,
f
->
y_stride
,
predictor
,
16
,
16
,
strength
,
filter_weight
,
accumulator
,
count
);
...
...
@@ -441,29 +441,17 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
f
->
v_buffer
+
mb_uv_offset
,
f
->
uv_stride
,
predictor
+
512
,
mb_uv_width
,
mb_uv_height
,
strength
,
filter_weight
,
accumulator
+
512
,
count
+
512
);
#if CONFIG_HIGHBITDEPTH
}
#else
// Apply the filter (YUV)
av1_temporal_filter_apply_c
(
f
->
y_buffer
+
mb_y_offset
,
f
->
y_stride
,
predictor
,
16
,
16
,
strength
,
filter_weight
,
accumulator
,
count
);
av1_temporal_filter_apply_c
(
f
->
u_buffer
+
mb_uv_offset
,
f
->
uv_stride
,
predictor
+
256
,
mb_uv_width
,
mb_uv_height
,
strength
,
filter_weight
,
accumulator
+
256
,
count
+
256
);
av1_temporal_filter_apply_c
(
f
->
v_buffer
+
mb_uv_offset
,
f
->
uv_stride
,
predictor
+
512
,
mb_uv_width
,
mb_uv_height
,
strength
,
filter_weight
,
accumulator
+
512
,
count
+
512
);
#endif // CONFIG_HIGHBITDEPTH
}
}
// Normalize filter output to produce AltRef frame
#if CONFIG_HIGHBITDEPTH
if
(
mbd
->
cur_buf
->
flags
&
YV12_FLAG_HIGHBITDEPTH
)
{
uint16_t
*
dst1_16
;
uint16_t
*
dst2_16
;
// Normalize filter output to produce AltRef frame
dst1
=
cpi
->
alt_ref_buffer
.
y_buffer
;
dst1_16
=
CONVERT_TO_SHORTPTR
(
dst1
);
stride
=
cpi
->
alt_ref_buffer
.
y_stride
;
...
...
@@ -505,7 +493,7 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
byte
+=
stride
-
mb_uv_width
;
}
}
else
{
// Normalize filter output to produce AltRef frame
#endif // CONFIG_HIGHBITDEPTH
dst1
=
cpi
->
alt_ref_buffer
.
y_buffer
;
stride
=
cpi
->
alt_ref_buffer
.
y_stride
;
byte
=
mb_y_offset
;
...
...
@@ -541,43 +529,7 @@ static void temporal_filter_iterate_c(AV1_COMP *cpi,
}
byte
+=
stride
-
mb_uv_width
;
}
}
#else
// Normalize filter output to produce AltRef frame
dst1
=
cpi
->
alt_ref_buffer
.
y_buffer
;
stride
=
cpi
->
alt_ref_buffer
.
y_stride
;
byte
=
mb_y_offset
;
for
(
i
=
0
,
k
=
0
;
i
<
16
;
i
++
)
{
for
(
j
=
0
;
j
<
16
;
j
++
,
k
++
)
{
dst1
[
byte
]
=
(
uint8_t
)
OD_DIVU
(
accumulator
[
k
]
+
(
count
[
k
]
>>
1
),
count
[
k
]);
// move to next pixel
byte
++
;
}
byte
+=
stride
-
16
;
}
dst1
=
cpi
->
alt_ref_buffer
.
u_buffer
;
dst2
=
cpi
->
alt_ref_buffer
.
v_buffer
;
stride
=
cpi
->
alt_ref_buffer
.
uv_stride
;
byte
=
mb_uv_offset
;
for
(
i
=
0
,
k
=
256
;
i
<
mb_uv_height
;
i
++
)
{
for
(
j
=
0
;
j
<
mb_uv_width
;
j
++
,
k
++
)
{
int
m
=
k
+
256
;
// U
dst1
[
byte
]
=
(
uint8_t
)
OD_DIVU
(
accumulator
[
k
]
+
(
count
[
k
]
>>
1
),
count
[
k
]);
// V
dst2
[
byte
]
=
(
uint8_t
)
OD_DIVU
(
accumulator
[
m
]
+
(
count
[
m
]
>>
1
),
count
[
m
]);
// move to next pixel
byte
++
;
}
byte
+=
stride
-
mb_uv_width
;
#if CONFIG_HIGHBITDEPTH
}
#endif // CONFIG_HIGHBITDEPTH
mb_y_offset
+=
16
;
...
...
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