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
5c391a16
Commit
5c391a16
authored
Jul 08, 2011
by
Ronald S. Bultje
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
swscale: rename uv_off/uv_off2 to uv_off_px/byte.
parent
1ce724ee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
46 deletions
+46
-46
swscale_internal.h
libswscale/swscale_internal.h
+4
-4
utils.c
libswscale/utils.c
+2
-2
swscale_template.c
libswscale/x86/swscale_template.c
+40
-40
No files found.
libswscale/swscale_internal.h
View file @
5c391a16
...
...
@@ -319,8 +319,8 @@ typedef struct SwsContext {
#define V_TEMP "11*8+4*4*256*2+32"
#define Y_TEMP "11*8+4*4*256*2+40"
#define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48"
#define UV_OFF
"11*8+4*4*256*3+48"
#define UV_OFF
x2
"11*8+4*4*256*3+56"
#define UV_OFF
_PX
"11*8+4*4*256*3+48"
#define UV_OFF
_BYTE
"11*8+4*4*256*3+56"
#define DITHER16 "11*8+4*4*256*3+64"
#define DITHER32 "11*8+4*4*256*3+80"
...
...
@@ -345,8 +345,8 @@ typedef struct SwsContext {
DECLARE_ALIGNED
(
8
,
uint64_t
,
v_temp
);
DECLARE_ALIGNED
(
8
,
uint64_t
,
y_temp
);
int32_t
alpMmxFilter
[
4
*
MAX_FILTER_SIZE
];
DECLARE_ALIGNED
(
8
,
ptrdiff_t
,
uv_off
);
///< offset (in pixels) between u and v planes
DECLARE_ALIGNED
(
8
,
ptrdiff_t
,
uv_off
x2
);
///< offset (in bytes) between u and v planes
DECLARE_ALIGNED
(
8
,
ptrdiff_t
,
uv_off
_px
);
///< offset (in pixels) between u and v planes
DECLARE_ALIGNED
(
8
,
ptrdiff_t
,
uv_off
_byte
);
///< offset (in bytes) between u and v planes
uint16_t
dither16
[
8
];
uint32_t
dither32
[
8
];
...
...
libswscale/utils.c
View file @
5c391a16
...
...
@@ -1048,8 +1048,8 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
FF_ALLOCZ_OR_GOTO
(
c
,
c
->
lumPixBuf
[
i
+
c
->
vLumBufSize
],
dst_stride
+
1
,
fail
);
c
->
lumPixBuf
[
i
]
=
c
->
lumPixBuf
[
i
+
c
->
vLumBufSize
];
}
c
->
uv_off
=
dst_stride_px
;
c
->
uv_off
x2
=
dst_stride
;
c
->
uv_off
_px
=
dst_stride_px
;
c
->
uv_off
_byte
=
dst_stride
;
for
(
i
=
0
;
i
<
c
->
vChrBufSize
;
i
++
)
{
FF_ALLOC_OR_GOTO
(
c
,
c
->
chrUPixBuf
[
i
+
c
->
vChrBufSize
],
dst_stride
*
2
+
1
,
fail
);
c
->
chrUPixBuf
[
i
]
=
c
->
chrUPixBuf
[
i
+
c
->
vChrBufSize
];
...
...
libswscale/x86/swscale_template.c
View file @
5c391a16
...
...
@@ -118,7 +118,7 @@ static void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
const
uint8_t
*
lumDither
=
c
->
lumDither8
,
*
chrDither
=
c
->
chrDither8
;
if
(
uDest
)
{
x86_reg
uv_off
=
c
->
uv_off
x2
>>
1
;
x86_reg
uv_off
=
c
->
uv_off
_byte
>>
1
;
dither_8to16
(
c
,
chrDither
,
0
);
YSCALEYUV2YV12X
(
CHR_MMX_FILTER_OFFSET
,
uDest
,
chrDstW
,
0
)
dither_8to16
(
c
,
chrDither
,
1
);
...
...
@@ -213,14 +213,14 @@ dither_8to32(SwsContext *c, const uint8_t *srcDither, int rot)
"punpckhwd %%mm0, %%mm5
\n\t
"
"punpcklwd %%mm0, %%mm6
\n\t
"
"punpckhwd %%mm0, %%mm7
\n\t
"
"psll
w
$12, %%mm4
\n\t
"
"psll
w
$12, %%mm5
\n\t
"
"psll
w
$12, %%mm6
\n\t
"
"psll
w
$12, %%mm7
\n\t
"
"movq %%mm
3
, "
DITHER32
"+0(%1)
\n\t
"
"movq %%mm
4
, "
DITHER32
"+8(%1)
\n\t
"
"movq %%mm
4
, "
DITHER32
"+16(%1)
\n\t
"
"movq %%mm
4
, "
DITHER32
"+24(%1)
\n\t
"
"psll
d
$12, %%mm4
\n\t
"
"psll
d
$12, %%mm5
\n\t
"
"psll
d
$12, %%mm6
\n\t
"
"psll
d
$12, %%mm7
\n\t
"
"movq %%mm
4
, "
DITHER32
"+0(%1)
\n\t
"
"movq %%mm
5
, "
DITHER32
"+8(%1)
\n\t
"
"movq %%mm
6
, "
DITHER32
"+16(%1)
\n\t
"
"movq %%mm
7
, "
DITHER32
"+24(%1)
\n\t
"
::
"r"
(
srcDither
),
"r"
(
&
c
->
redDither
)
);
}
else
{
...
...
@@ -235,14 +235,14 @@ dither_8to32(SwsContext *c, const uint8_t *srcDither, int rot)
"punpckhwd %%mm0, %%mm5
\n\t
"
"punpcklwd %%mm0, %%mm6
\n\t
"
"punpckhwd %%mm0, %%mm7
\n\t
"
"psll
w
$12, %%mm4
\n\t
"
"psll
w
$12, %%mm5
\n\t
"
"psll
w
$12, %%mm6
\n\t
"
"psll
w
$12, %%mm7
\n\t
"
"movq %%mm
3
, "
DITHER32
"+0(%1)
\n\t
"
"movq %%mm
4
, "
DITHER32
"+8(%1)
\n\t
"
"movq %%mm
4
, "
DITHER32
"+16(%1)
\n\t
"
"movq %%mm
4
, "
DITHER32
"+24(%1)
\n\t
"
"psll
d
$12, %%mm4
\n\t
"
"psll
d
$12, %%mm5
\n\t
"
"psll
d
$12, %%mm6
\n\t
"
"psll
d
$12, %%mm7
\n\t
"
"movq %%mm
4
, "
DITHER32
"+0(%1)
\n\t
"
"movq %%mm
5
, "
DITHER32
"+8(%1)
\n\t
"
"movq %%mm
6
, "
DITHER32
"+16(%1)
\n\t
"
"movq %%mm
7
, "
DITHER32
"+24(%1)
\n\t
"
::
"r"
(
srcDither
),
"r"
(
&
c
->
redDither
)
);
}
...
...
@@ -261,7 +261,7 @@ static void RENAME(yuv2yuvX_ar)(SwsContext *c, const int16_t *lumFilter,
const
uint8_t
*
lumDither
=
c
->
lumDither8
,
*
chrDither
=
c
->
chrDither8
;
if
(
uDest
)
{
x86_reg
uv_off
=
c
->
uv_off
x2
>>
1
;
x86_reg
uv_off
=
c
->
uv_off
_byte
>>
1
;
dither_8to32
(
c
,
chrDither
,
0
);
YSCALEYUV2YV12X_ACCURATE
(
CHR_MMX_FILTER_OFFSET
,
uDest
,
chrDstW
,
0
)
dither_8to32
(
c
,
chrDither
,
1
);
...
...
@@ -574,7 +574,7 @@ static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
if
(
CONFIG_SWSCALE_ALPHA
&&
c
->
alpPixBuf
)
{
YSCALEYUV2PACKEDX_ACCURATE
...
...
@@ -607,7 +607,7 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
if
(
CONFIG_SWSCALE_ALPHA
&&
c
->
alpPixBuf
)
{
YSCALEYUV2PACKEDX
...
...
@@ -664,7 +664,7 @@ static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
...
...
@@ -688,7 +688,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
...
...
@@ -741,7 +741,7 @@ static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
...
...
@@ -765,7 +765,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
...
...
@@ -898,7 +898,7 @@ static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX_ACCURATE
YSCALEYUV2RGBX
...
...
@@ -922,7 +922,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX
YSCALEYUV2RGBX
...
...
@@ -963,7 +963,7 @@ static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX_ACCURATE
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
...
...
@@ -984,7 +984,7 @@ static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
{
x86_reg
dummy
=
0
;
x86_reg
dstW_reg
=
dstW
;
x86_reg
uv_off
=
c
->
uv_off
x2
;
x86_reg
uv_off
=
c
->
uv_off
_byte
;
YSCALEYUV2PACKEDX
/* mm2=B, %%mm4=G, %%mm5=R, %%mm7=0 */
...
...
@@ -1002,10 +1002,10 @@ static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
"1: \n\t"\
"movq (%2, "#index"), %%mm2 \n\t"
/* uvbuf0[eax]*/
\
"movq (%3, "#index"), %%mm3 \n\t"
/* uvbuf1[eax]*/
\
"add
"UV_OFFx2
"("#c"), "#index" \n\t" \
"add
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"movq (%2, "#index"), %%mm5 \n\t"
/* uvbuf0[eax+2048]*/
\
"movq (%3, "#index"), %%mm4 \n\t"
/* uvbuf1[eax+2048]*/
\
"sub
"UV_OFFx2
"("#c"), "#index" \n\t" \
"sub
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"psubw %%mm3, %%mm2 \n\t"
/* uvbuf0[eax] - uvbuf1[eax]*/
\
"psubw %%mm4, %%mm5 \n\t"
/* uvbuf0[eax+2048] - uvbuf1[eax+2048]*/
\
"movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t"\
...
...
@@ -1233,10 +1233,10 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
"1: \n\t"\
"movq (%2, "#index"), %%mm2 \n\t"
/* uvbuf0[eax]*/
\
"movq (%3, "#index"), %%mm3 \n\t"
/* uvbuf1[eax]*/
\
"add
"UV_OFFx2
"("#c"), "#index" \n\t" \
"add
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"movq (%2, "#index"), %%mm5 \n\t"
/* uvbuf0[eax+2048]*/
\
"movq (%3, "#index"), %%mm4 \n\t"
/* uvbuf1[eax+2048]*/
\
"sub
"UV_OFFx2
"("#c"), "#index" \n\t" \
"sub
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"psubw %%mm3, %%mm2 \n\t"
/* uvbuf0[eax] - uvbuf1[eax]*/
\
"psubw %%mm4, %%mm5 \n\t"
/* uvbuf0[eax+2048] - uvbuf1[eax+2048]*/
\
"movq "CHR_MMX_FILTER_OFFSET"+8("#c"), %%mm0 \n\t"\
...
...
@@ -1288,9 +1288,9 @@ static void RENAME(yuv2yuyv422_2)(SwsContext *c, const int16_t *buf[2],
".p2align 4 \n\t"\
"1: \n\t"\
"movq (%2, "#index"), %%mm3 \n\t"
/* uvbuf0[eax]*/
\
"add
"UV_OFFx2
"("#c"), "#index" \n\t" \
"add
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"movq (%2, "#index"), %%mm4 \n\t"
/* uvbuf0[eax+2048]*/
\
"sub
"UV_OFFx2
"("#c"), "#index" \n\t" \
"sub
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"psraw $4, %%mm3 \n\t"
/* uvbuf0[eax] - uvbuf1[eax] >>4*/
\
"psraw $4, %%mm4 \n\t"
/* uvbuf0[eax+2048] - uvbuf1[eax+2048] >>4*/
\
"psubw "U_OFFSET"("#c"), %%mm3 \n\t"
/* (U-128)8*/
\
...
...
@@ -1341,10 +1341,10 @@ static void RENAME(yuv2yuyv422_2)(SwsContext *c, const int16_t *buf[2],
"1: \n\t"\
"movq (%2, "#index"), %%mm2 \n\t"
/* uvbuf0[eax]*/
\
"movq (%3, "#index"), %%mm3 \n\t"
/* uvbuf1[eax]*/
\
"add
"UV_OFFx2
"("#c"), "#index" \n\t" \
"add
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"movq (%2, "#index"), %%mm5 \n\t"
/* uvbuf0[eax+2048]*/
\
"movq (%3, "#index"), %%mm4 \n\t"
/* uvbuf1[eax+2048]*/
\
"sub
"UV_OFFx2
"("#c"), "#index" \n\t" \
"sub
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"paddw %%mm2, %%mm3 \n\t"
/* uvbuf0[eax] + uvbuf1[eax]*/
\
"paddw %%mm5, %%mm4 \n\t"
/* uvbuf0[eax+2048] + uvbuf1[eax+2048]*/
\
"psrlw $5, %%mm3 \n\t"
/*FIXME might overflow*/
\
...
...
@@ -1608,9 +1608,9 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
".p2align 4 \n\t"\
"1: \n\t"\
"movq (%2, "#index"), %%mm3 \n\t"
/* uvbuf0[eax]*/
\
"add
"UV_OFFx2
"("#c"), "#index" \n\t" \
"add
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"movq (%2, "#index"), %%mm4 \n\t"
/* uvbuf0[eax+2048]*/
\
"sub
"UV_OFFx2
"("#c"), "#index" \n\t" \
"sub
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"psraw $7, %%mm3 \n\t" \
"psraw $7, %%mm4 \n\t" \
"movq (%0, "#index", 2), %%mm1 \n\t"
/*buf0[eax]*/
\
...
...
@@ -1626,10 +1626,10 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
"1: \n\t"\
"movq (%2, "#index"), %%mm2 \n\t"
/* uvbuf0[eax]*/
\
"movq (%3, "#index"), %%mm3 \n\t"
/* uvbuf1[eax]*/
\
"add
"UV_OFFx2
"("#c"), "#index" \n\t" \
"add
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"movq (%2, "#index"), %%mm5 \n\t"
/* uvbuf0[eax+2048]*/
\
"movq (%3, "#index"), %%mm4 \n\t"
/* uvbuf1[eax+2048]*/
\
"sub
"UV_OFFx2
"("#c"), "#index" \n\t" \
"sub
"UV_OFF_PX
"("#c"), "#index" \n\t" \
"paddw %%mm2, %%mm3 \n\t"
/* uvbuf0[eax] + uvbuf1[eax]*/
\
"paddw %%mm5, %%mm4 \n\t"
/* uvbuf0[eax+2048] + uvbuf1[eax+2048]*/
\
"psrlw $8, %%mm3 \n\t" \
...
...
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