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

2019-05-06 Thread Sun, Jing A
-Original Message-
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Carl 
Eugen Hoyos
Sent: Sunday, May 5, 2019 6:48 PM
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper

>You add a new encoder, so you have to raise MINOR in libavcodec/version.h (and 
>reset MICRO).

>Carl Eugen

Hi Carl,

I made the version change and submitted the v11 patches. Please kindly review 
if I am doing it correctly.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-05-05 Thread Carl Eugen Hoyos
Am So., 5. Mai 2019 um 12:10 Uhr schrieb Sun, Jing A :
>
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Carl 
> Eugen Hoyos
> Sent: Friday, April 26, 2019 11:28 PM
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
> encoder wrapper
>
> 2019-04-26 8:41 GMT+02:00, Li, Zhong :
> >> Is it V11 now? (Just saw several V10 and I am a litter confused.)
> >> Since there is some existed software HEVC encoder, how about add a
> >> link to the SVT-HEVC writepaper in the commit message to make other
> >> easily to understand what is the advantage of SVT-HEVC and the benefit
> >> to plugin to FFmpeg?
>
> >Without knowing the white paper, I would prefer not to add a link.
> >Carl Eugen
>
> Thanks for the review!
>
> The whitepaper is not final, and I prefer not to add its link as well. Also 
> it's quite easy to locate
> it in the SVT HEVC GitHub page. Is that OK not to add it?

> For versions, I increased it if big changes were submitted and kept it the 
> same if only minor
> changes. I am new to the community and would you please guide me if that 
> strategy is all
> right or not? If not, I will resubmit the last with v11.

You add a new encoder, so you have to raise MINOR in
libavcodec/version.h (and reset MICRO).

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-05-05 Thread Sun, Jing A
-Original Message-
From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of Carl 
Eugen Hoyos
Sent: Friday, April 26, 2019 11:28 PM
To: FFmpeg development discussions and patches 
Subject: Re: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper

2019-04-26 8:41 GMT+02:00, Li, Zhong :
>> Is it V11 now? (Just saw several V10 and I am a litter confused.)
>> Since there is some existed software HEVC encoder, how about add a 
>> link to the SVT-HEVC writepaper in the commit message to make other 
>> easily to understand what is the advantage of SVT-HEVC and the benefit 
>> to plugin to FFmpeg?

>Without knowing the white paper, I would prefer not to add a link.
>Carl Eugen

Thanks for the review!

The whitepaper is not final, and I prefer not to add its link as well. Also 
it's quite easy to locate it in the SVT HEVC GitHub page. Is that OK not to add 
it?
For versions, I increased it if big changes were submitted and kept it the same 
if only minor changes. I am new to the community and would you please guide me 
if that strategy is all right or not? If not, I will resubmit the last with 
v11. 

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-04-26 Thread Carl Eugen Hoyos
2019-04-26 8:41 GMT+02:00, Li, Zhong :
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
>> Of Jing Sun
>> Sent: Tuesday, April 2, 2019 3:02 PM
>> To: ffmpeg-devel@ffmpeg.org
>> Cc: Sun, Jing A ; Huang, Zhengxu
>> ; Jun Zhao ; Tmar,
>> Hassene 
>> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
>
> Is it V11 now? (Just saw several V10 and I am a litter confused.)
>
>> encoder wrapper
>
> Since there is some existed software HEVC encoder, how about add a link to
> the SVT-HEVC writepaper in the commit message
> to make other easily to understand what is the advantage of SVT-HEVC and the
> benefit to plugin to FFmpeg?

Without knowing the white paper, I would prefer not to add a link.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-04-26 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Jing Sun
> Sent: Tuesday, April 2, 2019 3:02 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu
> ; Jun Zhao ; Tmar,
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc

Is it V11 now? (Just saw several V10 and I am a litter confused.)

> encoder wrapper

Since there is some existed software HEVC encoder, how about add a link to the 
SVT-HEVC writepaper in the commit message
to make other easily to understand what is the advantage of SVT-HEVC and the 
benefit to plugin to FFmpeg?

> Signed-off-by: Zhengxu Huang 
> Signed-off-by: Hassene Tmar 
> Signed-off-by: Jun Zhao 
> Signed-off-by: Jing Sun 
> ---
>  configure|   4 +
>  libavcodec/Makefile  |   1 +
>  libavcodec/allcodecs.c   |   1 +
>  libavcodec/libsvt_hevc.c | 482
> +++
>  4 files changed, 488 insertions(+)
>  create mode 100644 libavcodec/libsvt_hevc.c
> 
> diff --git a/configure b/configure
> index 938ff10..2aabac4 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
> 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..5534389
> --- /dev/null
> +++ b/libavcodec/libsvt_hevc.c
> @@ -0,0 +1,482 @@
> +/*
> +* Scalable Video Technology for HEVC encoder library plugin
> +*
> +* Copyright (c) 2019 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 (at your option) any later version.
> +*
> +* FFmpeg is distributed in the hope that it will be useful,
> +* but WITHOUT ANY WARRANTY; without even the implied warranty of
> +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> GNU
> +* Lesser General Public 

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

2019-04-26 Thread Li, Zhong
> From: Sun, Jing A
> Sent: Tuesday, April 2, 2019 2:02 PM
> To: Li, Zhong ; FFmpeg development discussions and
> patches 
> Cc: Huang, Zhengxu ; Jun Zhao
> ; Tmar, Hassene 
> Subject: RE: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper
> 
> -Original Message-
> From: Li, Zhong
> Sent: Friday, March 29, 2019 6:59 PM
> To: FFmpeg development discussions and patches
> 
> Cc: Sun, Jing A ; Huang, Zhengxu
> ; Jun Zhao ; Tmar,
> Hassene 
> Subject: RE: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper
> 
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> > Of Jing Sun
> > Sent: Friday, March 29, 2019 4:22 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Sun, Jing A ; Huang, Zhengxu
> > ; Jun Zhao ; Tmar,
> > Hassene 
> > Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
> > encoder wrapper
> >
> > Signed-off-by: Zhengxu Huang 
> > Signed-off-by: Hassene Tmar 
> > Signed-off-by: Jun Zhao 
> > Signed-off-by: Jing Sun 
> > ---
> >  configure|   4 +
> >  libavcodec/Makefile  |   1 +
> >  libavcodec/allcodecs.c   |   1 +
> >  libavcodec/libsvt_hevc.c | 500
> > +++
> >  4 files changed, 506 insertions(+)
> >  create mode 100644 libavcodec/libsvt_hevc.c
> >
> > diff --git a/configure b/configure
> > index 938ff10..2aabac4 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
> > 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
> >

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

2019-04-22 Thread Sun, Jing A
-Original Message-
From: Sun, Jing A 
Sent: Monday, April 1, 2019 10:38 AM
To: ffmpeg-devel@ffmpeg.org
Cc: Sun, Jing A ; Huang, Zhengxu 
; Tmar, Hassene ; Jun Zhao 

Subject: [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

Signed-off-by: Zhengxu Huang 
Signed-off-by: Hassene Tmar 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 482 +++
 4 files changed, 488 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index 938ff10..2aabac4 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 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..2ab5323
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,482 @@
+/*
+* 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 (at your option) any later version.
+*
+* FFmpeg is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 
+02110-1301 USA */
+
+#include "EbErrorCodes.h"
+#include "EbTime.h"
+#include "EbApi.h"
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+
+#include "internal.h"
+#include "avcodec.h"
+
+typedef enum eos_status {
+EOS_NOT_REACHED = 0,
+EOS_REACHED,
+

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

2019-04-02 Thread Sun, Jing A
-Original Message-
From: Li, Zhong 
Sent: Friday, March 29, 2019 6:59 PM
To: FFmpeg development discussions and patches 
Cc: Sun, Jing A ; Huang, Zhengxu 
; Jun Zhao ; Tmar, Hassene 

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

> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf 
> Of Jing Sun
> Sent: Friday, March 29, 2019 4:22 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu 
> ; Jun Zhao ; Tmar, 
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
> encoder wrapper
> 
> Signed-off-by: Zhengxu Huang 
> Signed-off-by: Hassene Tmar 
> Signed-off-by: Jun Zhao 
> Signed-off-by: Jing Sun 
> ---
>  configure|   4 +
>  libavcodec/Makefile  |   1 +
>  libavcodec/allcodecs.c   |   1 +
>  libavcodec/libsvt_hevc.c | 500
> +++
>  4 files changed, 506 insertions(+)
>  create mode 100644 libavcodec/libsvt_hevc.c
> 
> diff --git a/configure b/configure
> index 938ff10..2aabac4 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
> 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..4ef06a8
> --- /dev/null
> +++ b/libavcodec/libsvt_hevc.c
> @@ -0,0 +1,500 @@
> +/*
> +* Scalable Video Technology for HEVC encoder library plugin
> +*
> +* Copyright (c) 2018 Intel Corporation

It is 2019 now.

[Jing] To be modified.

> +* This file is part of FFmpeg.
&

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

2019-04-02 Thread Jing Sun
Signed-off-by: Zhengxu Huang 
Signed-off-by: Hassene Tmar 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 482 +++
 4 files changed, 488 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index 938ff10..2aabac4 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 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..5534389
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,482 @@
+/*
+* Scalable Video Technology for HEVC encoder library plugin
+*
+* Copyright (c) 2019 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 (at your option) any later version.
+*
+* FFmpeg is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "EbErrorCodes.h"
+#include "EbTime.h"
+#include "EbApi.h"
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+
+#include "internal.h"
+#include "avcodec.h"
+
+typedef enum eos_status {
+EOS_NOT_REACHED = 0,
+EOS_REACHED,
+EOS_TOTRIGGER
+}EOS_STATUS;
+
+typedef struct SvtContext {
+AVClass *class;
+
+EB_H265_ENC_CONFIGURATION enc_params;
+EB_COMPONENTTYPE *svt_handle;
+EB_BUFFERHEADERTYPE in_buf;
+EOS_STATUS eos_flag;
+
+// User options.
+int 

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

2019-03-31 Thread Sun, Jing A

-Original Message-
From: Li, Zhong 
Sent: Monday, April 1, 2019 1:21 PM
To: FFmpeg development discussions and patches 
Cc: Sun, Jing A ; Huang, Zhengxu 
; Jun Zhao ; Tmar, Hassene 

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

> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf 
> Of Jing Sun
> Sent: Monday, April 1, 2019 10:38 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu 
> ; Jun Zhao ; Tmar, 
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
> encoder wrapper

>I haven't seen any of my comments was addressed. 

Thanks for your valuable comments! I am working on them.

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-03-31 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Jing Sun
> Sent: Monday, April 1, 2019 10:38 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu
> ; Jun Zhao ; Tmar,
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper

I haven't seen any of my comments was addressed. 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-03-31 Thread Sun, Jing A
The one made the below change:

- if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10LE) {
+if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10) {

No special handling for 10 bit anymore.

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

To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with 
subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-03-31 Thread Sun, Jing A
The one made the below change:

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-03-31 Thread Jing Sun
Signed-off-by: Zhengxu Huang 
Signed-off-by: Hassene Tmar 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 482 +++
 4 files changed, 488 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index 938ff10..2aabac4 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 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..2ab5323
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,482 @@
+/*
+* 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 (at your option) any later version.
+*
+* FFmpeg is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "EbErrorCodes.h"
+#include "EbTime.h"
+#include "EbApi.h"
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+
+#include "internal.h"
+#include "avcodec.h"
+
+typedef enum eos_status {
+EOS_NOT_REACHED = 0,
+EOS_REACHED,
+EOS_TOTRIGGER
+}EOS_STATUS;
+
+typedef struct SvtContext {
+AVClass *class;
+
+EB_H265_ENC_CONFIGURATION enc_params;
+EB_COMPONENTTYPE *svt_handle;
+EB_BUFFERHEADERTYPE in_buf;
+EOS_STATUS eos_flag;
+
+// User options.
+int 

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

2019-03-31 Thread Sun, Jing A
On Fri, Mar 29, 2019 at 5:28 AM Jing Sun  wrote:
+static int config_enc_params(EB_H265_ENC_CONFIGURATION *param,
+                             AVCodecContext *avctx)
+{
+    SvtContext *svt_enc = avctx->priv_data;
+    int ret;
+
+    param->sourceWidth = avctx->width;
+    param->sourceHeight = avctx->height;
+    param->encoderBitDepth = 8;
+
+    if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10LE) {
+        av_log(avctx, AV_LOG_DEBUG, "Encoder 10 bits depth input\n");
+
+        param->encoderBitDepth = 10;
+    }
+    param->encoderColorFormat = EB_YUV420;

>this patch blatantly ignores my review(s) and therefore it is rejected

>to reiterate:
>- if the encoder does not support 10 bit (or if scales down from 10 to 8 
>internally), this feature should not be present in the wrapper either (or it 
>should at least warn the user)

>- if the encoder does not support setting the color properties in the VUI, the 
>wrapper should definitely warn the user of the loss of information (or we 
>should wait until this features is present upstream)

>reagrds
>-- 
>Vittorio

--
So what is happening in this case? The encoder is slower because it converts 
from 10 to 8 bit internally? And then the output encode is 8 bit right now? If 
that is the case, I'd rather have this functionality removed since the 
conversion can happen directly within ffmpeg. Having the conversion performed 
by the encoder is guaranteed to be slower and less precise, and if the output 
is not 10 bit it is very surprising too.

At the same time the comment in the code is useless because users will never 
read something buried deep in the code, I'd suggest printing something at the 
warning level so that it will be shown during the conversion (and please have 
it proofread by a native English-speaking person).
-

You said that functionality should be removed and the comment in the code is 
useless, so I removed it. The 10 bit works fine this way, no need to warn the 
users.


--
nit: excessive whitespace alignment
-- 
I have corrected the whitespace.


--
Where is the warning that notifies the lack of color properties support?
--
I was with you, so added the warning in v9, then I removed the hdr/vui 
interfaces entirely in v10, after I saw mark's review. I think you are right, 
that the SVT-HEVC's implementation of hdr/vui is not a complete one , hence the 
removal. And I have explained the removal in the former reply: to add hdr back 
once the feature is fully supported in SVT-HEVC.


--
IMO these options help text could be improved. 
--
I have improved it in v9/v10. 
+{ "aud", "Include Access Unit Delimiter", OFFSET(aud),
+  AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-03-29 Thread Vittorio Giovara
On Fri, Mar 29, 2019 at 5:28 AM Jing Sun  wrote:

> +static int config_enc_params(EB_H265_ENC_CONFIGURATION *param,
> + AVCodecContext *avctx)
> +{
> +SvtContext *svt_enc = avctx->priv_data;
> +int ret;
> +
> +param->sourceWidth = avctx->width;
> +param->sourceHeight = avctx->height;
> +param->encoderBitDepth = 8;
> +
> +if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10LE) {
> +av_log(avctx, AV_LOG_DEBUG, "Encoder 10 bits depth input\n");
> +
> +param->encoderBitDepth = 10;
> +}
> +param->encoderColorFormat = EB_YUV420;
>
>
this patch blatantly ignores my review(s) and therefore it is rejected

to reiterate:
- if the encoder does not support 10 bit (or if scales down from 10 to 8
internally), this feature should not be present in the wrapper either (or
it should at least warn the user)
- if the encoder does not support setting the color properties in the VUI,
the wrapper should definitely warn the user of the loss of information (or
we should wait until this features is present upstream)

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

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

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

2019-03-29 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Jing Sun
> Sent: Friday, March 29, 2019 4:22 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu
> ; Jun Zhao ; Tmar,
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper
> 
> Signed-off-by: Zhengxu Huang 
> Signed-off-by: Hassene Tmar 
> Signed-off-by: Jun Zhao 
> Signed-off-by: Jing Sun 
> ---
>  configure|   4 +
>  libavcodec/Makefile  |   1 +
>  libavcodec/allcodecs.c   |   1 +
>  libavcodec/libsvt_hevc.c | 500
> +++
>  4 files changed, 506 insertions(+)
>  create mode 100644 libavcodec/libsvt_hevc.c
> 
> diff --git a/configure b/configure
> index 938ff10..2aabac4 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
> 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..4ef06a8
> --- /dev/null
> +++ b/libavcodec/libsvt_hevc.c
> @@ -0,0 +1,500 @@
> +/*
> +* Scalable Video Technology for HEVC encoder library plugin
> +*
> +* Copyright (c) 2018 Intel Corporation

It is 2019 now.

> +* 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 (at your option) any later version.
> +*
> +* FFmpeg is dist

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

2019-03-29 Thread Jing Sun
Signed-off-by: Zhengxu Huang 
Signed-off-by: Hassene Tmar 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 482 +++
 4 files changed, 488 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index 938ff10..2aabac4 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 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..59c6758
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,482 @@
+/*
+* 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 (at your option) any later version.
+*
+* FFmpeg is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "EbErrorCodes.h"
+#include "EbTime.h"
+#include "EbApi.h"
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+
+#include "internal.h"
+#include "avcodec.h"
+
+typedef enum eos_status {
+EOS_NOT_REACHED = 0,
+EOS_REACHED,
+EOS_TOTRIGGER
+}EOS_STATUS;
+
+typedef struct SvtContext {
+AVClass *class;
+
+EB_H265_ENC_CONFIGURATION enc_params;
+EB_COMPONENTTYPE *svt_handle;
+EB_BUFFERHEADERTYPE in_buf;
+EOS_STATUS eos_flag;
+
+// User options.
+int 

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

2019-03-29 Thread Jing Sun
Signed-off-by: Zhengxu Huang 
Signed-off-by: Hassene Tmar 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 500 +++
 4 files changed, 506 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index 938ff10..2aabac4 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 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..4ef06a8
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,500 @@
+/*
+* 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 (at your option) any later version.
+*
+* FFmpeg is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "EbErrorCodes.h"
+#include "EbTime.h"
+#include "EbApi.h"
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+
+#include "internal.h"
+#include "avcodec.h"
+
+typedef enum eos_status {
+EOS_NOT_REACHED = 0,
+EOS_REACHED,
+EOS_TOTRIGGER
+}EOS_STATUS;
+
+typedef struct SvtContext {
+AVClass *class;
+
+EB_H265_ENC_CONFIGURATION enc_params;
+EB_COMPONENTTYPE *svt_handle;
+EB_BUFFERHEADERTYPE in_buf;
+EOS_STATUS eos_flag;
+
+// User options.
+int vui_info;
+