~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/mpegaudiodec.c

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * MPEG Audio decoder
25
25
 */
26
26
 
27
 
#include "libavutil/audioconvert.h"
 
27
#include "libavutil/channel_layout.h"
28
28
#include "avcodec.h"
29
29
#include "get_bits.h"
 
30
#include "internal.h"
30
31
#include "mathops.h"
31
32
#include "mpegaudiodsp.h"
 
33
#include "dsputil.h"
32
34
 
33
35
/*
34
36
 * TODO:
80
82
    int err_recognition;
81
83
    AVCodecContext* avctx;
82
84
    MPADSPContext mpadsp;
 
85
    DSPContext dsp;
83
86
    AVFrame frame;
84
87
} MPADecodeContext;
85
88
 
91
94
#   define MULH3(x, y, s) ((s)*(y)*(x))
92
95
#   define MULLx(x, y, s) ((y)*(x))
93
96
#   define RENAME(a) a ## _float
94
 
#   define OUT_FMT AV_SAMPLE_FMT_FLT
 
97
#   define OUT_FMT   AV_SAMPLE_FMT_FLT
 
98
#   define OUT_FMT_P AV_SAMPLE_FMT_FLTP
95
99
#else
96
100
#   define SHR(a,b)       ((a)>>(b))
97
101
/* WARNING: only correct for positive numbers */
101
105
#   define MULH3(x, y, s) MULH((s)*(x), y)
102
106
#   define MULLx(x, y, s) MULL(x,y,s)
103
107
#   define RENAME(a)      a ## _fixed
104
 
#   define OUT_FMT AV_SAMPLE_FMT_S16
 
108
#   define OUT_FMT   AV_SAMPLE_FMT_S16
 
109
#   define OUT_FMT_P AV_SAMPLE_FMT_S16P
105
110
#endif
106
111
 
107
112
/****************/
172
177
 
173
178
static void ff_init_short_region(MPADecodeContext *s, GranuleDef *g)
174
179
{
175
 
    if (g->block_type == 2)
176
 
        g->region_size[0] = (36 / 2);
177
 
    else {
 
180
    if (g->block_type == 2) {
 
181
        if (s->sample_rate_index != 8)
 
182
            g->region_size[0] = (36 / 2);
 
183
        else
 
184
            g->region_size[0] = (72 / 2);
 
185
    } else {
178
186
        if (s->sample_rate_index <= 2)
179
187
            g->region_size[0] = (36 / 2);
180
188
        else if (s->sample_rate_index != 8)
199
207
    if (g->block_type == 2) {
200
208
        if (g->switch_point) {
201
209
            /* if switched mode, we handle the 36 first samples as
202
 
                long blocks.  For 8000Hz, we handle the 48 first
203
 
                exponents as long blocks (XXX: check this!) */
 
210
                long blocks.  For 8000Hz, we handle the 72 first
 
211
                exponents as long blocks */
204
212
            if (s->sample_rate_index <= 2)
205
213
                g->long_end = 8;
206
 
            else if (s->sample_rate_index != 8)
 
214
            else
207
215
                g->long_end = 6;
208
 
            else
209
 
                g->long_end = 4; /* 8000 Hz */
210
216
 
211
217
            g->short_start = 3;
212
218
        } else {
302
308
    for (i = 1; i < 16; i++) {
303
309
        const HuffTable *h = &mpa_huff_tables[i];
304
310
        int xsize, x, y;
305
 
        uint8_t  tmp_bits [512];
306
 
        uint16_t tmp_codes[512];
307
 
 
308
 
        memset(tmp_bits , 0, sizeof(tmp_bits ));
309
 
        memset(tmp_codes, 0, sizeof(tmp_codes));
 
311
        uint8_t  tmp_bits [512] = { 0 };
 
312
        uint16_t tmp_codes[512] = { 0 };
310
313
 
311
314
        xsize = h->xsize;
312
315
 
432
435
    s->avctx = avctx;
433
436
 
434
437
    ff_mpadsp_init(&s->mpadsp);
 
438
    ff_dsputil_init(&s->dsp, avctx);
435
439
 
436
 
    avctx->sample_fmt= OUT_FMT;
 
440
    if (avctx->request_sample_fmt == OUT_FMT &&
 
441
        avctx->codec_id != AV_CODEC_ID_MP3ON4)
 
442
        avctx->sample_fmt = OUT_FMT;
 
443
    else
 
444
        avctx->sample_fmt = OUT_FMT_P;
437
445
    s->err_recognition = avctx->err_recognition;
438
446
 
439
 
    if (avctx->codec_id == CODEC_ID_MP3ADU)
 
447
    if (avctx->codec_id == AV_CODEC_ID_MP3ADU)
440
448
        s->adu_mode = 1;
441
449
 
442
450
    avcodec_get_frame_defaults(&s->frame);
884
892
            int pos = get_bits_count(&s->gb);
885
893
 
886
894
            if (pos >= end_pos){
887
 
//                av_log(NULL, AV_LOG_ERROR, "pos: %d %d %d %d\n", pos, end_pos, end_pos2, s_index);
888
895
                switch_buffer(s, &pos, &end_pos, &end_pos2);
889
 
//                av_log(NULL, AV_LOG_ERROR, "new pos: %d %d\n", pos, end_pos);
890
896
                if (pos >= end_pos)
891
897
                    break;
892
898
            }
960
966
                    s_index=0;
961
967
                break;
962
968
            }
963
 
//                av_log(NULL, AV_LOG_ERROR, "pos2: %d %d %d %d\n", pos, end_pos, end_pos2, s_index);
964
969
            switch_buffer(s, &pos, &end_pos, &end_pos2);
965
 
//                av_log(NULL, AV_LOG_ERROR, "new pos2: %d %d %d\n", pos, end_pos, s_index);
966
970
            if (pos >= end_pos)
967
971
                break;
968
972
        }
985
989
    }
986
990
    /* skip extension bits */
987
991
    bits_left = end_pos2 - get_bits_count(&s->gb);
988
 
//av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);
989
992
    if (bits_left < 0 && (s->err_recognition & AV_EF_BUFFER)) {
990
993
        av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
991
994
        s_index=0;
1018
1021
        if (s->sample_rate_index != 8)
1019
1022
            ptr = g->sb_hybrid + 36;
1020
1023
        else
1021
 
            ptr = g->sb_hybrid + 48;
 
1024
            ptr = g->sb_hybrid + 72;
1022
1025
    } else {
1023
1026
        ptr = g->sb_hybrid;
1024
1027
    }
1153
1156
        /* ms stereo ONLY */
1154
1157
        /* NOTE: the 1/sqrt(2) normalization factor is included in the
1155
1158
           global gain */
 
1159
#if CONFIG_FLOAT
 
1160
       s-> dsp.butterflies_float(g0->sb_hybrid, g1->sb_hybrid, 576);
 
1161
#else
1156
1162
        tab0 = g0->sb_hybrid;
1157
1163
        tab1 = g1->sb_hybrid;
1158
1164
        for (i = 0; i < 576; i++) {
1161
1167
            tab0[i] = tmp0 + tmp1;
1162
1168
            tab1[i] = tmp0 - tmp1;
1163
1169
        }
 
1170
#endif
1164
1171
    }
1165
1172
}
1166
1173
 
1383
1390
                                FFMAX(0, LAST_BUF_SIZE - s->last_buf_size));
1384
1391
        assert((get_bits_count(&s->gb) & 7) == 0);
1385
1392
        /* now we get bits from the main_data_begin offset */
1386
 
        av_dlog(s->avctx, "seekback: %d\n", main_data_begin);
1387
 
    //av_log(NULL, AV_LOG_ERROR, "backstep:%d, lastbuf:%d\n", main_data_begin, s->last_buf_size);
 
1393
        av_dlog(s->avctx, "seekback:%d, lastbuf:%d\n",
 
1394
                main_data_begin, s->last_buf_size);
1388
1395
 
1389
1396
        memcpy(s->last_buf + s->last_buf_size, ptr, extrasize);
1390
1397
        s->in_gb = s->gb;
1398
1405
                g = &s->granules[ch][gr];
1399
1406
                s->last_buf_size += g->part2_3_length;
1400
1407
                memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid));
 
1408
                compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], s->mdct_buf[ch]);
1401
1409
            }
1402
1410
        }
1403
1411
        skip = s->last_buf_size - 8 * main_data_begin;
1529
1537
            huffman_decode(s, g, exponents, bits_pos + g->part2_3_length);
1530
1538
        } /* ch */
1531
1539
 
1532
 
        if (s->nb_channels == 2)
 
1540
        if (s->mode == MPA_JSTEREO)
1533
1541
            compute_stereo(s, &s->granules[0][gr], &s->granules[1][gr]);
1534
1542
 
1535
1543
        for (ch = 0; ch < s->nb_channels; ch++) {
1545
1553
    return nb_granules * 18;
1546
1554
}
1547
1555
 
1548
 
static int mp_decode_frame(MPADecodeContext *s, OUT_INT *samples,
 
1556
static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples,
1549
1557
                           const uint8_t *buf, int buf_size)
1550
1558
{
1551
1559
    int i, nb_frames, ch, ret;
1604
1612
    /* get output buffer */
1605
1613
    if (!samples) {
1606
1614
        s->frame.nb_samples = s->avctx->frame_size;
1607
 
        if ((ret = s->avctx->get_buffer(s->avctx, &s->frame)) < 0) {
 
1615
        if ((ret = ff_get_buffer(s->avctx, &s->frame)) < 0) {
1608
1616
            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
1609
1617
            return ret;
1610
1618
        }
1611
 
        samples = (OUT_INT *)s->frame.data[0];
 
1619
        samples = (OUT_INT **)s->frame.extended_data;
1612
1620
    }
1613
1621
 
1614
1622
    /* apply the synthesis filter */
1615
1623
    for (ch = 0; ch < s->nb_channels; ch++) {
1616
 
        samples_ptr = samples + ch;
 
1624
        int sample_stride;
 
1625
        if (s->avctx->sample_fmt == OUT_FMT_P) {
 
1626
            samples_ptr   = samples[ch];
 
1627
            sample_stride = 1;
 
1628
        } else {
 
1629
            samples_ptr   = samples[0] + ch;
 
1630
            sample_stride = s->nb_channels;
 
1631
        }
1617
1632
        for (i = 0; i < nb_frames; i++) {
1618
 
            RENAME(ff_mpa_synth_filter)(
1619
 
                         &s->mpadsp,
1620
 
                         s->synth_buf[ch], &(s->synth_buf_offset[ch]),
1621
 
                         RENAME(ff_mpa_synth_window), &s->dither_state,
1622
 
                         samples_ptr, s->nb_channels,
1623
 
                         s->sb_samples[ch][i]);
1624
 
            samples_ptr += 32 * s->nb_channels;
 
1633
            RENAME(ff_mpa_synth_filter)(&s->mpadsp, s->synth_buf[ch],
 
1634
                                        &(s->synth_buf_offset[ch]),
 
1635
                                        RENAME(ff_mpa_synth_window),
 
1636
                                        &s->dither_state, samples_ptr,
 
1637
                                        sample_stride, s->sb_samples[ch][i]);
 
1638
            samples_ptr += 32 * sample_stride;
1625
1639
        }
1626
1640
    }
1627
1641
 
1656
1670
    avctx->channel_layout = s->nb_channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO;
1657
1671
    if (!avctx->bit_rate)
1658
1672
        avctx->bit_rate = s->bit_rate;
1659
 
    avctx->sub_id = s->layer;
1660
1673
 
1661
1674
    if (s->frame_size <= 0 || s->frame_size > buf_size) {
1662
1675
        av_log(avctx, AV_LOG_ERROR, "incomplete frame\n");
1663
1676
        return AVERROR_INVALIDDATA;
1664
1677
    } else if (s->frame_size < buf_size) {
1665
 
        av_log(avctx, AV_LOG_ERROR, "incorrect frame size\n");
1666
1678
        buf_size= s->frame_size;
1667
1679
    }
1668
1680
 
1687
1699
    return buf_size;
1688
1700
}
1689
1701
 
 
1702
static void mp_flush(MPADecodeContext *ctx)
 
1703
{
 
1704
    memset(ctx->synth_buf, 0, sizeof(ctx->synth_buf));
 
1705
    ctx->last_buf_size = 0;
 
1706
}
 
1707
 
1690
1708
static void flush(AVCodecContext *avctx)
1691
1709
{
1692
 
    MPADecodeContext *s = avctx->priv_data;
1693
 
    memset(s->synth_buf, 0, sizeof(s->synth_buf));
1694
 
    s->last_buf_size = 0;
 
1710
    mp_flush(avctx->priv_data);
1695
1711
}
1696
1712
 
1697
1713
#if CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER
1702
1718
    int buf_size        = avpkt->size;
1703
1719
    MPADecodeContext *s = avctx->priv_data;
1704
1720
    uint32_t header;
1705
 
    int len, out_size, ret = 0;
 
1721
    int len, ret;
1706
1722
 
1707
1723
    len = buf_size;
1708
1724
 
1730
1746
    avctx->channels    = s->nb_channels;
1731
1747
    if (!avctx->bit_rate)
1732
1748
        avctx->bit_rate = s->bit_rate;
1733
 
    avctx->sub_id = s->layer;
1734
1749
 
1735
1750
    s->frame_size = len;
1736
1751
 
1737
 
#if FF_API_PARSE_FRAME
1738
 
    if (avctx->parse_only)
1739
 
        out_size = buf_size;
1740
 
    else
1741
 
#endif
1742
1752
    ret = mp_decode_frame(s, NULL, buf, buf_size);
1743
1753
    if (ret < 0) {
1744
1754
        av_log(avctx, AV_LOG_ERROR, "Error while decoding MPEG audio frame.\n");
1763
1773
    int syncword;                   ///< syncword patch
1764
1774
    const uint8_t *coff;            ///< channel offsets in output buffer
1765
1775
    MPADecodeContext *mp3decctx[5]; ///< MPADecodeContext for every decoder instance
1766
 
    OUT_INT *decoded_buf;           ///< output buffer for decoded samples
1767
1776
} MP3On4DecodeContext;
1768
1777
 
1769
1778
#include "mpeg4audio.h"
1805
1814
    for (i = 0; i < s->frames; i++)
1806
1815
        av_free(s->mp3decctx[i]);
1807
1816
 
1808
 
    av_freep(&s->decoded_buf);
1809
 
 
1810
1817
    return 0;
1811
1818
}
1812
1819
 
1867
1874
        s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp;
1868
1875
    }
1869
1876
 
1870
 
    /* Allocate buffer for multi-channel output if needed */
1871
 
    if (s->frames > 1) {
1872
 
        s->decoded_buf = av_malloc(MPA_FRAME_SIZE * MPA_MAX_CHANNELS *
1873
 
                                   sizeof(*s->decoded_buf));
1874
 
        if (!s->decoded_buf)
1875
 
            goto alloc_fail;
1876
 
    }
1877
 
 
1878
1877
    return 0;
1879
1878
alloc_fail:
1880
1879
    decode_close_mp3on4(avctx);
1887
1886
    int i;
1888
1887
    MP3On4DecodeContext *s = avctx->priv_data;
1889
1888
 
1890
 
    for (i = 0; i < s->frames; i++) {
1891
 
        MPADecodeContext *m = s->mp3decctx[i];
1892
 
        memset(m->synth_buf, 0, sizeof(m->synth_buf));
1893
 
        m->last_buf_size = 0;
1894
 
    }
 
1889
    for (i = 0; i < s->frames; i++)
 
1890
        mp_flush(s->mp3decctx[i]);
1895
1891
}
1896
1892
 
1897
1893
 
1904
1900
    MPADecodeContext *m;
1905
1901
    int fsize, len = buf_size, out_size = 0;
1906
1902
    uint32_t header;
1907
 
    OUT_INT *out_samples;
1908
 
    OUT_INT *outptr, *bp;
1909
 
    int fr, j, n, ch, ret;
 
1903
    OUT_INT **out_samples;
 
1904
    OUT_INT *outptr[2];
 
1905
    int fr, ch, ret;
1910
1906
 
1911
1907
    /* get output buffer */
1912
1908
    s->frame->nb_samples = MPA_FRAME_SIZE;
1913
 
    if ((ret = avctx->get_buffer(avctx, s->frame)) < 0) {
 
1909
    if ((ret = ff_get_buffer(avctx, s->frame)) < 0) {
1914
1910
        av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
1915
1911
        return ret;
1916
1912
    }
1917
 
    out_samples = (OUT_INT *)s->frame->data[0];
 
1913
    out_samples = (OUT_INT **)s->frame->extended_data;
1918
1914
 
1919
1915
    // Discard too short frames
1920
1916
    if (buf_size < HEADER_SIZE)
1921
1917
        return AVERROR_INVALIDDATA;
1922
1918
 
1923
 
    // If only one decoder interleave is not needed
1924
 
    outptr = s->frames == 1 ? out_samples : s->decoded_buf;
1925
 
 
1926
1919
    avctx->bit_rate = 0;
1927
1920
 
1928
1921
    ch = 0;
1950
1943
        }
1951
1944
        ch += m->nb_channels;
1952
1945
 
 
1946
        outptr[0] = out_samples[s->coff[fr]];
 
1947
        if (m->nb_channels > 1)
 
1948
            outptr[1] = out_samples[s->coff[fr] + 1];
 
1949
 
1953
1950
        if ((ret = mp_decode_frame(m, outptr, buf, fsize)) < 0)
1954
1951
            return ret;
1955
1952
 
1957
1954
        buf      += fsize;
1958
1955
        len      -= fsize;
1959
1956
 
1960
 
        if (s->frames > 1) {
1961
 
            n = m->avctx->frame_size*m->nb_channels;
1962
 
            /* interleave output data */
1963
 
            bp = out_samples + s->coff[fr];
1964
 
            if (m->nb_channels == 1) {
1965
 
                for (j = 0; j < n; j++) {
1966
 
                    *bp = s->decoded_buf[j];
1967
 
                    bp += avctx->channels;
1968
 
                }
1969
 
            } else {
1970
 
                for (j = 0; j < n; j++) {
1971
 
                    bp[0] = s->decoded_buf[j++];
1972
 
                    bp[1] = s->decoded_buf[j];
1973
 
                    bp   += avctx->channels;
1974
 
                }
1975
 
            }
1976
 
        }
1977
1957
        avctx->bit_rate += m->bit_rate;
1978
1958
    }
1979
1959
 
1993
1973
AVCodec ff_mp1_decoder = {
1994
1974
    .name           = "mp1",
1995
1975
    .type           = AVMEDIA_TYPE_AUDIO,
1996
 
    .id             = CODEC_ID_MP1,
 
1976
    .id             = AV_CODEC_ID_MP1,
1997
1977
    .priv_data_size = sizeof(MPADecodeContext),
1998
1978
    .init           = decode_init,
1999
1979
    .decode         = decode_frame,
2000
 
#if FF_API_PARSE_FRAME
2001
 
    .capabilities   = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1,
2002
 
#else
2003
1980
    .capabilities   = CODEC_CAP_DR1,
2004
 
#endif
2005
1981
    .flush          = flush,
2006
1982
    .long_name      = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"),
 
1983
    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
 
1984
                                                      AV_SAMPLE_FMT_S16,
 
1985
                                                      AV_SAMPLE_FMT_NONE },
2007
1986
};
2008
1987
#endif
2009
1988
#if CONFIG_MP2_DECODER
2010
1989
AVCodec ff_mp2_decoder = {
2011
1990
    .name           = "mp2",
2012
1991
    .type           = AVMEDIA_TYPE_AUDIO,
2013
 
    .id             = CODEC_ID_MP2,
 
1992
    .id             = AV_CODEC_ID_MP2,
2014
1993
    .priv_data_size = sizeof(MPADecodeContext),
2015
1994
    .init           = decode_init,
2016
1995
    .decode         = decode_frame,
2017
 
#if FF_API_PARSE_FRAME
2018
 
    .capabilities   = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1,
2019
 
#else
2020
1996
    .capabilities   = CODEC_CAP_DR1,
2021
 
#endif
2022
1997
    .flush          = flush,
2023
1998
    .long_name      = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"),
 
1999
    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
 
2000
                                                      AV_SAMPLE_FMT_S16,
 
2001
                                                      AV_SAMPLE_FMT_NONE },
2024
2002
};
2025
2003
#endif
2026
2004
#if CONFIG_MP3_DECODER
2027
2005
AVCodec ff_mp3_decoder = {
2028
2006
    .name           = "mp3",
2029
2007
    .type           = AVMEDIA_TYPE_AUDIO,
2030
 
    .id             = CODEC_ID_MP3,
 
2008
    .id             = AV_CODEC_ID_MP3,
2031
2009
    .priv_data_size = sizeof(MPADecodeContext),
2032
2010
    .init           = decode_init,
2033
2011
    .decode         = decode_frame,
2034
 
#if FF_API_PARSE_FRAME
2035
 
    .capabilities   = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1,
2036
 
#else
2037
2012
    .capabilities   = CODEC_CAP_DR1,
2038
 
#endif
2039
2013
    .flush          = flush,
2040
2014
    .long_name      = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"),
 
2015
    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
 
2016
                                                      AV_SAMPLE_FMT_S16,
 
2017
                                                      AV_SAMPLE_FMT_NONE },
2041
2018
};
2042
2019
#endif
2043
2020
#if CONFIG_MP3ADU_DECODER
2044
2021
AVCodec ff_mp3adu_decoder = {
2045
2022
    .name           = "mp3adu",
2046
2023
    .type           = AVMEDIA_TYPE_AUDIO,
2047
 
    .id             = CODEC_ID_MP3ADU,
 
2024
    .id             = AV_CODEC_ID_MP3ADU,
2048
2025
    .priv_data_size = sizeof(MPADecodeContext),
2049
2026
    .init           = decode_init,
2050
2027
    .decode         = decode_frame_adu,
2051
 
#if FF_API_PARSE_FRAME
2052
 
    .capabilities   = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1,
2053
 
#else
2054
2028
    .capabilities   = CODEC_CAP_DR1,
2055
 
#endif
2056
2029
    .flush          = flush,
2057
2030
    .long_name      = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"),
 
2031
    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
 
2032
                                                      AV_SAMPLE_FMT_S16,
 
2033
                                                      AV_SAMPLE_FMT_NONE },
2058
2034
};
2059
2035
#endif
2060
2036
#if CONFIG_MP3ON4_DECODER
2061
2037
AVCodec ff_mp3on4_decoder = {
2062
2038
    .name           = "mp3on4",
2063
2039
    .type           = AVMEDIA_TYPE_AUDIO,
2064
 
    .id             = CODEC_ID_MP3ON4,
 
2040
    .id             = AV_CODEC_ID_MP3ON4,
2065
2041
    .priv_data_size = sizeof(MP3On4DecodeContext),
2066
2042
    .init           = decode_init_mp3on4,
2067
2043
    .close          = decode_close_mp3on4,
2069
2045
    .capabilities   = CODEC_CAP_DR1,
2070
2046
    .flush          = flush_mp3on4,
2071
2047
    .long_name      = NULL_IF_CONFIG_SMALL("MP3onMP4"),
 
2048
    .sample_fmts    = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P,
 
2049
                                                      AV_SAMPLE_FMT_NONE },
2072
2050
};
2073
2051
#endif
2074
2052
#endif