You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

518 lines
15KB

  1. // ISO/IEC 14496-1:2010(E)
  2. // Annex I: Usage of ITU-T Recommendation H.264 | ISO/IEC 14496-10 AVC (p150)
  3. //
  4. // 1. Start Codes shall not be present in the stream. The field indicating the size of each following NAL unit
  5. // shall be added before NAL unit.The size of this field is defined in DecoderSpecificInfo.
  6. // 2. It is recommended encapsulating one NAL unit in one SL packet when it is delivered over lossy environment.
  7. #include "mpeg4-avc.h"
  8. #include <string.h>
  9. #include <assert.h>
  10. #include <stdint.h>
  11. #include <stddef.h>
  12. #define H264_NAL_IDR 5 // Coded slice of an IDR picture
  13. #define H264_NAL_SPS 7 // Sequence parameter set
  14. #define H264_NAL_PPS 8 // Picture parameter set
  15. #define H264_NAL_AUD 9 // Access unit delimiter
  16. #define H2645_BITSTREAM_FORMAT_DETECT
  17. struct h264_annexbtomp4_handle_t
  18. {
  19. struct mpeg4_avc_t* avc;
  20. int errcode;
  21. int* update; // avc sps/pps update flags
  22. int* vcl;
  23. uint8_t* out;
  24. size_t bytes;
  25. size_t capacity;
  26. };
  27. static const uint8_t* h264_startcode(const uint8_t *data, size_t bytes)
  28. {
  29. size_t i;
  30. for (i = 2; i + 1 < bytes; i++)
  31. {
  32. if (0x01 == data[i] && 0x00 == data[i - 1] && 0x00 == data[i - 2])
  33. return data + i + 1;
  34. }
  35. return NULL;
  36. }
  37. /// @return >0-ok, <=0-error
  38. static inline int h264_avcc_length(const uint8_t* h264, size_t bytes, size_t avcc)
  39. {
  40. size_t i;
  41. uint32_t n;
  42. n = 0;
  43. assert(3 <= avcc && avcc <= 4);
  44. for (i = 0; i < avcc && i < bytes; i++)
  45. n = (n << 8) | h264[i];
  46. return avcc >= bytes ? -1 : (int)n;
  47. }
  48. /// @return 1-true, 0-false
  49. static int mpeg4_h264_avcc_bitstream_valid(const uint8_t* h264, size_t bytes, size_t avcc)
  50. {
  51. size_t n;
  52. while(avcc + 1 < bytes)
  53. {
  54. n = h264_avcc_length(h264, bytes, avcc);
  55. if (n < 0 || n + avcc > bytes)
  56. return 0; // invalid
  57. h264 += n + avcc;
  58. bytes -= n + avcc;
  59. }
  60. return 0 == bytes ? 1 : 0;
  61. }
  62. /// @return 0-annexb, >0-avcc, <0-error
  63. int mpeg4_h264_bitstream_format(const uint8_t* h264, size_t bytes)
  64. {
  65. uint32_t n;
  66. if (bytes < 4)
  67. return -1;
  68. n = ((uint32_t)h264[0]) << 16 | ((uint32_t)h264[1]) << 8 | ((uint32_t)h264[2]);
  69. if (0 == n && h264[3] <= 1)
  70. {
  71. return 0; // annexb
  72. }
  73. else if(1 == n)
  74. {
  75. // try avcc & annexb
  76. return mpeg4_h264_avcc_bitstream_valid(h264, bytes, 4) ? 4 : 0;
  77. }
  78. else
  79. {
  80. // try avcc 4/3 bytes
  81. return mpeg4_h264_avcc_bitstream_valid(h264, bytes, 4) ? 4 : (mpeg4_h264_avcc_bitstream_valid(h264, bytes, 3) ? 3 : -1);
  82. }
  83. }
  84. static int mpeg4_h264_avcc_nalu(const void* h264, size_t bytes, int avcc, void (*handler)(void* param, const uint8_t* nalu, size_t bytes), void* param)
  85. {
  86. uint32_t n;
  87. const uint8_t* p, * end;
  88. p = (const uint8_t*)h264;
  89. end = (const uint8_t*)h264 + bytes;
  90. for(n = h264_avcc_length(p, (int)(end - p), avcc); p + n + avcc <= end; n = h264_avcc_length(p, (int)(end - p), avcc))
  91. {
  92. assert(n > 0);
  93. if (n > 0)
  94. {
  95. handler(param, p + avcc, (int)n);
  96. }
  97. p += n + avcc;
  98. }
  99. return 0;
  100. }
  101. ///@param[in] h264 H.264 byte stream format data(A set of NAL units)
  102. int mpeg4_h264_annexb_nalu(const void* h264, size_t bytes, void (*handler)(void* param, const uint8_t* nalu, size_t bytes), void* param)
  103. {
  104. ptrdiff_t n;
  105. const uint8_t* p, *next, *end;
  106. #if defined(H2645_BITSTREAM_FORMAT_DETECT)
  107. int avcc;
  108. avcc = mpeg4_h264_bitstream_format(h264, bytes);
  109. if (avcc > 0)
  110. return mpeg4_h264_avcc_nalu(h264, bytes, avcc, handler, param);
  111. #endif
  112. end = (const uint8_t*)h264 + bytes;
  113. p = h264_startcode((const uint8_t*)h264, bytes);
  114. while (p)
  115. {
  116. next = h264_startcode(p, (int)(end - p));
  117. if (next)
  118. {
  119. n = next - p - 3;
  120. }
  121. else
  122. {
  123. n = end - p;
  124. }
  125. while (n > 0 && 0 == p[n - 1]) n--; // filter tailing zero
  126. assert(n > 0);
  127. if (n > 0)
  128. {
  129. handler(param, p, (int)n);
  130. }
  131. p = next;
  132. }
  133. return 0;
  134. }
  135. uint8_t mpeg4_h264_read_ue(const uint8_t* data, size_t bytes, size_t* offset)
  136. {
  137. int bit, i;
  138. int leadingZeroBits = -1;
  139. for (bit = 0; !bit && *offset / 8 < bytes; ++leadingZeroBits)
  140. {
  141. bit = (data[*offset / 8] >> (7 - (*offset % 8))) & 0x01;
  142. ++*offset;
  143. }
  144. bit = 0;
  145. assert(leadingZeroBits < 32);
  146. for (i = 0; i < leadingZeroBits && *offset / 8 < bytes; i++)
  147. {
  148. bit = (bit << 1) | ((data[*offset / 8] >> (7 - (*offset % 8))) & 0x01);
  149. ++*offset;
  150. }
  151. return (uint8_t)((1 << leadingZeroBits) - 1 + bit);
  152. }
  153. static void mpeg4_avc_remove(struct mpeg4_avc_t* avc, uint8_t* ptr, size_t bytes, const uint8_t* end)
  154. {
  155. uint8_t i;
  156. assert(ptr >= avc->data && ptr + bytes <= end && end <= avc->data + sizeof(avc->data));
  157. memmove(ptr, ptr + bytes, end - ptr - bytes);
  158. for (i = 0; i < avc->nb_sps; i++)
  159. {
  160. if (avc->sps[i].data > ptr)
  161. avc->sps[i].data -= bytes;
  162. }
  163. for (i = 0; i < avc->nb_pps; i++)
  164. {
  165. if (avc->pps[i].data > ptr)
  166. avc->pps[i].data -= bytes;
  167. }
  168. }
  169. static int h264_sps_copy(struct mpeg4_avc_t* avc, const uint8_t* nalu, size_t bytes)
  170. {
  171. size_t i;
  172. size_t offset;
  173. uint8_t spsid;
  174. if (bytes < 4 + 1)
  175. {
  176. assert(0);
  177. return -1; // invalid length
  178. }
  179. offset = 4 * 8; // 1-NALU + 3-profile+flags+level
  180. spsid = mpeg4_h264_read_ue(nalu, bytes, &offset);
  181. for (i = 0; i < avc->nb_sps; i++)
  182. {
  183. offset = 4 * 8; // reset offset
  184. if (spsid == mpeg4_h264_read_ue(avc->sps[i].data, avc->sps[i].bytes, &offset))
  185. {
  186. if (bytes == avc->sps[i].bytes && 0 == memcmp(nalu, avc->sps[i].data, bytes))
  187. return 0; // do nothing
  188. if (bytes > avc->sps[i].bytes && avc->off + (bytes - avc->sps[i].bytes) > sizeof(avc->data))
  189. {
  190. assert(0);
  191. return -1; // too big
  192. }
  193. mpeg4_avc_remove(avc, avc->sps[i].data, avc->sps[i].bytes, avc->data + avc->off);
  194. avc->off -= avc->sps[i].bytes;
  195. avc->sps[i].data = avc->data + avc->off;
  196. avc->sps[i].bytes = (uint16_t)bytes;
  197. memcpy(avc->sps[i].data, nalu, bytes);
  198. avc->off += bytes;
  199. return 1; // set update flag
  200. }
  201. }
  202. // copy new
  203. assert(avc->nb_sps < sizeof(avc->sps) / sizeof(avc->sps[0]));
  204. if (avc->nb_sps >= sizeof(avc->sps) / sizeof(avc->sps[0])
  205. || avc->off + bytes > sizeof(avc->data))
  206. {
  207. assert(0);
  208. return -1;
  209. }
  210. avc->sps[avc->nb_sps].data = avc->data + avc->off;
  211. avc->sps[avc->nb_sps].bytes = (uint16_t)bytes;
  212. memcpy(avc->sps[avc->nb_sps].data, nalu, bytes);
  213. avc->off += bytes;
  214. ++avc->nb_sps;
  215. return 1; // set update flag
  216. }
  217. static int h264_pps_copy(struct mpeg4_avc_t* avc, const uint8_t* nalu, size_t bytes)
  218. {
  219. size_t i;
  220. size_t offset;
  221. uint8_t spsid;
  222. uint8_t ppsid;
  223. if (bytes < 1 + 1)
  224. {
  225. assert(0);
  226. return -1; // invalid length
  227. }
  228. offset = 1 * 8; // 1-NALU
  229. ppsid = mpeg4_h264_read_ue(nalu, bytes, &offset);
  230. spsid = mpeg4_h264_read_ue(nalu, bytes, &offset);
  231. for (i = 0; i < avc->nb_pps; i++)
  232. {
  233. offset = 1 * 8; // reset offset
  234. if (ppsid == mpeg4_h264_read_ue(avc->pps[i].data, avc->pps[i].bytes, &offset) && spsid == mpeg4_h264_read_ue(avc->pps[i].data, avc->pps[i].bytes, &offset))
  235. {
  236. if (bytes == avc->pps[i].bytes && 0 == memcmp(nalu, avc->pps[i].data, bytes))
  237. return 0; // do nothing
  238. if (bytes > avc->pps[i].bytes && avc->off + (bytes - avc->pps[i].bytes) > sizeof(avc->data))
  239. {
  240. assert(0);
  241. return -1; // too big
  242. }
  243. mpeg4_avc_remove(avc, avc->pps[i].data, avc->pps[i].bytes, avc->data + avc->off);
  244. avc->off -= avc->pps[i].bytes;
  245. avc->pps[i].data = avc->data + avc->off;
  246. avc->pps[i].bytes = (uint16_t)bytes;
  247. memcpy(avc->pps[i].data, nalu, bytes);
  248. avc->off += bytes;
  249. return 1; // set update flag
  250. }
  251. }
  252. // fix openh264 sps/pps id cycle (0/0, 1/1, 2/2, ..., 31/31, 0/32, 1/33, ...)
  253. if ((unsigned int)avc->nb_pps + 1 >= sizeof(avc->pps) / sizeof(avc->pps[0]) && avc->nb_sps > 16)
  254. {
  255. // replace the oldest pps
  256. mpeg4_avc_remove(avc, avc->pps[0].data, avc->pps[0].bytes, avc->data + avc->off);
  257. avc->off -= avc->pps[0].bytes;
  258. avc->pps[0].data = avc->data + avc->off;
  259. avc->pps[0].bytes = (uint16_t)bytes;
  260. memcpy(avc->pps[0].data, nalu, bytes);
  261. avc->off += bytes;
  262. return 1; // set update flag
  263. }
  264. // copy new
  265. assert((unsigned int)avc->nb_pps + 1 < sizeof(avc->pps) / sizeof(avc->pps[0]));
  266. if ((unsigned int)avc->nb_pps + 1 >= sizeof(avc->pps) / sizeof(avc->pps[0])
  267. || avc->off + bytes > sizeof(avc->data))
  268. {
  269. assert(0);
  270. return -1;
  271. }
  272. avc->pps[avc->nb_pps].data = avc->data + avc->off;
  273. avc->pps[avc->nb_pps].bytes = (uint16_t)bytes;
  274. memcpy(avc->pps[avc->nb_pps].data, nalu, bytes);
  275. avc->off += bytes;
  276. ++avc->nb_pps; // fixme: uint8_t overflow
  277. return 1; // set update flag
  278. }
  279. int mpeg4_avc_update(struct mpeg4_avc_t* avc, const uint8_t* nalu, size_t bytes)
  280. {
  281. int r;
  282. switch (nalu[0] & 0x1f)
  283. {
  284. case H264_NAL_SPS:
  285. r = h264_sps_copy(avc, nalu, bytes);
  286. if (1 == r || 1 == avc->nb_sps)
  287. {
  288. // update profile/level
  289. avc->profile = nalu[1];
  290. avc->compatibility = nalu[2];
  291. avc->level = nalu[3];
  292. }
  293. break;
  294. case H264_NAL_PPS:
  295. r = h264_pps_copy(avc, nalu, bytes);
  296. break;
  297. default:
  298. r = 0;
  299. }
  300. return r;
  301. }
  302. static void h264_handler(void* param, const uint8_t* nalu, size_t bytes)
  303. {
  304. int r;
  305. uint8_t nalutype;
  306. struct h264_annexbtomp4_handle_t* mp4;
  307. mp4 = (struct h264_annexbtomp4_handle_t*)param;
  308. if (bytes < 1)
  309. {
  310. assert(0);
  311. return;
  312. }
  313. nalutype = (nalu[0]) & 0x1f;
  314. #if defined(H2645_FILTER_AUD)
  315. if (H264_NAL_AUD == nalutype)
  316. return; // ignore AUD
  317. #endif
  318. r = mpeg4_avc_update(mp4->avc, nalu, bytes);
  319. if (1 == r && mp4->update)
  320. *mp4->update = 1;
  321. else if (r < 0)
  322. mp4->errcode = r;
  323. // IDR-1, B/P-2, other-0
  324. if (mp4->vcl && 1 <= nalutype && nalutype <= H264_NAL_IDR)
  325. *mp4->vcl = nalutype == H264_NAL_IDR ? 1 : 2;
  326. if (mp4->capacity >= mp4->bytes + bytes + 4)
  327. {
  328. mp4->out[mp4->bytes + 0] = (uint8_t)((bytes >> 24) & 0xFF);
  329. mp4->out[mp4->bytes + 1] = (uint8_t)((bytes >> 16) & 0xFF);
  330. mp4->out[mp4->bytes + 2] = (uint8_t)((bytes >> 8) & 0xFF);
  331. mp4->out[mp4->bytes + 3] = (uint8_t)((bytes >> 0) & 0xFF);
  332. memmove(mp4->out + mp4->bytes + 4, nalu, bytes);
  333. mp4->bytes += bytes + 4;
  334. }
  335. else
  336. {
  337. mp4->errcode = -1;
  338. }
  339. }
  340. int h264_annexbtomp4(struct mpeg4_avc_t* avc, const void* data, size_t bytes, void* out, size_t size, int* vcl, int* update)
  341. {
  342. struct h264_annexbtomp4_handle_t h;
  343. memset(&h, 0, sizeof(h));
  344. h.avc = avc;
  345. h.vcl = vcl;
  346. h.update = update;
  347. h.out = (uint8_t*)out;
  348. h.capacity = size;
  349. if (vcl) *vcl = 0;
  350. if (update) *update = 0;
  351. mpeg4_h264_annexb_nalu(data, bytes, h264_handler, &h);
  352. avc->nalu = 4;
  353. return 0 == h.errcode ? (int)h.bytes : 0;
  354. }
  355. /// h264_is_new_access_unit H.264 new access unit(frame)
  356. /// @return 1-new access, 0-not a new access
  357. int h264_is_new_access_unit(const uint8_t* nalu, size_t bytes)
  358. {
  359. enum { NAL_NIDR = 1, NAL_PARTITION_A = 2, NAL_IDR = 5, NAL_SEI = 6, NAL_SPS = 7, NAL_PPS = 8, NAL_AUD = 9, };
  360. uint8_t nal_type;
  361. if(bytes < 2)
  362. return 0;
  363. nal_type = nalu[0] & 0x1f;
  364. // 7.4.1.2.3 Order of NAL units and coded pictures and association to access units
  365. if(NAL_AUD == nal_type || NAL_SPS == nal_type || NAL_PPS == nal_type || NAL_SEI == nal_type || (14 <= nal_type && nal_type <= 18))
  366. return 1;
  367. // 7.4.1.2.4 Detection of the first VCL NAL unit of a primary coded picture
  368. if(NAL_NIDR == nal_type || NAL_PARTITION_A == nal_type || NAL_IDR == nal_type)
  369. {
  370. // Live555 H264or5VideoStreamParser::parse
  371. // The high-order bit of the byte after the "nal_unit_header" tells us whether it's
  372. // the start of a new 'access unit' (and thus the current NAL unit ends an 'access unit'):
  373. return (nalu[1] & 0x80) ? 1 : 0; // first_mb_in_slice
  374. }
  375. return 0;
  376. }
  377. #if defined(_DEBUG) || defined(DEBUG)
  378. static void mpeg4_h264_bitstream_format_test(void)
  379. {
  380. const uint8_t bs3[] = { 0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0xab,0xcd, };
  381. const uint8_t bs4[] = { 0x00,0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0xab,0xcd, };
  382. const uint8_t bs5[] = { 0x00,0x00,0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0xab,0xcd, };
  383. const uint8_t avcc3[] = { 0x00,0x00,0x06,0x67,0x42,0xe0,0x1e,0xab,0xcd, };
  384. const uint8_t avcc4[] = { 0x00,0x00,0x00,0x06,0x67,0x42,0xe0,0x1e,0xab,0xcd, };
  385. assert(0 == mpeg4_h264_bitstream_format(bs3, sizeof(bs3)));
  386. assert(0 == mpeg4_h264_bitstream_format(bs4, sizeof(bs4)));
  387. assert(0 == mpeg4_h264_bitstream_format(bs5, sizeof(bs5)));
  388. assert(3 == mpeg4_h264_bitstream_format(avcc3, sizeof(avcc3)));
  389. assert(4 == mpeg4_h264_bitstream_format(avcc4, sizeof(avcc4)));
  390. }
  391. static void mpeg4_annexbtomp4_test2(void)
  392. {
  393. const uint8_t sps[] = { 0x00,0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0xab,0xcd, };
  394. const uint8_t pps[] = { 0x00,0x00,0x00,0x01,0x28,0xce,0x3c,0x80 };
  395. const uint8_t sps1[] = { 0x00,0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0x4b,0xcd, 0x01 };
  396. const uint8_t pps1[] = { 0x00,0x00,0x00,0x01,0x28,0xce,0x3c,0x80, 0x01 };
  397. const uint8_t sps2[] = { 0x00,0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0xab };
  398. const uint8_t pps2[] = { 0x00,0x00,0x00,0x01,0x28,0xce,0x3c };
  399. int vcl, update;
  400. uint8_t buffer[128];
  401. struct mpeg4_avc_t avc;
  402. memset(&avc, 0, sizeof(avc));
  403. h264_annexbtomp4(&avc, sps, sizeof(sps), buffer, sizeof(buffer), &vcl, &update);
  404. assert(0 == vcl && 1 == update);
  405. h264_annexbtomp4(&avc, pps, sizeof(pps), buffer, sizeof(buffer), &vcl, &update);
  406. assert(0 == vcl && 1 == update && 1 == avc.nb_sps && avc.sps[0].bytes == sizeof(sps)-4 && 0 == memcmp(avc.sps[0].data, sps+4, sizeof(sps) - 4) && 1 == avc.nb_pps && avc.pps[0].bytes == sizeof(pps) - 4 && 0 == memcmp(avc.pps[0].data, pps+4, sizeof(pps) - 4));
  407. h264_annexbtomp4(&avc, sps1, sizeof(sps1), buffer, sizeof(buffer), &vcl, &update);
  408. assert(0 == vcl && 1 == update && 2 == avc.nb_sps && avc.sps[0].bytes == sizeof(sps) - 4 && avc.sps[1].bytes == sizeof(sps1) - 4 && 0 == memcmp(avc.sps[0].data, sps+4, sizeof(sps) - 4) && 0 == memcmp(avc.sps[1].data, sps1 + 4, sizeof(sps1) - 4) && 1 == avc.nb_pps && avc.pps[0].bytes == sizeof(pps) - 4 && 0 == memcmp(avc.pps[0].data, pps + 4, sizeof(pps) - 4));
  409. h264_annexbtomp4(&avc, pps1, sizeof(pps1), buffer, sizeof(buffer), &vcl, &update);
  410. assert(0 == vcl && 1 == update && 2 == avc.nb_sps && avc.sps[0].bytes == sizeof(sps) - 4 && avc.sps[1].bytes == sizeof(sps1) - 4 && 0 == memcmp(avc.sps[0].data, sps + 4, sizeof(sps) - 4) && 0 == memcmp(avc.sps[1].data, sps1 + 4, sizeof(sps1) - 4) && 1 == avc.nb_pps && avc.pps[0].bytes == sizeof(pps1) - 4 && 0 == memcmp(avc.pps[0].data, pps1 + 4, sizeof(pps1) - 4));
  411. h264_annexbtomp4(&avc, sps2, sizeof(sps2), buffer, sizeof(buffer), &vcl, &update);
  412. assert(0 == vcl && 1 == update && 2 == avc.nb_sps && avc.sps[0].bytes == sizeof(sps2) - 4 && avc.sps[1].bytes == sizeof(sps1) - 4 && 0 == memcmp(avc.sps[0].data, sps2 + 4, sizeof(sps2) - 4) && 0 == memcmp(avc.sps[1].data, sps1 + 4, sizeof(sps1) - 4) && 1 == avc.nb_pps && avc.pps[0].bytes == sizeof(pps1) - 4 && 0 == memcmp(avc.pps[0].data, pps1 + 4, sizeof(pps1) - 4));
  413. h264_annexbtomp4(&avc, pps2, sizeof(pps2), buffer, sizeof(buffer), &vcl, &update);
  414. assert(0 == vcl && 1 == update && 2 == avc.nb_sps && avc.sps[0].bytes == sizeof(sps2) - 4 && avc.sps[1].bytes == sizeof(sps1) - 4 && 0 == memcmp(avc.sps[0].data, sps2 + 4, sizeof(sps2) - 4) && 0 == memcmp(avc.sps[1].data, sps1 + 4, sizeof(sps1) - 4) && 1 == avc.nb_pps && avc.pps[0].bytes == sizeof(pps2) - 4 && 0 == memcmp(avc.pps[0].data, pps2 + 4, sizeof(pps2) - 4));
  415. }
  416. void mpeg4_annexbtomp4_test(void)
  417. {
  418. const uint8_t sps[] = { 0x67,0x42,0xe0,0x1e,0xab };
  419. const uint8_t pps[] = { 0x28,0xce,0x3c,0x80 };
  420. const uint8_t annexb[] = { 0x00,0x00,0x00,0x01,0x67,0x42,0xe0,0x1e,0xab, 0x00,0x00,0x00,0x01,0x28,0xce,0x3c,0x80,0x00,0x00,0x00,0x01,0x65,0x11 };
  421. uint8_t output[256];
  422. int vcl, update;
  423. struct mpeg4_avc_t avc;
  424. memset(&avc, 0, sizeof(avc));
  425. assert(h264_annexbtomp4(&avc, annexb, sizeof(annexb), output, sizeof(output), &vcl, &update) > 0);
  426. assert(1 == avc.nb_sps && avc.sps[0].bytes == sizeof(sps) && 0 == memcmp(avc.sps[0].data, sps, sizeof(sps)));
  427. assert(1 == avc.nb_pps && avc.pps[0].bytes == sizeof(pps) && 0 == memcmp(avc.pps[0].data, pps, sizeof(pps)));
  428. assert(vcl == 1);
  429. mpeg4_annexbtomp4_test2();
  430. mpeg4_h264_bitstream_format_test();
  431. }
  432. #endif