aboutsummaryrefslogtreecommitdiffstats
path: root/multimedia/ffmpeg/files
diff options
context:
space:
mode:
authorjbeich <jbeich@FreeBSD.org>2016-09-28 10:13:50 +0800
committerjbeich <jbeich@FreeBSD.org>2016-09-28 10:13:50 +0800
commit78dabd6decd50f7a9d633b7437c4114be09950b2 (patch)
treef1c3814e1a8e8b59d43a68b0e52f8bb8e268fdee /multimedia/ffmpeg/files
parentc4f689a929385540a68bef4de8c10ffb3a8cea96 (diff)
downloadfreebsd-ports-graphics-78dabd6decd50f7a9d633b7437c4114be09950b2.tar.gz
freebsd-ports-graphics-78dabd6decd50f7a9d633b7437c4114be09950b2.tar.zst
freebsd-ports-graphics-78dabd6decd50f7a9d633b7437c4114be09950b2.zip
multimedia/ffmpeg: add KVAZAAR option (another HEVC implementation)
Diffstat (limited to 'multimedia/ffmpeg/files')
-rw-r--r--multimedia/ffmpeg/files/patch-kvazaar-0.773
1 files changed, 73 insertions, 0 deletions
diff --git a/multimedia/ffmpeg/files/patch-kvazaar-0.7 b/multimedia/ffmpeg/files/patch-kvazaar-0.7
new file mode 100644
index 00000000000..77e1e9da56b
--- /dev/null
+++ b/multimedia/ffmpeg/files/patch-kvazaar-0.7
@@ -0,0 +1,73 @@
+From b3777b2c2eb5d04386992c0388985914d5bbebba Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Arttu=20Yl=C3=A4-Outinen?= <arttu.yla-outinen@tut.fi>
+Date: Mon, 28 Sep 2015 10:55:14 +0300
+Subject: libkvazaar: Update to work with the latest version
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Function encoder_encode in Kvazaar API was changed to have new output
+parameters: source picture and frame info. Frame info is used to set the
+keyframe flag and source picture is ignored.
+
+Signed-off-by: Arttu Ylä-Outinen <arttu.yla-outinen@tut.fi>
+---
+ libavcodec/libkvazaar.c | 16 +++++++++++++++-
+ 1 file changed, 15 insertions(+), 1 deletion(-)
+
+diff --git configure configure
+index 4cc45ad..af3fbf4 100755
+--- configure
++++ configure
+@@ -5237,7 +5237,7 @@
+ check_lib "${gsm_hdr}" gsm_create -lgsm && break;
+ done || die "ERROR: libgsm not found"; }
+ enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
+-enabled libkvazaar && require_pkg_config "kvazaar < 0.7.0" kvazaar.h kvz_api_get
++enabled libkvazaar && require_pkg_config "kvazaar >= 0.7.0" kvazaar.h kvz_api_get
+ enabled libmfx && require_pkg_config libmfx "mfx/mfxvideo.h" MFXInit
+ enabled libmodplug && require_pkg_config libmodplug libmodplug/modplug.h ModPlug_Load
+ enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
+diff --git libavcodec/libkvazaar.c libavcodec/libkvazaar.c
+index 9fb5be7..7430e0a 100644
+--- libavcodec/libkvazaar.c
++++ libavcodec/libkvazaar.c
+@@ -137,8 +137,11 @@ static int libkvazaar_encode(AVCodecContext *avctx,
+ {
+ int retval = 0;
+ kvz_picture *img_in = NULL;
++
+ kvz_data_chunk *data_out = NULL;
+ uint32_t len_out = 0;
++ kvz_frame_info frame_info;
++
+ LibkvazaarContext *ctx = avctx->priv_data;
+
+ *got_packet_ptr = 0;
+@@ -173,7 +176,10 @@ static int libkvazaar_encode(AVCodecContext *avctx,
+ }
+ }
+
+- if (!ctx->api->encoder_encode(ctx->encoder, img_in, &data_out, &len_out, NULL)) {
++ if (!ctx->api->encoder_encode(ctx->encoder, img_in,
++ &data_out, &len_out,
++ NULL, NULL,
++ &frame_info)) {
+ av_log(avctx, AV_LOG_ERROR, "Failed to encode frame.\n");
+ retval = AVERROR_EXTERNAL;
+ goto done;
+@@ -198,6 +204,14 @@ static int libkvazaar_encode(AVCodecContext *avctx,
+
+ ctx->api->chunk_free(data_out);
+ data_out = NULL;
++
++ avpkt->flags = 0;
++ // IRAP VCL NAL unit types span the range
++ // [BLA_W_LP (16), RSV_IRAP_VCL23 (23)].
++ if (frame_info.nal_unit_type >= KVZ_NAL_BLA_W_LP &&
++ frame_info.nal_unit_type <= KVZ_NAL_RSV_IRAP_VCL23) {
++ avpkt->flags |= AV_PKT_FLAG_KEY;
++ }
+ }
+
+ done: