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.

117 lines
3.6KB

  1. /*
  2. * RealVideo 4 decoder
  3. * copyright (c) 2007 Konstantin Shishkov
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file rv40data.h
  23. * miscellaneous RV40 tables
  24. */
  25. #ifndef FFMPEG_RV40DATA_H
  26. #define FFMPEG_RV40DATA_H
  27. #include <stdint.h>
  28. /**
  29. * standard widths and heights coded in RV40
  30. */
  31. //@{
  32. static const int rv40_standard_widths[] = { 160, 172, 240, 320, 352, 640, 704, 0};
  33. static const int rv40_standard_heights[] = { 120, 132, 144, 240, 288, 480, 0, 0};
  34. static const int rv40_standard_heights2[] = { 180, 360, 576, 0};
  35. //@}
  36. #define MODE2_PATTERNS_NUM 20
  37. /**
  38. * intra types table
  39. *
  40. * These values are actually coded 3-tuples
  41. * used for detecting standard block configurations.
  42. */
  43. static const uint16_t rv40_aic_table_index[MODE2_PATTERNS_NUM] = {
  44. 0x000, 0x100, 0x200,
  45. 0x011, 0x111, 0x211, 0x511, 0x611,
  46. 0x022, 0x122, 0x222, 0x722,
  47. 0x272, 0x227,
  48. 0x822, 0x282, 0x228,
  49. 0x112, 0x116, 0x221
  50. };
  51. /**
  52. * luma quantizer values
  53. * The second table is used for inter blocks.
  54. */
  55. static const uint8_t rv40_luma_dc_quant[2][32] = {
  56. { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  57. 16, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 22, 22, 22, 22 },
  58. { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  59. 16, 17, 18, 19, 20, 20, 21, 21, 22, 23, 23, 23, 24, 24, 24, 24 }
  60. };
  61. /**
  62. * @begingroup loopfilter coefficients used by the RV40 loop filter
  63. * @{
  64. */
  65. /**
  66. * dither values for deblocking filter - left/top values
  67. */
  68. static const uint8_t rv40_dither_l[16] = {
  69. 0x40, 0x50, 0x20, 0x60, 0x30, 0x50, 0x40, 0x30,
  70. 0x50, 0x40, 0x50, 0x30, 0x60, 0x20, 0x50, 0x40
  71. };
  72. /**
  73. * dither values for deblocking filter - right/bottom values
  74. */
  75. static const uint8_t rv40_dither_r[16] = {
  76. 0x40, 0x30, 0x60, 0x20, 0x50, 0x30, 0x30, 0x40,
  77. 0x40, 0x40, 0x50, 0x30, 0x20, 0x60, 0x30, 0x40
  78. };
  79. /** alpha parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
  80. static const uint8_t rv40_alpha_tab[32] = {
  81. 128, 128, 128, 128, 128, 128, 128, 128,
  82. 128, 128, 122, 96, 75, 59, 47, 37,
  83. 29, 23, 18, 15, 13, 11, 10, 9,
  84. 8, 7, 6, 5, 4, 3, 2, 1
  85. };
  86. /** beta parameter for RV40 loop filter - almost the same as in JVT-A003r1 */
  87. static const uint8_t rv40_beta_tab[32] = {
  88. 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, 3, 4, 4, 4, 6, 6,
  89. 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 15, 16, 17
  90. };
  91. /** clip table for RV40 loop filter - the same as in JVT-A003r1 */
  92. static const uint8_t rv40_filter_clip_tbl[3][32] = {
  93. {
  94. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  95. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  96. },
  97. {
  98. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
  99. 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5
  100. },
  101. {
  102. 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
  103. 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 7, 8, 9
  104. }
  105. };
  106. /** @} */ // end loopfilter group
  107. #endif /* FFMPEG_RV40DATA_H */