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
bc0bdda7
Commit
bc0bdda7
authored
Apr 04, 2012
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: handle complete dimensions for monoblack/white.
Fixes bug 269.
parent
e484265c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
input.c
libswscale/input.c
+4
-2
output.c
libswscale/output.c
+7
-3
No files found.
libswscale/input.c
View file @
bc0bdda7
...
@@ -309,7 +309,8 @@ static void monowhite2Y_c(uint8_t *dst, const uint8_t *src,
...
@@ -309,7 +309,8 @@ static void monowhite2Y_c(uint8_t *dst, const uint8_t *src,
int
width
,
uint32_t
*
unused
)
int
width
,
uint32_t
*
unused
)
{
{
int
i
,
j
;
int
i
,
j
;
for
(
i
=
0
;
i
<
width
/
8
;
i
++
)
{
width
=
(
width
+
7
)
>>
3
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
d
=
~
src
[
i
];
int
d
=
~
src
[
i
];
for
(
j
=
0
;
j
<
8
;
j
++
)
for
(
j
=
0
;
j
<
8
;
j
++
)
dst
[
8
*
i
+
j
]
=
((
d
>>
(
7
-
j
))
&
1
)
*
255
;
dst
[
8
*
i
+
j
]
=
((
d
>>
(
7
-
j
))
&
1
)
*
255
;
...
@@ -320,7 +321,8 @@ static void monoblack2Y_c(uint8_t *dst, const uint8_t *src,
...
@@ -320,7 +321,8 @@ static void monoblack2Y_c(uint8_t *dst, const uint8_t *src,
int
width
,
uint32_t
*
unused
)
int
width
,
uint32_t
*
unused
)
{
{
int
i
,
j
;
int
i
,
j
;
for
(
i
=
0
;
i
<
width
/
8
;
i
++
)
{
width
=
(
width
+
7
)
>>
3
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
d
=
src
[
i
];
int
d
=
src
[
i
];
for
(
j
=
0
;
j
<
8
;
j
++
)
for
(
j
=
0
;
j
<
8
;
j
++
)
dst
[
8
*
i
+
j
]
=
((
d
>>
(
7
-
j
))
&
1
)
*
255
;
dst
[
8
*
i
+
j
]
=
((
d
>>
(
7
-
j
))
&
1
)
*
255
;
...
...
libswscale/output.c
View file @
bc0bdda7
...
@@ -317,7 +317,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
...
@@ -317,7 +317,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
int
i
;
int
i
;
unsigned
acc
=
0
;
unsigned
acc
=
0
;
for
(
i
=
0
;
i
<
dstW
-
1
;
i
+=
2
)
{
for
(
i
=
0
;
i
<
dstW
;
i
+=
2
)
{
int
j
;
int
j
;
int
Y1
=
1
<<
18
;
int
Y1
=
1
<<
18
;
int
Y2
=
1
<<
18
;
int
Y2
=
1
<<
18
;
...
@@ -338,6 +338,10 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
...
@@ -338,6 +338,10 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter,
output_pixel
(
*
dest
++
,
acc
);
output_pixel
(
*
dest
++
,
acc
);
}
}
}
}
if
(
i
&
6
)
{
output_pixel
(
*
dest
,
acc
);
}
}
}
static
av_always_inline
void
static
av_always_inline
void
...
@@ -352,7 +356,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
...
@@ -352,7 +356,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2],
int
yalpha1
=
4095
-
yalpha
;
int
yalpha1
=
4095
-
yalpha
;
int
i
;
int
i
;
for
(
i
=
0
;
i
<
dstW
-
7
;
i
+=
8
)
{
for
(
i
=
0
;
i
<
dstW
;
i
+=
8
)
{
int
Y
,
acc
=
0
;
int
Y
,
acc
=
0
;
Y
=
(
buf0
[
i
+
0
]
*
yalpha1
+
buf1
[
i
+
0
]
*
yalpha
)
>>
19
;
Y
=
(
buf0
[
i
+
0
]
*
yalpha1
+
buf1
[
i
+
0
]
*
yalpha
)
>>
19
;
...
@@ -385,7 +389,7 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
...
@@ -385,7 +389,7 @@ yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0,
const
uint8_t
*
const
d128
=
dither_8x8_220
[
y
&
7
];
const
uint8_t
*
const
d128
=
dither_8x8_220
[
y
&
7
];
int
i
;
int
i
;
for
(
i
=
0
;
i
<
dstW
-
7
;
i
+=
8
)
{
for
(
i
=
0
;
i
<
dstW
;
i
+=
8
)
{
int
acc
=
0
;
int
acc
=
0
;
accumulate_bit
(
acc
,
(
buf0
[
i
+
0
]
>>
7
)
+
d128
[
0
]);
accumulate_bit
(
acc
,
(
buf0
[
i
+
0
]
>>
7
)
+
d128
[
0
]);
...
...
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