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.

679 lines
20KB

  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. * @file
  23. * Zip Motion Blocks Video decoder
  24. */
  25. #include <stdio.h>
  26. #include <stdlib.h>
  27. #include "libavutil/common.h"
  28. #include "libavutil/intreadwrite.h"
  29. #include "avcodec.h"
  30. #include "internal.h"
  31. #include <zlib.h>
  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. z_stream zstream;
  63. int (*decode_intra)(struct ZmbvContext *c);
  64. int (*decode_xor)(struct ZmbvContext *c);
  65. } ZmbvContext;
  66. /**
  67. * Decode XOR'ed frame - 8bpp version
  68. */
  69. static int zmbv_decode_xor_8(ZmbvContext *c)
  70. {
  71. uint8_t *src = c->decomp_buf;
  72. uint8_t *output, *prev;
  73. int8_t *mvec;
  74. int x, y;
  75. int d, dx, dy, bw2, bh2;
  76. int block;
  77. int i, j;
  78. int mx, my;
  79. output = c->cur;
  80. prev = c->prev;
  81. if (c->flags & ZMBV_DELTAPAL) {
  82. for (i = 0; i < 768; i++)
  83. c->pal[i] ^= *src++;
  84. }
  85. mvec = (int8_t*)src;
  86. src += ((c->bx * c->by * 2 + 3) & ~3);
  87. block = 0;
  88. for (y = 0; y < c->height; y += c->bh) {
  89. bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
  90. for (x = 0; x < c->width; x += c->bw) {
  91. uint8_t *out, *tprev;
  92. d = mvec[block] & 1;
  93. dx = mvec[block] >> 1;
  94. dy = mvec[block + 1] >> 1;
  95. block += 2;
  96. bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
  97. /* copy block - motion vectors out of bounds are used to zero blocks */
  98. out = output + x;
  99. tprev = prev + x + dx + dy * c->width;
  100. mx = x + dx;
  101. my = y + dy;
  102. for (j = 0; j < bh2; j++) {
  103. if (my + j < 0 || my + j >= c->height) {
  104. memset(out, 0, bw2);
  105. } else {
  106. for (i = 0; i < bw2; i++) {
  107. if (mx + i < 0 || mx + i >= c->width)
  108. out[i] = 0;
  109. else
  110. out[i] = tprev[i];
  111. }
  112. }
  113. out += c->width;
  114. tprev += c->width;
  115. }
  116. if (d) { /* apply XOR'ed difference */
  117. out = output + x;
  118. for (j = 0; j < bh2; j++) {
  119. for (i = 0; i < bw2; i++)
  120. out[i] ^= *src++;
  121. out += c->width;
  122. }
  123. }
  124. }
  125. output += c->width * c->bh;
  126. prev += c->width * c->bh;
  127. }
  128. if (src - c->decomp_buf != c->decomp_len)
  129. av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
  130. 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 %ti of %i bytes\n",
  195. 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",
  269. src-c->decomp_buf, c->decomp_len);
  270. return 0;
  271. }
  272. #endif //ZMBV_ENABLE_24BPP
  273. /**
  274. * Decode XOR'ed frame - 32bpp version
  275. */
  276. static int zmbv_decode_xor_32(ZmbvContext *c)
  277. {
  278. uint8_t *src = c->decomp_buf;
  279. uint32_t *output, *prev;
  280. int8_t *mvec;
  281. int x, y;
  282. int d, dx, dy, bw2, bh2;
  283. int block;
  284. int i, j;
  285. int mx, my;
  286. output = (uint32_t*)c->cur;
  287. prev = (uint32_t*)c->prev;
  288. mvec = (int8_t*)src;
  289. src += ((c->bx * c->by * 2 + 3) & ~3);
  290. block = 0;
  291. for (y = 0; y < c->height; y += c->bh) {
  292. bh2 = ((c->height - y) > c->bh) ? c->bh : (c->height - y);
  293. for (x = 0; x < c->width; x += c->bw) {
  294. uint32_t *out, *tprev;
  295. d = mvec[block] & 1;
  296. dx = mvec[block] >> 1;
  297. dy = mvec[block + 1] >> 1;
  298. block += 2;
  299. bw2 = ((c->width - x) > c->bw) ? c->bw : (c->width - x);
  300. /* copy block - motion vectors out of bounds are used to zero blocks */
  301. out = output + x;
  302. tprev = prev + x + dx + dy * c->width;
  303. mx = x + dx;
  304. my = y + dy;
  305. for (j = 0; j < bh2; j++) {
  306. if (my + j < 0 || my + j >= c->height) {
  307. memset(out, 0, bw2 * 4);
  308. } else {
  309. for (i = 0; i < bw2; i++){
  310. if (mx + i < 0 || mx + i >= c->width)
  311. out[i] = 0;
  312. else
  313. out[i] = tprev[i];
  314. }
  315. }
  316. out += c->width;
  317. tprev += c->width;
  318. }
  319. if (d) { /* apply XOR'ed difference */
  320. out = output + x;
  321. for (j = 0; j < bh2; j++){
  322. for (i = 0; i < bw2; i++) {
  323. out[i] ^= *((uint32_t *) src);
  324. src += 4;
  325. }
  326. out += c->width;
  327. }
  328. }
  329. }
  330. output += c->width * c->bh;
  331. prev += c->width * c->bh;
  332. }
  333. if (src - c->decomp_buf != c->decomp_len)
  334. av_log(c->avctx, AV_LOG_ERROR, "Used %ti of %i bytes\n",
  335. src-c->decomp_buf, c->decomp_len);
  336. return 0;
  337. }
  338. /**
  339. * Decode intraframe
  340. */
  341. static int zmbv_decode_intra(ZmbvContext *c)
  342. {
  343. uint8_t *src = c->decomp_buf;
  344. /* make the palette available on the way out */
  345. if (c->fmt == ZMBV_FMT_8BPP) {
  346. memcpy(c->pal, src, 768);
  347. src += 768;
  348. }
  349. memcpy(c->cur, src, c->width * c->height * (c->bpp / 8));
  350. return 0;
  351. }
  352. static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
  353. {
  354. const uint8_t *buf = avpkt->data;
  355. int buf_size = avpkt->size;
  356. ZmbvContext * const c = avctx->priv_data;
  357. int zret = Z_OK; // Zlib return code
  358. int len = buf_size;
  359. int hi_ver, lo_ver, ret;
  360. if (c->pic.data[0])
  361. avctx->release_buffer(avctx, &c->pic);
  362. c->pic.reference = 3;
  363. c->pic.buffer_hints = FF_BUFFER_HINTS_VALID;
  364. if ((ret = ff_get_buffer(avctx, &c->pic)) < 0) {
  365. av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
  366. return ret;
  367. }
  368. /* parse header */
  369. c->flags = buf[0];
  370. buf++; len--;
  371. if (c->flags & ZMBV_KEYFRAME) {
  372. void *decode_intra = NULL;
  373. c->decode_intra= NULL;
  374. hi_ver = buf[0];
  375. lo_ver = buf[1];
  376. c->comp = buf[2];
  377. c->fmt = buf[3];
  378. c->bw = buf[4];
  379. c->bh = buf[5];
  380. c->decode_intra = NULL;
  381. c->decode_xor = NULL;
  382. buf += 6;
  383. len -= 6;
  384. av_log(avctx, AV_LOG_DEBUG,
  385. "Flags=%X ver=%i.%i comp=%i fmt=%i blk=%ix%i\n",
  386. c->flags,hi_ver,lo_ver,c->comp,c->fmt,c->bw,c->bh);
  387. if (hi_ver != 0 || lo_ver != 1) {
  388. av_log_ask_for_sample(avctx, "Unsupported version %i.%i\n",
  389. hi_ver, lo_ver);
  390. return AVERROR_PATCHWELCOME;
  391. }
  392. if (c->bw == 0 || c->bh == 0) {
  393. av_log_ask_for_sample(avctx, "Unsupported block size %ix%i\n",
  394. c->bw, c->bh);
  395. return AVERROR_PATCHWELCOME;
  396. }
  397. if (c->comp != 0 && c->comp != 1) {
  398. av_log_ask_for_sample(avctx, "Unsupported compression type %i\n",
  399. c->comp);
  400. return AVERROR_PATCHWELCOME;
  401. }
  402. switch (c->fmt) {
  403. case ZMBV_FMT_8BPP:
  404. c->bpp = 8;
  405. decode_intra = zmbv_decode_intra;
  406. c->decode_xor = zmbv_decode_xor_8;
  407. break;
  408. case ZMBV_FMT_15BPP:
  409. case ZMBV_FMT_16BPP:
  410. c->bpp = 16;
  411. decode_intra = zmbv_decode_intra;
  412. c->decode_xor = zmbv_decode_xor_16;
  413. break;
  414. #ifdef ZMBV_ENABLE_24BPP
  415. case ZMBV_FMT_24BPP:
  416. c->bpp = 24;
  417. decode_intra = zmbv_decode_intra;
  418. c->decode_xor = zmbv_decode_xor_24;
  419. break;
  420. #endif //ZMBV_ENABLE_24BPP
  421. case ZMBV_FMT_32BPP:
  422. c->bpp = 32;
  423. decode_intra = zmbv_decode_intra;
  424. c->decode_xor = zmbv_decode_xor_32;
  425. break;
  426. default:
  427. c->decode_xor = NULL;
  428. av_log_ask_for_sample(avctx, "Unsupported (for now) format %i\n",
  429. c->fmt);
  430. return AVERROR_PATCHWELCOME;
  431. }
  432. zret = inflateReset(&c->zstream);
  433. if (zret != Z_OK) {
  434. av_log(avctx, AV_LOG_ERROR, "Inflate reset error: %d\n", zret);
  435. return AVERROR_UNKNOWN;
  436. }
  437. c->cur = av_realloc_f(c->cur, avctx->width * avctx->height, (c->bpp / 8));
  438. c->prev = av_realloc_f(c->prev, avctx->width * avctx->height, (c->bpp / 8));
  439. c->bx = (c->width + c->bw - 1) / c->bw;
  440. c->by = (c->height+ c->bh - 1) / c->bh;
  441. if (!c->cur || !c->prev)
  442. return -1;
  443. memset(c->cur, 0, avctx->width * avctx->height * (c->bpp / 8));
  444. memset(c->prev, 0, avctx->width * avctx->height * (c->bpp / 8));
  445. c->decode_intra= decode_intra;
  446. }
  447. if (c->decode_intra == NULL) {
  448. av_log(avctx, AV_LOG_ERROR, "Error! Got no format or no keyframe!\n");
  449. return AVERROR_INVALIDDATA;
  450. }
  451. if (c->comp == 0) { //Uncompressed data
  452. if (c->decomp_size < len) {
  453. av_log(avctx, AV_LOG_ERROR, "decomp buffer too small\n");
  454. return AVERROR_INVALIDDATA;
  455. }
  456. memcpy(c->decomp_buf, buf, len);
  457. } else { // ZLIB-compressed data
  458. c->zstream.total_in = c->zstream.total_out = 0;
  459. c->zstream.next_in = (uint8_t*)buf;
  460. c->zstream.avail_in = len;
  461. c->zstream.next_out = c->decomp_buf;
  462. c->zstream.avail_out = c->decomp_size;
  463. zret = inflate(&c->zstream, Z_SYNC_FLUSH);
  464. if (zret != Z_OK && zret != Z_STREAM_END) {
  465. av_log(avctx, AV_LOG_ERROR, "inflate error %d\n", zret);
  466. return AVERROR_INVALIDDATA;
  467. }
  468. c->decomp_len = c->zstream.total_out;
  469. }
  470. if (c->flags & ZMBV_KEYFRAME) {
  471. c->pic.key_frame = 1;
  472. c->pic.pict_type = AV_PICTURE_TYPE_I;
  473. c->decode_intra(c);
  474. } else {
  475. c->pic.key_frame = 0;
  476. c->pic.pict_type = AV_PICTURE_TYPE_P;
  477. if (c->decomp_len)
  478. c->decode_xor(c);
  479. }
  480. /* update frames */
  481. {
  482. uint8_t *out, *src;
  483. int i, j;
  484. out = c->pic.data[0];
  485. src = c->cur;
  486. switch (c->fmt) {
  487. case ZMBV_FMT_8BPP:
  488. for (j = 0; j < c->height; j++) {
  489. for (i = 0; i < c->width; i++) {
  490. out[i * 3 + 0] = c->pal[(*src) * 3 + 0];
  491. out[i * 3 + 1] = c->pal[(*src) * 3 + 1];
  492. out[i * 3 + 2] = c->pal[(*src) * 3 + 2];
  493. src++;
  494. }
  495. out += c->pic.linesize[0];
  496. }
  497. break;
  498. case ZMBV_FMT_15BPP:
  499. for (j = 0; j < c->height; j++) {
  500. for (i = 0; i < c->width; i++) {
  501. uint16_t tmp = AV_RL16(src);
  502. src += 2;
  503. out[i * 3 + 0] = (tmp & 0x7C00) >> 7;
  504. out[i * 3 + 1] = (tmp & 0x03E0) >> 2;
  505. out[i * 3 + 2] = (tmp & 0x001F) << 3;
  506. }
  507. out += c->pic.linesize[0];
  508. }
  509. break;
  510. case ZMBV_FMT_16BPP:
  511. for (j = 0; j < c->height; j++) {
  512. for (i = 0; i < c->width; i++) {
  513. uint16_t tmp = AV_RL16(src);
  514. src += 2;
  515. out[i * 3 + 0] = (tmp & 0xF800) >> 8;
  516. out[i * 3 + 1] = (tmp & 0x07E0) >> 3;
  517. out[i * 3 + 2] = (tmp & 0x001F) << 3;
  518. }
  519. out += c->pic.linesize[0];
  520. }
  521. break;
  522. #ifdef ZMBV_ENABLE_24BPP
  523. case ZMBV_FMT_24BPP:
  524. for (j = 0; j < c->height; j++) {
  525. memcpy(out, src, c->width * 3);
  526. src += c->width * 3;
  527. out += c->pic.linesize[0];
  528. }
  529. break;
  530. #endif //ZMBV_ENABLE_24BPP
  531. case ZMBV_FMT_32BPP:
  532. for (j = 0; j < c->height; j++) {
  533. for (i = 0; i < c->width; i++) {
  534. uint32_t tmp = AV_RL32(src);
  535. src += 4;
  536. AV_WB24(out+(i*3), tmp);
  537. }
  538. out += c->pic.linesize[0];
  539. }
  540. break;
  541. default:
  542. av_log(avctx, AV_LOG_ERROR, "Cannot handle format %i\n", c->fmt);
  543. }
  544. FFSWAP(uint8_t *, c->cur, c->prev);
  545. }
  546. *got_frame = 1;
  547. *(AVFrame*)data = c->pic;
  548. /* always report that the buffer was completely consumed */
  549. return buf_size;
  550. }
  551. static av_cold int decode_init(AVCodecContext *avctx)
  552. {
  553. ZmbvContext * const c = avctx->priv_data;
  554. int zret; // Zlib return code
  555. c->avctx = avctx;
  556. c->width = avctx->width;
  557. c->height = avctx->height;
  558. avcodec_get_frame_defaults(&c->pic);
  559. c->bpp = avctx->bits_per_coded_sample;
  560. // Needed if zlib unused or init aborted before inflateInit
  561. memset(&c->zstream, 0, sizeof(z_stream));
  562. avctx->pix_fmt = AV_PIX_FMT_RGB24;
  563. c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64);
  564. /* Allocate decompression buffer */
  565. if (c->decomp_size) {
  566. if ((c->decomp_buf = av_mallocz(c->decomp_size)) == NULL) {
  567. av_log(avctx, AV_LOG_ERROR,
  568. "Can't allocate decompression buffer.\n");
  569. return AVERROR(ENOMEM);
  570. }
  571. }
  572. c->zstream.zalloc = Z_NULL;
  573. c->zstream.zfree = Z_NULL;
  574. c->zstream.opaque = Z_NULL;
  575. zret = inflateInit(&c->zstream);
  576. if (zret != Z_OK) {
  577. av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
  578. return AVERROR_UNKNOWN;
  579. }
  580. return 0;
  581. }
  582. static av_cold int decode_end(AVCodecContext *avctx)
  583. {
  584. ZmbvContext * const c = avctx->priv_data;
  585. av_freep(&c->decomp_buf);
  586. if (c->pic.data[0])
  587. avctx->release_buffer(avctx, &c->pic);
  588. inflateEnd(&c->zstream);
  589. av_freep(&c->cur);
  590. av_freep(&c->prev);
  591. return 0;
  592. }
  593. AVCodec ff_zmbv_decoder = {
  594. .name = "zmbv",
  595. .type = AVMEDIA_TYPE_VIDEO,
  596. .id = AV_CODEC_ID_ZMBV,
  597. .priv_data_size = sizeof(ZmbvContext),
  598. .init = decode_init,
  599. .close = decode_end,
  600. .decode = decode_frame,
  601. .capabilities = CODEC_CAP_DR1,
  602. .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
  603. };