aboutsummaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--multimedia/ffmpeg/Makefile7
-rw-r--r--multimedia/ffmpeg/files/patch-kvazaar-0.773
2 files changed, 79 insertions, 1 deletions
diff --git a/multimedia/ffmpeg/Makefile b/multimedia/ffmpeg/Makefile
index 3ebcfd8a096..41bf9c32bdb 100644
--- a/multimedia/ffmpeg/Makefile
+++ b/multimedia/ffmpeg/Makefile
@@ -27,7 +27,7 @@ PORTSCOUT= limit:^2\.
OPTIONS_DEFINE= AACPLUS ALSA AMR_NB AMR_WB ASS BS2B CACA CDIO CELT DC1394 \
DEBUG DOCS FAAC FDK_AAC FFSERVER FLITE FONTCONFIG \
- FREETYPE FREI0R FRIBIDI GME GSM ICONV ILBC JACK LADSPA \
+ FREETYPE FREI0R FRIBIDI GME GSM ICONV ILBC JACK KVAZAAR LADSPA \
LAME LIBBLURAY MODPLUG OPENAL OPENCL OPENCV OPENGL \
OPENH264 OPENJPEG OPTIMIZED_CFLAGS OPUS PULSEAUDIO QUVI \
RTCPU RTMP SCHROEDINGER SDL SMB SNAPPY SPEEX SSH \
@@ -61,6 +61,7 @@ FLITE_DESC= Voice synthesis support via libflite
GME_DESC= Game Music Emu demuxer
GPL3_DESC= Allow (L)GPL version 3 code(cs)
ILBC_DESC= Internet Low Bit Rate codec
+KVAZAAR_DESC= H.265 video codec support via Kvazaar
LICENSE_DESC= Licensing options
NEON_DESC= Enable Media Processing Engine instructions
NONFREE_DESC= Allow use of nonfree code
@@ -186,6 +187,10 @@ ILBC_CONFIGURE_ENABLE= libilbc
JACK_LIB_DEPENDS= libjack.so:audio/jack
JACK_CONFIGURE_OFF= --disable-indev=jack
+# kvazaar
+KVAZAAR_LIB_DEPENDS= libkvazaar.so:multimedia/kvazaar
+KVAZAAR_CONFIGURE_ENABLE= libkvazaar
+
# ladspa
LADSPA_BUILD_DEPENDS= ${LOCALBASE}/include/ladspa.h:audio/ladspa
LADSPA_RUN_DEPENDS= ${LOCALBASE}/lib/ladspa/amp.so:audio/ladspa
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: