summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-01-01 16:16:57 +0100
committerHendrik Leppkes <h.leppkes@gmail.com>2016-01-01 16:20:39 +0100
commit5e8b05345243cdec3ca01116ce130da812ffed3d (patch)
tree497704c9f07bbee3858e88ba95780688fa2aad0d /libavcodec
parent5f2d12b82494220f2fa65bd3295617e09ef25cad (diff)
parent2c6811397bdf13d43ca206e48d6d6da9c2cd47c6 (diff)
Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'
* commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/Makefile1
-rw-r--r--libavcodec/aacdec.c5
-rw-r--r--libavcodec/aacdec_fixed.c2
-rw-r--r--libavcodec/aacdec_template.c12
-rw-r--r--libavcodec/avcodec.h19
-rw-r--r--libavcodec/codec_desc.c10
-rw-r--r--libavcodec/dcadec.c12
-rw-r--r--libavcodec/h264.c20
-rw-r--r--libavcodec/hevc.c11
-rw-r--r--libavcodec/jpeg2000dec.c12
-rw-r--r--libavcodec/libdcadec.c13
-rw-r--r--libavcodec/mpeg12dec.c15
-rw-r--r--libavcodec/mpeg4videodec.c23
-rw-r--r--libavcodec/profiles.c124
-rw-r--r--libavcodec/profiles.h34
-rw-r--r--libavcodec/utils.c15
-rw-r--r--libavcodec/vc1dec.c13
-rw-r--r--libavcodec/version.h2
18 files changed, 225 insertions, 118 deletions
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 0717d0acb2..a18ca5bc4b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -33,6 +33,7 @@ OBJS = allcodecs.o \
mathtables.o \
options.o \
parser.o \
+ profiles.o \
qsv_api.o \
raw.o \
resample.o \
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index f53803bd6d..26bdea1ecc 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -55,6 +55,7 @@
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "aacadtsdec.h"
+#include "profiles.h"
#include "libavutil/intfloat.h"
#include <errno.h>
@@ -555,7 +556,7 @@ AVCodec ff_aac_decoder = {
.channel_layouts = aac_channel_layout,
.flush = flush,
.priv_class = &aac_decoder_class,
- .profiles = profiles,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};
/*
@@ -579,5 +580,5 @@ AVCodec ff_aac_latm_decoder = {
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.channel_layouts = aac_channel_layout,
.flush = flush,
- .profiles = profiles,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
};
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 923fbe0383..396a874d95 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -80,6 +80,7 @@
#include "aacsbr.h"
#include "mpeg4audio.h"
#include "aacadtsdec.h"
+#include "profiles.h"
#include "libavutil/intfloat.h"
#include <math.h>
@@ -440,5 +441,6 @@ AVCodec ff_aac_fixed_decoder = {
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
.channel_layouts = aac_channel_layout,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
.flush = flush,
};
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 620600c05a..d819958d95 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -3232,15 +3232,3 @@ static const AVClass aac_decoder_class = {
.option = options,
.version = LIBAVUTIL_VERSION_INT,
};
-
-static const AVProfile profiles[] = {
- { FF_PROFILE_AAC_MAIN, "Main" },
- { FF_PROFILE_AAC_LOW, "LC" },
- { FF_PROFILE_AAC_SSR, "SSR" },
- { FF_PROFILE_AAC_LTP, "LTP" },
- { FF_PROFILE_AAC_HE, "HE-AAC" },
- { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
- { FF_PROFILE_AAC_LD, "LD" },
- { FF_PROFILE_AAC_ELD, "ELD" },
- { FF_PROFILE_UNKNOWN },
-};
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 35965d7a25..f365775f0b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -574,13 +574,17 @@ typedef struct AVCodecDescriptor {
* Codec properties, a combination of AV_CODEC_PROP_* flags.
*/
int props;
-
/**
* MIME type(s) associated with the codec.
* May be NULL; if not, a NULL-terminated array of MIME types.
* The first item is always non-NULL and is the preferred MIME type.
*/
const char *const *mime_types;
+ /**
+ * If non-NULL, an array of profiles recognized for this codec.
+ * Terminated with FF_PROFILE_UNKNOWN.
+ */
+ const struct AVProfile *profiles;
} AVCodecDescriptor;
/**
@@ -5055,6 +5059,19 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
*/
const char *av_get_profile_name(const AVCodec *codec, int profile);
+/**
+ * Return a name for the specified profile, if available.
+ *
+ * @param codec_id the ID of the codec to which the requested profile belongs
+ * @param profile the profile value for which a name is requested
+ * @return A name for the profile if found, NULL otherwise.
+ *
+ * @note unlike av_get_profile_name(), which searches a list of profiles
+ * supported by a specific decoder or encoder implementation, this
+ * function searches the list of profiles from the AVCodecDescriptor
+ */
+const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
+
int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
//FIXME func typedef
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 9cad3e6e47..a445c565e6 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -24,6 +24,7 @@
#include "libavutil/common.h"
#include "libavutil/internal.h"
#include "avcodec.h"
+#include "profiles.h"
#include "version.h"
#define MT(...) (const char *const[]){ __VA_ARGS__, NULL }
@@ -43,6 +44,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "mpeg2video",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
},
#if FF_API_XVMC
{
@@ -102,6 +104,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "mpeg4",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
},
{
.id = AV_CODEC_ID_RAWVIDEO,
@@ -207,6 +210,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "h264",
.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_REORDER,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
},
{
.id = AV_CODEC_ID_INDEO3,
@@ -473,6 +477,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "vc1",
.long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
},
{
.id = AV_CODEC_ID_WMV3,
@@ -480,6 +485,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "wmv3",
.long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
},
{
.id = AV_CODEC_ID_LOCO,
@@ -602,6 +608,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
AV_CODEC_PROP_LOSSLESS,
.mime_types= MT("image/jp2"),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles),
},
{
.id = AV_CODEC_ID_VMNC,
@@ -1202,6 +1209,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "hevc",
.long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding)"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
},
{
.id = AV_CODEC_ID_FIC,
@@ -2097,6 +2105,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.props = AV_CODEC_PROP_LOSSY,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
},
{
.id = AV_CODEC_ID_AC3,
@@ -2111,6 +2120,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.name = "dts",
.long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
.props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
},
{
.id = AV_CODEC_ID_VORBIS,
diff --git a/libavcodec/dcadec.c b/libavcodec/dcadec.c
index 4283adf99f..e9120a1907 100644
--- a/libavcodec/dcadec.c
+++ b/libavcodec/dcadec.c
@@ -49,6 +49,7 @@
#include "get_bits.h"
#include "internal.h"
#include "mathops.h"
+#include "profiles.h"
#include "synth_filter.h"
#if ARCH_ARM
@@ -2030,15 +2031,6 @@ static av_cold int dca_decode_end(AVCodecContext *avctx)
return 0;
}
-static const AVProfile profiles[] = {
- { FF_PROFILE_DTS, "DTS" },
- { FF_PROFILE_DTS_ES, "DTS-ES" },
- { FF_PROFILE_DTS_96_24, "DTS 96/24" },
- { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
- { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
- { FF_PROFILE_UNKNOWN },
-};
-
static const AVOption options[] = {
{ "disable_xch", "disable decoding of the XCh extension", offsetof(DCAContext, xch_disable), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM },
{ "disable_xll", "disable decoding of the XLL extension", offsetof(DCAContext, xll_disable), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM },
@@ -2065,6 +2057,6 @@ AVCodec ff_dca_decoder = {
.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
AV_SAMPLE_FMT_NONE },
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
.priv_class = &dca_decoder_class,
};
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 139011b60b..a89be349f0 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -46,6 +46,7 @@
#include "mathops.h"
#include "me_cmp.h"
#include "mpegutils.h"
+#include "profiles.h"
#include "rectangle.h"
#include "svq3.h"
#include "thread.h"
@@ -1962,23 +1963,6 @@ static const AVClass h264_class = {
.version = LIBAVUTIL_VERSION_INT,
};
-static const AVProfile profiles[] = {
- { FF_PROFILE_H264_BASELINE, "Baseline" },
- { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
- { FF_PROFILE_H264_MAIN, "Main" },
- { FF_PROFILE_H264_EXTENDED, "Extended" },
- { FF_PROFILE_H264_HIGH, "High" },
- { FF_PROFILE_H264_HIGH_10, "High 10" },
- { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
- { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
- { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
- { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
- { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
- { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
- { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
- { FF_PROFILE_UNKNOWN },
-};
-
AVCodec ff_h264_decoder = {
.name = "h264",
.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
@@ -1995,7 +1979,7 @@ AVCodec ff_h264_decoder = {
.flush = flush_dpb,
.init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
.update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
.priv_class = &h264_class,
};
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 21435da981..33c6ee2d62 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -38,6 +38,7 @@
#include "cabac_functions.h"
#include "golomb.h"
#include "hevc.h"
+#include "profiles.h"
const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 };
@@ -3314,14 +3315,6 @@ static void hevc_decode_flush(AVCodecContext *avctx)
#define OFFSET(x) offsetof(HEVCContext, x)
#define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
-static const AVProfile profiles[] = {
- { FF_PROFILE_HEVC_MAIN, "Main" },
- { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
- { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
- { FF_PROFILE_HEVC_REXT, "Rext" },
- { FF_PROFILE_UNKNOWN },
-};
-
static const AVOption options[] = {
{ "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin),
AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, PAR },
@@ -3352,5 +3345,5 @@ AVCodec ff_hevc_decoder = {
.init_thread_copy = hevc_init_thread_copy,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
};
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 515d6a052e..849b0f7262 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -39,6 +39,7 @@
#include "thread.h"
#include "jpeg2000.h"
#include "jpeg2000dsp.h"
+#include "profiles.h"
#define JP2_SIG_TYPE 0x6A502020
#define JP2_SIG_VALUE 0x0D0A870A
@@ -2142,15 +2143,6 @@ static const AVOption options[] = {
{ NULL },
};
-static const AVProfile profiles[] = {
- { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
- { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
- { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
- { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
- { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
- { FF_PROFILE_UNKNOWN },
-};
-
static const AVClass jpeg2000_class = {
.class_name = "jpeg2000",
.item_name = av_default_item_name,
@@ -2170,5 +2162,5 @@ AVCodec ff_jpeg2000_decoder = {
.decode = jpeg2000_decode_frame,
.priv_class = &jpeg2000_class,
.max_lowres = 5,
- .profiles = NULL_IF_CONFIG_SMALL(profiles)
+ .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles)
};
diff --git a/libavcodec/libdcadec.c b/libavcodec/libdcadec.c
index 79fa3316d6..7d1f931878 100644
--- a/libavcodec/libdcadec.c
+++ b/libavcodec/libdcadec.c
@@ -29,6 +29,7 @@
#include "dca.h"
#include "dca_syncwords.h"
#include "internal.h"
+#include "profiles.h"
typedef struct DCADecContext {
const AVClass *class;
@@ -292,16 +293,6 @@ static const AVClass dcadec_class = {
.category = AV_CLASS_CATEGORY_DECODER,
};
-static const AVProfile profiles[] = {
- { FF_PROFILE_DTS, "DTS" },
- { FF_PROFILE_DTS_ES, "DTS-ES" },
- { FF_PROFILE_DTS_96_24, "DTS 96/24" },
- { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
- { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
- { FF_PROFILE_DTS_EXPRESS, "DTS Express" },
- { FF_PROFILE_UNKNOWN },
-};
-
AVCodec ff_libdcadec_decoder = {
.name = "libdcadec",
.long_name = NULL_IF_CONFIG_SMALL("dcadec DCA decoder"),
@@ -316,5 +307,5 @@ AVCodec ff_libdcadec_decoder = {
.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P,
AV_SAMPLE_FMT_NONE },
.priv_class = &dcadec_class,
- .profiles = NULL_IF_CONFIG_SMALL(profiles),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
};
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 66bc4dc61b..23c77cdb33 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -44,6 +44,7 @@
#include "mpegutils.h"
#include "mpegvideo.h"
#include "mpegvideodata.h"
+#include "profiles.h"
#include "thread.h"
#include "version.h"
#include "vdpau_compat.h"
@@ -2855,18 +2856,6 @@ static av_cold int mpeg_decode_end(AVCodecContext *avctx)
return 0;
}
-static const AVProfile mpeg2_video_profiles[] = {
- { FF_PROFILE_MPEG2_422, "4:2:2" },
- { FF_PROFILE_MPEG2_HIGH, "High" },
- { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
- { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
- { FF_PROFILE_MPEG2_MAIN, "Main" },
- { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
- { FF_PROFILE_RESERVED, "Reserved" },
- { FF_PROFILE_RESERVED, "Reserved" },
- { FF_PROFILE_UNKNOWN },
-};
-
AVCodec ff_mpeg1video_decoder = {
.name = "mpeg1video",
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
@@ -2898,7 +2887,7 @@ AVCodec ff_mpeg2video_decoder = {
AV_CODEC_CAP_SLICE_THREADS,
.flush = flush,
.max_lowres = 3,
- .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
};
//legacy decoder
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 2c3b598d75..133adbb6fe 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -32,6 +32,7 @@
#include "mpegvideodata.h"
#include "mpeg4video.h"
#include "h263.h"
+#include "profiles.h"
#include "thread.h"
#include "xvididct.h"
@@ -2745,26 +2746,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 0;
}
-static const AVProfile mpeg4_video_profiles[] = {
- { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
- { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
- { FF_PROFILE_MPEG4_CORE, "Core Profile" },
- { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
- { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
- { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
- { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
- { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
- { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
- { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
- { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
- { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
- { FF_PROFILE_UNKNOWN },
-};
-
static const AVOption mpeg4_options[] = {
{"quarter_sample", "1/4 subpel MC", offsetof(MpegEncContext, quarter_sample), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0},
{"divx_packed", "divx style packed b frames", offsetof(MpegEncContext, divx_packed), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0},
@@ -2793,7 +2774,7 @@ AVCodec ff_mpeg4_decoder = {
.flush = ff_mpeg_flush,
.max_lowres = 3,
.pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
- .profiles = NULL_IF_CONFIG_SMALL(mpeg4_video_profiles),
+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
.update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context),
.priv_class = &mpeg4_class,
};
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
new file mode 100644
index 0000000000..fa6baedfeb
--- /dev/null
+++ b/libavcodec/profiles.c
@@ -0,0 +1,124 @@
+/*
+ *
+ * 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
+ */
+
+#include "config.h"
+
+#include "avcodec.h"
+#include "profiles.h"
+
+#if !CONFIG_SMALL
+
+const AVProfile ff_aac_profiles[] = {
+ { FF_PROFILE_AAC_LOW, "LC" },
+ { FF_PROFILE_AAC_HE, "HE-AAC" },
+ { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
+ { FF_PROFILE_AAC_LD, "LD" },
+ { FF_PROFILE_AAC_ELD, "ELD" },
+ { FF_PROFILE_AAC_MAIN, "Main" },
+ { FF_PROFILE_AAC_LOW, "LC" },
+ { FF_PROFILE_AAC_SSR, "SSR" },
+ { FF_PROFILE_AAC_LTP, "LTP" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_dca_profiles[] = {
+ { FF_PROFILE_DTS, "DTS" },
+ { FF_PROFILE_DTS_ES, "DTS-ES" },
+ { FF_PROFILE_DTS_96_24, "DTS 96/24" },
+ { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
+ { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
+ { FF_PROFILE_DTS_EXPRESS, "DTS Express" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_h264_profiles[] = {
+ { FF_PROFILE_H264_BASELINE, "Baseline" },
+ { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
+ { FF_PROFILE_H264_MAIN, "Main" },
+ { FF_PROFILE_H264_EXTENDED, "Extended" },
+ { FF_PROFILE_H264_HIGH, "High" },
+ { FF_PROFILE_H264_HIGH_10, "High 10" },
+ { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
+ { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
+ { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
+ { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
+ { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
+ { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
+ { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_hevc_profiles[] = {
+ { FF_PROFILE_HEVC_MAIN, "Main" },
+ { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
+ { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
+ { FF_PROFILE_HEVC_REXT, "Rext" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_jpeg2000_profiles[] = {
+ { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
+ { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
+ { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
+ { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
+ { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_mpeg2_video_profiles[] = {
+ { FF_PROFILE_MPEG2_422, "4:2:2" },
+ { FF_PROFILE_MPEG2_HIGH, "High" },
+ { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
+ { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
+ { FF_PROFILE_MPEG2_MAIN, "Main" },
+ { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
+ { FF_PROFILE_RESERVED, "Reserved" },
+ { FF_PROFILE_RESERVED, "Reserved" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_mpeg4_video_profiles[] = {
+ { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
+ { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
+ { FF_PROFILE_MPEG4_CORE, "Core Profile" },
+ { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
+ { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
+ { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
+ { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
+ { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
+ { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
+ { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
+ { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
+ { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
+ { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
+ { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
+ { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
+ { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+const AVProfile ff_vc1_profiles[] = {
+ { FF_PROFILE_VC1_SIMPLE, "Simple" },
+ { FF_PROFILE_VC1_MAIN, "Main" },
+ { FF_PROFILE_VC1_COMPLEX, "Complex" },
+ { FF_PROFILE_VC1_ADVANCED, "Advanced" },
+ { FF_PROFILE_UNKNOWN },
+};
+
+#endif /* !CONFIG_SMALL */
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
new file mode 100644
index 0000000000..0314de351b
--- /dev/null
+++ b/libavcodec/profiles.h
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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
+ */
+
+#ifndef AVCODEC_PROFILES_H
+#define AVCODEC_PROFILES_H
+
+#include "avcodec.h"
+
+extern const AVProfile ff_aac_profiles[];
+extern const AVProfile ff_dca_profiles[];
+extern const AVProfile ff_h264_profiles[];
+extern const AVProfile ff_hevc_profiles[];
+extern const AVProfile ff_jpeg2000_profiles[];
+extern const AVProfile ff_mpeg2_video_profiles[];
+extern const AVProfile ff_mpeg4_video_profiles[];
+extern const AVProfile ff_vc1_profiles[];
+
+#endif
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 33295ed270..ddd939c60a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2862,6 +2862,21 @@ const char *av_get_profile_name(const AVCodec *codec, int profile)
return NULL;
}
+const char *avcodec_profile_name(enum AVCodecID codec_id, int profile)
+{
+ const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
+ const AVProfile *p;
+
+ if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles)
+ return NULL;
+
+ for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
+ if (p->profile == profile)
+ return p->name;
+
+ return NULL;
+}
+
unsigned avcodec_version(void)
{
// av_assert0(AV_CODEC_ID_V410==164);
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index acd29bcd2b..c9ee199c71 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -34,6 +34,7 @@
#include "mpegvideo.h"
#include "msmpeg4.h"
#include "msmpeg4data.h"
+#include "profiles.h"
#include "vc1.h"
#include "vc1data.h"
#include "vdpau_compat.h"
@@ -1103,14 +1104,6 @@ err:
}
-static const AVProfile profiles[] = {
- { FF_PROFILE_VC1_SIMPLE, "Simple" },
- { FF_PROFILE_VC1_MAIN, "Main" },
- { FF_PROFILE_VC1_COMPLEX, "Complex" },
- { FF_PROFILE_VC1_ADVANCED, "Advanced" },
- { FF_PROFILE_UNKNOWN },
-};
-
static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = {
#if CONFIG_VC1_DXVA2_HWACCEL
AV_PIX_FMT_DXVA2_VLD,
@@ -1140,7 +1133,7 @@ AVCodec ff_vc1_decoder = {
.flush = ff_mpeg_flush,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.pix_fmts = vc1_hwaccel_pixfmt_list_420,
- .profiles = NULL_IF_CONFIG_SMALL(profiles)
+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles)
};
#if CONFIG_WMV3_DECODER
@@ -1156,7 +1149,7 @@ AVCodec ff_wmv3_decoder = {
.flush = ff_mpeg_flush,
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
.pix_fmts = vc1_hwaccel_pixfmt_list_420,
- .profiles = NULL_IF_CONFIG_SMALL(profiles)
+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles)
};
#endif
diff --git a/libavcodec/version.h b/libavcodec/version.h
index b17b79468f..9846275e09 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
-#define LIBAVCODEC_VERSION_MINOR 20
+#define LIBAVCODEC_VERSION_MINOR 21
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \