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
f84a1b59
Commit
f84a1b59
authored
Jul 20, 2014
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: support AV_PIX_FMT_YA16 as input
Based on a long debug session with Kostya.
parent
e9abafca
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
2 deletions
+49
-2
input.c
libswscale/input.c
+40
-0
swscale-test.c
libswscale/swscale-test.c
+3
-1
swscale_internal.h
libswscale/swscale_internal.h
+3
-1
swscale_unscaled.c
libswscale/swscale_unscaled.c
+1
-0
utils.c
libswscale/utils.c
+2
-0
No files found.
libswscale/input.c
View file @
f84a1b59
...
...
@@ -419,6 +419,38 @@ static void bswap16UV_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src1,
}
}
static
void
read_ya16le_gray_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
AV_WN16
(
dst
+
i
*
2
,
AV_RL16
(
src
+
i
*
4
));
}
static
void
read_ya16le_alpha_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
AV_WN16
(
dst
+
i
*
2
,
AV_RL16
(
src
+
i
*
4
+
2
));
}
static
void
read_ya16be_gray_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
AV_WN16
(
dst
+
i
*
2
,
AV_RB16
(
src
+
i
*
4
));
}
static
void
read_ya16be_alpha_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
AV_WN16
(
dst
+
i
*
2
,
AV_RB16
(
src
+
i
*
4
+
2
));
}
/* This is almost identical to the previous, end exists only because
* yuy2ToY/UV)(dst, src + 1, ...) would have 100% unaligned accesses. */
static
void
uyvyToY_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
int
width
,
...
...
@@ -987,6 +1019,14 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
c
->
alpToYV12
=
bswap16Y_c
;
break
;
#endif
case
AV_PIX_FMT_YA16LE
:
c
->
lumToYV12
=
read_ya16le_gray_c
;
c
->
alpToYV12
=
read_ya16le_alpha_c
;
break
;
case
AV_PIX_FMT_YA16BE
:
c
->
lumToYV12
=
read_ya16be_gray_c
;
c
->
alpToYV12
=
read_ya16be_alpha_c
;
break
;
case
AV_PIX_FMT_YUYV422
:
case
AV_PIX_FMT_YVYU422
:
case
AV_PIX_FMT_YA8
:
...
...
libswscale/swscale-test.c
View file @
f84a1b59
...
...
@@ -39,7 +39,9 @@
((x) == AV_PIX_FMT_GRAY8 || \
(x) == AV_PIX_FMT_YA8 || \
(x) == AV_PIX_FMT_GRAY16BE || \
(x) == AV_PIX_FMT_GRAY16LE)
(x) == AV_PIX_FMT_GRAY16LE || \
(x) == AV_PIX_FMT_YA16BE || \
(x) == AV_PIX_FMT_YA16LE)
#define hasChroma(x) \
(!(isGray(x) || \
(x) == AV_PIX_FMT_MONOBLACK || \
...
...
libswscale/swscale_internal.h
View file @
f84a1b59
...
...
@@ -608,7 +608,9 @@ static av_always_inline int isRGB(enum AVPixelFormat pix_fmt)
((x) == AV_PIX_FMT_GRAY8 || \
(x) == AV_PIX_FMT_YA8 || \
(x) == AV_PIX_FMT_GRAY16BE || \
(x) == AV_PIX_FMT_GRAY16LE)
(x) == AV_PIX_FMT_GRAY16LE || \
(x) == AV_PIX_FMT_YA16BE || \
(x) == AV_PIX_FMT_YA16LE)
#endif
#define isRGBinInt(x) \
...
...
libswscale/swscale_unscaled.c
View file @
f84a1b59
...
...
@@ -1053,6 +1053,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_BGR565
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_BGRA64
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_GRAY16
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_YA16
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_RGB444
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_RGB48
)
||
IS_DIFFERENT_ENDIANESS
(
srcFormat
,
dstFormat
,
AV_PIX_FMT_RGB555
)
||
...
...
libswscale/utils.c
View file @
f84a1b59
...
...
@@ -155,6 +155,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[
AV_PIX_FMT_BGR444LE
]
=
{
1
,
1
},
[
AV_PIX_FMT_BGR444BE
]
=
{
1
,
1
},
[
AV_PIX_FMT_YA8
]
=
{
1
,
0
},
[
AV_PIX_FMT_YA16BE
]
=
{
1
,
0
},
[
AV_PIX_FMT_YA16LE
]
=
{
1
,
0
},
[
AV_PIX_FMT_BGR48BE
]
=
{
1
,
1
},
[
AV_PIX_FMT_BGR48LE
]
=
{
1
,
1
},
[
AV_PIX_FMT_BGRA64BE
]
=
{
0
,
0
,
1
},
...
...
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