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
0d59ae32
Commit
0d59ae32
authored
Dec 24, 2011
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make mov palette opaque or load alpha if present.
parent
64cafe34
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
mov.c
libavformat/mov.c
+7
-8
No files found.
libavformat/mov.c
View file @
0d59ae32
...
...
@@ -1213,7 +1213,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
(
color_depth
==
8
))
{
/* for palette traversal */
unsigned
int
color_start
,
color_count
,
color_end
;
unsigned
char
r
,
g
,
b
;
unsigned
char
a
,
r
,
g
,
b
;
if
(
color_greyscale
)
{
int
color_index
,
color_dec
;
...
...
@@ -1228,7 +1228,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
}
else
r
=
g
=
b
=
color_index
;
sc
->
palette
[
j
]
=
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
);
(
0xFFU
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
);
color_index
-=
color_dec
;
if
(
color_index
<
0
)
color_index
=
0
;
...
...
@@ -1249,7 +1249,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
g
=
color_table
[
j
*
3
+
1
];
b
=
color_table
[
j
*
3
+
2
];
sc
->
palette
[
j
]
=
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
);
(
0xFFU
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
);
}
}
else
{
/* load the palette from the file */
...
...
@@ -1259,10 +1259,9 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
if
((
color_start
<=
255
)
&&
(
color_end
<=
255
))
{
for
(
j
=
color_start
;
j
<=
color_end
;
j
++
)
{
/* each R, G, or B component is 16 bits;
* only use the top 8 bits; skip alpha bytes
* up front */
avio_r8
(
pb
);
/* each A, R, G, or B component is 16 bits;
* only use the top 8 bits */
a
=
avio_r8
(
pb
);
avio_r8
(
pb
);
r
=
avio_r8
(
pb
);
avio_r8
(
pb
);
...
...
@@ -1271,7 +1270,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
b
=
avio_r8
(
pb
);
avio_r8
(
pb
);
sc
->
palette
[
j
]
=
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
);
(
a
<<
24
)
|
(
r
<<
16
)
|
(
g
<<
8
)
|
(
b
);
}
}
}
...
...
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