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
c0c32a37
Commit
c0c32a37
authored
Feb 14, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: Fix rounding in yuv2rgb_1_c_template()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2bc610dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
output.c
libswscale/output.c
+12
-12
No files found.
libswscale/output.c
View file @
c0c32a37
...
@@ -994,18 +994,18 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
...
@@ -994,18 +994,18 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
if
(
uvalpha
<
2048
)
{
if
(
uvalpha
<
2048
)
{
for
(
i
=
0
;
i
<
(
dstW
>>
1
);
i
++
)
{
for
(
i
=
0
;
i
<
(
dstW
>>
1
);
i
++
)
{
int
Y1
=
buf0
[
i
*
2
]
>>
7
;
int
Y1
=
(
buf0
[
i
*
2
]
+
64
)
>>
7
;
int
Y2
=
buf0
[
i
*
2
+
1
]
>>
7
;
int
Y2
=
(
buf0
[
i
*
2
+
1
]
+
64
)
>>
7
;
int
U
=
ubuf0
[
i
]
>>
7
;
int
U
=
(
ubuf0
[
i
]
+
64
)
>>
7
;
int
V
=
vbuf0
[
i
]
>>
7
;
int
V
=
(
vbuf0
[
i
]
+
64
)
>>
7
;
int
A1
,
A2
;
int
A1
,
A2
;
const
void
*
r
=
c
->
table_rV
[
V
+
YUVRGB_TABLE_HEADROOM
],
const
void
*
r
=
c
->
table_rV
[
V
+
YUVRGB_TABLE_HEADROOM
],
*
g
=
(
c
->
table_gU
[
U
+
YUVRGB_TABLE_HEADROOM
]
+
c
->
table_gV
[
V
+
YUVRGB_TABLE_HEADROOM
]),
*
g
=
(
c
->
table_gU
[
U
+
YUVRGB_TABLE_HEADROOM
]
+
c
->
table_gV
[
V
+
YUVRGB_TABLE_HEADROOM
]),
*
b
=
c
->
table_bU
[
U
+
YUVRGB_TABLE_HEADROOM
];
*
b
=
c
->
table_bU
[
U
+
YUVRGB_TABLE_HEADROOM
];
if
(
hasAlpha
)
{
if
(
hasAlpha
)
{
A1
=
abuf0
[
i
*
2
]
>>
7
;
A1
=
(
abuf0
[
i
*
2
]
+
64
)
>>
7
;
A2
=
abuf0
[
i
*
2
+
1
]
>>
7
;
A2
=
(
abuf0
[
i
*
2
+
1
]
+
64
)
>>
7
;
}
}
yuv2rgb_write
(
dest
,
i
,
Y1
,
Y2
,
hasAlpha
?
A1
:
0
,
hasAlpha
?
A2
:
0
,
yuv2rgb_write
(
dest
,
i
,
Y1
,
Y2
,
hasAlpha
?
A1
:
0
,
hasAlpha
?
A2
:
0
,
...
@@ -1014,18 +1014,18 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
...
@@ -1014,18 +1014,18 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0,
}
else
{
}
else
{
const
int16_t
*
ubuf1
=
ubuf
[
1
],
*
vbuf1
=
vbuf
[
1
];
const
int16_t
*
ubuf1
=
ubuf
[
1
],
*
vbuf1
=
vbuf
[
1
];
for
(
i
=
0
;
i
<
(
dstW
>>
1
);
i
++
)
{
for
(
i
=
0
;
i
<
(
dstW
>>
1
);
i
++
)
{
int
Y1
=
buf0
[
i
*
2
]
>>
7
;
int
Y1
=
(
buf0
[
i
*
2
]
+
64
)
>>
7
;
int
Y2
=
buf0
[
i
*
2
+
1
]
>>
7
;
int
Y2
=
(
buf0
[
i
*
2
+
1
]
+
64
)
>>
7
;
int
U
=
(
ubuf0
[
i
]
+
ubuf1
[
i
])
>>
8
;
int
U
=
(
ubuf0
[
i
]
+
ubuf1
[
i
]
+
128
)
>>
8
;
int
V
=
(
vbuf0
[
i
]
+
vbuf1
[
i
])
>>
8
;
int
V
=
(
vbuf0
[
i
]
+
vbuf1
[
i
]
+
128
)
>>
8
;
int
A1
,
A2
;
int
A1
,
A2
;
const
void
*
r
=
c
->
table_rV
[
V
+
YUVRGB_TABLE_HEADROOM
],
const
void
*
r
=
c
->
table_rV
[
V
+
YUVRGB_TABLE_HEADROOM
],
*
g
=
(
c
->
table_gU
[
U
+
YUVRGB_TABLE_HEADROOM
]
+
c
->
table_gV
[
V
+
YUVRGB_TABLE_HEADROOM
]),
*
g
=
(
c
->
table_gU
[
U
+
YUVRGB_TABLE_HEADROOM
]
+
c
->
table_gV
[
V
+
YUVRGB_TABLE_HEADROOM
]),
*
b
=
c
->
table_bU
[
U
+
YUVRGB_TABLE_HEADROOM
];
*
b
=
c
->
table_bU
[
U
+
YUVRGB_TABLE_HEADROOM
];
if
(
hasAlpha
)
{
if
(
hasAlpha
)
{
A1
=
abuf0
[
i
*
2
]
>>
7
;
A1
=
(
abuf0
[
i
*
2
]
+
64
)
>>
7
;
A2
=
abuf0
[
i
*
2
+
1
]
>>
7
;
A2
=
(
abuf0
[
i
*
2
+
1
]
+
64
)
>>
7
;
}
}
yuv2rgb_write
(
dest
,
i
,
Y1
,
Y2
,
hasAlpha
?
A1
:
0
,
hasAlpha
?
A2
:
0
,
yuv2rgb_write
(
dest
,
i
,
Y1
,
Y2
,
hasAlpha
?
A1
:
0
,
hasAlpha
?
A2
:
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