The profiles are a property of the codec, so it makes sense to export them through AVCodecDescriptors, not just the codec implementations.
Unified · Split
| @@ -13,6 +13,9 @@ libavutil: 2015-08-28 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2015-xx-xx - xxxxxxx - lavc 57.12.0 - avcodec.h | |
| 17 | + Add AVCodecDescriptor.profiles and avcodec_profile_name(). | |
| 18 | + | |
| 16 | 19 | 2015-xx-xx - xxxxxxx - lavc 57.11.0 - avcodec.h dirac.h |
| 17 | 20 | xxxxxxx - Add av_packet_add_side_data(). |
| 18 | 21 | xxxxxxx - Add AVCodecContext.coded_side_data. |
| @@ -28,6 +28,7 @@ OBJS = allcodecs.o \ · 27 unmodified lines | ||
| 28 | 28 | mathtables.o \ |
| 29 | 29 | options.o \ |
| 30 | 30 | parser.o \ |
| 31 | + profiles.o \ | |
| 31 | 32 | qsv_api.o \ |
| 32 | 33 | raw.o \ |
| 33 | 34 | utils.o \ |
| @@ -503,6 +503,11 @@ typedef struct AVCodecDescriptor { · 502 unmodified lines | ||
| 503 | 503 | * Codec properties, a combination of AV_CODEC_PROP_* flags. |
| 504 | 504 | */ |
| 505 | 505 | 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; | |
| 506 | 511 | } AVCodecDescriptor; |
| 507 | 512 | |
| 508 | 513 | /** |
| @@ -4454,6 +4459,19 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); · 3945 unmodified lines | ||
| 4454 | 4459 | */ |
| 4455 | 4460 | const char *av_get_profile_name(const AVCodec *codec, int profile); |
| 4456 | 4461 | |
| 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 | + | |
| 4457 | 4475 | int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); |
| 4458 | 4476 | int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); |
| 4459 | 4477 | //FIXME func typedef |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include "libavutil/common.h" |
| 22 | 22 | #include "libavutil/internal.h" |
| 23 | 23 | #include "avcodec.h" |
| 24 | +#include "profiles.h" | |
| 24 | 25 | #include "version.h" |
| 25 | 26 | |
| 26 | 27 | static const AVCodecDescriptor codec_descriptors[] = { |
| @@ -38,6 +39,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 11 unmodified lines | ||
| 38 | 39 | .name = "mpeg2video", |
| 39 | 40 | .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), |
| 40 | 41 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, |
| 42 | + .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles), | |
| 41 | 43 | }, |
| 42 | 44 | #if FF_API_XVMC |
| 43 | 45 | { |
| @@ -96,6 +98,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 52 unmodified lines | ||
| 96 | 98 | .name = "mpeg4", |
| 97 | 99 | .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), |
| 98 | 100 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, |
| 101 | + .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg4_video_profiles), | |
| 99 | 102 | }, |
| 100 | 103 | { |
| 101 | 104 | .id = AV_CODEC_ID_RAWVIDEO, |
| @@ -201,6 +204,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 99 unmodified lines | ||
| 201 | 204 | .name = "h264", |
| 202 | 205 | .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), |
| 203 | 206 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS | AV_CODEC_PROP_REORDER, |
| 207 | + .profiles = NULL_IF_CONFIG_SMALL(ff_h264_profiles), | |
| 204 | 208 | }, |
| 205 | 209 | { |
| 206 | 210 | .id = AV_CODEC_ID_INDEO3, |
| @@ -460,6 +464,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 253 unmodified lines | ||
| 460 | 464 | .name = "vc1", |
| 461 | 465 | .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1"), |
| 462 | 466 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, |
| 467 | + .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles), | |
| 463 | 468 | }, |
| 464 | 469 | { |
| 465 | 470 | .id = AV_CODEC_ID_WMV3, |
| @@ -467,6 +472,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 1 unmodified line | ||
| 467 | 472 | .name = "wmv3", |
| 468 | 473 | .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9"), |
| 469 | 474 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, |
| 475 | + .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles), | |
| 470 | 476 | }, |
| 471 | 477 | { |
| 472 | 478 | .id = AV_CODEC_ID_LOCO, |
| @@ -587,6 +593,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 114 unmodified lines | ||
| 587 | 593 | .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), |
| 588 | 594 | .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY | |
| 589 | 595 | AV_CODEC_PROP_LOSSLESS, |
| 596 | + .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles), | |
| 590 | 597 | }, |
| 591 | 598 | { |
| 592 | 599 | .id = AV_CODEC_ID_VMNC, |
| @@ -1098,6 +1105,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 505 unmodified lines | ||
| 1098 | 1105 | .name = "hevc", |
| 1099 | 1106 | .long_name = NULL_IF_CONFIG_SMALL("HEVC (High Efficiency Video Coding)"), |
| 1100 | 1107 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_REORDER, |
| 1108 | + .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), | |
| 1101 | 1109 | }, |
| 1102 | 1110 | { |
| 1103 | 1111 | .id = AV_CODEC_ID_FIC, |
| @@ -1912,6 +1920,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 808 unmodified lines | ||
| 1912 | 1920 | .name = "aac", |
| 1913 | 1921 | .long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"), |
| 1914 | 1922 | .props = AV_CODEC_PROP_LOSSY, |
| 1923 | + .profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), | |
| 1915 | 1924 | }, |
| 1916 | 1925 | { |
| 1917 | 1926 | .id = AV_CODEC_ID_AC3, |
| @@ -1926,6 +1935,7 @@ static const AVCodecDescriptor codec_descriptors[] = { · 8 unmodified lines | ||
| 1926 | 1935 | .name = "dts", |
| 1927 | 1936 | .long_name = NULL_IF_CONFIG_SMALL("DCA (DTS Coherent Acoustics)"), |
| 1928 | 1937 | .props = AV_CODEC_PROP_LOSSY | AV_CODEC_PROP_LOSSLESS, |
| 1938 | + .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), | |
| 1929 | 1939 | }, |
| 1930 | 1940 | { |
| 1931 | 1941 | .id = AV_CODEC_ID_VORBIS, |
| @@ -49,6 +49,7 @@ · 48 unmodified lines | ||
| 49 | 49 | #include "get_bits.h" |
| 50 | 50 | #include "internal.h" |
| 51 | 51 | #include "mathops.h" |
| 52 | +#include "profiles.h" | |
| 52 | 53 | #include "put_bits.h" |
| 53 | 54 | #include "synth_filter.h" |
| 54 | 55 | |
| @@ -1566,15 +1567,6 @@ static av_cold int dca_decode_end(AVCodecContext *avctx) · 1511 unmodified lines | ||
| 1566 | 1567 | return 0; |
| 1567 | 1568 | } |
| 1568 | 1569 | |
| 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 | − | |
| 1578 | 1570 | static const AVOption options[] = { |
| 1579 | 1571 | { "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 }, |
| 1580 | 1572 | { "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 | ||
| 1600 | 1592 | .capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, |
| 1601 | 1593 | .sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, |
| 1602 | 1594 | AV_SAMPLE_FMT_NONE }, |
| 1603 | − .profiles = NULL_IF_CONFIG_SMALL(profiles), | |
| 1595 | + .profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), | |
| 1604 | 1596 | .priv_class = &dca_decoder_class, |
| 1605 | 1597 | }; |
| @@ -44,6 +44,7 @@ · 43 unmodified lines | ||
| 44 | 44 | #include "mathops.h" |
| 45 | 45 | #include "me_cmp.h" |
| 46 | 46 | #include "mpegutils.h" |
| 47 | +#include "profiles.h" | |
| 47 | 48 | #include "rectangle.h" |
| 48 | 49 | #include "svq3.h" |
| 49 | 50 | #include "thread.h" |
| @@ -1771,23 +1772,6 @@ static const AVClass h264_class = { · 1721 unmodified lines | ||
| 1771 | 1772 | .version = LIBAVUTIL_VERSION_INT, |
| 1772 | 1773 | }; |
| 1773 | 1774 | |
| 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 | − | |
| 1791 | 1775 | AVCodec ff_h264_decoder = { |
| 1792 | 1776 | .name = "h264", |
| 1793 | 1777 | .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 | ||
| 1804 | 1788 | .flush = flush_dpb, |
| 1805 | 1789 | .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy), |
| 1806 | 1790 | .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), | |
| 1808 | 1792 | .priv_class = &h264_class, |
| 1809 | 1793 | }; |
| @@ -37,6 +37,7 @@ · 36 unmodified lines | ||
| 37 | 37 | #include "cabac_functions.h" |
| 38 | 38 | #include "golomb.h" |
| 39 | 39 | #include "hevc.h" |
| 40 | +#include "profiles.h" | |
| 40 | 41 | |
| 41 | 42 | const uint8_t ff_hevc_qpel_extra_before[4] = { 0, 3, 3, 3 }; |
| 42 | 43 | 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 | ||
| 3027 | 3028 | #define OFFSET(x) offsetof(HEVCContext, x) |
| 3028 | 3029 | #define PAR (AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM) |
| 3029 | 3030 | |
| 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 | − | |
| 3037 | 3031 | static const AVOption options[] = { |
| 3038 | 3032 | { "apply_defdispwin", "Apply default display window from VUI", OFFSET(apply_defdispwin), |
| 3039 | 3033 | AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, PAR }, |
| @@ -3062,5 +3056,5 @@ AVCodec ff_hevc_decoder = { · 22 unmodified lines | ||
| 3062 | 3056 | .init_thread_copy = hevc_init_thread_copy, |
| 3063 | 3057 | .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 3064 | 3058 | AV_CODEC_CAP_FRAME_THREADS, |
| 3065 | − .profiles = NULL_IF_CONFIG_SMALL(profiles), | |
| 3059 | + .profiles = NULL_IF_CONFIG_SMALL(ff_hevc_profiles), | |
| 3066 | 3060 | }; |
| @@ -36,6 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | #include "thread.h" |
| 37 | 37 | #include "jpeg2000.h" |
| 38 | 38 | #include "jpeg2000dsp.h" |
| 39 | +#include "profiles.h" | |
| 39 | 40 | |
| 40 | 41 | #define JP2_SIG_TYPE 0x6A502020 |
| 41 | 42 | #define JP2_SIG_VALUE 0x0D0A870A |
| @@ -1457,15 +1458,6 @@ static const AVOption options[] = { · 1415 unmodified lines | ||
| 1457 | 1458 | { NULL }, |
| 1458 | 1459 | }; |
| 1459 | 1460 | |
| 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 | − | |
| 1469 | 1461 | static const AVClass class = { |
| 1470 | 1462 | .class_name = "jpeg2000", |
| 1471 | 1463 | .item_name = av_default_item_name, |
| @@ -1484,5 +1476,5 @@ AVCodec ff_jpeg2000_decoder = { · 12 unmodified lines | ||
| 1484 | 1476 | .init = jpeg2000_decode_init, |
| 1485 | 1477 | .decode = jpeg2000_decode_frame, |
| 1486 | 1478 | .priv_class = &class, |
| 1487 | − .profiles = NULL_IF_CONFIG_SMALL(profiles) | |
| 1479 | + .profiles = NULL_IF_CONFIG_SMALL(ff_jpeg2000_profiles) | |
| 1488 | 1480 | }; |
| @@ -42,6 +42,7 @@ · 41 unmodified lines | ||
| 42 | 42 | #include "mpegutils.h" |
| 43 | 43 | #include "mpegvideo.h" |
| 44 | 44 | #include "mpegvideodata.h" |
| 45 | +#include "profiles.h" | |
| 45 | 46 | #include "thread.h" |
| 46 | 47 | #include "version.h" |
| 47 | 48 | #include "xvmc_internal.h" |
| @@ -2680,18 +2681,6 @@ static av_cold int mpeg_decode_end(AVCodecContext *avctx) · 2632 unmodified lines | ||
| 2680 | 2681 | return 0; |
| 2681 | 2682 | } |
| 2682 | 2683 | |
| 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 | − | |
| 2695 | 2684 | AVCodec ff_mpeg1video_decoder = { |
| 2696 | 2685 | .name = "mpeg1video", |
| 2697 | 2686 | .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), |
| @@ -2721,7 +2710,7 @@ AVCodec ff_mpeg2video_decoder = { · 23 unmodified lines | ||
| 2721 | 2710 | AV_CODEC_CAP_TRUNCATED | AV_CODEC_CAP_DELAY | |
| 2722 | 2711 | AV_CODEC_CAP_SLICE_THREADS, |
| 2723 | 2712 | .flush = flush, |
| 2724 | − .profiles = NULL_IF_CONFIG_SMALL(mpeg2_video_profiles), | |
| 2713 | + .profiles = NULL_IF_CONFIG_SMALL(ff_mpeg2_video_profiles), | |
| 2725 | 2714 | }; |
| 2726 | 2715 | |
| 2727 | 2716 | #if FF_API_XVMC |
| @@ -28,6 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #include "mpegvideodata.h" |
| 29 | 29 | #include "mpeg4video.h" |
| 30 | 30 | #include "h263.h" |
| 31 | +#include "profiles.h" | |
| 31 | 32 | #include "thread.h" |
| 32 | 33 | #include "xvididct.h" |
| 33 | 34 | |
| @@ -2599,25 +2600,6 @@ static av_cold int decode_init(AVCodecContext *avctx) · 2565 unmodified lines | ||
| 2599 | 2600 | return 0; |
| 2600 | 2601 | } |
| 2601 | 2602 | |
| 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 | − | |
| 2621 | 2603 | AVCodec ff_mpeg4_decoder = { |
| 2622 | 2604 | .name = "mpeg4", |
| 2623 | 2605 | .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), |
| @@ -2632,6 +2614,6 @@ AVCodec ff_mpeg4_decoder = { · 8 unmodified lines | ||
| 2632 | 2614 | AV_CODEC_CAP_FRAME_THREADS, |
| 2633 | 2615 | .flush = ff_mpeg_flush, |
| 2634 | 2616 | .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), | |
| 2636 | 2618 | .update_thread_context = ONLY_IF_THREADS_ENABLED(mpeg4_update_thread_context), |
| 2637 | 2619 | }; |
| @@ -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 */ | |
| @@ -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 | |
| @@ -1918,6 +1918,21 @@ const char *av_get_profile_name(const AVCodec *codec, int profile) · 1917 unmodified lines | ||
| 1918 | 1918 | return NULL; |
| 1919 | 1919 | } |
| 1920 | 1920 | |
| 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 | + | |
| 1921 | 1936 | unsigned avcodec_version(void) |
| 1922 | 1937 | { |
| 1923 | 1938 | return LIBAVCODEC_VERSION_INT; |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #include "mpegvideo.h" |
| 35 | 35 | #include "msmpeg4.h" |
| 36 | 36 | #include "msmpeg4data.h" |
| 37 | +#include "profiles.h" | |
| 37 | 38 | #include "vc1.h" |
| 38 | 39 | #include "vc1data.h" |
| 39 | 40 | |
| @@ -943,14 +944,6 @@ err: · 903 unmodified lines | ||
| 943 | 944 | } |
| 944 | 945 | |
| 945 | 946 | |
| 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 | − | |
| 954 | 947 | static const enum AVPixelFormat vc1_hwaccel_pixfmt_list_420[] = { |
| 955 | 948 | #if CONFIG_VC1_DXVA2_HWACCEL |
| 956 | 949 | AV_PIX_FMT_DXVA2_VLD, |
| @@ -980,7 +973,7 @@ AVCodec ff_vc1_decoder = { · 23 unmodified lines | ||
| 980 | 973 | .flush = ff_mpeg_flush, |
| 981 | 974 | .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 982 | 975 | .pix_fmts = vc1_hwaccel_pixfmt_list_420, |
| 983 | − .profiles = NULL_IF_CONFIG_SMALL(profiles) | |
| 976 | + .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) | |
| 984 | 977 | }; |
| 985 | 978 | |
| 986 | 979 | #if CONFIG_WMV3_DECODER |
| @@ -996,7 +989,7 @@ AVCodec ff_wmv3_decoder = { · 9 unmodified lines | ||
| 996 | 989 | .flush = ff_mpeg_flush, |
| 997 | 990 | .capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 998 | 991 | .pix_fmts = vc1_hwaccel_pixfmt_list_420, |
| 999 | − .profiles = NULL_IF_CONFIG_SMALL(profiles) | |
| 992 | + .profiles = NULL_IF_CONFIG_SMALL(ff_vc1_profiles) | |
| 1000 | 993 | }; |
| 1001 | 994 | #endif |
| 1002 | 995 | |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include "libavutil/version.h" |
| 30 | 30 | |
| 31 | 31 | #define LIBAVCODEC_VERSION_MAJOR 57 |
| 32 | −#define LIBAVCODEC_VERSION_MINOR 11 | |
| 32 | +#define LIBAVCODEC_VERSION_MINOR 12 | |
| 33 | 33 | #define LIBAVCODEC_VERSION_MICRO 0 |
| 34 | 34 | |
| 35 | 35 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |