Revision 24641185 libavcodec/dsputil.h

View differences:

libavcodec/dsputil.h
16 16
 * License along with this library; if not, write to the Free Software
17 17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 18
 */
19

  
20
/**
21
 * @file dsputil.h
22
 * @brief DSP utils
23
 *
24
 */
25

  
19 26
#ifndef DSPUTIL_H
20 27
#define DSPUTIL_H
21 28

  
22 29
#include "common.h"
23 30
#include "avcodec.h"
24 31

  
32

  
25 33
//#define DEBUG
26 34
/* dct code */
27 35
typedef short DCTELEM;
......
100 108

  
101 109
typedef int (*me_cmp_func)(void /*MpegEncContext*/ *s, uint8_t *blk1/*align width (8 or 16)*/, uint8_t *blk2/*align 1*/, int line_size)/* __attribute__ ((const))*/;
102 110

  
111
/**
112
 * DSPContext.
113
 */
103 114
typedef struct DSPContext {
104 115
    /* pixel ops : interface with DCT */
105 116
    void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
......
152 163
    
153 164
    /* (I)DCT */
154 165
    void (*fdct)(DCTELEM *block/* align 16*/);
166
    
167
    /**
168
     * block -> idct -> clip to unsigned 8 bit -> dest.<br>
169
     * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
170
     * @param line_size size in pixels of a horizotal line of dest
171
     */
155 172
    void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
173
    
174
    /**
175
     * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
176
     * @param line_size size in pixels of a horizotal line of dest
177
     */
156 178
    void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
179
    
180
    /**
181
     * idct input permutation.<br>
182
     * an example to avoid confusion:
183
     * - (->decode coeffs -> zigzag reorder -> dequant -> reference idct ->...)
184
     * - (x -> referece dct -> reference idct -> x)
185
     * - (x -> referece dct -> simple_mmx_perm = idct_permutation -> simple_idct_mmx -> x)
186
     * - (->decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant -> simple_idct_mmx ->...)
187
     */
157 188
    uint8_t idct_permutation[64];
158 189
    int idct_permutation_type;
159 190
#define FF_NO_IDCT_PERM 1
......
171 202
 */
172 203
void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
173 204

  
205
/**
206
 * Empty mmx state.<br>
207
 * this must be called between any dsp function and float/double code.
208
 * for example sin(); dsp->idct_put(); emms_c(); cos()
209
 */
174 210
#define emms_c()
175 211

  
176 212
/* should be defined by architectures supporting

Also available in: Unified diff