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.

632 lines
21KB

  1. /*
  2. * ALAC (Apple Lossless Audio Codec) decoder
  3. * Copyright (c) 2005 David Hammerton
  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. * ALAC (Apple Lossless Audio Codec) decoder
  24. * @author 2005 David Hammerton
  25. * @see http://crazney.net/programs/itunes/alac.html
  26. *
  27. * Note: This decoder expects a 36-byte QuickTime atom to be
  28. * passed through the extradata[_size] fields. This atom is tacked onto
  29. * the end of an 'alac' stsd atom and has the following format:
  30. *
  31. * 32 bits atom size
  32. * 32 bits tag ("alac")
  33. * 32 bits tag version (0)
  34. * 32 bits samples per frame (used when not set explicitly in the frames)
  35. * 8 bits compatible version (0)
  36. * 8 bits sample size
  37. * 8 bits history mult (40)
  38. * 8 bits initial history (10)
  39. * 8 bits rice param limit (14)
  40. * 8 bits channels
  41. * 16 bits maxRun (255)
  42. * 32 bits max coded frame size (0 means unknown)
  43. * 32 bits average bitrate (0 means unknown)
  44. * 32 bits samplerate
  45. */
  46. #include <inttypes.h>
  47. #include "libavutil/channel_layout.h"
  48. #include "libavutil/opt.h"
  49. #include "avcodec.h"
  50. #include "get_bits.h"
  51. #include "bytestream.h"
  52. #include "internal.h"
  53. #include "thread.h"
  54. #include "unary.h"
  55. #include "mathops.h"
  56. #include "alac_data.h"
  57. #include "alacdsp.h"
  58. #define ALAC_EXTRADATA_SIZE 36
  59. typedef struct ALACContext {
  60. AVClass *class;
  61. AVCodecContext *avctx;
  62. GetBitContext gb;
  63. int channels;
  64. int32_t *predict_error_buffer[2];
  65. int32_t *output_samples_buffer[2];
  66. int32_t *extra_bits_buffer[2];
  67. uint32_t max_samples_per_frame;
  68. uint8_t sample_size;
  69. uint8_t rice_history_mult;
  70. uint8_t rice_initial_history;
  71. uint8_t rice_limit;
  72. int sample_rate;
  73. int extra_bits; /**< number of extra bits beyond 16-bit */
  74. int nb_samples; /**< number of samples in the current frame */
  75. int direct_output;
  76. int extra_bit_bug;
  77. ALACDSPContext dsp;
  78. } ALACContext;
  79. static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps)
  80. {
  81. unsigned int x = get_unary_0_9(gb);
  82. if (x > 8) { /* RICE THRESHOLD */
  83. /* use alternative encoding */
  84. x = get_bits_long(gb, bps);
  85. } else if (k != 1) {
  86. int extrabits = show_bits(gb, k);
  87. /* multiply x by 2^k - 1, as part of their strange algorithm */
  88. x = (x << k) - x;
  89. if (extrabits > 1) {
  90. x += extrabits - 1;
  91. skip_bits(gb, k);
  92. } else
  93. skip_bits(gb, k - 1);
  94. }
  95. return x;
  96. }
  97. static int rice_decompress(ALACContext *alac, int32_t *output_buffer,
  98. int nb_samples, int bps, int rice_history_mult)
  99. {
  100. int i;
  101. unsigned int history = alac->rice_initial_history;
  102. int sign_modifier = 0;
  103. for (i = 0; i < nb_samples; i++) {
  104. int k;
  105. unsigned int x;
  106. if(get_bits_left(&alac->gb) <= 0)
  107. return AVERROR_INVALIDDATA;
  108. /* calculate rice param and decode next value */
  109. k = av_log2((history >> 9) + 3);
  110. k = FFMIN(k, alac->rice_limit);
  111. x = decode_scalar(&alac->gb, k, bps);
  112. x += sign_modifier;
  113. sign_modifier = 0;
  114. output_buffer[i] = (x >> 1) ^ -(x & 1);
  115. /* update the history */
  116. if (x > 0xffff)
  117. history = 0xffff;
  118. else
  119. history += x * rice_history_mult -
  120. ((history * rice_history_mult) >> 9);
  121. /* special case: there may be compressed blocks of 0 */
  122. if ((history < 128) && (i + 1 < nb_samples)) {
  123. int block_size;
  124. /* calculate rice param and decode block size */
  125. k = 7 - av_log2(history) + ((history + 16) >> 6);
  126. k = FFMIN(k, alac->rice_limit);
  127. block_size = decode_scalar(&alac->gb, k, 16);
  128. if (block_size > 0) {
  129. if (block_size >= nb_samples - i) {
  130. av_log(alac->avctx, AV_LOG_ERROR,
  131. "invalid zero block size of %d %d %d\n", block_size,
  132. nb_samples, i);
  133. block_size = nb_samples - i - 1;
  134. }
  135. memset(&output_buffer[i + 1], 0,
  136. block_size * sizeof(*output_buffer));
  137. i += block_size;
  138. }
  139. if (block_size <= 0xffff)
  140. sign_modifier = 1;
  141. history = 0;
  142. }
  143. }
  144. return 0;
  145. }
  146. static inline int sign_only(int v)
  147. {
  148. return v ? FFSIGN(v) : 0;
  149. }
  150. static void lpc_prediction(int32_t *error_buffer, uint32_t *buffer_out,
  151. int nb_samples, int bps, int16_t *lpc_coefs,
  152. int lpc_order, int lpc_quant)
  153. {
  154. int i;
  155. uint32_t *pred = buffer_out;
  156. /* first sample always copies */
  157. *buffer_out = *error_buffer;
  158. if (nb_samples <= 1)
  159. return;
  160. if (!lpc_order) {
  161. memcpy(&buffer_out[1], &error_buffer[1],
  162. (nb_samples - 1) * sizeof(*buffer_out));
  163. return;
  164. }
  165. if (lpc_order == 31) {
  166. /* simple 1st-order prediction */
  167. for (i = 1; i < nb_samples; i++) {
  168. buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i],
  169. bps);
  170. }
  171. return;
  172. }
  173. /* read warm-up samples */
  174. for (i = 1; i <= lpc_order && i < nb_samples; i++)
  175. buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i], bps);
  176. /* NOTE: 4 and 8 are very common cases that could be optimized. */
  177. for (; i < nb_samples; i++) {
  178. int j;
  179. int val = 0;
  180. unsigned error_val = error_buffer[i];
  181. int error_sign;
  182. int d = *pred++;
  183. /* LPC prediction */
  184. for (j = 0; j < lpc_order; j++)
  185. val += (pred[j] - d) * lpc_coefs[j];
  186. val = (val + (1LL << (lpc_quant - 1))) >> lpc_quant;
  187. val += d + error_val;
  188. buffer_out[i] = sign_extend(val, bps);
  189. /* adapt LPC coefficients */
  190. error_sign = sign_only(error_val);
  191. if (error_sign) {
  192. for (j = 0; j < lpc_order && (int)(error_val * error_sign) > 0; j++) {
  193. int sign;
  194. val = d - pred[j];
  195. sign = sign_only(val) * error_sign;
  196. lpc_coefs[j] -= sign;
  197. val *= (unsigned)sign;
  198. error_val -= (val >> lpc_quant) * (j + 1U);
  199. }
  200. }
  201. }
  202. }
  203. static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
  204. int channels)
  205. {
  206. ALACContext *alac = avctx->priv_data;
  207. int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret;
  208. uint32_t output_samples;
  209. int i, ch;
  210. skip_bits(&alac->gb, 4); /* element instance tag */
  211. skip_bits(&alac->gb, 12); /* unused header bits */
  212. /* the number of output samples is stored in the frame */
  213. has_size = get_bits1(&alac->gb);
  214. alac->extra_bits = get_bits(&alac->gb, 2) << 3;
  215. bps = alac->sample_size - alac->extra_bits + channels - 1;
  216. if (bps > 32) {
  217. avpriv_report_missing_feature(avctx, "bps %d", bps);
  218. return AVERROR_PATCHWELCOME;
  219. }
  220. if (bps < 1)
  221. return AVERROR_INVALIDDATA;
  222. /* whether the frame is compressed */
  223. is_compressed = !get_bits1(&alac->gb);
  224. if (has_size)
  225. output_samples = get_bits_long(&alac->gb, 32);
  226. else
  227. output_samples = alac->max_samples_per_frame;
  228. if (!output_samples || output_samples > alac->max_samples_per_frame) {
  229. av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %"PRIu32"\n",
  230. output_samples);
  231. return AVERROR_INVALIDDATA;
  232. }
  233. if (!alac->nb_samples) {
  234. ThreadFrame tframe = { .f = frame };
  235. /* get output buffer */
  236. frame->nb_samples = output_samples;
  237. if ((ret = ff_thread_get_buffer(avctx, &tframe, 0)) < 0)
  238. return ret;
  239. } else if (output_samples != alac->nb_samples) {
  240. av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %"PRIu32" != %d\n",
  241. output_samples, alac->nb_samples);
  242. return AVERROR_INVALIDDATA;
  243. }
  244. alac->nb_samples = output_samples;
  245. if (alac->direct_output) {
  246. for (ch = 0; ch < channels; ch++)
  247. alac->output_samples_buffer[ch] = (int32_t *)frame->extended_data[ch_index + ch];
  248. }
  249. if (is_compressed) {
  250. int16_t lpc_coefs[2][32];
  251. int lpc_order[2];
  252. int prediction_type[2];
  253. int lpc_quant[2];
  254. int rice_history_mult[2];
  255. if (!alac->rice_limit) {
  256. avpriv_request_sample(alac->avctx,
  257. "Compression with rice limit 0");
  258. return AVERROR(ENOSYS);
  259. }
  260. decorr_shift = get_bits(&alac->gb, 8);
  261. decorr_left_weight = get_bits(&alac->gb, 8);
  262. if (channels == 2 && decorr_left_weight && decorr_shift > 31)
  263. return AVERROR_INVALIDDATA;
  264. for (ch = 0; ch < channels; ch++) {
  265. prediction_type[ch] = get_bits(&alac->gb, 4);
  266. lpc_quant[ch] = get_bits(&alac->gb, 4);
  267. rice_history_mult[ch] = get_bits(&alac->gb, 3);
  268. lpc_order[ch] = get_bits(&alac->gb, 5);
  269. if (lpc_order[ch] >= alac->max_samples_per_frame || !lpc_quant[ch])
  270. return AVERROR_INVALIDDATA;
  271. /* read the predictor table */
  272. for (i = lpc_order[ch] - 1; i >= 0; i--)
  273. lpc_coefs[ch][i] = get_sbits(&alac->gb, 16);
  274. }
  275. if (alac->extra_bits) {
  276. for (i = 0; i < alac->nb_samples; i++) {
  277. if(get_bits_left(&alac->gb) <= 0)
  278. return AVERROR_INVALIDDATA;
  279. for (ch = 0; ch < channels; ch++)
  280. alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits);
  281. }
  282. }
  283. for (ch = 0; ch < channels; ch++) {
  284. int ret=rice_decompress(alac, alac->predict_error_buffer[ch],
  285. alac->nb_samples, bps,
  286. rice_history_mult[ch] * alac->rice_history_mult / 4);
  287. if(ret<0)
  288. return ret;
  289. /* adaptive FIR filter */
  290. if (prediction_type[ch] == 15) {
  291. /* Prediction type 15 runs the adaptive FIR twice.
  292. * The first pass uses the special-case coef_num = 31, while
  293. * the second pass uses the coefs from the bitstream.
  294. *
  295. * However, this prediction type is not currently used by the
  296. * reference encoder.
  297. */
  298. lpc_prediction(alac->predict_error_buffer[ch],
  299. alac->predict_error_buffer[ch],
  300. alac->nb_samples, bps, NULL, 31, 0);
  301. } else if (prediction_type[ch] > 0) {
  302. av_log(avctx, AV_LOG_WARNING, "unknown prediction type: %i\n",
  303. prediction_type[ch]);
  304. }
  305. lpc_prediction(alac->predict_error_buffer[ch],
  306. alac->output_samples_buffer[ch], alac->nb_samples,
  307. bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]);
  308. }
  309. } else {
  310. /* not compressed, easy case */
  311. for (i = 0; i < alac->nb_samples; i++) {
  312. if(get_bits_left(&alac->gb) <= 0)
  313. return AVERROR_INVALIDDATA;
  314. for (ch = 0; ch < channels; ch++) {
  315. alac->output_samples_buffer[ch][i] =
  316. get_sbits_long(&alac->gb, alac->sample_size);
  317. }
  318. }
  319. alac->extra_bits = 0;
  320. decorr_shift = 0;
  321. decorr_left_weight = 0;
  322. }
  323. if (channels == 2) {
  324. if (alac->extra_bits && alac->extra_bit_bug) {
  325. alac->dsp.append_extra_bits[1](alac->output_samples_buffer, alac->extra_bits_buffer,
  326. alac->extra_bits, channels, alac->nb_samples);
  327. }
  328. if (decorr_left_weight) {
  329. alac->dsp.decorrelate_stereo(alac->output_samples_buffer, alac->nb_samples,
  330. decorr_shift, decorr_left_weight);
  331. }
  332. if (alac->extra_bits && !alac->extra_bit_bug) {
  333. alac->dsp.append_extra_bits[1](alac->output_samples_buffer, alac->extra_bits_buffer,
  334. alac->extra_bits, channels, alac->nb_samples);
  335. }
  336. } else if (alac->extra_bits) {
  337. alac->dsp.append_extra_bits[0](alac->output_samples_buffer, alac->extra_bits_buffer,
  338. alac->extra_bits, channels, alac->nb_samples);
  339. }
  340. switch(alac->sample_size) {
  341. case 16: {
  342. for (ch = 0; ch < channels; ch++) {
  343. int16_t *outbuffer = (int16_t *)frame->extended_data[ch_index + ch];
  344. for (i = 0; i < alac->nb_samples; i++)
  345. *outbuffer++ = alac->output_samples_buffer[ch][i];
  346. }}
  347. break;
  348. case 20: {
  349. for (ch = 0; ch < channels; ch++) {
  350. for (i = 0; i < alac->nb_samples; i++)
  351. alac->output_samples_buffer[ch][i] *= 1U << 12;
  352. }}
  353. break;
  354. case 24: {
  355. for (ch = 0; ch < channels; ch++) {
  356. for (i = 0; i < alac->nb_samples; i++)
  357. alac->output_samples_buffer[ch][i] *= 1U << 8;
  358. }}
  359. break;
  360. }
  361. return 0;
  362. }
  363. static int alac_decode_frame(AVCodecContext *avctx, void *data,
  364. int *got_frame_ptr, AVPacket *avpkt)
  365. {
  366. ALACContext *alac = avctx->priv_data;
  367. AVFrame *frame = data;
  368. enum AlacRawDataBlockType element;
  369. int channels;
  370. int ch, ret, got_end;
  371. if ((ret = init_get_bits8(&alac->gb, avpkt->data, avpkt->size)) < 0)
  372. return ret;
  373. got_end = 0;
  374. alac->nb_samples = 0;
  375. ch = 0;
  376. while (get_bits_left(&alac->gb) >= 3) {
  377. element = get_bits(&alac->gb, 3);
  378. if (element == TYPE_END) {
  379. got_end = 1;
  380. break;
  381. }
  382. if (element > TYPE_CPE && element != TYPE_LFE) {
  383. avpriv_report_missing_feature(avctx, "Syntax element %d", element);
  384. return AVERROR_PATCHWELCOME;
  385. }
  386. channels = (element == TYPE_CPE) ? 2 : 1;
  387. if (ch + channels > alac->channels ||
  388. ff_alac_channel_layout_offsets[alac->channels - 1][ch] + channels > alac->channels) {
  389. av_log(avctx, AV_LOG_ERROR, "invalid element channel count\n");
  390. return AVERROR_INVALIDDATA;
  391. }
  392. ret = decode_element(avctx, frame,
  393. ff_alac_channel_layout_offsets[alac->channels - 1][ch],
  394. channels);
  395. if (ret < 0 && get_bits_left(&alac->gb))
  396. return ret;
  397. ch += channels;
  398. }
  399. if (!got_end) {
  400. av_log(avctx, AV_LOG_ERROR, "no end tag found. incomplete packet.\n");
  401. return AVERROR_INVALIDDATA;
  402. }
  403. if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8) {
  404. av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n",
  405. avpkt->size * 8 - get_bits_count(&alac->gb));
  406. }
  407. if (alac->channels == ch && alac->nb_samples)
  408. *got_frame_ptr = 1;
  409. else
  410. av_log(avctx, AV_LOG_WARNING, "Failed to decode all channels\n");
  411. return avpkt->size;
  412. }
  413. static av_cold int alac_decode_close(AVCodecContext *avctx)
  414. {
  415. ALACContext *alac = avctx->priv_data;
  416. int ch;
  417. for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
  418. av_freep(&alac->predict_error_buffer[ch]);
  419. if (!alac->direct_output)
  420. av_freep(&alac->output_samples_buffer[ch]);
  421. av_freep(&alac->extra_bits_buffer[ch]);
  422. }
  423. return 0;
  424. }
  425. static int allocate_buffers(ALACContext *alac)
  426. {
  427. int ch;
  428. unsigned buf_size = alac->max_samples_per_frame * sizeof(int32_t);
  429. unsigned extra_buf_size = buf_size + AV_INPUT_BUFFER_PADDING_SIZE;
  430. for (ch = 0; ch < 2; ch++) {
  431. alac->predict_error_buffer[ch] = NULL;
  432. alac->output_samples_buffer[ch] = NULL;
  433. alac->extra_bits_buffer[ch] = NULL;
  434. }
  435. for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
  436. if (!(alac->predict_error_buffer[ch] = av_malloc(buf_size)))
  437. return AVERROR(ENOMEM);
  438. alac->direct_output = alac->sample_size > 16;
  439. if (!alac->direct_output) {
  440. if (!(alac->output_samples_buffer[ch] = av_malloc(extra_buf_size)))
  441. return AVERROR(ENOMEM);
  442. }
  443. if (!(alac->extra_bits_buffer[ch] = av_malloc(extra_buf_size)))
  444. return AVERROR(ENOMEM);
  445. }
  446. return 0;
  447. }
  448. static int alac_set_info(ALACContext *alac)
  449. {
  450. GetByteContext gb;
  451. bytestream2_init(&gb, alac->avctx->extradata,
  452. alac->avctx->extradata_size);
  453. bytestream2_skipu(&gb, 12); // size:4, alac:4, version:4
  454. alac->max_samples_per_frame = bytestream2_get_be32u(&gb);
  455. if (!alac->max_samples_per_frame ||
  456. alac->max_samples_per_frame > 4096 * 4096) {
  457. av_log(alac->avctx, AV_LOG_ERROR,
  458. "max samples per frame invalid: %"PRIu32"\n",
  459. alac->max_samples_per_frame);
  460. return AVERROR_INVALIDDATA;
  461. }
  462. bytestream2_skipu(&gb, 1); // compatible version
  463. alac->sample_size = bytestream2_get_byteu(&gb);
  464. alac->rice_history_mult = bytestream2_get_byteu(&gb);
  465. alac->rice_initial_history = bytestream2_get_byteu(&gb);
  466. alac->rice_limit = bytestream2_get_byteu(&gb);
  467. alac->channels = bytestream2_get_byteu(&gb);
  468. bytestream2_get_be16u(&gb); // maxRun
  469. bytestream2_get_be32u(&gb); // max coded frame size
  470. bytestream2_get_be32u(&gb); // average bitrate
  471. alac->sample_rate = bytestream2_get_be32u(&gb);
  472. return 0;
  473. }
  474. static av_cold int alac_decode_init(AVCodecContext * avctx)
  475. {
  476. int ret;
  477. ALACContext *alac = avctx->priv_data;
  478. alac->avctx = avctx;
  479. /* initialize from the extradata */
  480. if (alac->avctx->extradata_size < ALAC_EXTRADATA_SIZE) {
  481. av_log(avctx, AV_LOG_ERROR, "extradata is too small\n");
  482. return AVERROR_INVALIDDATA;
  483. }
  484. if ((ret = alac_set_info(alac)) < 0) {
  485. av_log(avctx, AV_LOG_ERROR, "set_info failed\n");
  486. return ret;
  487. }
  488. switch (alac->sample_size) {
  489. case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
  490. break;
  491. case 20:
  492. case 24:
  493. case 32: avctx->sample_fmt = AV_SAMPLE_FMT_S32P;
  494. break;
  495. default: avpriv_request_sample(avctx, "Sample depth %d", alac->sample_size);
  496. return AVERROR_PATCHWELCOME;
  497. }
  498. avctx->bits_per_raw_sample = alac->sample_size;
  499. avctx->sample_rate = alac->sample_rate;
  500. if (alac->channels < 1) {
  501. av_log(avctx, AV_LOG_WARNING, "Invalid channel count\n");
  502. alac->channels = avctx->channels;
  503. } else {
  504. if (alac->channels > ALAC_MAX_CHANNELS)
  505. alac->channels = avctx->channels;
  506. else
  507. avctx->channels = alac->channels;
  508. }
  509. if (avctx->channels > ALAC_MAX_CHANNELS || avctx->channels <= 0 ) {
  510. avpriv_report_missing_feature(avctx, "Channel count %d",
  511. avctx->channels);
  512. return AVERROR_PATCHWELCOME;
  513. }
  514. avctx->channel_layout = ff_alac_channel_layouts[alac->channels - 1];
  515. if ((ret = allocate_buffers(alac)) < 0) {
  516. av_log(avctx, AV_LOG_ERROR, "Error allocating buffers\n");
  517. return ret;
  518. }
  519. ff_alacdsp_init(&alac->dsp);
  520. return 0;
  521. }
  522. static const AVOption options[] = {
  523. { "extra_bits_bug", "Force non-standard decoding process",
  524. offsetof(ALACContext, extra_bit_bug), AV_OPT_TYPE_BOOL, { .i64 = 0 },
  525. 0, 1, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM },
  526. { NULL },
  527. };
  528. static const AVClass alac_class = {
  529. .class_name = "alac",
  530. .item_name = av_default_item_name,
  531. .option = options,
  532. .version = LIBAVUTIL_VERSION_INT,
  533. };
  534. AVCodec ff_alac_decoder = {
  535. .name = "alac",
  536. .long_name = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
  537. .type = AVMEDIA_TYPE_AUDIO,
  538. .id = AV_CODEC_ID_ALAC,
  539. .priv_data_size = sizeof(ALACContext),
  540. .init = alac_decode_init,
  541. .close = alac_decode_close,
  542. .decode = alac_decode_frame,
  543. .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
  544. .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
  545. .priv_class = &alac_class
  546. };