2 * Copyright (C) 2003 Ivan Kalvachev
4 * This file is part of Libav.
6 * Libav is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * Libav is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Libav; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 #ifndef AVCODEC_XVMC_H
22 #define AVCODEC_XVMC_H
26 * @ingroup lavc_codec_hwaccel_xvmc
27 * Public libavcodec XvMC header.
30 #include <X11/extensions/XvMC.h>
32 #include "libavutil/attributes.h"
39 * @defgroup lavc_codec_hwaccel_xvmc XvMC
40 * @ingroup lavc_codec_hwaccel
45 #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
46 the number is 1337 speak for the letters IDCT MCo (motion compensation) */
48 attribute_deprecated struct xvmc_pix_fmt {
49 /** The field contains the special constant value AV_XVMC_ID.
50 It is used as a test that the application correctly uses the API,
51 and that there is no corruption caused by pixel routines.
52 - application - set during initialization
53 - libavcodec - unchanged
57 /** Pointer to the block array allocated by XvMCCreateBlocks().
58 The array has to be freed by XvMCDestroyBlocks().
59 Each group of 64 values represents one data block of differential
60 pixel information (in MoCo mode) or coefficients for IDCT.
61 - application - set the pointer during initialization
62 - libavcodec - fills coefficients/pixel data into the array
66 /** Pointer to the macroblock description array allocated by
67 XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
68 - application - set the pointer during initialization
69 - libavcodec - fills description data into the array
71 XvMCMacroBlock* mv_blocks;
73 /** Number of macroblock descriptions that can be stored in the mv_blocks
75 - application - set during initialization
76 - libavcodec - unchanged
78 int allocated_mv_blocks;
80 /** Number of blocks that can be stored at once in the data_blocks array.
81 - application - set during initialization
82 - libavcodec - unchanged
84 int allocated_data_blocks;
86 /** Indicate that the hardware would interpret data_blocks as IDCT
87 coefficients and perform IDCT on them.
88 - application - set during initialization
89 - libavcodec - unchanged
93 /** In MoCo mode it indicates that intra macroblocks are assumed to be in
94 unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
95 - application - set during initialization
96 - libavcodec - unchanged
100 /** Pointer to the surface allocated by XvMCCreateSurface().
101 It has to be freed by XvMCDestroySurface() on application exit.
102 It identifies the frame and its state on the video hardware.
103 - application - set during initialization
104 - libavcodec - unchanged
106 XvMCSurface* p_surface;
108 /** Set by the decoder before calling ff_draw_horiz_band(),
109 needed by the XvMCRenderSurface function. */
111 /** Pointer to the surface used as past reference
112 - application - unchanged
115 XvMCSurface* p_past_surface;
117 /** Pointer to the surface used as future reference
118 - application - unchanged
121 XvMCSurface* p_future_surface;
123 /** top/bottom field or frame
124 - application - unchanged
127 unsigned int picture_structure;
129 /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
130 - application - unchanged
136 /** Number of macroblock descriptions in the mv_blocks array
137 that have already been passed to the hardware.
138 - application - zeroes it on get_buffer().
139 A successful ff_draw_horiz_band() may increment it
140 with filled_mb_block_num or zero both.
141 - libavcodec - unchanged
143 int start_mv_blocks_num;
145 /** Number of new macroblock descriptions in the mv_blocks array (after
146 start_mv_blocks_num) that are filled by libavcodec and have to be
147 passed to the hardware.
148 - application - zeroes it on get_buffer() or after successful
149 ff_draw_horiz_band().
150 - libavcodec - increment with one of each stored MB
152 int filled_mv_blocks_num;
154 /** Number of the next free data block; one data block consists of
155 64 short values in the data_blocks array.
156 All blocks before this one have already been claimed by placing their
157 position into the corresponding block description structure field,
158 that are part of the mv_blocks array.
159 - application - zeroes it on get_buffer().
160 A successful ff_draw_horiz_band() may zero it together
161 with start_mb_blocks_num.
162 - libavcodec - each decoded macroblock increases it by the number
163 of coded blocks it contains.
165 int next_free_data_block_num;
172 #endif /* FF_API_XVMC */
174 #endif /* AVCODEC_XVMC_H */