Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-19 Thread Vittorio Giovara
On Tue, Mar 19, 2019 at 2:17 AM Sun, Jing A  wrote:

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Jing SUN
> Sent: Monday, March 11, 2019 6:38 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu <
> zhengxu.hu...@intel.com>; Jun Zhao ; Tmar, Hassene <
> hassene.t...@intel.com>
> Subject: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper.
>
> From: Jing Sun 
>
> base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC
>
> V4: - Fix the build error with new API in PR#52
> - Fix the encoding hang issue by API change in PR#52
> - Fix the last frame dropping issue
> - Fix the invalid parameter causing segmentation fault issue
> - Add the support to svt hevc and av1 plugins coexistance
> - Add the VMAF optimized mode to "-tune"
> - Add the "-hdr" parameter
>
> V3: - Fix the build error with new API
>
> V2: - Change the config options (didn't need to enable-gpl for BSD+Patent,
>   it's can compatible with LGPL2+, thanks Xavier correct this part),
>   now just need to "--enable-libsvthevc" option
> - Add force_idr option
> - Remove default GoP size setting in the wrapper, SVT-HEVC will calc
>   the the GoP size internal
> - Refine the code as the FFmpeg community's comments
>   (https://patchwork.ffmpeg.org/patch/11347/)
>
> V1: - base on patch by Huang, Zhengxu, then refine some code.
>

all this version history should be in the email thread but not in the
commit section in my opinion


>
> Change-Id: If0dcc5044ab9effd6847a8f48797b985d02b0816
>

this id means nothing in ffmpeg git, I'd suggest dropping it


> Signed-off-by: Huang, Zhengxu 
> Signed-off-by: hassene 
>

Should there be a real name here?


> Signed-off-by: Jun Zhao 
> Signed-off-by: Jing Sun 
> Signed-off-by: Jing SUN 
>

double sign-off?

---
>
[..]

> --
> 1.8.3.1
>
> Hi maintainers,
>
> A week has passed and no negative comment is received except a new feature
> request, which will be considered in the next version. Is the first version
> good to be picked?
>

Until that feature request is added, there should be a warning about that
missing missing feature IMO.
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-18 Thread Sun, Jing A
-Original Message-
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Jing 
SUN
Sent: Monday, March 11, 2019 6:38 PM
To: ffmpeg-devel@ffmpeg.org
Cc: Sun, Jing A ; Huang, Zhengxu 
; Jun Zhao ; Tmar, Hassene 

Subject: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder 
wrapper.

From: Jing Sun 

base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC

V4: - Fix the build error with new API in PR#52
- Fix the encoding hang issue by API change in PR#52
- Fix the last frame dropping issue
- Fix the invalid parameter causing segmentation fault issue
- Add the support to svt hevc and av1 plugins coexistance
- Add the VMAF optimized mode to "-tune"
- Add the "-hdr" parameter

V3: - Fix the build error with new API

V2: - Change the config options (didn't need to enable-gpl for BSD+Patent,
  it's can compatible with LGPL2+, thanks Xavier correct this part),
  now just need to "--enable-libsvthevc" option
- Add force_idr option
- Remove default GoP size setting in the wrapper, SVT-HEVC will calc
  the the GoP size internal
- Refine the code as the FFmpeg community's comments
  (https://patchwork.ffmpeg.org/patch/11347/)

V1: - base on patch by Huang, Zhengxu, then refine some code.

Change-Id: If0dcc5044ab9effd6847a8f48797b985d02b0816
Signed-off-by: Huang, Zhengxu 
Signed-off-by: hassene 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
Signed-off-by: Jing SUN 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 527 +++
 4 files changed, 533 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index dcead3a..36bc8c1 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ External library support:
   --enable-libspeexenable Speex de/encoding via libspeex [no]
   --enable-libsrt  enable Haivision SRT protocol via libsrt [no]
   --enable-libssh  enable SFTP protocol via libssh [no]
+  --enable-libsvthevc  enable HEVC encoding via svt [no]
   --enable-libtensorflow   enable TensorFlow as a DNN module backend
for DNN based filters like sr [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
@@ -1784,6 +1785,7 @@ EXTERNAL_LIBRARY_LIST="
 libspeex
 libsrt
 libssh
+libsvthevc
 libtensorflow
 libtesseract
 libtheora
@@ -3173,6 +3175,7 @@ libshine_encoder_select="audio_frame_queue"
 libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
+libsvt_hevc_encoder_deps="libsvthevc"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
@@ -6209,6 +6212,7 @@ enabled libsoxr   && require libsoxr soxr.h 
soxr_create -lsoxr
 enabled libssh&& require_pkg_config libssh libssh libssh/sftp.h 
sftp_init
 enabled libspeex  && require_pkg_config libspeex speex speex/speex.h 
speex_decoder_init
 enabled libsrt&& require_pkg_config libsrt "srt >= 1.3.0" 
srt/srt.h srt_socket
+enabled libsvthevc&& require_pkg_config libsvthevc SvtHevcEnc 
svt-hevc/EbApi.h EbInitHandle
 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h 
TF_Version -ltensorflow
 enabled libtesseract  && require_pkg_config libtesseract tesseract 
tesseract/capi.h TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 15c43a8..c93e545 
100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -987,6 +987,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)+= libopusenc.o 
libopus.o \
 OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
+OBJS-$(CONFIG_LIBSVT_HEVC_ENCODER)+= libsvt_hevc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 
b26aeca..e93f66f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -703,6 +703,7 @@ extern AVCodec ff_librsvg_decoder;  extern AVCodec 
ff_libshine_encoder;  extern AVCodec ff_libspeex_encoder;  extern AVCodec 
ff_libspeex_decoder;
+extern AVCodec ff_libsvt_hevc_encoder;
 extern AVCodec ff_libtheora_encoder;
 extern AVCodec ff_libtwolame_encoder;
 extern AVCodec ff_libvo_amrwbe

Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-13 Thread Sun, Jing A

On Wed, Mar 13, 2019 at 8:29 PM Sun, Jing A  wrote:

>
>
> > On Tue, Mar 12, 2019 at 11:40 PM Sun, Jing A 
> wrote:
>
> Hi Giovara,
>
>
>
> SVT HEVC has the interface to enable/disable sending a vui structure 
> in the HEVC bitstream, but supports no interface for setting the color 
> properties before encoding yet. I will be opening an issue in SVT HEVC 
> github asking if they have plans to add such feature, and will keep 
> you posted. In the meantime, I think it is not blocking the first 
> version of this plugin’s merging , is it?
>
>
>
>
>
> > It kind-of is, what is the point of setting the HDR information (or
> encoding in hevc at all) if you can't set the related color properties?
>
> > At the very least there should be a big fat warning that notifies 
> > users
> of this missing feature, when such information is lost.
>
> > --
>
> > Vittorio
>
>
>
> SVT HEVC’s HDR is also an on-off switch, please refer to 
> https://github.com/intel/SVT-HEVC/blob/master/Docs/svt-hevc_encoder_us
> er_guide.md
> .
>
>
>
> -Jing
>

>Sorry, I fail to see the logical connection between my comment and your reply.
>--
>Vittorio

The feature request is being considered: 
https://github.com/intel/SVT-HEVC/issues/148
-Jing
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-13 Thread Vittorio Giovara
On Wed, Mar 13, 2019 at 8:29 PM Sun, Jing A  wrote:

>
>
> > On Tue, Mar 12, 2019 at 11:40 PM Sun, Jing A 
> wrote:
>
> Hi Giovara,
>
>
>
> SVT HEVC has the interface to enable/disable sending a vui structure in
> the HEVC bitstream, but supports no interface for setting the color
> properties before encoding yet. I will be opening an issue in SVT HEVC
> github asking if they have plans to add such feature, and will keep you
> posted. In the meantime, I think it is not blocking the first version of
> this plugin’s merging , is it?
>
>
>
>
>
> > It kind-of is, what is the point of setting the HDR information (or
> encoding in hevc at all) if you can't set the related color properties?
>
> > At the very least there should be a big fat warning that notifies users
> of this missing feature, when such information is lost.
>
> > --
>
> > Vittorio
>
>
>
> SVT HEVC’s HDR is also an on-off switch, please refer to
> https://github.com/intel/SVT-HEVC/blob/master/Docs/svt-hevc_encoder_user_guide.md
> .
>
>
>
> -Jing
>

Sorry, I fail to see the logical connection between my comment and your
reply.
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-13 Thread Sun, Jing A

> On Tue, Mar 12, 2019 at 11:40 PM Sun, Jing A 
> mailto:jing.a@intel.com>> wrote:
Hi Giovara,

SVT HEVC has the interface to enable/disable sending a vui structure in the 
HEVC bitstream, but supports no interface for setting the color properties 
before encoding yet. I will be opening an issue in SVT HEVC github asking if 
they have plans to add such feature, and will keep you posted. In the meantime, 
I think it is not blocking the first version of this plugin’s merging , is it?


> It kind-of is, what is the point of setting the HDR information (or encoding 
> in hevc at all) if you can't set the related color properties?
> At the very least there should be a big fat warning that notifies users of 
> this missing feature, when such information is lost.
> --
> Vittorio

SVT HEVC’s HDR is also an on-off switch, please refer to 
https://github.com/intel/SVT-HEVC/blob/master/Docs/svt-hevc_encoder_user_guide.md.

-Jing
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-13 Thread Vittorio Giovara
On Tue, Mar 12, 2019 at 11:40 PM Sun, Jing A  wrote:

> Hi Giovara,
>
>
>
> SVT HEVC has the interface to enable/disable sending a vui structure in
> the HEVC bitstream, but supports no interface for setting the color
> properties before encoding yet. I will be opening an issue in SVT HEVC
> github asking if they have plans to add such feature, and will keep you
> posted. In the meantime, I think it is not blocking the first version of
> this plugin’s merging , is it?
>
>
>
It kind-of is, what is the point of setting the HDR information (or
encoding in hevc at all) if you can't set the related color properties?
At the very least there should be a big fat warning that notifies users of
this missing feature, when such information is lost.
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-12 Thread Sun, Jing A
On  Monday, March 11, 2019 10:50 PM Vittorio Giovara vittorio.giov...@gmail.com 
wrote:

>On Mon, Mar 11, 2019 at 12:50 AM Sun, Jing A  wrote:
>I just searched my inbox again but failed to find that email of question you 
>mentioned.
>
>Yeah I often see my mail bounced with this message:
>
>Address not found
>Your message wasn't delivered to jun.z...@intel.com because the address 
>couldn't be found, or is unable to receive mail. 
 
>For reference this was the message on the mailing list 
>https://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240663.html
>
>Could you please elaborate your request? What is the preservation for and how 
>is it expected to work? 
>
>Yes of course, when you encode an HEVC stream you should be able to 
>signal how the color properties of the video buffers should be 
>rendered. This is usually conveyed with three parameters, the matrix 
>coefficients, the color primaries and the transfer characteristics. Without 
>such information, the data stored in the video may be interpreted differently 
>and often incorrectly by modern video players, causing image degradation, 
>wrong rendering and off colors.

>For HEVC they are usually expressed in the stream itself, under the VUI, and 
>it is kinda expected that modern encoder allow to set them to any of the 
>applicable values.
>In ffmpeg-land, they are represented by the colorspace, color_primaries and 
>color_transfer options in AVCodecContext and carried over through the whole 
>video processing.
>--
>Vittorio

Hi Giovara,

SVT HEVC has the interface to enable/disable sending a vui structure in the 
HEVC bitstream, but supports no interface for setting the color properties 
before encoding yet. I will be opening an issue in SVT HEVC github asking if 
they have plans to add such feature, and will keep you posted. In the meantime, 
I think it is not blocking the first version of this plugin’s merging , is it?

In SVT HEVC user guide: "VideoUsabilityInfo - Enables or disables sending a vui 
structure in the HEVC Elementary bitstream. 0 = OFF, 1 = ON"

Regards,
SUN, Jing

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


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-12 Thread Sun, Jing A
On  Monday, March 11, 2019 10:50 PM Vittorio Giovara vittorio.giov...@gmail.com 
wrote:

>On Mon, Mar 11, 2019 at 12:50 AM Sun, Jing A  wrote:
>I just searched my inbox again but failed to find that email of question you 
>mentioned.
>
>Yeah I often see my mail bounced with this message:
>
>Address not found
>Your message wasn't delivered to jun.z...@intel.com because the address 
>couldn't be found, or is unable to receive mail. 
 
>For reference this was the message on the mailing list 
>https://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240663.html
>
>Could you please elaborate your request? What is the preservation for and how 
>is it expected to work? 
>
>Yes of course, when you encode an HEVC stream you should be able to signal how 
>the color properties of the video buffers should be rendered. This is usually 
>conveyed with three 
>parameters, the matrix coefficients, the color primaries and the transfer 
>characteristics. Without such information, the data stored in the video may be 
>interpreted differently and often 
>incorrectly by modern video players, causing image degradation, wrong 
>rendering and off colors.

>For HEVC they are usually expressed in the stream itself, under the VUI, and 
>it is kinda expected that modern encoder allow to set them to any of the 
>applicable values.
>In ffmpeg-land, they are represented by the colorspace, color_primaries and 
>color_transfer options in AVCodecContext and carried over through the whole 
>video processing.
>-- 
>Vittorio

Hi Giovara,

SVT HEVC has the interface to enable/disable sending a vui structure in the 
HEVC bitstream, but supports no interface for setting the color properties 
before encoding yet. I will be opening an issue in SVT HEVC github asking if 
they have plans to add such feature, and will keep you posted. In the meantime, 
I think it is not blocking the first version of this plugin’s merging , is it?

In SVT HEVC user guide: "VideoUsabilityInfo - Enables or disables sending a vui 
structure in the HEVC Elementary bitstream. 0 = OFF, 1 = ON"

Regards,
SUN, Jing

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


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-12 Thread Sun, Jing A
Hi Giovara,

SVT HEVC has the interface to enable/disable sending a vui structure in the 
HEVC bitstream, but supports no interface for setting the color properties 
before encoding yet. I will be opening an issue in SVT HEVC github asking if 
they have plans to add such feature, and will keep you posted. In the meantime, 
I think it is not blocking the first version of this plugin’s merging , is it?

VideoUsabilityInfo

Enables or disables sending a vui
structure in the HEVC Elementary
bitstream. 0 = OFF, 1 = ON


Regards,
SUN, Jing

From: Vittorio Giovara [mailto:vittorio.giov...@gmail.com]
Sent: Monday, March 11, 2019 10:50 PM
To: Sun, Jing A 
Cc: FFmpeg development discussions and patches ; 
Huang, Zhengxu ; Tmar, Hassene 
Subject: Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper.



On Mon, Mar 11, 2019 at 12:50 AM Sun, Jing A 
mailto:jing.a@intel.com>> wrote:
I just searched my inbox again but failed to find that email of question you 
mentioned.

Yeah I often see my mail bounced with this message:

Address not found
Your message wasn't delivered to jun.z...@intel.com<mailto:jun.z...@intel.com> 
because the address couldn't be found, or is unable to receive mail.


For reference this was the message on the mailing list 
https://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240663.html

Could you please elaborate your request? What is the preservation for and how 
is it expected to work?

Yes of course, when you encode an HEVC stream you should be able to signal how 
the color properties of the video buffers should be rendered. This is usually 
conveyed with three parameters, the matrix coefficients, the color primaries 
and the transfer characteristics. Without such information, the data stored in 
the video may be interpreted differently and often incorrectly by modern video 
players, causing image degradation, wrong rendering and off colors.

For HEVC they are usually expressed in the stream itself, under the VUI, and it 
is kinda expected that modern encoder allow to set them to any of the 
applicable values.
In ffmpeg-land, they are represented by the colorspace, color_primaries and 
color_transfer options in AVCodecContext and carried over through the whole 
video processing.
--
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Vittorio Giovara
On Mon, Mar 11, 2019 at 12:50 AM Sun, Jing A  wrote:

> I just searched my inbox again but failed to find that email of question
> you mentioned.
>

Yeah I often see my mail bounced with this message:
Address not foundYour message wasn't delivered to *jun.z...@intel.com*
because the address couldn't be found, or is unable to receive mail.

For reference this was the message on the mailing list
https://ffmpeg.org/pipermail/ffmpeg-devel/2019-March/240663.html

Could you please elaborate your request? What is the preservation for and
> how is it expected to work?
>

Yes of course, when you encode an HEVC stream you should be able to signal
how the color properties of the video buffers should be rendered. This is
usually conveyed with three parameters, the matrix coefficients, the color
primaries and the transfer characteristics. Without such information, the
data stored in the video may be interpreted differently and often
incorrectly by modern video players, causing image degradation, wrong
rendering and off colors.

For HEVC they are usually expressed in the stream itself, under the VUI,
and it is kinda expected that modern encoder allow to set them to any of
the applicable values.
In ffmpeg-land, they are represented by the colorspace, color_primaries and
color_transfer options in AVCodecContext and carried over through the whole
video processing.
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Jing SUN
From: Jing Sun 

base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC

V4: - Fix the build error with new API in PR#52
- Fix the encoding hang issue by API change in PR#52
- Fix the last frame dropping issue
- Fix the invalid parameter causing segmentation fault issue
- Add the support to svt hevc and av1 plugins coexistance
- Add the VMAF optimized mode to "-tune"
- Add the "-hdr" parameter

V3: - Fix the build error with new API

V2: - Change the config options (didn't need to enable-gpl for BSD+Patent,
  it's can compatible with LGPL2+, thanks Xavier correct this part),
  now just need to "--enable-libsvthevc" option
- Add force_idr option
- Remove default GoP size setting in the wrapper, SVT-HEVC will calc
  the the GoP size internal
- Refine the code as the FFmpeg community's comments
  (https://patchwork.ffmpeg.org/patch/11347/)

V1: - base on patch by Huang, Zhengxu, then refine some code.

Change-Id: If0dcc5044ab9effd6847a8f48797b985d02b0816
Signed-off-by: Huang, Zhengxu 
Signed-off-by: hassene 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
Signed-off-by: Jing SUN 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 527 +++
 4 files changed, 533 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index dcead3a..36bc8c1 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ External library support:
   --enable-libspeexenable Speex de/encoding via libspeex [no]
   --enable-libsrt  enable Haivision SRT protocol via libsrt [no]
   --enable-libssh  enable SFTP protocol via libssh [no]
+  --enable-libsvthevc  enable HEVC encoding via svt [no]
   --enable-libtensorflow   enable TensorFlow as a DNN module backend
for DNN based filters like sr [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
@@ -1784,6 +1785,7 @@ EXTERNAL_LIBRARY_LIST="
 libspeex
 libsrt
 libssh
+libsvthevc
 libtensorflow
 libtesseract
 libtheora
@@ -3173,6 +3175,7 @@ libshine_encoder_select="audio_frame_queue"
 libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
+libsvt_hevc_encoder_deps="libsvthevc"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
@@ -6209,6 +6212,7 @@ enabled libsoxr   && require libsoxr soxr.h 
soxr_create -lsoxr
 enabled libssh&& require_pkg_config libssh libssh libssh/sftp.h 
sftp_init
 enabled libspeex  && require_pkg_config libspeex speex speex/speex.h 
speex_decoder_init
 enabled libsrt&& require_pkg_config libsrt "srt >= 1.3.0" 
srt/srt.h srt_socket
+enabled libsvthevc&& require_pkg_config libsvthevc SvtHevcEnc 
svt-hevc/EbApi.h EbInitHandle
 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h 
TF_Version -ltensorflow
 enabled libtesseract  && require_pkg_config libtesseract tesseract 
tesseract/capi.h TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 15c43a8..c93e545 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -987,6 +987,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)+= libopusenc.o 
libopus.o \
 OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
+OBJS-$(CONFIG_LIBSVT_HEVC_ENCODER)+= libsvt_hevc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b26aeca..e93f66f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -703,6 +703,7 @@ extern AVCodec ff_librsvg_decoder;
 extern AVCodec ff_libshine_encoder;
 extern AVCodec ff_libspeex_encoder;
 extern AVCodec ff_libspeex_decoder;
+extern AVCodec ff_libsvt_hevc_encoder;
 extern AVCodec ff_libtheora_encoder;
 extern AVCodec ff_libtwolame_encoder;
 extern AVCodec ff_libvo_amrwbenc_encoder;
diff --git a/libavcodec/libsvt_hevc.c b/libavcodec/libsvt_hevc.c
new file mode 100644
index 000..088decf
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,527 @@
+/*
+* Scalable Video Technology for HEVC encoder library plugin
+*
+* Copyright (c) 2018 Intel Corporation
+*
+* This file is part of FFmpeg.
+*
+* FFmpeg is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or 

Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Carl Eugen Hoyos
2019-03-11 11:28 GMT+01:00, Jing SUN :

> +static void free_buffer(SvtContext *svt_enc)
> +{
> +uint8_t *in_data = (EB_H265_ENC_INPUT *)svt_enc->in_buf.pBuffer;
> +
> +av_freep(&in_data);
> +}

Is the cast necessary?
Does the variable make the code more readable?
Does the function make the code more readable?

No more comments here, sorry, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Sun, Jing A

-Original Message-
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Carl 
Eugen Hoyos
Sent: Monday, March 11, 2019 5:01 PM
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper.

2019-03-11 9:49 GMT+01:00, Moritz Barsnick :
> On Mon, Mar 11, 2019 at 04:17:21 +, Sun, Jing A wrote:
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf 
>> Of Carl Eugen Hoyos
>> > The condition is unnecessary.
>> [SUN, Jing] If av_mallocz fails, free_buffer will be called with 
>> in_data being NULL. Checking it avoids unnecessary calling to 
>> av_freep in that case.
>
> Please read the kind documentation (and the "Note" quzoted below) or 
> the source of said function, and how other uses within ffmpeg are:
>
> https://www.ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0cc8
> 4043ea2167ad005c86e11d0bcdba
>
> void av_freep (void *ptr)
> [...]
> Note
> *ptr = NULL is safe and leads to no action.

> In other words, av_freep() already has this check.

I believe his argumentation was that he knows but that in case of oom, he wants 
to avoid extra indirections.

Carl Eugen

[SUN, Jing] Modified and thanks for the review!

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


[FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Jing SUN
From: Jing Sun 

base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC

V4: - Fix the build error with new API in PR#52
- Fix the encoding hang issue by API change in PR#52
- Fix the last frame dropping issue
- Fix the invalid parameter causing segmentation fault issue
- Add the support to svt hevc and av1 plugins coexistance
- Add the VMAF optimized mode to "-tune"
- Add the "-hdr" parameter

V3: - Fix the build error with new API

V2: - Change the config options (didn't need to enable-gpl for BSD+Patent,
  it's can compatible with LGPL2+, thanks Xavier correct this part),
  now just need to "--enable-libsvthevc" option
- Add force_idr option
- Remove default GoP size setting in the wrapper, SVT-HEVC will calc
  the the GoP size internal
- Refine the code as the FFmpeg community's comments
  (https://patchwork.ffmpeg.org/patch/11347/)

V1: - base on patch by Huang, Zhengxu, then refine some code.

Change-Id: If0dcc5044ab9effd6847a8f48797b985d02b0816
Signed-off-by: Huang, Zhengxu 
Signed-off-by: hassene 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
Signed-off-by: Jing SUN 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 527 +++
 4 files changed, 533 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index dcead3a..36bc8c1 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ External library support:
   --enable-libspeexenable Speex de/encoding via libspeex [no]
   --enable-libsrt  enable Haivision SRT protocol via libsrt [no]
   --enable-libssh  enable SFTP protocol via libssh [no]
+  --enable-libsvthevc  enable HEVC encoding via svt [no]
   --enable-libtensorflow   enable TensorFlow as a DNN module backend
for DNN based filters like sr [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
@@ -1784,6 +1785,7 @@ EXTERNAL_LIBRARY_LIST="
 libspeex
 libsrt
 libssh
+libsvthevc
 libtensorflow
 libtesseract
 libtheora
@@ -3173,6 +3175,7 @@ libshine_encoder_select="audio_frame_queue"
 libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
+libsvt_hevc_encoder_deps="libsvthevc"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
@@ -6209,6 +6212,7 @@ enabled libsoxr   && require libsoxr soxr.h 
soxr_create -lsoxr
 enabled libssh&& require_pkg_config libssh libssh libssh/sftp.h 
sftp_init
 enabled libspeex  && require_pkg_config libspeex speex speex/speex.h 
speex_decoder_init
 enabled libsrt&& require_pkg_config libsrt "srt >= 1.3.0" 
srt/srt.h srt_socket
+enabled libsvthevc&& require_pkg_config libsvthevc SvtHevcEnc 
svt-hevc/EbApi.h EbInitHandle
 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h 
TF_Version -ltensorflow
 enabled libtesseract  && require_pkg_config libtesseract tesseract 
tesseract/capi.h TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 15c43a8..c93e545 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -987,6 +987,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)+= libopusenc.o 
libopus.o \
 OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
+OBJS-$(CONFIG_LIBSVT_HEVC_ENCODER)+= libsvt_hevc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b26aeca..e93f66f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -703,6 +703,7 @@ extern AVCodec ff_librsvg_decoder;
 extern AVCodec ff_libshine_encoder;
 extern AVCodec ff_libspeex_encoder;
 extern AVCodec ff_libspeex_decoder;
+extern AVCodec ff_libsvt_hevc_encoder;
 extern AVCodec ff_libtheora_encoder;
 extern AVCodec ff_libtwolame_encoder;
 extern AVCodec ff_libvo_amrwbenc_encoder;
diff --git a/libavcodec/libsvt_hevc.c b/libavcodec/libsvt_hevc.c
new file mode 100644
index 000..088decf
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,527 @@
+/*
+* Scalable Video Technology for HEVC encoder library plugin
+*
+* Copyright (c) 2018 Intel Corporation
+*
+* This file is part of FFmpeg.
+*
+* FFmpeg is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or 

Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Carl Eugen Hoyos
2019-03-11 9:49 GMT+01:00, Moritz Barsnick :
> On Mon, Mar 11, 2019 at 04:17:21 +, Sun, Jing A wrote:
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
>> Carl Eugen Hoyos
>> > The condition is unnecessary.
>> [SUN, Jing] If av_mallocz fails, free_buffer will be called with in_data
>> being NULL. Checking it avoids unnecessary calling to av_freep in that
>> case.
>
> Please read the kind documentation (and the "Note" quzoted below) or
> the source of said function, and how other uses within ffmpeg are:
>
> https://www.ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0cc84043ea2167ad005c86e11d0bcdba
>
> void av_freep (void *ptr)
> [...]
> Note
> *ptr = NULL is safe and leads to no action.

> In other words, av_freep() already has this check.

I believe his argumentation was that he knows but that in case
of oom, he wants to avoid extra indirections.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Moritz Barsnick
On Mon, Mar 11, 2019 at 04:17:21 +, Sun, Jing A wrote:
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Carl 
> Eugen Hoyos
> > The condition is unnecessary.
> [SUN, Jing] If av_mallocz fails, free_buffer will be called with in_data 
> being NULL. Checking it avoids unnecessary calling to av_freep in that case.

Please read the kind documentation (and the "Note" quzoted below) or
the source of said function, and how other uses within ffmpeg are:

https://www.ffmpeg.org/doxygen/4.1/group__lavu__mem__funcs.html#ga0cc84043ea2167ad005c86e11d0bcdba

void av_freep (void *ptr)
[...]
Note
*ptr = NULL is safe and leads to no action.

In other words, av_freep() already has this check.

Moritz
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-11 Thread Carl Eugen Hoyos
2019-03-11 5:17 GMT+01:00, Sun, Jing A :

> 2019-03-08 11:36 GMT+01:00, Jing SUN :
>
>> +static void free_buffer(SvtContext *svt_enc) {
>> +EB_H265_ENC_INPUT *in_data =
>> (EB_H265_ENC_INPUT *)svt_enc->in_buf.pBuffer;
>
> Is the cast necessary?
> Or actually: Can't in_data be whatever doesn't produce a warning?
> [SUN, Jing] Yes, it's necessary, because the type of pBuffer is uint8_t* in
> libsvt_hevc.

You could make in_data uint8_t*.

>> +
>> +if (in_data)
>> +av_freep(&in_data);
>
> The condition is unnecessary.
> [SUN, Jing] If av_mallocz fails, free_buffer will be called with in_data
> being NULL. Checking it avoids unnecessary calling to av_freep in that
> case.

Please remove the condition (or the function).

Please fix your quoting, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-10 Thread Sun, Jing A
I just searched my inbox again but failed to find that email of question you 
mentioned.
Could you please elaborate your request? What is the preservation for and how 
is it expected to work?

Regards,
SUN, Jing

From: Vittorio Giovara [mailto:vittorio.giov...@gmail.com]
Sent: Saturday, March 9, 2019 4:48 AM
To: FFmpeg development discussions and patches 
Cc: Sun, Jing A ; Huang, Zhengxu 
; Jun Zhao ; Tmar, Hassene 

Subject: Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper.



On Fri, Mar 8, 2019 at 4:39 AM Jing SUN 
mailto:jing.a@intel.com>> wrote:
From: Jing Sun mailto:jing.a@intel.com>>

base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC

V4: - Fix the build error with new API in PR#52
- Fix the encoding hang issue by API change in PR#52
- Fix the last frame dropping issue
- Fix the invalid parameter causing segmentation fault issue
- Add the support to svt hevc and av1 plugins coexistance
- Add the VMAF optimized mode to "-tune"
- Add the "-hdr" parameter

Apologies if i missed your reply but i think my question was not answered

Is there any way to preserve the color matrix/primary/transfer properties 
during encoding?

Thank you
--
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-10 Thread Sun, Jing A

-Original Message-
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Carl 
Eugen Hoyos
Sent: Saturday, March 9, 2019 5:07 AM
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper.

2019-03-08 11:36 GMT+01:00, Jing SUN :

> +static void free_buffer(SvtContext *svt_enc) {
> +EB_H265_ENC_INPUT *in_data =
> (EB_H265_ENC_INPUT *)svt_enc->in_buf.pBuffer;

Is the cast necessary?
Or actually: Can't in_data be whatever doesn't produce a warning?
[SUN, Jing] Yes, it's necessary, because the type of pBuffer is uint8_t* in 
libsvt_hevc.

> +
> +if (in_data)
> +av_freep(&in_data);

The condition is unnecessary.
[SUN, Jing] If av_mallocz fails, free_buffer will be called with in_data being 
NULL. Checking it avoids unnecessary calling to av_freep in that case.

static void free_buffer(SvtContext *svt_enc)
{
...
if (in_data)
av_freep(&in_data);
}

static int alloc_buffer(EB_H265_ENC_CONFIGURATION *config, SvtContext *svt_enc)
{
...

in_data  = av_mallocz(sizeof(*in_data));
if (!in_data)
goto failed;
   ...

failed:
free_buffer(svt_enc);
...
}
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-08 Thread Carl Eugen Hoyos
2019-03-08 11:36 GMT+01:00, Jing SUN :

> +static void free_buffer(SvtContext *svt_enc)
> +{
> +EB_H265_ENC_INPUT *in_data =
> (EB_H265_ENC_INPUT *)svt_enc->in_buf.pBuffer;

Is the cast necessary?
Or actually: Can't in_data be whatever doesn't produce
a warning?

> +
> +if (in_data)
> +av_freep(&in_data);

The condition is unnecessary.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-08 Thread Vittorio Giovara
On Fri, Mar 8, 2019 at 4:39 AM Jing SUN  wrote:

> From: Jing Sun 
>
> base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC
>
> V4: - Fix the build error with new API in PR#52
> - Fix the encoding hang issue by API change in PR#52
> - Fix the last frame dropping issue
> - Fix the invalid parameter causing segmentation fault issue
> - Add the support to svt hevc and av1 plugins coexistance
> - Add the VMAF optimized mode to "-tune"
> - Add the "-hdr" parameter
>

Apologies if i missed your reply but i think my question was not answered

Is there any way to preserve the color matrix/primary/transfer properties
during encoding?

Thank you
-- 
Vittorio
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v7 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper.

2019-03-08 Thread Jing SUN
From: Jing Sun 

base on patch by Huang, Zhengxu from https://github.com/intel/SVT-HEVC

V4: - Fix the build error with new API in PR#52
- Fix the encoding hang issue by API change in PR#52
- Fix the last frame dropping issue
- Fix the invalid parameter causing segmentation fault issue
- Add the support to svt hevc and av1 plugins coexistance
- Add the VMAF optimized mode to "-tune"
- Add the "-hdr" parameter

V3: - Fix the build error with new API

V2: - Change the config options (didn't need to enable-gpl for BSD+Patent,
  it's can compatible with LGPL2+, thanks Xavier correct this part),
  now just need to "--enable-libsvthevc" option
- Add force_idr option
- Remove default GoP size setting in the wrapper, SVT-HEVC will calc
  the the GoP size internal
- Refine the code as the FFmpeg community's comments
  (https://patchwork.ffmpeg.org/patch/11347/)

V1: - base on patch by Huang, Zhengxu, then refine some code.

Change-Id: If0dcc5044ab9effd6847a8f48797b985d02b0816
Signed-off-by: Huang, Zhengxu 
Signed-off-by: hassene 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
Signed-off-by: Jing SUN 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 528 +++
 4 files changed, 534 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index dcead3a..36bc8c1 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ External library support:
   --enable-libspeexenable Speex de/encoding via libspeex [no]
   --enable-libsrt  enable Haivision SRT protocol via libsrt [no]
   --enable-libssh  enable SFTP protocol via libssh [no]
+  --enable-libsvthevc  enable HEVC encoding via svt [no]
   --enable-libtensorflow   enable TensorFlow as a DNN module backend
for DNN based filters like sr [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
@@ -1784,6 +1785,7 @@ EXTERNAL_LIBRARY_LIST="
 libspeex
 libsrt
 libssh
+libsvthevc
 libtensorflow
 libtesseract
 libtheora
@@ -3173,6 +3175,7 @@ libshine_encoder_select="audio_frame_queue"
 libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
+libsvt_hevc_encoder_deps="libsvthevc"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
@@ -6209,6 +6212,7 @@ enabled libsoxr   && require libsoxr soxr.h 
soxr_create -lsoxr
 enabled libssh&& require_pkg_config libssh libssh libssh/sftp.h 
sftp_init
 enabled libspeex  && require_pkg_config libspeex speex speex/speex.h 
speex_decoder_init
 enabled libsrt&& require_pkg_config libsrt "srt >= 1.3.0" 
srt/srt.h srt_socket
+enabled libsvthevc&& require_pkg_config libsvthevc SvtHevcEnc 
svt-hevc/EbApi.h EbInitHandle
 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h 
TF_Version -ltensorflow
 enabled libtesseract  && require_pkg_config libtesseract tesseract 
tesseract/capi.h TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 15c43a8..c93e545 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -987,6 +987,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)+= libopusenc.o 
libopus.o \
 OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
+OBJS-$(CONFIG_LIBSVT_HEVC_ENCODER)+= libsvt_hevc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b26aeca..e93f66f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -703,6 +703,7 @@ extern AVCodec ff_librsvg_decoder;
 extern AVCodec ff_libshine_encoder;
 extern AVCodec ff_libspeex_encoder;
 extern AVCodec ff_libspeex_decoder;
+extern AVCodec ff_libsvt_hevc_encoder;
 extern AVCodec ff_libtheora_encoder;
 extern AVCodec ff_libtwolame_encoder;
 extern AVCodec ff_libvo_amrwbenc_encoder;
diff --git a/libavcodec/libsvt_hevc.c b/libavcodec/libsvt_hevc.c
new file mode 100644
index 000..de11a19
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,528 @@
+/*
+* Scalable Video Technology for HEVC encoder library plugin
+*
+* Copyright (c) 2018 Intel Corporation
+*
+* This file is part of FFmpeg.
+*
+* FFmpeg is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation; either
+* version 2.1 of the License, or