Re: [FFmpeg-devel] [PATCH] doc/filters: added possible values to @item win_func

2021-10-15 Thread Paul B Mahol
On Fri, Oct 15, 2021 at 6:12 AM Gyan Doshi  wrote:

>
>
> On 2021-10-15 12:35 am, Paul B Mahol wrote:
> > will revert in next 96 hours.
>
> Devote time to something productive.
>

Great words you do not follow at all.


>
> In any case, not all filters have identical lists. spectrumsynth
> supports limited functions. many don't recognize the string 'hann'. The
> defaults also vary.
> Harmonize those first before we save 150 odd lines out of 28000 in
> filters.texi
>
> Regards,
> Gyan
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 5/8] avformat/mov: support dvwC box for Dolby Vision

2021-10-15 Thread myp...@gmail.com
On Thu, Oct 14, 2021 at 9:10 PM  wrote:
>
> From: Limin Wang 
>
> By <>
>
> Signed-off-by: Limin Wang 
> ---
>  libavformat/mov.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index 57c67e3..49a8c27 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -7074,7 +7074,7 @@ static int mov_read_dvcc_dvvc(MOVContext *c, 
> AVIOContext *pb, MOVAtom atom)
>  return ret;
>  }
>
> -av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC box, version: %d.%d, profile: 
> %d, level: %d, "
> +av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, 
> profile: %d, level: %d, "
> "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d\n",
> dovi->dv_version_major, dovi->dv_version_minor,
> dovi->dv_profile, dovi->dv_level,
> @@ -7273,6 +7273,7 @@ static const MOVParseTableEntry 
> mov_default_parse_table[] = {
>  { MKTAG('c','l','l','i'), mov_read_clli },
>  { MKTAG('d','v','c','C'), mov_read_dvcc_dvvc },
>  { MKTAG('d','v','v','C'), mov_read_dvcc_dvvc },
> +{ MKTAG('d','v','w','C'), mov_read_dvcc_dvvc },
>  { MKTAG('k','i','n','d'), mov_read_kind },
>  { 0, NULL }
>  };
> --
> 1.8.3.1
Do you have test clip for this patch?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH] avformat/westwood_vqa: Store VQFL codebook chunks

2021-10-15 Thread Paul B Mahol
applied
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 07/10] avcodec/libdav1d: Don't leak side-data-only packets

2021-10-15 Thread James Almer

On 10/11/2021 12:36 PM, Andreas Rheinhardt wrote:

Signed-off-by: Andreas Rheinhardt 
---
  libavcodec/libdav1d.c | 3 +++
  1 file changed, 3 insertions(+)

diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 2807210e50..2d5fccec71 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -328,6 +328,9 @@ static int libdav1d_receive_frame(AVCodecContext *c, 
AVFrame *frame)
  return res;
  }
  }
+} else if (res >= 0) {
+av_packet_unref(&pkt);
+return AVERROR(EAGAIN);


Not exactly a real world scenario, but a valid one, so nice catch and lgtm.


  }
  }
  



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

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


Re: [FFmpeg-devel] [PATCH v2 1/3] avformat/avio: privatize point of truth for AVIOContext::written

2021-10-15 Thread Michael Niedermayer
On Thu, Oct 14, 2021 at 12:10:36AM +0300, Jan Ekström wrote:
> Looking at 3f75e5116b900f1428aa13041fc7d6301bf1988a, the field
> was supposed to be private, but during merging the field and the
> group that had the comment about it got separated.
> 
> Thus, move the actual privately utilized state of this variable
> into the private FFIOContext.
> ---
>  libavformat/avio_internal.h |  5 +
>  libavformat/aviobuf.c   | 11 +++
>  2 files changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/libavformat/avio_internal.h b/libavformat/avio_internal.h
> index eded38759b..28ea38079d 100644
> --- a/libavformat/avio_internal.h
> +++ b/libavformat/avio_internal.h
> @@ -51,6 +51,11 @@ typedef struct FFIOContext {
>   */
>  int64_t bytes_read;
>  
> +/**
> + * Bytes written statistic
> + */
> +int64_t bytes_written;
> +
>  /**
>   * seek statistic
>   */
> diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> index 3d87d66091..7afbff0266 100644
> --- a/libavformat/aviobuf.c
> +++ b/libavformat/aviobuf.c
> @@ -164,8 +164,10 @@ static void writeout(AVIOContext *s, const uint8_t 
> *data, int len)
>  if (ret < 0) {
>  s->error = ret;
>  } else {
> -if (s->pos + len > s->written)
> -s->written = s->pos + len;
> +if (s->pos + len > ctx->bytes_written) {
> +ctx->bytes_written = s->pos + len;
> +s->written = ctx->bytes_written;
> +}
>  }
>  }
>  if (ctx->current_type == AVIO_DATA_MARKER_SYNC_POINT ||
> @@ -337,13 +339,14 @@ int64_t avio_skip(AVIOContext *s, int64_t offset)
>  
>  int64_t avio_size(AVIOContext *s)
>  {
> +FFIOContext *const ctx = ffiocontext(s);
>  int64_t size;
>  
>  if (!s)
>  return AVERROR(EINVAL);
>  
> -if (s->written)
> -return s->written;
> +if (ctx->bytes_written)
> +return ctx->bytes_written;

looking at this again, it doesnt look like "written" is what "bytes_written" is
if s->written represents the file size as avio_size() returns then
thats different from the number of bytes written statistic as soon as any
seeking has happened

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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

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


Re: [FFmpeg-devel] [PATCH v2 2/3] avformat/avio{, buf}: introduce public AVIOContext::bytes_{read, written}

2021-10-15 Thread Michael Niedermayer
On Thu, Oct 14, 2021 at 12:10:37AM +0300, Jan Ekström wrote:
> Such fields can be seen as generally useful in cases where the
> API user is not implementing custom AVIO callbacks, but still would
> like to know if data is being read or written out, such as in case
> data is being read from input but no AVPacket has been received yet.
> ---
>  doc/APIchanges|  3 +++
>  libavformat/avio.h| 10 ++
>  libavformat/aviobuf.c |  4 +++-
>  libavformat/version.h |  2 +-
>  4 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 7b267a79ac..806eaf4c83 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -14,6 +14,9 @@ libavutil: 2021-04-27
>  
>  API changes, most recent first:
>  
> +2021-09-26 - xx - lavf 59.7.100 - avio.h
> +  Introduce public bytes_{read,written} statistic fields to AVIOContext.
> +
>  2021-09-21 - xx - lavu 57.7.100 - pixfmt.h
>Add AV_PIX_FMT_X2BGR10.
>  
> diff --git a/libavformat/avio.h b/libavformat/avio.h
> index a7b56ab667..0f9a0f909f 100644
> --- a/libavformat/avio.h
> +++ b/libavformat/avio.h
> @@ -297,6 +297,16 @@ typedef struct AVIOContext {
>   * used keeping track of already written data for a later flush.
>   */
>  unsigned char *buf_ptr_max;
> +
> +/**
> + * Read-only statistic of bytes read for this AVIOContext.
> + */
> +int64_t bytes_read;
> +
> +/**
> + * Read-only statistic of bytes written for this AVIOContext.
> + */
> +int64_t bytes_written;
>  } AVIOContext;

ok

thx

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

It is a danger to trust the dream we wish for rather than
the science we have, -- Dr. Kenneth Brown


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

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


Re: [FFmpeg-devel] [PATCH v3 1/4] libswscale/x86/rgb2rgb: add shuffle_bytes avx2

2021-10-15 Thread Michael Niedermayer
On Thu, Oct 14, 2021 at 07:19:37AM +, Wu, Jianhua wrote:
> Ping.
> 
> > -Original Message-
> > From: Wu, Jianhua 
> > Sent: Thursday, September 30, 2021 4:44 PM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Wu, Jianhua 
> > Subject: [PATCH v3 1/4] libswscale/x86/rgb2rgb: add shuffle_bytes avx2
> > 
> > Performance data(Less is better):
> > shuffle_bytes_ssse3   3.64654
> > shuffle_bytes_avx20.94288
> > 
> > Signed-off-by: Wu Jianhua 
> > ---
> >  libswscale/x86/rgb2rgb.c | 17 +++--
> >  libswscale/x86/rgb_2_rgb.asm | 11 +++
> >  2 files changed, 26 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libswscale/x86/rgb2rgb.c b/libswscale/x86/rgb2rgb.c index
> > c38a953277..0ab139aca4 100644
> > --- a/libswscale/x86/rgb2rgb.c
> > +++ b/libswscale/x86/rgb2rgb.c
> > @@ -146,6 +146,12 @@ void ff_shuffle_bytes_3012_ssse3(const uint8_t *src,
> > uint8_t *dst, int src_size)  void ff_shuffle_bytes_3210_ssse3(const uint8_t
> > *src, uint8_t *dst, int src_size);
> > 
> >  #if ARCH_X86_64
> > +void ff_shuffle_bytes_2103_avx2(const uint8_t *src, uint8_t *dst, int
> > +src_size); void ff_shuffle_bytes_0321_avx2(const uint8_t *src, uint8_t
> > +*dst, int src_size); void ff_shuffle_bytes_1230_avx2(const uint8_t
> > +*src, uint8_t *dst, int src_size); void
> > +ff_shuffle_bytes_3012_avx2(const uint8_t *src, uint8_t *dst, int
> > +src_size); void ff_shuffle_bytes_3210_avx2(const uint8_t *src, uint8_t
> > +*dst, int src_size);
> > +
> >  void ff_uyvytoyuv422_sse2(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
> >const uint8_t *src, int width, int height,
> >int lumStride, int chromStride, int srcStride); 
> > @@ -186,9 +192,16
> > @@ av_cold void rgb2rgb_init_x86(void)
> >  shuffle_bytes_3012 = ff_shuffle_bytes_3012_ssse3;
> >  shuffle_bytes_3210 = ff_shuffle_bytes_3210_ssse3;
> >  }
> > -if (EXTERNAL_AVX(cpu_flags)) {
> >  #if ARCH_X86_64
> > +if (EXTERNAL_AVX2_FAST(cpu_flags)) {
> > +shuffle_bytes_0321 = ff_shuffle_bytes_0321_avx2;
> > +shuffle_bytes_2103 = ff_shuffle_bytes_2103_avx2;
> > +shuffle_bytes_1230 = ff_shuffle_bytes_1230_avx2;
> > +shuffle_bytes_3012 = ff_shuffle_bytes_3012_avx2;
> > +shuffle_bytes_3210 = ff_shuffle_bytes_3210_avx2;
> > +}
> > +if (EXTERNAL_AVX(cpu_flags)) {
> >  uyvytoyuv422 = ff_uyvytoyuv422_avx; -#endif
> >  }
> > +#endif
> >  }
> > diff --git a/libswscale/x86/rgb_2_rgb.asm b/libswscale/x86/rgb_2_rgb.asm
> > index 29b856e281..c695c61d5c 100644
> > --- a/libswscale/x86/rgb_2_rgb.asm
> > +++ b/libswscale/x86/rgb_2_rgb.asm
> > @@ -159,6 +159,17 @@ SHUFFLE_BYTES 1, 2, 3, 0  SHUFFLE_BYTES 3, 0, 1, 2
> > SHUFFLE_BYTES 3, 2, 1, 0
> > 
> > +%if ARCH_X86_64
> > +%if HAVE_AVX2_EXTERNAL
> > +INIT_YMM avx2
> > +SHUFFLE_BYTES 2, 1, 0, 3
> > +SHUFFLE_BYTES 0, 3, 2, 1
> > +SHUFFLE_BYTES 1, 2, 3, 0
> > +SHUFFLE_BYTES 3, 0, 1, 2
> > +SHUFFLE_BYTES 3, 2, 1, 0
> > +%endif
> > +%endif
> > +
> >  
> > ;
> > ---
> >  ; uyvytoyuv422(uint8_t *ydst, uint8_t *udst, uint8_t *vdst,
> >  ;  const uint8_t *src, int width, int height,
> > --
> > 2.17.1
> 
> Hi there,
> 
> Any update?

you posted a v4 but "ping" v3 ?
is that intended

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


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

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


Re: [FFmpeg-devel] [PATCH] avcodec/vqavideo: Decode 15-bit VQA3 files

2021-10-15 Thread Pekka Väänänen

Hi,

I've fixed the issues pointed out in the earlier discussion at

https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-September/285688.html

Are there still any problems that block this patch getting applied? I'm 
happy to make any changes if needed.

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

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


[FFmpeg-devel] [PATCH v6 00/10] make QSV works with the Intel's oneVPL

2021-10-15 Thread Haihao Xiang
The oneAPI Video Processing Library (oneVPL) is a single interface for
encode, decode and video processing[1]. oneVPL is a successor to Intel(R) Media
SDK, but removed obsolete features. Intel(R) Media SDK lifetime comes to an
end now, new features for new Intel Gen platforms will be supported in oneVPL
only[2].

It is recommended to use oneVPL for new work, even for currently available
hardwares[3]. Hence, this patchset added a new option --enable-onevpl to bring
the support for oneVPL in QSV. New features for oneVPL will be implemented in
other patchset. --enble-libmfx option still works with Intel(R) Media SDK.

Note user can't enable onevpl and libmfx together.

oneVPL dispatcher source code:
https://github.com/oneapi-src/oneVPL

oneVPL GPU runtime for new Intel Gen platforms:
https://github.com/oneapi-src/oneVPL-intel-gpu

v6:
  - Use ${libmfx_incdir} in configure
  - Don't define mfx related function in an exported header
  - Rebased this patchset against the latest master and fixed bugs

[1] https://spec.oneapi.io/versions/latest/elements/oneVPL/source/index.html
[2] https://github.com/Intel-Media-SDK/MediaSDK/#media-sdk-support-matrix
[3] 
https://software.intel.com/content/www/us/en/develop/articles/upgrading-from-msdk-to-onevpl.html

Haihao Xiang (10):
  configure: ensure --enable-libmfx uses libmfx 1.x
  configure: fix the check for MFX_CODEC_VP9
  qsv: remove mfx/ prefix from mfx headers
  qsv: load user plugin for MFX_VERSION < 2.0
  qsv: build audio related code when MFX_VERSION < 2.0
  qsvenc: support multi-frame encode when MFX_VERSION < 2.0
  qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0
  qsv: support OPAQUE memory when MFX_VERSION < 2.0
  qsv: use a new method to create mfx session when using oneVPL
  configure: add --enable-libvpl option

 configure|  29 ++-
 libavcodec/qsv.c | 220 ++--
 libavcodec/qsv.h |   4 +-
 libavcodec/qsv_internal.h|   6 +-
 libavcodec/qsvdec.c  |  21 +-
 libavcodec/qsvenc.c  |  25 +-
 libavcodec/qsvenc.h  |   9 +-
 libavcodec/qsvenc_h264.c |   3 +-
 libavcodec/qsvenc_hevc.c |   3 +-
 libavcodec/qsvenc_jpeg.c |   3 +-
 libavcodec/qsvenc_mpeg2.c|   3 +-
 libavcodec/qsvenc_vp9.c  |   3 +-
 libavfilter/qsvvpp.c | 145 ++-
 libavfilter/qsvvpp.h |  12 +-
 libavfilter/vf_deinterlace_qsv.c |  73 +++---
 libavfilter/vf_scale_qsv.c   |  88 ---
 libavutil/hwcontext_d3d11va.c|  13 +
 libavutil/hwcontext_d3d11va.h|   5 +
 libavutil/hwcontext_dxva2.c  |   8 +
 libavutil/hwcontext_dxva2.h  |   4 +
 libavutil/hwcontext_opencl.c |   2 +-
 libavutil/hwcontext_qsv.c| 423 +++
 libavutil/hwcontext_qsv.h|   3 +-
 libavutil/hwcontext_vaapi.c  |  13 +
 libavutil/hwcontext_vaapi.h  |   4 +
 25 files changed, 934 insertions(+), 188 deletions(-)

-- 
2.17.1

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

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


[FFmpeg-devel] [PATCH v6 01/10] configure: ensure --enable-libmfx uses libmfx 1.x

2021-10-15 Thread Haihao Xiang
Intel's oneVPL is a successor to MediaSDK, but removed some obsolete
features of MediaSDK[1]. Some early versions of oneVPL still uses libmfx
as library name[2], however some of obsolete features, including OPAQUE
memory, multi-frame encode, user plugins and LA_EXT rate control mode
etc, have been enabled in QSV, so user can not use --enable-libmfx to
enable QSV if using an early version of oneVPL SDK. In order to make
sure user builds FFmpeg against a right version of libmfx, this patch
added a check for the version of libmfx and warning message about the
used obsolete features.

[1] 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html
[2] https://github.com/oneapi-src/oneVPL
---
 configure | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 92610c7edc..f89e769684 100755
--- a/configure
+++ b/configure
@@ -6438,8 +6438,11 @@ enabled liblensfun&& require_pkg_config 
liblensfun lensfun lensfun.h lf_
 # Media SDK or Intel Media Server Studio, these don't come with
 # pkg-config support.  Instead, users should make sure that the build
 # can find the libraries and headers through other means.
-enabled libmfx&& { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" 
MFXInit ||
-   { require libmfx "mfx/mfxvideo.h" MFXInit 
"-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } }
+enabled libmfx&& { { check_pkg_config libmfx "libmfx < 2.0" 
"mfx/mfxvideo.h" MFXInit ||
+ { require "libmfx < 2.0" "mfx/mfxvideo.h" 
MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without 
pkg-config"; } } &&
+   warn "build FFmpeg against libmfx 1.x, obsolete 
features of libmfx such as OPAQUE memory,\n"\
+"multi-frame encode, user plugins and 
LA_EXT rate control mode are enabled"; }
+
 if enabled libmfx; then
check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
 fi
-- 
2.17.1

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

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


[FFmpeg-devel] [PATCH v6 02/10] configure: fix the check for MFX_CODEC_VP9

2021-10-15 Thread Haihao Xiang
The data structures for VP9 in mfxvp9.h is wrapped by
MFX_VERSION_NEXT, which means those data structures have never been used
in a public release. Actually MFX_CODEC_VP9 and other VP9 stuffs is
added in mfxstructures.h. In addition, mfxdefs.h is included in
mfxvp9.h, so we may use the check in this patch for MFX_CODEC_VP9

This is in preparation for oneVPL support because mfxvp9.h is removed
from oneVPL [1]

[1]: https://github.com/oneapi-src/oneVPL
---
 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index f89e769684..0204d230c7 100755
--- a/configure
+++ b/configure
@@ -6444,7 +6444,7 @@ enabled libmfx&& { { check_pkg_config libmfx 
"libmfx < 2.0" "mfx/mfx
 "multi-frame encode, user plugins and 
LA_EXT rate control mode are enabled"; }
 
 if enabled libmfx; then
-   check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
+   check_cc MFX_CODEC_VP9 "mfx/mfxdefs.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
 fi
 
 enabled libmodplug&& require_pkg_config libmodplug libmodplug 
libmodplug/modplug.h ModPlug_Load
-- 
2.17.1

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

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


[FFmpeg-devel] [PATCH v6 03/10] qsv: remove mfx/ prefix from mfx headers

2021-10-15 Thread Haihao Xiang
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no
longer needed when including mfx headers in FFmpeg.
   Cflags: -I${includedir} -I${includedir}/mfx

Some old versions of libmfx have the following Cflags in libmfx.pc
   Cflags: -I${includedir}

We may add -I${includedir}/mfx to CFLAGS when running 'configure
--enable-libmfx' for old versions of libmfx, if so, mfx headers without
mfx/ prefix can be included too.

If libmfx comes without pkg-config support, we may do a small change to
the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx
instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can
find the mfx headers without mfx/ prefix

After applying this change, we won't need to change #include for mfx
headers when mfx headers are installed under a new directory.

This is in preparation for oneVPL support (mfx headers in oneVPL are
installed under vpl directory)
---
 configure| 13 +
 libavcodec/qsv.c |  8 
 libavcodec/qsv.h |  2 +-
 libavcodec/qsv_internal.h|  2 +-
 libavcodec/qsvdec.c  |  2 +-
 libavcodec/qsvenc.c  |  2 +-
 libavcodec/qsvenc.h  |  2 +-
 libavcodec/qsvenc_h264.c |  2 +-
 libavcodec/qsvenc_hevc.c |  2 +-
 libavcodec/qsvenc_jpeg.c |  2 +-
 libavcodec/qsvenc_mpeg2.c|  2 +-
 libavcodec/qsvenc_vp9.c  |  2 +-
 libavfilter/qsvvpp.h |  2 +-
 libavfilter/vf_deinterlace_qsv.c |  2 +-
 libavfilter/vf_scale_qsv.c   |  2 +-
 libavutil/hwcontext_opencl.c |  2 +-
 libavutil/hwcontext_qsv.c|  2 +-
 libavutil/hwcontext_qsv.h|  2 +-
 18 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/configure b/configure
index 0204d230c7..cc5894dcac 100755
--- a/configure
+++ b/configure
@@ -6438,13 +6438,18 @@ enabled liblensfun&& require_pkg_config 
liblensfun lensfun lensfun.h lf_
 # Media SDK or Intel Media Server Studio, these don't come with
 # pkg-config support.  Instead, users should make sure that the build
 # can find the libraries and headers through other means.
-enabled libmfx&& { { check_pkg_config libmfx "libmfx < 2.0" 
"mfx/mfxvideo.h" MFXInit ||
- { require "libmfx < 2.0" "mfx/mfxvideo.h" 
MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without 
pkg-config"; } } &&
+
+enabled libmfx&& { { check_pkg_config libmfx "libmfx < 2.0" 
"mfxvideo.h" MFXInit ||
+# Some old versions of libmfx have the following settings in libmfx.pc:
+#   includedir=/usr/include
+#   Cflags: -I${includedir}
+# So add -I${includedir}/mfx to CFLAGS
+ { check_pkg_config libmfx "libmfx < 2.0" 
"mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
+ { require "libmfx < 2.0" "mfxvideo.h" MFXInit 
"-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } &&
warn "build FFmpeg against libmfx 1.x, obsolete 
features of libmfx such as OPAQUE memory,\n"\
 "multi-frame encode, user plugins and 
LA_EXT rate control mode are enabled"; }
-
 if enabled libmfx; then
-   check_cc MFX_CODEC_VP9 "mfx/mfxdefs.h mfx/mfxstructures.h" "MFX_CODEC_VP9"
+   check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9"
 fi
 
 enabled libmodplug&& require_pkg_config libmodplug libmodplug 
libmodplug/modplug.h ModPlug_Load
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 9d08485c92..84f0401b0f 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -18,9 +18,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include 
 #include 
@@ -39,7 +39,7 @@
 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
 
 #if QSV_VERSION_ATLEAST(1, 12)
-#include "mfx/mfxvp8.h"
+#include "mfxvp8.h"
 #endif
 
 int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
diff --git a/libavcodec/qsv.h b/libavcodec/qsv.h
index b77158ec26..04ae0d6f34 100644
--- a/libavcodec/qsv.h
+++ b/libavcodec/qsv.h
@@ -21,7 +21,7 @@
 #ifndef AVCODEC_QSV_H
 #define AVCODEC_QSV_H
 
-#include 
+#include 
 
 #include "libavutil/buffer.h"
 
diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
index 8090b748b3..24c3e9307e 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -39,7 +39,7 @@
 #include "libavutil/hwcontext_vaapi.h"
 #endif
 
-#include 
+#include 
 
 #include "libavutil/frame.h"
 
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 8bce9f2cf0..1cadb846f5 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -25,7 +25,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include "libavutil/common.h"
 #include "libavutil/fifo.h"
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 06f55604b5..7eaa680ae4 100644
--- a/libav

[FFmpeg-devel] [PATCH v6 04/10] qsv: load user plugin for MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
preparation for oneVPL Support

[1]: 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2]: https://github.com/oneapi-src/oneVPL
---
 libavcodec/qsv.c  | 8 +++-
 libavcodec/qsv_internal.h | 2 ++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 84f0401b0f..83056e5976 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -19,7 +19,6 @@
  */
 
 #include 
-#include 
 #include 
 
 #include 
@@ -37,11 +36,16 @@
 #include "qsv_internal.h"
 
 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
+#define QSV_HAVE_USER_PLUGIN!QSV_ONEVPL
 
 #if QSV_VERSION_ATLEAST(1, 12)
 #include "mfxvp8.h"
 #endif
 
+#if QSV_HAVE_USER_PLUGIN
+#include 
+#endif
+
 int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
 {
 switch (codec_id) {
@@ -291,6 +295,7 @@ enum AVPictureType ff_qsv_map_pictype(int mfx_pic_type)
 static int qsv_load_plugins(mfxSession session, const char *load_plugins,
 void *logctx)
 {
+#if QSV_HAVE_USER_PLUGIN
 if (!load_plugins || !*load_plugins)
 return 0;
 
@@ -334,6 +339,7 @@ load_plugin_fail:
 if (err < 0)
 return err;
 }
+#endif
 
 return 0;
 
diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
index 24c3e9307e..659417ded8 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -60,6 +60,8 @@
 ((MFX_VERSION.Major > (MAJOR)) ||   \
 (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
 
+#define QSV_ONEVPL   QSV_VERSION_ATLEAST(2, 0)
+
 typedef struct QSVMid {
 AVBufferRef *hw_frames_ref;
 mfxHDLPair *handle_pair;
-- 
2.17.1

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

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


[FFmpeg-devel] [PATCH v6 05/10] qsv: build audio related code when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
preparation for oneVPL support

[1]: 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2]: https://github.com/oneapi-src/oneVPL
---
 libavcodec/qsv.c | 5 +
 libavfilter/qsvvpp.c | 6 ++
 libavfilter/qsvvpp.h | 2 ++
 3 files changed, 13 insertions(+)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 83056e5976..e0a124a5cb 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -37,6 +37,7 @@
 
 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
 #define QSV_HAVE_USER_PLUGIN!QSV_ONEVPL
+#define QSV_HAVE_AUDIO  !QSV_ONEVPL
 
 #if QSV_VERSION_ATLEAST(1, 12)
 #include "mfxvp8.h"
@@ -137,8 +138,10 @@ static const struct {
 { MFX_ERR_INVALID_VIDEO_PARAM,  AVERROR(EINVAL), "invalid video 
parameters" },
 { MFX_ERR_UNDEFINED_BEHAVIOR,   AVERROR_BUG, "undefined behavior"  
 },
 { MFX_ERR_DEVICE_FAILED,AVERROR(EIO),"device failed"   
 },
+#if QSV_HAVE_AUDIO
 { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio 
parameters"},
 { MFX_ERR_INVALID_AUDIO_PARAM,  AVERROR(EINVAL), "invalid audio 
parameters" },
+#endif
 
 { MFX_WRN_IN_EXECUTION, 0,   "operation in 
execution"   },
 { MFX_WRN_DEVICE_BUSY,  0,   "device busy" 
 },
@@ -148,7 +151,9 @@ static const struct {
 { MFX_WRN_VALUE_NOT_CHANGED,0,   "value is saturated"  
 },
 { MFX_WRN_OUT_OF_RANGE, 0,   "value out of range"  
 },
 { MFX_WRN_FILTER_SKIPPED,   0,   "filter skipped"  
 },
+#if QSV_HAVE_AUDIO
 { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,   "incompatible audio 
parameters"},
+#endif
 };
 
 /**
diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index d1218355c7..1113d27ba1 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -38,6 +38,8 @@
 #define IS_SYSTEM_MEMORY(mode) (mode & MFX_MEMTYPE_SYSTEM_MEMORY)
 #define MFX_IMPL_VIA_MASK(impl) (0x0f00 & (impl))
 
+#define QSV_HAVE_AUDIO !QSV_ONEVPL
+
 static const AVRational default_tb = { 1, 9 };
 
 static const struct {
@@ -95,8 +97,10 @@ static const struct {
 { MFX_ERR_INVALID_VIDEO_PARAM,  AVERROR(EINVAL), "invalid video 
parameters" },
 { MFX_ERR_UNDEFINED_BEHAVIOR,   AVERROR_BUG, "undefined behavior"  
 },
 { MFX_ERR_DEVICE_FAILED,AVERROR(EIO),"device failed"   
 },
+#if QSV_HAVE_AUDIO
 { MFX_ERR_INCOMPATIBLE_AUDIO_PARAM, AVERROR(EINVAL), "incompatible audio 
parameters"},
 { MFX_ERR_INVALID_AUDIO_PARAM,  AVERROR(EINVAL), "invalid audio 
parameters" },
+#endif
 
 { MFX_WRN_IN_EXECUTION, 0,   "operation in 
execution"   },
 { MFX_WRN_DEVICE_BUSY,  0,   "device busy" 
 },
@@ -106,7 +110,9 @@ static const struct {
 { MFX_WRN_VALUE_NOT_CHANGED,0,   "value is saturated"  
 },
 { MFX_WRN_OUT_OF_RANGE, 0,   "value out of range"  
 },
 { MFX_WRN_FILTER_SKIPPED,   0,   "filter skipped"  
 },
+#if QSV_HAVE_AUDIO
 { MFX_WRN_INCOMPATIBLE_AUDIO_PARAM, 0,   "incompatible audio 
parameters"},
+#endif
 };
 
 static int qsv_map_error(mfxStatus mfx_err, const char **desc)
diff --git a/libavfilter/qsvvpp.h b/libavfilter/qsvvpp.h
index 8c0cf3ed95..46e90c1d2c 100644
--- a/libavfilter/qsvvpp.h
+++ b/libavfilter/qsvvpp.h
@@ -40,6 +40,8 @@
 ((MFX_VERSION.Major > (MAJOR)) ||   \
 (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
 
+#define QSV_ONEVPL   QSV_VERSION_ATLEAST(2, 0)
+
 typedef struct QSVFrame {
 AVFrame  *frame;
 mfxFrameSurface1 surface;
-- 
2.17.1

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

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


[FFmpeg-devel] [PATCH v6 08/10] qsv: support OPAQUE memory when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
preparation for oneVPL support

[1]: 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2]: https://github.com/oneapi-src/oneVPL
---
 libavcodec/qsv.c |  4 ++
 libavcodec/qsv.h |  2 +
 libavcodec/qsv_internal.h|  1 +
 libavcodec/qsvdec.c  |  9 
 libavcodec/qsvenc.c  | 21 +
 libavcodec/qsvenc.h  |  2 +
 libavfilter/qsvvpp.c | 26 ++-
 libavfilter/qsvvpp.h |  3 ++
 libavfilter/vf_deinterlace_qsv.c | 57 +---
 libavfilter/vf_scale_qsv.c   | 74 ++--
 libavutil/hwcontext_qsv.c| 56 +---
 11 files changed, 181 insertions(+), 74 deletions(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index e0a124a5cb..d6f77908e4 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -89,10 +89,14 @@ static const struct {
 } qsv_iopatterns[] = {
 {MFX_IOPATTERN_IN_VIDEO_MEMORY, "input is video memory surface"
 },
 {MFX_IOPATTERN_IN_SYSTEM_MEMORY,"input is system memory surface"   
 },
+#if QSV_HAVE_OPAQUE
 {MFX_IOPATTERN_IN_OPAQUE_MEMORY,"input is opaque memory surface"   
 },
+#endif
 {MFX_IOPATTERN_OUT_VIDEO_MEMORY,"output is video memory surface"   
 },
 {MFX_IOPATTERN_OUT_SYSTEM_MEMORY,   "output is system memory surface"  
 },
+#if QSV_HAVE_OPAQUE
 {MFX_IOPATTERN_OUT_OPAQUE_MEMORY,   "output is opaque memory surface"  
 },
+#endif
 };
 
 int ff_qsv_print_iopattern(void *log_ctx, int mfx_iopattern,
diff --git a/libavcodec/qsv.h b/libavcodec/qsv.h
index 04ae0d6f34..c156b08d07 100644
--- a/libavcodec/qsv.h
+++ b/libavcodec/qsv.h
@@ -61,6 +61,8 @@ typedef struct AVQSVContext {
  * required by the encoder and the user-provided value nb_opaque_surfaces.
  * The array of the opaque surfaces will be exported to the caller through
  * the opaque_surfaces field.
+ *
+ * The caller must set this field to zero for oneVPL (MFX_VERSION >= 2.0)
  */
 int opaque_alloc;
 
diff --git a/libavcodec/qsv_internal.h b/libavcodec/qsv_internal.h
index 659417ded8..ff50b41de8 100644
--- a/libavcodec/qsv_internal.h
+++ b/libavcodec/qsv_internal.h
@@ -61,6 +61,7 @@
 (MFX_VERSION.Major == (MAJOR) && MFX_VERSION.Minor >= (MINOR)))
 
 #define QSV_ONEVPL   QSV_VERSION_ATLEAST(2, 0)
+#define QSV_HAVE_OPAQUE  !QSV_ONEVPL
 
 typedef struct QSVMid {
 AVBufferRef *hw_frames_ref;
diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
index 1cadb846f5..9395a1fd9a 100644
--- a/libavcodec/qsvdec.c
+++ b/libavcodec/qsvdec.c
@@ -171,7 +171,11 @@ static int qsv_init_session(AVCodecContext *avctx, 
QSVContext *q, mfxSession ses
 
 ret = ff_qsv_init_session_frames(avctx, &q->internal_qs.session,
  &q->frames_ctx, q->load_plugins,
+#if QSV_HAVE_OPAQUE
  q->iopattern == 
MFX_IOPATTERN_OUT_OPAQUE_MEMORY,
+#else
+ 0,
+#endif
  q->gpu_copy);
 if (ret < 0) {
 av_buffer_unref(&q->frames_ctx.hw_frames_ctx);
@@ -282,10 +286,15 @@ static int qsv_decode_preinit(AVCodecContext *avctx, 
QSVContext *q, enum AVPixel
 AVQSVFramesContext *frames_hwctx = frames_ctx->hwctx;
 
 if (!iopattern) {
+#if QSV_HAVE_OPAQUE
 if (frames_hwctx->frame_type & MFX_MEMTYPE_OPAQUE_FRAME)
 iopattern = MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
 else if (frames_hwctx->frame_type & 
MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
 iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
+#else
+if (frames_hwctx->frame_type & 
MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)
+iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
+#endif
 }
 }
 
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 6c6494745f..546efd9668 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1029,6 +1029,7 @@ static int qsv_retrieve_enc_params(AVCodecContext *avctx, 
QSVEncContext *q)
 return 0;
 }
 
+#if QSV_HAVE_OPAQUE
 static int qsv_init_opaque_alloc(AVCodecContext *avctx, QSVEncContext *q)
 {
 AVQSVContext *qsv = avctx->hwaccel_context;
@@ -1065,6 +1066,7 @@ static int qsv_init_opaque_alloc(AVCodecContext *avctx, 
QSVEncContext *q)
 
 return 0;
 }
+#endif
 
 static int qsvenc_init_session(AVCodecContext *avctx, QSVEncContext *q)
 {
@@ -1080,7 +1082,11 @@ static int qsvenc_init_session(AVCodecContext *avctx, 
QSVEncContext *q)
 
 ret = ff_qsv_init_session_frames(avctx, &q->internal_qs.session,
  &q->frames_ctx, q->load_plugins,
+#if QSV_HAVE_OPAQUE
  q->param.IOPattern == 
MFX_IOPATTERN_IN_OPAQUE_MEMORY,
+#els

[FFmpeg-devel] [PATCH v6 09/10] qsv: use a new method to create mfx session when using oneVPL

2021-10-15 Thread Haihao Xiang
In oneVPL, MFXLoad() and MFXCreateSession() are required to create a
workable mfx session[1]

Add AccelerationMode config filter for D3D9/D3D11 session (galinart)

The default device is changed to d3d11va for oneVPL when both d3d11va
and dxva2 are enabled on Microsoft Windows

This is in preparation for oneVPL support

[1] 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/programming_guide/VPL_prg_session.html#onevpl-dispatcher

Signed-off-by: galinart 
---
 libavcodec/qsv.c | 197 +++--
 libavcodec/qsv_internal.h|   1 +
 libavcodec/qsvdec.c  |  10 +
 libavcodec/qsvenc.h  |   3 +
 libavcodec/qsvenc_h264.c |   1 -
 libavcodec/qsvenc_hevc.c |   1 -
 libavcodec/qsvenc_jpeg.c |   1 -
 libavcodec/qsvenc_mpeg2.c|   1 -
 libavcodec/qsvenc_vp9.c  |   1 -
 libavfilter/qsvvpp.c | 113 +-
 libavfilter/qsvvpp.h |   5 +
 libavfilter/vf_deinterlace_qsv.c |  14 +-
 libavfilter/vf_scale_qsv.c   |  12 +-
 libavutil/hwcontext_d3d11va.c|  13 ++
 libavutil/hwcontext_d3d11va.h|   5 +
 libavutil/hwcontext_dxva2.c  |   8 +
 libavutil/hwcontext_dxva2.h  |   4 +
 libavutil/hwcontext_qsv.c| 365 +++
 libavutil/hwcontext_qsv.h|   1 +
 libavutil/hwcontext_vaapi.c  |  13 ++
 libavutil/hwcontext_vaapi.h  |   4 +
 21 files changed, 684 insertions(+), 89 deletions(-)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index d6f77908e4..46d3ac95eb 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -47,6 +47,12 @@
 #include 
 #endif
 
+#if QSV_ONEVPL
+#include 
+#else
+#define MFXUnload(a) do { } while(0)
+#endif
+
 int ff_qsv_codec_id_to_mfx(enum AVCodecID codec_id)
 {
 switch (codec_id) {
@@ -387,6 +393,164 @@ static int ff_qsv_set_display_handle(AVCodecContext 
*avctx, QSVSession *qs)
 }
 #endif //AVCODEC_QSV_LINUX_SESSION_HANDLE
 
+#if QSV_ONEVPL
+
+static int qsv_create_mfx_session(AVCodecContext *avctx,
+  mfxIMPL implementation,
+  mfxVersion *pver,
+  int gpu_copy,
+  mfxSession *psession,
+  void **ploader)
+{
+mfxStatus sts;
+mfxLoader loader = NULL;
+mfxSession session = NULL;
+mfxConfig cfg;
+mfxVariant impl_value;
+uint32_t impl_idx = 0;
+
+*psession = NULL;
+
+/* Don't create a new MFX loader if the input loader is valid */
+if (*ploader == NULL) {
+av_log(avctx, AV_LOG_VERBOSE,
+   "Use Intel(R) oneVPL to create MFX session, the required "
+   "implementation version is %d.%d\n",
+   pver->Major, pver->Minor);
+
+loader = MFXLoad();
+
+if (!loader) {
+av_log(avctx, AV_LOG_ERROR, "Error creating a MFX loader\n");
+goto fail;
+}
+
+/* Create configurations for implementation */
+cfg = MFXCreateConfig(loader);
+
+if (!cfg) {
+av_log(avctx, AV_LOG_ERROR, "Error creating a MFX 
configurations\n");
+goto fail;
+}
+
+impl_value.Type = MFX_VARIANT_TYPE_U32;
+impl_value.Data.U32 = (implementation == MFX_IMPL_SOFTWARE) ?
+MFX_IMPL_TYPE_SOFTWARE : MFX_IMPL_TYPE_HARDWARE;
+sts = MFXSetConfigFilterProperty(cfg,
+ (const mfxU8 
*)"mfxImplDescription.Impl", impl_value);
+
+if (sts != MFX_ERR_NONE) {
+av_log(avctx, AV_LOG_ERROR, "Error adding a MFX configuration "
+   "property: %d\n", sts);
+goto fail;
+}
+
+impl_value.Type = MFX_VARIANT_TYPE_U32;
+impl_value.Data.U32 = pver->Version;
+sts = MFXSetConfigFilterProperty(cfg,
+ (const mfxU8 
*)"mfxImplDescription.ApiVersion.Version",
+ impl_value);
+
+if (sts != MFX_ERR_NONE) {
+av_log(avctx, AV_LOG_ERROR, "Error adding a MFX configuration "
+   "property: %d\n", sts);
+goto fail;
+}
+} else {
+av_log(avctx, AV_LOG_VERBOSE,
+   "Use Intel(R) oneVPL to create MFX session with the specified 
MFX loader\n");
+
+loader = *ploader;
+}
+
+while (1) {
+/* Enumerate all implementations */
+mfxImplDescription *impl_desc;
+
+sts = MFXEnumImplementations(loader, impl_idx,
+ MFX_IMPLCAPS_IMPLDESCSTRUCTURE,
+ (mfxHDL *)&impl_desc);
+
+/* Failed to find an available implementation */
+if (sts == MFX_ERR_NOT_FOUND)
+break;
+else if (sts != MFX_ERR_NONE) {
+impl_idx++;
+continue;
+}
+
+sts = MFXCreateSession(loader, impl_idx, &session);
+MFXDispRelease

[FFmpeg-devel] [PATCH v6 10/10] configure: add --enable-libvpl option

2021-10-15 Thread Haihao Xiang
This allows user to build FFmpeg against Intel oneVPL. oneVPL 2.2
is the required minimum version when building Intel oneVPL code.

It will fail to run configure script if both libmfx and libvpl are
enabled.

It is recommended to use oneVPL for new work, even for currently available
hardwares [1]

Note the preferred child device type is d3d11va for libvpl on Windows.
The commands below will use d3d11va if d3d11va is available on Windows.
$> ffmpeg -hwaccel qsv -c:v h264_qsv ...
$> ffmpeg -qsv_device 0 -hwaccel qsv -c:v h264_qsv ...
$> ffmpeg -init_hw_device qsv=qsv:hw_any -hwaccel qsv -c:v h264_qsv ...
$> ffmpeg -init_hw_device qsv=qsv:hw_any,child_device=0 -hwaccel qsv -c:v 
h264_qsv ...

User may use child_device_type option to specify child device type to
dxva2 or derive a qsv device from a dxva2 device
$> ffmpeg -init_hw_device qsv=qsv:hw_any,child_device=0,child_device_type=dxva2 
-hwaccel qsv -c:v h264_qsv ...
$> ffmpeg -init_hw_device dxva2=d3d9:0 -init_hw_device qsv=qsv@d3d9 -hwaccel 
qsv -c:v h264_qsv ...

[1] 
https://software.intel.com/content/www/us/en/develop/articles/upgrading-from-msdk-to-onevpl.html
---
 configure | 27 +--
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index cc5894dcac..88dc2bda91 100755
--- a/configure
+++ b/configure
@@ -337,6 +337,7 @@ External library support:
   --disable-ffnvcodec  disable dynamically linked Nvidia code [autodetect]
   --enable-libdrm  enable DRM code (Linux) [no]
   --enable-libmfx  enable Intel MediaSDK (AKA Quick Sync Video) code 
via libmfx [no]
+  --enable-libvpl  enable Intel oneVPL code via libvpl if libmfx is 
not used [no]
   --enable-libnpp  enable Nvidia Performance Primitives-based code [no]
   --enable-mmalenable Broadcom Multi-Media Abstraction Layer 
(Raspberry Pi) via MMAL [no]
   --disable-nvdec  disable Nvidia video decoding acceleration (via 
hwaccel) [autodetect]
@@ -1898,6 +1899,7 @@ HWACCEL_LIBRARY_NONFREE_LIST="
 HWACCEL_LIBRARY_LIST="
 $HWACCEL_LIBRARY_NONFREE_LIST
 libmfx
+libvpl
 mmal
 omx
 opencl
@@ -6432,22 +6434,35 @@ enabled libilbc   && require libilbc ilbc.h 
WebRtcIlbcfix_InitDecode -li
 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 liblensfun&& require_pkg_config liblensfun lensfun lensfun.h 
lf_db_new
+
+if enabled libmfx && enabled libvpl; then
+   die "ERROR: can not use libmfx and libvpl together"
 # 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
 # installation route altogether.  If libmfx is installed via the Intel
 # Media SDK or Intel Media Server Studio, these don't come with
 # pkg-config support.  Instead, users should make sure that the build
 # can find the libraries and headers through other means.
-
-enabled libmfx&& { { check_pkg_config libmfx "libmfx < 2.0" 
"mfxvideo.h" MFXInit ||
+elif enabled libmfx; then
+{ check_pkg_config libmfx "libmfx < 2.0" "mfxvideo.h" MFXInit || \
 # Some old versions of libmfx have the following settings in libmfx.pc:
 #   includedir=/usr/include
 #   Cflags: -I${includedir}
 # So add -I${includedir}/mfx to CFLAGS
- { check_pkg_config libmfx "libmfx < 2.0" 
"mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
- { require "libmfx < 2.0" "mfxvideo.h" MFXInit 
"-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } &&
-   warn "build FFmpeg against libmfx 1.x, obsolete 
features of libmfx such as OPAQUE memory,\n"\
-"multi-frame encode, user plugins and 
LA_EXT rate control mode are enabled"; }
+  { check_pkg_config libmfx "libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && 
add_cflags -I${libmfx_incdir}/mfx; } ||
+  { require "libmfx < 2.0" "mfxvideo.h" MFXInit "-llibmfx 
$advapi32_extralibs" && warn "using libmfx without pkg-config"; } } &&
+warn "build FFmpeg against libmfx 1.x, obsolete features of libmfx such as 
OPAQUE memory,\n"\
+ "multi-frame encode, user plugins and LA_EXT rate control mode are 
enabled"
+elif enabled libvpl; then
+# Consider pkg-config only. The name of libmfx is still passed to 
check_pkg_config function for --enable-libvpl option
+# because QSV has dependency on libmfx, we can use the same dependency if 
using libmfx in this check. The package name
+# is extracted from "vpl >= 2.2"
+check_pkg_config libmfx "vpl >= 2.2" "mfxvideo.h mfxdispatcher.h" MFXLoad 
&& \
+warn "build FFmpeg against oneVPL 2.2+, OPAQUE memory, multi-frame 
encode, user plugins\n"\
+ "and LA_EXT rate control mode in FFmpeg QSV won't be supported." 
||
+  

[FFmpeg-devel] [PATCH v6 06/10] qsvenc: support multi-frame encode when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This is
in preparation for oneVPL support

[1]: 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2]: https://github.com/oneapi-src/oneVPL
---
 libavcodec/qsvenc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 7a71ffe98f..93af4d1198 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -64,7 +64,7 @@
 #define QSV_HAVE_ICQQSV_VERSION_ATLEAST(1, 28)
 #define QSV_HAVE_VCM0
 #define QSV_HAVE_QVBR   QSV_VERSION_ATLEAST(1, 28)
-#define QSV_HAVE_MF QSV_VERSION_ATLEAST(1, 25)
+#define QSV_HAVE_MF QSV_VERSION_ATLEAST(1, 25) && !QSV_ONEVPL
 #endif
 
 #if !QSV_HAVE_LA_DS
-- 
2.17.1

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

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


[FFmpeg-devel] [PATCH v6 07/10] qsvenc: support MFX_RATECONTROL_LA_EXT when MFX_VERSION < 2.0

2021-10-15 Thread Haihao Xiang
MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2].
This is in preparation for oneVPL support

[1]: 
https://spec.oneapi.io/versions/latest/elements/oneVPL/source/appendix/VPL_intel_media_sdk.html#msdk-full-name-feature-removals
[2]: https://github.com/oneapi-src/oneVPL
---
 libavcodec/qsvenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 7eaa680ae4..6c6494745f 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -100,7 +100,7 @@ static const struct {
 #if QSV_HAVE_VCM
 { MFX_RATECONTROL_VCM, "VCM" },
 #endif
-#if QSV_VERSION_ATLEAST(1, 10)
+#if QSV_VERSION_ATLEAST(1, 10) && !QSV_ONEVPL
 { MFX_RATECONTROL_LA_EXT,  "LA_EXT" },
 #endif
 #if QSV_HAVE_LA_HRD
-- 
2.17.1

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

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


Re: [FFmpeg-devel] [PATCH v3 1/4] libswscale/x86/rgb2rgb: add shuffle_bytes avx2

2021-10-15 Thread Wu Jianhua
Michael wrote:

> > On Thu, Oct 14, 2021 at 07:19:37AM +, Wu, Jianhua wrote:

> > Ping.

> >

> > Hi there,

> >

> > Any update?



> you posted a v4 but "ping" v3 ?

> is that intended


No, it's not intentional. I'm sorry I pinged an incorrect version, and the v4 
is for updating the incorrect commit message for patches 3-4. The correct 
thread is this one: 
http://ffmpeg.org/pipermail/ffmpeg-devel/2021-September/286334.html

Thanks for your reminder.
Jianhua

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

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


Re: [FFmpeg-devel] [PATCH 5/8] avformat/mov: support dvwC box for Dolby Vision

2021-10-15 Thread lance . lmwang
On Fri, Oct 15, 2021 at 04:40:26PM +0800, myp...@gmail.com wrote:
> On Thu, Oct 14, 2021 at 9:10 PM  wrote:
> >
> > From: Limin Wang 
> >
> > By < > 2.2>>
> >
> > Signed-off-by: Limin Wang 
> > ---
> >  libavformat/mov.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/mov.c b/libavformat/mov.c
> > index 57c67e3..49a8c27 100644
> > --- a/libavformat/mov.c
> > +++ b/libavformat/mov.c
> > @@ -7074,7 +7074,7 @@ static int mov_read_dvcc_dvvc(MOVContext *c, 
> > AVIOContext *pb, MOVAtom atom)
> >  return ret;
> >  }
> >
> > -av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC box, version: %d.%d, 
> > profile: %d, level: %d, "
> > +av_log(c, AV_LOG_TRACE, "DOVI in dvcC/dvvC/dvwC box, version: %d.%d, 
> > profile: %d, level: %d, "
> > "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: 
> > %d\n",
> > dovi->dv_version_major, dovi->dv_version_minor,
> > dovi->dv_profile, dovi->dv_level,
> > @@ -7273,6 +7273,7 @@ static const MOVParseTableEntry 
> > mov_default_parse_table[] = {
> >  { MKTAG('c','l','l','i'), mov_read_clli },
> >  { MKTAG('d','v','c','C'), mov_read_dvcc_dvvc },
> >  { MKTAG('d','v','v','C'), mov_read_dvcc_dvvc },
> > +{ MKTAG('d','v','w','C'), mov_read_dvcc_dvvc },
> >  { MKTAG('k','i','n','d'), mov_read_kind },
> >  { 0, NULL }
> >  };
> > --
> > 1.8.3.1
> Do you have test clip for this patch?

I tested with created sample with the mov muxer in the patchset. I haven't saw 
such
sample released by dolby.

-- 
Thanks,
Limin Wang
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/speexdec: Check frames_per_packet more completely

2021-10-15 Thread Michael Niedermayer
On Fri, Oct 15, 2021 at 08:52:39AM +0200, Paul B Mahol wrote:
> On Fri, Oct 15, 2021 at 12:20 AM James Almer  wrote:
> 
> > On 10/14/2021 7:13 PM, Michael Niedermayer wrote:
> > > Fixes: signed integer overflow: 2105344 * 539033345 cannot be
> > represented in type 'int'
> > > Fixes: out of array write
> > > Fixes:
> > 39956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4766419250708480
> > >
> > > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >   libavcodec/speexdec.c | 2 +-
> > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
> > > index 4c50f54f27b..05f084de2e5 100644
> > > --- a/libavcodec/speexdec.c
> > > +++ b/libavcodec/speexdec.c
> > > @@ -1428,7 +1428,7 @@ static int parse_speex_extradata(AVCodecContext
> > *avctx,
> > >   return AVERROR_INVALIDDATA;
> > >   s->vbr = bytestream_get_le32(&buf);
> > >   s->frames_per_packet = bytestream_get_le32(&buf);
> > > -if (s->frames_per_packet <= 0)
> > > +if (s->frames_per_packet <= 0 || s->frames_per_packet >= INT32_MAX
> > / s->frame_size)
> >
> > s->frames_per_packet * s->frame_size is then multiplied by channel count
> > (which can be at most 2) for the vector_fmul_scalar() call, so might as
> > well check for that here too.
> >
> > Alternatively, all floatdsp functions could be adapted to take size_t
> > buffer lengths.
> >
> 
> Limit it to 32/64.

you mean like this: (64 channels) ?

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 4c50f54f27b..1fc1eea1a1b 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -1428,7 +1428,7 @@ static int parse_speex_extradata(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 s->vbr = bytestream_get_le32(&buf);
 s->frames_per_packet = bytestream_get_le32(&buf);
-if (s->frames_per_packet <= 0)
+if (s->frames_per_packet <= 0 || s->frames_per_packet >= INT32_MAX / 64 / 
s->frame_size)
 return AVERROR_INVALIDDATA;
 s->extra_headers = bytestream_get_le32(&buf);
 


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/speexdec: Check frames_per_packet more completely

2021-10-15 Thread Paul B Mahol
On Fri, Oct 15, 2021 at 7:26 PM Michael Niedermayer 
wrote:

> On Fri, Oct 15, 2021 at 08:52:39AM +0200, Paul B Mahol wrote:
> > On Fri, Oct 15, 2021 at 12:20 AM James Almer  wrote:
> >
> > > On 10/14/2021 7:13 PM, Michael Niedermayer wrote:
> > > > Fixes: signed integer overflow: 2105344 * 539033345 cannot be
> > > represented in type 'int'
> > > > Fixes: out of array write
> > > > Fixes:
> > >
> 39956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4766419250708480
> > > >
> > > > Found-by: continuous fuzzing process
> > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > > Signed-off-by: Michael Niedermayer 
> > > > ---
> > > >   libavcodec/speexdec.c | 2 +-
> > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
> > > > index 4c50f54f27b..05f084de2e5 100644
> > > > --- a/libavcodec/speexdec.c
> > > > +++ b/libavcodec/speexdec.c
> > > > @@ -1428,7 +1428,7 @@ static int parse_speex_extradata(AVCodecContext
> > > *avctx,
> > > >   return AVERROR_INVALIDDATA;
> > > >   s->vbr = bytestream_get_le32(&buf);
> > > >   s->frames_per_packet = bytestream_get_le32(&buf);
> > > > -if (s->frames_per_packet <= 0)
> > > > +if (s->frames_per_packet <= 0 || s->frames_per_packet >=
> INT32_MAX
> > > / s->frame_size)
> > >
> > > s->frames_per_packet * s->frame_size is then multiplied by channel
> count
> > > (which can be at most 2) for the vector_fmul_scalar() call, so might as
> > > well check for that here too.
> > >
> > > Alternatively, all floatdsp functions could be adapted to take size_t
> > > buffer lengths.
> > >
> >
> > Limit it to 32/64.
>
> you mean like this: (64 channels) ?
>

I mean limit max frames per packet to 64.

>
> diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
> index 4c50f54f27b..1fc1eea1a1b 100644
> --- a/libavcodec/speexdec.c
> +++ b/libavcodec/speexdec.c
> @@ -1428,7 +1428,7 @@ static int parse_speex_extradata(AVCodecContext
> *avctx,
>  return AVERROR_INVALIDDATA;
>  s->vbr = bytestream_get_le32(&buf);
>  s->frames_per_packet = bytestream_get_le32(&buf);
> -if (s->frames_per_packet <= 0)
> +if (s->frames_per_packet <= 0 || s->frames_per_packet >= INT32_MAX /
> 64 / s->frame_size)
>  return AVERROR_INVALIDDATA;
>  s->extra_headers = bytestream_get_le32(&buf);
>
>
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> In a rich man's house there is no place to spit but his face.
> -- Diogenes of Sinope
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


Re: [FFmpeg-devel] [PATCH v6 00/10] make QSV works with the Intel's oneVPL

2021-10-15 Thread Soft Works



> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Haihao Xiang
> Sent: Friday, October 15, 2021 3:39 PM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Haihao Xiang 
> Subject: [FFmpeg-devel] [PATCH v6 00/10] make QSV works with the
> Intel's oneVPL
> 
> The oneAPI Video Processing Library (oneVPL) is a single interface
> for
> encode, decode and video processing[1]. oneVPL is a successor to
> Intel(R) Media
> SDK, but removed obsolete features. Intel(R) Media SDK lifetime comes
> to an
> end now, new features for new Intel Gen platforms will be supported
> in oneVPL
> only[2].
> 
> It is recommended to use oneVPL for new work, even for currently
> available
> hardwares[3]. Hence, this patchset added a new option --enable-onevpl
> to bring
> the support for oneVPL in QSV. New features for oneVPL will be
> implemented in
> other patchset. --enble-libmfx option still works with Intel(R) Media
> SDK.
> 
> Note user can't enable onevpl and libmfx together.
> 
> oneVPL dispatcher source code:
> https://github.com/oneapi-src/oneVPL
> 
> oneVPL GPU runtime for new Intel Gen platforms:
> https://github.com/oneapi-src/oneVPL-intel-gpu
> 
> v6:
>   - Use ${libmfx_incdir} in configure
>   - Don't define mfx related function in an exported header
>   - Rebased this patchset against the latest master and fixed bugs
> 
> [1]
> https://spec.oneapi.io/versions/latest/elements/oneVPL/source/index.h
> tml
> [2] https://github.com/Intel-Media-SDK/MediaSDK/#media-sdk-support-
> matrix
> [3]
> https://software.intel.com/content/www/us/en/develop/articles/upgradi
> ng-from-msdk-to-onevpl.html
> 

Hi Haihao,

I really appreciate all the effort that Intel is taking to improve 
ffmppeg for QSV hw acceleration, but in this case I'm not convinced
that this should be merged into ffmpeg at this time.

Let's look at the messages from your individual commits:

> User plugin isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
> preparation for oneVPL Support

> OPAQUE memory isn't supported for MFX_VERSION >= 2.0[1][2]. This is
> in preparation for oneVPL support

> Audio isn't supported for MFX_VERSION >= 2.0[1][2]. This is in
> preparation for oneVPL support

> Multi-frame encode isn't supported for MFX_VERSION >= 2.0[1][2]. This
> is in preparation for oneVPL support

> MFX_RATECONTROL_LA_EXT isn't supported for MFX_VERSION >= 2.0[1][2].
> This is in preparation for oneVPL support

In its current state, oneVPL is all about removal of features that
have existed for a long time.

In its current state, it does not provide a single benefit over
libmfx 1.x

New CPU gens are still supported when using the latest libmfx 1.35

All-in-all, there is no single reason for anybody to compile 
ffmpeg with oneVPL instead of libmfx, but several reasons
against doing so.

When I look at your patchset that is in large parts dealing with
the removal of features that are "in preparation for oneVPL", 
I wonder why the ffmpeg code should go through all those 
changes, which are creating a lot of unnecessary noise.

While I don't like the way those recent changes are performed 
by Intel, I'm not opposed to oneVPL in general.
But from my point of view, this is not the right time to deal 
with it at the side of ffmpeg for the reasons above.

My suggestion is to postpone this until:

- the removed features are added to oneVPL
  and
- there exist some actual benefits in using oneVPL over libmfx 1.x

Kind regards,
softworkz





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

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/speexdec: Check frames_per_packet more completely

2021-10-15 Thread Michael Niedermayer
On Fri, Oct 15, 2021 at 07:30:20PM +0200, Paul B Mahol wrote:
> On Fri, Oct 15, 2021 at 7:26 PM Michael Niedermayer 
> wrote:
> 
> > On Fri, Oct 15, 2021 at 08:52:39AM +0200, Paul B Mahol wrote:
> > > On Fri, Oct 15, 2021 at 12:20 AM James Almer  wrote:
> > >
> > > > On 10/14/2021 7:13 PM, Michael Niedermayer wrote:
> > > > > Fixes: signed integer overflow: 2105344 * 539033345 cannot be
> > > > represented in type 'int'
> > > > > Fixes: out of array write
> > > > > Fixes:
> > > >
> > 39956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-4766419250708480
> > > > >
> > > > > Found-by: continuous fuzzing process
> > > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > > > Signed-off-by: Michael Niedermayer 
> > > > > ---
> > > > >   libavcodec/speexdec.c | 2 +-
> > > > >   1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
> > > > > index 4c50f54f27b..05f084de2e5 100644
> > > > > --- a/libavcodec/speexdec.c
> > > > > +++ b/libavcodec/speexdec.c
> > > > > @@ -1428,7 +1428,7 @@ static int parse_speex_extradata(AVCodecContext
> > > > *avctx,
> > > > >   return AVERROR_INVALIDDATA;
> > > > >   s->vbr = bytestream_get_le32(&buf);
> > > > >   s->frames_per_packet = bytestream_get_le32(&buf);
> > > > > -if (s->frames_per_packet <= 0)
> > > > > +if (s->frames_per_packet <= 0 || s->frames_per_packet >=
> > INT32_MAX
> > > > / s->frame_size)
> > > >
> > > > s->frames_per_packet * s->frame_size is then multiplied by channel
> > count
> > > > (which can be at most 2) for the vector_fmul_scalar() call, so might as
> > > > well check for that here too.
> > > >
> > > > Alternatively, all floatdsp functions could be adapted to take size_t
> > > > buffer lengths.
> > > >
> > >
> > > Limit it to 32/64.
> >
> > you mean like this: (64 channels) ?
> >
> 
> I mean limit max frames per packet to 64.

that would give something like this: unless we can bound frame_size tighter

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 4c50f54f27b..d240e8a20bf 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -1428,7 +1428,9 @@ static int parse_speex_extradata(AVCodecContext *avctx,
 return AVERROR_INVALIDDATA;
 s->vbr = bytestream_get_le32(&buf);
 s->frames_per_packet = bytestream_get_le32(&buf);
-if (s->frames_per_packet <= 0)
+if (s->frames_per_packet <= 0 ||
+s->frames_per_packet > 64 ||
+s->frames_per_packet >= INT32_MAX / s->nb_channels / s->frame_size)
 return AVERROR_INVALIDDATA;
 s->extra_headers = bytestream_get_le32(&buf);

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

If the United States is serious about tackling the national security threats 
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier


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

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


[FFmpeg-devel] Patch to remove build path from tools/cl2c

2021-10-15 Thread Vagrant Cascadian
The attached patch removes build paths from the resulting binaries,
which makes it easier to verify the reproducibility of a build without
needing to know the path from which it was originally built.

I ran "make fate" with and without the patch applied, and all of the
tests that passed as of commit 3cc3f5de2afda5b8f880c0817e9d67c2dafbfe1e
still passed (fate-sws-slice-yuv422-12bit-rgb48 and
fate-sws-slice-bgr0-nv12 both failed regardless of weather the patch was
applied).

This was originally reported at https://bugs.debian.org/985187

With this change applied, the ffmpeg package in Debian should build
reproducibly:

  https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ffmpeg.html


Thanks for maintaining and developing ffmpeg, it is a very useful tool!


live well,
  vagrant
From b86db13adc6a27337cd93af174356d80ead1a5a9 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian 
Date: Sat, 13 Mar 2021 03:52:51 +
Subject: [PATCH 1/1] tools/cl2c: Strip full path from input file in embedded
 output.

Without this patch, the full build path gets embedded into various
binaries shipped in the package, for example, libavfilter.a contains
a reference to:

  #line 1 "/build/1st/ffmpeg-4.3.2/libavfilter/opencl/avgblur.cl"

By not embedding the build path, it makes it easier to recreate the
build environment and reproduce the build:

  https://reproducible-builds.org/docs/build-path/

Originally submitted to Debian as:

  https://bugs.debian.org/985187

Signed-off-by: Vagrant Cascadian 
---
 tools/cl2c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/cl2c b/tools/cl2c
index e3f92bab1c..48444e61a7 100755
--- a/tools/cl2c
+++ b/tools/cl2c
@@ -23,11 +23,13 @@ input="$1"
 output="$2"
 
 name=$(basename "$input" | sed 's/.cl$//')
+# Avoid embedded the build path, using only the basename of the input file.
+base_input=$(basename "$input")
 
 cat >$output <

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

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