Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
612eb2e2
Commit
612eb2e2
authored
Jan 02, 2018
by
Steinar Midtskogen
Committed by
Sebastien Alaiwan
Jan 03, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove CDEF_FULL and CDEF_CAP defines
Change-Id: I562f1f59c16c1a0295cc141dbcdf122160aa3db0
parent
52b1ba2b
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
294 deletions
+6
-294
av1/common/cdef_block.c
av1/common/cdef_block.c
+2
-46
av1/common/cdef_block.h
av1/common/cdef_block.h
+0
-10
av1/common/cdef_block_simd.h
av1/common/cdef_block_simd.h
+4
-238
No files found.
av1/common/cdef_block.c
View file @
612eb2e2
...
...
@@ -21,18 +21,6 @@
#include "./cdef.h"
/* Generated from gen_filter_tables.c. */
#if CDEF_FULL
DECLARE_ALIGNED
(
16
,
const
int
,
cdef_directions
[
8
][
3
])
=
{
{
-
1
*
CDEF_BSTRIDE
+
1
,
-
2
*
CDEF_BSTRIDE
+
2
,
-
3
*
CDEF_BSTRIDE
+
3
},
{
0
*
CDEF_BSTRIDE
+
1
,
-
1
*
CDEF_BSTRIDE
+
2
,
-
1
*
CDEF_BSTRIDE
+
3
},
{
0
*
CDEF_BSTRIDE
+
1
,
0
*
CDEF_BSTRIDE
+
2
,
0
*
CDEF_BSTRIDE
+
3
},
{
0
*
CDEF_BSTRIDE
+
1
,
1
*
CDEF_BSTRIDE
+
2
,
1
*
CDEF_BSTRIDE
+
3
},
{
1
*
CDEF_BSTRIDE
+
1
,
2
*
CDEF_BSTRIDE
+
2
,
3
*
CDEF_BSTRIDE
+
3
},
{
1
*
CDEF_BSTRIDE
+
0
,
2
*
CDEF_BSTRIDE
+
1
,
3
*
CDEF_BSTRIDE
+
1
},
{
1
*
CDEF_BSTRIDE
+
0
,
2
*
CDEF_BSTRIDE
+
0
,
3
*
CDEF_BSTRIDE
+
0
},
{
1
*
CDEF_BSTRIDE
+
0
,
2
*
CDEF_BSTRIDE
-
1
,
3
*
CDEF_BSTRIDE
-
1
}
};
#else
DECLARE_ALIGNED
(
16
,
const
int
,
cdef_directions
[
8
][
2
])
=
{
{
-
1
*
CDEF_BSTRIDE
+
1
,
-
2
*
CDEF_BSTRIDE
+
2
},
{
0
*
CDEF_BSTRIDE
+
1
,
-
1
*
CDEF_BSTRIDE
+
2
},
...
...
@@ -43,7 +31,6 @@ DECLARE_ALIGNED(16, const int, cdef_directions[8][2]) = {
{
1
*
CDEF_BSTRIDE
+
0
,
2
*
CDEF_BSTRIDE
+
0
},
{
1
*
CDEF_BSTRIDE
+
0
,
2
*
CDEF_BSTRIDE
-
1
}
};
#endif
/* Detect direction. 0 means 45-degree up-right, 2 is horizontal, and so on.
The search minimizes the weighted variance along all the lines in a
...
...
@@ -123,27 +110,14 @@ int cdef_find_dir_c(const uint16_t *img, int stride, int32_t *var,
return
best_dir
;
}
#if CDEF_FULL
const
int
cdef_pri_taps
[
2
][
3
]
=
{
{
3
,
2
,
1
},
{
2
,
2
,
2
}
};
const
int
cdef_sec_taps
[
2
][
2
]
=
{
{
3
,
1
},
{
3
,
1
}
};
#else
const
int
cdef_pri_taps
[
2
][
2
]
=
{
{
4
,
2
},
{
3
,
3
}
};
const
int
cdef_sec_taps
[
2
][
2
]
=
{
{
2
,
1
},
{
2
,
1
}
};
#endif
/* Smooth in the direction detected. */
#if CDEF_CAP
void
cdef_filter_block_c
(
uint8_t
*
dst8
,
uint16_t
*
dst16
,
int
dstride
,
const
uint16_t
*
in
,
int
pri_strength
,
int
sec_strength
,
int
dir
,
int
pri_damping
,
int
sec_damping
,
int
bsize
,
AOM_UNUSED
int
max_unused
,
int
coeff_shift
)
#else
void
cdef_filter_block_c
(
uint8_t
*
dst8
,
uint16_t
*
dst16
,
int
dstride
,
const
uint16_t
*
in
,
int
pri_strength
,
int
sec_strength
,
int
dir
,
int
pri_damping
,
int
sec_damping
,
int
bsize
,
int
max
,
int
coeff_shift
)
#endif
{
AOM_UNUSED
int
max_unused
,
int
coeff_shift
)
{
int
i
,
j
,
k
;
const
int
s
=
CDEF_BSTRIDE
;
const
int
*
pri_taps
=
cdef_pri_taps
[(
pri_strength
>>
coeff_shift
)
&
1
];
...
...
@@ -153,34 +127,21 @@ void cdef_filter_block_c(uint8_t *dst8, uint16_t *dst16, int dstride,
int16_t
sum
=
0
;
int16_t
y
;
int16_t
x
=
in
[
i
*
s
+
j
];
#if CDEF_CAP
int
max
=
x
;
int
min
=
x
;
#endif
#if CDEF_FULL
for
(
k
=
0
;
k
<
3
;
k
++
)
#else
for
(
k
=
0
;
k
<
2
;
k
++
)
#endif
{
for
(
k
=
0
;
k
<
2
;
k
++
)
{
int16_t
p0
=
in
[
i
*
s
+
j
+
cdef_directions
[
dir
][
k
]];
int16_t
p1
=
in
[
i
*
s
+
j
-
cdef_directions
[
dir
][
k
]];
sum
+=
pri_taps
[
k
]
*
constrain
(
p0
-
x
,
pri_strength
,
pri_damping
);
sum
+=
pri_taps
[
k
]
*
constrain
(
p1
-
x
,
pri_strength
,
pri_damping
);
#if CDEF_CAP
if
(
p0
!=
CDEF_VERY_LARGE
)
max
=
AOMMAX
(
p0
,
max
);
if
(
p1
!=
CDEF_VERY_LARGE
)
max
=
AOMMAX
(
p1
,
max
);
min
=
AOMMIN
(
p0
,
min
);
min
=
AOMMIN
(
p1
,
min
);
#endif
#if CDEF_FULL
if
(
k
==
2
)
continue
;
#endif
int16_t
s0
=
in
[
i
*
s
+
j
+
cdef_directions
[(
dir
+
2
)
&
7
][
k
]];
int16_t
s1
=
in
[
i
*
s
+
j
-
cdef_directions
[(
dir
+
2
)
&
7
][
k
]];
int16_t
s2
=
in
[
i
*
s
+
j
+
cdef_directions
[(
dir
+
6
)
&
7
][
k
]];
int16_t
s3
=
in
[
i
*
s
+
j
-
cdef_directions
[(
dir
+
6
)
&
7
][
k
]];
#if CDEF_CAP
if
(
s0
!=
CDEF_VERY_LARGE
)
max
=
AOMMAX
(
s0
,
max
);
if
(
s1
!=
CDEF_VERY_LARGE
)
max
=
AOMMAX
(
s1
,
max
);
if
(
s2
!=
CDEF_VERY_LARGE
)
max
=
AOMMAX
(
s2
,
max
);
...
...
@@ -189,17 +150,12 @@ void cdef_filter_block_c(uint8_t *dst8, uint16_t *dst16, int dstride,
min
=
AOMMIN
(
s1
,
min
);
min
=
AOMMIN
(
s2
,
min
);
min
=
AOMMIN
(
s3
,
min
);
#endif
sum
+=
sec_taps
[
k
]
*
constrain
(
s0
-
x
,
sec_strength
,
sec_damping
);
sum
+=
sec_taps
[
k
]
*
constrain
(
s1
-
x
,
sec_strength
,
sec_damping
);
sum
+=
sec_taps
[
k
]
*
constrain
(
s2
-
x
,
sec_strength
,
sec_damping
);
sum
+=
sec_taps
[
k
]
*
constrain
(
s3
-
x
,
sec_strength
,
sec_damping
);
}
#if CDEF_CAP
y
=
clamp
((
int16_t
)
x
+
((
8
+
sum
-
(
sum
<
0
))
>>
4
),
min
,
max
);
#else
y
=
clamp
((
int16_t
)
x
+
((
8
+
sum
-
(
sum
<
0
))
>>
4
),
0
,
max
);
#endif
if
(
dst8
)
dst8
[
i
*
dstride
+
j
]
=
(
uint8_t
)
y
;
else
...
...
av1/common/cdef_block.h
View file @
612eb2e2
...
...
@@ -31,19 +31,9 @@
#define CDEF_INBUF_SIZE \
(CDEF_BSTRIDE * ((1 << MAX_SB_SIZE_LOG2) + 2 * CDEF_VBORDER))
// Filter configuration
#define CDEF_CAP 1 // 1 = Cap change to largest diff
#define CDEF_FULL 0 // 1 = 7x7 filter, 0 = 5x5 filter
#if CDEF_FULL
extern
const
int
cdef_pri_taps
[
2
][
3
];
extern
const
int
cdef_sec_taps
[
2
][
2
];
DECLARE_ALIGNED
(
16
,
extern
const
int
,
cdef_directions
[
8
][
3
]);
#else
extern
const
int
cdef_pri_taps
[
2
][
2
];
extern
const
int
cdef_sec_taps
[
2
][
2
];
DECLARE_ALIGNED
(
16
,
extern
const
int
,
cdef_directions
[
8
][
2
]);
#endif
typedef
struct
{
uint8_t
by
;
...
...
av1/common/cdef_block_simd.h
View file @
612eb2e2
This diff is collapsed.
Click to expand it.
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