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.

693 lines
19KB

  1. /*
  2. * Zip Motion Blocks Video (ZMBV) decoder
  3. * Copyright (c) 2006 Konstantin Shishkov
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  18. *
  19. */
  20. /**
  21. * @file zmbv.c
  22. * Zip Motion Blocks Video decoder
  23. */
  24. #include <stdio.h>
  25. #include <stdlib.h>
  26. #include "common.h"
  27. #include "avcodec.h"
  28. #ifdef CONFIG_ZLIB
  29. #include <zlib.h>
  30. #endif
  31. #define ZMBV_KEYFRAME 1
  32. #define ZMBV_DELTAPAL 2
  33. enum ZmbvFormat {
  34. ZMBV_FMT_NONE = 0,
  35. ZMBV_FMT_1BPP = 1,
  36. ZMBV_FMT_2BPP = 2,
  37. ZMBV_FMT_4BPP = 3,
  38. ZMBV_FMT_8BPP = 4,
  39. ZMBV_FMT_15BPP = 5,
  40. ZMBV_FMT_16BPP = 6,
  41. ZMBV_FMT_24BPP = 7,
  42. ZMBV_FMT_32BPP = 8
  43. };
  44. /*
  45. * Decoder context
  46. */
  47. typedef struct ZmbvContext {
  48. AVCodecContext *avctx;
  49. AVFrame pic;
  50. int bpp;
  51. unsigned int decomp_size;
  52. uint8_t* decomp_buf;
  53. uint8_t pal[768];
  54. uint8_t *prev, *cur;
  55. int width, height;
  56. int fmt;
  57. int comp;
  58. int flags;
  59. int bw, bh, bx, by;
  60. int decomp_len;
  61. #ifdef CONFIG_ZLIB
  62. z_stream zstream;
  63. #endif
  64. int (*decode_intra)(struct ZmbvContext *c);
  65. int (*decode_xor)(struct ZmbvContext *c);
  66. } ZmbvContext;
  67. /**
  68. * Decode XOR'ed frame - 8bpp version
  69. */
  70. static int zmbv_decode_xor_8(ZmbvContext *c)
  71. {
  72. uint8_t *src = c->decomp_buf;
  73. uint8_t *output, *prev;
  74. int8_t *mvec;
  75. int x, y;
  76. int d, dx, dy, bw2, bh2;
  77. int block;
  78. int i, j;
  79. int mx, my;
  80. output = c->cur;
  81. prev = c->prev;
  82. if(c->flags & ZMBV_DELTAPAL){
  83. for(i = 0; i < 768; i++)
  84. c->pal[i] ^= *src++;
  85. }
  86. mvec = (int8_t*)src;
  87. src += ((c->bx * c->by * 2 + 3) & ~3);
  88. block = 0;
  89. for(y = 0; y < c->height; y += c->bh) {
  90. bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
  91. for(x = 0; x < c->width; x += c->bw) {
  92. uint8_t *out, *tprev;
  93. d = mvec[block] & 1;
  94. dx = mvec[block] >> 1;
  95. dy = mvec[block + 1] >> 1;
  96. block += 2;
  97. bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
  98. /* copy block - motion vectors out of bounds are used to zero blocks */
  99. out = output + x;
  100. tprev = prev + x + dx + dy * c->width;
  101. mx = x + dx;
  102. my = y + dy;
  103. for(j = 0; j < bh2; j++){
  104. if((my + j < 0) || (my + j >= c->height)) {
  105. memset(out, 0, bw2);
  106. } else {
  107. for(i = 0; i < bw2; i++){
  108. if((mx + i < 0) || (mx + i >= c->width))
  109. out[i] = 0;
  110. else
  111. out[i] = tprev[i];
  112. }
  113. }
  114. out += c->width;
  115. tprev += c->width;
  116. }
  117. if(d) { /* apply XOR'ed difference */
  118. out = output + x;
  119. for(j = 0; j < bh2; j++){
  120. for(i = 0; i < bw2; i++)
  121. out[i] ^= *src++;
  122. out += c->width;
  123. }
  124. }
  125. }
  126. output += c->width * c->bh;
  127. prev += c->width * c->bh;
  128. }
  129. if(src - c->decomp_buf != c->decomp_len)
  130. av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
  131. return 0;
  132. }
  133. /**
  134. * Decode XOR'ed frame - 15bpp and 16bpp version
  135. */
  136. static int zmbv_decode_xor_16(ZmbvContext *c)
  137. {
  138. uint8_t *src = c->decomp_buf;
  139. uint16_t *output, *prev;
  140. int8_t *mvec;
  141. int x, y;
  142. int d, dx, dy, bw2, bh2;
  143. int block;
  144. int i, j;
  145. int mx, my;
  146. output = (uint16_t*)c->cur;
  147. prev = (uint16_t*)c->prev;
  148. mvec = (int8_t*)src;
  149. src += ((c->bx * c->by * 2 + 3) & ~3);
  150. block = 0;
  151. for(y = 0; y < c->height; y += c->bh) {
  152. bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
  153. for(x = 0; x < c->width; x += c->bw) {
  154. uint16_t *out, *tprev;
  155. d = mvec[block] & 1;
  156. dx = mvec[block] >> 1;
  157. dy = mvec[block + 1] >> 1;
  158. block += 2;
  159. bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
  160. /* copy block - motion vectors out of bounds are used to zero blocks */
  161. out = output + x;
  162. tprev = prev + x + dx + dy * c->width;
  163. mx = x + dx;
  164. my = y + dy;
  165. for(j = 0; j < bh2; j++){
  166. if((my + j < 0) || (my + j >= c->height)) {
  167. memset(out, 0, bw2 * 2);
  168. } else {
  169. for(i = 0; i < bw2; i++){
  170. if((mx + i < 0) || (mx + i >= c->width))
  171. out[i] = 0;
  172. else
  173. out[i] = tprev[i];
  174. }
  175. }
  176. out += c->width;
  177. tprev += c->width;
  178. }
  179. if(d) { /* apply XOR'ed difference */
  180. out = output + x;
  181. for(j = 0; j < bh2; j++){
  182. for(i = 0; i < bw2; i++) {
  183. out[i] ^= *((uint16_t*)src);
  184. src += 2;
  185. }
  186. out += c->width;
  187. }
  188. }
  189. }
  190. output += c->width * c->bh;
  191. prev += c->width * c->bh;
  192. }
  193. if(src - c->decomp_buf != c->decomp_len)
  194. av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
  195. return 0;
  196. }
  197. #ifdef ZMBV_ENABLE_24BPP
  198. /**
  199. * Decode XOR'ed frame - 24bpp version
  200. */
  201. static int zmbv_decode_xor_24(ZmbvContext *c)
  202. {
  203. uint8_t *src = c->decomp_buf;
  204. uint8_t *output, *prev;
  205. int8_t *mvec;
  206. int x, y;
  207. int d, dx, dy, bw2, bh2;
  208. int block;
  209. int i, j;
  210. int mx, my;
  211. int stride;
  212. output = c->cur;
  213. prev = c->prev;
  214. stride = c->width * 3;
  215. mvec = (int8_t*)src;
  216. src += ((c->bx * c->by * 2 + 3) & ~3);
  217. block = 0;
  218. for(y = 0; y < c->height; y += c->bh) {
  219. bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
  220. for(x = 0; x < c->width; x += c->bw) {
  221. uint8_t *out, *tprev;
  222. d = mvec[block] & 1;
  223. dx = mvec[block] >> 1;
  224. dy = mvec[block + 1] >> 1;
  225. block += 2;
  226. bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
  227. /* copy block - motion vectors out of bounds are used to zero blocks */
  228. out = output + x * 3;
  229. tprev = prev + (x + dx) * 3 + dy * stride;
  230. mx = x + dx;
  231. my = y + dy;
  232. for(j = 0; j < bh2; j++){
  233. if((my + j < 0) || (my + j >= c->height)) {
  234. memset(out, 0, bw2 * 3);
  235. } else {
  236. for(i = 0; i < bw2; i++){
  237. if((mx + i < 0) || (mx + i >= c->width)) {
  238. out[i * 3 + 0] = 0;
  239. out[i * 3 + 1] = 0;
  240. out[i * 3 + 2] = 0;
  241. } else {
  242. out[i * 3 + 0] = tprev[i * 3 + 0];
  243. out[i * 3 + 1] = tprev[i * 3 + 1];
  244. out[i * 3 + 2] = tprev[i * 3 + 2];
  245. }
  246. }
  247. }
  248. out += stride;
  249. tprev += stride;
  250. }
  251. if(d) { /* apply XOR'ed difference */
  252. out = output + x * 3;
  253. for(j = 0; j < bh2; j++){
  254. for(i = 0; i < bw2; i++) {
  255. out[i * 3 + 0] ^= *src++;
  256. out[i * 3 + 1] ^= *src++;
  257. out[i * 3 + 2] ^= *src++;
  258. }
  259. out += stride;
  260. }
  261. }
  262. }
  263. output += stride * c->bh;
  264. prev += stride * c->bh;
  265. }
  266. if(src - c->decomp_buf != c->decomp_len)
  267. av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
  268. return 0;
  269. }
  270. #endif //ZMBV_ENABLE_24BPP
  271. /**
  272. * Decode XOR'ed frame - 32bpp version
  273. */
  274. static int zmbv_decode_xor_32(ZmbvContext *c)
  275. {
  276. uint8_t *src = c->decomp_buf;
  277. uint32_t *output, *prev;
  278. int8_t *mvec;
  279. int x, y;
  280. int d, dx, dy, bw2, bh2;
  281. int block;
  282. int i, j;
  283. int mx, my;
  284. output = (uint32_t*)c->cur;
  285. prev = (uint32_t*)c->prev;
  286. mvec = (int8_t*)src;
  287. src += ((c->bx * c->by * 2 + 3) & ~3);
  288. block = 0;
  289. for(y = 0; y < c->height; y += c->bh) {
  290. bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
  291. for(x = 0; x < c->width; x += c->bw) {
  292. uint32_t *out, *tprev;
  293. d = mvec[block] & 1;
  294. dx = mvec[block] >> 1;
  295. dy = mvec[block + 1] >> 1;
  296. block += 2;
  297. bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
  298. /* copy block - motion vectors out of bounds are used to zero blocks */
  299. out = output + x;
  300. tprev = prev + x + dx + dy * c->width;
  301. mx = x + dx;
  302. my = y + dy;
  303. for(j = 0; j < bh2; j++){
  304. if((my + j < 0) || (my + j >= c->height)) {
  305. memset(out, 0, bw2 * 4);
  306. } else {
  307. for(i = 0; i < bw2; i++){
  308. if((mx + i < 0) || (mx + i >= c->width))
  309. out[i] = 0;
  310. else
  311. out[i] = tprev[i];
  312. }
  313. }
  314. out += c->width;
  315. tprev += c->width;
  316. }
  317. if(d) { /* apply XOR'ed difference */
  318. out = output + x;
  319. for(j = 0; j < bh2; j++){
  320. for(i = 0; i < bw2; i++) {
  321. out[i] ^= *((uint32_t*)src);
  322. src += 4;
  323. }
  324. out += c->width;
  325. }
  326. }
  327. }
  328. output += c->width * c->bh;
  329. prev += c->width * c->bh;
  330. }
  331. if(src - c->decomp_buf != c->decomp_len)
  332. av_log(c->avctx, AV_LOG_ERROR, "Used %i of %i bytes\n", src-c->decomp_buf, c->decomp_len);
  333. return 0;
  334. }
  335. /**
  336. * Decode intraframe
  337. */
  338. static int zmbv_decode_intra(ZmbvContext *c)
  339. {
  340. uint8_t *src = c->decomp_buf;
  341. /* make the palette available on the way out */
  342. if (c->fmt == ZMBV_FMT_8BPP) {
  343. memcpy(c->pal, src, 768);
  344. src += 768;
  345. }
  346. memcpy(c->cur, src, c->width * c->height * (c->bpp / 8));
  347. return 0;
  348. }
  349. static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
  350. {
  351. ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
  352. uint8_t *outptr;
  353. #ifdef CONFIG_ZLIB
  354. int zret = Z_OK; // Zlib return code
  355. #endif
  356. int len = buf_size;
  357. int hi_ver, lo_ver;
  358. if(c->pic.data[0])
  359. avctx->release_buffer(avctx, &c->pic);
  360. c->pic.reference = 1;
  361. c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
  362. if(avctx->get_buffer(avctx, &c->pic) < 0){
  363. av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
  364. return -1;
  365. }
  366. outptr = c->pic.data[0]; // Output image pointer
  367. /* parse header */
  368. c->flags = buf[0];
  369. buf++; len--;
  370. if(c->flags & ZMBV_KEYFRAME) {
  371. hi_ver = buf[0];
  372. lo_ver = buf[1];
  373. c->comp = buf[2];
  374. c->fmt = buf[3];
  375. c->bw = buf[4];
  376. c->bh = buf[5];
  377. buf += 6;
  378. len -= 6;
  379. av_log(avctx, AV_LOG_DEBUG, "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
  380. if(hi_ver != 0 || lo_ver != 1) {
  381. av_log(avctx, AV_LOG_ERROR, "Unsupported version %i.%i\n", hi_ver, lo_ver);
  382. return -1;
  383. }
  384. if(c->bw == 0 || c->bh == 0) {
  385. av_log(avctx, AV_LOG_ERROR, "Unsupported block size %ix%i\n", c->bw, c->bh);
  386. }
  387. if(c->comp != 0 && c->comp != 1) {
  388. av_log(avctx, AV_LOG_ERROR, "Unsupported compression type %i\n", c->comp);
  389. return -1;
  390. }
  391. switch(c->fmt) {
  392. case ZMBV_FMT_8BPP:
  393. c->bpp = 8;
  394. c->decode_intra = zmbv_decode_intra;
  395. c->decode_xor = zmbv_decode_xor_8;
  396. break;
  397. case ZMBV_FMT_15BPP:
  398. case ZMBV_FMT_16BPP:
  399. c->bpp = 16;
  400. c->decode_intra = zmbv_decode_intra;
  401. c->decode_xor = zmbv_decode_xor_16;
  402. break;
  403. #ifdef ZMBV_ENABLE_24BPP
  404. case ZMBV_FMT_24BPP:
  405. c->bpp = 24;
  406. c->decode_intra = zmbv_decode_intra;
  407. c->decode_xor = zmbv_decode_xor_24;
  408. break;
  409. #endif //ZMBV_ENABLE_24BPP
  410. case ZMBV_FMT_32BPP:
  411. c->bpp = 32;
  412. c->decode_intra = zmbv_decode_intra;
  413. c->decode_xor = zmbv_decode_xor_32;
  414. break;
  415. default:
  416. c->decode_intra = NULL;
  417. c->decode_xor = NULL;
  418. av_log(avctx, AV_LOG_ERROR, "Unsupported (for now) format %i\n", c->fmt);
  419. return -1;
  420. }
  421. #ifdef CONFIG_ZLIB
  422. zret = inflateReset(&c->zstream);
  423. if (zret != Z_OK) {
  424. av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
  425. return -1;
  426. }
  427. #else
  428. av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n");
  429. return -1;
  430. #endif /* CONFIG_ZLIB */
  431. c->cur = av_realloc(c->cur, avctx->width * avctx->height * (c->bpp / 8));
  432. c->prev = av_realloc(c->prev, avctx->width * avctx->height * (c->bpp / 8));
  433. c->bx = (c->width + c->bw - 1) / c->bw;
  434. c->by = (c->height+ c->bh - 1) / c->bh;
  435. }
  436. if(c->decode_intra == NULL) {
  437. av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
  438. return -1;
  439. }
  440. if(c->comp == 0) { //Uncompressed data
  441. memcpy(c->decomp_buf, buf, len);
  442. c->decomp_size = 1;
  443. } else { // ZLIB-compressed data
  444. #ifdef CONFIG_ZLIB
  445. c->zstream.total_in = c->zstream.total_out = 0;
  446. c->zstream.next_in = buf;
  447. c->zstream.avail_in = len;
  448. c->zstream.next_out = c->decomp_buf;
  449. c->zstream.avail_out = c->decomp_size;
  450. inflate(&c->zstream, Z_FINISH);
  451. c->decomp_len = c->zstream.total_out;
  452. #else
  453. av_log(avctx, AV_LOG_ERROR, "BUG! Zlib support not compiled in frame decoder.\n");
  454. return -1;
  455. #endif
  456. }
  457. if(c->flags & ZMBV_KEYFRAME) {
  458. c->pic.key_frame = 1;
  459. c->pic.pict_type = FF_I_TYPE;
  460. c->decode_intra(c);
  461. } else {
  462. c->pic.key_frame = 0;
  463. c->pic.pict_type = FF_P_TYPE;
  464. c->decode_xor(c);
  465. }
  466. /* update frames */
  467. {
  468. uint8_t *out, *src;
  469. int i, j;
  470. out = c->pic.data[0];
  471. src = c->cur;
  472. switch(c->fmt) {
  473. case ZMBV_FMT_8BPP:
  474. for(j = 0; j < c->height; j++) {
  475. for(i = 0; i < c->width; i++) {
  476. out[i * 3 + 0] = c->pal[(*src) * 3 + 0];
  477. out[i * 3 + 1] = c->pal[(*src) * 3 + 1];
  478. out[i * 3 + 2] = c->pal[(*src) * 3 + 2];
  479. *src++;
  480. }
  481. out += c->pic.linesize[0];
  482. }
  483. break;
  484. case ZMBV_FMT_15BPP:
  485. for(j = 0; j < c->height; j++) {
  486. for(i = 0; i < c->width; i++) {
  487. uint16_t tmp = LE_16(src);
  488. src += 2;
  489. out[i * 3 + 0] = (tmp & 0x7C00) >> 7;
  490. out[i * 3 + 1] = (tmp & 0x03E0) >> 2;
  491. out[i * 3 + 2] = (tmp & 0x001F) << 3;
  492. }
  493. out += c->pic.linesize[0];
  494. }
  495. break;
  496. case ZMBV_FMT_16BPP:
  497. for(j = 0; j < c->height; j++) {
  498. for(i = 0; i < c->width; i++) {
  499. uint16_t tmp = LE_16(src);
  500. src += 2;
  501. out[i * 3 + 0] = (tmp & 0xF800) >> 8;
  502. out[i * 3 + 1] = (tmp & 0x07E0) >> 3;
  503. out[i * 3 + 2] = (tmp & 0x001F) << 3;
  504. }
  505. out += c->pic.linesize[0];
  506. }
  507. break;
  508. #ifdef ZMBV_ENABLE_24BPP
  509. case ZMBV_FMT_24BPP:
  510. for(j = 0; j < c->height; j++) {
  511. memcpy(out, src, c->width * 3);
  512. src += c->width * 3;
  513. out += c->pic.linesize[0];
  514. }
  515. break;
  516. #endif //ZMBV_ENABLE_24BPP
  517. case ZMBV_FMT_32BPP:
  518. for(j = 0; j < c->height; j++) {
  519. for(i = 0; i < c->width; i++) {
  520. uint32_t tmp = LE_32(src);
  521. src += 4;
  522. out[i * 3 + 0] = tmp >> 16;
  523. out[i * 3 + 1] = tmp >> 8;
  524. out[i * 3 + 2] = tmp >> 0;
  525. }
  526. out += c->pic.linesize[0];
  527. }
  528. break;
  529. default:
  530. av_log(avctx, AV_LOG_ERROR, "Cannot handle format %i\n", c->fmt);
  531. }
  532. memcpy(c->prev, c->cur, c->width * c->height * (c->bpp / 8));
  533. }
  534. *data_size = sizeof(AVFrame);
  535. *(AVFrame*)data = c->pic;
  536. /* always report that the buffer was completely consumed */
  537. return buf_size;
  538. }
  539. /*
  540. *
  541. * Init zmbv decoder
  542. *
  543. */
  544. static int decode_init(AVCodecContext *avctx)
  545. {
  546. ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
  547. int zret; // Zlib return code
  548. c->avctx = avctx;
  549. avctx->has_b_frames = 0;
  550. c->pic.data[0] = NULL;
  551. c->width = avctx->width;
  552. c->height = avctx->height;
  553. if (avcodec_check_dimensions(avctx, avctx->height, avctx->width) < 0) {
  554. return 1;
  555. }
  556. c->bpp = avctx->bits_per_sample;
  557. #ifdef CONFIG_ZLIB
  558. // Needed if zlib unused or init aborted before inflateInit
  559. memset(&(c->zstream), 0, sizeof(z_stream));
  560. #else
  561. av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");
  562. return 1;
  563. #endif
  564. avctx->pix_fmt = PIX_FMT_RGB24;
  565. c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
  566. /* Allocate decompression buffer */
  567. if (c->decomp_size) {
  568. if ((c->decomp_buf = av_malloc(c->decomp_size)) == NULL) {
  569. av_log(avctx, AV_LOG_ERROR, "Can't allocate decompression buffer.\n");
  570. return 1;
  571. }
  572. }
  573. #ifdef CONFIG_ZLIB
  574. c->zstream.zalloc = Z_NULL;
  575. c->zstream.zfree = Z_NULL;
  576. c->zstream.opaque = Z_NULL;
  577. zret = inflateInit(&(c->zstream));
  578. if (zret != Z_OK) {
  579. av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
  580. return 1;
  581. }
  582. #endif
  583. return 0;
  584. }
  585. /*
  586. *
  587. * Uninit zmbv decoder
  588. *
  589. */
  590. static int decode_end(AVCodecContext *avctx)
  591. {
  592. ZmbvContext * const c = (ZmbvContext *)avctx->priv_data;
  593. av_freep(&c->decomp_buf);
  594. if (c->pic.data[0])
  595. avctx->release_buffer(avctx, &c->pic);
  596. #ifdef CONFIG_ZLIB
  597. inflateEnd(&(c->zstream));
  598. #endif
  599. if(c->cur)
  600. av_freep(&c->cur);
  601. if(c->prev)
  602. av_freep(&c->prev);
  603. return 0;
  604. }
  605. AVCodec zmbv_decoder = {
  606. "zmbv",
  607. CODEC_TYPE_VIDEO,
  608. CODEC_ID_ZMBV,
  609. sizeof(ZmbvContext),
  610. decode_init,
  611. NULL,
  612. decode_end,
  613. decode_frame
  614. };