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.

691 lines
19KB

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