* [FFmpeg-devel] [PATCH] avcodec/libx265: fix build error
@ 2022-11-03 11:11 Zhao Zhili
2022-11-03 12:32 ` James Almer
0 siblings, 1 reply; 4+ messages in thread
From: Zhao Zhili @ 2022-11-03 11:11 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
x265_sei is available since X265_BUILD 88. This fixes a regression
from commit 1f585030137.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
libavcodec/libx265.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 4aa96e1f2d..e36f20a812 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -516,8 +516,10 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
ctx->api->picture_init(ctx->params, &x265pic);
if (pic) {
+#if X265_BUILD >= 88
x265_sei *sei = &x265pic.userSEI;
sei->numPayloads = 0;
+#endif
for (i = 0; i < 3; i++) {
x265pic.planes[i] = pic->data[i];
x265pic.stride[i] = pic->linesize[i];
@@ -546,6 +548,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
memcpy(x265pic.userData, &pic->reordered_opaque, sizeof(pic->reordered_opaque));
}
+#if X265_BUILD >= 88
if (ctx->udu_sei) {
for (i = 0; i < pic->nb_side_data; i++) {
AVFrameSideData *side_data = pic->side_data[i];
@@ -573,6 +576,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
sei->numPayloads++;
}
}
+#endif
}
ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
@@ -713,7 +717,9 @@ static const AVOption options[] = {
{ "preset", "set the x265 preset", OFFSET(preset), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "tune", "set the x265 tune parameter", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ "profile", "set the x265 profile", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
+#if X265_BUILD >= 88
{ "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
+#endif
{ "x265-params", "set the x265 configuration using a :-separated list of key=value parameters", OFFSET(x265_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
{ NULL }
};
--
2.25.1
_______________________________________________
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] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libx265: fix build error
2022-11-03 11:11 [FFmpeg-devel] [PATCH] avcodec/libx265: fix build error Zhao Zhili
@ 2022-11-03 12:32 ` James Almer
2022-11-03 14:20 ` Zhao Zhili
0 siblings, 1 reply; 4+ messages in thread
From: James Almer @ 2022-11-03 12:32 UTC (permalink / raw)
To: ffmpeg-devel
On 11/3/2022 8:11 AM, Zhao Zhili wrote:
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> x265_sei is available since X265_BUILD 88. This fixes a regression
> from commit 1f585030137.
How old are we talking about? Latest release is > 200, so 88 seems
pretty old.
I'd just bump the minimum required version in configure. It's 70 right
now, which is equally ancient.
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> libavcodec/libx265.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
> index 4aa96e1f2d..e36f20a812 100644
> --- a/libavcodec/libx265.c
> +++ b/libavcodec/libx265.c
> @@ -516,8 +516,10 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> ctx->api->picture_init(ctx->params, &x265pic);
>
> if (pic) {
> +#if X265_BUILD >= 88
> x265_sei *sei = &x265pic.userSEI;
> sei->numPayloads = 0;
> +#endif
> for (i = 0; i < 3; i++) {
> x265pic.planes[i] = pic->data[i];
> x265pic.stride[i] = pic->linesize[i];
> @@ -546,6 +548,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> memcpy(x265pic.userData, &pic->reordered_opaque, sizeof(pic->reordered_opaque));
> }
>
> +#if X265_BUILD >= 88
> if (ctx->udu_sei) {
> for (i = 0; i < pic->nb_side_data; i++) {
> AVFrameSideData *side_data = pic->side_data[i];
> @@ -573,6 +576,7 @@ static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
> sei->numPayloads++;
> }
> }
> +#endif
> }
>
> ret = ctx->api->encoder_encode(ctx->encoder, &nal, &nnal,
> @@ -713,7 +717,9 @@ static const AVOption options[] = {
> { "preset", "set the x265 preset", OFFSET(preset), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
> { "tune", "set the x265 tune parameter", OFFSET(tune), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
> { "profile", "set the x265 profile", OFFSET(profile), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
> +#if X265_BUILD >= 88
> { "udu_sei", "Use user data unregistered SEI if available", OFFSET(udu_sei), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },
> +#endif
> { "x265-params", "set the x265 configuration using a :-separated list of key=value parameters", OFFSET(x265_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
> { NULL }
> };
_______________________________________________
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] 4+ messages in thread
* [FFmpeg-devel] [PATCH] avcodec/libx265: fix build error
2022-11-03 12:32 ` James Almer
@ 2022-11-03 14:20 ` Zhao Zhili
2022-11-18 7:45 ` "zhilizhao(赵志立)"
0 siblings, 1 reply; 4+ messages in thread
From: Zhao Zhili @ 2022-11-03 14:20 UTC (permalink / raw)
To: ffmpeg-devel; +Cc: Zhao Zhili
From: Zhao Zhili <zhilizhao@tencent.com>
x265_sei is available since X265_BUILD 88. Bump required version
to 89 to fix the regression from commit 1f585030137, and remove a
conditional compilation.
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
configure | 2 +-
libavcodec/libx265.c | 2 --
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/configure b/configure
index 2bcdf18a57..09d51002e3 100755
--- a/configure
+++ b/configure
@@ -6736,7 +6736,7 @@ enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
- require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
+ require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 4aa96e1f2d..555b5e26d8 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -293,7 +293,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
return ret;
}
-#if X265_BUILD >= 89
if (avctx->qmin >= 0) {
ret = libx265_param_parse_int(avctx, "qpmin", avctx->qmin);
if (ret < 0)
@@ -304,7 +303,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
if (ret < 0)
return ret;
}
-#endif
if (avctx->max_qdiff >= 0) {
ret = libx265_param_parse_int(avctx, "qpstep", avctx->max_qdiff);
if (ret < 0)
--
2.34.1
_______________________________________________
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] 4+ messages in thread
* Re: [FFmpeg-devel] [PATCH] avcodec/libx265: fix build error
2022-11-03 14:20 ` Zhao Zhili
@ 2022-11-18 7:45 ` "zhilizhao(赵志立)"
0 siblings, 0 replies; 4+ messages in thread
From: "zhilizhao(赵志立)" @ 2022-11-18 7:45 UTC (permalink / raw)
To: FFmpeg development discussions and patches
> On Nov 3, 2022, at 22:20, Zhao Zhili <quinkblack@foxmail.com> wrote:
>
> From: Zhao Zhili <zhilizhao@tencent.com>
>
> x265_sei is available since X265_BUILD 88. Bump required version
> to 89 to fix the regression from commit 1f585030137, and remove a
> conditional compilation.
>
> Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
> ---
> configure | 2 +-
> libavcodec/libx265.c | 2 --
> 2 files changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/configure b/configure
> index 2bcdf18a57..09d51002e3 100755
> --- a/configure
> +++ b/configure
> @@ -6736,7 +6736,7 @@ enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x
> require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
> check_cpp_condition libx262 x264.h "X264_MPEG2"
> enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
> - require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
> + require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
> enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
> enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
> diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
> index 4aa96e1f2d..555b5e26d8 100644
> --- a/libavcodec/libx265.c
> +++ b/libavcodec/libx265.c
> @@ -293,7 +293,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
> return ret;
> }
>
> -#if X265_BUILD >= 89
> if (avctx->qmin >= 0) {
> ret = libx265_param_parse_int(avctx, "qpmin", avctx->qmin);
> if (ret < 0)
> @@ -304,7 +303,6 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
> if (ret < 0)
> return ret;
> }
> -#endif
> if (avctx->max_qdiff >= 0) {
> ret = libx265_param_parse_int(avctx, "qpstep", avctx->max_qdiff);
> if (ret < 0)
> --
> 2.34.1
>
Applied as 36a8d1e729dcad6877791e1aa35c6deeab538555.
_______________________________________________
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] 4+ messages in thread
end of thread, other threads:[~2022-11-18 7:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-03 11:11 [FFmpeg-devel] [PATCH] avcodec/libx265: fix build error Zhao Zhili
2022-11-03 12:32 ` James Almer
2022-11-03 14:20 ` Zhao Zhili
2022-11-18 7:45 ` "zhilizhao(赵志立)"
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