Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
46bb4568
Commit
46bb4568
authored
Apr 20, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86: dsputil: Refactor pixels16 wrapper functions with a macro
parent
2c2c48a9
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
41 additions
and
143 deletions
+41
-143
dsputil_mmx.c
libavcodec/x86/dsputil_mmx.c
+2
-12
dsputil_mmx.h
libavcodec/x86/dsputil_mmx.h
+12
-0
h264_qpel.c
libavcodec/x86/h264_qpel.c
+3
-12
hpeldsp_avg_template.c
libavcodec/x86/hpeldsp_avg_template.c
+0
-77
hpeldsp_init.c
libavcodec/x86/hpeldsp_init.c
+21
-16
hpeldsp_rnd_template.c
libavcodec/x86/hpeldsp_rnd_template.c
+0
-11
rnd_mmx.c
libavcodec/x86/rnd_mmx.c
+3
-0
rnd_template.c
libavcodec/x86/rnd_template.c
+0
-15
No files found.
libavcodec/x86/dsputil_mmx.c
View file @
46bb4568
...
...
@@ -440,19 +440,9 @@ static void draw_edges_mmx(uint8_t *buf, int wrap, int width, int height,
#if HAVE_YASM
static
void
ff_avg_pixels16_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
int
line_size
,
int
h
)
{
ff_avg_pixels8_mmxext
(
block
,
pixels
,
line_size
,
h
);
ff_avg_pixels8_mmxext
(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
ff_put_pixels16_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
ff_put_pixels8_mmxext
(
block
,
pixels
,
line_size
,
h
);
ff_put_pixels8_mmxext
(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
PIXELS16
(
static
,
ff_avg
,
,
,
_mmxext
)
PIXELS16
(
static
,
ff_put
,
,
,
_mmxext
)
#define QPEL_OP(OPNAME, RND, MMX) \
static void OPNAME ## qpel8_mc00_ ## MMX (uint8_t *dst, uint8_t *src, \
...
...
libavcodec/x86/dsputil_mmx.h
View file @
46bb4568
...
...
@@ -153,4 +153,16 @@ void ff_deinterlace_line_inplace_mmx(const uint8_t *lum_m4,
const
uint8_t
*
lum_m1
,
const
uint8_t
*
lum
,
int
size
);
#define PIXELS16(STATIC, PFX1, PFX2, TYPE, CPUEXT) \
STATIC void PFX1 ## _pixels16 ## TYPE ## CPUEXT(uint8_t *block, \
const uint8_t *pixels, \
ptrdiff_t line_size, \
int h) \
{ \
PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block, pixels, \
line_size, h); \
PFX2 ## PFX1 ## _pixels8 ## TYPE ## CPUEXT(block + 8, pixels + 8, \
line_size, h); \
}
#endif
/* AVCODEC_X86_DSPUTIL_MMX_H */
libavcodec/x86/h264_qpel.c
View file @
46bb4568
...
...
@@ -32,18 +32,6 @@ void ff_put_pixels4_mmxext(uint8_t *block, const uint8_t *pixels,
ptrdiff_t
line_size
,
int
h
);
void
ff_avg_pixels4_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
);
static
void
ff_put_pixels16_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
ff_put_pixels8_mmxext
(
block
,
pixels
,
line_size
,
h
);
ff_put_pixels8_mmxext
(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
ff_avg_pixels16_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
ff_avg_pixels8_mmxext
(
block
,
pixels
,
line_size
,
h
);
ff_avg_pixels8_mmxext
(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
void
ff_put_pixels4_l2_mmxext
(
uint8_t
*
dst
,
uint8_t
*
src1
,
uint8_t
*
src2
,
int
dstStride
,
int
src1Stride
,
int
h
);
void
ff_avg_pixels4_l2_mmxext
(
uint8_t
*
dst
,
uint8_t
*
src1
,
uint8_t
*
src2
,
...
...
@@ -61,6 +49,9 @@ void ff_avg_pixels16_l2_mmxext(uint8_t *dst, uint8_t *src1, uint8_t *src2,
#define ff_put_pixels16_l2_sse2 ff_put_pixels16_l2_mmxext
#define ff_avg_pixels16_l2_sse2 ff_avg_pixels16_l2_mmxext
PIXELS16
(
static
,
ff_avg
,
,
,
_mmxext
)
PIXELS16
(
static
,
ff_put
,
,
,
_mmxext
)
#define DEF_QPEL(OPNAME)\
void ff_ ## OPNAME ## _h264_qpel4_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
void ff_ ## OPNAME ## _h264_qpel8_h_lowpass_mmxext(uint8_t *dst, uint8_t *src, int dstStride, int srcStride);\
...
...
libavcodec/x86/hpeldsp_avg_template.c
deleted
100644 → 0
View file @
2c2c48a9
/*
* DSP utils : average functions are compiled twice for 3dnow/mmxext
* Copyright (c) 2000, 2001 Fabrice Bellard
* Copyright (c) 2002-2004 Michael Niedermayer
*
* MMX optimization by Nick Kurshev <nickols_k@mail.ru>
* mostly rewritten by Michael Niedermayer <michaelni@gmx.at>
* and improved by Zdenek Kabelac <kabi@users.sf.net>
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
//FIXME the following could be optimized too ...
static
void
DEF
(
put_no_rnd_pixels16_x2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_put_no_rnd_pixels8_x2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_put_no_rnd_pixels8_x2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
put_pixels16_y2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_put_pixels8_y2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_put_pixels8_y2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
put_no_rnd_pixels16_y2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_put_no_rnd_pixels8_y2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_put_no_rnd_pixels8_y2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
avg_pixels16
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_avg_pixels8
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_avg_pixels8
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
avg_pixels16_x2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_avg_pixels8_x2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_avg_pixels8_x2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
avg_pixels16_y2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_avg_pixels8_y2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_avg_pixels8_y2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
avg_pixels16_xy2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
ff_avg_pixels8_xy2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
ff_avg_pixels8_xy2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
libavcodec/x86/hpeldsp_init.c
View file @
46bb4568
...
...
@@ -105,6 +105,13 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
#undef PAVGBP
#undef PAVGB
#undef STATIC
PIXELS16
(
static
,
avg_no_rnd
,
,
_y2
,
_mmx
)
PIXELS16
(
static
,
put_no_rnd
,
,
_y2
,
_mmx
)
PIXELS16
(
static
,
avg_no_rnd
,
,
_xy2
,
_mmx
)
PIXELS16
(
static
,
put_no_rnd
,
,
_xy2
,
_mmx
)
/***********************************/
/* MMX rounding */
...
...
@@ -120,27 +127,25 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
#undef PAVGBP
#undef PAVGB
PIXELS16
(
static
,
avg
,
,
_y2
,
_mmx
)
PIXELS16
(
static
,
put
,
,
_y2
,
_mmx
)
#endif
/* HAVE_INLINE_ASM */
#if HAVE_YASM
/***********************************/
/* 3Dnow specific */
#define DEF(x) x ## _3dnow
#include "hpeldsp_avg_template.c"
#undef DEF
/***********************************/
/* MMXEXT specific */
#define DEF(x) x ## _mmxext
#include "hpeldsp_avg_template.c"
#undef DEF
#define HPELDSP_AVG_PIXELS16(CPUEXT) \
PIXELS16(static, put_no_rnd, ff_, _x2, CPUEXT) \
PIXELS16(static, put, ff_, _y2, CPUEXT) \
PIXELS16(static, put_no_rnd, ff_, _y2, CPUEXT) \
PIXELS16(static, avg, ff_, , CPUEXT) \
PIXELS16(static, avg, ff_, _x2, CPUEXT) \
PIXELS16(static, avg, ff_, _y2, CPUEXT) \
PIXELS16(static, avg, ff_, _xy2, CPUEXT)
HPELDSP_AVG_PIXELS16
(
_3dnow
)
HPELDSP_AVG_PIXELS16
(
_mmxext
)
#endif
/* HAVE_YASM */
...
...
libavcodec/x86/hpeldsp_rnd_template.c
View file @
46bb4568
...
...
@@ -196,14 +196,3 @@ static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, ptrdiff_
:
"r"
((
x86_reg
)
line_size
)
:
REG_a
,
"memory"
);
}
//FIXME optimize
static
void
DEF
(
put
,
pixels16_y2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
){
DEF
(
put
,
pixels8_y2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
put
,
pixels8_y2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
static
void
DEF
(
avg
,
pixels16_y2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
){
DEF
(
avg
,
pixels8_y2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
avg
,
pixels8_y2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
libavcodec/x86/rnd_mmx.c
View file @
46bb4568
...
...
@@ -29,4 +29,7 @@
#include "rnd_template.c"
PIXELS16
(,
ff_avg
,
,
_xy2
,
_mmx
)
PIXELS16
(,
ff_put
,
,
_xy2
,
_mmx
)
#endif
/* HAVE_INLINE_ASM */
libavcodec/x86/rnd_template.c
View file @
46bb4568
...
...
@@ -171,18 +171,3 @@ STATIC void DEF(avg, pixels8_xy2)(uint8_t *block, const uint8_t *pixels,
:
"D"
(
block
),
"r"
((
x86_reg
)
line_size
)
:
REG_a
,
"memory"
);
}
//FIXME optimize
STATIC
void
DEF
(
put
,
pixels16_xy2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
put
,
pixels8_xy2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
put
,
pixels8_xy2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
STATIC
void
DEF
(
avg
,
pixels16_xy2
)(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
DEF
(
avg
,
pixels8_xy2
)(
block
,
pixels
,
line_size
,
h
);
DEF
(
avg
,
pixels8_xy2
)(
block
+
8
,
pixels
+
8
,
line_size
,
h
);
}
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