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
987e4c17
Commit
987e4c17
authored
Jul 03, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sws: fix rgb -> 16bit
parent
b5ff6169
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
swscale.c
libswscale/swscale.c
+7
-4
swscale_template.c
libswscale/x86/swscale_template.c
+1
-1
No files found.
libswscale/swscale.c
View file @
987e4c17
...
@@ -1979,6 +1979,9 @@ static void hScale16_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_s
...
@@ -1979,6 +1979,9 @@ static void hScale16_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_s
int
bits
=
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
;
int
bits
=
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
;
int
sh
=
(
bits
<=
7
)
?
11
:
(
bits
-
4
);
int
sh
=
(
bits
<=
7
)
?
11
:
(
bits
-
4
);
if
((
isAnyRGB
(
c
->
srcFormat
)
||
c
->
srcFormat
==
PIX_FMT_PAL8
)
&&
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
15
)
sh
=
9
;
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
for
(
i
=
0
;
i
<
dstW
;
i
++
)
{
int
j
;
int
j
;
int
srcPos
=
filterPos
[
i
];
int
srcPos
=
filterPos
[
i
];
...
@@ -2154,7 +2157,7 @@ static av_always_inline void hyscale(SwsContext *c, int16_t *dst, int dstWidth,
...
@@ -2154,7 +2157,7 @@ static av_always_inline void hyscale(SwsContext *c, int16_t *dst, int dstWidth,
src
=
formatConvBuffer
;
src
=
formatConvBuffer
;
}
}
if
(
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
8
&&
c
->
scalingBpp
==
16
)
{
if
(
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
8
&&
c
->
scalingBpp
==
16
&&
!
isAnyRGB
(
c
->
srcFormat
)
)
{
c
->
scale8To16Rv
((
uint16_t
*
)
formatConvBuffer
,
src
,
srcW
);
c
->
scale8To16Rv
((
uint16_t
*
)
formatConvBuffer
,
src
,
srcW
);
src
=
formatConvBuffer
;
src
=
formatConvBuffer
;
}
}
...
@@ -2208,7 +2211,7 @@ static av_always_inline void hcscale(SwsContext *c, int16_t *dst1, int16_t *dst2
...
@@ -2208,7 +2211,7 @@ static av_always_inline void hcscale(SwsContext *c, int16_t *dst1, int16_t *dst2
src2
=
buf2
;
src2
=
buf2
;
}
}
if
(
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
8
&&
c
->
scalingBpp
==
16
)
{
if
(
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
8
&&
c
->
scalingBpp
==
16
&&
!
isAnyRGB
(
c
->
srcFormat
)
)
{
uint8_t
*
buf2
=
(
formatConvBuffer
+
FFALIGN
(
srcW
*
2
+
78
,
16
));
uint8_t
*
buf2
=
(
formatConvBuffer
+
FFALIGN
(
srcW
*
2
+
78
,
16
));
c
->
scale8To16Rv
((
uint16_t
*
)
formatConvBuffer
,
src1
,
srcW
);
c
->
scale8To16Rv
((
uint16_t
*
)
formatConvBuffer
,
src1
,
srcW
);
c
->
scale8To16Rv
((
uint16_t
*
)
buf2
,
src2
,
srcW
);
c
->
scale8To16Rv
((
uint16_t
*
)
buf2
,
src2
,
srcW
);
...
@@ -2878,8 +2881,8 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
...
@@ -2878,8 +2881,8 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
}
}
}
}
if
((
isAnyRGB
(
c
->
srcFormat
)
&&
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
15
)
if
((
(
isAnyRGB
(
c
->
srcFormat
)
&&
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
15
)
||
c
->
srcFormat
==
PIX_FMT_PAL8
)
||
c
->
srcFormat
==
PIX_FMT_PAL8
)
&&
c
->
scalingBpp
==
8
)
c
->
hScale16
=
hScale16N_c
;
c
->
hScale16
=
hScale16N_c
;
if
(
c
->
scalingBpp
==
8
)
{
if
(
c
->
scalingBpp
==
8
)
{
...
...
libswscale/x86/swscale_template.c
View file @
987e4c17
...
@@ -2438,6 +2438,6 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
...
@@ -2438,6 +2438,6 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
}
}
}
}
#endif
/* !COMPILE_TEMPLATE_MMX2 */
#endif
/* !COMPILE_TEMPLATE_MMX2 */
if
(
isAnyRGB
(
c
->
srcFormat
)
&&
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
15
)
if
(
isAnyRGB
(
c
->
srcFormat
)
&&
av_pix_fmt_descriptors
[
c
->
srcFormat
].
comp
[
0
].
depth_minus1
<
15
&&
c
->
scalingBpp
==
8
)
c
->
hScale16
=
RENAME
(
hScale16
);
c
->
hScale16
=
RENAME
(
hScale16
);
}
}
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