Re: [FFmpeg-devel] [PATCH V2] avfilter: Add tonemap vaapi filter

2018-12-28 Thread Zhou, Zachary


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Michael Niedermayer
> Sent: Thursday, December 27, 2018 9:06 PM
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH V2] avfilter: Add tonemap vaapi filter
> 
> On Thu, Dec 27, 2018 at 04:55:17PM +0800, Zachary Zhou wrote:
> > It supports ICL platform.
> > H2H (HDR to HDR): P010 -> RGB10
> > H2S (HDR to SDR): P010 -> RGB8
> >
> > libva commit for HDR10
> >
> https://github.com/intel/libva/commit/cf11abe5e1b9c93ee75cf974076957162
> c1605b9
> >
> > Signed-off-by: Zachary Zhou 
> > ---
> >  configure  |   2 +
> >  libavfilter/Makefile   |   1 +
> >  libavfilter/allfilters.c   |   1 +
> >  libavfilter/vaapi_vpp.c|  29 ++
> >  libavfilter/vaapi_vpp.h|   8 +
> >  libavfilter/vf_tonemap_vaapi.c | 542
> +
> >  libavutil/hwcontext_vaapi.c|   1 +
> >  7 files changed, 584 insertions(+)
> >  create mode 100644 libavfilter/vf_tonemap_vaapi.c
> 
> breaks build
> CClibavutil/hwcontext_vaapi.o
> src/libavutil/hwcontext_vaapi.c:127:19: error: use of undeclared identifier
> 'VA_RT_FORMAT_RGB32_10'
> { 0x41424752, VA_RT_FORMAT_RGB32_10, AV_PIX_FMT_GBRP10LE, 0, },
>   ^
> src/libavutil/hwcontext_vaapi.c:143:28: error: invalid application of 
> 'sizeof' to
> an incomplete type 'const VAAPIFormatDescriptor []'
> for (i = 0; i < (sizeof(vaapi_format_map) / 
> sizeof((vaapi_format_map)[0]));
> i++)
>^~
> src/libavutil/hwcontext_vaapi.c:153:28: error: invalid application of 
> 'sizeof' to
> an incomplete type 'const VAAPIFormatDescriptor []'
> for (i = 0; i < (sizeof(vaapi_format_map) / 
> sizeof((vaapi_format_map)[0]));
> i++)
>^~
> 3 errors generated.
> make: *** [libavutil/hwcontext_vaapi.o] Error 1
> make: Target `all' not remade because of errors.
> 

Thanks Michael for the check, I am fixing the issue with -

+#ifdef VA_RT_FORMAT_RGB32_10
 MAP(RGBA, RGB32_10, GBRP10, 0),
+#endif

I will resend the patch soon.

-Zach

> 
> 
> [...]
> --
> Michael GnuPG fingerprint:
> 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH V2] avfilter: Add tonemap vaapi filter

2018-12-28 Thread Zhou, Zachary


> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
> Moritz Barsnick
> Sent: Thursday, December 27, 2018 8:47 PM
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH V2] avfilter: Add tonemap vaapi filter
> 
> On Thu, Dec 27, 2018 at 16:55:17 +0800, Zachary Zhou wrote:
> > +typedef enum {
> > +HDR_VAAPI_H2H,
> > +HDR_VAAPI_H2S,
> > +} HDRType;
> 
> > +static const AVOption tonemap_vaapi_options[] = {
> > +{ "type","hdr type",OFFSET(hdr_type), AV_OPT_TYPE_INT, 
> > { .i64
> = HDR_VAAPI_H2H }, 0, 2, FLAGS, "type" },
> > +{ "h2h", "vaapi P010 to RGB10", 0, AV_OPT_TYPE_CONST,
> {.i64=HDR_VAAPI_H2H}, INT_MIN, INT_MAX, FLAGS, "type" },
> > +{ "h2s", "vaapi P010 to RGB8",  0, AV_OPT_TYPE_CONST,
> > +{.i64=HDR_VAAPI_H2S}, INT_MIN, INT_MAX, FLAGS, "type" },
> 
> Is it intentional that specifying 2 is possible, but not documented? (I see
> there's code handling it as switch/case/default or
> if/else_if/else.)
> 
> By the way, did someone mention a required change to doc/filters.texi?

Thanks Moritz for the comments, I got it.
I am adding document to doc/filters.texi, I will resend the patch soon.
-Zach

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


Re: [FFmpeg-devel] Install from Source on CentOS 7

2018-12-28 Thread Moritz Barsnick
On Thu, Dec 27, 2018 at 22:38:24 -0800, Larry Apolonio wrote:
> ERROR: x265 not found using pkg-config
[...]
> pkg-config --exists --print-errors x265
> Package x265 was not found in the pkg-config search path.
> Perhaps you should add the directory containing `x265.pc'
> to the PKG_CONFIG_PATH environment variable

After x265's "sudo make install", is x265.pc located where your other
pkgconfig files are located?

Perhaps you need to
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

in case pkgconfig is not searching that path by default.
(Assuming "make install" installed to /usr/local.)

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


Re: [FFmpeg-devel] patch for failing on WavPack DSD files

2018-12-28 Thread Paul B Mahol
On 12/24/18, Derek Buitenhuis  wrote:
> On 24/12/2018 17:47, David Bryant wrote:
>> I want to do that, but am swamped at work right now, so it will probably
>> be a few months before I can get to that.
>>
>> In the meantime, I think this patch would be a safe stopgap (and prevent
>> the Kodi crash).
>
> I think it's OK for the meantime (my opinion).

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


[FFmpeg-devel] Plans to support HLS-compatible AES-CBCS for MP4

2018-12-28 Thread Toby Steele
Hi There,

 

Looking at current MP4 encryption support, using the 'ffmpeg -h muxer=mp4'
command, I can see that only AES-CTR mode is supported. 

 

I was wondering whether there are plans to support AES-CBCS mode encryption
as well? This is needed to support CENC-compatible encrypted HLS content
using the fragmented MP4 container format, and so would be a very useful
addition.

 

Thanks in advance

 

Toby

 

 

 

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


Re: [FFmpeg-devel] [PATCH V4 1/2] avutil: add ROI data struct and bump version

2018-12-28 Thread Derek Buitenhuis
On 28/12/2018 10:09, Guo, Yejun wrote:
> The encoders such as libx264 support different QPs offset for different MBs,
> it makes possible for ROI-based encoding. It makes sense to add support
> within ffmpeg to generate/accept ROI infos and pass into encoders.
> 
> Typical usage: After AVFrame is decoded, a ffmpeg filter or user's code
> generates ROI info for that frame, and the encoder finally does the
> ROI-based encoding.
> 
> The ROI info is maintained as side data of AVFrame.
> 
> Signed-off-by: Guo, Yejun 
> ---
>  libavutil/frame.c   |  1 +
>  libavutil/frame.h   | 23 +++
>  libavutil/version.h |  2 +-
>  3 files changed, 25 insertions(+), 1 deletion(-)

Seems OK, I think.

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


Re: [FFmpeg-devel] [PATCH V4 2/2] avcodec/libx264: add support for ROI-based encoding

2018-12-28 Thread Derek Buitenhuis
On 28/12/2018 10:10, Guo, Yejun wrote:
> This patch just enables the path from ffmpeg to libx264,
> the more encoders can be added later.
> 
> Signed-off-by: Guo, Yejun 
> ---
>  libavcodec/libx264.c | 39 +++
>  1 file changed, 39 insertions(+)

Seems OK.

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


Re: [FFmpeg-devel] [PATCH v2] mov: Remove duration-of-last-frame heuristic hack

2018-12-28 Thread Derek Buitenhuis
On 24/12/2018 19:55, Derek Buitenhuis wrote:
> This breaks totally valid files that get caught in its heuristic.
> 
> This, according to the commit message, is my own doing, having asked
> Michael to implement this check and providing a sample that was
> "wrong". I am now atoning for my sins, and removing this hack, having
> seen the light (aka that this was silly to do in the first place).
> 
> Resotores correct behavior on valid files.
> 
> This reverts commit 8e5e84c2a2a21a979b48e80c5a8dd44754ab3f21.
> 
> Signed-off-by: Derek Buitenhuis 
> ---
> v1 had accidentally removed a cast. Woops.
>  libavformat/mov.c | 6 --
>  1 file changed, 6 deletions(-)

Ping.

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


Re: [FFmpeg-devel] Install from Source on CentOS 7

2018-12-28 Thread Larry Apolonio

On 12/28/2018 3:09 AM, Moritz Barsnick wrote:

On Thu, Dec 27, 2018 at 22:38:24 -0800, Larry Apolonio wrote:

ERROR: x265 not found using pkg-config

[...]

pkg-config --exists --print-errors x265
Package x265 was not found in the pkg-config search path.
Perhaps you should add the directory containing `x265.pc'
to the PKG_CONFIG_PATH environment variable

After x265's "sudo make install", is x265.pc located where your other
pkgconfig files are located?

Perhaps you need to
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

in case pkgconfig is not searching that path by default.
(Assuming "make install" installed to /usr/local.)

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


I checked /usr/local/lib/pkgconfig and the x265.pc packages is there as 
well as the others.


# ls -l /usr/local/lib/pkgconfig
total 52
-rw-r--r-- 1 root root 426 Dec 26 23:52 libavcodec.pc
-rw-r--r-- 1 root root 459 Dec 26 23:52 libavdevice.pc
-rw-r--r-- 1 root root 449 Dec 26 23:52 libavfilter.pc
-rw-r--r-- 1 root root 366 Dec 26 23:52 libavformat.pc
-rw-r--r-- 1 root root 285 Dec 26 23:52 libavutil.pc
-rw-r--r-- 1 root root 308 Dec 26 23:52 libpostproc.pc
-rw-r--r-- 1 root root 313 Dec 26 23:52 libswresample.pc
-rw-r--r-- 1 root root 306 Dec 26 23:52 libswscale.pc
-rw-r--r-- 1 root root 246 Dec 26 22:46 opencore-amrnb.pc
-rw-r--r-- 1 root root 255 Dec 26 22:46 opencore-amrwb.pc
-rw-r--r-- 1 root root 260 Dec 27 11:25 vo-amrwbenc.pc
-rw-r--r-- 1 root root 278 Dec 26 23:10 x264.pc
*-rw-r--r-- 1 root root 244 Dec 27 12:00 x265.pc*


I ran the following commands and they did not produce any error

$ pkg-config --exists --print-errors x265
$ pkg-config --exists --print-errors x264
$ pkg-config --exists --print-errors opencore-amrwb

and the PKG_CONFIG_PATH is set.

$ echo $PKG_CONFIG_PATH
/usr/local/lib/pkgconfig/

LA

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


Re: [FFmpeg-devel] Install from Source on CentOS 7

2018-12-28 Thread Derek Buitenhuis
On 28/12/2018 16:21, Larry Apolonio wrote:
> [...]

You'd need to post your whole config.log (pastebin) likely.

However, this list is for development of FFmpeg itself, and this
question should be on the user mailing list, or #ffmpeg on FreeNode,
where you'll likely get better answers.

Cheers,
- Derek

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


Re: [FFmpeg-devel] [PATCH 1/3] avcodec/rangecoder: factorize termination version code

2018-12-28 Thread Michael Niedermayer
On Sun, Dec 23, 2018 at 04:05:12PM +0100, Michael Niedermayer wrote:
> On Wed, Dec 19, 2018 at 10:35:25AM +0100, Jerome Martinez wrote:
> > On 19/12/2018 02:40, Michael Niedermayer wrote:
> > >Signed-off-by: Michael Niedermayer 
> > >---
> > >  libavcodec/ffv1enc.c  | 10 +++---
> > >  libavcodec/rangecoder.c   |  4 +++-
> > >  libavcodec/rangecoder.h   |  2 +-
> > >  libavcodec/snowenc.c  |  2 +-
> > >  libavcodec/sonic.c|  2 +-
> > >  libavcodec/tests/rangecoder.c |  2 +-
> > >  6 files changed, 10 insertions(+), 12 deletions(-)
> > >
> > >diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
> > >index f5eb0feb4e..796d81f7c6 100644
> > >--- a/libavcodec/ffv1enc.c
> > >+++ b/libavcodec/ffv1enc.c
> > >@@ -449,7 +449,7 @@ static int write_extradata(FFV1Context *f)
> > >  put_symbol(c, state, f->intra = (f->avctx->gop_size < 2), 0);
> > >  }
> > >-f->avctx->extradata_size = ff_rac_terminate(c);
> > >+f->avctx->extradata_size = ff_rac_terminate(c, 0);
> > >  v = av_crc(av_crc_get_table(AV_CRC_32_IEEE), 0, f->avctx->extradata, 
> > > f->avctx->extradata_size);
> > >  AV_WL32(f->avctx->extradata + f->avctx->extradata_size, v);
> > >  f->avctx->extradata_size += 4;
> > >@@ -1065,9 +1065,7 @@ retry:
> > >  encode_slice_header(f, fs);
> > >  }
> > >  if (fs->ac == AC_GOLOMB_RICE) {
> > >-if (f->version > 2)
> > >-put_rac(&fs->c, (uint8_t[]) { 129 }, 0);
> > >-fs->ac_byte_count = f->version > 2 || (!x && !y) ? 
> > >ff_rac_terminate(&fs->c) : 0;
> > >+fs->ac_byte_count = f->version > 2 || (!x && !y) ? 
> > >ff_rac_terminate(&fs->c, f->version > 2) : 0;
> > 
> > Moving the "129" stuff from FFV1 encoder code to rangecoder encoding part is
> > good for factorization, but there is no more mirroring of FFV1 encoding and
> > FFV1 decoding in that case ("129" stuff is still present in FFV1 decoder
> > code, not rangecoder decoding part), IMO this makes the FFV1 code more
> > difficult to understand.
> > 
> > Isn't it possible to have the same kind of modification for the decoding
> > part?
> 
> The encoder side factors 2 different termination procedures. If you need
> version 1 there you need version 1 you cannot use version 0 in its place.
> The decoder has to deal with buggy input and the kind of termination needed
> depends on where the termination is done it is not 1:1 bound to the bitstream
> version.
> The encoder OTOH does not produce the buggy variants so it does not have
> anything symmetric for that.
> 
> There are also 3 places where termination happens, each is different
> even if one disregards the old bug.
> One place also needs further investigation to understand the implications
> for the bitstream compatibility in case its changed.
> 
> So while i can factor the decoder side in a way similar to the encoder
> this will still not make the code look more similar.
> 
> So i suggest to apply this patchset as it is.
> I do have some patches locally that mess with the decoder side of the related
> code but the code does not become simpler even thhough it does get checked a
> bit more fully. So this is not really what you asked for IIUC

Will apply this patchset soon unless there are objections

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


Re: [FFmpeg-devel] Plans to support HLS-compatible AES-CBCS for MP4

2018-12-28 Thread Derek Buitenhuis
On 28/12/2018 15:39, Toby Steele wrote:
> I was wondering whether there are plans to support AES-CBCS mode encryption
> as well? This is needed to support CENC-compatible encrypted HLS content
> using the fragmented MP4 container format, and so would be a very useful
> addition.

I'm not aware of anyone working on it, but patches are more than welcome!

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


Re: [FFmpeg-devel] [PATCH] fixed luma quantizing when q >= MAX_STORED_Q

2018-12-28 Thread Derek Buitenhuis
On 27/12/2018 19:28, Alex Mogurenko wrote:
> ---
>  libavcodec/proresenc_kostya.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

Can you give a little more detail about what's changed and why,
in the commit message?

It looks like custom_chroma_q is zero initialized and never set to anything?

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


Re: [FFmpeg-devel] [PATCH 1/3] avutil/imgutils: Optimize writing 4 bytes in memset_bytes()

2018-12-28 Thread Michael Niedermayer
On Wed, Dec 26, 2018 at 10:16:47PM +0100, Marton Balint wrote:
> 
> 
> On Wed, 26 Dec 2018, Paul B Mahol wrote:
> 
> >On 12/26/18, Michael Niedermayer  wrote:
> >>On Wed, Dec 26, 2018 at 04:32:17PM +0100, Paul B Mahol wrote:
> >>>On 12/25/18, Michael Niedermayer  wrote:
>  Fixes: Timeout
>  Fixes:
>  11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
>  Before: Executed
>  clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
>  in 11294 ms
>  After : Executed
>  clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
>  in 4249 ms
> 
>  Found-by: continuous fuzzing process
>  https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
>  Signed-off-by: Michael Niedermayer 
>  ---
>   libavutil/imgutils.c | 6 ++
>   1 file changed, 6 insertions(+)
> 
>  diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
>  index 4938a7ef67..cc38f1e878 100644
>  --- a/libavutil/imgutils.c
>  +++ b/libavutil/imgutils.c
>  @@ -529,6 +529,12 @@ static void memset_bytes(uint8_t *dst, size_t
>  dst_size,
>  uint8_t *clear,
>   }
>   } else if (clear_size == 4) {
>   uint32_t val = AV_RN32(clear);
>  +uint64_t val8 = val * 0x10001ULL;
>  +for (; dst_size >= 32; dst_size -= 32) {
>  +AV_WN64(dst   , val8); AV_WN64(dst+ 8, val8);
>  +AV_WN64(dst+16, val8); AV_WN64(dst+24, val8);
>  +dst += 32;
>  +}
>   for (; dst_size >= 4; dst_size -= 4) {
>   AV_WN32(dst, val);
>   dst += 4;
>  --
>  2.20.1
> 
> >>>
> >>>NAK, implement special memset function instead.
> >>
> >>I can move the added loop into a seperate function, if thats what you
> >>suggest ?
> >
> >No, don't do that.
> >
> >>All the code is already in a "special" memset though, this is
> >>memset_bytes()
> >>
> >
> >I guess function is less useful if its static. So any duplicate should
> >be avoided in codebase.
> 
> Isn't av_memcpy_backptr does almost exactly what is needed here? That can
> also be optimized further if needed.

av_memcpy_backptr() copies data with overlap, its more like a recursive
memmove(). 

thx
[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH] fixed luma quantizing when q >= MAX_STORED_Q

2018-12-28 Thread Alex Mogurenko
problem occurs in slice quant estimation and slice encoding.

if slice quant >= MAX_STORED_Q we dont use pre-calculated quant matrices
but generate new:

qmat = ctx->custom_q;

qmat_chroma = ctx->custom_q;

for (i = 0; i < 64; i++) {

qmat[i] = ctx->quant_mat[i] * quant;

qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;

}


as you see both qmat and qmat_chroma both point to same ctx -> custom_q

as result they will contain chroma qunatizers as


qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;


last in loop, after all we pass qmat/qmat_chroma to function where we
estimate encoded slice size or encode slice:

estimate_slice_plane / encode_slice_plane


I will make new patch with detailed description


пт, 28 дек. 2018 г. в 18:43, Derek Buitenhuis :

> On 27/12/2018 19:28, Alex Mogurenko wrote:
> > ---
> >  libavcodec/proresenc_kostya.c | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
>
> Can you give a little more detail about what's changed and why,
> in the commit message?
>
> It looks like custom_chroma_q is zero initialized and never set to
> anything?
>
> - Derek
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fixed luma quantizing when q >= MAX_STORED_Q

2018-12-28 Thread Derek Buitenhuis
On 28/12/2018 17:04, Alex Mogurenko wrote:
> problem occurs in slice quant estimation and slice encoding.
> 
> if slice quant >= MAX_STORED_Q we dont use pre-calculated quant matrices
> but generate new:
> 
> qmat = ctx->custom_q;
> 
> qmat_chroma = ctx->custom_q;
> 
> for (i = 0; i < 64; i++) {
> 
> qmat[i] = ctx->quant_mat[i] * quant;
> 
> qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;
> 
> }
> 
> 
> as you see both qmat and qmat_chroma both point to same ctx -> custom_q
> 
> as result they will contain chroma qunatizers as
> 
> 
> qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;
> 
> 
> last in loop, after all we pass qmat/qmat_chroma to function where we
> estimate encoded slice size or encode slice:
> 
> estimate_slice_plane / encode_slice_plane
> 
> 
> I will make new patch with detailed description
> 

Thanks, this makes sense, I missed that the fact it was setting it in the loop.

- Derek

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


Re: [FFmpeg-devel] Install from Source on CentOS 7

2018-12-28 Thread Larry Apolonio

Thanks Derek, I will repost my question on the users list as well as in IRC

The pastebin is here though

https://pastebin.com/Vq8GFaui


On 12/28/2018 8:30 AM, Derek Buitenhuis wrote:

On 28/12/2018 16:21, Larry Apolonio wrote:

[...]

You'd need to post your whole config.log (pastebin) likely.

However, this list is for development of FFmpeg itself, and this
question should be on the user mailing list, or #ffmpeg on FreeNode,
where you'll likely get better answers.

Cheers,
- Derek

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

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


[FFmpeg-devel] possible bug

2018-12-28 Thread Bogárdi Mátyás
Hello, I have got this warning in StaxRip: "encoder : Lavc58.35.100 flac
[dca @ 023cd4738e40] 10 XLL channels is not implemented. Update your FFmpeg 
version to the newest one from Git. If the problem still occurs, it means that 
your file has a feature which has not been implemented.
[dca @ 023cd4738e40] If you want to help, upload a sample of this file to 
ftp://upload.ffmpeg.org/incoming/ and contact the ffmpeg-devel mailing list. 
(ffmpeg-devel@ffmpeg.org)
[dca @ 023cd4738e40] Read past end of XLL band data" Please let me know if 
I should ignore this message or not. Thank you for the help. Regards, bagitman
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] avutil/imgutils: Optimize writing 4 bytes in memset_bytes()

2018-12-28 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
Before: Executed 
clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 
in 11294 ms
After : Executed 
clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 
in 4249 ms

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavutil/imgutils.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 229c289c11..2d23079578 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -525,6 +525,12 @@ void av_memset_bytes(uint8_t *dst, size_t dst_size, 
uint8_t *clear,
 }
 } else if (clear_size == 4) {
 uint32_t val = AV_RN32(clear);
+uint64_t val8 = val * 0x10001ULL;
+for (; dst_size >= 32; dst_size -= 32) {
+AV_WN64(dst   , val8); AV_WN64(dst+ 8, val8);
+AV_WN64(dst+16, val8); AV_WN64(dst+24, val8);
+dst += 32;
+}
 for (; dst_size >= 4; dst_size -= 4) {
 AV_WN32(dst, val);
 dst += 4;
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 1/2] avutil: export av_memset_bytes()

2018-12-28 Thread Michael Niedermayer
This function is useful in more cases than just imgutils

Signed-off-by: Michael Niedermayer 
---
 doc/APIchanges   |  3 +++
 libavutil/imgutils.c |  8 ++--
 libavutil/imgutils.h | 10 ++
 3 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 5889fb246b..08cd0804b9 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+201x-xx-xx - xx - lavu 56.xx.xxx - imgutils.h
+  Add av_memset_bytes()
+
 2018-12-21 - 2744d6b364 - lavu 56.25.100 - hdr_dynamic_metadata.h
   Add AV_FRAME_DATA_DYNAMIC_HDR_PLUS enum value, av_dynamic_hdr_plus_alloc(),
   av_dynamic_hdr_plus_create_side_data() functions, and related structs.
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 4938a7ef67..229c289c11 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -494,11 +494,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size,
 return size;
 }
 
-// Fill dst[0..dst_size] with the bytes in clear[0..clear_size]. The clear
-// bytes are repeated until dst_size is reached. If dst_size is unaligned (i.e.
-// dst_size%clear_size!=0), the remaining data will be filled with the 
beginning
-// of the clear data only.
-static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear,
+void av_memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear,
  size_t clear_size)
 {
 size_t pos = 0;
@@ -653,7 +649,7 @@ int av_image_fill_black(uint8_t *dst_data[4], const 
ptrdiff_t dst_linesize[4],
 int plane_h = ((height + ( 1 << chroma_div) - 1)) >> chroma_div;
 
 for (; plane_h > 0; plane_h--) {
-memset_bytes(data, bytewidth, &clear_block[plane][0], 
clear_block_size[plane]);
+av_memset_bytes(data, bytewidth, &clear_block[plane][0], 
clear_block_size[plane]);
 data += dst_linesize[plane];
 }
 }
diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index 5b790ecf0a..2f0f4b9106 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -269,6 +269,16 @@ int av_image_fill_black(uint8_t *dst_data[4], const 
ptrdiff_t dst_linesize[4],
 enum AVPixelFormat pix_fmt, enum AVColorRange range,
 int width, int height);
 
+/**
+ * Fill dst[0..dst_size] with the bytes in clear[0..clear_size]. The clear
+ * bytes are repeated until dst_size is reached. If dst_size is unaligned (i.e.
+ * dst_size%clear_size!=0), the remaining data will be filled with the 
beginning
+ * of the clear data only.
+ */
+void av_memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear,
+ size_t clear_size);
+
+
 /**
  * @}
  */
-- 
2.20.1

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


Re: [FFmpeg-devel] [PATCH 2/2] avutil/imgutils: Optimize writing 4 bytes in memset_bytes()

2018-12-28 Thread Michael Niedermayer
On Fri, Dec 28, 2018 at 08:26:58PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 
> 11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
> Before: Executed 
> clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
>  in 11294 ms
> After : Executed 
> clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
>  in 4249 ms
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavutil/imgutils.c | 6 ++
>  1 file changed, 6 insertions(+)

disregard this, ill send a better one

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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


[FFmpeg-devel] [PATCH] avcodec/prores_ks: fixed luma quantize if q >= MAX_STORED_Q

2018-12-28 Thread Alex Mogurenko
problem occurs in slice quant estimation and slice encoding.
if slice quant >= MAX_STORED_Q we dont use pre-calculated quant matrices but 
generate new:

qmat = ctx->custom_q;
qmat_chroma = ctx->custom_q;

 for (i = 0; i < 64; i++) {
qmat[i] = ctx->quant_mat[i] * quant;
qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;
}

as you see qmat and qmat_chroma both point to same ctx->custom_q

result it will contain chroma qunatizers as
qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;

last in the loop, after all we pass qmat/qmat_chroma to function where we
estimate encoded slice size or encode slice:
estimate_slice_plane / encode_slice_plane

custom_chroma_q  was added same way as custom_q e.g to encoder context I would 
prefer to have it on stack thought
---
 libavcodec/proresenc_kostya.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c
index 9a77d24fb6..e045a972f1 100644
--- a/libavcodec/proresenc_kostya.c
+++ b/libavcodec/proresenc_kostya.c
@@ -222,6 +222,7 @@ typedef struct ProresThreadData {
 DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * 
MAX_MBS_PER_SLICE];
 DECLARE_ALIGNED(16, uint16_t, emu_buf)[16 * 16];
 int16_t custom_q[64];
+int16_t custom_chroma_q[64];
 struct TrellisNode *nodes;
 } ProresThreadData;
 
@@ -232,6 +233,7 @@ typedef struct ProresContext {
 int16_t quants[MAX_STORED_Q][64];
 int16_t quants_chroma[MAX_STORED_Q][64];
 int16_t custom_q[64];
+int16_t custom_chroma_q[64];
 const uint8_t *quant_mat;
 const uint8_t *quant_chroma_mat;
 const uint8_t *scantable;
@@ -574,7 +576,7 @@ static int encode_slice(AVCodecContext *avctx, const 
AVFrame *pic,
 qmat_chroma = ctx->quants_chroma[quant];
 } else {
 qmat = ctx->custom_q;
-qmat_chroma = ctx->custom_q;
+qmat_chroma = ctx->custom_chroma_q;
 for (i = 0; i < 64; i++) {
 qmat[i] = ctx->quant_mat[i] * quant;
 qmat_chroma[i] = ctx->quant_chroma_mat[i] * quant;
@@ -902,7 +904,7 @@ static int find_slice_quant(AVCodecContext *avctx,
 qmat_chroma = ctx->quants_chroma[q];
 } else {
 qmat = td->custom_q;
-qmat_chroma = td->custom_q;
+qmat_chroma = td->custom_chroma_q;
 for (i = 0; i < 64; i++) {
 qmat[i] = ctx->quant_mat[i] * q;
 qmat_chroma[i] = ctx->quant_chroma_mat[i] * q;
-- 
2.19.0

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


[FFmpeg-devel] [PATCH 4/6] avutil/imgutils: Optimize writing 4 bytes in memset_bytes()

2018-12-28 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
11502/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920
Before: Executed 
clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 
in 11294 ms
After : Executed 
clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WCMV_fuzzer-5664893810769920 
in 4249 ms

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavutil/imgutils.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 4938a7ef67..6c0d3950de 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -529,6 +529,14 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, 
uint8_t *clear,
 }
 } else if (clear_size == 4) {
 uint32_t val = AV_RN32(clear);
+#if HAVE_FAST_64BIT
+uint64_t val8 = val * 0x10001ULL;
+for (; dst_size >= 32; dst_size -= 32) {
+AV_WN64(dst   , val8); AV_WN64(dst+ 8, val8);
+AV_WN64(dst+16, val8); AV_WN64(dst+24, val8);
+dst += 32;
+}
+#endif
 for (; dst_size >= 4; dst_size -= 4) {
 AV_WN32(dst, val);
 dst += 4;
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 3/6] avcodec/qsvenc: Fix Unkown typo

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 70772dc0e2..56a3756357 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1346,7 +1346,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q,
 pict_type = AV_PICTURE_TYPE_B;
 else if (bs->FrameType == MFX_FRAMETYPE_UNKNOWN) {
 pict_type = AV_PICTURE_TYPE_NONE;
-av_log(avctx, AV_LOG_WARNING, "Unkown FrameType, set pict_type to 
AV_PICTURE_TYPE_NONE.\n");
+av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set pict_type to 
AV_PICTURE_TYPE_NONE.\n");
 } else {
 av_log(avctx, AV_LOG_ERROR, "Invalid FrameType:%d.\n", 
bs->FrameType);
 return AVERROR_INVALIDDATA;
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 5/6] avcodec/mjpegbdec: Fix some misplaced {} and spaces

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/mjpegbdec.c | 24 +---
 1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index a858707d54..8583fcb4f9 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -70,8 +70,7 @@ read_header:
 
 skip_bits(&hgb, 32); /* reserved zeros */
 
-if (get_bits_long(&hgb, 32) != MKBETAG('m','j','p','g'))
-{
+if (get_bits_long(&hgb, 32) != MKBETAG('m','j','p','g')) {
 av_log(avctx, AV_LOG_WARNING, "not mjpeg-b (bad fourcc)\n");
 return AVERROR_INVALIDDATA;
 }
@@ -85,19 +84,17 @@ read_header:
 
 dqt_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dqt is %d and size 
is %d\n");
 av_log(avctx, AV_LOG_DEBUG, "dqt offs: 0x%"PRIx32"\n", dqt_offs);
-if (dqt_offs)
-{
+if (dqt_offs) {
 init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - 
(buf_ptr+dqt_offs))*8);
 s->start_code = DQT;
 if (ff_mjpeg_decode_dqt(s) < 0 &&
 (avctx->err_recognition & AV_EF_EXPLODE))
-  return AVERROR_INVALIDDATA;
+return AVERROR_INVALIDDATA;
 }
 
 dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size 
is %d\n");
 av_log(avctx, AV_LOG_DEBUG, "dht offs: 0x%"PRIx32"\n", dht_offs);
-if (dht_offs)
-{
+if (dht_offs) {
 init_get_bits(&s->gb, buf_ptr+dht_offs, (buf_end - 
(buf_ptr+dht_offs))*8);
 s->start_code = DHT;
 ff_mjpeg_decode_dht(s);
@@ -105,8 +102,7 @@ read_header:
 
 sof_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size 
is %d\n");
 av_log(avctx, AV_LOG_DEBUG, "sof offs: 0x%"PRIx32"\n", sof_offs);
-if (sof_offs)
-{
+if (sof_offs) {
 init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - 
(buf_ptr+sof_offs))*8);
 s->start_code = SOF0;
 if (ff_mjpeg_decode_sof(s) < 0)
@@ -117,25 +113,23 @@ read_header:
 av_log(avctx, AV_LOG_DEBUG, "sos offs: 0x%"PRIx32"\n", sos_offs);
 sod_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sof is %d and size 
is %d\n");
 av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%"PRIx32"\n", sod_offs);
-if (sos_offs)
-{
+if (sos_offs) {
 init_get_bits(&s->gb, buf_ptr + sos_offs,
   8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs));
 s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
 s->start_code = SOS;
 if (ff_mjpeg_decode_sos(s, NULL, 0, NULL) < 0 &&
 (avctx->err_recognition & AV_EF_EXPLODE))
-  return AVERROR_INVALIDDATA;
+return AVERROR_INVALIDDATA;
 }
 
 if (s->interlaced) {
 s->bottom_field ^= 1;
 /* if not bottom field, do not output image yet */
-if (s->bottom_field != s->interlace_polarity && second_field_offs)
-{
+if (s->bottom_field != s->interlace_polarity && second_field_offs) {
 buf_ptr = buf + second_field_offs;
 goto read_header;
-}
+}
 }
 
 //XXX FIXME factorize, this looks very similar to the EOI code
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 6/6] avcodec/mjpegbdec: Propagate error codes

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/mjpegbdec.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c
index 8583fcb4f9..37d7bb8228 100644
--- a/libavcodec/mjpegbdec.c
+++ b/libavcodec/mjpegbdec.c
@@ -87,9 +87,9 @@ read_header:
 if (dqt_offs) {
 init_get_bits(&s->gb, buf_ptr+dqt_offs, (buf_end - 
(buf_ptr+dqt_offs))*8);
 s->start_code = DQT;
-if (ff_mjpeg_decode_dqt(s) < 0 &&
-(avctx->err_recognition & AV_EF_EXPLODE))
-return AVERROR_INVALIDDATA;
+ret = ff_mjpeg_decode_dqt(s);
+if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+return ret;
 }
 
 dht_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "dht is %d and size 
is %d\n");
@@ -105,8 +105,8 @@ read_header:
 if (sof_offs) {
 init_get_bits(&s->gb, buf_ptr+sof_offs, (buf_end - 
(buf_ptr+sof_offs))*8);
 s->start_code = SOF0;
-if (ff_mjpeg_decode_sof(s) < 0)
-return -1;
+if ((ret = ff_mjpeg_decode_sof(s)) < 0)
+return ret;
 }
 
 sos_offs = read_offs(avctx, &hgb, buf_end - buf_ptr, "sos is %d and size 
is %d\n");
@@ -118,9 +118,9 @@ read_header:
   8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs));
 s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16));
 s->start_code = SOS;
-if (ff_mjpeg_decode_sos(s, NULL, 0, NULL) < 0 &&
-(avctx->err_recognition & AV_EF_EXPLODE))
-return AVERROR_INVALIDDATA;
+ret = ff_mjpeg_decode_sos(s, NULL, 0, NULL);
+if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
+return ret;
 }
 
 if (s->interlaced) {
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 2/6] avcodec/v4l2_m2m: fix cant typo

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/v4l2_m2m.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/v4l2_m2m.h b/libavcodec/v4l2_m2m.h
index 452bf0d9bc..0d4671beb1 100644
--- a/libavcodec/v4l2_m2m.h
+++ b/libavcodec/v4l2_m2m.h
@@ -104,7 +104,7 @@ int ff_v4l2_m2m_codec_init(AVCodecContext *avctx);
 int ff_v4l2_m2m_codec_end(AVCodecContext *avctx);
 
 /**
- * Reinitializes the V4L2m2mContext when the driver cant continue processing
+ * Reinitializes the V4L2m2mContext when the driver cannot continue processing
  * with the capture parameters.
  *
  * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder.
@@ -114,7 +114,7 @@ int ff_v4l2_m2m_codec_end(AVCodecContext *avctx);
 int ff_v4l2_m2m_codec_reinit(V4L2m2mContext *ctx);
 
 /**
- * Reinitializes the V4L2m2mContext when the driver cant continue processing
+ * Reinitializes the V4L2m2mContext when the driver cannot continue processing
  * with the  any of the current V4L2Contexts (ie, changes in output and 
capture).
  *
  * @param[in] ctx The V4L2m2mContext instantiated by the encoder/decoder.
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 1/6] avformat/libopenmpt: Fix successfull typo

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/libopenmpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 0fff702a36..a334270847 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -259,7 +259,7 @@ static int read_probe_openmpt(AVProbeData *p)
 } else {
 /* The file extension is unknown and we have very few data
  * bytes available. libopenmpt cannot decide anything here,
- * and returning any score > 0 would result in successfull
+ * and returning any score > 0 would result in successful
  * probing of random data.
  */
 return 0;
-- 
2.20.1

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


Re: [FFmpeg-devel] [PATCH 3/6] avcodec/qsvenc: Fix Unkown typo

2018-12-28 Thread Lou Logan
On Fri, Dec 28, 2018, at 12:22 PM, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/qsvenc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> index 70772dc0e2..56a3756357 100644
> --- a/libavcodec/qsvenc.c
> +++ b/libavcodec/qsvenc.c
> @@ -1346,7 +1346,7 @@ int ff_qsv_encode(AVCodecContext *avctx, 
> QSVEncContext *q,
>  pict_type = AV_PICTURE_TYPE_B;
>  else if (bs->FrameType == MFX_FRAMETYPE_UNKNOWN) {
>  pict_type = AV_PICTURE_TYPE_NONE;
> -av_log(avctx, AV_LOG_WARNING, "Unkown FrameType, set 
> pict_type to AV_PICTURE_TYPE_NONE.\n");
> +av_log(avctx, AV_LOG_WARNING, "Unknown FrameType, set 
> pict_type to AV_PICTURE_TYPE_NONE.\n");
>  } else {
>  av_log(avctx, AV_LOG_ERROR, "Invalid FrameType:%d.\n", bs-
> >FrameType);
>  return AVERROR_INVALIDDATA;

OK, of course. Same for patch 2/6. No need to submit patches for simple typos.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/6] avcodec/qsvenc: Fix Unkown typo

2018-12-28 Thread Lou Logan
On Fri, Dec 28, 2018, at 12:35 PM, Lou Logan wrote:
>
> OK, of course. Same for patch 2/6. No need to submit patches for simple typos.

...also 1/6.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/6] avcodec/v4l2_m2m: fix cant typo

2018-12-28 Thread Moritz Barsnick
On Fri, Dec 28, 2018 at 22:22:53 +0100, Michael Niedermayer wrote:
> - * Reinitializes the V4L2m2mContext when the driver cant continue processing
> + * Reinitializes the V4L2m2mContext when the driver cannot continue 
> processing
>   * with the  any of the current V4L2Contexts (ie, changes in output and 
> capture).

The line below is also wrong. "with the any of" does not make any
sense, and "ie," is very ugly.

Suggestion:

  Reinitializes the V4L2m2mContext when the driver cannot continue processing
  with any of the current V4L2Contexts (i.e. changes in output and capture).

Even with "i.e.", the text in the parantheses doesn't make sense to me.
My guess is "ie" meant to be "e.g.".

So:

  Reinitializes the V4L2m2mContext when the driver cannot continue processing
  with any of the current V4L2Contexts (e.g. changes in output and capture).

Gruß,
Moritz
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S

2018-12-28 Thread Manoj Gupta
Hi All,

I recently had a problem building ffmpeg for AArch64 where lld linker
complained about text relocations in readonly segment. The following
patch fixes the linker complains by referring to a local label instead
of function name.

This is similar in nature as the following previous commits:
https://www.mail-archive.com/ffmpeg-cvslog@ffmpeg.org/msg34290.html
https://www.mail-archive.com/ffmpeg-cvslog@ffmpeg.org/msg34419.html

Thanks,
Manoj

Patch:

libavcodec: Remove dynamic relocs from aarch64/h264idct_neon.S

Some of the assembly functions e.g. ff_h264_idct_dc_add_neon
has code like:
movrel  x14, X(ff_h264_idct_add_neon)

Linker cannot resolve them fully at link time and emits dynamic
relocations.
Use explicit labels instead so that no dynamic relocations are
needed at all.

This avoids lld complains about text relocations.

For background, see https://crbug.com/917919

Signed-off-by: Manoj Gupta 
---
 libavcodec/aarch64/h264idct_neon.S | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/libavcodec/aarch64/h264idct_neon.S
b/libavcodec/aarch64/h264idct_neon.S
index 825ec49f8c..7de44205d3 100644
--- a/libavcodec/aarch64/h264idct_neon.S
+++ b/libavcodec/aarch64/h264idct_neon.S
@@ -23,6 +23,7 @@
 #include "neon.S"

 function ff_h264_idct_add_neon, export=1
+.L_ff_h264_idct_add_neon:
 ld1 {v0.4H, v1.4H, v2.4H, v3.4H},  [x1]
 sxtwx2, w2
 moviv30.8H, #0
@@ -77,6 +78,7 @@ function ff_h264_idct_add_neon, export=1
 endfunc

 function ff_h264_idct_dc_add_neon, export=1
+.L_ff_h264_idct_dc_add_neon:
 sxtwx2,  w2
 mov w3,   #0
 ld1r{v2.8H},  [x1]
@@ -106,8 +108,8 @@ function ff_h264_idct_add16_neon, export=1
 mov w9,  w3 // stride
 movrel  x7,  scan8
 mov x10, #16
-movrel  x13, X(ff_h264_idct_dc_add_neon)
-movrel  x14, X(ff_h264_idct_add_neon)
+movrel  x13, .L_ff_h264_idct_dc_add_neon
+movrel  x14, .L_ff_h264_idct_add_neon
 1:  mov w2,  w9
 ldrbw3,  [x7], #1
 ldrsw   x0,  [x5], #4
@@ -133,8 +135,8 @@ function ff_h264_idct_add16intra_neon, export=1
 mov w9,  w3 // stride
 movrel  x7,  scan8
 mov x10, #16
-movrel  x13, X(ff_h264_idct_dc_add_neon)
-movrel  x14, X(ff_h264_idct_add_neon)
+movrel  x13, .L_ff_h264_idct_dc_add_neon
+movrel  x14, .L_ff_h264_idct_add_neon
 1:  mov w2,  w9
 ldrbw3,  [x7], #1
 ldrsw   x0,  [x5], #4
@@ -160,8 +162,8 @@ function ff_h264_idct_add8_neon, export=1
 add x5,  x1,  #16*4 // block_offset
 add x9,  x2,  #16*32// block
 mov w19, w3 // stride
-movrel  x13, X(ff_h264_idct_dc_add_neon)
-movrel  x14, X(ff_h264_idct_add_neon)
+movrel  x13, .L_ff_h264_idct_dc_add_neon
+movrel  x14, .L_ff_h264_idct_add_neon
 movrel  x7,  scan8, 16
 mov x10, #0
 mov x11, #16
@@ -263,6 +265,7 @@ endfunc
 .endm

 function ff_h264_idct8_add_neon, export=1
+.L_ff_h264_idct8_add_neon:
 moviv19.8H,   #0
 sxtwx2,   w2
 ld1 {v24.8H, v25.8H}, [x1]
@@ -326,6 +329,7 @@ function ff_h264_idct8_add_neon, export=1
 endfunc

 function ff_h264_idct8_dc_add_neon, export=1
+.L_ff_h264_idct8_dc_add_neon:
 mov w3,   #0
 sxtwx2,   w2
 ld1r{v31.8H}, [x1]
@@ -375,8 +379,8 @@ function ff_h264_idct8_add4_neon, export=1
 mov w2,  w3
 movrel  x7,  scan8
 mov w10, #16
-movrel  x13, X(ff_h264_idct8_dc_add_neon)
-movrel  x14, X(ff_h264_idct8_add_neon)
+movrel  x13, .L_ff_h264_idct8_dc_add_neon
+movrel  x14, .L_ff_h264_idct8_add_neon
 1:  ldrbw9,  [x7], #4
 ldrsw   x0,  [x5], #16
 ldrbw9,  [x4, w9, UXTW]
--
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] tools: add target_dec_fate.sh

2018-12-28 Thread Michael Niedermayer
On Mon, Sep 10, 2018 at 02:22:06AM +0200, Michael Niedermayer wrote:
> Script to download and test ossfuzz testcases
> This also includes a list of such testcases.
> I intend to subsequently fill this list with the cases we have fixed in the 
> past
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fate.list |  6 
>  tools/target_dec_fate.sh   | 62 ++
>  2 files changed, 68 insertions(+)
>  create mode 100644 tools/target_dec_fate.list
>  create mode 100755 tools/target_dec_fate.sh

will apply

[...]
-- 
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
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Install from Source on CentOS 7

2018-12-28 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

> You'd need to post your whole config.log (pastebin) likely.
> 
> However, this list is for development of FFmpeg itself, and this 
> question should be on the user mailing list, or #ffmpeg on
> FreeNode, where you'll likely get better answers.

I'd usually agree, but I'm building the binaries for macOS and I'm
running into the same issue.

Either the latest x265 broke something or a change in ffmpeg's
configure messed things up.

What I don't understand is that you didn't run into the same problem
with fate.

The last successful build I had was Dec 24th:

ffmpeg 92795-gcdbf8847ea
x265 20181217-1f44f1f1623d 2.9+16-1f44f1f1623d

So something between then and now screwed things up.

Cheers,
  K. C.

- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAlwmtxUACgkQvgmFNJ1E
3QDHLQ/7BK1EDTPotGqn+7LQODL2TSmDGq8mQf7emx5ckG42R5Kpb0G84eZ5Ns6a
Mii8oQ/tovX/kRtFjd4+H17xIUA2u7e+kXc/yNSHC51jFhE5F8QxfuU/3T2wfSIt
nLbPx68t5LARPqUdaldWUJ3r7kL/wyctNaeqYfZrMuhhzRm5BCRnKJC1mLgNCB+e
8628iMdCCeucZwj1Eb3bK+Y4YgoxalEHHjnqSnrAxlxuWO2WdlIbD1z5gfTMJ8s7
bDsKVmKKdgy27lI4JU0vRZ5Q1d2GaPqicVRij7L3XjYr0OC6Yn2Oe9h9mYZCBLfp
Z3f/wxUMOSQI4CwA2yd97ZV1fcs82B28StAvdaixTDWxecWyjF89dMC2mYqmpIFu
SFqrtzEZdrWnFgNljSkvkd4t2evLCIS+A5l9b01sXVxN7RyqFv0kThs+bHll/cH9
jYXm/bVYn1hUuAp73xsKlHlNWjRcCgTQQSqVAKxAU6NP2PeIRogf/NpU8M7hACuo
mds/OIFPNUMTnul58pvT59xTnrQV96aULDvbm+lTvskP93T/x4VDjs2yrYJ3q4tH
45J0a2x6eCmU2yVKLK/6wf2NwciBCDxItBIwqRPZ5m/8creDlfF46dHspE/q2wqd
mR0YmeWr5ouOigFSnXi0EZk/eZwbqMPrUc+87LGm9Gt3gdHCHAs=
=G6TL
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Install from Source on CentOS 7

2018-12-28 Thread Moritz Barsnick
On Fri, Dec 28, 2018 at 18:51:55 -0500, Helmut K. C. Tessarek wrote:
> Either the latest x265 broke something or a change in ffmpeg's
> configure messed things up.

x265 messed it up, with a commit created 15 days ago:
http://ffmpeg.org/pipermail/ffmpeg-user/2018-December/042609.html

> What I don't understand is that you didn't run into the same problem
> with fate.

AFAIU, fate doesn't use external libraries. (Not even just build tests,
apparently.)

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


[FFmpeg-devel] [PATCH 1/2] tools/target_dec_fate.sh: print some statistics

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 tools/target_dec_fate.sh | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/tools/target_dec_fate.sh b/tools/target_dec_fate.sh
index 1fdfdcaaea..5e683676d1 100755
--- a/tools/target_dec_fate.sh
+++ b/tools/target_dec_fate.sh
@@ -43,6 +43,9 @@ test ! -d "$1"  && echo $1 is not an accessable directory && 
show_help
 test ! -f target_dec_fate.sh && echo $0 Must be run from its location && 
show_help
 grep 'CONFIG_OSSFUZZ 0' ../config.h && echo not configured for ossfuzz && 
show_help
 
+CACHED=0
+DOWNLOADED=0
+FAILED2DOWNLOAD=0
 #Download testcases
 while read -r LINE; do
 ISSUE_NUM=`echo $LINE | sed 's#/.*##'`
@@ -50,10 +53,12 @@ while read -r LINE; do
 FILE=`echo $LINE | sed 's# .*##'`
 if test -f "$1/$FILE" ; then
 echo exists   $FILE
+CACHED=$((CACHED+1))
 else
 echo downloading  $FILE
 mkdir -p "$1/$ISSUE_NUM"
-wget -O "$1/$FILE" 
"https://oss-fuzz.com/download?testcase_id=$FILE_ID"; || rm "$1/$FILE"
+wget -O "$1/$FILE" 
"https://oss-fuzz.com/download?testcase_id=$FILE_ID"; || ( rm "$1/$FILE" ; 
FAILED2DOWNLOAD=$((FAILED2DOWNLOAD+1)) )
+DOWNLOADED=$((DOWNLOADED+1))
 fi
 done < "$LIST"
 
@@ -75,4 +80,4 @@ while read -r LINE; do
 tools/$TOOL_ID $1/$FILE
 done < "tools/$LIST"
 
-echo OK
+echo OK cached:$CACHED downloaded:$DOWNLOADED failed to 
download:$FAILED2DOWNLOAD
-- 
2.20.1

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


[FFmpeg-devel] [PATCH 2/2] tools/target_dec_fate: Add entries from around issue 500 to 700

2018-12-28 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 tools/target_dec_fate.list | 61 ++
 1 file changed, 61 insertions(+)

diff --git a/tools/target_dec_fate.list b/tools/target_dec_fate.list
index e0509aaa64..f6b56261bb 100644
--- a/tools/target_dec_fate.list
+++ b/tools/target_dec_fate.list
@@ -1,4 +1,65 @@
+496/clusterfuzz-testcase-5805083497332736  
 target_dec_jpegls_fuzzer
+498/clusterfuzz-testcase-6157986632302592  
 target_dec_tiff_fuzzer
+500/clusterfuzz-testcase-6315221727576064  
 target_dec_png_fuzzer
+501/clusterfuzz-testcase-5672752870588416  
 target_dec_sipr_fuzzer
+503/clusterfuzz-testcase-6386429735206912  
 target_dec_mp3_fuzzer
+508/clusterfuzz-testcase-6245747678773248  
 target_dec_amrnb_fuzzer
+510/clusterfuzz-testcase-5737865715646464  
 target_dec_dca_fuzzer
+540/clusterfuzz-testcase-5674546153652224  
 target_dec_jpegls_fuzzer
 
544/clusterfuzz-testcase-5936536407244800.f8bd9b24_8ba77916_70c2c7be_3df6a2ea_96cd9f14
  target_dec_interplay_video_fuzzer
+546/clusterfuzz-testcase-4809433909559296  
 target_dec_png_fuzzer
+555/clusterfuzz-testcase-5986646595993600  
 target_dec_movtext_fuzzer
+559/clusterfuzz-testcase-6424225917173760  
 target_dec_pictor_fuzzer
+607/clusterfuzz-testcase-5108792465293312  
 target_dec_wavpack_fuzzer
+608/clusterfuzz-testcase-6039782863929344  
 target_dec_mpeg2video_fuzzer
+609/clusterfuzz-testcase-4825202619842560  
 target_dec_png_fuzzer
+610/clusterfuzz-testcase-4831030085156864  
 target_dec_ac3_fuzzer
+611/clusterfuzz-testcase-5613455820193792  
 target_dec_mjpeg_fuzzer
+612/clusterfuzz-testcase-4707817137111040  
 target_dec_mpeg4_fuzzer
+614/clusterfuzz-testcase-4931860079575040  
 target_dec_h264_fuzzer
+615/clusterfuzz-testcase-5488002644049920  
 target_dec_h264_fuzzer
+616/clusterfuzz-testcase-5724692654587904  
 target_dec_jpegls_fuzzer
+617/clusterfuzz-testcase-6413875723370496  
 target_dec_subrip_fuzzer
+618/clusterfuzz-testcase-6594990333493248  
 target_dec_h263_fuzzer
+619/clusterfuzz-testcase-5803914534322176  
 target_dec_dvbsub_fuzzer
+622/clusterfuzz-testcase-5745722022428672  
 target_dec_pictor_fuzzer
+626/clusterfuzz-testcase-4738718621499392  
 target_dec_flac_fuzzer
+628/clusterfuzz-testcase-6187747641393152  
 target_dec_flac_fuzzer
+629/clusterfuzz-testcase-6697457381539840  
 target_dec_dca_fuzzer
+630/clusterfuzz-testcase-6608718928019456  
 target_dec_rv40_fuzzer
+631/clusterfuzz-testcase-6725491035734016  
 target_dec_mp3_fuzzer
+633/clusterfuzz-testcase-4553133554401280  
 target_dec_dvvideo_fuzzer
+634/clusterfuzz-testcase-5285420445204480  
 target_dec_h264_fuzzer
+637/clusterfuzz-testcase-5713159862091776  
 target_dec_rv40_fuzzer
+639/clusterfuzz-testcase-5143866241974272  
 target_dec_h263_fuzzer
+656/clusterfuzz-testcase-6463814516080640  
 target_dec_mpeg4_fuzzer
+657/clusterfuzz-testcase-6674741433729024  
 target_dec_jpegls_fuzzer
+658/clusterfuzz-testcase-6691260146384896  
 target_dec_mpeg4_fuzzer
+659/clusterfuzz-testcase-5866673603084288  
 target_dec_h263_fuzzer
+662/clusterfuzz-testcase-

[FFmpeg-devel] [PATCH V3] avfilter: Add tonemap vaapi filter

2018-12-28 Thread Zachary Zhou
It supports ICL platform.
H2H (HDR to HDR): P010 -> RGB10
H2S (HDR to SDR): P010 -> RGB8

libva commit for HDR10
https://github.com/intel/libva/commit/cf11abe5e1b9c93ee75cf974076957162c1605b9

Signed-off-by: Zachary Zhou 
---
 configure  |   2 +
 doc/filters.texi   |  63 
 libavfilter/Makefile   |   1 +
 libavfilter/allfilters.c   |   1 +
 libavfilter/vaapi_vpp.c|  29 ++
 libavfilter/vaapi_vpp.h|   8 +
 libavfilter/vf_tonemap_vaapi.c | 542 +
 libavutil/hwcontext_vaapi.c|   3 +
 8 files changed, 649 insertions(+)
 create mode 100644 libavfilter/vf_tonemap_vaapi.c

diff --git a/configure b/configure
index be49c19b88..baf70d03fc 100755
--- a/configure
+++ b/configure
@@ -3480,6 +3480,7 @@ tinterlace_merge_test_deps="tinterlace_filter"
 tinterlace_pad_test_deps="tinterlace_filter"
 tonemap_filter_deps="const_nan"
 tonemap_opencl_filter_deps="opencl const_nan"
+tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping"
 transpose_opencl_filter_deps="opencl"
 unsharp_opencl_filter_deps="opencl"
 uspp_filter_deps="gpl avcodec"
@@ -5984,6 +5985,7 @@ check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode 
-D_WIN32_WINNT=0x0602
 
 check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
 check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
+check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping"
 check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
 check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
 check_type "va/va.h va/va_enc_vp8.h"  "VAEncPictureParameterBufferVP8"
diff --git a/doc/filters.texi b/doc/filters.texi
index ac4c9b44d8..9ed53a1008 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -19130,6 +19130,69 @@ Convert HDR(PQ/HLG) video to 
bt2020-transfer-characteristic p010 format using li
 @end example
 @end itemize
 
+@section tonemap_vappi
+
+Perform HDR(High Dynamic Range) to HDR and HDR to SDR conversion with 
tone-mapping.
+
+It accepts the following parameters:
+
+@table @option
+@item type
+Specify the tone-mapping operator to be used.
+
+Possible values are:
+@table @var
+@item h2h
+Perform H2H(HDR to HDR), convert from p010 to rgb10
+@item h2s
+Perform H2S(HDR to SDR), convert from p010 to rgb8
+@end table
+
+@item display
+Set mastering display metadata for H2H
+
+Can assume the following values:
+@table @var
+@item G
+Green primary G(x|y)
+@item B
+Blue primary B(x|y)
+@item R
+Red primary R(x|y)
+@item WP
+White point WP(x|y)
+@item L
+Display mastering luminance L(max|min)
+@end table
+
+@item light
+Set content light level for H2H
+
+Can assume the following values:
+@table @var
+@item CLL
+Max content light level
+@item FALL
+Max average light level per frame
+@end table
+
+@end table
+
+@subsection Example
+
+@itemize
+@item
+Convert HDR video to HDR video from p010 format to rgb10 format.
+@example
+-i INPUT -vf 
"tonemap_vaapi=h2h:display=G(13250|34500)B(7500|3000)R(34000|16000)WP(15635|16450)L(2000|2000):light=CLL(1)FALL(1000)"
 OUTPUT 
+@end example
+@item
+Convert HDR video to SDR video from p010 format to rgb8 format.
+@example
+-i INPUT -vf "tonemap_vaapi=h2s" OUTPUT
+@end example
+@end itemize
+
 @section unsharp_opencl
 
 Sharpen or blur the input video.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6e2658186d..f6894209d1 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -390,6 +390,7 @@ OBJS-$(CONFIG_TMIX_FILTER)   += vf_mix.o 
framesync.o
 OBJS-$(CONFIG_TONEMAP_FILTER)+= vf_tonemap.o colorspace.o
 OBJS-$(CONFIG_TONEMAP_OPENCL_FILTER) += vf_tonemap_opencl.o 
colorspace.o opencl.o \
 opencl/tonemap.o 
opencl/colorspace_common.o
+OBJS-$(CONFIG_TONEMAP_VAAPI_FILTER)  += vf_tonemap_vaapi.o vaapi_vpp.o
 OBJS-$(CONFIG_TPAD_FILTER)   += vf_tpad.o
 OBJS-$(CONFIG_TRANSPOSE_FILTER)  += vf_transpose.o
 OBJS-$(CONFIG_TRANSPOSE_NPP_FILTER)  += vf_transpose_npp.o cuda_check.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index a600069500..754b84819d 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -369,6 +369,7 @@ extern AVFilter ff_vf_tlut2;
 extern AVFilter ff_vf_tmix;
 extern AVFilter ff_vf_tonemap;
 extern AVFilter ff_vf_tonemap_opencl;
+extern AVFilter ff_vf_tonemap_vaapi;
 extern AVFilter ff_vf_tpad;
 extern AVFilter ff_vf_transpose;
 extern AVFilter ff_vf_transpose_npp;
diff --git a/libavfilter/vaapi_vpp.c b/libavfilter/vaapi_vpp.c
index c5bbc3b85b..7389ebd9d5 100644
--- a/libavfilter/vaapi_vpp.c
+++ b/libavfilter/vaapi_vpp.c
@@ -276,6 +276,35 @@ int ff_vaapi_vpp_make_param_buffers(AVFilterContext *avctx,
 return 0;
 }
 
+int ff_vaapi_vpp_make_param_buffers2(AVFilterContext *avctx,
+ int type,
+ const