Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b4dc6880
Commit
b4dc6880
authored
Dec 16, 2011
by
Janne Grunau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: add endian conversion for RGB555 and RGB444 pixel formats
Add a macro to shorten the if condition.
parent
be1bafc3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
swscale_unscaled.c
libswscale/swscale_unscaled.c
+15
-10
No files found.
libswscale/swscale_unscaled.c
View file @
b4dc6880
...
@@ -688,6 +688,12 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
...
@@ -688,6 +688,12 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
return
srcSliceH
;
return
srcSliceH
;
}
}
#define IS_DIFFERENT_ENDIANESS(src_fmt, dst_fmt, pix_fmt) \
((src_fmt == pix_fmt ## BE && dst_fmt == pix_fmt ## LE) || \
(src_fmt == pix_fmt ## LE && dst_fmt == pix_fmt ## BE))
void
ff_get_unscaled_swscale
(
SwsContext
*
c
)
void
ff_get_unscaled_swscale
(
SwsContext
*
c
)
{
{
const
enum
PixelFormat
srcFormat
=
c
->
srcFormat
;
const
enum
PixelFormat
srcFormat
=
c
->
srcFormat
;
...
@@ -737,16 +743,15 @@ void ff_get_unscaled_swscale(SwsContext *c)
...
@@ -737,16 +743,15 @@ void ff_get_unscaled_swscale(SwsContext *c)
c
->
swScale
=
rgbToRgbWrapper
;
c
->
swScale
=
rgbToRgbWrapper
;
/* bswap 16 bits per pixel/component packed formats */
/* bswap 16 bits per pixel/component packed formats */
if
((
srcFormat
==
PIX_FMT_RGB48LE
&&
dstFormat
==
PIX_FMT_RGB48BE
)
||
if
(
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_BGR444
)
||
(
srcFormat
==
PIX_FMT_RGB48BE
&&
dstFormat
==
PIX_FMT_RGB48LE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_BGR48
)
||
(
srcFormat
==
PIX_FMT_BGR48LE
&&
dstFormat
==
PIX_FMT_BGR48BE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_BGR555
)
||
(
srcFormat
==
PIX_FMT_BGR48BE
&&
dstFormat
==
PIX_FMT_BGR48LE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_BGR565
)
||
(
srcFormat
==
PIX_FMT_GRAY16LE
&&
dstFormat
==
PIX_FMT_GRAY16BE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_GRAY16
)
||
(
srcFormat
==
PIX_FMT_GRAY16BE
&&
dstFormat
==
PIX_FMT_GRAY16LE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_RGB444
)
||
(
srcFormat
==
PIX_FMT_RGB565LE
&&
dstFormat
==
PIX_FMT_RGB565BE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_RGB48
)
||
(
srcFormat
==
PIX_FMT_RGB565BE
&&
dstFormat
==
PIX_FMT_RGB565LE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_RGB555
)
||
(
srcFormat
==
PIX_FMT_BGR565BE
&&
dstFormat
==
PIX_FMT_BGR565LE
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
PIX_FMT_RGB565
))
(
srcFormat
==
PIX_FMT_BGR565LE
&&
dstFormat
==
PIX_FMT_BGR565BE
))
c
->
swScale
=
packed_16bpc_bswap
;
c
->
swScale
=
packed_16bpc_bswap
;
if
((
usePal
(
srcFormat
)
&&
(
if
((
usePal
(
srcFormat
)
&&
(
...
...
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