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
2c328a90
Commit
2c328a90
authored
Mar 16, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pixdesc: add a function for counting planes in a pixel format.
parent
e5c32d6d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
APIchanges
doc/APIchanges
+3
-0
pixdesc.c
libavutil/pixdesc.c
+15
-0
pixdesc.h
libavutil/pixdesc.h
+6
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
2c328a90
...
...
@@ -13,6 +13,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2013-xx-xx - lavu 52.9.0 - pixdesc.h
Add av_pix_fmt_count_planes() function for counting planes in a pixel format.
2013-xx-xx - lavfi 3.6.0
Add AVFilterGraph.nb_filters, deprecate AVFilterGraph.filter_count.
...
...
libavutil/pixdesc.c
View file @
2c328a90
...
...
@@ -1473,3 +1473,18 @@ int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
return
0
;
}
int
av_pix_fmt_count_planes
(
enum
AVPixelFormat
pix_fmt
)
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
pix_fmt
);
int
i
,
planes
[
4
]
=
{
0
},
ret
=
0
;
if
(
!
desc
)
return
AVERROR
(
EINVAL
);
for
(
i
=
0
;
i
<
desc
->
nb_components
;
i
++
)
planes
[
desc
->
comp
[
i
].
plane
]
=
1
;
for
(
i
=
0
;
i
<
FF_ARRAY_ELEMS
(
planes
);
i
++
)
ret
+=
planes
[
i
];
return
ret
;
}
libavutil/pixdesc.h
View file @
2c328a90
...
...
@@ -219,5 +219,11 @@ enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
int
av_pix_fmt_get_chroma_sub_sample
(
enum
AVPixelFormat
pix_fmt
,
int
*
h_shift
,
int
*
v_shift
);
/**
* @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
* valid pixel format.
*/
int
av_pix_fmt_count_planes
(
enum
AVPixelFormat
pix_fmt
);
#endif
/* AVUTIL_PIXDESC_H */
libavutil/version.h
View file @
2c328a90
...
...
@@ -37,7 +37,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
#define LIBAVUTIL_VERSION_MINOR
8
#define LIBAVUTIL_VERSION_MINOR
9
#define LIBAVUTIL_VERSION_MICRO 0
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
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