vmdav.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646
  1. /*
  2. * Sierra VMD Audio & Video Decoders
  3. * Copyright (C) 2004 the ffmpeg project
  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 libavcodec/vmdav.c
  23. * Sierra VMD audio & video decoders
  24. * by Vladimir "VAG" Gneushev (vagsoft at mail.ru)
  25. * for more information on the Sierra VMD format, visit:
  26. * http://www.pcisys.net/~melanson/codecs/
  27. *
  28. * The video decoder outputs PAL8 colorspace data. The decoder expects
  29. * a 0x330-byte VMD file header to be transmitted via extradata during
  30. * codec initialization. Each encoded frame that is sent to this decoder
  31. * is expected to be prepended with the appropriate 16-byte frame
  32. * information record from the VMD file.
  33. *
  34. * The audio decoder, like the video decoder, expects each encoded data
  35. * chunk to be prepended with the appropriate 16-byte frame information
  36. * record from the VMD file. It does not require the 0x330-byte VMD file
  37. * header, but it does need the audio setup parameters passed in through
  38. * normal libavcodec API means.
  39. */
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <string.h>
  43. #include <unistd.h>
  44. #include "libavutil/intreadwrite.h"
  45. #include "avcodec.h"
  46. #define VMD_HEADER_SIZE 0x330
  47. #define PALETTE_COUNT 256
  48. /*
  49. * Video Decoder
  50. */
  51. typedef struct VmdVideoContext {
  52. AVCodecContext *avctx;
  53. AVFrame frame;
  54. AVFrame prev_frame;
  55. const unsigned char *buf;
  56. int size;
  57. unsigned char palette[PALETTE_COUNT * 4];
  58. unsigned char *unpack_buffer;
  59. int unpack_buffer_size;
  60. int x_off, y_off;
  61. } VmdVideoContext;
  62. #define QUEUE_SIZE 0x1000
  63. #define QUEUE_MASK 0x0FFF
  64. static void lz_unpack(const unsigned char *src, int src_len,
  65. unsigned char *dest, int dest_len)
  66. {
  67. const unsigned char *s;
  68. unsigned int s_len;
  69. unsigned char *d;
  70. unsigned char *d_end;
  71. unsigned char queue[QUEUE_SIZE];
  72. unsigned int qpos;
  73. unsigned int dataleft;
  74. unsigned int chainofs;
  75. unsigned int chainlen;
  76. unsigned int speclen;
  77. unsigned char tag;
  78. unsigned int i, j;
  79. s = src;
  80. s_len = src_len;
  81. d = dest;
  82. d_end = d + dest_len;
  83. dataleft = AV_RL32(s);
  84. s += 4; s_len -= 4;
  85. memset(queue, 0x20, QUEUE_SIZE);
  86. if (s_len < 4)
  87. return;
  88. if (AV_RL32(s) == 0x56781234) {
  89. s += 4; s_len -= 4;
  90. qpos = 0x111;
  91. speclen = 0xF + 3;
  92. } else {
  93. qpos = 0xFEE;
  94. speclen = 100; /* no speclen */
  95. }
  96. while (dataleft > 0 && s_len > 0) {
  97. tag = *s++; s_len--;
  98. if ((tag == 0xFF) && (dataleft > 8)) {
  99. if (d + 8 > d_end || s_len < 8)
  100. return;
  101. for (i = 0; i < 8; i++) {
  102. queue[qpos++] = *d++ = *s++;
  103. qpos &= QUEUE_MASK;
  104. }
  105. s_len -= 8;
  106. dataleft -= 8;
  107. } else {
  108. for (i = 0; i < 8; i++) {
  109. if (dataleft == 0)
  110. break;
  111. if (tag & 0x01) {
  112. if (d + 1 > d_end || s_len < 1)
  113. return;
  114. queue[qpos++] = *d++ = *s++;
  115. qpos &= QUEUE_MASK;
  116. dataleft--;
  117. s_len--;
  118. } else {
  119. if (s_len < 2)
  120. return;
  121. chainofs = *s++;
  122. chainofs |= ((*s & 0xF0) << 4);
  123. chainlen = (*s++ & 0x0F) + 3;
  124. s_len -= 2;
  125. if (chainlen == speclen) {
  126. if (s_len < 1)
  127. return;
  128. chainlen = *s++ + 0xF + 3;
  129. s_len--;
  130. }
  131. if (d + chainlen > d_end)
  132. return;
  133. for (j = 0; j < chainlen; j++) {
  134. *d = queue[chainofs++ & QUEUE_MASK];
  135. queue[qpos++] = *d++;
  136. qpos &= QUEUE_MASK;
  137. }
  138. dataleft -= chainlen;
  139. }
  140. tag >>= 1;
  141. }
  142. }
  143. }
  144. }
  145. static int rle_unpack(const unsigned char *src, unsigned char *dest,
  146. int src_count, int src_size, int dest_len)
  147. {
  148. const unsigned char *ps;
  149. unsigned char *pd;
  150. int i, l;
  151. unsigned char *dest_end = dest + dest_len;
  152. ps = src;
  153. pd = dest;
  154. if (src_count & 1) {
  155. if (src_size < 1)
  156. return 0;
  157. *pd++ = *ps++;
  158. src_size--;
  159. }
  160. src_count >>= 1;
  161. i = 0;
  162. do {
  163. if (src_size < 1)
  164. break;
  165. l = *ps++;
  166. src_size--;
  167. if (l & 0x80) {
  168. l = (l & 0x7F) * 2;
  169. if (pd + l > dest_end || src_size < l)
  170. return ps - src;
  171. memcpy(pd, ps, l);
  172. ps += l;
  173. src_size -= l;
  174. pd += l;
  175. } else {
  176. if (pd + i > dest_end || src_size < 2)
  177. return ps - src;
  178. for (i = 0; i < l; i++) {
  179. *pd++ = ps[0];
  180. *pd++ = ps[1];
  181. }
  182. ps += 2;
  183. src_size -= 2;
  184. }
  185. i += l;
  186. } while (i < src_count);
  187. return ps - src;
  188. }
  189. static void vmd_decode(VmdVideoContext *s)
  190. {
  191. int i;
  192. unsigned int *palette32;
  193. unsigned char r, g, b;
  194. /* point to the start of the encoded data */
  195. const unsigned char *p = s->buf + 16;
  196. const unsigned char *pb;
  197. unsigned int pb_size;
  198. unsigned char meth;
  199. unsigned char *dp; /* pointer to current frame */
  200. unsigned char *pp; /* pointer to previous frame */
  201. unsigned char len;
  202. int ofs;
  203. int frame_x, frame_y;
  204. int frame_width, frame_height;
  205. int dp_size;
  206. frame_x = AV_RL16(&s->buf[6]);
  207. frame_y = AV_RL16(&s->buf[8]);
  208. frame_width = AV_RL16(&s->buf[10]) - frame_x + 1;
  209. frame_height = AV_RL16(&s->buf[12]) - frame_y + 1;
  210. if (frame_x < 0 || frame_width < 0 ||
  211. frame_x >= s->avctx->width ||
  212. frame_width > s->avctx->width ||
  213. frame_x + frame_width > s->avctx->width)
  214. return;
  215. if (frame_y < 0 || frame_height < 0 ||
  216. frame_y >= s->avctx->height ||
  217. frame_height > s->avctx->height ||
  218. frame_y + frame_height > s->avctx->height)
  219. return;
  220. if ((frame_width == s->avctx->width && frame_height == s->avctx->height) &&
  221. (frame_x || frame_y)) {
  222. s->x_off = frame_x;
  223. s->y_off = frame_y;
  224. }
  225. frame_x -= s->x_off;
  226. frame_y -= s->y_off;
  227. /* if only a certain region will be updated, copy the entire previous
  228. * frame before the decode */
  229. if (s->prev_frame.data[0] &&
  230. (frame_x || frame_y || (frame_width != s->avctx->width) ||
  231. (frame_height != s->avctx->height))) {
  232. memcpy(s->frame.data[0], s->prev_frame.data[0],
  233. s->avctx->height * s->frame.linesize[0]);
  234. }
  235. /* check if there is a new palette */
  236. if (s->buf[15] & 0x02) {
  237. p += 2;
  238. palette32 = (unsigned int *)s->palette;
  239. for (i = 0; i < PALETTE_COUNT; i++) {
  240. r = *p++ * 4;
  241. g = *p++ * 4;
  242. b = *p++ * 4;
  243. palette32[i] = (r << 16) | (g << 8) | (b);
  244. }
  245. s->size -= (256 * 3 + 2);
  246. }
  247. if (s->size > 0) {
  248. /* originally UnpackFrame in VAG's code */
  249. pb = p;
  250. pb_size = s->buf + s->size - pb;
  251. if (pb_size < 1)
  252. return;
  253. meth = *pb++; pb_size--;
  254. if (meth & 0x80) {
  255. lz_unpack(pb, pb_size,
  256. s->unpack_buffer, s->unpack_buffer_size);
  257. meth &= 0x7F;
  258. pb = s->unpack_buffer;
  259. pb_size = s->unpack_buffer_size;
  260. }
  261. dp = &s->frame.data[0][frame_y * s->frame.linesize[0] + frame_x];
  262. dp_size = s->frame.linesize[0] * s->avctx->height;
  263. pp = &s->prev_frame.data[0][frame_y * s->prev_frame.linesize[0] + frame_x];
  264. switch (meth) {
  265. case 1:
  266. for (i = 0; i < frame_height; i++) {
  267. ofs = 0;
  268. do {
  269. if (pb_size < 1)
  270. return;
  271. len = *pb++;
  272. pb_size--;
  273. if (len & 0x80) {
  274. len = (len & 0x7F) + 1;
  275. if (ofs + len > frame_width || pb_size < len)
  276. return;
  277. memcpy(&dp[ofs], pb, len);
  278. pb += len;
  279. pb_size -= len;
  280. ofs += len;
  281. } else {
  282. /* interframe pixel copy */
  283. if (ofs + len + 1 > frame_width || !s->prev_frame.data[0])
  284. return;
  285. memcpy(&dp[ofs], &pp[ofs], len + 1);
  286. ofs += len + 1;
  287. }
  288. } while (ofs < frame_width);
  289. if (ofs > frame_width) {
  290. av_log(s->avctx, AV_LOG_ERROR, "VMD video: offset > width (%d > %d)\n",
  291. ofs, frame_width);
  292. break;
  293. }
  294. dp += s->frame.linesize[0];
  295. pp += s->prev_frame.linesize[0];
  296. }
  297. break;
  298. case 2:
  299. for (i = 0; i < frame_height; i++) {
  300. if (pb_size < frame_width)
  301. return;
  302. memcpy(dp, pb, frame_width);
  303. pb += frame_width;
  304. pb_size -= frame_width;
  305. dp += s->frame.linesize[0];
  306. pp += s->prev_frame.linesize[0];
  307. }
  308. break;
  309. case 3:
  310. for (i = 0; i < frame_height; i++) {
  311. ofs = 0;
  312. do {
  313. if (pb_size < 1)
  314. return;
  315. len = *pb++;
  316. pb_size--;
  317. if (len & 0x80) {
  318. len = (len & 0x7F) + 1;
  319. if (pb_size < 1)
  320. return;
  321. if (*pb++ == 0xFF)
  322. len = rle_unpack(pb, &dp[ofs], len, pb_size, frame_width - ofs);
  323. else {
  324. if (pb_size < len)
  325. return;
  326. memcpy(&dp[ofs], pb, len);
  327. }
  328. pb += len;
  329. pb_size -= 1 + len;
  330. ofs += len;
  331. } else {
  332. /* interframe pixel copy */
  333. if (ofs + len + 1 > frame_width || !s->prev_frame.data[0])
  334. return;
  335. memcpy(&dp[ofs], &pp[ofs], len + 1);
  336. ofs += len + 1;
  337. }
  338. } while (ofs < frame_width);
  339. if (ofs > frame_width) {
  340. av_log(s->avctx, AV_LOG_ERROR, "VMD video: offset > width (%d > %d)\n",
  341. ofs, frame_width);
  342. }
  343. dp += s->frame.linesize[0];
  344. pp += s->prev_frame.linesize[0];
  345. }
  346. break;
  347. }
  348. }
  349. }
  350. static av_cold int vmdvideo_decode_init(AVCodecContext *avctx)
  351. {
  352. VmdVideoContext *s = avctx->priv_data;
  353. int i;
  354. unsigned int *palette32;
  355. int palette_index = 0;
  356. unsigned char r, g, b;
  357. unsigned char *vmd_header;
  358. unsigned char *raw_palette;
  359. s->avctx = avctx;
  360. avctx->pix_fmt = PIX_FMT_PAL8;
  361. /* make sure the VMD header made it */
  362. if (s->avctx->extradata_size != VMD_HEADER_SIZE) {
  363. av_log(s->avctx, AV_LOG_ERROR, "VMD video: expected extradata size of %d\n",
  364. VMD_HEADER_SIZE);
  365. return -1;
  366. }
  367. vmd_header = (unsigned char *)avctx->extradata;
  368. s->unpack_buffer_size = AV_RL32(&vmd_header[800]);
  369. s->unpack_buffer = av_malloc(s->unpack_buffer_size);
  370. if (!s->unpack_buffer)
  371. return -1;
  372. /* load up the initial palette */
  373. raw_palette = &vmd_header[28];
  374. palette32 = (unsigned int *)s->palette;
  375. for (i = 0; i < PALETTE_COUNT; i++) {
  376. r = raw_palette[palette_index++] * 4;
  377. g = raw_palette[palette_index++] * 4;
  378. b = raw_palette[palette_index++] * 4;
  379. palette32[i] = (r << 16) | (g << 8) | (b);
  380. }
  381. s->frame.data[0] = s->prev_frame.data[0] = NULL;
  382. return 0;
  383. }
  384. static int vmdvideo_decode_frame(AVCodecContext *avctx,
  385. void *data, int *data_size,
  386. const uint8_t *buf, int buf_size)
  387. {
  388. VmdVideoContext *s = avctx->priv_data;
  389. s->buf = buf;
  390. s->size = buf_size;
  391. if (buf_size < 16)
  392. return buf_size;
  393. s->frame.reference = 1;
  394. if (avctx->get_buffer(avctx, &s->frame)) {
  395. av_log(s->avctx, AV_LOG_ERROR, "VMD Video: get_buffer() failed\n");
  396. return -1;
  397. }
  398. vmd_decode(s);
  399. /* make the palette available on the way out */
  400. memcpy(s->frame.data[1], s->palette, PALETTE_COUNT * 4);
  401. /* shuffle frames */
  402. FFSWAP(AVFrame, s->frame, s->prev_frame);
  403. if (s->frame.data[0])
  404. avctx->release_buffer(avctx, &s->frame);
  405. *data_size = sizeof(AVFrame);
  406. *(AVFrame*)data = s->prev_frame;
  407. /* report that the buffer was completely consumed */
  408. return buf_size;
  409. }
  410. static av_cold int vmdvideo_decode_end(AVCodecContext *avctx)
  411. {
  412. VmdVideoContext *s = avctx->priv_data;
  413. if (s->prev_frame.data[0])
  414. avctx->release_buffer(avctx, &s->prev_frame);
  415. av_free(s->unpack_buffer);
  416. return 0;
  417. }
  418. /*
  419. * Audio Decoder
  420. */
  421. typedef struct VmdAudioContext {
  422. AVCodecContext *avctx;
  423. int channels;
  424. int bits;
  425. int block_align;
  426. int predictors[2];
  427. } VmdAudioContext;
  428. static const uint16_t vmdaudio_table[128] = {
  429. 0x000, 0x008, 0x010, 0x020, 0x030, 0x040, 0x050, 0x060, 0x070, 0x080,
  430. 0x090, 0x0A0, 0x0B0, 0x0C0, 0x0D0, 0x0E0, 0x0F0, 0x100, 0x110, 0x120,
  431. 0x130, 0x140, 0x150, 0x160, 0x170, 0x180, 0x190, 0x1A0, 0x1B0, 0x1C0,
  432. 0x1D0, 0x1E0, 0x1F0, 0x200, 0x208, 0x210, 0x218, 0x220, 0x228, 0x230,
  433. 0x238, 0x240, 0x248, 0x250, 0x258, 0x260, 0x268, 0x270, 0x278, 0x280,
  434. 0x288, 0x290, 0x298, 0x2A0, 0x2A8, 0x2B0, 0x2B8, 0x2C0, 0x2C8, 0x2D0,
  435. 0x2D8, 0x2E0, 0x2E8, 0x2F0, 0x2F8, 0x300, 0x308, 0x310, 0x318, 0x320,
  436. 0x328, 0x330, 0x338, 0x340, 0x348, 0x350, 0x358, 0x360, 0x368, 0x370,
  437. 0x378, 0x380, 0x388, 0x390, 0x398, 0x3A0, 0x3A8, 0x3B0, 0x3B8, 0x3C0,
  438. 0x3C8, 0x3D0, 0x3D8, 0x3E0, 0x3E8, 0x3F0, 0x3F8, 0x400, 0x440, 0x480,
  439. 0x4C0, 0x500, 0x540, 0x580, 0x5C0, 0x600, 0x640, 0x680, 0x6C0, 0x700,
  440. 0x740, 0x780, 0x7C0, 0x800, 0x900, 0xA00, 0xB00, 0xC00, 0xD00, 0xE00,
  441. 0xF00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x3000, 0x4000
  442. };
  443. static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
  444. {
  445. VmdAudioContext *s = avctx->priv_data;
  446. s->avctx = avctx;
  447. s->channels = avctx->channels;
  448. s->bits = avctx->bits_per_coded_sample;
  449. s->block_align = avctx->block_align;
  450. avctx->sample_fmt = SAMPLE_FMT_S16;
  451. av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
  452. s->channels, s->bits, s->block_align, avctx->sample_rate);
  453. return 0;
  454. }
  455. static void vmdaudio_decode_audio(VmdAudioContext *s, unsigned char *data,
  456. const uint8_t *buf, int buf_size, int stereo)
  457. {
  458. int i;
  459. int chan = 0;
  460. int16_t *out = (int16_t*)data;
  461. for(i = 0; i < buf_size; i++) {
  462. if(buf[i] & 0x80)
  463. s->predictors[chan] -= vmdaudio_table[buf[i] & 0x7F];
  464. else
  465. s->predictors[chan] += vmdaudio_table[buf[i]];
  466. s->predictors[chan] = av_clip_int16(s->predictors[chan]);
  467. out[i] = s->predictors[chan];
  468. chan ^= stereo;
  469. }
  470. }
  471. static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
  472. const uint8_t *buf, int silence, int data_size)
  473. {
  474. int bytes_decoded = 0;
  475. int i;
  476. // if (silence)
  477. // av_log(s->avctx, AV_LOG_INFO, "silent block!\n");
  478. if (s->channels == 2) {
  479. /* stereo handling */
  480. if (silence) {
  481. memset(data, 0, data_size * 2);
  482. } else {
  483. if (s->bits == 16)
  484. vmdaudio_decode_audio(s, data, buf, data_size, 1);
  485. else {
  486. /* copy the data but convert it to signed */
  487. for (i = 0; i < data_size; i++){
  488. *data++ = buf[i] + 0x80;
  489. *data++ = buf[i] + 0x80;
  490. }
  491. }
  492. }
  493. } else {
  494. bytes_decoded = data_size * 2;
  495. /* mono handling */
  496. if (silence) {
  497. memset(data, 0, data_size * 2);
  498. } else {
  499. if (s->bits == 16) {
  500. vmdaudio_decode_audio(s, data, buf, data_size, 0);
  501. } else {
  502. /* copy the data but convert it to signed */
  503. for (i = 0; i < data_size; i++){
  504. *data++ = buf[i] + 0x80;
  505. *data++ = buf[i] + 0x80;
  506. }
  507. }
  508. }
  509. }
  510. return data_size * 2;
  511. }
  512. static int vmdaudio_decode_frame(AVCodecContext *avctx,
  513. void *data, int *data_size,
  514. const uint8_t *buf, int buf_size)
  515. {
  516. VmdAudioContext *s = avctx->priv_data;
  517. unsigned char *output_samples = (unsigned char *)data;
  518. /* point to the start of the encoded data */
  519. const unsigned char *p = buf + 16;
  520. if (buf_size < 16)
  521. return buf_size;
  522. if (buf[6] == 1) {
  523. /* the chunk contains audio */
  524. *data_size = vmdaudio_loadsound(s, output_samples, p, 0, buf_size - 16);
  525. } else if (buf[6] == 2) {
  526. /* initial chunk, may contain audio and silence */
  527. uint32_t flags = AV_RB32(p);
  528. int raw_block_size = s->block_align * s->bits / 8;
  529. int silent_chunks;
  530. if(flags == 0xFFFFFFFF)
  531. silent_chunks = 32;
  532. else
  533. silent_chunks = av_log2(flags + 1);
  534. if(*data_size < (s->block_align*silent_chunks + buf_size - 20) * 2)
  535. return -1;
  536. *data_size = 0;
  537. memset(output_samples, 0, raw_block_size * silent_chunks);
  538. output_samples += raw_block_size * silent_chunks;
  539. *data_size = raw_block_size * silent_chunks;
  540. *data_size += vmdaudio_loadsound(s, output_samples, p + 4, 0, buf_size - 20);
  541. } else if (buf[6] == 3) {
  542. /* silent chunk */
  543. *data_size = vmdaudio_loadsound(s, output_samples, p, 1, 0);
  544. }
  545. return buf_size;
  546. }
  547. /*
  548. * Public Data Structures
  549. */
  550. AVCodec vmdvideo_decoder = {
  551. "vmdvideo",
  552. CODEC_TYPE_VIDEO,
  553. CODEC_ID_VMDVIDEO,
  554. sizeof(VmdVideoContext),
  555. vmdvideo_decode_init,
  556. NULL,
  557. vmdvideo_decode_end,
  558. vmdvideo_decode_frame,
  559. CODEC_CAP_DR1,
  560. .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD video"),
  561. };
  562. AVCodec vmdaudio_decoder = {
  563. "vmdaudio",
  564. CODEC_TYPE_AUDIO,
  565. CODEC_ID_VMDAUDIO,
  566. sizeof(VmdAudioContext),
  567. vmdaudio_decode_init,
  568. NULL,
  569. NULL,
  570. vmdaudio_decode_frame,
  571. .long_name = NULL_IF_CONFIG_SMALL("Sierra VMD audio"),
  572. };