2 * This file is part of FFmpeg.
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef AVCODEC_AVDCT_H
20 #define AVCODEC_AVDCT_H
22 #include "libavutil/opt.h"
26 * @note function pointers can be NULL if the specific features have been
27 * disabled at build time.
29 typedef struct AVDCT
{
30 const AVClass
*av_class
;
32 void (*idct
)(int16_t *block
/* align 16 */);
35 * IDCT input permutation.
36 * Several optimized IDCTs need a permutated input (relative to the
37 * normal order of the reference IDCT).
38 * This permutation must be performed before the idct_put/add.
39 * Note, normally this can be merged with the zigzag/alternate scan<br>
40 * An example to avoid confusion:
41 * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
42 * - (x -> reference DCT -> reference IDCT -> x)
43 * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
44 * -> simple_idct_mmx -> x)
45 * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
46 * -> simple_idct_mmx -> ...)
48 uint8_t idct_permutation
[64];
50 void (*fdct
)(int16_t *block
/* align 16 */);
55 * must use AVOptions to set this field.
61 * must use AVOptions to set this field.
65 void (*get_pixels
)(int16_t *block
/* align 16 */,
66 const uint8_t *pixels
/* align 8 */,
71 void (*get_pixels_unaligned
)(int16_t *block
/* align 16 */,
72 const uint8_t *pixels
,
77 * Allocates a AVDCT context.
78 * This needs to be initialized with avcodec_dct_init() after optionally
79 * configuring it with AVOptions.
81 * To free it use av_free()
83 AVDCT
*avcodec_dct_alloc(void);
84 int avcodec_dct_init(AVDCT
*);
86 const AVClass
*avcodec_dct_get_class(void);
88 #endif /* AVCODEC_AVDCT_H */