annotate lib/libavcodec/xvmc.h @ 2324:b2e3ac05f2b3

Merge
author Grumpy7
date Thu, 27 Mar 2014 23:30:02 +0100
parents 992d2e6f907d
children
rev   line source
2134
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
1 /*
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
2 * Copyright (C) 2003 Ivan Kalvachev
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
3 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
4 * This file is part of FFmpeg.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
5 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
10 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
14 * Lesser General Public License for more details.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
15 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
19 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
20
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
21 #ifndef AVCODEC_XVMC_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
22 #define AVCODEC_XVMC_H
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
23
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
24 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
25 * @file
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
26 * @ingroup lavc_codec_hwaccel_xvmc
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
27 * Public libavcodec XvMC header.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
28 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
29
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
30 #include <X11/extensions/XvMC.h>
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
31
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
32 #include "avcodec.h"
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
33
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
34 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
35 * @defgroup lavc_codec_hwaccel_xvmc XvMC
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
36 * @ingroup lavc_codec_hwaccel
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
37 *
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
38 * @{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
39 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
40
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
41 #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
42 the number is 1337 speak for the letters IDCT MCo (motion compensation) */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
43
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
44 struct xvmc_pix_fmt {
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
45 /** The field contains the special constant value AV_XVMC_ID.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
46 It is used as a test that the application correctly uses the API,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
47 and that there is no corruption caused by pixel routines.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
48 - application - set during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
49 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
50 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
51 int xvmc_id;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
52
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
53 /** Pointer to the block array allocated by XvMCCreateBlocks().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
54 The array has to be freed by XvMCDestroyBlocks().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
55 Each group of 64 values represents one data block of differential
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
56 pixel information (in MoCo mode) or coefficients for IDCT.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
57 - application - set the pointer during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
58 - libavcodec - fills coefficients/pixel data into the array
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
59 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
60 short* data_blocks;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
61
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
62 /** Pointer to the macroblock description array allocated by
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
63 XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
64 - application - set the pointer during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
65 - libavcodec - fills description data into the array
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
66 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
67 XvMCMacroBlock* mv_blocks;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
68
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
69 /** Number of macroblock descriptions that can be stored in the mv_blocks
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
70 array.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
71 - application - set during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
72 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
73 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
74 int allocated_mv_blocks;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
75
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
76 /** Number of blocks that can be stored at once in the data_blocks array.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
77 - application - set during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
78 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
79 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
80 int allocated_data_blocks;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
81
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
82 /** Indicate that the hardware would interpret data_blocks as IDCT
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
83 coefficients and perform IDCT on them.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
84 - application - set during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
85 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
86 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
87 int idct;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
88
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
89 /** In MoCo mode it indicates that intra macroblocks are assumed to be in
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
90 unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
91 - application - set during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
92 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
93 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
94 int unsigned_intra;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
95
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
96 /** Pointer to the surface allocated by XvMCCreateSurface().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
97 It has to be freed by XvMCDestroySurface() on application exit.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
98 It identifies the frame and its state on the video hardware.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
99 - application - set during initialization
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
100 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
101 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
102 XvMCSurface* p_surface;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
103
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
104 /** Set by the decoder before calling ff_draw_horiz_band(),
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
105 needed by the XvMCRenderSurface function. */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
106 //@{
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
107 /** Pointer to the surface used as past reference
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
108 - application - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
109 - libavcodec - set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
110 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
111 XvMCSurface* p_past_surface;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
112
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
113 /** Pointer to the surface used as future reference
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
114 - application - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
115 - libavcodec - set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
116 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
117 XvMCSurface* p_future_surface;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
118
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
119 /** top/bottom field or frame
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
120 - application - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
121 - libavcodec - set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
122 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
123 unsigned int picture_structure;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
124
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
125 /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
126 - application - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
127 - libavcodec - set
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
128 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
129 unsigned int flags;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
130 //}@
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
131
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
132 /** Number of macroblock descriptions in the mv_blocks array
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
133 that have already been passed to the hardware.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
134 - application - zeroes it on get_buffer().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
135 A successful ff_draw_horiz_band() may increment it
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
136 with filled_mb_block_num or zero both.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
137 - libavcodec - unchanged
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
138 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
139 int start_mv_blocks_num;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
140
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
141 /** Number of new macroblock descriptions in the mv_blocks array (after
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
142 start_mv_blocks_num) that are filled by libavcodec and have to be
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
143 passed to the hardware.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
144 - application - zeroes it on get_buffer() or after successful
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
145 ff_draw_horiz_band().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
146 - libavcodec - increment with one of each stored MB
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
147 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
148 int filled_mv_blocks_num;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
149
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
150 /** Number of the next free data block; one data block consists of
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
151 64 short values in the data_blocks array.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
152 All blocks before this one have already been claimed by placing their
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
153 position into the corresponding block description structure field,
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
154 that are part of the mv_blocks array.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
155 - application - zeroes it on get_buffer().
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
156 A successful ff_draw_horiz_band() may zero it together
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
157 with start_mb_blocks_num.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
158 - libavcodec - each decoded macroblock increases it by the number
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
159 of coded blocks it contains.
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
160 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
161 int next_free_data_block_num;
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
162 };
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
163
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
164 /**
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
165 * @}
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
166 */
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
167
992d2e6f907d preparation for libavcodec
zipi
parents:
diff changeset
168 #endif /* AVCODEC_XVMC_H */