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
2e31434d
Commit
2e31434d
authored
Dec 08, 2015
by
Hendrik Leppkes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: add P010 input support
parent
c2869b46
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
1 deletion
+58
-1
input.c
libswscale/input.c
+53
-0
swscale_unscaled.c
libswscale/swscale_unscaled.c
+3
-1
utils.c
libswscale/utils.c
+2
-0
No files found.
libswscale/input.c
View file @
2e31434d
...
...
@@ -679,6 +679,46 @@ static void nv21ToUV_c(uint8_t *dstU, uint8_t *dstV,
nvXXtoUV_c
(
dstV
,
dstU
,
src1
,
width
);
}
static
void
p010LEToY_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
AV_WN16
(
dst
+
i
*
2
,
AV_RL16
(
src
+
i
*
2
)
>>
6
);
}
}
static
void
p010BEToY_c
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
AV_WN16
(
dst
+
i
*
2
,
AV_RB16
(
src
+
i
*
2
)
>>
6
);
}
}
static
void
p010LEToUV_c
(
uint8_t
*
dstU
,
uint8_t
*
dstV
,
const
uint8_t
*
unused0
,
const
uint8_t
*
src1
,
const
uint8_t
*
src2
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
AV_WN16
(
dstU
+
i
*
2
,
AV_RL16
(
src1
+
i
*
4
+
0
)
>>
6
);
AV_WN16
(
dstV
+
i
*
2
,
AV_RL16
(
src1
+
i
*
4
+
2
)
>>
6
);
}
}
static
void
p010BEToUV_c
(
uint8_t
*
dstU
,
uint8_t
*
dstV
,
const
uint8_t
*
unused0
,
const
uint8_t
*
src1
,
const
uint8_t
*
src2
,
int
width
,
uint32_t
*
unused
)
{
int
i
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
AV_WN16
(
dstU
+
i
*
2
,
AV_RB16
(
src1
+
i
*
4
+
0
)
>>
6
);
AV_WN16
(
dstV
+
i
*
2
,
AV_RB16
(
src1
+
i
*
4
+
2
)
>>
6
);
}
}
#define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos))
static
void
bgr24ToY_c
(
uint8_t
*
_dst
,
const
uint8_t
*
src
,
const
uint8_t
*
unused1
,
const
uint8_t
*
unused2
,
...
...
@@ -1017,6 +1057,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case
AV_PIX_FMT_AYUV64LE
:
c
->
chrToYV12
=
read_ayuv64le_UV_c
;
break
;
case
AV_PIX_FMT_P010LE
:
c
->
chrToYV12
=
p010LEToUV_c
;
break
;
case
AV_PIX_FMT_P010BE
:
c
->
chrToYV12
=
p010BEToUV_c
;
break
;
}
if
(
c
->
chrSrcHSubSample
)
{
switch
(
srcFormat
)
{
...
...
@@ -1402,6 +1448,13 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
break
;
case
AV_PIX_FMT_BGRA64LE
:
c
->
lumToYV12
=
bgr64LEToY_c
;
break
;
case
AV_PIX_FMT_P010LE
:
c
->
lumToYV12
=
p010LEToY_c
;
break
;
case
AV_PIX_FMT_P010BE
:
c
->
lumToYV12
=
p010BEToY_c
;
break
;
}
if
(
c
->
alpPixBuf
)
{
if
(
is16BPS
(
srcFormat
)
||
isNBPS
(
srcFormat
))
{
...
...
libswscale/swscale_unscaled.c
View file @
2e31434d
...
...
@@ -1762,7 +1762,9 @@ void ff_get_unscaled_swscale(SwsContext *c)
c
->
chrDstHSubSample
==
c
->
chrSrcHSubSample
&&
c
->
chrDstVSubSample
==
c
->
chrSrcVSubSample
&&
dstFormat
!=
AV_PIX_FMT_NV12
&&
dstFormat
!=
AV_PIX_FMT_NV21
&&
srcFormat
!=
AV_PIX_FMT_NV12
&&
srcFormat
!=
AV_PIX_FMT_NV21
))
dstFormat
!=
AV_PIX_FMT_P010LE
&&
dstFormat
!=
AV_PIX_FMT_P010BE
&&
srcFormat
!=
AV_PIX_FMT_NV12
&&
srcFormat
!=
AV_PIX_FMT_NV21
&&
srcFormat
!=
AV_PIX_FMT_P010LE
&&
srcFormat
!=
AV_PIX_FMT_P010BE
))
{
if
(
isPacked
(
c
->
srcFormat
))
c
->
swscale
=
packedCopyWrapper
;
...
...
libswscale/utils.c
View file @
2e31434d
...
...
@@ -228,6 +228,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[
AV_PIX_FMT_XYZ12BE
]
=
{
1
,
1
,
1
},
[
AV_PIX_FMT_XYZ12LE
]
=
{
1
,
1
,
1
},
[
AV_PIX_FMT_AYUV64LE
]
=
{
1
,
1
},
[
AV_PIX_FMT_P010LE
]
=
{
1
,
0
},
[
AV_PIX_FMT_P010BE
]
=
{
1
,
0
},
};
int
sws_isSupportedInput
(
enum
AVPixelFormat
pix_fmt
)
...
...
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