xine-lib  1.2.10
greedyhmacros.h
Go to the documentation of this file.
1 // Copyright (c) 2001 Tom Barry. All rights reserved.
4 //
5 // This file is subject to the terms of the GNU General Public License as
6 // published by the Free Software Foundation. A copy of this license is
7 // included with this software distribution in the file COPYING. If you
8 // do not have a copy, you may obtain a copy by writing to the Free
9 // Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
10 //
11 // This software is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details
15 //
17 
18 // Define a few macros for CPU dependent instructions.
19 // I suspect I don't really understand how the C macro preprocessor works but
20 // this seems to get the job done. // TRB 7/01
21 
22 // BEFORE USING THESE YOU MUST SET:
23 
24 // #define SSE_TYPE SSE (or MMX or 3DNOW)
25 
26 // some macros for pavgb instruction
27 // V_PAVGB(mmr1, mmr2, mmr work register, smask) mmr2 may = mmrw if you can trash it
28 
29 #define V_PAVGB_MMX(mmr1, mmr2, mmrw, smask) \
30  "movq "mmr2", "mmrw"\n\t" \
31  "pand "smask", "mmrw"\n\t" \
32  "psrlw $1, "mmrw"\n\t" \
33  "pand "smask", "mmr1"\n\t" \
34  "psrlw $1, "mmr1"\n\t" \
35  "paddusb "mmrw", "mmr1"\n\t"
36 #define V_PAVGB_SSE(mmr1, mmr2, mmrw, smask) "pavgb "mmr2", "mmr1"\n\t"
37 #define V_PAVGB_3DNOW(mmr1, mmr2, mmrw, smask) "pavgusb "mmr2", "mmr1"\n\t"
38 #define V_PAVGB(mmr1, mmr2, mmrw, smask) V_PAVGB2(mmr1, mmr2, mmrw, smask, SSE_TYPE)
39 #define V_PAVGB2(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp)
40 #define V_PAVGB3(mmr1, mmr2, mmrw, smask, ssetyp) V_PAVGB_##ssetyp(mmr1, mmr2, mmrw, smask)
41 
42 // some macros for pmaxub instruction
43 #define V_PMAXUB_MMX(mmr1, mmr2) \
44  "psubusb "mmr2", "mmr1"\n\t" \
45  "paddusb "mmr2", "mmr1"\n\t"
46 #define V_PMAXUB_SSE(mmr1, mmr2) "pmaxub "mmr2", "mmr1"\n\t"
47 #define V_PMAXUB_3DNOW(mmr1, mmr2) V_PMAXUB_MMX(mmr1, mmr2) // use MMX version
48 #define V_PMAXUB(mmr1, mmr2) V_PMAXUB2(mmr1, mmr2, SSE_TYPE)
49 #define V_PMAXUB2(mmr1, mmr2, ssetyp) V_PMAXUB3(mmr1, mmr2, ssetyp)
50 #define V_PMAXUB3(mmr1, mmr2, ssetyp) V_PMAXUB_##ssetyp(mmr1, mmr2)
51 
52 // some macros for pminub instruction
53 // V_PMINUB(mmr1, mmr2, mmr work register) mmr2 may NOT = mmrw
54 #define V_PMINUB_MMX(mmr1, mmr2, mmrw) \
55  "pcmpeqb "mmrw", "mmrw"\n\t" \
56  "psubusb "mmr2", "mmrw"\n\t" \
57  "paddusb "mmrw", "mmr1"\n\t" \
58  "psubusb "mmrw", "mmr1"\n\t"
59 #define V_PMINUB_SSE(mmr1, mmr2, mmrw) "pminub "mmr2", "mmr1"\n\t"
60 #define V_PMINUB_3DNOW(mmr1, mmr2, mmrw) V_PMINUB_MMX(mmr1, mmr2, mmrw) // use MMX version
61 #define V_PMINUB(mmr1, mmr2, mmrw) V_PMINUB2(mmr1, mmr2, mmrw, SSE_TYPE)
62 #define V_PMINUB2(mmr1, mmr2, mmrw, ssetyp) V_PMINUB3(mmr1, mmr2, mmrw, ssetyp)
63 #define V_PMINUB3(mmr1, mmr2, mmrw, ssetyp) V_PMINUB_##ssetyp(mmr1, mmr2, mmrw)
64 
65 // some macros for movntq instruction
66 // V_MOVNTQ(mmr1, mmr2)
67 #define V_MOVNTQ_MMX(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t"
68 #define V_MOVNTQ_3DNOW(mmr1, mmr2) "movq "mmr2", "mmr1"\n\t"
69 #define V_MOVNTQ_SSE(mmr1, mmr2) "movntq "mmr2", "mmr1"\n\t"
70 #define V_MOVNTQ(mmr1, mmr2) V_MOVNTQ2(mmr1, mmr2, SSE_TYPE)
71 #define V_MOVNTQ2(mmr1, mmr2, ssetyp) V_MOVNTQ3(mmr1, mmr2, ssetyp)
72 #define V_MOVNTQ3(mmr1, mmr2, ssetyp) V_MOVNTQ_##ssetyp(mmr1, mmr2)
73 
74 // end of macros
deinterlace_greedy_packed422_scanline_mmxext
static void deinterlace_greedy_packed422_scanline_mmxext(uint8_t *output, deinterlace_scanline_data_t *data, int width)
Definition: greedy.c:62
deinterlace_scanline_data_s::t1
uint8_t * t1
Definition: deinterlace.h:57
copy_scanline
static void copy_scanline(uint8_t *output, deinterlace_scanline_data_t *data, int width)
Definition: double.c:44
xineutils.h
deinterlace_scanline_double
static void deinterlace_scanline_double(uint8_t *output, deinterlace_scanline_data_t *data, int width)
Definition: double.c:37
doublemethod
static const deinterlace_method_t doublemethod
Definition: double.c:52
xine_fast_memcpy
void *(* xine_fast_memcpy)(void *to, const void *from, size_t len)
Definition: memcpy.c:60
paddusb_m2r
#define paddusb_m2r(var, reg)
Definition: mmx.h:468
deinterlace_scanline_data_s::m0
uint8_t * m0
Definition: deinterlace.h:56
deinterlace_scanline_data_s::m1
uint8_t * m1
Definition: deinterlace.h:57
xine_mmx.h
psubusb_r2r
#define psubusb_r2r(regs, regd)
Definition: mmx.h:506
deinterlace_scanline_data_s::b1
uint8_t * b1
Definition: deinterlace.h:57
pavgb_r2r
#define pavgb_r2r(regs, regd)
Definition: mmx.h:226
sfence
#define sfence()
Definition: mmx.h:263
speedtools.h
deinterlace_scanline_data_s
Definition: deinterlace.h:54
mmx_t::uq
unsigned long long uq
Definition: mmx.h:55
greedy2frame_get_method
const deinterlace_method_t * greedy2frame_get_method(void)
Definition: greedy2frame.c:108
attributes.h
por_r2r
#define por_r2r(regs, regd)
Definition: mmx.h:570
copy_scanline
static void copy_scanline(uint8_t *output, deinterlace_scanline_data_t *data, int width)
Definition: greedy.c:55
movq_m2r
#define movq_m2r(var, reg)
Definition: mmx.h:411
NULL
NULL
Definition: xine_plugin.c:78
xine_mm_accel
uint32_t xine_mm_accel(void)
Definition: cpu_accel.c:390
blit_packed422_scanline
void(* blit_packed422_scanline)(uint8_t *dest, const uint8_t *src, int width)
Definition: speedy.c:79
plugins.h
greedymethod
static const deinterlace_method_t greedymethod
Definition: greedy.c:175
width
unsigned int width
Definition: gfontrle.c:4
pcmpeqb_r2r
#define pcmpeqb_r2r(regs, regd)
Definition: mmx.h:593
paddusb_r2r
#define paddusb_r2r(regs, regd)
Definition: mmx.h:469
deinterlace_scanline_data_s::t0
uint8_t * t0
Definition: deinterlace.h:56
double_get_method
const deinterlace_method_t * double_get_method(void)
Definition: double.c:67
mmx_t
Definition: mmx.h:53
mmx_t::ub
unsigned char ub[8]
Definition: mmx.h:61
deinterlace_method_s
Definition: deinterlace.h:123
movntq_r2m
#define movntq_r2m(mmreg, var)
Definition: mmx.h:223
greedy2frame_template.c
emms
#define emms()
Definition: mmx.h:732
deinterlace_frame_data_s::f0
uint8_t * f0
Definition: deinterlace.h:105
height
unsigned int height
Definition: gfontrle.c:5
MM_ACCEL_X86_SSE2
#define MM_ACCEL_X86_SSE2
Definition: xineutils.h:168
deinterlace_frame_data_s
Definition: deinterlace.h:103
deinterlace_frame_data_s::f2
uint8_t * f2
Definition: deinterlace.h:107
DeinterlaceGreedy2Frame_SSE2
static void DeinterlaceGreedy2Frame_SSE2(uint8_t *output, int outstride, deinterlace_frame_data_t *data, int bottom_field, int second_field, int width, int height)
Definition: greedy2frame_template_sse2.c:95
DeinterlaceGreedy2Frame_MMX
static void DeinterlaceGreedy2Frame_MMX(uint8_t *output, int outstride, deinterlace_frame_data_t *data, int bottom_field, int second_field, int width, int height)
Definition: greedy2frame_template.c:108
speedy.h
greedy_get_method
const deinterlace_method_t * greedy_get_method(void)
Definition: greedy.c:200
deinterlace_scanline_data_s::m2
uint8_t * m2
Definition: deinterlace.h:58
greedy2framemethod
static const deinterlace_method_t greedy2framemethod
Definition: greedy2frame.c:93
deinterlace_frame_data_s::f1
uint8_t * f1
Definition: deinterlace.h:106
greedy2frame_template_sse2.c
config.h
movq_r2r
#define movq_r2r(regs, regd)
Definition: mmx.h:413
pand_r2r
#define pand_r2r(regs, regd)
Definition: mmx.h:555
psubusb_m2r
#define psubusb_m2r(var, reg)
Definition: mmx.h:505
DeinterlaceGreedy2Frame
static void DeinterlaceGreedy2Frame(uint8_t *output, int outstride, deinterlace_frame_data_t *data, int bottom_field, int second_field, int width, int height)
Definition: greedy2frame.c:59
MM_ACCEL_X86_MMXEXT
#define MM_ACCEL_X86_MMXEXT
Definition: xineutils.h:166
deinterlace.h