You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xvmc.h 5.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. /*
  2. * Copyright (C) 2003 Ivan Kalvachev
  3. *
  4. * This file is part of FFmpeg.
  5. *
  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.
  10. *
  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.
  15. *
  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
  19. */
  20. #ifndef AVCODEC_XVMC_H
  21. #define AVCODEC_XVMC_H
  22. /**
  23. * @file
  24. * @ingroup lavc_codec_hwaccel_xvmc
  25. * Public libavcodec XvMC header.
  26. */
  27. #include <X11/extensions/XvMC.h>
  28. #include "libavutil/attributes.h"
  29. #include "version.h"
  30. #include "avcodec.h"
  31. /**
  32. * @defgroup lavc_codec_hwaccel_xvmc XvMC
  33. * @ingroup lavc_codec_hwaccel
  34. *
  35. * @{
  36. */
  37. #define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct
  38. the number is 1337 speak for the letters IDCT MCo (motion compensation) */
  39. attribute_deprecated struct xvmc_pix_fmt {
  40. /** The field contains the special constant value AV_XVMC_ID.
  41. It is used as a test that the application correctly uses the API,
  42. and that there is no corruption caused by pixel routines.
  43. - application - set during initialization
  44. - libavcodec - unchanged
  45. */
  46. int xvmc_id;
  47. /** Pointer to the block array allocated by XvMCCreateBlocks().
  48. The array has to be freed by XvMCDestroyBlocks().
  49. Each group of 64 values represents one data block of differential
  50. pixel information (in MoCo mode) or coefficients for IDCT.
  51. - application - set the pointer during initialization
  52. - libavcodec - fills coefficients/pixel data into the array
  53. */
  54. short* data_blocks;
  55. /** Pointer to the macroblock description array allocated by
  56. XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
  57. - application - set the pointer during initialization
  58. - libavcodec - fills description data into the array
  59. */
  60. XvMCMacroBlock* mv_blocks;
  61. /** Number of macroblock descriptions that can be stored in the mv_blocks
  62. array.
  63. - application - set during initialization
  64. - libavcodec - unchanged
  65. */
  66. int allocated_mv_blocks;
  67. /** Number of blocks that can be stored at once in the data_blocks array.
  68. - application - set during initialization
  69. - libavcodec - unchanged
  70. */
  71. int allocated_data_blocks;
  72. /** Indicate that the hardware would interpret data_blocks as IDCT
  73. coefficients and perform IDCT on them.
  74. - application - set during initialization
  75. - libavcodec - unchanged
  76. */
  77. int idct;
  78. /** In MoCo mode it indicates that intra macroblocks are assumed to be in
  79. unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
  80. - application - set during initialization
  81. - libavcodec - unchanged
  82. */
  83. int unsigned_intra;
  84. /** Pointer to the surface allocated by XvMCCreateSurface().
  85. It has to be freed by XvMCDestroySurface() on application exit.
  86. It identifies the frame and its state on the video hardware.
  87. - application - set during initialization
  88. - libavcodec - unchanged
  89. */
  90. XvMCSurface* p_surface;
  91. /** Set by the decoder before calling ff_draw_horiz_band(),
  92. needed by the XvMCRenderSurface function. */
  93. //@{
  94. /** Pointer to the surface used as past reference
  95. - application - unchanged
  96. - libavcodec - set
  97. */
  98. XvMCSurface* p_past_surface;
  99. /** Pointer to the surface used as future reference
  100. - application - unchanged
  101. - libavcodec - set
  102. */
  103. XvMCSurface* p_future_surface;
  104. /** top/bottom field or frame
  105. - application - unchanged
  106. - libavcodec - set
  107. */
  108. unsigned int picture_structure;
  109. /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
  110. - application - unchanged
  111. - libavcodec - set
  112. */
  113. unsigned int flags;
  114. //}@
  115. /** Number of macroblock descriptions in the mv_blocks array
  116. that have already been passed to the hardware.
  117. - application - zeroes it on get_buffer().
  118. A successful ff_draw_horiz_band() may increment it
  119. with filled_mb_block_num or zero both.
  120. - libavcodec - unchanged
  121. */
  122. int start_mv_blocks_num;
  123. /** Number of new macroblock descriptions in the mv_blocks array (after
  124. start_mv_blocks_num) that are filled by libavcodec and have to be
  125. passed to the hardware.
  126. - application - zeroes it on get_buffer() or after successful
  127. ff_draw_horiz_band().
  128. - libavcodec - increment with one of each stored MB
  129. */
  130. int filled_mv_blocks_num;
  131. /** Number of the next free data block; one data block consists of
  132. 64 short values in the data_blocks array.
  133. All blocks before this one have already been claimed by placing their
  134. position into the corresponding block description structure field,
  135. that are part of the mv_blocks array.
  136. - application - zeroes it on get_buffer().
  137. A successful ff_draw_horiz_band() may zero it together
  138. with start_mb_blocks_num.
  139. - libavcodec - each decoded macroblock increases it by the number
  140. of coded blocks it contains.
  141. */
  142. int next_free_data_block_num;
  143. };
  144. /**
  145. * @}
  146. */
  147. #endif /* AVCODEC_XVMC_H */