aom.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
  3. *
  4. * This source code is subject to the terms of the BSD 2 Clause License and
  5. * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
  6. * was not distributed with this source code in the LICENSE file, you can
  7. * obtain it at www.aomedia.org/license/software. If the Alliance for Open
  8. * Media Patent License 1.0 was not distributed with this source code in the
  9. * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
  10. */
  11. /*!\defgroup aom AOM
  12. * \ingroup codecs
  13. * AOM is aom's newest video compression algorithm that uses motion
  14. * compensated prediction, Discrete Cosine Transform (DCT) coding of the
  15. * prediction error signal and context dependent entropy coding techniques
  16. * based on arithmetic principles. It features:
  17. * - YUV 4:2:0 image format
  18. * - Macro-block based coding (16x16 luma plus two 8x8 chroma)
  19. * - 1/4 (1/8) pixel accuracy motion compensated prediction
  20. * - 4x4 DCT transform
  21. * - 128 level linear quantizer
  22. * - In loop deblocking filter
  23. * - Context-based entropy coding
  24. *
  25. * @{
  26. */
  27. /*!\file
  28. * \brief Provides controls common to both the AOM encoder and decoder.
  29. */
  30. #ifndef AOM_AOM_AOM_H_
  31. #define AOM_AOM_AOM_H_
  32. #include "aom/aom_codec.h"
  33. #include "aom/aom_image.h"
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. /*!\brief Control functions
  38. *
  39. * The set of macros define the control functions of AOM interface
  40. * The range for common control IDs is 230-255(max).
  41. */
  42. enum aom_com_control_id {
  43. /*!\brief Codec control function to get a pointer to a reference frame
  44. *
  45. * av1_ref_frame_t* parameter
  46. */
  47. AV1_GET_REFERENCE = 230,
  48. /*!\brief Codec control function to write a frame into a reference buffer
  49. *
  50. * av1_ref_frame_t* parameter
  51. */
  52. AV1_SET_REFERENCE = 231,
  53. /*!\brief Codec control function to get a copy of reference frame from the
  54. * decoder
  55. *
  56. * av1_ref_frame_t* parameter
  57. */
  58. AV1_COPY_REFERENCE = 232,
  59. /*!\brief Codec control function to get a pointer to the new frame
  60. *
  61. * aom_image_t* parameter
  62. */
  63. AV1_GET_NEW_FRAME_IMAGE = 233,
  64. /*!\brief Codec control function to copy the new frame to an external buffer
  65. *
  66. * aom_image_t* parameter
  67. */
  68. AV1_COPY_NEW_FRAME_IMAGE = 234,
  69. /*!\brief Start point of control IDs for aom_dec_control_id.
  70. * Any new common control IDs should be added above.
  71. */
  72. AOM_DECODER_CTRL_ID_START = 256
  73. // No common control IDs should be added after AOM_DECODER_CTRL_ID_START.
  74. };
  75. /*!\brief AV1 specific reference frame data struct
  76. *
  77. * Define the data struct to access av1 reference frames.
  78. */
  79. typedef struct av1_ref_frame {
  80. int idx; /**< frame index to get (input) */
  81. int use_external_ref; /**< Directly use external ref buffer(decoder only) */
  82. aom_image_t img; /**< img structure to populate (output) */
  83. } av1_ref_frame_t;
  84. /*!\cond */
  85. /*!\brief aom decoder control function parameter type
  86. *
  87. * Defines the data type for each of AOM decoder control function requires.
  88. *
  89. * \note For each control ID "X", a macro-define of
  90. * AOM_CTRL_X is provided. It is used at compile time to determine
  91. * if the control ID is supported by the libaom library available,
  92. * when the libaom version cannot be controlled.
  93. */
  94. AOM_CTRL_USE_TYPE(AV1_GET_REFERENCE, av1_ref_frame_t *)
  95. #define AOM_CTRL_AV1_GET_REFERENCE
  96. AOM_CTRL_USE_TYPE(AV1_SET_REFERENCE, av1_ref_frame_t *)
  97. #define AOM_CTRL_AV1_SET_REFERENCE
  98. AOM_CTRL_USE_TYPE(AV1_COPY_REFERENCE, av1_ref_frame_t *)
  99. #define AOM_CTRL_AV1_COPY_REFERENCE
  100. AOM_CTRL_USE_TYPE(AV1_GET_NEW_FRAME_IMAGE, aom_image_t *)
  101. #define AOM_CTRL_AV1_GET_NEW_FRAME_IMAGE
  102. AOM_CTRL_USE_TYPE(AV1_COPY_NEW_FRAME_IMAGE, aom_image_t *)
  103. #define AOM_CTRL_AV1_COPY_NEW_FRAME_IMAGE
  104. /*!\endcond */
  105. /*! @} - end defgroup aom */
  106. #ifdef __cplusplus
  107. } // extern "C"
  108. #endif
  109. #endif // AOM_AOM_AOM_H_