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
bcf64348
Commit
bcf64348
authored
Apr 16, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sws/fill_rgb2yuv_table: increase precission to 32bit
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2fa11a94
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
utils.c
libswscale/utils.c
+17
-13
No files found.
libswscale/utils.c
View file @
bcf64348
...
@@ -801,7 +801,7 @@ static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
...
@@ -801,7 +801,7 @@ static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
static
void
fill_rgb2yuv_table
(
SwsContext
*
c
,
const
int
table
[
4
],
int
dstRange
)
static
void
fill_rgb2yuv_table
(
SwsContext
*
c
,
const
int
table
[
4
],
int
dstRange
)
{
{
int64_t
W
,
V
,
Z
;
int64_t
W
,
V
,
Z
,
Cy
,
Cu
,
Cv
;
int64_t
vr
=
table
[
0
];
int64_t
vr
=
table
[
0
];
int64_t
ub
=
table
[
1
];
int64_t
ub
=
table
[
1
];
int64_t
ug
=
-
table
[
2
];
int64_t
ug
=
-
table
[
2
];
...
@@ -858,21 +858,25 @@ static void fill_rgb2yuv_table(SwsContext *c, const int table[4], int dstRange)
...
@@ -858,21 +858,25 @@ static void fill_rgb2yuv_table(SwsContext *c, const int table[4], int dstRange)
ug
=
ug
*
224
/
255
;
ug
=
ug
*
224
/
255
;
vg
=
vg
*
224
/
255
;
vg
=
vg
*
224
/
255
;
}
}
W
=
ONE
*
ug
/
ub
;
W
=
ONE
*
ONE
*
ug
/
ub
;
V
=
ONE
*
vg
/
vr
;
V
=
ONE
*
ONE
*
vg
/
vr
;
Z
=
ONE
-
W
-
V
;
Z
=
ONE
*
ONE
-
W
-
V
;
c
->
input_rgb2yuv_table
[
RY_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
V
/
(
Z
*
cy
)
;
Cy
=
cy
*
Z
/
ONE
;
c
->
input_rgb2yuv_table
[
GY_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
ONE
/
(
Z
*
cy
)
;
Cu
=
ub
*
Z
/
ONE
;
c
->
input_rgb2yuv_table
[
BY_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
W
/
(
Z
*
cy
)
;
Cv
=
vr
*
Z
/
ONE
;
c
->
input_rgb2yuv_table
[
R
U_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
V
/
(
Z
*
ub
)
;
c
->
input_rgb2yuv_table
[
R
Y_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
V
/
Cy
;
c
->
input_rgb2yuv_table
[
G
U_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
ONE
/
(
Z
*
ub
)
;
c
->
input_rgb2yuv_table
[
G
Y_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
ONE
/
Cy
;
c
->
input_rgb2yuv_table
[
B
U_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
(
Z
+
W
)
/
(
Z
*
ub
)
;
c
->
input_rgb2yuv_table
[
B
Y_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
W
/
Cy
;
c
->
input_rgb2yuv_table
[
RV_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
(
V
+
Z
)
/
(
Z
*
vr
);
c
->
input_rgb2yuv_table
[
RU_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
V
/
Cu
;
c
->
input_rgb2yuv_table
[
GV_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
ONE
/
(
Z
*
vr
);
c
->
input_rgb2yuv_table
[
GU_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
ONE
/
Cu
;
c
->
input_rgb2yuv_table
[
BV_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
W
/
(
Z
*
vr
);
c
->
input_rgb2yuv_table
[
BU_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
(
Z
+
W
)
/
Cu
;
c
->
input_rgb2yuv_table
[
RV_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
(
V
+
Z
)
/
Cv
;
c
->
input_rgb2yuv_table
[
GV_IDX
]
=
-
(
1
<<
RGB2YUV_SHIFT
)
*
ONE
*
ONE
/
Cv
;
c
->
input_rgb2yuv_table
[
BV_IDX
]
=
(
1
<<
RGB2YUV_SHIFT
)
*
W
/
Cv
;
if
(
/*!dstRange && */
table
==
ff_yuv2rgb_coeffs
[
SWS_CS_DEFAULT
])
{
if
(
/*!dstRange && */
table
==
ff_yuv2rgb_coeffs
[
SWS_CS_DEFAULT
])
{
c
->
input_rgb2yuv_table
[
BY_IDX
]
=
((
int
)(
0
.
114
*
219
/
255
*
(
1
<<
RGB2YUV_SHIFT
)
+
0
.
5
));
c
->
input_rgb2yuv_table
[
BY_IDX
]
=
((
int
)(
0
.
114
*
219
/
255
*
(
1
<<
RGB2YUV_SHIFT
)
+
0
.
5
));
...
...
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