Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 754 lines (619 sloc) 28.097 kb
ff4ec49e » Fabrice Bellard
2002-05-25 license/copyright change
1 /*
2 * DSP utils
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard.
8f2ab833 » michaelni
2004-01-10 copyright year update of the files i touched and remembered, things l…
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
ff4ec49e » Fabrice Bellard
2002-05-25 license/copyright change
5 *
b78e7197 » DonDiego
2006-10-07 Change license headers to say 'FFmpeg' instead of 'this program/this …
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
ff4ec49e » Fabrice Bellard
2002-05-25 license/copyright change
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
b78e7197 » DonDiego
2006-10-07 Change license headers to say 'FFmpeg' instead of 'this program/this …
11 * version 2.1 of the License, or (at your option) any later version.
ff4ec49e » Fabrice Bellard
2002-05-25 license/copyright change
12 *
b78e7197 » DonDiego
2006-10-07 Change license headers to say 'FFmpeg' instead of 'this program/this …
13 * FFmpeg is distributed in the hope that it will be useful,
ff4ec49e » Fabrice Bellard
2002-05-25 license/copyright change
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
b78e7197 » DonDiego
2006-10-07 Change license headers to say 'FFmpeg' instead of 'this program/this …
19 * License along with FFmpeg; if not, write to the Free Software
5509bffa » DonDiego
2006-01-12 Update licensing information: The FSF changed postal address.
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ff4ec49e » Fabrice Bellard
2002-05-25 license/copyright change
21 */
24641185 » michaelni
2003-03-06 more dox
22
23 /**
24 * @file dsputil.h
983e3246 » michaelni
2003-03-06 per file doxy
25 * DSP utils.
5755c27f » michaelni
2003-04-25 doc fixes (forgot to commit)
26 * note, many functions in here may use MMX which trashes the FPU state, it is
27 * absolutely necessary to call emms_c() between dsp & float/double code
24641185 » michaelni
2003-03-06 more dox
28 */
29
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
30 #ifndef DSPUTIL_H
31 #define DSPUTIL_H
32
43f1708f » Juanjo
2002-02-26 - Added PSNR feature to libavcodec and ffmpeg. By now just Y PSNR unt…
33 #include "avcodec.h"
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
34
24641185 » michaelni
2003-03-06 more dox
35
44eb4951 » michaelni
2002-03-09 divx5-gmc support
36 //#define DEBUG
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
37 /* dct code */
38 typedef short DCTELEM;
059715a4 » Robert Edele
2006-03-16 First part of a series of speed-enchancing patches.
39 typedef int DWTELEM;
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
40
03c94ede » Fabrice Bellard
2002-06-04 avoid name clash with libjpeg - added missing externs
41 void fdct_ifast (DCTELEM *data);
48b1f800 » rvs
2003-10-25 * adding integer/floating point AAN implementations for DCT 2-4-8
42 void fdct_ifast248 (DCTELEM *data);
28db7fce » michaelni
2002-08-29 slow but accurate integer dct from IJG (should be ok with the LGPL as…
43 void ff_jpeg_fdct_islow (DCTELEM *data);
10acc479 » rvs
2003-10-24 * introducing dct248 into the DSP context.
44 void ff_fdct248_islow (DCTELEM *data);
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
45
46 void j_rev_dct (DCTELEM *data);
178fcca8 » michaelni
2004-09-25 1/2 resolution decoding
47 void j_rev_dct4 (DCTELEM *data);
9ca358b9 » michaelni
2004-09-26 1/4 resolution decoding
48 void j_rev_dct2 (DCTELEM *data);
1aa8c57b » michaelni
2004-09-26 1/8 resolution decoding
49 void j_rev_dct1 (DCTELEM *data);
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
50
3f09f52a » arpitest
2002-09-19 fdct_mmx -> ff_fdct_mmx (renamed to avoid namespace conflict with xvid)
51 void ff_fdct_mmx(DCTELEM *block);
cf3bf5bb » michaelni
2003-10-23 minor mmx2 optimization if the dct
52 void ff_fdct_mmx2(DCTELEM *block);
8fd19ab2 » michaelni
2004-01-29 SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
53 void ff_fdct_sse2(DCTELEM *block);
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
54
43efd19a » Loren Merritt
2005-06-02 decode H.264 with 8x8 transform.
55 void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride);
0fa8158d » michaelni
2004-09-27 move h264 idct to its own file and call via function pointer in DspCo…
56 void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride);
ef9d1d15 » Loren Merritt
2006-02-10 h264: special case dc-only idct. ~1% faster overall
57 void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
58 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
0fa8158d » michaelni
2004-09-27 move h264 idct to its own file and call via function pointer in DspCo…
59 void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block);
60 void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block);
61
eb4825b5 » Loren Merritt
2006-08-10 sse and 3dnow implementations of float->int conversion and mdct windo…
62 void ff_vector_fmul_add_add_c(float *dst, const float *src0, const float *src1,
63 const float *src2, int src3, int blocksize, int step);
64 void ff_float_to_int16_c(int16_t *dst, const float *src, int len);
65
e0eac44e » Fabrice Bellard
2001-08-07 added block permutation functions
66 /* encoding scans */
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
67 extern const uint8_t ff_alternate_horizontal_scan[64];
68 extern const uint8_t ff_alternate_vertical_scan[64];
69 extern const uint8_t ff_zigzag_direct[64];
10acc479 » rvs
2003-10-24 * introducing dct248 into the DSP context.
70 extern const uint8_t ff_zigzag248_direct[64];
5a240838 » michaelni
2002-01-10 fix for non-mmx runtimedetect encoding bugs - patch by Michael Nieder…
71
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
72 /* pixel operations */
f2e92ef2 » michaelni
2004-06-21 increase size of crop table
73 #define MAX_NEG_CROP 1024
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
74
75 /* temporary */
1d503957 » mansr
2006-11-12 rename squareTbl -> ff_squareTbl
76 extern uint32_t ff_squareTbl[512];
55fde95e » mansr
2006-11-12 rename cropTbl -> ff_cropTbl
77 extern uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
78
44cb64ee » multimediamike
2004-03-08 seperated out the C-based VP3 DSP functions into a different file; also
79 /* VP3 DSP functions */
8b6103da » michaelni
2005-05-17 porting vp3 idct over to lavc idct api
80 void ff_vp3_idct_c(DCTELEM *block/* align 16*/);
81 void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
82 void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
83
54009d42 » michaelni
2006-03-31 remove mpegvideo.c img resample dependancy
84 /* 1/2^n downscaling functions from imgconvert.c */
85 void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
86 void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
87 void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
88 void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
703c8195 » Loren Merritt
2006-04-04 mmx implementation of 3-point GMC. (5x faster than C)
89
90 void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
91 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
54009d42 » michaelni
2006-03-31 remove mpegvideo.c img resample dependancy
92
b7c27ee6 » michaelni
2002-09-14 alignment info
93 /* minimum alignment rules ;)
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
94 if u notice errors in the align stuff, need more alignment for some asm code for some cpu
b7c27ee6 » michaelni
2002-09-14 alignment info
95 or need to use a function with less aligned data then send a mail to the ffmpeg-dev list, ...
96
97 !warning these alignments might not match reallity, (missing attribute((align)) stuff somewhere possible)
98 i (michael) didnt check them, these are just the alignents which i think could be reached easily ...
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
99
b7c27ee6 » michaelni
2002-09-14 alignment info
100 !future video codecs might need functions with less strict alignment
101 */
102
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
103 /*
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
104 void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
105 void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
106 void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
107 void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
649c00c9 » michaelni
2002-03-28 sizeof(s->block) isnt 64*6*2 anymore bugfix
108 void clear_blocks_c(DCTELEM *blocks);
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
109 */
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
110
111 /* add and put pixel (decoding) */
b7c27ee6 » michaelni
2002-09-14 alignment info
112 // blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
7d67aa9b » michaelni
2003-12-30 info about h and tpel
113 //h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller then 4
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
114 typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
669ac79c » michaelni
2003-05-15 moving the svq3 motion compensation stuff to dsputil (this also means…
115 typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h);
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
116 typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
0da71265 » michaelni
2003-04-04 H264 decoder & demuxer
117 typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
9f2d1b4f » Loren Merritt
2005-01-07 H.264 weighted prediction.
118 typedef void (*h264_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int offset);
e8b56208 » Loren Merritt
2006-01-09 tweak h264_biweight
119 typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset);
b3184779 » michaelni
2002-09-11 put/avg_pixels16
120
db794953 » michaelni
2003-01-09 qpel fix
121 #define DEF_OLD_QPEL(name)\
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
122 void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
123 void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
124 void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
db794953 » michaelni
2003-01-09 qpel fix
125
126 DEF_OLD_QPEL(qpel16_mc11_old_c)
127 DEF_OLD_QPEL(qpel16_mc31_old_c)
128 DEF_OLD_QPEL(qpel16_mc12_old_c)
129 DEF_OLD_QPEL(qpel16_mc32_old_c)
130 DEF_OLD_QPEL(qpel16_mc13_old_c)
131 DEF_OLD_QPEL(qpel16_mc33_old_c)
132 DEF_OLD_QPEL(qpel8_mc11_old_c)
133 DEF_OLD_QPEL(qpel8_mc31_old_c)
134 DEF_OLD_QPEL(qpel8_mc12_old_c)
135 DEF_OLD_QPEL(qpel8_mc32_old_c)
136 DEF_OLD_QPEL(qpel8_mc13_old_c)
137 DEF_OLD_QPEL(qpel8_mc33_old_c)
b3184779 » michaelni
2002-09-11 put/avg_pixels16
138
139 #define CALL_2X_PIXELS(a, b, n)\
140 static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
141 b(block , pixels , line_size, h);\
142 b(block+n, pixels+n, line_size, h);\
143 }
44eb4951 » michaelni
2002-03-09 divx5-gmc support
144
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
145 /* motion estimation */
7d67aa9b » michaelni
2003-12-30 info about h and tpel
146 // h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller then 2
755bfeab » DonDiego
2007-06-12 misc spelling fixes
147 // although currently h<4 is not used as functions with width <8 are neither used nor implemented
bb198e19 » michaelni
2003-12-30 interlaced motion estimation
148 typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size, int h)/* __attribute__ ((const))*/;
1457ab52 » michaelni
2002-12-27 qpel encoding
149
0da71265 » michaelni
2003-04-04 H264 decoder & demuxer
150
059715a4 » Robert Edele
2006-03-16 First part of a series of speed-enchancing patches.
151 // for snow slices
152 typedef struct slice_buffer_s slice_buffer;
153
24641185 » michaelni
2003-03-06 more dox
154 /**
155 * DSPContext.
156 */
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
157 typedef struct DSPContext {
158 /* pixel ops : interface with DCT */
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
159 void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
160 void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
161 void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
f9ed9d85 » multimediamike
2004-04-27 separate out put_signed_pixels_clamped() into its own function and
162 void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
163 void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
36940eca » Loren Merritt
2005-06-17 H.264 lossless mode
164 void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size);
165 void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size);
1edbfe19 » Loren Merritt
2007-05-12 factor sum_abs_dctelem out of dct_sad, and simd it.
166 int (*sum_abs_dctelem)(DCTELEM *block/*align 16*/);
d518aebd » michaelni
2003-03-15 halfpel MC doxy
167 /**
168 * translational global motion compensation.
169 */
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
170 void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
d518aebd » michaelni
2003-03-15 halfpel MC doxy
171 /**
172 * global motion compensation.
173 */
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
174 void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
bb270c08 » DonDiego
2005-12-22 COSMETICS: tabs --> spaces, some prettyprinting
175 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
176 void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
177 int (*pix_sum)(uint8_t * pix, int line_size);
178 int (*pix_norm1)(uint8_t * pix, int line_size);
bb198e19 » michaelni
2003-12-30 interlaced motion estimation
179 // 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
180
622348f9 » michaelni
2004-01-05 interlaced dct decision cleanup
181 me_cmp_func sad[5]; /* identical to pix_absAxA except additional void * */
182 me_cmp_func sse[5];
183 me_cmp_func hadamard8_diff[5];
184 me_cmp_func dct_sad[5];
185 me_cmp_func quant_psnr[5];
186 me_cmp_func bit[5];
187 me_cmp_func rd[5];
188 me_cmp_func vsad[5];
189 me_cmp_func vsse[5];
e6a2ac34 » michaelni
2004-06-07 noise preserving sum of squares comparission function
190 me_cmp_func nsse[5];
26efc54e » michaelni
2004-08-22 4x4 SSE compare function
191 me_cmp_func w53[5];
192 me_cmp_func w97[5];
0fd6aea1 » michaelni
2004-12-08 more flexible frame skip decission
193 me_cmp_func dct_max[5];
27c61ac5 » michaelni
2006-01-04 8x8 integer dct from x264 as cmp function (under CONFIG_GPL)
194 me_cmp_func dct264_sad[5];
1457ab52 » michaelni
2002-12-27 qpel encoding
195
bb198e19 » michaelni
2003-12-30 interlaced motion estimation
196 me_cmp_func me_pre_cmp[5];
197 me_cmp_func me_cmp[5];
198 me_cmp_func me_sub_cmp[5];
199 me_cmp_func mb_cmp[5];
622348f9 » michaelni
2004-01-05 interlaced dct decision cleanup
200 me_cmp_func ildct_cmp[5]; //only width 16 used
0fd6aea1 » michaelni
2004-12-08 more flexible frame skip decission
201 me_cmp_func frame_skip_cmp[5]; //only width 8 used
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
202
59006372 » Loren Merritt
2007-03-30 mmx 16-bit ssd. 2.3x faster svq1 encoding.
203 int (*ssd_int8_vs_int16)(int8_t *pix1, int16_t *pix2, int size);
204
d518aebd » michaelni
2003-03-15 halfpel MC doxy
205 /**
206 * Halfpel motion compensation with rounding (a+b+1)>>1.
30f15053 » lu-zero
2007-03-30 Typos in comments
207 * this is an array[4][4] of motion compensation functions for 4
e5771f4f » michaelni
2004-01-01 put_pixels width comment fix
208 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27f » michaelni
2003-04-25 doc fixes (forgot to commit)
209 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aebd » michaelni
2003-03-15 halfpel MC doxy
210 * @param block destination where the result is stored
211 * @param pixels source
212 * @param line_size number of bytes in a horizontal line of block
213 * @param h height
214 */
669ac79c » michaelni
2003-05-15 moving the svq3 motion compensation stuff to dsputil (this also means…
215 op_pixels_func put_pixels_tab[4][4];
d518aebd » michaelni
2003-03-15 halfpel MC doxy
216
217 /**
218 * Halfpel motion compensation with rounding (a+b+1)>>1.
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
219 * This is an array[4][4] of motion compensation functions for 4
e5771f4f » michaelni
2004-01-01 put_pixels width comment fix
220 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27f » michaelni
2003-04-25 doc fixes (forgot to commit)
221 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aebd » michaelni
2003-03-15 halfpel MC doxy
222 * @param block destination into which the result is averaged (a+b+1)>>1
223 * @param pixels source
224 * @param line_size number of bytes in a horizontal line of block
225 * @param h height
226 */
da3b9756 » multimediamike
2003-06-19 added support for B-frames and multiple slices
227 op_pixels_func avg_pixels_tab[4][4];
d518aebd » michaelni
2003-03-15 halfpel MC doxy
228
229 /**
230 * Halfpel motion compensation with no rounding (a+b)>>1.
30f15053 » lu-zero
2007-03-30 Typos in comments
231 * this is an array[2][4] of motion compensation functions for 2
eb14c713 » michaelni
2003-05-05 doxy
232 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27f » michaelni
2003-04-25 doc fixes (forgot to commit)
233 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aebd » michaelni
2003-03-15 halfpel MC doxy
234 * @param block destination where the result is stored
235 * @param pixels source
236 * @param line_size number of bytes in a horizontal line of block
237 * @param h height
238 */
dbc56b39 » michaelni
2004-06-11 chroma me fix
239 op_pixels_func put_no_rnd_pixels_tab[4][4];
d518aebd » michaelni
2003-03-15 halfpel MC doxy
240
241 /**
242 * Halfpel motion compensation with no rounding (a+b)>>1.
30f15053 » lu-zero
2007-03-30 Typos in comments
243 * this is an array[2][4] of motion compensation functions for 2
eb14c713 » michaelni
2003-05-05 doxy
244 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27f » michaelni
2003-04-25 doc fixes (forgot to commit)
245 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aebd » michaelni
2003-03-15 halfpel MC doxy
246 * @param block destination into which the result is averaged (a+b)>>1
247 * @param pixels source
248 * @param line_size number of bytes in a horizontal line of block
249 * @param h height
250 */
dbc56b39 » michaelni
2004-06-11 chroma me fix
251 op_pixels_func avg_no_rnd_pixels_tab[4][4];
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
252
c0a0170c » michaelni
2004-03-05 fix motion compensation with (x+1/2,y+1/2) MVs
253 void (*put_no_rnd_pixels_l2[2])(uint8_t *block/*align width (8 or 16)*/, const uint8_t *a/*align 1*/, const uint8_t *b/*align 1*/, int line_size, int h);
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
254
669ac79c » michaelni
2003-05-15 moving the svq3 motion compensation stuff to dsputil (this also means…
255 /**
256 * Thirdpel motion compensation with rounding (a+b+1)>>1.
30f15053 » lu-zero
2007-03-30 Typos in comments
257 * this is an array[12] of motion compensation functions for the 9 thirdpe
258 * positions<br>
669ac79c » michaelni
2003-05-15 moving the svq3 motion compensation stuff to dsputil (this also means…
259 * *pixels_tab[ xthirdpel + 4*ythirdpel ]
260 * @param block destination where the result is stored
261 * @param pixels source
262 * @param line_size number of bytes in a horizontal line of block
263 * @param h height
264 */
265 tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
da3b9756 » multimediamike
2003-06-19 added support for B-frames and multiple slices
266 tpel_mc_func avg_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
267
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
268 qpel_mc_func put_qpel_pixels_tab[2][16];
269 qpel_mc_func avg_qpel_pixels_tab[2][16];
270 qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
271 qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16];
1457ab52 » michaelni
2002-12-27 qpel encoding
272 qpel_mc_func put_mspel_pixels_tab[8];
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
273
0da71265 » michaelni
2003-04-04 H264 decoder & demuxer
274 /**
30f15053 » lu-zero
2007-03-30 Typos in comments
275 * h264 Chroma MC
0da71265 » michaelni
2003-04-04 H264 decoder & demuxer
276 */
277 h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
e34350a3 » Kostya Shishkov
2006-09-02 New function for chroma MC (will be used in VC-1)
278 /* This is really one func used in VC-1 decoding */
279 h264_chroma_mc_func put_no_rnd_h264_chroma_pixels_tab[3];
0da71265 » michaelni
2003-04-04 H264 decoder & demuxer
280 h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
281
80e44bc3 » michaelni
2006-01-08 use h264 MC functions for 2xX Xx2 blocks in snow too
282 qpel_mc_func put_h264_qpel_pixels_tab[4][16];
283 qpel_mc_func avg_h264_qpel_pixels_tab[4][16];
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
284
2833fc46 » Loren Merritt
2006-10-01 approximate qpel functions: sacrifice some quality for some decoding …
285 qpel_mc_func put_2tap_qpel_pixels_tab[4][16];
286 qpel_mc_func avg_2tap_qpel_pixels_tab[4][16];
287
9f2d1b4f » Loren Merritt
2005-01-07 H.264 weighted prediction.
288 h264_weight_func weight_h264_pixels_tab[10];
289 h264_biweight_func biweight_h264_pixels_tab[10];
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
290
b482e2d1 » michaelni
2006-07-03 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
291 /* AVS specific */
292 qpel_mc_func put_cavs_qpel_pixels_tab[2][16];
293 qpel_mc_func avg_cavs_qpel_pixels_tab[2][16];
294 void (*cavs_filter_lv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
295 void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
296 void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
297 void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
298 void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
299
bb198e19 » michaelni
2003-12-30 interlaced motion estimation
300 me_cmp_func pix_abs[2][4];
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
301
11f18faf » michaelni
2002-11-14 huffyuv
302 /* huffyuv specific */
303 void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
1457ab52 » michaelni
2002-12-27 qpel encoding
304 void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w);
84705403 » michaelni
2003-10-13 mmx2 optimization of huffyuv median encoding
305 /**
306 * subtract huffyuv's variant of median prediction
307 * note, this might read from src1[-1], src2[-1]
308 */
309 void (*sub_hfyu_median_prediction)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top);
3d2e8cce » michaelni
2003-05-19 ASV1 codec
310 void (*bswap_buf)(uint32_t *dst, uint32_t *src, int w);
42251a2a » Loren Merritt
2005-04-25 MMX for H.264 deblocking filter
311
5cf08f23 » Loren Merritt
2005-05-18 H.264 deblocking optimizations (mmx for chroma_bS4 case, convert exis…
312 void (*h264_v_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
313 void (*h264_h_loop_filter_luma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
314 void (*h264_v_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
315 void (*h264_h_loop_filter_chroma)(uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0);
316 void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta);
317 void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix, int stride, int alpha, int beta);
3e20143e » Loren Merritt
2006-08-28 mmx implementation of deblocking strength decision.
318 // h264_loop_filter_strength: simd only. the C version is inlined in h264.c
319 void (*h264_loop_filter_strength)(int16_t bS[2][4][4], uint8_t nnz[40], int8_t ref[2][40], int16_t mv[2][40][2],
320 int bidir, int edges, int step, int mask_mv0, int mask_mv1);
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
321
332f9ac4 » michaelni
2003-12-01 h263 loop filter
322 void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale);
323 void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale);
324
fdbbf2e0 » michaelni
2004-05-30 rewrite h261 loop filter
325 void (*h261_loop_filter)(uint8_t *src, int stride);
c6148de2 » michaelni
2004-05-30 h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc …
326
eb4825b5 » Loren Merritt
2006-08-10 sse and 3dnow implementations of float->int conversion and mdct windo…
327 /* assume len is a multiple of 4, and arrays are 16-byte aligned */
2dac4acf » Loren Merritt
2006-08-03 sse & sse2 implementations of vorbis channel coupling.
328 void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize);
eb4825b5 » Loren Merritt
2006-08-10 sse and 3dnow implementations of float->int conversion and mdct windo…
329 /* assume len is a multiple of 8, and arrays are 16-byte aligned */
06972056 » Loren Merritt
2006-08-11 vorbis simd tweaks
330 void (*vector_fmul)(float *dst, const float *src, int len);
eb4825b5 » Loren Merritt
2006-08-10 sse and 3dnow implementations of float->int conversion and mdct windo…
331 void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len);
332 /* assume len is a multiple of 8, and src arrays are 16-byte aligned */
333 void (*vector_fmul_add_add)(float *dst, const float *src0, const float *src1, const float *src2, int src3, int len, int step);
334
335 /* C version: convert floats from the range [384.0,386.0] to ints in [-32768,32767]
98145875 » lu-zero
2006-08-31 Align the input buffer in ffplay, introduce a public macro for aligne…
336 * simd versions: convert floats from [-32768.0,32767.0] without rescaling and arrays are 16byte aligned */
eb4825b5 » Loren Merritt
2006-08-10 sse and 3dnow implementations of float->int conversion and mdct windo…
337 void (*float_to_int16)(int16_t *dst, const float *src, int len);
2dac4acf » Loren Merritt
2006-08-03 sse & sse2 implementations of vorbis channel coupling.
338
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
339 /* (I)DCT */
340 void (*fdct)(DCTELEM *block/* align 16*/);
10acc479 » rvs
2003-10-24 * introducing dct248 into the DSP context.
341 void (*fdct248)(DCTELEM *block/* align 16*/);
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
342
4fb518c3 » michaelni
2003-06-21 the return of the idct with 16bit output by ("Ivan Kalvachev" <ivan a…
343 /* IDCT really*/
344 void (*idct)(DCTELEM *block/* align 16*/);
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
345
24641185 » michaelni
2003-03-06 more dox
346 /**
77c92c2d » michaelni
2003-03-06 cosmetics
347 * block -> idct -> clip to unsigned 8 bit -> dest.
24641185 » michaelni
2003-03-06 more dox
348 * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
a1adf436 » michaelni
2003-03-06 typo
349 * @param line_size size in bytes of a horizotal line of dest
24641185 » michaelni
2003-03-06 more dox
350 */
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
351 void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
352
24641185 » michaelni
2003-03-06 more dox
353 /**
354 * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
a1adf436 » michaelni
2003-03-06 typo
355 * @param line_size size in bytes of a horizotal line of dest
24641185 » michaelni
2003-03-06 more dox
356 */
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
357 void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
358
24641185 » michaelni
2003-03-06 more dox
359 /**
77c92c2d » michaelni
2003-03-06 cosmetics
360 * idct input permutation.
05493021 » michaelni
2003-05-11 more idct_permute docs
361 * several optimized IDCTs need a permutated input (relative to the normal order of the reference
362 * IDCT)
363 * this permutation must be performed before the idct_put/add, note, normally this can be merged
364 * with the zigzag/alternate scan<br>
24641185 » michaelni
2003-03-06 more dox
365 * an example to avoid confusion:
366 * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
367 * - (x -> referece dct -> reference idct -> x)
368 * - (x -> referece dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
369 * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
370 */
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
371 uint8_t idct_permutation[64];
372 int idct_permutation_type;
373 #define FF_NO_IDCT_PERM 1
374 #define FF_LIBMPEG2_IDCT_PERM 2
375 #define FF_SIMPLE_IDCT_PERM 3
376 #define FF_TRANSPOSE_IDCT_PERM 4
5773a746 » michaelni
2005-05-17 porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
377 #define FF_PARTTRANS_IDCT_PERM 5
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
378
364a1797 » michaelni
2004-02-06 quantizer noise shaping optimization
379 int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale);
380 void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
381 #define BASIS_SHIFT 16
382 #define RECON_SHIFT 6
115329f1 » DonDiego
2005-12-17 COSMETICS: Remove all trailing whitespace.
383
ea9f5d6f » takis
2006-12-05 Add comment denoting group of H.264 functions
384 /* h264 functions */
0fa8158d » michaelni
2004-09-27 move h264 idct to its own file and call via function pointer in DspCo…
385 void (*h264_idct_add)(uint8_t *dst, DCTELEM *block, int stride);
43efd19a » Loren Merritt
2005-06-02 decode H.264 with 8x8 transform.
386 void (*h264_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
ef9d1d15 » Loren Merritt
2006-02-10 h264: special case dc-only idct. ~1% faster overall
387 void (*h264_idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
388 void (*h264_idct8_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
f1862127 » takis
2006-12-07 Added entry for H.264 DCT to the DSP context.
389 void (*h264_dct)(DCTELEM block[4][4]);
059715a4 » Robert Edele
2006-03-16 First part of a series of speed-enchancing patches.
390
391 /* snow wavelet */
392 void (*vertical_compose97i)(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
393 void (*horizontal_compose97i)(DWTELEM *b, int width);
9dd6c804 » takis
2007-01-30 Add the const specifier as needed to reduce the number of warnings.
394 void (*inner_add_yblock)(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
513fbd8e » Loren Merritt
2006-03-23 prefetch pixels for future motion compensation. 2-5% faster h264.
395
396 void (*prefetch)(void *mem, int stride, int h);
54009d42 » michaelni
2006-03-31 remove mpegvideo.c img resample dependancy
397
398 void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
64db55ae » Kostya Shishkov
2006-07-30 New functions in DSPContext for VC-1 decoding
399
400 /* vc1 functions */
401 void (*vc1_inv_trans_8x8)(DCTELEM *b);
402 void (*vc1_inv_trans_8x4)(DCTELEM *b, int n);
403 void (*vc1_inv_trans_4x8)(DCTELEM *b, int n);
404 void (*vc1_inv_trans_4x4)(DCTELEM *b, int n);
61f5b14a » Kostya Shishkov
2006-11-26 Correct rounding values in overlap filtering
405 void (*vc1_v_overlap)(uint8_t* src, int stride);
406 void (*vc1_h_overlap)(uint8_t* src, int stride);
64db55ae » Kostya Shishkov
2006-07-30 New functions in DSPContext for VC-1 decoding
407 /* put 8x8 block with bicubic interpolation and quarterpel precision
408 * last argument is actually round value instead of height
409 */
410 op_pixels_func put_vc1_mspel_pixels_tab[16];
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
411 } DSPContext;
412
486497e0 » mansr
2006-11-14 revert bad checkin
413 void dsputil_static_init(void);
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
414 void dsputil_init(DSPContext* p, AVCodecContext *avctx);
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
415
6dc7d5da » michaelni
2006-12-07 ff_check_alignment to warn the user about a missaligned stack
416 int ff_check_alignment(void);
417
7801d21d » michaelni
2002-10-23 optimize block_permute()
418 /**
419 * permute block according to permuatation.
420 * @param last last non zero element in scantable order
421 */
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
422 void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
e0eac44e » Fabrice Bellard
2001-08-07 added block permutation functions
423
622348f9 » michaelni
2004-01-05 interlaced dct decision cleanup
424 void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
425
bb270c08 » DonDiego
2005-12-22 COSMETICS: tabs --> spaces, some prettyprinting
426 #define BYTE_VEC32(c) ((c)*0x01010101UL)
d8085ea7 » michaelni
2003-05-14 cleanup
427
428 static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
429 {
430 return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
431 }
432
433 static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
434 {
435 return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
436 }
437
26efc54e » michaelni
2004-08-22 4x4 SSE compare function
438 static inline int get_penalty_factor(int lambda, int lambda2, int type){
439 switch(type&0xFF){
440 default:
441 case FF_CMP_SAD:
442 return lambda>>FF_LAMBDA_SHIFT;
443 case FF_CMP_DCT:
444 return (3*lambda)>>(FF_LAMBDA_SHIFT+1);
445 case FF_CMP_W53:
446 return (4*lambda)>>(FF_LAMBDA_SHIFT);
447 case FF_CMP_W97:
448 return (2*lambda)>>(FF_LAMBDA_SHIFT);
449 case FF_CMP_SATD:
27c61ac5 » michaelni
2006-01-04 8x8 integer dct from x264 as cmp function (under CONFIG_GPL)
450 case FF_CMP_DCT264:
26efc54e » michaelni
2004-08-22 4x4 SSE compare function
451 return (2*lambda)>>FF_LAMBDA_SHIFT;
452 case FF_CMP_RD:
453 case FF_CMP_PSNR:
454 case FF_CMP_SSE:
455 case FF_CMP_NSSE:
456 return lambda2>>FF_LAMBDA_SHIFT;
457 case FF_CMP_BIT:
458 return 1;
459 }
460 }
461
24641185 » michaelni
2003-03-06 more dox
462 /**
77c92c2d » michaelni
2003-03-06 cosmetics
463 * Empty mmx state.
24641185 » michaelni
2003-03-06 more dox
464 * this must be called between any dsp function and float/double code.
465 * for example sin(); dsp->idct_put(); emms_c(); cos()
466 */
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
467 #define emms_c()
468
e629ab68 » Romain Dolbeau
2003-01-11 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot…
469 /* should be defined by architectures supporting
470 one or more MultiMedia extension */
471 int mm_support(void);
472
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
473 #define DECLARE_ALIGNED_16(t, v) DECLARE_ALIGNED(16, t, v)
92a69cf8 » multimediamike
2004-04-25 move __align16 some place where non-MMX machines can see it
474
3d03c0a2 » Fabrice Bellard
2001-08-13 arm optimizations
475 #if defined(HAVE_MMX)
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
476
18f77016 » Zdenek Kabelac
2002-11-12 * fixing some minor const warnings
477 #undef emms_c
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
478
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
479 #define MM_MMX 0x0001 /* standard MMX */
480 #define MM_3DNOW 0x0004 /* AMD 3DNOW */
481 #define MM_MMXEXT 0x0002 /* SSE integer functions or AMD MMX ext */
482 #define MM_SSE 0x0008 /* SSE functions */
483 #define MM_SSE2 0x0010 /* PIV SSE2 functions */
e42a152b » michaelni
2004-12-13 x86 cpu capabilities detection rewrite / cleanup
484 #define MM_3DNOWEXT 0x0020 /* AMD 3DNowExt */
392f6da8 » zuxy
2006-04-28 Remove unused and unsupported Cyrix's "Extended MMX",
485 #define MM_SSE3 0x0040 /* Prescott SSE3 functions */
5a5c770d » Guillaume Poirier
2006-12-18 Add SSSE3 (Core2 aka Conroe/Merom/Woodcrester new instructions) detec…
486 #define MM_SSSE3 0x0080 /* Conroe SSSE3 functions */
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
487
486497e0 » mansr
2006-11-14 revert bad checkin
488 extern int mm_flags;
489
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
490 void add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
491 void put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
f9ed9d85 » multimediamike
2004-04-27 separate out put_signed_pixels_clamped() into its own function and
492 void put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
493
494 static inline void emms(void)
495 {
fb16b7e7 » Fabrice Bellard
2001-07-24 added emms_c() macro which should can used in c code in both mmx/non …
496 __asm __volatile ("emms;":::"memory");
497 }
498
1457ab52 » michaelni
2002-12-27 qpel encoding
499
fb16b7e7 » Fabrice Bellard
2001-07-24 added emms_c() macro which should can used in c code in both mmx/non …
500 #define emms_c() \
501 {\
486497e0 » mansr
2006-11-14 revert bad checkin
502 if (mm_flags & MM_MMX)\
fb16b7e7 » Fabrice Bellard
2001-07-24 added emms_c() macro which should can used in c code in both mmx/non …
503 emms();\
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
504 }
505
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
506 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
68b51e58 » Steve L'Homme
2006-02-05 MSVC-compatible __align8/__align16 declaration
507
3237f731 » michaelni
2004-10-26 stride align cleanup
508 #define STRIDE_ALIGN 8
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
509
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
510 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
511 void dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
2720569a » Zdenek Kabelac
2003-02-11 * prototypes at one place
512
3d03c0a2 » Fabrice Bellard
2001-08-13 arm optimizations
513 #elif defined(ARCH_ARMV4L)
514
515 /* This is to use 4 bytes read to the IDCT pointers for some 'zero'
92a69cf8 » multimediamike
2004-04-25 move __align16 some place where non-MMX machines can see it
516 line optimizations */
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
517 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(4, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
518 #define STRIDE_ALIGN 4
3d03c0a2 » Fabrice Bellard
2001-08-13 arm optimizations
519
eba9ae3c » Gildas Bazin
2005-06-28 IWMMXT configure support + runtime selection patch by (Gildas Bazin, …
520 #define MM_IWMMXT 0x0100 /* XScale IWMMXT */
521
486497e0 » mansr
2006-11-14 revert bad checkin
522 extern int mm_flags;
523
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
524 void dsputil_init_armv4l(DSPContext* c, AVCodecContext *avctx);
3d03c0a2 » Fabrice Bellard
2001-08-13 arm optimizations
525
c34270f5 » Fabrice Bellard
2001-09-16 mlib merge
526 #elif defined(HAVE_MLIB)
527
528 /* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
529 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
530 #define STRIDE_ALIGN 8
c34270f5 » Fabrice Bellard
2001-09-16 mlib merge
531
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
532 void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx);
c34270f5 » Fabrice Bellard
2001-09-16 mlib merge
533
44f54ceb » michaelni
2004-04-23 VIS optimized motion compensation code. by (David S. Miller <davem at…
534 #elif defined(ARCH_SPARC)
535
536 /* SPARC/VIS IDCT needs 8-byte aligned DCT blocks */
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
537 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
538 #define STRIDE_ALIGN 8
44f54ceb » michaelni
2004-04-23 VIS optimized motion compensation code. by (David S. Miller <davem at…
539 void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
540
1e98dffb » Nick Kurshev
2002-01-20 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebi…
541 #elif defined(ARCH_ALPHA)
542
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
543 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
544 #define STRIDE_ALIGN 8
1e98dffb » Nick Kurshev
2002-01-20 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebi…
545
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
546 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
1e98dffb » Nick Kurshev
2002-01-20 Alpha optimizations by Falk Hueffner <falk.hueffner@student.uni-tuebi…
547
59925ef2 » Brian Foley
2002-08-28 first cut at altivec support on darwin patch by (Brian Foley <bfoley …
548 #elif defined(ARCH_POWERPC)
549
404d2241 » Brian Foley
2002-11-26 altivec accelerated v-resample patch by (Brian Foley <bfoley at comps…
550 #define MM_ALTIVEC 0x0001 /* standard AltiVec */
551
486497e0 » mansr
2006-11-14 revert bad checkin
552 extern int mm_flags;
553
3b991c54 » Romain Dolbeau
2003-01-26 Altivec on non darwin systems patch by Romain Dolbeau
554 #if defined(HAVE_ALTIVEC) && !defined(CONFIG_DARWIN)
9a197a24 » michaelni
2003-12-03 altivec.h bug workaround (untested)
555 #define pixel altivec_pixel
3b991c54 » Romain Dolbeau
2003-01-26 Altivec on non darwin systems patch by Romain Dolbeau
556 #include <altivec.h>
9a197a24 » michaelni
2003-12-03 altivec.h bug workaround (untested)
557 #undef pixel
3b991c54 » Romain Dolbeau
2003-01-26 Altivec on non darwin systems patch by Romain Dolbeau
558 #endif
559
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
560 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
561 #define STRIDE_ALIGN 16
59925ef2 » Brian Foley
2002-08-28 first cut at altivec support on darwin patch by (Brian Foley <bfoley …
562
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
563 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
59925ef2 » Brian Foley
2002-08-28 first cut at altivec support on darwin patch by (Brian Foley <bfoley …
564
d46aba26 » Leon van Stuivenberg
2002-09-23 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
565 #elif defined(HAVE_MMI)
566
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
567 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(16, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
568 #define STRIDE_ALIGN 16
d46aba26 » Leon van Stuivenberg
2002-09-23 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
569
b0368839 » michaelni
2003-03-03 MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
570 void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
d46aba26 » Leon van Stuivenberg
2002-09-23 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
571
0c6bd2ea » BERO
2003-05-14 sh4 optimized idct & bswap patch by (BERO <bero at geocities dot co d…
572 #elif defined(ARCH_SH4)
573
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
574 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
575 #define STRIDE_ALIGN 8
0c6bd2ea » BERO
2003-05-14 sh4 optimized idct & bswap patch by (BERO <bero at geocities dot co d…
576
577 void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
578
5ca030fe » Michael Benjamin
2006-09-16 ADI Blackfin optimizations
579 #elif defined(ARCH_BFIN)
580
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
581 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
5ca030fe » Michael Benjamin
2006-09-16 ADI Blackfin optimizations
582 #define STRIDE_ALIGN 8
583
584 void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
585
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
586 #else
587
43c7c7c7 » axic
2007-05-13 use DECLARE_ALIGNED from mem.h (which is included through common.h)
588 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
3237f731 » michaelni
2004-10-26 stride align cleanup
589 #define STRIDE_ALIGN 8
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
590
591 #endif
592
43f1708f » Juanjo
2002-02-26 - Added PSNR feature to libavcodec and ffmpeg. By now just Y PSNR unt…
593 /* PSNR */
0c1a9eda » Zdenek Kabelac
2003-02-11 * UINTX -> uintx_t INTX -> intx_t
594 void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
43f1708f » Juanjo
2002-02-26 - Added PSNR feature to libavcodec and ffmpeg. By now just Y PSNR unt…
595 int orig_linesize[3], int coded_linesize,
596 AVCodecContext *avctx);
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
597
598 /* FFT computation */
599
600 /* NOTE: soon integer code will be added, so you must use the
601 FFTSample type */
602 typedef float FFTSample;
603
bcfa3e58 » Loren Merritt
2006-08-08 3dnow2 implementation of imdct.
604 struct MDCTContext;
605
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
606 typedef struct FFTComplex {
607 FFTSample re, im;
608 } FFTComplex;
609
610 typedef struct FFTContext {
611 int nbits;
612 int inverse;
613 uint16_t *revtab;
614 FFTComplex *exptab;
615 FFTComplex *exptab1; /* only used by SSE code */
616 void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
bcfa3e58 » Loren Merritt
2006-08-08 3dnow2 implementation of imdct.
617 void (*imdct_calc)(struct MDCTContext *s, FFTSample *output,
618 const FFTSample *input, FFTSample *tmp);
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
619 } FFTContext;
620
68951ecf » Gildas Bazin
2004-03-13 fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
621 int ff_fft_init(FFTContext *s, int nbits, int inverse);
622 void ff_fft_permute(FFTContext *s, FFTComplex *z);
623 void ff_fft_calc_c(FFTContext *s, FFTComplex *z);
624 void ff_fft_calc_sse(FFTContext *s, FFTComplex *z);
82eb4b0f » zuxy
2006-03-08 3DNow! & Extended 3DNow! versions of FFT
625 void ff_fft_calc_3dn(FFTContext *s, FFTComplex *z);
626 void ff_fft_calc_3dn2(FFTContext *s, FFTComplex *z);
68951ecf » Gildas Bazin
2004-03-13 fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
627 void ff_fft_calc_altivec(FFTContext *s, FFTComplex *z);
8d268a7d » Fabrice Bellard
2003-01-07 fft altivec by Romain Dolbeau - simplified patch, test it on PPC with…
628
68951ecf » Gildas Bazin
2004-03-13 fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
629 static inline void ff_fft_calc(FFTContext *s, FFTComplex *z)
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
630 {
631 s->fft_calc(s, z);
632 }
68951ecf » Gildas Bazin
2004-03-13 fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
633 void ff_fft_end(FFTContext *s);
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
634
635 /* MDCT computation */
636
637 typedef struct MDCTContext {
638 int n; /* size of MDCT (i.e. number of input data * 2) */
639 int nbits; /* n = 2^nbits */
640 /* pre/post rotation tables */
641 FFTSample *tcos;
642 FFTSample *tsin;
643 FFTContext fft;
644 } MDCTContext;
645
82696bee » Fabrice Bellard
2002-10-29 avoid name clash
646 int ff_mdct_init(MDCTContext *s, int nbits, int inverse);
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
647 void ff_imdct_calc(MDCTContext *s, FFTSample *output,
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
648 const FFTSample *input, FFTSample *tmp);
bcfa3e58 » Loren Merritt
2006-08-08 3dnow2 implementation of imdct.
649 void ff_imdct_calc_3dn2(MDCTContext *s, FFTSample *output,
650 const FFTSample *input, FFTSample *tmp);
ebbafcb4 » Loren Merritt
2006-09-21 sse implementation of imdct.
651 void ff_imdct_calc_sse(MDCTContext *s, FFTSample *output,
652 const FFTSample *input, FFTSample *tmp);
eb4b3dd3 » Zdenek Kabelac
2002-11-11 * using DSPContext - so each codec could use its local (sub)set of CP…
653 void ff_mdct_calc(MDCTContext *s, FFTSample *out,
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
654 const FFTSample *input, FFTSample *tmp);
82696bee » Fabrice Bellard
2002-10-29 avoid name clash
655 void ff_mdct_end(MDCTContext *s);
bb6f5690 » Fabrice Bellard
2002-10-28 new generic FFT/MDCT code for audio codecs
656
bb198e19 » michaelni
2003-12-30 interlaced motion estimation
657 #define WARPER8_16(name8, name16)\
658 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
659 return name8(s, dst , src , stride, h)\
660 +name8(s, dst+8 , src+8 , stride, h);\
661 }
662
663 #define WARPER8_16_SQ(name8, name16)\
664 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
665 int score=0;\
666 score +=name8(s, dst , src , stride, 8);\
667 score +=name8(s, dst+8 , src+8 , stride, 8);\
668 if(h==16){\
669 dst += 8*stride;\
670 src += 8*stride;\
671 score +=name8(s, dst , src , stride, 8);\
672 score +=name8(s, dst+8 , src+8 , stride, 8);\
673 }\
674 return score;\
1457ab52 » michaelni
2002-12-27 qpel encoding
675 }
676
49cef744 » Brian Foley
2006-11-26 Move copy_block* functions to dsp dsputil.h
677
678 static inline void copy_block2(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
679 {
680 int i;
681 for(i=0; i<h; i++)
682 {
683 ST16(dst , LD16(src ));
684 dst+=dstStride;
685 src+=srcStride;
686 }
687 }
688
689 static inline void copy_block4(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
690 {
691 int i;
692 for(i=0; i<h; i++)
693 {
694 ST32(dst , LD32(src ));
695 dst+=dstStride;
696 src+=srcStride;
697 }
698 }
699
700 static inline void copy_block8(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
701 {
702 int i;
703 for(i=0; i<h; i++)
704 {
705 ST32(dst , LD32(src ));
706 ST32(dst+4 , LD32(src+4 ));
707 dst+=dstStride;
708 src+=srcStride;
709 }
710 }
711
712 static inline void copy_block9(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
713 {
714 int i;
715 for(i=0; i<h; i++)
716 {
717 ST32(dst , LD32(src ));
718 ST32(dst+4 , LD32(src+4 ));
719 dst[8]= src[8];
720 dst+=dstStride;
721 src+=srcStride;
722 }
723 }
724
725 static inline void copy_block16(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
726 {
727 int i;
728 for(i=0; i<h; i++)
729 {
730 ST32(dst , LD32(src ));
731 ST32(dst+4 , LD32(src+4 ));
732 ST32(dst+8 , LD32(src+8 ));
733 ST32(dst+12, LD32(src+12));
734 dst+=dstStride;
735 src+=srcStride;
736 }
737 }
738
739 static inline void copy_block17(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h)
740 {
741 int i;
742 for(i=0; i<h; i++)
743 {
744 ST32(dst , LD32(src ));
745 ST32(dst+4 , LD32(src+4 ));
746 ST32(dst+8 , LD32(src+8 ));
747 ST32(dst+12, LD32(src+12));
748 dst[16]= src[16];
749 dst+=dstStride;
750 src+=srcStride;
751 }
752 }
753
de6d9b64 » Fabrice Bellard
2001-07-22 Initial revision
754 #endif
Something went wrong with that request. Please try again.