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