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
0cc1a86d
Commit
0cc1a86d
authored
Jan 12, 2012
by
Paul B Mahol
Committed by
Ronald S. Bultje
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rgb2rgb: rgb12to15()
Signed-off-by:
Ronald S. Bultje
<
rsbultje@gmail.com
>
parent
06b0246d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
rgb2rgb.c
libswscale/rgb2rgb.c
+19
-0
rgb2rgb.h
libswscale/rgb2rgb.h
+1
-0
swscale_unscaled.c
libswscale/swscale_unscaled.c
+1
-0
No files found.
libswscale/rgb2rgb.c
View file @
0cc1a86d
...
...
@@ -183,6 +183,25 @@ void rgb16tobgr32(const uint8_t *src, uint8_t *dst, int src_size)
}
}
void
rgb12to15
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
)
{
const
uint16_t
*
end
;
uint16_t
*
d
=
(
uint16_t
*
)
dst
;
const
uint16_t
*
s
=
(
const
uint16_t
*
)
src
;
uint16_t
rgb
,
r
,
g
,
b
;
end
=
s
+
src_size
/
2
;
while
(
s
<
end
)
{
rgb
=
*
s
++
;
r
=
rgb
&
0xF00
;
g
=
rgb
&
0x0F0
;
b
=
rgb
&
0x00F
;
r
=
(
r
<<
3
)
|
((
r
&
0x800
)
>>
1
);
g
=
(
g
<<
2
)
|
((
g
&
0x080
)
>>
2
);
b
=
(
b
<<
1
)
|
(
b
>>
3
);
*
d
++
=
r
|
g
|
b
;
}
}
void
rgb16to24
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
)
{
const
uint16_t
*
end
;
...
...
libswscale/rgb2rgb.h
View file @
0cc1a86d
...
...
@@ -63,6 +63,7 @@ void rgb15to24(const uint8_t *src, uint8_t *dst, int src_size);
void
rgb15tobgr16
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb15tobgr15
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb12tobgr12
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb12to15
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
bgr8torgb8
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
shuffle_bytes_0321
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
...
...
libswscale/swscale_unscaled.c
View file @
0cc1a86d
...
...
@@ -389,6 +389,7 @@ static rgbConvFn findRgbConvFn(SwsContext *c)
if
((
isBGRinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
))
||
(
isRGBinInt
(
srcFormat
)
&&
isRGBinInt
(
dstFormat
)))
{
switch
(
srcId
|
(
dstId
<<
16
))
{
case
0x000F000C
:
conv
=
rgb12to15
;
break
;
case
0x000F0010
:
conv
=
rgb16to15
;
break
;
case
0x000F0018
:
conv
=
rgb24to15
;
break
;
case
0x000F0020
:
conv
=
rgb32to15
;
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