FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
idctdsp.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_IDCTDSP_H
20 #define AVCODEC_IDCTDSP_H
21 
22 #include <stdint.h>
23 
24 #include "avcodec.h"
25 
26 /**
27  * Scantable.
28  */
29 typedef struct ScanTable {
33 } ScanTable;
34 
42 };
43 
44 void ff_init_scantable(uint8_t *permutation, ScanTable *st,
45  const uint8_t *src_scantable);
46 void ff_init_scantable_permutation(uint8_t *idct_permutation,
47  enum idct_permutation_type perm_type);
48 int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
49  enum idct_permutation_type perm_type);
50 
51 typedef struct IDCTDSPContext {
52  /* pixel ops : interface with DCT */
53  void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
54  uint8_t *pixels /* align 8 */,
55  ptrdiff_t line_size);
56  void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
57  uint8_t *pixels /* align 8 */,
58  ptrdiff_t line_size);
59  void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
60  uint8_t *pixels /* align 8 */,
61  ptrdiff_t line_size);
62 
63  void (*idct)(int16_t *block /* align 16 */);
64 
65  /**
66  * block -> idct -> clip to unsigned 8 bit -> dest.
67  * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
68  * @param line_size size in bytes of a horizontal line of dest
69  */
70  void (*idct_put)(uint8_t *dest /* align 8 */,
71  int line_size, int16_t *block /* align 16 */);
72 
73  /**
74  * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
75  * @param line_size size in bytes of a horizontal line of dest
76  */
77  void (*idct_add)(uint8_t *dest /* align 8 */,
78  int line_size, int16_t *block /* align 16 */);
79 
80  /**
81  * IDCT input permutation.
82  * Several optimized IDCTs need a permutated input (relative to the
83  * normal order of the reference IDCT).
84  * This permutation must be performed before the idct_put/add.
85  * Note, normally this can be merged with the zigzag/alternate scan<br>
86  * An example to avoid confusion:
87  * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
88  * - (x -> reference DCT -> reference IDCT -> x)
89  * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
90  * -> simple_idct_mmx -> x)
91  * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
92  * -> simple_idct_mmx -> ...)
93  */
97 
98 extern void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
99 extern void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size);
100 
102 
104  unsigned high_bit_depth);
106  unsigned high_bit_depth);
108  unsigned high_bit_depth);
110  unsigned high_bit_depth);
112  unsigned high_bit_depth);
113 
114 #endif /* AVCODEC_IDCTDSP_H */
void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp_init.c:61
int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
Definition: idctdsp_init.c:42
idct_permutation_type
Definition: idctdsp.h:35
void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
Definition: idctdsp.c:241
void(* put_signed_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size)
Definition: idctdsp.h:56
Scantable.
Definition: idctdsp.h:29
uint8_t raster_end[64]
Definition: idctdsp.h:32
uint8_t permutated[64]
Definition: idctdsp.h:31
void(* ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size)
Definition: idctdsp.c:83
void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
static int16_t block[64]
Definition: dct.c:113
uint8_t
void(* put_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size)
Definition: idctdsp.h:53
const uint8_t * scantable
Definition: idctdsp.h:30
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
Definition: idctdsp.c:29
void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
void(* add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size)
Definition: idctdsp.h:59
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
void ff_init_scantable_permutation(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
Definition: idctdsp.c:50
uint8_t idct_permutation[64]
IDCT input permutation.
Definition: idctdsp.h:94
void(* idct_add)(uint8_t *dest, int line_size, int16_t *block)
block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
Definition: idctdsp.h:77
void(* idct_put)(uint8_t *dest, int line_size, int16_t *block)
block -> idct -> clip to unsigned 8 bit -> dest.
Definition: idctdsp.h:70
void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Libavcodec external API header.
void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp.c:256
main external API structure.
Definition: avcodec.h:1676
static double c[64]
int pixels
Definition: avisynth_c.h:429
void(* ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, ptrdiff_t line_size)
Definition: idctdsp.c:84
enum idct_permutation_type perm_type
Definition: idctdsp.h:95
void(* idct)(int16_t *block)
Definition: idctdsp.h:63