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
6b7849e6
Commit
6b7849e6
authored
Jul 18, 2012
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: unscaled rgba64->rgb48
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
b4befca2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
0 deletions
+30
-0
colorspace-test.c
libswscale/colorspace-test.c
+2
-0
rgb2rgb.c
libswscale/rgb2rgb.c
+18
-0
rgb2rgb.h
libswscale/rgb2rgb.h
+2
-0
swscale_unscaled.c
libswscale/swscale_unscaled.c
+8
-0
No files found.
libswscale/colorspace-test.c
View file @
6b7849e6
...
...
@@ -86,6 +86,8 @@ int main(int argc, char **argv)
FUNC
(
4
,
4
,
shuffle_bytes_2103
),
/* rgb32tobgr32 */
FUNC
(
6
,
6
,
rgb48tobgr48_nobswap
),
FUNC
(
6
,
6
,
rgb48tobgr48_bswap
),
FUNC
(
8
,
6
,
rgb64to48_nobswap
),
FUNC
(
8
,
6
,
rgb64to48_bswap
),
FUNC
(
8
,
6
,
rgb64tobgr48_nobswap
),
FUNC
(
8
,
6
,
rgb64tobgr48_bswap
),
FUNC
(
0
,
0
,
NULL
)
...
...
libswscale/rgb2rgb.c
View file @
6b7849e6
...
...
@@ -369,3 +369,21 @@ void rgb64tobgr48_ ## need_bswap(const uint8_t *src, \
DEFINE_RGB64TOBGR48
(
nobswap
,
0
)
DEFINE_RGB64TOBGR48
(
bswap
,
1
)
#define DEFINE_RGB64TO48(need_bswap, swap) \
void rgb64to48_ ## need_bswap(const uint8_t *src, \
uint8_t *dst, int src_size) \
{ \
uint16_t *d = (uint16_t *)dst; \
uint16_t *s = (uint16_t *)src; \
int i, num_pixels = src_size >> 3; \
\
for (i = 0; i < num_pixels; i++) { \
d[3 * i ] = swap ? av_bswap16(s[4 * i ]) : s[4 * i ]; \
d[3 * i + 1] = swap ? av_bswap16(s[4 * i + 1]) : s[4 * i + 1]; \
d[3 * i + 2] = swap ? av_bswap16(s[4 * i + 2]) : s[4 * i + 2]; \
} \
}
DEFINE_RGB64TO48
(
nobswap
,
0
)
DEFINE_RGB64TO48
(
bswap
,
1
)
libswscale/rgb2rgb.h
View file @
6b7849e6
...
...
@@ -56,6 +56,8 @@ void rgb64tobgr48_nobswap(const uint8_t *src, uint8_t *dst, int src_size);
void
rgb64tobgr48_bswap
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb48tobgr48_nobswap
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb48tobgr48_bswap
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb64to48_nobswap
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb64to48_bswap
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb24to32
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb32to24
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
void
rgb16tobgr32
(
const
uint8_t
*
src
,
uint8_t
*
dst
,
int
src_size
);
...
...
libswscale/swscale_unscaled.c
View file @
6b7849e6
...
...
@@ -582,6 +582,14 @@ static rgbConvFn findRgbConvFn(SwsContext *c)
||
CONV_IS
(
BGRA64LE
,
RGB48BE
)
||
CONV_IS
(
RGBA64BE
,
BGR48LE
)
||
CONV_IS
(
BGRA64BE
,
RGB48LE
))
conv
=
rgb64tobgr48_bswap
;
else
if
(
CONV_IS
(
RGBA64LE
,
RGB48LE
)
||
CONV_IS
(
BGRA64LE
,
BGR48LE
)
||
CONV_IS
(
RGBA64BE
,
RGB48BE
)
||
CONV_IS
(
BGRA64BE
,
BGR48BE
))
conv
=
rgb64to48_nobswap
;
else
if
(
CONV_IS
(
RGBA64LE
,
RGB48BE
)
||
CONV_IS
(
BGRA64LE
,
BGR48BE
)
||
CONV_IS
(
RGBA64BE
,
RGB48LE
)
||
CONV_IS
(
BGRA64BE
,
BGR48LE
))
conv
=
rgb64to48_bswap
;
}
else
/* BGR -> BGR */
if
((
isBGRinInt
(
srcFormat
)
&&
isBGRinInt
(
dstFormat
))
||
...
...
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