1
0

elements.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*!
  2. *************************************************************************************
  3. * \file elements.h
  4. *
  5. * \brief
  6. * Header file for elements in H.264 streams
  7. *
  8. * \date
  9. * 6.10.2000
  10. *
  11. * \version
  12. * 1.0
  13. *
  14. * \author
  15. * Sebastian Purreiter <[email protected]> \n
  16. * Siemens AG, Information and Communication Mobile \n
  17. * P.O.Box 80 17 07 \n
  18. * D-81617 Munich, Germany \n
  19. *************************************************************************************
  20. */
  21. #ifndef _ELEMENTS_H_
  22. #define _ELEMENTS_H_
  23. /*!
  24. * definition of H.264 syntax elements
  25. * order of elements follow dependencies for picture reconstruction
  26. */
  27. /*!
  28. * \brief Assignment of old TYPE partition elements to new
  29. * elements
  30. *
  31. * old element | new elements
  32. * ----------------+-------------------------------------------------------------------
  33. * TYPE_HEADER | SE_HEADER, SE_PTYPE
  34. * TYPE_MBHEADER | SE_MBTYPE, SE_REFFRAME, SE_INTRAPREDMODE
  35. * TYPE_MVD | SE_MVD
  36. * TYPE_CBP | SE_CBP_INTRA, SE_CBP_INTER
  37. * SE_DELTA_QUANT_INTER
  38. * SE_DELTA_QUANT_INTRA
  39. * TYPE_COEFF_Y | SE_LUM_DC_INTRA, SE_LUM_AC_INTRA, SE_LUM_DC_INTER, SE_LUM_AC_INTER
  40. * TYPE_2x2DC | SE_CHR_DC_INTRA, SE_CHR_DC_INTER
  41. * TYPE_COEFF_C | SE_CHR_AC_INTRA, SE_CHR_AC_INTER
  42. * TYPE_EOS | SE_EOS
  43. */
  44. #define SE_HEADER 0
  45. #define SE_PTYPE 1
  46. #define SE_MBTYPE 2
  47. #define SE_REFFRAME 3
  48. #define SE_INTRAPREDMODE 4
  49. #define SE_MVD 5
  50. #define SE_CBP_INTRA 6
  51. #define SE_LUM_DC_INTRA 7
  52. #define SE_CHR_DC_INTRA 8
  53. #define SE_LUM_AC_INTRA 9
  54. #define SE_CHR_AC_INTRA 10
  55. #define SE_CBP_INTER 11
  56. #define SE_LUM_DC_INTER 12
  57. #define SE_CHR_DC_INTER 13
  58. #define SE_LUM_AC_INTER 14
  59. #define SE_CHR_AC_INTER 15
  60. #define SE_DELTA_QUANT_INTER 16
  61. #define SE_DELTA_QUANT_INTRA 17
  62. #define SE_BFRAME 18
  63. #define SE_EOS 19
  64. #define SE_MAX_ELEMENTS 20
  65. #define NO_EC 0 //!< no error concealment necessary
  66. #define EC_REQ 1 //!< error concealment required
  67. #define EC_SYNC 2 //!< search and sync on next header element
  68. #define MAXPARTITIONMODES 2 //!< maximum possible partition modes as defined in assignSE2partition[][]
  69. /*!
  70. * \brief lookup-table to assign different elements to partition
  71. *
  72. * \note here we defined up to 6 different partitions similar to
  73. * document Q15-k-18 described in the PROGFRAMEMODE.
  74. * The Sliceheader contains the PSYNC information. \par
  75. *
  76. * Elements inside a partition are not ordered. They are
  77. * ordered by occurence in the stream.
  78. * Assumption: Only partitionlosses are considered. \par
  79. *
  80. * The texture elements luminance and chrominance are
  81. * not ordered in the progressive form
  82. * This may be changed in image.c \par
  83. *
  84. * We also defined the proposed internet partition mode
  85. * of Stephan Wenger here. To select the desired mode
  86. * uncomment one of the two following lines. \par
  87. *
  88. * -IMPORTANT:
  89. * Picture- or Sliceheaders must be assigned to partition 0. \par
  90. * Furthermore partitions must follow syntax dependencies as
  91. * outlined in document Q15-J-23.
  92. */
  93. static const byte assignSE2partition[][SE_MAX_ELEMENTS] =
  94. {
  95. // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 // element number (do not uncomment)
  96. { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, //!< all elements in one partition no data partitioning
  97. { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 2, 2, 2, 2, 0, 0, 0, 0 } //!< three partitions per slice
  98. };
  99. #endif