1 /*
2  * This file is part of FFmpeg.
3  *
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.
8  *
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.
13  *
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
17  */
18 module ffmpeg.libavcodec.avdct;
19 
20 import ffmpeg.libavcodec;
21 import ffmpeg.libavutil;
22 
23 extern (C) @nogc nothrow:
24 
25 /**
26  * AVDCT context.
27  * @note function pointers can be NULL if the specific features have been
28  *       disabled at build time.
29  */
30 struct AVDCT
31 {
32     const(AVClass)* av_class;
33 
34     /* align 16 */
35     void function (short* block) idct;
36 
37     /**
38      * IDCT input permutation.
39      * Several optimized IDCTs need a permutated input (relative to the
40      * normal order of the reference IDCT).
41      * This permutation must be performed before the idct_put/add.
42      * Note, normally this can be merged with the zigzag/alternate scan<br>
43      * An example to avoid confusion:
44      * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
45      * - (x -> reference DCT -> reference IDCT -> x)
46      * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
47      *    -> simple_idct_mmx -> x)
48      * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
49      *    -> simple_idct_mmx -> ...)
50      */
51     ubyte[64] idct_permutation;
52 
53     /* align 16 */
54     void function (short* block) fdct;
55 
56     /**
57      * DCT algorithm.
58      * must use AVOptions to set this field.
59      */
60     int dct_algo;
61 
62     /**
63      * IDCT algorithm.
64      * must use AVOptions to set this field.
65      */
66     int idct_algo;
67 
68     /* align 16 */
69     /* align 8 */
70     void function (
71         short* block,
72         const(ubyte)* pixels,
73         ptrdiff_t line_size) get_pixels;
74 
75     int bits_per_sample;
76 
77     /* align 16 */
78     void function (
79         short* block,
80         const(ubyte)* pixels,
81         ptrdiff_t line_size) get_pixels_unaligned;
82 }
83 
84 /**
85  * Allocates a AVDCT context.
86  * This needs to be initialized with avcodec_dct_init() after optionally
87  * configuring it with AVOptions.
88  *
89  * To free it use av_free()
90  */
91 AVDCT* avcodec_dct_alloc ();
92 int avcodec_dct_init (AVDCT*);
93 
94 const(AVClass)* avcodec_dct_get_class ();
95 
96 /* AVCODEC_AVDCT_H */