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.

119 lines
3.6KB

  1. /*
  2. * AVS3 related definitions
  3. *
  4. * Copyright (C) 2020 Huiwen Ren, <hwrenx@gmail.com>
  5. *
  6. * This file is part of FFmpeg.
  7. *
  8. * FFmpeg is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2.1 of the License, or (at your option) any later version.
  12. *
  13. * FFmpeg is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with FFmpeg; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #ifndef AVCODEC_AVS3_H
  23. #define AVCODEC_AVS3_H
  24. #define AVS3_NAL_START_CODE 0x010000
  25. #define AVS3_SEQ_START_CODE 0xB0
  26. #define AVS3_SEQ_END_CODE 0xB1
  27. #define AVS3_USER_DATA_START_CODE 0xB2
  28. #define AVS3_INTRA_PIC_START_CODE 0xB3
  29. #define AVS3_UNDEF_START_CODE 0xB4
  30. #define AVS3_EXTENSION_START_CODE 0xB5
  31. #define AVS3_INTER_PIC_START_CODE 0xB6
  32. #define AVS3_VIDEO_EDIT_CODE 0xB7
  33. #define AVS3_FIRST_SLICE_START_CODE 0x00
  34. #define AVS3_PROFILE_BASELINE_MAIN 0x20
  35. #define AVS3_PROFILE_BASELINE_MAIN10 0x22
  36. #define AVS3_ISPIC(x) ((x) == AVS3_INTRA_PIC_START_CODE || (x) == AVS3_INTER_PIC_START_CODE)
  37. #define AVS3_ISUNIT(x) ((x) == AVS3_SEQ_START_CODE || AVS3_ISPIC(x))
  38. #include "libavutil/avutil.h"
  39. #include "libavutil/pixfmt.h"
  40. #include "libavutil/rational.h"
  41. static const AVRational ff_avs3_frame_rate_tab[16] = {
  42. { 0 , 0 }, // forbid
  43. { 24000, 1001},
  44. { 24 , 1 },
  45. { 25 , 1 },
  46. { 30000, 1001},
  47. { 30 , 1 },
  48. { 50 , 1 },
  49. { 60000, 1001},
  50. { 60 , 1 },
  51. { 100 , 1 },
  52. { 120 , 1 },
  53. { 200 , 1 },
  54. { 240 , 1 },
  55. { 300 , 1 },
  56. { 0 , 0 }, // reserved
  57. { 0 , 0 } // reserved
  58. };
  59. static const int ff_avs3_color_primaries_tab[10] = {
  60. AVCOL_PRI_RESERVED0 , // 0
  61. AVCOL_PRI_BT709 , // 1
  62. AVCOL_PRI_UNSPECIFIED , // 2
  63. AVCOL_PRI_RESERVED , // 3
  64. AVCOL_PRI_BT470M , // 4
  65. AVCOL_PRI_BT470BG , // 5
  66. AVCOL_PRI_SMPTE170M , // 6
  67. AVCOL_PRI_SMPTE240M , // 7
  68. AVCOL_PRI_FILM , // 8
  69. AVCOL_PRI_BT2020 // 9
  70. };
  71. static const int ff_avs3_color_transfer_tab[15] = {
  72. AVCOL_TRC_RESERVED0 , // 0
  73. AVCOL_TRC_BT709 , // 1
  74. AVCOL_TRC_UNSPECIFIED , // 2
  75. AVCOL_TRC_RESERVED , // 3
  76. AVCOL_TRC_GAMMA22 , // 4
  77. AVCOL_TRC_GAMMA28 , // 5
  78. AVCOL_TRC_SMPTE170M , // 6
  79. AVCOL_TRC_SMPTE240M , // 7
  80. AVCOL_TRC_LINEAR , // 8
  81. AVCOL_TRC_LOG , // 9
  82. AVCOL_TRC_LOG_SQRT , // 10
  83. AVCOL_TRC_BT2020_12 , // 11
  84. AVCOL_TRC_SMPTE2084 , // 12
  85. AVCOL_TRC_UNSPECIFIED , // 13
  86. AVCOL_TRC_ARIB_STD_B67 // 14
  87. };
  88. static const int ff_avs3_color_matrix_tab[12] = {
  89. AVCOL_SPC_RESERVED , // 0
  90. AVCOL_SPC_BT709 , // 1
  91. AVCOL_SPC_UNSPECIFIED , // 2
  92. AVCOL_SPC_RESERVED , // 3
  93. AVCOL_SPC_FCC , // 4
  94. AVCOL_SPC_BT470BG , // 5
  95. AVCOL_SPC_SMPTE170M , // 6
  96. AVCOL_SPC_SMPTE240M , // 7
  97. AVCOL_SPC_BT2020_NCL , // 8
  98. AVCOL_SPC_BT2020_CL , // 9
  99. AVCOL_SPC_UNSPECIFIED , // 10
  100. AVCOL_SPC_UNSPECIFIED // 11
  101. };
  102. static const enum AVPictureType ff_avs3_image_type[4] = {
  103. AV_PICTURE_TYPE_NONE,
  104. AV_PICTURE_TYPE_I,
  105. AV_PICTURE_TYPE_P,
  106. AV_PICTURE_TYPE_B
  107. };
  108. #endif /* AVCODEC_AVS3_H */