initial commit
[goodguy/cinelerra.git] / cinelerra-5.1 / mpeg2enc / simd.h
1 /*
2  *
3  * qblockdist_sse.simd.h
4  * Copyright (C) 2000 Andrew Stevens <as@comlab.ox.ac.uk>
5  *
6  *
7  *
8  * This file is part of mpeg2enc, a free MPEG-2 video stream encoder
9  * based on the original MSSG reference design
10  *
11  * mpeg2enc is free software; you can redistribute new parts
12  * and/or modify under the terms of the GNU General Public License 
13  * as published by
14  * the Free Software Foundation; either version 2 of the License, or
15  * (at your option) any later version.
16  *
17  * mpeg2enc is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * See the files for those sections (c) MSSG
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program; if not, write to the Free Software
26  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
27  */
28
29 #include <inttypes.h>
30
31
32 #ifdef X86_CPU
33
34
35 int mblock_sub44_dists_mmxe( uint8_t *blk,  uint8_t *ref,
36                                                         int ilow, int jlow,
37                                                         int ihigh, int jhigh, 
38                                                         int h, int rowstride, 
39                                                         int threshold,
40                                                         mc_result_s *resvec);
41 int mblock_sub44_dists_mmx( uint8_t *blk,  uint8_t *ref,
42                                                         int ilow, int jlow,
43                                                         int ihigh, int jhigh, 
44                                                         int threshold,
45                                                         int h, int rowstride, mc_result_s *resvec);
46
47 int quant_non_intra_hv_3dnow(   struct pict_data *picture,int16_t *src, int16_t *dst,
48                                                         int mquant, int *nonsat_mquant);
49 int quant_non_intra_hv_sse(     struct pict_data *picture,int16_t *src, int16_t *dst,
50                                                         int mquant, int *nonsat_mquant);
51 int quant_non_intra_hv_mmx(     struct pict_data *picture,int16_t *src, int16_t *dst,
52                                                         int mquant, int *nonsat_mquant);
53                                                         
54 int quantize_ni_mmx(short *dst, short *src, short *quant_mat, 
55                                                    short *i_quant_mat, 
56                                                    int imquant, int mquant, int sat_limit);
57 int quant_weight_coeff_sum_mmx (short *blk, unsigned short*i_quant_mat );
58 int cpuid_flags();
59
60 void iquant_non_intra_m1_sse(int16_t *src, int16_t *dst, uint16_t *qmat);
61 void iquant_non_intra_m1_mmx(int16_t *src, int16_t *dst, uint16_t *qmat);
62
63 int dist1_00_mmxe(uint8_t *blk1, uint8_t *blk2, int lx, int h, int distlim);
64 int dist1_01_mmxe(uint8_t *blk1, uint8_t *blk2, int lx, int h);
65 int dist1_10_mmxe(uint8_t *blk1, uint8_t *blk2, int lx, int h);
66 int dist1_11_mmxe(uint8_t *blk1, uint8_t *blk2, int lx, int h);
67
68 void mblockq_dist1_mmxe(uint8_t *blk1, uint8_t *blk2, int lx, int h, int *resvec);
69 void mblockq_dist22_mmxe(unsigned char *blk1,unsigned char *blk2,int flx,int fh, int* resvec);
70
71 int dist22_mmxe ( uint8_t *blk1, uint8_t *blk2,  int flx, int fh);
72 int dist44_mmxe ( uint8_t *blk1, uint8_t *blk2,  int flx, int fh);
73 int dist2_mmx( uint8_t *blk1, uint8_t *blk2,
74                            int lx, int hx, int hy, int h);
75 int dist2_22_mmx( uint8_t *blk1, uint8_t *blk2,
76                                   int lx, int h);
77 int bdist2_22_mmx( uint8_t *blk1f, uint8_t *blk1b, 
78                                    uint8_t *blk2,
79                                   int lx, int h);
80 int bdist2_mmx (uint8_t *pf, uint8_t *pb,
81                                 uint8_t *p2, int lx,
82                                 int hxf, int hyf, int hxb, int hyb, int h);
83 int bdist1_mmx (uint8_t *pf, uint8_t *pb,
84                                 uint8_t *p2, int lx,
85                                 int hxf, int hyf, int hxb, int hyb, int h);
86
87
88 int dist1_00_mmx ( uint8_t *blk1, uint8_t *blk2,  int lx, int h, int distlim);
89 int dist1_01_mmx(uint8_t *blk1, uint8_t *blk2, int lx, int h);
90 int dist1_10_mmx(uint8_t *blk1, uint8_t *blk2, int lx, int h);
91 int dist1_11_mmx(uint8_t *blk1, uint8_t *blk2, int lx, int h);
92 int dist22_mmx ( uint8_t *blk1, uint8_t *blk2,  int flx, int fh);
93 int dist44_mmx (uint8_t *blk1, uint8_t *blk2,  int qlx, int qh);
94 int dist2_mmx  ( uint8_t *blk1, uint8_t *blk2,
95                            int lx, int hx, int hy, int h);
96 int bdist2_mmx (uint8_t *pf, uint8_t *pb,
97                                 uint8_t *p2, int lx, 
98                                 int hxf, int hyf, int hxb, int hyb, int h);
99 int bdist1_mmx (uint8_t *pf, uint8_t *pb,
100                                 uint8_t *p2, int lx, 
101                                 int hxf, int hyf, int hxb, int hyb, int h);
102
103 void predcomp_00_mmxe(char *src,char *dst,int lx, int w, int h, int addflag);
104 void predcomp_10_mmxe(char *src,char *dst,int lx, int w, int h, int addflag);
105 void predcomp_11_mmxe(char *src,char *dst,int lx, int w, int h, int addflag);
106 void predcomp_01_mmxe(char *src,char *dst,int lx, int w, int h, int addflag);
107
108 void predcomp_00_mmx(char *src,char *dst,int lx, int w, int h, int addflag);
109 void predcomp_10_mmx(char *src,char *dst,int lx, int w, int h, int addflag);
110 void predcomp_11_mmx(char *src,char *dst,int lx, int w, int h, int addflag);
111 void predcomp_01_mmx(char *src,char *dst,int lx, int w, int h, int addflag);
112
113 #endif