Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
19565c60
Commit
19565c60
authored
Jan 06, 2019
by
Peter Ross
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/vp3dsp: add 12 pixel loop filter functions
Signed-off-by:
Peter Ross
<
pross@xvid.org
>
parent
1dfd7aec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
vp3dsp.c
libavcodec/vp3dsp.c
+20
-8
vp3dsp.h
libavcodec/vp3dsp.h
+3
-0
No files found.
libavcodec/vp3dsp.c
View file @
19565c60
...
...
@@ -228,14 +228,14 @@ static void vp3_idct_dc_add_c(uint8_t *dest /* align 8 */, ptrdiff_t stride,
block
[
0
]
=
0
;
}
static
void
vp3_v_loop_filter_c
(
uint8_t
*
first_pixel
,
ptrdiff_t
stride
,
int
*
bounding_values
)
static
av_always_inline
void
vp3_v_loop_filter_c
(
uint8_t
*
first_pixel
,
ptrdiff_t
stride
,
int
*
bounding_values
,
int
count
)
{
unsigned
char
*
end
;
int
filter_value
;
const
ptrdiff_t
nstride
=
-
stride
;
for
(
end
=
first_pixel
+
8
;
first_pixel
<
end
;
first_pixel
++
)
{
for
(
end
=
first_pixel
+
count
;
first_pixel
<
end
;
first_pixel
++
)
{
filter_value
=
(
first_pixel
[
2
*
nstride
]
-
first_pixel
[
stride
])
+
(
first_pixel
[
0
]
-
first_pixel
[
nstride
])
*
3
;
filter_value
=
bounding_values
[(
filter_value
+
4
)
>>
3
];
...
...
@@ -245,13 +245,13 @@ static void vp3_v_loop_filter_c(uint8_t *first_pixel, ptrdiff_t stride,
}
}
static
void
vp3_h_loop_filter_c
(
uint8_t
*
first_pixel
,
ptrdiff_t
stride
,
int
*
bounding_values
)
static
av_always_inline
void
vp3_h_loop_filter_c
(
uint8_t
*
first_pixel
,
ptrdiff_t
stride
,
int
*
bounding_values
,
int
count
)
{
unsigned
char
*
end
;
int
filter_value
;
for
(
end
=
first_pixel
+
8
*
stride
;
first_pixel
!=
end
;
first_pixel
+=
stride
)
{
for
(
end
=
first_pixel
+
count
*
stride
;
first_pixel
!=
end
;
first_pixel
+=
stride
)
{
filter_value
=
(
first_pixel
[
-
2
]
-
first_pixel
[
1
])
+
(
first_pixel
[
0
]
-
first_pixel
[
-
1
])
*
3
;
filter_value
=
bounding_values
[(
filter_value
+
4
)
>>
3
];
...
...
@@ -261,6 +261,18 @@ static void vp3_h_loop_filter_c(uint8_t *first_pixel, ptrdiff_t stride,
}
}
#define LOOP_FILTER(prefix, suffix, dim, count) \
void prefix##_##dim##_loop_filter_##count##suffix(uint8_t *first_pixel, ptrdiff_t stride, \
int *bounding_values) \
{ \
vp3_##dim##_loop_filter_c(first_pixel, stride, bounding_values, count); \
}
static
LOOP_FILTER
(
vp3
,
_c
,
v
,
8
)
static
LOOP_FILTER
(
vp3
,
_c
,
h
,
8
)
LOOP_FILTER
(
ff_vp3dsp
,
,
v
,
12
)
LOOP_FILTER
(
ff_vp3dsp
,
,
h
,
12
)
static
void
put_no_rnd_pixels_l2
(
uint8_t
*
dst
,
const
uint8_t
*
src1
,
const
uint8_t
*
src2
,
ptrdiff_t
stride
,
int
h
)
{
...
...
@@ -285,8 +297,8 @@ av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags)
c
->
idct_put
=
vp3_idct_put_c
;
c
->
idct_add
=
vp3_idct_add_c
;
c
->
idct_dc_add
=
vp3_idct_dc_add_c
;
c
->
v_loop_filter
=
vp3_v_loop_filter_c
;
c
->
h_loop_filter
=
vp3_h_loop_filter_c
;
c
->
v_loop_filter
=
vp3_v_loop_filter_
8_
c
;
c
->
h_loop_filter
=
vp3_h_loop_filter_
8_
c
;
if
(
ARCH_ARM
)
ff_vp3dsp_init_arm
(
c
,
flags
);
...
...
libavcodec/vp3dsp.h
View file @
19565c60
...
...
@@ -45,6 +45,9 @@ typedef struct VP3DSPContext {
void
(
*
h_loop_filter
)(
uint8_t
*
src
,
ptrdiff_t
stride
,
int
*
bounding_values
);
}
VP3DSPContext
;
void
ff_vp3dsp_v_loop_filter_12
(
uint8_t
*
first_pixel
,
ptrdiff_t
stride
,
int
*
bounding_values
);
void
ff_vp3dsp_h_loop_filter_12
(
uint8_t
*
first_pixel
,
ptrdiff_t
stride
,
int
*
bounding_values
);
void
ff_vp3dsp_init
(
VP3DSPContext
*
c
,
int
flags
);
void
ff_vp3dsp_init_arm
(
VP3DSPContext
*
c
,
int
flags
);
void
ff_vp3dsp_init_ppc
(
VP3DSPContext
*
c
,
int
flags
);
...
...
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