yading@10: /* yading@10: * Copyright (C) 2003 Ivan Kalvachev yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #ifndef AVCODEC_XVMC_H yading@10: #define AVCODEC_XVMC_H yading@10: yading@10: /** yading@10: * @file yading@10: * @ingroup lavc_codec_hwaccel_xvmc yading@10: * Public libavcodec XvMC header. yading@10: */ yading@10: yading@10: #include yading@10: yading@10: #include "avcodec.h" yading@10: yading@10: /** yading@10: * @defgroup lavc_codec_hwaccel_xvmc XvMC yading@10: * @ingroup lavc_codec_hwaccel yading@10: * yading@10: * @{ yading@10: */ yading@10: yading@10: #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct yading@10: the number is 1337 speak for the letters IDCT MCo (motion compensation) */ yading@10: yading@10: struct xvmc_pix_fmt { yading@10: /** The field contains the special constant value AV_XVMC_ID. yading@10: It is used as a test that the application correctly uses the API, yading@10: and that there is no corruption caused by pixel routines. yading@10: - application - set during initialization yading@10: - libavcodec - unchanged yading@10: */ yading@10: int xvmc_id; yading@10: yading@10: /** Pointer to the block array allocated by XvMCCreateBlocks(). yading@10: The array has to be freed by XvMCDestroyBlocks(). yading@10: Each group of 64 values represents one data block of differential yading@10: pixel information (in MoCo mode) or coefficients for IDCT. yading@10: - application - set the pointer during initialization yading@10: - libavcodec - fills coefficients/pixel data into the array yading@10: */ yading@10: short* data_blocks; yading@10: yading@10: /** Pointer to the macroblock description array allocated by yading@10: XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks(). yading@10: - application - set the pointer during initialization yading@10: - libavcodec - fills description data into the array yading@10: */ yading@10: XvMCMacroBlock* mv_blocks; yading@10: yading@10: /** Number of macroblock descriptions that can be stored in the mv_blocks yading@10: array. yading@10: - application - set during initialization yading@10: - libavcodec - unchanged yading@10: */ yading@10: int allocated_mv_blocks; yading@10: yading@10: /** Number of blocks that can be stored at once in the data_blocks array. yading@10: - application - set during initialization yading@10: - libavcodec - unchanged yading@10: */ yading@10: int allocated_data_blocks; yading@10: yading@10: /** Indicate that the hardware would interpret data_blocks as IDCT yading@10: coefficients and perform IDCT on them. yading@10: - application - set during initialization yading@10: - libavcodec - unchanged yading@10: */ yading@10: int idct; yading@10: yading@10: /** In MoCo mode it indicates that intra macroblocks are assumed to be in yading@10: unsigned format; same as the XVMC_INTRA_UNSIGNED flag. yading@10: - application - set during initialization yading@10: - libavcodec - unchanged yading@10: */ yading@10: int unsigned_intra; yading@10: yading@10: /** Pointer to the surface allocated by XvMCCreateSurface(). yading@10: It has to be freed by XvMCDestroySurface() on application exit. yading@10: It identifies the frame and its state on the video hardware. yading@10: - application - set during initialization yading@10: - libavcodec - unchanged yading@10: */ yading@10: XvMCSurface* p_surface; yading@10: yading@10: /** Set by the decoder before calling ff_draw_horiz_band(), yading@10: needed by the XvMCRenderSurface function. */ yading@10: //@{ yading@10: /** Pointer to the surface used as past reference yading@10: - application - unchanged yading@10: - libavcodec - set yading@10: */ yading@10: XvMCSurface* p_past_surface; yading@10: yading@10: /** Pointer to the surface used as future reference yading@10: - application - unchanged yading@10: - libavcodec - set yading@10: */ yading@10: XvMCSurface* p_future_surface; yading@10: yading@10: /** top/bottom field or frame yading@10: - application - unchanged yading@10: - libavcodec - set yading@10: */ yading@10: unsigned int picture_structure; yading@10: yading@10: /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence yading@10: - application - unchanged yading@10: - libavcodec - set yading@10: */ yading@10: unsigned int flags; yading@10: //}@ yading@10: yading@10: /** Number of macroblock descriptions in the mv_blocks array yading@10: that have already been passed to the hardware. yading@10: - application - zeroes it on get_buffer(). yading@10: A successful ff_draw_horiz_band() may increment it yading@10: with filled_mb_block_num or zero both. yading@10: - libavcodec - unchanged yading@10: */ yading@10: int start_mv_blocks_num; yading@10: yading@10: /** Number of new macroblock descriptions in the mv_blocks array (after yading@10: start_mv_blocks_num) that are filled by libavcodec and have to be yading@10: passed to the hardware. yading@10: - application - zeroes it on get_buffer() or after successful yading@10: ff_draw_horiz_band(). yading@10: - libavcodec - increment with one of each stored MB yading@10: */ yading@10: int filled_mv_blocks_num; yading@10: yading@10: /** Number of the next free data block; one data block consists of yading@10: 64 short values in the data_blocks array. yading@10: All blocks before this one have already been claimed by placing their yading@10: position into the corresponding block description structure field, yading@10: that are part of the mv_blocks array. yading@10: - application - zeroes it on get_buffer(). yading@10: A successful ff_draw_horiz_band() may zero it together yading@10: with start_mb_blocks_num. yading@10: - libavcodec - each decoded macroblock increases it by the number yading@10: of coded blocks it contains. yading@10: */ yading@10: int next_free_data_block_num; yading@10: }; yading@10: yading@10: /** yading@10: * @} yading@10: */ yading@10: yading@10: #endif /* AVCODEC_XVMC_H */