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
be3c29e3
Commit
be3c29e3
authored
Apr 02, 2020
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale/yuv2rgb: Fix vertical dither offset with slices
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
4fa4ab97
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
yuv2rgb.c
libswscale/yuv2rgb.c
+22
-21
No files found.
libswscale/yuv2rgb.c
View file @
be3c29e3
...
@@ -138,10 +138,11 @@ const int *sws_getCoefficients(int colorspace)
...
@@ -138,10 +138,11 @@ const int *sws_getCoefficients(int colorspace)
srcStride[2] *= 2; \
srcStride[2] *= 2; \
} \
} \
for (y = 0; y < srcSliceH; y += 2) { \
for (y = 0; y < srcSliceH; y += 2) { \
int yd = y + srcSliceY; \
dst_type *dst_1 = \
dst_type *dst_1 = \
(dst_type *)(dst[0] + (y
+ srcSliceY) * dstStride[0]);
\
(dst_type *)(dst[0] + (y
d) * dstStride[0]);
\
dst_type *dst_2 = \
dst_type *dst_2 = \
(dst_type *)(dst[0] + (y
+ srcSliceY + 1) * dstStride[0]);
\
(dst_type *)(dst[0] + (y
d + 1) * dstStride[0]);
\
dst_type av_unused *r, *g, *b; \
dst_type av_unused *r, *g, *b; \
const uint8_t *py_1 = src[0] + y * srcStride[0]; \
const uint8_t *py_1 = src[0] + y * srcStride[0]; \
const uint8_t *py_2 = py_1 + srcStride[0]; \
const uint8_t *py_2 = py_1 + srcStride[0]; \
...
@@ -498,8 +499,8 @@ CLOSEYUV2RGBFUNC(8)
...
@@ -498,8 +499,8 @@ CLOSEYUV2RGBFUNC(8)
// r, g, b, dst_1, dst_2
// r, g, b, dst_1, dst_2
YUV2RGBFUNC
(
yuv2rgb_c_8_ordered_dither
,
uint8_t
,
0
)
YUV2RGBFUNC
(
yuv2rgb_c_8_ordered_dither
,
uint8_t
,
0
)
const
uint8_t
*
d32
=
ff_dither_8x8_32
[
y
&
7
];
const
uint8_t
*
d32
=
ff_dither_8x8_32
[
y
d
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
#define PUTRGB8(dst, src, i, o) \
#define PUTRGB8(dst, src, i, o) \
Y = src[2 * i]; \
Y = src[2 * i]; \
...
@@ -528,8 +529,8 @@ YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0)
...
@@ -528,8 +529,8 @@ YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0)
PUTRGB8
(
dst_1
,
py_1
,
3
,
6
);
PUTRGB8
(
dst_1
,
py_1
,
3
,
6
);
ENDYUV2RGBLINE
(
8
,
0
)
ENDYUV2RGBLINE
(
8
,
0
)
const
uint8_t
*
d32
=
ff_dither_8x8_32
[
y
&
7
];
const
uint8_t
*
d32
=
ff_dither_8x8_32
[
y
d
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
LOADCHROMA
(
0
);
LOADCHROMA
(
0
);
PUTRGB8
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB8
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB8
(
dst_2
,
py_2
,
0
,
0
+
8
);
PUTRGB8
(
dst_2
,
py_2
,
0
,
0
+
8
);
...
@@ -539,8 +540,8 @@ ENDYUV2RGBLINE(8, 0)
...
@@ -539,8 +540,8 @@ ENDYUV2RGBLINE(8, 0)
PUTRGB8
(
dst_1
,
py_1
,
1
,
2
);
PUTRGB8
(
dst_1
,
py_1
,
1
,
2
);
ENDYUV2RGBLINE
(
8
,
1
)
ENDYUV2RGBLINE
(
8
,
1
)
const
uint8_t
*
d32
=
ff_dither_8x8_32
[
y
&
7
];
const
uint8_t
*
d32
=
ff_dither_8x8_32
[
y
d
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
LOADCHROMA
(
0
);
LOADCHROMA
(
0
);
PUTRGB8
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB8
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB8
(
dst_2
,
py_2
,
0
,
0
+
8
);
PUTRGB8
(
dst_2
,
py_2
,
0
,
0
+
8
);
...
@@ -549,8 +550,8 @@ ENDYUV2RGBFUNC()
...
@@ -549,8 +550,8 @@ ENDYUV2RGBFUNC()
YUV2RGBFUNC
(
yuv2rgb_c_4_ordered_dither
,
uint8_t
,
0
)
YUV2RGBFUNC
(
yuv2rgb_c_4_ordered_dither
,
uint8_t
,
0
)
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
int
acc
;
int
acc
;
#define PUTRGB4D(dst, src, i, o) \
#define PUTRGB4D(dst, src, i, o) \
...
@@ -581,8 +582,8 @@ YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0)
...
@@ -581,8 +582,8 @@ YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0)
PUTRGB4D
(
dst_1
,
py_1
,
3
,
6
);
PUTRGB4D
(
dst_1
,
py_1
,
3
,
6
);
ENDYUV2RGBLINE
(
4
,
0
)
ENDYUV2RGBLINE
(
4
,
0
)
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
int
acc
;
int
acc
;
LOADCHROMA
(
0
);
LOADCHROMA
(
0
);
PUTRGB4D
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB4D
(
dst_1
,
py_1
,
0
,
0
);
...
@@ -593,8 +594,8 @@ ENDYUV2RGBLINE(4, 0)
...
@@ -593,8 +594,8 @@ ENDYUV2RGBLINE(4, 0)
PUTRGB4D
(
dst_1
,
py_1
,
1
,
2
);
PUTRGB4D
(
dst_1
,
py_1
,
1
,
2
);
ENDYUV2RGBLINE
(
4
,
1
)
ENDYUV2RGBLINE
(
4
,
1
)
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
int
acc
;
int
acc
;
LOADCHROMA
(
0
);
LOADCHROMA
(
0
);
PUTRGB4D
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB4D
(
dst_1
,
py_1
,
0
,
0
);
...
@@ -602,8 +603,8 @@ ENDYUV2RGBLINE(4, 1)
...
@@ -602,8 +603,8 @@ ENDYUV2RGBLINE(4, 1)
ENDYUV2RGBFUNC
()
ENDYUV2RGBFUNC
()
YUV2RGBFUNC
(
yuv2rgb_c_4b_ordered_dither
,
uint8_t
,
0
)
YUV2RGBFUNC
(
yuv2rgb_c_4b_ordered_dither
,
uint8_t
,
0
)
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
#define PUTRGB4DB(dst, src, i, o) \
#define PUTRGB4DB(dst, src, i, o) \
Y = src[2 * i]; \
Y = src[2 * i]; \
...
@@ -631,8 +632,8 @@ YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0)
...
@@ -631,8 +632,8 @@ YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0)
PUTRGB4DB
(
dst_2
,
py_2
,
3
,
6
+
8
);
PUTRGB4DB
(
dst_2
,
py_2
,
3
,
6
+
8
);
PUTRGB4DB
(
dst_1
,
py_1
,
3
,
6
);
PUTRGB4DB
(
dst_1
,
py_1
,
3
,
6
);
ENDYUV2RGBLINE
(
8
,
0
)
ENDYUV2RGBLINE
(
8
,
0
)
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
LOADCHROMA
(
0
);
LOADCHROMA
(
0
);
PUTRGB4DB
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB4DB
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB4DB
(
dst_2
,
py_2
,
0
,
0
+
8
);
PUTRGB4DB
(
dst_2
,
py_2
,
0
,
0
+
8
);
...
@@ -641,15 +642,15 @@ ENDYUV2RGBLINE(8, 0)
...
@@ -641,15 +642,15 @@ ENDYUV2RGBLINE(8, 0)
PUTRGB4DB
(
dst_2
,
py_2
,
1
,
2
+
8
);
PUTRGB4DB
(
dst_2
,
py_2
,
1
,
2
+
8
);
PUTRGB4DB
(
dst_1
,
py_1
,
1
,
2
);
PUTRGB4DB
(
dst_1
,
py_1
,
1
,
2
);
ENDYUV2RGBLINE
(
8
,
1
)
ENDYUV2RGBLINE
(
8
,
1
)
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
&
7
];
const
uint8_t
*
d64
=
ff_dither_8x8_73
[
y
d
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
LOADCHROMA
(
0
);
LOADCHROMA
(
0
);
PUTRGB4DB
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB4DB
(
dst_1
,
py_1
,
0
,
0
);
PUTRGB4DB
(
dst_2
,
py_2
,
0
,
0
+
8
);
PUTRGB4DB
(
dst_2
,
py_2
,
0
,
0
+
8
);
ENDYUV2RGBFUNC
()
ENDYUV2RGBFUNC
()
YUV2RGBFUNC
(
yuv2rgb_c_1_ordered_dither
,
uint8_t
,
0
)
YUV2RGBFUNC
(
yuv2rgb_c_1_ordered_dither
,
uint8_t
,
0
)
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
&
7
];
const
uint8_t
*
d128
=
ff_dither_8x8_220
[
y
d
&
7
];
char
out_1
=
0
,
out_2
=
0
;
char
out_1
=
0
,
out_2
=
0
;
g
=
c
->
table_gU
[
128
+
YUVRGB_TABLE_HEADROOM
]
+
c
->
table_gV
[
128
+
YUVRGB_TABLE_HEADROOM
];
g
=
c
->
table_gU
[
128
+
YUVRGB_TABLE_HEADROOM
]
+
c
->
table_gV
[
128
+
YUVRGB_TABLE_HEADROOM
];
...
...
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