Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
685f5438
Commit
685f5438
authored
12 years ago
by
Mans Rullgard
Browse files
Options
Downloads
Patches
Plain Diff
x86: move some inline asm macros to the only places they are used
Signed-off-by:
Mans Rullgard
<
mans@mansr.com
>
parent
41e637e4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libavcodec/x86/cavsdsp_mmx.c
+6
-0
6 additions, 0 deletions
libavcodec/x86/cavsdsp_mmx.c
libavcodec/x86/dsputil_mmx.c
+28
-0
28 additions, 0 deletions
libavcodec/x86/dsputil_mmx.c
libavcodec/x86/dsputil_mmx.h
+0
-34
0 additions, 34 deletions
libavcodec/x86/dsputil_mmx.h
with
34 additions
and
34 deletions
libavcodec/x86/cavsdsp_mmx.c
+
6
−
0
View file @
685f5438
...
...
@@ -29,6 +29,12 @@
#include
"libavcodec/cavsdsp.h"
#include
"dsputil_mmx.h"
/* in/out: mma=mma+mmb, mmb=mmb-mma */
#define SUMSUB_BA( a, b ) \
"paddw "#b", "#a" \n\t"\
"paddw "#b", "#b" \n\t"\
"psubw "#a", "#b" \n\t"
/*****************************************************************************
*
* inverse transform
...
...
This diff is collapsed.
Click to expand it.
libavcodec/x86/dsputil_mmx.c
+
28
−
0
View file @
685f5438
...
...
@@ -630,6 +630,34 @@ static void add_hfyu_median_prediction_cmov(uint8_t *dst, const uint8_t *top,
}
#endif
static
inline
void
transpose4x4
(
uint8_t
*
dst
,
uint8_t
*
src
,
x86_reg
dst_stride
,
x86_reg
src_stride
){
__asm__
volatile
(
//FIXME could save 1 instruction if done as 8x4 ...
"movd (%1), %%mm0
\n\t
"
"add %3, %1
\n\t
"
"movd (%1), %%mm1
\n\t
"
"movd (%1,%3,1), %%mm2
\n\t
"
"movd (%1,%3,2), %%mm3
\n\t
"
"punpcklbw %%mm1, %%mm0
\n\t
"
"punpcklbw %%mm3, %%mm2
\n\t
"
"movq %%mm0, %%mm1
\n\t
"
"punpcklwd %%mm2, %%mm0
\n\t
"
"punpckhwd %%mm2, %%mm1
\n\t
"
"movd %%mm0, (%0)
\n\t
"
"add %2, %0
\n\t
"
"punpckhdq %%mm0, %%mm0
\n\t
"
"movd %%mm0, (%0)
\n\t
"
"movd %%mm1, (%0,%2,1)
\n\t
"
"punpckhdq %%mm1, %%mm1
\n\t
"
"movd %%mm1, (%0,%2,2)
\n\t
"
:
"+&r"
(
dst
),
"+&r"
(
src
)
:
"r"
(
dst_stride
),
"r"
(
src_stride
)
:
"memory"
);
}
#define H263_LOOP_FILTER \
"pxor %%mm7, %%mm7 \n\t" \
"movq %0, %%mm0 \n\t" \
...
...
This diff is collapsed.
Click to expand it.
libavcodec/x86/dsputil_mmx.h
+
0
−
34
View file @
685f5438
...
...
@@ -78,12 +78,6 @@ extern const double ff_pd_2[2];
"movq "#c", 2*"#stride"+"#out"\n\t"\
"movq "#d", 3*"#stride"+"#out"\n\t"
/* in/out: mma=mma+mmb, mmb=mmb-mma */
#define SUMSUB_BA( a, b ) \
"paddw "#b", "#a" \n\t"\
"paddw "#b", "#b" \n\t"\
"psubw "#a", "#b" \n\t"
#define SBUTTERFLY(a,b,t,n,m)\
"mov" #m " " #a ", " #t " \n\t"
/* abcd */
\
"punpckl" #n " " #b ", " #a " \n\t"
/* aebf */
\
...
...
@@ -95,34 +89,6 @@ extern const double ff_pd_2[2];
SBUTTERFLY(a,c,d,dq,q)
/* a=aeim d=bfjn */
\
SBUTTERFLY(t,b,c,dq,q)
/* t=cgko c=dhlp */
static
inline
void
transpose4x4
(
uint8_t
*
dst
,
uint8_t
*
src
,
x86_reg
dst_stride
,
x86_reg
src_stride
){
__asm__
volatile
(
//FIXME could save 1 instruction if done as 8x4 ...
"movd (%1), %%mm0
\n\t
"
"add %3, %1
\n\t
"
"movd (%1), %%mm1
\n\t
"
"movd (%1,%3,1), %%mm2
\n\t
"
"movd (%1,%3,2), %%mm3
\n\t
"
"punpcklbw %%mm1, %%mm0
\n\t
"
"punpcklbw %%mm3, %%mm2
\n\t
"
"movq %%mm0, %%mm1
\n\t
"
"punpcklwd %%mm2, %%mm0
\n\t
"
"punpckhwd %%mm2, %%mm1
\n\t
"
"movd %%mm0, (%0)
\n\t
"
"add %2, %0
\n\t
"
"punpckhdq %%mm0, %%mm0
\n\t
"
"movd %%mm0, (%0)
\n\t
"
"movd %%mm1, (%0,%2,1)
\n\t
"
"punpckhdq %%mm1, %%mm1
\n\t
"
"movd %%mm1, (%0,%2,2)
\n\t
"
:
"+&r"
(
dst
),
"+&r"
(
src
)
:
"r"
(
dst_stride
),
"r"
(
src_stride
)
:
"memory"
);
}
// e,f,g,h can be memory
// out: a,d,t,c
#define TRANSPOSE8x4(a,b,c,d,e,f,g,h,t)\
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment