]> git.sesse.net Git - ffmpeg/blob - libavcodec/alac.c
alac: drop packed sample output support with the next major bump
[ffmpeg] / libavcodec / alac.c
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 /**
23  * @file
24  * ALAC (Apple Lossless Audio Codec) decoder
25  * @author 2005 David Hammerton
26  * @see http://crazney.net/programs/itunes/alac.html
27  *
28  * Note: This decoder expects a 36-byte QuickTime atom to be
29  * passed through the extradata[_size] fields. This atom is tacked onto
30  * the end of an 'alac' stsd atom and has the following format:
31  *
32  * 32bit  atom size
33  * 32bit  tag                  ("alac")
34  * 32bit  tag version          (0)
35  * 32bit  samples per frame    (used when not set explicitly in the frames)
36  *  8bit  compatible version   (0)
37  *  8bit  sample size
38  *  8bit  history mult         (40)
39  *  8bit  initial history      (14)
40  *  8bit  rice param limit     (10)
41  *  8bit  channels
42  * 16bit  maxRun               (255)
43  * 32bit  max coded frame size (0 means unknown)
44  * 32bit  average bitrate      (0 means unknown)
45  * 32bit  samplerate
46  */
47
48 #include "libavutil/audioconvert.h"
49 #include "avcodec.h"
50 #include "get_bits.h"
51 #include "bytestream.h"
52 #include "unary.h"
53 #include "mathops.h"
54
55 #define ALAC_EXTRADATA_SIZE 36
56 #define MAX_CHANNELS 8
57
58 typedef struct {
59     AVCodecContext *avctx;
60     AVFrame frame;
61     GetBitContext gb;
62     int channels;
63
64     int32_t *predict_error_buffer[2];
65     int32_t *output_samples_buffer[2];
66     int32_t *extra_bits_buffer[2];
67
68     uint32_t max_samples_per_frame;
69     uint8_t  sample_size;
70     uint8_t  rice_history_mult;
71     uint8_t  rice_initial_history;
72     uint8_t  rice_limit;
73
74     int extra_bits;     /**< number of extra bits beyond 16-bit */
75     int nb_samples;     /**< number of samples in the current frame */
76
77     int direct_output;
78 } ALACContext;
79
80 enum RawDataBlockType {
81     /* At the moment, only SCE, CPE, LFE, and END are recognized. */
82     TYPE_SCE,
83     TYPE_CPE,
84     TYPE_CCE,
85     TYPE_LFE,
86     TYPE_DSE,
87     TYPE_PCE,
88     TYPE_FIL,
89     TYPE_END
90 };
91
92 static const uint8_t alac_channel_layout_offsets[8][8] = {
93     { 0 },
94     { 0, 1 },
95     { 2, 0, 1 },
96     { 2, 0, 1, 3 },
97     { 2, 0, 1, 3, 4 },
98     { 2, 0, 1, 4, 5, 3 },
99     { 2, 0, 1, 4, 5, 6, 3 },
100     { 2, 6, 7, 0, 1, 4, 5, 3 }
101 };
102
103 static const uint16_t alac_channel_layouts[8] = {
104     AV_CH_LAYOUT_MONO,
105     AV_CH_LAYOUT_STEREO,
106     AV_CH_LAYOUT_SURROUND,
107     AV_CH_LAYOUT_4POINT0,
108     AV_CH_LAYOUT_5POINT0_BACK,
109     AV_CH_LAYOUT_5POINT1_BACK,
110     AV_CH_LAYOUT_6POINT1_BACK,
111     AV_CH_LAYOUT_7POINT1_WIDE_BACK
112 };
113
114 static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps)
115 {
116     unsigned int x = get_unary_0_9(gb);
117
118     if (x > 8) { /* RICE THRESHOLD */
119         /* use alternative encoding */
120         x = get_bits_long(gb, bps);
121     } else if (k != 1) {
122         int extrabits = show_bits(gb, k);
123
124         /* multiply x by 2^k - 1, as part of their strange algorithm */
125         x = (x << k) - x;
126
127         if (extrabits > 1) {
128             x += extrabits - 1;
129             skip_bits(gb, k);
130         } else
131             skip_bits(gb, k - 1);
132     }
133     return x;
134 }
135
136 static int rice_decompress(ALACContext *alac, int32_t *output_buffer,
137                             int nb_samples, int bps, int rice_history_mult)
138 {
139     int i;
140     unsigned int history = alac->rice_initial_history;
141     int sign_modifier = 0;
142
143     for (i = 0; i < nb_samples; i++) {
144         int k;
145         unsigned int x;
146
147         if(get_bits_left(&alac->gb) <= 0)
148             return -1;
149
150         /* calculate rice param and decode next value */
151         k = av_log2((history >> 9) + 3);
152         k = FFMIN(k, alac->rice_limit);
153         x = decode_scalar(&alac->gb, k, bps);
154         x += sign_modifier;
155         sign_modifier = 0;
156         output_buffer[i] = (x >> 1) ^ -(x & 1);
157
158         /* update the history */
159         if (x > 0xffff)
160             history = 0xffff;
161         else
162             history +=         x * rice_history_mult -
163                        ((history * rice_history_mult) >> 9);
164
165         /* special case: there may be compressed blocks of 0 */
166         if ((history < 128) && (i + 1 < nb_samples)) {
167             int block_size;
168
169             /* calculate rice param and decode block size */
170             k = 7 - av_log2(history) + ((history + 16) >> 6);
171             k = FFMIN(k, alac->rice_limit);
172             block_size = decode_scalar(&alac->gb, k, 16);
173
174             if (block_size > 0) {
175                 if (block_size >= nb_samples - i) {
176                     av_log(alac->avctx, AV_LOG_ERROR,
177                            "invalid zero block size of %d %d %d\n", block_size,
178                            nb_samples, i);
179                     block_size = nb_samples - i - 1;
180                 }
181                 memset(&output_buffer[i + 1], 0,
182                        block_size * sizeof(*output_buffer));
183                 i += block_size;
184             }
185             if (block_size <= 0xffff)
186                 sign_modifier = 1;
187             history = 0;
188         }
189     }
190     return 0;
191 }
192
193 static inline int sign_only(int v)
194 {
195     return v ? FFSIGN(v) : 0;
196 }
197
198 static void lpc_prediction(int32_t *error_buffer, int32_t *buffer_out,
199                            int nb_samples, int bps, int16_t *lpc_coefs,
200                            int lpc_order, int lpc_quant)
201 {
202     int i;
203
204     /* first sample always copies */
205     *buffer_out = *error_buffer;
206
207     if (nb_samples <= 1)
208         return;
209
210     if (!lpc_order) {
211         memcpy(&buffer_out[1], &error_buffer[1],
212                (nb_samples - 1) * sizeof(*buffer_out));
213         return;
214     }
215
216     if (lpc_order == 31) {
217         /* simple 1st-order prediction */
218         for (i = 1; i < nb_samples; i++) {
219             buffer_out[i] = sign_extend(buffer_out[i - 1] + error_buffer[i],
220                                         bps);
221         }
222         return;
223     }
224
225     /* read warm-up samples */
226     for (i = 0; i < lpc_order; i++) {
227         buffer_out[i + 1] = sign_extend(buffer_out[i] + error_buffer[i + 1],
228                                         bps);
229     }
230
231     /* NOTE: 4 and 8 are very common cases that could be optimized. */
232
233     for (i = lpc_order; i < nb_samples - 1; i++) {
234         int j;
235         int val = 0;
236         int error_val = error_buffer[i + 1];
237         int error_sign;
238         int d = buffer_out[i - lpc_order];
239
240         /* LPC prediction */
241         for (j = 0; j < lpc_order; j++)
242             val += (buffer_out[i - j] - d) * lpc_coefs[j];
243         val = (val + (1 << (lpc_quant - 1))) >> lpc_quant;
244         val += d + error_val;
245         buffer_out[i + 1] = sign_extend(val, bps);
246
247         /* adapt LPC coefficients */
248         error_sign = sign_only(error_val);
249         if (error_sign) {
250             for (j = lpc_order - 1; j >= 0 && error_val * error_sign > 0; j--) {
251                 int sign;
252                 val  = d - buffer_out[i - j];
253                 sign = sign_only(val) * error_sign;
254                 lpc_coefs[j] -= sign;
255                 val *= sign;
256                 error_val -= (val >> lpc_quant) * (lpc_order - j);
257             }
258         }
259     }
260 }
261
262 static void decorrelate_stereo(int32_t *buffer[2], int nb_samples,
263                                int decorr_shift, int decorr_left_weight)
264 {
265     int i;
266
267     for (i = 0; i < nb_samples; i++) {
268         int32_t a, b;
269
270         a = buffer[0][i];
271         b = buffer[1][i];
272
273         a -= (b * decorr_left_weight) >> decorr_shift;
274         b += a;
275
276         buffer[0][i] = b;
277         buffer[1][i] = a;
278     }
279 }
280
281 static void append_extra_bits(int32_t *buffer[2], int32_t *extra_bits_buffer[2],
282                               int extra_bits, int channels, int nb_samples)
283 {
284     int i, ch;
285
286     for (ch = 0; ch < channels; ch++)
287         for (i = 0; i < nb_samples; i++)
288             buffer[ch][i] = (buffer[ch][i] << extra_bits) | extra_bits_buffer[ch][i];
289 }
290
291 static int decode_element(AVCodecContext *avctx, void *data, int ch_index,
292                           int channels)
293 {
294     ALACContext *alac = avctx->priv_data;
295     int has_size, bps, is_compressed, decorr_shift, decorr_left_weight, ret;
296     uint32_t output_samples;
297     int i, ch;
298
299     skip_bits(&alac->gb, 4);  /* element instance tag */
300     skip_bits(&alac->gb, 12); /* unused header bits */
301
302     /* the number of output samples is stored in the frame */
303     has_size = get_bits1(&alac->gb);
304
305     alac->extra_bits = get_bits(&alac->gb, 2) << 3;
306     bps = alac->sample_size - alac->extra_bits + channels - 1;
307     if (bps > 32) {
308         av_log(avctx, AV_LOG_ERROR, "bps is unsupported: %d\n", bps);
309         return AVERROR_PATCHWELCOME;
310     }
311
312     /* whether the frame is compressed */
313     is_compressed = !get_bits1(&alac->gb);
314
315     if (has_size)
316         output_samples = get_bits_long(&alac->gb, 32);
317     else
318         output_samples = alac->max_samples_per_frame;
319     if (!output_samples || output_samples > alac->max_samples_per_frame) {
320         av_log(avctx, AV_LOG_ERROR, "invalid samples per frame: %d\n",
321                output_samples);
322         return AVERROR_INVALIDDATA;
323     }
324     if (!alac->nb_samples) {
325         /* get output buffer */
326         alac->frame.nb_samples = output_samples;
327         if ((ret = avctx->get_buffer(avctx, &alac->frame)) < 0) {
328             av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
329             return ret;
330         }
331         if (alac->direct_output) {
332             for (ch = 0; ch < channels; ch++)
333                 alac->output_samples_buffer[ch] = (int32_t *)alac->frame.extended_data[ch_index + ch];
334         }
335     } else if (output_samples != alac->nb_samples) {
336         av_log(avctx, AV_LOG_ERROR, "sample count mismatch: %u != %d\n",
337                output_samples, alac->nb_samples);
338         return AVERROR_INVALIDDATA;
339     }
340     alac->nb_samples = output_samples;
341
342     if (is_compressed) {
343         int16_t lpc_coefs[2][32];
344         int lpc_order[2];
345         int prediction_type[2];
346         int lpc_quant[2];
347         int rice_history_mult[2];
348
349         decorr_shift       = get_bits(&alac->gb, 8);
350         decorr_left_weight = get_bits(&alac->gb, 8);
351
352         for (ch = 0; ch < channels; ch++) {
353             prediction_type[ch]   = get_bits(&alac->gb, 4);
354             lpc_quant[ch]         = get_bits(&alac->gb, 4);
355             rice_history_mult[ch] = get_bits(&alac->gb, 3);
356             lpc_order[ch]         = get_bits(&alac->gb, 5);
357
358             /* read the predictor table */
359             for (i = 0; i < lpc_order[ch]; i++)
360                 lpc_coefs[ch][i] = get_sbits(&alac->gb, 16);
361         }
362
363         if (alac->extra_bits) {
364             for (i = 0; i < alac->nb_samples; i++) {
365                 if(get_bits_left(&alac->gb) <= 0)
366                     return -1;
367                 for (ch = 0; ch < channels; ch++)
368                     alac->extra_bits_buffer[ch][i] = get_bits(&alac->gb, alac->extra_bits);
369             }
370         }
371         for (ch = 0; ch < channels; ch++) {
372             int ret=rice_decompress(alac, alac->predict_error_buffer[ch],
373                             alac->nb_samples, bps,
374                             rice_history_mult[ch] * alac->rice_history_mult / 4);
375             if(ret<0)
376                 return ret;
377
378             /* adaptive FIR filter */
379             if (prediction_type[ch] == 15) {
380                 /* Prediction type 15 runs the adaptive FIR twice.
381                  * The first pass uses the special-case coef_num = 31, while
382                  * the second pass uses the coefs from the bitstream.
383                  *
384                  * However, this prediction type is not currently used by the
385                  * reference encoder.
386                  */
387                 lpc_prediction(alac->predict_error_buffer[ch],
388                                alac->predict_error_buffer[ch],
389                                alac->nb_samples, bps, NULL, 31, 0);
390             } else if (prediction_type[ch] > 0) {
391                 av_log(avctx, AV_LOG_WARNING, "unknown prediction type: %i\n",
392                        prediction_type[ch]);
393             }
394             lpc_prediction(alac->predict_error_buffer[ch],
395                            alac->output_samples_buffer[ch], alac->nb_samples,
396                            bps, lpc_coefs[ch], lpc_order[ch], lpc_quant[ch]);
397         }
398     } else {
399         /* not compressed, easy case */
400         for (i = 0; i < alac->nb_samples; i++) {
401             if(get_bits_left(&alac->gb) <= 0)
402                 return -1;
403             for (ch = 0; ch < channels; ch++) {
404                 alac->output_samples_buffer[ch][i] =
405                          get_sbits_long(&alac->gb, alac->sample_size);
406             }
407         }
408         alac->extra_bits   = 0;
409         decorr_shift       = 0;
410         decorr_left_weight = 0;
411     }
412
413     if (channels == 2 && decorr_left_weight) {
414         decorrelate_stereo(alac->output_samples_buffer, alac->nb_samples,
415                            decorr_shift, decorr_left_weight);
416     }
417
418     if (alac->extra_bits) {
419         append_extra_bits(alac->output_samples_buffer, alac->extra_bits_buffer,
420                           alac->extra_bits, channels, alac->nb_samples);
421     }
422
423     if(av_sample_fmt_is_planar(avctx->sample_fmt)) {
424     switch(alac->sample_size) {
425     case 16: {
426         for (ch = 0; ch < channels; ch++) {
427             int16_t *outbuffer = (int16_t *)alac->frame.extended_data[ch_index + ch];
428             for (i = 0; i < alac->nb_samples; i++)
429                 *outbuffer++ = alac->output_samples_buffer[ch][i];
430         }}
431         break;
432     case 24: {
433         for (ch = 0; ch < channels; ch++) {
434             for (i = 0; i < alac->nb_samples; i++)
435                 alac->output_samples_buffer[ch][i] <<= 8;
436         }}
437         break;
438     }
439     }else{
440         switch(alac->sample_size) {
441         case 16: {
442             int16_t *outbuffer = ((int16_t *)alac->frame.extended_data[0]) + ch_index;
443             for (i = 0; i < alac->nb_samples; i++)
444                 for (ch = 0; ch < channels; ch++)
445                     *outbuffer++ = alac->output_samples_buffer[ch][i];
446             }
447             break;
448         case 24: {
449             int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
450             for (i = 0; i < alac->nb_samples; i++)
451                 for (ch = 0; ch < channels; ch++)
452                     *outbuffer++ = alac->output_samples_buffer[ch][i] << 8;
453             }
454             break;
455         case 32: {
456             int32_t *outbuffer = ((int32_t *)alac->frame.extended_data[0]) + ch_index;
457             for (i = 0; i < alac->nb_samples; i++)
458                 for (ch = 0; ch < channels; ch++)
459                     *outbuffer++ = alac->output_samples_buffer[ch][i];
460             }
461             break;
462         }
463     }
464
465     return 0;
466 }
467
468 static int alac_decode_frame(AVCodecContext *avctx, void *data,
469                              int *got_frame_ptr, AVPacket *avpkt)
470 {
471     ALACContext *alac = avctx->priv_data;
472     enum RawDataBlockType element;
473     int channels;
474     int ch, ret;
475
476     init_get_bits(&alac->gb, avpkt->data, avpkt->size * 8);
477
478     alac->nb_samples = 0;
479     ch = 0;
480     while (get_bits_left(&alac->gb)) {
481         element = get_bits(&alac->gb, 3);
482         if (element == TYPE_END)
483             break;
484         if (element > TYPE_CPE && element != TYPE_LFE) {
485             av_log(avctx, AV_LOG_ERROR, "syntax element unsupported: %d", element);
486             return AVERROR_PATCHWELCOME;
487         }
488
489         channels = (element == TYPE_CPE) ? 2 : 1;
490         if (ch + channels > alac->channels) {
491             av_log(avctx, AV_LOG_ERROR, "invalid element channel count\n");
492             return AVERROR_INVALIDDATA;
493         }
494
495         ret = decode_element(avctx, data,
496                              alac_channel_layout_offsets[alac->channels - 1][ch],
497                              channels);
498         if (ret < 0)
499             return ret;
500
501         ch += channels;
502     }
503
504     if (avpkt->size * 8 - get_bits_count(&alac->gb) > 8) {
505         av_log(avctx, AV_LOG_ERROR, "Error : %d bits left\n",
506                avpkt->size * 8 - get_bits_count(&alac->gb));
507     }
508
509     *got_frame_ptr   = 1;
510     *(AVFrame *)data = alac->frame;
511
512     return avpkt->size;
513 }
514
515 static av_cold int alac_decode_close(AVCodecContext *avctx)
516 {
517     ALACContext *alac = avctx->priv_data;
518
519     int ch;
520     for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
521         av_freep(&alac->predict_error_buffer[ch]);
522         if (!alac->direct_output)
523             av_freep(&alac->output_samples_buffer[ch]);
524         av_freep(&alac->extra_bits_buffer[ch]);
525     }
526
527     return 0;
528 }
529
530 static int allocate_buffers(ALACContext *alac)
531 {
532     int ch;
533     int buf_size = alac->max_samples_per_frame * sizeof(int32_t);
534
535     for (ch = 0; ch < FFMIN(alac->channels, 2); ch++) {
536         FF_ALLOC_OR_GOTO(alac->avctx, alac->predict_error_buffer[ch],
537                          buf_size, buf_alloc_fail);
538
539         alac->direct_output = alac->sample_size > 16 && av_sample_fmt_is_planar(alac->avctx->sample_fmt);
540         if (!alac->direct_output) {
541             FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],
542                              buf_size, buf_alloc_fail);
543         }
544
545         FF_ALLOC_OR_GOTO(alac->avctx, alac->extra_bits_buffer[ch],
546                          buf_size, buf_alloc_fail);
547     }
548     return 0;
549 buf_alloc_fail:
550     alac_decode_close(alac->avctx);
551     return AVERROR(ENOMEM);
552 }
553
554 static int alac_set_info(ALACContext *alac)
555 {
556     GetByteContext gb;
557
558     bytestream2_init(&gb, alac->avctx->extradata,
559                      alac->avctx->extradata_size);
560
561     bytestream2_skipu(&gb, 12); // size:4, alac:4, version:4
562
563     alac->max_samples_per_frame = bytestream2_get_be32u(&gb);
564     if (!alac->max_samples_per_frame || alac->max_samples_per_frame > INT_MAX) {
565         av_log(alac->avctx, AV_LOG_ERROR, "max samples per frame invalid: %u\n",
566                alac->max_samples_per_frame);
567         return AVERROR_INVALIDDATA;
568     }
569     bytestream2_skipu(&gb, 1);  // compatible version
570     alac->sample_size          = bytestream2_get_byteu(&gb);
571     alac->rice_history_mult    = bytestream2_get_byteu(&gb);
572     alac->rice_initial_history = bytestream2_get_byteu(&gb);
573     alac->rice_limit           = bytestream2_get_byteu(&gb);
574     alac->channels             = bytestream2_get_byteu(&gb);
575     bytestream2_get_be16u(&gb); // maxRun
576     bytestream2_get_be32u(&gb); // max coded frame size
577     bytestream2_get_be32u(&gb); // average bitrate
578     bytestream2_get_be32u(&gb); // samplerate
579
580     return 0;
581 }
582
583 static av_cold int alac_decode_init(AVCodecContext * avctx)
584 {
585     int ret;
586     int req_packed;
587     ALACContext *alac = avctx->priv_data;
588     alac->avctx = avctx;
589
590     /* initialize from the extradata */
591     if (alac->avctx->extradata_size != ALAC_EXTRADATA_SIZE) {
592         av_log(avctx, AV_LOG_ERROR, "alac: expected %d extradata bytes\n",
593             ALAC_EXTRADATA_SIZE);
594         return -1;
595     }
596     if (alac_set_info(alac)) {
597         av_log(avctx, AV_LOG_ERROR, "alac: set_info failed\n");
598         return -1;
599     }
600
601     req_packed = LIBAVCODEC_VERSION_MAJOR < 55 && !av_sample_fmt_is_planar(avctx->request_sample_fmt);
602     switch (alac->sample_size) {
603     case 16: avctx->sample_fmt = req_packed ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_S16P;
604              break;
605     case 24:
606     case 32: avctx->sample_fmt = req_packed ? AV_SAMPLE_FMT_S32 : AV_SAMPLE_FMT_S32P;
607              break;
608     default: av_log_ask_for_sample(avctx, "Sample depth %d is not supported.\n",
609                                    alac->sample_size);
610              return AVERROR_PATCHWELCOME;
611     }
612
613     if (alac->channels < 1) {
614         av_log(avctx, AV_LOG_WARNING, "Invalid channel count\n");
615         alac->channels = avctx->channels;
616     } else {
617         if (alac->channels > MAX_CHANNELS)
618             alac->channels = avctx->channels;
619         else
620             avctx->channels = alac->channels;
621     }
622     if (avctx->channels > MAX_CHANNELS) {
623         av_log(avctx, AV_LOG_ERROR, "Unsupported channel count: %d\n",
624                avctx->channels);
625         return AVERROR_PATCHWELCOME;
626     }
627     avctx->channel_layout = alac_channel_layouts[alac->channels - 1];
628
629     if ((ret = allocate_buffers(alac)) < 0) {
630         av_log(avctx, AV_LOG_ERROR, "Error allocating buffers\n");
631         return ret;
632     }
633
634     avcodec_get_frame_defaults(&alac->frame);
635     avctx->coded_frame = &alac->frame;
636
637     return 0;
638 }
639
640 AVCodec ff_alac_decoder = {
641     .name           = "alac",
642     .type           = AVMEDIA_TYPE_AUDIO,
643     .id             = CODEC_ID_ALAC,
644     .priv_data_size = sizeof(ALACContext),
645     .init           = alac_decode_init,
646     .close          = alac_decode_close,
647     .decode         = alac_decode_frame,
648     .capabilities   = CODEC_CAP_DR1,
649     .long_name      = NULL_IF_CONFIG_SMALL("ALAC (Apple Lossless Audio Codec)"),
650 };