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.

152 lines
5.7KB

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