jpeg_priv.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * This program is free software; you can redistribute it and/or
  3. * modify it under the terms of the GNU General Public License
  4. * as published by the Free Software Foundation; either version 2
  5. * of the License, or (at your option) any later version.
  6. * This program is distributed in the hope that it will be useful,
  7. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. * GNU General Public License for more details.
  10. *
  11. * You should have received a copy of the GNU General Public License
  12. * along with this program; if not, write to the Free Software
  13. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  14. * MA 02110-1301, USA.
  15. *
  16. * Name:
  17. * ark_jpeg_priv.h
  18. *
  19. * Description:
  20. *
  21. *
  22. * Author:
  23. * Sim
  24. *
  25. * Remarks:
  26. *
  27. */
  28. #ifndef __ARK_JPEG_PRIV_H__
  29. #define __ARK_JPEG_PRIV_H__
  30. /*************************************************************************
  31. * Definitions and macros
  32. *************************************************************************/
  33. typedef struct {
  34. unsigned int width;
  35. unsigned int height;
  36. unsigned int *buf;
  37. unsigned int data_format;
  38. } PIC_INFO;
  39. typedef struct {
  40. int width;
  41. int height;
  42. int format;
  43. } SoftJpegHeaderInfo;
  44. typedef struct {
  45. unsigned char Cs;
  46. unsigned char Td;
  47. unsigned char Ta;
  48. } JPEG_SOS_NS_PARA;
  49. typedef struct {
  50. unsigned short Ls;
  51. unsigned char Ns;
  52. unsigned char Ss;
  53. unsigned char Se;
  54. unsigned char Ah;
  55. unsigned char Ai;
  56. JPEG_SOS_NS_PARA SOS_NS_PARA[4];
  57. } JPEG_SOS_PARA;
  58. typedef struct {
  59. unsigned char C;
  60. unsigned char H;
  61. unsigned char V;
  62. unsigned char Tq;
  63. } JPEG_SOF_NS_PARA;
  64. typedef struct {
  65. unsigned short Lf;
  66. unsigned char P;
  67. unsigned short Y;
  68. unsigned short X;
  69. unsigned char Nf;
  70. unsigned char Colspctype;
  71. JPEG_SOF_NS_PARA SOF_NS_PARA[255];
  72. } JPEG_SOF_PARA;
  73. typedef struct {
  74. unsigned int restart_interval;
  75. unsigned int restart_flag;
  76. } JPEG_DRI_PARA;
  77. typedef struct {
  78. unsigned int wAddr1;
  79. unsigned int wSize1;
  80. unsigned int wAddr2;
  81. unsigned int wSize2;
  82. unsigned int wAddr3;
  83. unsigned int wSize3;
  84. } JpegStartAddr;
  85. #define ARKPRESCAL_WORKMODE_VIDEO 0
  86. #define ARKPRESCAL_WORKMODE_HONLY 1
  87. #define ARKPRESCAL_WORKMODE_VONLY 2
  88. #define ARKPRESCAL_WORKMODE_MIX 3
  89. #define ARKPRESCAL_FORMAT_RGB 0
  90. #define ARKPRESCAL_FORMAT_YUV 1
  91. #define ARKPRESCAL_FORMAT_YUV422 2
  92. #define ARKPRESCAL_FORMAT_Y_U_V420 3
  93. #define ARKPRESCAL_FORMAT_Y_UV420 4
  94. #define ARKPRESCAL_HFORMAT_RGB 0
  95. #define ARKPRESCAL_HFORMAT_YUV 1
  96. #define ARKPRESCAL_HFORMAT_YUV422 3
  97. #define ARKPRESCAL_VFORMAT_YUV422 0
  98. #define ARKPRESCAL_VFORMAT_Y_U_V420 2
  99. #define ARKPRESCAL_VFORMAT_Y_UV420 3
  100. struct ark_prescale_cfg_arg {
  101. unsigned int src_addr;
  102. unsigned int dst_addr;
  103. unsigned int hv_addr1;
  104. unsigned int hv_addr2;
  105. unsigned int hv_addr3;
  106. unsigned int src_width;
  107. unsigned int src_height;
  108. unsigned int dst_width;
  109. unsigned int dst_height;
  110. unsigned int block_height;
  111. unsigned int left_blank;
  112. unsigned int right_blank;
  113. unsigned int up_blank;
  114. unsigned int down_blank;
  115. unsigned int hori_format;
  116. unsigned int vert_format;
  117. };
  118. /*************************************************************************
  119. * Functions
  120. *************************************************************************/
  121. /* core functions */
  122. int ark_jpeg_reg_check(struct ark_jpeg_context *context);
  123. int ark_jpeg_dev_init(struct ark_jpeg_context *context);
  124. irqreturn_t ark_jpeg_intr_handler(int irq, void *dev_id);
  125. irqreturn_t ark_prescale_intr_handler(int irq, void *dev_id);
  126. void re_scaler(JPEG_DECODE_OPT * dec);
  127. int get_part_pic(struct part_pic *pic);
  128. void JpegPicDec(void);
  129. bool JpegHeaderIntHandler(void);
  130. bool JpegFrameIntHandler(void);
  131. bool JpegBufferIntHandler(void);
  132. bool JpegBlockIntHandler(void);
  133. void JpegContinueWork(void);
  134. #endif //#ifndef __ARK_JPEG_PRIV_H__