Symbols.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. * Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
  3. * Copyright (c) 2022, Gregory Bertilson<zaggy1024@gmail.com>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. namespace Video::VP9 {
  9. // FIXME: These should be placed in logical groupings based on the
  10. // context they are used in, and perhaps split into multiple
  11. // files. While doing so, as many of these as possible should be
  12. // renamed to be more human-readable, and most if not all should
  13. // be constexpr variables rather than preprocessor definitions.
  14. #define REFS_PER_FRAME 3
  15. #define MV_FR_SIZE 4
  16. #define MVREF_NEIGHBOURS 8
  17. #define BLOCK_SIZE_GROUPS 4
  18. #define BLOCK_SIZES 13
  19. #define BLOCK_INVALID 14
  20. #define PARTITION_CONTEXTS 16
  21. #define MI_SIZE 8
  22. #define MIN_TILE_WIDTH_B64 4
  23. #define MAX_TILE_WIDTH_B64 64
  24. #define MAX_MV_REF_CANDIDATES 2
  25. #define LOG2_OF_NUM_REF_FRAMES 3
  26. #define NUM_REF_FRAMES 1 << LOG2_OF_NUM_REF_FRAMES
  27. #define MAX_REF_FRAMES 4
  28. #define IS_INTER_CONTEXTS 4
  29. #define COMP_MODE_CONTEXTS 5
  30. #define REF_CONTEXTS 5
  31. #define MAX_SEGMENTS 8
  32. #define SEG_LVL_ALT_Q 0
  33. #define SEG_LVL_ALT_L 1
  34. #define SEG_LVL_REF_FRAME 2
  35. #define SEG_LVL_SKIP 3
  36. #define SEG_LVL_MAX 4
  37. #define BLOCK_TYPES 2
  38. #define REF_TYPES 2
  39. #define COEF_BANDS 6
  40. #define PREV_COEF_CONTEXTS 6
  41. #define UNCONSTRAINED_NODES 3
  42. #define TX_SIZE_CONTEXTS 2
  43. #define SWITCHABLE_FILTERS 3
  44. #define INTERP_FILTER_CONTEXTS 4
  45. #define SKIP_CONTEXTS 3
  46. #define PARTITION_TYPES 4
  47. #define TX_SIZES 4
  48. #define TX_MODES 5
  49. #define MB_MODE_COUNT 14
  50. #define INTRA_MODES 10
  51. #define INTER_MODES 4
  52. #define INTER_MODE_CONTEXTS 7
  53. #define MV_JOINTS 4
  54. #define MV_CLASSES 11
  55. #define CLASS0_SIZE 2
  56. #define MV_OFFSET_BITS 10
  57. #define MAX_PROB 255
  58. #define MAX_MODE_LF_DELTAS 2
  59. #define COMPANDED_MVREF_THRESH 8
  60. #define MAX_LOOP_FILTER 63
  61. #define REF_SCALE_SHIFT 14
  62. // Number of bits of precision when performing inter prediction.
  63. #define SUBPEL_BITS 4
  64. #define SUBPEL_SHIFTS 16
  65. #define SUBPEL_MASK 15
  66. #define MV_BORDER 128
  67. // Value used when clipping motion vectors.
  68. #define INTERP_EXTEND 4
  69. // Value used when clipping motion vectors.
  70. #define BORDERINPIXELS 160
  71. #define MAX_UPDATE_FACTOR 128
  72. #define COUNT_SAT 20
  73. #define BOTH_ZERO 0
  74. #define ZERO_PLUS_PREDICTED 1
  75. #define BOTH_PREDICTED 2
  76. #define NEW_PLUS_NON_INTRA 3
  77. #define BOTH_NEW 4
  78. #define INTRA_PLUS_NON_INTRA 5
  79. #define BOTH_INTRA 6
  80. #define INVALID_CASE 9
  81. }