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
06972056
Commit
06972056
authored
Aug 11, 2006
by
Loren Merritt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vorbis simd tweaks
Originally committed as revision 5983 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
49a0122c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
69 additions
and
53 deletions
+69
-53
dsputil.h
libavcodec/dsputil.h
+1
-1
dsputil_mmx.c
libavcodec/i386/dsputil_mmx.c
+67
-51
vorbis.c
libavcodec/vorbis.c
+1
-1
No files found.
libavcodec/dsputil.h
View file @
06972056
...
...
@@ -313,8 +313,8 @@ typedef struct DSPContext {
/* assume len is a multiple of 4, and arrays are 16-byte aligned */
void
(
*
vorbis_inverse_coupling
)(
float
*
mag
,
float
*
ang
,
int
blocksize
);
void
(
*
vector_fmul
)(
float
*
dst
,
const
float
*
src
,
int
len
);
/* assume len is a multiple of 8, and arrays are 16-byte aligned */
void
(
*
vector_fmul
)(
float
*
dst
,
const
float
*
src
,
int
len
);
void
(
*
vector_fmul_reverse
)(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
int
len
);
/* assume len is a multiple of 8, and src arrays are 16-byte aligned */
void
(
*
vector_fmul_add_add
)(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
const
float
*
src2
,
int
src3
,
int
len
,
int
step
);
...
...
libavcodec/i386/dsputil_mmx.c
View file @
06972056
...
...
@@ -2773,33 +2773,39 @@ static void vorbis_inverse_coupling_sse(float *mag, float *ang, int blocksize)
}
static
void
vector_fmul_3dnow
(
float
*
dst
,
const
float
*
src
,
int
len
){
long
i
;
len
>>=
1
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
asm
volatile
(
"movq %0, %%mm0
\n\t
"
"pfmul %1, %%mm0
\n\t
"
"movq %%mm0, %0
\n\t
"
:
"+m"
(
dst
[
i
*
2
])
:
"m"
(
src
[
i
*
2
])
:
"memory"
);
}
asm
volatile
(
"femms"
);
long
i
=
(
len
-
4
)
*
4
;
asm
volatile
(
"1:
\n\t
"
"movq (%1,%0), %%mm0
\n\t
"
"movq 8(%1,%0), %%mm1
\n\t
"
"pfmul (%2,%0), %%mm0
\n\t
"
"pfmul 8(%2,%0), %%mm1
\n\t
"
"movq %%mm0, (%1,%0)
\n\t
"
"movq %%mm1, 8(%1,%0)
\n\t
"
"sub $16, %0
\n\t
"
"jge 1b
\n\t
"
"femms
\n\t
"
:
"+r"
(
i
)
:
"r"
(
dst
),
"r"
(
src
)
:
"memory"
);
}
static
void
vector_fmul_sse
(
float
*
dst
,
const
float
*
src
,
int
len
){
long
i
;
len
>>=
2
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
asm
volatile
(
"movaps %0, %%xmm0
\n\t
"
"mulps %1, %%xmm0
\n\t
"
"movaps %%xmm0, %0
\n\t
"
:
"+m"
(
dst
[
i
*
4
])
:
"m"
(
src
[
i
*
4
])
:
"memory"
);
}
long
i
=
(
len
-
8
)
*
4
;
asm
volatile
(
"1:
\n\t
"
"movaps (%1,%0), %%xmm0
\n\t
"
"movaps 16(%1,%0), %%xmm1
\n\t
"
"mulps (%2,%0), %%xmm0
\n\t
"
"mulps 16(%2,%0), %%xmm1
\n\t
"
"movaps %%xmm0, (%1,%0)
\n\t
"
"movaps %%xmm1, 16(%1,%0)
\n\t
"
"sub $32, %0
\n\t
"
"jge 1b
\n\t
"
:
"+r"
(
i
)
:
"r"
(
dst
),
"r"
(
src
)
:
"memory"
);
}
static
void
vector_fmul_reverse_3dnow2
(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
int
len
){
...
...
@@ -2842,9 +2848,8 @@ static void vector_fmul_reverse_sse(float *dst, const float *src0, const float *
static
void
vector_fmul_add_add_3dnow
(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
const
float
*
src2
,
int
src3
,
int
len
,
int
step
){
long
i
;
long
i
=
(
len
-
4
)
*
4
;
if
(
step
==
2
&&
src3
==
0
){
i
=
(
len
-
4
)
*
4
;
dst
+=
(
len
-
4
)
*
2
;
asm
volatile
(
"1:
\n\t
"
...
...
@@ -2869,26 +2874,31 @@ static void vector_fmul_add_add_3dnow(float *dst, const float *src0, const float
);
}
else
if
(
step
==
1
&&
src3
==
0
){
for
(
i
=
0
;
i
<
len
;
i
+=
2
){
asm
volatile
(
"movq %1, %%mm0
\n\t
"
"pfmul %2, %%mm0
\n\t
"
"pfadd %3, %%mm0
\n\t
"
"movq %%mm0, %0
\n\t
"
:
"=m"
(
dst
[
i
])
:
"m"
(
src0
[
i
]),
"m"
(
src1
[
i
]),
"m"
(
src2
[
i
])
);
}
asm
volatile
(
"1:
\n\t
"
"movq (%2,%0), %%mm0
\n\t
"
"movq 8(%2,%0), %%mm1
\n\t
"
"pfmul (%3,%0), %%mm0
\n\t
"
"pfmul 8(%3,%0), %%mm1
\n\t
"
"pfadd (%4,%0), %%mm0
\n\t
"
"pfadd 8(%4,%0), %%mm1
\n\t
"
"movq %%mm0, (%1,%0)
\n\t
"
"movq %%mm1, 8(%1,%0)
\n\t
"
"sub $16, %0
\n\t
"
"jge 1b
\n\t
"
:
"+r"
(
i
)
:
"r"
(
dst
),
"r"
(
src0
),
"r"
(
src1
),
"r"
(
src2
)
:
"memory"
);
}
else
ff_vector_fmul_add_add_c
(
dst
,
src0
,
src1
,
src2
,
src3
,
len
,
step
);
asm
volatile
(
"femms"
);
}
static
void
vector_fmul_add_add_sse
(
float
*
dst
,
const
float
*
src0
,
const
float
*
src1
,
const
float
*
src2
,
floa
t
src3
,
int
len
,
int
step
){
long
i
;
const
float
*
src2
,
in
t
src3
,
int
len
,
int
step
){
long
i
=
(
len
-
8
)
*
4
;
if
(
step
==
2
&&
src3
==
0
){
i
=
(
len
-
8
)
*
4
;
dst
+=
(
len
-
8
)
*
2
;
asm
volatile
(
"1:
\n\t
"
...
...
@@ -2921,16 +2931,22 @@ static void vector_fmul_add_add_sse(float *dst, const float *src0, const float *
);
}
else
if
(
step
==
1
&&
src3
==
0
){
for
(
i
=
0
;
i
<
len
;
i
+=
4
){
asm
volatile
(
"movaps %1, %%xmm0
\n\t
"
"mulps %2, %%xmm0
\n\t
"
"addps %3, %%xmm0
\n\t
"
"movaps %%xmm0, %0
\n\t
"
:
"=m"
(
dst
[
i
])
:
"m"
(
src0
[
i
]),
"m"
(
src1
[
i
]),
"m"
(
src2
[
i
])
);
}
asm
volatile
(
"1:
\n\t
"
"movaps (%2,%0), %%xmm0
\n\t
"
"movaps 16(%2,%0), %%xmm1
\n\t
"
"mulps (%3,%0), %%xmm0
\n\t
"
"mulps 16(%3,%0), %%xmm1
\n\t
"
"addps (%4,%0), %%xmm0
\n\t
"
"addps 16(%4,%0), %%xmm1
\n\t
"
"movaps %%xmm0, (%1,%0)
\n\t
"
"movaps %%xmm1, 16(%1,%0)
\n\t
"
"sub $32, %0
\n\t
"
"jge 1b
\n\t
"
:
"+r"
(
i
)
:
"r"
(
dst
),
"r"
(
src0
),
"r"
(
src1
),
"r"
(
src2
)
:
"memory"
);
}
else
ff_vector_fmul_add_add_c
(
dst
,
src0
,
src1
,
src2
,
src3
,
len
,
step
);
...
...
@@ -3409,7 +3425,7 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c
->
vector_fmul_add_add
=
vector_fmul_add_add_sse
;
}
if
(
mm_flags
&
MM_3DNOW
)
c
->
vector_fmul_add_add
=
vector_fmul_add_add_3dnow
;
// faster than sse
2
c
->
vector_fmul_add_add
=
vector_fmul_add_add_3dnow
;
// faster than sse
}
#ifdef CONFIG_ENCODERS
...
...
libavcodec/vorbis.c
View file @
06972056
...
...
@@ -762,7 +762,7 @@ static void create_map( vorbis_context * vc, uint_fast8_t floor_number )
for
(
blockflag
=
0
;
blockflag
<
2
;
++
blockflag
)
{
n
=
(
blockflag
?
vc
->
blocksize
[
1
]
:
vc
->
blocksize
[
0
])
/
2
;
n
=
vc
->
blocksize
[
blockflag
]
/
2
;
floors
[
floor_number
].
data
.
t0
.
map
[
blockflag
]
=
av_malloc
((
n
+
1
)
*
sizeof
(
int_fast32_t
));
// n+sentinel
...
...
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