Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 949 lines (816 sloc) 38.122 kb
ff4ec49 license/copyright change
Fabrice Bellard authored
1 /*
2 * DSP utils
406792e @DonDiego cosmetics: Remove pointless period after copyright statement non-sent…
DonDiego authored
3 * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
8f2ab83 @michaelni copyright year update of the files i touched and remembered, things l…
michaelni authored
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
ff4ec49 license/copyright change
Fabrice Bellard authored
5 *
b78e719 @DonDiego Change license headers to say 'FFmpeg' instead of 'this program/this …
DonDiego authored
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
ff4ec49 license/copyright change
Fabrice Bellard authored
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
b78e719 @DonDiego Change license headers to say 'FFmpeg' instead of 'this program/this …
DonDiego authored
11 * version 2.1 of the License, or (at your option) any later version.
ff4ec49 license/copyright change
Fabrice Bellard authored
12 *
b78e719 @DonDiego Change license headers to say 'FFmpeg' instead of 'this program/this …
DonDiego authored
13 * FFmpeg is distributed in the hope that it will be useful,
ff4ec49 license/copyright change
Fabrice Bellard authored
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
b78e719 @DonDiego Change license headers to say 'FFmpeg' instead of 'this program/this …
DonDiego authored
19 * License along with FFmpeg; if not, write to the Free Software
5509bff @DonDiego Update licensing information: The FSF changed postal address.
DonDiego authored
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ff4ec49 license/copyright change
Fabrice Bellard authored
21 */
2464118 @michaelni more dox
michaelni authored
22
23 /**
bad5537 @DonDiego Use full internal pathname in doxygen @file directives.
DonDiego authored
24 * @file libavcodec/dsputil.h
983e324 @michaelni per file doxy
michaelni authored
25 * DSP utils.
5755c27 @michaelni doc fixes (forgot to commit)
michaelni authored
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
2464118 @michaelni more dox
michaelni authored
28 */
29
9879038 Globally rename the header inclusion guard names.
Stefano Sabatini authored
30 #ifndef AVCODEC_DSPUTIL_H
31 #define AVCODEC_DSPUTIL_H
de6d9b6 Initial revision
Fabrice Bellard authored
32
6a5d31a @DonDiego Fix build: Add intreadwrite.h and bswap.h #includes where necessary.
DonDiego authored
33 #include "libavutil/intreadwrite.h"
43f1708 - Added PSNR feature to libavcodec and ffmpeg. By now just Y PSNR unt…
Juanjo authored
34 #include "avcodec.h"
de6d9b6 Initial revision
Fabrice Bellard authored
35
2464118 @michaelni more dox
michaelni authored
36
44eb495 @michaelni divx5-gmc support
michaelni authored
37 //#define DEBUG
de6d9b6 Initial revision
Fabrice Bellard authored
38 /* dct code */
39 typedef short DCTELEM;
059715a First part of a series of speed-enchancing patches.
Robert Edele authored
40 typedef int DWTELEM;
d593e32 @michaelni use 16bit IDWT (a SIMD implementation of it should be >2x faster then…
michaelni authored
41 typedef short IDWTELEM;
de6d9b6 Initial revision
Fabrice Bellard authored
42
03c94ed avoid name clash with libjpeg - added missing externs
Fabrice Bellard authored
43 void fdct_ifast (DCTELEM *data);
48b1f80 @rvs * adding integer/floating point AAN implementations for DCT 2-4-8
rvs authored
44 void fdct_ifast248 (DCTELEM *data);
28db7fc @michaelni slow but accurate integer dct from IJG (should be ok with the LGPL as…
michaelni authored
45 void ff_jpeg_fdct_islow (DCTELEM *data);
10acc47 @rvs * introducing dct248 into the DSP context.
rvs authored
46 void ff_fdct248_islow (DCTELEM *data);
de6d9b6 Initial revision
Fabrice Bellard authored
47
48 void j_rev_dct (DCTELEM *data);
178fcca @michaelni 1/2 resolution decoding
michaelni authored
49 void j_rev_dct4 (DCTELEM *data);
9ca358b @michaelni 1/4 resolution decoding
michaelni authored
50 void j_rev_dct2 (DCTELEM *data);
1aa8c57 @michaelni 1/8 resolution decoding
michaelni authored
51 void j_rev_dct1 (DCTELEM *data);
9abc7e0 @michaelni intrax8 decoder patch by "someone"
michaelni authored
52 void ff_wmv2_idct_c(DCTELEM *data);
de6d9b6 Initial revision
Fabrice Bellard authored
53
3f09f52 @arpitest fdct_mmx -> ff_fdct_mmx (renamed to avoid namespace conflict with xvid)
arpitest authored
54 void ff_fdct_mmx(DCTELEM *block);
cf3bf5b @michaelni minor mmx2 optimization if the dct
michaelni authored
55 void ff_fdct_mmx2(DCTELEM *block);
8fd19ab @michaelni SSE2 fdct by (Balatoni Denes <pnis at coder dot hu>)
michaelni authored
56 void ff_fdct_sse2(DCTELEM *block);
de6d9b6 Initial revision
Fabrice Bellard authored
57
43efd19 decode H.264 with 8x8 transform.
Loren Merritt authored
58 void ff_h264_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride);
0fa8158 @michaelni move h264 idct to its own file and call via function pointer in DspCo…
michaelni authored
59 void ff_h264_idct_add_c(uint8_t *dst, DCTELEM *block, int stride);
ef9d1d1 h264: special case dc-only idct. ~1% faster overall
Loren Merritt authored
60 void ff_h264_idct8_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
61 void ff_h264_idct_dc_add_c(uint8_t *dst, DCTELEM *block, int stride);
0fa8158 @michaelni move h264 idct to its own file and call via function pointer in DspCo…
michaelni authored
62 void ff_h264_lowres_idct_add_c(uint8_t *dst, int stride, DCTELEM *block);
63 void ff_h264_lowres_idct_put_c(uint8_t *dst, int stride, DCTELEM *block);
ac22385 @michaelni H.264 idct functions that include the chroma, inter luma and intra16 …
michaelni authored
64 void ff_h264_idct_add16_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
65 void ff_h264_idct_add16intra_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
66 void ff_h264_idct8_add4_c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
67 void ff_h264_idct_add8_c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);
0fa8158 @michaelni move h264 idct to its own file and call via function pointer in DspCo…
michaelni authored
68
f27e1d6 simplify vorbis windowing
Loren Merritt authored
69 void ff_vector_fmul_window_c(float *dst, const float *src0, const float *src1,
70 const float *win, float add_bias, int len);
560fa9b @michaelni Fix x86-64
michaelni authored
71 void ff_float_to_int16_c(int16_t *dst, const float *src, long len);
8a37920 r14205 broke vorbis float_to_int on ppc
Loren Merritt authored
72 void ff_float_to_int16_interleave_c(int16_t *dst, const float **src, long len, int channels);
eb4825b sse and 3dnow implementations of float->int conversion and mdct windo…
Loren Merritt authored
73
e0eac44 added block permutation functions
Fabrice Bellard authored
74 /* encoding scans */
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
75 extern const uint8_t ff_alternate_horizontal_scan[64];
76 extern const uint8_t ff_alternate_vertical_scan[64];
77 extern const uint8_t ff_zigzag_direct[64];
10acc47 @rvs * introducing dct248 into the DSP context.
rvs authored
78 extern const uint8_t ff_zigzag248_direct[64];
5a24083 @michaelni fix for non-mmx runtimedetect encoding bugs - patch by Michael Nieder…
michaelni authored
79
de6d9b6 Initial revision
Fabrice Bellard authored
80 /* pixel operations */
f2e92ef @michaelni increase size of crop table
michaelni authored
81 #define MAX_NEG_CROP 1024
de6d9b6 Initial revision
Fabrice Bellard authored
82
83 /* temporary */
1d50395 @mansr rename squareTbl -> ff_squareTbl
mansr authored
84 extern uint32_t ff_squareTbl[512];
55fde95 @mansr rename cropTbl -> ff_cropTbl
mansr authored
85 extern uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP];
de6d9b6 Initial revision
Fabrice Bellard authored
86
44cb64e @multimediamike seperated out the C-based VP3 DSP functions into a different file; also
multimediamike authored
87 /* VP3 DSP functions */
8b6103d @michaelni porting vp3 idct over to lavc idct api
michaelni authored
88 void ff_vp3_idct_c(DCTELEM *block/* align 16*/);
89 void ff_vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
90 void ff_vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
de6d9b6 Initial revision
Fabrice Bellard authored
91
9971331 @yuvi Move VP3 loop filter to DSPContext
yuvi authored
92 void ff_vp3_v_loop_filter_c(uint8_t *src, int stride, int *bounding_values);
93 void ff_vp3_h_loop_filter_c(uint8_t *src, int stride, int *bounding_values);
94
26f3ae8 @aurelj move vp6_filter_diag4() to a new vp6dsp.c file and use it throught ds…
aurelj authored
95 /* VP6 DSP functions */
96 void ff_vp6_filter_diag4_c(uint8_t *dst, uint8_t *src, int stride,
97 const int16_t *h_weights, const int16_t *v_weights);
98
54009d4 @michaelni remove mpegvideo.c img resample dependancy
michaelni authored
99 /* 1/2^n downscaling functions from imgconvert.c */
100 void ff_img_copy_plane(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
101 void ff_shrink22(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
102 void ff_shrink44(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
103 void ff_shrink88(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
703c819 mmx implementation of 3-point GMC. (5x faster than C)
Loren Merritt authored
104
105 void ff_gmc_c(uint8_t *dst, uint8_t *src, int stride, int h, int ox, int oy,
106 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
54009d4 @michaelni remove mpegvideo.c img resample dependancy
michaelni authored
107
b7c27ee @michaelni alignment info
michaelni authored
108 /* minimum alignment rules ;)
7ce6892 @DonDiego misc spelling fixes
DonDiego authored
109 If you notice errors in the align stuff, need more alignment for some ASM code
110 for some CPU or need to use a function with less aligned data then send a mail
111 to the ffmpeg-devel mailing list, ...
112
113 !warning These alignments might not match reality, (missing attribute((align))
114 stuff somewhere possible).
2cab640 @DonDiego typo fixes
DonDiego authored
115 I (Michael) did not check them, these are just the alignments which I think
7ce6892 @DonDiego misc spelling fixes
DonDiego authored
116 could be reached easily ...
de6d9b6 Initial revision
Fabrice Bellard authored
117
b7c27ee @michaelni alignment info
michaelni authored
118 !future video codecs might need functions with less strict alignment
119 */
120
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
121 /*
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
122 void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
123 void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
124 void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
125 void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
649c00c @michaelni sizeof(s->block) isnt 64*6*2 anymore bugfix
michaelni authored
126 void clear_blocks_c(DCTELEM *blocks);
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
127 */
de6d9b6 Initial revision
Fabrice Bellard authored
128
129 /* add and put pixel (decoding) */
b7c27ee @michaelni alignment info
michaelni authored
130 // blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
7d67aa9 @michaelni info about h and tpel
michaelni authored
131 //h for op_pixels_func is limited to {width/2, width} but never larger than 16 and never smaller then 4
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
132 typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
669ac79 @michaelni moving the svq3 motion compensation stuff to dsputil (this also means…
michaelni authored
133 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);
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
134 typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
0da7126 @michaelni H264 decoder & demuxer
michaelni authored
135 typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
9f2d1b4 H.264 weighted prediction.
Loren Merritt authored
136 typedef void (*h264_weight_func)(uint8_t *block, int stride, int log2_denom, int weight, int offset);
e8b5620 tweak h264_biweight
Loren Merritt authored
137 typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, int stride, int log2_denom, int weightd, int weights, int offset);
b318477 @michaelni put/avg_pixels16
michaelni authored
138
db79495 @michaelni qpel fix
michaelni authored
139 #define DEF_OLD_QPEL(name)\
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
140 void ff_put_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
141 void ff_put_no_rnd_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);\
142 void ff_avg_ ## name (uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
db79495 @michaelni qpel fix
michaelni authored
143
144 DEF_OLD_QPEL(qpel16_mc11_old_c)
145 DEF_OLD_QPEL(qpel16_mc31_old_c)
146 DEF_OLD_QPEL(qpel16_mc12_old_c)
147 DEF_OLD_QPEL(qpel16_mc32_old_c)
148 DEF_OLD_QPEL(qpel16_mc13_old_c)
149 DEF_OLD_QPEL(qpel16_mc33_old_c)
150 DEF_OLD_QPEL(qpel8_mc11_old_c)
151 DEF_OLD_QPEL(qpel8_mc31_old_c)
152 DEF_OLD_QPEL(qpel8_mc12_old_c)
153 DEF_OLD_QPEL(qpel8_mc32_old_c)
154 DEF_OLD_QPEL(qpel8_mc13_old_c)
155 DEF_OLD_QPEL(qpel8_mc33_old_c)
b318477 @michaelni put/avg_pixels16
michaelni authored
156
157 #define CALL_2X_PIXELS(a, b, n)\
158 static void a(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
159 b(block , pixels , line_size, h);\
160 b(block+n, pixels+n, line_size, h);\
161 }
44eb495 @michaelni divx5-gmc support
michaelni authored
162
de6d9b6 Initial revision
Fabrice Bellard authored
163 /* motion estimation */
7d67aa9 @michaelni info about h and tpel
michaelni authored
164 // h is limited to {width/2, width, 2*width} but never larger than 16 and never smaller then 2
755bfea @DonDiego misc spelling fixes
DonDiego authored
165 // although currently h<4 is not used as functions with width <8 are neither used nor implemented
bb198e1 @michaelni interlaced motion estimation
michaelni authored
166 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))*/;
1457ab5 @michaelni qpel encoding
michaelni authored
167
0da7126 @michaelni H264 decoder & demuxer
michaelni authored
168
059715a First part of a series of speed-enchancing patches.
Robert Edele authored
169 // for snow slices
170 typedef struct slice_buffer_s slice_buffer;
171
2464118 @michaelni more dox
michaelni authored
172 /**
4c79b95 @aurelj move ff_init_scantable() into dsputil
aurelj authored
173 * Scantable.
174 */
175 typedef struct ScanTable{
176 const uint8_t *scantable;
177 uint8_t permutated[64];
178 uint8_t raster_end[64];
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored
179 #if ARCH_PPC
4c79b95 @aurelj move ff_init_scantable() into dsputil
aurelj authored
180 /** Used by dct_quantize_altivec to find last-non-zero */
49c35f1 @aurelj Fix compilation on powerpc.
aurelj authored
181 DECLARE_ALIGNED(16, uint8_t, inverse[64]);
4c79b95 @aurelj move ff_init_scantable() into dsputil
aurelj authored
182 #endif
183 } ScanTable;
184
185 void ff_init_scantable(uint8_t *, ScanTable *st, const uint8_t *src_scantable);
186
288a44f @aurelj move ff_emulated_edge_mc() to dsputil
aurelj authored
187 void ff_emulated_edge_mc(uint8_t *buf, uint8_t *src, int linesize,
188 int block_w, int block_h,
189 int src_x, int src_y, int w, int h);
190
4c79b95 @aurelj move ff_init_scantable() into dsputil
aurelj authored
191 /**
2464118 @michaelni more dox
michaelni authored
192 * DSPContext.
193 */
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
194 typedef struct DSPContext {
195 /* pixel ops : interface with DCT */
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
196 void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
197 void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
198 void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
f9ed9d8 @multimediamike separate out put_signed_pixels_clamped() into its own function and
multimediamike authored
199 void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
200 void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
36940ec H.264 lossless mode
Loren Merritt authored
201 void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size);
202 void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size);
1edbfe1 factor sum_abs_dctelem out of dct_sad, and simd it.
Loren Merritt authored
203 int (*sum_abs_dctelem)(DCTELEM *block/*align 16*/);
d518aeb @michaelni halfpel MC doxy
michaelni authored
204 /**
205 * translational global motion compensation.
206 */
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
207 void (*gmc1)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x16, int y16, int rounder);
d518aeb @michaelni halfpel MC doxy
michaelni authored
208 /**
209 * global motion compensation.
210 */
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
211 void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
bb270c0 @DonDiego COSMETICS: tabs --> spaces, some prettyprinting
DonDiego authored
212 int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
5fecfb7 clear_block mmx
Loren Merritt authored
213 void (*clear_block)(DCTELEM *block/*align 16*/);
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
214 void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
215 int (*pix_sum)(uint8_t * pix, int line_size);
216 int (*pix_norm1)(uint8_t * pix, int line_size);
bb198e1 @michaelni interlaced motion estimation
michaelni authored
217 // 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
218
3899eb2 @rvs Making the arrays accomodate an extra intra 8x8 cmp function
rvs authored
219 me_cmp_func sad[6]; /* identical to pix_absAxA except additional void * */
220 me_cmp_func sse[6];
221 me_cmp_func hadamard8_diff[6];
222 me_cmp_func dct_sad[6];
223 me_cmp_func quant_psnr[6];
224 me_cmp_func bit[6];
225 me_cmp_func rd[6];
226 me_cmp_func vsad[6];
227 me_cmp_func vsse[6];
228 me_cmp_func nsse[6];
229 me_cmp_func w53[6];
230 me_cmp_func w97[6];
231 me_cmp_func dct_max[6];
232 me_cmp_func dct264_sad[6];
233
234 me_cmp_func me_pre_cmp[6];
235 me_cmp_func me_cmp[6];
236 me_cmp_func me_sub_cmp[6];
237 me_cmp_func mb_cmp[6];
238 me_cmp_func ildct_cmp[6]; //only width 16 used
239 me_cmp_func frame_skip_cmp[6]; //only width 8 used
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
240
a00177a @mansr make arguments to ssd_int8_vs_int16() const
mansr authored
241 int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2,
242 int size);
5900637 mmx 16-bit ssd. 2.3x faster svq1 encoding.
Loren Merritt authored
243
d518aeb @michaelni halfpel MC doxy
michaelni authored
244 /**
245 * Halfpel motion compensation with rounding (a+b+1)>>1.
30f1505 @lu-zero Typos in comments
lu-zero authored
246 * this is an array[4][4] of motion compensation functions for 4
e5771f4 @michaelni put_pixels width comment fix
michaelni authored
247 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27 @michaelni doc fixes (forgot to commit)
michaelni authored
248 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aeb @michaelni halfpel MC doxy
michaelni authored
249 * @param block destination where the result is stored
250 * @param pixels source
251 * @param line_size number of bytes in a horizontal line of block
252 * @param h height
253 */
669ac79 @michaelni moving the svq3 motion compensation stuff to dsputil (this also means…
michaelni authored
254 op_pixels_func put_pixels_tab[4][4];
d518aeb @michaelni halfpel MC doxy
michaelni authored
255
256 /**
257 * Halfpel motion compensation with rounding (a+b+1)>>1.
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
258 * This is an array[4][4] of motion compensation functions for 4
e5771f4 @michaelni put_pixels width comment fix
michaelni authored
259 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27 @michaelni doc fixes (forgot to commit)
michaelni authored
260 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aeb @michaelni halfpel MC doxy
michaelni authored
261 * @param block destination into which the result is averaged (a+b+1)>>1
262 * @param pixels source
263 * @param line_size number of bytes in a horizontal line of block
264 * @param h height
265 */
da3b975 @multimediamike added support for B-frames and multiple slices
multimediamike authored
266 op_pixels_func avg_pixels_tab[4][4];
d518aeb @michaelni halfpel MC doxy
michaelni authored
267
268 /**
269 * Halfpel motion compensation with no rounding (a+b)>>1.
30f1505 @lu-zero Typos in comments
lu-zero authored
270 * this is an array[2][4] of motion compensation functions for 2
eb14c71 @michaelni doxy
michaelni authored
271 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27 @michaelni doc fixes (forgot to commit)
michaelni authored
272 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aeb @michaelni halfpel MC doxy
michaelni authored
273 * @param block destination where the result is stored
274 * @param pixels source
275 * @param line_size number of bytes in a horizontal line of block
276 * @param h height
277 */
dbc56b3 @michaelni chroma me fix
michaelni authored
278 op_pixels_func put_no_rnd_pixels_tab[4][4];
d518aeb @michaelni halfpel MC doxy
michaelni authored
279
280 /**
281 * Halfpel motion compensation with no rounding (a+b)>>1.
30f1505 @lu-zero Typos in comments
lu-zero authored
282 * this is an array[2][4] of motion compensation functions for 2
eb14c71 @michaelni doxy
michaelni authored
283 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
5755c27 @michaelni doc fixes (forgot to commit)
michaelni authored
284 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
d518aeb @michaelni halfpel MC doxy
michaelni authored
285 * @param block destination into which the result is averaged (a+b)>>1
286 * @param pixels source
287 * @param line_size number of bytes in a horizontal line of block
288 * @param h height
289 */
dbc56b3 @michaelni chroma me fix
michaelni authored
290 op_pixels_func avg_no_rnd_pixels_tab[4][4];
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
291
c0a0170 @michaelni fix motion compensation with (x+1/2,y+1/2) MVs
michaelni authored
292 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);
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
293
669ac79 @michaelni moving the svq3 motion compensation stuff to dsputil (this also means…
michaelni authored
294 /**
295 * Thirdpel motion compensation with rounding (a+b+1)>>1.
30f1505 @lu-zero Typos in comments
lu-zero authored
296 * this is an array[12] of motion compensation functions for the 9 thirdpe
297 * positions<br>
669ac79 @michaelni moving the svq3 motion compensation stuff to dsputil (this also means…
michaelni authored
298 * *pixels_tab[ xthirdpel + 4*ythirdpel ]
299 * @param block destination where the result is stored
300 * @param pixels source
301 * @param line_size number of bytes in a horizontal line of block
302 * @param h height
303 */
304 tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
da3b975 @multimediamike added support for B-frames and multiple slices
multimediamike authored
305 tpel_mc_func avg_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
306
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
307 qpel_mc_func put_qpel_pixels_tab[2][16];
308 qpel_mc_func avg_qpel_pixels_tab[2][16];
309 qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
310 qpel_mc_func avg_no_rnd_qpel_pixels_tab[2][16];
1457ab5 @michaelni qpel encoding
michaelni authored
311 qpel_mc_func put_mspel_pixels_tab[8];
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
312
0da7126 @michaelni H264 decoder & demuxer
michaelni authored
313 /**
30f1505 @lu-zero Typos in comments
lu-zero authored
314 * h264 Chroma MC
0da7126 @michaelni H264 decoder & demuxer
michaelni authored
315 */
316 h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
317 h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
c374691 @yuvi Rename put_no_rnd_h264_chroma* to reflect its usage in VC1 only
yuvi authored
318 /* This is really one func used in VC-1 decoding */
319 h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
8013da7 @yuvi VC1: add and use avg_no_rnd chroma MC functions
yuvi authored
320 h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3];
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
321
80e44bc @michaelni use h264 MC functions for 2xX Xx2 blocks in snow too
michaelni authored
322 qpel_mc_func put_h264_qpel_pixels_tab[4][16];
323 qpel_mc_func avg_h264_qpel_pixels_tab[4][16];
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
324
2833fc4 approximate qpel functions: sacrifice some quality for some decoding …
Loren Merritt authored
325 qpel_mc_func put_2tap_qpel_pixels_tab[4][16];
326 qpel_mc_func avg_2tap_qpel_pixels_tab[4][16];
327
9f2d1b4 H.264 weighted prediction.
Loren Merritt authored
328 h264_weight_func weight_h264_pixels_tab[10];
329 h264_biweight_func biweight_h264_pixels_tab[10];
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
330
b482e2d @michaelni CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michaelni authored
331 /* AVS specific */
332 qpel_mc_func put_cavs_qpel_pixels_tab[2][16];
333 qpel_mc_func avg_cavs_qpel_pixels_tab[2][16];
334 void (*cavs_filter_lv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
335 void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
336 void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
337 void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
338 void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
339
bb198e1 @michaelni interlaced motion estimation
michaelni authored
340 me_cmp_func pix_abs[2][4];
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
341
11f18fa @michaelni huffyuv
michaelni authored
342 /* huffyuv specific */
343 void (*add_bytes)(uint8_t *dst/*align 16*/, uint8_t *src/*align 16*/, int w);
4a9ca0a simd and unroll png_filter_row
Loren Merritt authored
344 void (*add_bytes_l2)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 16*/, int w);
1457ab5 @michaelni qpel encoding
michaelni authored
345 void (*diff_bytes)(uint8_t *dst/*align 16*/, uint8_t *src1/*align 16*/, uint8_t *src2/*align 1*/,int w);
8470540 @michaelni mmx2 optimization of huffyuv median encoding
michaelni authored
346 /**
347 * subtract huffyuv's variant of median prediction
348 * note, this might read from src1[-1], src2[-1]
349 */
350 void (*sub_hfyu_median_prediction)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int w, int *left, int *left_top);
3daa434 ff_add_hfyu_median_prediction_mmx2
Loren Merritt authored
351 void (*add_hfyu_median_prediction)(uint8_t *dst, uint8_t *top, uint8_t *diff, int w, int *left, int *left_top);
4a9ca0a simd and unroll png_filter_row
Loren Merritt authored
352 /* this might write to dst[w] */
353 void (*add_png_paeth_prediction)(uint8_t *dst, uint8_t *src, uint8_t *top, int w, int bpp);
96711ec @michaelni const src for bswap
michaelni authored
354 void (*bswap_buf)(uint32_t *dst, const uint32_t *src, int w);
42251a2 MMX for H.264 deblocking filter
Loren Merritt authored
355
2272e04 document some dsp alignments
Loren Merritt authored
356 void (*h264_v_loop_filter_luma)(uint8_t *pix/*align 16*/, int stride, int alpha, int beta, int8_t *tc0);
357 void (*h264_h_loop_filter_luma)(uint8_t *pix/*align 4 */, int stride, int alpha, int beta, int8_t *tc0);
358 /* v/h_loop_filter_luma_intra: align 16 */
712ca84 Move filter_luma_intra into dsputil for later addition of asm.
Jason Garrett-Glaser authored
359 void (*h264_v_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta);
360 void (*h264_h_loop_filter_luma_intra)(uint8_t *pix, int stride, int alpha, int beta);
2272e04 document some dsp alignments
Loren Merritt authored
361 void (*h264_v_loop_filter_chroma)(uint8_t *pix/*align 8*/, int stride, int alpha, int beta, int8_t *tc0);
362 void (*h264_h_loop_filter_chroma)(uint8_t *pix/*align 4*/, int stride, int alpha, int beta, int8_t *tc0);
363 void (*h264_v_loop_filter_chroma_intra)(uint8_t *pix/*align 8*/, int stride, int alpha, int beta);
364 void (*h264_h_loop_filter_chroma_intra)(uint8_t *pix/*align 8*/, int stride, int alpha, int beta);
3e20143 mmx implementation of deblocking strength decision.
Loren Merritt authored
365 // h264_loop_filter_strength: simd only. the C version is inlined in h264.c
366 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],
4f20b45 @michaelni Fix h264_loop_filter_strength_mmx2() so it works with PAFF.
michaelni authored
367 int bidir, int edges, int step, int mask_mv0, int mask_mv1, int field);
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
368
332f9ac @michaelni h263 loop filter
michaelni authored
369 void (*h263_v_loop_filter)(uint8_t *src, int stride, int qscale);
370 void (*h263_h_loop_filter)(uint8_t *src, int stride, int qscale);
371
fdbbf2e @michaelni rewrite h261 loop filter
michaelni authored
372 void (*h261_loop_filter)(uint8_t *src, int stride);
c6148de @michaelni h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc …
michaelni authored
373
9abc7e0 @michaelni intrax8 decoder patch by "someone"
michaelni authored
374 void (*x8_v_loop_filter)(uint8_t *src, int stride, int qscale);
375 void (*x8_h_loop_filter)(uint8_t *src, int stride, int qscale);
376
9971331 @yuvi Move VP3 loop filter to DSPContext
yuvi authored
377 void (*vp3_v_loop_filter)(uint8_t *src, int stride, int *bounding_values);
378 void (*vp3_h_loop_filter)(uint8_t *src, int stride, int *bounding_values);
379
26f3ae8 @aurelj move vp6_filter_diag4() to a new vp6dsp.c file and use it throught ds…
aurelj authored
380 void (*vp6_filter_diag4)(uint8_t *dst, uint8_t *src, int stride,
381 const int16_t *h_weights,const int16_t *v_weights);
382
eb4825b sse and 3dnow implementations of float->int conversion and mdct windo…
Loren Merritt authored
383 /* assume len is a multiple of 4, and arrays are 16-byte aligned */
2dac4ac sse & sse2 implementations of vorbis channel coupling.
Loren Merritt authored
384 void (*vorbis_inverse_coupling)(float *mag, float *ang, int blocksize);
ac2e556 simd downmix
Loren Merritt authored
385 void (*ac3_downmix)(float (*samples)[256], float (*matrix)[2], int out_ch, int in_ch, int len);
6810b93 sse2 version of compute_autocorr().
Loren Merritt authored
386 /* no alignment needed */
387 void (*flac_compute_autocorr)(const int32_t *data, int len, int lag, double *autoc);
eb4825b sse and 3dnow implementations of float->int conversion and mdct windo…
Loren Merritt authored
388 /* assume len is a multiple of 8, and arrays are 16-byte aligned */
0697205 vorbis simd tweaks
Loren Merritt authored
389 void (*vector_fmul)(float *dst, const float *src, int len);
eb4825b sse and 3dnow implementations of float->int conversion and mdct windo…
Loren Merritt authored
390 void (*vector_fmul_reverse)(float *dst, const float *src0, const float *src1, int len);
391 /* assume len is a multiple of 8, and src arrays are 16-byte aligned */
952e872 @mansr Drop unused args from vector_fmul_add_add, simpify code, and rename
mansr authored
392 void (*vector_fmul_add)(float *dst, const float *src0, const float *src1, const float *src2, int len);
f27e1d6 simplify vorbis windowing
Loren Merritt authored
393 /* assume len is a multiple of 4, and arrays are 16-byte aligned */
394 void (*vector_fmul_window)(float *dst, const float *src0, const float *src1, const float *win, float add_bias, int len);
911e21a simd int->float
Loren Merritt authored
395 /* assume len is a multiple of 8, and arrays are 16-byte aligned */
396 void (*int32_to_float_fmul_scalar)(float *dst, const int *src, float mul, int len);
50e23ae Mark parameter src of vector_clipf() as const
Vitor Sessak authored
397 void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */);
53b5721 @mansr Add some dsputil functions useful for AAC decoder
mansr authored
398 /**
399 * Multiply a vector of floats by a scalar float. Source and
400 * destination vectors must overlap exactly or not at all.
401 * @param dst result vector, 16-byte aligned
402 * @param src input vector, 16-byte aligned
403 * @param mul scalar value
404 * @param len length of vector, multiple of 4
405 */
406 void (*vector_fmul_scalar)(float *dst, const float *src, float mul,
407 int len);
408 /**
409 * Multiply a vector of floats by concatenated short vectors of
410 * floats and by a scalar float. Source and destination vectors
411 * must overlap exactly or not at all.
412 * [0]: short vectors of length 2, 8-byte aligned
413 * [1]: short vectors of length 4, 16-byte aligned
414 * @param dst output vector, 16-byte aligned
415 * @param src input vector, 16-byte aligned
416 * @param sv array of pointers to short vectors
417 * @param mul scalar value
418 * @param len number of elements in src and dst, multiple of 4
419 */
420 void (*vector_fmul_sv_scalar[2])(float *dst, const float *src,
421 const float **sv, float mul, int len);
422 /**
423 * Multiply short vectors of floats by a scalar float, store
424 * concatenated result.
425 * [0]: short vectors of length 2, 8-byte aligned
426 * [1]: short vectors of length 4, 16-byte aligned
427 * @param dst output vector, 16-byte aligned
428 * @param sv array of pointers to short vectors
429 * @param mul scalar value
430 * @param len number of output elements, multiple of 4
431 */
432 void (*sv_fmul_scalar[2])(float *dst, const float **sv,
433 float mul, int len);
434 /**
435 * Calculate the scalar product of two vectors of floats.
436 * @param v1 first vector, 16-byte aligned
437 * @param v2 second vector, 16-byte aligned
438 * @param len length of vectors, multiple of 4
439 */
440 float (*scalarproduct_float)(const float *v1, const float *v2, int len);
441 /**
442 * Calculate the sum and difference of two vectors of floats.
443 * @param v1 first input vector, sum output, 16-byte aligned
444 * @param v2 second input vector, difference output, 16-byte aligned
445 * @param len length of vectors, multiple of 4
446 */
447 void (*butterflies_float)(float *restrict v1, float *restrict v2, int len);
eb4825b sse and 3dnow implementations of float->int conversion and mdct windo…
Loren Merritt authored
448
449 /* C version: convert floats from the range [384.0,386.0] to ints in [-32768,32767]
9814587 @lu-zero Align the input buffer in ffplay, introduce a public macro for aligne…
lu-zero authored
450 * simd versions: convert floats from [-32768.0,32767.0] without rescaling and arrays are 16byte aligned */
560fa9b @michaelni Fix x86-64
michaelni authored
451 void (*float_to_int16)(int16_t *dst, const float *src, long len);
5eb0f2a float_to_int16_interleave: change src to an array of pointers instead…
Loren Merritt authored
452 void (*float_to_int16_interleave)(int16_t *dst, const float **src, long len, int channels);
2dac4ac sse & sse2 implementations of vorbis channel coupling.
Loren Merritt authored
453
b036883 @michaelni MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni authored
454 /* (I)DCT */
455 void (*fdct)(DCTELEM *block/* align 16*/);
10acc47 @rvs * introducing dct248 into the DSP context.
rvs authored
456 void (*fdct248)(DCTELEM *block/* align 16*/);
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
457
4fb518c @michaelni the return of the idct with 16bit output by ("Ivan Kalvachev" <ivan a…
michaelni authored
458 /* IDCT really*/
459 void (*idct)(DCTELEM *block/* align 16*/);
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
460
2464118 @michaelni more dox
michaelni authored
461 /**
77c92c2 @michaelni cosmetics
michaelni authored
462 * block -> idct -> clip to unsigned 8 bit -> dest.
2464118 @michaelni more dox
michaelni authored
463 * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
9846cbd cosmetics: typos
Panagiotis Issaris authored
464 * @param line_size size in bytes of a horizontal line of dest
2464118 @michaelni more dox
michaelni authored
465 */
b036883 @michaelni MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni authored
466 void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
467
2464118 @michaelni more dox
michaelni authored
468 /**
469 * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
9846cbd cosmetics: typos
Panagiotis Issaris authored
470 * @param line_size size in bytes of a horizontal line of dest
2464118 @michaelni more dox
michaelni authored
471 */
b036883 @michaelni MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni authored
472 void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
473
2464118 @michaelni more dox
michaelni authored
474 /**
77c92c2 @michaelni cosmetics
michaelni authored
475 * idct input permutation.
0549302 @michaelni more idct_permute docs
michaelni authored
476 * several optimized IDCTs need a permutated input (relative to the normal order of the reference
477 * IDCT)
478 * this permutation must be performed before the idct_put/add, note, normally this can be merged
479 * with the zigzag/alternate scan<br>
2464118 @michaelni more dox
michaelni authored
480 * an example to avoid confusion:
481 * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
482 * - (x -> referece dct -> reference idct -> x)
483 * - (x -> referece dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
484 * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
485 */
b036883 @michaelni MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni authored
486 uint8_t idct_permutation[64];
487 int idct_permutation_type;
488 #define FF_NO_IDCT_PERM 1
489 #define FF_LIBMPEG2_IDCT_PERM 2
490 #define FF_SIMPLE_IDCT_PERM 3
491 #define FF_TRANSPOSE_IDCT_PERM 4
5773a74 @michaelni porting the mmx&sse2 (sse2 untested) vp3 idcts to the lavc idct API
michaelni authored
492 #define FF_PARTTRANS_IDCT_PERM 5
0e956ba @mrvacbob Add a new IDCT permutation, used in xvid_sse2 and possibly future sim…
mrvacbob authored
493 #define FF_SSE2_IDCT_PERM 6
b036883 @michaelni MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni authored
494
364a179 @michaelni quantizer noise shaping optimization
michaelni authored
495 int (*try_8x8basis)(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale);
496 void (*add_8x8basis)(int16_t rem[64], int16_t basis[64], int scale);
497 #define BASIS_SHIFT 16
498 #define RECON_SHIFT 6
115329f @DonDiego COSMETICS: Remove all trailing whitespace.
DonDiego authored
499
5a6a9e7 @aurelj move draw_edges() into dsputil
aurelj authored
500 void (*draw_edges)(uint8_t *buf, int wrap, int width, int height, int w);
cbcd6c8 @aurelj move EDGE_WIDTH definition allong with draw_edges where it belongs
aurelj authored
501 #define EDGE_WIDTH 16
5a6a9e7 @aurelj move draw_edges() into dsputil
aurelj authored
502
ea9f5d6 Add comment denoting group of H.264 functions
Panagiotis Issaris authored
503 /* h264 functions */
6a1846e @michaelni Document new idct requirements.
michaelni authored
504 /* NOTE!!! if you implement any of h264_idct8_add, h264_idct8_add4 then you must implement all of them
505 NOTE!!! if you implement any of h264_idct_add, h264_idct_add16, h264_idct_add16intra, h264_idct_add8 then you must implement all of them
506 The reason for above, is that no 2 out of one list may use a different permutation.
507 */
7fadc32 document some dsp alignments
Loren Merritt authored
508 void (*h264_idct_add)(uint8_t *dst/*align 4*/, DCTELEM *block/*align 16*/, int stride);
509 void (*h264_idct8_add)(uint8_t *dst/*align 8*/, DCTELEM *block/*align 16*/, int stride);
510 void (*h264_idct_dc_add)(uint8_t *dst/*align 4*/, DCTELEM *block/*align 16*/, int stride);
511 void (*h264_idct8_dc_add)(uint8_t *dst/*align 8*/, DCTELEM *block/*align 16*/, int stride);
f186212 Added entry for H.264 DCT to the DSP context.
Panagiotis Issaris authored
512 void (*h264_dct)(DCTELEM block[4][4]);
ac22385 @michaelni H.264 idct functions that include the chroma, inter luma and intra16 …
michaelni authored
513 void (*h264_idct_add16)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
514 void (*h264_idct8_add4)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
515 void (*h264_idct_add8)(uint8_t **dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
516 void (*h264_idct_add16intra)(uint8_t *dst/*align 16*/, const int *blockoffset, DCTELEM *block/*align 16*/, int stride, const uint8_t nnzc[6*8]);
059715a First part of a series of speed-enchancing patches.
Robert Edele authored
517
518 /* snow wavelet */
d593e32 @michaelni use 16bit IDWT (a SIMD implementation of it should be >2x faster then…
michaelni authored
519 void (*vertical_compose97i)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width);
520 void (*horizontal_compose97i)(IDWTELEM *b, int width);
9dd6c80 Add the const specifier as needed to reduce the number of warnings.
Panagiotis Issaris authored
521 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);
513fbd8 prefetch pixels for future motion compensation. 2-5% faster h264.
Loren Merritt authored
522
523 void (*prefetch)(void *mem, int stride, int h);
54009d4 @michaelni remove mpegvideo.c img resample dependancy
michaelni authored
524
525 void (*shrink[4])(uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height);
64db55a New functions in DSPContext for VC-1 decoding
Kostya Shishkov authored
526
bf4f19d @ramiropolla mlpdec: Move MLP's filter_channel() to dsputils.
ramiropolla authored
527 /* mlp/truehd functions */
13bd204 @ramiropolla mlp: Simplify adressing of state and coeffs arrays for both filters b…
ramiropolla authored
528 void (*mlp_filter_channel)(int32_t *state, const int32_t *coeff,
529 int firorder, int iirorder,
bf4f19d @ramiropolla mlpdec: Move MLP's filter_channel() to dsputils.
ramiropolla authored
530 unsigned int filter_shift, int32_t mask, int blocksize,
531 int32_t *sample_buffer);
532
64db55a New functions in DSPContext for VC-1 decoding
Kostya Shishkov authored
533 /* vc1 functions */
534 void (*vc1_inv_trans_8x8)(DCTELEM *b);
d2e45f3 Switch VC-1 decoder to output decoded residual immediately.
Kostya Shishkov authored
535 void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, DCTELEM *block);
536 void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, DCTELEM *block);
537 void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, DCTELEM *block);
4f717c6 idct_dc for VC-1/WMV3 decoder; ~11% faster decoding overall.
Jason Garrett-Glaser authored
538 void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, DCTELEM *block);
539 void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, DCTELEM *block);
540 void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, DCTELEM *block);
541 void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, DCTELEM *block);
61f5b14 Correct rounding values in overlap filtering
Kostya Shishkov authored
542 void (*vc1_v_overlap)(uint8_t* src, int stride);
543 void (*vc1_h_overlap)(uint8_t* src, int stride);
3992526 @yuvi Split VC1 loop filter into separate functions for h/v and size
yuvi authored
544 void (*vc1_v_loop_filter4)(uint8_t *src, int stride, int pq);
545 void (*vc1_h_loop_filter4)(uint8_t *src, int stride, int pq);
546 void (*vc1_v_loop_filter8)(uint8_t *src, int stride, int pq);
547 void (*vc1_h_loop_filter8)(uint8_t *src, int stride, int pq);
548 void (*vc1_v_loop_filter16)(uint8_t *src, int stride, int pq);
549 void (*vc1_h_loop_filter16)(uint8_t *src, int stride, int pq);
64db55a New functions in DSPContext for VC-1 decoding
Kostya Shishkov authored
550 /* put 8x8 block with bicubic interpolation and quarterpel precision
551 * last argument is actually round value instead of height
552 */
553 op_pixels_func put_vc1_mspel_pixels_tab[16];
6cecd63 @yuvi VC1: Do qpel when needed for both MVs in a B frame
yuvi authored
554 op_pixels_func avg_vc1_mspel_pixels_tab[16];
9abc7e0 @michaelni intrax8 decoder patch by "someone"
michaelni authored
555
556 /* intrax8 functions */
8a43317 @DonDiego cosmetics: Fix spacial --> spatial typo in function names.
DonDiego authored
557 void (*x8_spatial_compensation[12])(uint8_t *src , uint8_t *dst, int linesize);
558 void (*x8_setup_spatial_compensation)(uint8_t *src, uint8_t *dst, int linesize,
9abc7e0 @michaelni intrax8 decoder patch by "someone"
michaelni authored
559 int * range, int * sum, int edges);
560
88c0536 Add several vector functions used by Monkey's Audio decoder to dsputil
Kostya Shishkov authored
561 /* ape functions */
562 /**
563 * Add contents of the second vector to the first one.
bb68f8a Monkey's Audio decoder vector functions work on input with length
Kostya Shishkov authored
564 * @param len length of vectors, should be multiple of 16
88c0536 Add several vector functions used by Monkey's Audio decoder to dsputil
Kostya Shishkov authored
565 */
566 void (*add_int16)(int16_t *v1/*align 16*/, int16_t *v2, int len);
567 /**
568 * Add contents of the second vector to the first one.
bb68f8a Monkey's Audio decoder vector functions work on input with length
Kostya Shishkov authored
569 * @param len length of vectors, should be multiple of 16
88c0536 Add several vector functions used by Monkey's Audio decoder to dsputil
Kostya Shishkov authored
570 */
571 void (*sub_int16)(int16_t *v1/*align 16*/, int16_t *v2, int len);
572 /**
573 * Calculate scalar product of two vectors.
bb68f8a Monkey's Audio decoder vector functions work on input with length
Kostya Shishkov authored
574 * @param len length of vectors, should be multiple of 16
88c0536 Add several vector functions used by Monkey's Audio decoder to dsputil
Kostya Shishkov authored
575 * @param shift number of bits to discard from product
576 */
577 int32_t (*scalarproduct_int16)(int16_t *v1, int16_t *v2/*align 16*/, int len, int shift);
2d8a081 RV40 MC functions
Kostya Shishkov authored
578
11c0f9e enable RV40 decoder
Kostya Shishkov authored
579 /* rv30 functions */
580 qpel_mc_func put_rv30_tpel_pixels_tab[4][16];
581 qpel_mc_func avg_rv30_tpel_pixels_tab[4][16];
582
2d8a081 RV40 MC functions
Kostya Shishkov authored
583 /* rv40 functions */
584 qpel_mc_func put_rv40_qpel_pixels_tab[4][16];
585 qpel_mc_func avg_rv40_qpel_pixels_tab[4][16];
586 h264_chroma_mc_func put_rv40_chroma_pixels_tab[3];
587 h264_chroma_mc_func avg_rv40_chroma_pixels_tab[3];
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
588 } DSPContext;
589
486497e @mansr revert bad checkin
mansr authored
590 void dsputil_static_init(void);
b036883 @michaelni MpegEncContext.(i)dct_* -> DspContext.(i)dct_*
michaelni authored
591 void dsputil_init(DSPContext* p, AVCodecContext *avctx);
de6d9b6 Initial revision
Fabrice Bellard authored
592
6dc7d5d @michaelni ff_check_alignment to warn the user about a missaligned stack
michaelni authored
593 int ff_check_alignment(void);
594
7801d21 @michaelni optimize block_permute()
michaelni authored
595 /**
596 * permute block according to permuatation.
597 * @param last last non zero element in scantable order
598 */
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
599 void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
e0eac44 added block permutation functions
Fabrice Bellard authored
600
622348f @michaelni interlaced dct decision cleanup
michaelni authored
601 void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
602
bb270c0 @DonDiego COSMETICS: tabs --> spaces, some prettyprinting
DonDiego authored
603 #define BYTE_VEC32(c) ((c)*0x01010101UL)
d8085ea @michaelni cleanup
michaelni authored
604
605 static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
606 {
607 return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
608 }
609
610 static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
611 {
612 return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
613 }
614
26efc54 @michaelni 4x4 SSE compare function
michaelni authored
615 static inline int get_penalty_factor(int lambda, int lambda2, int type){
616 switch(type&0xFF){
617 default:
618 case FF_CMP_SAD:
619 return lambda>>FF_LAMBDA_SHIFT;
620 case FF_CMP_DCT:
621 return (3*lambda)>>(FF_LAMBDA_SHIFT+1);
622 case FF_CMP_W53:
623 return (4*lambda)>>(FF_LAMBDA_SHIFT);
624 case FF_CMP_W97:
625 return (2*lambda)>>(FF_LAMBDA_SHIFT);
626 case FF_CMP_SATD:
27c61ac @michaelni 8x8 integer dct from x264 as cmp function (under CONFIG_GPL)
michaelni authored
627 case FF_CMP_DCT264:
26efc54 @michaelni 4x4 SSE compare function
michaelni authored
628 return (2*lambda)>>FF_LAMBDA_SHIFT;
629 case FF_CMP_RD:
630 case FF_CMP_PSNR:
631 case FF_CMP_SSE:
632 case FF_CMP_NSSE:
633 return lambda2>>FF_LAMBDA_SHIFT;
634 case FF_CMP_BIT:
635 return 1;
636 }
637 }
638
2464118 @michaelni more dox
michaelni authored
639 /**
77c92c2 @michaelni cosmetics
michaelni authored
640 * Empty mmx state.
2464118 @michaelni more dox
michaelni authored
641 * this must be called between any dsp function and float/double code.
642 * for example sin(); dsp->idct_put(); emms_c(); cos()
643 */
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
644 #define emms_c()
645
e629ab6 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot…
Romain Dolbeau authored
646 /* should be defined by architectures supporting
647 one or more MultiMedia extension */
648 int mm_support(void);
e78516c @mansr One declaration of mm_flags is enough
mansr authored
649 extern int mm_flags;
e629ab6 altivec jumbo patch by (Romain Dolbeau <dolbeaur at club-internet dot…
Romain Dolbeau authored
650
a1bee08 @mansr move dsputil_init_foo() out from #ifdef
mansr authored
651 void dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
a2fc0f6 @mansr ARM: replace "armv4l" with "arm"
mansr authored
652 void dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
a1bee08 @mansr move dsputil_init_foo() out from #ifdef
mansr authored
653 void dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);
654 void dsputil_init_mlib(DSPContext* c, AVCodecContext *avctx);
655 void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx);
656 void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx);
657 void dsputil_init_ppc(DSPContext* c, AVCodecContext *avctx);
658 void dsputil_init_sh4(DSPContext* c, AVCodecContext *avctx);
659 void dsputil_init_vis(DSPContext* c, AVCodecContext *avctx);
660
43c7c7c @axic use DECLARE_ALIGNED from mem.h (which is included through common.h)
axic authored
661 #define DECLARE_ALIGNED_16(t, v) DECLARE_ALIGNED(16, t, v)
5b1b014 @mansr Move DECLARE_ALIGNED_8 definition next to DECLARE_ALIGNED_16
mansr authored
662 #define DECLARE_ALIGNED_8(t, v) DECLARE_ALIGNED(8, t, v)
92a69cf @multimediamike move __align16 some place where non-MMX machines can see it
multimediamike authored
663
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored
664 #if HAVE_MMX
de6d9b6 Initial revision
Fabrice Bellard authored
665
18f7701 * fixing some minor const warnings
Zdenek Kabelac authored
666 #undef emms_c
eb4b3dd * using DSPContext - so each codec could use its local (sub)set of CP…
Zdenek Kabelac authored
667
de6d9b6 Initial revision
Fabrice Bellard authored
668 static inline void emms(void)
669 {
be449fc @Flameeyes Convert asm keyword into __asm__.
Flameeyes authored
670 __asm__ volatile ("emms;":::"memory");
fb16b7e added emms_c() macro which should can used in c code in both mmx/non …
Fabrice Bellard authored
671 }
672
1457ab5 @michaelni qpel encoding
michaelni authored
673
fb16b7e added emms_c() macro which should can used in c code in both mmx/non …
Fabrice Bellard authored
674 #define emms_c() \
675 {\
82d1605 Remove duplicated MM_* macros for CPU capabilities from dsputil.h.
Dominik Mierzejewski authored
676 if (mm_flags & FF_MM_MMX)\
fb16b7e added emms_c() macro which should can used in c code in both mmx/non …
Fabrice Bellard authored
677 emms();\
de6d9b6 Initial revision
Fabrice Bellard authored
678 }
679
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored
680 #elif ARCH_ARM
3d03c0a arm optimizations
Fabrice Bellard authored
681
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored
682 #if HAVE_NEON
f1424cf @mansr ARM: set STRIDE_ALIGN and DECLARE_ALIGNED_8 to 16 for NEON
mansr authored
683 # define STRIDE_ALIGN 16
684 #endif
685
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored
686 #elif ARCH_PPC
59925ef first cut at altivec support on darwin patch by (Brian Foley <bfoley …
Brian Foley authored
687
3237f73 @michaelni stride align cleanup
michaelni authored
688 #define STRIDE_ALIGN 16
59925ef first cut at altivec support on darwin patch by (Brian Foley <bfoley …
Brian Foley authored
689
b250f9c @aurelj Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurelj authored
690 #elif HAVE_MMI
d46aba2 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
Leon van Stuivenberg authored
691
3237f73 @michaelni stride align cleanup
michaelni authored
692 #define STRIDE_ALIGN 16
d46aba2 ps2 idct patch by (Leon van Stuivenberg <leonvs at iae dot nl>)
Leon van Stuivenberg authored
693
f67a10c @mrvacbob Define mm_flags/support to be 0 on architectures where they don't exist.
mrvacbob authored
694 #else
695
696 #define mm_flags 0
697 #define mm_support() 0
698
5c319d3 @mansr clean up definition of DECLARE_ALIGNED_8 and STRIDE_ALIGN
mansr authored
699 #endif
de6d9b6 Initial revision
Fabrice Bellard authored
700
5c319d3 @mansr clean up definition of DECLARE_ALIGNED_8 and STRIDE_ALIGN
mansr authored
701 #ifndef STRIDE_ALIGN
702 # define STRIDE_ALIGN 8
de6d9b6 Initial revision
Fabrice Bellard authored
703 #endif
704
43f1708 - Added PSNR feature to libavcodec and ffmpeg. By now just Y PSNR unt…
Juanjo authored
705 /* PSNR */
0c1a9ed * UINTX -> uintx_t INTX -> intx_t
Zdenek Kabelac authored
706 void get_psnr(uint8_t *orig_image[3], uint8_t *coded_image[3],
43f1708 - Added PSNR feature to libavcodec and ffmpeg. By now just Y PSNR unt…
Juanjo authored
707 int orig_linesize[3], int coded_linesize,
708 AVCodecContext *avctx);
bb6f569 new generic FFT/MDCT code for audio codecs
Fabrice Bellard authored
709
710 /* FFT computation */
711
712 /* NOTE: soon integer code will be added, so you must use the
713 FFTSample type */
714 typedef float FFTSample;
715
716 typedef struct FFTComplex {
717 FFTSample re, im;
718 } FFTComplex;
719
720 typedef struct FFTContext {
721 int nbits;
722 int inverse;
723 uint16_t *revtab;
724 FFTComplex *exptab;
725 FFTComplex *exptab1; /* only used by SSE code */
5d0ddd1 split-radix FFT
Loren Merritt authored
726 FFTComplex *tmp_buf;
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
727 int mdct_size; /* size of MDCT (i.e. number of input data * 2) */
728 int mdct_bits; /* n = 2^nbits */
729 /* pre/post rotation tables */
730 FFTSample *tcos;
731 FFTSample *tsin;
5d0ddd1 split-radix FFT
Loren Merritt authored
732 void (*fft_permute)(struct FFTContext *s, FFTComplex *z);
bb6f569 new generic FFT/MDCT code for audio codecs
Fabrice Bellard authored
733 void (*fft_calc)(struct FFTContext *s, FFTComplex *z);
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
734 void (*imdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
735 void (*imdct_half)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
736 void (*mdct_calc)(struct FFTContext *s, FFTSample *output, const FFTSample *input);
f486321 @mansr Move per-arch fft init bits into the corresponding subdirs
mansr authored
737 int split_radix;
94274b8 @mansr Allow arch-specific mdct code to request interleaving of cos/sin tables
mansr authored
738 int permutation;
739 #define FF_MDCT_PERM_NONE 0
740 #define FF_MDCT_PERM_INTERLEAVE 1
bb6f569 new generic FFT/MDCT code for audio codecs
Fabrice Bellard authored
741 } FFTContext;
742
faca561 The ff_cos_tabs table itself is constant, too, so mark it as such.
Reimar Döffinger authored
743 extern FFTSample* const ff_cos_tabs[13];
6860254 @aconverse Add the rdft family of transforms (fft/ifft of an all real sequence) …
aconverse authored
744
8f05c99 @aconverse Clean up FFT related comments.
aconverse authored
745 /**
746 * Sets up a complex FFT.
747 * @param nbits log2 of the length of the input array
748 * @param inverse if 0 perform the forward transform, if 1 perform the inverse
749 */
68951ec fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
Gildas Bazin authored
750 int ff_fft_init(FFTContext *s, int nbits, int inverse);
5d0ddd1 split-radix FFT
Loren Merritt authored
751 void ff_fft_permute_c(FFTContext *s, FFTComplex *z);
68951ec fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
Gildas Bazin authored
752 void ff_fft_calc_c(FFTContext *s, FFTComplex *z);
f486321 @mansr Move per-arch fft init bits into the corresponding subdirs
mansr authored
753
754 void ff_fft_init_altivec(FFTContext *s);
755 void ff_fft_init_mmx(FFTContext *s);
68336ea @mansr 10l: fix ff_fft_init_arm() prototype
mansr authored
756 void ff_fft_init_arm(FFTContext *s);
8d268a7 fft altivec by Romain Dolbeau - simplified patch, test it on PPC with…
Fabrice Bellard authored
757
8f05c99 @aconverse Clean up FFT related comments.
aconverse authored
758 /**
759 * Do the permutation needed BEFORE calling ff_fft_calc().
760 */
5d0ddd1 split-radix FFT
Loren Merritt authored
761 static inline void ff_fft_permute(FFTContext *s, FFTComplex *z)
762 {
763 s->fft_permute(s, z);
764 }
8f05c99 @aconverse Clean up FFT related comments.
aconverse authored
765 /**
766 * Do a complex FFT with the parameters defined in ff_fft_init(). The
767 * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
768 */
68951ec fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
Gildas Bazin authored
769 static inline void ff_fft_calc(FFTContext *s, FFTComplex *z)
bb6f569 new generic FFT/MDCT code for audio codecs
Fabrice Bellard authored
770 {
771 s->fft_calc(s, z);
772 }
68951ec fft_*() renamed into ff_fft_*() patch by (Gildas Bazin <gbazin at alt…
Gildas Bazin authored
773 void ff_fft_end(FFTContext *s);
bb6f569 new generic FFT/MDCT code for audio codecs
Fabrice Bellard authored
774
775 /* MDCT computation */
776
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
777 static inline void ff_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input)
d46ac5b mdct wrapper function to match fft
Loren Merritt authored
778 {
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
779 s->imdct_calc(s, output, input);
d46ac5b mdct wrapper function to match fft
Loren Merritt authored
780 }
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
781 static inline void ff_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input)
d46ac5b mdct wrapper function to match fft
Loren Merritt authored
782 {
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
783 s->imdct_half(s, output, input);
d46ac5b mdct wrapper function to match fft
Loren Merritt authored
784 }
785
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
786 static inline void ff_mdct_calc(FFTContext *s, FFTSample *output,
46c32e2 @mansr Prepare for optimised forward MDCT implementations
mansr authored
787 const FFTSample *input)
788 {
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
789 s->mdct_calc(s, output, input);
46c32e2 @mansr Prepare for optimised forward MDCT implementations
mansr authored
790 }
791
4eb7a73 @superdump Make the Kaiser-Bessel window generator a common function
superdump authored
792 /**
793 * Generate a Kaiser-Bessel Derived Window.
794 * @param window pointer to half window
3ed546f @superdump Add variable alpha and size of half window for Kaiser-Bessel Derived …
superdump authored
795 * @param alpha determines window shape
796 * @param n size of half window
4eb7a73 @superdump Make the Kaiser-Bessel window generator a common function
superdump authored
797 */
3ed546f @superdump Add variable alpha and size of half window for Kaiser-Bessel Derived …
superdump authored
798 void ff_kbd_window_init(float *window, float alpha, int n);
4eb7a73 @superdump Make the Kaiser-Bessel window generator a common function
superdump authored
799
9146e4d @superdump Add generic ff_sine_window_init function and implement in codecs appr…
superdump authored
800 /**
801 * Generate a sine window.
802 * @param window pointer to half window
803 * @param n size of half window
804 */
805 void ff_sine_window_init(float *window, int n);
6776061 Add two more sizes to ff_sine_windows[] and also pad it with NULLs so
Vitor Sessak authored
806 extern float ff_sine_32 [ 32];
807 extern float ff_sine_64 [ 64];
69fc4da @superdump Add declarations for the sine tables used in wma.c (half window sizes…
superdump authored
808 extern float ff_sine_128 [ 128];
809 extern float ff_sine_256 [ 256];
810 extern float ff_sine_512 [ 512];
811 extern float ff_sine_1024[1024];
812 extern float ff_sine_2048[2048];
336c2ca @merbanan Add size that is needed for the wmapro codec
merbanan authored
813 extern float ff_sine_4096[4096];
6776061 Add two more sizes to ff_sine_windows[] and also pad it with NULLs so
Vitor Sessak authored
814 extern float * const ff_sine_windows[13];
9146e4d @superdump Add generic ff_sine_window_init function and implement in codecs appr…
superdump authored
815
01b2214 @mansr Merge FFTContext and MDCTContext
mansr authored
816 int ff_mdct_init(FFTContext *s, int nbits, int inverse, double scale);
817 void ff_imdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
818 void ff_imdct_half_c(FFTContext *s, FFTSample *output, const FFTSample *input);
819 void ff_mdct_calc_c(FFTContext *s, FFTSample *output, const FFTSample *input);
820 void ff_mdct_end(FFTContext *s);
bb6f569 new generic FFT/MDCT code for audio codecs
Fabrice Bellard authored
821
6860254 @aconverse Add the rdft family of transforms (fft/ifft of an all real sequence) …
aconverse authored
822 /* Real Discrete Fourier Transform */
823
824 enum RDFTransformType {
825 RDFT,
826 IRDFT,
827 RIDFT,
828 IRIDFT,
829 };
830
831 typedef struct {
832 int nbits;
833 int inverse;
834 int sign_convention;
835
836 /* pre/post rotation tables */
837 FFTSample *tcos;
838 FFTSample *tsin;
839 FFTContext fft;
840 } RDFTContext;
841
842 /**
843 * Sets up a real FFT.
844 * @param nbits log2 of the length of the input array
845 * @param trans the type of transform
846 */
847 int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans);
848 void ff_rdft_calc(RDFTContext *s, FFTSample *data);
849 void ff_rdft_end(RDFTContext *s);
850
9fbd14a @DonDiego Fix typo in macro name: WARPER8_16_SQ --> WRAPPER8_16_SQ.
DonDiego authored
851 #define WRAPPER8_16(name8, name16)\
bb198e1 @michaelni interlaced motion estimation
michaelni authored
852 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
853 return name8(s, dst , src , stride, h)\
854 +name8(s, dst+8 , src+8 , stride, h);\
855 }
856
9fbd14a @DonDiego Fix typo in macro name: WARPER8_16_SQ --> WRAPPER8_16_SQ.
DonDiego authored
857 #define WRAPPER8_16_SQ(name8, name16)\
bb198e1 @michaelni interlaced motion estimation
michaelni authored
858 static int name16(void /*MpegEncContext*/ *s, uint8_t *dst, uint8_t *src, int stride, int h){\
859 int score=0;\
860 score +=name8(s, dst , src , stride, 8);\
861 score +=name8(s, dst+8 , src+8 , stride, 8);\
862 if(h==16){\
863 dst += 8*stride;\
864 src += 8*stride;\
865 score +=name8(s, dst , src , stride, 8);\
866 score +=name8(s, dst+8 , src+8 , stride, 8);\
867 }\
868 return score;\
1457ab5 @michaelni qpel encoding
michaelni authored
869 }
870
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
871
184fcc6 @aconverse Mark src constant in copy_block*().
aconverse authored
872 static inline void copy_block2(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
873 {
874 int i;
875 for(i=0; i<h; i++)
876 {
905694d @rvs * renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
rvs authored
877 AV_WN16(dst , AV_RN16(src ));
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
878 dst+=dstStride;
879 src+=srcStride;
880 }
881 }
882
184fcc6 @aconverse Mark src constant in copy_block*().
aconverse authored
883 static inline void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
884 {
885 int i;
886 for(i=0; i<h; i++)
887 {
905694d @rvs * renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
rvs authored
888 AV_WN32(dst , AV_RN32(src ));
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
889 dst+=dstStride;
890 src+=srcStride;
891 }
892 }
893
184fcc6 @aconverse Mark src constant in copy_block*().
aconverse authored
894 static inline void copy_block8(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
895 {
896 int i;
897 for(i=0; i<h; i++)
898 {
905694d @rvs * renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
rvs authored
899 AV_WN32(dst , AV_RN32(src ));
900 AV_WN32(dst+4 , AV_RN32(src+4 ));
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
901 dst+=dstStride;
902 src+=srcStride;
903 }
904 }
905
184fcc6 @aconverse Mark src constant in copy_block*().
aconverse authored
906 static inline void copy_block9(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
907 {
908 int i;
909 for(i=0; i<h; i++)
910 {
905694d @rvs * renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
rvs authored
911 AV_WN32(dst , AV_RN32(src ));
912 AV_WN32(dst+4 , AV_RN32(src+4 ));
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
913 dst[8]= src[8];
914 dst+=dstStride;
915 src+=srcStride;
916 }
917 }
918
184fcc6 @aconverse Mark src constant in copy_block*().
aconverse authored
919 static inline void copy_block16(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
920 {
921 int i;
922 for(i=0; i<h; i++)
923 {
905694d @rvs * renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
rvs authored
924 AV_WN32(dst , AV_RN32(src ));
925 AV_WN32(dst+4 , AV_RN32(src+4 ));
926 AV_WN32(dst+8 , AV_RN32(src+8 ));
927 AV_WN32(dst+12, AV_RN32(src+12));
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
928 dst+=dstStride;
929 src+=srcStride;
930 }
931 }
932
184fcc6 @aconverse Mark src constant in copy_block*().
aconverse authored
933 static inline void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
934 {
935 int i;
936 for(i=0; i<h; i++)
937 {
905694d @rvs * renaming (ST|LD)(16|32|64) -> AV_(R|W)N(16|32|64)
rvs authored
938 AV_WN32(dst , AV_RN32(src ));
939 AV_WN32(dst+4 , AV_RN32(src+4 ));
940 AV_WN32(dst+8 , AV_RN32(src+8 ));
941 AV_WN32(dst+12, AV_RN32(src+12));
49cef74 Move copy_block* functions to dsp dsputil.h
Brian Foley authored
942 dst[16]= src[16];
943 dst+=dstStride;
944 src+=srcStride;
945 }
946 }
947
9879038 Globally rename the header inclusion guard names.
Stefano Sabatini authored
948 #endif /* AVCODEC_DSPUTIL_H */
Something went wrong with that request. Please try again.