2 * Copyright (C) 2003 Ivan Kalvachev
4 * This file is part of FFmpeg.
6 * FFmpeg 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 * FFmpeg 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 FFmpeg; 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"
37 * @defgroup lavc_codec_hwaccel_xvmc XvMC
38 * @ingroup lavc_codec_hwaccel
43 #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
44 the number is 1337 speak for the letters IDCT MCo (motion compensation) */
46 struct attribute_deprecated xvmc_pix_fmt {
47 /** The field contains the special constant value AV_XVMC_ID.
48 It is used as a test that the application correctly uses the API,
49 and that there is no corruption caused by pixel routines.
50 - application - set during initialization
51 - libavcodec - unchanged
55 /** Pointer to the block array allocated by XvMCCreateBlocks().
56 The array has to be freed by XvMCDestroyBlocks().
57 Each group of 64 values represents one data block of differential
58 pixel information (in MoCo mode) or coefficients for IDCT.
59 - application - set the pointer during initialization
60 - libavcodec - fills coefficients/pixel data into the array
64 /** Pointer to the macroblock description array allocated by
65 XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
66 - application - set the pointer during initialization
67 - libavcodec - fills description data into the array
69 XvMCMacroBlock* mv_blocks;
71 /** Number of macroblock descriptions that can be stored in the mv_blocks
73 - application - set during initialization
74 - libavcodec - unchanged
76 int allocated_mv_blocks;
78 /** Number of blocks that can be stored at once in the data_blocks array.
79 - application - set during initialization
80 - libavcodec - unchanged
82 int allocated_data_blocks;
84 /** Indicate that the hardware would interpret data_blocks as IDCT
85 coefficients and perform IDCT on them.
86 - application - set during initialization
87 - libavcodec - unchanged
91 /** In MoCo mode it indicates that intra macroblocks are assumed to be in
92 unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
93 - application - set during initialization
94 - libavcodec - unchanged
98 /** Pointer to the surface allocated by XvMCCreateSurface().
99 It has to be freed by XvMCDestroySurface() on application exit.
100 It identifies the frame and its state on the video hardware.
101 - application - set during initialization
102 - libavcodec - unchanged
104 XvMCSurface* p_surface;
106 /** Set by the decoder before calling ff_draw_horiz_band(),
107 needed by the XvMCRenderSurface function. */
109 /** Pointer to the surface used as past reference
110 - application - unchanged
113 XvMCSurface* p_past_surface;
115 /** Pointer to the surface used as future reference
116 - application - unchanged
119 XvMCSurface* p_future_surface;
121 /** top/bottom field or frame
122 - application - unchanged
125 unsigned int picture_structure;
127 /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
128 - application - unchanged
134 /** Number of macroblock descriptions in the mv_blocks array
135 that have already been passed to the hardware.
136 - application - zeroes it on get_buffer().
137 A successful ff_draw_horiz_band() may increment it
138 with filled_mb_block_num or zero both.
139 - libavcodec - unchanged
141 int start_mv_blocks_num;
143 /** Number of new macroblock descriptions in the mv_blocks array (after
144 start_mv_blocks_num) that are filled by libavcodec and have to be
145 passed to the hardware.
146 - application - zeroes it on get_buffer() or after successful
147 ff_draw_horiz_band().
148 - libavcodec - increment with one of each stored MB
150 int filled_mv_blocks_num;
152 /** Number of the next free data block; one data block consists of
153 64 short values in the data_blocks array.
154 All blocks before this one have already been claimed by placing their
155 position into the corresponding block description structure field,
156 that are part of the mv_blocks array.
157 - application - zeroes it on get_buffer().
158 A successful ff_draw_horiz_band() may zero it together
159 with start_mb_blocks_num.
160 - libavcodec - each decoded macroblock increases it by the number
161 of coded blocks it contains.
163 int next_free_data_block_num;
170 #endif /* AVCODEC_XVMC_H */