avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines

These defines are also used in other contexts than just AVCodecContext
ones, e.g. in libavformat. Furthermore, given that these defines are
public, the AV-prefix is the right one, so deprecate (and not just move)
the FF-macros.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2023-09-02 14:57:41 +02:00
parent 0c6e5f321b
commit 8238bc0b5e
93 changed files with 879 additions and 727 deletions

View File

@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09
API changes, most recent first: API changes, most recent first:
2023-09-07 - xxxxxxxxxx - lavc 60.26.100 - defs.h
Add AV_PROFILE_* and AV_LEVEL_* replacements in defs.h for the
defines from avcodec.h. The latter are deprecated.
2023-09-06 - xxxxxxxxxx - lavc 60.25.101 - avcodec.h 2023-09-06 - xxxxxxxxxx - lavc 60.25.101 - avcodec.h
AVCodecContext.rc_buffer_size may now be set by decoders. AVCodecContext.rc_buffer_size may now be set by decoders.

View File

@ -3020,7 +3020,7 @@ static int show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_id
if (!do_bitexact && (profile = avcodec_profile_name(par->codec_id, par->profile))) if (!do_bitexact && (profile = avcodec_profile_name(par->codec_id, par->profile)))
print_str("profile", profile); print_str("profile", profile);
else { else {
if (par->profile != FF_PROFILE_UNKNOWN) { if (par->profile != AV_PROFILE_UNKNOWN) {
char profile_num[12]; char profile_num[12];
snprintf(profile_num, sizeof(profile_num), "%d", par->profile); snprintf(profile_num, sizeof(profile_num), "%d", par->profile);
print_str("profile", profile_num); print_str("profile", profile_num);

View File

@ -2486,12 +2486,12 @@ static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
ac->avctx->ch_layout.nb_channels == 1) { ac->avctx->ch_layout.nb_channels == 1) {
ac->oc[1].m4ac.sbr = 1; ac->oc[1].m4ac.sbr = 1;
ac->oc[1].m4ac.ps = 1; ac->oc[1].m4ac.ps = 1;
ac->avctx->profile = FF_PROFILE_AAC_HE_V2; ac->avctx->profile = AV_PROFILE_AAC_HE_V2;
output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags, output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
ac->oc[1].status, 1); ac->oc[1].status, 1);
} else { } else {
ac->oc[1].m4ac.sbr = 1; ac->oc[1].m4ac.sbr = 1;
ac->avctx->profile = FF_PROFILE_AAC_HE; ac->avctx->profile = AV_PROFILE_AAC_HE;
} }
res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type); res = AAC_RENAME(ff_decode_sbr_extension)(ac, &che->sbr, gb, crc_flag, cnt, elem_type);
if (ac->oc[1].m4ac.ps == 1 && !ac->warned_he_aac_mono) { if (ac->oc[1].m4ac.ps == 1 && !ac->warned_he_aac_mono) {
@ -3080,7 +3080,7 @@ static int aac_decode_er_frame(AVCodecContext *avctx, void *data,
if ((err = frame_configure_elements(avctx)) < 0) if ((err = frame_configure_elements(avctx)) < 0)
return err; return err;
// The FF_PROFILE_AAC_* defines are all object_type - 1 // The AV_PROFILE_AAC_* defines are all object_type - 1
// This may lead to an undefined profile being signaled // This may lead to an undefined profile being signaled
ac->avctx->profile = aot - 1; ac->avctx->profile = aot - 1;
@ -3163,7 +3163,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, AVFrame *frame,
if ((err = frame_configure_elements(avctx)) < 0) if ((err = frame_configure_elements(avctx)) < 0)
goto fail; goto fail;
// The FF_PROFILE_AAC_* defines are all object_type - 1 // The AV_PROFILE_AAC_* defines are all object_type - 1
// This may lead to an undefined profile being signaled // This may lead to an undefined profile being signaled
ac->avctx->profile = ac->oc[1].m4ac.object_type - 1; ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;

View File

@ -1307,13 +1307,13 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
avctx->bit_rate); avctx->bit_rate);
/* Profile and option setting */ /* Profile and option setting */
avctx->profile = avctx->profile == FF_PROFILE_UNKNOWN ? FF_PROFILE_AAC_LOW : avctx->profile = avctx->profile == AV_PROFILE_UNKNOWN ? AV_PROFILE_AAC_LOW :
avctx->profile; avctx->profile;
for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++) for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++)
if (avctx->profile == aacenc_profiles[i]) if (avctx->profile == aacenc_profiles[i])
break; break;
if (avctx->profile == FF_PROFILE_MPEG2_AAC_LOW) { if (avctx->profile == AV_PROFILE_MPEG2_AAC_LOW) {
avctx->profile = FF_PROFILE_AAC_LOW; avctx->profile = AV_PROFILE_AAC_LOW;
ERROR_IF(s->options.pred, ERROR_IF(s->options.pred,
"Main prediction unavailable in the \"mpeg2_aac_low\" profile\n"); "Main prediction unavailable in the \"mpeg2_aac_low\" profile\n");
ERROR_IF(s->options.ltp, ERROR_IF(s->options.ltp,
@ -1321,22 +1321,22 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
WARN_IF(s->options.pns, WARN_IF(s->options.pns,
"PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n"); "PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n");
s->options.pns = 0; s->options.pns = 0;
} else if (avctx->profile == FF_PROFILE_AAC_LTP) { } else if (avctx->profile == AV_PROFILE_AAC_LTP) {
s->options.ltp = 1; s->options.ltp = 1;
ERROR_IF(s->options.pred, ERROR_IF(s->options.pred,
"Main prediction unavailable in the \"aac_ltp\" profile\n"); "Main prediction unavailable in the \"aac_ltp\" profile\n");
} else if (avctx->profile == FF_PROFILE_AAC_MAIN) { } else if (avctx->profile == AV_PROFILE_AAC_MAIN) {
s->options.pred = 1; s->options.pred = 1;
ERROR_IF(s->options.ltp, ERROR_IF(s->options.ltp,
"LTP prediction unavailable in the \"aac_main\" profile\n"); "LTP prediction unavailable in the \"aac_main\" profile\n");
} else if (s->options.ltp) { } else if (s->options.ltp) {
avctx->profile = FF_PROFILE_AAC_LTP; avctx->profile = AV_PROFILE_AAC_LTP;
WARN_IF(1, WARN_IF(1,
"Chainging profile to \"aac_ltp\"\n"); "Chainging profile to \"aac_ltp\"\n");
ERROR_IF(s->options.pred, ERROR_IF(s->options.pred,
"Main prediction unavailable in the \"aac_ltp\" profile\n"); "Main prediction unavailable in the \"aac_ltp\" profile\n");
} else if (s->options.pred) { } else if (s->options.pred) {
avctx->profile = FF_PROFILE_AAC_MAIN; avctx->profile = AV_PROFILE_AAC_MAIN;
WARN_IF(1, WARN_IF(1,
"Chainging profile to \"aac_main\"\n"); "Chainging profile to \"aac_main\"\n");
ERROR_IF(s->options.ltp, ERROR_IF(s->options.ltp,

View File

@ -37,7 +37,7 @@ void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce,
{ {
int i; int i;
IndividualChannelStream *ics = &sce->ics; IndividualChannelStream *ics = &sce->ics;
if (s->profile != FF_PROFILE_AAC_LTP || !ics->predictor_present) if (s->profile != AV_PROFILE_AAC_LTP || !ics->predictor_present)
return; return;
if (common_window) if (common_window)
put_bits(&s->pb, 1, 0); put_bits(&s->pb, 1, 0);
@ -119,7 +119,7 @@ void ff_aac_update_ltp(AACEncContext *s, SingleChannelElement *sce)
float *pred_signal = &sce->ltp_state[0]; float *pred_signal = &sce->ltp_state[0];
const float *samples = &s->planar_samples[s->cur_channel][1024]; const float *samples = &s->planar_samples[s->cur_channel][1024];
if (s->profile != FF_PROFILE_AAC_LTP) if (s->profile != AV_PROFILE_AAC_LTP)
return; return;
/* Calculate lag */ /* Calculate lag */

View File

@ -335,7 +335,7 @@ void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce)
IndividualChannelStream *ics = &sce->ics; IndividualChannelStream *ics = &sce->ics;
const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]); const int pmax = FFMIN(ics->max_sfb, ff_aac_pred_sfb_max[s->samplerate_index]);
if (s->profile != FF_PROFILE_AAC_MAIN || if (s->profile != AV_PROFILE_AAC_MAIN ||
!ics->predictor_present) !ics->predictor_present)
return; return;

View File

@ -167,7 +167,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4; const int c_bits = is8 ? TNS_Q_BITS_IS8 == 4 : TNS_Q_BITS == 4;
const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm); const int sfb_start = av_clip(tns_min_sfb[is8][s->samplerate_index], 0, mmm);
const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm); const int sfb_end = av_clip(sce->ics.num_swb, 0, mmm);
const int order = is8 ? 7 : s->profile == FF_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER; const int order = is8 ? 7 : s->profile == AV_PROFILE_AAC_LOW ? 12 : TNS_MAX_ORDER;
const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 : const int slant = sce->ics.window_sequence[0] == LONG_STOP_SEQUENCE ? 1 :
sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2; sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
const int sfb_len = sfb_end - sfb_start; const int sfb_len = sfb_end - sfb_start;

View File

@ -124,10 +124,10 @@ static const unsigned char aac_maxval_cb[] = {
}; };
static const int aacenc_profiles[] = { static const int aacenc_profiles[] = {
FF_PROFILE_AAC_MAIN, AV_PROFILE_AAC_MAIN,
FF_PROFILE_AAC_LOW, AV_PROFILE_AAC_LOW,
FF_PROFILE_AAC_LTP, AV_PROFILE_AAC_LTP,
FF_PROFILE_MPEG2_AAC_LOW, AV_PROFILE_MPEG2_AAC_LOW,
}; };
#endif /* AVCODEC_AACENCTAB_H */ #endif /* AVCODEC_AACENCTAB_H */

View File

@ -973,7 +973,7 @@ static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
*num_bits_left = 0; *num_bits_left = 0;
} else { } else {
*num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps.common, *num_bits_left); *num_bits_left -= ff_ps_read_data(ac->avctx, gb, &sbr->ps.common, *num_bits_left);
ac->avctx->profile = FF_PROFILE_AAC_HE_V2; ac->avctx->profile = AV_PROFILE_AAC_HE_V2;
// ensure the warning is not printed if PS extension is present // ensure the warning is not printed if PS extension is present
ac->warned_he_aac_mono = 1; ac->warned_he_aac_mono = 1;
} }

View File

@ -1714,7 +1714,7 @@ skip:
if (!err) { if (!err) {
avctx->sample_rate = s->sample_rate; avctx->sample_rate = s->sample_rate;
avctx->bit_rate = s->bit_rate + s->prev_bit_rate; avctx->bit_rate = s->bit_rate + s->prev_bit_rate;
avctx->profile = s->eac3_extension_type_a == 1 ? FF_PROFILE_EAC3_DDP_ATMOS : FF_PROFILE_UNKNOWN; avctx->profile = s->eac3_extension_type_a == 1 ? AV_PROFILE_EAC3_DDP_ATMOS : AV_PROFILE_UNKNOWN;
} }
if (!avctx->sample_rate) { if (!avctx->sample_rate) {

View File

@ -192,7 +192,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate); AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate);
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_AV1_MAIN: case AV_PROFILE_AV1_MAIN:
profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN; profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN;
break; break;
default: default:
@ -204,7 +204,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile); AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile);
profile_level = avctx->level; profile_level = avctx->level;
if (profile_level == FF_LEVEL_UNKNOWN) { if (profile_level == AV_LEVEL_UNKNOWN) {
profile_level = ctx->level; profile_level = ctx->level;
} }
if (profile_level != 0) { if (profile_level != 0) {

View File

@ -223,19 +223,19 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate); AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate);
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE; profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE;
break; break;
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
profile = AMF_VIDEO_ENCODER_PROFILE_MAIN; profile = AMF_VIDEO_ENCODER_PROFILE_MAIN;
break; break;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
profile = AMF_VIDEO_ENCODER_PROFILE_HIGH; profile = AMF_VIDEO_ENCODER_PROFILE_HIGH;
break; break;
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case AV_PROFILE_H264_CONSTRAINED_BASELINE:
profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE; profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE;
break; break;
case (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED): case (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED):
profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH; profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_HIGH;
break; break;
} }
@ -246,7 +246,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile); AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile);
profile_level = avctx->level; profile_level = avctx->level;
if (profile_level == FF_LEVEL_UNKNOWN) { if (profile_level == AV_LEVEL_UNKNOWN) {
profile_level = ctx->level; profile_level = ctx->level;
} }
if (profile_level != 0) { if (profile_level != 0) {

View File

@ -184,7 +184,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate); AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate);
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_HEVC_MAIN: case AV_PROFILE_HEVC_MAIN:
profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN; profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN;
break; break;
default: default:
@ -198,7 +198,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier); AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier);
profile_level = avctx->level; profile_level = avctx->level;
if (profile_level == FF_LEVEL_UNKNOWN) { if (profile_level == AV_LEVEL_UNKNOWN) {
profile_level = ctx->level; profile_level = ctx->level;
} }
if (profile_level != 0) { if (profile_level != 0) {

View File

@ -60,17 +60,17 @@ static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
switch (codec) { switch (codec) {
case AV_CODEC_ID_AAC: case AV_CODEC_ID_AAC:
switch (profile) { switch (profile) {
case FF_PROFILE_AAC_LOW: case AV_PROFILE_AAC_LOW:
default: default:
return kAudioFormatMPEG4AAC; return kAudioFormatMPEG4AAC;
case FF_PROFILE_AAC_HE: case AV_PROFILE_AAC_HE:
return kAudioFormatMPEG4AAC_HE; return kAudioFormatMPEG4AAC_HE;
case FF_PROFILE_AAC_HE_V2: case AV_PROFILE_AAC_HE_V2:
return kAudioFormatMPEG4AAC_HE_V2; return kAudioFormatMPEG4AAC_HE_V2;
case FF_PROFILE_AAC_LD: case AV_PROFILE_AAC_LD:
return kAudioFormatMPEG4AAC_LD; return kAudioFormatMPEG4AAC_LD;
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
case FF_PROFILE_AAC_ELD: case AV_PROFILE_AAC_ELD:
return kAudioFormatMPEG4AAC_ELD; return kAudioFormatMPEG4AAC_ELD;
#endif #endif
} }
@ -586,12 +586,12 @@ static av_cold int ffat_close_encoder(AVCodecContext *avctx)
} }
static const AVProfile aac_profiles[] = { static const AVProfile aac_profiles[] = {
{ FF_PROFILE_AAC_LOW, "LC" }, { AV_PROFILE_AAC_LOW, "LC" },
{ FF_PROFILE_AAC_HE, "HE-AAC" }, { AV_PROFILE_AAC_HE, "HE-AAC" },
{ FF_PROFILE_AAC_HE_V2, "HE-AACv2" }, { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
{ FF_PROFILE_AAC_LD, "LD" }, { AV_PROFILE_AAC_LD, "LD" },
{ FF_PROFILE_AAC_ELD, "ELD" }, { AV_PROFILE_AAC_ELD, "ELD" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
#define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

View File

@ -1587,8 +1587,12 @@ typedef struct AVCodecContext {
* profile * profile
* - encoding: Set by user. * - encoding: Set by user.
* - decoding: Set by libavcodec. * - decoding: Set by libavcodec.
* See the AV_PROFILE_* defines in defs.h.
*/ */
int profile; int profile;
#if FF_API_FF_PROFILE_LEVEL
/** @deprecated The following defines are deprecated; use AV_PROFILE_*
* in defs.h instead. */
#define FF_PROFILE_UNKNOWN -99 #define FF_PROFILE_UNKNOWN -99
#define FF_PROFILE_RESERVED -100 #define FF_PROFILE_RESERVED -100
@ -1719,14 +1723,20 @@ typedef struct AVCodecContext {
#define FF_PROFILE_EVC_BASELINE 0 #define FF_PROFILE_EVC_BASELINE 0
#define FF_PROFILE_EVC_MAIN 1 #define FF_PROFILE_EVC_MAIN 1
#endif
/** /**
* level * level
* - encoding: Set by user. * - encoding: Set by user.
* - decoding: Set by libavcodec. * - decoding: Set by libavcodec.
* See AV_LEVEL_* in defs.h.
*/ */
int level; int level;
#if FF_API_FF_PROFILE_LEVEL
/** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN
* in defs.h instead. */
#define FF_LEVEL_UNKNOWN -99 #define FF_LEVEL_UNKNOWN -99
#endif
/** /**
* Skip loop filtering for selected frames. * Skip loop filtering for selected frames.

View File

@ -20,10 +20,10 @@
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "cbs.h" #include "cbs.h"
#include "cbs_internal.h" #include "cbs_internal.h"
#include "cbs_av1.h" #include "cbs_av1.h"
#include "defs.h"
static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc,

View File

@ -82,7 +82,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
flag(high_bitdepth); flag(high_bitdepth);
if (seq_profile == FF_PROFILE_AV1_PROFESSIONAL && if (seq_profile == AV_PROFILE_AV1_PROFESSIONAL &&
current->high_bitdepth) { current->high_bitdepth) {
flag(twelve_bit); flag(twelve_bit);
priv->bit_depth = current->twelve_bit ? 12 : 10; priv->bit_depth = current->twelve_bit ? 12 : 10;
@ -90,7 +90,7 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
priv->bit_depth = current->high_bitdepth ? 10 : 8; priv->bit_depth = current->high_bitdepth ? 10 : 8;
} }
if (seq_profile == FF_PROFILE_AV1_HIGH) if (seq_profile == AV_PROFILE_AV1_HIGH)
infer(mono_chrome, 0); infer(mono_chrome, 0);
else else
flag(mono_chrome); flag(mono_chrome);
@ -126,10 +126,10 @@ static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
} else { } else {
flag(color_range); flag(color_range);
if (seq_profile == FF_PROFILE_AV1_MAIN) { if (seq_profile == AV_PROFILE_AV1_MAIN) {
infer(subsampling_x, 1); infer(subsampling_x, 1);
infer(subsampling_y, 1); infer(subsampling_y, 1);
} else if (seq_profile == FF_PROFILE_AV1_HIGH) { } else if (seq_profile == AV_PROFILE_AV1_HIGH) {
infer(subsampling_x, 0); infer(subsampling_x, 0);
infer(subsampling_y, 0); infer(subsampling_y, 0);
} else { } else {
@ -190,8 +190,8 @@ static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
HEADER("Sequence Header"); HEADER("Sequence Header");
fc(3, seq_profile, FF_PROFILE_AV1_MAIN, fc(3, seq_profile, AV_PROFILE_AV1_MAIN,
FF_PROFILE_AV1_PROFESSIONAL); AV_PROFILE_AV1_PROFESSIONAL);
flag(still_picture); flag(still_picture);
flag(reduced_still_picture_header); flag(reduced_still_picture_header);

View File

@ -217,7 +217,7 @@ typedef struct AVCodec {
const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
#endif #endif
const AVClass *priv_class; ///< AVClass for the private context const AVClass *priv_class; ///< AVClass for the private context
const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN}
/** /**
* Group name of the codec implementation. * Group name of the codec implementation.

View File

@ -60,7 +60,7 @@ typedef struct AVCodecDescriptor {
const char *const *mime_types; const char *const *mime_types;
/** /**
* If non-NULL, an array of profiles recognized for this codec. * If non-NULL, an array of profiles recognized for this codec.
* Terminated with FF_PROFILE_UNKNOWN. * Terminated with AV_PROFILE_UNKNOWN.
*/ */
const struct AVProfile *profiles; const struct AVProfile *profiles;
} AVCodecDescriptor; } AVCodecDescriptor;

View File

@ -47,8 +47,8 @@ static void codec_parameters_reset(AVCodecParameters *par)
par->chroma_location = AVCHROMA_LOC_UNSPECIFIED; par->chroma_location = AVCHROMA_LOC_UNSPECIFIED;
par->sample_aspect_ratio = (AVRational){ 0, 1 }; par->sample_aspect_ratio = (AVRational){ 0, 1 };
par->framerate = (AVRational){ 0, 1 }; par->framerate = (AVRational){ 0, 1 };
par->profile = FF_PROFILE_UNKNOWN; par->profile = AV_PROFILE_UNKNOWN;
par->level = FF_LEVEL_UNKNOWN; par->level = AV_LEVEL_UNKNOWN;
} }
AVCodecParameters *avcodec_parameters_alloc(void) AVCodecParameters *avcodec_parameters_alloc(void)

View File

@ -2387,13 +2387,13 @@ int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame)
// Set profile, bit rate, etc // Set profile, bit rate, etc
if (s->ext_audio_mask & DCA_EXSS_MASK) if (s->ext_audio_mask & DCA_EXSS_MASK)
avctx->profile = FF_PROFILE_DTS_HD_HRA; avctx->profile = AV_PROFILE_DTS_HD_HRA;
else if (s->ext_audio_mask & (DCA_CSS_XXCH | DCA_CSS_XCH)) else if (s->ext_audio_mask & (DCA_CSS_XXCH | DCA_CSS_XCH))
avctx->profile = FF_PROFILE_DTS_ES; avctx->profile = AV_PROFILE_DTS_ES;
else if (s->ext_audio_mask & DCA_CSS_X96) else if (s->ext_audio_mask & DCA_CSS_X96)
avctx->profile = FF_PROFILE_DTS_96_24; avctx->profile = AV_PROFILE_DTS_96_24;
else else
avctx->profile = FF_PROFILE_DTS; avctx->profile = AV_PROFILE_DTS;
if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK)) if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK))
avctx->bit_rate = s->bit_rate; avctx->bit_rate = s->bit_rate;

View File

@ -1744,7 +1744,7 @@ int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame)
avctx->sample_rate = s->sample_rate; avctx->sample_rate = s->sample_rate;
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP; avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
avctx->bits_per_raw_sample = 0; avctx->bits_per_raw_sample = 0;
avctx->profile = FF_PROFILE_DTS_EXPRESS; avctx->profile = AV_PROFILE_DTS_EXPRESS;
avctx->bit_rate = s->bit_rate_scaled; avctx->bit_rate = s->bit_rate_scaled;
if (s->flags & LBR_FLAG_LFE_PRESENT) { if (s->flags & LBR_FLAG_LFE_PRESENT) {

View File

@ -228,7 +228,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
*sample_rate = ff_dca_sampling_freqs[pc1->sr_code]; *sample_rate = ff_dca_sampling_freqs[pc1->sr_code];
*duration = 1024 << ff_dca_freq_ranges[pc1->sr_code]; *duration = 1024 << ff_dca_freq_ranges[pc1->sr_code];
*profile = FF_PROFILE_DTS_EXPRESS; *profile = AV_PROFILE_DTS_EXPRESS;
return 0; return 0;
} }
@ -253,7 +253,7 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
*sample_rate = asset->max_sample_rate; *sample_rate = asset->max_sample_rate;
*duration = (1 + (*sample_rate > 96000)) << nsamples_log2; *duration = (1 + (*sample_rate > 96000)) << nsamples_log2;
*profile = FF_PROFILE_DTS_HD_MA; *profile = AV_PROFILE_DTS_HD_MA;
return 0; return 0;
} }
@ -268,18 +268,18 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
*duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES; *duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES;
*sample_rate = ff_dca_sample_rates[h.sr_code]; *sample_rate = ff_dca_sample_rates[h.sr_code];
if (*profile != FF_PROFILE_UNKNOWN) if (*profile != AV_PROFILE_UNKNOWN)
return 0; return 0;
*profile = FF_PROFILE_DTS; *profile = AV_PROFILE_DTS;
if (h.ext_audio_present) { if (h.ext_audio_present) {
switch (h.ext_audio_type) { switch (h.ext_audio_type) {
case DCA_EXT_AUDIO_XCH: case DCA_EXT_AUDIO_XCH:
case DCA_EXT_AUDIO_XXCH: case DCA_EXT_AUDIO_XXCH:
*profile = FF_PROFILE_DTS_ES; *profile = AV_PROFILE_DTS_ES;
break; break;
case DCA_EXT_AUDIO_X96: case DCA_EXT_AUDIO_X96:
*profile = FF_PROFILE_DTS_96_24; *profile = AV_PROFILE_DTS_96_24;
break; break;
} }
} }
@ -296,9 +296,9 @@ static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
return 0; return 0;
if (asset->extension_mask & DCA_EXSS_XLL) if (asset->extension_mask & DCA_EXSS_XLL)
*profile = FF_PROFILE_DTS_HD_MA; *profile = AV_PROFILE_DTS_HD_MA;
else if (asset->extension_mask & (DCA_EXSS_XBR | DCA_EXSS_XXCH | DCA_EXSS_X96)) else if (asset->extension_mask & (DCA_EXSS_XBR | DCA_EXSS_XXCH | DCA_EXSS_X96))
*profile = FF_PROFILE_DTS_HD_HRA; *profile = AV_PROFILE_DTS_HD_HRA;
return 0; return 0;
} }

View File

@ -1446,11 +1446,11 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame)
} }
if (s->x_imax_syncword_present) { if (s->x_imax_syncword_present) {
avctx->profile = FF_PROFILE_DTS_HD_MA_X_IMAX; avctx->profile = AV_PROFILE_DTS_HD_MA_X_IMAX;
} else if (s->x_syncword_present) { } else if (s->x_syncword_present) {
avctx->profile = FF_PROFILE_DTS_HD_MA_X; avctx->profile = AV_PROFILE_DTS_HD_MA_X;
} else { } else {
avctx->profile = FF_PROFILE_DTS_HD_MA; avctx->profile = AV_PROFILE_DTS_HD_MA;
} }
avctx->bits_per_raw_sample = p->storage_bit_res; avctx->bits_per_raw_sample = p->storage_bit_res;

View File

@ -61,6 +61,141 @@
#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions #define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions
#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. #define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
#define AV_PROFILE_UNKNOWN -99
#define AV_PROFILE_RESERVED -100
#define AV_PROFILE_AAC_MAIN 0
#define AV_PROFILE_AAC_LOW 1
#define AV_PROFILE_AAC_SSR 2
#define AV_PROFILE_AAC_LTP 3
#define AV_PROFILE_AAC_HE 4
#define AV_PROFILE_AAC_HE_V2 28
#define AV_PROFILE_AAC_LD 22
#define AV_PROFILE_AAC_ELD 38
#define AV_PROFILE_MPEG2_AAC_LOW 128
#define AV_PROFILE_MPEG2_AAC_HE 131
#define AV_PROFILE_DNXHD 0
#define AV_PROFILE_DNXHR_LB 1
#define AV_PROFILE_DNXHR_SQ 2
#define AV_PROFILE_DNXHR_HQ 3
#define AV_PROFILE_DNXHR_HQX 4
#define AV_PROFILE_DNXHR_444 5
#define AV_PROFILE_DTS 20
#define AV_PROFILE_DTS_ES 30
#define AV_PROFILE_DTS_96_24 40
#define AV_PROFILE_DTS_HD_HRA 50
#define AV_PROFILE_DTS_HD_MA 60
#define AV_PROFILE_DTS_EXPRESS 70
#define AV_PROFILE_DTS_HD_MA_X 61
#define AV_PROFILE_DTS_HD_MA_X_IMAX 62
#define AV_PROFILE_EAC3_DDP_ATMOS 30
#define AV_PROFILE_TRUEHD_ATMOS 30
#define AV_PROFILE_MPEG2_422 0
#define AV_PROFILE_MPEG2_HIGH 1
#define AV_PROFILE_MPEG2_SS 2
#define AV_PROFILE_MPEG2_SNR_SCALABLE 3
#define AV_PROFILE_MPEG2_MAIN 4
#define AV_PROFILE_MPEG2_SIMPLE 5
#define AV_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag
#define AV_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag
#define AV_PROFILE_H264_BASELINE 66
#define AV_PROFILE_H264_CONSTRAINED_BASELINE (66|AV_PROFILE_H264_CONSTRAINED)
#define AV_PROFILE_H264_MAIN 77
#define AV_PROFILE_H264_EXTENDED 88
#define AV_PROFILE_H264_HIGH 100
#define AV_PROFILE_H264_HIGH_10 110
#define AV_PROFILE_H264_HIGH_10_INTRA (110|AV_PROFILE_H264_INTRA)
#define AV_PROFILE_H264_MULTIVIEW_HIGH 118
#define AV_PROFILE_H264_HIGH_422 122
#define AV_PROFILE_H264_HIGH_422_INTRA (122|AV_PROFILE_H264_INTRA)
#define AV_PROFILE_H264_STEREO_HIGH 128
#define AV_PROFILE_H264_HIGH_444 144
#define AV_PROFILE_H264_HIGH_444_PREDICTIVE 244
#define AV_PROFILE_H264_HIGH_444_INTRA (244|AV_PROFILE_H264_INTRA)
#define AV_PROFILE_H264_CAVLC_444 44
#define AV_PROFILE_VC1_SIMPLE 0
#define AV_PROFILE_VC1_MAIN 1
#define AV_PROFILE_VC1_COMPLEX 2
#define AV_PROFILE_VC1_ADVANCED 3
#define AV_PROFILE_MPEG4_SIMPLE 0
#define AV_PROFILE_MPEG4_SIMPLE_SCALABLE 1
#define AV_PROFILE_MPEG4_CORE 2
#define AV_PROFILE_MPEG4_MAIN 3
#define AV_PROFILE_MPEG4_N_BIT 4
#define AV_PROFILE_MPEG4_SCALABLE_TEXTURE 5
#define AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION 6
#define AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE 7
#define AV_PROFILE_MPEG4_HYBRID 8
#define AV_PROFILE_MPEG4_ADVANCED_REAL_TIME 9
#define AV_PROFILE_MPEG4_CORE_SCALABLE 10
#define AV_PROFILE_MPEG4_ADVANCED_CODING 11
#define AV_PROFILE_MPEG4_ADVANCED_CORE 12
#define AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
#define AV_PROFILE_MPEG4_SIMPLE_STUDIO 14
#define AV_PROFILE_MPEG4_ADVANCED_SIMPLE 15
#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0 1
#define AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1 2
#define AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION 32768
#define AV_PROFILE_JPEG2000_DCINEMA_2K 3
#define AV_PROFILE_JPEG2000_DCINEMA_4K 4
#define AV_PROFILE_VP9_0 0
#define AV_PROFILE_VP9_1 1
#define AV_PROFILE_VP9_2 2
#define AV_PROFILE_VP9_3 3
#define AV_PROFILE_HEVC_MAIN 1
#define AV_PROFILE_HEVC_MAIN_10 2
#define AV_PROFILE_HEVC_MAIN_STILL_PICTURE 3
#define AV_PROFILE_HEVC_REXT 4
#define AV_PROFILE_HEVC_SCC 9
#define AV_PROFILE_VVC_MAIN_10 1
#define AV_PROFILE_VVC_MAIN_10_444 33
#define AV_PROFILE_AV1_MAIN 0
#define AV_PROFILE_AV1_HIGH 1
#define AV_PROFILE_AV1_PROFESSIONAL 2
#define AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT 0xc0
#define AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT 0xc1
#define AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT 0xc2
#define AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS 0xc3
#define AV_PROFILE_MJPEG_JPEG_LS 0xf7
#define AV_PROFILE_SBC_MSBC 1
#define AV_PROFILE_PRORES_PROXY 0
#define AV_PROFILE_PRORES_LT 1
#define AV_PROFILE_PRORES_STANDARD 2
#define AV_PROFILE_PRORES_HQ 3
#define AV_PROFILE_PRORES_4444 4
#define AV_PROFILE_PRORES_XQ 5
#define AV_PROFILE_ARIB_PROFILE_A 0
#define AV_PROFILE_ARIB_PROFILE_C 1
#define AV_PROFILE_KLVA_SYNC 0
#define AV_PROFILE_KLVA_ASYNC 1
#define AV_PROFILE_EVC_BASELINE 0
#define AV_PROFILE_EVC_MAIN 1
#define AV_LEVEL_UNKNOWN -99
/** /**
* @ingroup lavc_decoding * @ingroup lavc_decoding
*/ */

View File

@ -22,7 +22,7 @@
#include <stddef.h> #include <stddef.h>
#include "libavutil/log.h" #include "libavutil/log.h"
#include "libavutil/macros.h" #include "libavutil/macros.h"
#include "avcodec.h" #include "defs.h"
#include "dnxhddata.h" #include "dnxhddata.h"
/* The quantization tables below are in zigzag order! */ /* The quantization tables below are in zigzag order! */
@ -1110,15 +1110,15 @@ int ff_dnxhd_get_hr_frame_size(int cid, int w, int h)
static int dnxhd_find_hr_cid(AVCodecContext *avctx) static int dnxhd_find_hr_cid(AVCodecContext *avctx)
{ {
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_DNXHR_444: case AV_PROFILE_DNXHR_444:
return 1270; return 1270;
case FF_PROFILE_DNXHR_HQX: case AV_PROFILE_DNXHR_HQX:
return 1271; return 1271;
case FF_PROFILE_DNXHR_HQ: case AV_PROFILE_DNXHR_HQ:
return 1272; return 1272;
case FF_PROFILE_DNXHR_SQ: case AV_PROFILE_DNXHR_SQ:
return 1273; return 1273;
case FF_PROFILE_DNXHR_LB: case AV_PROFILE_DNXHR_LB:
return 1274; return 1274;
} }
return 0; return 0;
@ -1129,7 +1129,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
int i, j; int i, j;
int mbs = avctx->bit_rate / 1000000; int mbs = avctx->bit_rate / 1000000;
if (avctx->profile != FF_PROFILE_DNXHD) if (avctx->profile != AV_PROFILE_DNXHD)
return dnxhd_find_hr_cid(avctx); return dnxhd_find_hr_cid(avctx);
if (!mbs) if (!mbs)

View File

@ -160,17 +160,17 @@ static int dnxhd_get_profile(int cid)
{ {
switch(cid) { switch(cid) {
case 1270: case 1270:
return FF_PROFILE_DNXHR_444; return AV_PROFILE_DNXHR_444;
case 1271: case 1271:
return FF_PROFILE_DNXHR_HQX; return AV_PROFILE_DNXHR_HQX;
case 1272: case 1272:
return FF_PROFILE_DNXHR_HQ; return AV_PROFILE_DNXHR_HQ;
case 1273: case 1273:
return FF_PROFILE_DNXHR_SQ; return AV_PROFILE_DNXHR_SQ;
case 1274: case 1274:
return FF_PROFILE_DNXHR_LB; return AV_PROFILE_DNXHR_LB;
} }
return FF_PROFILE_DNXHD; return AV_PROFILE_DNXHD;
} }
static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame, static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
@ -262,7 +262,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
ctx->decode_dct_block = dnxhd_decode_dct_block_12; ctx->decode_dct_block = dnxhd_decode_dct_block_12;
ctx->pix_fmt = AV_PIX_FMT_YUV422P12; ctx->pix_fmt = AV_PIX_FMT_YUV422P12;
} else if (bitdepth == 10) { } else if (bitdepth == 10) {
if (ctx->avctx->profile == FF_PROFILE_DNXHR_HQX) if (ctx->avctx->profile == AV_PROFILE_DNXHR_HQX)
ctx->decode_dct_block = dnxhd_decode_dct_block_10_444; ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
else else
ctx->decode_dct_block = dnxhd_decode_dct_block_10; ctx->decode_dct_block = dnxhd_decode_dct_block_10;

View File

@ -54,19 +54,19 @@ static const AVOption options[] = {
offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT, offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT,
{ .i64 = 0 }, INT_MIN, INT_MAX, VE }, { .i64 = 0 }, INT_MIN, INT_MAX, VE },
{ "profile", NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT, { "profile", NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT,
{ .i64 = FF_PROFILE_DNXHD }, { .i64 = AV_PROFILE_DNXHD },
FF_PROFILE_DNXHD, FF_PROFILE_DNXHR_444, VE, "profile" }, AV_PROFILE_DNXHD, AV_PROFILE_DNXHR_444, VE, "profile" },
{ "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHD }, { "dnxhd", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHD },
0, 0, VE, "profile" }, 0, 0, VE, "profile" },
{ "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_444 }, { "dnxhr_444", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_444 },
0, 0, VE, "profile" }, 0, 0, VE, "profile" },
{ "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQX }, { "dnxhr_hqx", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQX },
0, 0, VE, "profile" }, 0, 0, VE, "profile" },
{ "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_HQ }, { "dnxhr_hq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_HQ },
0, 0, VE, "profile" }, 0, 0, VE, "profile" },
{ "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_SQ }, { "dnxhr_sq", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_SQ },
0, 0, VE, "profile" }, 0, 0, VE, "profile" },
{ "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHR_LB }, { "dnxhr_lb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHR_LB },
0, 0, VE, "profile" }, 0, 0, VE, "profile" },
{ NULL } { NULL }
}; };
@ -367,30 +367,30 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
break; break;
} }
if ((ctx->profile == FF_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 && if ((ctx->profile == AV_PROFILE_DNXHR_444 && (avctx->pix_fmt != AV_PIX_FMT_YUV444P10 &&
avctx->pix_fmt != AV_PIX_FMT_GBRP10)) || avctx->pix_fmt != AV_PIX_FMT_GBRP10)) ||
(ctx->profile != FF_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || (ctx->profile != AV_PROFILE_DNXHR_444 && (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 ||
avctx->pix_fmt == AV_PIX_FMT_GBRP10))) { avctx->pix_fmt == AV_PIX_FMT_GBRP10))) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"pixel format is incompatible with DNxHD profile\n"); "pixel format is incompatible with DNxHD profile\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (ctx->profile == FF_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { if (ctx->profile == AV_PROFILE_DNXHR_HQX && avctx->pix_fmt != AV_PIX_FMT_YUV422P10) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"pixel format is incompatible with DNxHR HQX profile\n"); "pixel format is incompatible with DNxHR HQX profile\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if ((ctx->profile == FF_PROFILE_DNXHR_LB || if ((ctx->profile == AV_PROFILE_DNXHR_LB ||
ctx->profile == FF_PROFILE_DNXHR_SQ || ctx->profile == AV_PROFILE_DNXHR_SQ ||
ctx->profile == FF_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) { ctx->profile == AV_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"pixel format is incompatible with DNxHR LB/SQ/HQ profile\n"); "pixel format is incompatible with DNxHR LB/SQ/HQ profile\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
ctx->is_444 = ctx->profile == FF_PROFILE_DNXHR_444; ctx->is_444 = ctx->profile == AV_PROFILE_DNXHR_444;
avctx->profile = ctx->profile; avctx->profile = ctx->profile;
ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth); ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth);
if (!ctx->cid) { if (!ctx->cid) {
@ -426,13 +426,13 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ff_pixblockdsp_init(&ctx->m.pdsp, avctx); ff_pixblockdsp_init(&ctx->m.pdsp, avctx);
ff_dct_encode_init(&ctx->m); ff_dct_encode_init(&ctx->m);
if (ctx->profile != FF_PROFILE_DNXHD) if (ctx->profile != AV_PROFILE_DNXHD)
ff_videodsp_init(&ctx->m.vdsp, ctx->bit_depth); ff_videodsp_init(&ctx->m.vdsp, ctx->bit_depth);
if (!ctx->m.dct_quantize) if (!ctx->m.dct_quantize)
ctx->m.dct_quantize = ff_dct_quantize_c; ctx->m.dct_quantize = ff_dct_quantize_c;
if (ctx->is_444 || ctx->profile == FF_PROFILE_DNXHR_HQX) { if (ctx->is_444 || ctx->profile == AV_PROFILE_DNXHR_HQX) {
ctx->m.dct_quantize = dnxhd_10bit_dct_quantize_444; ctx->m.dct_quantize = dnxhd_10bit_dct_quantize_444;
ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym; ctx->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym;
ctx->block_width_l2 = 4; ctx->block_width_l2 = 4;
@ -457,7 +457,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
ctx->m.mb_height /= 2; ctx->m.mb_height /= 2;
} }
if (ctx->interlaced && ctx->profile != FF_PROFILE_DNXHD) { if (ctx->interlaced && ctx->profile != AV_PROFILE_DNXHD) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"Interlaced encoding is not supported for DNxHR profiles.\n"); "Interlaced encoding is not supported for DNxHR profiles.\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);

View File

@ -53,28 +53,28 @@ DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x
typedef struct dxva_mode { typedef struct dxva_mode {
const GUID *guid; const GUID *guid;
enum AVCodecID codec; enum AVCodecID codec;
// List of supported profiles, terminated by a FF_PROFILE_UNKNOWN entry. // List of supported profiles, terminated by a AV_PROFILE_UNKNOWN entry.
// If NULL, don't check profile. // If NULL, don't check profile.
const int *profiles; const int *profiles;
} dxva_mode; } dxva_mode;
static const int prof_mpeg2_main[] = {FF_PROFILE_MPEG2_SIMPLE, static const int prof_mpeg2_main[] = {AV_PROFILE_MPEG2_SIMPLE,
FF_PROFILE_MPEG2_MAIN, AV_PROFILE_MPEG2_MAIN,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const int prof_h264_high[] = {FF_PROFILE_H264_CONSTRAINED_BASELINE, static const int prof_h264_high[] = {AV_PROFILE_H264_CONSTRAINED_BASELINE,
FF_PROFILE_H264_MAIN, AV_PROFILE_H264_MAIN,
FF_PROFILE_H264_HIGH, AV_PROFILE_H264_HIGH,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const int prof_hevc_main[] = {FF_PROFILE_HEVC_MAIN, static const int prof_hevc_main[] = {AV_PROFILE_HEVC_MAIN,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const int prof_hevc_main10[] = {FF_PROFILE_HEVC_MAIN_10, static const int prof_hevc_main10[] = {AV_PROFILE_HEVC_MAIN_10,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const int prof_vp9_profile0[] = {FF_PROFILE_VP9_0, static const int prof_vp9_profile0[] = {AV_PROFILE_VP9_0,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const int prof_vp9_profile2[] = {FF_PROFILE_VP9_2, static const int prof_vp9_profile2[] = {AV_PROFILE_VP9_2,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const int prof_av1_profile0[] = {FF_PROFILE_AV1_MAIN, static const int prof_av1_profile0[] = {AV_PROFILE_AV1_MAIN,
FF_PROFILE_UNKNOWN}; AV_PROFILE_UNKNOWN};
static const dxva_mode dxva_modes[] = { static const dxva_mode dxva_modes[] = {
/* MPEG-2 */ /* MPEG-2 */
@ -199,7 +199,7 @@ static int dxva_check_codec_compatibility(AVCodecContext *avctx, const dxva_mode
if (mode->profiles && !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) { if (mode->profiles && !(avctx->hwaccel_flags & AV_HWACCEL_FLAG_ALLOW_PROFILE_MISMATCH)) {
int i, found = 0; int i, found = 0;
for (i = 0; mode->profiles[i] != FF_PROFILE_UNKNOWN; i++) { for (i = 0; mode->profiles[i] != AV_PROFILE_UNKNOWN; i++) {
if (avctx->profile == mode->profiles[i]) { if (avctx->profile == mode->profiles[i]) {
found = 1; found = 1;
break; break;

View File

@ -526,22 +526,22 @@ int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
* *
* @param sps SPS * @param sps SPS
* *
* @return profile as defined by FF_PROFILE_H264_* * @return profile as defined by AV_PROFILE_H264_*
*/ */
int ff_h264_get_profile(const SPS *sps) int ff_h264_get_profile(const SPS *sps)
{ {
int profile = sps->profile_idc; int profile = sps->profile_idc;
switch (sps->profile_idc) { switch (sps->profile_idc) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
// constraint_set1_flag set to 1 // constraint_set1_flag set to 1
profile |= (sps->constraint_set_flags & 1 << 1) ? FF_PROFILE_H264_CONSTRAINED : 0; profile |= (sps->constraint_set_flags & 1 << 1) ? AV_PROFILE_H264_CONSTRAINED : 0;
break; break;
case FF_PROFILE_H264_HIGH_10: case AV_PROFILE_H264_HIGH_10:
case FF_PROFILE_H264_HIGH_422: case AV_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_444_PREDICTIVE: case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
// constraint_set3_flag set to 1 // constraint_set3_flag set to 1
profile |= (sps->constraint_set_flags & 1 << 3) ? FF_PROFILE_H264_INTRA : 0; profile |= (sps->constraint_set_flags & 1 << 3) ? AV_PROFILE_H264_INTRA : 0;
break; break;
} }

View File

@ -250,15 +250,15 @@ static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx,
ptl->profile_space = get_bits(gb, 2); ptl->profile_space = get_bits(gb, 2);
ptl->tier_flag = get_bits1(gb); ptl->tier_flag = get_bits1(gb);
ptl->profile_idc = get_bits(gb, 5); ptl->profile_idc = get_bits(gb, 5);
if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN) if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN)
av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n"); av_log(avctx, AV_LOG_DEBUG, "Main profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_10) else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_10)
av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n"); av_log(avctx, AV_LOG_DEBUG, "Main 10 profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_MAIN_STILL_PICTURE) else if (ptl->profile_idc == AV_PROFILE_HEVC_MAIN_STILL_PICTURE)
av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n"); av_log(avctx, AV_LOG_DEBUG, "Main Still Picture profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_REXT) else if (ptl->profile_idc == AV_PROFILE_HEVC_REXT)
av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n"); av_log(avctx, AV_LOG_DEBUG, "Range Extension profile bitstream\n");
else if (ptl->profile_idc == FF_PROFILE_HEVC_SCC) else if (ptl->profile_idc == AV_PROFILE_HEVC_SCC)
av_log(avctx, AV_LOG_DEBUG, "Screen Content Coding Extension profile bitstream\n"); av_log(avctx, AV_LOG_DEBUG, "Screen Content Coding Extension profile bitstream\n");
else else
av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc); av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
@ -1968,7 +1968,7 @@ int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx,
pps->pps_scc_extension_flag = get_bits1(gb); pps->pps_scc_extension_flag = get_bits1(gb);
skip_bits(gb, 4); // pps_extension_4bits skip_bits(gb, 4); // pps_extension_4bits
if (sps->ptl.general_ptl.profile_idc >= FF_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) { if (sps->ptl.general_ptl.profile_idc >= AV_PROFILE_HEVC_REXT && pps->pps_range_extensions_flag) {
if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0) if ((ret = pps_range_extensions(gb, avctx, pps, sps)) < 0)
goto err; goto err;
} }

View File

@ -3082,7 +3082,7 @@ static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
if (ret < 0) if (ret < 0)
goto fail; goto fail;
} else { } else {
if (s->avctx->profile == FF_PROFILE_HEVC_SCC) { if (s->avctx->profile == AV_PROFILE_HEVC_SCC) {
av_log(s->avctx, AV_LOG_ERROR, av_log(s->avctx, AV_LOG_ERROR,
"SCC profile is not yet implemented in hevc native decoder.\n"); "SCC profile is not yet implemented in hevc native decoder.\n");
ret = AVERROR_PATCHWELCOME; ret = AVERROR_PATCHWELCOME;

View File

@ -312,8 +312,8 @@ static int get_siz(Jpeg2000DecoderContext *s)
if (ret < 0) if (ret < 0)
return ret; return ret;
if (s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_2K || if (s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_2K ||
s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_4K) { s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_4K) {
possible_fmts = xyz_pix_fmts; possible_fmts = xyz_pix_fmts;
possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts); possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts);
} else { } else {

View File

@ -78,17 +78,17 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if (img->bit_depth == 8) { if (img->bit_depth == 8) {
avctx->pix_fmt = img->monochrome ? avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P; AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P;
avctx->profile = FF_PROFILE_AV1_MAIN; avctx->profile = AV_PROFILE_AV1_MAIN;
return 0; return 0;
} else if (img->bit_depth == 10) { } else if (img->bit_depth == 10) {
avctx->pix_fmt = img->monochrome ? avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10; AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10;
avctx->profile = FF_PROFILE_AV1_MAIN; avctx->profile = AV_PROFILE_AV1_MAIN;
return 0; return 0;
} else if (img->bit_depth == 12) { } else if (img->bit_depth == 12) {
avctx->pix_fmt = img->monochrome ? avctx->pix_fmt = img->monochrome ?
AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12; AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0; return 0;
} else { } else {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
@ -97,15 +97,15 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
case AOM_IMG_FMT_I42216: case AOM_IMG_FMT_I42216:
if (img->bit_depth == 8) { if (img->bit_depth == 8) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P; avctx->pix_fmt = AV_PIX_FMT_YUV422P;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0; return 0;
} else if (img->bit_depth == 10) { } else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10; avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0; return 0;
} else if (img->bit_depth == 12) { } else if (img->bit_depth == 12) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P12; avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0; return 0;
} else { } else {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
@ -115,18 +115,18 @@ static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
if (img->bit_depth == 8) { if (img->bit_depth == 8) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
avctx->profile = FF_PROFILE_AV1_HIGH; avctx->profile = AV_PROFILE_AV1_HIGH;
return 0; return 0;
} else if (img->bit_depth == 10) { } else if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV444P10; avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
avctx->profile = FF_PROFILE_AV1_HIGH; avctx->profile = AV_PROFILE_AV1_HIGH;
return 0; return 0;
} else if (img->bit_depth == 12) { } else if (img->bit_depth == 12) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12; AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12;
avctx->profile = FF_PROFILE_AV1_PROFESSIONAL; avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
return 0; return 0;
} else { } else {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;

View File

@ -451,16 +451,16 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
enccfg->monochrome = 1; enccfg->monochrome = 1;
/* Fall-through */ /* Fall-through */
case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
enccfg->g_profile = FF_PROFILE_AV1_MAIN; enccfg->g_profile = AV_PROFILE_AV1_MAIN;
*img_fmt = AOM_IMG_FMT_I420; *img_fmt = AOM_IMG_FMT_I420;
return 0; return 0;
case AV_PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I422; *img_fmt = AOM_IMG_FMT_I422;
return 0; return 0;
case AV_PIX_FMT_YUV444P: case AV_PIX_FMT_YUV444P:
case AV_PIX_FMT_GBRP: case AV_PIX_FMT_GBRP:
enccfg->g_profile = FF_PROFILE_AV1_HIGH; enccfg->g_profile = AV_PROFILE_AV1_HIGH;
*img_fmt = AOM_IMG_FMT_I444; *img_fmt = AOM_IMG_FMT_I444;
return 0; return 0;
case AV_PIX_FMT_GRAY10: case AV_PIX_FMT_GRAY10:
@ -471,7 +471,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
case AV_PIX_FMT_YUV420P12: case AV_PIX_FMT_YUV420P12:
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
enccfg->g_profile = enccfg->g_profile =
enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_MAIN : FF_PROFILE_AV1_PROFESSIONAL; enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_MAIN : AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I42016; *img_fmt = AOM_IMG_FMT_I42016;
*flags |= AOM_CODEC_USE_HIGHBITDEPTH; *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
return 0; return 0;
@ -480,7 +480,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
case AV_PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P10:
case AV_PIX_FMT_YUV422P12: case AV_PIX_FMT_YUV422P12:
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
enccfg->g_profile = FF_PROFILE_AV1_PROFESSIONAL; enccfg->g_profile = AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I42216; *img_fmt = AOM_IMG_FMT_I42216;
*flags |= AOM_CODEC_USE_HIGHBITDEPTH; *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
return 0; return 0;
@ -492,7 +492,7 @@ static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
case AV_PIX_FMT_GBRP12: case AV_PIX_FMT_GBRP12:
if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) { if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
enccfg->g_profile = enccfg->g_profile =
enccfg->g_bit_depth == 10 ? FF_PROFILE_AV1_HIGH : FF_PROFILE_AV1_PROFESSIONAL; enccfg->g_bit_depth == 10 ? AV_PROFILE_AV1_HIGH : AV_PROFILE_AV1_PROFESSIONAL;
*img_fmt = AOM_IMG_FMT_I44416; *img_fmt = AOM_IMG_FMT_I44416;
*flags |= AOM_CODEC_USE_HIGHBITDEPTH; *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
return 0; return 0;
@ -842,7 +842,7 @@ static av_cold int aom_init(AVCodecContext *avctx,
/* 0-3: For non-zero values the encoder increasingly optimizes for reduced /* 0-3: For non-zero values the encoder increasingly optimizes for reduced
* complexity playback on low powered devices at the expense of encode * complexity playback on low powered devices at the expense of encode
* quality. */ * quality. */
if (avctx->profile != FF_PROFILE_UNKNOWN) if (avctx->profile != AV_PROFILE_UNKNOWN)
enccfg.g_profile = avctx->profile; enccfg.g_profile = avctx->profile;
enccfg.g_error_resilient = ctx->error_resilient; enccfg.g_error_resilient = ctx->error_resilient;

View File

@ -49,13 +49,13 @@ static unsigned int get_profile_font_size(AVCodecContext *avctx)
Libaribb24Context *b24 = avctx->priv_data; Libaribb24Context *b24 = avctx->priv_data;
int profile = avctx->profile; int profile = avctx->profile;
if (profile == FF_PROFILE_UNKNOWN) if (profile == AV_PROFILE_UNKNOWN)
profile = b24->default_profile; profile = b24->default_profile;
switch (profile) { switch (profile) {
case FF_PROFILE_ARIB_PROFILE_A: case AV_PROFILE_ARIB_PROFILE_A:
return 36; return 36;
case FF_PROFILE_ARIB_PROFILE_C: case AV_PROFILE_ARIB_PROFILE_C:
return 18; return 18;
default: default:
return 0; return 0;
@ -75,15 +75,15 @@ static int libaribb24_generate_ass_header(AVCodecContext *avctx)
unsigned int font_size = 0; unsigned int font_size = 0;
int profile = avctx->profile; int profile = avctx->profile;
if (profile == FF_PROFILE_UNKNOWN) if (profile == AV_PROFILE_UNKNOWN)
profile = b24->default_profile; profile = b24->default_profile;
switch (profile) { switch (profile) {
case FF_PROFILE_ARIB_PROFILE_A: case AV_PROFILE_ARIB_PROFILE_A:
plane_width = 960; plane_width = 960;
plane_height = 540; plane_height = 540;
break; break;
case FF_PROFILE_ARIB_PROFILE_C: case AV_PROFILE_ARIB_PROFILE_C:
plane_width = 320; plane_width = 320;
plane_height = 180; plane_height = 180;
break; break;
@ -172,14 +172,14 @@ static int libaribb24_init(AVCodecContext *avctx)
goto init_fail; goto init_fail;
} }
if (profile == FF_PROFILE_UNKNOWN) if (profile == AV_PROFILE_UNKNOWN)
profile = b24->default_profile; profile = b24->default_profile;
switch (profile) { switch (profile) {
case FF_PROFILE_ARIB_PROFILE_A: case AV_PROFILE_ARIB_PROFILE_A:
arib_dec_init = arib_initialize_decoder_a_profile; arib_dec_init = arib_initialize_decoder_a_profile;
break; break;
case FF_PROFILE_ARIB_PROFILE_C: case AV_PROFILE_ARIB_PROFILE_C:
arib_dec_init = arib_initialize_decoder_c_profile; arib_dec_init = arib_initialize_decoder_c_profile;
break; break;
default: default:
@ -390,9 +390,9 @@ static const AVOption options[] = {
{ "aribb24-skip-ruby-text", "skip ruby text blocks during decoding", { "aribb24-skip-ruby-text", "skip ruby text blocks during decoding",
OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD }, OFFSET(aribb24_skip_ruby), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, SD },
{ "default_profile", "default profile to use if not specified in the stream parameters", { "default_profile", "default profile to use if not specified in the stream parameters",
OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_ARIB_PROFILE_C, SD, "profile" }, OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_ARIB_PROFILE_C, SD, "profile" },
{"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"}, {"a", "Profile A", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_A}, INT_MIN, INT_MAX, SD, "profile"},
{"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"}, {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, SD, "profile"},
{ NULL } { NULL }
}; };

View File

@ -452,7 +452,7 @@ static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx)
goto fail; goto fail;
} }
if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) { if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C) {
/* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */
/* No position information is provided for profile C */ /* No position information is provided for profile C */
rect->x = (ctx->frame_width - rect->w) / 2; rect->x = (ctx->frame_width - rect->w) / 2;
@ -594,7 +594,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
/* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */ /* ARIB TR-B14 version 3.8 Fascicle 1-(2/2) Volume 3 [Section 4] */
/* No position information is provided for profile C */ /* No position information is provided for profile C */
if (ctx->avctx->profile == FF_PROFILE_ARIB_PROFILE_C) if (ctx->avctx->profile == AV_PROFILE_ARIB_PROFILE_C)
single_rect = true; single_rect = true;
sub->format = 1; /* text */ sub->format = 1; /* text */
@ -606,7 +606,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
av_bprint_init(&buf, ARIBC_BPRINT_SIZE_INIT, ARIBC_BPRINT_SIZE_MAX); av_bprint_init(&buf, ARIBC_BPRINT_SIZE_INIT, ARIBC_BPRINT_SIZE_MAX);
if (single_rect && ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { if (single_rect && ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) {
int x, y, rx, ry; int x, y, rx, ry;
x = ctx->plane_width; x = ctx->plane_width;
y = ctx->plane_height; y = ctx->plane_height;
@ -660,7 +660,7 @@ static int aribcaption_trans_ass_subtitle(ARIBCaptionContext *ctx)
for (int j = 0; j < region->char_count; j++) { for (int j = 0; j < region->char_count; j++) {
aribcc_caption_char_t *ch = &region->chars[j]; aribcc_caption_char_t *ch = &region->chars[j];
if (ctx->avctx->profile != FF_PROFILE_ARIB_PROFILE_C) { if (ctx->avctx->profile != AV_PROFILE_ARIB_PROFILE_C) {
if (ch->char_horizontal_spacing != char_horizontal_spacing) { if (ch->char_horizontal_spacing != char_horizontal_spacing) {
av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ? av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ?
ch->char_horizontal_spacing / 2 : ch->char_horizontal_spacing / 2 :
@ -960,14 +960,14 @@ static int aribcaption_init(AVCodecContext *avctx)
ctx->avctx = avctx; ctx->avctx = avctx;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_ARIB_PROFILE_A: case AV_PROFILE_ARIB_PROFILE_A:
profile = ARIBCC_PROFILE_A; profile = ARIBCC_PROFILE_A;
/* assume 960x540 at initial state */ /* assume 960x540 at initial state */
ctx->plane_width = 960; ctx->plane_width = 960;
ctx->plane_height = 540; ctx->plane_height = 540;
ctx->font_size = 36; ctx->font_size = 36;
break; break;
case FF_PROFILE_ARIB_PROFILE_C: case AV_PROFILE_ARIB_PROFILE_C:
profile = ARIBCC_PROFILE_C; profile = ARIBCC_PROFILE_C;
ctx->plane_width = 320; ctx->plane_width = 320;
ctx->plane_height = 180; ctx->plane_height = 180;

View File

@ -179,7 +179,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
AACENC_InfoStruct info = { 0 }; AACENC_InfoStruct info = { 0 };
CHANNEL_MODE mode; CHANNEL_MODE mode;
AACENC_ERROR err; AACENC_ERROR err;
int aot = FF_PROFILE_AAC_LOW + 1; int aot = AV_PROFILE_AAC_LOW + 1;
int sce = 0, cpe = 0; int sce = 0, cpe = 0;
if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) { if ((err = aacEncOpen(&s->handle, 0, avctx->ch_layout.nb_channels)) != AACENC_OK) {
@ -188,7 +188,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto error; goto error;
} }
if (avctx->profile != FF_PROFILE_UNKNOWN) if (avctx->profile != AV_PROFILE_UNKNOWN)
aot = avctx->profile + 1; aot = avctx->profile + 1;
if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) { if ((err = aacEncoder_SetParam(s->handle, AACENC_AOT, aot)) != AACENC_OK) {
@ -197,7 +197,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto error; goto error;
} }
if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_sbr) { if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_sbr) {
if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE, if ((err = aacEncoder_SetParam(s->handle, AACENC_SBR_MODE,
1)) != AACENC_OK) { 1)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n", av_log(avctx, AV_LOG_ERROR, "Unable to enable SBR for ELD: %s\n",
@ -227,7 +227,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
case 2: case 2:
#if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0 #if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
// (profile + 1) to map from profile range to AOT range // (profile + 1) to map from profile range to AOT range
if (aot == FF_PROFILE_AAC_ELD + 1 && s->eld_v2) { if (aot == AV_PROFILE_AAC_ELD + 1 && s->eld_v2) {
if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE, if ((err = aacEncoder_SetParam(s->handle, AACENC_CHANNELMODE,
128)) != AACENC_OK) { 128)) != AACENC_OK) {
av_log(avctx, AV_LOG_ERROR, "Unable to enable ELDv2: %s\n", av_log(avctx, AV_LOG_ERROR, "Unable to enable ELDv2: %s\n",
@ -310,14 +310,14 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
} }
} else { } else {
if (avctx->bit_rate <= 0) { if (avctx->bit_rate <= 0) {
if (avctx->profile == FF_PROFILE_AAC_HE_V2) { if (avctx->profile == AV_PROFILE_AAC_HE_V2) {
sce = 1; sce = 1;
cpe = 0; cpe = 0;
} }
avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44; avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44;
if (avctx->profile == FF_PROFILE_AAC_HE || if (avctx->profile == AV_PROFILE_AAC_HE ||
avctx->profile == FF_PROFILE_AAC_HE_V2 || avctx->profile == AV_PROFILE_AAC_HE_V2 ||
avctx->profile == FF_PROFILE_MPEG2_AAC_HE || avctx->profile == AV_PROFILE_MPEG2_AAC_HE ||
s->eld_sbr) s->eld_sbr)
avctx->bit_rate /= 2; avctx->bit_rate /= 2;
} }
@ -544,12 +544,12 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
} }
static const AVProfile profiles[] = { static const AVProfile profiles[] = {
{ FF_PROFILE_AAC_LOW, "LC" }, { AV_PROFILE_AAC_LOW, "LC" },
{ FF_PROFILE_AAC_HE, "HE-AAC" }, { AV_PROFILE_AAC_HE, "HE-AAC" },
{ FF_PROFILE_AAC_HE_V2, "HE-AACv2" }, { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
{ FF_PROFILE_AAC_LD, "LD" }, { AV_PROFILE_AAC_LD, "LD" },
{ FF_PROFILE_AAC_ELD, "ELD" }, { AV_PROFILE_AAC_ELD, "ELD" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
static const FFCodecDefault aac_encode_defaults[] = { static const FFCodecDefault aac_encode_defaults[] = {

View File

@ -61,11 +61,11 @@ typedef struct SVCContext {
#define DEPRECATED AV_OPT_FLAG_DEPRECATED #define DEPRECATED AV_OPT_FLAG_DEPRECATED
static const AVOption options[] = { static const AVOption options[] = {
{ "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE }, { "loopfilter", "enable loop filter", OFFSET(loopfilter), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
{ "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, VE, "profile" }, { "profile", "set profile restrictions", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, VE, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile" #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, { .i64 = value }, 0, 0, VE, "profile"
{ PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
{ PROFILE("main", FF_PROFILE_H264_MAIN) }, { PROFILE("main", AV_PROFILE_H264_MAIN) },
{ PROFILE("high", FF_PROFILE_H264_HIGH) }, { PROFILE("high", AV_PROFILE_H264_HIGH) },
#undef PROFILE #undef PROFILE
{ "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE }, { "max_nal_size", "set maximum NAL size in bytes", OFFSET(max_nal_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE }, { "allow_skip_frames", "allow skipping frames to hit the target bitrate", OFFSET(skip_frames), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
@ -177,12 +177,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
param.iMultipleThreadIdc = avctx->thread_count; param.iMultipleThreadIdc = avctx->thread_count;
/* Allow specifying the libopenh264 profile through AVCodecContext. */ /* Allow specifying the libopenh264 profile through AVCodecContext. */
if (FF_PROFILE_UNKNOWN == s->profile && if (AV_PROFILE_UNKNOWN == s->profile &&
FF_PROFILE_UNKNOWN != avctx->profile) AV_PROFILE_UNKNOWN != avctx->profile)
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case AV_PROFILE_H264_CONSTRAINED_BASELINE:
s->profile = avctx->profile; s->profile = avctx->profile;
break; break;
default: default:
@ -191,34 +191,34 @@ FF_ENABLE_DEPRECATION_WARNINGS
break; break;
} }
if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0) if (s->profile == AV_PROFILE_UNKNOWN && s->coder >= 0)
s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : s->profile = s->coder == 0 ? AV_PROFILE_H264_CONSTRAINED_BASELINE :
#if OPENH264_VER_AT_LEAST(1, 8) #if OPENH264_VER_AT_LEAST(1, 8)
FF_PROFILE_H264_HIGH; AV_PROFILE_H264_HIGH;
#else #else
FF_PROFILE_H264_MAIN; AV_PROFILE_H264_MAIN;
#endif #endif
switch (s->profile) { switch (s->profile) {
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
av_log(avctx, AV_LOG_VERBOSE, "Using %s, " av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
"select EProfileIdc PRO_HIGH in libopenh264.\n", "select EProfileIdc PRO_HIGH in libopenh264.\n",
param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
break; break;
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
av_log(avctx, AV_LOG_VERBOSE, "Using %s, " av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
"select EProfileIdc PRO_MAIN in libopenh264.\n", "select EProfileIdc PRO_MAIN in libopenh264.\n",
param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC"); param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
break; break;
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case AV_PROFILE_H264_CONSTRAINED_BASELINE:
case FF_PROFILE_UNKNOWN: case AV_PROFILE_UNKNOWN:
s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
param.iEntropyCodingModeFlag = 0; param.iEntropyCodingModeFlag = 0;
av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, " av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, "
"select EProfileIdc PRO_BASELINE in libopenh264.\n"); "select EProfileIdc PRO_BASELINE in libopenh264.\n");
break; break;
default: default:
s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
param.iEntropyCodingModeFlag = 0; param.iEntropyCodingModeFlag = 0;
av_log(avctx, AV_LOG_WARNING, "Unsupported profile, " av_log(avctx, AV_LOG_WARNING, "Unsupported profile, "
"select EProfileIdc PRO_BASELINE in libopenh264.\n"); "select EProfileIdc PRO_BASELINE in libopenh264.\n");

View File

@ -236,10 +236,10 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
} }
#endif #endif
if (avctx->profile != FF_PROFILE_UNKNOWN) if (avctx->profile != AV_PROFILE_UNKNOWN)
param->profile = avctx->profile; param->profile = avctx->profile;
if (avctx->level != FF_LEVEL_UNKNOWN) if (avctx->level != AV_LEVEL_UNKNOWN)
param->level = avctx->level; param->level = avctx->level;
// gop_size == 1 case is handled when encoding each frame by setting // gop_size == 1 case is handled when encoding each frame by setting
@ -310,12 +310,12 @@ FF_ENABLE_DEPRECATION_WARNINGS
} }
if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10) if ((param->encoder_color_format == EB_YUV422 || param->encoder_bit_depth > 10)
&& param->profile != FF_PROFILE_AV1_PROFESSIONAL ) { && param->profile != AV_PROFILE_AV1_PROFESSIONAL ) {
av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n"); av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n");
param->profile = FF_PROFILE_AV1_PROFESSIONAL; param->profile = AV_PROFILE_AV1_PROFESSIONAL;
} else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) { } else if (param->encoder_color_format == EB_YUV444 && param->profile != AV_PROFILE_AV1_HIGH) {
av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n"); av_log(avctx, AV_LOG_WARNING, "Forcing High profile\n");
param->profile = FF_PROFILE_AV1_HIGH; param->profile = AV_PROFILE_AV1_HIGH;
} }
avctx->bit_rate = param->rate_control_mode > 0 ? avctx->bit_rate = param->rate_control_mode > 0 ?

View File

@ -127,26 +127,26 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
switch (img->fmt) { switch (img->fmt) {
case VPX_IMG_FMT_I420: case VPX_IMG_FMT_I420:
if (avctx->codec_id == AV_CODEC_ID_VP9) if (avctx->codec_id == AV_CODEC_ID_VP9)
avctx->profile = FF_PROFILE_VP9_0; avctx->profile = AV_PROFILE_VP9_0;
avctx->pix_fmt = avctx->pix_fmt =
has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
return 0; return 0;
#if CONFIG_LIBVPX_VP9_DECODER #if CONFIG_LIBVPX_VP9_DECODER
case VPX_IMG_FMT_I422: case VPX_IMG_FMT_I422:
avctx->profile = FF_PROFILE_VP9_1; avctx->profile = AV_PROFILE_VP9_1;
avctx->pix_fmt = AV_PIX_FMT_YUV422P; avctx->pix_fmt = AV_PIX_FMT_YUV422P;
return 0; return 0;
case VPX_IMG_FMT_I440: case VPX_IMG_FMT_I440:
avctx->profile = FF_PROFILE_VP9_1; avctx->profile = AV_PROFILE_VP9_1;
avctx->pix_fmt = AV_PIX_FMT_YUV440P; avctx->pix_fmt = AV_PIX_FMT_YUV440P;
return 0; return 0;
case VPX_IMG_FMT_I444: case VPX_IMG_FMT_I444:
avctx->profile = FF_PROFILE_VP9_1; avctx->profile = AV_PROFILE_VP9_1;
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P; AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
return 0; return 0;
case VPX_IMG_FMT_I42016: case VPX_IMG_FMT_I42016:
avctx->profile = FF_PROFILE_VP9_2; avctx->profile = AV_PROFILE_VP9_2;
if (img->bit_depth == 10) { if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV420P10; avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
return 0; return 0;
@ -157,7 +157,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
case VPX_IMG_FMT_I42216: case VPX_IMG_FMT_I42216:
avctx->profile = FF_PROFILE_VP9_3; avctx->profile = AV_PROFILE_VP9_3;
if (img->bit_depth == 10) { if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV422P10; avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
return 0; return 0;
@ -168,7 +168,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
case VPX_IMG_FMT_I44016: case VPX_IMG_FMT_I44016:
avctx->profile = FF_PROFILE_VP9_3; avctx->profile = AV_PROFILE_VP9_3;
if (img->bit_depth == 10) { if (img->bit_depth == 10) {
avctx->pix_fmt = AV_PIX_FMT_YUV440P10; avctx->pix_fmt = AV_PIX_FMT_YUV440P10;
return 0; return 0;
@ -179,7 +179,7 @@ static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
case VPX_IMG_FMT_I44416: case VPX_IMG_FMT_I44416:
avctx->profile = FF_PROFILE_VP9_3; avctx->profile = AV_PROFILE_VP9_3;
if (img->bit_depth == 10) { if (img->bit_depth == 10) {
avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ? avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10; AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;

View File

@ -1145,7 +1145,7 @@ static av_cold int vpx_init(AVCodecContext *avctx,
/* 0-3: For non-zero values the encoder increasingly optimizes for reduced /* 0-3: For non-zero values the encoder increasingly optimizes for reduced
complexity playback on low powered devices at the expense of encode complexity playback on low powered devices at the expense of encode
quality. */ quality. */
if (avctx->profile != FF_PROFILE_UNKNOWN) if (avctx->profile != AV_PROFILE_UNKNOWN)
enccfg.g_profile = avctx->profile; enccfg.g_profile = avctx->profile;
enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT; enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT;

View File

@ -1048,22 +1048,22 @@ static av_cold int X264_init(AVCodecContext *avctx)
/* Allow specifying the x264 profile through AVCodecContext. */ /* Allow specifying the x264 profile through AVCodecContext. */
if (!x4->profile) if (!x4->profile)
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
x4->profile = "baseline"; x4->profile = "baseline";
break; break;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
x4->profile = "high"; x4->profile = "high";
break; break;
case FF_PROFILE_H264_HIGH_10: case AV_PROFILE_H264_HIGH_10:
x4->profile = "high10"; x4->profile = "high10";
break; break;
case FF_PROFILE_H264_HIGH_422: case AV_PROFILE_H264_HIGH_422:
x4->profile = "high422"; x4->profile = "high422";
break; break;
case FF_PROFILE_H264_HIGH_444: case AV_PROFILE_H264_HIGH_444:
x4->profile = "high444"; x4->profile = "high444";
break; break;
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
x4->profile = "main"; x4->profile = "main";
break; break;
default: default:

View File

@ -365,82 +365,82 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx)
if (avctx->codec_id == AV_CODEC_ID_H264) { if (avctx->codec_id == AV_CODEC_ID_H264) {
switch(avctx->profile) { switch(avctx->profile) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
return AVCProfileBaseline; return AVCProfileBaseline;
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case AV_PROFILE_H264_CONSTRAINED_BASELINE:
return AVCProfileConstrainedBaseline; return AVCProfileConstrainedBaseline;
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
return AVCProfileMain; return AVCProfileMain;
break; break;
case FF_PROFILE_H264_EXTENDED: case AV_PROFILE_H264_EXTENDED:
return AVCProfileExtended; return AVCProfileExtended;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
return AVCProfileHigh; return AVCProfileHigh;
case FF_PROFILE_H264_HIGH_10: case AV_PROFILE_H264_HIGH_10:
case FF_PROFILE_H264_HIGH_10_INTRA: case AV_PROFILE_H264_HIGH_10_INTRA:
return AVCProfileHigh10; return AVCProfileHigh10;
case FF_PROFILE_H264_HIGH_422: case AV_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_422_INTRA: case AV_PROFILE_H264_HIGH_422_INTRA:
return AVCProfileHigh422; return AVCProfileHigh422;
case FF_PROFILE_H264_HIGH_444: case AV_PROFILE_H264_HIGH_444:
case FF_PROFILE_H264_HIGH_444_INTRA: case AV_PROFILE_H264_HIGH_444_INTRA:
case FF_PROFILE_H264_HIGH_444_PREDICTIVE: case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
return AVCProfileHigh444; return AVCProfileHigh444;
} }
} else if (avctx->codec_id == AV_CODEC_ID_HEVC) { } else if (avctx->codec_id == AV_CODEC_ID_HEVC) {
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_HEVC_MAIN: case AV_PROFILE_HEVC_MAIN:
return HEVCProfileMain; return HEVCProfileMain;
case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: case AV_PROFILE_HEVC_MAIN_STILL_PICTURE:
return HEVCProfileMainStill; return HEVCProfileMainStill;
case FF_PROFILE_HEVC_MAIN_10: case AV_PROFILE_HEVC_MAIN_10:
return HEVCProfileMain10; return HEVCProfileMain10;
} }
} else if (avctx->codec_id == AV_CODEC_ID_VP9) { } else if (avctx->codec_id == AV_CODEC_ID_VP9) {
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_VP9_0: case AV_PROFILE_VP9_0:
return VP9Profile0; return VP9Profile0;
case FF_PROFILE_VP9_1: case AV_PROFILE_VP9_1:
return VP9Profile1; return VP9Profile1;
case FF_PROFILE_VP9_2: case AV_PROFILE_VP9_2:
return VP9Profile2; return VP9Profile2;
case FF_PROFILE_VP9_3: case AV_PROFILE_VP9_3:
return VP9Profile3; return VP9Profile3;
} }
} else if(avctx->codec_id == AV_CODEC_ID_MPEG4) { } else if(avctx->codec_id == AV_CODEC_ID_MPEG4) {
switch (avctx->profile) switch (avctx->profile)
{ {
case FF_PROFILE_MPEG4_SIMPLE: case AV_PROFILE_MPEG4_SIMPLE:
return MPEG4ProfileSimple; return MPEG4ProfileSimple;
case FF_PROFILE_MPEG4_SIMPLE_SCALABLE: case AV_PROFILE_MPEG4_SIMPLE_SCALABLE:
return MPEG4ProfileSimpleScalable; return MPEG4ProfileSimpleScalable;
case FF_PROFILE_MPEG4_CORE: case AV_PROFILE_MPEG4_CORE:
return MPEG4ProfileCore; return MPEG4ProfileCore;
case FF_PROFILE_MPEG4_MAIN: case AV_PROFILE_MPEG4_MAIN:
return MPEG4ProfileMain; return MPEG4ProfileMain;
case FF_PROFILE_MPEG4_N_BIT: case AV_PROFILE_MPEG4_N_BIT:
return MPEG4ProfileNbit; return MPEG4ProfileNbit;
case FF_PROFILE_MPEG4_SCALABLE_TEXTURE: case AV_PROFILE_MPEG4_SCALABLE_TEXTURE:
return MPEG4ProfileScalableTexture; return MPEG4ProfileScalableTexture;
case FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION: case AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION:
return MPEG4ProfileSimpleFBA; return MPEG4ProfileSimpleFBA;
case FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE: case AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE:
return MPEG4ProfileBasicAnimated; return MPEG4ProfileBasicAnimated;
case FF_PROFILE_MPEG4_HYBRID: case AV_PROFILE_MPEG4_HYBRID:
return MPEG4ProfileHybrid; return MPEG4ProfileHybrid;
case FF_PROFILE_MPEG4_ADVANCED_REAL_TIME: case AV_PROFILE_MPEG4_ADVANCED_REAL_TIME:
return MPEG4ProfileAdvancedRealTime; return MPEG4ProfileAdvancedRealTime;
case FF_PROFILE_MPEG4_CORE_SCALABLE: case AV_PROFILE_MPEG4_CORE_SCALABLE:
return MPEG4ProfileCoreScalable; return MPEG4ProfileCoreScalable;
case FF_PROFILE_MPEG4_ADVANCED_CODING: case AV_PROFILE_MPEG4_ADVANCED_CODING:
return MPEG4ProfileAdvancedCoding; return MPEG4ProfileAdvancedCoding;
case FF_PROFILE_MPEG4_ADVANCED_CORE: case AV_PROFILE_MPEG4_ADVANCED_CORE:
return MPEG4ProfileAdvancedCore; return MPEG4ProfileAdvancedCore;
case FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE: case AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE:
return MPEG4ProfileAdvancedScalable; return MPEG4ProfileAdvancedScalable;
case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: case AV_PROFILE_MPEG4_ADVANCED_SIMPLE:
return MPEG4ProfileAdvancedSimple; return MPEG4ProfileAdvancedSimple;
case FF_PROFILE_MPEG4_SIMPLE_STUDIO: case AV_PROFILE_MPEG4_SIMPLE_STUDIO:
// Studio profiles are not supported by mediacodec. // Studio profiles are not supported by mediacodec.
default: default:
break; break;
@ -448,10 +448,10 @@ int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx)
} else if(avctx->codec_id == AV_CODEC_ID_AV1) { } else if(avctx->codec_id == AV_CODEC_ID_AV1) {
switch (avctx->profile) switch (avctx->profile)
{ {
case FF_PROFILE_AV1_MAIN: case AV_PROFILE_AV1_MAIN:
return AV1ProfileMain8; return AV1ProfileMain8;
case FF_PROFILE_AV1_HIGH: case AV_PROFILE_AV1_HIGH:
case FF_PROFILE_AV1_PROFESSIONAL: case AV_PROFILE_AV1_PROFESSIONAL:
default: default:
break; break;
} }

View File

@ -660,14 +660,14 @@ enum MediaCodecAvcLevel {
static const AVOption h264_options[] = { static const AVOption h264_options[] = {
COMMON_OPTION COMMON_OPTION
FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, FF_PROFILE_H264_BASELINE) FF_AVCTX_PROFILE_OPTION("baseline", NULL, VIDEO, AV_PROFILE_H264_BASELINE)
FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE) FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, AV_PROFILE_H264_CONSTRAINED_BASELINE)
FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_H264_MAIN) FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_H264_MAIN)
FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, FF_PROFILE_H264_EXTENDED) FF_AVCTX_PROFILE_OPTION("extended", NULL, VIDEO, AV_PROFILE_H264_EXTENDED)
FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_H264_HIGH) FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_H264_HIGH)
FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, FF_PROFILE_H264_HIGH_10) FF_AVCTX_PROFILE_OPTION("high10", NULL, VIDEO, AV_PROFILE_H264_HIGH_10)
FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, FF_PROFILE_H264_HIGH_422) FF_AVCTX_PROFILE_OPTION("high422", NULL, VIDEO, AV_PROFILE_H264_HIGH_422)
FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, FF_PROFILE_H264_HIGH_444) FF_AVCTX_PROFILE_OPTION("high444", NULL, VIDEO, AV_PROFILE_H264_HIGH_444)
{ "level", "Specify level", { "level", "Specify level",
OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
@ -732,8 +732,8 @@ enum MediaCodecHevcLevel {
static const AVOption hevc_options[] = { static const AVOption hevc_options[] = {
COMMON_OPTION COMMON_OPTION
FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_HEVC_MAIN) FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_HEVC_MAIN)
FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10) FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, AV_PROFILE_HEVC_MAIN_10)
{ "level", "Specify tier and level", { "level", "Specify tier and level",
OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
@ -846,10 +846,10 @@ enum MediaCodecVP9Level {
static const AVOption vp9_options[] = { static const AVOption vp9_options[] = {
COMMON_OPTION COMMON_OPTION
FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, FF_PROFILE_VP9_0) FF_AVCTX_PROFILE_OPTION("profile0", NULL, VIDEO, AV_PROFILE_VP9_0)
FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, FF_PROFILE_VP9_1) FF_AVCTX_PROFILE_OPTION("profile1", NULL, VIDEO, AV_PROFILE_VP9_1)
FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, FF_PROFILE_VP9_2) FF_AVCTX_PROFILE_OPTION("profile2", NULL, VIDEO, AV_PROFILE_VP9_2)
FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, FF_PROFILE_VP9_3) FF_AVCTX_PROFILE_OPTION("profile3", NULL, VIDEO, AV_PROFILE_VP9_3)
{ "level", "Specify tier and level", { "level", "Specify tier and level",
OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" }, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },

View File

@ -672,10 +672,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
if (avctx->codec_id == AV_CODEC_ID_H264) { if (avctx->codec_id == AV_CODEC_ID_H264) {
UINT32 profile = ff_eAVEncH264VProfile_Base; UINT32 profile = ff_eAVEncH264VProfile_Base;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
profile = ff_eAVEncH264VProfile_Main; profile = ff_eAVEncH264VProfile_Main;
break; break;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
profile = ff_eAVEncH264VProfile_High; profile = ff_eAVEncH264VProfile_High;
break; break;
} }

View File

@ -2486,9 +2486,9 @@ redo_for_pal8:
case SOF0: case SOF0:
case SOF1: case SOF1:
if (start_code == SOF0) if (start_code == SOF0)
s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT; s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
else else
s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT; s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT;
s->lossless = 0; s->lossless = 0;
s->ls = 0; s->ls = 0;
s->progressive = 0; s->progressive = 0;
@ -2496,7 +2496,7 @@ redo_for_pal8:
goto fail; goto fail;
break; break;
case SOF2: case SOF2:
s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT; s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
s->lossless = 0; s->lossless = 0;
s->ls = 0; s->ls = 0;
s->progressive = 1; s->progressive = 1;
@ -2504,7 +2504,7 @@ redo_for_pal8:
goto fail; goto fail;
break; break;
case SOF3: case SOF3:
s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS; s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS;
s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
s->lossless = 1; s->lossless = 1;
s->ls = 0; s->ls = 0;
@ -2513,7 +2513,7 @@ redo_for_pal8:
goto fail; goto fail;
break; break;
case SOF48: case SOF48:
s->avctx->profile = FF_PROFILE_MJPEG_JPEG_LS; s->avctx->profile = AV_PROFILE_MJPEG_JPEG_LS;
s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS; s->avctx->properties |= FF_CODEC_PROPERTY_LOSSLESS;
s->lossless = 1; s->lossless = 1;
s->ls = 1; s->ls = 1;

View File

@ -398,7 +398,7 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
*/ */
if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD
&& m->num_substreams == 4 && m->substream_info >> 7 == 1) { && m->num_substreams == 4 && m->substream_info >> 7 == 1) {
m->avctx->profile = FF_PROFILE_TRUEHD_ATMOS; m->avctx->profile = AV_PROFILE_TRUEHD_ATMOS;
} }
/* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */ /* limit to decoding 3 substreams, as the 4th is used by Dolby Atmos for non-audio data */

View File

@ -203,23 +203,23 @@ static av_cold int encode_init(AVCodecContext *avctx)
} }
} }
if (avctx->profile == FF_PROFILE_UNKNOWN) { if (avctx->profile == AV_PROFILE_UNKNOWN) {
if (avctx->level != FF_LEVEL_UNKNOWN) { if (avctx->level != AV_LEVEL_UNKNOWN) {
av_log(avctx, AV_LOG_ERROR, "Set profile and level\n"); av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
/* Main or 4:2:2 */ /* Main or 4:2:2 */
avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? AV_PROFILE_MPEG2_MAIN
: FF_PROFILE_MPEG2_422; : AV_PROFILE_MPEG2_422;
} }
if (avctx->level == FF_LEVEL_UNKNOWN) { if (avctx->level == AV_LEVEL_UNKNOWN) {
if (avctx->profile == FF_PROFILE_MPEG2_422) { /* 4:2:2 */ if (avctx->profile == AV_PROFILE_MPEG2_422) { /* 4:2:2 */
if (avctx->width <= 720 && avctx->height <= 608) if (avctx->width <= 720 && avctx->height <= 608)
avctx->level = 5; /* Main */ avctx->level = 5; /* Main */
else else
avctx->level = 2; /* High */ avctx->level = 2; /* High */
} else { } else {
if (avctx->profile != FF_PROFILE_MPEG2_HIGH && if (avctx->profile != AV_PROFILE_MPEG2_HIGH &&
avctx->pix_fmt != AV_PIX_FMT_YUV420P) { avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n"); "Only High(1) and 4:2:2(0) profiles support 4:2:2 color sampling\n");
@ -366,7 +366,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
put_header(s, EXT_START_CODE); put_header(s, EXT_START_CODE);
put_bits(&s->pb, 4, 1); // seq ext put_bits(&s->pb, 4, 1); // seq ext
put_bits(&s->pb, 1, s->avctx->profile == FF_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile put_bits(&s->pb, 1, s->avctx->profile == AV_PROFILE_MPEG2_422); // escx 1 for 4:2:2 profile
put_bits(&s->pb, 3, s->avctx->profile); // profile put_bits(&s->pb, 3, s->avctx->profile); // profile
put_bits(&s->pb, 4, s->avctx->level); // level put_bits(&s->pb, 4, s->avctx->level); // level

View File

@ -2564,10 +2564,10 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
*/ */
if (ctx->vo_type == CORE_STUDIO_VO_TYPE || if (ctx->vo_type == CORE_STUDIO_VO_TYPE ||
ctx->vo_type == SIMPLE_STUDIO_VO_TYPE) { ctx->vo_type == SIMPLE_STUDIO_VO_TYPE) {
if (s->avctx->profile != FF_PROFILE_UNKNOWN && s->avctx->profile != FF_PROFILE_MPEG4_SIMPLE_STUDIO) if (s->avctx->profile != AV_PROFILE_UNKNOWN && s->avctx->profile != AV_PROFILE_MPEG4_SIMPLE_STUDIO)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
s->studio_profile = 1; s->studio_profile = 1;
s->avctx->profile = FF_PROFILE_MPEG4_SIMPLE_STUDIO; s->avctx->profile = AV_PROFILE_MPEG4_SIMPLE_STUDIO;
return decode_studio_vol_header(ctx, gb); return decode_studio_vol_header(ctx, gb);
} else if (s->studio_profile) { } else if (s->studio_profile) {
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
@ -3605,7 +3605,7 @@ int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb,
} else if (startcode == VOS_STARTCODE) { } else if (startcode == VOS_STARTCODE) {
int profile, level; int profile, level;
mpeg4_decode_profile_level(s, gb, &profile, &level); mpeg4_decode_profile_level(s, gb, &profile, &level);
if (profile == FF_PROFILE_MPEG4_SIMPLE_STUDIO && if (profile == AV_PROFILE_MPEG4_SIMPLE_STUDIO &&
(level > 0 && level < 9)) { (level > 0 && level < 9)) {
s->studio_profile = 1; s->studio_profile = 1;
next_start_code_studio(gb); next_start_code_studio(gb);

View File

@ -916,7 +916,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s)
int profile_and_level_indication; int profile_and_level_indication;
int vo_ver_id; int vo_ver_id;
if (s->avctx->profile != FF_PROFILE_UNKNOWN) { if (s->avctx->profile != AV_PROFILE_UNKNOWN) {
profile_and_level_indication = s->avctx->profile << 4; profile_and_level_indication = s->avctx->profile << 4;
} else if (s->max_b_frames || s->quarter_sample) { } else if (s->max_b_frames || s->quarter_sample) {
profile_and_level_indication = 0xF0; // adv simple profile_and_level_indication = 0xF0; // adv simple
@ -924,7 +924,7 @@ static void mpeg4_encode_visual_object_header(MpegEncContext *s)
profile_and_level_indication = 0x00; // simple profile_and_level_indication = 0x00; // simple
} }
if (s->avctx->level != FF_LEVEL_UNKNOWN) if (s->avctx->level != AV_LEVEL_UNKNOWN)
profile_and_level_indication |= s->avctx->level; profile_and_level_indication |= s->avctx->level;
else else
profile_and_level_indication |= 1; // level 1 profile_and_level_indication |= 1; // level 1

View File

@ -1219,19 +1219,19 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
switch(ctx->profile) { switch(ctx->profile) {
case NV_ENC_H264_PROFILE_BASELINE: case NV_ENC_H264_PROFILE_BASELINE:
cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID; cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID;
avctx->profile = FF_PROFILE_H264_BASELINE; avctx->profile = AV_PROFILE_H264_BASELINE;
break; break;
case NV_ENC_H264_PROFILE_MAIN: case NV_ENC_H264_PROFILE_MAIN:
cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID; cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID;
avctx->profile = FF_PROFILE_H264_MAIN; avctx->profile = AV_PROFILE_H264_MAIN;
break; break;
case NV_ENC_H264_PROFILE_HIGH: case NV_ENC_H264_PROFILE_HIGH:
cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID; cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID;
avctx->profile = FF_PROFILE_H264_HIGH; avctx->profile = AV_PROFILE_H264_HIGH;
break; break;
case NV_ENC_H264_PROFILE_HIGH_444P: case NV_ENC_H264_PROFILE_HIGH_444P:
cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID;
avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE;
break; break;
} }
} }
@ -1239,10 +1239,10 @@ static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
// force setting profile as high444p if input is AV_PIX_FMT_YUV444P // force setting profile as high444p if input is AV_PIX_FMT_YUV444P
if (IS_YUV444(ctx->data_pix_fmt)) { if (IS_YUV444(ctx->data_pix_fmt)) {
cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID; cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_444_GUID;
avctx->profile = FF_PROFILE_H264_HIGH_444_PREDICTIVE; avctx->profile = AV_PROFILE_H264_HIGH_444_PREDICTIVE;
} }
h264->chromaFormatIDC = avctx->profile == FF_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1; h264->chromaFormatIDC = avctx->profile == AV_PROFILE_H264_HIGH_444_PREDICTIVE ? 3 : 1;
h264->level = ctx->level; h264->level = ctx->level;
@ -1335,28 +1335,28 @@ static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
switch (ctx->profile) { switch (ctx->profile) {
case NV_ENC_HEVC_PROFILE_MAIN: case NV_ENC_HEVC_PROFILE_MAIN:
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID; cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
avctx->profile = FF_PROFILE_HEVC_MAIN; avctx->profile = AV_PROFILE_HEVC_MAIN;
break; break;
case NV_ENC_HEVC_PROFILE_MAIN_10: case NV_ENC_HEVC_PROFILE_MAIN_10:
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
avctx->profile = FF_PROFILE_HEVC_MAIN_10; avctx->profile = AV_PROFILE_HEVC_MAIN_10;
break; break;
case NV_ENC_HEVC_PROFILE_REXT: case NV_ENC_HEVC_PROFILE_REXT:
cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
avctx->profile = FF_PROFILE_HEVC_REXT; avctx->profile = AV_PROFILE_HEVC_REXT;
break; break;
} }
// force setting profile as main10 if input is 10 bit // force setting profile as main10 if input is 10 bit
if (IS_10BIT(ctx->data_pix_fmt)) { if (IS_10BIT(ctx->data_pix_fmt)) {
cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID; cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
avctx->profile = FF_PROFILE_HEVC_MAIN_10; avctx->profile = AV_PROFILE_HEVC_MAIN_10;
} }
// force setting profile as rext if input is yuv444 // force setting profile as rext if input is yuv444
if (IS_YUV444(ctx->data_pix_fmt)) { if (IS_YUV444(ctx->data_pix_fmt)) {
cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID; cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
avctx->profile = FF_PROFILE_HEVC_REXT; avctx->profile = AV_PROFILE_HEVC_REXT;
} }
hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1; hevc->chromaFormatIDC = IS_YUV444(ctx->data_pix_fmt) ? 3 : 1;
@ -1407,7 +1407,7 @@ static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx)
return AVERROR(ENOTSUP); return AVERROR(ENOTSUP);
} else { } else {
cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID; cc->profileGUID = NV_ENC_AV1_PROFILE_MAIN_GUID;
avctx->profile = FF_PROFILE_AV1_MAIN; avctx->profile = AV_PROFILE_AV1_MAIN;
} }
if (ctx->dpb_size >= 0) { if (ctx->dpb_size >= 0) {

View File

@ -57,7 +57,7 @@ static const AVOption options[] = {
{ "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" }, { "ull", "Ultra low latency", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_ULTRA_LOW_LATENCY }, 0, 0, VE, "tune" },
{ "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, "tune" }, { "lossless", "Lossless", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS }, 0, 0, VE, "tune" },
#endif #endif
{ "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, FF_PROFILE_HEVC_REXT, VE, "profile" }, { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, NV_ENC_HEVC_PROFILE_MAIN, AV_PROFILE_HEVC_REXT, VE, "profile" },
{ "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" }, { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN }, 0, 0, VE, "profile" },
{ "main10", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" }, { "main10", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_MAIN_10 }, 0, 0, VE, "profile" },
{ "rext", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" }, { "rext", "", 0, AV_OPT_TYPE_CONST, { .i64 = NV_ENC_HEVC_PROFILE_REXT }, 0, 0, VE, "profile" },

View File

@ -531,14 +531,14 @@ static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
CHECK(err); CHECK(err);
avc.nBFrames = 0; avc.nBFrames = 0;
avc.nPFrames = avctx->gop_size - 1; avc.nPFrames = avctx->gop_size - 1;
switch (s->profile == FF_PROFILE_UNKNOWN ? avctx->profile : s->profile) { switch (s->profile == AV_PROFILE_UNKNOWN ? avctx->profile : s->profile) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
avc.eProfile = OMX_VIDEO_AVCProfileBaseline; avc.eProfile = OMX_VIDEO_AVCProfileBaseline;
break; break;
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
avc.eProfile = OMX_VIDEO_AVCProfileMain; avc.eProfile = OMX_VIDEO_AVCProfileMain;
break; break;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
avc.eProfile = OMX_VIDEO_AVCProfileHigh; avc.eProfile = OMX_VIDEO_AVCProfileHigh;
break; break;
default: default:
@ -919,10 +919,10 @@ static const AVOption options[] = {
{ "omx_libname", "OpenMAX library name", OFFSET(libname), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "omx_libname", "OpenMAX library name", OFFSET(libname), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE },
{ "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE }, { "omx_libprefix", "OpenMAX library prefix", OFFSET(libprefix), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VDE },
{ "zerocopy", "Try to avoid copying input frames if possible", OFFSET(input_zerocopy), AV_OPT_TYPE_INT, { .i64 = CONFIG_OMX_RPI }, 0, 1, VE }, { "zerocopy", "Try to avoid copying input frames if possible", OFFSET(input_zerocopy), AV_OPT_TYPE_INT, { .i64 = CONFIG_OMX_RPI }, 0, 1, VE },
{ "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_H264_HIGH, VE, "profile" }, { "profile", "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_H264_HIGH, VE, "profile" },
{ "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" }, { "baseline", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" },
{ "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, 0, 0, VE, "profile" }, { "main", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, 0, 0, VE, "profile" },
{ "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, 0, 0, VE, "profile" }, { "high", "", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, 0, 0, VE, "profile" },
{ NULL } { NULL }
}; };

View File

@ -223,9 +223,9 @@ static const AVOption avcodec_options[] = {
{"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E}, {"nssew", "nsse weight", OFFSET(nsse_weight), AV_OPT_TYPE_INT, {.i64 = 8 }, INT_MIN, INT_MAX, V|E},
{"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_top", "number of macroblock rows at the top which are skipped", OFFSET(skip_top), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
{"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D}, {"skip_bottom", "number of macroblock rows at the bottom which are skipped", OFFSET(skip_bottom), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|D},
{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"}, {"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.profile"},
{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.profile"},
{"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"}, {"main10", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "avctx.profile"},
{"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.level"}, {"level", NULL, OFFSET(level), AV_OPT_TYPE_INT, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E|CC, "avctx.level"},
{"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.level"}, {"unknown", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_LEVEL_UNKNOWN }, INT_MIN, INT_MAX, V|A|E, "avctx.level"},
{"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D}, {"lowres", "decode at 1= 1/2, 2=1/4, 3=1/8 resolutions", OFFSET(lowres), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|A|D},

View File

@ -24,180 +24,180 @@
#if !CONFIG_SMALL #if !CONFIG_SMALL
const AVProfile ff_aac_profiles[] = { const AVProfile ff_aac_profiles[] = {
{ FF_PROFILE_AAC_LOW, "LC" }, { AV_PROFILE_AAC_LOW, "LC" },
{ FF_PROFILE_AAC_HE, "HE-AAC" }, { AV_PROFILE_AAC_HE, "HE-AAC" },
{ FF_PROFILE_AAC_HE_V2, "HE-AACv2" }, { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
{ FF_PROFILE_AAC_LD, "LD" }, { AV_PROFILE_AAC_LD, "LD" },
{ FF_PROFILE_AAC_ELD, "ELD" }, { AV_PROFILE_AAC_ELD, "ELD" },
{ FF_PROFILE_AAC_MAIN, "Main" }, { AV_PROFILE_AAC_MAIN, "Main" },
{ FF_PROFILE_AAC_SSR, "SSR" }, { AV_PROFILE_AAC_SSR, "SSR" },
{ FF_PROFILE_AAC_LTP, "LTP" }, { AV_PROFILE_AAC_LTP, "LTP" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_dca_profiles[] = { const AVProfile ff_dca_profiles[] = {
{ FF_PROFILE_DTS, "DTS" }, { AV_PROFILE_DTS, "DTS" },
{ FF_PROFILE_DTS_ES, "DTS-ES" }, { AV_PROFILE_DTS_ES, "DTS-ES" },
{ FF_PROFILE_DTS_96_24, "DTS 96/24" }, { AV_PROFILE_DTS_96_24, "DTS 96/24" },
{ FF_PROFILE_DTS_HD_HRA, "DTS-HD HRA" }, { AV_PROFILE_DTS_HD_HRA, "DTS-HD HRA" },
{ FF_PROFILE_DTS_HD_MA, "DTS-HD MA" }, { AV_PROFILE_DTS_HD_MA, "DTS-HD MA" },
{ FF_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" }, { AV_PROFILE_DTS_HD_MA_X, "DTS-HD MA + DTS:X" },
{ FF_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" }, { AV_PROFILE_DTS_HD_MA_X_IMAX, "DTS-HD MA + DTS:X IMAX" },
{ FF_PROFILE_DTS_EXPRESS, "DTS Express" }, { AV_PROFILE_DTS_EXPRESS, "DTS Express" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_eac3_profiles[] = { const AVProfile ff_eac3_profiles[] = {
{ FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"}, { AV_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"},
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_truehd_profiles[] = { const AVProfile ff_truehd_profiles[] = {
{ FF_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"}, { AV_PROFILE_TRUEHD_ATMOS, "Dolby TrueHD + Dolby Atmos"},
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_dnxhd_profiles[] = { const AVProfile ff_dnxhd_profiles[] = {
{ FF_PROFILE_DNXHD, "DNXHD"}, { AV_PROFILE_DNXHD, "DNXHD"},
{ FF_PROFILE_DNXHR_LB, "DNXHR LB"}, { AV_PROFILE_DNXHR_LB, "DNXHR LB"},
{ FF_PROFILE_DNXHR_SQ, "DNXHR SQ"}, { AV_PROFILE_DNXHR_SQ, "DNXHR SQ"},
{ FF_PROFILE_DNXHR_HQ, "DNXHR HQ" }, { AV_PROFILE_DNXHR_HQ, "DNXHR HQ" },
{ FF_PROFILE_DNXHR_HQX, "DNXHR HQX"}, { AV_PROFILE_DNXHR_HQX, "DNXHR HQX"},
{ FF_PROFILE_DNXHR_444, "DNXHR 444"}, { AV_PROFILE_DNXHR_444, "DNXHR 444"},
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_h264_profiles[] = { const AVProfile ff_h264_profiles[] = {
{ FF_PROFILE_H264_BASELINE, "Baseline" }, { AV_PROFILE_H264_BASELINE, "Baseline" },
{ FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" }, { AV_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline" },
{ FF_PROFILE_H264_MAIN, "Main" }, { AV_PROFILE_H264_MAIN, "Main" },
{ FF_PROFILE_H264_EXTENDED, "Extended" }, { AV_PROFILE_H264_EXTENDED, "Extended" },
{ FF_PROFILE_H264_HIGH, "High" }, { AV_PROFILE_H264_HIGH, "High" },
{ FF_PROFILE_H264_HIGH_10, "High 10" }, { AV_PROFILE_H264_HIGH_10, "High 10" },
{ FF_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" }, { AV_PROFILE_H264_HIGH_10_INTRA, "High 10 Intra" },
{ FF_PROFILE_H264_HIGH_422, "High 4:2:2" }, { AV_PROFILE_H264_HIGH_422, "High 4:2:2" },
{ FF_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" }, { AV_PROFILE_H264_HIGH_422_INTRA, "High 4:2:2 Intra" },
{ FF_PROFILE_H264_HIGH_444, "High 4:4:4" }, { AV_PROFILE_H264_HIGH_444, "High 4:4:4" },
{ FF_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" }, { AV_PROFILE_H264_HIGH_444_PREDICTIVE, "High 4:4:4 Predictive" },
{ FF_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" }, { AV_PROFILE_H264_HIGH_444_INTRA, "High 4:4:4 Intra" },
{ FF_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" }, { AV_PROFILE_H264_CAVLC_444, "CAVLC 4:4:4" },
{ FF_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" }, { AV_PROFILE_H264_MULTIVIEW_HIGH, "Multiview High" },
{ FF_PROFILE_H264_STEREO_HIGH, "Stereo High" }, { AV_PROFILE_H264_STEREO_HIGH, "Stereo High" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_vvc_profiles[] = { const AVProfile ff_vvc_profiles[] = {
{ FF_PROFILE_VVC_MAIN_10, "Main 10" }, { AV_PROFILE_VVC_MAIN_10, "Main 10" },
{ FF_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" }, { AV_PROFILE_VVC_MAIN_10_444, "Main 10 4:4:4" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_hevc_profiles[] = { const AVProfile ff_hevc_profiles[] = {
{ FF_PROFILE_HEVC_MAIN, "Main" }, { AV_PROFILE_HEVC_MAIN, "Main" },
{ FF_PROFILE_HEVC_MAIN_10, "Main 10" }, { AV_PROFILE_HEVC_MAIN_10, "Main 10" },
{ FF_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" }, { AV_PROFILE_HEVC_MAIN_STILL_PICTURE, "Main Still Picture" },
{ FF_PROFILE_HEVC_REXT, "Rext" }, { AV_PROFILE_HEVC_REXT, "Rext" },
{ FF_PROFILE_HEVC_SCC, "Scc" }, { AV_PROFILE_HEVC_SCC, "Scc" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_jpeg2000_profiles[] = { const AVProfile ff_jpeg2000_profiles[] = {
{ FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" }, { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0, "JPEG 2000 codestream restriction 0" },
{ FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" }, { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1, "JPEG 2000 codestream restriction 1" },
{ FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" }, { AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
{ FF_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" }, { AV_PROFILE_JPEG2000_DCINEMA_2K, "JPEG 2000 digital cinema 2K" },
{ FF_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" }, { AV_PROFILE_JPEG2000_DCINEMA_4K, "JPEG 2000 digital cinema 4K" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_mpeg2_video_profiles[] = { const AVProfile ff_mpeg2_video_profiles[] = {
{ FF_PROFILE_MPEG2_422, "4:2:2" }, { AV_PROFILE_MPEG2_422, "4:2:2" },
{ FF_PROFILE_MPEG2_HIGH, "High" }, { AV_PROFILE_MPEG2_HIGH, "High" },
{ FF_PROFILE_MPEG2_SS, "Spatially Scalable" }, { AV_PROFILE_MPEG2_SS, "Spatially Scalable" },
{ FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" }, { AV_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable" },
{ FF_PROFILE_MPEG2_MAIN, "Main" }, { AV_PROFILE_MPEG2_MAIN, "Main" },
{ FF_PROFILE_MPEG2_SIMPLE, "Simple" }, { AV_PROFILE_MPEG2_SIMPLE, "Simple" },
{ FF_PROFILE_RESERVED, "Reserved" }, { AV_PROFILE_RESERVED, "Reserved" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_mpeg4_video_profiles[] = { const AVProfile ff_mpeg4_video_profiles[] = {
{ FF_PROFILE_MPEG4_SIMPLE, "Simple Profile" }, { AV_PROFILE_MPEG4_SIMPLE, "Simple Profile" },
{ FF_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" }, { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, "Simple Scalable Profile" },
{ FF_PROFILE_MPEG4_CORE, "Core Profile" }, { AV_PROFILE_MPEG4_CORE, "Core Profile" },
{ FF_PROFILE_MPEG4_MAIN, "Main Profile" }, { AV_PROFILE_MPEG4_MAIN, "Main Profile" },
{ FF_PROFILE_MPEG4_N_BIT, "N-bit Profile" }, { AV_PROFILE_MPEG4_N_BIT, "N-bit Profile" },
{ FF_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" }, { AV_PROFILE_MPEG4_SCALABLE_TEXTURE, "Scalable Texture Profile" },
{ FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" }, { AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION, "Simple Face Animation Profile" },
{ FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" }, { AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE, "Basic Animated Texture Profile" },
{ FF_PROFILE_MPEG4_HYBRID, "Hybrid Profile" }, { AV_PROFILE_MPEG4_HYBRID, "Hybrid Profile" },
{ FF_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" }, { AV_PROFILE_MPEG4_ADVANCED_REAL_TIME, "Advanced Real Time Simple Profile" },
{ FF_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" }, { AV_PROFILE_MPEG4_CORE_SCALABLE, "Code Scalable Profile" },
{ FF_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" }, { AV_PROFILE_MPEG4_ADVANCED_CODING, "Advanced Coding Profile" },
{ FF_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" }, { AV_PROFILE_MPEG4_ADVANCED_CORE, "Advanced Core Profile" },
{ FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" }, { AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
{ FF_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" }, { AV_PROFILE_MPEG4_SIMPLE_STUDIO, "Simple Studio Profile" },
{ FF_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" }, { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, "Advanced Simple Profile" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_vc1_profiles[] = { const AVProfile ff_vc1_profiles[] = {
{ FF_PROFILE_VC1_SIMPLE, "Simple" }, { AV_PROFILE_VC1_SIMPLE, "Simple" },
{ FF_PROFILE_VC1_MAIN, "Main" }, { AV_PROFILE_VC1_MAIN, "Main" },
{ FF_PROFILE_VC1_COMPLEX, "Complex" }, { AV_PROFILE_VC1_COMPLEX, "Complex" },
{ FF_PROFILE_VC1_ADVANCED, "Advanced" }, { AV_PROFILE_VC1_ADVANCED, "Advanced" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_vp9_profiles[] = { const AVProfile ff_vp9_profiles[] = {
{ FF_PROFILE_VP9_0, "Profile 0" }, { AV_PROFILE_VP9_0, "Profile 0" },
{ FF_PROFILE_VP9_1, "Profile 1" }, { AV_PROFILE_VP9_1, "Profile 1" },
{ FF_PROFILE_VP9_2, "Profile 2" }, { AV_PROFILE_VP9_2, "Profile 2" },
{ FF_PROFILE_VP9_3, "Profile 3" }, { AV_PROFILE_VP9_3, "Profile 3" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_av1_profiles[] = { const AVProfile ff_av1_profiles[] = {
{ FF_PROFILE_AV1_MAIN, "Main" }, { AV_PROFILE_AV1_MAIN, "Main" },
{ FF_PROFILE_AV1_HIGH, "High" }, { AV_PROFILE_AV1_HIGH, "High" },
{ FF_PROFILE_AV1_PROFESSIONAL, "Professional" }, { AV_PROFILE_AV1_PROFESSIONAL, "Professional" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_sbc_profiles[] = { const AVProfile ff_sbc_profiles[] = {
{ FF_PROFILE_SBC_MSBC, "mSBC" }, { AV_PROFILE_SBC_MSBC, "mSBC" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
const AVProfile ff_prores_profiles[] = { const AVProfile ff_prores_profiles[] = {
{ FF_PROFILE_PRORES_PROXY, "Proxy" }, { AV_PROFILE_PRORES_PROXY, "Proxy" },
{ FF_PROFILE_PRORES_LT, "LT" }, { AV_PROFILE_PRORES_LT, "LT" },
{ FF_PROFILE_PRORES_STANDARD, "Standard" }, { AV_PROFILE_PRORES_STANDARD, "Standard" },
{ FF_PROFILE_PRORES_HQ, "HQ" }, { AV_PROFILE_PRORES_HQ, "HQ" },
{ FF_PROFILE_PRORES_4444, "4444" }, { AV_PROFILE_PRORES_4444, "4444" },
{ FF_PROFILE_PRORES_XQ, "XQ" }, { AV_PROFILE_PRORES_XQ, "XQ" },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
const AVProfile ff_mjpeg_profiles[] = { const AVProfile ff_mjpeg_profiles[] = {
{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" }, { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, "Baseline" },
{ FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" }, { AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential" },
{ FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" }, { AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT, "Progressive" },
{ FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" }, { AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS, "Lossless" },
{ FF_PROFILE_MJPEG_JPEG_LS, "JPEG LS" }, { AV_PROFILE_MJPEG_JPEG_LS, "JPEG LS" },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
const AVProfile ff_arib_caption_profiles[] = { const AVProfile ff_arib_caption_profiles[] = {
{ FF_PROFILE_ARIB_PROFILE_A, "Profile A" }, { AV_PROFILE_ARIB_PROFILE_A, "Profile A" },
{ FF_PROFILE_ARIB_PROFILE_C, "Profile C" }, { AV_PROFILE_ARIB_PROFILE_C, "Profile C" },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
const AVProfile ff_evc_profiles[] = { const AVProfile ff_evc_profiles[] = {
{ FF_PROFILE_EVC_BASELINE, "Baseline" }, { AV_PROFILE_EVC_BASELINE, "Baseline" },
{ FF_PROFILE_EVC_MAIN, "Main" }, { AV_PROFILE_EVC_MAIN, "Main" },
{ FF_PROFILE_UNKNOWN }, { AV_PROFILE_UNKNOWN },
}; };
#endif /* !CONFIG_SMALL */ #endif /* !CONFIG_SMALL */

View File

@ -26,35 +26,35 @@
{name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"}, {name, description, 0, AV_OPT_TYPE_CONST, {.i64 = value }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM | AV_OPT_FLAG_## type ##_PARAM, "avctx.profile"},
#define FF_AAC_PROFILE_OPTS \ #define FF_AAC_PROFILE_OPTS \
FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, FF_PROFILE_AAC_MAIN)\ FF_AVCTX_PROFILE_OPTION("aac_main", NULL, AUDIO, AV_PROFILE_AAC_MAIN)\
FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, FF_PROFILE_AAC_LOW)\ FF_AVCTX_PROFILE_OPTION("aac_low", NULL, AUDIO, AV_PROFILE_AAC_LOW)\
FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, FF_PROFILE_AAC_SSR)\ FF_AVCTX_PROFILE_OPTION("aac_ssr", NULL, AUDIO, AV_PROFILE_AAC_SSR)\
FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, FF_PROFILE_AAC_LTP)\ FF_AVCTX_PROFILE_OPTION("aac_ltp", NULL, AUDIO, AV_PROFILE_AAC_LTP)\
FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, FF_PROFILE_AAC_HE)\ FF_AVCTX_PROFILE_OPTION("aac_he", NULL, AUDIO, AV_PROFILE_AAC_HE)\
FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, FF_PROFILE_AAC_HE_V2)\ FF_AVCTX_PROFILE_OPTION("aac_he_v2", NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\
FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, FF_PROFILE_AAC_LD)\ FF_AVCTX_PROFILE_OPTION("aac_ld", NULL, AUDIO, AV_PROFILE_AAC_LD)\
FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, FF_PROFILE_AAC_ELD)\ FF_AVCTX_PROFILE_OPTION("aac_eld", NULL, AUDIO, AV_PROFILE_AAC_ELD)\
FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_LOW)\ FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\
FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_HE)\ FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\
#define FF_MPEG4_PROFILE_OPTS \ #define FF_MPEG4_PROFILE_OPTS \
FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, FF_PROFILE_MPEG4_SIMPLE)\ FF_AVCTX_PROFILE_OPTION("mpeg4_sp", NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\
FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, FF_PROFILE_MPEG4_CORE)\ FF_AVCTX_PROFILE_OPTION("mpeg4_core", NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\
FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\ FF_AVCTX_PROFILE_OPTION("mpeg4_main", NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\
FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\ FF_AVCTX_PROFILE_OPTION("mpeg4_asp", NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\
#define FF_MPEG2_PROFILE_OPTS \ #define FF_MPEG2_PROFILE_OPTS \
FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, FF_PROFILE_MPEG2_422)\ FF_AVCTX_PROFILE_OPTION("422", NULL, VIDEO, AV_PROFILE_MPEG2_422)\
FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\ FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\
FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, FF_PROFILE_MPEG2_SS)\ FF_AVCTX_PROFILE_OPTION("ss", NULL, VIDEO, AV_PROFILE_MPEG2_SS)\
FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\ FF_AVCTX_PROFILE_OPTION("snr", NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\
FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\ FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\
FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\ FF_AVCTX_PROFILE_OPTION("simple", NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\
#define FF_AV1_PROFILE_OPTS \ #define FF_AV1_PROFILE_OPTS \
FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, FF_PROFILE_AV1_MAIN)\ FF_AVCTX_PROFILE_OPTION("main", NULL, VIDEO, AV_PROFILE_AV1_MAIN)\
FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, FF_PROFILE_AV1_HIGH)\ FF_AVCTX_PROFILE_OPTION("high", NULL, VIDEO, AV_PROFILE_AV1_HIGH)\
FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, FF_PROFILE_AV1_PROFESSIONAL)\ FF_AVCTX_PROFILE_OPTION("professional", NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\
extern const AVProfile ff_aac_profiles[]; extern const AVProfile ff_aac_profiles[];
extern const AVProfile ff_dca_profiles[]; extern const AVProfile ff_dca_profiles[];

View File

@ -141,27 +141,27 @@ static av_cold int decode_init(AVCodecContext *avctx)
switch (avctx->codec_tag) { switch (avctx->codec_tag) {
case MKTAG('a','p','c','o'): case MKTAG('a','p','c','o'):
avctx->profile = FF_PROFILE_PRORES_PROXY; avctx->profile = AV_PROFILE_PRORES_PROXY;
break; break;
case MKTAG('a','p','c','s'): case MKTAG('a','p','c','s'):
avctx->profile = FF_PROFILE_PRORES_LT; avctx->profile = AV_PROFILE_PRORES_LT;
break; break;
case MKTAG('a','p','c','n'): case MKTAG('a','p','c','n'):
avctx->profile = FF_PROFILE_PRORES_STANDARD; avctx->profile = AV_PROFILE_PRORES_STANDARD;
break; break;
case MKTAG('a','p','c','h'): case MKTAG('a','p','c','h'):
avctx->profile = FF_PROFILE_PRORES_HQ; avctx->profile = AV_PROFILE_PRORES_HQ;
break; break;
case MKTAG('a','p','4','h'): case MKTAG('a','p','4','h'):
avctx->profile = FF_PROFILE_PRORES_4444; avctx->profile = AV_PROFILE_PRORES_4444;
avctx->bits_per_raw_sample = 12; avctx->bits_per_raw_sample = 12;
break; break;
case MKTAG('a','p','4','x'): case MKTAG('a','p','4','x'):
avctx->profile = FF_PROFILE_PRORES_XQ; avctx->profile = AV_PROFILE_PRORES_XQ;
avctx->bits_per_raw_sample = 12; avctx->bits_per_raw_sample = 12;
break; break;
default: default:
avctx->profile = FF_PROFILE_UNKNOWN; avctx->profile = AV_PROFILE_UNKNOWN;
av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag); av_log(avctx, AV_LOG_WARNING, "Unknown prores profile %d\n", avctx->codec_tag);
} }

View File

@ -41,13 +41,13 @@
#define DEFAULT_SLICE_MB_WIDTH 8 #define DEFAULT_SLICE_MB_WIDTH 8
static const AVProfile profiles[] = { static const AVProfile profiles[] = {
{ FF_PROFILE_PRORES_PROXY, "apco"}, { AV_PROFILE_PRORES_PROXY, "apco"},
{ FF_PROFILE_PRORES_LT, "apcs"}, { AV_PROFILE_PRORES_LT, "apcs"},
{ FF_PROFILE_PRORES_STANDARD, "apcn"}, { AV_PROFILE_PRORES_STANDARD, "apcn"},
{ FF_PROFILE_PRORES_HQ, "apch"}, { AV_PROFILE_PRORES_HQ, "apch"},
{ FF_PROFILE_PRORES_4444, "ap4h"}, { AV_PROFILE_PRORES_4444, "ap4h"},
{ FF_PROFILE_PRORES_XQ, "ap4x"}, { AV_PROFILE_PRORES_XQ, "ap4x"},
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const int qp_start_table[] = { 8, 3, 2, 1, 1, 1}; static const int qp_start_table[] = { 8, 3, 2, 1, 1, 1};
@ -771,7 +771,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream_put_be16(&buf, avctx->width); bytestream_put_be16(&buf, avctx->width);
bytestream_put_be16(&buf, avctx->height); bytestream_put_be16(&buf, avctx->height);
frame_flags = 0x82; /* 422 not interlaced */ frame_flags = 0x82; /* 422 not interlaced */
if (avctx->profile >= FF_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */ if (avctx->profile >= AV_PROFILE_PRORES_4444) /* 4444 or 4444 Xq */
frame_flags |= 0x40; /* 444 chroma */ frame_flags |= 0x40; /* 444 chroma */
if (ctx->is_interlaced) { if (ctx->is_interlaced) {
if ((pict->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) || !(pict->flags & AV_FRAME_FLAG_INTERLACED)) { if ((pict->flags & AV_FRAME_FLAG_TOP_FIELD_FIRST) || !(pict->flags & AV_FRAME_FLAG_INTERLACED)) {
@ -795,7 +795,7 @@ static int prores_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
pict->color_trc, valid_trc, 0); pict->color_trc, valid_trc, 0);
*buf++ = int_from_list_or_default(avctx, "frame colorspace", *buf++ = int_from_list_or_default(avctx, "frame colorspace",
pict->colorspace, valid_colorspace, 0); pict->colorspace, valid_colorspace, 0);
if (avctx->profile >= FF_PROFILE_PRORES_4444) { if (avctx->profile >= AV_PROFILE_PRORES_4444) {
if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
*buf++ = 0xA0;/* src b64a and no alpha */ *buf++ = 0xA0;/* src b64a and no alpha */
} else { } else {
@ -871,40 +871,40 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (avctx->profile == FF_PROFILE_UNKNOWN) { if (avctx->profile == AV_PROFILE_UNKNOWN) {
if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) { if (avctx->pix_fmt == AV_PIX_FMT_YUV422P10) {
avctx->profile = FF_PROFILE_PRORES_STANDARD; avctx->profile = AV_PROFILE_PRORES_STANDARD;
av_log(avctx, AV_LOG_INFO, av_log(avctx, AV_LOG_INFO,
"encoding with ProRes standard (apcn) profile\n"); "encoding with ProRes standard (apcn) profile\n");
} else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { } else if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) {
avctx->profile = FF_PROFILE_PRORES_4444; avctx->profile = AV_PROFILE_PRORES_4444;
av_log(avctx, AV_LOG_INFO, av_log(avctx, AV_LOG_INFO,
"encoding with ProRes 4444 (ap4h) profile\n"); "encoding with ProRes 4444 (ap4h) profile\n");
} else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) { } else if (avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) {
avctx->profile = FF_PROFILE_PRORES_4444; avctx->profile = AV_PROFILE_PRORES_4444;
av_log(avctx, AV_LOG_INFO, av_log(avctx, AV_LOG_INFO,
"encoding with ProRes 4444+ (ap4h) profile\n"); "encoding with ProRes 4444+ (ap4h) profile\n");
} }
} else if (avctx->profile < FF_PROFILE_PRORES_PROXY } else if (avctx->profile < AV_PROFILE_PRORES_PROXY
|| avctx->profile > FF_PROFILE_PRORES_XQ) { || avctx->profile > AV_PROFILE_PRORES_XQ) {
av_log( av_log(
avctx, avctx,
AV_LOG_ERROR, AV_LOG_ERROR,
"unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n", "unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n",
avctx->profile); avctx->profile);
return AVERROR(EINVAL); return AVERROR(EINVAL);
} else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > FF_PROFILE_PRORES_HQ)){ } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P10) && (avctx->profile > AV_PROFILE_PRORES_HQ)){
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n"); "encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) } else if ((avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10)
&& (avctx->profile < FF_PROFILE_PRORES_4444)){ && (avctx->profile < AV_PROFILE_PRORES_4444)){
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n"); "encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (avctx->profile < FF_PROFILE_PRORES_4444) { /* 422 versions */ if (avctx->profile < AV_PROFILE_PRORES_4444) { /* 422 versions */
ctx->is_422 = 1; ctx->is_422 = 1;
if ((avctx->height & 0xf) || (avctx->width & 0xf)) { if ((avctx->height & 0xf) || (avctx->width & 0xf)) {
ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8)); ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8));

View File

@ -199,7 +199,7 @@ static int sbc_encode_init(AVCodecContext *avctx)
SBCEncContext *sbc = avctx->priv_data; SBCEncContext *sbc = avctx->priv_data;
struct sbc_frame *frame = &sbc->frame; struct sbc_frame *frame = &sbc->frame;
if (avctx->profile == FF_PROFILE_SBC_MSBC) if (avctx->profile == AV_PROFILE_SBC_MSBC)
sbc->msbc = 1; sbc->msbc = 1;
if (sbc->msbc) { if (sbc->msbc) {
@ -333,7 +333,7 @@ static const AVOption options[] = {
OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE }, OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE },
{ "msbc", "use mSBC mode (wideband speech mono SBC)", { "msbc", "use mSBC mode (wideband speech mono SBC)",
OFFSET(msbc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AE }, OFFSET(msbc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AE },
FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, FF_PROFILE_SBC_MSBC) FF_AVCTX_PROFILE_OPTION("msbc", NULL, AUDIO, AV_PROFILE_SBC_MSBC)
{ NULL }, { NULL },
}; };

View File

@ -434,10 +434,10 @@ const char *avcodec_get_name(enum AVCodecID id)
const char *av_get_profile_name(const AVCodec *codec, int profile) const char *av_get_profile_name(const AVCodec *codec, int profile)
{ {
const AVProfile *p; const AVProfile *p;
if (profile == FF_PROFILE_UNKNOWN || !codec->profiles) if (profile == AV_PROFILE_UNKNOWN || !codec->profiles)
return NULL; return NULL;
for (p = codec->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) for (p = codec->profiles; p->profile != AV_PROFILE_UNKNOWN; p++)
if (p->profile == profile) if (p->profile == profile)
return p->name; return p->name;
@ -449,10 +449,10 @@ const char *avcodec_profile_name(enum AVCodecID codec_id, int profile)
const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id); const AVCodecDescriptor *desc = avcodec_descriptor_get(codec_id);
const AVProfile *p; const AVProfile *p;
if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles) if (profile == AV_PROFILE_UNKNOWN || !desc || !desc->profiles)
return NULL; return NULL;
for (p = desc->profiles; p->profile != FF_PROFILE_UNKNOWN; p++) for (p = desc->profiles; p->profile != AV_PROFILE_UNKNOWN; p++)
if (p->profile == profile) if (p->profile == profile)
return p->name; return p->name;

View File

@ -103,17 +103,17 @@ static inline unsigned int v4l2_h264_profile_from_ff(int p)
unsigned int ffmpeg_val; unsigned int ffmpeg_val;
unsigned int v4l2_val; unsigned int v4l2_val;
} profile[] = { } profile[] = {
{ FF_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) }, { AV_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) },
{ FF_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) }, { AV_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) },
{ FF_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) }, { AV_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) },
{ FF_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) }, { AV_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) },
{ FF_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) }, { AV_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) },
{ FF_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) }, { AV_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) },
{ FF_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) }, { AV_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) },
{ FF_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) }, { AV_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) },
{ FF_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) }, { AV_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) },
{ FF_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) }, { AV_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) },
{ FF_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) }, { AV_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) },
}; };
int i; int i;
@ -130,11 +130,11 @@ static inline int v4l2_mpeg4_profile_from_ff(int p)
unsigned int ffmpeg_val; unsigned int ffmpeg_val;
unsigned int v4l2_val; unsigned int v4l2_val;
} profile[] = { } profile[] = {
{ FF_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) }, { AV_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) },
{ FF_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) }, { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) },
{ FF_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) }, { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) },
{ FF_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) }, { AV_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) },
{ FF_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) }, { AV_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) },
}; };
int i; int i;
@ -206,7 +206,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
switch (avctx->codec_id) { switch (avctx->codec_id) {
case AV_CODEC_ID_H264: case AV_CODEC_ID_H264:
if (avctx->profile != FF_PROFILE_UNKNOWN) { if (avctx->profile != AV_PROFILE_UNKNOWN) {
val = v4l2_h264_profile_from_ff(avctx->profile); val = v4l2_h264_profile_from_ff(avctx->profile);
if (val < 0) if (val < 0)
av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n"); av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n");
@ -219,7 +219,7 @@ static int v4l2_prepare_encoder(V4L2m2mContext *s)
qmax = 51; qmax = 51;
break; break;
case AV_CODEC_ID_MPEG4: case AV_CODEC_ID_MPEG4:
if (avctx->profile != FF_PROFILE_UNKNOWN) { if (avctx->profile != AV_PROFILE_UNKNOWN) {
val = v4l2_mpeg4_profile_from_ff(avctx->profile); val = v4l2_mpeg4_profile_from_ff(avctx->profile);
if (val < 0) if (val < 0)
av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n"); av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n");

View File

@ -390,7 +390,7 @@ static const struct {
VAProfile va_profile; VAProfile va_profile;
VAProfile (*profile_parser)(AVCodecContext *avctx); VAProfile (*profile_parser)(AVCodecContext *avctx);
} vaapi_profile_map[] = { } vaapi_profile_map[] = {
#define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, FF_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ } #define MAP(c, p, v, ...) { AV_CODEC_ID_ ## c, AV_PROFILE_ ## p, VAProfile ## v, __VA_ARGS__ }
MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2Simple ), MAP(MPEG2VIDEO, MPEG2_SIMPLE, MPEG2Simple ),
MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2Main ), MAP(MPEG2VIDEO, MPEG2_MAIN, MPEG2Main ),
MAP(H263, UNKNOWN, H263Baseline), MAP(H263, UNKNOWN, H263Baseline),
@ -497,7 +497,7 @@ static int vaapi_decode_make_config(AVCodecContext *avctx,
if (avctx->codec_id != vaapi_profile_map[i].codec_id) if (avctx->codec_id != vaapi_profile_map[i].codec_id)
continue; continue;
if (avctx->profile == vaapi_profile_map[i].codec_profile || if (avctx->profile == vaapi_profile_map[i].codec_profile ||
vaapi_profile_map[i].codec_profile == FF_PROFILE_UNKNOWN) vaapi_profile_map[i].codec_profile == AV_PROFILE_UNKNOWN)
profile_match = 1; profile_match = 1;
va_profile = vaapi_profile_map[i].profile_parser ? va_profile = vaapi_profile_map[i].profile_parser ?

View File

@ -1414,7 +1414,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx)
av_assert0(ctx->codec->profiles); av_assert0(ctx->codec->profiles);
for (i = 0; (ctx->codec->profiles[i].av_profile != for (i = 0; (ctx->codec->profiles[i].av_profile !=
FF_PROFILE_UNKNOWN); i++) { AV_PROFILE_UNKNOWN); i++) {
profile = &ctx->codec->profiles[i]; profile = &ctx->codec->profiles[i];
if (depth != profile->depth || if (depth != profile->depth ||
desc->nb_components != profile->nb_components) desc->nb_components != profile->nb_components)
@ -1424,7 +1424,7 @@ static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx)
desc->log2_chroma_h != profile->log2_chroma_h)) desc->log2_chroma_h != profile->log2_chroma_h))
continue; continue;
if (avctx->profile != profile->av_profile && if (avctx->profile != profile->av_profile &&
avctx->profile != FF_PROFILE_UNKNOWN) avctx->profile != AV_PROFILE_UNKNOWN)
continue; continue;
#if VA_CHECK_VERSION(1, 0, 0) #if VA_CHECK_VERSION(1, 0, 0)

View File

@ -134,7 +134,7 @@ typedef struct VAAPIEncodePicture {
} VAAPIEncodePicture; } VAAPIEncodePicture;
typedef struct VAAPIEncodeProfile { typedef struct VAAPIEncodeProfile {
// lavc profile value (FF_PROFILE_*). // lavc profile value (AV_PROFILE_*).
int av_profile; int av_profile;
// Supported bit depth. // Supported bit depth.
int depth; int depth;
@ -384,7 +384,7 @@ enum {
typedef struct VAAPIEncodeType { typedef struct VAAPIEncodeType {
// List of supported profiles and corresponding VAAPI profiles. // List of supported profiles and corresponding VAAPI profiles.
// (Must end with FF_PROFILE_UNKNOWN.) // (Must end with AV_PROFILE_UNKNOWN.)
const VAAPIEncodeProfile *profiles; const VAAPIEncodeProfile *profiles;
// Codec feature flags. // Codec feature flags.

View File

@ -322,15 +322,15 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
sps->profile_idc = avctx->profile & 0xff; sps->profile_idc = avctx->profile & 0xff;
if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE || if (avctx->profile == AV_PROFILE_H264_CONSTRAINED_BASELINE ||
avctx->profile == FF_PROFILE_H264_MAIN) avctx->profile == AV_PROFILE_H264_MAIN)
sps->constraint_set1_flag = 1; sps->constraint_set1_flag = 1;
if (avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) if (avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10)
sps->constraint_set3_flag = ctx->gop_size == 1; sps->constraint_set3_flag = ctx->gop_size == 1;
if (avctx->profile == FF_PROFILE_H264_MAIN || if (avctx->profile == AV_PROFILE_H264_MAIN ||
avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) { avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) {
sps->constraint_set4_flag = 1; sps->constraint_set4_flag = 1;
sps->constraint_set5_flag = ctx->b_per_p == 0; sps->constraint_set5_flag = ctx->b_per_p == 0;
} }
@ -340,7 +340,7 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
else else
priv->dpb_frames = 1 + ctx->max_b_depth; priv->dpb_frames = 1 + ctx->max_b_depth;
if (avctx->level != FF_LEVEL_UNKNOWN) { if (avctx->level != AV_LEVEL_UNKNOWN) {
sps->level_idc = avctx->level; sps->level_idc = avctx->level;
} else { } else {
const H264LevelDescriptor *level; const H264LevelDescriptor *level;
@ -512,9 +512,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
pps->seq_parameter_set_id = 0; pps->seq_parameter_set_id = 0;
pps->entropy_coding_mode_flag = pps->entropy_coding_mode_flag =
!(sps->profile_idc == FF_PROFILE_H264_BASELINE || !(sps->profile_idc == AV_PROFILE_H264_BASELINE ||
sps->profile_idc == FF_PROFILE_H264_EXTENDED || sps->profile_idc == AV_PROFILE_H264_EXTENDED ||
sps->profile_idc == FF_PROFILE_H264_CAVLC_444); sps->profile_idc == AV_PROFILE_H264_CAVLC_444);
if (!priv->coder && pps->entropy_coding_mode_flag) if (!priv->coder && pps->entropy_coding_mode_flag)
pps->entropy_coding_mode_flag = 0; pps->entropy_coding_mode_flag = 0;
@ -523,9 +523,9 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
pps->pic_init_qp_minus26 = priv->fixed_qp_idr - 26; pps->pic_init_qp_minus26 = priv->fixed_qp_idr - 26;
if (sps->profile_idc == FF_PROFILE_H264_BASELINE || if (sps->profile_idc == AV_PROFILE_H264_BASELINE ||
sps->profile_idc == FF_PROFILE_H264_EXTENDED || sps->profile_idc == AV_PROFILE_H264_EXTENDED ||
sps->profile_idc == FF_PROFILE_H264_MAIN) { sps->profile_idc == AV_PROFILE_H264_MAIN) {
pps->more_rbsp_data = 0; pps->more_rbsp_data = 0;
} else { } else {
pps->more_rbsp_data = 1; pps->more_rbsp_data = 1;
@ -1159,13 +1159,13 @@ static av_cold int vaapi_encode_h264_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = { static const VAAPIEncodeProfile vaapi_encode_h264_profiles[] = {
#if VA_CHECK_VERSION(1, 18, 0) #if VA_CHECK_VERSION(1, 18, 0)
{ FF_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 }, { AV_PROFILE_H264_HIGH_10, 10, 3, 1, 1, VAProfileH264High10 },
#endif #endif
{ FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High }, { AV_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High },
{ FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main }, { AV_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main },
{ FF_PROFILE_H264_CONSTRAINED_BASELINE, { AV_PROFILE_H264_CONSTRAINED_BASELINE,
8, 3, 1, 1, VAProfileH264ConstrainedBaseline }, 8, 3, 1, 1, VAProfileH264ConstrainedBaseline },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const VAAPIEncodeType vaapi_encode_type_h264 = { static const VAAPIEncodeType vaapi_encode_type_h264 = {
@ -1207,40 +1207,40 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)
ctx->codec = &vaapi_encode_type_h264; ctx->codec = &vaapi_encode_type_h264;
if (avctx->profile == FF_PROFILE_UNKNOWN) if (avctx->profile == AV_PROFILE_UNKNOWN)
avctx->profile = priv->profile; avctx->profile = priv->profile;
if (avctx->level == FF_LEVEL_UNKNOWN) if (avctx->level == AV_LEVEL_UNKNOWN)
avctx->level = priv->level; avctx->level = priv->level;
if (avctx->compression_level == FF_COMPRESSION_DEFAULT) if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
avctx->compression_level = priv->quality; avctx->compression_level = priv->quality;
// Reject unsupported profiles. // Reject unsupported profiles.
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile is not " av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile is not "
"supported, using constrained baseline profile instead.\n"); "supported, using constrained baseline profile instead.\n");
avctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; avctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
break; break;
case FF_PROFILE_H264_EXTENDED: case AV_PROFILE_H264_EXTENDED:
av_log(avctx, AV_LOG_ERROR, "H.264 extended profile " av_log(avctx, AV_LOG_ERROR, "H.264 extended profile "
"is not supported.\n"); "is not supported.\n");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
case FF_PROFILE_H264_HIGH_10_INTRA: case AV_PROFILE_H264_HIGH_10_INTRA:
av_log(avctx, AV_LOG_ERROR, "H.264 high 10 intra profile " av_log(avctx, AV_LOG_ERROR, "H.264 high 10 intra profile "
"is not supported.\n"); "is not supported.\n");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
case FF_PROFILE_H264_HIGH_422: case AV_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_422_INTRA: case AV_PROFILE_H264_HIGH_422_INTRA:
case FF_PROFILE_H264_HIGH_444: case AV_PROFILE_H264_HIGH_444:
case FF_PROFILE_H264_HIGH_444_PREDICTIVE: case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
case FF_PROFILE_H264_HIGH_444_INTRA: case AV_PROFILE_H264_HIGH_444_INTRA:
case FF_PROFILE_H264_CAVLC_444: case AV_PROFILE_H264_CAVLC_444:
av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles " av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles "
"are not supported.\n"); "are not supported.\n");
return AVERROR_PATCHWELCOME; return AVERROR_PATCHWELCOME;
} }
if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) {
av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit "
"in 8-bit unsigned integer.\n", avctx->level); "in 8-bit unsigned integer.\n", avctx->level);
return AVERROR(EINVAL); return AVERROR(EINVAL);
@ -1313,19 +1313,19 @@ static const AVOption vaapi_encode_h264_options[] = {
{ "profile", "Set profile (profile_idc and constraint_set*_flag)", { "profile", "Set profile (profile_idc and constraint_set*_flag)",
OFFSET(profile), AV_OPT_TYPE_INT, OFFSET(profile), AV_OPT_TYPE_INT,
{ .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" }, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xffff, FLAGS, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "profile" { .i64 = value }, 0, 0, FLAGS, "profile"
{ PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) }, { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
{ PROFILE("main", FF_PROFILE_H264_MAIN) }, { PROFILE("main", AV_PROFILE_H264_MAIN) },
{ PROFILE("high", FF_PROFILE_H264_HIGH) }, { PROFILE("high", AV_PROFILE_H264_HIGH) },
{ PROFILE("high10", FF_PROFILE_H264_HIGH_10) }, { PROFILE("high10", AV_PROFILE_H264_HIGH_10) },
#undef PROFILE #undef PROFILE
{ "level", "Set level (level_idc)", { "level", "Set level (level_idc)",
OFFSET(level), AV_OPT_TYPE_INT, OFFSET(level), AV_OPT_TYPE_INT,
{ .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" },
#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "level" { .i64 = value }, 0, 0, FLAGS, "level"

View File

@ -346,7 +346,7 @@ static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
ptl->general_lower_bit_rate_constraint_flag = 1; ptl->general_lower_bit_rate_constraint_flag = 1;
if (avctx->level != FF_LEVEL_UNKNOWN) { if (avctx->level != AV_LEVEL_UNKNOWN) {
ptl->general_level_idc = avctx->level; ptl->general_level_idc = avctx->level;
} else { } else {
const H265LevelDescriptor *level; const H265LevelDescriptor *level;
@ -1290,22 +1290,22 @@ static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx)
} }
static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = { static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
{ FF_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain }, { AV_PROFILE_HEVC_MAIN, 8, 3, 1, 1, VAProfileHEVCMain },
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain }, { AV_PROFILE_HEVC_REXT, 8, 3, 1, 1, VAProfileHEVCMain },
#if VA_CHECK_VERSION(0, 37, 0) #if VA_CHECK_VERSION(0, 37, 0)
{ FF_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 }, { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 }, { AV_PROFILE_HEVC_REXT, 10, 3, 1, 1, VAProfileHEVCMain10 },
#endif #endif
#if VA_CHECK_VERSION(1, 2, 0) #if VA_CHECK_VERSION(1, 2, 0)
{ FF_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 }, { AV_PROFILE_HEVC_REXT, 12, 3, 1, 1, VAProfileHEVCMain12 },
{ FF_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 }, { AV_PROFILE_HEVC_REXT, 8, 3, 1, 0, VAProfileHEVCMain422_10 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 }, { AV_PROFILE_HEVC_REXT, 10, 3, 1, 0, VAProfileHEVCMain422_10 },
{ FF_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 }, { AV_PROFILE_HEVC_REXT, 12, 3, 1, 0, VAProfileHEVCMain422_12 },
{ FF_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 }, { AV_PROFILE_HEVC_REXT, 8, 3, 0, 0, VAProfileHEVCMain444 },
{ FF_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 }, { AV_PROFILE_HEVC_REXT, 10, 3, 0, 0, VAProfileHEVCMain444_10 },
{ FF_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 }, { AV_PROFILE_HEVC_REXT, 12, 3, 0, 0, VAProfileHEVCMain444_12 },
#endif #endif
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const VAAPIEncodeType vaapi_encode_type_h265 = { static const VAAPIEncodeType vaapi_encode_type_h265 = {
@ -1348,12 +1348,12 @@ static av_cold int vaapi_encode_h265_init(AVCodecContext *avctx)
ctx->codec = &vaapi_encode_type_h265; ctx->codec = &vaapi_encode_type_h265;
if (avctx->profile == FF_PROFILE_UNKNOWN) if (avctx->profile == AV_PROFILE_UNKNOWN)
avctx->profile = priv->profile; avctx->profile = priv->profile;
if (avctx->level == FF_LEVEL_UNKNOWN) if (avctx->level == AV_LEVEL_UNKNOWN)
avctx->level = priv->level; avctx->level = priv->level;
if (avctx->level != FF_LEVEL_UNKNOWN && avctx->level & ~0xff) { if (avctx->level != AV_LEVEL_UNKNOWN && avctx->level & ~0xff) {
av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit " av_log(avctx, AV_LOG_ERROR, "Invalid level %d: must fit "
"in 8-bit unsigned integer.\n", avctx->level); "in 8-bit unsigned integer.\n", avctx->level);
return AVERROR(EINVAL); return AVERROR(EINVAL);
@ -1395,13 +1395,13 @@ static const AVOption vaapi_encode_h265_options[] = {
{ "profile", "Set profile (general_profile_idc)", { "profile", "Set profile (general_profile_idc)",
OFFSET(profile), AV_OPT_TYPE_INT, OFFSET(profile), AV_OPT_TYPE_INT,
{ .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" }, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 0xff, FLAGS, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "profile" { .i64 = value }, 0, 0, FLAGS, "profile"
{ PROFILE("main", FF_PROFILE_HEVC_MAIN) }, { PROFILE("main", AV_PROFILE_HEVC_MAIN) },
{ PROFILE("main10", FF_PROFILE_HEVC_MAIN_10) }, { PROFILE("main10", AV_PROFILE_HEVC_MAIN_10) },
{ PROFILE("rext", FF_PROFILE_HEVC_REXT) }, { PROFILE("rext", AV_PROFILE_HEVC_REXT) },
#undef PROFILE #undef PROFILE
{ "tier", "Set tier (general_tier_flag)", { "tier", "Set tier (general_tier_flag)",
@ -1414,7 +1414,7 @@ static const AVOption vaapi_encode_h265_options[] = {
{ "level", "Set level (general_level_idc)", { "level", "Set level (general_level_idc)",
OFFSET(level), AV_OPT_TYPE_INT, OFFSET(level), AV_OPT_TYPE_INT,
{ .i64 = FF_LEVEL_UNKNOWN }, FF_LEVEL_UNKNOWN, 0xff, FLAGS, "level" }, { .i64 = AV_LEVEL_UNKNOWN }, AV_LEVEL_UNKNOWN, 0xff, FLAGS, "level" },
#define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ #define LEVEL(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "level" { .i64 = value }, 0, 0, FLAGS, "level"

View File

@ -480,15 +480,15 @@ static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx)
} }
static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = { static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = {
{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 1, 0, 0, VAProfileJPEGBaseline }, 8, 1, 0, 0, VAProfileJPEGBaseline },
{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 3, 1, 1, VAProfileJPEGBaseline }, 8, 3, 1, 1, VAProfileJPEGBaseline },
{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 3, 1, 0, VAProfileJPEGBaseline }, 8, 3, 1, 0, VAProfileJPEGBaseline },
{ FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT, { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
8, 3, 0, 0, VAProfileJPEGBaseline }, 8, 3, 0, 0, VAProfileJPEGBaseline },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const VAAPIEncodeType vaapi_encode_type_mjpeg = { static const VAAPIEncodeType vaapi_encode_type_mjpeg = {

View File

@ -558,9 +558,9 @@ static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
} }
static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = { static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = {
{ FF_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main }, { AV_PROFILE_MPEG2_MAIN, 8, 3, 1, 1, VAProfileMPEG2Main },
{ FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple }, { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const VAAPIEncodeType vaapi_encode_type_mpeg2 = { static const VAAPIEncodeType vaapi_encode_type_mpeg2 = {
@ -595,9 +595,9 @@ static av_cold int vaapi_encode_mpeg2_init(AVCodecContext *avctx)
ctx->codec = &vaapi_encode_type_mpeg2; ctx->codec = &vaapi_encode_type_mpeg2;
if (avctx->profile == FF_PROFILE_UNKNOWN) if (avctx->profile == AV_PROFILE_UNKNOWN)
avctx->profile = priv->profile; avctx->profile = priv->profile;
if (avctx->level == FF_LEVEL_UNKNOWN) if (avctx->level == AV_LEVEL_UNKNOWN)
avctx->level = priv->level; avctx->level = priv->level;
// Reject unknown levels (these are required to set f_code for // Reject unknown levels (these are required to set f_code for
@ -644,12 +644,12 @@ static const AVOption vaapi_encode_mpeg2_options[] = {
{ "profile", "Set profile (in profile_and_level_indication)", { "profile", "Set profile (in profile_and_level_indication)",
OFFSET(profile), AV_OPT_TYPE_INT, OFFSET(profile), AV_OPT_TYPE_INT,
{ .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, 7, FLAGS, "profile" }, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, 7, FLAGS, "profile" },
#define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \ #define PROFILE(name, value) name, NULL, 0, AV_OPT_TYPE_CONST, \
{ .i64 = value }, 0, 0, FLAGS, "profile" { .i64 = value }, 0, 0, FLAGS, "profile"
{ PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) }, { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) },
{ PROFILE("main", FF_PROFILE_MPEG2_MAIN) }, { PROFILE("main", AV_PROFILE_MPEG2_MAIN) },
#undef PROFILE #undef PROFILE
{ "level", "Set level (in profile_and_level_indication)", { "level", "Set level (in profile_and_level_indication)",

View File

@ -180,7 +180,7 @@ static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx)
static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = { static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = {
{ 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 }, { 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const VAAPIEncodeType vaapi_encode_type_vp8 = { static const VAAPIEncodeType vaapi_encode_type_vp8 = {

View File

@ -227,11 +227,11 @@ static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
} }
static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = { static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
{ FF_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 }, { AV_PROFILE_VP9_0, 8, 3, 1, 1, VAProfileVP9Profile0 },
{ FF_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 }, { AV_PROFILE_VP9_1, 8, 3, 0, 0, VAProfileVP9Profile1 },
{ FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 }, { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
{ FF_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 }, { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
{ FF_PROFILE_UNKNOWN } { AV_PROFILE_UNKNOWN }
}; };
static const VAAPIEncodeType vaapi_encode_type_vp9 = { static const VAAPIEncodeType vaapi_encode_type_vp9 = {

View File

@ -227,8 +227,8 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
} }
#if VA_CHECK_VERSION(1, 2, 0) #if VA_CHECK_VERSION(1, 2, 0)
if (avctx->profile == FF_PROFILE_HEVC_REXT || if (avctx->profile == AV_PROFILE_HEVC_REXT ||
avctx->profile == FF_PROFILE_HEVC_SCC) { avctx->profile == AV_PROFILE_HEVC_SCC) {
pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) { pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) {
.range_extension_pic_fields.bits = { .range_extension_pic_fields.bits = {
.transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag, .transform_skip_rotation_enabled_flag = sps->transform_skip_rotation_enabled_flag,
@ -262,7 +262,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
sps->sps_num_palette_predictor_initializers : sps->sps_num_palette_predictor_initializers :
0); 0);
if (avctx->profile == FF_PROFILE_HEVC_SCC) { if (avctx->profile == AV_PROFILE_HEVC_SCC) {
pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) { pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) {
.screen_content_pic_fields.bits = { .screen_content_pic_fields.bits = {
.pps_curr_pic_ref_enabled_flag = pps->pps_curr_pic_ref_enabled_flag, .pps_curr_pic_ref_enabled_flag = pps->pps_curr_pic_ref_enabled_flag,
@ -294,7 +294,7 @@ static int vaapi_hevc_start_frame(AVCodecContext *avctx,
} }
#endif #endif
pic_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? pic_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC); sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC);
err = ff_vaapi_decode_make_param_buffer(avctx, &pic->pic, err = ff_vaapi_decode_make_param_buffer(avctx, &pic->pic,
@ -347,7 +347,7 @@ static int vaapi_hevc_end_frame(AVCodecContext *avctx)
VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
int ret; int ret;
int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC);
if (pic->last_size) { if (pic->last_size) {
@ -377,10 +377,10 @@ static void fill_pred_weight_table(AVCodecContext *avctx,
{ {
int i; int i;
#if VA_CHECK_VERSION(1, 2, 0) #if VA_CHECK_VERSION(1, 2, 0)
int is_rext = avctx->profile >= FF_PROFILE_HEVC_REXT; int is_rext = avctx->profile >= AV_PROFILE_HEVC_REXT;
#else #else
int is_rext = 0; int is_rext = 0;
if (avctx->profile >= FF_PROFILE_HEVC_REXT) if (avctx->profile >= AV_PROFILE_HEVC_REXT)
av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 1.2.0 " av_log(avctx, AV_LOG_WARNING, "Please consider to update to VAAPI 1.2.0 "
"or above, which can support REXT related setting correctly.\n"); "or above, which can support REXT related setting correctly.\n");
#endif #endif
@ -461,7 +461,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private; VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param; VASliceParameterBufferHEVC *last_slice_param = (VASliceParameterBufferHEVC *)&pic->last_slice_param;
int slice_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ? int slice_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC); sizeof(pic->last_slice_param) : sizeof(VASliceParameterBufferHEVC);
int nb_list = (sh->slice_type == HEVC_SLICE_B) ? int nb_list = (sh->slice_type == HEVC_SLICE_B) ?
@ -526,7 +526,7 @@ static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
fill_pred_weight_table(avctx, h, sh, last_slice_param); fill_pred_weight_table(avctx, h, sh, last_slice_param);
#if VA_CHECK_VERSION(1, 2, 0) #if VA_CHECK_VERSION(1, 2, 0)
if (avctx->profile >= FF_PROFILE_HEVC_REXT) { if (avctx->profile >= AV_PROFILE_HEVC_REXT) {
pic->last_slice_param.rext = (VASliceParameterBufferHEVCRext) { pic->last_slice_param.rext = (VASliceParameterBufferHEVCRext) {
.slice_ext_flags.bits = { .slice_ext_flags.bits = {
.cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag, .cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag,

View File

@ -337,13 +337,13 @@ static int vdpau_av1_init(AVCodecContext *avctx)
uint32_t level = avctx->level; uint32_t level = avctx->level;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_AV1_MAIN: case AV_PROFILE_AV1_MAIN:
profile = VDP_DECODER_PROFILE_AV1_MAIN; profile = VDP_DECODER_PROFILE_AV1_MAIN;
break; break;
case FF_PROFILE_AV1_HIGH: case AV_PROFILE_AV1_HIGH:
profile = VDP_DECODER_PROFILE_AV1_HIGH; profile = VDP_DECODER_PROFILE_AV1_HIGH;
break; break;
case FF_PROFILE_AV1_PROFESSIONAL: case AV_PROFILE_AV1_PROFESSIONAL:
profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL; profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL;
break; break;
default: default:

View File

@ -219,35 +219,35 @@ static int vdpau_h264_init(AVCodecContext *avctx)
VdpDecoderProfile profile; VdpDecoderProfile profile;
uint32_t level = avctx->level; uint32_t level = avctx->level;
switch (avctx->profile & ~FF_PROFILE_H264_INTRA) { switch (avctx->profile & ~AV_PROFILE_H264_INTRA) {
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
profile = VDP_DECODER_PROFILE_H264_BASELINE; profile = VDP_DECODER_PROFILE_H264_BASELINE;
break; break;
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case AV_PROFILE_H264_CONSTRAINED_BASELINE:
#ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE #ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE; profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE;
break; break;
#endif #endif
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
profile = VDP_DECODER_PROFILE_H264_MAIN; profile = VDP_DECODER_PROFILE_H264_MAIN;
break; break;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
profile = VDP_DECODER_PROFILE_H264_HIGH; profile = VDP_DECODER_PROFILE_H264_HIGH;
break; break;
#ifdef VDP_DECODER_PROFILE_H264_EXTENDED #ifdef VDP_DECODER_PROFILE_H264_EXTENDED
case FF_PROFILE_H264_EXTENDED: case AV_PROFILE_H264_EXTENDED:
profile = VDP_DECODER_PROFILE_H264_EXTENDED; profile = VDP_DECODER_PROFILE_H264_EXTENDED;
break; break;
#endif #endif
case FF_PROFILE_H264_HIGH_10: case AV_PROFILE_H264_HIGH_10:
/* XXX: High 10 can be treated as High so long as only 8 bits per /* XXX: High 10 can be treated as High so long as only 8 bits per
* format are supported. */ * format are supported. */
profile = VDP_DECODER_PROFILE_H264_HIGH; profile = VDP_DECODER_PROFILE_H264_HIGH;
break; break;
#ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
case FF_PROFILE_H264_HIGH_422: case AV_PROFILE_H264_HIGH_422:
case FF_PROFILE_H264_HIGH_444_PREDICTIVE: case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
case FF_PROFILE_H264_CAVLC_444: case AV_PROFILE_H264_CAVLC_444:
profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE; profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE;
break; break;
#endif #endif
@ -255,7 +255,7 @@ static int vdpau_h264_init(AVCodecContext *avctx)
return AVERROR(ENOTSUP); return AVERROR(ENOTSUP);
} }
if ((avctx->profile & FF_PROFILE_H264_INTRA) && avctx->level == 11) if ((avctx->profile & AV_PROFILE_H264_INTRA) && avctx->level == 11)
level = VDP_DECODER_LEVEL_H264_1b; level = VDP_DECODER_LEVEL_H264_1b;
return ff_vdpau_common_init(avctx, profile, level); return ff_vdpau_common_init(avctx, profile, level);

View File

@ -519,16 +519,16 @@ static int vdpau_hevc_init(AVCodecContext *avctx)
int ret; int ret;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_HEVC_MAIN: case AV_PROFILE_HEVC_MAIN:
profile = VDP_DECODER_PROFILE_HEVC_MAIN; profile = VDP_DECODER_PROFILE_HEVC_MAIN;
break; break;
case FF_PROFILE_HEVC_MAIN_10: case AV_PROFILE_HEVC_MAIN_10:
profile = VDP_DECODER_PROFILE_HEVC_MAIN_10; profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
break; break;
case FF_PROFILE_HEVC_MAIN_STILL_PICTURE: case AV_PROFILE_HEVC_MAIN_STILL_PICTURE:
profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL; profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
break; break;
case FF_PROFILE_HEVC_REXT: case AV_PROFILE_HEVC_REXT:
ret = vdpau_hevc_parse_rext_profile(avctx, &profile); ret = vdpau_hevc_parse_rext_profile(avctx, &profile);
if (ret) if (ret)
return AVERROR(ENOTSUP); return AVERROR(ENOTSUP);

View File

@ -128,10 +128,10 @@ static int vdpau_mpeg2_init(AVCodecContext *avctx)
VdpDecoderProfile profile; VdpDecoderProfile profile;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_MPEG2_MAIN: case AV_PROFILE_MPEG2_MAIN:
profile = VDP_DECODER_PROFILE_MPEG2_MAIN; profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
break; break;
case FF_PROFILE_MPEG2_SIMPLE: case AV_PROFILE_MPEG2_SIMPLE:
profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE;
break; break;
default: default:

View File

@ -95,13 +95,13 @@ static int vdpau_mpeg4_init(AVCodecContext *avctx)
VdpDecoderProfile profile; VdpDecoderProfile profile;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_MPEG4_SIMPLE: case AV_PROFILE_MPEG4_SIMPLE:
profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP; profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP;
break; break;
// As any ASP decoder must be able to decode SP, this // As any ASP decoder must be able to decode SP, this
// should be a safe fallback if profile is unknown/unspecified. // should be a safe fallback if profile is unknown/unspecified.
case FF_PROFILE_UNKNOWN: case AV_PROFILE_UNKNOWN:
case FF_PROFILE_MPEG4_ADVANCED_SIMPLE: case AV_PROFILE_MPEG4_ADVANCED_SIMPLE:
profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP; profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
break; break;
default: default:

View File

@ -121,13 +121,13 @@ static int vdpau_vc1_init(AVCodecContext *avctx)
VdpDecoderProfile profile; VdpDecoderProfile profile;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_VC1_SIMPLE: case AV_PROFILE_VC1_SIMPLE:
profile = VDP_DECODER_PROFILE_VC1_SIMPLE; profile = VDP_DECODER_PROFILE_VC1_SIMPLE;
break; break;
case FF_PROFILE_VC1_MAIN: case AV_PROFILE_VC1_MAIN:
profile = VDP_DECODER_PROFILE_VC1_MAIN; profile = VDP_DECODER_PROFILE_VC1_MAIN;
break; break;
case FF_PROFILE_VC1_ADVANCED: case AV_PROFILE_VC1_ADVANCED:
profile = VDP_DECODER_PROFILE_VC1_ADVANCED; profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
break; break;
default: default:

View File

@ -203,16 +203,16 @@ static int vdpau_vp9_init(AVCodecContext *avctx)
uint32_t level = avctx->level; uint32_t level = avctx->level;
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_VP9_0: case AV_PROFILE_VP9_0:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_0; profile = VDP_DECODER_PROFILE_VP9_PROFILE_0;
break; break;
case FF_PROFILE_VP9_1: case AV_PROFILE_VP9_1:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_1; profile = VDP_DECODER_PROFILE_VP9_PROFILE_1;
break; break;
case FF_PROFILE_VP9_2: case AV_PROFILE_VP9_2:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_2; profile = VDP_DECODER_PROFILE_VP9_PROFILE_2;
break; break;
case FF_PROFILE_VP9_3: case AV_PROFILE_VP9_3:
profile = VDP_DECODER_PROFILE_VP9_PROFILE_3; profile = VDP_DECODER_PROFILE_VP9_PROFILE_3;
break; break;
default: default:

View File

@ -29,8 +29,8 @@
#include "version_major.h" #include "version_major.h"
#define LIBAVCODEC_VERSION_MINOR 25 #define LIBAVCODEC_VERSION_MINOR 26
#define LIBAVCODEC_VERSION_MICRO 102 #define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \

View File

@ -51,6 +51,7 @@
#define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_DROPCHANGED (LIBAVCODEC_VERSION_MAJOR < 61)
#define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62) #define FF_API_AVFFT (LIBAVCODEC_VERSION_MAJOR < 62)
#define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62)
// reminder to remove CrystalHD decoders on next major bump // reminder to remove CrystalHD decoders on next major bump
#define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)

View File

@ -206,7 +206,7 @@ static void loadVTEncSymbols(void){
GET_SYM(kVTCompressionPropertyKey_MinAllowedFrameQP, "MinAllowedFrameQP"); GET_SYM(kVTCompressionPropertyKey_MinAllowedFrameQP, "MinAllowedFrameQP");
} }
#define H264_PROFILE_CONSTRAINED_HIGH (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED) #define H264_PROFILE_CONSTRAINED_HIGH (AV_PROFILE_H264_HIGH | AV_PROFILE_H264_CONSTRAINED)
typedef enum VTH264Entropy{ typedef enum VTH264Entropy{
VT_ENTROPY_NOT_SET, VT_ENTROPY_NOT_SET,
@ -455,22 +455,22 @@ static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx,
return kCMVideoCodecType_HEVC; return kCMVideoCodecType_HEVC;
case AV_CODEC_ID_PRORES: case AV_CODEC_ID_PRORES:
switch (profile) { switch (profile) {
case FF_PROFILE_PRORES_PROXY: case AV_PROFILE_PRORES_PROXY:
return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy return MKBETAG('a','p','c','o'); // kCMVideoCodecType_AppleProRes422Proxy
case FF_PROFILE_PRORES_LT: case AV_PROFILE_PRORES_LT:
return MKBETAG('a','p','c','s'); // kCMVideoCodecType_AppleProRes422LT return MKBETAG('a','p','c','s'); // kCMVideoCodecType_AppleProRes422LT
case FF_PROFILE_PRORES_STANDARD: case AV_PROFILE_PRORES_STANDARD:
return MKBETAG('a','p','c','n'); // kCMVideoCodecType_AppleProRes422 return MKBETAG('a','p','c','n'); // kCMVideoCodecType_AppleProRes422
case FF_PROFILE_PRORES_HQ: case AV_PROFILE_PRORES_HQ:
return MKBETAG('a','p','c','h'); // kCMVideoCodecType_AppleProRes422HQ return MKBETAG('a','p','c','h'); // kCMVideoCodecType_AppleProRes422HQ
case FF_PROFILE_PRORES_4444: case AV_PROFILE_PRORES_4444:
return MKBETAG('a','p','4','h'); // kCMVideoCodecType_AppleProRes4444 return MKBETAG('a','p','4','h'); // kCMVideoCodecType_AppleProRes4444
case FF_PROFILE_PRORES_XQ: case AV_PROFILE_PRORES_XQ:
return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ return MKBETAG('a','p','4','x'); // kCMVideoCodecType_AppleProRes4444XQ
default: default:
av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile); av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile);
case FF_PROFILE_UNKNOWN: case AV_PROFILE_UNKNOWN:
if (desc && if (desc &&
((desc->flags & AV_PIX_FMT_FLAG_ALPHA) || ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) ||
desc->log2_chroma_w == 0)) desc->log2_chroma_w == 0))
@ -736,18 +736,18 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
VTEncContext *vtctx = avctx->priv_data; VTEncContext *vtctx = avctx->priv_data;
int profile = vtctx->profile; int profile = vtctx->profile;
if (profile == FF_PROFILE_UNKNOWN && vtctx->level) { if (profile == AV_PROFILE_UNKNOWN && vtctx->level) {
//Need to pick a profile if level is not auto-selected. //Need to pick a profile if level is not auto-selected.
profile = vtctx->has_b_frames ? FF_PROFILE_H264_MAIN : FF_PROFILE_H264_BASELINE; profile = vtctx->has_b_frames ? AV_PROFILE_H264_MAIN : AV_PROFILE_H264_BASELINE;
} }
*profile_level_val = NULL; *profile_level_val = NULL;
switch (profile) { switch (profile) {
case FF_PROFILE_UNKNOWN: case AV_PROFILE_UNKNOWN:
return true; return true;
case FF_PROFILE_H264_BASELINE: case AV_PROFILE_H264_BASELINE:
switch (vtctx->level) { switch (vtctx->level) {
case 0: *profile_level_val = case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break; compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break;
@ -769,7 +769,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
} }
break; break;
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case AV_PROFILE_H264_CONSTRAINED_BASELINE:
*profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel; *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
if (vtctx->level != 0) { if (vtctx->level != 0) {
@ -781,7 +781,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
} }
break; break;
case FF_PROFILE_H264_MAIN: case AV_PROFILE_H264_MAIN:
switch (vtctx->level) { switch (vtctx->level) {
case 0: *profile_level_val = case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break; compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break;
@ -812,7 +812,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
} }
break; break;
case FF_PROFILE_H264_HIGH: case AV_PROFILE_H264_HIGH:
switch (vtctx->level) { switch (vtctx->level) {
case 0: *profile_level_val = case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_High_AutoLevel; break; compat_keys.kVTProfileLevel_H264_High_AutoLevel; break;
@ -835,7 +835,7 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
compat_keys.kVTProfileLevel_H264_High_5_2; break; compat_keys.kVTProfileLevel_H264_High_5_2; break;
} }
break; break;
case FF_PROFILE_H264_EXTENDED: case AV_PROFILE_H264_EXTENDED:
switch (vtctx->level) { switch (vtctx->level) {
case 0: *profile_level_val = case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break; compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break;
@ -868,13 +868,13 @@ static bool get_vt_hevc_profile_level(AVCodecContext *avctx,
*profile_level_val = NULL; *profile_level_val = NULL;
switch (profile) { switch (profile) {
case FF_PROFILE_UNKNOWN: case AV_PROFILE_UNKNOWN:
return true; return true;
case FF_PROFILE_HEVC_MAIN: case AV_PROFILE_HEVC_MAIN:
*profile_level_val = *profile_level_val =
compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel; compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel;
break; break;
case FF_PROFILE_HEVC_MAIN_10: case AV_PROFILE_HEVC_MAIN_10:
*profile_level_val = *profile_level_val =
compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel; compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel;
break; break;
@ -1521,12 +1521,12 @@ static int vtenc_configure_encoder(AVCodecContext *avctx)
vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex; vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex;
vtctx->has_b_frames = avctx->max_b_frames > 0; vtctx->has_b_frames = avctx->max_b_frames > 0;
if(vtctx->has_b_frames && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE){ if(vtctx->has_b_frames && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE){
av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n"); av_log(avctx, AV_LOG_WARNING, "Cannot use B-frames with baseline profile. Output will not contain B-frames.\n");
vtctx->has_b_frames = 0; vtctx->has_b_frames = 0;
} }
if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == FF_PROFILE_H264_BASELINE) { if (vtctx->entropy == VT_CABAC && (0xFF & vtctx->profile) == AV_PROFILE_H264_BASELINE) {
av_log(avctx, AV_LOG_WARNING, "CABAC entropy requires 'main' or 'high' profile, but baseline was requested. Encode will not use CABAC entropy.\n"); av_log(avctx, AV_LOG_WARNING, "CABAC entropy requires 'main' or 'high' profile, but baseline was requested. Encode will not use CABAC entropy.\n");
vtctx->entropy = VT_ENTROPY_NOT_SET; vtctx->entropy = VT_ENTROPY_NOT_SET;
} }
@ -1632,7 +1632,7 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
pthread_cond_init(&vtctx->cv_sample_sent, NULL); pthread_cond_init(&vtctx->cv_sample_sent, NULL);
// It can happen when user set avctx->profile directly. // It can happen when user set avctx->profile directly.
if (vtctx->profile == FF_PROFILE_UNKNOWN) if (vtctx->profile == AV_PROFILE_UNKNOWN)
vtctx->profile = avctx->profile; vtctx->profile = avctx->profile;
vtctx->session = NULL; vtctx->session = NULL;
status = vtenc_configure_encoder(avctx); status = vtenc_configure_encoder(avctx);
@ -2778,13 +2778,13 @@ static const enum AVPixelFormat prores_pix_fmts[] = {
#define OFFSET(x) offsetof(VTEncContext, x) #define OFFSET(x) offsetof(VTEncContext, x)
static const AVOption h264_options[] = { static const AVOption h264_options[] = {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" },
{ "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
{ "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" }, { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
{ "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
{ "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
{ "constrained_high", "Constrained High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROFILE_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" }, { "constrained_high", "Constrained High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROFILE_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
{ "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" }, { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_H264_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" },
{ "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" }, { "level", "Level", OFFSET(level), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 52, VE, "level" },
{ "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" }, { "1.3", "Level 1.3, only available with Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = 13 }, INT_MIN, INT_MAX, VE, "level" },
@ -2835,9 +2835,9 @@ const FFCodec ff_h264_videotoolbox_encoder = {
}; };
static const AVOption hevc_options[] = { static const AVOption hevc_options[] = {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, INT_MAX, VE, "profile" }, { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, INT_MAX, VE, "profile" },
{ "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" }, { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
{ "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" }, { "main10", "Main10 Profile", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, VE, "profile" },
{ "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE }, { "alpha_quality", "Compression quality for the alpha channel", OFFSET(alpha_quality), AV_OPT_TYPE_DOUBLE, { .dbl = 0.0 }, 0.0, 1.0, VE },
@ -2872,14 +2872,14 @@ const FFCodec ff_hevc_videotoolbox_encoder = {
}; };
static const AVOption prores_options[] = { static const AVOption prores_options[] = {
{ "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_PROFILE_PRORES_XQ, VE, "profile" }, { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = AV_PROFILE_UNKNOWN }, AV_PROFILE_UNKNOWN, AV_PROFILE_PRORES_XQ, VE, "profile" },
{ "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" }, { "auto", "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, VE, "profile" },
{ "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" }, { "proxy", "ProRes 422 Proxy", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_PROXY }, INT_MIN, INT_MAX, VE, "profile" },
{ "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" }, { "lt", "ProRes 422 LT", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_LT }, INT_MIN, INT_MAX, VE, "profile" },
{ "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" }, { "standard", "ProRes 422", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_STANDARD }, INT_MIN, INT_MAX, VE, "profile" },
{ "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" }, { "hq", "ProRes 422 HQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_HQ }, INT_MIN, INT_MAX, VE, "profile" },
{ "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" }, { "4444", "ProRes 4444", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_4444 }, INT_MIN, INT_MAX, VE, "profile" },
{ "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" }, { "xq", "ProRes 4444 XQ", 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_PRORES_XQ }, INT_MIN, INT_MAX, VE, "profile" },
COMMON_OPTIONS COMMON_OPTIONS
{ NULL }, { NULL },

View File

@ -696,8 +696,8 @@ static VkResult vulkan_setup_profile(AVCodecContext *avctx,
/* Vulkan transmits all the constrant_set flags, rather than wanting them /* Vulkan transmits all the constrant_set flags, rather than wanting them
* merged in the profile IDC */ * merged in the profile IDC */
h264_profile->stdProfileIdc = cur_profile & ~(FF_PROFILE_H264_CONSTRAINED | h264_profile->stdProfileIdc = cur_profile & ~(AV_PROFILE_H264_CONSTRAINED |
FF_PROFILE_H264_INTRA); AV_PROFILE_H264_INTRA);
h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN || h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN ||
avctx->field_order == AV_FIELD_PROGRESSIVE ? avctx->field_order == AV_FIELD_PROGRESSIVE ?
@ -789,8 +789,8 @@ static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
} }
cur_profile = avctx->profile; cur_profile = avctx->profile;
base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? FF_PROFILE_H264_CONSTRAINED_BASELINE : base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE :
avctx->codec_id == AV_CODEC_ID_H265 ? FF_PROFILE_HEVC_MAIN : avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN :
avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN : avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN :
0; 0;

View File

@ -23,7 +23,7 @@
#include "libavutil/mem.h" #include "libavutil/mem.h"
#include "libavcodec/av1.h" #include "libavcodec/av1.h"
#include "libavcodec/av1_parse.h" #include "libavcodec/av1_parse.h"
#include "libavcodec/avcodec.h" #include "libavcodec/defs.h"
#include "libavcodec/put_bits.h" #include "libavcodec/put_bits.h"
#include "av1.h" #include "av1.h"
#include "avio.h" #include "avio.h"
@ -141,12 +141,12 @@ static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *
{ {
int twelve_bit = 0; int twelve_bit = 0;
int high_bitdepth = get_bits1(gb); int high_bitdepth = get_bits1(gb);
if (seq_params->profile == FF_PROFILE_AV1_PROFESSIONAL && high_bitdepth) if (seq_params->profile == AV_PROFILE_AV1_PROFESSIONAL && high_bitdepth)
twelve_bit = get_bits1(gb); twelve_bit = get_bits1(gb);
seq_params->bitdepth = 8 + (high_bitdepth * 2) + (twelve_bit * 2); seq_params->bitdepth = 8 + (high_bitdepth * 2) + (twelve_bit * 2);
if (seq_params->profile == FF_PROFILE_AV1_HIGH) if (seq_params->profile == AV_PROFILE_AV1_HIGH)
seq_params->monochrome = 0; seq_params->monochrome = 0;
else else
seq_params->monochrome = get_bits1(gb); seq_params->monochrome = get_bits1(gb);
@ -176,10 +176,10 @@ static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *
} else { } else {
seq_params->color_range = get_bits1(gb); seq_params->color_range = get_bits1(gb);
if (seq_params->profile == FF_PROFILE_AV1_MAIN) { if (seq_params->profile == AV_PROFILE_AV1_MAIN) {
seq_params->chroma_subsampling_x = 1; seq_params->chroma_subsampling_x = 1;
seq_params->chroma_subsampling_y = 1; seq_params->chroma_subsampling_y = 1;
} else if (seq_params->profile == FF_PROFILE_AV1_HIGH) { } else if (seq_params->profile == AV_PROFILE_AV1_HIGH) {
seq_params->chroma_subsampling_x = 0; seq_params->chroma_subsampling_x = 0;
seq_params->chroma_subsampling_y = 0; seq_params->chroma_subsampling_y = 0;
} else { } else {

View File

@ -39,7 +39,7 @@
#include "libavutil/time.h" #include "libavutil/time.h"
#include "libavutil/time_internal.h" #include "libavutil/time_internal.h"
#include "libavcodec/avcodec.h" #include "libavcodec/defs.h"
#include "avformat.h" #include "avformat.h"
#include "avio_internal.h" #include "avio_internal.h"
@ -369,12 +369,12 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
} }
} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) { } else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
uint8_t *data = st->codecpar->extradata; uint8_t *data = st->codecpar->extradata;
int profile = FF_PROFILE_UNKNOWN; int profile = AV_PROFILE_UNKNOWN;
int level = FF_LEVEL_UNKNOWN; int level = AV_LEVEL_UNKNOWN;
if (st->codecpar->profile != FF_PROFILE_UNKNOWN) if (st->codecpar->profile != AV_PROFILE_UNKNOWN)
profile = st->codecpar->profile; profile = st->codecpar->profile;
if (st->codecpar->level != FF_LEVEL_UNKNOWN) if (st->codecpar->level != AV_LEVEL_UNKNOWN)
level = st->codecpar->level; level = st->codecpar->level;
/* check the boundary of data which from current position is small than extradata_size */ /* check the boundary of data which from current position is small than extradata_size */
@ -407,8 +407,8 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
data++; data++;
} }
if (st->codecpar->codec_tag == MKTAG('h','v','c','1') && if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
profile != FF_PROFILE_UNKNOWN && profile != AV_PROFILE_UNKNOWN &&
level != FF_LEVEL_UNKNOWN) { level != AV_LEVEL_UNKNOWN) {
snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", av_fourcc2str(st->codecpar->codec_tag), profile, level); snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", av_fourcc2str(st->codecpar->codec_tag), profile, level);
} else } else
goto fail; goto fail;

View File

@ -51,8 +51,8 @@
#include "libavutil/time_internal.h" #include "libavutil/time_internal.h"
#include "libavutil/spherical.h" #include "libavutil/spherical.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavcodec/defs.h"
#include "libavcodec/flac.h" #include "libavcodec/flac.h"
#include "libavcodec/mpeg4audio.h" #include "libavcodec/mpeg4audio.h"
#include "libavcodec/packet_internal.h" #include "libavcodec/packet_internal.h"
@ -3037,21 +3037,21 @@ static int mkv_parse_subtitle_codec(MatroskaTrack *track, AVStream *st,
// [0x30..0x37] are component tags utilized for // [0x30..0x37] are component tags utilized for
// non-mobile captioning service ("profile A"). // non-mobile captioning service ("profile A").
if (component_tag >= 0x30 && component_tag <= 0x37) { if (component_tag >= 0x30 && component_tag <= 0x37) {
par->profile = FF_PROFILE_ARIB_PROFILE_A; par->profile = AV_PROFILE_ARIB_PROFILE_A;
} }
break; break;
case 0x0012: case 0x0012:
// component tag 0x87 signifies a mobile/partial reception // component tag 0x87 signifies a mobile/partial reception
// (1seg) captioning service ("profile C"). // (1seg) captioning service ("profile C").
if (component_tag == 0x87) { if (component_tag == 0x87) {
par->profile = FF_PROFILE_ARIB_PROFILE_C; par->profile = AV_PROFILE_ARIB_PROFILE_C;
} }
break; break;
default: default:
break; break;
} }
if (par->profile == FF_PROFILE_UNKNOWN) if (par->profile == AV_PROFILE_UNKNOWN)
av_log(matroska->ctx, AV_LOG_WARNING, av_log(matroska->ctx, AV_LOG_WARNING,
"Unknown ARIB caption profile utilized: %02x / %04x\n", "Unknown ARIB caption profile utilized: %02x / %04x\n",
component_tag, data_component_id); component_tag, data_component_id);

View File

@ -59,9 +59,9 @@
#include "libavutil/stereo3d.h" #include "libavutil/stereo3d.h"
#include "libavcodec/av1.h" #include "libavcodec/av1.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavcodec/codec_desc.h" #include "libavcodec/codec_desc.h"
#include "libavcodec/defs.h"
#include "libavcodec/xiph.h" #include "libavcodec/xiph.h"
#include "libavcodec/mpeg4audio.h" #include "libavcodec/mpeg4audio.h"
@ -1154,11 +1154,11 @@ static int mkv_assemble_native_codecprivate(AVFormatContext *s, AVIOContext *dyn
case AV_CODEC_ID_ARIB_CAPTION: { case AV_CODEC_ID_ARIB_CAPTION: {
unsigned stream_identifier, data_component_id; unsigned stream_identifier, data_component_id;
switch (par->profile) { switch (par->profile) {
case FF_PROFILE_ARIB_PROFILE_A: case AV_PROFILE_ARIB_PROFILE_A:
stream_identifier = 0x30; stream_identifier = 0x30;
data_component_id = 0x0008; data_component_id = 0x0008;
break; break;
case FF_PROFILE_ARIB_PROFILE_C: case AV_PROFILE_ARIB_PROFILE_C:
stream_identifier = 0x87; stream_identifier = 0x87;
data_component_id = 0x0012; data_component_id = 0x0012;
break; break;

View File

@ -1757,8 +1757,8 @@ static const struct {
static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track) static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track)
{ {
int tag = MKTAG('A','V','d','n'); int tag = MKTAG('A','V','d','n');
if (track->par->profile != FF_PROFILE_UNKNOWN && if (track->par->profile != AV_PROFILE_UNKNOWN &&
track->par->profile != FF_PROFILE_DNXHD) track->par->profile != AV_PROFILE_DNXHD)
tag = MKTAG('A','V','d','h'); tag = MKTAG('A','V','d','h');
return tag; return tag;
} }
@ -4766,10 +4766,10 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
if (track->par->codec_id == AV_CODEC_ID_AAC) { if (track->par->codec_id == AV_CODEC_ID_AAC) {
switch (track->par->profile) switch (track->par->profile)
{ {
case FF_PROFILE_AAC_HE_V2: case AV_PROFILE_AAC_HE_V2:
param_write_string(pb, "FourCC", "AACP"); param_write_string(pb, "FourCC", "AACP");
break; break;
case FF_PROFILE_AAC_HE: case AV_PROFILE_AAC_HE:
param_write_string(pb, "FourCC", "AACH"); param_write_string(pb, "FourCC", "AACH");
break; break;
default: default:

View File

@ -34,6 +34,7 @@
#include "libavutil/dovi_meta.h" #include "libavutil/dovi_meta.h"
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavcodec/defs.h"
#include "libavcodec/get_bits.h" #include "libavcodec/get_bits.h"
#include "libavcodec/opus.h" #include "libavcodec/opus.h"
#include "avformat.h" #include "avformat.h"
@ -2147,7 +2148,7 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
// Component tag limits are documented in TR-B14, fascicle 2, // Component tag limits are documented in TR-B14, fascicle 2,
// Vol. 3, Section 2, 4.2.8.1 // Vol. 3, Section 2, 4.2.8.1
int actual_component_tag = sti->stream_identifier - 1; int actual_component_tag = sti->stream_identifier - 1;
int picked_profile = FF_PROFILE_UNKNOWN; int picked_profile = AV_PROFILE_UNKNOWN;
int data_component_id = get16(pp, desc_end); int data_component_id = get16(pp, desc_end);
if (data_component_id < 0) if (data_component_id < 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
@ -2158,21 +2159,21 @@ int ff_parse_mpeg2_descriptor(AVFormatContext *fc, AVStream *st, int stream_type
// non-mobile captioning service ("profile A"). // non-mobile captioning service ("profile A").
if (actual_component_tag >= 0x30 && if (actual_component_tag >= 0x30 &&
actual_component_tag <= 0x37) { actual_component_tag <= 0x37) {
picked_profile = FF_PROFILE_ARIB_PROFILE_A; picked_profile = AV_PROFILE_ARIB_PROFILE_A;
} }
break; break;
case 0x0012: case 0x0012:
// component tag 0x87 signifies a mobile/partial reception // component tag 0x87 signifies a mobile/partial reception
// (1seg) captioning service ("profile C"). // (1seg) captioning service ("profile C").
if (actual_component_tag == 0x87) { if (actual_component_tag == 0x87) {
picked_profile = FF_PROFILE_ARIB_PROFILE_C; picked_profile = AV_PROFILE_ARIB_PROFILE_C;
} }
break; break;
default: default:
break; break;
} }
if (picked_profile == FF_PROFILE_UNKNOWN) if (picked_profile == AV_PROFILE_UNKNOWN)
break; break;
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;

View File

@ -28,8 +28,8 @@
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavcodec/ac3_parser_internal.h" #include "libavcodec/ac3_parser_internal.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavcodec/defs.h"
#include "libavcodec/h264.h" #include "libavcodec/h264.h"
#include "libavcodec/startcode.h" #include "libavcodec/startcode.h"
@ -300,11 +300,11 @@ static int put_arib_caption_descriptor(AVFormatContext *s, uint8_t **q_ptr,
uint8_t *q = *q_ptr; uint8_t *q = *q_ptr;
switch (codecpar->profile) { switch (codecpar->profile) {
case FF_PROFILE_ARIB_PROFILE_A: case AV_PROFILE_ARIB_PROFILE_A:
stream_identifier = 0x30; stream_identifier = 0x30;
data_component_id = 0x0008; data_component_id = 0x0008;
break; break;
case FF_PROFILE_ARIB_PROFILE_C: case AV_PROFILE_ARIB_PROFILE_C:
stream_identifier = 0x87; stream_identifier = 0x87;
data_component_id = 0x0012; data_component_id = 0x0012;
break; break;
@ -431,7 +431,7 @@ static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
stream_type = STREAM_TYPE_PRIVATE_DATA; stream_type = STREAM_TYPE_PRIVATE_DATA;
break; break;
case AV_CODEC_ID_SMPTE_KLV: case AV_CODEC_ID_SMPTE_KLV:
if (st->codecpar->profile == FF_PROFILE_KLVA_SYNC) { if (st->codecpar->profile == AV_PROFILE_KLVA_SYNC) {
stream_type = STREAM_TYPE_METADATA; stream_type = STREAM_TYPE_METADATA;
} else { } else {
stream_type = STREAM_TYPE_PRIVATE_DATA; stream_type = STREAM_TYPE_PRIVATE_DATA;

View File

@ -52,6 +52,7 @@
#include "libavutil/mastering_display_metadata.h" #include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
#include "libavcodec/bytestream.h" #include "libavcodec/bytestream.h"
#include "libavcodec/defs.h"
#include "libavcodec/internal.h" #include "libavcodec/internal.h"
#include "libavutil/channel_layout.h" #include "libavutil/channel_layout.h"
#include "libavutil/dict_internal.h" #include "libavutil/dict_internal.h"
@ -1403,8 +1404,8 @@ static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int
} }
if (IS_KLV_KEY(uid, mxf_jp2k_rsiz)) { if (IS_KLV_KEY(uid, mxf_jp2k_rsiz)) {
uint32_t rsiz = avio_rb16(pb); uint32_t rsiz = avio_rb16(pb);
if (rsiz == FF_PROFILE_JPEG2000_DCINEMA_2K || if (rsiz == AV_PROFILE_JPEG2000_DCINEMA_2K ||
rsiz == FF_PROFILE_JPEG2000_DCINEMA_4K) rsiz == AV_PROFILE_JPEG2000_DCINEMA_4K)
descriptor->pix_fmt = AV_PIX_FMT_XYZ12; descriptor->pix_fmt = AV_PIX_FMT_XYZ12;
} }
if (IS_KLV_KEY(uid, mxf_mastering_display_prefix)) { if (IS_KLV_KEY(uid, mxf_mastering_display_prefix)) {

View File

@ -47,7 +47,7 @@
#include "libavutil/mastering_display_metadata.h" #include "libavutil/mastering_display_metadata.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/time_internal.h" #include "libavutil/time_internal.h"
#include "libavcodec/avcodec.h" #include "libavcodec/defs.h"
#include "libavcodec/golomb.h" #include "libavcodec/golomb.h"
#include "libavcodec/h264.h" #include "libavcodec/h264.h"
#include "libavcodec/packet_internal.h" #include "libavcodec/packet_internal.h"
@ -2111,12 +2111,12 @@ static const struct {
int profile; int profile;
UID codec_ul; UID codec_ul;
} mxf_prores_codec_uls[] = { } mxf_prores_codec_uls[] = {
{ FF_PROFILE_PRORES_PROXY, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x01,0x00 } }, { AV_PROFILE_PRORES_PROXY, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x01,0x00 } },
{ FF_PROFILE_PRORES_LT, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x02,0x00 } }, { AV_PROFILE_PRORES_LT, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x02,0x00 } },
{ FF_PROFILE_PRORES_STANDARD, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00 } }, { AV_PROFILE_PRORES_STANDARD, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00 } },
{ FF_PROFILE_PRORES_HQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x04,0x00 } }, { AV_PROFILE_PRORES_HQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x04,0x00 } },
{ FF_PROFILE_PRORES_4444, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x05,0x00 } }, { AV_PROFILE_PRORES_4444, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x05,0x00 } },
{ FF_PROFILE_PRORES_XQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x06,0x00 } }, { AV_PROFILE_PRORES_XQ, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x06,0x00 } },
}; };
static int mxf_parse_prores_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt) static int mxf_parse_prores_frame(AVFormatContext *s, AVStream *st, AVPacket *pkt)

View File

@ -21,7 +21,7 @@
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h" #include "libavutil/pixfmt.h"
#include "libavcodec/avcodec.h" #include "libavcodec/defs.h"
#include "libavcodec/get_bits.h" #include "libavcodec/get_bits.h"
#include "vpcc.h" #include "vpcc.h"
@ -155,7 +155,7 @@ int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
AVRational *frame_rate, VPCC *vpcc) AVRational *frame_rate, VPCC *vpcc)
{ {
int profile = par->profile; int profile = par->profile;
int level = par->level == FF_LEVEL_UNKNOWN ? int level = par->level == AV_LEVEL_UNKNOWN ?
get_vp9_level(par, frame_rate) : par->level; get_vp9_level(par, frame_rate) : par->level;
int bit_depth = get_bit_depth(s, par->format); int bit_depth = get_bit_depth(s, par->format);
int vpx_chroma_subsampling = int vpx_chroma_subsampling =
@ -166,7 +166,7 @@ int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
if (bit_depth < 0 || vpx_chroma_subsampling < 0) if (bit_depth < 0 || vpx_chroma_subsampling < 0)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (len && (profile == FF_PROFILE_UNKNOWN || !bit_depth)) { if (len && (profile == AV_PROFILE_UNKNOWN || !bit_depth)) {
GetBitContext gb; GetBitContext gb;
int ret = init_get_bits8(&gb, data, len); int ret = init_get_bits8(&gb, data, len);
@ -176,16 +176,16 @@ int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
parse_bitstream(&gb, &profile, &bit_depth); parse_bitstream(&gb, &profile, &bit_depth);
} }
if (profile == FF_PROFILE_UNKNOWN && bit_depth) { if (profile == AV_PROFILE_UNKNOWN && bit_depth) {
if (vpx_chroma_subsampling == VPX_SUBSAMPLING_420_VERTICAL || if (vpx_chroma_subsampling == VPX_SUBSAMPLING_420_VERTICAL ||
vpx_chroma_subsampling == VPX_SUBSAMPLING_420_COLLOCATED_WITH_LUMA) { vpx_chroma_subsampling == VPX_SUBSAMPLING_420_COLLOCATED_WITH_LUMA) {
profile = (bit_depth == 8) ? FF_PROFILE_VP9_0 : FF_PROFILE_VP9_2; profile = (bit_depth == 8) ? AV_PROFILE_VP9_0 : AV_PROFILE_VP9_2;
} else { } else {
profile = (bit_depth == 8) ? FF_PROFILE_VP9_1 : FF_PROFILE_VP9_3; profile = (bit_depth == 8) ? AV_PROFILE_VP9_1 : AV_PROFILE_VP9_3;
} }
} }
if (profile == FF_PROFILE_UNKNOWN || !bit_depth) if (profile == AV_PROFILE_UNKNOWN || !bit_depth)
av_log(s, AV_LOG_WARNING, "VP9 profile and/or bit depth not set or could not be derived\n"); av_log(s, AV_LOG_WARNING, "VP9 profile and/or bit depth not set or could not be derived\n");
vpcc->profile = profile; vpcc->profile = profile;