raw.c 13.7 KB
Newer Older
1
/*
2
 * RAW muxer and demuxer
3
 * Copyright (c) 2001 Fabrice Bellard
4
 * Copyright (c) 2005 Alex Beregszaszi
Fabrice Bellard's avatar
Fabrice Bellard committed
5
 *
6 7 8
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
Fabrice Bellard's avatar
Fabrice Bellard committed
9 10
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
11
 * version 2.1 of the License, or (at your option) any later version.
Fabrice Bellard's avatar
Fabrice Bellard committed
12
 *
13
 * FFmpeg is distributed in the hope that it will be useful,
Fabrice Bellard's avatar
Fabrice Bellard committed
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Fabrice Bellard's avatar
Fabrice Bellard committed
15 16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
Fabrice Bellard's avatar
Fabrice Bellard committed
17
 *
Fabrice Bellard's avatar
Fabrice Bellard committed
18
 * You should have received a copy of the GNU Lesser General Public
19
 * License along with FFmpeg; if not, write to the Free Software
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Fabrice Bellard's avatar
Fabrice Bellard committed
21
 */
22

Fabrice Bellard's avatar
Fabrice Bellard committed
23
#include "avformat.h"
24
#include "raw.h"
Fabrice Bellard's avatar
Fabrice Bellard committed
25 26

/* simple formats */
27

28
#if CONFIG_MUXERS
29
int ff_raw_write_packet(AVFormatContext *s, AVPacket *pkt)
Fabrice Bellard's avatar
Fabrice Bellard committed
30
{
31 32
    put_buffer(s->pb, pkt->data, pkt->size);
    put_flush_packet(s->pb);
Fabrice Bellard's avatar
Fabrice Bellard committed
33 34
    return 0;
}
35
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
36

37
#if CONFIG_DEMUXERS
Fabrice Bellard's avatar
Fabrice Bellard committed
38
/* raw input */
39
int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap)
Fabrice Bellard's avatar
Fabrice Bellard committed
40 41
{
    AVStream *st;
42
    enum CodecID id;
Fabrice Bellard's avatar
Fabrice Bellard committed
43

Fabrice Bellard's avatar
Fabrice Bellard committed
44
    st = av_new_stream(s, 0);
Fabrice Bellard's avatar
Fabrice Bellard committed
45
    if (!st)
46
        return AVERROR(ENOMEM);
47

Fabrice Bellard's avatar
Fabrice Bellard committed
48 49
        id = s->iformat->value;
        if (id == CODEC_ID_RAWVIDEO) {
50
            st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
Fabrice Bellard's avatar
Fabrice Bellard committed
51
        } else {
52
            st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
Fabrice Bellard's avatar
Fabrice Bellard committed
53
        }
54
        st->codec->codec_id = id;
Fabrice Bellard's avatar
Fabrice Bellard committed
55

56
        switch(st->codec->codec_type) {
57
        case AVMEDIA_TYPE_AUDIO:
58
            st->codec->sample_rate = ap->sample_rate;
59 60
            if(ap->channels) st->codec->channels = ap->channels;
            else             st->codec->channels = 1;
61 62 63
            st->codec->bits_per_coded_sample = av_get_bits_per_sample(st->codec->codec_id);
            assert(st->codec->bits_per_coded_sample > 0);
            st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8;
64
            av_set_pts_info(st, 64, 1, st->codec->sample_rate);
Fabrice Bellard's avatar
Fabrice Bellard committed
65
            break;
66
        case AVMEDIA_TYPE_VIDEO:
67 68 69 70
            if(ap->time_base.num)
                av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den);
            else
                av_set_pts_info(st, 64, 1, 25);
71 72 73 74 75
            st->codec->width = ap->width;
            st->codec->height = ap->height;
            st->codec->pix_fmt = ap->pix_fmt;
            if(st->codec->pix_fmt == PIX_FMT_NONE)
                st->codec->pix_fmt= PIX_FMT_YUV420P;
Fabrice Bellard's avatar
Fabrice Bellard committed
76 77
            break;
        default:
Fabrice Bellard's avatar
Fabrice Bellard committed
78
            return -1;
Fabrice Bellard's avatar
Fabrice Bellard committed
79 80 81 82
        }
    return 0;
}

Fabrice Bellard's avatar
Fabrice Bellard committed
83
#define RAW_PACKET_SIZE 1024
Fabrice Bellard's avatar
Fabrice Bellard committed
84

85
int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt)
86 87 88 89 90 91
{
    int ret, size;

    size = RAW_PACKET_SIZE;

    if (av_new_packet(pkt, size) < 0)
92
        return AVERROR(ENOMEM);
93

94
    pkt->pos= url_ftell(s->pb);
95
    pkt->stream_index = 0;
96
    ret = get_partial_buffer(s->pb, pkt->data, size);
97
    if (ret < 0) {
98
        av_free_packet(pkt);
99
        return ret;
100 101 102 103
    }
    pkt->size = ret;
    return ret;
}
104
#endif
105

106
#if CONFIG_RAWVIDEO_DEMUXER
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
static int rawvideo_read_packet(AVFormatContext *s, AVPacket *pkt)
{
    int packet_size, ret, width, height;
    AVStream *st = s->streams[0];

    width = st->codec->width;
    height = st->codec->height;

    packet_size = avpicture_get_size(st->codec->pix_fmt, width, height);
    if (packet_size < 0)
        return -1;

    ret= av_get_packet(s->pb, pkt, packet_size);
    pkt->pts=
    pkt->dts= pkt->pos / packet_size;

    pkt->stream_index = 0;
124 125
    if (ret < 0)
        return ret;
126
    return 0;
127
}
128
#endif
129

130
#if CONFIG_DEMUXERS
131
int ff_raw_audio_read_header(AVFormatContext *s,
132
                             AVFormatParameters *ap)
Måns Rullgård's avatar
Måns Rullgård committed
133
{
134
    AVStream *st = av_new_stream(s, 0);
Måns Rullgård's avatar
Måns Rullgård committed
135
    if (!st)
136
        return AVERROR(ENOMEM);
137
    st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
138
    st->codec->codec_id = s->iformat->value;
139
    st->need_parsing = AVSTREAM_PARSE_FULL;
Måns Rullgård's avatar
Måns Rullgård committed
140
    /* the parameters will be extracted from the compressed bitstream */
141

Måns Rullgård's avatar
Måns Rullgård committed
142 143 144
    return 0;
}

145
/* MPEG-1/H.263 input */
146
int ff_raw_video_read_header(AVFormatContext *s,
Fabrice Bellard's avatar
Fabrice Bellard committed
147 148 149 150
                             AVFormatParameters *ap)
{
    AVStream *st;

Fabrice Bellard's avatar
Fabrice Bellard committed
151
    st = av_new_stream(s, 0);
Fabrice Bellard's avatar
Fabrice Bellard committed
152
    if (!st)
153
        return AVERROR(ENOMEM);
Fabrice Bellard's avatar
Fabrice Bellard committed
154

155
    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
156
    st->codec->codec_id = s->iformat->value;
157
    st->need_parsing = AVSTREAM_PARSE_FULL;
158

159 160
    /* for MJPEG, specify frame rate */
    /* for MPEG-4 specify it, too (most MPEG-4 streams do not have the fixed_vop_rate set ...)*/
161
    if (ap->time_base.num) {
162
        st->codec->time_base= ap->time_base;
163
    } else if ( st->codec->codec_id == CODEC_ID_MJPEG ||
164
                st->codec->codec_id == CODEC_ID_MPEG4 ||
165
                st->codec->codec_id == CODEC_ID_DIRAC ||
166
                st->codec->codec_id == CODEC_ID_DNXHD ||
167
                st->codec->codec_id == CODEC_ID_VC1   ||
168
                st->codec->codec_id == CODEC_ID_H264) {
169
        st->codec->time_base= (AVRational){1,25};
Fabrice Bellard's avatar
Fabrice Bellard committed
170
    }
171
    av_set_pts_info(st, 64, 1, 1200000);
172

Fabrice Bellard's avatar
Fabrice Bellard committed
173 174
    return 0;
}
175
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
176

177 178
/* Note: Do not forget to add new entries to the Makefile as well. */

179
#if CONFIG_AC3_MUXER
180
AVOutputFormat ac3_muxer = {
Fabrice Bellard's avatar
Fabrice Bellard committed
181
    "ac3",
182
    NULL_IF_CONFIG_SMALL("raw AC-3"),
183
    "audio/x-ac3",
Fabrice Bellard's avatar
Fabrice Bellard committed
184
    "ac3",
Fabrice Bellard's avatar
Fabrice Bellard committed
185
    0,
Fabrice Bellard's avatar
Fabrice Bellard committed
186
    CODEC_ID_AC3,
187
    CODEC_ID_NONE,
188
    NULL,
189
    ff_raw_write_packet,
190
    .flags= AVFMT_NOTIMESTAMPS,
Fabrice Bellard's avatar
Fabrice Bellard committed
191
};
192
#endif
193

194
#if CONFIG_DIRAC_MUXER
195 196
AVOutputFormat dirac_muxer = {
    "dirac",
197
    NULL_IF_CONFIG_SMALL("raw Dirac"),
198 199 200
    NULL,
    "drc",
    0,
201
    CODEC_ID_NONE,
202 203
    CODEC_ID_DIRAC,
    NULL,
204
    ff_raw_write_packet,
205 206 207 208
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

209
#if CONFIG_DNXHD_MUXER
Baptiste Coudurier's avatar
Baptiste Coudurier committed
210 211 212 213 214 215 216 217 218
AVOutputFormat dnxhd_muxer = {
    "dnxhd",
    NULL_IF_CONFIG_SMALL("raw DNxHD (SMPTE VC-3)"),
    NULL,
    "dnxhd",
    0,
    CODEC_ID_NONE,
    CODEC_ID_DNXHD,
    NULL,
219
    ff_raw_write_packet,
Baptiste Coudurier's avatar
Baptiste Coudurier committed
220 221 222 223
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

224
#if CONFIG_DTS_MUXER
225 226 227 228 229
AVOutputFormat dts_muxer = {
    "dts",
    NULL_IF_CONFIG_SMALL("raw DTS"),
    "audio/x-dca",
    "dts",
Måns Rullgård's avatar
Måns Rullgård committed
230
    0,
231 232
    CODEC_ID_DTS,
    CODEC_ID_NONE,
Måns Rullgård's avatar
Måns Rullgård committed
233
    NULL,
234
    ff_raw_write_packet,
235 236 237 238
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

239
#if CONFIG_EAC3_MUXER
240 241 242 243 244 245 246 247 248
AVOutputFormat eac3_muxer = {
    "eac3",
    NULL_IF_CONFIG_SMALL("raw E-AC-3"),
    "audio/x-eac3",
    "eac3",
    0,
    CODEC_ID_EAC3,
    CODEC_ID_NONE,
    NULL,
249
    ff_raw_write_packet,
250 251 252 253
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

254
#if CONFIG_GSM_DEMUXER
255 256
AVInputFormat gsm_demuxer = {
    "gsm",
257
    NULL_IF_CONFIG_SMALL("raw GSM"),
258 259
    0,
    NULL,
260
    ff_raw_audio_read_header,
261
    ff_raw_read_partial_packet,
262 263 264 265
    .flags= AVFMT_GENERIC_INDEX,
    .extensions = "gsm",
    .value = CODEC_ID_GSM,
};
266
#endif
267

268
#if CONFIG_H261_MUXER
269
AVOutputFormat h261_muxer = {
270
    "h261",
271
    NULL_IF_CONFIG_SMALL("raw H.261"),
272 273 274
    "video/x-h261",
    "h261",
    0,
275
    CODEC_ID_NONE,
276
    CODEC_ID_H261,
277
    NULL,
278
    ff_raw_write_packet,
279
    .flags= AVFMT_NOTIMESTAMPS,
280
};
281
#endif
282

283
#if CONFIG_H263_MUXER
284
AVOutputFormat h263_muxer = {
Fabrice Bellard's avatar
Fabrice Bellard committed
285
    "h263",
286
    NULL_IF_CONFIG_SMALL("raw H.263"),
Fabrice Bellard's avatar
Fabrice Bellard committed
287 288 289
    "video/x-h263",
    "h263",
    0,
290
    CODEC_ID_NONE,
Fabrice Bellard's avatar
Fabrice Bellard committed
291
    CODEC_ID_H263,
292
    NULL,
293
    ff_raw_write_packet,
294
    .flags= AVFMT_NOTIMESTAMPS,
Fabrice Bellard's avatar
Fabrice Bellard committed
295
};
296
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
297

298
#if CONFIG_H264_MUXER
299 300 301 302 303 304 305 306 307
AVOutputFormat h264_muxer = {
    "h264",
    NULL_IF_CONFIG_SMALL("raw H.264 video format"),
    NULL,
    "h264",
    0,
    CODEC_ID_NONE,
    CODEC_ID_H264,
    NULL,
308
    ff_raw_write_packet,
309 310
    .flags= AVFMT_NOTIMESTAMPS,
};
311
#endif
312

313 314 315 316 317 318 319 320 321 322
#if CONFIG_CAVSVIDEO_MUXER
AVOutputFormat cavsvideo_muxer = {
    "cavsvideo",
    NULL_IF_CONFIG_SMALL("raw Chinese AVS video"),
    NULL,
    "cavs",
    0,
    CODEC_ID_NONE,
    CODEC_ID_CAVS,
    NULL,
323
    ff_raw_write_packet,
324 325 326 327
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

328
#if CONFIG_M4V_MUXER
329
AVOutputFormat m4v_muxer = {
330
    "m4v",
331
    NULL_IF_CONFIG_SMALL("raw MPEG-4 video format"),
332 333 334 335 336
    NULL,
    "m4v",
    0,
    CODEC_ID_NONE,
    CODEC_ID_MPEG4,
337
    NULL,
338
    ff_raw_write_packet,
339
    .flags= AVFMT_NOTIMESTAMPS,
340
};
341
#endif
342

343
#if CONFIG_MJPEG_DEMUXER
344 345
AVInputFormat mjpeg_demuxer = {
    "mjpeg",
346
    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
Michael Niedermayer's avatar
Michael Niedermayer committed
347
    0,
348
    NULL,
349
    ff_raw_video_read_header,
350
    ff_raw_read_partial_packet,
351
    .flags= AVFMT_GENERIC_INDEX,
352 353
    .extensions = "mjpg,mjpeg",
    .value = CODEC_ID_MJPEG,
Michael Niedermayer's avatar
Michael Niedermayer committed
354
};
355
#endif
Michael Niedermayer's avatar
Michael Niedermayer committed
356

357
#if CONFIG_MJPEG_MUXER
358 359
AVOutputFormat mjpeg_muxer = {
    "mjpeg",
360
    NULL_IF_CONFIG_SMALL("raw MJPEG video"),
361 362
    "video/x-mjpeg",
    "mjpg,mjpeg",
Michael Niedermayer's avatar
Michael Niedermayer committed
363 364
    0,
    CODEC_ID_NONE,
365
    CODEC_ID_MJPEG,
366
    NULL,
367
    ff_raw_write_packet,
368
    .flags= AVFMT_NOTIMESTAMPS,
Michael Niedermayer's avatar
Michael Niedermayer committed
369
};
370
#endif
Michael Niedermayer's avatar
Michael Niedermayer committed
371

372
#if CONFIG_MLP_DEMUXER
373 374 375
AVInputFormat mlp_demuxer = {
    "mlp",
    NULL_IF_CONFIG_SMALL("raw MLP"),
Fabrice Bellard's avatar
Fabrice Bellard committed
376
    0,
377
    NULL,
378
    ff_raw_audio_read_header,
379
    ff_raw_read_partial_packet,
380
    .flags= AVFMT_GENERIC_INDEX,
381 382
    .extensions = "mlp",
    .value = CODEC_ID_MLP,
Fabrice Bellard's avatar
Fabrice Bellard committed
383
};
384
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
385

Andreas Öman's avatar
Andreas Öman committed
386
#if CONFIG_MLP_MUXER
Ramiro Polla's avatar
Ramiro Polla committed
387 388 389 390 391 392 393 394 395
AVOutputFormat mlp_muxer = {
    "mlp",
    NULL_IF_CONFIG_SMALL("raw MLP"),
    NULL,
    "mlp",
    0,
    CODEC_ID_MLP,
    CODEC_ID_NONE,
    NULL,
396
    ff_raw_write_packet,
Ramiro Polla's avatar
Ramiro Polla committed
397 398 399 400
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

401 402 403 404 405 406
#if CONFIG_SRT_MUXER
AVOutputFormat srt_muxer = {
    .name           = "srt",
    .long_name      = NULL_IF_CONFIG_SMALL("SubRip subtitle format"),
    .mime_type      = "application/x-subrip",
    .extensions     = "srt",
407
    .write_packet   = ff_raw_write_packet,
408 409 410 411 412
    .flags          = AVFMT_NOTIMESTAMPS,
    .subtitle_codec = CODEC_ID_SRT,
};
#endif

Ramiro Polla's avatar
Ramiro Polla committed
413 414 415 416 417 418
#if CONFIG_TRUEHD_DEMUXER
AVInputFormat truehd_demuxer = {
    "truehd",
    NULL_IF_CONFIG_SMALL("raw TrueHD"),
    0,
    NULL,
419
    ff_raw_audio_read_header,
Ramiro Polla's avatar
Ramiro Polla committed
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436
    ff_raw_read_partial_packet,
    .flags= AVFMT_GENERIC_INDEX,
    .extensions = "thd",
    .value = CODEC_ID_TRUEHD,
};
#endif

#if CONFIG_TRUEHD_MUXER
AVOutputFormat truehd_muxer = {
    "truehd",
    NULL_IF_CONFIG_SMALL("raw TrueHD"),
    NULL,
    "thd",
    0,
    CODEC_ID_TRUEHD,
    CODEC_ID_NONE,
    NULL,
437
    ff_raw_write_packet,
Ramiro Polla's avatar
Ramiro Polla committed
438 439 440 441
    .flags= AVFMT_NOTIMESTAMPS,
};
#endif

442
#if CONFIG_MPEG1VIDEO_MUXER
443
AVOutputFormat mpeg1video_muxer = {
Fabrice Bellard's avatar
Fabrice Bellard committed
444
    "mpeg1video",
445
    NULL_IF_CONFIG_SMALL("raw MPEG-1 video"),
Fabrice Bellard's avatar
Fabrice Bellard committed
446
    "video/x-mpeg",
447
    "mpg,mpeg,m1v",
Fabrice Bellard's avatar
Fabrice Bellard committed
448
    0,
449
    CODEC_ID_NONE,
Fabrice Bellard's avatar
Fabrice Bellard committed
450
    CODEC_ID_MPEG1VIDEO,
451
    NULL,
452
    ff_raw_write_packet,
453
    .flags= AVFMT_NOTIMESTAMPS,
Fabrice Bellard's avatar
Fabrice Bellard committed
454
};
455
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
456

457
#if CONFIG_MPEG2VIDEO_MUXER
458
AVOutputFormat mpeg2video_muxer = {
459
    "mpeg2video",
460
    NULL_IF_CONFIG_SMALL("raw MPEG-2 video"),
461 462 463
    NULL,
    "m2v",
    0,
464
    CODEC_ID_NONE,
465
    CODEC_ID_MPEG2VIDEO,
466
    NULL,
467
    ff_raw_write_packet,
468
    .flags= AVFMT_NOTIMESTAMPS,
469
};
470
#endif
471

472
#if CONFIG_RAWVIDEO_DEMUXER
473 474 475 476 477
AVInputFormat rawvideo_demuxer = {
    "rawvideo",
    NULL_IF_CONFIG_SMALL("raw video format"),
    0,
    NULL,
478
    ff_raw_read_header,
479
    rawvideo_read_packet,
480
    .flags= AVFMT_GENERIC_INDEX,
481 482
    .extensions = "yuv,cif,qcif,rgb",
    .value = CODEC_ID_RAWVIDEO,
483
};
484
#endif
485

486
#if CONFIG_RAWVIDEO_MUXER
487 488 489 490 491
AVOutputFormat rawvideo_muxer = {
    "rawvideo",
    NULL_IF_CONFIG_SMALL("raw video format"),
    NULL,
    "yuv,rgb",
Fabrice Bellard's avatar
Fabrice Bellard committed
492
    0,
493
    CODEC_ID_NONE,
494
    CODEC_ID_RAWVIDEO,
495
    NULL,
496
    ff_raw_write_packet,
497
    .flags= AVFMT_NOTIMESTAMPS,
Fabrice Bellard's avatar
Fabrice Bellard committed
498
};
499
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
500

501
#if CONFIG_SHORTEN_DEMUXER
502 503 504 505 506
AVInputFormat shorten_demuxer = {
    "shn",
    NULL_IF_CONFIG_SMALL("raw Shorten"),
    0,
    NULL,
507
    ff_raw_audio_read_header,
508
    ff_raw_read_partial_packet,
509 510 511 512
    .flags= AVFMT_GENERIC_INDEX,
    .extensions = "shn",
    .value = CODEC_ID_SHORTEN,
};
513
#endif
514

515
#if CONFIG_VC1_DEMUXER
Kostya Shishkov's avatar
Kostya Shishkov committed
516 517
AVInputFormat vc1_demuxer = {
    "vc1",
518
    NULL_IF_CONFIG_SMALL("raw VC-1"),
Kostya Shishkov's avatar
Kostya Shishkov committed
519 520
    0,
    NULL /* vc1_probe */,
521
    ff_raw_video_read_header,
522
    ff_raw_read_partial_packet,
Kostya Shishkov's avatar
Kostya Shishkov committed
523 524 525
    .extensions = "vc1",
    .value = CODEC_ID_VC1,
};
526
#endif
Kostya Shishkov's avatar
Kostya Shishkov committed
527

528
/* PCM formats */
529

530
#define PCMOUTPUTDEF(name, long_name, ext, codec) \
531
AVOutputFormat pcm_ ## name ## _muxer = {\
Fabrice Bellard's avatar
Fabrice Bellard committed
532
    #name,\
533
    NULL_IF_CONFIG_SMALL(long_name),\
Fabrice Bellard's avatar
Fabrice Bellard committed
534 535 536 537
    NULL,\
    ext,\
    0,\
    codec,\
538
    CODEC_ID_NONE,\
539
    NULL,\
540
    ff_raw_write_packet,\
541
    .flags= AVFMT_NOTIMESTAMPS,\
Fabrice Bellard's avatar
Fabrice Bellard committed
542
};
543 544


545
#if CONFIG_MUXERS
546 547 548 549 550
#define PCMDEF(name, long_name, ext, codec) \
        PCMOUTPUTDEF(name, long_name, ext, codec)
#else
#define PCMDEF(name, long_name, ext, codec)
#endif
Fabrice Bellard's avatar
Fabrice Bellard committed
551

552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574
PCMDEF(f64be, "PCM 64 bit floating-point big-endian format",
       NULL, CODEC_ID_PCM_F64BE)

PCMDEF(f64le, "PCM 64 bit floating-point little-endian format",
       NULL, CODEC_ID_PCM_F64LE)

PCMDEF(f32be, "PCM 32 bit floating-point big-endian format",
       NULL, CODEC_ID_PCM_F32BE)

PCMDEF(f32le, "PCM 32 bit floating-point little-endian format",
       NULL, CODEC_ID_PCM_F32LE)

PCMDEF(s32be, "PCM signed 32 bit big-endian format",
       NULL, CODEC_ID_PCM_S32BE)

PCMDEF(s32le, "PCM signed 32 bit little-endian format",
       NULL, CODEC_ID_PCM_S32LE)

PCMDEF(s24be, "PCM signed 24 bit big-endian format",
       NULL, CODEC_ID_PCM_S24BE)

PCMDEF(s24le, "PCM signed 24 bit little-endian format",
       NULL, CODEC_ID_PCM_S24LE)
Fabrice Bellard's avatar
Fabrice Bellard committed
575

576
PCMDEF(s16be, "PCM signed 16 bit big-endian format",
577
       AV_NE("sw", NULL), CODEC_ID_PCM_S16BE)
Fabrice Bellard's avatar
Fabrice Bellard committed
578

579
PCMDEF(s16le, "PCM signed 16 bit little-endian format",
580
       AV_NE(NULL, "sw"), CODEC_ID_PCM_S16LE)
581 582 583

PCMDEF(s8, "PCM signed 8 bit format",
       "sb", CODEC_ID_PCM_S8)
Fabrice Bellard's avatar
Fabrice Bellard committed
584

585 586 587 588 589 590 591 592 593 594 595 596
PCMDEF(u32be, "PCM unsigned 32 bit big-endian format",
       NULL, CODEC_ID_PCM_U32BE)

PCMDEF(u32le, "PCM unsigned 32 bit little-endian format",
       NULL, CODEC_ID_PCM_U32LE)

PCMDEF(u24be, "PCM unsigned 24 bit big-endian format",
       NULL, CODEC_ID_PCM_U24BE)

PCMDEF(u24le, "PCM unsigned 24 bit little-endian format",
       NULL, CODEC_ID_PCM_U24LE)

597
PCMDEF(u16be, "PCM unsigned 16 bit big-endian format",
598
       AV_NE("uw", NULL), CODEC_ID_PCM_U16BE)
Fabrice Bellard's avatar
Fabrice Bellard committed
599

600
PCMDEF(u16le, "PCM unsigned 16 bit little-endian format",
601
       AV_NE(NULL, "uw"), CODEC_ID_PCM_U16LE)
Fabrice Bellard's avatar
Fabrice Bellard committed
602

603
PCMDEF(u8, "PCM unsigned 8 bit format",
Fabrice Bellard's avatar
Fabrice Bellard committed
604
       "ub", CODEC_ID_PCM_U8)
Fabrice Bellard's avatar
Fabrice Bellard committed
605

606
PCMDEF(alaw, "PCM A-law format",
Fabrice Bellard's avatar
Fabrice Bellard committed
607
       "al", CODEC_ID_PCM_ALAW)
Fabrice Bellard's avatar
Fabrice Bellard committed
608

609 610
PCMDEF(mulaw, "PCM mu-law format",
       "ul", CODEC_ID_PCM_MULAW)