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
0b8b3387
Commit
0b8b3387
authored
Jan 10, 2012
by
Paul B Mahol
Committed by
Ronald S. Bultje
Jan 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rgb2rgb: allow conversion for <15 bpp
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
0c50edb7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
swscale_unscaled.c
libswscale/swscale_unscaled.c
+31
-31
No files found.
libswscale/swscale_unscaled.c
View file @
0b8b3387
...
...
@@ -360,8 +360,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
const
enum
PixelFormat
dstFormat
=
c
->
dstFormat
;
const
int
srcBpp
=
(
c
->
srcFormatBpp
+
7
)
>>
3
;
const
int
dstBpp
=
(
c
->
dstFormatBpp
+
7
)
>>
3
;
const
int
srcId
=
c
->
srcFormatBpp
>>
2
;
/* 1:0, 4:1, 8:2, 15:3, 16:4, 24:6, 32:8 */
const
int
dstId
=
c
->
dstFormatBpp
>>
2
;
const
int
srcId
=
c
->
srcFormatBpp
;
const
int
dstId
=
c
->
dstFormatBpp
;
void
(
*
conv
)(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
)
=
NULL
;
#define CONV_IS(src, dst) (srcFormat == PIX_FMT_##src && dstFormat == PIX_FMT_##dst)
...
...
@@ -383,38 +383,38 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
/* BGR -> BGR */
if
((
isBGRinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
))
||
(
isRGBinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
)))
{
switch
(
srcId
|
(
dstId
<<
4
))
{
case
0x
34
:
conv
=
rgb16to15
;
break
;
case
0x
36
:
conv
=
rgb24to15
;
break
;
case
0x
38
:
conv
=
rgb32to15
;
break
;
case
0x
43
:
conv
=
rgb15to16
;
break
;
case
0x
46
:
conv
=
rgb24to16
;
break
;
case
0x
48
:
conv
=
rgb32to16
;
break
;
case
0x
63
:
conv
=
rgb15to24
;
break
;
case
0x
64
:
conv
=
rgb16to24
;
break
;
case
0x
68
:
conv
=
rgb32to24
;
break
;
case
0x
83
:
conv
=
rgb15to32
;
break
;
case
0x
84
:
conv
=
rgb16to32
;
break
;
case
0x
86
:
conv
=
rgb24to32
;
break
;
switch
(
srcId
|
(
dstId
<<
16
))
{
case
0x
000F0010
:
conv
=
rgb16to15
;
break
;
case
0x
000F0018
:
conv
=
rgb24to15
;
break
;
case
0x
000F0020
:
conv
=
rgb32to15
;
break
;
case
0x
0010000F
:
conv
=
rgb15to16
;
break
;
case
0x
00100018
:
conv
=
rgb24to16
;
break
;
case
0x
00100020
:
conv
=
rgb32to16
;
break
;
case
0x
0018000F
:
conv
=
rgb15to24
;
break
;
case
0x
00180010
:
conv
=
rgb16to24
;
break
;
case
0x
00180020
:
conv
=
rgb32to24
;
break
;
case
0x
0020000F
:
conv
=
rgb15to32
;
break
;
case
0x
00200010
:
conv
=
rgb16to32
;
break
;
case
0x
00200018
:
conv
=
rgb24to32
;
break
;
}
}
else
if
((
isBGRinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
))
||
(
isRGBinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
)))
{
switch
(
srcId
|
(
dstId
<<
4
))
{
case
0x
33
:
conv
=
rgb15tobgr15
;
break
;
case
0x
34
:
conv
=
rgb16tobgr15
;
break
;
case
0x
36
:
conv
=
rgb24tobgr15
;
break
;
case
0x
38
:
conv
=
rgb32tobgr15
;
break
;
case
0x
43
:
conv
=
rgb15tobgr16
;
break
;
case
0x
44
:
conv
=
rgb16tobgr16
;
break
;
case
0x
46
:
conv
=
rgb24tobgr16
;
break
;
case
0x
48
:
conv
=
rgb32tobgr16
;
break
;
case
0x
63
:
conv
=
rgb15tobgr24
;
break
;
case
0x
64
:
conv
=
rgb16tobgr24
;
break
;
case
0x
66
:
conv
=
rgb24tobgr24
;
break
;
case
0x
68
:
conv
=
rgb32tobgr24
;
break
;
case
0x
83
:
conv
=
rgb15tobgr32
;
break
;
case
0x
84
:
conv
=
rgb16tobgr32
;
break
;
case
0x
86
:
conv
=
rgb24tobgr32
;
break
;
switch
(
srcId
|
(
dstId
<<
16
))
{
case
0x
000F000F
:
conv
=
rgb15tobgr15
;
break
;
case
0x
000F0010
:
conv
=
rgb16tobgr15
;
break
;
case
0x
000F0018
:
conv
=
rgb24tobgr15
;
break
;
case
0x
000F0020
:
conv
=
rgb32tobgr15
;
break
;
case
0x
0010000F
:
conv
=
rgb15tobgr16
;
break
;
case
0x
00100010
:
conv
=
rgb16tobgr16
;
break
;
case
0x
00100018
:
conv
=
rgb24tobgr16
;
break
;
case
0x
00100020
:
conv
=
rgb32tobgr16
;
break
;
case
0x
0018000F
:
conv
=
rgb15tobgr24
;
break
;
case
0x
00180010
:
conv
=
rgb16tobgr24
;
break
;
case
0x
00180018
:
conv
=
rgb24tobgr24
;
break
;
case
0x
00180020
:
conv
=
rgb32tobgr24
;
break
;
case
0x
0020000F
:
conv
=
rgb15tobgr32
;
break
;
case
0x
00200010
:
conv
=
rgb16tobgr32
;
break
;
case
0x
00200018
:
conv
=
rgb24tobgr32
;
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