h264: simplify calls to ff_er_add_slice().
[FFMpeg-mirror/mplayer-patches.git] / libavcodec / xvmc.h
blob1f77e4efca85422d8096e4593f1d7fa0f8aa5542
1 /*
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
24 /**
25 * @file
26 * @ingroup lavc_codec_hwaccel_xvmc
27 * Public libavcodec XvMC header.
30 #include <X11/extensions/XvMC.h>
32 #include "avcodec.h"
34 /**
35 * @defgroup lavc_codec_hwaccel_xvmc XvMC
36 * @ingroup lavc_codec_hwaccel
38 * @{
41 #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
42 the number is 1337 speak for the letters IDCT MCo (motion compensation) */
44 struct xvmc_pix_fmt {
45 /** The field contains the special constant value AV_XVMC_ID.
46 It is used as a test that the application correctly uses the API,
47 and that there is no corruption caused by pixel routines.
48 - application - set during initialization
49 - libavcodec - unchanged
51 int xvmc_id;
53 /** Pointer to the block array allocated by XvMCCreateBlocks().
54 The array has to be freed by XvMCDestroyBlocks().
55 Each group of 64 values represents one data block of differential
56 pixel information (in MoCo mode) or coefficients for IDCT.
57 - application - set the pointer during initialization
58 - libavcodec - fills coefficients/pixel data into the array
60 short* data_blocks;
62 /** Pointer to the macroblock description array allocated by
63 XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
64 - application - set the pointer during initialization
65 - libavcodec - fills description data into the array
67 XvMCMacroBlock* mv_blocks;
69 /** Number of macroblock descriptions that can be stored in the mv_blocks
70 array.
71 - application - set during initialization
72 - libavcodec - unchanged
74 int allocated_mv_blocks;
76 /** Number of blocks that can be stored at once in the data_blocks array.
77 - application - set during initialization
78 - libavcodec - unchanged
80 int allocated_data_blocks;
82 /** Indicate that the hardware would interpret data_blocks as IDCT
83 coefficients and perform IDCT on them.
84 - application - set during initialization
85 - libavcodec - unchanged
87 int idct;
89 /** In MoCo mode it indicates that intra macroblocks are assumed to be in
90 unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
91 - application - set during initialization
92 - libavcodec - unchanged
94 int unsigned_intra;
96 /** Pointer to the surface allocated by XvMCCreateSurface().
97 It has to be freed by XvMCDestroySurface() on application exit.
98 It identifies the frame and its state on the video hardware.
99 - application - set during initialization
100 - libavcodec - unchanged
102 XvMCSurface* p_surface;
104 /** Set by the decoder before calling ff_draw_horiz_band(),
105 needed by the XvMCRenderSurface function. */
106 //@{
107 /** Pointer to the surface used as past reference
108 - application - unchanged
109 - libavcodec - set
111 XvMCSurface* p_past_surface;
113 /** Pointer to the surface used as future reference
114 - application - unchanged
115 - libavcodec - set
117 XvMCSurface* p_future_surface;
119 /** top/bottom field or frame
120 - application - unchanged
121 - libavcodec - set
123 unsigned int picture_structure;
125 /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
126 - application - unchanged
127 - libavcodec - set
129 unsigned int flags;
130 //}@
132 /** Number of macroblock descriptions in the mv_blocks array
133 that have already been passed to the hardware.
134 - application - zeroes it on get_buffer().
135 A successful ff_draw_horiz_band() may increment it
136 with filled_mb_block_num or zero both.
137 - libavcodec - unchanged
139 int start_mv_blocks_num;
141 /** Number of new macroblock descriptions in the mv_blocks array (after
142 start_mv_blocks_num) that are filled by libavcodec and have to be
143 passed to the hardware.
144 - application - zeroes it on get_buffer() or after successful
145 ff_draw_horiz_band().
146 - libavcodec - increment with one of each stored MB
148 int filled_mv_blocks_num;
150 /** Number of the next free data block; one data block consists of
151 64 short values in the data_blocks array.
152 All blocks before this one have already been claimed by placing their
153 position into the corresponding block description structure field,
154 that are part of the mv_blocks array.
155 - application - zeroes it on get_buffer().
156 A successful ff_draw_horiz_band() may zero it together
157 with start_mb_blocks_num.
158 - libavcodec - each decoded macroblock increases it by the number
159 of coded blocks it contains.
161 int next_free_data_block_num;
165 * @}
168 #endif /* AVCODEC_XVMC_H */