diff mbox series

[FFmpeg-devel,2/7] avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines

Message ID AS8P250MB0744E6DAD55B1252B1715F9A8FEBA@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State Accepted
Headers show
Series [FFmpeg-devel] avformat/avformat: Avoid including codec.h, frame.h | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 2, 2023, 4:21 p.m. UTC
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>
---
Missing version update.

 doc/APIchanges                       |   4 +
 fftools/ffprobe.c                    |   2 +-
 libavcodec/aacdec_template.c         |   8 +-
 libavcodec/aacenc.c                  |  14 +-
 libavcodec/aacenc_ltp.c              |   4 +-
 libavcodec/aacenc_pred.c             |   2 +-
 libavcodec/aacenc_tns.c              |   2 +-
 libavcodec/aacenctab.h               |   8 +-
 libavcodec/aacsbr_template.c         |   2 +-
 libavcodec/ac3dec.c                  |   2 +-
 libavcodec/amfenc_av1.c              |   4 +-
 libavcodec/amfenc_h264.c             |  12 +-
 libavcodec/amfenc_hevc.c             |   4 +-
 libavcodec/audiotoolboxenc.c         |  22 +--
 libavcodec/avcodec.h                 |  10 ++
 libavcodec/cbs_av1.c                 |   2 +-
 libavcodec/cbs_av1_syntax_template.c |  12 +-
 libavcodec/codec.h                   |   2 +-
 libavcodec/codec_desc.h              |   2 +-
 libavcodec/codec_par.c               |   4 +-
 libavcodec/dca_core.c                |   8 +-
 libavcodec/dca_lbr.c                 |   2 +-
 libavcodec/dca_parser.c              |  16 +-
 libavcodec/dca_xll.c                 |   6 +-
 libavcodec/defs.h                    | 135 +++++++++++++++
 libavcodec/dnxhddata.c               |  14 +-
 libavcodec/dnxhddec.c                |  14 +-
 libavcodec/dnxhdenc.c                |  36 ++--
 libavcodec/dxva2.c                   |  38 ++---
 libavcodec/h264_parse.c              |  14 +-
 libavcodec/hevc_ps.c                 |  12 +-
 libavcodec/hevcdec.c                 |   2 +-
 libavcodec/jpeg2000dec.c             |   4 +-
 libavcodec/libaomdec.c               |  18 +-
 libavcodec/libaomenc.c               |  14 +-
 libavcodec/libaribb24.c              |  24 +--
 libavcodec/libaribcaption.c          |  12 +-
 libavcodec/libfdk-aacenc.c           |  28 ++--
 libavcodec/libopenh264enc.c          |  38 ++---
 libavcodec/libsvtav1.c               |  12 +-
 libavcodec/libvpxdec.c               |  16 +-
 libavcodec/libvpxenc.c               |   2 +-
 libavcodec/libx264.c                 |  12 +-
 libavcodec/mediacodec_wrapper.c      |  76 ++++-----
 libavcodec/mediacodecenc.c           |  28 ++--
 libavcodec/mfenc.c                   |   4 +-
 libavcodec/mjpegdec.c                |  10 +-
 libavcodec/mlpdec.c                  |   2 +-
 libavcodec/mpeg12enc.c               |  16 +-
 libavcodec/mpeg4videodec.c           |   6 +-
 libavcodec/mpeg4videoenc.c           |   4 +-
 libavcodec/nvenc.c                   |  24 +--
 libavcodec/nvenc_hevc.c              |   2 +-
 libavcodec/omx.c                     |  16 +-
 libavcodec/options_table.h           |   6 +-
 libavcodec/profiles.c                | 240 +++++++++++++--------------
 libavcodec/profiles.h                |  46 ++---
 libavcodec/proresdec2.c              |  14 +-
 libavcodec/proresenc_anatoliy.c      |  36 ++--
 libavcodec/sbcenc.c                  |   4 +-
 libavcodec/utils.c                   |   8 +-
 libavcodec/v4l2_m2m_enc.c            |  36 ++--
 libavcodec/vaapi_decode.c            |   4 +-
 libavcodec/vaapi_encode.c            |   4 +-
 libavcodec/vaapi_encode.h            |   4 +-
 libavcodec/vaapi_encode_h264.c       |  72 ++++----
 libavcodec/vaapi_encode_h265.c       |  42 ++---
 libavcodec/vaapi_encode_mjpeg.c      |  10 +-
 libavcodec/vaapi_encode_mpeg2.c      |  16 +-
 libavcodec/vaapi_encode_vp8.c        |   2 +-
 libavcodec/vaapi_encode_vp9.c        |  10 +-
 libavcodec/vaapi_hevc.c              |  18 +-
 libavcodec/vdpau_av1.c               |   6 +-
 libavcodec/vdpau_h264.c              |  22 +--
 libavcodec/vdpau_hevc.c              |   8 +-
 libavcodec/vdpau_mpeg12.c            |   4 +-
 libavcodec/vdpau_mpeg4.c             |   6 +-
 libavcodec/vdpau_vc1.c               |   6 +-
 libavcodec/vdpau_vp9.c               |   8 +-
 libavcodec/version_major.h           |   1 +
 libavcodec/videotoolboxenc.c         |  78 ++++-----
 libavcodec/vulkan_decode.c           |   8 +-
 libavformat/av1.c                    |  10 +-
 libavformat/hlsenc.c                 |  14 +-
 libavformat/matroskadec.c            |   8 +-
 libavformat/matroskaenc.c            |   6 +-
 libavformat/movenc.c                 |   8 +-
 libavformat/mpegts.c                 |   9 +-
 libavformat/mpegtsenc.c              |   8 +-
 libavformat/mxfdec.c                 |   5 +-
 libavformat/mxfenc.c                 |  14 +-
 libavformat/vpcc.c                   |  14 +-
 92 files changed, 877 insertions(+), 725 deletions(-)
diff mbox series

Patch

diff --git a/doc/APIchanges b/doc/APIchanges
index dbaec30aac..a5da7cfb31 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -2,6 +2,10 @@  The last version increases of all libraries were on 2023-02-09
 
 API changes, most recent first:
 
+2023-09-02 - xxxxxxxxxx - lavc 58.xx.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-02 - xxxxxxxxxx - lavu 58.19.100 - executor.h
   Add AVExecutor API
 
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 4fcfe1164b..c20f464623 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -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)))
         print_str("profile", profile);
     else {
-        if (par->profile != FF_PROFILE_UNKNOWN) {
+        if (par->profile != AV_PROFILE_UNKNOWN) {
             char profile_num[12];
             snprintf(profile_num, sizeof(profile_num), "%d", par->profile);
             print_str("profile", profile_num);
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index e8dcd460a0..f8039e490b 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -2486,12 +2486,12 @@  static int decode_extension_payload(AACContext *ac, GetBitContext *gb, int cnt,
                    ac->avctx->ch_layout.nb_channels == 1) {
             ac->oc[1].m4ac.sbr = 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,
                              ac->oc[1].status, 1);
         } else {
             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);
         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)
         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
     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)
         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
     ac->avctx->profile = ac->oc[1].m4ac.object_type - 1;
 
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index f48f057022..2a34685aec 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -1307,13 +1307,13 @@  static av_cold int aac_encode_init(AVCodecContext *avctx)
                                      avctx->bit_rate);
 
     /* 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;
     for (i = 0; i < FF_ARRAY_ELEMS(aacenc_profiles); i++)
         if (avctx->profile == aacenc_profiles[i])
             break;
-    if (avctx->profile == FF_PROFILE_MPEG2_AAC_LOW) {
-        avctx->profile = FF_PROFILE_AAC_LOW;
+    if (avctx->profile == AV_PROFILE_MPEG2_AAC_LOW) {
+        avctx->profile = AV_PROFILE_AAC_LOW;
         ERROR_IF(s->options.pred,
                  "Main prediction unavailable in the \"mpeg2_aac_low\" profile\n");
         ERROR_IF(s->options.ltp,
@@ -1321,22 +1321,22 @@  static av_cold int aac_encode_init(AVCodecContext *avctx)
         WARN_IF(s->options.pns,
                 "PNS unavailable in the \"mpeg2_aac_low\" profile, turning off\n");
         s->options.pns = 0;
-    } else if (avctx->profile == FF_PROFILE_AAC_LTP) {
+    } else if (avctx->profile == AV_PROFILE_AAC_LTP) {
         s->options.ltp = 1;
         ERROR_IF(s->options.pred,
                  "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;
         ERROR_IF(s->options.ltp,
                  "LTP prediction unavailable in the \"aac_main\" profile\n");
     } else if (s->options.ltp) {
-        avctx->profile = FF_PROFILE_AAC_LTP;
+        avctx->profile = AV_PROFILE_AAC_LTP;
         WARN_IF(1,
                 "Chainging profile to \"aac_ltp\"\n");
         ERROR_IF(s->options.pred,
                  "Main prediction unavailable in the \"aac_ltp\" profile\n");
     } else if (s->options.pred) {
-        avctx->profile = FF_PROFILE_AAC_MAIN;
+        avctx->profile = AV_PROFILE_AAC_MAIN;
         WARN_IF(1,
                 "Chainging profile to \"aac_main\"\n");
         ERROR_IF(s->options.ltp,
diff --git a/libavcodec/aacenc_ltp.c b/libavcodec/aacenc_ltp.c
index f7fb85bbf8..f3075f0e71 100644
--- a/libavcodec/aacenc_ltp.c
+++ b/libavcodec/aacenc_ltp.c
@@ -37,7 +37,7 @@  void ff_aac_encode_ltp_info(AACEncContext *s, SingleChannelElement *sce,
 {
     int i;
     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;
     if (common_window)
         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];
     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;
 
     /* Calculate lag */
diff --git a/libavcodec/aacenc_pred.c b/libavcodec/aacenc_pred.c
index 447444cb82..f87fcd5a00 100644
--- a/libavcodec/aacenc_pred.c
+++ b/libavcodec/aacenc_pred.c
@@ -335,7 +335,7 @@  void ff_aac_encode_main_pred(AACEncContext *s, SingleChannelElement *sce)
     IndividualChannelStream *ics = &sce->ics;
     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)
         return;
 
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c
index 195ff5e2b7..8dc6dfcf62 100644
--- a/libavcodec/aacenc_tns.c
+++ b/libavcodec/aacenc_tns.c
@@ -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 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 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 :
                       sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
     const int sfb_len = sfb_end - sfb_start;
diff --git a/libavcodec/aacenctab.h b/libavcodec/aacenctab.h
index 2d96621945..20e47ea900 100644
--- a/libavcodec/aacenctab.h
+++ b/libavcodec/aacenctab.h
@@ -124,10 +124,10 @@  static const unsigned char aac_maxval_cb[] = {
 };
 
 static const int aacenc_profiles[] = {
-    FF_PROFILE_AAC_MAIN,
-    FF_PROFILE_AAC_LOW,
-    FF_PROFILE_AAC_LTP,
-    FF_PROFILE_MPEG2_AAC_LOW,
+    AV_PROFILE_AAC_MAIN,
+    AV_PROFILE_AAC_LOW,
+    AV_PROFILE_AAC_LTP,
+    AV_PROFILE_MPEG2_AAC_LOW,
 };
 
 #endif /* AVCODEC_AACENCTAB_H */
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c
index cdca402f04..b33ffd4295 100644
--- a/libavcodec/aacsbr_template.c
+++ b/libavcodec/aacsbr_template.c
@@ -973,7 +973,7 @@  static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr,
             *num_bits_left = 0;
         } else {
             *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
             ac->warned_he_aac_mono = 1;
         }
diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c
index 8c63f015f4..ee50138605 100644
--- a/libavcodec/ac3dec.c
+++ b/libavcodec/ac3dec.c
@@ -1714,7 +1714,7 @@  skip:
     if (!err) {
         avctx->sample_rate = s->sample_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) {
diff --git a/libavcodec/amfenc_av1.c b/libavcodec/amfenc_av1.c
index 30c0a9fad2..8f13aea29e 100644
--- a/libavcodec/amfenc_av1.c
+++ b/libavcodec/amfenc_av1.c
@@ -192,7 +192,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
     AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_FRAMERATE, framerate);
 
     switch (avctx->profile) {
-    case FF_PROFILE_AV1_MAIN:
+    case AV_PROFILE_AV1_MAIN:
         profile = AMF_VIDEO_ENCODER_AV1_PROFILE_MAIN;
         break;
     default:
@@ -204,7 +204,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
     AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_PROFILE, profile);
 
     profile_level = avctx->level;
-    if (profile_level == FF_LEVEL_UNKNOWN) {
+    if (profile_level == AV_LEVEL_UNKNOWN) {
         profile_level = ctx->level;
     }
     if (profile_level != 0) {
diff --git a/libavcodec/amfenc_h264.c b/libavcodec/amfenc_h264.c
index 2380aa4e90..bd544d12df 100644
--- a/libavcodec/amfenc_h264.c
+++ b/libavcodec/amfenc_h264.c
@@ -223,19 +223,19 @@  FF_ENABLE_DEPRECATION_WARNINGS
     AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_FRAMERATE, framerate);
 
     switch (avctx->profile) {
-    case FF_PROFILE_H264_BASELINE:
+    case AV_PROFILE_H264_BASELINE:
         profile = AMF_VIDEO_ENCODER_PROFILE_BASELINE;
         break;
-    case FF_PROFILE_H264_MAIN:
+    case AV_PROFILE_H264_MAIN:
         profile = AMF_VIDEO_ENCODER_PROFILE_MAIN;
         break;
-    case FF_PROFILE_H264_HIGH:
+    case AV_PROFILE_H264_HIGH:
         profile = AMF_VIDEO_ENCODER_PROFILE_HIGH;
         break;
-    case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+    case AV_PROFILE_H264_CONSTRAINED_BASELINE:
         profile = AMF_VIDEO_ENCODER_PROFILE_CONSTRAINED_BASELINE;
         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;
         break;
     }
@@ -246,7 +246,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
     AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_PROFILE, profile);
 
     profile_level = avctx->level;
-    if (profile_level == FF_LEVEL_UNKNOWN) {
+    if (profile_level == AV_LEVEL_UNKNOWN) {
         profile_level = ctx->level;
     }
     if (profile_level != 0) {
diff --git a/libavcodec/amfenc_hevc.c b/libavcodec/amfenc_hevc.c
index dd232cc8ac..352564a301 100644
--- a/libavcodec/amfenc_hevc.c
+++ b/libavcodec/amfenc_hevc.c
@@ -184,7 +184,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
     AMF_ASSIGN_PROPERTY_RATE(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_FRAMERATE, framerate);
 
     switch (avctx->profile) {
-    case FF_PROFILE_HEVC_MAIN:
+    case AV_PROFILE_HEVC_MAIN:
         profile = AMF_VIDEO_ENCODER_HEVC_PROFILE_MAIN;
         break;
     default:
@@ -198,7 +198,7 @@  FF_ENABLE_DEPRECATION_WARNINGS
     AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_TIER, ctx->tier);
 
     profile_level = avctx->level;
-    if (profile_level == FF_LEVEL_UNKNOWN) {
+    if (profile_level == AV_LEVEL_UNKNOWN) {
         profile_level = ctx->level;
     }
     if (profile_level != 0) {
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 46aca4c7ff..1b4e2a6c43 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -60,17 +60,17 @@  static UInt32 ffat_get_format_id(enum AVCodecID codec, int profile)
     switch (codec) {
     case AV_CODEC_ID_AAC:
         switch (profile) {
-        case FF_PROFILE_AAC_LOW:
+        case AV_PROFILE_AAC_LOW:
         default:
             return kAudioFormatMPEG4AAC;
-        case FF_PROFILE_AAC_HE:
+        case AV_PROFILE_AAC_HE:
             return kAudioFormatMPEG4AAC_HE;
-        case FF_PROFILE_AAC_HE_V2:
+        case AV_PROFILE_AAC_HE_V2:
             return kAudioFormatMPEG4AAC_HE_V2;
-        case FF_PROFILE_AAC_LD:
+        case AV_PROFILE_AAC_LD:
             return kAudioFormatMPEG4AAC_LD;
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
-        case FF_PROFILE_AAC_ELD:
+        case AV_PROFILE_AAC_ELD:
             return kAudioFormatMPEG4AAC_ELD;
 #endif
         }
@@ -586,12 +586,12 @@  static av_cold int ffat_close_encoder(AVCodecContext *avctx)
 }
 
 static const AVProfile aac_profiles[] = {
-    { FF_PROFILE_AAC_LOW,   "LC"       },
-    { FF_PROFILE_AAC_HE,    "HE-AAC"   },
-    { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
-    { FF_PROFILE_AAC_LD,    "LD"       },
-    { FF_PROFILE_AAC_ELD,   "ELD"      },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_AAC_LOW,   "LC"       },
+    { AV_PROFILE_AAC_HE,    "HE-AAC"   },
+    { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
+    { AV_PROFILE_AAC_LD,    "LD"       },
+    { AV_PROFILE_AAC_ELD,   "ELD"      },
+    { AV_PROFILE_UNKNOWN },
 };
 
 #define AE AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 649411ac79..172b669c87 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1587,8 +1587,12 @@  typedef struct AVCodecContext {
      * profile
      * - encoding: Set by user.
      * - decoding: Set by libavcodec.
+     * See the AV_PROFILE_* defines in defs.h.
      */
      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_RESERVED -100
 
@@ -1719,14 +1723,20 @@  typedef struct AVCodecContext {
 
 #define FF_PROFILE_EVC_BASELINE             0
 #define FF_PROFILE_EVC_MAIN                 1
+#endif
 
     /**
      * level
      * - encoding: Set by user.
      * - decoding: Set by libavcodec.
+     * See AV_LEVEL_* in defs.h.
      */
      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
+#endif
 
     /**
      * Skip loop filtering for selected frames.
diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 452e022b36..7fb5bd8b42 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -20,10 +20,10 @@ 
 #include "libavutil/opt.h"
 #include "libavutil/pixfmt.h"
 
-#include "avcodec.h"
 #include "cbs.h"
 #include "cbs_internal.h"
 #include "cbs_av1.h"
+#include "defs.h"
 
 
 static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc,
diff --git a/libavcodec/cbs_av1_syntax_template.c b/libavcodec/cbs_av1_syntax_template.c
index a747e17784..6f09c4e410 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -82,7 +82,7 @@  static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
 
     flag(high_bitdepth);
 
-    if (seq_profile == FF_PROFILE_AV1_PROFESSIONAL &&
+    if (seq_profile == AV_PROFILE_AV1_PROFESSIONAL &&
         current->high_bitdepth) {
         flag(twelve_bit);
         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;
     }
 
-    if (seq_profile == FF_PROFILE_AV1_HIGH)
+    if (seq_profile == AV_PROFILE_AV1_HIGH)
         infer(mono_chrome, 0);
     else
         flag(mono_chrome);
@@ -126,10 +126,10 @@  static int FUNC(color_config)(CodedBitstreamContext *ctx, RWContext *rw,
     } else {
         flag(color_range);
 
-        if (seq_profile == FF_PROFILE_AV1_MAIN) {
+        if (seq_profile == AV_PROFILE_AV1_MAIN) {
             infer(subsampling_x, 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_y, 0);
         } else {
@@ -190,8 +190,8 @@  static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
 
     HEADER("Sequence Header");
 
-    fc(3, seq_profile, FF_PROFILE_AV1_MAIN,
-                       FF_PROFILE_AV1_PROFESSIONAL);
+    fc(3, seq_profile, AV_PROFILE_AV1_MAIN,
+                       AV_PROFILE_AV1_PROFESSIONAL);
     flag(still_picture);
     flag(reduced_still_picture_header);
 
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index 7a932d75dd..8034f1a53c 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -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
 #endif
     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.
diff --git a/libavcodec/codec_desc.h b/libavcodec/codec_desc.h
index dd4491112b..96afd20208 100644
--- a/libavcodec/codec_desc.h
+++ b/libavcodec/codec_desc.h
@@ -60,7 +60,7 @@  typedef struct AVCodecDescriptor {
     const char *const *mime_types;
     /**
      * 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;
 } AVCodecDescriptor;
diff --git a/libavcodec/codec_par.c b/libavcodec/codec_par.c
index a38a475dc7..e4e4cd48d3 100644
--- a/libavcodec/codec_par.c
+++ b/libavcodec/codec_par.c
@@ -47,8 +47,8 @@  static void codec_parameters_reset(AVCodecParameters *par)
     par->chroma_location     = AVCHROMA_LOC_UNSPECIFIED;
     par->sample_aspect_ratio = (AVRational){ 0, 1 };
     par->framerate           = (AVRational){ 0, 1 };
-    par->profile             = FF_PROFILE_UNKNOWN;
-    par->level               = FF_LEVEL_UNKNOWN;
+    par->profile             = AV_PROFILE_UNKNOWN;
+    par->level               = AV_LEVEL_UNKNOWN;
 }
 
 AVCodecParameters *avcodec_parameters_alloc(void)
diff --git a/libavcodec/dca_core.c b/libavcodec/dca_core.c
index c50d005a56..6abd3513a9 100644
--- a/libavcodec/dca_core.c
+++ b/libavcodec/dca_core.c
@@ -2386,13 +2386,13 @@  int ff_dca_core_filter_frame(DCACoreDecoder *s, AVFrame *frame)
 
     // Set profile, bit rate, etc
     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))
-        avctx->profile = FF_PROFILE_DTS_ES;
+        avctx->profile = AV_PROFILE_DTS_ES;
     else if (s->ext_audio_mask & DCA_CSS_X96)
-        avctx->profile = FF_PROFILE_DTS_96_24;
+        avctx->profile = AV_PROFILE_DTS_96_24;
     else
-        avctx->profile = FF_PROFILE_DTS;
+        avctx->profile = AV_PROFILE_DTS;
 
     if (s->bit_rate > 3 && !(s->ext_audio_mask & DCA_EXSS_MASK))
         avctx->bit_rate = s->bit_rate;
diff --git a/libavcodec/dca_lbr.c b/libavcodec/dca_lbr.c
index bef0054dbe..c9c5c0f856 100644
--- a/libavcodec/dca_lbr.c
+++ b/libavcodec/dca_lbr.c
@@ -1744,7 +1744,7 @@  int ff_dca_lbr_filter_frame(DCALbrDecoder *s, AVFrame *frame)
     avctx->sample_rate = s->sample_rate;
     avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
     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;
 
     if (s->flags & LBR_FLAG_LFE_PRESENT) {
diff --git a/libavcodec/dca_parser.c b/libavcodec/dca_parser.c
index 3148397b7d..eb0ef55d46 100644
--- a/libavcodec/dca_parser.c
+++ b/libavcodec/dca_parser.c
@@ -228,7 +228,7 @@  static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
 
             *sample_rate = ff_dca_sampling_freqs[pc1->sr_code];
             *duration = 1024 << ff_dca_freq_ranges[pc1->sr_code];
-            *profile = FF_PROFILE_DTS_EXPRESS;
+            *profile = AV_PROFILE_DTS_EXPRESS;
             return 0;
         }
 
@@ -253,7 +253,7 @@  static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
 
             *sample_rate = asset->max_sample_rate;
             *duration = (1 + (*sample_rate > 96000)) << nsamples_log2;
-            *profile = FF_PROFILE_DTS_HD_MA;
+            *profile = AV_PROFILE_DTS_HD_MA;
             return 0;
         }
 
@@ -268,18 +268,18 @@  static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
 
     *duration = h.npcmblocks * DCA_PCMBLOCK_SAMPLES;
     *sample_rate = ff_dca_sample_rates[h.sr_code];
-    if (*profile != FF_PROFILE_UNKNOWN)
+    if (*profile != AV_PROFILE_UNKNOWN)
         return 0;
 
-    *profile = FF_PROFILE_DTS;
+    *profile = AV_PROFILE_DTS;
     if (h.ext_audio_present) {
         switch (h.ext_audio_type) {
         case DCA_EXT_AUDIO_XCH:
         case DCA_EXT_AUDIO_XXCH:
-            *profile = FF_PROFILE_DTS_ES;
+            *profile = AV_PROFILE_DTS_ES;
             break;
         case DCA_EXT_AUDIO_X96:
-            *profile = FF_PROFILE_DTS_96_24;
+            *profile = AV_PROFILE_DTS_96_24;
             break;
         }
     }
@@ -296,9 +296,9 @@  static int dca_parse_params(DCAParseContext *pc1, const uint8_t *buf,
         return 0;
 
     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))
-        *profile = FF_PROFILE_DTS_HD_HRA;
+        *profile = AV_PROFILE_DTS_HD_HRA;
 
     return 0;
 }
diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c
index b8cf37a35f..15f9bd9196 100644
--- a/libavcodec/dca_xll.c
+++ b/libavcodec/dca_xll.c
@@ -1446,11 +1446,11 @@  int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame)
     }
 
     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) {
-        avctx->profile = FF_PROFILE_DTS_HD_MA_X;
+        avctx->profile = AV_PROFILE_DTS_HD_MA_X;
     } else {
-        avctx->profile = FF_PROFILE_DTS_HD_MA;
+        avctx->profile = AV_PROFILE_DTS_HD_MA;
     }
 
     avctx->bits_per_raw_sample = p->storage_bit_res;
diff --git a/libavcodec/defs.h b/libavcodec/defs.h
index fbe3254db2..ceed8d5e16 100644
--- a/libavcodec/defs.h
+++ b/libavcodec/defs.h
@@ -61,6 +61,141 @@ 
 #define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
 #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
  */
diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index d52abe87dd..ce06d77f18 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -22,7 +22,7 @@ 
 #include <stddef.h>
 #include "libavutil/log.h"
 #include "libavutil/macros.h"
-#include "avcodec.h"
+#include "defs.h"
 #include "dnxhddata.h"
 
 /* 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)
 {
     switch (avctx->profile) {
-    case FF_PROFILE_DNXHR_444:
+    case AV_PROFILE_DNXHR_444:
         return 1270;
-    case FF_PROFILE_DNXHR_HQX:
+    case AV_PROFILE_DNXHR_HQX:
         return 1271;
-    case FF_PROFILE_DNXHR_HQ:
+    case AV_PROFILE_DNXHR_HQ:
         return 1272;
-    case FF_PROFILE_DNXHR_SQ:
+    case AV_PROFILE_DNXHR_SQ:
         return 1273;
-    case FF_PROFILE_DNXHR_LB:
+    case AV_PROFILE_DNXHR_LB:
         return 1274;
     }
     return 0;
@@ -1129,7 +1129,7 @@  int ff_dnxhd_find_cid(AVCodecContext *avctx, int bit_depth)
     int i, j;
     int mbs = avctx->bit_rate / 1000000;
 
-    if (avctx->profile != FF_PROFILE_DNXHD)
+    if (avctx->profile != AV_PROFILE_DNXHD)
         return dnxhd_find_hr_cid(avctx);
 
     if (!mbs)
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 834390b93b..5c49a43c8d 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -160,17 +160,17 @@  static int dnxhd_get_profile(int cid)
 {
     switch(cid) {
     case 1270:
-        return FF_PROFILE_DNXHR_444;
+        return AV_PROFILE_DNXHR_444;
     case 1271:
-        return FF_PROFILE_DNXHR_HQX;
+        return AV_PROFILE_DNXHR_HQX;
     case 1272:
-        return FF_PROFILE_DNXHR_HQ;
+        return AV_PROFILE_DNXHR_HQ;
     case 1273:
-        return FF_PROFILE_DNXHR_SQ;
+        return AV_PROFILE_DNXHR_SQ;
     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,
@@ -262,7 +262,7 @@  static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame *frame,
         ctx->decode_dct_block = dnxhd_decode_dct_block_12;
         ctx->pix_fmt = AV_PIX_FMT_YUV422P12;
     } 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;
         else
             ctx->decode_dct_block = dnxhd_decode_dct_block_10;
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index a1852fa6b7..f52a2e9918 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -54,19 +54,19 @@  static const AVOption options[] = {
         offsetof(DNXHDEncContext, intra_quant_bias), AV_OPT_TYPE_INT,
         { .i64 = 0 }, INT_MIN, INT_MAX, VE },
     { "profile",       NULL, offsetof(DNXHDEncContext, profile), AV_OPT_TYPE_INT,
-        { .i64 = FF_PROFILE_DNXHD },
-        FF_PROFILE_DNXHD, FF_PROFILE_DNXHR_444, VE, "profile" },
-    { "dnxhd",     NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_DNXHD },
+        { .i64 = AV_PROFILE_DNXHD },
+        AV_PROFILE_DNXHD, AV_PROFILE_DNXHR_444, VE, "profile" },
+    { "dnxhd",     NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_PROFILE_DNXHD },
         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" },
-    { "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" },
-    { "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" },
-    { "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" },
-    { "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" },
     { NULL }
 };
@@ -367,30 +367,30 @@  static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
         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)) ||
-        (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))) {
         av_log(avctx, AV_LOG_ERROR,
                "pixel format is incompatible with DNxHD profile\n");
         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,
                "pixel format is incompatible with DNxHR HQX profile\n");
         return AVERROR(EINVAL);
     }
 
-    if ((ctx->profile == FF_PROFILE_DNXHR_LB ||
-         ctx->profile == FF_PROFILE_DNXHR_SQ ||
-         ctx->profile == FF_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
+    if ((ctx->profile == AV_PROFILE_DNXHR_LB ||
+         ctx->profile == AV_PROFILE_DNXHR_SQ ||
+         ctx->profile == AV_PROFILE_DNXHR_HQ) && avctx->pix_fmt != AV_PIX_FMT_YUV422P) {
         av_log(avctx, AV_LOG_ERROR,
                "pixel format is incompatible with DNxHR LB/SQ/HQ profile\n");
         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;
     ctx->cid = ff_dnxhd_find_cid(avctx, ctx->bit_depth);
     if (!ctx->cid) {
@@ -426,13 +426,13 @@  static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
     ff_pixblockdsp_init(&ctx->m.pdsp, avctx);
     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);
 
     if (!ctx->m.dct_quantize)
         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->get_pixels_8x4_sym = dnxhd_10bit_get_pixels_8x4_sym;
         ctx->block_width_l2     = 4;
@@ -457,7 +457,7 @@  static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
         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,
                "Interlaced encoding is not supported for DNxHR profiles.\n");
         return AVERROR(EINVAL);
diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c
index 568d686f39..d7bc587562 100644
--- a/libavcodec/dxva2.c
+++ b/libavcodec/dxva2.c
@@ -53,28 +53,28 @@  DEFINE_GUID(ff_IID_IDirectXVideoDecoderService, 0xfc51a551,0xd5e7,0x11d9,0xaf,0x
 typedef struct dxva_mode {
     const GUID     *guid;
     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.
     const int      *profiles;
 } dxva_mode;
 
-static const int prof_mpeg2_main[]   = {FF_PROFILE_MPEG2_SIMPLE,
-                                        FF_PROFILE_MPEG2_MAIN,
-                                        FF_PROFILE_UNKNOWN};
-static const int prof_h264_high[]    = {FF_PROFILE_H264_CONSTRAINED_BASELINE,
-                                        FF_PROFILE_H264_MAIN,
-                                        FF_PROFILE_H264_HIGH,
-                                        FF_PROFILE_UNKNOWN};
-static const int prof_hevc_main[]    = {FF_PROFILE_HEVC_MAIN,
-                                        FF_PROFILE_UNKNOWN};
-static const int prof_hevc_main10[]  = {FF_PROFILE_HEVC_MAIN_10,
-                                        FF_PROFILE_UNKNOWN};
-static const int prof_vp9_profile0[] = {FF_PROFILE_VP9_0,
-                                        FF_PROFILE_UNKNOWN};
-static const int prof_vp9_profile2[] = {FF_PROFILE_VP9_2,
-                                        FF_PROFILE_UNKNOWN};
-static const int prof_av1_profile0[] = {FF_PROFILE_AV1_MAIN,
-                                        FF_PROFILE_UNKNOWN};
+static const int prof_mpeg2_main[]   = {AV_PROFILE_MPEG2_SIMPLE,
+                                        AV_PROFILE_MPEG2_MAIN,
+                                        AV_PROFILE_UNKNOWN};
+static const int prof_h264_high[]    = {AV_PROFILE_H264_CONSTRAINED_BASELINE,
+                                        AV_PROFILE_H264_MAIN,
+                                        AV_PROFILE_H264_HIGH,
+                                        AV_PROFILE_UNKNOWN};
+static const int prof_hevc_main[]    = {AV_PROFILE_HEVC_MAIN,
+                                        AV_PROFILE_UNKNOWN};
+static const int prof_hevc_main10[]  = {AV_PROFILE_HEVC_MAIN_10,
+                                        AV_PROFILE_UNKNOWN};
+static const int prof_vp9_profile0[] = {AV_PROFILE_VP9_0,
+                                        AV_PROFILE_UNKNOWN};
+static const int prof_vp9_profile2[] = {AV_PROFILE_VP9_2,
+                                        AV_PROFILE_UNKNOWN};
+static const int prof_av1_profile0[] = {AV_PROFILE_AV1_MAIN,
+                                        AV_PROFILE_UNKNOWN};
 
 static const dxva_mode dxva_modes[] = {
     /* 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)) {
         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]) {
                 found = 1;
                 break;
diff --git a/libavcodec/h264_parse.c b/libavcodec/h264_parse.c
index 97ddf0e437..3378650fd5 100644
--- a/libavcodec/h264_parse.c
+++ b/libavcodec/h264_parse.c
@@ -526,22 +526,22 @@  int ff_h264_decode_extradata(const uint8_t *data, int size, H264ParamSets *ps,
  *
  * @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 profile = sps->profile_idc;
 
     switch (sps->profile_idc) {
-    case FF_PROFILE_H264_BASELINE:
+    case AV_PROFILE_H264_BASELINE:
         // 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;
-    case FF_PROFILE_H264_HIGH_10:
-    case FF_PROFILE_H264_HIGH_422:
-    case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
+    case AV_PROFILE_H264_HIGH_10:
+    case AV_PROFILE_H264_HIGH_422:
+    case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
         // 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;
     }
 
diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 1db2d3a242..bdd623507d 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -250,15 +250,15 @@  static int decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx,
     ptl->profile_space = get_bits(gb, 2);
     ptl->tier_flag     = get_bits1(gb);
     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");
-    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");
-    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");
-    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");
-    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");
     else
         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);
         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)
                 goto err;
         }
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index df40c91ba6..abdf19a15e 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3082,7 +3082,7 @@  static int decode_nal_unit(HEVCContext *s, const H2645NAL *nal)
             if (ret < 0)
                 goto fail;
         } else {
-            if (s->avctx->profile == FF_PROFILE_HEVC_SCC) {
+            if (s->avctx->profile == AV_PROFILE_HEVC_SCC) {
                 av_log(s->avctx, AV_LOG_ERROR,
                        "SCC profile is not yet implemented in hevc native decoder.\n");
                 ret = AVERROR_PATCHWELCOME;
diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index d6f2a5938e..7d1a222f71 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -312,8 +312,8 @@  static int get_siz(Jpeg2000DecoderContext *s)
     if (ret < 0)
         return ret;
 
-    if (s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_2K ||
-        s->avctx->profile == FF_PROFILE_JPEG2000_DCINEMA_4K) {
+    if (s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_2K ||
+        s->avctx->profile == AV_PROFILE_JPEG2000_DCINEMA_4K) {
         possible_fmts = xyz_pix_fmts;
         possible_fmts_nb = FF_ARRAY_ELEMS(xyz_pix_fmts);
     } else {
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 767c216aa9..695d901051 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -78,17 +78,17 @@  static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
         if (img->bit_depth == 8) {
             avctx->pix_fmt = img->monochrome ?
                              AV_PIX_FMT_GRAY8 : AV_PIX_FMT_YUV420P;
-            avctx->profile = FF_PROFILE_AV1_MAIN;
+            avctx->profile = AV_PROFILE_AV1_MAIN;
             return 0;
         } else if (img->bit_depth == 10) {
             avctx->pix_fmt = img->monochrome ?
                              AV_PIX_FMT_GRAY10 : AV_PIX_FMT_YUV420P10;
-            avctx->profile = FF_PROFILE_AV1_MAIN;
+            avctx->profile = AV_PROFILE_AV1_MAIN;
             return 0;
         } else if (img->bit_depth == 12) {
             avctx->pix_fmt = img->monochrome ?
                              AV_PIX_FMT_GRAY12 : AV_PIX_FMT_YUV420P12;
-            avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+            avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
             return 0;
         } else {
             return AVERROR_INVALIDDATA;
@@ -97,15 +97,15 @@  static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
     case AOM_IMG_FMT_I42216:
         if (img->bit_depth == 8) {
             avctx->pix_fmt = AV_PIX_FMT_YUV422P;
-            avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+            avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
             return 0;
         } else if (img->bit_depth == 10) {
             avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
-            avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+            avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
             return 0;
         } else if (img->bit_depth == 12) {
             avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
-            avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+            avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
             return 0;
         } else {
             return AVERROR_INVALIDDATA;
@@ -115,18 +115,18 @@  static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
         if (img->bit_depth == 8) {
             avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
                              AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
-            avctx->profile = FF_PROFILE_AV1_HIGH;
+            avctx->profile = AV_PROFILE_AV1_HIGH;
             return 0;
         } else if (img->bit_depth == 10) {
             avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
             avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
                              AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
-            avctx->profile = FF_PROFILE_AV1_HIGH;
+            avctx->profile = AV_PROFILE_AV1_HIGH;
             return 0;
         } else if (img->bit_depth == 12) {
             avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
                              AV_PIX_FMT_GBRP12 : AV_PIX_FMT_YUV444P12;
-            avctx->profile = FF_PROFILE_AV1_PROFESSIONAL;
+            avctx->profile = AV_PROFILE_AV1_PROFESSIONAL;
             return 0;
         } else {
             return AVERROR_INVALIDDATA;
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index f29cb0784a..72d602a797 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -451,16 +451,16 @@  static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
         enccfg->monochrome = 1;
         /* Fall-through */
     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;
         return 0;
     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;
         return 0;
     case AV_PIX_FMT_YUV444P:
     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;
         return 0;
     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:
         if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
             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;
             *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
             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_YUV422P12:
         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;
             *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
             return 0;
@@ -492,7 +492,7 @@  static int set_pix_fmt(AVCodecContext *avctx, aom_codec_caps_t codec_caps,
     case AV_PIX_FMT_GBRP12:
         if (codec_caps & AOM_CODEC_CAP_HIGHBITDEPTH) {
             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;
             *flags |= AOM_CODEC_USE_HIGHBITDEPTH;
             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
      * complexity playback on low powered devices at the expense of encode
      * quality. */
-    if (avctx->profile != FF_PROFILE_UNKNOWN)
+    if (avctx->profile != AV_PROFILE_UNKNOWN)
         enccfg.g_profile = avctx->profile;
 
     enccfg.g_error_resilient = ctx->error_resilient;
diff --git a/libavcodec/libaribb24.c b/libavcodec/libaribb24.c
index e3e244be99..8032536b22 100644
--- a/libavcodec/libaribb24.c
+++ b/libavcodec/libaribb24.c
@@ -49,13 +49,13 @@  static unsigned int get_profile_font_size(AVCodecContext *avctx)
     Libaribb24Context *b24 = avctx->priv_data;
     int profile = avctx->profile;
 
-    if (profile == FF_PROFILE_UNKNOWN)
+    if (profile == AV_PROFILE_UNKNOWN)
         profile = b24->default_profile;
 
     switch (profile) {
-    case FF_PROFILE_ARIB_PROFILE_A:
+    case AV_PROFILE_ARIB_PROFILE_A:
         return 36;
-    case FF_PROFILE_ARIB_PROFILE_C:
+    case AV_PROFILE_ARIB_PROFILE_C:
         return 18;
     default:
         return 0;
@@ -75,15 +75,15 @@  static int libaribb24_generate_ass_header(AVCodecContext *avctx)
     unsigned int font_size = 0;
     int profile = avctx->profile;
 
-    if (profile == FF_PROFILE_UNKNOWN)
+    if (profile == AV_PROFILE_UNKNOWN)
         profile = b24->default_profile;
 
     switch (profile) {
-    case FF_PROFILE_ARIB_PROFILE_A:
+    case AV_PROFILE_ARIB_PROFILE_A:
         plane_width = 960;
         plane_height = 540;
         break;
-    case FF_PROFILE_ARIB_PROFILE_C:
+    case AV_PROFILE_ARIB_PROFILE_C:
         plane_width = 320;
         plane_height = 180;
         break;
@@ -172,14 +172,14 @@  static int libaribb24_init(AVCodecContext *avctx)
         goto init_fail;
     }
 
-    if (profile == FF_PROFILE_UNKNOWN)
+    if (profile == AV_PROFILE_UNKNOWN)
         profile = b24->default_profile;
 
     switch (profile) {
-    case FF_PROFILE_ARIB_PROFILE_A:
+    case AV_PROFILE_ARIB_PROFILE_A:
         arib_dec_init = arib_initialize_decoder_a_profile;
         break;
-    case FF_PROFILE_ARIB_PROFILE_C:
+    case AV_PROFILE_ARIB_PROFILE_C:
         arib_dec_init = arib_initialize_decoder_c_profile;
         break;
     default:
@@ -390,9 +390,9 @@  static const AVOption options[] = {
     { "aribb24-skip-ruby-text", "skip ruby text blocks during decoding",
       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",
-      OFFSET(default_profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_PROFILE_UNKNOWN, FF_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"},
-        {"c", "Profile C", 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_ARIB_PROFILE_C}, INT_MIN, INT_MAX, 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 = AV_PROFILE_ARIB_PROFILE_A}, 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 }
 };
 
diff --git a/libavcodec/libaribcaption.c b/libavcodec/libaribcaption.c
index 747ca8a2e4..8a8c8f8cfd 100644
--- a/libavcodec/libaribcaption.c
+++ b/libavcodec/libaribcaption.c
@@ -452,7 +452,7 @@  static int aribcaption_trans_bitmap_subtitle(ARIBCaptionContext *ctx)
             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] */
             /* No position information is provided for profile C */
             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] */
     /* 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;
 
     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);
 
-    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;
         x = ctx->plane_width;
         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++) {
             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) {
                     av_bprintf(&buf, "{\\fsp%d}", (region->is_ruby) ?
                                      ch->char_horizontal_spacing / 2 :
@@ -960,14 +960,14 @@  static int aribcaption_init(AVCodecContext *avctx)
     ctx->avctx = avctx;
 
     switch (avctx->profile) {
-    case FF_PROFILE_ARIB_PROFILE_A:
+    case AV_PROFILE_ARIB_PROFILE_A:
         profile = ARIBCC_PROFILE_A;
         /* assume 960x540 at initial state */
         ctx->plane_width = 960;
         ctx->plane_height = 540;
         ctx->font_size = 36;
         break;
-    case FF_PROFILE_ARIB_PROFILE_C:
+    case AV_PROFILE_ARIB_PROFILE_C:
         profile = ARIBCC_PROFILE_C;
         ctx->plane_width = 320;
         ctx->plane_height = 180;
diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c
index e08c6a0c6c..d400ac2e7c 100644
--- a/libavcodec/libfdk-aacenc.c
+++ b/libavcodec/libfdk-aacenc.c
@@ -179,7 +179,7 @@  static av_cold int aac_encode_init(AVCodecContext *avctx)
     AACENC_InfoStruct info = { 0 };
     CHANNEL_MODE mode;
     AACENC_ERROR err;
-    int aot = FF_PROFILE_AAC_LOW + 1;
+    int aot = AV_PROFILE_AAC_LOW + 1;
     int sce = 0, cpe = 0;
 
     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;
     }
 
-    if (avctx->profile != FF_PROFILE_UNKNOWN)
+    if (avctx->profile != AV_PROFILE_UNKNOWN)
         aot = avctx->profile + 1;
 
     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;
     }
 
-    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,
                                        1)) != AACENC_OK) {
             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:
 #if FDKENC_VER_AT_LEAST(4, 0) // 4.0.0
       // (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,
                                          128)) != AACENC_OK) {
               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 {
         if (avctx->bit_rate <= 0) {
-            if (avctx->profile == FF_PROFILE_AAC_HE_V2) {
+            if (avctx->profile == AV_PROFILE_AAC_HE_V2) {
                 sce = 1;
                 cpe = 0;
             }
             avctx->bit_rate = (96*sce + 128*cpe) * avctx->sample_rate / 44;
-            if (avctx->profile == FF_PROFILE_AAC_HE ||
-                avctx->profile == FF_PROFILE_AAC_HE_V2 ||
-                avctx->profile == FF_PROFILE_MPEG2_AAC_HE ||
+            if (avctx->profile == AV_PROFILE_AAC_HE ||
+                avctx->profile == AV_PROFILE_AAC_HE_V2 ||
+                avctx->profile == AV_PROFILE_MPEG2_AAC_HE ||
                 s->eld_sbr)
                 avctx->bit_rate /= 2;
         }
@@ -544,12 +544,12 @@  static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
 }
 
 static const AVProfile profiles[] = {
-    { FF_PROFILE_AAC_LOW,   "LC"       },
-    { FF_PROFILE_AAC_HE,    "HE-AAC"   },
-    { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
-    { FF_PROFILE_AAC_LD,    "LD"       },
-    { FF_PROFILE_AAC_ELD,   "ELD"      },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_AAC_LOW,   "LC"       },
+    { AV_PROFILE_AAC_HE,    "HE-AAC"   },
+    { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
+    { AV_PROFILE_AAC_LD,    "LD"       },
+    { AV_PROFILE_AAC_ELD,   "ELD"      },
+    { AV_PROFILE_UNKNOWN },
 };
 
 static const FFCodecDefault aac_encode_defaults[] = {
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 5b59af6f94..3f05bee388 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -61,11 +61,11 @@  typedef struct SVCContext {
 #define DEPRECATED AV_OPT_FLAG_DEPRECATED
 static const AVOption options[] = {
     { "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"
-        { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) },
-        { PROFILE("main",                 FF_PROFILE_H264_MAIN) },
-        { PROFILE("high",                 FF_PROFILE_H264_HIGH) },
+        { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
+        { PROFILE("main",                 AV_PROFILE_H264_MAIN) },
+        { PROFILE("high",                 AV_PROFILE_H264_HIGH) },
 #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 },
     { "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;
 
     /* Allow specifying the libopenh264 profile through AVCodecContext. */
-    if (FF_PROFILE_UNKNOWN == s->profile &&
-        FF_PROFILE_UNKNOWN != avctx->profile)
+    if (AV_PROFILE_UNKNOWN == s->profile &&
+        AV_PROFILE_UNKNOWN != avctx->profile)
         switch (avctx->profile) {
-        case FF_PROFILE_H264_HIGH:
-        case FF_PROFILE_H264_MAIN:
-        case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+        case AV_PROFILE_H264_HIGH:
+        case AV_PROFILE_H264_MAIN:
+        case AV_PROFILE_H264_CONSTRAINED_BASELINE:
             s->profile = avctx->profile;
             break;
         default:
@@ -191,34 +191,34 @@  FF_ENABLE_DEPRECATION_WARNINGS
             break;
         }
 
-    if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0)
-        s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE :
+    if (s->profile == AV_PROFILE_UNKNOWN && s->coder >= 0)
+        s->profile = s->coder == 0 ? AV_PROFILE_H264_CONSTRAINED_BASELINE :
 #if OPENH264_VER_AT_LEAST(1, 8)
-                                     FF_PROFILE_H264_HIGH;
+                                     AV_PROFILE_H264_HIGH;
 #else
-                                     FF_PROFILE_H264_MAIN;
+                                     AV_PROFILE_H264_MAIN;
 #endif
 
     switch (s->profile) {
-    case FF_PROFILE_H264_HIGH:
+    case AV_PROFILE_H264_HIGH:
         av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
                 "select EProfileIdc PRO_HIGH in libopenh264.\n",
                 param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
         break;
-    case FF_PROFILE_H264_MAIN:
+    case AV_PROFILE_H264_MAIN:
         av_log(avctx, AV_LOG_VERBOSE, "Using %s, "
                 "select EProfileIdc PRO_MAIN in libopenh264.\n",
                 param.iEntropyCodingModeFlag ? "CABAC" : "CAVLC");
         break;
-    case FF_PROFILE_H264_CONSTRAINED_BASELINE:
-    case FF_PROFILE_UNKNOWN:
-        s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+    case AV_PROFILE_H264_CONSTRAINED_BASELINE:
+    case AV_PROFILE_UNKNOWN:
+        s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
         param.iEntropyCodingModeFlag = 0;
         av_log(avctx, AV_LOG_VERBOSE, "Using CAVLC, "
                "select EProfileIdc PRO_BASELINE in libopenh264.\n");
         break;
     default:
-        s->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+        s->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
         param.iEntropyCodingModeFlag = 0;
         av_log(avctx, AV_LOG_WARNING, "Unsupported profile, "
                "select EProfileIdc PRO_BASELINE in libopenh264.\n");
diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index f2b73361d8..c35412319b 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -236,10 +236,10 @@  static int config_enc_params(EbSvtAv1EncConfiguration *param,
     }
 #endif
 
-    if (avctx->profile != FF_PROFILE_UNKNOWN)
+    if (avctx->profile != AV_PROFILE_UNKNOWN)
         param->profile = avctx->profile;
 
-    if (avctx->level != FF_LEVEL_UNKNOWN)
+    if (avctx->level != AV_LEVEL_UNKNOWN)
         param->level = avctx->level;
 
     // 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)
-         && param->profile != FF_PROFILE_AV1_PROFESSIONAL ) {
+         && param->profile != AV_PROFILE_AV1_PROFESSIONAL ) {
         av_log(avctx, AV_LOG_WARNING, "Forcing Professional profile\n");
-        param->profile = FF_PROFILE_AV1_PROFESSIONAL;
-    } else if (param->encoder_color_format == EB_YUV444 && param->profile != FF_PROFILE_AV1_HIGH) {
+        param->profile = AV_PROFILE_AV1_PROFESSIONAL;
+    } else if (param->encoder_color_format == EB_YUV444 && param->profile != AV_PROFILE_AV1_HIGH) {
         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 ?
diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c
index f480545ae0..40c8caf887 100644
--- a/libavcodec/libvpxdec.c
+++ b/libavcodec/libvpxdec.c
@@ -127,26 +127,26 @@  static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
     switch (img->fmt) {
     case VPX_IMG_FMT_I420:
         if (avctx->codec_id == AV_CODEC_ID_VP9)
-            avctx->profile = FF_PROFILE_VP9_0;
+            avctx->profile = AV_PROFILE_VP9_0;
         avctx->pix_fmt =
             has_alpha_channel ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P;
         return 0;
 #if CONFIG_LIBVPX_VP9_DECODER
     case VPX_IMG_FMT_I422:
-        avctx->profile = FF_PROFILE_VP9_1;
+        avctx->profile = AV_PROFILE_VP9_1;
         avctx->pix_fmt = AV_PIX_FMT_YUV422P;
         return 0;
     case VPX_IMG_FMT_I440:
-        avctx->profile = FF_PROFILE_VP9_1;
+        avctx->profile = AV_PROFILE_VP9_1;
         avctx->pix_fmt = AV_PIX_FMT_YUV440P;
         return 0;
     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 ?
                          AV_PIX_FMT_GBRP : AV_PIX_FMT_YUV444P;
         return 0;
     case VPX_IMG_FMT_I42016:
-        avctx->profile = FF_PROFILE_VP9_2;
+        avctx->profile = AV_PROFILE_VP9_2;
         if (img->bit_depth == 10) {
             avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
             return 0;
@@ -157,7 +157,7 @@  static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
             return AVERROR_INVALIDDATA;
         }
     case VPX_IMG_FMT_I42216:
-        avctx->profile = FF_PROFILE_VP9_3;
+        avctx->profile = AV_PROFILE_VP9_3;
         if (img->bit_depth == 10) {
             avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
             return 0;
@@ -168,7 +168,7 @@  static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
             return AVERROR_INVALIDDATA;
         }
     case VPX_IMG_FMT_I44016:
-        avctx->profile = FF_PROFILE_VP9_3;
+        avctx->profile = AV_PROFILE_VP9_3;
         if (img->bit_depth == 10) {
             avctx->pix_fmt = AV_PIX_FMT_YUV440P10;
             return 0;
@@ -179,7 +179,7 @@  static int set_pix_fmt(AVCodecContext *avctx, struct vpx_image *img,
             return AVERROR_INVALIDDATA;
         }
     case VPX_IMG_FMT_I44416:
-        avctx->profile = FF_PROFILE_VP9_3;
+        avctx->profile = AV_PROFILE_VP9_3;
         if (img->bit_depth == 10) {
             avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
                              AV_PIX_FMT_GBRP10 : AV_PIX_FMT_YUV444P10;
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 7a545527a9..61986cd3ff 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -1145,7 +1145,7 @@  static av_cold int vpx_init(AVCodecContext *avctx,
     /* 0-3: For non-zero values the encoder increasingly optimizes for reduced
        complexity playback on low powered devices at the expense of encode
        quality. */
-    if (avctx->profile != FF_PROFILE_UNKNOWN)
+    if (avctx->profile != AV_PROFILE_UNKNOWN)
         enccfg.g_profile = avctx->profile;
 
     enccfg.g_error_resilient = ctx->error_resilient || ctx->flags & VP8F_ERROR_RESILIENT;
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index ce849d6c9a..77515209b9 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -1048,22 +1048,22 @@  static av_cold int X264_init(AVCodecContext *avctx)
     /* Allow specifying the x264 profile through AVCodecContext. */
     if (!x4->profile)
         switch (avctx->profile) {
-        case FF_PROFILE_H264_BASELINE:
+        case AV_PROFILE_H264_BASELINE:
             x4->profile = "baseline";
             break;
-        case FF_PROFILE_H264_HIGH:
+        case AV_PROFILE_H264_HIGH:
             x4->profile = "high";
             break;
-        case FF_PROFILE_H264_HIGH_10:
+        case AV_PROFILE_H264_HIGH_10:
             x4->profile = "high10";
             break;
-        case FF_PROFILE_H264_HIGH_422:
+        case AV_PROFILE_H264_HIGH_422:
             x4->profile = "high422";
             break;
-        case FF_PROFILE_H264_HIGH_444:
+        case AV_PROFILE_H264_HIGH_444:
             x4->profile = "high444";
             break;
-        case FF_PROFILE_H264_MAIN:
+        case AV_PROFILE_H264_MAIN:
             x4->profile = "main";
             break;
         default:
diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index eb69ad7eaf..0880ddd3ef 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -365,82 +365,82 @@  int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx)
 
     if (avctx->codec_id == AV_CODEC_ID_H264) {
         switch(avctx->profile) {
-        case FF_PROFILE_H264_BASELINE:
+        case AV_PROFILE_H264_BASELINE:
             return AVCProfileBaseline;
-        case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+        case AV_PROFILE_H264_CONSTRAINED_BASELINE:
             return AVCProfileConstrainedBaseline;
-        case FF_PROFILE_H264_MAIN:
+        case AV_PROFILE_H264_MAIN:
             return AVCProfileMain;
             break;
-        case FF_PROFILE_H264_EXTENDED:
+        case AV_PROFILE_H264_EXTENDED:
             return AVCProfileExtended;
-        case FF_PROFILE_H264_HIGH:
+        case AV_PROFILE_H264_HIGH:
             return AVCProfileHigh;
-        case FF_PROFILE_H264_HIGH_10:
-        case FF_PROFILE_H264_HIGH_10_INTRA:
+        case AV_PROFILE_H264_HIGH_10:
+        case AV_PROFILE_H264_HIGH_10_INTRA:
             return AVCProfileHigh10;
-        case FF_PROFILE_H264_HIGH_422:
-        case FF_PROFILE_H264_HIGH_422_INTRA:
+        case AV_PROFILE_H264_HIGH_422:
+        case AV_PROFILE_H264_HIGH_422_INTRA:
             return AVCProfileHigh422;
-        case FF_PROFILE_H264_HIGH_444:
-        case FF_PROFILE_H264_HIGH_444_INTRA:
-        case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
+        case AV_PROFILE_H264_HIGH_444:
+        case AV_PROFILE_H264_HIGH_444_INTRA:
+        case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
             return AVCProfileHigh444;
         }
     } else if (avctx->codec_id == AV_CODEC_ID_HEVC) {
         switch (avctx->profile) {
-        case FF_PROFILE_HEVC_MAIN:
+        case AV_PROFILE_HEVC_MAIN:
             return HEVCProfileMain;
-        case FF_PROFILE_HEVC_MAIN_STILL_PICTURE:
+        case AV_PROFILE_HEVC_MAIN_STILL_PICTURE:
             return HEVCProfileMainStill;
-        case FF_PROFILE_HEVC_MAIN_10:
+        case AV_PROFILE_HEVC_MAIN_10:
             return HEVCProfileMain10;
         }
     } else if (avctx->codec_id == AV_CODEC_ID_VP9) {
         switch (avctx->profile) {
-        case FF_PROFILE_VP9_0:
+        case AV_PROFILE_VP9_0:
             return VP9Profile0;
-        case FF_PROFILE_VP9_1:
+        case AV_PROFILE_VP9_1:
             return VP9Profile1;
-        case FF_PROFILE_VP9_2:
+        case AV_PROFILE_VP9_2:
             return VP9Profile2;
-         case FF_PROFILE_VP9_3:
+         case AV_PROFILE_VP9_3:
             return VP9Profile3;
         }
     } else if(avctx->codec_id == AV_CODEC_ID_MPEG4) {
         switch (avctx->profile)
         {
-        case FF_PROFILE_MPEG4_SIMPLE:
+        case AV_PROFILE_MPEG4_SIMPLE:
             return MPEG4ProfileSimple;
-        case FF_PROFILE_MPEG4_SIMPLE_SCALABLE:
+        case AV_PROFILE_MPEG4_SIMPLE_SCALABLE:
             return MPEG4ProfileSimpleScalable;
-        case FF_PROFILE_MPEG4_CORE:
+        case AV_PROFILE_MPEG4_CORE:
             return MPEG4ProfileCore;
-        case FF_PROFILE_MPEG4_MAIN:
+        case AV_PROFILE_MPEG4_MAIN:
             return MPEG4ProfileMain;
-        case FF_PROFILE_MPEG4_N_BIT:
+        case AV_PROFILE_MPEG4_N_BIT:
             return MPEG4ProfileNbit;
-        case FF_PROFILE_MPEG4_SCALABLE_TEXTURE:
+        case AV_PROFILE_MPEG4_SCALABLE_TEXTURE:
             return MPEG4ProfileScalableTexture;
-        case FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION:
+        case AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION:
             return MPEG4ProfileSimpleFBA;
-        case FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE:
+        case AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE:
             return MPEG4ProfileBasicAnimated;
-        case FF_PROFILE_MPEG4_HYBRID:
+        case AV_PROFILE_MPEG4_HYBRID:
             return MPEG4ProfileHybrid;
-        case FF_PROFILE_MPEG4_ADVANCED_REAL_TIME:
+        case AV_PROFILE_MPEG4_ADVANCED_REAL_TIME:
             return MPEG4ProfileAdvancedRealTime;
-        case FF_PROFILE_MPEG4_CORE_SCALABLE:
+        case AV_PROFILE_MPEG4_CORE_SCALABLE:
             return MPEG4ProfileCoreScalable;
-        case FF_PROFILE_MPEG4_ADVANCED_CODING:
+        case AV_PROFILE_MPEG4_ADVANCED_CODING:
             return MPEG4ProfileAdvancedCoding;
-        case FF_PROFILE_MPEG4_ADVANCED_CORE:
+        case AV_PROFILE_MPEG4_ADVANCED_CORE:
             return MPEG4ProfileAdvancedCore;
-        case FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE:
+        case AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE:
             return MPEG4ProfileAdvancedScalable;
-        case FF_PROFILE_MPEG4_ADVANCED_SIMPLE:
+        case AV_PROFILE_MPEG4_ADVANCED_SIMPLE:
             return MPEG4ProfileAdvancedSimple;
-        case FF_PROFILE_MPEG4_SIMPLE_STUDIO:
+        case AV_PROFILE_MPEG4_SIMPLE_STUDIO:
             // Studio profiles are not supported by mediacodec.
         default:
             break;
@@ -448,10 +448,10 @@  int ff_AMediaCodecProfile_getProfileFromAVCodecContext(AVCodecContext *avctx)
     } else if(avctx->codec_id == AV_CODEC_ID_AV1) {
         switch (avctx->profile)
         {
-        case FF_PROFILE_AV1_MAIN:
+        case AV_PROFILE_AV1_MAIN:
             return AV1ProfileMain8;
-        case FF_PROFILE_AV1_HIGH:
-        case FF_PROFILE_AV1_PROFESSIONAL:
+        case AV_PROFILE_AV1_HIGH:
+        case AV_PROFILE_AV1_PROFESSIONAL:
         default:
             break;
         }
diff --git a/libavcodec/mediacodecenc.c b/libavcodec/mediacodecenc.c
index 1da705d113..485ab7b4ed 100644
--- a/libavcodec/mediacodecenc.c
+++ b/libavcodec/mediacodecenc.c
@@ -660,14 +660,14 @@  enum MediaCodecAvcLevel {
 static const AVOption h264_options[] = {
     COMMON_OPTION
 
-    FF_AVCTX_PROFILE_OPTION("baseline",             NULL, VIDEO, FF_PROFILE_H264_BASELINE)
-    FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, FF_PROFILE_H264_CONSTRAINED_BASELINE)
-    FF_AVCTX_PROFILE_OPTION("main",                 NULL, VIDEO, FF_PROFILE_H264_MAIN)
-    FF_AVCTX_PROFILE_OPTION("extended",             NULL, VIDEO, FF_PROFILE_H264_EXTENDED)
-    FF_AVCTX_PROFILE_OPTION("high",                 NULL, VIDEO, FF_PROFILE_H264_HIGH)
-    FF_AVCTX_PROFILE_OPTION("high10",               NULL, VIDEO, FF_PROFILE_H264_HIGH_10)
-    FF_AVCTX_PROFILE_OPTION("high422",              NULL, VIDEO, FF_PROFILE_H264_HIGH_422)
-    FF_AVCTX_PROFILE_OPTION("high444",              NULL, VIDEO, FF_PROFILE_H264_HIGH_444)
+    FF_AVCTX_PROFILE_OPTION("baseline",             NULL, VIDEO, AV_PROFILE_H264_BASELINE)
+    FF_AVCTX_PROFILE_OPTION("constrained_baseline", NULL, VIDEO, AV_PROFILE_H264_CONSTRAINED_BASELINE)
+    FF_AVCTX_PROFILE_OPTION("main",                 NULL, VIDEO, AV_PROFILE_H264_MAIN)
+    FF_AVCTX_PROFILE_OPTION("extended",             NULL, VIDEO, AV_PROFILE_H264_EXTENDED)
+    FF_AVCTX_PROFILE_OPTION("high",                 NULL, VIDEO, AV_PROFILE_H264_HIGH)
+    FF_AVCTX_PROFILE_OPTION("high10",               NULL, VIDEO, AV_PROFILE_H264_HIGH_10)
+    FF_AVCTX_PROFILE_OPTION("high422",              NULL, VIDEO, AV_PROFILE_H264_HIGH_422)
+    FF_AVCTX_PROFILE_OPTION("high444",              NULL, VIDEO, AV_PROFILE_H264_HIGH_444)
 
     { "level", "Specify 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[] = {
     COMMON_OPTION
 
-    FF_AVCTX_PROFILE_OPTION("main",   NULL, VIDEO, FF_PROFILE_HEVC_MAIN)
-    FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, FF_PROFILE_HEVC_MAIN_10)
+    FF_AVCTX_PROFILE_OPTION("main",   NULL, VIDEO, AV_PROFILE_HEVC_MAIN)
+    FF_AVCTX_PROFILE_OPTION("main10", NULL, VIDEO, AV_PROFILE_HEVC_MAIN_10)
 
     { "level", "Specify tier and 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[] = {
     COMMON_OPTION
 
-    FF_AVCTX_PROFILE_OPTION("profile0",   NULL, VIDEO, FF_PROFILE_VP9_0)
-    FF_AVCTX_PROFILE_OPTION("profile1",   NULL, VIDEO, FF_PROFILE_VP9_1)
-    FF_AVCTX_PROFILE_OPTION("profile2",   NULL, VIDEO, FF_PROFILE_VP9_2)
-    FF_AVCTX_PROFILE_OPTION("profile3",   NULL, VIDEO, FF_PROFILE_VP9_3)
+    FF_AVCTX_PROFILE_OPTION("profile0",   NULL, VIDEO, AV_PROFILE_VP9_0)
+    FF_AVCTX_PROFILE_OPTION("profile1",   NULL, VIDEO, AV_PROFILE_VP9_1)
+    FF_AVCTX_PROFILE_OPTION("profile2",   NULL, VIDEO, AV_PROFILE_VP9_2)
+    FF_AVCTX_PROFILE_OPTION("profile3",   NULL, VIDEO, AV_PROFILE_VP9_3)
 
     { "level", "Specify tier and level",
                 OFFSET(level), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, VE, "level" },
diff --git a/libavcodec/mfenc.c b/libavcodec/mfenc.c
index 8d950a3109..3c50a6c074 100644
--- a/libavcodec/mfenc.c
+++ b/libavcodec/mfenc.c
@@ -672,10 +672,10 @@  FF_ENABLE_DEPRECATION_WARNINGS
     if (avctx->codec_id == AV_CODEC_ID_H264) {
         UINT32 profile = ff_eAVEncH264VProfile_Base;
         switch (avctx->profile) {
-        case FF_PROFILE_H264_MAIN:
+        case AV_PROFILE_H264_MAIN:
             profile = ff_eAVEncH264VProfile_Main;
             break;
-        case FF_PROFILE_H264_HIGH:
+        case AV_PROFILE_H264_HIGH:
             profile = ff_eAVEncH264VProfile_High;
             break;
         }
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index cef8625791..24f24b1a5b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2485,9 +2485,9 @@  redo_for_pal8:
         case SOF0:
         case SOF1:
             if (start_code == SOF0)
-                s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
+                s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT;
             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->ls          = 0;
             s->progressive = 0;
@@ -2495,7 +2495,7 @@  redo_for_pal8:
                 goto fail;
             break;
         case SOF2:
-            s->avctx->profile = FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
+            s->avctx->profile = AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT;
             s->lossless    = 0;
             s->ls          = 0;
             s->progressive = 1;
@@ -2503,7 +2503,7 @@  redo_for_pal8:
                 goto fail;
             break;
         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->lossless    = 1;
             s->ls          = 0;
@@ -2512,7 +2512,7 @@  redo_for_pal8:
                 goto fail;
             break;
         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->lossless    = 1;
             s->ls          = 1;
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 966ee0f0a2..4357165d4e 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -398,7 +398,7 @@  static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
      */
     if (m->avctx->codec_id == AV_CODEC_ID_TRUEHD
             && 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 */
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 4aa45e9e86..0135623c0e 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -203,23 +203,23 @@  static av_cold int encode_init(AVCodecContext *avctx)
         }
     }
 
-    if (avctx->profile == FF_PROFILE_UNKNOWN) {
-        if (avctx->level != FF_LEVEL_UNKNOWN) {
+    if (avctx->profile == AV_PROFILE_UNKNOWN) {
+        if (avctx->level != AV_LEVEL_UNKNOWN) {
             av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");
             return AVERROR(EINVAL);
         }
         /* Main or 4:2:2 */
-        avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? FF_PROFILE_MPEG2_MAIN
-                                                              : FF_PROFILE_MPEG2_422;
+        avctx->profile = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? AV_PROFILE_MPEG2_MAIN
+                                                              : AV_PROFILE_MPEG2_422;
     }
-    if (avctx->level == FF_LEVEL_UNKNOWN) {
-        if (avctx->profile == FF_PROFILE_MPEG2_422) {   /* 4:2:2 */
+    if (avctx->level == AV_LEVEL_UNKNOWN) {
+        if (avctx->profile == AV_PROFILE_MPEG2_422) {   /* 4:2:2 */
             if (avctx->width <= 720 && avctx->height <= 608)
                 avctx->level = 5;                   /* Main */
             else
                 avctx->level = 2;                   /* High */
         } else {
-            if (avctx->profile != FF_PROFILE_MPEG2_HIGH &&
+            if (avctx->profile != AV_PROFILE_MPEG2_HIGH &&
                 avctx->pix_fmt != AV_PIX_FMT_YUV420P) {
                 av_log(avctx, AV_LOG_ERROR,
                        "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_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, 4, s->avctx->level);   // level
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 30aec5e529..142e56c03c 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2564,10 +2564,10 @@  static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
      */
     if (ctx->vo_type == CORE_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;
         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);
     } else if (s->studio_profile) {
         return AVERROR_PATCHWELCOME;
@@ -3605,7 +3605,7 @@  int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb,
         } else if (startcode == VOS_STARTCODE) {
             int 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)) {
                 s->studio_profile = 1;
                 next_start_code_studio(gb);
diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
index 777635c40c..d1e50612dd 100644
--- a/libavcodec/mpeg4videoenc.c
+++ b/libavcodec/mpeg4videoenc.c
@@ -916,7 +916,7 @@  static void mpeg4_encode_visual_object_header(MpegEncContext *s)
     int profile_and_level_indication;
     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;
     } else if (s->max_b_frames || s->quarter_sample) {
         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
     }
 
-    if (s->avctx->level != FF_LEVEL_UNKNOWN)
+    if (s->avctx->level != AV_LEVEL_UNKNOWN)
         profile_and_level_indication |= s->avctx->level;
     else
         profile_and_level_indication |= 1;   // level 1
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 1e83ea9734..7184a9efa3 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1219,19 +1219,19 @@  static av_cold int nvenc_setup_h264_config(AVCodecContext *avctx)
         switch(ctx->profile) {
         case NV_ENC_H264_PROFILE_BASELINE:
             cc->profileGUID = NV_ENC_H264_PROFILE_BASELINE_GUID;
-            avctx->profile = FF_PROFILE_H264_BASELINE;
+            avctx->profile = AV_PROFILE_H264_BASELINE;
             break;
         case NV_ENC_H264_PROFILE_MAIN:
             cc->profileGUID = NV_ENC_H264_PROFILE_MAIN_GUID;
-            avctx->profile = FF_PROFILE_H264_MAIN;
+            avctx->profile = AV_PROFILE_H264_MAIN;
             break;
         case NV_ENC_H264_PROFILE_HIGH:
             cc->profileGUID = NV_ENC_H264_PROFILE_HIGH_GUID;
-            avctx->profile = FF_PROFILE_H264_HIGH;
+            avctx->profile = AV_PROFILE_H264_HIGH;
             break;
         case NV_ENC_H264_PROFILE_HIGH_444P:
             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;
         }
     }
@@ -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
     if (IS_YUV444(ctx->data_pix_fmt)) {
         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;
 
@@ -1335,28 +1335,28 @@  static av_cold int nvenc_setup_hevc_config(AVCodecContext *avctx)
     switch (ctx->profile) {
     case NV_ENC_HEVC_PROFILE_MAIN:
         cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN_GUID;
-        avctx->profile  = FF_PROFILE_HEVC_MAIN;
+        avctx->profile  = AV_PROFILE_HEVC_MAIN;
         break;
     case NV_ENC_HEVC_PROFILE_MAIN_10:
         cc->profileGUID = NV_ENC_HEVC_PROFILE_MAIN10_GUID;
-        avctx->profile  = FF_PROFILE_HEVC_MAIN_10;
+        avctx->profile  = AV_PROFILE_HEVC_MAIN_10;
         break;
     case NV_ENC_HEVC_PROFILE_REXT:
         cc->profileGUID = NV_ENC_HEVC_PROFILE_FREXT_GUID;
-        avctx->profile  = FF_PROFILE_HEVC_REXT;
+        avctx->profile  = AV_PROFILE_HEVC_REXT;
         break;
     }
 
     // force setting profile as main10 if input is 10 bit
     if (IS_10BIT(ctx->data_pix_fmt)) {
         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
     if (IS_YUV444(ctx->data_pix_fmt)) {
         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;
@@ -1407,7 +1407,7 @@  static av_cold int nvenc_setup_av1_config(AVCodecContext *avctx)
         return AVERROR(ENOTSUP);
     } else {
         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) {
diff --git a/libavcodec/nvenc_hevc.c b/libavcodec/nvenc_hevc.c
index e606655e7e..e88f7e9783 100644
--- a/libavcodec/nvenc_hevc.c
+++ b/libavcodec/nvenc_hevc.c
@@ -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" },
     { "lossless",    "Lossless",                            0,                    AV_OPT_TYPE_CONST, { .i64 = NV_ENC_TUNING_INFO_LOSSLESS },                 0, 0, VE, "tune" },
 #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" },
     { "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" },
diff --git a/libavcodec/omx.c b/libavcodec/omx.c
index 6e667971ea..8d6519d141 100644
--- a/libavcodec/omx.c
+++ b/libavcodec/omx.c
@@ -531,14 +531,14 @@  static av_cold int omx_component_init(AVCodecContext *avctx, const char *role)
         CHECK(err);
         avc.nBFrames = 0;
         avc.nPFrames = avctx->gop_size - 1;
-        switch (s->profile == FF_PROFILE_UNKNOWN ? avctx->profile : s->profile) {
-        case FF_PROFILE_H264_BASELINE:
+        switch (s->profile == AV_PROFILE_UNKNOWN ? avctx->profile : s->profile) {
+        case AV_PROFILE_H264_BASELINE:
             avc.eProfile = OMX_VIDEO_AVCProfileBaseline;
             break;
-        case FF_PROFILE_H264_MAIN:
+        case AV_PROFILE_H264_MAIN:
             avc.eProfile = OMX_VIDEO_AVCProfileMain;
             break;
-        case FF_PROFILE_H264_HIGH:
+        case AV_PROFILE_H264_HIGH:
             avc.eProfile = OMX_VIDEO_AVCProfileHigh;
             break;
         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_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 },
-    { "profile",  "Set the encoding profile", OFFSET(profile), AV_OPT_TYPE_INT,   { .i64 = FF_PROFILE_UNKNOWN },       FF_PROFILE_UNKNOWN, FF_PROFILE_H264_HIGH, VE, "profile" },
-    { "baseline", "",                         0,               AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_BASELINE }, 0, 0, VE, "profile" },
-    { "main",     "",                         0,               AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_MAIN },     0, 0, VE, "profile" },
-    { "high",     "",                         0,               AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH },     0, 0, 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 = AV_PROFILE_H264_BASELINE }, 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 = AV_PROFILE_H264_HIGH },     0, 0, VE, "profile" },
     { NULL }
 };
 
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index bb4b894b06..47e4a313bc 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -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},
 {"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},
-{"profile", NULL, OFFSET(profile), AV_OPT_TYPE_INT, {.i64 = FF_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"},
-{"main10",  NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, INT_MAX, V|E, "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 = AV_PROFILE_UNKNOWN }, INT_MIN, INT_MAX, V|A|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"},
 {"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},
diff --git a/libavcodec/profiles.c b/libavcodec/profiles.c
index c646a3f54d..5bb8f150e6 100644
--- a/libavcodec/profiles.c
+++ b/libavcodec/profiles.c
@@ -24,180 +24,180 @@ 
 #if !CONFIG_SMALL
 
 const AVProfile ff_aac_profiles[] = {
-    { FF_PROFILE_AAC_LOW,   "LC"       },
-    { FF_PROFILE_AAC_HE,    "HE-AAC"   },
-    { FF_PROFILE_AAC_HE_V2, "HE-AACv2" },
-    { FF_PROFILE_AAC_LD,    "LD"       },
-    { FF_PROFILE_AAC_ELD,   "ELD"      },
-    { FF_PROFILE_AAC_MAIN,  "Main" },
-    { FF_PROFILE_AAC_SSR,   "SSR"  },
-    { FF_PROFILE_AAC_LTP,   "LTP"  },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_AAC_LOW,   "LC"       },
+    { AV_PROFILE_AAC_HE,    "HE-AAC"   },
+    { AV_PROFILE_AAC_HE_V2, "HE-AACv2" },
+    { AV_PROFILE_AAC_LD,    "LD"       },
+    { AV_PROFILE_AAC_ELD,   "ELD"      },
+    { AV_PROFILE_AAC_MAIN,  "Main" },
+    { AV_PROFILE_AAC_SSR,   "SSR"  },
+    { AV_PROFILE_AAC_LTP,   "LTP"  },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_dca_profiles[] = {
-    { FF_PROFILE_DTS,                "DTS"                    },
-    { FF_PROFILE_DTS_ES,             "DTS-ES"                 },
-    { FF_PROFILE_DTS_96_24,          "DTS 96/24"              },
-    { FF_PROFILE_DTS_HD_HRA,         "DTS-HD HRA"             },
-    { FF_PROFILE_DTS_HD_MA,          "DTS-HD MA"              },
-    { FF_PROFILE_DTS_HD_MA_X,        "DTS-HD MA + DTS:X"      },
-    { FF_PROFILE_DTS_HD_MA_X_IMAX,   "DTS-HD MA + DTS:X IMAX" },
-    { FF_PROFILE_DTS_EXPRESS,        "DTS Express"            },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_DTS,                "DTS"                    },
+    { AV_PROFILE_DTS_ES,             "DTS-ES"                 },
+    { AV_PROFILE_DTS_96_24,          "DTS 96/24"              },
+    { AV_PROFILE_DTS_HD_HRA,         "DTS-HD HRA"             },
+    { AV_PROFILE_DTS_HD_MA,          "DTS-HD MA"              },
+    { AV_PROFILE_DTS_HD_MA_X,        "DTS-HD MA + DTS:X"      },
+    { AV_PROFILE_DTS_HD_MA_X_IMAX,   "DTS-HD MA + DTS:X IMAX" },
+    { AV_PROFILE_DTS_EXPRESS,        "DTS Express"            },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_eac3_profiles[] = {
-  { FF_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"},
-  { FF_PROFILE_UNKNOWN },
+  { AV_PROFILE_EAC3_DDP_ATMOS, "Dolby Digital Plus + Dolby Atmos"},
+  { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_truehd_profiles[] = {
-  { FF_PROFILE_TRUEHD_ATMOS,   "Dolby TrueHD + Dolby Atmos"},
-  { FF_PROFILE_UNKNOWN },
+  { AV_PROFILE_TRUEHD_ATMOS,   "Dolby TrueHD + Dolby Atmos"},
+  { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_dnxhd_profiles[] = {
-  { FF_PROFILE_DNXHD,      "DNXHD"},
-  { FF_PROFILE_DNXHR_LB,   "DNXHR LB"},
-  { FF_PROFILE_DNXHR_SQ,   "DNXHR SQ"},
-  { FF_PROFILE_DNXHR_HQ,   "DNXHR HQ" },
-  { FF_PROFILE_DNXHR_HQX,  "DNXHR HQX"},
-  { FF_PROFILE_DNXHR_444,  "DNXHR 444"},
-  { FF_PROFILE_UNKNOWN },
+  { AV_PROFILE_DNXHD,      "DNXHD"},
+  { AV_PROFILE_DNXHR_LB,   "DNXHR LB"},
+  { AV_PROFILE_DNXHR_SQ,   "DNXHR SQ"},
+  { AV_PROFILE_DNXHR_HQ,   "DNXHR HQ" },
+  { AV_PROFILE_DNXHR_HQX,  "DNXHR HQX"},
+  { AV_PROFILE_DNXHR_444,  "DNXHR 444"},
+  { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_h264_profiles[] = {
-    { FF_PROFILE_H264_BASELINE,             "Baseline"              },
-    { FF_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline"  },
-    { FF_PROFILE_H264_MAIN,                 "Main"                  },
-    { FF_PROFILE_H264_EXTENDED,             "Extended"              },
-    { FF_PROFILE_H264_HIGH,                 "High"                  },
-    { FF_PROFILE_H264_HIGH_10,              "High 10"               },
-    { FF_PROFILE_H264_HIGH_10_INTRA,        "High 10 Intra"         },
-    { FF_PROFILE_H264_HIGH_422,             "High 4:2:2"            },
-    { FF_PROFILE_H264_HIGH_422_INTRA,       "High 4:2:2 Intra"      },
-    { FF_PROFILE_H264_HIGH_444,             "High 4:4:4"            },
-    { FF_PROFILE_H264_HIGH_444_PREDICTIVE,  "High 4:4:4 Predictive" },
-    { FF_PROFILE_H264_HIGH_444_INTRA,       "High 4:4:4 Intra"      },
-    { FF_PROFILE_H264_CAVLC_444,            "CAVLC 4:4:4"           },
-    { FF_PROFILE_H264_MULTIVIEW_HIGH,       "Multiview High"        },
-    { FF_PROFILE_H264_STEREO_HIGH,          "Stereo High"           },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_H264_BASELINE,             "Baseline"              },
+    { AV_PROFILE_H264_CONSTRAINED_BASELINE, "Constrained Baseline"  },
+    { AV_PROFILE_H264_MAIN,                 "Main"                  },
+    { AV_PROFILE_H264_EXTENDED,             "Extended"              },
+    { AV_PROFILE_H264_HIGH,                 "High"                  },
+    { AV_PROFILE_H264_HIGH_10,              "High 10"               },
+    { AV_PROFILE_H264_HIGH_10_INTRA,        "High 10 Intra"         },
+    { AV_PROFILE_H264_HIGH_422,             "High 4:2:2"            },
+    { AV_PROFILE_H264_HIGH_422_INTRA,       "High 4:2:2 Intra"      },
+    { AV_PROFILE_H264_HIGH_444,             "High 4:4:4"            },
+    { AV_PROFILE_H264_HIGH_444_PREDICTIVE,  "High 4:4:4 Predictive" },
+    { AV_PROFILE_H264_HIGH_444_INTRA,       "High 4:4:4 Intra"      },
+    { AV_PROFILE_H264_CAVLC_444,            "CAVLC 4:4:4"           },
+    { AV_PROFILE_H264_MULTIVIEW_HIGH,       "Multiview High"        },
+    { AV_PROFILE_H264_STEREO_HIGH,          "Stereo High"           },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_vvc_profiles[] = {
-    { FF_PROFILE_VVC_MAIN_10,                   "Main 10" },
-    { FF_PROFILE_VVC_MAIN_10_444,               "Main 10 4:4:4" },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_VVC_MAIN_10,                   "Main 10" },
+    { AV_PROFILE_VVC_MAIN_10_444,               "Main 10 4:4:4" },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_hevc_profiles[] = {
-    { FF_PROFILE_HEVC_MAIN,                 "Main"                },
-    { FF_PROFILE_HEVC_MAIN_10,              "Main 10"             },
-    { FF_PROFILE_HEVC_MAIN_STILL_PICTURE,   "Main Still Picture"  },
-    { FF_PROFILE_HEVC_REXT,                 "Rext"                },
-    { FF_PROFILE_HEVC_SCC,                  "Scc"                 },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_HEVC_MAIN,                 "Main"                },
+    { AV_PROFILE_HEVC_MAIN_10,              "Main 10"             },
+    { AV_PROFILE_HEVC_MAIN_STILL_PICTURE,   "Main Still Picture"  },
+    { AV_PROFILE_HEVC_REXT,                 "Rext"                },
+    { AV_PROFILE_HEVC_SCC,                  "Scc"                 },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_jpeg2000_profiles[] = {
-    { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0,  "JPEG 2000 codestream restriction 0"   },
-    { FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1,  "JPEG 2000 codestream restriction 1"   },
-    { FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
-    { FF_PROFILE_JPEG2000_DCINEMA_2K,             "JPEG 2000 digital cinema 2K"          },
-    { FF_PROFILE_JPEG2000_DCINEMA_4K,             "JPEG 2000 digital cinema 4K"          },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0,  "JPEG 2000 codestream restriction 0"   },
+    { AV_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1,  "JPEG 2000 codestream restriction 1"   },
+    { AV_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION, "JPEG 2000 no codestream restrictions" },
+    { AV_PROFILE_JPEG2000_DCINEMA_2K,             "JPEG 2000 digital cinema 2K"          },
+    { AV_PROFILE_JPEG2000_DCINEMA_4K,             "JPEG 2000 digital cinema 4K"          },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_mpeg2_video_profiles[] = {
-    { FF_PROFILE_MPEG2_422,          "4:2:2"              },
-    { FF_PROFILE_MPEG2_HIGH,         "High"               },
-    { FF_PROFILE_MPEG2_SS,           "Spatially Scalable" },
-    { FF_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable"       },
-    { FF_PROFILE_MPEG2_MAIN,         "Main"               },
-    { FF_PROFILE_MPEG2_SIMPLE,       "Simple"             },
-    { FF_PROFILE_RESERVED,           "Reserved"           },
-    { FF_PROFILE_UNKNOWN                                  },
+    { AV_PROFILE_MPEG2_422,          "4:2:2"              },
+    { AV_PROFILE_MPEG2_HIGH,         "High"               },
+    { AV_PROFILE_MPEG2_SS,           "Spatially Scalable" },
+    { AV_PROFILE_MPEG2_SNR_SCALABLE, "SNR Scalable"       },
+    { AV_PROFILE_MPEG2_MAIN,         "Main"               },
+    { AV_PROFILE_MPEG2_SIMPLE,       "Simple"             },
+    { AV_PROFILE_RESERVED,           "Reserved"           },
+    { AV_PROFILE_UNKNOWN                                  },
 };
 
 const AVProfile ff_mpeg4_video_profiles[] = {
-    { FF_PROFILE_MPEG4_SIMPLE,                    "Simple Profile" },
-    { FF_PROFILE_MPEG4_SIMPLE_SCALABLE,           "Simple Scalable Profile" },
-    { FF_PROFILE_MPEG4_CORE,                      "Core Profile" },
-    { FF_PROFILE_MPEG4_MAIN,                      "Main Profile" },
-    { FF_PROFILE_MPEG4_N_BIT,                     "N-bit Profile" },
-    { FF_PROFILE_MPEG4_SCALABLE_TEXTURE,          "Scalable Texture Profile" },
-    { FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION,     "Simple Face Animation Profile" },
-    { FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE,    "Basic Animated Texture Profile" },
-    { FF_PROFILE_MPEG4_HYBRID,                    "Hybrid Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_REAL_TIME,        "Advanced Real Time Simple Profile" },
-    { FF_PROFILE_MPEG4_CORE_SCALABLE,             "Code Scalable Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_CODING,           "Advanced Coding Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_CORE,             "Advanced Core Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
-    { FF_PROFILE_MPEG4_SIMPLE_STUDIO,             "Simple Studio Profile" },
-    { FF_PROFILE_MPEG4_ADVANCED_SIMPLE,           "Advanced Simple Profile" },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_MPEG4_SIMPLE,                    "Simple Profile" },
+    { AV_PROFILE_MPEG4_SIMPLE_SCALABLE,           "Simple Scalable Profile" },
+    { AV_PROFILE_MPEG4_CORE,                      "Core Profile" },
+    { AV_PROFILE_MPEG4_MAIN,                      "Main Profile" },
+    { AV_PROFILE_MPEG4_N_BIT,                     "N-bit Profile" },
+    { AV_PROFILE_MPEG4_SCALABLE_TEXTURE,          "Scalable Texture Profile" },
+    { AV_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION,     "Simple Face Animation Profile" },
+    { AV_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE,    "Basic Animated Texture Profile" },
+    { AV_PROFILE_MPEG4_HYBRID,                    "Hybrid Profile" },
+    { AV_PROFILE_MPEG4_ADVANCED_REAL_TIME,        "Advanced Real Time Simple Profile" },
+    { AV_PROFILE_MPEG4_CORE_SCALABLE,             "Code Scalable Profile" },
+    { AV_PROFILE_MPEG4_ADVANCED_CODING,           "Advanced Coding Profile" },
+    { AV_PROFILE_MPEG4_ADVANCED_CORE,             "Advanced Core Profile" },
+    { AV_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE, "Advanced Scalable Texture Profile" },
+    { AV_PROFILE_MPEG4_SIMPLE_STUDIO,             "Simple Studio Profile" },
+    { AV_PROFILE_MPEG4_ADVANCED_SIMPLE,           "Advanced Simple Profile" },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_vc1_profiles[] = {
-    { FF_PROFILE_VC1_SIMPLE,   "Simple"   },
-    { FF_PROFILE_VC1_MAIN,     "Main"     },
-    { FF_PROFILE_VC1_COMPLEX,  "Complex"  },
-    { FF_PROFILE_VC1_ADVANCED, "Advanced" },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_VC1_SIMPLE,   "Simple"   },
+    { AV_PROFILE_VC1_MAIN,     "Main"     },
+    { AV_PROFILE_VC1_COMPLEX,  "Complex"  },
+    { AV_PROFILE_VC1_ADVANCED, "Advanced" },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_vp9_profiles[] = {
-    { FF_PROFILE_VP9_0, "Profile 0" },
-    { FF_PROFILE_VP9_1, "Profile 1" },
-    { FF_PROFILE_VP9_2, "Profile 2" },
-    { FF_PROFILE_VP9_3, "Profile 3" },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_VP9_0, "Profile 0" },
+    { AV_PROFILE_VP9_1, "Profile 1" },
+    { AV_PROFILE_VP9_2, "Profile 2" },
+    { AV_PROFILE_VP9_3, "Profile 3" },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_av1_profiles[] = {
-    { FF_PROFILE_AV1_MAIN,         "Main" },
-    { FF_PROFILE_AV1_HIGH,         "High" },
-    { FF_PROFILE_AV1_PROFESSIONAL, "Professional" },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_AV1_MAIN,         "Main" },
+    { AV_PROFILE_AV1_HIGH,         "High" },
+    { AV_PROFILE_AV1_PROFESSIONAL, "Professional" },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_sbc_profiles[] = {
-    { FF_PROFILE_SBC_MSBC, "mSBC" },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_SBC_MSBC, "mSBC" },
+    { AV_PROFILE_UNKNOWN },
 };
 
 const AVProfile ff_prores_profiles[] = {
-    { FF_PROFILE_PRORES_PROXY,    "Proxy"    },
-    { FF_PROFILE_PRORES_LT,       "LT"       },
-    { FF_PROFILE_PRORES_STANDARD, "Standard" },
-    { FF_PROFILE_PRORES_HQ,       "HQ"       },
-    { FF_PROFILE_PRORES_4444,     "4444"     },
-    { FF_PROFILE_PRORES_XQ,       "XQ"       },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_PRORES_PROXY,    "Proxy"    },
+    { AV_PROFILE_PRORES_LT,       "LT"       },
+    { AV_PROFILE_PRORES_STANDARD, "Standard" },
+    { AV_PROFILE_PRORES_HQ,       "HQ"       },
+    { AV_PROFILE_PRORES_4444,     "4444"     },
+    { AV_PROFILE_PRORES_XQ,       "XQ"       },
+    { AV_PROFILE_UNKNOWN }
 };
 
 const AVProfile ff_mjpeg_profiles[] = {
-    { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,            "Baseline"    },
-    { FF_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential"  },
-    { FF_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT,         "Progressive" },
-    { FF_PROFILE_MJPEG_HUFFMAN_LOSSLESS,                "Lossless"    },
-    { FF_PROFILE_MJPEG_JPEG_LS,                         "JPEG LS"     },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,            "Baseline"    },
+    { AV_PROFILE_MJPEG_HUFFMAN_EXTENDED_SEQUENTIAL_DCT, "Sequential"  },
+    { AV_PROFILE_MJPEG_HUFFMAN_PROGRESSIVE_DCT,         "Progressive" },
+    { AV_PROFILE_MJPEG_HUFFMAN_LOSSLESS,                "Lossless"    },
+    { AV_PROFILE_MJPEG_JPEG_LS,                         "JPEG LS"     },
+    { AV_PROFILE_UNKNOWN }
 };
 
 const AVProfile ff_arib_caption_profiles[] = {
-    { FF_PROFILE_ARIB_PROFILE_A, "Profile A" },
-    { FF_PROFILE_ARIB_PROFILE_C, "Profile C" },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_ARIB_PROFILE_A, "Profile A" },
+    { AV_PROFILE_ARIB_PROFILE_C, "Profile C" },
+    { AV_PROFILE_UNKNOWN }
 };
 
 const AVProfile ff_evc_profiles[] = {
-    { FF_PROFILE_EVC_BASELINE,             "Baseline"              },
-    { FF_PROFILE_EVC_MAIN,                 "Main"                  },
-    { FF_PROFILE_UNKNOWN },
+    { AV_PROFILE_EVC_BASELINE,             "Baseline"              },
+    { AV_PROFILE_EVC_MAIN,                 "Main"                  },
+    { AV_PROFILE_UNKNOWN },
 };
 
 #endif /* !CONFIG_SMALL */
diff --git a/libavcodec/profiles.h b/libavcodec/profiles.h
index c0eacae5c1..270430a48b 100644
--- a/libavcodec/profiles.h
+++ b/libavcodec/profiles.h
@@ -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"},
 
 #define FF_AAC_PROFILE_OPTS \
-    FF_AVCTX_PROFILE_OPTION("aac_main",      NULL, AUDIO, FF_PROFILE_AAC_MAIN)\
-    FF_AVCTX_PROFILE_OPTION("aac_low",       NULL, AUDIO, FF_PROFILE_AAC_LOW)\
-    FF_AVCTX_PROFILE_OPTION("aac_ssr",       NULL, AUDIO, FF_PROFILE_AAC_SSR)\
-    FF_AVCTX_PROFILE_OPTION("aac_ltp",       NULL, AUDIO, FF_PROFILE_AAC_LTP)\
-    FF_AVCTX_PROFILE_OPTION("aac_he",        NULL, AUDIO, FF_PROFILE_AAC_HE)\
-    FF_AVCTX_PROFILE_OPTION("aac_he_v2",     NULL, AUDIO, FF_PROFILE_AAC_HE_V2)\
-    FF_AVCTX_PROFILE_OPTION("aac_ld",        NULL, AUDIO, FF_PROFILE_AAC_LD)\
-    FF_AVCTX_PROFILE_OPTION("aac_eld",       NULL, AUDIO, FF_PROFILE_AAC_ELD)\
-    FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, FF_PROFILE_MPEG2_AAC_LOW)\
-    FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he",  NULL, AUDIO, FF_PROFILE_MPEG2_AAC_HE)\
+    FF_AVCTX_PROFILE_OPTION("aac_main",      NULL, AUDIO, AV_PROFILE_AAC_MAIN)\
+    FF_AVCTX_PROFILE_OPTION("aac_low",       NULL, AUDIO, AV_PROFILE_AAC_LOW)\
+    FF_AVCTX_PROFILE_OPTION("aac_ssr",       NULL, AUDIO, AV_PROFILE_AAC_SSR)\
+    FF_AVCTX_PROFILE_OPTION("aac_ltp",       NULL, AUDIO, AV_PROFILE_AAC_LTP)\
+    FF_AVCTX_PROFILE_OPTION("aac_he",        NULL, AUDIO, AV_PROFILE_AAC_HE)\
+    FF_AVCTX_PROFILE_OPTION("aac_he_v2",     NULL, AUDIO, AV_PROFILE_AAC_HE_V2)\
+    FF_AVCTX_PROFILE_OPTION("aac_ld",        NULL, AUDIO, AV_PROFILE_AAC_LD)\
+    FF_AVCTX_PROFILE_OPTION("aac_eld",       NULL, AUDIO, AV_PROFILE_AAC_ELD)\
+    FF_AVCTX_PROFILE_OPTION("mpeg2_aac_low", NULL, AUDIO, AV_PROFILE_MPEG2_AAC_LOW)\
+    FF_AVCTX_PROFILE_OPTION("mpeg2_aac_he",  NULL, AUDIO, AV_PROFILE_MPEG2_AAC_HE)\
 
 #define FF_MPEG4_PROFILE_OPTS \
-    FF_AVCTX_PROFILE_OPTION("mpeg4_sp",      NULL, VIDEO, FF_PROFILE_MPEG4_SIMPLE)\
-    FF_AVCTX_PROFILE_OPTION("mpeg4_core",    NULL, VIDEO, FF_PROFILE_MPEG4_CORE)\
-    FF_AVCTX_PROFILE_OPTION("mpeg4_main",    NULL, VIDEO, FF_PROFILE_MPEG4_MAIN)\
-    FF_AVCTX_PROFILE_OPTION("mpeg4_asp",     NULL, VIDEO, FF_PROFILE_MPEG4_ADVANCED_SIMPLE)\
+    FF_AVCTX_PROFILE_OPTION("mpeg4_sp",      NULL, VIDEO, AV_PROFILE_MPEG4_SIMPLE)\
+    FF_AVCTX_PROFILE_OPTION("mpeg4_core",    NULL, VIDEO, AV_PROFILE_MPEG4_CORE)\
+    FF_AVCTX_PROFILE_OPTION("mpeg4_main",    NULL, VIDEO, AV_PROFILE_MPEG4_MAIN)\
+    FF_AVCTX_PROFILE_OPTION("mpeg4_asp",     NULL, VIDEO, AV_PROFILE_MPEG4_ADVANCED_SIMPLE)\
 
 #define FF_MPEG2_PROFILE_OPTS \
-    FF_AVCTX_PROFILE_OPTION("422",           NULL, VIDEO, FF_PROFILE_MPEG2_422)\
-    FF_AVCTX_PROFILE_OPTION("high",          NULL, VIDEO, FF_PROFILE_MPEG2_HIGH)\
-    FF_AVCTX_PROFILE_OPTION("ss",            NULL, VIDEO, FF_PROFILE_MPEG2_SS)\
-    FF_AVCTX_PROFILE_OPTION("snr",           NULL, VIDEO, FF_PROFILE_MPEG2_SNR_SCALABLE)\
-    FF_AVCTX_PROFILE_OPTION("main",          NULL, VIDEO, FF_PROFILE_MPEG2_MAIN)\
-    FF_AVCTX_PROFILE_OPTION("simple",        NULL, VIDEO, FF_PROFILE_MPEG2_SIMPLE)\
+    FF_AVCTX_PROFILE_OPTION("422",           NULL, VIDEO, AV_PROFILE_MPEG2_422)\
+    FF_AVCTX_PROFILE_OPTION("high",          NULL, VIDEO, AV_PROFILE_MPEG2_HIGH)\
+    FF_AVCTX_PROFILE_OPTION("ss",            NULL, VIDEO, AV_PROFILE_MPEG2_SS)\
+    FF_AVCTX_PROFILE_OPTION("snr",           NULL, VIDEO, AV_PROFILE_MPEG2_SNR_SCALABLE)\
+    FF_AVCTX_PROFILE_OPTION("main",          NULL, VIDEO, AV_PROFILE_MPEG2_MAIN)\
+    FF_AVCTX_PROFILE_OPTION("simple",        NULL, VIDEO, AV_PROFILE_MPEG2_SIMPLE)\
 
 #define FF_AV1_PROFILE_OPTS \
-    FF_AVCTX_PROFILE_OPTION("main",          NULL, VIDEO, FF_PROFILE_AV1_MAIN)\
-    FF_AVCTX_PROFILE_OPTION("high",          NULL, VIDEO, FF_PROFILE_AV1_HIGH)\
-    FF_AVCTX_PROFILE_OPTION("professional",  NULL, VIDEO, FF_PROFILE_AV1_PROFESSIONAL)\
+    FF_AVCTX_PROFILE_OPTION("main",          NULL, VIDEO, AV_PROFILE_AV1_MAIN)\
+    FF_AVCTX_PROFILE_OPTION("high",          NULL, VIDEO, AV_PROFILE_AV1_HIGH)\
+    FF_AVCTX_PROFILE_OPTION("professional",  NULL, VIDEO, AV_PROFILE_AV1_PROFESSIONAL)\
 
 extern const AVProfile ff_aac_profiles[];
 extern const AVProfile ff_dca_profiles[];
diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
index ae5838eca4..9297860946 100644
--- a/libavcodec/proresdec2.c
+++ b/libavcodec/proresdec2.c
@@ -141,27 +141,27 @@  static av_cold int decode_init(AVCodecContext *avctx)
 
     switch (avctx->codec_tag) {
     case MKTAG('a','p','c','o'):
-        avctx->profile = FF_PROFILE_PRORES_PROXY;
+        avctx->profile = AV_PROFILE_PRORES_PROXY;
         break;
     case MKTAG('a','p','c','s'):
-        avctx->profile = FF_PROFILE_PRORES_LT;
+        avctx->profile = AV_PROFILE_PRORES_LT;
         break;
     case MKTAG('a','p','c','n'):
-        avctx->profile = FF_PROFILE_PRORES_STANDARD;
+        avctx->profile = AV_PROFILE_PRORES_STANDARD;
         break;
     case MKTAG('a','p','c','h'):
-        avctx->profile = FF_PROFILE_PRORES_HQ;
+        avctx->profile = AV_PROFILE_PRORES_HQ;
         break;
     case MKTAG('a','p','4','h'):
-        avctx->profile = FF_PROFILE_PRORES_4444;
+        avctx->profile = AV_PROFILE_PRORES_4444;
         avctx->bits_per_raw_sample = 12;
         break;
     case MKTAG('a','p','4','x'):
-        avctx->profile = FF_PROFILE_PRORES_XQ;
+        avctx->profile = AV_PROFILE_PRORES_XQ;
         avctx->bits_per_raw_sample = 12;
         break;
     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);
     }
 
diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index c701275e5d..e7114f1646 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -41,13 +41,13 @@ 
 #define DEFAULT_SLICE_MB_WIDTH 8
 
 static const AVProfile profiles[] = {
-    { FF_PROFILE_PRORES_PROXY,    "apco"},
-    { FF_PROFILE_PRORES_LT,       "apcs"},
-    { FF_PROFILE_PRORES_STANDARD, "apcn"},
-    { FF_PROFILE_PRORES_HQ,       "apch"},
-    { FF_PROFILE_PRORES_4444,     "ap4h"},
-    { FF_PROFILE_PRORES_XQ,       "ap4x"},
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_PRORES_PROXY,    "apco"},
+    { AV_PROFILE_PRORES_LT,       "apcs"},
+    { AV_PROFILE_PRORES_STANDARD, "apcn"},
+    { AV_PROFILE_PRORES_HQ,       "apch"},
+    { AV_PROFILE_PRORES_4444,     "ap4h"},
+    { AV_PROFILE_PRORES_XQ,       "ap4x"},
+    { AV_PROFILE_UNKNOWN }
 };
 
 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->height);
     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 */
     if (ctx->is_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);
     *buf++ = int_from_list_or_default(avctx, "frame colorspace",
                                       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) {
             *buf++ = 0xA0;/* src b64a and no alpha */
         } else {
@@ -871,40 +871,40 @@  static av_cold int prores_encode_init(AVCodecContext *avctx)
         return AVERROR(EINVAL);
     }
 
-    if (avctx->profile == FF_PROFILE_UNKNOWN) {
+    if (avctx->profile == AV_PROFILE_UNKNOWN) {
         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,
                 "encoding with ProRes standard (apcn) profile\n");
         } 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,
                    "encoding with ProRes 4444 (ap4h) profile\n");
         } 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,
                    "encoding with ProRes 4444+ (ap4h) profile\n");
         }
-    } else if (avctx->profile < FF_PROFILE_PRORES_PROXY
-            || avctx->profile > FF_PROFILE_PRORES_XQ) {
+    } else if (avctx->profile < AV_PROFILE_PRORES_PROXY
+            || avctx->profile > AV_PROFILE_PRORES_XQ) {
         av_log(
                 avctx,
                 AV_LOG_ERROR,
                 "unknown profile %d, use [0 - apco, 1 - apcs, 2 - apcn (default), 3 - apch, 4 - ap4h, 5 - ap4x]\n",
                 avctx->profile);
         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,
                "encoding with ProRes 444/Xq (ap4h/ap4x) profile, need YUV444P10 input\n");
         return AVERROR(EINVAL);
     }  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,
                "encoding with ProRes Proxy/LT/422/422 HQ (apco, apcs, apcn, ap4h) profile, need YUV422P10 input\n");
         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;
         if ((avctx->height & 0xf) || (avctx->width & 0xf)) {
             ctx->fill_y = av_malloc(4 * (DEFAULT_SLICE_MB_WIDTH << 8));
diff --git a/libavcodec/sbcenc.c b/libavcodec/sbcenc.c
index fccb0e3ea3..45eb9a9a5e 100644
--- a/libavcodec/sbcenc.c
+++ b/libavcodec/sbcenc.c
@@ -198,7 +198,7 @@  static int sbc_encode_init(AVCodecContext *avctx)
     SBCEncContext *sbc = avctx->priv_data;
     struct sbc_frame *frame = &sbc->frame;
 
-    if (avctx->profile == FF_PROFILE_SBC_MSBC)
+    if (avctx->profile == AV_PROFILE_SBC_MSBC)
         sbc->msbc = 1;
 
     if (sbc->msbc) {
@@ -332,7 +332,7 @@  static const AVOption options[] = {
       OFFSET(max_delay), AV_OPT_TYPE_DURATION, {.i64 = 13000}, 1000,13000, AE },
     { "msbc",      "use mSBC mode (wideband speech mono SBC)",
       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 },
 };
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bd4131db62..06955272da 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -434,10 +434,10 @@  const char *avcodec_get_name(enum AVCodecID id)
 const char *av_get_profile_name(const AVCodec *codec, int profile)
 {
     const AVProfile *p;
-    if (profile == FF_PROFILE_UNKNOWN || !codec->profiles)
+    if (profile == AV_PROFILE_UNKNOWN || !codec->profiles)
         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)
             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 AVProfile *p;
 
-    if (profile == FF_PROFILE_UNKNOWN || !desc || !desc->profiles)
+    if (profile == AV_PROFILE_UNKNOWN || !desc || !desc->profiles)
         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)
             return p->name;
 
diff --git a/libavcodec/v4l2_m2m_enc.c b/libavcodec/v4l2_m2m_enc.c
index 9a0837ecf3..e08db5d5d3 100644
--- a/libavcodec/v4l2_m2m_enc.c
+++ b/libavcodec/v4l2_m2m_enc.c
@@ -103,17 +103,17 @@  static inline unsigned int v4l2_h264_profile_from_ff(int p)
         unsigned int ffmpeg_val;
         unsigned int v4l2_val;
     } profile[] = {
-        { FF_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) },
-        { FF_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) },
-        { FF_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) },
-        { FF_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) },
-        { FF_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) },
-        { FF_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) },
-        { FF_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) },
-        { FF_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) },
-        { FF_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) },
+        { AV_PROFILE_H264_CONSTRAINED_BASELINE, MPEG_VIDEO(H264_PROFILE_CONSTRAINED_BASELINE) },
+        { AV_PROFILE_H264_HIGH_444_PREDICTIVE, MPEG_VIDEO(H264_PROFILE_HIGH_444_PREDICTIVE) },
+        { AV_PROFILE_H264_HIGH_422_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_422_INTRA) },
+        { AV_PROFILE_H264_HIGH_444_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_444_INTRA) },
+        { AV_PROFILE_H264_HIGH_10_INTRA, MPEG_VIDEO(H264_PROFILE_HIGH_10_INTRA) },
+        { AV_PROFILE_H264_HIGH_422, MPEG_VIDEO(H264_PROFILE_HIGH_422) },
+        { AV_PROFILE_H264_BASELINE, MPEG_VIDEO(H264_PROFILE_BASELINE) },
+        { AV_PROFILE_H264_EXTENDED, MPEG_VIDEO(H264_PROFILE_EXTENDED) },
+        { AV_PROFILE_H264_HIGH_10, MPEG_VIDEO(H264_PROFILE_HIGH_10) },
+        { AV_PROFILE_H264_MAIN, MPEG_VIDEO(H264_PROFILE_MAIN) },
+        { AV_PROFILE_H264_HIGH, MPEG_VIDEO(H264_PROFILE_HIGH) },
     };
     int i;
 
@@ -130,11 +130,11 @@  static inline int v4l2_mpeg4_profile_from_ff(int p)
         unsigned int ffmpeg_val;
         unsigned int v4l2_val;
     } profile[] = {
-        { FF_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) },
-        { FF_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) },
-        { FF_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) },
-        { FF_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) },
-        { FF_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) },
+        { AV_PROFILE_MPEG4_ADVANCED_CODING, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY) },
+        { AV_PROFILE_MPEG4_ADVANCED_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_ADVANCED_SIMPLE) },
+        { AV_PROFILE_MPEG4_SIMPLE_SCALABLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE_SCALABLE) },
+        { AV_PROFILE_MPEG4_SIMPLE, MPEG_VIDEO(MPEG4_PROFILE_SIMPLE) },
+        { AV_PROFILE_MPEG4_CORE, MPEG_VIDEO(MPEG4_PROFILE_CORE) },
     };
     int i;
 
@@ -206,7 +206,7 @@  static int v4l2_prepare_encoder(V4L2m2mContext *s)
 
     switch (avctx->codec_id) {
     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);
             if (val < 0)
                 av_log(avctx, AV_LOG_WARNING, "h264 profile not found\n");
@@ -219,7 +219,7 @@  static int v4l2_prepare_encoder(V4L2m2mContext *s)
         qmax = 51;
         break;
     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);
             if (val < 0)
                 av_log(avctx, AV_LOG_WARNING, "mpeg4 profile not found\n");
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index dd55cbd6f1..10b4284db0 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -390,7 +390,7 @@  static const struct {
     VAProfile va_profile;
     VAProfile (*profile_parser)(AVCodecContext *avctx);
 } 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_MAIN,      MPEG2Main   ),
     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)
             continue;
         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;
 
         va_profile = vaapi_profile_map[i].profile_parser ?
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index bfca315a7a..0316fe5c18 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -1414,7 +1414,7 @@  static av_cold int vaapi_encode_profile_entrypoint(AVCodecContext *avctx)
 
     av_assert0(ctx->codec->profiles);
     for (i = 0; (ctx->codec->profiles[i].av_profile !=
-                 FF_PROFILE_UNKNOWN); i++) {
+                 AV_PROFILE_UNKNOWN); i++) {
         profile = &ctx->codec->profiles[i];
         if (depth               != profile->depth ||
             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))
             continue;
         if (avctx->profile != profile->av_profile &&
-            avctx->profile != FF_PROFILE_UNKNOWN)
+            avctx->profile != AV_PROFILE_UNKNOWN)
             continue;
 
 #if VA_CHECK_VERSION(1, 0, 0)
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index a1e639f56b..bd25cd5c95 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -134,7 +134,7 @@  typedef struct VAAPIEncodePicture {
 } VAAPIEncodePicture;
 
 typedef struct VAAPIEncodeProfile {
-    // lavc profile value (FF_PROFILE_*).
+    // lavc profile value (AV_PROFILE_*).
     int       av_profile;
     // Supported bit depth.
     int       depth;
@@ -384,7 +384,7 @@  enum {
 
 typedef struct VAAPIEncodeType {
     // List of supported profiles and corresponding VAAPI profiles.
-    // (Must end with FF_PROFILE_UNKNOWN.)
+    // (Must end with AV_PROFILE_UNKNOWN.)
     const VAAPIEncodeProfile *profiles;
 
     // Codec feature flags.
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 9ad017d540..09e1300113 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -322,15 +322,15 @@  static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
 
     sps->profile_idc = avctx->profile & 0xff;
 
-    if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE ||
-        avctx->profile == FF_PROFILE_H264_MAIN)
+    if (avctx->profile == AV_PROFILE_H264_CONSTRAINED_BASELINE ||
+        avctx->profile == AV_PROFILE_H264_MAIN)
         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;
 
-    if (avctx->profile == FF_PROFILE_H264_MAIN ||
-        avctx->profile == FF_PROFILE_H264_HIGH || avctx->profile == FF_PROFILE_H264_HIGH_10) {
+    if (avctx->profile == AV_PROFILE_H264_MAIN ||
+        avctx->profile == AV_PROFILE_H264_HIGH || avctx->profile == AV_PROFILE_H264_HIGH_10) {
         sps->constraint_set4_flag = 1;
         sps->constraint_set5_flag = ctx->b_per_p == 0;
     }
@@ -340,7 +340,7 @@  static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
     else
         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;
     } else {
         const H264LevelDescriptor *level;
@@ -512,9 +512,9 @@  static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
     pps->seq_parameter_set_id = 0;
 
     pps->entropy_coding_mode_flag =
-        !(sps->profile_idc == FF_PROFILE_H264_BASELINE ||
-          sps->profile_idc == FF_PROFILE_H264_EXTENDED ||
-          sps->profile_idc == FF_PROFILE_H264_CAVLC_444);
+        !(sps->profile_idc == AV_PROFILE_H264_BASELINE ||
+          sps->profile_idc == AV_PROFILE_H264_EXTENDED ||
+          sps->profile_idc == AV_PROFILE_H264_CAVLC_444);
     if (!priv->coder && pps->entropy_coding_mode_flag)
         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;
 
-    if (sps->profile_idc == FF_PROFILE_H264_BASELINE ||
-        sps->profile_idc == FF_PROFILE_H264_EXTENDED ||
-        sps->profile_idc == FF_PROFILE_H264_MAIN) {
+    if (sps->profile_idc == AV_PROFILE_H264_BASELINE ||
+        sps->profile_idc == AV_PROFILE_H264_EXTENDED ||
+        sps->profile_idc == AV_PROFILE_H264_MAIN) {
         pps->more_rbsp_data = 0;
     } else {
         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[] = {
 #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
-    { FF_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High },
-    { FF_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main },
-    { FF_PROFILE_H264_CONSTRAINED_BASELINE,
+    { AV_PROFILE_H264_HIGH, 8, 3, 1, 1, VAProfileH264High },
+    { AV_PROFILE_H264_MAIN, 8, 3, 1, 1, VAProfileH264Main },
+    { AV_PROFILE_H264_CONSTRAINED_BASELINE,
                             8, 3, 1, 1, VAProfileH264ConstrainedBaseline },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_UNKNOWN }
 };
 
 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;
 
-    if (avctx->profile == FF_PROFILE_UNKNOWN)
+    if (avctx->profile == AV_PROFILE_UNKNOWN)
         avctx->profile = priv->profile;
-    if (avctx->level == FF_LEVEL_UNKNOWN)
+    if (avctx->level == AV_LEVEL_UNKNOWN)
         avctx->level = priv->level;
     if (avctx->compression_level == FF_COMPRESSION_DEFAULT)
         avctx->compression_level = priv->quality;
 
     // Reject unsupported profiles.
     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 "
                "supported, using constrained baseline profile instead.\n");
-        avctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+        avctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
         break;
-    case FF_PROFILE_H264_EXTENDED:
+    case AV_PROFILE_H264_EXTENDED:
         av_log(avctx, AV_LOG_ERROR, "H.264 extended profile "
                "is not supported.\n");
         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 "
                "is not supported.\n");
         return AVERROR_PATCHWELCOME;
-    case FF_PROFILE_H264_HIGH_422:
-    case FF_PROFILE_H264_HIGH_422_INTRA:
-    case FF_PROFILE_H264_HIGH_444:
-    case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
-    case FF_PROFILE_H264_HIGH_444_INTRA:
-    case FF_PROFILE_H264_CAVLC_444:
+    case AV_PROFILE_H264_HIGH_422:
+    case AV_PROFILE_H264_HIGH_422_INTRA:
+    case AV_PROFILE_H264_HIGH_444:
+    case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
+    case AV_PROFILE_H264_HIGH_444_INTRA:
+    case AV_PROFILE_H264_CAVLC_444:
         av_log(avctx, AV_LOG_ERROR, "H.264 non-4:2:0 profiles "
                "are not supported.\n");
         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 "
                "in 8-bit unsigned integer.\n", avctx->level);
         return AVERROR(EINVAL);
@@ -1313,19 +1313,19 @@  static const AVOption vaapi_encode_h264_options[] = {
 
     { "profile", "Set profile (profile_idc and constraint_set*_flag)",
       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, \
       { .i64 = value }, 0, 0, FLAGS, "profile"
-    { PROFILE("constrained_baseline", FF_PROFILE_H264_CONSTRAINED_BASELINE) },
-    { PROFILE("main",                 FF_PROFILE_H264_MAIN) },
-    { PROFILE("high",                 FF_PROFILE_H264_HIGH) },
-    { PROFILE("high10",               FF_PROFILE_H264_HIGH_10) },
+    { PROFILE("constrained_baseline", AV_PROFILE_H264_CONSTRAINED_BASELINE) },
+    { PROFILE("main",                 AV_PROFILE_H264_MAIN) },
+    { PROFILE("high",                 AV_PROFILE_H264_HIGH) },
+    { PROFILE("high10",               AV_PROFILE_H264_HIGH_10) },
 #undef PROFILE
 
     { "level", "Set level (level_idc)",
       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, \
       { .i64 = value }, 0, 0, FLAGS, "level"
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index aa7e532f9a..efa59aecf5 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -346,7 +346,7 @@  static int vaapi_encode_h265_init_sequence_params(AVCodecContext *avctx)
 
     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;
     } else {
         const H265LevelDescriptor *level;
@@ -1290,22 +1290,22 @@  static av_cold int vaapi_encode_h265_configure(AVCodecContext *avctx)
 }
 
 static const VAAPIEncodeProfile vaapi_encode_h265_profiles[] = {
-    { FF_PROFILE_HEVC_MAIN,     8, 3, 1, 1, VAProfileHEVCMain       },
-    { FF_PROFILE_HEVC_REXT,     8, 3, 1, 1, VAProfileHEVCMain       },
+    { AV_PROFILE_HEVC_MAIN,     8, 3, 1, 1, VAProfileHEVCMain       },
+    { AV_PROFILE_HEVC_REXT,     8, 3, 1, 1, VAProfileHEVCMain       },
 #if VA_CHECK_VERSION(0, 37, 0)
-    { FF_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10     },
-    { FF_PROFILE_HEVC_REXT,    10, 3, 1, 1, VAProfileHEVCMain10     },
+    { AV_PROFILE_HEVC_MAIN_10, 10, 3, 1, 1, VAProfileHEVCMain10     },
+    { AV_PROFILE_HEVC_REXT,    10, 3, 1, 1, VAProfileHEVCMain10     },
 #endif
 #if VA_CHECK_VERSION(1, 2, 0)
-    { FF_PROFILE_HEVC_REXT,    12, 3, 1, 1, VAProfileHEVCMain12 },
-    { FF_PROFILE_HEVC_REXT,     8, 3, 1, 0, VAProfileHEVCMain422_10 },
-    { FF_PROFILE_HEVC_REXT,    10, 3, 1, 0, VAProfileHEVCMain422_10 },
-    { FF_PROFILE_HEVC_REXT,    12, 3, 1, 0, VAProfileHEVCMain422_12 },
-    { FF_PROFILE_HEVC_REXT,     8, 3, 0, 0, VAProfileHEVCMain444 },
-    { FF_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, 1, 1, VAProfileHEVCMain12 },
+    { AV_PROFILE_HEVC_REXT,     8, 3, 1, 0, VAProfileHEVCMain422_10 },
+    { AV_PROFILE_HEVC_REXT,    10, 3, 1, 0, VAProfileHEVCMain422_10 },
+    { AV_PROFILE_HEVC_REXT,    12, 3, 1, 0, VAProfileHEVCMain422_12 },
+    { AV_PROFILE_HEVC_REXT,     8, 3, 0, 0, VAProfileHEVCMain444 },
+    { AV_PROFILE_HEVC_REXT,    10, 3, 0, 0, VAProfileHEVCMain444_10 },
+    { AV_PROFILE_HEVC_REXT,    12, 3, 0, 0, VAProfileHEVCMain444_12 },
 #endif
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_UNKNOWN }
 };
 
 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;
 
-    if (avctx->profile == FF_PROFILE_UNKNOWN)
+    if (avctx->profile == AV_PROFILE_UNKNOWN)
         avctx->profile = priv->profile;
-    if (avctx->level == FF_LEVEL_UNKNOWN)
+    if (avctx->level == AV_LEVEL_UNKNOWN)
         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 "
                "in 8-bit unsigned integer.\n", avctx->level);
         return AVERROR(EINVAL);
@@ -1395,13 +1395,13 @@  static const AVOption vaapi_encode_h265_options[] = {
 
     { "profile", "Set profile (general_profile_idc)",
       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, \
       { .i64 = value }, 0, 0, FLAGS, "profile"
-    { PROFILE("main",               FF_PROFILE_HEVC_MAIN) },
-    { PROFILE("main10",             FF_PROFILE_HEVC_MAIN_10) },
-    { PROFILE("rext",               FF_PROFILE_HEVC_REXT) },
+    { PROFILE("main",               AV_PROFILE_HEVC_MAIN) },
+    { PROFILE("main10",             AV_PROFILE_HEVC_MAIN_10) },
+    { PROFILE("rext",               AV_PROFILE_HEVC_REXT) },
 #undef PROFILE
 
     { "tier", "Set tier (general_tier_flag)",
@@ -1414,7 +1414,7 @@  static const AVOption vaapi_encode_h265_options[] = {
 
     { "level", "Set level (general_level_idc)",
       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, \
       { .i64 = value }, 0, 0, FLAGS, "level"
diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c
index cb7588b94b..c17747e3a9 100644
--- a/libavcodec/vaapi_encode_mjpeg.c
+++ b/libavcodec/vaapi_encode_mjpeg.c
@@ -480,15 +480,15 @@  static av_cold int vaapi_encode_mjpeg_configure(AVCodecContext *avctx)
 }
 
 static const VAAPIEncodeProfile vaapi_encode_mjpeg_profiles[] = {
-    { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+    { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
             8, 1, 0, 0, VAProfileJPEGBaseline },
-    { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+    { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
             8, 3, 1, 1, VAProfileJPEGBaseline },
-    { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+    { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
             8, 3, 1, 0, VAProfileJPEGBaseline },
-    { FF_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
+    { AV_PROFILE_MJPEG_HUFFMAN_BASELINE_DCT,
             8, 3, 0, 0, VAProfileJPEGBaseline },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_UNKNOWN }
 };
 
 static const VAAPIEncodeType vaapi_encode_type_mjpeg = {
diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
index 9261d19a83..2edb0c3586 100644
--- a/libavcodec/vaapi_encode_mpeg2.c
+++ b/libavcodec/vaapi_encode_mpeg2.c
@@ -558,9 +558,9 @@  static av_cold int vaapi_encode_mpeg2_configure(AVCodecContext *avctx)
 }
 
 static const VAAPIEncodeProfile vaapi_encode_mpeg2_profiles[] = {
-    { FF_PROFILE_MPEG2_MAIN,   8, 3, 1, 1, VAProfileMPEG2Main   },
-    { FF_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_MPEG2_MAIN,   8, 3, 1, 1, VAProfileMPEG2Main   },
+    { AV_PROFILE_MPEG2_SIMPLE, 8, 3, 1, 1, VAProfileMPEG2Simple },
+    { AV_PROFILE_UNKNOWN }
 };
 
 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;
 
-    if (avctx->profile == FF_PROFILE_UNKNOWN)
+    if (avctx->profile == AV_PROFILE_UNKNOWN)
         avctx->profile = priv->profile;
-    if (avctx->level == FF_LEVEL_UNKNOWN)
+    if (avctx->level == AV_LEVEL_UNKNOWN)
         avctx->level = priv->level;
 
     // 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)",
       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, \
       { .i64 = value }, 0, 0, FLAGS, "profile"
-    { PROFILE("simple", FF_PROFILE_MPEG2_SIMPLE) },
-    { PROFILE("main",   FF_PROFILE_MPEG2_MAIN)   },
+    { PROFILE("simple", AV_PROFILE_MPEG2_SIMPLE) },
+    { PROFILE("main",   AV_PROFILE_MPEG2_MAIN)   },
 #undef PROFILE
 
     { "level", "Set level (in profile_and_level_indication)",
diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c
index ae6a8d313c..ea8abb2418 100644
--- a/libavcodec/vaapi_encode_vp8.c
+++ b/libavcodec/vaapi_encode_vp8.c
@@ -180,7 +180,7 @@  static av_cold int vaapi_encode_vp8_configure(AVCodecContext *avctx)
 
 static const VAAPIEncodeProfile vaapi_encode_vp8_profiles[] = {
     { 0 /* VP8 has no profiles */, 8, 3, 1, 1, VAProfileVP8Version0_3 },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_UNKNOWN }
 };
 
 static const VAAPIEncodeType vaapi_encode_type_vp8 = {
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index af1353cea8..87429881f1 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -227,11 +227,11 @@  static av_cold int vaapi_encode_vp9_configure(AVCodecContext *avctx)
 }
 
 static const VAAPIEncodeProfile vaapi_encode_vp9_profiles[] = {
-    { FF_PROFILE_VP9_0,  8, 3, 1, 1, VAProfileVP9Profile0 },
-    { FF_PROFILE_VP9_1,  8, 3, 0, 0, VAProfileVP9Profile1 },
-    { FF_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
-    { FF_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
-    { FF_PROFILE_UNKNOWN }
+    { AV_PROFILE_VP9_0,  8, 3, 1, 1, VAProfileVP9Profile0 },
+    { AV_PROFILE_VP9_1,  8, 3, 0, 0, VAProfileVP9Profile1 },
+    { AV_PROFILE_VP9_2, 10, 3, 1, 1, VAProfileVP9Profile2 },
+    { AV_PROFILE_VP9_3, 10, 3, 0, 0, VAProfileVP9Profile3 },
+    { AV_PROFILE_UNKNOWN }
 };
 
 static const VAAPIEncodeType vaapi_encode_type_vp9 = {
diff --git a/libavcodec/vaapi_hevc.c b/libavcodec/vaapi_hevc.c
index d464fda18c..3bdd2dd1b8 100644
--- a/libavcodec/vaapi_hevc.c
+++ b/libavcodec/vaapi_hevc.c
@@ -227,8 +227,8 @@  static int vaapi_hevc_start_frame(AVCodecContext          *avctx,
     }
 
 #if VA_CHECK_VERSION(1, 2, 0)
-    if (avctx->profile == FF_PROFILE_HEVC_REXT ||
-        avctx->profile == FF_PROFILE_HEVC_SCC) {
+    if (avctx->profile == AV_PROFILE_HEVC_REXT ||
+        avctx->profile == AV_PROFILE_HEVC_SCC) {
         pic->pic_param.rext = (VAPictureParameterBufferHEVCRext) {
             .range_extension_pic_fields.bits  = {
                 .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 :
                        0);
 
-    if (avctx->profile == FF_PROFILE_HEVC_SCC) {
+    if (avctx->profile == AV_PROFILE_HEVC_SCC) {
         pic->pic_param.scc = (VAPictureParameterBufferHEVCScc) {
             .screen_content_pic_fields.bits = {
                 .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
-    pic_param_size = avctx->profile >= FF_PROFILE_HEVC_REXT ?
+    pic_param_size = avctx->profile >= AV_PROFILE_HEVC_REXT ?
                             sizeof(pic->pic_param) : sizeof(VAPictureParameterBufferHEVC);
 
     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;
     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);
 
     if (pic->last_size) {
@@ -377,10 +377,10 @@  static void fill_pred_weight_table(AVCodecContext *avctx,
 {
     int i;
 #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
     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 "
                "or above, which can support REXT related setting correctly.\n");
 #endif
@@ -461,7 +461,7 @@  static int vaapi_hevc_decode_slice(AVCodecContext *avctx,
     VAAPIDecodePictureHEVC *pic = h->ref->hwaccel_picture_private;
     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);
 
     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);
 
 #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) {
             .slice_ext_flags.bits = {
                 .cu_chroma_qp_offset_enabled_flag = sh->cu_chroma_qp_offset_enabled_flag,
diff --git a/libavcodec/vdpau_av1.c b/libavcodec/vdpau_av1.c
index 0ae62301cb..80923092b9 100644
--- a/libavcodec/vdpau_av1.c
+++ b/libavcodec/vdpau_av1.c
@@ -337,13 +337,13 @@  static int vdpau_av1_init(AVCodecContext *avctx)
     uint32_t level = avctx->level;
 
     switch (avctx->profile) {
-    case FF_PROFILE_AV1_MAIN:
+    case AV_PROFILE_AV1_MAIN:
         profile = VDP_DECODER_PROFILE_AV1_MAIN;
         break;
-    case FF_PROFILE_AV1_HIGH:
+    case AV_PROFILE_AV1_HIGH:
         profile = VDP_DECODER_PROFILE_AV1_HIGH;
         break;
-    case FF_PROFILE_AV1_PROFESSIONAL:
+    case AV_PROFILE_AV1_PROFESSIONAL:
         profile = VDP_DECODER_PROFILE_AV1_PROFESSIONAL;
         break;
     default:
diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c
index 8694292fe3..9c08e4048c 100644
--- a/libavcodec/vdpau_h264.c
+++ b/libavcodec/vdpau_h264.c
@@ -219,35 +219,35 @@  static int vdpau_h264_init(AVCodecContext *avctx)
     VdpDecoderProfile profile;
     uint32_t level = avctx->level;
 
-    switch (avctx->profile & ~FF_PROFILE_H264_INTRA) {
-    case FF_PROFILE_H264_BASELINE:
+    switch (avctx->profile & ~AV_PROFILE_H264_INTRA) {
+    case AV_PROFILE_H264_BASELINE:
         profile = VDP_DECODER_PROFILE_H264_BASELINE;
         break;
-    case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+    case AV_PROFILE_H264_CONSTRAINED_BASELINE:
 #ifdef VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
         profile = VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE;
         break;
 #endif
-    case FF_PROFILE_H264_MAIN:
+    case AV_PROFILE_H264_MAIN:
         profile = VDP_DECODER_PROFILE_H264_MAIN;
         break;
-    case FF_PROFILE_H264_HIGH:
+    case AV_PROFILE_H264_HIGH:
         profile = VDP_DECODER_PROFILE_H264_HIGH;
         break;
 #ifdef VDP_DECODER_PROFILE_H264_EXTENDED
-    case FF_PROFILE_H264_EXTENDED:
+    case AV_PROFILE_H264_EXTENDED:
         profile = VDP_DECODER_PROFILE_H264_EXTENDED;
         break;
 #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
          * format are supported. */
         profile = VDP_DECODER_PROFILE_H264_HIGH;
         break;
 #ifdef VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE
-    case FF_PROFILE_H264_HIGH_422:
-    case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
-    case FF_PROFILE_H264_CAVLC_444:
+    case AV_PROFILE_H264_HIGH_422:
+    case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
+    case AV_PROFILE_H264_CAVLC_444:
         profile = VDP_DECODER_PROFILE_H264_HIGH_444_PREDICTIVE;
         break;
 #endif
@@ -255,7 +255,7 @@  static int vdpau_h264_init(AVCodecContext *avctx)
         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;
 
     return ff_vdpau_common_init(avctx, profile, level);
diff --git a/libavcodec/vdpau_hevc.c b/libavcodec/vdpau_hevc.c
index fea98805d5..4cd7ce5621 100644
--- a/libavcodec/vdpau_hevc.c
+++ b/libavcodec/vdpau_hevc.c
@@ -519,16 +519,16 @@  static int vdpau_hevc_init(AVCodecContext *avctx)
     int ret;
 
     switch (avctx->profile) {
-    case FF_PROFILE_HEVC_MAIN:
+    case AV_PROFILE_HEVC_MAIN:
         profile = VDP_DECODER_PROFILE_HEVC_MAIN;
         break;
-    case FF_PROFILE_HEVC_MAIN_10:
+    case AV_PROFILE_HEVC_MAIN_10:
         profile = VDP_DECODER_PROFILE_HEVC_MAIN_10;
         break;
-    case FF_PROFILE_HEVC_MAIN_STILL_PICTURE:
+    case AV_PROFILE_HEVC_MAIN_STILL_PICTURE:
         profile = VDP_DECODER_PROFILE_HEVC_MAIN_STILL;
         break;
-    case FF_PROFILE_HEVC_REXT:
+    case AV_PROFILE_HEVC_REXT:
         ret = vdpau_hevc_parse_rext_profile(avctx, &profile);
         if (ret)
             return AVERROR(ENOTSUP);
diff --git a/libavcodec/vdpau_mpeg12.c b/libavcodec/vdpau_mpeg12.c
index a5f21ca3a5..bbf76eb469 100644
--- a/libavcodec/vdpau_mpeg12.c
+++ b/libavcodec/vdpau_mpeg12.c
@@ -128,10 +128,10 @@  static int vdpau_mpeg2_init(AVCodecContext *avctx)
     VdpDecoderProfile profile;
 
     switch (avctx->profile) {
-    case FF_PROFILE_MPEG2_MAIN:
+    case AV_PROFILE_MPEG2_MAIN:
         profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
         break;
-    case FF_PROFILE_MPEG2_SIMPLE:
+    case AV_PROFILE_MPEG2_SIMPLE:
         profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE;
         break;
     default:
diff --git a/libavcodec/vdpau_mpeg4.c b/libavcodec/vdpau_mpeg4.c
index 0c3852efdf..055426b95b 100644
--- a/libavcodec/vdpau_mpeg4.c
+++ b/libavcodec/vdpau_mpeg4.c
@@ -95,13 +95,13 @@  static int vdpau_mpeg4_init(AVCodecContext *avctx)
     VdpDecoderProfile profile;
 
     switch (avctx->profile) {
-    case FF_PROFILE_MPEG4_SIMPLE:
+    case AV_PROFILE_MPEG4_SIMPLE:
         profile = VDP_DECODER_PROFILE_MPEG4_PART2_SP;
         break;
     // As any ASP decoder must be able to decode SP, this
     // should be a safe fallback if profile is unknown/unspecified.
-    case FF_PROFILE_UNKNOWN:
-    case FF_PROFILE_MPEG4_ADVANCED_SIMPLE:
+    case AV_PROFILE_UNKNOWN:
+    case AV_PROFILE_MPEG4_ADVANCED_SIMPLE:
         profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
         break;
     default:
diff --git a/libavcodec/vdpau_vc1.c b/libavcodec/vdpau_vc1.c
index a7ab36e431..4e5ee14428 100644
--- a/libavcodec/vdpau_vc1.c
+++ b/libavcodec/vdpau_vc1.c
@@ -121,13 +121,13 @@  static int vdpau_vc1_init(AVCodecContext *avctx)
     VdpDecoderProfile profile;
 
     switch (avctx->profile) {
-    case FF_PROFILE_VC1_SIMPLE:
+    case AV_PROFILE_VC1_SIMPLE:
         profile = VDP_DECODER_PROFILE_VC1_SIMPLE;
         break;
-    case FF_PROFILE_VC1_MAIN:
+    case AV_PROFILE_VC1_MAIN:
         profile = VDP_DECODER_PROFILE_VC1_MAIN;
         break;
-    case FF_PROFILE_VC1_ADVANCED:
+    case AV_PROFILE_VC1_ADVANCED:
         profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
         break;
     default:
diff --git a/libavcodec/vdpau_vp9.c b/libavcodec/vdpau_vp9.c
index fa55101536..424e2e60fb 100644
--- a/libavcodec/vdpau_vp9.c
+++ b/libavcodec/vdpau_vp9.c
@@ -203,16 +203,16 @@  static int vdpau_vp9_init(AVCodecContext *avctx)
     uint32_t level = avctx->level;
 
     switch (avctx->profile) {
-    case FF_PROFILE_VP9_0:
+    case AV_PROFILE_VP9_0:
         profile = VDP_DECODER_PROFILE_VP9_PROFILE_0;
         break;
-    case FF_PROFILE_VP9_1:
+    case AV_PROFILE_VP9_1:
         profile = VDP_DECODER_PROFILE_VP9_PROFILE_1;
         break;
-    case FF_PROFILE_VP9_2:
+    case AV_PROFILE_VP9_2:
         profile = VDP_DECODER_PROFILE_VP9_PROFILE_2;
         break;
-    case FF_PROFILE_VP9_3:
+    case AV_PROFILE_VP9_3:
         profile = VDP_DECODER_PROFILE_VP9_PROFILE_3;
         break;
     default:
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index cfd0b5023e..b9164fe5c6 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -51,6 +51,7 @@ 
 #define FF_API_DROPCHANGED         (LIBAVCODEC_VERSION_MAJOR < 61)
 
 #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
 #define FF_CODEC_CRYSTAL_HD        (LIBAVCODEC_VERSION_MAJOR < 61)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 8e493c4f7a..d0a00347b5 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -206,7 +206,7 @@  static void loadVTEncSymbols(void){
     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{
     VT_ENTROPY_NOT_SET,
@@ -455,22 +455,22 @@  static CMVideoCodecType get_cm_codec_type(AVCodecContext *avctx,
         return kCMVideoCodecType_HEVC;
     case AV_CODEC_ID_PRORES:
         switch (profile) {
-        case FF_PROFILE_PRORES_PROXY:
+        case AV_PROFILE_PRORES_PROXY:
             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
-        case FF_PROFILE_PRORES_STANDARD:
+        case AV_PROFILE_PRORES_STANDARD:
             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
-        case FF_PROFILE_PRORES_4444:
+        case AV_PROFILE_PRORES_4444:
             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
 
         default:
             av_log(avctx, AV_LOG_ERROR, "Unknown profile ID: %d, using auto\n", profile);
-        case FF_PROFILE_UNKNOWN:
+        case AV_PROFILE_UNKNOWN:
             if (desc &&
                 ((desc->flags & AV_PIX_FMT_FLAG_ALPHA) ||
                   desc->log2_chroma_w == 0))
@@ -736,18 +736,18 @@  static bool get_vt_h264_profile_level(AVCodecContext *avctx,
     VTEncContext *vtctx = avctx->priv_data;
     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.
-        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;
 
     switch (profile) {
-        case FF_PROFILE_UNKNOWN:
+        case AV_PROFILE_UNKNOWN:
             return true;
 
-        case FF_PROFILE_H264_BASELINE:
+        case AV_PROFILE_H264_BASELINE:
             switch (vtctx->level) {
                 case  0: *profile_level_val =
                                   compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break;
@@ -769,7 +769,7 @@  static bool get_vt_h264_profile_level(AVCodecContext *avctx,
             }
             break;
 
-        case FF_PROFILE_H264_CONSTRAINED_BASELINE:
+        case AV_PROFILE_H264_CONSTRAINED_BASELINE:
             *profile_level_val =  compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
 
             if (vtctx->level != 0) {
@@ -781,7 +781,7 @@  static bool get_vt_h264_profile_level(AVCodecContext *avctx,
             }
             break;
 
-        case FF_PROFILE_H264_MAIN:
+        case AV_PROFILE_H264_MAIN:
             switch (vtctx->level) {
                 case  0: *profile_level_val =
                                   compat_keys.kVTProfileLevel_H264_Main_AutoLevel; break;
@@ -812,7 +812,7 @@  static bool get_vt_h264_profile_level(AVCodecContext *avctx,
             }
             break;
 
-        case FF_PROFILE_H264_HIGH:
+        case AV_PROFILE_H264_HIGH:
             switch (vtctx->level) {
                 case  0: *profile_level_val =
                                   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;
             }
             break;
-        case FF_PROFILE_H264_EXTENDED:
+        case AV_PROFILE_H264_EXTENDED:
             switch (vtctx->level) {
                 case  0: *profile_level_val =
                                   compat_keys.kVTProfileLevel_H264_Extended_AutoLevel; break;
@@ -868,13 +868,13 @@  static bool get_vt_hevc_profile_level(AVCodecContext *avctx,
     *profile_level_val = NULL;
 
     switch (profile) {
-        case FF_PROFILE_UNKNOWN:
+        case AV_PROFILE_UNKNOWN:
             return true;
-        case FF_PROFILE_HEVC_MAIN:
+        case AV_PROFILE_HEVC_MAIN:
             *profile_level_val =
                 compat_keys.kVTProfileLevel_HEVC_Main_AutoLevel;
             break;
-        case FF_PROFILE_HEVC_MAIN_10:
+        case AV_PROFILE_HEVC_MAIN_10:
             *profile_level_val =
                 compat_keys.kVTProfileLevel_HEVC_Main10_AutoLevel;
             break;
@@ -1521,12 +1521,12 @@  static int vtenc_configure_encoder(AVCodecContext *avctx)
         vtctx->get_param_set_func = CMVideoFormatDescriptionGetH264ParameterSetAtIndex;
 
         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");
             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");
             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);
 
     // 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->session = NULL;
     status = vtenc_configure_encoder(avctx);
@@ -2778,13 +2778,13 @@  static const enum AVPixelFormat prores_pix_fmts[] = {
 
 #define OFFSET(x) offsetof(VTEncContext, x)
 static const AVOption h264_options[] = {
-    { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_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" },
-    { "constrained_baseline", "Constrained Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = FF_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" },
-    { "high",                 "High Profile",                 0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_H264_HIGH                 }, INT_MIN, 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 = AV_PROFILE_H264_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 = AV_PROFILE_H264_MAIN                 }, 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" },
-    { "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" },
     { "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[] = {
-    { "profile", "Profile", OFFSET(profile), AV_OPT_TYPE_INT, { .i64 = FF_PROFILE_UNKNOWN }, FF_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" },
-    { "main10",   "Main10 Profile",   0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_HEVC_MAIN_10 }, INT_MIN, 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 = AV_PROFILE_HEVC_MAIN    }, 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 },
 
@@ -2872,14 +2872,14 @@  const FFCodec ff_hevc_videotoolbox_encoder = {
 };
 
 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" },
-    { "auto",     "Automatically determine based on input format", 0, AV_OPT_TYPE_CONST, { .i64 = FF_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" },
-    { "lt",       "ProRes 422 LT",                                 0, AV_OPT_TYPE_CONST, { .i64 = FF_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" },
-    { "hq",       "ProRes 422 HQ",                                 0, AV_OPT_TYPE_CONST, { .i64 = FF_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" },
-    { "xq",       "ProRes 4444 XQ",                                0, AV_OPT_TYPE_CONST, { .i64 = FF_PROFILE_PRORES_XQ },          INT_MIN, INT_MAX, 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 = AV_PROFILE_UNKNOWN },            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 = AV_PROFILE_PRORES_LT },          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 = AV_PROFILE_PRORES_HQ },          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 = AV_PROFILE_PRORES_XQ },          INT_MIN, INT_MAX, VE, "profile" },
 
     COMMON_OPTIONS
     { NULL },
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 1b2ff0045d..9a57369df7 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -696,8 +696,8 @@  static VkResult vulkan_setup_profile(AVCodecContext *avctx,
 
         /* Vulkan transmits all the constrant_set flags, rather than wanting them
          * merged in the profile IDC */
-        h264_profile->stdProfileIdc = cur_profile & ~(FF_PROFILE_H264_CONSTRAINED |
-                                                      FF_PROFILE_H264_INTRA);
+        h264_profile->stdProfileIdc = cur_profile & ~(AV_PROFILE_H264_CONSTRAINED |
+                                                      AV_PROFILE_H264_INTRA);
 
         h264_profile->pictureLayout = avctx->field_order == AV_FIELD_UNKNOWN ||
                                       avctx->field_order == AV_FIELD_PROGRESSIVE ?
@@ -789,8 +789,8 @@  static int vulkan_decode_get_profile(AVCodecContext *avctx, AVBufferRef *frames_
     }
 
     cur_profile = avctx->profile;
-    base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? FF_PROFILE_H264_CONSTRAINED_BASELINE :
-                   avctx->codec_id == AV_CODEC_ID_H265 ? FF_PROFILE_HEVC_MAIN :
+    base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE :
+                   avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN :
                    avctx->codec_id == AV_CODEC_ID_AV1  ? STD_VIDEO_AV1_MESA_PROFILE_MAIN :
                    0;
 
diff --git a/libavformat/av1.c b/libavformat/av1.c
index b6eaf50627..4455ec0504 100644
--- a/libavformat/av1.c
+++ b/libavformat/av1.c
@@ -23,7 +23,7 @@ 
 #include "libavutil/mem.h"
 #include "libavcodec/av1.h"
 #include "libavcodec/av1_parse.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/put_bits.h"
 #include "av1.h"
 #include "avio.h"
@@ -141,12 +141,12 @@  static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *
 {
     int twelve_bit = 0;
     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);
 
     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;
     else
         seq_params->monochrome = get_bits1(gb);
@@ -176,10 +176,10 @@  static int parse_color_config(AV1SequenceParameters *seq_params, GetBitContext *
     } else {
         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_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_y = 0;
         } else {
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 004bd25359..12e20580ee 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -39,7 +39,7 @@ 
 #include "libavutil/time.h"
 #include "libavutil/time_internal.h"
 
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
 
 #include "avformat.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) {
         uint8_t *data = st->codecpar->extradata;
-        int profile = FF_PROFILE_UNKNOWN;
-        int level = FF_LEVEL_UNKNOWN;
+        int profile = AV_PROFILE_UNKNOWN;
+        int level = AV_LEVEL_UNKNOWN;
 
-        if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
+        if (st->codecpar->profile != AV_PROFILE_UNKNOWN)
             profile = st->codecpar->profile;
-        if (st->codecpar->level != FF_LEVEL_UNKNOWN)
+        if (st->codecpar->level != AV_LEVEL_UNKNOWN)
             level = st->codecpar->level;
 
         /* 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++;
         }
         if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
-            profile != FF_PROFILE_UNKNOWN &&
-            level != FF_LEVEL_UNKNOWN) {
+            profile != AV_PROFILE_UNKNOWN &&
+            level != AV_LEVEL_UNKNOWN) {
             snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", av_fourcc2str(st->codecpar->codec_tag), profile, level);
         } else
             goto fail;
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index fda77b0b89..b5333c4692 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -51,8 +51,8 @@ 
 #include "libavutil/time_internal.h"
 #include "libavutil/spherical.h"
 
-#include "libavcodec/avcodec.h"
 #include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/flac.h"
 #include "libavcodec/mpeg4audio.h"
 #include "libavcodec/packet_internal.h"
@@ -2896,21 +2896,21 @@  static int matroska_parse_tracks(AVFormatContext *s)
                 // [0x30..0x37] are component tags utilized for
                 // non-mobile captioning service ("profile A").
                 if (component_tag >= 0x30 && component_tag <= 0x37) {
-                    st->codecpar->profile = FF_PROFILE_ARIB_PROFILE_A;
+                    st->codecpar->profile = AV_PROFILE_ARIB_PROFILE_A;
                 }
                 break;
             case 0x0012:
                 // component tag 0x87 signifies a mobile/partial reception
                 // (1seg) captioning service ("profile C").
                 if (component_tag == 0x87) {
-                    st->codecpar->profile = FF_PROFILE_ARIB_PROFILE_C;
+                    st->codecpar->profile = AV_PROFILE_ARIB_PROFILE_C;
                 }
                 break;
             default:
                 break;
             }
 
-            if (st->codecpar->profile == FF_PROFILE_UNKNOWN)
+            if (st->codecpar->profile == AV_PROFILE_UNKNOWN)
                 av_log(matroska->ctx, AV_LOG_WARNING,
                        "Unknown ARIB caption profile utilized: %02x / %04x\n",
                        component_tag, data_component_id);
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index bf2ca7106b..ba54f5f98e 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -59,9 +59,9 @@ 
 #include "libavutil/stereo3d.h"
 
 #include "libavcodec/av1.h"
-#include "libavcodec/avcodec.h"
 #include "libavcodec/bytestream.h"
 #include "libavcodec/codec_desc.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/xiph.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: {
         unsigned stream_identifier, data_component_id;
         switch (par->profile) {
-        case FF_PROFILE_ARIB_PROFILE_A:
+        case AV_PROFILE_ARIB_PROFILE_A:
             stream_identifier = 0x30;
             data_component_id = 0x0008;
             break;
-        case FF_PROFILE_ARIB_PROFILE_C:
+        case AV_PROFILE_ARIB_PROFILE_C:
             stream_identifier = 0x87;
             data_component_id = 0x0012;
             break;
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 7ef6cef46a..dbfa647a14 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1760,8 +1760,8 @@  static const struct {
 static int mov_get_dnxhd_codec_tag(AVFormatContext *s, MOVTrack *track)
 {
   int tag = MKTAG('A','V','d','n');
-  if (track->par->profile != FF_PROFILE_UNKNOWN &&
-      track->par->profile != FF_PROFILE_DNXHD)
+  if (track->par->profile != AV_PROFILE_UNKNOWN &&
+      track->par->profile != AV_PROFILE_DNXHD)
       tag = MKTAG('A','V','d','h');
   return tag;
 }
@@ -4769,10 +4769,10 @@  static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat
             if (track->par->codec_id == AV_CODEC_ID_AAC) {
                 switch (track->par->profile)
                 {
-                    case FF_PROFILE_AAC_HE_V2:
+                    case AV_PROFILE_AAC_HE_V2:
                         param_write_string(pb, "FourCC", "AACP");
                         break;
-                    case FF_PROFILE_AAC_HE:
+                    case AV_PROFILE_AAC_HE:
                         param_write_string(pb, "FourCC", "AACH");
                         break;
                     default:
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 0b3edda817..8fd1524a8a 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -34,6 +34,7 @@ 
 #include "libavutil/dovi_meta.h"
 #include "libavcodec/avcodec.h"
 #include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/get_bits.h"
 #include "libavcodec/opus.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,
             // Vol. 3, Section 2, 4.2.8.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);
             if (data_component_id < 0)
                 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").
                 if (actual_component_tag >= 0x30 &&
                     actual_component_tag <= 0x37) {
-                    picked_profile = FF_PROFILE_ARIB_PROFILE_A;
+                    picked_profile = AV_PROFILE_ARIB_PROFILE_A;
                 }
                 break;
             case 0x0012:
                 // component tag 0x87 signifies a mobile/partial reception
                 // (1seg) captioning service ("profile C").
                 if (actual_component_tag == 0x87) {
-                    picked_profile = FF_PROFILE_ARIB_PROFILE_C;
+                    picked_profile = AV_PROFILE_ARIB_PROFILE_C;
                 }
                 break;
             default:
                 break;
             }
 
-            if (picked_profile == FF_PROFILE_UNKNOWN)
+            if (picked_profile == AV_PROFILE_UNKNOWN)
                 break;
 
             st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 700fc549df..46ed16985f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -28,8 +28,8 @@ 
 #include "libavutil/opt.h"
 
 #include "libavcodec/ac3_parser_internal.h"
-#include "libavcodec/avcodec.h"
 #include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/h264.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;
 
     switch (codecpar->profile) {
-    case FF_PROFILE_ARIB_PROFILE_A:
+    case AV_PROFILE_ARIB_PROFILE_A:
         stream_identifier = 0x30;
         data_component_id = 0x0008;
         break;
-    case FF_PROFILE_ARIB_PROFILE_C:
+    case AV_PROFILE_ARIB_PROFILE_C:
         stream_identifier = 0x87;
         data_component_id = 0x0012;
         break;
@@ -431,7 +431,7 @@  static int get_dvb_stream_type(AVFormatContext *s, AVStream *st)
         stream_type = STREAM_TYPE_PRIVATE_DATA;
         break;
     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;
         } else {
             stream_type = STREAM_TYPE_PRIVATE_DATA;
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 110b69b7c1..7dbe294d23 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -52,6 +52,7 @@ 
 #include "libavutil/mastering_display_metadata.h"
 #include "libavutil/mathematics.h"
 #include "libavcodec/bytestream.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/internal.h"
 #include "libavutil/channel_layout.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)) {
             uint32_t rsiz = avio_rb16(pb);
-            if (rsiz == FF_PROFILE_JPEG2000_DCINEMA_2K ||
-                rsiz == FF_PROFILE_JPEG2000_DCINEMA_4K)
+            if (rsiz == AV_PROFILE_JPEG2000_DCINEMA_2K ||
+                rsiz == AV_PROFILE_JPEG2000_DCINEMA_4K)
                 descriptor->pix_fmt = AV_PIX_FMT_XYZ12;
         }
         if (IS_KLV_KEY(uid, mxf_mastering_display_prefix)) {
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index d8252ed68f..cb299412e2 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -47,7 +47,7 @@ 
 #include "libavutil/mastering_display_metadata.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/time_internal.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/golomb.h"
 #include "libavcodec/h264.h"
 #include "libavcodec/packet_internal.h"
@@ -2111,12 +2111,12 @@  static const struct {
     int profile;
     UID codec_ul;
 } mxf_prores_codec_uls[] = {
-    { FF_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 } },
-    { FF_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 } },
-    { FF_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_PROXY,    { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x01,0x00 } },
+    { AV_PROFILE_PRORES_LT,       { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x02,0x00 } },
+    { AV_PROFILE_PRORES_STANDARD, { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x03,0x00 } },
+    { AV_PROFILE_PRORES_HQ,       { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x04,0x00 } },
+    { AV_PROFILE_PRORES_4444,     { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0d,0x04,0x01,0x02,0x02,0x03,0x06,0x05,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)
diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
index ea66959abf..0d9e0cfe10 100644
--- a/libavformat/vpcc.c
+++ b/libavformat/vpcc.c
@@ -21,7 +21,7 @@ 
 
 #include "libavutil/pixdesc.h"
 #include "libavutil/pixfmt.h"
-#include "libavcodec/avcodec.h"
+#include "libavcodec/defs.h"
 #include "libavcodec/get_bits.h"
 #include "vpcc.h"
 
@@ -155,7 +155,7 @@  int ff_isom_get_vpcc_features(AVFormatContext *s, AVCodecParameters *par,
                               AVRational *frame_rate, VPCC *vpcc)
 {
     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;
     int bit_depth = get_bit_depth(s, par->format);
     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)
         return AVERROR_INVALIDDATA;
 
-    if (len && (profile == FF_PROFILE_UNKNOWN || !bit_depth)) {
+    if (len && (profile == AV_PROFILE_UNKNOWN || !bit_depth)) {
         GetBitContext gb;
 
         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);
     }
 
-    if (profile == FF_PROFILE_UNKNOWN && bit_depth) {
+    if (profile == AV_PROFILE_UNKNOWN && bit_depth) {
         if (vpx_chroma_subsampling == VPX_SUBSAMPLING_420_VERTICAL ||
             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 {
-            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");
 
     vpcc->profile            = profile;