History

Merge commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6'

* commit '2c6811397bdf13d43ca206e48d6d6da9c2cd47c6': lavc: add profiles to AVCodecDescriptor

Hendrik Leppkes committed 10 years ago

Commit 5e8b0532 parents 5f2d12b 2c6811319 files · +228 −118Browse files

Unified · Split

19 files
  1. doc/APIchanges +3 −0
  2. libavcodec/Makefile +1 −0
  3. libavcodec/aacdec.c +3 −2
  4. libavcodec/aacdec_fixed.c +2 −0
  5. libavcodec/aacdec_template.c +0 −12
  6. libavcodec/avcodec.h +18 −1
  7. libavcodec/codec_desc.c +10 −0
  8. libavcodec/dcadec.c +2 −10
  9. libavcodec/h264.c +2 −18
  10. libavcodec/hevc.c +2 −9
  11. libavcodec/jpeg2000dec.c +2 −10
  12. libavcodec/libdcadec.c +2 −11
  13. libavcodec/mpeg12dec.c +2 −13
  14. libavcodec/mpeg4videodec.c +2 −21
  15. libavcodec/profiles.c +124 −0
  16. libavcodec/profiles.h +34 −0
  17. libavcodec/utils.c +15 −0
  18. libavcodec/vc1dec.c +3 −10
  19. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2015-08-28 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2016-01-01 - xxxxxxx - lavc 57.21.100 / 57.12.0 - avcodec.h
19+ Add AVCodecDescriptor.profiles and avcodec_profile_name().
20+
1821 2015-12-28 - xxxxxxx - lavf 57.21.100 - avformat.h
1922 Add automatic bitstream filtering; add av_apply_bitstream_filters()
2023
libavcodec/Makefile+1−0
@@ -33,6 +33,7 @@ OBJS = allcodecs.o \ · 32 unmodified lines
3333 mathtables.o \
3434 options.o \
3535 parser.o \
36+ profiles.o \
3637 qsv_api.o \
3738 raw.o \
3839 resample.o \
libavcodec/aacdec.c+3−2
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 #include "aacsbr.h"
5656 #include "mpeg4audio.h"
5757 #include "aacadtsdec.h"
58+#include "profiles.h"
5859 #include "libavutil/intfloat.h"
5960
6061 #include <errno.h>
@@ -555,7 +556,7 @@ AVCodec ff_aac_decoder = { · 494 unmodified lines
555556 .channel_layouts = aac_channel_layout,
556557 .flush = flush,
557558 .priv_class = &aac_decoder_class,
558− .profiles = profiles,
559+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
559560 };
560561
561562 /*
@@ -579,5 +580,5 @@ AVCodec ff_aac_latm_decoder = { · 17 unmodified lines
579580 .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
580581 .channel_layouts = aac_channel_layout,
581582 .flush = flush,
582− .profiles = profiles,
583+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
583584 };
libavcodec/aacdec_fixed.c+2−0
@@ -80,6 +80,7 @@ · 79 unmodified lines
8080 #include "aacsbr.h"
8181 #include "mpeg4audio.h"
8282 #include "aacadtsdec.h"
83+#include "profiles.h"
8384 #include "libavutil/intfloat.h"
8485
8586 #include <math.h>
@@ -440,5 +441,6 @@ AVCodec ff_aac_fixed_decoder = { · 354 unmodified lines
440441 .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
441442 .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
442443 .channel_layouts = aac_channel_layout,
444+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
443445 .flush = flush,
444446 };
libavcodec/aacdec_template.c+0−12
@@ -3232,15 +3232,3 @@ static const AVClass aac_decoder_class = { · 3231 unmodified lines
32323232 .option = options,
32333233 .version = LIBAVUTIL_VERSION_INT,
32343234 };
3235−
3236−static const AVProfile profiles[] = {
3237− { FF_PROFILE_AAC_MAIN, "Main" },
3238− { FF_PROFILE_AAC_LOW, "LC" },
3239− { FF_PROFILE_AAC_SSR, "SSR" },
3240− { FF_PROFILE_AAC_LTP, "LTP" },
3241− { FF_PROFILE_AAC_HE, "HE-AAC" },
3242− { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
3243− { FF_PROFILE_AAC_LD, "LD" },
3244− { FF_PROFILE_AAC_ELD, "ELD" },
3245− { FF_PROFILE_UNKNOWN },
3246−};
libavcodec/avcodec.h+18−1
@@ -574,13 +574,17 @@ typedef struct AVCodecDescriptor { · 573 unmodified lines
574574 * Codec properties, a combination of AV_CODEC_PROP_* flags.
575575 */
576576 int props;
577−
578577 /**
579578 * MIME type(s) associated with the codec.
580579 * May be NULL; if not, a NULL-terminated array of MIME types.
581580 * The first item is always non-NULL and is the preferred MIME type.
582581 */
583582 const char *const *mime_types;
583+ /**
584+ * If non-NULL, an array of profiles recognized for this codec.
585+ * Terminated with FF_PROFILE_UNKNOWN.
586+ */
587+ const struct AVProfile *profiles;
584588 } AVCodecDescriptor;
585589
586590 /**
@@ -5055,6 +5059,19 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); · 4468 unmodified lines
50555059 */
50565060 const char *av_get_profile_name(const AVCodec *codec, int profile);
50575061
5062+/**
5063+ * Return a name for the specified profile, if available.
5064+ *
5065+ * @param codec_id the ID of the codec to which the requested profile belongs
5066+ * @param profile the profile value for which a name is requested
5067+ * @return A name for the profile if found, NULL otherwise.
5068+ *
5069+ * @note unlike av_get_profile_name(), which searches a list of profiles
5070+ * supported by a specific decoder or encoder implementation, this
5071+ * function searches the list of profiles from the AVCodecDescriptor
5072+ */
5073+const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
5074+
50585075 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
50595076 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
50605077 //FIXME func typedef
libavcodec/codec_desc.c+10−0
@@ -24,6 +24,7 @@ · 23 unmodified lines
2424 #include "libavutil/common.h"
2525 #include "libavutil/internal.h"
2626 #include "avcodec.h"
27+#include "profiles.h"
2728 #include "version.h"
2829
2930 #define MT(...) (const char *const[]){ __VA_ARGS__, NULL }
@@ -43,6 +44,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 13 unmodified lines
4344 .name = "mpeg2video",
4445 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
4546 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
47+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
4648 },
4749 #if FF_API_XVMC
4850 {
@@ -102,6 +104,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 53 unmodified lines
102104 .name = "mpeg4",
103105 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
104106 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
107+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
105108 },
106109 {
107110 .id = AV_CODEC_ID_RAWVIDEO,
@@ -207,6 +210,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 99 unmodified lines
207210 .name = "h264",
208211 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
209212 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_REORDER,
213+ .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
210214 },
211215 {
212216 .id = AV_CODEC_ID_INDEO3,
@@ -473,6 +477,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 260 unmodified lines
473477 .name = "vc1",
474478 .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
475479 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
480+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
476481 },
477482 {
478483 .id = AV_CODEC_ID_WMV3,
@@ -480,6 +485,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 1 unmodified line
480485 .name = "wmv3",
481486 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"),
482487 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
488+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
483489 },
484490 {
485491 .id = AV_CODEC_ID_LOCO,
@@ -602,6 +608,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 116 unmodified lines
602608 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
603609 AV_CODEC_PROP_LOSSLESS,
604610 .mime_types= MT("image/jp2"),
611+ .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles),
605612 },
606613 {
607614 .id = AV_CODEC_ID_VMNC,
@@ -1202,6 +1209,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 594 unmodified lines
12021209 .name = "hevc",
12031210 .long_name = NULL_IF_CONFIG_SMALL("H.265 / HEVC (High Efficiency Video Coding)"),
12041211 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
1212+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
12051213 },
12061214 {
12071215 .id = AV_CODEC_ID_FIC,
@@ -2097,6 +2105,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 889 unmodified lines
20972105 .name = "aac",
20982106 .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
20992107 .props = AV_CODEC_PROP_LOSSY,
2108+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
21002109 },
21012110 {
21022111 .id = AV_CODEC_ID_AC3,
@@ -2111,6 +2120,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 8 unmodified lines
21112120 .name = "dts",
21122121 .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
21132122 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
2123+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
21142124 },
21152125 {
21162126 .id = AV_CODEC_ID_VORBIS,
libavcodec/dcadec.c+2−10
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 #include "get_bits.h"
5050 #include "internal.h"
5151 #include "mathops.h"
52+#include "profiles.h"
5253 #include "synth_filter.h"
5354
5455 #if ARCH_ARM
@@ -2030,15 +2031,6 @@ static av_cold int dca_decode_end(AVCodecContext *avctx) · 1975 unmodified lines
20302031 return 0;
20312032 }
20322033
2033−static const AVProfile profiles[] = {
2034− { FF_PROFILE_DTS, "DTS" },
2035− { FF_PROFILE_DTS_ES, "DTS-ES" },
2036− { FF_PROFILE_DTS_96_24, "DTS 96/24" },
2037− { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
2038− { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
2039− { FF_PROFILE_UNKNOWN },
2040−};
2041−
20422034 static const AVOption options[] = {
20432035 { "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 },
20442036 { "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 = { · 20 unmodified lines
20652057 .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
20662058 .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
20672059 AV_SAMPLE_FMT_NONE },
2068− .profiles = NULL_IF_CONFIG_SMALL(profiles),
2060+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
20692061 .priv_class = &dca_decoder_class,
20702062 };
libavcodec/h264.c+2−18
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 #include "mathops.h"
4747 #include "me_cmp.h"
4848 #include "mpegutils.h"
49+#include "profiles.h"
4950 #include "rectangle.h"
5051 #include "svq3.h"
5152 #include "thread.h"
@@ -1962,23 +1963,6 @@ static const AVClass h264_class = { · 1910 unmodified lines
19621963 .version = LIBAVUTIL_VERSION_INT,
19631964 };
19641965
1965−static const AVProfile profiles[] = {
1966− { FF_PROFILE_H264_BASELINE, "Baseline" },
1967− { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
1968− { FF_PROFILE_H264_MAIN, "Main" },
1969− { FF_PROFILE_H264_EXTENDED, "Extended" },
1970− { FF_PROFILE_H264_HIGH, "High" },
1971− { FF_PROFILE_H264_HIGH_10, "High 10" },
1972− { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
1973− { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
1974− { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
1975− { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
1976− { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
1977− { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
1978− { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
1979− { FF_PROFILE_UNKNOWN },
1980−};
1981−
19821966 AVCodec ff_h264_decoder = {
19831967 .name = "h264",
19841968 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
@@ -1995,7 +1979,7 @@ AVCodec ff_h264_decoder = { · 10 unmodified lines
19951979 .flush = flush_dpb,
19961980 .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
19971981 .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
1998− .profiles = NULL_IF_CONFIG_SMALL(profiles),
1982+ .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
19991983 .priv_class = &h264_class,
20001984 };
20011985
libavcodec/hevc.c+2−9
@@ -38,6 +38,7 @@ · 37 unmodified lines
3838 #include "cabac_functions.h"
3939 #include "golomb.h"
4040 #include "hevc.h"
41+#include "profiles.h"
4142
4243 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 };
4344
@@ -3314,14 +3315,6 @@ static void hevc_decode_flush(AVCodecContext *avctx) · 3270 unmodified lines
33143315 #define OFFSET(x) offsetof(HEVCContext, x)
33153316 #define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
33163317
3317−static const AVProfile profiles[] = {
3318− { FF_PROFILE_HEVC_MAIN, "Main" },
3319− { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
3320− { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
3321− { FF_PROFILE_HEVC_REXT, "Rext" },
3322− { FF_PROFILE_UNKNOWN },
3323−};
3324−
33253318 static const AVOption options[] = {
33263319 { "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin),
33273320 AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, PAR },
@@ -3352,5 +3345,5 @@ AVCodec ff_hevc_decoder = { · 24 unmodified lines
33523345 .init_thread_copy = hevc_init_thread_copy,
33533346 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
33543347 AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS,
3355− .profiles = NULL_IF_CONFIG_SMALL(profiles),
3348+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
33563349 };
libavcodec/jpeg2000dec.c+2−10
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include "thread.h"
4040 #include "jpeg2000.h"
4141 #include "jpeg2000dsp.h"
42+#include "profiles.h"
4243
4344 #define JP2_SIG_TYPE 0x6A502020
4445 #define JP2_SIG_VALUE 0x0D0A870A
@@ -2142,15 +2143,6 @@ static const AVOption options[] = { · 2097 unmodified lines
21422143 { NULL },
21432144 };
21442145
2145−static const AVProfile profiles[] = {
2146− { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
2147− { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
2148− { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
2149− { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
2150− { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
2151− { FF_PROFILE_UNKNOWN },
2152−};
2153−
21542146 static const AVClass jpeg2000_class = {
21552147 .class_name = "jpeg2000",
21562148 .item_name = av_default_item_name,
@@ -2170,5 +2162,5 @@ AVCodec ff_jpeg2000_decoder = { · 13 unmodified lines
21702162 .decode = jpeg2000_decode_frame,
21712163 .priv_class = &jpeg2000_class,
21722164 .max_lowres = 5,
2173− .profiles = NULL_IF_CONFIG_SMALL(profiles)
2165+ .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles)
21742166 };
libavcodec/libdcadec.c+2−11
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include "dca.h"
3030 #include "dca_syncwords.h"
3131 #include "internal.h"
32+#include "profiles.h"
3233
3334 typedef struct DCADecContext {
3435 const AVClass *class;
@@ -292,16 +293,6 @@ static const AVClass dcadec_class = { · 257 unmodified lines
292293 .category = AV_CLASS_CATEGORY_DECODER,
293294 };
294295
295−static const AVProfile profiles[] = {
296− { FF_PROFILE_DTS, "DTS" },
297− { FF_PROFILE_DTS_ES, "DTS-ES" },
298− { FF_PROFILE_DTS_96_24, "DTS 96/24" },
299− { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
300− { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
301− { FF_PROFILE_DTS_EXPRESS, "DTS Express" },
302− { FF_PROFILE_UNKNOWN },
303−};
304−
305296 AVCodec ff_libdcadec_decoder = {
306297 .name = "libdcadec",
307298 .long_name = NULL_IF_CONFIG_SMALL("dcadec DCA decoder"),
@@ -316,5 +307,5 @@ AVCodec ff_libdcadec_decoder = { · 8 unmodified lines
316307 .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P,
317308 AV_SAMPLE_FMT_NONE },
318309 .priv_class = &dcadec_class,
319− .profiles = NULL_IF_CONFIG_SMALL(profiles),
310+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
320311 };
libavcodec/mpeg12dec.c+2−13
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #include "mpegutils.h"
4545 #include "mpegvideo.h"
4646 #include "mpegvideodata.h"
47+#include "profiles.h"
4748 #include "thread.h"
4849 #include "version.h"
4950 #include "vdpau_compat.h"
@@ -2855,18 +2856,6 @@ static av_cold int mpeg_decode_end(AVCodecContext *avctx) · 2805 unmodified lines
28552856 return 0;
28562857 }
28572858
2858−static const AVProfile mpeg2_video_profiles[] = {
2859− { FF_PROFILE_MPEG2_422, "4:2:2" },
2860− { FF_PROFILE_MPEG2_HIGH, "High" },
2861− { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
2862− { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
2863− { FF_PROFILE_MPEG2_MAIN, "Main" },
2864− { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
2865− { FF_PROFILE_RESERVED, "Reserved" },
2866− { FF_PROFILE_RESERVED, "Reserved" },
2867− { FF_PROFILE_UNKNOWN },
2868−};
2869−
28702859 AVCodec ff_mpeg1video_decoder = {
28712860 .name = "mpeg1video",
28722861 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
@@ -2898,7 +2887,7 @@ AVCodec ff_mpeg2video_decoder = { · 25 unmodified lines
28982887 AV_CODEC_CAP_SLICE_THREADS,
28992888 .flush = flush,
29002889 .max_lowres = 3,
2901− .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
2890+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
29022891 };
29032892
29042893 //legacy decoder
libavcodec/mpeg4videodec.c+2−21
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "mpegvideodata.h"
3333 #include "mpeg4video.h"
3434 #include "h263.h"
35+#include "profiles.h"
3536 #include "thread.h"
3637 #include "xvididct.h"
3738
@@ -2745,26 +2746,6 @@ static av_cold int decode_init(AVCodecContext *avctx) · 2707 unmodified lines
27452746 return 0;
27462747 }
27472748
2748−static const AVProfile mpeg4_video_profiles[] = {
2749− { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
2750− { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
2751− { FF_PROFILE_MPEG4_CORE, "Core Profile" },
2752− { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
2753− { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
2754− { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
2755− { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
2756− { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
2757− { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
2758− { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
2759− { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
2760− { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
2761− { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
2762− { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
2763− { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
2764− { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
2765− { FF_PROFILE_UNKNOWN },
2766−};
2767−
27682749 static const AVOption mpeg4_options[] = {
27692750 {"quarter_sample", "1/4 subpel MC", offsetof(MpegEncContext, quarter_sample), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0},
27702751 {"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 = { · 22 unmodified lines
27932774 .flush = ff_mpeg_flush,
27942775 .max_lowres = 3,
27952776 .pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
2796− .profiles = NULL_IF_CONFIG_SMALL(mpeg4_video_profiles),
2777+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
27972778 .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context),
27982779 .priv_class = &mpeg4_class,
27992780 };
libavcodec/profiles.c+124−0
@@ -0,0 +1,124 @@
1+/*
2+ *
3+ * This file is part of FFmpeg.
4+ *
5+ * FFmpeg is free software; you can redistribute it and/or
6+ * modify it under the terms of the GNU Lesser General Public
7+ * License as published by the Free Software Foundation; either
8+ * version 2.1 of the License, or (at your option) any later version.
9+ *
10+ * FFmpeg is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+ * Lesser General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU Lesser General Public
16+ * License along with FFmpeg; if not, write to the Free Software
17+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+ */
19+
20+#include "config.h"
21+
22+#include "avcodec.h"
23+#include "profiles.h"
24+
25+#if !CONFIG_SMALL
26+
27+const AVProfile ff_aac_profiles[] = {
28+ { FF_PROFILE_AAC_LOW, "LC" },
29+ { FF_PROFILE_AAC_HE, "HE-AAC" },
30+ { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
31+ { FF_PROFILE_AAC_LD, "LD" },
32+ { FF_PROFILE_AAC_ELD, "ELD" },
33+ { FF_PROFILE_AAC_MAIN, "Main" },
34+ { FF_PROFILE_AAC_LOW, "LC" },
35+ { FF_PROFILE_AAC_SSR, "SSR" },
36+ { FF_PROFILE_AAC_LTP, "LTP" },
37+ { FF_PROFILE_UNKNOWN },
38+};
39+
40+const AVProfile ff_dca_profiles[] = {
41+ { FF_PROFILE_DTS, "DTS" },
42+ { FF_PROFILE_DTS_ES, "DTS-ES" },
43+ { FF_PROFILE_DTS_96_24, "DTS 96/24" },
44+ { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
45+ { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
46+ { FF_PROFILE_DTS_EXPRESS, "DTS Express" },
47+ { FF_PROFILE_UNKNOWN },
48+};
49+
50+const AVProfile ff_h264_profiles[] = {
51+ { FF_PROFILE_H264_BASELINE, "Baseline" },
52+ { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
53+ { FF_PROFILE_H264_MAIN, "Main" },
54+ { FF_PROFILE_H264_EXTENDED, "Extended" },
55+ { FF_PROFILE_H264_HIGH, "High" },
56+ { FF_PROFILE_H264_HIGH_10, "High 10" },
57+ { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
58+ { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
59+ { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
60+ { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
61+ { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
62+ { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
63+ { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
64+ { FF_PROFILE_UNKNOWN },
65+};
66+
67+const AVProfile ff_hevc_profiles[] = {
68+ { FF_PROFILE_HEVC_MAIN, "Main" },
69+ { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
70+ { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
71+ { FF_PROFILE_HEVC_REXT, "Rext" },
72+ { FF_PROFILE_UNKNOWN },
73+};
74+
75+const AVProfile ff_jpeg2000_profiles[] = {
76+ { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
77+ { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
78+ { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
79+ { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
80+ { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
81+ { FF_PROFILE_UNKNOWN },
82+};
83+
84+const AVProfile ff_mpeg2_video_profiles[] = {
85+ { FF_PROFILE_MPEG2_422, "4:2:2" },
86+ { FF_PROFILE_MPEG2_HIGH, "High" },
87+ { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
88+ { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
89+ { FF_PROFILE_MPEG2_MAIN, "Main" },
90+ { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
91+ { FF_PROFILE_RESERVED, "Reserved" },
92+ { FF_PROFILE_RESERVED, "Reserved" },
93+ { FF_PROFILE_UNKNOWN },
94+};
95+
96+const AVProfile ff_mpeg4_video_profiles[] = {
97+ { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
98+ { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
99+ { FF_PROFILE_MPEG4_CORE, "Core Profile" },
100+ { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
101+ { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
102+ { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
103+ { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
104+ { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
105+ { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
106+ { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
107+ { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
108+ { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
109+ { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
110+ { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
111+ { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
112+ { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
113+ { FF_PROFILE_UNKNOWN },
114+};
115+
116+const AVProfile ff_vc1_profiles[] = {
117+ { FF_PROFILE_VC1_SIMPLE, "Simple" },
118+ { FF_PROFILE_VC1_MAIN, "Main" },
119+ { FF_PROFILE_VC1_COMPLEX, "Complex" },
120+ { FF_PROFILE_VC1_ADVANCED, "Advanced" },
121+ { FF_PROFILE_UNKNOWN },
122+};
123+
124+#endif /* !CONFIG_SMALL */
libavcodec/profiles.h+34−0
@@ -0,0 +1,34 @@
1+/*
2+ *
3+ * This file is part of FFmpeg.
4+ *
5+ * FFmpeg is free software; you can redistribute it and/or
6+ * modify it under the terms of the GNU Lesser General Public
7+ * License as published by the Free Software Foundation; either
8+ * version 2.1 of the License, or (at your option) any later version.
9+ *
10+ * FFmpeg is distributed in the hope that it will be useful,
11+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+ * Lesser General Public License for more details.
14+ *
15+ * You should have received a copy of the GNU Lesser General Public
16+ * License along with FFmpeg; if not, write to the Free Software
17+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18+ */
19+
20+#ifndef AVCODEC_PROFILES_H
21+#define AVCODEC_PROFILES_H
22+
23+#include "avcodec.h"
24+
25+extern const AVProfile ff_aac_profiles[];
26+extern const AVProfile ff_dca_profiles[];
27+extern const AVProfile ff_h264_profiles[];
28+extern const AVProfile ff_hevc_profiles[];
29+extern const AVProfile ff_jpeg2000_profiles[];
30+extern const AVProfile ff_mpeg2_video_profiles[];
31+extern const AVProfile ff_mpeg4_video_profiles[];
32+extern const AVProfile ff_vc1_profiles[];
33+
34+#endif
libavcodec/utils.c+15−0
@@ -2862,6 +2862,21 @@ const char *av_get_profile_name(const AVCodec *codec, int profile) · 2861 unmodified lines
28622862 return NULL;
28632863 }
28642864
2865+const char *avcodec_profile_name(enum AVCodecID codec_id, int profile)
2866+{
2867+ const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
2868+ const AVProfile *p;
2869+
2870+ if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles)
2871+ return NULL;
2872+
2873+ for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
2874+ if (p->profile == profile)
2875+ return p->name;
2876+
2877+ return NULL;
2878+}
2879+
28652880 unsigned avcodec_version(void)
28662881 {
28672882 // av_assert0(AV_CODEC_ID_V410==164);
libavcodec/vc1dec.c+3−10
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include "mpegvideo.h"
3535 #include "msmpeg4.h"
3636 #include "msmpeg4data.h"
37+#include "profiles.h"
3738 #include "vc1.h"
3839 #include "vc1data.h"
3940 #include "vdpau_compat.h"
@@ -1103,14 +1104,6 @@ err: · 1063 unmodified lines
11031104 }
11041105
11051106
1106−static const AVProfile profiles[] = {
1107− { FF_PROFILE_VC1_SIMPLE, "Simple" },
1108− { FF_PROFILE_VC1_MAIN, "Main" },
1109− { FF_PROFILE_VC1_COMPLEX, "Complex" },
1110− { FF_PROFILE_VC1_ADVANCED, "Advanced" },
1111− { FF_PROFILE_UNKNOWN },
1112−};
1113−
11141107 static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = {
11151108 #if CONFIG_VC1_DXVA2_HWACCEL
11161109 AV_PIX_FMT_DXVA2_VLD,
@@ -1140,7 +1133,7 @@ AVCodec ff_vc1_decoder = { · 23 unmodified lines
11401133 .flush = ff_mpeg_flush,
11411134 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
11421135 .pix_fmts = vc1_hwaccel_pixfmt_list_420,
1143− .profiles = NULL_IF_CONFIG_SMALL(profiles)
1136+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles)
11441137 };
11451138
11461139 #if CONFIG_WMV3_DECODER
@@ -1156,7 +1149,7 @@ AVCodec ff_wmv3_decoder = { · 9 unmodified lines
11561149 .flush = ff_mpeg_flush,
11571150 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
11581151 .pix_fmts = vc1_hwaccel_pixfmt_list_420,
1159− .profiles = NULL_IF_CONFIG_SMALL(profiles)
1152+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles)
11601153 };
11611154 #endif
11621155
libavcodec/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/version.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 57
32−#define LIBAVCODEC_VERSION_MINOR 20
32+#define LIBAVCODEC_VERSION_MINOR 21
3333 #define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t