svn commit: r422841 - in head/multimedia/ffmpeg: . files

Jan Beich jbeich at FreeBSD.org
Wed Sep 28 02:13:51 UTC 2016


Author: jbeich
Date: Wed Sep 28 02:13:50 2016
New Revision: 422841
URL: https://svnweb.freebsd.org/changeset/ports/422841

Log:
  multimedia/ffmpeg: add KVAZAAR option (another HEVC implementation)

Added:
  head/multimedia/ffmpeg/files/patch-kvazaar-0.7   (contents, props changed)
Modified:
  head/multimedia/ffmpeg/Makefile   (contents, props changed)

Modified: head/multimedia/ffmpeg/Makefile
==============================================================================
--- head/multimedia/ffmpeg/Makefile	Wed Sep 28 02:13:33 2016	(r422840)
+++ head/multimedia/ffmpeg/Makefile	Wed Sep 28 02:13:50 2016	(r422841)
@@ -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 
 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

Added: head/multimedia/ffmpeg/files/patch-kvazaar-0.7
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/ffmpeg/files/patch-kvazaar-0.7	Wed Sep 28 02:13:50 2016	(r422841)
@@ -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 at 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 at 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:


More information about the svn-ports-head mailing list