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.

124 lines
2.7KB

  1. /*
  2. * Copyright (C) 2004 Michael Niedermayer <michaelni@gmx.at>
  3. * Copyright (C) 2006 Robert Edele <yartrebo@earthlink.net>
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. */
  19. #ifndef _SNOW_H
  20. #define _SNOW_H
  21. #include "dsputil.h"
  22. #define MID_STATE 128
  23. #define MAX_DECOMPOSITIONS 8
  24. #define MAX_PLANES 4
  25. #define QSHIFT 5
  26. #define QROOT (1<<QSHIFT)
  27. #define LOSSLESS_QLOG -128
  28. #define FRAC_BITS 8
  29. #define LOG2_OBMC_MAX 6
  30. #define OBMC_MAX (1<<(LOG2_OBMC_MAX))
  31. /** Used to minimize the amount of memory used in order to optimize cache performance. **/
  32. struct slice_buffer_s {
  33. DWTELEM * * line; ///< For use by idwt and predict_slices.
  34. DWTELEM * * data_stack; ///< Used for internal purposes.
  35. int data_stack_top;
  36. int line_count;
  37. int line_width;
  38. int data_count;
  39. DWTELEM * base_buffer; ///< Buffer that this structure is caching.
  40. };
  41. #define liftS lift
  42. #define lift5 lift
  43. #if 1
  44. #define W_AM 3
  45. #define W_AO 0
  46. #define W_AS 1
  47. #undef liftS
  48. #define W_BM 1
  49. #define W_BO 8
  50. #define W_BS 4
  51. #define W_CM 1
  52. #define W_CO 0
  53. #define W_CS 0
  54. #define W_DM 3
  55. #define W_DO 4
  56. #define W_DS 3
  57. #elif 0
  58. #define W_AM 55
  59. #define W_AO 16
  60. #define W_AS 5
  61. #define W_BM 3
  62. #define W_BO 32
  63. #define W_BS 6
  64. #define W_CM 127
  65. #define W_CO 64
  66. #define W_CS 7
  67. #define W_DM 7
  68. #define W_DO 8
  69. #define W_DS 4
  70. #elif 0
  71. #define W_AM 97
  72. #define W_AO 32
  73. #define W_AS 6
  74. #define W_BM 63
  75. #define W_BO 512
  76. #define W_BS 10
  77. #define W_CM 13
  78. #define W_CO 8
  79. #define W_CS 4
  80. #define W_DM 15
  81. #define W_DO 16
  82. #define W_DS 5
  83. #else
  84. #define W_AM 203
  85. #define W_AO 64
  86. #define W_AS 7
  87. #define W_BM 217
  88. #define W_BO 2048
  89. #define W_BS 12
  90. #define W_CM 113
  91. #define W_CO 64
  92. #define W_CS 7
  93. #define W_DM 227
  94. #define W_DO 128
  95. #define W_DS 9
  96. #endif
  97. extern void ff_snow_vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
  98. extern void ff_snow_horizontal_compose97i(DWTELEM *b, int width);
  99. extern void ff_snow_inner_add_yblock(uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
  100. #endif