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.

171 lines
6.7KB

  1. /*
  2. * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5)
  3. *
  4. * Copyright (c) 2009 Maxim Poliakovski
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. /**
  23. * @file libavcodec/ivi_dsp.h
  24. * DSP functions (inverse transforms, motion compensations, wavelet recompostion)
  25. * for Indeo Video Interactive codecs.
  26. */
  27. #ifndef AVCODEC_IVI_DSP_H
  28. #define AVCODEC_IVI_DSP_H
  29. #include "avcodec.h"
  30. #include "ivi_common.h"
  31. /**
  32. * 5/3 wavelet recomposition filter for Indeo5
  33. *
  34. * @param plane [in] pointer to the descriptor of the plane being processed
  35. * @param dst [out] pointer to the destination buffer
  36. * @param dst_pitch [in] pitch of the destination buffer
  37. * @param num_bands [in] number of wavelet bands to be processed
  38. */
  39. void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst,
  40. const int dst_pitch, const int num_bands);
  41. /**
  42. * two-dimensional inverse slant 8x8 transform
  43. *
  44. * @param in [in] pointer to the vector of transform coefficients
  45. * @param out [out] pointer to the output buffer (frame)
  46. * @param pitch [in] pitch to move to the next y line
  47. * @param flags [in] pointer to the array of column flags:
  48. * != 0 - non_empty column, 0 - empty one
  49. * (this array must be filled by caller)
  50. */
  51. void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch,
  52. const uint8_t *flags);
  53. /**
  54. * two-dimensional inverse slant 4x4 transform
  55. *
  56. * @param in [in] pointer to the vector of transform coefficients
  57. * @param out [out] pointer to the output buffer (frame)
  58. * @param pitch [in] pitch to move to the next y line
  59. * @param flags [in] pointer to the array of column flags:
  60. * != 0 - non_empty column, 0 - empty one
  61. * (this array must be filled by caller)
  62. */
  63. void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch,
  64. const uint8_t *flags);
  65. /**
  66. * DC-only two-dimensional inverse slant transform.
  67. * Performing the inverse slant transform in this case is equivalent to
  68. * spreading (DC_coeff + 1)/2 over the whole block.
  69. * It works much faster than performing the slant transform on a vector of zeroes.
  70. *
  71. * @param in [in] pointer to the dc coefficient
  72. * @param out [out] pointer to the output buffer (frame)
  73. * @param pitch [in] pitch to move to the next y line
  74. * @param blk_size [in] transform block size
  75. */
  76. void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
  77. /**
  78. * inverse 1D row slant transform
  79. *
  80. * @param in [in] pointer to the vector of transform coefficients
  81. * @param out [out] pointer to the output buffer (frame)
  82. * @param pitch [in] pitch to move to the next y line
  83. * @param flags [in] pointer to the array of column flags (unused here)
  84. */
  85. void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
  86. const uint8_t *flags);
  87. /**
  88. * inverse 1D column slant transform
  89. *
  90. * @param in [in] pointer to the vector of transform coefficients
  91. * @param out [out] pointer to the output buffer (frame)
  92. * @param pitch [in] pitch to move to the next y line
  93. * @param flags [in] pointer to the array of column flags:
  94. * != 0 - non_empty column, 0 - empty one
  95. * (this array must be filled by caller)
  96. */
  97. void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch,
  98. const uint8_t *flags);
  99. /**
  100. * DC-only inverse row slant transform
  101. */
  102. void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
  103. /**
  104. * DC-only inverse column slant transform
  105. */
  106. void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
  107. /**
  108. * Copies the pixels into the frame buffer.
  109. */
  110. void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags);
  111. /**
  112. * Copies the DC coefficient into the first pixel of the block and
  113. * zeroes all others.
  114. */
  115. void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size);
  116. /**
  117. * 8x8 block motion compensation with adding delta
  118. *
  119. * @param buf [in,out] pointer to the block in the current frame buffer containing delta
  120. * @param ref_buf [in] pointer to the corresponding block in the reference frame
  121. * @param pitch [in] pitch for moving to the next y line
  122. * @param mc_type [in] interpolation type
  123. */
  124. void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
  125. /**
  126. * 4x4 block motion compensation with adding delta
  127. *
  128. * @param buf [in,out] pointer to the block in the current frame buffer containing delta
  129. * @param ref_buf [in] pointer to the corresponding block in the reference frame
  130. * @param pitch [in] pitch for moving to the next y line
  131. * @param mc_type [in] interpolation type
  132. */
  133. void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
  134. /**
  135. * motion compensation without adding delta
  136. *
  137. * @param buf [in,out] pointer to the block in the current frame receiving the result
  138. * @param ref_buf [in] pointer to the corresponding block in the reference frame
  139. * @param pitch [in] pitch for moving to the next y line
  140. * @param mc_type [in] interpolation type
  141. */
  142. void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
  143. /**
  144. * 4x4 block motion compensation without adding delta
  145. *
  146. * @param buf [in,out] pointer to the block in the current frame receiving the result
  147. * @param ref_buf [in] pointer to the corresponding block in the reference frame
  148. * @param pitch [in] pitch for moving to the next y line
  149. * @param mc_type [in] interpolation type
  150. */
  151. void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type);
  152. #endif /* AVCODEC_IVI_DSP_H */