2013-11-16 13:15:35 +01:00
|
|
|
/*
|
|
|
|
|
* The simplest mpeg audio layer 2 encoder
|
|
|
|
|
* Copyright (c) 2000, 2001 Fabrice Bellard
|
|
|
|
|
*
|
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
|
*
|
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
*/
|
|
|
|
|
|
2021-06-12 01:10:58 +02:00
|
|
|
#include "libavutil/channel_layout.h"
|
2013-12-03 19:55:12 +01:00
|
|
|
#define USE_FLOATS 1
|
2022-03-16 18:18:28 +01:00
|
|
|
#include "codec_internal.h"
|
2013-11-16 13:15:35 +01:00
|
|
|
#include "mpegaudioenc_template.c"
|
|
|
|
|
|
2022-03-16 21:09:54 +01:00
|
|
|
const FFCodec ff_mp2_encoder = {
|
|
|
|
|
.p.name = "mp2",
|
2022-08-29 13:38:02 +02:00
|
|
|
CODEC_LONG_NAME("MP2 (MPEG audio layer 2)"),
|
2022-03-16 21:09:54 +01:00
|
|
|
.p.type = AVMEDIA_TYPE_AUDIO,
|
|
|
|
|
.p.id = AV_CODEC_ID_MP2,
|
2022-11-27 13:37:10 +01:00
|
|
|
.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
|
2013-11-16 13:15:35 +01:00
|
|
|
.priv_data_size = sizeof(MpegAudioContext),
|
|
|
|
|
.init = MPA_encode_init,
|
2022-03-30 23:28:24 +02:00
|
|
|
FF_CODEC_ENCODE_CB(MPA_encode_frame),
|
2025-03-07 01:19:27 +01:00
|
|
|
CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16),
|
|
|
|
|
CODEC_SAMPLERATES(44100, 48000, 32000, 22050, 24000, 16000),
|
|
|
|
|
CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO),
|
2013-11-16 13:15:35 +01:00
|
|
|
.defaults = mp2_defaults,
|
|
|
|
|
};
|