vpp.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * AMLOGIC Audio/Video streaming port driver.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the named License,
  7. * or any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
  17. *
  18. * Author: Tim Yao <timyao@amlogic.com>
  19. *
  20. */
  21. #ifndef VPP_H
  22. #define VPP_H
  23. #define VPP_FLAG_WIDEMODE_MASK 0x00000007
  24. #define VPP_FLAG_INTERLACE_OUT 0x00000010
  25. #define VPP_FLAG_INTERLACE_IN 0x00000020
  26. #define VPP_FLAG_CBCR_SEPARATE 0x00000040
  27. #define VPP_FLAG_ZOOM_SHORTSIDE 0x00000080
  28. #define VPP_FLAG_AR_MASK 0x0003ff00
  29. #define VPP_FLAG_AR_BITS 8
  30. #define VPP_FLAG_PORTRAIT_MODE 0x00040000
  31. #define IDX_H (2 << 8)
  32. #define IDX_V_Y (1 << 13)
  33. #define IDX_V_CBCR ((1 << 13) | (1 << 8))
  34. #define ASPECT_4_3 ((3<<8)/4)
  35. #define ASPECT_16_9 ((9<<8)/16)
  36. typedef enum {
  37. F2V_IT2IT = 0,
  38. F2V_IB2IB,
  39. F2V_IT2IB,
  40. F2V_IB2IT,
  41. F2V_P2IT,
  42. F2V_P2IB,
  43. F2V_IT2P,
  44. F2V_IB2P,
  45. F2V_P2P,
  46. F2V_TYPE_MAX
  47. } f2v_vphase_type_t; /* frame to video conversion type */
  48. typedef struct {
  49. s8 repeat_skip;
  50. u8 phase;
  51. } f2v_vphase_t;
  52. typedef struct {
  53. u32 vpp_hf_start_phase_step;
  54. u32 vpp_hf_start_phase_slope;
  55. u32 vpp_hf_end_phase_slope;
  56. const u32 *vpp_vert_coeff;
  57. const u32 *vpp_horz_coeff;
  58. u32 vpp_sc_misc_;
  59. u32 vpp_vsc_start_phase_step;
  60. u32 vpp_hsc_start_phase_step;
  61. } vppfilter_mode_t;
  62. typedef struct {
  63. vppfilter_mode_t *top;
  64. vppfilter_mode_t *bottom;
  65. } vpp_filters_t;
  66. typedef struct {
  67. u32 VPP_hd_start_lines_;
  68. u32 VPP_hd_end_lines_;
  69. u32 VPP_vd_start_lines_;
  70. u32 VPP_vd_end_lines_;
  71. u32 VPP_vsc_startp;
  72. u32 VPP_vsc_endp;
  73. u32 VPP_hsc_startp;
  74. u32 VPP_hsc_linear_startp;
  75. u32 VPP_hsc_linear_endp;
  76. u32 VPP_hsc_endp;
  77. u32 VPP_hf_ini_phase_;
  78. f2v_vphase_t VPP_vf_ini_phase_[9];
  79. u32 VPP_pic_in_height_;
  80. u32 VPP_line_in_length_;
  81. u32 VPP_post_blend_vd_v_start_;
  82. u32 VPP_post_blend_vd_v_end_;
  83. u32 VPP_post_blend_vd_h_start_;
  84. u32 VPP_post_blend_vd_h_end_;
  85. u32 VPP_post_blend_h_size_;
  86. vppfilter_mode_t vpp_filter;
  87. u32 VPP_postproc_misc_;
  88. u32 vscale_skip_count;
  89. } vpp_frame_par_t;
  90. extern void
  91. vpp_set_filters(u32 wide_mode, vframe_t * vf,
  92. vpp_frame_par_t * next_frame_par, const vinfo_t *vinfo);
  93. extern void
  94. vpp_set_video_layer_position(s32 x, s32 y, s32 w, s32 h);
  95. extern void
  96. vpp_get_video_layer_position(s32 *x, s32 *y, s32 *w, s32 *h);
  97. extern void
  98. vpp_set_global_offset(s32 x, s32 y);
  99. extern void
  100. vpp_get_global_offset(s32 *x, s32 *y);
  101. extern void
  102. vpp_set_zoom_ratio(u32 r);
  103. extern u32
  104. vpp_get_zoom_ratio(void);
  105. extern void
  106. vpp_set_osd_layer_preblend(u32*);
  107. extern
  108. void vpp_set_osd_layer_position(s32*);
  109. #ifdef CONFIG_AM_VIDEO2
  110. extern void
  111. vpp2_set_filters(u32 wide_mode, vframe_t * vf,
  112. vpp_frame_par_t * next_frame_par, const vinfo_t *vinfo);
  113. extern void
  114. vpp2_set_video_layer_position(s32 x, s32 y, s32 w, s32 h);
  115. extern void
  116. vpp2_get_video_layer_position(s32 *x, s32 *y, s32 *w, s32 *h);
  117. extern void
  118. vpp2_set_zoom_ratio(u32 r);
  119. extern u32
  120. vpp2_get_zoom_ratio(void);
  121. #endif
  122. #endif /* VPP_H */