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
a4b55bbb
Commit
a4b55bbb
authored
Jul 19, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale/input: fix 16bit gbrp input
Fixes Ticket2793 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
72f5a6d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
input.c
libswscale/input.c
+5
-3
No files found.
libswscale/input.c
View file @
a4b55bbb
...
...
@@ -754,12 +754,13 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr
const
uint16_t
**
src
=
(
const
uint16_t
**
)
_src
;
uint16_t
*
dst
=
(
uint16_t
*
)
_dst
;
int32_t
ry
=
rgb2yuv
[
RY_IDX
],
gy
=
rgb2yuv
[
GY_IDX
],
by
=
rgb2yuv
[
BY_IDX
];
int
shift
=
bpc
<
16
?
bpc
:
14
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
g
=
rdpx
(
src
[
0
]
+
i
);
int
b
=
rdpx
(
src
[
1
]
+
i
);
int
r
=
rdpx
(
src
[
2
]
+
i
);
dst
[
i
]
=
((
ry
*
r
+
gy
*
g
+
by
*
b
+
(
33
<<
(
RGB2YUV_SHIFT
+
bpc
-
9
)))
>>
(
RGB2YUV_SHIFT
+
bpc
-
14
));
dst
[
i
]
=
((
ry
*
r
+
gy
*
g
+
by
*
b
+
(
33
<<
(
RGB2YUV_SHIFT
+
bpc
-
9
)))
>>
(
RGB2YUV_SHIFT
+
shift
-
14
));
}
}
...
...
@@ -773,13 +774,14 @@ static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
uint16_t
*
dstV
=
(
uint16_t
*
)
_dstV
;
int32_t
ru
=
rgb2yuv
[
RU_IDX
],
gu
=
rgb2yuv
[
GU_IDX
],
bu
=
rgb2yuv
[
BU_IDX
];
int32_t
rv
=
rgb2yuv
[
RV_IDX
],
gv
=
rgb2yuv
[
GV_IDX
],
bv
=
rgb2yuv
[
BV_IDX
];
int
shift
=
bpc
<
16
?
bpc
:
14
;
for
(
i
=
0
;
i
<
width
;
i
++
)
{
int
g
=
rdpx
(
src
[
0
]
+
i
);
int
b
=
rdpx
(
src
[
1
]
+
i
);
int
r
=
rdpx
(
src
[
2
]
+
i
);
dstU
[
i
]
=
(
ru
*
r
+
gu
*
g
+
bu
*
b
+
(
257
<<
(
RGB2YUV_SHIFT
+
bpc
-
9
)))
>>
(
RGB2YUV_SHIFT
+
bpc
-
14
);
dstV
[
i
]
=
(
rv
*
r
+
gv
*
g
+
bv
*
b
+
(
257
<<
(
RGB2YUV_SHIFT
+
bpc
-
9
)))
>>
(
RGB2YUV_SHIFT
+
bpc
-
14
);
dstU
[
i
]
=
(
ru
*
r
+
gu
*
g
+
bu
*
b
+
(
257
<<
(
RGB2YUV_SHIFT
+
bpc
-
9
)))
>>
(
RGB2YUV_SHIFT
+
shift
-
14
);
dstV
[
i
]
=
(
rv
*
r
+
gv
*
g
+
bv
*
b
+
(
257
<<
(
RGB2YUV_SHIFT
+
bpc
-
9
)))
>>
(
RGB2YUV_SHIFT
+
shift
-
14
);
}
}
#undef rdpx
...
...
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