vidstabcommon.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*------------------------------------------------------------------------------
  2. -- --
  3. -- This software is confidential and proprietary and may be used --
  4. -- only as expressly authorized by a licensing agreement from --
  5. -- --
  6. -- Hantro Products Oy. --
  7. -- --
  8. -- (C) COPYRIGHT 2006 HANTRO PRODUCTS OY --
  9. -- ALL RIGHTS RESERVED --
  10. -- --
  11. -- The entire notice above must be reproduced --
  12. -- on all copies and should not be removed. --
  13. -- --
  14. --------------------------------------------------------------------------------
  15. -
  16. - Description : ...
  17. -
  18. ------------------------------------------------------------------------------*/
  19. #ifndef __VIDSTABCOMMON_H__
  20. #define __VIDSTABCOMMON_H__
  21. #include "basetype.h"
  22. #ifdef H8290_HAVE_VIDSTABDEBUG_H
  23. #include "vidstabdebug.h"
  24. #else
  25. #ifndef ASSERT
  26. #define ASSERT(expr)
  27. #endif
  28. #ifndef DEBUG_PRINT
  29. #define DEBUG_PRINT(args)
  30. #endif
  31. #endif
  32. typedef struct HWStabData_
  33. {
  34. u32 rMotionSum;
  35. u32 rMotionMin;
  36. i32 rGmvX;
  37. i32 rGmvY;
  38. u32 rMatrixVal[9];
  39. } HWStabData;
  40. /* Stabilizer parameter and data structure */
  41. typedef struct SwStbData_
  42. {
  43. /* User defined parameters */
  44. i32 inputWidth; /* Input picture dimensions in pixels */
  45. i32 inputHeight;
  46. i32 stride; /* Input picture scanline length in bytes */
  47. i32 stabilizedWidth; /* Stabilized picture dimensions in pixels, */
  48. i32 stabilizedHeight; /* multiple of 4, [8, inputHeight-8] */
  49. /* Stabilized picture position from top-left corner of input picture,
  50. * algorithm input/output, initialize to (inputWidth-stabilizedWidth)/2 */
  51. i32 stabOffsetX; /* [0, inputWidth-stabilizedWidth] */
  52. i32 stabOffsetY; /* [0, inputHeight-stabilizedHeight] */
  53. /* Algorithm internal data, MUST INITIALIZE TO ZERO */
  54. i32 qpMotionX;
  55. i32 qpMotionY;
  56. i32 filterPosX;
  57. i32 filterPosY;
  58. i32 filterX;
  59. i32 filterY;
  60. i32 filterLengthX;
  61. i32 filterLengthY;
  62. i32 filterSumMotX;
  63. i32 filterSumMotY;
  64. i32 filterSumStabX;
  65. i32 filterSumStabY;
  66. i32 filterErrorX;
  67. i32 filterErrorY;
  68. i32 filterErrorXp;
  69. i32 filterErrorYp;
  70. const u32 *motion;
  71. i32 half[5][5];
  72. i32 quarter[5][5];
  73. u32 prevMin;
  74. u32 prevMean;
  75. u32 sceneChange;
  76. } SwStbData;
  77. void VSAlgInit(SwStbData * data, u32 srcWidth, u32 srcHeight, u32 width,
  78. u32 height);
  79. void VSAlgReset(SwStbData * data);
  80. u32 VSAlgStabilize(SwStbData * data, const HWStabData * hwStabData);
  81. void VSAlgGetResult(const SwStbData * data, u32 * xOff, u32 * yOff);
  82. void VSReadStabData(const u32 * regMirror, HWStabData * hwStabData);
  83. #endif /* __VIDSTABCOMMON_H__ */