summaryrefslogtreecommitdiff
path: root/libavcodec/dct.h (plain)
blob: 0a03e256d1365962cdefeda8c4e0f98c15521a85
1/*
2 * (I)DCT Transforms
3 * Copyright (c) 2009 Peter Ross <pross@xvid.org>
4 * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
5 * Copyright (c) 2010 Vitor Sessak
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#if !defined(AVCODEC_DCT_H) && (!defined(FFT_FLOAT) || FFT_FLOAT)
25#define AVCODEC_DCT_H
26
27#include <stddef.h>
28#include <stdint.h>
29
30#include "rdft.h"
31
32struct DCTContext {
33 int nbits;
34 int inverse;
35 RDFTContext rdft;
36 const float *costab;
37 FFTSample *csc2;
38 void (*dct_calc)(struct DCTContext *s, FFTSample *data);
39 void (*dct32)(FFTSample *out, const FFTSample *in);
40};
41
42/**
43 * Set up DCT.
44 * @param nbits size of the input array:
45 * (1 << nbits) for DCT-II, DCT-III and DST-I
46 * (1 << nbits) + 1 for DCT-I
47 *
48 * @note the first element of the input of DST-I is ignored
49 */
50int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType type);
51void ff_dct_end (DCTContext *s);
52
53void ff_dct_init_x86(DCTContext *s);
54
55void ff_fdct_ifast(int16_t *data);
56void ff_fdct_ifast248(int16_t *data);
57void ff_jpeg_fdct_islow_8(int16_t *data);
58void ff_jpeg_fdct_islow_10(int16_t *data);
59void ff_fdct248_islow_8(int16_t *data);
60void ff_fdct248_islow_10(int16_t *data);
61
62void ff_j_rev_dct(int16_t *data);
63void ff_j_rev_dct4(int16_t *data);
64void ff_j_rev_dct2(int16_t *data);
65void ff_j_rev_dct1(int16_t *data);
66void ff_jref_idct_put(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
67void ff_jref_idct_add(uint8_t *dest, ptrdiff_t line_size, int16_t *block);
68
69#endif /* AVCODEC_DCT_H */
70