FFmpeg: libavcodec/idctdsp.h Source File

FFmpeg
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 "config.h"
25 
26 #include "avcodec.h"
27 
28 /**
29  * Scantable.
30  */
31  typedef struct ScanTable {
32   const uint8_t *scantable;
33   uint8_t permutated[64];
34   uint8_t raster_end[64];
35 } ScanTable;
36 
37  enum idct_permutation_type {
38   FF_IDCT_PERM_NONE,
39   FF_IDCT_PERM_LIBMPEG2,
40   FF_IDCT_PERM_SIMPLE,
41   FF_IDCT_PERM_TRANSPOSE,
42   FF_IDCT_PERM_PARTTRANS,
43   FF_IDCT_PERM_SSE2,
44 };
45 
46 void ff_init_scantable(uint8_t *permutation, ScanTable *st,
47  const uint8_t *src_scantable);
48 void ff_init_scantable_permutation(uint8_t *idct_permutation,
49  enum idct_permutation_type perm_type);
50 int ff_init_scantable_permutation_x86(uint8_t *idct_permutation,
51  enum idct_permutation_type perm_type);
52 
53  typedef struct IDCTDSPContext {
54  /* pixel ops : interface with DCT */
55   void (*put_pixels_clamped)(const int16_t *block /* align 16 */,
56  uint8_t *av_restrict pixels /* align 8 */,
57  ptrdiff_t line_size);
58   void (*put_signed_pixels_clamped)(const int16_t *block /* align 16 */,
59  uint8_t *av_restrict pixels /* align 8 */,
60  ptrdiff_t line_size);
61   void (*add_pixels_clamped)(const int16_t *block /* align 16 */,
62  uint8_t *av_restrict pixels /* align 8 */,
63  ptrdiff_t line_size);
64 
65   void (*idct)(int16_t *block /* align 16 */);
66 
67  /**
68  * block -> idct -> clip to unsigned 8 bit -> dest.
69  * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
70  * @param line_size size in bytes of a horizontal line of dest
71  */
72   void (*idct_put)(uint8_t *dest /* align 8 */,
73  ptrdiff_t line_size, int16_t *block /* align 16 */);
74 
75  /**
76  * block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
77  * @param line_size size in bytes of a horizontal line of dest
78  */
79   void (*idct_add)(uint8_t *dest /* align 8 */,
80  ptrdiff_t line_size, int16_t *block /* align 16 */);
81 
82  /**
83  * IDCT input permutation.
84  * Several optimized IDCTs need a permutated input (relative to the
85  * normal order of the reference IDCT).
86  * This permutation must be performed before the idct_put/add.
87  * Note, normally this can be merged with the zigzag/alternate scan<br>
88  * An example to avoid confusion:
89  * - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
90  * - (x -> reference DCT -> reference IDCT -> x)
91  * - (x -> reference DCT -> simple_mmx_perm = idct_permutation
92  * -> simple_idct_mmx -> x)
93  * - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
94  * -> simple_idct_mmx -> ...)
95  */
96   uint8_t idct_permutation[64];
97   enum idct_permutation_type perm_type;
98 } IDCTDSPContext;
99 
100 void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
101  ptrdiff_t line_size);
102 void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
103  ptrdiff_t line_size);
104 
105 void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx);
106 
107 void ff_idctdsp_init_aarch64(IDCTDSPContext *c, AVCodecContext *avctx,
108  unsigned high_bit_depth);
109 void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx,
110  unsigned high_bit_depth);
111 void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
112  unsigned high_bit_depth);
113 void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx,
114  unsigned high_bit_depth);
115 void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx,
116  unsigned high_bit_depth);
117 void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx,
118  unsigned high_bit_depth);
119 
120 #endif /* AVCODEC_IDCTDSP_H */
ff_idctdsp_init_x86
void ff_idctdsp_init_x86(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp_init.c:61
ff_init_scantable_permutation_x86
int ff_init_scantable_permutation_x86(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
Definition: idctdsp_init.c:42
idct_permutation_type
idct_permutation_type
Definition: idctdsp.h:37
ff_idctdsp_init
void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
Definition: idctdsp.c:238
ff_add_pixels_clamped_c
void ff_add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.c:157
ScanTable
Scantable.
Definition: idctdsp.h:31
ScanTable::raster_end
uint8_t raster_end[64]
Definition: idctdsp.h:34
ScanTable::permutated
uint8_t permutated[64]
Definition: idctdsp.h:33
ff_idctdsp_init_arm
void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp_init_arm.c:66
block
static int16_t block[64]
Definition: dct.c:115
uint8_t
uint8_t
Definition: audio_convert.c:194
IDCTDSPContext::add_pixels_clamped
void(* add_pixels_clamped)(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.h:61
ScanTable::scantable
const uint8_t * scantable
Definition: idctdsp.h:32
IDCTDSPContext::put_pixels_clamped
void(* put_pixels_clamped)(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.h:55
ff_init_scantable
void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
Definition: idctdsp.c:29
ff_idctdsp_init_mips
void ff_idctdsp_init_mips(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp_init_mips.c:62
void
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
ff_init_scantable_permutation
void ff_init_scantable_permutation(uint8_t *idct_permutation, enum idct_permutation_type perm_type)
Definition: idctdsp.c:50
ff_idctdsp_init_aarch64
void ff_idctdsp_init_aarch64(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp_init_aarch64.c:28
IDCTDSPContext::idct_permutation
uint8_t idct_permutation[64]
IDCT input permutation.
Definition: idctdsp.h:96
ff_idctdsp_init_alpha
void ff_idctdsp_init_alpha(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp_alpha.c:108
avcodec.h
Libavcodec external API header.
ff_idctdsp_init_ppc
void ff_idctdsp_init_ppc(IDCTDSPContext *c, AVCodecContext *avctx, unsigned high_bit_depth)
Definition: idctdsp.c:255
AVCodecContext
main external API structure.
Definition: avcodec.h:1518
IDCTDSPContext::idct_add
void(* idct_add)(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
Definition: idctdsp.h:79
IDCTDSPContext::put_signed_pixels_clamped
void(* put_signed_pixels_clamped)(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.h:58
IDCTDSPContext::idct_put
void(* idct_put)(uint8_t *dest, ptrdiff_t line_size, int16_t *block)
block -> idct -> clip to unsigned 8 bit -> dest.
Definition: idctdsp.h:72
c
static double c[64]
Definition: vsrc_mptestsrc.c:87
pixels
int pixels
Definition: avisynth_c.h:429
ff_put_pixels_clamped_c
void ff_put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, ptrdiff_t line_size)
Definition: idctdsp.c:83
IDCTDSPContext::perm_type
enum idct_permutation_type perm_type
Definition: idctdsp.h:97
IDCTDSPContext::idct
void(* idct)(int16_t *block)
Definition: idctdsp.h:65

Generated on Sun May 13 2018 02:03:48 for FFmpeg by   doxygen 1.8.6

AltStyle によって変換されたページ (->オリジナル) /