Symbols.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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_NEIGHBORS 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 BLOCK_TYPES 2
  33. #define REF_TYPES 2
  34. #define COEF_BANDS 6
  35. #define PREV_COEF_CONTEXTS 6
  36. #define UNCONSTRAINED_NODES 3
  37. #define TX_SIZE_CONTEXTS 2
  38. #define SWITCHABLE_FILTERS 3
  39. #define INTERP_FILTER_CONTEXTS 4
  40. #define SKIP_CONTEXTS 3
  41. #define PARTITION_TYPES 4
  42. #define TX_SIZES 4
  43. #define TX_MODES 5
  44. #define MB_MODE_COUNT 14
  45. #define INTRA_MODES 10
  46. #define INTER_MODES 4
  47. #define INTER_MODE_CONTEXTS 7
  48. #define MV_JOINTS 4
  49. #define MV_CLASSES 11
  50. #define CLASS0_SIZE 2
  51. #define MV_OFFSET_BITS 10
  52. #define MAX_PROB 255
  53. #define MAX_MODE_LF_DELTAS 2
  54. #define COMPANDED_MVREF_THRESH 8
  55. #define MAX_LOOP_FILTER 63
  56. #define REF_SCALE_SHIFT 14
  57. // Number of bits of precision when performing inter prediction.
  58. #define SUBPEL_BITS 4
  59. #define SUBPEL_SHIFTS 16
  60. #define SUBPEL_MASK 15
  61. #define MV_BORDER 128
  62. // Value used when clipping motion vectors.
  63. #define INTERP_EXTEND 4
  64. // Value used when clipping motion vectors.
  65. #define BORDERINPIXELS 160
  66. #define MAX_UPDATE_FACTOR 128
  67. #define COUNT_SAT 20
  68. #define BOTH_ZERO 0
  69. #define ZERO_PLUS_PREDICTED 1
  70. #define BOTH_PREDICTED 2
  71. #define NEW_PLUS_NON_INTRA 3
  72. #define BOTH_NEW 4
  73. #define INTRA_PLUS_NON_INTRA 5
  74. #define BOTH_INTRA 6
  75. #define INVALID_CASE 9
  76. }