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
9b3a04d3
Commit
9b3a04d3
authored
Apr 23, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x86: Move duplicated put_pixels{8|16}_mmx functions into their own file
parent
0671adbb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
134 deletions
+109
-134
Makefile
libavcodec/x86/Makefile
+3
-1
dsputil_mmx.c
libavcodec/x86/dsputil_mmx.c
+3
-65
dsputil_mmx.h
libavcodec/x86/dsputil_mmx.h
+5
-0
fpel_mmx.c
libavcodec/x86/fpel_mmx.c
+94
-0
hpeldsp_init.c
libavcodec/x86/hpeldsp_init.c
+4
-68
No files found.
libavcodec/x86/Makefile
View file @
9b3a04d3
...
@@ -10,7 +10,8 @@ OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o
...
@@ -10,7 +10,8 @@ OBJS-$(CONFIG_H264CHROMA) += x86/h264chroma_init.o
OBJS-$(CONFIG_H264DSP)
+=
x86/h264dsp_init.o
OBJS-$(CONFIG_H264DSP)
+=
x86/h264dsp_init.o
OBJS-$(CONFIG_H264PRED)
+=
x86/h264_intrapred_init.o
OBJS-$(CONFIG_H264PRED)
+=
x86/h264_intrapred_init.o
OBJS-$(CONFIG_H264QPEL)
+=
x86/h264_qpel.o
OBJS-$(CONFIG_H264QPEL)
+=
x86/h264_qpel.o
OBJS-$(CONFIG_HPELDSP)
+=
x86/hpeldsp_init.o
OBJS-$(CONFIG_HPELDSP)
+=
x86/fpel_mmx.o
\
x86/hpeldsp_init.o
OBJS-$(CONFIG_LPC)
+=
x86/lpc.o
OBJS-$(CONFIG_LPC)
+=
x86/lpc.o
OBJS-$(CONFIG_MLP_DECODER)
+=
x86/mlpdsp.o
OBJS-$(CONFIG_MLP_DECODER)
+=
x86/mlpdsp.o
OBJS-$(CONFIG_MPEGAUDIODSP)
+=
x86/mpegaudiodsp.o
OBJS-$(CONFIG_MPEGAUDIODSP)
+=
x86/mpegaudiodsp.o
...
@@ -33,6 +34,7 @@ OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
...
@@ -33,6 +34,7 @@ OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
MMX-OBJS-$(CONFIG_DSPUTIL)
+=
x86/dsputil_mmx.o
\
MMX-OBJS-$(CONFIG_DSPUTIL)
+=
x86/dsputil_mmx.o
\
x86/fdct.o
\
x86/fdct.o
\
x86/fpel_mmx.o
\
x86/idct_mmx_xvid.o
\
x86/idct_mmx_xvid.o
\
x86/idct_sse2_xvid.o
\
x86/idct_sse2_xvid.o
\
x86/simple_idct.o
\
x86/simple_idct.o
\
...
...
libavcodec/x86/dsputil_mmx.c
View file @
9b3a04d3
...
@@ -253,68 +253,6 @@ void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
...
@@ -253,68 +253,6 @@ void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels,
}
while
(
--
i
);
}
while
(
--
i
);
}
}
static
void
put_pixels8_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
__asm__
volatile
(
"lea (%3, %3), %%"
REG_a
"
\n\t
"
".p2align 3
\n\t
"
"1:
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"subl $4, %0
\n\t
"
"jnz 1b
\n\t
"
:
"+g"
(
h
),
"+r"
(
pixels
),
"+r"
(
block
)
:
"r"
((
x86_reg
)
line_size
)
:
"%"
REG_a
,
"memory"
);
}
static
void
put_pixels16_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
__asm__
volatile
(
"lea (%3, %3), %%"
REG_a
"
\n\t
"
".p2align 3
\n\t
"
"1:
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq 8(%1 ), %%mm4
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq 8(%1, %3), %%mm5
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm4, 8(%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"movq %%mm5, 8(%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq 8(%1 ), %%mm4
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq 8(%1, %3), %%mm5
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm4, 8(%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"movq %%mm5, 8(%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"subl $4, %0
\n\t
"
"jnz 1b
\n\t
"
:
"+g"
(
h
),
"+r"
(
pixels
),
"+r"
(
block
)
:
"r"
((
x86_reg
)
line_size
)
:
"%"
REG_a
,
"memory"
);
}
#define CLEAR_BLOCKS(name, n) \
#define CLEAR_BLOCKS(name, n) \
static void name(int16_t *blocks) \
static void name(int16_t *blocks) \
{ \
{ \
...
@@ -1075,7 +1013,7 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src,
...
@@ -1075,7 +1013,7 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src,
/* CAVS-specific */
/* CAVS-specific */
void
ff_put_cavs_qpel8_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
void
ff_put_cavs_qpel8_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
{
{
put_pixels8_mmx
(
dst
,
src
,
stride
,
8
);
ff_
put_pixels8_mmx
(
dst
,
src
,
stride
,
8
);
}
}
void
ff_avg_cavs_qpel8_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
void
ff_avg_cavs_qpel8_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
...
@@ -1085,7 +1023,7 @@ void ff_avg_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
...
@@ -1085,7 +1023,7 @@ void ff_avg_cavs_qpel8_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
void
ff_put_cavs_qpel16_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
void
ff_put_cavs_qpel16_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
{
{
put_pixels16_mmx
(
dst
,
src
,
stride
,
16
);
ff_
put_pixels16_mmx
(
dst
,
src
,
stride
,
16
);
}
}
void
ff_avg_cavs_qpel16_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
void
ff_avg_cavs_qpel16_mc00_mmx
(
uint8_t
*
dst
,
uint8_t
*
src
,
ptrdiff_t
stride
)
...
@@ -1097,7 +1035,7 @@ void ff_avg_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
...
@@ -1097,7 +1035,7 @@ void ff_avg_cavs_qpel16_mc00_mmx(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
void
ff_put_vc1_mspel_mc00_mmx
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
void
ff_put_vc1_mspel_mc00_mmx
(
uint8_t
*
dst
,
const
uint8_t
*
src
,
ptrdiff_t
stride
,
int
rnd
)
ptrdiff_t
stride
,
int
rnd
)
{
{
put_pixels8_mmx
(
dst
,
src
,
stride
,
8
);
ff_
put_pixels8_mmx
(
dst
,
src
,
stride
,
8
);
}
}
static
void
vector_clipf_sse
(
float
*
dst
,
const
float
*
src
,
static
void
vector_clipf_sse
(
float
*
dst
,
const
float
*
src
,
...
...
libavcodec/x86/dsputil_mmx.h
View file @
9b3a04d3
...
@@ -155,6 +155,11 @@ void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_s
...
@@ -155,6 +155,11 @@ void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_s
void
ff_put_pixels_clamped_mmx
(
const
int16_t
*
block
,
uint8_t
*
pixels
,
int
line_size
);
void
ff_put_pixels_clamped_mmx
(
const
int16_t
*
block
,
uint8_t
*
pixels
,
int
line_size
);
void
ff_put_signed_pixels_clamped_mmx
(
const
int16_t
*
block
,
uint8_t
*
pixels
,
int
line_size
);
void
ff_put_signed_pixels_clamped_mmx
(
const
int16_t
*
block
,
uint8_t
*
pixels
,
int
line_size
);
void
ff_put_pixels8_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
);
void
ff_put_pixels16_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
);
void
ff_avg_pixels8_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
void
ff_avg_pixels8_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
);
ptrdiff_t
line_size
,
int
h
);
void
ff_put_pixels8_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
void
ff_put_pixels8_mmxext
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
...
...
libavcodec/x86/fpel_mmx.c
0 → 100644
View file @
9b3a04d3
/*
* MMX-optimized avg/put pixel routines
*
* Copyright (c) 2000, 2001 Fabrice Bellard
* Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
*
* 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
*/
#include <stddef.h>
#include <stdint.h>
#include "config.h"
#include "dsputil_mmx.h"
#if HAVE_MMX_INLINE
void
ff_put_pixels8_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
__asm__
volatile
(
"lea (%3, %3), %%"
REG_a
"
\n\t
"
".p2align 3
\n\t
"
"1:
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"subl $4, %0
\n\t
"
"jnz 1b
\n\t
"
:
"+g"
(
h
),
"+r"
(
pixels
),
"+r"
(
block
)
:
"r"
((
x86_reg
)
line_size
)
:
"%"
REG_a
,
"memory"
);
}
void
ff_put_pixels16_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
__asm__
volatile
(
"lea (%3, %3), %%"
REG_a
"
\n\t
"
".p2align 3
\n\t
"
"1:
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq 8(%1 ), %%mm4
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq 8(%1, %3), %%mm5
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm4, 8(%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"movq %%mm5, 8(%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq 8(%1 ), %%mm4
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq 8(%1, %3), %%mm5
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm4, 8(%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"movq %%mm5, 8(%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"subl $4, %0
\n\t
"
"jnz 1b
\n\t
"
:
"+g"
(
h
),
"+r"
(
pixels
),
"+r"
(
block
)
:
"r"
((
x86_reg
)
line_size
)
:
"%"
REG_a
,
"memory"
);
}
#endif
/* HAVE_MMX_INLINE */
libavcodec/x86/hpeldsp_init.c
View file @
9b3a04d3
...
@@ -74,6 +74,10 @@ void ff_avg_pixels8_xy2_mmxext(uint8_t *block, const uint8_t *pixels,
...
@@ -74,6 +74,10 @@ void ff_avg_pixels8_xy2_mmxext(uint8_t *block, const uint8_t *pixels,
void
ff_avg_pixels8_xy2_3dnow
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
void
ff_avg_pixels8_xy2_3dnow
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
);
ptrdiff_t
line_size
,
int
h
);
#define put_pixels8_mmx ff_put_pixels8_mmx
#define put_pixels16_mmx ff_put_pixels16_mmx
#define put_no_rnd_pixels8_mmx ff_put_pixels8_mmx
#define put_no_rnd_pixels16_mmx ff_put_pixels16_mmx
#if HAVE_INLINE_ASM
#if HAVE_INLINE_ASM
...
@@ -133,74 +137,6 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
...
@@ -133,74 +137,6 @@ void ff_avg_pixels8_xy2_3dnow(uint8_t *block, const uint8_t *pixels,
#endif
/* HAVE_YASM */
#endif
/* HAVE_YASM */
#if HAVE_INLINE_ASM
#define put_no_rnd_pixels16_mmx put_pixels16_mmx
#define put_no_rnd_pixels8_mmx put_pixels8_mmx
static
void
put_pixels8_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
__asm__
volatile
(
"lea (%3, %3), %%"
REG_a
"
\n\t
"
".p2align 3
\n\t
"
"1:
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"subl $4, %0
\n\t
"
"jnz 1b
\n\t
"
:
"+g"
(
h
),
"+r"
(
pixels
),
"+r"
(
block
)
:
"r"
((
x86_reg
)
line_size
)
:
"%"
REG_a
,
"memory"
);
}
static
void
put_pixels16_mmx
(
uint8_t
*
block
,
const
uint8_t
*
pixels
,
ptrdiff_t
line_size
,
int
h
)
{
__asm__
volatile
(
"lea (%3, %3), %%"
REG_a
"
\n\t
"
".p2align 3
\n\t
"
"1:
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq 8(%1 ), %%mm4
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq 8(%1, %3), %%mm5
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm4, 8(%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"movq %%mm5, 8(%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"movq (%1 ), %%mm0
\n\t
"
"movq 8(%1 ), %%mm4
\n\t
"
"movq (%1, %3), %%mm1
\n\t
"
"movq 8(%1, %3), %%mm5
\n\t
"
"movq %%mm0, (%2)
\n\t
"
"movq %%mm4, 8(%2)
\n\t
"
"movq %%mm1, (%2, %3)
\n\t
"
"movq %%mm5, 8(%2, %3)
\n\t
"
"add %%"
REG_a
", %1
\n\t
"
"add %%"
REG_a
", %2
\n\t
"
"subl $4, %0
\n\t
"
"jnz 1b
\n\t
"
:
"+g"
(
h
),
"+r"
(
pixels
),
"+r"
(
block
)
:
"r"
((
x86_reg
)
line_size
)
:
"%"
REG_a
,
"memory"
);
}
#endif
/* HAVE_INLINE_ASM */
#define SET_HPEL_FUNCS(PFX, IDX, SIZE, CPU) \
#define SET_HPEL_FUNCS(PFX, IDX, SIZE, CPU) \
do { \
do { \
c->PFX ## _pixels_tab IDX [0] = PFX ## _pixels ## SIZE ## _ ## CPU; \
c->PFX ## _pixels_tab IDX [0] = PFX ## _pixels ## SIZE ## _ ## CPU; \
...
...
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