1
0

block.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /*!
  2. ************************************************************************
  3. * \file block.h
  4. *
  5. * \brief
  6. * definitions for block decoding functions
  7. *
  8. * \author
  9. * Inge Lille-Langoy <[email protected]> \n
  10. * Telenor Satellite Services \n
  11. * P.O.Box 6914 St.Olavs plass \n
  12. * N-0130 Oslo, Norway
  13. *
  14. ************************************************************************
  15. */
  16. #ifndef _BLOCK_H_
  17. #define _BLOCK_H_
  18. #include "global.h"
  19. #include "transform8x8.h"
  20. static const byte QP_SCALE_CR[52]=
  21. {
  22. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,
  23. 12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,
  24. 28,29,29,30,31,32,32,33,34,34,35,35,36,36,37,37,
  25. 37,38,38,38,39,39,39,39
  26. };
  27. //! look up tables for FRExt_chroma support
  28. static const unsigned char subblk_offset_x[3][8][4] =
  29. {
  30. {
  31. {0, 4, 0, 4},
  32. {0, 4, 0, 4},
  33. {0, 0, 0, 0},
  34. {0, 0, 0, 0},
  35. {0, 0, 0, 0},
  36. {0, 0, 0, 0},
  37. {0, 0, 0, 0},
  38. {0, 0, 0, 0},
  39. },
  40. {
  41. {0, 4, 0, 4},
  42. {0, 4, 0, 4},
  43. {0, 4, 0, 4},
  44. {0, 4, 0, 4},
  45. {0, 0, 0, 0},
  46. {0, 0, 0, 0},
  47. {0, 0, 0, 0},
  48. {0, 0, 0, 0},
  49. },
  50. {
  51. {0, 4, 0, 4},
  52. {8,12, 8,12},
  53. {0, 4, 0, 4},
  54. {8,12, 8,12},
  55. {0, 4, 0, 4},
  56. {8,12, 8,12},
  57. {0, 4, 0, 4},
  58. {8,12, 8,12}
  59. }
  60. };
  61. static const unsigned char subblk_offset_y[3][8][4] =
  62. {
  63. {
  64. {0, 0, 4, 4},
  65. {0, 0, 4, 4},
  66. {0, 0, 0, 0},
  67. {0, 0, 0, 0},
  68. {0, 0, 0, 0},
  69. {0, 0, 0, 0},
  70. {0, 0, 0, 0},
  71. {0, 0, 0, 0}
  72. },
  73. {
  74. {0, 0, 4, 4},
  75. {8, 8,12,12},
  76. {0, 0, 4, 4},
  77. {8, 8,12,12},
  78. {0, 0, 0, 0},
  79. {0, 0, 0, 0},
  80. {0, 0, 0, 0},
  81. {0, 0, 0, 0}
  82. },
  83. {
  84. {0, 0, 4, 4},
  85. {0, 0, 4, 4},
  86. {8, 8,12,12},
  87. {8, 8,12,12},
  88. {0, 0, 4, 4},
  89. {0, 0, 4, 4},
  90. {8, 8,12,12},
  91. {8, 8,12,12}
  92. }
  93. };
  94. static const byte decode_block_scan[16] = {0, 1, 4, 5, 2, 3, 6, 7, 8, 9, 12, 13, 10, 11, 14, 15};
  95. static const int cof4_pos_to_subblock[4][4] = { { 0, 1, 4, 5}, {2,3,6,7}, {8,9,12,13}, {10,11,14,15} };
  96. extern void iMBtrans4x4(Macroblock *currMB, ColorPlane pl, int smb);
  97. extern void iMBtrans8x8(Macroblock *currMB, ColorPlane pl);
  98. extern void itrans_sp_cr(Macroblock *currMB, int uv);
  99. extern void intrapred_chroma (Macroblock *currMB, int uv);
  100. extern void Inv_Residual_trans_4x4(Macroblock *currMB, ColorPlane pl, int ioff, int joff);
  101. extern void Inv_Residual_trans_8x8(Macroblock *currMB, ColorPlane pl, int ioff,int joff);
  102. extern void itrans4x4_c(const h264_short_block_t tblock, const h264_imgpel_macroblock_t mb_pred, h264_imgpel_macroblock_t mb_rec, int pos_x, int pos_y);
  103. extern void itrans4x4_mmx(const h264_short_block_t tblock, const h264_imgpel_macroblock_t mb_pred, h264_imgpel_macroblock_t mb_rec, int pos_x, int pos_y);
  104. extern int intrapred (Macroblock *currMB, ColorPlane pl, int ioff,int joff,int i4,int j4);
  105. extern void itrans_2 (Macroblock *currMB, ColorPlane pl);
  106. extern void iTransform (Macroblock *currMB, ColorPlane pl, int smb);
  107. extern void copy_image_data (imgpel **imgBuf1, imgpel **imgBuf2, int dest_x, int src_x, int width, int height);
  108. extern void copy_image_data_16x16 (imgpel **imgBuf1, imgpel **imgBuf2, int dest_x, int src_x);
  109. extern void copy_image_data_16x16_stride_c(struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source);
  110. extern void copy_image_data_16x16_stride_sse(struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source);
  111. extern void copy_image_data_8x8_stride (struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source);
  112. extern void copy_image_data_8x8_stride2 (struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source, int src_x, int src_y);
  113. extern void copy_image_data_4x4_stride (struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source, int src_x, int src_y);
  114. extern void copy_image_data_stride (struct video_image *destination, int dest_x, int dest_y, const h264_imgpel_macroblock_t source, int width, int height);
  115. #endif