[FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Guo, Yejun
I tried pkg-config on my local ubuntu16.04 system, the option like
">=1.2" or "<3.2" does not work, we have to use option --atleast-version
and --max-version separately.

Signed-off-by: Guo, Yejun 
---
 configure | 57 ++---
 1 file changed, 30 insertions(+), 27 deletions(-)

diff --git a/configure b/configure
index 3e2a487..e397d19 100755
--- a/configure
+++ b/configure
@@ -6045,10 +6045,13 @@ fi
 
 if ! disabled ffnvcodec; then
 ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h 
ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
-check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" || \
-  check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" 
"$ffnv_hdr_list" "" || \
-  check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" 
"$ffnv_hdr_list" "" || \
-  check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" 
"$ffnv_hdr_list" ""
+check_pkg_config ffnvcodec "ffnvcodec --atleast-version=9.0.18.0" 
"$ffnv_hdr_list" "" || \
+  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.2.15.8" 
"$ffnv_hdr_list" ""  && \
+   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.2.99" 
"$ffnv_hdr_list" "") || \
+  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.1.24.9" 
"$ffnv_hdr_list" ""  && \
+   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.1.99" 
"$ffnv_hdr_list" "") || \
+  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.0.14.9" 
"$ffnv_hdr_list" ""  && \
+   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.0.99" 
"$ffnv_hdr_list" "")
 fi
 
 check_cpp_condition winrt windows.h 
"!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
@@ -6128,8 +6131,8 @@ enabled gmp   && require gmp gmp.h mpz_export 
-lgmp
 enabled gnutls&& require_pkg_config gnutls gnutls gnutls/gnutls.h 
gnutls_global_init
 enabled jni   && { [ $target_os = "android" ] && check_headers 
jni.h && enabled pthreads || die "ERROR: jni not found"; }
 enabled ladspa&& require_headers "ladspa.h dlfcn.h"
-enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
aom/aom_codec.h aom_codec_version
-enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 > 1.0.3" 
"aribb24/aribb24.h" arib_instance_new ||
+enabled libaom&& require_pkg_config libaom "aom 
--atleast-version=1.0.0" aom/aom_codec.h aom_codec_version
+enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 
--atleast-version=1.0.4" "aribb24/aribb24.h" arib_instance_new ||
{ enabled gpl && require_pkg_config libaribb24 
aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
die "ERROR: libaribb24 requires version higher 
than 1.0.3 or --enable-gpl."; }
 enabled lv2   && require_pkg_config lv2 lilv-0 "lilv/lilv.h" 
lilv_world_new
@@ -6142,8 +6145,8 @@ enabled libcelt   && require libcelt celt/celt.h 
celt_decode -lcelt0 &&
die "ERROR: libcelt must be installed and 
version must be >= 0.11.0."; }
 enabled libcaca   && require_pkg_config libcaca caca caca.h 
caca_create_canvas
 enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create 
-lcodec2
-enabled libdav1d  && require_pkg_config libdav1d "dav1d >= 0.1.0" 
"dav1d/dav1d.h" dav1d_version
-enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
davs2.h davs2_decoder_open
+enabled libdav1d  && require_pkg_config libdav1d "dav1d 
--atleast-version=0.1.0" "dav1d/dav1d.h" dav1d_version
+enabled libdavs2  && require_pkg_config libdavs2 "davs2 
--atleast-version=1.6.0" davs2.h davs2_decoder_open
 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
dc1394/dc1394.h dc1394_new
 enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h 
drmGetVersion
 enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac 
"fdk-aac/aacenc_lib.h" aacEncOpen ||
@@ -6162,7 +6165,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
"gsm/gsm.h"; do
done || die "ERROR: libgsm not found"; }
 enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
-lilbc $pthreads_extralibs
 enabled libklvanc && require libklvanc libklvanc/vanc.h 
klvanc_context_create -lklvanc
-enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar >= 0.8.1" 
kvazaar.h kvz_api_get
+enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar 
--atleast-version=0.8.1" kvazaar.h kvz_api_get
 enabled liblensfun&& require_pkg_config liblensfun lensfun lensfun.h 
lf_db_new
 # While it may appear that require is being used as a pkg-config
 # fallback for libmfx, it is actually being used to detect a different
@@ -6186,9 +6189,9 @@ enabled libopencv && { check_headers 
opencv2/core/core_c

Re: [FFmpeg-devel] [PATCH] avformat/hls: fix hls-aes-128 set offset bug

2019-03-04 Thread Liu Steven


> 在 2019年3月4日,下午3:34,lmzeng(曾令明)  写道:
> 
> From 45720887a4466b97dbd63b6cac452e814e20a567 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?lmzeng=28=E6=9B=BE=E4=BB=A4=E6=98=8E=29?=
> 
> Date: Mon, 4 Mar 2019 15:05:45 +0800
> Subject: [PATCH] fix hls-aes-128 set offset bug
> 
> ---
> libavformat/hls.c | 20 +---
> 1 file changed, 13 insertions(+), 7 deletions(-)
> mode change 100644 => 100755 libavformat/hls.c
> 
> diff --git a/libavformat/hls.c b/libavformat/hls.c
> old mode 100644
> new mode 100755
> index 8975a87..fa9b055
> --- a/libavformat/hls.c
> +++ b/libavformat/hls.c
> @@ -1184,17 +1184,16 @@ static int open_input(HLSContext *c, struct playlist 
> *pls, struct segment *seg,
> if (c->http_persistent)
> av_dict_set(&opts, "multiple_requests", "1", 0);
> 
> -if (seg->size >= 0) {
> -/* try to restrict the HTTP request to the part we want
> - * (if this is in fact a HTTP request) */
> -av_dict_set_int(&opts, "offset", seg->url_offset, 0);
> -av_dict_set_int(&opts, "end_offset", seg->url_offset + seg->size, 0);
> -}
> -
> av_log(pls->parent, AV_LOG_VERBOSE, "HLS request for url '%s', offset 
> %"PRId64", playlist %d\n",
>seg->url, seg->url_offset, pls->index);
> 
> if (seg->key_type == KEY_NONE) {
> +if (seg->size >= 0) {
> +/* try to restrict the HTTP request to the part we want
> + * (if this is in fact a HTTP request) */
> +av_dict_set_int(&opts, "offset", seg->url_offset, 0);
> +av_dict_set_int(&opts, "end_offset", seg->url_offset + 
> seg->size, 0);
> +}
> ret = open_url(pls->parent, in, seg->url, c->avio_opts, opts, 
> &is_http);
> } else if (seg->key_type == KEY_AES_128) {
> char iv[33], key[33], url[MAX_URL_SIZE];
> @@ -1224,6 +1223,13 @@ static int open_input(HLSContext *c, struct playlist 
> *pls, struct segment *seg,
> av_dict_set(&opts, "key", key, 0);
> av_dict_set(&opts, "iv", iv, 0);
> 
> +if (seg->size >= 0) {
> +/* try to restrict the HTTP request to the part we want
> + * (if this is in fact a HTTP request) */
> +av_dict_set_int(&opts, "offset", seg->url_offset, 0);
> +av_dict_set_int(&opts, "end_offset", seg->url_offset + 
> seg->size, 0);
> +}
> +

duplicate code with above modify?
> ret = open_url(pls->parent, in, url, c->avio_opts, opts, &is_http);
> if (ret < 0) {
> goto cleanup;
> --
> 2.7.4
> 
> ___
> 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] use the correct option of pkg-config to check version

2019-03-04 Thread Timo Rothenpieler

This seems weird to me, why would there only be an issue on Ubuntu 16.04?
I'd assume that the code in question has been tested quite a bit.

Do you have an example of where and how it fails?



smime.p7s
Description: S/MIME Cryptographic Signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-03-04 Thread Paweł Wegner
On Mon, Mar 4, 2019 at 10:50 AM Paweł Wegner 
wrote:

> ping
>
> On Mon, Feb 25, 2019 at 11:50 AM Paweł Wegner 
> wrote:
>
>> This fixes avformat_query_codec incorrectly returning 0 for
>> mov container and mov_text subtitles.
>>
>> Signed-off-by: Paweł Wegner 
>> ---
>>  libavformat/movenc.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
>> index 77943304b5..8969d5b170 100644
>> --- a/libavformat/movenc.c
>> +++ b/libavformat/movenc.c
>> @@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
>>  .deinit= mov_free,
>>  .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH |
>> AVFMT_TS_NEGATIVE,
>>  .codec_tag = (const AVCodecTag* const []){
>> -ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
>> +ff_codec_movvideo_tags, ff_codec_movaudio_tags,
>> ff_codec_movsubtitle_tags, 0
>>  },
>>  .check_bitstream   = mov_check_bitstream,
>>  .priv_class= &mov_muxer_class,
>> --
>> 2.17.1
>>
>> Sorry for top posted ping.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/movenc: mov: added subtitle codec tags to codec tag list

2019-03-04 Thread Paweł Wegner
ping

On Mon, Feb 25, 2019 at 11:50 AM Paweł Wegner 
wrote:

> This fixes avformat_query_codec incorrectly returning 0 for
> mov container and mov_text subtitles.
>
> Signed-off-by: Paweł Wegner 
> ---
>  libavformat/movenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index 77943304b5..8969d5b170 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -6858,7 +6858,7 @@ AVOutputFormat ff_mov_muxer = {
>  .deinit= mov_free,
>  .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH |
> AVFMT_TS_NEGATIVE,
>  .codec_tag = (const AVCodecTag* const []){
> -ff_codec_movvideo_tags, ff_codec_movaudio_tags, 0
> +ff_codec_movvideo_tags, ff_codec_movaudio_tags,
> ff_codec_movsubtitle_tags, 0
>  },
>  .check_bitstream   = mov_check_bitstream,
>  .priv_class= &mov_muxer_class,
> --
> 2.17.1
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v3 1/2] lavfi/vaapi: Improve support for colour properties

2019-03-04 Thread Song, Ruiling

The patch basically looks good. Some comments inline.
> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Mark Thompson
> Sent: Thursday, February 28, 2019 8:38 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v3 1/2] lavfi/vaapi: Improve support for colour
> properties
> 
> Attempts to pick the set of supported colour properties best matching the
> input.  Output is then set with the same values, except for the colour
> matrix which may change when converting between RGB and YUV.
> ---
> Not much change since the version sent two months ago - rebased, and the
> transpose filter updated to match the others.
> 
> 
>  libavfilter/vaapi_vpp.c| 273 -
>  libavfilter/vaapi_vpp.h|   5 +-
>  libavfilter/vf_deinterlace_vaapi.c |  16 +-
>  libavfilter/vf_misc_vaapi.c|  13 +-
>  libavfilter/vf_procamp_vaapi.c |  13 +-
>  libavfilter/vf_scale_vaapi.c   |  12 +-
>  libavfilter/vf_transpose_vaapi.c   |  15 +-
>  7 files changed, 309 insertions(+), 38 deletions(-)
> 
> diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c
> index c5bbc3b85b..f4ee622a2b 100644
> --- a/libavfilter/vaapi_vpp.c
> +++ b/libavfilter/vaapi_vpp.c
> @@ -234,18 +234,273 @@ fail:
>  return err;
>  }
> 
> -int ff_vaapi_vpp_colour_standard(enum AVColorSpace av_cs)
> +typedef struct VAAPIColourProperties {
> +VAProcColorStandardType va_color_standard;
> +
> +enum AVColorPrimaries color_primaries;
> +enum AVColorTransferCharacteristic color_trc;
> +enum AVColorSpace colorspace;
> +
> +uint8_t va_chroma_sample_location;
> +uint8_t va_color_range;
> +
> +enum AVColorRange color_range;
> +enum AVChromaLocation chroma_sample_location;
> +} VAAPIColourProperties;
> +
> +static const VAAPIColourProperties*
> +vaapi_vpp_find_colour_props(VAProcColorStandardType vacs)
> +{
> +static const VAAPIColourProperties cs_map[] = {

Why using these magic number instead of meaningful enum value?
And two entries added for VAProcColorStandardBT601, seems that only the first 
will be returned?
> +{ VAProcColorStandardBT601,   5,  6,  5 },
> +{ VAProcColorStandardBT601,   6,  6,  6 },
> +{ VAProcColorStandardBT709,   1,  1,  1 },
> +{ VAProcColorStandardBT470M,  4,  4,  4 },
> +{ VAProcColorStandardBT470BG, 5,  5,  5 },
> +{ VAProcColorStandardSMPTE170M,   6,  6,  6 },
> +{ VAProcColorStandardSMPTE240M,   7,  7,  7 },
> +{ VAProcColorStandardGenericFilm, 8,  1,  1 },
> +#if VA_CHECK_VERSION(1, 1, 0)
> +{ VAProcColorStandardSRGB,1, 13,  0 },
> +{ VAProcColorStandardXVYCC601,1, 11,  5 },
> +{ VAProcColorStandardXVYCC709,1, 11,  1 },
> +{ VAProcColorStandardBT2020,  9, 14,  9 },
> +#endif
> +};
> +int i;
> +for (i = 0; i < FF_ARRAY_ELEMS(cs_map); i++) {
> +if (vacs == cs_map[i].va_color_standard)
> +return &cs_map[i];
> +}
> +return NULL;
> +}
> +
> +static void vaapi_vpp_fill_colour_standard(VAAPIColourProperties *props,
> +   VAProcColorStandardType *vacs,
> +   int nb_vacs)
> +{
> +const VAAPIColourProperties *t;
> +int i, k, score, best_score, worst_score;
> +
> +// If the driver supports explicit use of the standard values then just
> +// use them and avoid doing any mapping.  (The driver may not support
> +// some particular code point, but it still has enough information to
> +// make a better fallback choice than we do in that case.)
> +#if VA_CHECK_VERSION(1, 1, 0)
> +for (i = 0; i < nb_vacs; i++) {
> +if (vacs[i] == VAProcColorStandardExplicit) {
> +props->va_color_standard = VAProcColorStandardExplicit;
> +return;
> +}
> +}
> +#endif
> +
> +// Give scores to the possible options and choose the lowest one.
> +// An exact match will score zero and therefore always be chosen, as
> +// will a partial match where all unmatched elements are explicitly
> +// unspecified.  (If all elements are unspecified this will use the
> +// first available value.)  If no options match at all then just
> +// pass "none" to the driver and let it make its own choice.
Here (a*4+b*2+c)  is chosen as the score function, I am not sure whether (a + b 
+ c) is just ok? 

> +best_score = -1;
> +worst_score = 4 * (props->colorspace != AVCOL_SPC_UNSPECIFIED) +
> +  2 * (props->color_trc != AVCOL_TRC_UNSPECIFIED) +
> +  (props->color_primaries != AVCOL_PRI_UNSPECIFIED);
Seems that the outer loop here is just used to re-iterate through nb_vacs to 
find the best match again?
Can we remove the outer-loop-over-k like below?

best_va_standard = VAProcColorStandardNone;
for (i = 0; i < nb_vacs; i++) {
...
...
 

Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread myp...@gmail.com
On Mon, Mar 4, 2019 at 4:06 PM Guo, Yejun  wrote:
>
> I tried pkg-config on my local ubuntu16.04 system, the option like
> ">=1.2" or "<3.2" does not work, we have to use option --atleast-version
> and --max-version separately.
>
> Signed-off-by: Guo, Yejun 
> ---
>  configure | 57 ++---
>  1 file changed, 30 insertions(+), 27 deletions(-)
>
> diff --git a/configure b/configure
> index 3e2a487..e397d19 100755
> --- a/configure
> +++ b/configure
> @@ -6045,10 +6045,13 @@ fi
>
>  if ! disabled ffnvcodec; then
>  ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h 
> ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
> -check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" 
> || \
> -  check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" 
> "$ffnv_hdr_list" "" || \
> -  check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" 
> "$ffnv_hdr_list" "" || \
> -  check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" 
> "$ffnv_hdr_list" ""
> +check_pkg_config ffnvcodec "ffnvcodec --atleast-version=9.0.18.0" 
> "$ffnv_hdr_list" "" || \
> +  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.2.15.8" 
> "$ffnv_hdr_list" ""  && \
> +   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.2.99" 
> "$ffnv_hdr_list" "") || \
> +  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.1.24.9" 
> "$ffnv_hdr_list" ""  && \
> +   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.1.99" 
> "$ffnv_hdr_list" "") || \
> +  (check_pkg_config ffnvcodec "ffnvcodec --atleast-version=8.0.14.9" 
> "$ffnv_hdr_list" ""  && \
> +   check_pkg_config ffnvcodec "ffnvcodec --max-version=8.0.99" 
> "$ffnv_hdr_list" "")
>  fi
>
>  check_cpp_condition winrt windows.h 
> "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
> @@ -6128,8 +6131,8 @@ enabled gmp   && require gmp gmp.h 
> mpz_export -lgmp
>  enabled gnutls&& require_pkg_config gnutls gnutls 
> gnutls/gnutls.h gnutls_global_init
>  enabled jni   && { [ $target_os = "android" ] && check_headers 
> jni.h && enabled pthreads || die "ERROR: jni not found"; }
>  enabled ladspa&& require_headers "ladspa.h dlfcn.h"
> -enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
> aom/aom_codec.h aom_codec_version
> -enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 > 1.0.3" 
> "aribb24/aribb24.h" arib_instance_new ||
> +enabled libaom&& require_pkg_config libaom "aom 
> --atleast-version=1.0.0" aom/aom_codec.h aom_codec_version
> +enabled libaribb24&& { check_pkg_config libaribb24 "aribb24 
> --atleast-version=1.0.4" "aribb24/aribb24.h" arib_instance_new ||
> { enabled gpl && require_pkg_config 
> libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
> die "ERROR: libaribb24 requires version 
> higher than 1.0.3 or --enable-gpl."; }
>  enabled lv2   && require_pkg_config lv2 lilv-0 "lilv/lilv.h" 
> lilv_world_new
> @@ -6142,8 +6145,8 @@ enabled libcelt   && require libcelt 
> celt/celt.h celt_decode -lcelt0 &&
> die "ERROR: libcelt must be installed and 
> version must be >= 0.11.0."; }
>  enabled libcaca   && require_pkg_config libcaca caca caca.h 
> caca_create_canvas
>  enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create 
> -lcodec2
> -enabled libdav1d  && require_pkg_config libdav1d "dav1d >= 0.1.0" 
> "dav1d/dav1d.h" dav1d_version
> -enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
> davs2.h davs2_decoder_open
> +enabled libdav1d  && require_pkg_config libdav1d "dav1d 
> --atleast-version=0.1.0" "dav1d/dav1d.h" dav1d_version
> +enabled libdavs2  && require_pkg_config libdavs2 "davs2 
> --atleast-version=1.6.0" davs2.h davs2_decoder_open
>  enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
> dc1394/dc1394.h dc1394_new
>  enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h 
> drmGetVersion
>  enabled libfdk_aac&& { check_pkg_config libfdk_aac fdk-aac 
> "fdk-aac/aacenc_lib.h" aacEncOpen ||
> @@ -6162,7 +6165,7 @@ enabled libgsm&& { for gsm_hdr in "gsm.h" 
> "gsm/gsm.h"; do
> done || die "ERROR: libgsm not found"; }
>  enabled libilbc   && require libilbc ilbc.h WebRtcIlbcfix_InitDecode 
> -lilbc $pthreads_extralibs
>  enabled libklvanc && require libklvanc libklvanc/vanc.h 
> klvanc_context_create -lklvanc
> -enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar >= 
> 0.8.1" kvazaar.h kvz_api_get
> +enabled libkvazaar&& require_pkg_config libkvazaar "kvazaar 
> --atleast-version=0.8.1" kvazaar.h kvz_api_get
>  enabled liblensfun&& require_pkg_config liblensfun lensfun l

Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Timo Rothenpieler
> Sent: Monday, March 04, 2019 5:43 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to
> check version
> 
> This seems weird to me, why would there only be an issue on Ubuntu 16.04?

I guess it is a common issue, I'm at home and do not have other systems for a 
test.

> I'd assume that the code in question has been tested quite a bit.
> 
> Do you have an example of where and how it fails?

I've built and installed libvpx version 1.8 on my system with following vpx.pc:
$ cat /usr/local/lib/pkgconfig/vpx.pc 
# pkg-config file from libvpx v1.8.0-191-g503cb8e
prefix=/usr/local
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include

Name: vpx
Description: WebM Project VPx codec implementation
Version: 1.8.0
Requires:
Conflicts:
Libs: -L${libdir} -lvpx -lm
Libs.private: -lm -lpthread
Cflags: -I${includedir}


I did the following experiments to say it is an issue for the version check.

yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=1.2
yguo18@yguo18-skl-u1604:/tmp$ echo $?
0
yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=2.3
yguo18@yguo18-skl-u1604:/tmp$ echo $?
0

yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx 
--atleast-version=1.2
yguo18@yguo18-skl-u1604:/tmp$ echo $?
0
yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx 
--atleast-version=2.3
Requested 'vpx >= 2.3' but version of vpx is 1.8.0
yguo18@yguo18-skl-u1604:/tmp$ echo $?
1

yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >= 1.2
Package 1.2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `1.2.pc'
to the PKG_CONFIG_PATH environment variable
No package '1.2' found
yguo18@yguo18-skl-u1604:/tmp$ echo $?
1
yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >= 2.3
Package 2.3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `2.3.pc'
to the PKG_CONFIG_PATH environment variable
No package '2.3' found
yguo18@yguo18-skl-u1604:/tmp$ echo $?
1

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


Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to check version

2019-03-04 Thread Guo, Yejun
sorry for the disturbance, I missed "" in the command line, please ignore this 
patch, thanks.

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Guo, Yejun
> Sent: Monday, March 04, 2019 7:57 PM
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config to
> check version
> 
> 
> 
> > -Original Message-
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> > Of Timo Rothenpieler
> > Sent: Monday, March 04, 2019 5:43 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Subject: Re: [FFmpeg-devel] [PATCH] use the correct option of pkg-config
> to
> > check version
> >
> > This seems weird to me, why would there only be an issue on Ubuntu 16.04?
> 
> I guess it is a common issue, I'm at home and do not have other systems for a
> test.
> 
> > I'd assume that the code in question has been tested quite a bit.
> >
> > Do you have an example of where and how it fails?
> 
> I've built and installed libvpx version 1.8 on my system with following 
> vpx.pc:
> $ cat /usr/local/lib/pkgconfig/vpx.pc
> # pkg-config file from libvpx v1.8.0-191-g503cb8e
> prefix=/usr/local
> exec_prefix=${prefix}
> libdir=${prefix}/lib
> includedir=${prefix}/include
> 
> Name: vpx
> Description: WebM Project VPx codec implementation
> Version: 1.8.0
> Requires:
> Conflicts:
> Libs: -L${libdir} -lvpx -lm
> Libs.private: -lm -lpthread
> Cflags: -I${includedir}
> 
> 
> I did the following experiments to say it is an issue for the version check.
> 
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors
> vpx >=1.2
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 0
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors
> vpx >=2.3
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 0
> 
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx --
> atleast-version=1.2
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 0
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx --
> atleast-version=2.3
> Requested 'vpx >= 2.3' but version of vpx is 1.8.0
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 1
> 
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=
> 1.2
> Package 1.2 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `1.2.pc'
> to the PKG_CONFIG_PATH environment variable
> No package '1.2' found
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 1
> yguo18@yguo18-skl-u1604:/tmp$ pkg-config --exists  --print-errors  vpx >=
> 2.3
> Package 2.3 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `2.3.pc'
> to the PKG_CONFIG_PATH environment variable
> No package '2.3' found
> yguo18@yguo18-skl-u1604:/tmp$ echo $?
> 1
> 
> ___
> 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] avcodec/qtrle : improve decoding speed of 24bpp and 32 bpp

2019-03-04 Thread Martin Vignali
Pushed. Thanks

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


Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9 encoder and decoder

2019-03-04 Thread James Almer
On 3/4/2019 12:40 PM, Guo, Yejun wrote:
> Signed-off-by: Guo, Yejun 
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 3042ab9..3e2a487 100755
> --- a/configure
> +++ b/configure
> @@ -6236,11 +6236,11 @@ enabled libvpx&& {
>  }
>  enabled libvpx_vp9_decoder && {
>  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" 
> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
> -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
>  }
>  enabled libvpx_vp9_encoder && {
>  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" 
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
> -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
>  }
>  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder 
> libvpx_vp9_encoder; then
>  die "libvpx enabled but no supported decoders found"

What do you mean with "Really enable"? We're checking for
vpx_codec_vp9_dx and vpx_codec_vp9_cx because they are symbols that will
allegedly be present only if the relevant module was enabled during
libvpx compilation.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9 encoder and decoder

2019-03-04 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of James Almer
> Sent: Monday, March 04, 2019 8:21 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9
> encoder and decoder
> 
> On 3/4/2019 12:40 PM, Guo, Yejun wrote:
> > Signed-off-by: Guo, Yejun 
> > ---
> >  configure | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 3042ab9..3e2a487 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6236,11 +6236,11 @@ enabled libvpx&& {
> >  }
> >  enabled libvpx_vp9_decoder && {
> >  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0"
> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
> > -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> > +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
> "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
> $libm_extralibs"
> >  }
> >  enabled libvpx_vp9_encoder && {
> >  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0"
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
> > -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> > +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
> "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
> $libm_extralibs"
> >  }
> >  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder
> libvpx_vp8_encoder libvpx_vp9_encoder; then
> >  die "libvpx enabled but no supported decoders found"
> 
> What do you mean with "Really enable"? We're checking for
> vpx_codec_vp9_dx and vpx_codec_vp9_cx because they are symbols that
> will
> allegedly be present only if the relevant module was enabled during
> libvpx compilation.

the check for vpx_codec_vp9_dx/cx will always fail since it requires the build 
option "-lpthread".
(this pthread libvpx issue is another issue and I just sent out a patch for the 
fix, see 
https://groups.google.com/a/webmproject.org/forum/#!topic/codec-devel/JwufiANnwaA)

so I choose the same way as vp8, I guess this is a typo for vp9.

to see the issue, just run configure for ffmpeg and check the decoder/encoder 
outputs.

> ___
> 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] avcodec/proresenc_aw : improve speed by replacing PutBitContext for codeword encoding

2019-03-04 Thread Martin Vignali
Hello,

Test on big endian is welcome.
If it's works, it will avoid to add #if HAVE_BIG_ENDIAN in lot of place, to
separate the old code from the new.

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


Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9 encoder and decoder

2019-03-04 Thread James Almer
On 3/4/2019 9:27 AM, Guo, Yejun wrote:
> 
> 
>> -Original Message-
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
>> Of James Almer
>> Sent: Monday, March 04, 2019 8:21 PM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9
>> encoder and decoder
>>
>> On 3/4/2019 12:40 PM, Guo, Yejun wrote:
>>> Signed-off-by: Guo, Yejun 
>>> ---
>>>  configure | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/configure b/configure
>>> index 3042ab9..3e2a487 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -6236,11 +6236,11 @@ enabled libvpx&& {
>>>  }
>>>  enabled libvpx_vp9_decoder && {
>>>  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0"
>> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
>>> -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
>> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
>>> +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
>> "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
>> $libm_extralibs"
>>>  }
>>>  enabled libvpx_vp9_encoder && {
>>>  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0"
>> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
>>> -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
>> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
>>> +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
>> "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
>> $libm_extralibs"
>>>  }
>>>  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder
>> libvpx_vp8_encoder libvpx_vp9_encoder; then
>>>  die "libvpx enabled but no supported decoders found"
>>
>> What do you mean with "Really enable"? We're checking for
>> vpx_codec_vp9_dx and vpx_codec_vp9_cx because they are symbols that
>> will
>> allegedly be present only if the relevant module was enabled during
>> libvpx compilation.
> 
> the check for vpx_codec_vp9_dx/cx will always fail since it requires the 
> build option "-lpthread".
> (this pthread libvpx issue is another issue and I just sent out a patch for 
> the fix, see 
> https://groups.google.com/a/webmproject.org/forum/#!topic/codec-devel/JwufiANnwaA)

If the issue is a missing -lpthread in the non pkg-config check, then
just add $pthreads_extralibs between -lvpx and $libm_extralibs at the
end of it.

> 
> so I choose the same way as vp8, I guess this is a typo for vp9.

No, it's a typo for vp8, and it should be fixed.

> 
> to see the issue, just run configure for ffmpeg and check the decoder/encoder 
> outputs.

The change you're proposing will allegedly enable vp9 decoder and
encoder regardless of the relevant symbols being present in the library
or not, so it's not acceptable as compiling libavcodec will ultimately
fail if they aren't.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9 encoder and decoder

2019-03-04 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of James Almer
> Sent: Monday, March 04, 2019 8:40 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9
> encoder and decoder
> 
> On 3/4/2019 9:27 AM, Guo, Yejun wrote:
> >
> >
> >> -Original Message-
> >> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> >> Of James Almer
> >> Sent: Monday, March 04, 2019 8:21 PM
> >> To: ffmpeg-devel@ffmpeg.org
> >> Subject: Re: [FFmpeg-devel] [PATCH] configure: really enable libvpx-vp9
> >> encoder and decoder
> >>
> >> On 3/4/2019 12:40 PM, Guo, Yejun wrote:
> >>> Signed-off-by: Guo, Yejun 
> >>> ---
> >>>  configure | 4 ++--
> >>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>
> >>> diff --git a/configure b/configure
> >>> index 3042ab9..3e2a487 100755
> >>> --- a/configure
> >>> +++ b/configure
> >>> @@ -6236,11 +6236,11 @@ enabled libvpx&& {
> >>>  }
> >>>  enabled libvpx_vp9_decoder && {
> >>>  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0"
> >> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
> >>> -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
> >> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
> $libm_extralibs"
> >>> +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h
> vpx/vp8dx.h"
> >> "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
> >> $libm_extralibs"
> >>>  }
> >>>  enabled libvpx_vp9_encoder && {
> >>>  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0"
> >> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
> >>> -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
> >> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
> $libm_extralibs"
> >>> +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
> >> "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx
> >> $libm_extralibs"
> >>>  }
> >>>  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder
> >> libvpx_vp8_encoder libvpx_vp9_encoder; then
> >>>  die "libvpx enabled but no supported decoders found"
> >>
> >> What do you mean with "Really enable"? We're checking for
> >> vpx_codec_vp9_dx and vpx_codec_vp9_cx because they are symbols
> that
> >> will
> >> allegedly be present only if the relevant module was enabled during
> >> libvpx compilation.
> >
> > the check for vpx_codec_vp9_dx/cx will always fail since it requires the
> build option "-lpthread".
> > (this pthread libvpx issue is another issue and I just sent out a patch for 
> > the
> fix, see
> https://groups.google.com/a/webmproject.org/forum/#!topic/codec-
> devel/JwufiANnwaA)
> 
> If the issue is a missing -lpthread in the non pkg-config check, then
> just add $pthreads_extralibs between -lvpx and $libm_extralibs at the
> end of it.
> 
> >
> > so I choose the same way as vp8, I guess this is a typo for vp9.
> 
> No, it's a typo for vp8, and it should be fixed.

sure, no problem. 

I'll fix both the vp8 part and vp9 part.

> 
> >
> > to see the issue, just run configure for ffmpeg and check the
> decoder/encoder outputs.
> 
> The change you're proposing will allegedly enable vp9 decoder and
> encoder regardless of the relevant symbols being present in the library
> or not, so it's not acceptable as compiling libavcodec will ultimately
> fail if they aren't.
> ___
> 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 1/2] configure: enable libvpx-vp9 encoder and decoder

2019-03-04 Thread Guo, Yejun
currently run confingure and there is no "libvpx_vp9" for encoder and
decoder in the output string, while "libvpx_vp8" is there.

Signed-off-by: Guo, Yejun 
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 3042ab9..1c0ba78 100755
--- a/configure
+++ b/configure
@@ -6236,11 +6236,11 @@ enabled libvpx&& {
 }
 enabled libvpx_vp9_decoder && {
 check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h 
vpx/vp8dx.h" vpx_codec_vp9_dx ||
-check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
+check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread"
 }
 enabled libvpx_vp9_encoder && {
 check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h 
vpx/vp8cx.h" vpx_codec_vp9_cx ||
-check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
+check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread"
 }
 if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder 
libvpx_vp9_encoder; then
 die "libvpx enabled but no supported decoders found"
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 2/2] configure: fix typo for libvpx-vp8

2019-03-04 Thread Guo, Yejun
Signed-off-by: Guo, Yejun 
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 1c0ba78..66e0113 100755
--- a/configure
+++ b/configure
@@ -6226,12 +6226,12 @@ enabled libvorbis && require_pkg_config 
libvorbis vorbis vorbis/codec.h
 enabled libvpx&& {
 enabled libvpx_vp8_decoder && {
 check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h 
vpx/vp8dx.h" vpx_codec_vp8_dx ||
-check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
+check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread" ||
 die "ERROR: libvpx decoder version must be >=1.4.0";
 }
 enabled libvpx_vp8_encoder && {
 check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h 
vpx/vp8cx.h" vpx_codec_vp8_cx ||
-check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
+check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread" ||
 die "ERROR: libvpx encoder version must be >=1.4.0";
 }
 enabled libvpx_vp9_decoder && {
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH 1/2] configure: enable libvpx-vp9 encoder and decoder

2019-03-04 Thread James Almer
On 3/4/2019 6:21 PM, Guo, Yejun wrote:
> currently run confingure and there is no "libvpx_vp9" for encoder and
> decoder in the output string, while "libvpx_vp8" is there.

The check is working fine as is on systems without pthreads, so the
commit message is wrong. It should say something like adding missing
pthreads extralibs dependency to it.

> 
> Signed-off-by: Guo, Yejun 
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 3042ab9..1c0ba78 100755
> --- a/configure
> +++ b/configure
> @@ -6236,11 +6236,11 @@ enabled libvpx&& {
>  }
>  enabled libvpx_vp9_decoder && {
>  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" 
> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
> -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread"

$pthreads_extralibs, not -lpthread. the former will be set to the
correct ldflag depending on the host system.

>  }
>  enabled libvpx_vp9_encoder && {
>  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" 
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
> -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread"
>  }
>  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder 
> libvpx_vp9_encoder; then
>  die "libvpx enabled but no supported decoders found"
> 

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


Re: [FFmpeg-devel] [PATCH 2/2] configure: fix typo for libvpx-vp8

2019-03-04 Thread James Almer
On 3/4/2019 6:21 PM, Guo, Yejun wrote:
> Signed-off-by: Guo, Yejun 
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 1c0ba78..66e0113 100755
> --- a/configure
> +++ b/configure
> @@ -6226,12 +6226,12 @@ enabled libvorbis && require_pkg_config 
> libvorbis vorbis vorbis/codec.h
>  enabled libvpx&& {
>  enabled libvpx_vp8_decoder && {
>  check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" 
> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
> -check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
> +check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread" 
> ||

Like i mentioned in the other patch, it should be $pthreads_extralibs.

>  die "ERROR: libvpx decoder version must be >=1.4.0";
>  }
>  enabled libvpx_vp8_encoder && {
>  check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" 
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
> -check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
> +check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -lpthread" 
> ||
>  die "ERROR: libvpx encoder version must be >=1.4.0";
>  }
>  enabled libvpx_vp9_decoder && {
> 

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


Re: [FFmpeg-devel] [PATCH 1/2] configure: enable libvpx-vp9 encoder and decoder

2019-03-04 Thread Guo, Yejun


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of James Almer
> Sent: Monday, March 04, 2019 9:51 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH 1/2] configure: enable libvpx-vp9
> encoder and decoder
> 
> On 3/4/2019 6:21 PM, Guo, Yejun wrote:
> > currently run confingure and there is no "libvpx_vp9" for encoder and
> > decoder in the output string, while "libvpx_vp8" is there.
> 
> The check is working fine as is on systems without pthreads, so the
> commit message is wrong. It should say something like adding missing
> pthreads extralibs dependency to it.

yes, you are right, will fix.

> 
> >
> > Signed-off-by: Guo, Yejun 
> > ---
> >  configure | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 3042ab9..1c0ba78 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6236,11 +6236,11 @@ enabled libvpx&& {
> >  }
> >  enabled libvpx_vp9_decoder && {
> >  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0"
> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
> > -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> > +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h"
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs
> -lpthread"
> 
> $pthreads_extralibs, not -lpthread. the former will be set to the
> correct ldflag depending on the host system.
> 
> >  }
> >  enabled libvpx_vp9_encoder && {
> >  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0"
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
> > -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> > +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h"
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs -
> lpthread"
> >  }
> >  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder
> libvpx_vp8_encoder libvpx_vp9_encoder; then
> >  die "libvpx enabled but no supported decoders found"
> >
> 
> LGTM otherwise.
> ___
> 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 2/2] configure: use vpx_codec_vp8_dx/cx for libvpx-vp8 checking

2019-03-04 Thread Guo, Yejun
Signed-off-by: Guo, Yejun 
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 4c39da1..a5cd279 100755
--- a/configure
+++ b/configure
@@ -6226,12 +6226,12 @@ enabled libvorbis && require_pkg_config 
libvorbis vorbis vorbis/codec.h
 enabled libvpx&& {
 enabled libvpx_vp8_decoder && {
 check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h 
vpx/vp8dx.h" vpx_codec_vp8_dx ||
-check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_dec_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
+check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
$pthreads_extralibs" ||
 die "ERROR: libvpx decoder version must be >=1.4.0";
 }
 enabled libvpx_vp8_encoder && {
 check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h 
vpx/vp8cx.h" vpx_codec_vp8_cx ||
-check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_enc_init_ver VPX_IMG_FMT_HIGHBITDEPTH" -lvpx ||
+check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
$pthreads_extralibs" ||
 die "ERROR: libvpx encoder version must be >=1.4.0";
 }
 enabled libvpx_vp9_decoder && {
-- 
2.7.4

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


[FFmpeg-devel] [PATCH 1/2] configure: add missing pthreads extralibs dependency for libvpx-vp9

2019-03-04 Thread Guo, Yejun
Signed-off-by: Guo, Yejun 
---
 configure | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 3042ab9..4c39da1 100755
--- a/configure
+++ b/configure
@@ -6236,11 +6236,11 @@ enabled libvpx&& {
 }
 enabled libvpx_vp9_decoder && {
 check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h 
vpx/vp8dx.h" vpx_codec_vp9_dx ||
-check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
+check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
"vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
$pthreads_extralibs"
 }
 enabled libvpx_vp9_encoder && {
 check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h 
vpx/vp8cx.h" vpx_codec_vp9_cx ||
-check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
+check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
"vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
$pthreads_extralibs"
 }
 if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder 
libvpx_vp9_encoder; then
 die "libvpx enabled but no supported decoders found"
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH 1/2] configure: add missing pthreads extralibs dependency for libvpx-vp9

2019-03-04 Thread James Almer
On 3/4/2019 7:09 PM, Guo, Yejun wrote:
> Signed-off-by: Guo, Yejun 
> ---
>  configure | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 3042ab9..4c39da1 100755
> --- a/configure
> +++ b/configure
> @@ -6236,11 +6236,11 @@ enabled libvpx&& {
>  }
>  enabled libvpx_vp9_decoder && {
>  check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" 
> "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
> -check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> +check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" 
> "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
> $pthreads_extralibs"
>  }
>  enabled libvpx_vp9_encoder && {
>  check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" 
> "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
> -check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs"
> +check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" 
> "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs 
> $pthreads_extralibs"
>  }
>  if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder 
> libvpx_vp9_encoder; then
>  die "libvpx enabled but no supported decoders found"

Both patches pushed. Thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Added ff_v210_planar_unpack_aligned_avx2

2019-03-04 Thread James Darnley
On 2019-03-03 15:44, Martin Vignali wrote:
> Hello,
> 
> ...
> 
> Not directly related to this patch, but it can be interesting for testing
> purpose to write a checkasm test for the v210 func decoding.
> So it's more easy to check the perf for "each" cpu flags, and be sure, the
> various width cases works as expected.

I can probably do that.  I have one for v210 unpacking in a knock-off
checkasm for another project.

I will look over/review the submitted patch first.




signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/mxfdec: Allow MXF parser to identify the Canon XF-HEVC codec/format for video essence

2019-03-04 Thread Tomas Härdin
sön 2019-03-03 klockan 21:59 -0500 skrev Matthew McKenna:
> Hello ffmpeg-devel:
> 
> Attached is a patch to allow the MXF parser to identify the Canon 
> XF-HEVC codec for video essence.
> 
> This codec/containerization is found in the Canon XF-705 camera that 
> Canon released in 2018.  The camera can encode video using HEVC at 
> either a 110 or 160 Mbps bitrate, and the video is 3840x2160, YCC 4:2:2 
> at 10-bit depth (at a variety of choosable framerates).
> 
> At the moment there is little information published about the 
> containerization of the video, and I am not aware of it being a SMPTE 
> standard or otherwise.  However, by identifying the video as 
> AV_CODEC_ID_HEVC by way of its universal label (UL), ffmpeg can make use 
> of the video.  Bitrate, resolution, color space, framerate, and bit 
> depth all seem to be correctly identified.
> 
> Sample MXF files, as well as their successful conversion thru a patched 
> ffmpeg, are available at 
> http://www.matthewmckenna.com/contrib/ffmpeg/xf-hevc
> 

> +{ {
> 0x06,0x0e,0x2b,0x34,0x04,0x01,0x01,0x0a,0x0e,0x15,0x00,0x04,0x02,0x10
> ,0x00,0x01 }, 14,   AV_CODEC_ID_HEVC, NULL, 15 }, /* Canon XF-
> HEVC */

Got any idea what other ULs there are for this? If not then you should
probably be more strict and pick a matching length of 16 instead of 14.
Especially since you say there is no speficiation for it yet.

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


Re: [FFmpeg-devel] [PATCH] avformat/hls: fix hls-aes-128 set offset bug

2019-03-04 Thread Michael Niedermayer
On Mon, Mar 04, 2019 at 07:34:00AM +, lmzeng(曾令明) wrote:
> From 45720887a4466b97dbd63b6cac452e814e20a567 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?lmzeng=28=E6=9B=BE=E4=BB=A4=E6=98=8E=29?=
>  
> Date: Mon, 4 Mar 2019 15:05:45 +0800
> Subject: [PATCH] fix hls-aes-128 set offset bug
> 
> ---
>  libavformat/hls.c | 20 +---
>  1 file changed, 13 insertions(+), 7 deletions(-)
>  mode change 100644 => 100755 libavformat/hls.c
> 
> diff --git a/libavformat/hls.c b/libavformat/hls.c

> old mode 100644
> new mode 100755

this looks unintended

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Added ff_v210_planar_unpack_aligned_avx2

2019-03-04 Thread James Darnley
On 2019-03-01 18:41, Michael Stoner wrote:
> The AVX2 code leverages VPERMD to process 12 pixels/iteration.  This is my 
> first patch submission so any comments are greatly appreciated.
> 
> -Mike
> 
> Tested on Skylake (Win32 & Win64)
> 1920x1080 input frame
> =
> C code - 440 fps
> SSSE3  - 920 fps
> AVX- 930 fps
> AVX2   - 1040 fps
> 
> Regression tested at 1920x1080, 1280x720, and 352x288

>  .loop:
>  %ifidn %1, unaligned
> -movu   m0, [r0]
> +movu   m0, [r0]; yB v5 yA  u5 y9 v4  y8 u4 y7  v3 y6 
> u3  y5 v2 y4  u2 y3 v1  y2 u1 y1  v0 y0 u0
>  %else
>  mova   m0, [r0]
>  %endif

At first I didn't understand why you do so much seemingly unnecessary
work.  You don't change how the data loaded into register.  After more
in-depth reading I see now that you shuffle data around just so you can
store the data with a single move for each plane.  The chroma is below.

> +%if cpuflag(avx2)
> +vpermd m1, m6, m1  ; 00 v5 v4 v3 00 v2 v1 v0 00 u5 u4 u3 
> 00 u2 u1 u0
> +pshufb m1, m7  ; 00 00 v5 v4 v3 v2 v1 v0 00 00 u5 u4 
> u3 u2 u1 u0
> +movu   [r2+r4], xm1
> +vextracti128 [r3+r4], m1, 1
> +%else
>  movq   [r2+r4], m1
>  movhps [r3+r4], m1
> +%endif

Sounds commendable but I doubt the use of this many more shuffles gets
you much over a naive AVX2 version (where you treat the high half of ymm
like an unroll).

> +; for AVX2 version only
> +v210_luma_permute: dd 0,1,2,4,5,6,7,7
> +v210_chroma_permute: dd 0,1,4,5,2,3,6,7

Are you sure these can't be replaced with vpermq and its immediate
operand?  It really looks like the second could be.  It'll save you a
register.

> -mova   m3, [v210_mult]
> -mova   m4, [v210_mask]
> -mova   m5, [v210_luma_shuf]
> -mova   m6, [v210_chroma_shuf]
> +mova   m3, [v210_luma_shuf]
> +mova   m4, [v210_chroma_shuf1]
> +
> +%if cpuflag(avx2)
> +mova   m5, [v210_luma_permute]  ; VPERMD constant must be in a 
> register
> +mova   m6, [v210_chroma_permute]; VPERMD constant must be in a 
> register
> +mova   m7, [v210_chroma_shuf2]
> +%endif
> +
> +%if ARCH_X86_64
> +mova   m8, [v210_mult]
> +mova   m9, [v210_mask]
> +%endif
> +

It would let you clean this up a bit.

My suggestion is to make the diff minimal by keeping the existing uses
and if you still need more than 8 registers for avx2 then make it
available for x86-64 only.

Compare yours with the one I committed here
https://github.com/Upipe/upipe/blob/master/lib/upipe-v210/v210dec.asm#L45
which is just FFmpeg's cleaned up a little plus avx2.  I'm surprised
it's not already in FFmpeg.

You should do whatever is faster.




signature.asc
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] avcodec/libdav1d: use a custom picture allocator

2019-03-04 Thread James Almer
Replaces the libdav1d internal allocator. It uses an AVBufferPool to reduce the
amount of allocated buffers.
About 5% speed up when decoding 720p or higher streams.

Signed-off-by: James Almer 
---
get_buffer2() can't be used for this decoder, as there's no guarantee the 
buffers
it returns will respect the constrains specified by libdav1d.

 libavcodec/libdav1d.c | 72 ++-
 1 file changed, 65 insertions(+), 7 deletions(-)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 459bbae687..855c27db7f 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -22,6 +22,7 @@
 #include 
 
 #include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
 #include "libavutil/opt.h"
 
 #include "avcodec.h"
@@ -31,12 +32,21 @@
 typedef struct Libdav1dContext {
 AVClass *class;
 Dav1dContext *c;
+AVBufferPool *pool;
+int pool_size;
 
 Dav1dData data;
 int tile_threads;
 int apply_grain;
 } Libdav1dContext;
 
+static const enum AVPixelFormat pix_fmt[][3] = {
+[DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8,   AV_PIX_FMT_GRAY10,
AV_PIX_FMT_GRAY12 },
+[DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, 
AV_PIX_FMT_YUV420P12 },
+[DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, 
AV_PIX_FMT_YUV422P12 },
+[DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, 
AV_PIX_FMT_YUV444P12 },
+};
+
 static void libdav1d_log_callback(void *opaque, const char *fmt, va_list vl)
 {
 AVCodecContext *c = opaque;
@@ -44,6 +54,57 @@ static void libdav1d_log_callback(void *opaque, const char 
*fmt, va_list vl)
 av_vlog(c, AV_LOG_ERROR, fmt, vl);
 }
 
+static int libdav1d_picture_allocator(Dav1dPicture *p, void *cookie) {
+Libdav1dContext *dav1d = cookie;
+enum AVPixelFormat format = pix_fmt[p->p.layout][p->seq_hdr->hbd];
+int ret, linesize[4], h = FFALIGN(p->p.h, 128);
+uint8_t *aligned_ptr, *data[4];
+AVBufferRef *buf;
+
+ret = av_image_fill_arrays(data, linesize, NULL, format, FFALIGN(p->p.w, 
128),
+   h, DAV1D_PICTURE_ALIGNMENT);
+if (ret < 0)
+return ret;
+
+if (ret != dav1d->pool_size) {
+av_buffer_pool_uninit(&dav1d->pool);
+// Use twice the amount of required padding bytes for aligned_ptr 
below.
+dav1d->pool = av_buffer_pool_init(ret + DAV1D_PICTURE_ALIGNMENT * 2, 
NULL);
+if (!dav1d->pool)
+return -ENOMEM;
+dav1d->pool_size = ret;
+}
+buf = av_buffer_pool_get(dav1d->pool);
+if (!buf)
+return -ENOMEM;
+
+// libdav1d requires DAV1D_PICTURE_ALIGNMENT aligned buffers, which 
av_malloc()
+// doesn't guarantee for example when AVX is disabled at configure time.
+// Use the extra DAV1D_PICTURE_ALIGNMENT padding bytes in the buffer to 
align it
+// if required.
+aligned_ptr = (uint8_t *)FFALIGN((uintptr_t)buf->data, 
DAV1D_PICTURE_ALIGNMENT);
+ret = av_image_fill_pointers(data, format, h, aligned_ptr, linesize);
+if (ret < 0) {
+av_buffer_unref(&buf);
+return ret;
+}
+
+p->data[0] = data[0];
+p->data[1] = data[1];
+p->data[2] = data[2];
+p->stride[0] = linesize[0];
+p->stride[1] = linesize[1];
+p->allocator_data = buf;
+
+return 0;
+}
+
+static void libdav1d_picture_release(Dav1dPicture *p, void *cookie) {
+AVBufferRef *buf = p->allocator_data;
+
+av_buffer_unref(&buf);
+}
+
 static av_cold int libdav1d_init(AVCodecContext *c)
 {
 Libdav1dContext *dav1d = c->priv_data;
@@ -55,6 +116,9 @@ static av_cold int libdav1d_init(AVCodecContext *c)
 dav1d_default_settings(&s);
 s.logger.cookie = c;
 s.logger.callback = libdav1d_log_callback;
+s.allocator.cookie = dav1d;
+s.allocator.alloc_picture_callback = libdav1d_picture_allocator;
+s.allocator.release_picture_callback = libdav1d_picture_release;
 s.n_tile_threads = dav1d->tile_threads;
 s.apply_grain = dav1d->apply_grain;
 s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : 
av_cpu_count(), DAV1D_MAX_FRAME_THREADS);
@@ -87,13 +151,6 @@ static void libdav1d_frame_free(void *opaque, uint8_t 
*data) {
 av_free(p);
 }
 
-static const enum AVPixelFormat pix_fmt[][3] = {
-[DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8,   AV_PIX_FMT_GRAY10,
AV_PIX_FMT_GRAY12 },
-[DAV1D_PIXEL_LAYOUT_I420] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10, 
AV_PIX_FMT_YUV420P12 },
-[DAV1D_PIXEL_LAYOUT_I422] = { AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, 
AV_PIX_FMT_YUV422P12 },
-[DAV1D_PIXEL_LAYOUT_I444] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, 
AV_PIX_FMT_YUV444P12 },
-};
-
 static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
 {
 Libdav1dContext *dav1d = c->priv_data;
@@ -222,6 +279,7 @@ static av_cold int libdav1d_close(AVCodecContext *c)
 {
 Libdav1dContext *dav1d = c->priv_data;
 
+av_buffer_pool_uninit(&dav1d->pool);
 da

[FFmpeg-devel] [PATCH 1/2] avcodec/libdav1d: route dav1d internal logs through av_log()

2019-03-04 Thread James Almer
Bump the minimum required version to the first one with the logger API callback.

Signed-off-by: James Almer 
---
 configure | 2 +-
 libavcodec/libdav1d.c | 9 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index dcead3a300..a5cef4bc09 100755
--- a/configure
+++ b/configure
@@ -6142,7 +6142,7 @@ enabled libcelt   && require libcelt celt/celt.h 
celt_decode -lcelt0 &&
die "ERROR: libcelt must be installed and 
version must be >= 0.11.0."; }
 enabled libcaca   && require_pkg_config libcaca caca caca.h 
caca_create_canvas
 enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create 
-lcodec2
-enabled libdav1d  && require_pkg_config libdav1d "dav1d >= 0.1.0" 
"dav1d/dav1d.h" dav1d_version
+enabled libdav1d  && require_pkg_config libdav1d "dav1d >= 0.2.0" 
"dav1d/dav1d.h" dav1d_version
 enabled libdavs2  && require_pkg_config libdavs2 "davs2 >= 1.6.0" 
davs2.h davs2_decoder_open
 enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 
dc1394/dc1394.h dc1394_new
 enabled libdrm&& require_pkg_config libdrm libdrm xf86drm.h 
drmGetVersion
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index ed02da4ebf..459bbae687 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -37,6 +37,13 @@ typedef struct Libdav1dContext {
 int apply_grain;
 } Libdav1dContext;
 
+static void libdav1d_log_callback(void *opaque, const char *fmt, va_list vl)
+{
+AVCodecContext *c = opaque;
+
+av_vlog(c, AV_LOG_ERROR, fmt, vl);
+}
+
 static av_cold int libdav1d_init(AVCodecContext *c)
 {
 Libdav1dContext *dav1d = c->priv_data;
@@ -46,6 +53,8 @@ static av_cold int libdav1d_init(AVCodecContext *c)
 av_log(c, AV_LOG_INFO, "libdav1d %s\n", dav1d_version());
 
 dav1d_default_settings(&s);
+s.logger.cookie = c;
+s.logger.callback = libdav1d_log_callback;
 s.n_tile_threads = dav1d->tile_threads;
 s.apply_grain = dav1d->apply_grain;
 s.n_frame_threads = FFMIN(c->thread_count ? c->thread_count : 
av_cpu_count(), DAV1D_MAX_FRAME_THREADS);
-- 
2.21.0

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


Re: [FFmpeg-devel] avcodec/proresenc_aw : improve speed by replacing PutBitContext for codeword encoding

2019-03-04 Thread Michael Niedermayer
On Tue, Feb 26, 2019 at 04:54:38PM +0100, Martin Vignali wrote:
> Hello,
> 
> Patch in attach, change codeword bits writing
> by replacing PutBitContext, and use instead uint64_t bit_buf
> Also remove byte buffer length check
> 
> encode_codeword func have two version now
> - one for dc coeff and run coeff (same as previous encode_codeword func)
> - one for level coeff who also integrate the "IS_NEGATIVE(val)" bit writing
> 
> encode_codeword func code is reorganize
> in the first part, calculate codeword value and number of bits for this
> value
> at the end, write the codeword in bit_buf, and if bit_buf is full, write it
> in dst buf.
> 
> Pass fate test for me (X86_64 os X)
> also tested, on real samples. Md5 hash of the target file doesn't change
> for me
> 
> Speed improvment on X86_64 :
> test file 1 : 140 -> 154 fps
> test file 2 : 55 -> 62 fps
> 
> Not tested on big endian and X86_32.
> 
> Fate test cmd :
> make fate-vsynth3-prores;make fate-vsynth2-prores;make
> fate-vsynth1-prores;make fate-vsynth_lena-prores SAMPLES=fate-suite/
> 
> Comments welcome
> 
> Martin

>  proresenc_anatoliy.c |  133 
> +--
>  1 file changed, 108 insertions(+), 25 deletions(-)
> a5390e02202e780e4ae88d931af3959f338d447d  
> 0001-avcodec-proresenc_aw-replace-putbitsContext-by-uint6.patch
> From ce7709c6145920a9eeea8618810894d3a7fe99ba Mon Sep 17 00:00:00 2001
> From: Martin Vignali 
> Date: Tue, 26 Feb 2019 16:33:39 +0100
> Subject: [PATCH] avcodec/proresenc_aw : replace putbitsContext by uint64
>  bit_buf
> 

> also remove the target buffer length check

do i understand correctly that there is no check that prevents out of array
writing ?
not even an assert
If thats the case, then i think this is unwise.

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] avcodec/proresenc_aw : improve speed by replacing PutBitContext for codeword encoding

2019-03-04 Thread Michael Niedermayer
On Mon, Mar 04, 2019 at 01:24:27PM +0100, Martin Vignali wrote:
> Hello,
> 
> Test on big endian is welcome.
> If it's works, it will avoid to add #if HAVE_BIG_ENDIAN in lot of place, to
> separate the old code from the new.

it passes fate on qemu mips

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/2] avcodec/v210dec: move DSP function setting into dedicated function

2019-03-04 Thread James Darnley
Prepare for checkasm test.
---
 libavcodec/v210dec.c | 13 +
 libavcodec/v210dec.h |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c
index ddc5dbe8be..28cf00d320 100644
--- a/libavcodec/v210dec.c
+++ b/libavcodec/v210dec.c
@@ -50,6 +50,14 @@ static void v210_planar_unpack_c(const uint32_t *src, 
uint16_t *y, uint16_t *u,
 }
 }
 
+av_cold void ff_v210dec_init(V210DecContext *s)
+{
+s->unpack_frame = v210_planar_unpack_c;
+s->aligned_input = 0;
+if (ARCH_X86)
+ff_v210_x86_init(s);
+}
+
 static av_cold int decode_init(AVCodecContext *avctx)
 {
 V210DecContext *s = avctx->priv_data;
@@ -57,10 +65,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
 avctx->bits_per_raw_sample = 10;
 
-s->unpack_frame= v210_planar_unpack_c;
-
-if (HAVE_MMX)
-ff_v210_x86_init(s);
+ff_v210dec_init(s);
 
 return 0;
 }
diff --git a/libavcodec/v210dec.h b/libavcodec/v210dec.h
index 533afc435c..cfdb29da09 100644
--- a/libavcodec/v210dec.h
+++ b/libavcodec/v210dec.h
@@ -31,6 +31,7 @@ typedef struct {
 void (*unpack_frame)(const uint32_t *src, uint16_t *y, uint16_t *u, 
uint16_t *v, int width);
 } V210DecContext;
 
+void ff_v210dec_init(V210DecContext *s);
 void ff_v210_x86_init(V210DecContext *s);
 
 #endif /* AVCODEC_V210DEC_H */
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 2/2] checkasm: add test for v210dec

2019-03-04 Thread James Darnley
---
 tests/checkasm/Makefile   |  1 +
 tests/checkasm/checkasm.c |  3 ++
 tests/checkasm/checkasm.h |  1 +
 tests/checkasm/v210dec.c  | 76 +++
 4 files changed, 81 insertions(+)
 create mode 100644 tests/checkasm/v210dec.c

diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index 47b7b06d28..70abc1a407 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -25,6 +25,7 @@ AVCODECOBJS-$(CONFIG_JPEG2000_DECODER)  += jpeg2000dsp.o
 AVCODECOBJS-$(CONFIG_PIXBLOCKDSP)   += pixblockdsp.o
 AVCODECOBJS-$(CONFIG_HEVC_DECODER)  += hevc_add_res.o hevc_idct.o 
hevc_sao.o
 AVCODECOBJS-$(CONFIG_UTVIDEO_DECODER)   += utvideodsp.o
+AVCODECOBJS-$(CONFIG_V210_DECODER)  += v210dec.o
 AVCODECOBJS-$(CONFIG_V210_ENCODER)  += v210enc.o
 AVCODECOBJS-$(CONFIG_VP9_DECODER)   += vp9dsp.o
 
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 9eec41e3c4..bf51e00eab 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -136,6 +136,9 @@ static const struct {
 #if CONFIG_UTVIDEO_DECODER
 { "utvideodsp", checkasm_check_utvideodsp },
 #endif
+#if CONFIG_V210_DECODER
+{ "v210dec", checkasm_check_v210dec },
+#endif
 #if CONFIG_V210_ENCODER
 { "v210enc", checkasm_check_v210enc },
 #endif
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 9e8e879fd3..9b8d2f5419 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -69,6 +69,7 @@ void checkasm_check_sbrdsp(void);
 void checkasm_check_synth_filter(void);
 void checkasm_check_sw_rgb(void);
 void checkasm_check_utvideodsp(void);
+void checkasm_check_v210dec(void);
 void checkasm_check_v210enc(void);
 void checkasm_check_vf_hflip(void);
 void checkasm_check_vf_threshold(void);
diff --git a/tests/checkasm/v210dec.c b/tests/checkasm/v210dec.c
new file mode 100644
index 00..7320ed5e37
--- /dev/null
+++ b/tests/checkasm/v210dec.c
@@ -0,0 +1,76 @@
+/*
+ * Copyright (c) 2019 James Darnley
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include 
+#include "checkasm.h"
+#include "libavcodec/v210dec.h"
+
+static uint32_t get_v210(void)
+{
+uint32_t t0 = rnd() & 0x3ff,
+ t1 = rnd() & 0x3ff,
+ t2 = rnd() & 0x3ff;
+uint32_t value =  t0
+   | (t1 << 10)
+   | (t2 << 20);
+return value;
+}
+
+#define NUM_SAMPLES 2048
+
+static void randomize_buffers(uint32_t *src0, uint32_t *src1, int len)
+{
+for (int i = 0; i < len; i++) {
+uint32_t value = get_v210();
+src0[i] = value;
+src1[i] = value;
+}
+}
+
+void checkasm_check_v210dec(void)
+{
+V210DecContext h;
+
+ff_v210dec_init(&h);
+
+if (check_func(h.unpack_frame, "v210_unpack")) {
+uint32_t src0[NUM_SAMPLES/3];
+uint32_t src1[NUM_SAMPLES/3];
+uint16_t y0[NUM_SAMPLES/2];
+uint16_t y1[NUM_SAMPLES/2];
+uint16_t u0[NUM_SAMPLES/4];
+uint16_t u1[NUM_SAMPLES/4];
+uint16_t v0[NUM_SAMPLES/4];
+uint16_t v1[NUM_SAMPLES/4];
+declare_func(void, const uint32_t *src, uint16_t *y, uint16_t *u, 
uint16_t *v, int width);
+const int pixels = NUM_SAMPLES / 2 / 6 * 6;
+
+randomize_buffers(src0, src1, NUM_SAMPLES/3);
+call_ref(src0, y0, u0, v0, pixels);
+call_new(src1, y1, u1, v1, pixels);
+if (memcmp(src0, src1, NUM_SAMPLES/3 * sizeof src0[0])
+|| memcmp(y0, y1, pixels * sizeof y0[0])
+|| memcmp(u0, u1, pixels/2 * sizeof u0[0])
+|| memcmp(v0, v1, pixels/2 * sizeof v0[0]))
+fail();
+bench_new(src1, y1, u1, v1, pixels);
+}
+report("v210_unpack");
+}
-- 
2.20.1

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


Re: [FFmpeg-devel] [PATCH v2 6/6] lavc/qsvdec: Add VP9 decoder support

2019-03-04 Thread Rogozhkin, Dmitry V
On Thu, 2019-02-21 at 14:01 +0800, Li, Zhong wrote:
> > > @@ -90,6 +90,17 @@ static av_cold int
> > > qsv_decode_init(AVCodecContext
> > > *avctx)
> > >  }
> > >  #endif
> > > 
> > > +#if CONFIG_VP9_QSV_DECODER
> > > +if (avctx->codec_id == AV_CODEC_ID_VP9) {
> > > +static const char *uid_vp9dec_hw =
> > > "a922394d8d87452f878c51f2fc9b4131";
> > 
> > Should not be actually needed (and I hope it will work:)). VP9 hw
> > plugin is
> > actually a tiny compatibility stub which redirects everything to
> > the mediasdk
> > library.  Considering that you just add VP9 decoding support you
> > don't need
> > to care about compatibility (I hope). Hence, you can try to just
> > initialize VP9
> > decoder directly from the mediasdk library as you are doing for AVC
> > decoder.
> 
> Good point. But my question is that will it broken for the case "the
> latest ffmpeg + an old version MSDK"?
> Thus means:
> 1. Start from the version for MSDK support VP9 decoding, hw plugin is
> not needed. 
> 2. Or we don't care the compatibility "the latest ffmpeg + an old
> version MSDK", user should update MSDK.
> 
> If it is case 1, I am quite happy to remove vp9 hw plugin code. If it
> is case2, I would say I can't agree. 
> How do you think? 

This patch adds vp9 decoder support to ffmpeg-qsv. This feature was not
actually available previously in ffmpeg-qsv, so there will be versions
of ffmpeg which don't support vp9 decoder in qsv path. And potentially
there could be some versions of mediasdk which won't provide vp9
decoder at all or in a way anticipated by ffmpeg (without plugin if you
will agree to make this change). I don't see a problem here. Instead I
see another problem: will you be able to verify that current patch (to
initialize vp9 decoder via plugin)  actually is capable to work with
the old mediasdk versions? And what will happen if it is not or some
feature won't work because of some bug in this old mediasdk version?
Such a bug either won't be fixed at all or if it will be fixed,
mediasdk update will be required which most probably will simply allow
to work with vp9 decoder without mediasdk plugin.

Thus, I suggest to not complicate things and avoid pursuing
hypothetical compatibility with some old version of mediasdk library.
Mind also, that avoiding plugin path we actually avoid additional
memory allocations, .so loading overhead, etc.

More widely, I would actually suggest to revise existing mediasdk
plugins loading path and change it from loading plugins at the first
place to:
1. Try to initialize component directly from the library
2. If #1 fails, try to initialize component from the plugin
This will allow to avoid a cost of plugins loading when you don't
actually need to load them and will preserve compatibility with the old
versions of mediasdk.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/gdv: Check fps

2019-03-04 Thread Michael Niedermayer
Fixes: Division by 0
Fixes: ffmpeg_zero_division.bin

Found-by: Anatoly Trosinenko 
Signed-off-by: Michael Niedermayer 
---
 libavformat/gdv.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/gdv.c b/libavformat/gdv.c
index a69c349cab..3ead383892 100644
--- a/libavformat/gdv.c
+++ b/libavformat/gdv.c
@@ -86,6 +86,9 @@ static int gdv_read_header(AVFormatContext *ctx)
 vst->nb_frames = avio_rl16(pb);
 
 fps = avio_rl16(pb);
+if (!fps)
+return AVERROR_INVALIDDATA;
+
 snd_flags = avio_rl16(pb);
 if (snd_flags & 1) {
 ast = avformat_new_stream(ctx, 0);
-- 
2.21.0

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


Re: [FFmpeg-devel] [PATCH 4/5] vaapi_encode: Add ROI support

2019-03-04 Thread Mark Thompson
On 28/02/2019 06:33, Guo, Yejun wrote:>> -Original Message-
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
>> Of Mark Thompson
>> Sent: Thursday, February 28, 2019 6:00 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: [FFmpeg-devel] [PATCH 4/5] vaapi_encode: Add ROI support
>>
>> ---
>>  libavcodec/vaapi_encode.c   | 129
>> 
>>  libavcodec/vaapi_encode.h   |   9 +++
>>  libavcodec/vaapi_encode_h264.c  |   2 +
>>  libavcodec/vaapi_encode_h265.c  |   2 +
>>  libavcodec/vaapi_encode_mpeg2.c |   2 +
>>  libavcodec/vaapi_encode_vp8.c   |   2 +
>>  libavcodec/vaapi_encode_vp9.c   |   2 +
>>  7 files changed, 148 insertions(+)
> 
> I tried this patch with below command, but do not see any quality change with 
> my eyes. 
> I debugged in gdb and  found the ROI data are correct in function 
> vaapi_encode_issue.
> 
> I do not investigate deeper, and just want to first confirm if you see the 
> quality change or not. I might did something basic wrong.
> 
> ffmpeg_g -hwaccel vaapi -vaapi_device /dev/dri/renderD128  -s 1920x1080 -i 
> ../video
> /1080P_park_joy_1920x1080_500frames.yuv   -vf format=nv12,hwupload-c:v 
> h264_vaapi  -b:v 3M  -y tmp.264
> (my trick code in vf_scale.c is called with the above command)
> 
> I tried the similar option with libx264 and found obvious video quality 
> changes.

If you are using the i965 driver then you might need 
 to make it work.  The 
iHD driver worked for me with no changes.

In CQP mode with H.264 it's straightforward to verify the output directly, too 
- any stream analyser or other tool which can show the QP on each macroblock 
will make it very obvious, since you will see exactly the offset you set in 
your regions of interest.  (The reference decoder with trace enabled shows it 
as mb_qp_delta as well.)

Thanks,

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


Re: [FFmpeg-devel] [PATCH 2/5] libx264: Update ROI behaviour to match documentation

2019-03-04 Thread Mark Thompson
On 28/02/2019 06:38, Guo, Yejun wrote:
>> -Original Message-
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
>> Of myp...@gmail.com
>> Sent: Thursday, February 28, 2019 11:26 AM
>> To: FFmpeg development discussions and patches > de...@ffmpeg.org>
>> Subject: Re: [FFmpeg-devel] [PATCH 2/5] libx264: Update ROI behaviour to
>> match documentation
>>
>> On Thu, Feb 28, 2019 at 10:53 AM Guo, Yejun  wrote:
 -Original Message-
 From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
>> Behalf
 Of Mark Thompson
 Sent: Thursday, February 28, 2019 6:00 AM
 To: ffmpeg-devel@ffmpeg.org
 Subject: [FFmpeg-devel] [PATCH 2/5] libx264: Update ROI behaviour to
 match documentation

 Fix the quantisation offset - use the whole range, and don't change the
 offset size based on bit depth.

 Use correct bottom/right edge locations (they are offsets from
>> bottom/right,
 not from top/left).

 Iterate the list in reverse order.  The regions are in order of
>> decreasing
 importance, so the most important must be applied last.
 ---
  libavcodec/libx264.c | 50 
  1 file changed, 27 insertions(+), 23 deletions(-)

 diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
 index a3493f393d..475719021e 100644
 --- a/libavcodec/libx264.c
 +++ b/libavcodec/libx264.c
 @@ -285,16 +285,18 @@ static int X264_frame(AVCodecContext *ctx,
 AVPacket *pkt, const AVFrame *frame,
  int nnal, i, ret;
  x264_picture_t pic_out = {0};
  int pict_type;
 +int bit_depth;
  int64_t *out_opaque;
  AVFrameSideData *sd;

  x264_picture_init( &x4->pic );
  x4->pic.img.i_csp   = x4->params.i_csp;
  #if X264_BUILD >= 153
 -if (x4->params.i_bitdepth > 8)
 +bit_depth = x4->params.i_bitdepth;
  #else
 -if (x264_bit_depth > 8)
 +bit_depth = x264_bit_depth;
  #endif
 +if (bit_depth > 8)
  x4->pic.img.i_csp |= X264_CSP_HIGH_DEPTH;
  x4->pic.img.i_plane = avfmt2_num_planes(ctx->pix_fmt);

 @@ -359,45 +361,47 @@ static int X264_frame(AVCodecContext *ctx,
 AVPacket *pkt, const AVFrame *frame,
  if (frame->interlaced_frame == 0) {
  int mbx = (frame->width + MB_SIZE - 1) / MB_SIZE;
  int mby = (frame->height + MB_SIZE - 1) / MB_SIZE;
 +int qp_range = 51 + 6 * (bit_depth - 8);
>>>
>>> just found following from "$ ./x264 --fullhelp", not sure what 81 means
>> here. Shall we change our qoffset formula accordingly?
>>>   --qpminSet min QP [0]
>>>   --qpmaxSet max QP [81]

libx264 applies a fixed offset to the QP range to make it nonnegative (by 
adding QpBdOffsetY).  The maximum of 81 therefore corresponds to a bit depth of 
(81-51)/6+8 = 13 bits, the higher values only being valid at the higher depths.

I guess that's set for a higher depth than libx264 actually supports to avoid 
any future problems with range (e.g. 12-bit support would not be an 
unreasonable feature).

  int nb_rois;
 -AVRegionOfInterest* roi;
 -float* qoffsets;
 +const AVRegionOfInterest *roi;
 +float *qoffsets;
  qoffsets = av_mallocz_array(mbx * mby,
>> sizeof(*qoffsets));
  if (!qoffsets)
  return AVERROR(ENOMEM);

 -nb_rois = sd->size / sizeof(AVRegionOfInterest);
 -roi = (AVRegionOfInterest*)sd->data;
 -for (int count = 0; count < nb_rois; count++) {
 -int starty = FFMIN(mby, roi->top / MB_SIZE);
 -int endy   = FFMIN(mby, (roi->bottom + MB_SIZE
>> - 1)/ MB_SIZE);
 -int startx = FFMIN(mbx, roi->left / MB_SIZE);
 -int endx   = FFMIN(mbx, (roi->right + MB_SIZE
>> - 1)/ MB_SIZE);
 +roi = (const AVRegionOfInterest*)sd->data;
 +if (!roi->self_size || sd->size % roi->self_size
>> != 0) {
 +av_log(ctx, AV_LOG_ERROR, "Invalid
 AVRegionOfInterest.self_size.\n");
 +return AVERROR(EINVAL);
 +}
 +nb_rois = sd->size / roi->self_size;
 +
 +// This list must be iterated in reverse because
>> regions are
 +// defined in order of decreasing importance.
>>>
>>> Nit:   the reason may be more straight forward.
>>> This list must be iterated in reverse because: when overlapping regions
>> are defined, the first region containing a given area of the frame applies.

Right, yes.  I've u

Re: [FFmpeg-devel] [PATCH v3 2/2] vf_scale_vaapi: Add options to configure output colour properties

2019-03-04 Thread Song, Ruiling


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Mark Thompson
> Sent: Thursday, February 28, 2019 8:38 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH v3 2/2] vf_scale_vaapi: Add options to
> configure output colour properties
> 
> The "out_color_matrix" and "out_range" properties match the same options
> in vf_scale; the others attempt to follow the same pattern.
> ---
Looks good.

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


[FFmpeg-devel] [PATCH] avformat/mpegts.c: reduce buffering during initialization

2019-03-04 Thread andriy . gelman
From: Andriy Gelman 

Reduces buffering during estimation of mpegts raw_packet_size
parameter. Instead of buffering a fixed 8192 bytes, calculate
probe scores on a smaller buffer. Increase buffer size until
probe score is greater than minimum value.
---
 libavformat/mpegts.c | 82 +++-
 1 file changed, 59 insertions(+), 23 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b04fd7b4f4..a7b33eae69 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -53,6 +53,10 @@
 (prev_dividend) = (dividend);  
\
 } while (0)
 
+#define MAX_RAW_PACKET_PROBE 8192
+#define PROBE_PACKET_STEP 512
+#define RAW_PACKET_MIN_SCORE 10
+
 enum MpegTSFilterType {
 MPEGTS_PES,
 MPEGTS_SECTION,
@@ -591,28 +595,64 @@ static int analyze(const uint8_t *buf, int size, int 
packet_size,
 return best_score - FFMAX(stat_all - 10*best_score, 0)/10;
 }
 
-/* autodetect fec presence. Must have at least 1024 bytes  */
-static int get_packet_size(const uint8_t *buf, int size)
+/* autodetect fec presence */
+static int get_packet_size(AVIOContext* pb)
 {
 int score, fec_score, dvhs_score;
+int pd_packet_size = TS_PACKET_SIZE;
+int best_score = 0;
+int ret;
 
-if (size < (TS_FEC_PACKET_SIZE * 5 + 1))
-return AVERROR_INVALIDDATA;
+AVProbeData pd = { 0 };
+while (best_score < RAW_PACKET_MIN_SCORE &&
+pd.buf_size + PROBE_PACKET_STEP <= MAX_RAW_PACKET_PROBE) {
+
+/*create extra space for next packet*/
+uint8_t *new_buf = av_realloc(pd.buf, pd.buf_size + PROBE_PACKET_STEP);
+if (new_buf) {
+pd.buf = new_buf;
+ret = avio_read(pb, pd.buf + pd.buf_size, PROBE_PACKET_STEP);
+if (ret < 0) {
+av_log(pb, AV_LOG_ERROR, "Error reading from input: %s.\n",
+   av_err2str(ret));
+break;
+}
+pd.buf_size += ret;
+} else
+goto fail;
+
+/*check score for each fec packet size*/
+score  = analyze(pd.buf, pd.buf_size, TS_PACKET_SIZE,  0);
+if (score > best_score) {
+best_score = score;
+pd_packet_size = TS_PACKET_SIZE;
+}
 
-score  = analyze(buf, size, TS_PACKET_SIZE,  0);
-dvhs_score = analyze(buf, size, TS_DVHS_PACKET_SIZE, 0);
-fec_score  = analyze(buf, size, TS_FEC_PACKET_SIZE,  0);
-av_log(NULL, AV_LOG_TRACE, "score: %d, dvhs_score: %d, fec_score: %d \n",
-score, dvhs_score, fec_score);
-
-if (score > fec_score && score > dvhs_score)
-return TS_PACKET_SIZE;
-else if (dvhs_score > score && dvhs_score > fec_score)
-return TS_DVHS_PACKET_SIZE;
-else if (score < fec_score && dvhs_score < fec_score)
-return TS_FEC_PACKET_SIZE;
-else
-return AVERROR_INVALIDDATA;
+dvhs_score = analyze(pd.buf, pd.buf_size, TS_DVHS_PACKET_SIZE, 0);
+if (dvhs_score > best_score) {
+best_score = dvhs_score;
+pd_packet_size = TS_DVHS_PACKET_SIZE;
+}
+
+fec_score  = analyze(pd.buf, pd.buf_size, TS_FEC_PACKET_SIZE,  0);
+if (fec_score > best_score) {
+best_score = fec_score;
+pd_packet_size = TS_FEC_PACKET_SIZE;
+}
+
+av_log(NULL, AV_LOG_TRACE, "Probe size: %d, score: %d, dvhs_score: %d, 
fec_score: %d \n",
+pd.buf_size, score, dvhs_score, fec_score);
+}
+
+if (pd.buf)
+av_freep(&pd.buf);
+
+return pd_packet_size;
+
+fail:
+if (pd.buf)
+av_freep(&pd.buf);
+return AVERROR(ENOMEM);
 }
 
 typedef struct SectionHeader {
@@ -2841,8 +2881,6 @@ static int mpegts_read_header(AVFormatContext *s)
 {
 MpegTSContext *ts = s->priv_data;
 AVIOContext *pb   = s->pb;
-uint8_t buf[8 * 1024] = {0};
-int len;
 int64_t pos, probesize = s->probesize;
 
 s->internal->prefer_codec_framerate = 1;
@@ -2850,10 +2888,8 @@ static int mpegts_read_header(AVFormatContext *s)
 if (ffio_ensure_seekback(pb, probesize) < 0)
 av_log(s, AV_LOG_WARNING, "Failed to allocate buffers for seekback\n");
 
-/* read the first 8192 bytes to get packet size */
 pos = avio_tell(pb);
-len = avio_read(pb, buf, sizeof(buf));
-ts->raw_packet_size = get_packet_size(buf, len);
+ts->raw_packet_size = get_packet_size(pb);
 if (ts->raw_packet_size <= 0) {
 av_log(s, AV_LOG_WARNING, "Could not detect TS packet size, defaulting 
to non-FEC/DVHS\n");
 ts->raw_packet_size = TS_PACKET_SIZE;
-- 
2.20.1

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


Re: [FFmpeg-devel] [PATCH] avutil/mem: Mark DECLARE_ASM_ALIGNED as visibility("hidden") for __GNUC__

2019-03-04 Thread Fāng-ruì Sòng
On Thu, Feb 21, 2019 at 10:06 AM Fāng-ruì Sòng  wrote:
>
> > Why is it a good idea to remove them from the linker command line?
>
> In short, it improves portability. I'm not suggesting removing
> -Bsymbolic or --version-script from the ffmpeg build system. I mean
> users will no longer have to specify the two options to link ffmpeg
> object files into their own shared objects (AFAIK this patch address
> all C side issues. There are some other problem in *.asm code, though;
> I also saw BROKEN_RELOCATIONS in the code, thinking that it was
> probably added when developers noticed it could bring problems. I
> didn't dig up the history to learn more)
>
> When using a different build system when the relevant SHFLAGS options
> (-Bsymbolic and --version-script) aren't specified, there wouldn't be
> mysterious linker errors "relocation R_X86_64_PC32 cannot be used
> against ...". If the linker options aren't mandatory, ffmpeg can be
> more easily integrated to other projects or build systems.
>
> Or when linking libavcodec/*.o with other object files from the main
> program to form another shared object (not
> libavcodec/libavcodec.so.58). The current limitation (these global
> constants having default visibility) means every shared object linking
> in libavcodec/cabac.o (with the default visibility
> ff_h264_cabac_tables) and libavcodec/x86/constants.o have to use
> either -Bsymbolic, or to construct their own version script.
>
> * -Bsymbolic this option applies to all exported symbols on the linker
> command line, not just ffmpeg object files. This makes symbols
> non-preemptive, and in particular, breaks C++ [dcl.inline], which says
> "A static local variable in an inline function with external linkage
> always refers to the same object." If this option is used, two
> function-local static object may have different addresses.
> * --version-script  libavcodec/libavcodec.ver specifies `global: av_*;
> local: *;` Again, the problem is that it applies to all exported
> symbols (may affect program code). If the program code doesn't want
> all its symbols to be marked local, it'll have to define its own
> version script. This is a hindrance that can be avoided.
>
>
> On Thu, Feb 21, 2019 at 9:37 AM Fāng-ruì Sòng  wrote:
> >
> > Sorry if this doesn't attach to the correct thread as I didn't
> > subscribe to this list and don't know the Message-ID of the thread.
> >
> > > The word "also" indicates here that this should be an independent patch.
> >
> > I added `#if defined(__GNUC__) && !(defined(_WIN32) ||
> > defined(__CYGWIN__))`, not `#if (defined(__GNUC__) ||
> > defined(__clang__)) && !(defined(_WIN32) || defined(__CYGWIN__))`. For
> > consistency I removed the defined(__clang__) below. If that change
> > should be an independent one, here is the amended version without the
> > removal of defined(__clang__)
> >
> >
> > Inline asm code assumes these DECLARE_ASM_ALIGNED declared global
> > constants are non-preemptive, e.g.
> >
> > libavcodec/x86/cabac.h
> > "lea"MANGLE(ff_h264_cabac_tables)", %0  \n\t"
> >
> > On ELF platforms, if -Wl,-Bsymbolic
> > -Wl,--version-script,libavcodec/libavcodec.ver are removed from the
> > linker command line, the symbol will be considered preemptive and fail
> > to link to a DSO:
> >
> > ld.lld: error: relocation R_X86_64_PC32 cannot be used against
> > symbol ff_h264_cabac_tables; recompile with -fPIC
> >
> > It is better to express the intention explicitly and mark such global
> > constants hidden (non-preemptive). It also improves portability as no
> > linker magic is required.
> >
> > DECLARE_ASM_CONST uses the "static" specifier to indicate internal
> > linkage. The visibility annotation is unnecessary.
> >
> > Signed-off-by: Fangrui Song 
> > ---
> >  libavutil/mem.h | 8 +++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavutil/mem.h b/libavutil/mem.h
> > index 5fb1a02dd9..9afeed0b43 100644
> > --- a/libavutil/mem.h
> > +++ b/libavutil/mem.h
> > @@ -100,6 +100,12 @@
> >   * @param v Name of the variable
> >   */
> >
> > +#if defined(__GNUC__) && !(defined(_WIN32) || defined(__CYGWIN__))
> > +#define DECLARE_HIDDEN __attribute__ ((visibility ("hidden")))
> > +#else
> > +#define DECLARE_HIDDEN
> > +#endif
> > +
> >  #if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || 
> > defined(__SUNPRO_C)
> >  #define DECLARE_ALIGNED(n,t,v)  t __attribute__ ((aligned (n))) v
> >  #define DECLARE_ASM_ALIGNED(n,t,v)  t __attribute__ ((aligned (n))) v
> > @@ -110,7 +116,7 @@
> >  #define DECLARE_ASM_CONST(n,t,v)static const t av_used
> > __attribute__ ((aligned (FFMIN(n, 16 v
> >  #elif defined(__GNUC__) || defined(__clang__)
> >  #define DECLARE_ALIGNED(n,t,v)  t __attribute__ ((aligned (n))) v
> > -#define DECLARE_ASM_ALIGNED(n,t,v)  t av_used __attribute__
> > ((aligned (n))) v
> > +#define DECLARE_ASM_ALIGNED(n,t,v)  t av_used __attribute__
> > ((aligned (n))) DECLARE_HIDDEN v
> >

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

2019-03-04 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 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 546 +++
 4 files changed, 552 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..97bd204
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,546 @@
+/*
+* 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 late

[FFmpeg-devel] [PATCH v6 2/2] doc: Add libsvt_hevc encoder docs

2019-03-04 Thread Jing SUN
Add docs for libsvt_hevc encoder in encoders.texi and general.texi

Signed-off-by: Jun Zhao 
Signed-off-by: Huang, Zhengxu 
Signed-off-by: hassene 
Signed-off-by: Jing SUN 
---
 doc/encoders.texi | 161 ++
 doc/general.texi  |   8 +++
 2 files changed, 169 insertions(+)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 29625ba..64ddb2f 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1569,6 +1569,167 @@ Set maximum NAL size in bytes.
 Allow skipping frames to hit the target bitrate if set to 1.
 @end table
 
+@section libsvt_hevc
+
+Scalable Video Technology for HEVC encoder (SVT-HEVC encoder) wrapper.
+
+This encoder requires the presence of the headers and
+library during configuration. You need to explicitly configure the
+build with @code{--enable-libsvthevc}. The library is detected using
+@command{pkg-config}.
+
+For more information about the library see
+@url{https://github.com/intel/SVT-HEVC.git}.
+
+@subsection Options
+
+The following FFmpeg global options affect the configurations of the
+libsvt_hevc encoder.
+
+@table @option
+@item b  (@emph{bitrate})
+Set the bitrate (as a number of bits per second). Default is 7M.
+
+@item refs (@emph{ref})
+Number of reference frames each P-frame can use. The range is from @var{0-16}.
+Default is 0(disabled).
+
+@item g  / @option{gop_size}
+Set the GOP size. Default is 64.
+
+@item flags +cgop
+Enable closed GOP.
+
+@item qmin (@emph{min-q})
+Defaults 10
+
+@item qmax (@emph{max-q})
+Defaults 48
+
+Set minimum/maximum quantisation values.  Valid range is from 0 to 51
+(Only used when bit rate control mode @option{rc} is set to 0(cqp) mode.
+Has to be qmax > = qmin).
+
+@item profile (@emph{profile})
+Set profile restrictions. Can assume one of the following possible values:
+
+Default is 2 (main10).
+
+@table @samp
+@item main
+main profile
+@item main10
+main10 profile
+@end table
+
+@item level
+
+@option{profile} sets the value of @emph{profile_idc} and the 
@emph{constraint_set*_flag}s.
+@option{level} sets the value of @emph{level_idc}.
+
+The encoder also has its own specific options:
+
+@table @option
+@item vui
+Enables or disables the vui structure in the HEVC elementary
+bitstream. 0 = Off, 1 = On. Default is 0 (Off).
+
+@item aud (@emph{aud})
+Enable use of access unit delimiters when set to 1. Default is 0 (Off).
+
+@item hielevel
+Set hierarchical levels. Can assume one of the following possible values:
+
+Default is 3 (4level).
+
+@table @samp
+@item flat
+none hierarchy level
+@item 2level
+2-level hierarchy
+@item 3level
+3-level hierarchy
+@item 4level
+4-level hierarchy
+@end table
+
+@item la_depth
+Set look-ahead depth, depending on bit rate control mode @option{rc}, when
+bit rate control mode is set to vbr it's best to set this parameter to be
+equal to the intra period value (such is the default set by the encoder),
+when cqp is chosen, then a look ahead is recommended. The range is from 
@var{0-256}.
+
+@item intra_ref_type
+Set intra refesh type. Can assume one of the following possible values:
+
+Default is 2 (idr).
+
+@table @samp
+@item cra
+open group of pictures
+@item idr
+closed group of pictures
+@end table
+
+@item preset
+A preset defining the quality vs density tradeoff point that the
+encoding is to be performed at.(e.g. 0 is the highest quality mode,
+12 is the highest density mode). The range is from @var{0-12}. Default is 9.
+
+@item tier
+Set @emph{general_tier_flag}.  This may affect the level chosen for the stream
+if it is not explicitly specified. Can assume one of the following possible 
values:
+
+Default is 1 (main).
+
+@table @samp
+@item main
+main tier
+@item high
+high tier
+@end table
+
+@item rc
+Set bit rate control mode. Can assume one of the following possible values:
+
+Default is 0 (cqp).
+
+@table @samp
+@item cqp
+Constant QP (CQP) mode
+@item vbr
+Variable Bit Rate (VBR) mode
+@end table
+
+@item qp
+Initial quantization parameter for the intra pictures used when
+@option{rc} is cqp mode. The range is from @var{0-51}. Default is 32.
+
+@item sc_detection
+Enables or disables the scene change detection algorithm. Default is 0 
(disable).
+
+@item tune
+Set quality tuning mode. Can assume one of the following possible values:
+
+Default is 1 (oq).
+
+@table @samp
+@item sq
+Visually optimized mode
+@item oq
+PSNR / SSIM optimized mode
+@item vmaf
+VMAF optimized mode
+@end table
+
+@item bl_mode
+Enables or disables Random Access Prediction. Default is 0 (disable).
+@end table
+
+@item hdr
+High dynamic range input. Default is 0 (disable).
+@end table
+
 @section libtheora
 
 libtheora Theora encoder wrapper.
diff --git a/doc/general.texi b/doc/general.texi
index fe94c40..9863e14 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -126,6 +126,14 @@ The dispatcher is open source and can be downloaded from
 with the @code{--enable-libmfx} option and @code{pkg-config} needs to be able 
to
 locate the dispatcher's @code{.pc} fil