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
b61376bd
Commit
b61376bd
authored
Jul 26, 2020
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/hflip: Support Bayer pixel formats.
Fixes part of ticket #8819.
parent
3092a53c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
hflip.h
libavfilter/hflip.h
+1
-0
vf_hflip.c
libavfilter/vf_hflip.c
+3
-1
vf_hflip.c
tests/checkasm/vf_hflip.c
+1
-0
No files found.
libavfilter/hflip.h
View file @
b61376bd
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
typedef
struct
FlipContext
{
typedef
struct
FlipContext
{
const
AVClass
*
class
;
const
AVClass
*
class
;
int
max_step
[
4
];
///< max pixel step for each plane, expressed as a number of bytes
int
max_step
[
4
];
///< max pixel step for each plane, expressed as a number of bytes
int
bayer_plus1
;
///< 1 .. not a Bayer input format, 2 .. Bayer input format
int
planewidth
[
4
];
///< width of each plane
int
planewidth
[
4
];
///< width of each plane
int
planeheight
[
4
];
///< height of each plane
int
planeheight
[
4
];
///< height of each plane
...
...
libavfilter/vf_hflip.c
View file @
b61376bd
...
@@ -138,6 +138,7 @@ static int config_props(AVFilterLink *inlink)
...
@@ -138,6 +138,7 @@ static int config_props(AVFilterLink *inlink)
s
->
planewidth
[
1
]
=
s
->
planewidth
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
w
,
hsub
);
s
->
planewidth
[
1
]
=
s
->
planewidth
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
w
,
hsub
);
s
->
planeheight
[
0
]
=
s
->
planeheight
[
3
]
=
inlink
->
h
;
s
->
planeheight
[
0
]
=
s
->
planeheight
[
3
]
=
inlink
->
h
;
s
->
planeheight
[
1
]
=
s
->
planeheight
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
h
,
vsub
);
s
->
planeheight
[
1
]
=
s
->
planeheight
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
h
,
vsub
);
s
->
bayer_plus1
=
!!
(
pix_desc
->
flags
&
AV_PIX_FMT_FLAG_BAYER
)
+
1
;
nb_planes
=
av_pix_fmt_count_planes
(
inlink
->
format
);
nb_planes
=
av_pix_fmt_count_planes
(
inlink
->
format
);
...
@@ -149,6 +150,7 @@ int ff_hflip_init(FlipContext *s, int step[4], int nb_planes)
...
@@ -149,6 +150,7 @@ int ff_hflip_init(FlipContext *s, int step[4], int nb_planes)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
nb_planes
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_planes
;
i
++
)
{
step
[
i
]
*=
s
->
bayer_plus1
;
switch
(
step
[
i
])
{
switch
(
step
[
i
])
{
case
1
:
s
->
flip_line
[
i
]
=
hflip_byte_c
;
break
;
case
1
:
s
->
flip_line
[
i
]
=
hflip_byte_c
;
break
;
case
2
:
s
->
flip_line
[
i
]
=
hflip_short_c
;
break
;
case
2
:
s
->
flip_line
[
i
]
=
hflip_short_c
;
break
;
...
@@ -180,7 +182,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
...
@@ -180,7 +182,7 @@ static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
int
i
,
plane
,
step
;
int
i
,
plane
,
step
;
for
(
plane
=
0
;
plane
<
4
&&
in
->
data
[
plane
]
&&
in
->
linesize
[
plane
];
plane
++
)
{
for
(
plane
=
0
;
plane
<
4
&&
in
->
data
[
plane
]
&&
in
->
linesize
[
plane
];
plane
++
)
{
const
int
width
=
s
->
planewidth
[
plane
];
const
int
width
=
s
->
planewidth
[
plane
]
/
s
->
bayer_plus1
;
const
int
height
=
s
->
planeheight
[
plane
];
const
int
height
=
s
->
planeheight
[
plane
];
const
int
start
=
(
height
*
job
)
/
nb_jobs
;
const
int
start
=
(
height
*
job
)
/
nb_jobs
;
const
int
end
=
(
height
*
(
job
+
1
))
/
nb_jobs
;
const
int
end
=
(
height
*
(
job
+
1
))
/
nb_jobs
;
...
...
tests/checkasm/vf_hflip.c
View file @
b61376bd
...
@@ -40,6 +40,7 @@ static void check_hflip(int step, const char * report_name){
...
@@ -40,6 +40,7 @@ static void check_hflip(int step, const char * report_name){
int
i
;
int
i
;
int
step_array
[
4
]
=
{
1
,
1
,
1
,
1
};
int
step_array
[
4
]
=
{
1
,
1
,
1
,
1
};
FlipContext
s
;
FlipContext
s
;
s
.
bayer_plus1
=
1
;
declare_func
(
void
,
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
w
);
declare_func
(
void
,
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
w
);
...
...
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