* [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile
@ 2023-05-21 11:22 xufuji456
2023-05-21 13:07 ` Rick Kern
0 siblings, 1 reply; 5+ messages in thread
From: xufuji456 @ 2023-05-21 11:22 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: xufuji456, kernrj
The CBP/CHP profile has available with H264 in iOS 15.0.
Official Doc: https://developer.apple.com/documentation/videotoolbox/kvtprofilelevel_h264_constrainedbaseline_autolevel
Signed-off-by: xufuji456 <839789740@qq.com>
---
libavcodec/videotoolboxenc.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index b017c90c36..6a9b19831b 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -108,6 +108,8 @@ static struct{
CFStringRef kVTProfileLevel_H264_High_AutoLevel;
CFStringRef kVTProfileLevel_H264_Extended_5_0;
CFStringRef kVTProfileLevel_H264_Extended_AutoLevel;
+ CFStringRef kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
+ CFStringRef kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel;
CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel;
@@ -171,6 +173,8 @@ static void loadVTEncSymbols(void){
GET_SYM(kVTProfileLevel_H264_High_AutoLevel, "H264_High_AutoLevel");
GET_SYM(kVTProfileLevel_H264_Extended_5_0, "H264_Extended_5_0");
GET_SYM(kVTProfileLevel_H264_Extended_AutoLevel, "H264_Extended_AutoLevel");
+ GET_SYM(kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel, "H264_ConstrainedBaseline_AutoLevel");
+ GET_SYM(kVTProfileLevel_H264_ConstrainedHigh_AutoLevel, "H264_ConstrainedHigh_AutoLevel");
GET_SYM(kVTProfileLevel_HEVC_Main_AutoLevel, "HEVC_Main_AutoLevel");
GET_SYM(kVTProfileLevel_HEVC_Main10_AutoLevel, "HEVC_Main10_AutoLevel");
@@ -743,8 +747,15 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
case H264_PROF_BASELINE:
switch (vtctx->level) {
- case 0: *profile_level_val =
- compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break;
+ case 0: {
+ // check avctx->profile has been set constrained_baseline
+ if (avctx->profile == FF_PROFILE_H264_CONSTRAINED_BASELINE) {
+ *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
+ } else {
+ *profile_level_val = compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel;
+ }
+ break;
+ }
case 13: *profile_level_val = kVTProfileLevel_H264_Baseline_1_3; break;
case 30: *profile_level_val = kVTProfileLevel_H264_Baseline_3_0; break;
case 31: *profile_level_val = kVTProfileLevel_H264_Baseline_3_1; break;
@@ -784,6 +795,15 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
case H264_PROF_HIGH:
switch (vtctx->level) {
+ case 0: {
+ // check avctx->profile has been set constrained_high
+ if (avctx->profile == (FF_PROFILE_H264_HIGH | FF_PROFILE_H264_CONSTRAINED)) {
+ *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
+ } else {
+ *profile_level_val = compat_keys.kVTProfileLevel_H264_High_AutoLevel;
+ }
+ break;
+ }
case 0: *profile_level_val =
compat_keys.kVTProfileLevel_H264_High_AutoLevel; break;
case 30: *profile_level_val =
--
2.32.0 (Apple Git-132)
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile
2023-05-21 11:22 [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile xufuji456
@ 2023-05-21 13:07 ` Rick Kern
2023-05-21 14:05 ` [FFmpeg-devel] =?gb18030?b?u9i4tKO6ICBbUEFUQ0hdIGF2Y29kZWMvdmlk?= =?gb18030?q?eotoolboxenc=3A_add_CBP/CHP_profile?= =?gb18030?B?0Oy4o8Kh?=
0 siblings, 1 reply; 5+ messages in thread
From: Rick Kern @ 2023-05-21 13:07 UTC (permalink / raw)
To: xufuji456; +Cc: ffmpeg-devel
On Sun, May 21, 2023 at 7:22 AM xufuji456 <839789740@qq.com> wrote:
> The CBP/CHP profile has available with H264 in iOS 15.0.
> Official Doc:
> https://developer.apple.com/documentation/videotoolbox/kvtprofilelevel_h264_constrainedbaseline_autolevel
>
> Signed-off-by: xufuji456 <839789740@qq.com>
> ---
> libavcodec/videotoolboxenc.c | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index b017c90c36..6a9b19831b 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -108,6 +108,8 @@ static struct{
> CFStringRef kVTProfileLevel_H264_High_AutoLevel;
> CFStringRef kVTProfileLevel_H264_Extended_5_0;
> CFStringRef kVTProfileLevel_H264_Extended_AutoLevel;
> + CFStringRef kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
> + CFStringRef kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
>
> CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel;
> CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel;
> @@ -171,6 +173,8 @@ static void loadVTEncSymbols(void){
> GET_SYM(kVTProfileLevel_H264_High_AutoLevel,
> "H264_High_AutoLevel");
> GET_SYM(kVTProfileLevel_H264_Extended_5_0, "H264_Extended_5_0");
> GET_SYM(kVTProfileLevel_H264_Extended_AutoLevel,
> "H264_Extended_AutoLevel");
> + GET_SYM(kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel,
> "H264_ConstrainedBaseline_AutoLevel");
> + GET_SYM(kVTProfileLevel_H264_ConstrainedHigh_AutoLevel,
> "H264_ConstrainedHigh_AutoLevel");
>
> GET_SYM(kVTProfileLevel_HEVC_Main_AutoLevel,
> "HEVC_Main_AutoLevel");
> GET_SYM(kVTProfileLevel_HEVC_Main10_AutoLevel,
> "HEVC_Main10_AutoLevel");
> @@ -743,8 +747,15 @@ static bool get_vt_h264_profile_level(AVCodecContext
> *avctx,
>
> case H264_PROF_BASELINE:
> switch (vtctx->level) {
> - case 0: *profile_level_val =
> -
> compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break;
> + case 0: {
> + // check avctx->profile has been set
> constrained_baseline
> + if (avctx->profile ==
> FF_PROFILE_H264_CONSTRAINED_BASELINE) {
>
The profiles need to be added to the list of usable profiles in
h264_options so they can be used on the command line.
Using the FF_PROFILE_ constants doesn't follow the pattern of using the
profile constants defined in this file, but I like your approach better. To
keep things consistent, either remove the constants in VT_H264Profile and
VT_HEVCProfile and replace them with global constants, or I can follow up
with a patch.
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
> + } else {
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel;
> + }
> + break;
> + }
> case 13: *profile_level_val =
> kVTProfileLevel_H264_Baseline_1_3; break;
> case 30: *profile_level_val =
> kVTProfileLevel_H264_Baseline_3_0; break;
> case 31: *profile_level_val =
> kVTProfileLevel_H264_Baseline_3_1; break;
> @@ -784,6 +795,15 @@ static bool get_vt_h264_profile_level(AVCodecContext
> *avctx,
>
> case H264_PROF_HIGH:
> switch (vtctx->level) {
> + case 0: {
> + // check avctx->profile has been set constrained_high
> + if (avctx->profile == (FF_PROFILE_H264_HIGH |
> FF_PROFILE_H264_CONSTRAINED)) {
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
> + } else {
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_High_AutoLevel;
> + }
> + break;
> + }
> case 0: *profile_level_val =
>
> compat_keys.kVTProfileLevel_H264_High_AutoLevel; break;
>
This duplicate case 0 can be removed.
case 30: *profile_level_val =
> --
> 2.32.0 (Apple Git-132)
>
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] =?gb18030?b?u9i4tKO6ICBbUEFUQ0hdIGF2Y29kZWMvdmlk?= =?gb18030?q?eotoolboxenc=3A_add_CBP/CHP_profile?=
2023-05-21 13:07 ` Rick Kern
@ 2023-05-21 14:05 ` =?gb18030?B?0Oy4o8Kh?=
0 siblings, 0 replies; 5+ messages in thread
From: =?gb18030?B?0Oy4o8Kh?= @ 2023-05-21 14:05 UTC (permalink / raw)
To: =?gb18030?B?RkZtcGVnIGRldmVsb3BtZW50IGRpc2N1c3Npb25zIGFuZCBwYXRjaGVz?=
Cc: =?gb18030?B?a2VybnJq?=
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 8761 bytes --]
Thank you for your review, Kern.
I will remove VT_H264Profile and VT_HEVCProfile, replace with avctx->profile.
And submit a new patch of CBP/CHP after that.
------------------ ÔʼÓʼþ ------------------
·¢¼þÈË: "FFmpeg development discussions and patches" <kernrj@gmail.com>;
·¢ËÍʱ¼ä: 2023Äê5ÔÂ21ÈÕ(ÐÇÆÚÌì) ÍíÉÏ9:07
ÊÕ¼þÈË: "Ð츣¡"<839789740@qq.com>;
³ËÍ: "ffmpeg-devel"<ffmpeg-devel@ffmpeg.org>;
Ö÷Ìâ: Re: [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile
On Sun, May 21, 2023 at 7:226§2AM xufuji456 <839789740@qq.com> wrote:
> The CBP/CHP profile has available with H264 in iOS 15.0.
> Official Doc:
> https://developer.apple.com/documentation/videotoolbox/kvtprofilelevel_h264_constrainedbaseline_autolevel
>
> Signed-off-by: xufuji456 <839789740@qq.com>
> ---
> libavcodec/videotoolboxenc.c | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index b017c90c36..6a9b19831b 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -108,6 +108,8 @@ static struct{
> CFStringRef kVTProfileLevel_H264_High_AutoLevel;
> CFStringRef kVTProfileLevel_H264_Extended_5_0;
> CFStringRef kVTProfileLevel_H264_Extended_AutoLevel;
> + CFStringRef kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
> + CFStringRef kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
>
> CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel;
> CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel;
> @@ -171,6 +173,8 @@ static void loadVTEncSymbols(void){
> GET_SYM(kVTProfileLevel_H264_High_AutoLevel,
> "H264_High_AutoLevel");
> GET_SYM(kVTProfileLevel_H264_Extended_5_0, "H264_Extended_5_0");
> GET_SYM(kVTProfileLevel_H264_Extended_AutoLevel,
> "H264_Extended_AutoLevel");
> + GET_SYM(kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel,
> "H264_ConstrainedBaseline_AutoLevel");
> + GET_SYM(kVTProfileLevel_H264_ConstrainedHigh_AutoLevel,
> "H264_ConstrainedHigh_AutoLevel");
>
> GET_SYM(kVTProfileLevel_HEVC_Main_AutoLevel,
> "HEVC_Main_AutoLevel");
> GET_SYM(kVTProfileLevel_HEVC_Main10_AutoLevel,
> "HEVC_Main10_AutoLevel");
> @@ -743,8 +747,15 @@ static bool get_vt_h264_profile_level(AVCodecContext
> *avctx,
>
> case H264_PROF_BASELINE:
> switch (vtctx->level) {
> - case 0: *profile_level_val =
> -
> compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel; break;
> + case 0: {
> + // check avctx->profile has been set
> constrained_baseline
> + if (avctx->profile ==
> FF_PROFILE_H264_CONSTRAINED_BASELINE) {
>
The profiles need to be added to the list of usable profiles in
h264_options so they can be used on the command line.
Using the FF_PROFILE_ constants doesn't follow the pattern of using the
profile constants defined in this file, but I like your approach better. To
keep things consistent, either remove the constants in VT_H264Profile and
VT_HEVCProfile and replace them with global constants, or I can follow up
with a patch.
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
> + } else {
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_Baseline_AutoLevel;
> + }
> + break;
> + }
> case 13: *profile_level_val =
> kVTProfileLevel_H264_Baseline_1_3; break;
> case 30: *profile_level_val =
> kVTProfileLevel_H264_Baseline_3_0; break;
> case 31: *profile_level_val =
> kVTProfileLevel_H264_Baseline_3_1; break;
> @@ -784,6 +795,15 @@ static bool get_vt_h264_profile_level(AVCodecContext
> *avctx,
>
> case H264_PROF_HIGH:
> switch (vtctx->level) {
> + case 0: {
> + // check avctx->profile has been set constrained_high
> + if (avctx->profile == (FF_PROFILE_H264_HIGH |
> FF_PROFILE_H264_CONSTRAINED)) {
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
> + } else {
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_High_AutoLevel;
> + }
> + break;
> + }
> case 0: *profile_level_val =
>
> compat_keys.kVTProfileLevel_H264_High_AutoLevel; break;
>
This duplicate case 0 can be removed.
case 30: *profile_level_val =
> --
> 2.32.0 (Apple Git-132)
>
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile
2023-05-26 11:37 ` [FFmpeg-devel] =?gb18030?b?u9i4tKO6W1BBVENIXSBhdmNvZGVjL3ZpZGVv?= =?gb18030?q?toolboxenc=3A_add_CBP/CHP_profile?= =?gb18030?B?0Oy4o8Kh?=
@ 2023-06-03 21:39 ` Rick Kern
0 siblings, 0 replies; 5+ messages in thread
From: Rick Kern @ 2023-06-03 21:39 UTC (permalink / raw)
To: 徐福隆; +Cc: ffmpeg-devel
On Fri, May 26, 2023 at 7:37 AM 徐福隆 <839789740@qq.com> wrote:
> Kern, please help to review this patch, which has added CBP profile with
> profile options.
> As for the VT_H264Profile replacement, let you take over, follow up this
> patch.
>
Thanks. Pushed with minor modifications.
>
> Thanks
>
> ------------------ 原始邮件 ------------------
> *发件人:* "xufuji456" <839789740@qq.com>;
> *发送时间:* 2023年5月23日(星期二) 上午10:27
> *收件人:* "ffmpeg-devel"<ffmpeg-devel@ffmpeg.org>;
> *抄送:* "徐福隆"<839789740@qq.com>;
> *主题:* [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile
>
> The Constrained_Baseline and Constrained_High profile of H264 has
> available in iOS 15.0
>
> Signed-off-by: xufuji456 <839789740@qq.com>
> ---
> libavcodec/videotoolboxenc.c | 25 +++++++++++++++++++++----
> 1 file changed, 21 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index b017c90c36..028095cd04 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -108,6 +108,8 @@ static struct{
> CFStringRef kVTProfileLevel_H264_High_AutoLevel;
> CFStringRef kVTProfileLevel_H264_Extended_5_0;
> CFStringRef kVTProfileLevel_H264_Extended_AutoLevel;
> + CFStringRef kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
> + CFStringRef kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
>
> CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel;
> CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel;
> @@ -171,6 +173,8 @@ static void loadVTEncSymbols(void){
> GET_SYM(kVTProfileLevel_H264_High_AutoLevel,
> "H264_High_AutoLevel");
> GET_SYM(kVTProfileLevel_H264_Extended_5_0, "H264_Extended_5_0");
> GET_SYM(kVTProfileLevel_H264_Extended_AutoLevel,
> "H264_Extended_AutoLevel");
> + GET_SYM(kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel,
> "H264_ConstrainedBaseline_AutoLevel");
> + GET_SYM(kVTProfileLevel_H264_ConstrainedHigh_AutoLevel,
> "H264_ConstrainedHigh_AutoLevel");
>
> GET_SYM(kVTProfileLevel_HEVC_Main_AutoLevel,
> "HEVC_Main_AutoLevel");
> GET_SYM(kVTProfileLevel_HEVC_Main10_AutoLevel,
> "HEVC_Main10_AutoLevel");
> @@ -193,8 +197,10 @@ static void loadVTEncSymbols(void){
> typedef enum VT_H264Profile {
> H264_PROF_AUTO,
> H264_PROF_BASELINE,
> + H264_PROF_CONSTRAINED_BASELINE,
> H264_PROF_MAIN,
> H264_PROF_HIGH,
> + H264_PROF_CONSTRAINED_HIGH,
> H264_PROF_EXTENDED,
> H264_PROF_COUNT
> } VT_H264Profile;
> @@ -763,6 +769,10 @@ static bool get_vt_h264_profile_level(AVCodecContext
> *avctx,
> }
> break;
>
> + case H264_PROF_CONSTRAINED_BASELINE:
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
> + break;
> +
> case H264_PROF_MAIN:
> switch (vtctx->level) {
> case 0: *profile_level_val =
> @@ -805,6 +815,11 @@ static bool get_vt_h264_profile_level(AVCodecContext
> *avctx,
>
> compat_keys.kVTProfileLevel_H264_High_5_2; break;
> }
> break;
> +
> + case H264_PROF_CONSTRAINED_HIGH:
> + *profile_level_val =
> compat_keys.kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
> + break;
> +
> case H264_PROF_EXTENDED:
> switch (vtctx->level) {
> case 0: *profile_level_val =
> @@ -2757,10 +2772,12 @@ 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_INT64, { .i64 =
> H264_PROF_AUTO }, H264_PROF_AUTO, H264_PROF_COUNT, VE, "profile" },
> - { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 =
> H264_PROF_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
> - { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 =
> H264_PROF_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
> - { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 =
> H264_PROF_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
> - { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 =
> H264_PROF_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" },
> + { "baseline", "Baseline Profile", 0,
> AV_OPT_TYPE_CONST, { .i64 = H264_PROF_BASELINE }, INT_MIN,
> INT_MAX, VE, "profile" },
> + { "constrained_baseline", "Constrained_Baseline Profile", 0,
> AV_OPT_TYPE_CONST, { .i64 = H264_PROF_CONSTRAINED_BASELINE }, INT_MIN,
> INT_MAX, VE, "profile" },
> + { "main", "Main Profile", 0,
> AV_OPT_TYPE_CONST, { .i64 = H264_PROF_MAIN }, INT_MIN,
> INT_MAX, VE, "profile" },
> + { "high", "High Profile", 0,
> AV_OPT_TYPE_CONST, { .i64 = H264_PROF_HIGH }, INT_MIN,
> INT_MAX, VE, "profile" },
> + { "constrained_high", "Constrained_High Profile", 0,
> AV_OPT_TYPE_CONST, { .i64 = H264_PROF_CONSTRAINED_HIGH }, INT_MIN,
> INT_MAX, VE, "profile" },
> + { "extended", "Extend Profile", 0,
> AV_OPT_TYPE_CONST, { .i64 = H264_PROF_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" },
> --
> 2.32.0 (Apple Git-132)
>
>
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
* [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile
@ 2023-05-23 2:27 xufuji456
2023-05-26 11:37 ` [FFmpeg-devel] =?gb18030?b?u9i4tKO6W1BBVENIXSBhdmNvZGVjL3ZpZGVv?= =?gb18030?q?toolboxenc=3A_add_CBP/CHP_profile?= =?gb18030?B?0Oy4o8Kh?=
0 siblings, 1 reply; 5+ messages in thread
From: xufuji456 @ 2023-05-23 2:27 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: xufuji456
The Constrained_Baseline and Constrained_High profile of H264 has available in iOS 15.0
Signed-off-by: xufuji456 <839789740@qq.com>
---
libavcodec/videotoolboxenc.c | 25 +++++++++++++++++++++----
1 file changed, 21 insertions(+), 4 deletions(-)
diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index b017c90c36..028095cd04 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -108,6 +108,8 @@ static struct{
CFStringRef kVTProfileLevel_H264_High_AutoLevel;
CFStringRef kVTProfileLevel_H264_Extended_5_0;
CFStringRef kVTProfileLevel_H264_Extended_AutoLevel;
+ CFStringRef kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
+ CFStringRef kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
CFStringRef kVTProfileLevel_HEVC_Main_AutoLevel;
CFStringRef kVTProfileLevel_HEVC_Main10_AutoLevel;
@@ -171,6 +173,8 @@ static void loadVTEncSymbols(void){
GET_SYM(kVTProfileLevel_H264_High_AutoLevel, "H264_High_AutoLevel");
GET_SYM(kVTProfileLevel_H264_Extended_5_0, "H264_Extended_5_0");
GET_SYM(kVTProfileLevel_H264_Extended_AutoLevel, "H264_Extended_AutoLevel");
+ GET_SYM(kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel, "H264_ConstrainedBaseline_AutoLevel");
+ GET_SYM(kVTProfileLevel_H264_ConstrainedHigh_AutoLevel, "H264_ConstrainedHigh_AutoLevel");
GET_SYM(kVTProfileLevel_HEVC_Main_AutoLevel, "HEVC_Main_AutoLevel");
GET_SYM(kVTProfileLevel_HEVC_Main10_AutoLevel, "HEVC_Main10_AutoLevel");
@@ -193,8 +197,10 @@ static void loadVTEncSymbols(void){
typedef enum VT_H264Profile {
H264_PROF_AUTO,
H264_PROF_BASELINE,
+ H264_PROF_CONSTRAINED_BASELINE,
H264_PROF_MAIN,
H264_PROF_HIGH,
+ H264_PROF_CONSTRAINED_HIGH,
H264_PROF_EXTENDED,
H264_PROF_COUNT
} VT_H264Profile;
@@ -763,6 +769,10 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
}
break;
+ case H264_PROF_CONSTRAINED_BASELINE:
+ *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedBaseline_AutoLevel;
+ break;
+
case H264_PROF_MAIN:
switch (vtctx->level) {
case 0: *profile_level_val =
@@ -805,6 +815,11 @@ static bool get_vt_h264_profile_level(AVCodecContext *avctx,
compat_keys.kVTProfileLevel_H264_High_5_2; break;
}
break;
+
+ case H264_PROF_CONSTRAINED_HIGH:
+ *profile_level_val = compat_keys.kVTProfileLevel_H264_ConstrainedHigh_AutoLevel;
+ break;
+
case H264_PROF_EXTENDED:
switch (vtctx->level) {
case 0: *profile_level_val =
@@ -2757,10 +2772,12 @@ 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_INT64, { .i64 = H264_PROF_AUTO }, H264_PROF_AUTO, H264_PROF_COUNT, VE, "profile" },
- { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
- { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
- { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
- { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_EXTENDED }, INT_MIN, INT_MAX, VE, "profile" },
+ { "baseline", "Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
+ { "constrained_baseline", "Constrained_Baseline Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_CONSTRAINED_BASELINE }, INT_MIN, INT_MAX, VE, "profile" },
+ { "main", "Main Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_MAIN }, INT_MIN, INT_MAX, VE, "profile" },
+ { "high", "High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
+ { "constrained_high", "Constrained_High Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_CONSTRAINED_HIGH }, INT_MIN, INT_MAX, VE, "profile" },
+ { "extended", "Extend Profile", 0, AV_OPT_TYPE_CONST, { .i64 = H264_PROF_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" },
--
2.32.0 (Apple Git-132)
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-06-03 21:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-21 11:22 [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile xufuji456
2023-05-21 13:07 ` Rick Kern
2023-05-21 14:05 ` [FFmpeg-devel] =?gb18030?b?u9i4tKO6ICBbUEFUQ0hdIGF2Y29kZWMvdmlk?= =?gb18030?q?eotoolboxenc=3A_add_CBP/CHP_profile?= =?gb18030?B?0Oy4o8Kh?=
2023-05-23 2:27 [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile xufuji456
2023-05-26 11:37 ` [FFmpeg-devel] =?gb18030?b?u9i4tKO6W1BBVENIXSBhdmNvZGVjL3ZpZGVv?= =?gb18030?q?toolboxenc=3A_add_CBP/CHP_profile?= =?gb18030?B?0Oy4o8Kh?=
2023-06-03 21:39 ` [FFmpeg-devel] [PATCH] avcodec/videotoolboxenc: add CBP/CHP profile Rick Kern
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git