3 * Copyright (c) 2006 Konstantin Shishkov
5 * This file is part of FFmpeg.
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.
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.
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
28 * Based on http://wiki.multimedia.cx/index.php?title=Smacker
33 #include "libavutil/channel_layout.h"
34 #include "libavutil/mem.h"
38 #define SMKTREE_BITS 9
39 #define SMK_NODE 0x80000000
41 #define SMKTREE_DECODE_MAX_RECURSION FFMIN(32, 3 * SMKTREE_BITS)
42 #define SMKTREE_DECODE_BIG_MAX_RECURSION 500
44 /* The maximum possible unchecked overread happens in decode_header_trees:
45 * Decoding the MMAP tree can overread by 6 * SMKTREE_BITS + 1, followed by
46 * three get_bits1, followed by at most 2 + 3 * 16 read bits when reading
47 * the TYPE tree before the next check. 64 is because of 64 bit reads. */
48 #if (6 * SMKTREE_BITS + 1 + 3 + (2 + 3 * 16) + 64) <= 8 * AV_INPUT_BUFFER_PADDING_SIZE
49 #define UNCHECKED_BITSTREAM_READER 1
51 #define BITSTREAM_READER_LE
52 #include "bytestream.h"
53 #include "codec_internal.h"
57 typedef struct SmackVContext
{
58 AVCodecContext
*avctx
;
61 int *mmap_tbl
, *mclr_tbl
, *full_tbl
, *type_tbl
;
62 int mmap_last
[3], mclr_last
[3], full_last
[3], type_last
[3];
65 typedef struct HuffEntry
{
71 * Context used for code reconstructing
73 typedef struct HuffContext
{
75 HuffEntry entries
[256];
78 /* common parameters used for decode_bigtree */
79 typedef struct DBCtx
{
88 /* possible runs of blocks */
89 static const int block_runs
[64] = {
90 1, 2, 3, 4, 5, 6, 7, 8,
91 9, 10, 11, 12, 13, 14, 15, 16,
92 17, 18, 19, 20, 21, 22, 23, 24,
93 25, 26, 27, 28, 29, 30, 31, 32,
94 33, 34, 35, 36, 37, 38, 39, 40,
95 41, 42, 43, 44, 45, 46, 47, 48,
96 49, 50, 51, 52, 53, 54, 55, 56,
97 57, 58, 59, 128, 256, 512, 1024, 2048 };
106 * Decode local frame tree
108 * Can read SMKTREE_DECODE_MAX_RECURSION before the first check;
109 * does not overread gb on success.
111 static int smacker_decode_tree(AVCodecContext
*avctx
, GetBitContext
*gb
, HuffContext
*hc
, int length
)
113 if (length
> SMKTREE_DECODE_MAX_RECURSION
|| length
> 3 * SMKTREE_BITS
) {
114 av_log(avctx
, AV_LOG_ERROR
, "Maximum tree recursion level exceeded.\n");
115 return AVERROR_INVALIDDATA
;
118 if(!get_bits1(gb
)){ //Leaf
119 if (hc
->current
>= 256) {
120 av_log(avctx
, AV_LOG_ERROR
, "Tree size exceeded!\n");
121 return AVERROR_INVALIDDATA
;
123 if (get_bits_left(gb
) < 8)
124 return AVERROR_INVALIDDATA
;
125 hc
->entries
[hc
->current
++] = (HuffEntry
){ get_bits(gb
, 8), length
};
130 r
= smacker_decode_tree(avctx
, gb
, hc
, length
);
133 return smacker_decode_tree(avctx
, gb
, hc
, length
);
140 * Checks before the first read, can overread by 6 * SMKTREE_BITS on success.
142 static int smacker_decode_bigtree(AVCodecContext
*avctx
, GetBitContext
*gb
, DBCtx
*ctx
, int length
)
144 // Larger length can cause segmentation faults due to too deep recursion.
145 if (length
> SMKTREE_DECODE_BIG_MAX_RECURSION
) {
146 av_log(NULL
, AV_LOG_ERROR
, "Maximum bigtree recursion level exceeded.\n");
147 return AVERROR_INVALIDDATA
;
150 if (ctx
->current
>= ctx
->length
) {
151 av_log(NULL
, AV_LOG_ERROR
, "Tree size exceeded!\n");
152 return AVERROR_INVALIDDATA
;
154 if (get_bits_left(gb
) <= 0)
155 return AVERROR_INVALIDDATA
;
156 if(!get_bits1(gb
)){ //Leaf
158 i1
= ctx
->v1
->table
? get_vlc2(gb
, ctx
->v1
->table
, SMKTREE_BITS
, 3)
160 i2
= ctx
->v2
->table
? get_vlc2(gb
, ctx
->v2
->table
, SMKTREE_BITS
, 3)
162 val
= i1
| (i2
<< 8);
163 if(val
== ctx
->escapes
[0]) {
164 ctx
->last
[0] = ctx
->current
;
166 } else if(val
== ctx
->escapes
[1]) {
167 ctx
->last
[1] = ctx
->current
;
169 } else if(val
== ctx
->escapes
[2]) {
170 ctx
->last
[2] = ctx
->current
;
174 ctx
->values
[ctx
->current
++] = val
;
180 r
= smacker_decode_bigtree(avctx
, gb
, ctx
, length
+ 1);
183 ctx
->values
[t
] = SMK_NODE
| r
;
185 r_new
= smacker_decode_bigtree(avctx
, gb
, ctx
, length
+ 1);
193 * Store large tree as FFmpeg's vlc codes
195 * Can read FFMAX(1 + SMKTREE_DECODE_MAX_RECURSION, 2 + 3 * 16) bits
196 * before the first check; can overread by 6 * SMKTREE_BITS + 1 on success.
198 static int smacker_decode_header_tree(SmackVContext
*smk
, GetBitContext
*gb
, int **recodes
, int *last
, int size
)
200 VLC vlc
[2] = { { 0 } };
205 if(size
>= UINT_MAX
>>4){ // (((size + 3) >> 2) + 3) << 2 must not overflow
206 av_log(smk
->avctx
, AV_LOG_ERROR
, "size too large\n");
207 return AVERROR_INVALIDDATA
;
210 for (int i
= 0; i
< 2; i
++) {
213 if (!get_bits1(gb
)) {
215 av_log(smk
->avctx
, AV_LOG_ERROR
, "Skipping %s bytes tree\n",
219 err
= smacker_decode_tree(smk
->avctx
, gb
, &h
, 0);
224 err
= ff_vlc_init_from_lengths(&vlc
[i
], SMKTREE_BITS
, h
.current
,
225 &h
.entries
[0].length
, sizeof(*h
.entries
),
226 &h
.entries
[0].value
, sizeof(*h
.entries
), 1,
227 0, VLC_INIT_OUTPUT_LE
, smk
->avctx
);
229 av_log(smk
->avctx
, AV_LOG_ERROR
, "Cannot build VLC table\n");
233 ctx
.vals
[i
] = h
.entries
[0].value
;
236 escapes
[0] = get_bits(gb
, 16);
237 escapes
[1] = get_bits(gb
, 16);
238 escapes
[2] = get_bits(gb
, 16);
240 last
[0] = last
[1] = last
[2] = -1;
242 ctx
.escapes
[0] = escapes
[0];
243 ctx
.escapes
[1] = escapes
[1];
244 ctx
.escapes
[2] = escapes
[2];
248 ctx
.length
= (size
+ 3) >> 2;
250 ctx
.values
= av_malloc_array(ctx
.length
+ 3, sizeof(ctx
.values
[0]));
252 err
= AVERROR(ENOMEM
);
255 *recodes
= ctx
.values
;
257 err
= smacker_decode_bigtree(smk
->avctx
, gb
, &ctx
, 0);
261 if (ctx
.last
[0] == -1) ctx
.last
[0] = ctx
.current
++;
262 if (ctx
.last
[1] == -1) ctx
.last
[1] = ctx
.current
++;
263 if (ctx
.last
[2] == -1) ctx
.last
[2] = ctx
.current
++;
267 for (int i
= 0; i
< 2; i
++) {
268 ff_vlc_free(&vlc
[i
]);
274 static int decode_header_trees(SmackVContext
*smk
) {
276 int mmap_size
, mclr_size
, full_size
, type_size
, ret
;
279 mmap_size
= AV_RL32(smk
->avctx
->extradata
);
280 mclr_size
= AV_RL32(smk
->avctx
->extradata
+ 4);
281 full_size
= AV_RL32(smk
->avctx
->extradata
+ 8);
282 type_size
= AV_RL32(smk
->avctx
->extradata
+ 12);
284 ret
= init_get_bits8(&gb
, smk
->avctx
->extradata
+ 16, smk
->avctx
->extradata_size
- 16);
288 if(!get_bits1(&gb
)) {
290 av_log(smk
->avctx
, AV_LOG_INFO
, "Skipping MMAP tree\n");
291 smk
->mmap_tbl
= av_malloc(sizeof(int) * 2);
293 return AVERROR(ENOMEM
);
294 smk
->mmap_tbl
[0] = 0;
295 smk
->mmap_last
[0] = smk
->mmap_last
[1] = smk
->mmap_last
[2] = 1;
297 ret
= smacker_decode_header_tree(smk
, &gb
, &smk
->mmap_tbl
, smk
->mmap_last
, mmap_size
);
301 if(!get_bits1(&gb
)) {
303 av_log(smk
->avctx
, AV_LOG_INFO
, "Skipping MCLR tree\n");
304 smk
->mclr_tbl
= av_malloc(sizeof(int) * 2);
306 return AVERROR(ENOMEM
);
307 smk
->mclr_tbl
[0] = 0;
308 smk
->mclr_last
[0] = smk
->mclr_last
[1] = smk
->mclr_last
[2] = 1;
310 ret
= smacker_decode_header_tree(smk
, &gb
, &smk
->mclr_tbl
, smk
->mclr_last
, mclr_size
);
314 if(!get_bits1(&gb
)) {
316 av_log(smk
->avctx
, AV_LOG_INFO
, "Skipping FULL tree\n");
317 smk
->full_tbl
= av_malloc(sizeof(int) * 2);
319 return AVERROR(ENOMEM
);
320 smk
->full_tbl
[0] = 0;
321 smk
->full_last
[0] = smk
->full_last
[1] = smk
->full_last
[2] = 1;
323 ret
= smacker_decode_header_tree(smk
, &gb
, &smk
->full_tbl
, smk
->full_last
, full_size
);
327 if(!get_bits1(&gb
)) {
329 av_log(smk
->avctx
, AV_LOG_INFO
, "Skipping TYPE tree\n");
330 smk
->type_tbl
= av_malloc(sizeof(int) * 2);
332 return AVERROR(ENOMEM
);
333 smk
->type_tbl
[0] = 0;
334 smk
->type_last
[0] = smk
->type_last
[1] = smk
->type_last
[2] = 1;
336 ret
= smacker_decode_header_tree(smk
, &gb
, &smk
->type_tbl
, smk
->type_last
, type_size
);
340 if (skip
== 4 || get_bits_left(&gb
) < 0)
341 return AVERROR_INVALIDDATA
;
346 static av_always_inline
void last_reset(int *recode
, int *last
) {
347 recode
[last
[0]] = recode
[last
[1]] = recode
[last
[2]] = 0;
350 /* Get code and update history.
351 * Checks before reading, does not overread. */
352 static av_always_inline
int smk_get_code(GetBitContext
*gb
, int *recode
, int *last
) {
353 register int *table
= recode
;
356 while(*table
& SMK_NODE
) {
357 if (get_bits_left(gb
) < 1)
358 return AVERROR_INVALIDDATA
;
360 table
+= (*table
) & (~SMK_NODE
);
365 if(v
!= recode
[last
[0]]) {
366 recode
[last
[2]] = recode
[last
[1]];
367 recode
[last
[1]] = recode
[last
[0]];
373 static int decode_frame(AVCodecContext
*avctx
, AVFrame
*rframe
,
374 int *got_frame
, AVPacket
*avpkt
)
376 SmackVContext
* const smk
= avctx
->priv_data
;
381 int blocks
, blk
, bw
, bh
;
386 if (avpkt
->size
<= 769)
387 return AVERROR_INVALIDDATA
;
389 if ((ret
= ff_reget_buffer(avctx
, smk
->pic
, 0)) < 0)
392 /* make the palette available on the way out */
393 pal
= (uint32_t*)smk
->pic
->data
[1];
394 bytestream2_init(&gb2
, avpkt
->data
, avpkt
->size
);
395 flags
= bytestream2_get_byteu(&gb2
);
396 #if FF_API_PALETTE_HAS_CHANGED
397 FF_DISABLE_DEPRECATION_WARNINGS
398 smk
->pic
->palette_has_changed
= flags
& 1;
399 FF_ENABLE_DEPRECATION_WARNINGS
402 smk
->pic
->flags
|= AV_FRAME_FLAG_KEY
;
403 smk
->pic
->pict_type
= AV_PICTURE_TYPE_I
;
405 smk
->pic
->flags
&= ~AV_FRAME_FLAG_KEY
;
406 smk
->pic
->pict_type
= AV_PICTURE_TYPE_P
;
409 for(i
= 0; i
< 256; i
++)
410 *pal
++ = 0xFFU
<< 24 | bytestream2_get_be24u(&gb2
);
412 last_reset(smk
->mmap_tbl
, smk
->mmap_last
);
413 last_reset(smk
->mclr_tbl
, smk
->mclr_last
);
414 last_reset(smk
->full_tbl
, smk
->full_last
);
415 last_reset(smk
->type_tbl
, smk
->type_last
);
416 if ((ret
= init_get_bits8(&gb
, avpkt
->data
+ 769, avpkt
->size
- 769)) < 0)
420 bw
= avctx
->width
>> 2;
421 bh
= avctx
->height
>> 2;
423 stride
= smk
->pic
->linesize
[0];
424 while(blk
< blocks
) {
428 type
= smk_get_code(&gb
, smk
->type_tbl
, smk
->type_last
);
431 run
= block_runs
[(type
>> 2) & 0x3F];
434 while(run
-- && blk
< blocks
){
437 clr
= smk_get_code(&gb
, smk
->mclr_tbl
, smk
->mclr_last
);
438 map
= smk_get_code(&gb
, smk
->mmap_tbl
, smk
->mmap_last
);
439 out
= smk
->pic
->data
[0] + (blk
/ bw
) * (stride
* 4) + (blk
% bw
) * 4;
442 for(i
= 0; i
< 4; i
++) {
443 if(map
& 1) out
[0] = hi
; else out
[0] = lo
;
444 if(map
& 2) out
[1] = hi
; else out
[1] = lo
;
445 if(map
& 4) out
[2] = hi
; else out
[2] = lo
;
446 if(map
& 8) out
[3] = hi
; else out
[3] = lo
;
455 if(avctx
->codec_tag
== MKTAG('S', 'M', 'K', '4')) { // In case of Smacker v4 we have three modes
456 if (get_bits_left(&gb
) < 1)
457 return AVERROR_INVALIDDATA
;
458 if(get_bits1(&gb
)) mode
= 1;
459 else if(get_bits1(&gb
)) mode
= 2;
461 while(run
-- && blk
< blocks
){
462 out
= smk
->pic
->data
[0] + (blk
/ bw
) * (stride
* 4) + (blk
% bw
) * 4;
465 for(i
= 0; i
< 4; i
++) {
466 pix
= smk_get_code(&gb
, smk
->full_tbl
, smk
->full_last
);
468 pix
= smk_get_code(&gb
, smk
->full_tbl
, smk
->full_last
);
474 pix
= smk_get_code(&gb
, smk
->full_tbl
, smk
->full_last
);
475 out
[0] = out
[1] = pix
& 0xFF;
476 out
[2] = out
[3] = pix
>> 8;
478 out
[0] = out
[1] = pix
& 0xFF;
479 out
[2] = out
[3] = pix
>> 8;
481 pix
= smk_get_code(&gb
, smk
->full_tbl
, smk
->full_last
);
482 out
[0] = out
[1] = pix
& 0xFF;
483 out
[2] = out
[3] = pix
>> 8;
485 out
[0] = out
[1] = pix
& 0xFF;
486 out
[2] = out
[3] = pix
>> 8;
489 for(i
= 0; i
< 2; i
++) {
491 pix2
= smk_get_code(&gb
, smk
->full_tbl
, smk
->full_last
);
492 pix1
= smk_get_code(&gb
, smk
->full_tbl
, smk
->full_last
);
506 while(run
-- && blk
< blocks
)
511 while(run
-- && blk
< blocks
){
513 out
= smk
->pic
->data
[0] + (blk
/ bw
) * (stride
* 4) + (blk
% bw
) * 4;
514 col
= mode
* 0x01010101U
;
515 for(i
= 0; i
< 4; i
++) {
516 *((uint32_t*)out
) = col
;
526 if ((ret
= av_frame_ref(rframe
, smk
->pic
)) < 0)
531 /* always report that the buffer was completely consumed */
536 static av_cold
int decode_end(AVCodecContext
*avctx
)
538 SmackVContext
* const smk
= avctx
->priv_data
;
540 av_freep(&smk
->mmap_tbl
);
541 av_freep(&smk
->mclr_tbl
);
542 av_freep(&smk
->full_tbl
);
543 av_freep(&smk
->type_tbl
);
545 av_frame_free(&smk
->pic
);
551 static av_cold
int decode_init(AVCodecContext
*avctx
)
553 SmackVContext
* const c
= avctx
->priv_data
;
558 avctx
->pix_fmt
= AV_PIX_FMT_PAL8
;
560 c
->pic
= av_frame_alloc();
562 return AVERROR(ENOMEM
);
564 /* decode huffman trees from extradata */
565 if (avctx
->extradata_size
<= 16){
566 av_log(avctx
, AV_LOG_ERROR
, "Extradata missing!\n");
567 return AVERROR(EINVAL
);
570 ret
= decode_header_trees(c
);
579 static av_cold
int smka_decode_init(AVCodecContext
*avctx
)
581 int channels
= avctx
->ch_layout
.nb_channels
;
582 if (channels
< 1 || channels
> 2) {
583 av_log(avctx
, AV_LOG_ERROR
, "invalid number of channels\n");
584 return AVERROR_INVALIDDATA
;
586 av_channel_layout_uninit(&avctx
->ch_layout
);
587 av_channel_layout_default(&avctx
->ch_layout
, channels
);
588 avctx
->sample_fmt
= avctx
->bits_per_coded_sample
== 8 ? AV_SAMPLE_FMT_U8
: AV_SAMPLE_FMT_S16
;
594 * Decode Smacker audio data
596 static int smka_decode_frame(AVCodecContext
*avctx
, AVFrame
*frame
,
597 int *got_frame_ptr
, AVPacket
*avpkt
)
599 const uint8_t *buf
= avpkt
->data
;
600 int buf_size
= avpkt
->size
;
602 VLC vlc
[4] = { { 0 } };
609 unsigned pred
[2], val
, val2
;
612 av_log(avctx
, AV_LOG_ERROR
, "packet is too small\n");
613 return AVERROR_INVALIDDATA
;
616 unp_size
= AV_RL32(buf
);
618 if (unp_size
> (1U<<24)) {
619 av_log(avctx
, AV_LOG_ERROR
, "packet is too big\n");
620 return AVERROR_INVALIDDATA
;
623 if ((ret
= init_get_bits8(&gb
, buf
+ 4, buf_size
- 4)) < 0)
627 av_log(avctx
, AV_LOG_INFO
, "Sound: no data\n");
631 stereo
= get_bits1(&gb
);
632 bits
= get_bits1(&gb
);
633 if (stereo
^ (avctx
->ch_layout
.nb_channels
!= 1)) {
634 av_log(avctx
, AV_LOG_ERROR
, "channels mismatch\n");
635 return AVERROR_INVALIDDATA
;
637 if (bits
== (avctx
->sample_fmt
== AV_SAMPLE_FMT_U8
)) {
638 av_log(avctx
, AV_LOG_ERROR
, "sample format mismatch\n");
639 return AVERROR_INVALIDDATA
;
642 /* get output buffer */
643 frame
->nb_samples
= unp_size
/ (avctx
->ch_layout
.nb_channels
* (bits
+ 1));
644 if (unp_size
% (avctx
->ch_layout
.nb_channels
* (bits
+ 1))) {
645 av_log(avctx
, AV_LOG_ERROR
,
646 "The buffer does not contain an integer number of samples\n");
647 return AVERROR_INVALIDDATA
;
649 if ((ret
= ff_get_buffer(avctx
, frame
, 0)) < 0)
651 samples
= (int16_t *)frame
->data
[0];
652 samples8
= frame
->data
[0];
655 for(i
= 0; i
< (1 << (bits
+ stereo
)); i
++) {
659 if ((ret
= smacker_decode_tree(avctx
, &gb
, &h
, 0)) < 0)
663 ret
= ff_vlc_init_from_lengths(&vlc
[i
], SMKTREE_BITS
, h
.current
,
664 &h
.entries
[0].length
, sizeof(*h
.entries
),
665 &h
.entries
[0].value
, sizeof(*h
.entries
), 1,
666 0, VLC_INIT_OUTPUT_LE
, avctx
);
668 av_log(avctx
, AV_LOG_ERROR
, "Cannot build VLC table\n");
672 values
[i
] = h
.entries
[0].value
;
674 /* this codec relies on wraparound instead of clipping audio */
675 if(bits
) { //decode 16-bit data
676 for(i
= stereo
; i
>= 0; i
--)
677 pred
[i
] = av_bswap16(get_bits(&gb
, 16));
678 for(i
= 0; i
<= stereo
; i
++)
679 *samples
++ = pred
[i
];
682 if (vlc
[0 ].table
|| vlc
[ 1].table
||
683 vlc
[2*stereo
].table
|| vlc
[2*stereo
+1].table
) {
684 for(; i
< unp_size
; i
++) {
685 unsigned idx
= 2 * (i
& stereo
);
686 if (get_bits_left(&gb
) < 0) {
687 ret
= AVERROR_INVALIDDATA
;
691 res
= get_vlc2(&gb
, vlc
[idx
].table
, SMKTREE_BITS
, 3);
695 if (vlc
[++idx
].table
)
696 res
= get_vlc2(&gb
, vlc
[idx
].table
, SMKTREE_BITS
, 3);
700 pred
[idx
/ 2] += val
;
701 *samples
++ = pred
[idx
/ 2];
704 val
= 256*values
[1] + values
[0];
705 val2
= 256*values
[3] + values
[2];
706 for(; i
< unp_size
; i
+=2) {
709 *samples
++ = pred
[0];
710 *samples
++ = pred
[1];
713 val
= 256*values
[1] + values
[0];
714 for(; i
< unp_size
; i
++) {
716 *samples
++ = pred
[0];
719 } else { //8-bit data
720 for(i
= stereo
; i
>= 0; i
--)
721 pred
[i
] = get_bits(&gb
, 8);
722 for(i
= 0; i
<= stereo
; i
++)
723 *samples8
++ = pred
[i
];
724 for(; i
< unp_size
; i
++) {
725 unsigned idx
= i
& stereo
;
726 if (get_bits_left(&gb
) < 0) {
727 ret
= AVERROR_INVALIDDATA
;
731 val
= get_vlc2(&gb
, vlc
[idx
].table
, SMKTREE_BITS
, 3);
735 *samples8
++ = pred
[idx
];
743 for(i
= 0; i
< 4; i
++) {
744 ff_vlc_free(&vlc
[i
]);
750 const FFCodec ff_smacker_decoder
= {
751 .p
.name
= "smackvid",
752 CODEC_LONG_NAME("Smacker video"),
753 .p
.type
= AVMEDIA_TYPE_VIDEO
,
754 .p
.id
= AV_CODEC_ID_SMACKVIDEO
,
755 .priv_data_size
= sizeof(SmackVContext
),
758 FF_CODEC_DECODE_CB(decode_frame
),
759 .p
.capabilities
= AV_CODEC_CAP_DR1
,
760 .caps_internal
= FF_CODEC_CAP_INIT_CLEANUP
,
763 const FFCodec ff_smackaud_decoder
= {
764 .p
.name
= "smackaud",
765 CODEC_LONG_NAME("Smacker audio"),
766 .p
.type
= AVMEDIA_TYPE_AUDIO
,
767 .p
.id
= AV_CODEC_ID_SMACKAUDIO
,
768 .init
= smka_decode_init
,
769 FF_CODEC_DECODE_CB(smka_decode_frame
),
770 .p
.capabilities
= AV_CODEC_CAP_DR1
,