Re: [FFmpeg-devel] [PATCH v2] libi264: Add Hardware Accelerated H.264 Encoder based on libVA

2016-01-13 Thread Hamza Shahid
Hi Will,

I think we addressed all the review comments in this patch. Which are as
follows:

1. Remove inline asm for color conversion and replace with swscale, which I
did.
2. Replace static variables with #defines, which I did.
3. Remove unnecessary stuff from configure script, which I did.
4. Use named constants instead string to constant conversion function,
which I did.
5. configure script was broke, which I fixed.

Can you please be a bit more specific about which comments did we not
address. I will be more than glad to fix everything and get this patch
through.

Thanks & Regards
Hamza Shahid

On Tue, Jan 12, 2016 at 9:44 PM, Will Kelleher 
wrote:

> On 01/09, ha...@mayartech.com wrote:
> > From: "ha...@mayartech.com" 
> >
> > This commit adds a hardware accelerated H.264 encoder which utilizes
> > libVA (open source implementation of VA-API). Information about libva
> > is available at: https://en.wikipedia.org/wiki/Video_Acceleration_API
> > This encoder is only availbale on linux and supported hardware which
> > can be viewed at:
> >
> https://en.wikipedia.org/wiki/Video_Acceleration_API#Supported_hardware_and_drivers
> >
>
> Hi,
>
> I tested this and I can confirm that it at least works from a functional
> perspective.  I'm very interested in seeing this cleaned up and merged,
> since it
> provides a better alternative to h264_qsv on platforms for which Intel has
> decided to drop support in recent versions of the MediaSDK.  For example,
> my
> IvyBridge hardware is no longer supported with the current MediaSDK and is
> limited to kernel 3.14.5 with an old MediaSDK release.  I can use this
> patch to
> encode through vaapi with kernel 4.3.0 and no MediaSDK dependency.  This
> makes
> me happy!
>
> That said, it doesn't look like any of the previous review comments (which
> I
> agree with) were addressed in this second version.  Let me know if there is
> anything I can do to help.
>
> Thanks,
>
> will
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] libi264: Add Hardware Accelerated H.264 Encoder based on libVA

2016-01-12 Thread Hendrik Leppkes
On Tue, Jan 12, 2016 at 9:26 PM, compn  wrote:
> On Tue, 12 Jan 2016 10:44:18 -0600
> Will Kelleher  wrote:
>
>> That said, it doesn't look like any of the previous review comments
>> (which I agree with) were addressed in this second version.  Let me
>> know if there is anything I can do to help.
>
> some devs made comments that it cannot use colorspace conversion,
> because colorspace conversion code belongs in swscale.
>
> now they complain that there is a swscale dep.
>
> so what do these devs want? heh.

We want it to define its native input format, and let the generic code
in ffmpeg.c etc handle conversion to the appropriate format.

- Hendrik
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v2] libi264: Add Hardware Accelerated H.264 Encoder based on libVA

2016-01-12 Thread compn
On Tue, 12 Jan 2016 10:44:18 -0600
Will Kelleher  wrote:

> That said, it doesn't look like any of the previous review comments
> (which I agree with) were addressed in this second version.  Let me
> know if there is anything I can do to help.

some devs made comments that it cannot use colorspace conversion,
because colorspace conversion code belongs in swscale.

now they complain that there is a swscale dep.

so what do these devs want? heh.

-compn
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2] libi264: Add Hardware Accelerated H.264 Encoder based on libVA

2016-01-09 Thread hamza
From: "ha...@mayartech.com" 

This commit adds a hardware accelerated H.264 encoder which utilizes
libVA (open source implementation of VA-API). Information about libva
is available at: https://en.wikipedia.org/wiki/Video_Acceleration_API
This encoder is only availbale on linux and supported hardware which
can be viewed at:
https://en.wikipedia.org/wiki/Video_Acceleration_API#Supported_hardware_and_drivers

The short name for encoder is "libi264". The encoder must be enablde at
configure time using the --enable-libi264 switch. By default it is
turned off.
---
 Changelog   |1 +
 MAINTAINERS |1 +
 configure   |5 +-
 doc/general.texi|   11 +
 libavcodec/Makefile |1 +
 libavcodec/allcodecs.c  |1 +
 libavcodec/libi264.c| 1377 +++
 libavcodec/libi264.h|  111 +++
 libavcodec/libi264_param_set.c  |  425 +++
 libavcodec/libi264_param_set.h  |   81 +++
 libavcodec/libi264_va_display.c |  113 +++
 libavcodec/libi264_va_display.h |   86 +++
 libavcodec/libi264_va_display_drm.c |   97 +++
 libavcodec/libi264_va_display_x11.c |  172 +
 libavcodec/version.h|2 +-
 15 files changed, 2482 insertions(+), 2 deletions(-)
 create mode 100644 libavcodec/libi264.c
 create mode 100644 libavcodec/libi264.h
 create mode 100644 libavcodec/libi264_param_set.c
 create mode 100644 libavcodec/libi264_param_set.h
 create mode 100644 libavcodec/libi264_va_display.c
 create mode 100644 libavcodec/libi264_va_display.h
 create mode 100644 libavcodec/libi264_va_display_drm.c
 create mode 100644 libavcodec/libi264_va_display_x11.c

diff --git a/Changelog b/Changelog
index d9c2ea8..99acb56 100644
--- a/Changelog
+++ b/Changelog
@@ -49,6 +49,7 @@ version :
 - VAAPI VP9 hwaccel
 - audio high-order multiband parametric equalizer
 - automatic bitstream filtering
+- H.264 hwaccelerated encoding through libVA
 
 
 version 2.8:
diff --git a/MAINTAINERS b/MAINTAINERS
index 9add13d..e37cb6f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -203,6 +203,7 @@ Codecs:
   libcelt_dec.c Nicolas George
   libdirac* David Conrad
   libgsm.c  Michel Bardiaux
+  libi264*  Bryan Christ
   libkvazaar.c  Arttu Yl??-Outinen
   libopenjpeg.c Jaikrishnan Menon
   libopenjpegenc.c  Michael Bradshaw
diff --git a/configure b/configure
index da74ccd..d8fe713 100755
--- a/configure
+++ b/configure
@@ -265,6 +265,7 @@ External library support:
   --enable-libwavpack  enable wavpack encoding via libwavpack [no]
   --enable-libwebp enable WebP encoding via libwebp [no]
   --enable-libx264 enable H.264 encoding via x264 [no]
+  --enable-libi264 enable H.264 encoding via libva [no]
   --enable-libx265 enable HEVC encoding via x265 [no]
   --enable-libxavs enable AVS encoding via xavs [no]
   --enable-libxcb  enable X11 grabbing using XCB [autodetect]
@@ -1454,6 +1455,7 @@ EXTERNAL_LIBRARY_LIST="
 libfribidi
 libgme
 libgsm
+libi264
 libiec61883
 libilbc
 libkvazaar
@@ -2658,7 +2660,7 @@ libwebp_anim_encoder_deps="libwebp"
 libx262_encoder_deps="libx262"
 libx264_encoder_deps="libx264"
 libx264rgb_encoder_deps="libx264"
-libx264rgb_encoder_select="libx264_encoder"
+libi264_encoder_deps="swscale"
 libx265_encoder_deps="libx265"
 libxavs_encoder_deps="libxavs"
 libxvid_encoder_deps="libxvid"
@@ -5528,6 +5530,7 @@ enabled libx264   && { use_pkg_config x264 
"stdint.h x264.h" x264_encode
die "ERROR: libx264 must be installed and 
version must be >= 0.118."; } &&
  { check_cpp_condition x264.h "X264_MPEG2" &&
enable libx262; }
+enabled libi264   && require libva va/va.h vaInitialize -lva -lX11 
-lva-x11 -lva-drm
 enabled libx265   && require_pkg_config x265 x265.h x265_api_get &&
  { check_cpp_condition x265.h "X265_BUILD >= 57" ||
die "ERROR: libx265 version must be >= 57."; }
diff --git a/doc/general.texi b/doc/general.texi
index 06933ab..bca7ca0 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -131,6 +131,17 @@ x264 is under the GNU Public License Version 2 or later
 details), you must upgrade FFmpeg's license to GPL in order to use it.
 @end float
 
+@section libva
+
+FFmpeg can make use of the libva library for H.264 encoding. libva is an 
+implementation of VA-API for Linux. libva can only be used for H.264 encoding
+on unix based systems and Intel GPUs which have support for hardware 
accelerated
+H.264 encoding.
+
+Go to @url{http://www.freedesktop.org/wiki/Software/vaapi/} and