mask xy scale, mask boundary only overlay, fix 8 char mask nm bug, rework maskgui...
[goodguy/cinelerra.git] / cinelerra-5.1 / libzmpeg3 / nav.h
1 #ifndef __NAV_H__
2 #define __NAV_H__
3
4 uint8_t dsi[NAV_DSI_BYTES];
5 uint8_t pci[NAV_PCI_BYTES];
6
7 /* DSI General Information */
8 uint32_t dsi_gi_pck_scr() { return get4bytes(dsi + 0x0000); }
9 /* sector address of this nav pack */
10 uint32_t dsi_gi_pck_lbn() { return get4bytes(dsi + 0x0004); }
11 /* end address of this VOBU */
12 uint32_t dsi_gi_vobu_ea() { return get4bytes(dsi + 0x0008); }
13 /* end address of the 1st,2nd,3rd reference image */
14 uint32_t dsi_gi_vobu_1stref_ea() { return get4bytes(dsi + 0x000c); }
15 uint32_t dsi_gi_vobu_2ndref_ea() { return get4bytes(dsi + 0x0010); }
16 uint32_t dsi_gi_vobu_3rdref_ea() { return get4bytes(dsi + 0x0014); }
17 /* VOB Id number in which this VOBU exists */
18 uint32_t dsi_gi_vobu_vob_idn() { return get2bytes(dsi + 0x0018); }
19 /* Cell Id number in which this VOBU exists */
20 uint32_t dsi_gi_vobu_c_idn() { return *(dsi + 0x001b); }
21 /* Cell elapsed time, dvd_time_t */
22 uint32_t dsi_gi_elaped_time() { return get4bytes(dsi + 0x001c); }
23 /* Seamless Playback Information, stp/gap occurs 8 times */
24 uint32_t dsi_sp_category() { return get2bytes(dsi + 0x0020); }
25 /* end address of interleaved Unit */
26 uint32_t dsi_sp_ilvu_ea() { return get4bytes(dsi + 0x0022); }
27 /* start address of next interleaved unit */
28 uint32_t dsi_sp_ilvu_sa() { return get4bytes(dsi + 0x0026); }
29 /* size of next interleaved unit */
30 uint32_t dsi_sp_size() { return get2bytes(dsi + 0x002a); }
31 /* video start ptm in vob */
32 uint32_t dsi_sp_vob_v_s_s_ptm() { return get4bytes(dsi + 0x002c); }
33 /* video end ptm in vob */
34 uint32_t dsi_sp_vob_v_e_e_ptm() { return get4bytes(dsi + 0x0030); }
35 uint32_t dsi_sp_stp_ptm1(int i) { return get4bytes(dsi + 0x0034 + 16*i); }
36 uint32_t dsi_sp_stp_ptm2(int i) { return get4bytes(dsi + 0x0038 + 16*i); }
37 uint32_t dsi_sp_gap_len1(int i) { return get4bytes(dsi + 0x003c + 16*i); }
38 uint32_t dsi_sp_gap_len2(int i) { return get4bytes(dsi + 0x0040 + 16*i); }
39 /* Seamless Angle Information, occurs 9 times */
40 /* offset to next ILVU, high bit is before/after */
41 uint32_t dsi_sa_address(int i) { return get4bytes(dsi + 0x00b4 + 6*i); }
42 /* byte size of the ILVU pointed to by address */
43 uint32_t dsi_sa_size(int i) { return get4bytes(dsi + 0x00b8 + 6*i); }
44 /* VOBU Search Information, fwda occurs 19 times, bwda occurs 19 times */
45 /* Next vobu that contains video */
46 uint32_t dsi_si_next_video() { return get4bytes(dsi + 0x00ea); }
47 /* Forwards, time */
48 uint32_t dsi_si_fwda(int i) { return get4bytes(dsi + 0x00ee + 4*i); }
49 uint32_t dsi_si_next_vobu() { return get4bytes(dsi + 0x13a); }
50 uint32_t dsi_si_prev_vobu() { return get4bytes(dsi + 0x13e); }
51 /* Backwards, time */
52 uint32_t dsi_si_bwda(int i) { return get4bytes(dsi + 0x142 + 4*i); }
53 uint32_t dsi_si_prev_video() { return get4bytes(dsi + 0x18e); }
54 /* Synchronous Information, sy_a occurs 8 times, sy_sp occurs 32 times */
55 /* offset to first audio packet for this VOBU */
56 uint32_t dsi_sy_a_synca(int i) { return get2bytes(dsi + 0x192 + 4*i); }
57 /* offset to first subpicture packet */
58 uint32_t dsi_sy_sp_synca(int i) { return get4bytes(dsi + 0x1a2 + 4*i); }
59
60
61 /* PCI General Information */
62 /* sector address of this nav pack */
63 uint32_t pci_gi_pck_lbn() { return get4bytes(pci + 0x00); }
64 /* category of vobu */
65 uint32_t pci_gi_vobu_cat() { return get2bytes(pci + 0x04); }
66 /* UOP of vobu */
67 uint32_t pci_gi_vobu_uop_ctl() { return get4bytes(pci + 0x08); }
68 /* start presentation time of vobu */
69 uint32_t pci_gi_vobu_s_ptm() { return get4bytes(pci + 0x0c); }
70 /* end presentation time of vobu */
71 uint32_t pci_gi_vobu_e_ptm() { return get4bytes(pci + 0x10); }
72 /* end ptm of sequence end in vobu */
73 uint32_t pci_gi_vobu_se_e_ptm() { return get4bytes(pci + 0x14); }
74 /* Cell elapsed time */
75 uint32_t pci_gi_e_eltm() { return get4bytes(pci + 0x18); }
76 uint8_t *pci_gi_vobu_isrc() { return pci + 0x1c; }
77 /* Non Seamless Angle Information, occurs 9 times */
78 uint32_t pci_nsml_agl_dsta(int i) { return get4bytes(pci + 0x3c + 4*i); }
79 /* Highlight General Information */
80 /* status, 0:no btns, 1:!= 2:== 3:== except for btn cmds */
81 uint32_t pci_hgi_ss() { return get2bytes(pci + 0x60) & 0x3; }
82 /* start ptm of hli */
83 uint32_t pci_hgi_s_ptm() { return get4bytes(pci + 0x62); }
84 /* end ptm of hli */
85 uint32_t pci_hgi_e_ptm() { return get4bytes(pci + 0x66); }
86 /* end ptm of button select */
87 uint32_t pci_hgi_btn_se_e_ptm() { return get4bytes(pci + 0x6a); }
88 /* number of button groups 1, 2 or 3 with 36/18/12 buttons */
89 uint32_t pci_hgi_btngr_ns() { return (*(pci+0x6e)>>4) & 0x03; }
90 /* display type of subpic stream for button group 1 */
91 uint32_t pci_hgi_btngr1_dsp_ty() { return (*(pci+0x6e)>>0) & 0x07; }
92 /* display type of subpic stream for button group 2 */
93 uint32_t pci_hgi_btngr2_dsp_ty() { return (*(pci+0x6f)>>4) & 0x07; }
94 /* display type of subpic stream for button group 3 */
95 uint32_t pci_hgi_btngr3_dsp_ty() { return (*(pci+0x6f)>>0) & 0x07; }
96 /* button offset number range 0-255 */
97 uint32_t pci_hgi_btn_ofn() { return *(pci + 0x70); }
98 /* number of valid buttons  <= 36/18/12 */
99 uint32_t pci_hgi_btn_ns() { return *(pci + 0x71) & 0x3f; }
100 /* number of buttons selectable by U_BTNNi, nsl_btn_ns <= btn_ns */
101 uint32_t pci_hgi_nsl_btn_ns() { return *(pci + 0x72) & 0x3f; }
102 /**< forcedly selected button */
103 uint32_t pci_hgi_fosl_btnn() { return *(pci + 0x74) & 0x3f; }
104 /**< forcedly activated button */
105 uint32_t pci_hgi_foac_btnn() { return *(pci + 0x75) & 0x3f; }
106 /* color occurs 3 times, action occurs 2 times */
107 /*  each of first 4 nibs refs pgc palette, next 4 nibs are alphas */
108 uint32_t pci_btn_coli(int c,int i) { return get4bytes(pci + 0x76 + 8*c+4*i); }
109 /* Button Information, occurs 36 times */
110 uint32_t pci_btn_coln(int i) { /* button color number */
111   return (*(pci + 0x8e + 18*i)>>6) & 0x03;
112 }
113 uint32_t pci_btn_x_start(int i) { /* x start offset within the overlay */
114   uint8_t *p = pci + 0x8e + 18*i;
115   return (((p[0]<<8) + p[1])>>4) & 0x3ff;
116 }
117 uint32_t pci_btn_x_end(int i) { /* x end offset within the overlay */
118   uint8_t *p = pci + 0x8f + 18*i;
119   return ((p[0]<<8) + p[1]) & 0x3ff;
120 }
121 uint32_t pci_btn_auto_action_mode(int i) { /* 0:no, 1:armed if selected */
122   return (*(pci + 0x91 + 18*i)>>6) & 0x03;
123 }
124 uint32_t pci_btn_y_start(int i) { /**< y start offset within the overlay */
125   uint8_t *p = pci + 0x91 + 18*i;
126   return (((p[0]<<8) + p[1])>>4) & 0x3ff;
127 }
128 uint32_t pci_btn_y_end(int i) { /* y end offset within the overlay */
129   uint8_t *p = pci + 0x93 + 18*i;
130   return ((p[0]<<8) + p[1]) & 0x3ff;
131 }
132 /* button index when pressing up */
133 uint32_t pci_btn_up(int i) { return (*(pci + 0x94 + 18*i)>>0) & 0x3f; }
134 /* button index when pressing down */
135 uint32_t pci_btn_down(int i) { return (*(pci + 0x95 + 18*i)>>0) & 0x3f; }
136 /* button index when pressing left */
137 uint32_t pci_btn_left(int i) { return (*(pci + 0x96 + 18*i)>>0) & 0x3f; }
138 /* button index when pressing right */
139 uint32_t pci_btn_right(int i) { return (*(pci + 0x97 + 18*i)>>0) & 0x3f; }
140 /* command executed by button (8 bytes) */
141 uint8_t *pci_btn_cmd(int i) { return pci + 0x98 + 18*i; }
142
143 #endif