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
a2f088c0
Commit
a2f088c0
authored
Apr 14, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: factor ff_sws_init_range_convert() out
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
3751e5a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
21 deletions
+28
-21
swscale.c
libswscale/swscale.c
+26
-21
swscale_internal.h
libswscale/swscale_internal.h
+2
-0
No files found.
libswscale/swscale.c
View file @
a2f088c0
...
...
@@ -705,6 +705,31 @@ static int swscale(SwsContext *c, const uint8_t *src[],
return
dstY
-
lastDstY
;
}
av_cold
void
ff_sws_init_range_convert
(
SwsContext
*
c
)
{
c
->
lumConvertRange
=
NULL
;
c
->
chrConvertRange
=
NULL
;
if
(
c
->
srcRange
!=
c
->
dstRange
&&
!
isAnyRGB
(
c
->
dstFormat
))
{
if
(
c
->
dstBpc
<=
14
)
{
if
(
c
->
srcRange
)
{
c
->
lumConvertRange
=
lumRangeFromJpeg_c
;
c
->
chrConvertRange
=
chrRangeFromJpeg_c
;
}
else
{
c
->
lumConvertRange
=
lumRangeToJpeg_c
;
c
->
chrConvertRange
=
chrRangeToJpeg_c
;
}
}
else
{
if
(
c
->
srcRange
)
{
c
->
lumConvertRange
=
lumRangeFromJpeg16_c
;
c
->
chrConvertRange
=
chrRangeFromJpeg16_c
;
}
else
{
c
->
lumConvertRange
=
lumRangeToJpeg16_c
;
c
->
chrConvertRange
=
chrRangeToJpeg16_c
;
}
}
}
}
static
av_cold
void
sws_init_swscale
(
SwsContext
*
c
)
{
enum
AVPixelFormat
srcFormat
=
c
->
srcFormat
;
...
...
@@ -731,27 +756,7 @@ static av_cold void sws_init_swscale(SwsContext *c)
:
hScale16To15_c
;
}
c
->
lumConvertRange
=
NULL
;
c
->
chrConvertRange
=
NULL
;
if
(
c
->
srcRange
!=
c
->
dstRange
&&
!
isAnyRGB
(
c
->
dstFormat
))
{
if
(
c
->
dstBpc
<=
14
)
{
if
(
c
->
srcRange
)
{
c
->
lumConvertRange
=
lumRangeFromJpeg_c
;
c
->
chrConvertRange
=
chrRangeFromJpeg_c
;
}
else
{
c
->
lumConvertRange
=
lumRangeToJpeg_c
;
c
->
chrConvertRange
=
chrRangeToJpeg_c
;
}
}
else
{
if
(
c
->
srcRange
)
{
c
->
lumConvertRange
=
lumRangeFromJpeg16_c
;
c
->
chrConvertRange
=
chrRangeFromJpeg16_c
;
}
else
{
c
->
lumConvertRange
=
lumRangeToJpeg16_c
;
c
->
chrConvertRange
=
chrRangeToJpeg16_c
;
}
}
}
ff_sws_init_range_convert
(
c
);
if
(
!
(
isGray
(
srcFormat
)
||
isGray
(
c
->
dstFormat
)
||
srcFormat
==
AV_PIX_FMT_MONOBLACK
||
srcFormat
==
AV_PIX_FMT_MONOWHITE
))
...
...
libswscale/swscale_internal.h
View file @
a2f088c0
...
...
@@ -617,6 +617,8 @@ void ff_yuv2rgb_init_tables_ppc(SwsContext *c, const int inv_table[4],
void
updateMMXDitherTables
(
SwsContext
*
c
,
int
dstY
,
int
lumBufIndex
,
int
chrBufIndex
,
int
lastInLumBuf
,
int
lastInChrBuf
);
av_cold
void
ff_sws_init_range_convert
(
SwsContext
*
c
);
SwsFunc
ff_yuv2rgb_init_x86
(
SwsContext
*
c
);
SwsFunc
ff_yuv2rgb_init_ppc
(
SwsContext
*
c
);
SwsFunc
ff_yuv2rgb_init_bfin
(
SwsContext
*
c
);
...
...
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