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
624a7e00
Commit
624a7e00
authored
Apr 27, 2011
by
Baptiste Coudurier
Committed by
Michael Niedermayer
Apr 27, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly support pal8 with alpha in libswscale, fix png pal8 with alpha.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
dbfdb288
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
swscale.c
libswscale/swscale.c
+11
-0
swscale_internal.h
libswscale/swscale_internal.h
+1
-0
swscale_template.c
libswscale/swscale_template.c
+1
-0
No files found.
libswscale/swscale.c
View file @
624a7e00
...
...
@@ -1158,6 +1158,16 @@ BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<
BGR2UV
(
uint16_t
,
rgb16ToUV
,
0
,
0
,
0
,
0
,
0xF800
,
0x07E0
,
0x001F
,
RU
,
GU
<<
5
,
BU
<<
11
,
RV
,
GV
<<
5
,
BV
<<
11
,
RGB2YUV_SHIFT
+
8
)
BGR2UV
(
uint16_t
,
rgb15ToUV
,
0
,
0
,
0
,
0
,
0x7C00
,
0x03E0
,
0x001F
,
RU
,
GU
<<
5
,
BU
<<
10
,
RV
,
GV
<<
5
,
BV
<<
10
,
RGB2YUV_SHIFT
+
7
)
static
inline
void
palToA
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
long
width
,
uint32_t
*
pal
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
d
=
src
[
i
];
dst
[
i
]
=
pal
[
d
]
>>
24
;
}
}
static
inline
void
palToY
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
long
width
,
uint32_t
*
pal
)
{
int
i
;
...
...
@@ -2002,6 +2012,7 @@ int sws_scale(SwsContext *c, const uint8_t* const src[], const int srcStride[],
int
p
,
r
,
g
,
b
,
y
,
u
,
v
,
a
=
0xff
;
if
(
c
->
srcFormat
==
PIX_FMT_PAL8
)
{
p
=
((
const
uint32_t
*
)(
src
[
1
]))[
i
];
a
=
(
p
>>
24
)
&
0xFF
;
r
=
(
p
>>
16
)
&
0xFF
;
g
=
(
p
>>
8
)
&
0xFF
;
b
=
p
&
0xFF
;
...
...
libswscale/swscale_internal.h
View file @
624a7e00
...
...
@@ -459,6 +459,7 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_BGR32_1 \
|| (x)==PIX_FMT_RGB32 \
|| (x)==PIX_FMT_RGB32_1 \
|| (x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_GRAY8A \
|| (x)==PIX_FMT_YUVA420P \
)
...
...
libswscale/swscale_template.c
View file @
624a7e00
...
...
@@ -3068,6 +3068,7 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
case
PIX_FMT_BGR32
:
case
PIX_FMT_BGR32_1
:
c
->
alpToYV12
=
abgrToA
;
break
;
case
PIX_FMT_GRAY8A
:
c
->
alpToYV12
=
RENAME
(
yuy2ToY
);
break
;
case
PIX_FMT_PAL8
:
c
->
alpToYV12
=
palToA
;
break
;
}
}
...
...
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