FFmpeg
avdct.h
Go to the documentation of this file.
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 #ifndef AVCODEC_AVDCT_H
20 #define AVCODEC_AVDCT_H
21 
22 #include <stddef.h>
23 #include <stdint.h>
24 
25 #include "libavutil/opt.h"
26 
27 /**
28  * AVDCT context.
29  * @note function pointers can be NULL if the specific features have been
30  * disabled at build time.
31  */
32 typedef struct AVDCT {
33  const AVClass *av_class;
34 
35  void (*idct)(int16_t *block /* align 16 */);
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  uint8_t idct_permutation[64];
52 
53  void (*fdct)(int16_t *block /* align 16 */);
54 
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  void (*get_pixels)(int16_t *block /* align 16 */,
69  const uint8_t *pixels /* align 8 */,
70  ptrdiff_t line_size);
71 
73 
74  void (*get_pixels_unaligned)(int16_t *block /* align 16 */,
75  const uint8_t *pixels,
76  ptrdiff_t line_size);
77 } AVDCT;
78 
79 /**
80  * Allocates a AVDCT context.
81  * This needs to be initialized with avcodec_dct_init() after optionally
82  * configuring it with AVOptions.
83  *
84  * To free it use av_free()
85  */
87 int avcodec_dct_init(AVDCT *);
88 
89 const AVClass *avcodec_dct_get_class(void);
90 
91 #endif /* AVCODEC_AVDCT_H */
opt.h
AVDCT::dct_algo
int dct_algo
DCT algorithm.
Definition: avdct.h:60
avcodec_dct_init
int avcodec_dct_init(AVDCT *)
Definition: avdct.c:90
AVDCT::fdct
void(* fdct)(int16_t *block)
Definition: avdct.h:53
AVDCT::idct_permutation
uint8_t idct_permutation[64]
IDCT input permutation.
Definition: avdct.h:51
AVDCT::bits_per_sample
int bits_per_sample
Definition: avdct.h:72
avcodec_dct_alloc
AVDCT * avcodec_dct_alloc(void)
Allocates a AVDCT context.
Definition: avdct.c:77
AVDCT::av_class
const AVClass * av_class
Definition: avdct.h:33
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:76
AVDCT::get_pixels
void(* get_pixels)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size)
Definition: avdct.h:68
AVDCT::idct
void(* idct)(int16_t *block)
Definition: avdct.h:35
avcodec_dct_get_class
const AVClass * avcodec_dct_get_class(void)
Definition: avdct.c:72
AVDCT
AVDCT context.
Definition: avdct.h:32
AVDCT::get_pixels_unaligned
void(* get_pixels_unaligned)(int16_t *block, const uint8_t *pixels, ptrdiff_t line_size)
Definition: avdct.h:74
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
AVDCT::idct_algo
int idct_algo
IDCT algorithm.
Definition: avdct.h:66