Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
0b8b3387
Commit
0b8b3387
authored
13 years ago
by
Paul B Mahol
Committed by
Ronald S. Bultje
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rgb2rgb: allow conversion for <15 bpp
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
0c50edb7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libswscale/swscale_unscaled.c
+31
-31
31 additions, 31 deletions
libswscale/swscale_unscaled.c
with
31 additions
and
31 deletions
libswscale/swscale_unscaled.c
+
31
−
31
View file @
0b8b3387
...
@@ -360,8 +360,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
...
@@ -360,8 +360,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
const
enum
PixelFormat
dstFormat
=
c
->
dstFormat
;
const
enum
PixelFormat
dstFormat
=
c
->
dstFormat
;
const
int
srcBpp
=
(
c
->
srcFormatBpp
+
7
)
>>
3
;
const
int
srcBpp
=
(
c
->
srcFormatBpp
+
7
)
>>
3
;
const
int
dstBpp
=
(
c
->
dstFormatBpp
+
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
srcId
=
c
->
srcFormatBpp
;
const
int
dstId
=
c
->
dstFormatBpp
>>
2
;
const
int
dstId
=
c
->
dstFormatBpp
;
void
(
*
conv
)(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
)
=
NULL
;
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)
#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[],
...
@@ -383,38 +383,38 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
/* BGR -> BGR */
/* BGR -> BGR */
if
((
isBGRinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
))
||
if
((
isBGRinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
))
||
(
isRGBinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
)))
{
(
isRGBinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
)))
{
switch
(
srcId
|
(
dstId
<<
4
))
{
switch
(
srcId
|
(
dstId
<<
16
))
{
case
0x
34
:
conv
=
rgb16to15
;
break
;
case
0x
000F0010
:
conv
=
rgb16to15
;
break
;
case
0x
36
:
conv
=
rgb24to15
;
break
;
case
0x
000F0018
:
conv
=
rgb24to15
;
break
;
case
0x
38
:
conv
=
rgb32to15
;
break
;
case
0x
000F0020
:
conv
=
rgb32to15
;
break
;
case
0x
43
:
conv
=
rgb15to16
;
break
;
case
0x
0010000F
:
conv
=
rgb15to16
;
break
;
case
0x
46
:
conv
=
rgb24to16
;
break
;
case
0x
00100018
:
conv
=
rgb24to16
;
break
;
case
0x
48
:
conv
=
rgb32to16
;
break
;
case
0x
00100020
:
conv
=
rgb32to16
;
break
;
case
0x
63
:
conv
=
rgb15to24
;
break
;
case
0x
0018000F
:
conv
=
rgb15to24
;
break
;
case
0x
64
:
conv
=
rgb16to24
;
break
;
case
0x
00180010
:
conv
=
rgb16to24
;
break
;
case
0x
68
:
conv
=
rgb32to24
;
break
;
case
0x
00180020
:
conv
=
rgb32to24
;
break
;
case
0x
83
:
conv
=
rgb15to32
;
break
;
case
0x
0020000F
:
conv
=
rgb15to32
;
break
;
case
0x
84
:
conv
=
rgb16to32
;
break
;
case
0x
00200010
:
conv
=
rgb16to32
;
break
;
case
0x8
6
:
conv
=
rgb24to32
;
break
;
case
0x
0020001
8
:
conv
=
rgb24to32
;
break
;
}
}
}
else
if
((
isBGRinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
))
||
}
else
if
((
isBGRinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
))
||
(
isRGBinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
)))
{
(
isRGBinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
)))
{
switch
(
srcId
|
(
dstId
<<
4
))
{
switch
(
srcId
|
(
dstId
<<
16
))
{
case
0x
33
:
conv
=
rgb15tobgr15
;
break
;
case
0x
000F000F
:
conv
=
rgb15tobgr15
;
break
;
case
0x
34
:
conv
=
rgb16tobgr15
;
break
;
case
0x
000F0010
:
conv
=
rgb16tobgr15
;
break
;
case
0x
36
:
conv
=
rgb24tobgr15
;
break
;
case
0x
000F0018
:
conv
=
rgb24tobgr15
;
break
;
case
0x
38
:
conv
=
rgb32tobgr15
;
break
;
case
0x
000F0020
:
conv
=
rgb32tobgr15
;
break
;
case
0x
43
:
conv
=
rgb15tobgr16
;
break
;
case
0x
0010000F
:
conv
=
rgb15tobgr16
;
break
;
case
0x
44
:
conv
=
rgb16tobgr16
;
break
;
case
0x
00100010
:
conv
=
rgb16tobgr16
;
break
;
case
0x
46
:
conv
=
rgb24tobgr16
;
break
;
case
0x
00100018
:
conv
=
rgb24tobgr16
;
break
;
case
0x
48
:
conv
=
rgb32tobgr16
;
break
;
case
0x
00100020
:
conv
=
rgb32tobgr16
;
break
;
case
0x
63
:
conv
=
rgb15tobgr24
;
break
;
case
0x
0018000F
:
conv
=
rgb15tobgr24
;
break
;
case
0x
64
:
conv
=
rgb16tobgr24
;
break
;
case
0x
00180010
:
conv
=
rgb16tobgr24
;
break
;
case
0x
66
:
conv
=
rgb24tobgr24
;
break
;
case
0x
00180018
:
conv
=
rgb24tobgr24
;
break
;
case
0x
68
:
conv
=
rgb32tobgr24
;
break
;
case
0x
00180020
:
conv
=
rgb32tobgr24
;
break
;
case
0x
83
:
conv
=
rgb15tobgr32
;
break
;
case
0x
0020000F
:
conv
=
rgb15tobgr32
;
break
;
case
0x
84
:
conv
=
rgb16tobgr32
;
break
;
case
0x
00200010
:
conv
=
rgb16tobgr32
;
break
;
case
0x8
6
:
conv
=
rgb24tobgr32
;
break
;
case
0x
0020001
8
:
conv
=
rgb24tobgr32
;
break
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment