Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2a6a3d43
Commit
2a6a3d43
authored
Sep 30, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_hflip: refactor plane dimensions calculation
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
86277390
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
vf_hflip.c
libavfilter/vf_hflip.c
+10
-5
No files found.
libavfilter/vf_hflip.c
View file @
2a6a3d43
...
...
@@ -37,7 +37,8 @@
typedef
struct
{
int
max_step
[
4
];
///< max pixel step for each plane, expressed as a number of bytes
int
hsub
,
vsub
;
///< chroma subsampling
int
planewidth
[
4
];
///< width of each plane
int
planeheight
[
4
];
///< height of each plane
}
FlipContext
;
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
@@ -62,10 +63,14 @@ static int config_props(AVFilterLink *inlink)
{
FlipContext
*
s
=
inlink
->
dst
->
priv
;
const
AVPixFmtDescriptor
*
pix_desc
=
av_pix_fmt_desc_get
(
inlink
->
format
);
const
int
hsub
=
pix_desc
->
log2_chroma_w
;
const
int
vsub
=
pix_desc
->
log2_chroma_h
;
av_image_fill_max_pixsteps
(
s
->
max_step
,
NULL
,
pix_desc
);
s
->
hsub
=
pix_desc
->
log2_chroma_w
;
s
->
vsub
=
pix_desc
->
log2_chroma_h
;
s
->
planewidth
[
0
]
=
s
->
planewidth
[
3
]
=
inlink
->
w
;
s
->
planewidth
[
1
]
=
s
->
planewidth
[
2
]
=
FF_CEIL_RSHIFT
(
inlink
->
w
,
hsub
);
s
->
planeheight
[
0
]
=
s
->
planeheight
[
3
]
=
inlink
->
h
;
s
->
planeheight
[
1
]
=
s
->
planeheight
[
2
]
=
FF_CEIL_RSHIFT
(
inlink
->
h
,
vsub
);
return
0
;
}
...
...
@@ -91,8 +96,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
memcpy
(
out
->
data
[
1
],
in
->
data
[
1
],
AVPALETTE_SIZE
);
for
(
plane
=
0
;
plane
<
4
&&
in
->
data
[
plane
]
&&
in
->
linesize
[
plane
];
plane
++
)
{
const
int
width
=
(
plane
==
1
||
plane
==
2
)
?
FF_CEIL_RSHIFT
(
inlink
->
w
,
s
->
hsub
)
:
inlink
->
w
;
const
int
height
=
(
plane
==
1
||
plane
==
2
)
?
FF_CEIL_RSHIFT
(
inlink
->
h
,
s
->
vsub
)
:
inlink
->
h
;
const
int
width
=
s
->
planewidth
[
plane
]
;
const
int
height
=
s
->
planeheight
[
plane
]
;
step
=
s
->
max_step
[
plane
];
outrow
=
out
->
data
[
plane
];
...
...
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