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
a793a587
Commit
a793a587
authored
Dec 22, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/swapuv: support all planar yuv pixel formats
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b90ab2b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
10 deletions
+29
-10
vf_swapuv.c
libavfilter/vf_swapuv.c
+29
-10
No files found.
libavfilter/vf_swapuv.c
View file @
a793a587
...
...
@@ -23,6 +23,7 @@
* swap UV filter
*/
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
...
...
@@ -48,18 +49,36 @@ static int filter_frame(AVFilterLink *link, AVFilterBufferRef *inpicref)
return
ff_filter_frame
(
link
->
dst
->
outputs
[
0
],
inpicref
);
}
static
int
is_planar_yuv
(
const
AVPixFmtDescriptor
*
desc
)
{
int
i
;
if
(
desc
->
flags
&
~
(
PIX_FMT_BE
|
PIX_FMT_PLANAR
|
PIX_FMT_ALPHA
)
||
desc
->
nb_components
<
3
||
(
desc
->
comp
[
1
].
depth_minus1
!=
desc
->
comp
[
2
].
depth_minus1
))
return
0
;
for
(
i
=
0
;
i
<
desc
->
nb_components
;
i
++
)
{
if
(
desc
->
comp
[
i
].
offset_plus1
!=
1
||
desc
->
comp
[
i
].
shift
!=
0
||
desc
->
comp
[
i
].
plane
!=
i
)
return
0
;
}
return
1
;
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
static
const
enum
AVPixelFormat
pix_fmts
[]
=
{
AV_PIX_FMT_YUV420P
,
AV_PIX_FMT_YUVJ420P
,
AV_PIX_FMT_YUVA420P
,
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_YUVJ444P
,
AV_PIX_FMT_YUVA444P
,
AV_PIX_FMT_YUV440P
,
AV_PIX_FMT_YUVJ440P
,
AV_PIX_FMT_YUV422P
,
AV_PIX_FMT_YUVJ422P
,
AV_PIX_FMT_YUV411P
,
AV_PIX_FMT_NONE
,
}
;
ff_set_common_formats
(
ctx
,
f
f_make_format_list
(
pix_fmts
)
);
AVFilterFormats
*
formats
=
NULL
;
int
fmt
;
for
(
fmt
=
0
;
fmt
<
AV_PIX_FMT_NB
;
fmt
++
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
fmt
);
if
(
is_planar_yuv
(
desc
))
ff_add_format
(
&
formats
,
fmt
);
}
ff_set_common_formats
(
ctx
,
f
ormats
);
return
0
;
}
...
...
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