Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2011
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.76 KB | None | 0 0
  1. //! Slice
  2. typedef struct slice
  3. {
  4. struct video_par *p_Vid;
  5. struct inp_par *p_Inp;
  6. pic_parameter_set_rbsp_t *active_pps;
  7. seq_parameter_set_rbsp_t *active_sps;
  8. int svc_extension_flag;
  9.  
  10. // dpb pointer
  11. struct decoded_picture_buffer *p_Dpb;
  12.  
  13. //slice property;
  14. int idr_flag;
  15. int idr_pic_id;
  16. int nal_reference_idc; //!< nal_reference_idc from NAL unit
  17. int Transform8x8Mode;
  18. Boolean is_not_independent;
  19.  
  20. int toppoc; //poc for this top field // POC200301
  21. int bottompoc; //poc of bottom field of frame
  22. int framepoc; //poc of this frame // POC200301
  23.  
  24. //the following is for slice header syntax elements of poc
  25. // for poc mode 0.
  26. unsigned int pic_order_cnt_lsb;
  27. int delta_pic_order_cnt_bottom;
  28. // for poc mode 1.
  29. int delta_pic_order_cnt[2];
  30.  
  31. // ////////////////////////
  32. // for POC mode 0:
  33. signed int PicOrderCntMsb;
  34.  
  35. //signed int PrevPicOrderCntMsb;
  36. //unsigned int PrevPicOrderCntLsb;
  37.  
  38. // for POC mode 1:
  39. unsigned int AbsFrameNum;
  40. int ThisPOC;
  41. //signed int ExpectedPicOrderCnt, PicOrderCntCycleCnt, FrameNumInPicOrderCntCycle;
  42. //unsigned int PreviousFrameNum, FrameNumOffset;
  43. //int ExpectedDeltaPerPicOrderCntCycle;
  44. //int PreviousFrameNumOffset;
  45. // /////////////////////////
  46.  
  47. //information need to move to slice;
  48. unsigned int current_mb_nr; // bitstream order
  49. unsigned int num_dec_mb;
  50. short current_slice_nr;
  51. //int mb_x;
  52. //int mb_y;
  53. //int block_x;
  54. //int block_y;
  55. //int pix_c_x;
  56. //int pix_c_y;
  57. int cod_counter; //!< Current count of number of skipped macroblocks in a row
  58. int allrefzero;
  59. //end;
  60.  
  61. int mb_aff_frame_flag;
  62. int direct_spatial_mv_pred_flag; //!< Indicator for direct mode type (1 for Spatial, 0 for Temporal)
  63. int num_ref_idx_active[2]; //!< number of available list references
  64. //int num_ref_idx_l0_active; //!< number of available list 0 references
  65. //int num_ref_idx_l1_active; //!< number of available list 1 references
  66.  
  67. int ei_flag; //!< 0 if the partArr[0] contains valid information
  68. int qp;
  69. int slice_qp_delta;
  70. int qs;
  71. int slice_qs_delta;
  72. int slice_type; //!< slice type
  73. int model_number; //!< cabac model number
  74. unsigned int frame_num; //frame_num for this frame
  75. unsigned int field_pic_flag;
  76. byte bottom_field_flag;
  77. PictureStructure structure; //!< Identify picture structure type
  78. int start_mb_nr; //!< MUST be set by NAL even in case of ei_flag == 1
  79. int end_mb_nr_plus1;
  80. int max_part_nr;
  81. int dp_mode; //!< data partitioning mode
  82. int current_header;
  83. int next_header;
  84. int last_dquant;
  85.  
  86. //slice header information;
  87. int colour_plane_id; //!< colour_plane_id of the current coded slice
  88. int redundant_pic_cnt;
  89. int sp_switch; //!< 1 for switching sp, 0 for normal sp
  90. int slice_group_change_cycle;
  91. int redundant_slice_ref_idx; //!< reference index of redundant slice
  92. int no_output_of_prior_pics_flag;
  93. int long_term_reference_flag;
  94. int adaptive_ref_pic_buffering_flag;
  95. DecRefPicMarking_t *dec_ref_pic_marking_buffer; //!< stores the memory management control operations
  96.  
  97. char listXsize[6];
  98. struct storable_picture **listX[6];
  99.  
  100. // int last_mb_nr; //!< only valid when entropy coding == CABAC
  101. DataPartition *partArr; //!< array of partitions
  102. MotionInfoContexts *mot_ctx; //!< pointer to struct of context models for use in CABAC
  103. TextureInfoContexts *tex_ctx; //!< pointer to struct of context models for use in CABAC
  104.  
  105. int mvscale[6][MAX_REFERENCE_PICTURES];
  106.  
  107. int ref_pic_list_reordering_flag[2];
  108.  
  109. //dave modifying
  110. //int *reordering_of_pic_nums_idc[2];
  111. //int *abs_diff_pic_num_minus1[2];
  112. //int *long_term_pic_idx[2];
  113.  
  114. int reordering_of_pic_nums_idc[2][10];
  115. int abs_diff_pic_num_minus1[2][10];
  116. int long_term_pic_idx[2][10];
  117.  
  118. #if (MVC_EXTENSION_ENABLE) //dave add
  119. //int *abs_diff_view_idx_minus1[2];
  120. int abs_diff_view_idx_minus1[2][10];
  121.  
  122. int view_id;
  123. int inter_view_flag;
  124. int anchor_pic_flag;
  125.  
  126. NALUnitHeaderMVCExt_t NaluHeaderMVCExt;
  127. #endif
  128.  
  129. short DFDisableIdc; //!< Disable deblocking filter on slice
  130. short DFAlphaC0Offset; //!< Alpha and C0 offset for filtering slice
  131. short DFBetaOffset; //!< Beta offset for filtering slice
  132.  
  133. int pic_parameter_set_id; //!<the ID of the picture parameter set the slice is reffering to
  134.  
  135. int dpB_NotPresent; //!< non-zero, if data partition B is lost
  136. int dpC_NotPresent; //!< non-zero, if data partition C is lost
  137.  
  138. Boolean is_reset_coeff;
  139.  
  140. //dave modifying the following
  141. //imgpel ***mb_pred;
  142. imgpel *mb_pred[MAX_PLANE][MB_BLOCK_SIZE]; //3, 16, 16;
  143.  
  144.  
  145. //imgpel ***mb_rec;
  146. imgpel *mb_rec[MAX_PLANE][MB_BLOCK_SIZE]; //3, 16, 6
  147.  
  148. //int ***mb_rres;
  149. int *mb_rres[MAX_PLANE][MB_BLOCK_SIZE]; //3, 16, 6
  150.  
  151. //int ***cof;
  152. int *cof[MAX_PLANE][MB_BLOCK_SIZE]; //3, 16, 16
  153.  
  154. int ***fcf;
  155.  
  156. int cofu[16];
  157.  
  158. imgpel **tmp_block_l0;
  159. imgpel **tmp_block_l1;
  160. int **tmp_res;
  161. imgpel **tmp_block_l2;
  162. imgpel **tmp_block_l3;
  163.  
  164. // Scaling matrix info
  165. int InvLevelScale4x4_Intra[3][6][4][4];
  166. int InvLevelScale4x4_Inter[3][6][4][4];
  167. int InvLevelScale8x8_Intra[3][6][8][8];
  168. int InvLevelScale8x8_Inter[3][6][8][8];
  169.  
  170. int *qmatrix[12];
  171.  
  172. // Cabac
  173. int coeff[64]; // one more for EOB
  174. int coeff_ctr;
  175. int pos;
  176.  
  177.  
  178. //weighted prediction
  179. unsigned short weighted_pred_flag;
  180. unsigned short weighted_bipred_idc;
  181.  
  182. unsigned short luma_log2_weight_denom;
  183. unsigned short chroma_log2_weight_denom;
  184.  
  185. //dave modify
  186. //int ***wp_weight; // weight in [list][index][component] order; // int wp_weight[2][64][3];//
  187. //int ***wp_offset; // offset in [list][index][component] order; //int wp_offset[2][64][3];//
  188. //int ****wbp_weight; //weight in [list][fw_index][bw_index][component] order
  189.  
  190. int wp_weight[2][32][3]; // weight in [list][index][component] order; // int wp_weight[2][64][3];//
  191. int wp_offset[6][32][3]; // offset in [list][index][component] order; //int wp_offset[6][64][3];//
  192. int wbp_weight[6][32][32][3]; //weight in [list][fw_index][bw_index][component] order
  193.  
  194. short wp_round_luma;
  195. short wp_round_chroma;
  196.  
  197. #if (MVC_EXTENSION_ENABLE)
  198. int listinterviewidx0;
  199. int listinterviewidx1;
  200. struct frame_store **fs_listinterview0;
  201. struct frame_store **fs_listinterview1;
  202. #endif
  203.  
  204. // for signalling to the neighbour logic that this is a deblocker call
  205. //byte mixedModeEdgeFlag;
  206. int max_mb_vmv_r; //!< maximum vertical motion vector range in luma quarter pixel units for the current level_idc
  207. int ref_flag[17]; //!< 0: i-th previous frame is incorrect
  208.  
  209. void (*read_CBP_and_coeffs_from_NAL) (Macroblock *currMB);
  210. int (*decode_one_component ) (Macroblock *currMB, ColorPlane curr_plane, imgpel **currImg, struct storable_picture *dec_picture);
  211. int (*readSlice ) (struct video_par *, struct inp_par *);
  212. int (*nal_startcode_follows ) (struct slice*, int );
  213. void (*read_motion_info_from_NAL) (Macroblock *currMB);
  214. //void (*read_one_macroblock ) (Macroblock *currMB);
  215. int (*read_one_macroblock ) (Macroblock *currMB);
  216. void (*interpret_mb_mode ) (Macroblock *currMB);
  217.  
  218. //void (*init_lists ) (struct slice *currSlice); //original
  219. int (*init_lists ) (struct slice *currSlice);
  220.  
  221. void (*intrapred_chroma ) (Macroblock *currMB);
  222. void (*linfo_cbp_intra ) (int len, int info, int *cbp, int *dummy);
  223. void (*linfo_cbp_inter ) (int len, int info, int *cbp, int *dummy);
  224. void (*update_direct_mv_info ) (Macroblock *currMB);
  225. int erc_mvperMB;
  226. Macroblock *mb_data;
  227. struct storable_picture *dec_picture;
  228.  
  229. //dave modifying
  230. int **siblock;
  231. //byte **ipredmode;
  232.  
  233. //int *siblock[9];
  234. byte *ipredmode[36]; //[36][44];
  235. /////////////////
  236.  
  237. char *intra_block;
  238. char chroma_vector_adjustment[6][16];
  239. } Slice;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement