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
6d93f194
Commit
6d93f194
authored
Apr 19, 2003
by
Fabrice Bellard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rgba32 convert
Originally committed as revision 1794 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
5ae2c73e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
imgconvert.c
libavcodec/imgconvert.c
+32
-2
No files found.
libavcodec/imgconvert.c
View file @
6d93f194
...
...
@@ -119,7 +119,7 @@ static PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
/* paletted formats */
[
PIX_FMT_PAL8
]
=
{
.
name
=
"pal8"
,
.
nb_components
=
1
,
.
is_packed
=
1
,
.
is_paletted
=
1
,
.
nb_components
=
1
,
.
is_packed
=
1
,
.
is_
alpha
=
1
,
.
is_
paletted
=
1
,
},
};
...
...
@@ -989,7 +989,6 @@ static void gray_to_mono(AVPicture *dst, AVPicture *src,
d
=
dst
->
data
[
0
];
dst_wrap
=
dst
->
linesize
[
0
]
-
((
width
+
7
)
>>
3
);
printf
(
"%d %d
\n
"
,
width
,
height
);
for
(
y
=
0
;
y
<
height
;
y
++
)
{
n
=
width
;
...
...
@@ -1085,6 +1084,34 @@ static void rgb24_to_pal8(AVPicture *dst, AVPicture *src,
pal
[
i
++
]
=
0
;
}
static
void
rgba32_to_rgb24
(
AVPicture
*
dst
,
AVPicture
*
src
,
int
width
,
int
height
)
{
const
uint8_t
*
s
;
uint8_t
*
d
;
int
src_wrap
,
dst_wrap
,
j
,
y
;
unsigned
int
v
;
s
=
src
->
data
[
0
];
src_wrap
=
src
->
linesize
[
0
]
-
width
*
4
;
d
=
dst
->
data
[
0
];
dst_wrap
=
dst
->
linesize
[
0
]
-
width
*
3
;
for
(
y
=
0
;
y
<
height
;
y
++
)
{
for
(
j
=
0
;
j
<
width
;
j
++
)
{
v
=
*
(
uint32_t
*
)
s
;
s
+=
4
;
d
[
0
]
=
v
>>
16
;
d
[
1
]
=
v
>>
8
;
d
[
2
]
=
v
;
d
+=
3
;
}
s
+=
src_wrap
;
d
+=
dst_wrap
;
}
}
typedef
struct
ConvertEntry
{
void
(
*
convert
)(
AVPicture
*
dst
,
AVPicture
*
src
,
int
width
,
int
height
);
}
ConvertEntry
;
...
...
@@ -1158,6 +1185,9 @@ static ConvertEntry convert_table[PIX_FMT_NB][PIX_FMT_NB] = {
[
PIX_FMT_GRAY8
]
=
{
.
convert
=
rgba32_to_gray
},
[
PIX_FMT_RGB24
]
=
{
.
convert
=
rgba32_to_rgb24
},
},
[
PIX_FMT_BGR24
]
=
{
[
PIX_FMT_YUV420P
]
=
{
...
...
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