Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
a53b144e
Commit
a53b144e
authored
Feb 16, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: add avpriv_color_frame()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
af882e18
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
0 deletions
+25
-0
internal.h
libavcodec/internal.h
+3
-0
utils.c
libavcodec/utils.c
+22
-0
No files found.
libavcodec/internal.h
View file @
a53b144e
...
...
@@ -124,6 +124,9 @@ unsigned int avpriv_toupper4(unsigned int x);
*/
void
ff_init_buffer_info
(
AVCodecContext
*
s
,
AVFrame
*
frame
);
void
avpriv_color_frame
(
AVFrame
*
frame
,
const
int
color
[
4
]);
/**
* Remove and free all side data from packet.
*/
...
...
libavcodec/utils.c
View file @
a53b144e
...
...
@@ -501,6 +501,28 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
return
0
;
}
void
avpriv_color_frame
(
AVFrame
*
frame
,
const
int
c
[
4
])
{
const
AVPixFmtDescriptor
*
desc
=
av_pix_fmt_desc_get
(
frame
->
format
);
int
p
,
y
,
x
;
av_assert0
(
desc
->
flags
&
PIX_FMT_PLANAR
);
for
(
p
=
0
;
p
<
desc
->
nb_components
;
p
++
)
{
uint8_t
*
dst
=
frame
->
data
[
p
];
int
is_chroma
=
p
==
1
||
p
==
2
;
int
bytes
=
-
((
-
frame
->
width
)
>>
(
is_chroma
?
desc
->
log2_chroma_w
:
0
));
for
(
y
=
0
;
y
<-
((
-
frame
->
height
)
>>
(
is_chroma
?
desc
->
log2_chroma_h
:
0
));
y
++
){
if
(
desc
->
comp
[
0
].
depth_minus1
>=
8
)
{
for
(
x
=
0
;
x
<
bytes
;
x
++
)
((
uint16_t
*
)
dst
)[
x
]
=
c
[
p
];
}
else
memset
(
dst
,
c
[
p
],
bytes
);
dst
+=
frame
->
linesize
[
p
];
}
}
}
int
avcodec_default_get_buffer
(
AVCodecContext
*
avctx
,
AVFrame
*
frame
)
{
frame
->
type
=
FF_BUFFER_TYPE_INTERNAL
;
...
...
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