History

lavc: add profiles to AVCodecDescriptor

The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.

Anton Khirnov committed 11 years ago

Commit 2c681131 parent cdc9ce015 files · +219 −90Browse files

Unified · Split

15 files
  1. doc/APIchanges +3 −0
  2. libavcodec/Makefile +1 −0
  3. libavcodec/avcodec.h +18 −0
  4. libavcodec/codec_desc.c +10 −0
  5. libavcodec/dcadec.c +2 −10
  6. libavcodec/h264.c +2 −18
  7. libavcodec/hevc.c +2 −8
  8. libavcodec/jpeg2000dec.c +2 −10
  9. libavcodec/mpeg12dec.c +2 −13
  10. libavcodec/mpeg4videodec.c +2 −20
  11. libavcodec/profiles.c +122 −0
  12. libavcodec/profiles.h +34 −0
  13. libavcodec/utils.c +15 −0
  14. libavcodec/vc1dec.c +3 −10
  15. libavcodec/version.h +1 −1
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2015-08-28 · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2015-xx-xx - xxxxxxx - lavc 57.12.0 - avcodec.h
17+ Add AVCodecDescriptor.profiles and avcodec_profile_name().
18+
1619 2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h dirac.h
1720 xxxxxxx - Add av_packet_add_side_data().
1821 xxxxxxx - Add AVCodecContext.coded_side_data.
libavcodec/Makefile+1−0
@@ -28,6 +28,7 @@ OBJS = allcodecs.o \ · 27 unmodified lines
2828 mathtables.o \
2929 options.o \
3030 parser.o \
31+ profiles.o \
3132 qsv_api.o \
3233 raw.o \
3334 utils.o \
libavcodec/avcodec.h+18−0
@@ -503,6 +503,11 @@ typedef struct AVCodecDescriptor { · 502 unmodified lines
503503 * Codec properties, a combination of AV_CODEC_PROP_* flags.
504504 */
505505 int props;
506+ /**
507+ * If non-NULL, an array of profiles recognized for this codec.
508+ * Terminated with FF_PROFILE_UNKNOWN.
509+ */
510+ const struct AVProfile *profiles;
506511 } AVCodecDescriptor;
507512
508513 /**
@@ -4454,6 +4459,19 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); · 3945 unmodified lines
44544459 */
44554460 const char *av_get_profile_name(const AVCodec *codec, int profile);
44564461
4462+/**
4463+ * Return a name for the specified profile, if available.
4464+ *
4465+ * @param codec_id the ID of the codec to which the requested profile belongs
4466+ * @param profile the profile value for which a name is requested
4467+ * @return A name for the profile if found, NULL otherwise.
4468+ *
4469+ * @note unlike av_get_profile_name(), which searches a list of profiles
4470+ * supported by a specific decoder or encoder implementation, this
4471+ * function searches the list of profiles from the AVCodecDescriptor
4472+ */
4473+const char *avcodec_profile_name(enum AVCodecID codec_id, int profile);
4474+
44574475 int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
44584476 int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
44594477 //FIXME func typedef
libavcodec/codec_desc.c+10−0
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include "libavutil/common.h"
2222 #include "libavutil/internal.h"
2323 #include "avcodec.h"
24+#include "profiles.h"
2425 #include "version.h"
2526
2627 static const AVCodecDescriptor codec_descriptors[] = {
@@ -38,6 +39,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 11 unmodified lines
3839 .name = "mpeg2video",
3940 .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"),
4041 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
42+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
4143 },
4244 #if FF_API_XVMC
4345 {
@@ -96,6 +98,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 52 unmodified lines
9698 .name = "mpeg4",
9799 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
98100 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
101+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
99102 },
100103 {
101104 .id = AV_CODEC_ID_RAWVIDEO,
@@ -201,6 +204,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 99 unmodified lines
201204 .name = "h264",
202205 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
203206 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_REORDER,
207+ .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
204208 },
205209 {
206210 .id = AV_CODEC_ID_INDEO3,
@@ -460,6 +464,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 253 unmodified lines
460464 .name = "vc1",
461465 .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"),
462466 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
467+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
463468 },
464469 {
465470 .id = AV_CODEC_ID_WMV3,
@@ -467,6 +472,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 1 unmodified line
467472 .name = "wmv3",
468473 .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"),
469474 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
475+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles),
470476 },
471477 {
472478 .id = AV_CODEC_ID_LOCO,
@@ -587,6 +593,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 114 unmodified lines
587593 .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"),
588594 .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
589595 AV_CODEC_PROP_LOSSLESS,
596+ .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles),
590597 },
591598 {
592599 .id = AV_CODEC_ID_VMNC,
@@ -1098,6 +1105,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 505 unmodified lines
10981105 .name = "hevc",
10991106 .long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"),
11001107 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER,
1108+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
11011109 },
11021110 {
11031111 .id = AV_CODEC_ID_FIC,
@@ -1912,6 +1920,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 808 unmodified lines
19121920 .name = "aac",
19131921 .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
19141922 .props = AV_CODEC_PROP_LOSSY,
1923+ .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
19151924 },
19161925 {
19171926 .id = AV_CODEC_ID_AC3,
@@ -1926,6 +1935,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 8 unmodified lines
19261935 .name = "dts",
19271936 .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"),
19281937 .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS,
1938+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
19291939 },
19301940 {
19311941 .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 "put_bits.h"
5354 #include "synth_filter.h"
5455
@@ -1566,15 +1567,6 @@ static av_cold int dca_decode_end(AVCodecContext *avctx) · 1511 unmodified lines
15661567 return 0;
15671568 }
15681569
1569−static const AVProfile profiles[] = {
1570− { FF_PROFILE_DTS, "DTS" },
1571− { FF_PROFILE_DTS_ES, "DTS-ES" },
1572− { FF_PROFILE_DTS_96_24, "DTS 96/24" },
1573− { FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
1574− { FF_PROFILE_DTS_HD_MA, "DTS-HD MA" },
1575− { FF_PROFILE_UNKNOWN },
1576−};
1577−
15781570 static const AVOption options[] = {
15791571 { "disable_xch", "disable decoding of the XCh extension", offsetof(DCAContext, xch_disable), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM },
15801572 { "disable_xll", "disable decoding of the XLL extension", offsetof(DCAContext, xll_disable), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_AUDIO_PARAM },
@@ -1600,6 +1592,6 @@ AVCodec ff_dca_decoder = { · 19 unmodified lines
16001592 .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1,
16011593 .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP,
16021594 AV_SAMPLE_FMT_NONE },
1603− .profiles = NULL_IF_CONFIG_SMALL(profiles),
1595+ .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles),
16041596 .priv_class = &dca_decoder_class,
16051597 };
libavcodec/h264.c+2−18
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #include "mathops.h"
4545 #include "me_cmp.h"
4646 #include "mpegutils.h"
47+#include "profiles.h"
4748 #include "rectangle.h"
4849 #include "svq3.h"
4950 #include "thread.h"
@@ -1771,23 +1772,6 @@ static const AVClass h264_class = { · 1721 unmodified lines
17711772 .version = LIBAVUTIL_VERSION_INT,
17721773 };
17731774
1774−static const AVProfile profiles[] = {
1775− { FF_PROFILE_H264_BASELINE, "Baseline" },
1776− { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
1777− { FF_PROFILE_H264_MAIN, "Main" },
1778− { FF_PROFILE_H264_EXTENDED, "Extended" },
1779− { FF_PROFILE_H264_HIGH, "High" },
1780− { FF_PROFILE_H264_HIGH_10, "High 10" },
1781− { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
1782− { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
1783− { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
1784− { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
1785− { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
1786− { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
1787− { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
1788− { FF_PROFILE_UNKNOWN },
1789−};
1790−
17911775 AVCodec ff_h264_decoder = {
17921776 .name = "h264",
17931777 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
@@ -1804,6 +1788,6 @@ AVCodec ff_h264_decoder = { · 10 unmodified lines
18041788 .flush = flush_dpb,
18051789 .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
18061790 .update_thread_context = ONLY_IF_THREADS_ENABLED(ff_h264_update_thread_context),
1807− .profiles = NULL_IF_CONFIG_SMALL(profiles),
1791+ .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles),
18081792 .priv_class = &h264_class,
18091793 };
libavcodec/hevc.c+2−8
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include "cabac_functions.h"
3838 #include "golomb.h"
3939 #include "hevc.h"
40+#include "profiles.h"
4041
4142 const uint8_t ff_hevc_qpel_extra_before[4] = { 0, 3, 3, 3 };
4243 const uint8_t ff_hevc_qpel_extra_after[4] = { 0, 4, 4, 4 };
@@ -3027,13 +3028,6 @@ static void hevc_decode_flush(AVCodecContext *avctx) · 2984 unmodified lines
30273028 #define OFFSET(x) offsetof(HEVCContext, x)
30283029 #define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
30293030
3030−static const AVProfile profiles[] = {
3031− { FF_PROFILE_HEVC_MAIN, "Main" },
3032− { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
3033− { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
3034− { FF_PROFILE_UNKNOWN },
3035−};
3036−
30373031 static const AVOption options[] = {
30383032 { "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin),
30393033 AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, PAR },
@@ -3062,5 +3056,5 @@ AVCodec ff_hevc_decoder = { · 22 unmodified lines
30623056 .init_thread_copy = hevc_init_thread_copy,
30633057 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
30643058 AV_CODEC_CAP_FRAME_THREADS,
3065− .profiles = NULL_IF_CONFIG_SMALL(profiles),
3059+ .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles),
30663060 };
libavcodec/jpeg2000dec.c+2−10
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include "thread.h"
3737 #include "jpeg2000.h"
3838 #include "jpeg2000dsp.h"
39+#include "profiles.h"
3940
4041 #define JP2_SIG_TYPE 0x6A502020
4142 #define JP2_SIG_VALUE 0x0D0A870A
@@ -1457,15 +1458,6 @@ static const AVOption options[] = { · 1415 unmodified lines
14571458 { NULL },
14581459 };
14591460
1460−static const AVProfile profiles[] = {
1461− { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
1462− { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
1463− { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
1464− { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
1465− { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
1466− { FF_PROFILE_UNKNOWN },
1467−};
1468−
14691461 static const AVClass class = {
14701462 .class_name = "jpeg2000",
14711463 .item_name = av_default_item_name,
@@ -1484,5 +1476,5 @@ AVCodec ff_jpeg2000_decoder = { · 12 unmodified lines
14841476 .init = jpeg2000_decode_init,
14851477 .decode = jpeg2000_decode_frame,
14861478 .priv_class = &class,
1487− .profiles = NULL_IF_CONFIG_SMALL(profiles)
1479+ .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles)
14881480 };
libavcodec/mpeg12dec.c+2−13
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include "mpegutils.h"
4343 #include "mpegvideo.h"
4444 #include "mpegvideodata.h"
45+#include "profiles.h"
4546 #include "thread.h"
4647 #include "version.h"
4748 #include "xvmc_internal.h"
@@ -2680,18 +2681,6 @@ static av_cold int mpeg_decode_end(AVCodecContext *avctx) · 2632 unmodified lines
26802681 return 0;
26812682 }
26822683
2683−static const AVProfile mpeg2_video_profiles[] = {
2684− { FF_PROFILE_MPEG2_422, "4:2:2" },
2685− { FF_PROFILE_MPEG2_HIGH, "High" },
2686− { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
2687− { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
2688− { FF_PROFILE_MPEG2_MAIN, "Main" },
2689− { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
2690− { FF_PROFILE_RESERVED, "Reserved" },
2691− { FF_PROFILE_RESERVED, "Reserved" },
2692− { FF_PROFILE_UNKNOWN },
2693−};
2694−
26952684 AVCodec ff_mpeg1video_decoder = {
26962685 .name = "mpeg1video",
26972686 .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
@@ -2721,7 +2710,7 @@ AVCodec ff_mpeg2video_decoder = { · 23 unmodified lines
27212710 AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY |
27222711 AV_CODEC_CAP_SLICE_THREADS,
27232712 .flush = flush,
2724− .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles),
2713+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles),
27252714 };
27262715
27272716 #if FF_API_XVMC
libavcodec/mpeg4videodec.c+2−20
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include "mpegvideodata.h"
2929 #include "mpeg4video.h"
3030 #include "h263.h"
31+#include "profiles.h"
3132 #include "thread.h"
3233 #include "xvididct.h"
3334
@@ -2599,25 +2600,6 @@ static av_cold int decode_init(AVCodecContext *avctx) · 2565 unmodified lines
25992600 return 0;
26002601 }
26012602
2602−static const AVProfile mpeg4_video_profiles[] = {
2603− { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
2604− { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
2605− { FF_PROFILE_MPEG4_CORE, "Core Profile" },
2606− { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
2607− { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
2608− { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
2609− { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
2610− { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
2611− { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
2612− { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
2613− { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
2614− { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
2615− { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
2616− { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
2617− { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
2618− { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
2619−};
2620−
26212603 AVCodec ff_mpeg4_decoder = {
26222604 .name = "mpeg4",
26232605 .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"),
@@ -2632,6 +2614,6 @@ AVCodec ff_mpeg4_decoder = { · 8 unmodified lines
26322614 AV_CODEC_CAP_FRAME_THREADS,
26332615 .flush = ff_mpeg_flush,
26342616 .pix_fmts = ff_h263_hwaccel_pixfmt_list_420,
2635− .profiles = NULL_IF_CONFIG_SMALL(mpeg4_video_profiles),
2617+ .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles),
26362618 .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context),
26372619 };
libavcodec/profiles.c+122−0
@@ -0,0 +1,122 @@
1+/*
2+ *
3+ * This file is part of Libav.
4+ *
5+ * Libav 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+ * Libav 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 Libav; 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_UNKNOWN },
47+};
48+
49+const AVProfile ff_h264_profiles[] = {
50+ { FF_PROFILE_H264_BASELINE, "Baseline" },
51+ { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
52+ { FF_PROFILE_H264_MAIN, "Main" },
53+ { FF_PROFILE_H264_EXTENDED, "Extended" },
54+ { FF_PROFILE_H264_HIGH, "High" },
55+ { FF_PROFILE_H264_HIGH_10, "High 10" },
56+ { FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
57+ { FF_PROFILE_H264_HIGH_422, "High 4:2:2" },
58+ { FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
59+ { FF_PROFILE_H264_HIGH_444, "High 4:4:4" },
60+ { FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
61+ { FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
62+ { FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
63+ { FF_PROFILE_UNKNOWN },
64+};
65+
66+const AVProfile ff_hevc_profiles[] = {
67+ { FF_PROFILE_HEVC_MAIN, "Main" },
68+ { FF_PROFILE_HEVC_MAIN_10, "Main 10" },
69+ { FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
70+ { FF_PROFILE_UNKNOWN },
71+};
72+
73+const AVProfile ff_jpeg2000_profiles[] = {
74+ { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
75+ { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
76+ { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
77+ { FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
78+ { FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
79+ { FF_PROFILE_UNKNOWN },
80+};
81+
82+const AVProfile ff_mpeg2_video_profiles[] = {
83+ { FF_PROFILE_MPEG2_422, "4:2:2" },
84+ { FF_PROFILE_MPEG2_HIGH, "High" },
85+ { FF_PROFILE_MPEG2_SS, "Spatially Scalable" },
86+ { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
87+ { FF_PROFILE_MPEG2_MAIN, "Main" },
88+ { FF_PROFILE_MPEG2_SIMPLE, "Simple" },
89+ { FF_PROFILE_RESERVED, "Reserved" },
90+ { FF_PROFILE_RESERVED, "Reserved" },
91+ { FF_PROFILE_UNKNOWN },
92+};
93+
94+const AVProfile ff_mpeg4_video_profiles[] = {
95+ { FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
96+ { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
97+ { FF_PROFILE_MPEG4_CORE, "Core Profile" },
98+ { FF_PROFILE_MPEG4_MAIN, "Main Profile" },
99+ { FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
100+ { FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
101+ { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
102+ { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
103+ { FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
104+ { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
105+ { FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
106+ { FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
107+ { FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
108+ { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
109+ { FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
110+ { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
111+ { FF_PROFILE_UNKNOWN },
112+};
113+
114+const AVProfile ff_vc1_profiles[] = {
115+ { FF_PROFILE_VC1_SIMPLE, "Simple" },
116+ { FF_PROFILE_VC1_MAIN, "Main" },
117+ { FF_PROFILE_VC1_COMPLEX, "Complex" },
118+ { FF_PROFILE_VC1_ADVANCED, "Advanced" },
119+ { FF_PROFILE_UNKNOWN },
120+};
121+
122+#endif /* !CONFIG_SMALL */
libavcodec/profiles.h+34−0
@@ -0,0 +1,34 @@
1+/*
2+ *
3+ * This file is part of Libav.
4+ *
5+ * Libav 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+ * Libav 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 Libav; 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
@@ -1918,6 +1918,21 @@ const char *av_get_profile_name(const AVCodec *codec, int profile) · 1917 unmodified lines
19181918 return NULL;
19191919 }
19201920
1921+const char *avcodec_profile_name(enum AVCodecID codec_id, int profile)
1922+{
1923+ const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
1924+ const AVProfile *p;
1925+
1926+ if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles)
1927+ return NULL;
1928+
1929+ for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++)
1930+ if (p->profile == profile)
1931+ return p->name;
1932+
1933+ return NULL;
1934+}
1935+
19211936 unsigned avcodec_version(void)
19221937 {
19231938 return LIBAVCODEC_VERSION_INT;
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
@@ -943,14 +944,6 @@ err: · 903 unmodified lines
943944 }
944945
945946
946−static const AVProfile profiles[] = {
947− { FF_PROFILE_VC1_SIMPLE, "Simple" },
948− { FF_PROFILE_VC1_MAIN, "Main" },
949− { FF_PROFILE_VC1_COMPLEX, "Complex" },
950− { FF_PROFILE_VC1_ADVANCED, "Advanced" },
951− { FF_PROFILE_UNKNOWN },
952−};
953−
954947 static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = {
955948 #if CONFIG_VC1_DXVA2_HWACCEL
956949 AV_PIX_FMT_DXVA2_VLD,
@@ -980,7 +973,7 @@ AVCodec ff_vc1_decoder = { · 23 unmodified lines
980973 .flush = ff_mpeg_flush,
981974 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
982975 .pix_fmts = vc1_hwaccel_pixfmt_list_420,
983− .profiles = NULL_IF_CONFIG_SMALL(profiles)
976+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles)
984977 };
985978
986979 #if CONFIG_WMV3_DECODER
@@ -996,7 +989,7 @@ AVCodec ff_wmv3_decoder = { · 9 unmodified lines
996989 .flush = ff_mpeg_flush,
997990 .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY,
998991 .pix_fmts = vc1_hwaccel_pixfmt_list_420,
999− .profiles = NULL_IF_CONFIG_SMALL(profiles)
992+ .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles)
1000993 };
1001994 #endif
1002995
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 11
32+#define LIBAVCODEC_VERSION_MINOR 12
3333 #define LIBAVCODEC_VERSION_MICRO 0
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