viddec.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:3k
源码类别:

DVD

开发平台:

C/C++

  1. #ifndef __VIDDEC_H
  2. #define __VIDDEC_H
  3. #include "types.h"
  4. #ifndef EXTERN
  5. #define EXTERN extern
  6. #endif
  7. /*
  8. ** sequence_info
  9. */
  10. typedef struct {
  11.     UINT16  horizontal_size_value;
  12.     UINT16  vertical_size_value;
  13.     UINT32  bit_rate_value;                     // bit_rate_extension
  14.     UINT32  vbv_buffer_size_value;              // vbv_buffer_size_extension
  15.     UINT8   mpeg2_flag;                         // 
  16.     UINT8   constrained_parameters_flag;        //
  17.     UINT8   aspect_ratio_information;
  18.     UINT8   frame_rate_code;
  19. // The following is for MP4 only.    
  20.     UINT8   mp4_type;
  21. UINT16 vld_pkt_hdr;
  22. UINT16 vld_vol_hdr;
  23. UINT16 vld_vop_hdr;   
  24. UINT16 vld_gob_num;
  25. UINT16 invq_vol_hdr;     
  26. } t_seq_info;
  27. EXTERN t_seq_info seq_info;
  28. EXTERN UINT8 back_wait_copy;
  29. EXTERN UINT8 back_field_cntr;
  30. #ifdef  SUPPORT_SLOWBACKWARD
  31. //
  32. // SLOW_BACKWARD
  33. EXTERN UINT8 back_st;
  34. EXTERN UINT8 back_finished;
  35. EXTERN UINT8 back_vobu_cntr;         // 
  36. EXTERN UINT8 back_vobu_ref_cntr;
  37. EXTERN INT8 back_cntr;
  38. EXTERN INT8 back_cntr_all;          // 
  39. #define PICIF 72
  40. EXTERN UINT8 picif_cntr;
  41. EXTERN UINT8 picif[PICIF];
  42. #endif
  43. // option
  44. #define PIC_RESET_VIDEO (1<<7)
  45. #define PIC_VALID (1<<6)
  46. #define PIC_HLEXIST (1<<5)
  47. #define PIC_FIRST (1<<4)
  48. #define PIC_MPEG4 (1<<3)
  49. #define PIC_MPEG2 (1<<2)
  50. #define PIC_CHK_DTS (1<<1)
  51. #define PIC_CHK_PTS (1<<0)
  52. // mpeg2 flag
  53. #define ISO_MPEG2 (1<<0)
  54. #define ISO_MPEG4 (1<<1)
  55. //
  56. // LINE21
  57. // see DVD spec. part 3., 5.4.1.4
  58. //
  59. #define LINE21_SIZE 128
  60. EXTERN INT8    line21_dumping;
  61. EXTERN INT8    line21_decoding;
  62. EXTERN UINT8   line21_data_rp;
  63. EXTERN UINT8   line21_data_wp;
  64. EXTERN UINT8   line21_data[3*LINE21_SIZE]; // 128-fields line21 buffers
  65. // dump
  66. EXTERN UINT8   line21_d[3]; // 4-byte parsing line21 buffers
  67. EXTERN UINT8   line21_dump_num; // l21 dump 
  68. EXTERN UINT8   line21_dump_cnt; // l21 dump pointer
  69. EXTERN INT8    line21_f;
  70. EXTERN UINT8   line21_flag;
  71. // decode
  72. EXTERN UINT8   line21_now; // flag to send L21
  73. // 
  74. #define VPP_PAUSE_AUTO 0
  75. #define VPP_PAUSE_FRAME 1
  76. #define VPP_PAUSE_FIELD 2
  77. EXTERN UINT8   vpp_pause_operation;
  78. #define ext0_progressive_frame(x) ((x) & RF_CODING_EXT0_PROGRESSIVE_FRAME)
  79. #define ext0_repeat_first_field(x) ((x) & RF_CODING_EXT0_REPEAT_FIRST_FIELD)
  80. #define ext0_top_field_first(x) ((x) & RF_CODING_EXT0_TOP_FIELD_FIRST)
  81. #define ext0_second_field(x) ((x) & RF_CODING_EXT0_SECOND_FIELD)
  82. EXTERN UINT8   SML_CNTR;
  83. EXTERN UINT8   SML_CNTR_NOW;
  84. //
  85. //
  86. //
  87. #define avd_get_decode_mode() (mode_decode)
  88. #define get_disbuf()     get_disbuf_now()
  89. #define viddec_terminate() (regs0->vld_ctrl=1)
  90. #define viddec_block_sw(n) (regs0->agdc_mon_ubound = 1|((n)<<1))
  91. #define viddec_block_hw() (regs0->agdc_mon_ubound = 0)
  92. #define viddec_block_on() viddec_block_sw(1)
  93. #define viddec_block_off() viddec_block_sw(0)
  94. int get_disbuf_now();
  95. int get_disbuf_set();
  96. void set_disbuf(int);
  97. void set_disbuf_now(int);
  98. int wait_disbuf_sync(void);
  99. void init_video_decoder();
  100. void reset_video_decoder();
  101. int wait_decode_finish(int timeout);
  102. void setup_sequence_info(t_seq_info *p);
  103. void save_sequence_info(t_seq_info *d);
  104. //void copy_sequence_info(t_seq_info *d, t_seq_info *s);
  105. #define copy_sequence_info(d, s)    memcpy((void *)(d), (void *)(s), sizeof (t_seq_info))
  106. void resync_picture_state(void);
  107. #define reset_viddec_pause_flag() (viddec_paused=0)
  108. #define is_viddec_paused() (viddec_paused)
  109. #endif