Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
f2de9118
Commit
f2de9118
authored
Aug 10, 2022
by
Timo Rothenpieler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: add opaque parameter to input functions
parent
ef2c2a22
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
106 additions
and
85 deletions
+106
-85
hscale.c
libswscale/hscale.c
+6
-6
input.c
libswscale/input.c
+81
-68
swscale_internal.h
libswscale/swscale_internal.h
+11
-6
swscale.c
libswscale/x86/swscale.c
+8
-5
No files found.
libswscale/hscale.c
View file @
f2de9118
...
...
@@ -105,18 +105,18 @@ static int lum_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int
uint8_t
*
dst
=
desc
->
dst
->
plane
[
0
].
line
[
i
];
if
(
c
->
lumToYV12
)
{
c
->
lumToYV12
(
dst
,
src
[
0
],
src
[
1
],
src
[
2
],
srcW
,
pal
);
c
->
lumToYV12
(
dst
,
src
[
0
],
src
[
1
],
src
[
2
],
srcW
,
pal
,
c
->
input_opaque
);
}
else
if
(
c
->
readLumPlanar
)
{
c
->
readLumPlanar
(
dst
,
src
,
srcW
,
c
->
input_rgb2yuv_table
);
c
->
readLumPlanar
(
dst
,
src
,
srcW
,
c
->
input_rgb2yuv_table
,
c
->
input_opaque
);
}
if
(
desc
->
alpha
)
{
dst
=
desc
->
dst
->
plane
[
3
].
line
[
i
];
if
(
c
->
alpToYV12
)
{
c
->
alpToYV12
(
dst
,
src
[
3
],
src
[
1
],
src
[
2
],
srcW
,
pal
);
c
->
alpToYV12
(
dst
,
src
[
3
],
src
[
1
],
src
[
2
],
srcW
,
pal
,
c
->
input_opaque
);
}
else
if
(
c
->
readAlpPlanar
)
{
c
->
readAlpPlanar
(
dst
,
src
,
srcW
,
NULL
);
c
->
readAlpPlanar
(
dst
,
src
,
srcW
,
NULL
,
c
->
input_opaque
);
}
}
}
...
...
@@ -224,9 +224,9 @@ static int chr_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int
uint8_t
*
dst1
=
desc
->
dst
->
plane
[
1
].
line
[
i
];
uint8_t
*
dst2
=
desc
->
dst
->
plane
[
2
].
line
[
i
];
if
(
c
->
chrToYV12
)
{
c
->
chrToYV12
(
dst1
,
dst2
,
src
[
0
],
src
[
1
],
src
[
2
],
srcW
,
pal
);
c
->
chrToYV12
(
dst1
,
dst2
,
src
[
0
],
src
[
1
],
src
[
2
],
srcW
,
pal
,
c
->
input_opaque
);
}
else
if
(
c
->
readChrPlanar
)
{
c
->
readChrPlanar
(
dst1
,
dst2
,
src
,
srcW
,
c
->
input_rgb2yuv_table
);
c
->
readChrPlanar
(
dst1
,
dst2
,
src
,
srcW
,
c
->
input_rgb2yuv_table
,
c
->
input_opaque
);
}
}
return
sliceH
;
...
...
libswscale/input.c
View file @
f2de9118
This diff is collapsed.
Click to expand it.
libswscale/swscale_internal.h
View file @
f2de9118
...
...
@@ -559,26 +559,31 @@ typedef struct SwsContext {
yuv2packedX_fn
yuv2packedX
;
yuv2anyX_fn
yuv2anyX
;
/// Opaque data pointer passed to all input functions.
void
*
input_opaque
;
/// Unscaled conversion of luma plane to YV12 for horizontal scaler.
void
(
*
lumToYV12
)(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
src2
,
const
uint8_t
*
src3
,
int
width
,
uint32_t
*
pal
);
int
width
,
uint32_t
*
pal
,
void
*
opq
);
/// Unscaled conversion of alpha plane to YV12 for horizontal scaler.
void
(
*
alpToYV12
)(
uint8_t
*
dst
,
const
uint8_t
*
src
,
const
uint8_t
*
src2
,
const
uint8_t
*
src3
,
int
width
,
uint32_t
*
pal
);
int
width
,
uint32_t
*
pal
,
void
*
opq
);
/// Unscaled conversion of chroma planes to YV12 for horizontal scaler.
void
(
*
chrToYV12
)(
uint8_t
*
dstU
,
uint8_t
*
dstV
,
const
uint8_t
*
src1
,
const
uint8_t
*
src2
,
const
uint8_t
*
src3
,
int
width
,
uint32_t
*
pal
);
int
width
,
uint32_t
*
pal
,
void
*
opq
);
/**
* Functions to read planar input, such as planar RGB, and convert
* internally to Y/UV/A.
*/
/** @{ */
void
(
*
readLumPlanar
)(
uint8_t
*
dst
,
const
uint8_t
*
src
[
4
],
int
width
,
int32_t
*
rgb2yuv
);
void
(
*
readLumPlanar
)(
uint8_t
*
dst
,
const
uint8_t
*
src
[
4
],
int
width
,
int32_t
*
rgb2yuv
,
void
*
opq
);
void
(
*
readChrPlanar
)(
uint8_t
*
dstU
,
uint8_t
*
dstV
,
const
uint8_t
*
src
[
4
],
int
width
,
int32_t
*
rgb2yuv
);
void
(
*
readAlpPlanar
)(
uint8_t
*
dst
,
const
uint8_t
*
src
[
4
],
int
width
,
int32_t
*
rgb2yuv
);
int
width
,
int32_t
*
rgb2yuv
,
void
*
opq
);
void
(
*
readAlpPlanar
)(
uint8_t
*
dst
,
const
uint8_t
*
src
[
4
],
int
width
,
int32_t
*
rgb2yuv
,
void
*
opq
);
/** @} */
/**
...
...
libswscale/x86/swscale.c
View file @
f2de9118
...
...
@@ -296,13 +296,13 @@ VSCALE_FUNCS(avx, avx);
#define INPUT_Y_FUNC(fmt, opt) \
void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \
const uint8_t *unused1, const uint8_t *unused2, \
int w, uint32_t *unused)
int w, uint32_t *unused
, void *opq
)
#define INPUT_UV_FUNC(fmt, opt) \
void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \
const uint8_t *unused0, \
const uint8_t *src1, \
const uint8_t *src2, \
int w, uint32_t *unused)
int w, uint32_t *unused
, void *opq
)
#define INPUT_FUNC(fmt, opt) \
INPUT_Y_FUNC(fmt, opt); \
INPUT_UV_FUNC(fmt, opt)
...
...
@@ -370,15 +370,18 @@ YUV2GBRP_DECL(avx2);
#define INPUT_PLANAR_RGB_Y_FN_DECL(fmt, opt) \
void ff_planar_##fmt##_to_y_##opt(uint8_t *dst, \
const uint8_t *src[4], int w, int32_t *rgb2yuv)
const uint8_t *src[4], int w, int32_t *rgb2yuv, \
void *opq)
#define INPUT_PLANAR_RGB_UV_FN_DECL(fmt, opt) \
void ff_planar_##fmt##_to_uv_##opt(uint8_t *dstU, uint8_t *dstV, \
const uint8_t *src[4], int w, int32_t *rgb2yuv)
const uint8_t *src[4], int w, int32_t *rgb2yuv, \
void *opq)
#define INPUT_PLANAR_RGB_A_FN_DECL(fmt, opt) \
void ff_planar_##fmt##_to_a_##opt(uint8_t *dst, \
const uint8_t *src[4], int w, int32_t *rgb2yuv)
const uint8_t *src[4], int w, int32_t *rgb2yuv, \
void *opq)
#define INPUT_PLANAR_RGBXX_A_DECL(fmt, opt) \
...
...
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