Re: [FFmpeg-devel] [PATCH V4] Add a filter implementing HDR image generation from a single exposure using deep CNNs

2018-11-04 Thread Liu Steven


> 在 2018年11月5日,下午3:42,Guo, Yejun  写道:
> 
> ask for comment or merge, thanks.
Will push after 24 hours if there have no objections.
> 
>> -Original Message-
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
>> Of Guo, Yejun
>> Sent: Monday, October 29, 2018 11:19 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: Re: [FFmpeg-devel] [PATCH V4] Add a filter implementing HDR
>> image generation from a single exposure using deep CNNs
>> 
>> any more comment? thanks.
>> 
>>> -Original Message-
>>> From: Guo, Yejun
>>> Sent: Tuesday, October 23, 2018 6:46 AM
>>> To: ffmpeg-devel@ffmpeg.org
>>> Cc: Guo, Yejun ; Guo
>>> Subject: [PATCH V4] Add a filter implementing HDR image generation
>>> from a single exposure using deep CNNs
>>> 
>>> see the algorithm's paper and code below.
>>> 
>>> the filter's parameter looks like:
>>> 
>> sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmt=gbrp10l
>>> e
>>> 
>>> The input of the deep CNN model is RGB24 while the output is float for
>>> each color channel. This is the filter's default behavior to output
>>> format with gbrpf32le. And gbrp10le is also supported as the output,
>>> so we can see the rendering result in a player, as a reference.
>>> 
>>> To generate the model file, we need modify the original script a little.
>>> - set name='y' for y_final within script at
>>> https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py
>>> - add the following code to the script at
>>> https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict.
>>> py
>>> 
>>> graph = tf.graph_util.convert_variables_to_constants(sess,
>>> sess.graph_def,
>>> ["y"]) tf.train.write_graph(graph, '.', 'graph.pb', as_text=False)
>>> 
>>> The filter only works when tensorflow C api is supported in the
>>> system, native backend is not supported since there are some different
>>> types of layers in the deep CNN model, besides CONV and
>> DEPTH_TO_SPACE.
>>> 
>>> https://arxiv.org/pdf/1710.07480.pdf:
>>>  author   = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy
>> and
>>> Mantiuk, Rafał and Unger, Jonas",
>>>  title= "HDR image reconstruction from a single exposure using deep
>>> CNNs",
>>>  journal  = "ACM Transactions on Graphics (TOG)",
>>>  number   = "6",
>>>  volume   = "36",
>>>  articleno= "178",
>>>  year = "2017"
>>> 
>>> https://github.com/gabrieleilertsen/hdrcnn
>>> 
>>> btw, as a whole solution, metadata should also be generated from the
>>> sdr video, so to be encoded as a HDR video. Not supported yet.
>>> This patch just focuses on this paper.
>>> 
>>> Signed-off-by: Guo, Yejun 
>>> ---
>>> configure|   1 +
>>> doc/filters.texi |  35 +++
>>> libavfilter/Makefile |   1 +
>>> libavfilter/allfilters.c |   1 +
>>> libavfilter/vf_sdr2hdr.c | 268
>>> +++
>>> 5 files changed, 306 insertions(+)
>>> create mode 100644 libavfilter/vf_sdr2hdr.c
>>> 
>>> diff --git a/configure b/configure
>>> index 85d5dd5..5e2efba 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -3438,6 +3438,7 @@ scale2ref_filter_deps="swscale"
>>> scale_filter_deps="swscale"
>>> scale_qsv_filter_deps="libmfx"
>>> select_filter_select="pixelutils"
>>> +sdr2hdr_filter_deps="libtensorflow"
>>> sharpness_vaapi_filter_deps="vaapi"
>>> showcqt_filter_deps="avcodec avformat swscale"
>>> showcqt_filter_suggest="libfontconfig libfreetype"
>>> diff --git a/doc/filters.texi b/doc/filters.texi index
>>> 17e2549..bba9f87 100644
>>> --- a/doc/filters.texi
>>> +++ b/doc/filters.texi
>>> @@ -14672,6 +14672,41 @@ Scale a subtitle stream (b) to match the main
>>> video (a) in size before overlayin  @end example  @end itemize
>>> 
>>> +@section sdr2hdr
>>> +
>>> +HDR image generation from a single exposure using deep CNNs with
>>> TensorFlow C library.
>>> +
>>> +@itemize
>>> +@item
>>> +paper:  see @url{https://arxiv.org/pdf/1710.07480.pdf}
>>> +
>>> +@item
>>> +code with model and trained parameters: see
>>> +@url{https://github.com/gabrieleilertsen/hdrcnn}
>>> +@end itemize
>>> +
>>> +The filter accepts the following options:
>>> +
>>> +@table @option
>>> +
>>> +@item model_filename
>>> +Set path to model file specifying network architecture and its parameters.
>>> +
>>> +@item out_fmt
>>> +the data format of the filter's output.
>>> +
>>> +It accepts the following values:
>>> +@table @samp
>>> +@item gbrpf32le
>>> +force gbrpf32le output
>>> +
>>> +@item gbrp10le
>>> +force gbrp10le output
>>> +@end table
>>> +
>>> +Default value is @samp{gbrpf32le}.
>>> +
>>> +@end table
>>> +
>>> @anchor{selectivecolor}
>>> @section selectivecolor
>>> 
>>> diff --git a/libavfilter/Makefile b/libavfilter/Makefile index
>>> 62cc2f5..88e7da6
>>> 100644
>>> --- a/libavfilter/Makefile
>>> +++ b/libavfilter/Makefile
>>> @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER)   +=
>>> vf_convolution_opencl.o opencl.o
>>> OBJS-$(CONFIG_SPLIT_FILTER)  += 

Re: [FFmpeg-devel] [PATCH V4] Add a filter implementing HDR image generation from a single exposure using deep CNNs

2018-11-04 Thread Guo, Yejun
ask for comment or merge, thanks.

> -Original Message-
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Guo, Yejun
> Sent: Monday, October 29, 2018 11:19 AM
> To: ffmpeg-devel@ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH V4] Add a filter implementing HDR
> image generation from a single exposure using deep CNNs
> 
> any more comment? thanks.
> 
> > -Original Message-
> > From: Guo, Yejun
> > Sent: Tuesday, October 23, 2018 6:46 AM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Guo, Yejun ; Guo
> > Subject: [PATCH V4] Add a filter implementing HDR image generation
> > from a single exposure using deep CNNs
> >
> > see the algorithm's paper and code below.
> >
> > the filter's parameter looks like:
> >
> sdr2hdr=model_filename=/path_to_tensorflow_graph.pb:out_fmt=gbrp10l
> > e
> >
> > The input of the deep CNN model is RGB24 while the output is float for
> > each color channel. This is the filter's default behavior to output
> > format with gbrpf32le. And gbrp10le is also supported as the output,
> > so we can see the rendering result in a player, as a reference.
> >
> > To generate the model file, we need modify the original script a little.
> > - set name='y' for y_final within script at
> > https://github.com/gabrieleilertsen/hdrcnn/blob/master/network.py
> > - add the following code to the script at
> > https://github.com/gabrieleilertsen/hdrcnn/blob/master/hdrcnn_predict.
> > py
> >
> > graph = tf.graph_util.convert_variables_to_constants(sess,
> > sess.graph_def,
> > ["y"]) tf.train.write_graph(graph, '.', 'graph.pb', as_text=False)
> >
> > The filter only works when tensorflow C api is supported in the
> > system, native backend is not supported since there are some different
> > types of layers in the deep CNN model, besides CONV and
> DEPTH_TO_SPACE.
> >
> > https://arxiv.org/pdf/1710.07480.pdf:
> >   author   = "Eilertsen, Gabriel and Kronander, Joel, and Denes, Gyorgy
> and
> > Mantiuk, Rafał and Unger, Jonas",
> >   title= "HDR image reconstruction from a single exposure using deep
> > CNNs",
> >   journal  = "ACM Transactions on Graphics (TOG)",
> >   number   = "6",
> >   volume   = "36",
> >   articleno= "178",
> >   year = "2017"
> >
> > https://github.com/gabrieleilertsen/hdrcnn
> >
> > btw, as a whole solution, metadata should also be generated from the
> > sdr video, so to be encoded as a HDR video. Not supported yet.
> > This patch just focuses on this paper.
> >
> > Signed-off-by: Guo, Yejun 
> > ---
> >  configure|   1 +
> >  doc/filters.texi |  35 +++
> >  libavfilter/Makefile |   1 +
> >  libavfilter/allfilters.c |   1 +
> >  libavfilter/vf_sdr2hdr.c | 268
> > +++
> >  5 files changed, 306 insertions(+)
> >  create mode 100644 libavfilter/vf_sdr2hdr.c
> >
> > diff --git a/configure b/configure
> > index 85d5dd5..5e2efba 100755
> > --- a/configure
> > +++ b/configure
> > @@ -3438,6 +3438,7 @@ scale2ref_filter_deps="swscale"
> >  scale_filter_deps="swscale"
> >  scale_qsv_filter_deps="libmfx"
> >  select_filter_select="pixelutils"
> > +sdr2hdr_filter_deps="libtensorflow"
> >  sharpness_vaapi_filter_deps="vaapi"
> >  showcqt_filter_deps="avcodec avformat swscale"
> >  showcqt_filter_suggest="libfontconfig libfreetype"
> > diff --git a/doc/filters.texi b/doc/filters.texi index
> > 17e2549..bba9f87 100644
> > --- a/doc/filters.texi
> > +++ b/doc/filters.texi
> > @@ -14672,6 +14672,41 @@ Scale a subtitle stream (b) to match the main
> > video (a) in size before overlayin  @end example  @end itemize
> >
> > +@section sdr2hdr
> > +
> > +HDR image generation from a single exposure using deep CNNs with
> > TensorFlow C library.
> > +
> > +@itemize
> > +@item
> > +paper:  see @url{https://arxiv.org/pdf/1710.07480.pdf}
> > +
> > +@item
> > +code with model and trained parameters: see
> > +@url{https://github.com/gabrieleilertsen/hdrcnn}
> > +@end itemize
> > +
> > +The filter accepts the following options:
> > +
> > +@table @option
> > +
> > +@item model_filename
> > +Set path to model file specifying network architecture and its parameters.
> > +
> > +@item out_fmt
> > +the data format of the filter's output.
> > +
> > +It accepts the following values:
> > +@table @samp
> > +@item gbrpf32le
> > +force gbrpf32le output
> > +
> > +@item gbrp10le
> > +force gbrp10le output
> > +@end table
> > +
> > +Default value is @samp{gbrpf32le}.
> > +
> > +@end table
> > +
> >  @anchor{selectivecolor}
> >  @section selectivecolor
> >
> > diff --git a/libavfilter/Makefile b/libavfilter/Makefile index
> > 62cc2f5..88e7da6
> > 100644
> > --- a/libavfilter/Makefile
> > +++ b/libavfilter/Makefile
> > @@ -360,6 +360,7 @@ OBJS-$(CONFIG_SOBEL_OPENCL_FILTER)   +=
> > vf_convolution_opencl.o opencl.o
> >  OBJS-$(CONFIG_SPLIT_FILTER)  += split.o
> >  OBJS-$(CONFIG_SPP_FILTER)+= vf_spp.o
> >  OBJS-$(CONFIG_SR_FILTER)

[FFmpeg-devel] [PATCH] avcodec/mips: [loongson] refine optimization in h264_chroma.

2018-11-04 Thread Shiyou Yin
Remove invalid operation in the case x and y all equal 0,
this refine made about 2% speedup for H264 decode on loongson platform.
---
 libavcodec/mips/h264chroma_mmi.c | 970 +--
 1 file changed, 426 insertions(+), 544 deletions(-)

diff --git a/libavcodec/mips/h264chroma_mmi.c b/libavcodec/mips/h264chroma_mmi.c
index 91b2cc4..afda5be 100644
--- a/libavcodec/mips/h264chroma_mmi.c
+++ b/libavcodec/mips/h264chroma_mmi.c
@@ -30,74 +30,177 @@ void ff_put_h264_chroma_mc8_mmi(uint8_t *dst, uint8_t 
*src, ptrdiff_t stride,
 int h, int x, int y)
 {
 int A = 64, B, C, D, E;
-double ftmp[10];
+double ftmp[12];
 uint64_t tmp[1];
 
 if (!(x || y)) {
 /* x=0, y=0, A=64 */
 __asm__ volatile (
-"xor%[ftmp0],   %[ftmp0],   %[ftmp0]   \n\t"
-"dli%[tmp0],0x06   \n\t"
-"mtc1   %[tmp0],%[ftmp4]   \n\t"
-
 "1:\n\t"
+MMI_ULDC1(%[ftmp0], %[src], 0x00)
+PTR_ADDU   "%[src], %[src], %[stride]  \n\t"
 MMI_ULDC1(%[ftmp1], %[src], 0x00)
-"addi   %[h],   %[h],   -0x04  \n\t"
 PTR_ADDU   "%[src], %[src], %[stride]  \n\t"
-MMI_ULDC1(%[ftmp5], %[src], 0x00)
+MMI_ULDC1(%[ftmp2], %[src], 0x00)
 PTR_ADDU   "%[src], %[src], %[stride]  \n\t"
-MMI_ULDC1(%[ftmp6], %[src], 0x00)
+MMI_ULDC1(%[ftmp3], %[src], 0x00)
 PTR_ADDU   "%[src], %[src], %[stride]  \n\t"
-MMI_ULDC1(%[ftmp7], %[src], 0x00)
 
-"punpcklbh  %[ftmp2],   %[ftmp1],   %[ftmp0]   \n\t"
-"punpckhbh  %[ftmp3],   %[ftmp1],   %[ftmp0]   \n\t"
-"psllh  %[ftmp1],   %[ftmp2],   %[ftmp4]   \n\t"
-"psllh  %[ftmp2],   %[ftmp3],   %[ftmp4]   \n\t"
-"paddh  %[ftmp1],   %[ftmp1],   %[ff_pw_32]\n\t"
-"paddh  %[ftmp2],   %[ftmp2],   %[ff_pw_32]\n\t"
-"psrlh  %[ftmp1],   %[ftmp1],   %[ftmp4]   \n\t"
-"psrlh  %[ftmp2],   %[ftmp2],   %[ftmp4]   \n\t"
-"packushb   %[ftmp1],   %[ftmp1],   %[ftmp2]   \n\t"
-MMI_SDC1(%[ftmp1], %[dst], 0x00)
+"addi   %[h],   %[h],   -0x04  \n\t"
 
-"punpcklbh  %[ftmp2],   %[ftmp5],   %[ftmp0]   \n\t"
-"punpckhbh  %[ftmp3],   %[ftmp5],   %[ftmp0]   \n\t"
-"psllh  %[ftmp1],   %[ftmp2],   %[ftmp4]   \n\t"
-"psllh  %[ftmp2],   %[ftmp3],   %[ftmp4]   \n\t"
-"paddh  %[ftmp1],   %[ftmp1],   %[ff_pw_32]\n\t"
-"paddh  %[ftmp2],   %[ftmp2],   %[ff_pw_32]\n\t"
-"psrlh  %[ftmp1],   %[ftmp1],   %[ftmp4]   \n\t"
-"psrlh  %[ftmp2],   %[ftmp2],   %[ftmp4]   \n\t"
-"packushb   %[ftmp1],   %[ftmp1],   %[ftmp2]   \n\t"
+MMI_SDC1(%[ftmp0], %[dst], 0x00)
 PTR_ADDU   "%[dst], %[dst], %[stride]  \n\t"
 MMI_SDC1(%[ftmp1], %[dst], 0x00)
+PTR_ADDU   "%[dst], %[dst], %[stride]  \n\t"
+MMI_SDC1(%[ftmp2], %[dst], 0x00)
+PTR_ADDU   "%[dst], %[dst], %[stride]  \n\t"
+MMI_SDC1(%[ftmp3], %[dst], 0x00)
+PTR_ADDU   "%[dst], %[dst], %[stride]  \n\t"
+"bnez   %[h],   1b \n\t"
+: [ftmp0]"="(ftmp[0]),[ftmp1]"="(ftmp[1]),
+  [ftmp2]"="(ftmp[2]),[ftmp3]"="(ftmp[3]),
+  [dst]"+"(dst),  [src]"+"(src),
+  [h]"+"(h)
+: [stride]"r"((mips_reg)stride)
+: "memory"
+);
+} else if (x && y) {
+/* x!=0, y!=0 */
+D = x * y;
+B = (x << 3) - D;
+C = (y << 3) - D;
+A = 64 - D - B - C;
 
-"punpcklbh  %[ftmp2],   %[ftmp6],   %[ftmp0]   \n\t"
-"punpckhbh  %[ftmp3],   %[ftmp6],   %[ftmp0]   \n\t"
-"psllh  %[ftmp1],   %[ftmp2],   %[ftmp4]   \n\t"
-"psllh  %[ftmp2],   %[ftmp3],   %[ftmp4]   \n\t"
+__asm__ volatile (
+"xor%[ftmp0],   %[ftmp0],   %[ftmp0]   \n\t"
+"dli%[tmp0],0x06   \n\t"
+"pshufh %[A],   %[A],   %[ftmp0]   \n\t"
+"pshufh %[B],   %[B],   %[ftmp0] 

[FFmpeg-devel] [PATCH] [V2] avcodec/qsvenc: add VDENC support for H264 and HEVC

2018-11-04 Thread Linjie Fu
Add VDENC(lowpower mode) support for QSV h264 and HEVC

It's an experimental function(like lowpower in vaapi) with
some limitations:
- CBR/VBR require HuC which should be explicitly loaded via i915
module parameter(i915.enable_guc=2 for linux kerner version >= 4.16)
- HEVC VDENC was supported >= ICE LAKE

use option "-low_power 1" to enable VDENC.

[V2]: modified the commit message and option comments, use AV_OPT_TYPE_BOOL
to replace AV_OPT_TYPE_INT.

Signed-off-by: Linjie Fu 
---
 libavcodec/qsvenc.c  | 3 +++
 libavcodec/qsvenc.h  | 2 ++
 libavcodec/qsvenc_h264.c | 3 +++
 libavcodec/qsvenc_hevc.c | 3 +++
 4 files changed, 11 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 948751daf4..7a031297fe 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -464,6 +464,9 @@ static int init_video_param(AVCodecContext *avctx, 
QSVEncContext *q)
 }
 }
 
+#if QSV_HAVE_VDENC
+q->param.mfx.LowPower   = q->low_power ? 
MFX_CODINGOPTION_ON:MFX_CODINGOPTION_OFF;
+#endif
 q->param.mfx.CodecProfile   = q->profile;
 q->param.mfx.TargetUsage= avctx->compression_level;
 q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size);
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 50cc4267e7..a396aa7d3f 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -44,6 +44,7 @@
 #define QSV_HAVE_LA QSV_VERSION_ATLEAST(1, 7)
 #define QSV_HAVE_LA_DS  QSV_VERSION_ATLEAST(1, 8)
 #define QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
+#define QSV_HAVE_VDENC  QSV_VERSION_ATLEAST(1, 15)
 
 #if defined(_WIN32) || defined(__CYGWIN__)
 #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)
@@ -162,6 +163,7 @@ typedef struct QSVEncContext {
 int recovery_point_sei;
 
 int a53_cc;
+int low_power;
 
 #if QSV_HAVE_MF
 int mfmode;
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index 07c9d64e6b..e538e0ad52 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -153,6 +153,9 @@ static const AVOption options[] = {
 { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_DISABLED }, 
INT_MIN, INT_MAX, VE, "mfmode" },
 { "auto"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_MF_AUTO }, 
INT_MIN, INT_MAX, VE, "mfmode" },
 #endif
+#if QSV_HAVE_VDENC
+{ "low_power", "enable low power mode (experimental, many limitations by 
mfx version, HW platform, BRC modes, etc.", OFFSET(qsv.low_power), 
AV_OPT_TYPE_BOOL, { .i64 =  0 }, 0, 1, VE},
+#endif
 
 { NULL },
 };
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index 4339b316a3..f038f79b94 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -243,6 +243,9 @@ static const AVOption options[] = {
 { "main",NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAIN
}, INT_MIN, INT_MAX, VE, "profile" },
 { "main10",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAIN10  
}, INT_MIN, INT_MAX, VE, "profile" },
 { "mainsp",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MFX_PROFILE_HEVC_MAINSP  
}, INT_MIN, INT_MAX, VE, "profile" },
+#if QSV_HAVE_VDENC
+{ "low_power", "enable low power mode (experimental, many limitations by 
mfx version, HW platform, BRC modes, etc.", OFFSET(qsv.low_power), 
AV_OPT_TYPE_BOOL, { .i64 =  0 },  0,  1, VE },
+#endif
 
 { NULL },
 };
-- 
2.17.1

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


Re: [FFmpeg-devel] [PATCH] avcodec/qsvenc: add VDENC support for H264 and HEVC

2018-11-04 Thread Fu, Linjie
> -Original Message-
> From: Li, Zhong
> Sent: Thursday, November 1, 2018 15:16
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Fu, Linjie 
> Subject: RE: [FFmpeg-devel] [PATCH] avcodec/qsvenc: add VDENC support
> for H264 and HEVC
> 
> > From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On
> Behalf
> > Of Linjie Fu
> > Sent: Thursday, November 1, 2018 10:59 AM
> > To: ffmpeg-devel@ffmpeg.org
> > Cc: Fu, Linjie 
> > Subject: [FFmpeg-devel] [PATCH] avcodec/qsvenc: add VDENC support for
> > H264 and HEVC
> >
> > Add VDENC(lowpower mode) support for QSV h264 and HEVC with the
> > limitation of MSDK API verion greater than 1.15.
> 
> Should be "version", not "verion"
> IMHO, API version limitation is not necessary in the commit message since it
> is quite clear in the code
> 
> >
> > It's an experimental function(like lowpower in vaapi) with some limitations:
> > - CBR/VBR require HuC which should be explicitly loaded via i915 module
> > parameter(i915.enable_guc=2 for >=4.16)
> 
> 4.16 is not a clear message, should be Linux kernel version >= 4.16.
> 
> > - HEVC VDENC was supported >= ICE LAKE
> >
> > use option "-low_power 1" to enable VDENC.
> >
> > Signed-off-by: Linjie Fu 
> > ---
> >  libavcodec/qsvenc.c  | 3 +++
> >  libavcodec/qsvenc.h  | 2 ++
> >  libavcodec/qsvenc_h264.c | 3 +++
> >  libavcodec/qsvenc_hevc.c | 3 +++
> >  4 files changed, 11 insertions(+)
> >
> > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index
> > 948751daf4..7a031297fe 100644
> > --- a/libavcodec/qsvenc.c
> > +++ b/libavcodec/qsvenc.c
> > @@ -464,6 +464,9 @@ static int init_video_param(AVCodecContext *avctx,
> > QSVEncContext *q)
> >  }
> >  }
> >
> > +#if QSV_HAVE_VDENC
> > +q->param.mfx.LowPower   = q->low_power ?
> > MFX_CODINGOPTION_ON:MFX_CODINGOPTION_OFF;
> > +#endif
> >  q->param.mfx.CodecProfile   = q->profile;
> >  q->param.mfx.TargetUsage= avctx->compression_level;
> >  q->param.mfx.GopPicSize = FFMAX(0, avctx->gop_size);
> > diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h index
> > 50cc4267e7..a396aa7d3f 100644
> > --- a/libavcodec/qsvenc.h
> > +++ b/libavcodec/qsvenc.h
> > @@ -44,6 +44,7 @@
> >  #define QSV_HAVE_LA QSV_VERSION_ATLEAST(1, 7)
> >  #define QSV_HAVE_LA_DS  QSV_VERSION_ATLEAST(1, 8)  #define
> > QSV_HAVE_LA_HRD QSV_VERSION_ATLEAST(1, 11)
> > +#define QSV_HAVE_VDENC  QSV_VERSION_ATLEAST(1, 15)
> >
> >  #if defined(_WIN32) || defined(__CYGWIN__)
> >  #define QSV_HAVE_AVBR   QSV_VERSION_ATLEAST(1, 3)
> > @@ -162,6 +163,7 @@ typedef struct QSVEncContext {
> >  int recovery_point_sei;
> >
> >  int a53_cc;
> > +int low_power;
> >
> >  #if QSV_HAVE_MF
> >  int mfmode;
> > diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c index
> > 07c9d64e6b..483faf832b 100644
> > --- a/libavcodec/qsvenc_h264.c
> > +++ b/libavcodec/qsvenc_h264.c
> > @@ -153,6 +153,9 @@ static const AVOption options[] = {
> >  { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> > MFX_MF_DISABLED }, INT_MIN, INT_MAX, VE, "mfmode" },
> >  { "auto"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> > MFX_MF_AUTO }, INT_MIN, INT_MAX, VE, "mfmode" },
> >  #endif
> > +#if QSV_HAVE_VDENC
> > +{ "low_power",  "low power mode for encoder h264_qsv",
> 
> Since it is a h264_qsv private option, it is no need to add the comment "for
> encoder h264_qsv "
> I prefer "enable low power mode (experimental, many limitations by mfx
> version, HW platform, BRC modes, etc.)"
> 
> > OFFSET(qsv.low_power),  AV_OPT_TYPE_INT, { .i64 =  0 }, 0,
> > 1, VE },
> 
> Should be AV_OPT_TYPE_BOOL.
> 
> > +#endif
> >
> >  { NULL },
> >  };
> > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c index
> > 4339b316a3..cfe3674f0f 100644
> > --- a/libavcodec/qsvenc_hevc.c
> > +++ b/libavcodec/qsvenc_hevc.c
> > @@ -243,6 +243,9 @@ static const AVOption options[] = {
> >  { "main",NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_HEVC_MAIN}, INT_MIN, INT_MAX, VE, "profile" },
> >  { "main10",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_HEVC_MAIN10  }, INT_MIN, INT_MAX, VE, "profile" },
> >  { "mainsp",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 =
> > MFX_PROFILE_HEVC_MAINSP  }, INT_MIN, INT_MAX, VE, "profile" },
> > +#if QSV_HAVE_VDENC
> > +{ "low_power", "low power mode for encoder hevc_qsv",
> > +OFFSET(qsv.low_power), AV_OPT_TYPE_INT, { .i64 =  0 },  0,  1, VE },
> > +#endif
> 
> Should be AV_OPT_TYPE_BOOL as above.
> 
> >
> >  { NULL },
> >  };
> > --
> > 2.17.1

Thanks for the comments, and I modified the patch as suggestions. 
Will send a [V2] patch. 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/cbs_av1: fix decoder/encoder_buffer_delay variable types

2018-11-04 Thread James Almer
On 11/4/2018 9:32 PM, Mark Thompson wrote:
> On 04/11/18 20:13, James Almer wrote:
>> buffer_delay_length_minus_1 is five bits long, meaning decode_buffer_delay 
>> and
>> encoder_buffer_delay can have values up to 32 bits long.
>>
>> Signed-off-by: James Almer 
>> ---
>> See https://0x0.st/sIv-.ivf
>>
>>  libavcodec/cbs_av1.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
>> index b66a09c389..614a0bf108 100644
>> --- a/libavcodec/cbs_av1.h
>> +++ b/libavcodec/cbs_av1.h
>> @@ -87,8 +87,8 @@ typedef struct AV1RawSequenceHeader {
>>  uint8_t  seq_level_idx[AV1_MAX_OPERATING_POINTS];
>>  uint8_t  seq_tier[AV1_MAX_OPERATING_POINTS];
>>  uint8_t  decoder_model_present_for_this_op[AV1_MAX_OPERATING_POINTS];
>> -uint8_t  decoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
>> -uint8_t  encoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
>> +uint32_t decoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
>> +uint32_t encoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
>>  uint8_t  low_delay_mode_flag[AV1_MAX_OPERATING_POINTS];
>>  uint8_t  
>> initial_display_delay_present_for_this_op[AV1_MAX_OPERATING_POINTS];
>>  uint8_t  initial_display_delay_minus_1[AV1_MAX_OPERATING_POINTS];
>>
> 
> Yep; LGTM.
> 
> Thanks,
> 
> - Mark

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


Re: [FFmpeg-devel] [PATCH 2/3] cbs_av1: Support redundant frame headers

2018-11-04 Thread James Almer
On 11/4/2018 9:10 PM, Mark Thompson wrote:
> ---
> Includes support for using them when the normal frame header as been lost 
> (try "-bsf:v filter_units=remove_types=3").
> 
> 
>  libavcodec/cbs_av1.c |  8 +++-
>  libavcodec/cbs_av1.h |  2 +
>  libavcodec/cbs_av1_syntax_template.c | 64 +---
>  3 files changed, 66 insertions(+), 8 deletions(-)
> 
> diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
> index 1c49d90f51..b61b757f41 100644
> --- a/libavcodec/cbs_av1.c
> +++ b/libavcodec/cbs_av1.c
> @@ -996,7 +996,9 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
>  case AV1_OBU_REDUNDANT_FRAME_HEADER:
>  {
>  err = cbs_av1_read_frame_header_obu(ctx, ,
> ->obu.frame_header);
> +>obu.frame_header,
> +obu->header.obu_type ==
> +
> AV1_OBU_REDUNDANT_FRAME_HEADER);
>  if (err < 0)
>  return err;
>  }
> @@ -1124,7 +1126,9 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>  case AV1_OBU_REDUNDANT_FRAME_HEADER:
>  {
>  err = cbs_av1_write_frame_header_obu(ctx, pbc,
> - >obu.frame_header);
> + >obu.frame_header,
> + obu->header.obu_type ==
> + 
> AV1_OBU_REDUNDANT_FRAME_HEADER);
>  if (err < 0)
>  return err;
>  }
> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
> index b66a09c389..af9e88df71 100644
> --- a/libavcodec/cbs_av1.h
> +++ b/libavcodec/cbs_av1.h
> @@ -400,6 +400,8 @@ typedef struct CodedBitstreamAV1Context {
>  AVBufferRef  *sequence_header_ref;
>  
>  int seen_frame_header;
> +uint8_t *frame_header;
> +size_t   frame_header_size;
>  
>  int temporal_id;
>  int spatial_id;
> diff --git a/libavcodec/cbs_av1_syntax_template.c 
> b/libavcodec/cbs_av1_syntax_template.c
> index e146bbf8bb..5649af841a 100644
> --- a/libavcodec/cbs_av1_syntax_template.c
> +++ b/libavcodec/cbs_av1_syntax_template.c
> @@ -1463,24 +1463,76 @@ static int 
> FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
>  }
>  
>  static int FUNC(frame_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
> -  AV1RawFrameHeader *current)
> +  AV1RawFrameHeader *current, int redundant)
>  {
>  CodedBitstreamAV1Context *priv = ctx->priv_data;
> -int err;
> -
> -HEADER("Frame Header");
> +int start_pos, fh_bits, fh_bytes, err;
> +const uint8_t *fh_start;
>  
>  if (priv->seen_frame_header) {
> -// Nothing to do.
> +if (!redundant) {
> +av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid repeated "
> +   "frame header OBU.\n");
> +return AVERROR_INVALIDDATA;
> +} else {
> +GetBitContext fh;
> +size_t k;
> +int b;
> +
> +HEADER("Redundant Frame Header");
> +
> +init_get_bits(, priv->frame_header,
> +  priv->frame_header_size);
> +for (k = 0; k < priv->frame_header_size; k++) {
> +b = get_bits1();
> +xf(1, frame_header_copy[k], b, b, b, 1, k);

This is making a lot of noise in the trace output for no real gain,
since it prints every single bit as its own line. Can you silence it?

> +}
> +}
>  } else {
> +if (redundant)
> +HEADER("Redundant Frame Header (used as Frame Header)");
> +else
> +HEADER("Frame Header");
> +
>  priv->seen_frame_header = 1;
>  
> +#ifdef READ
> +start_pos = get_bits_count(rw);
> +#else
> +start_pos = put_bits_count(rw);
> +#endif
> +
>  CHECK(FUNC(uncompressed_header)(ctx, rw, current));
>  
>  if (current->show_existing_frame) {
>  priv->seen_frame_header = 0;
>  } else {
>  priv->seen_frame_header = 1;
> +
> +av_freep(>frame_header);
> +
> +#ifdef READ
> +fh_bits  = get_bits_count(rw) - start_pos;
> +fh_start = rw->buffer + start_pos / 8;
> +#else
> +// Need to flush the bitwriter so that we can copy its output,
> +// but use a copy so we don't affect the caller's structure.
> +{
> +PutBitContext tmp = *rw;
> +flush_put_bits();
> +}
> +
> +fh_bits  = put_bits_count(rw) - start_pos;
> +fh_start = rw->buf + start_pos / 8;
> +#endif
> +fh_bytes = (fh_bits + 7) / 8;
> +
> +priv->frame_header_size = fh_bits;
> +

Re: [FFmpeg-devel] [PATCH] Revert "lavc/v4l2_m2m_enc: Add missing braces around initializers."

2018-11-04 Thread Mark Thompson
On 04/11/18 03:46, Ronak wrote:
> 
>> On Oct 31, 2018, at 5:58 PM, Mark Thompson  wrote:
>>
>> On 31/10/18 00:07, Ronak Patel wrote:
>>>
 On Oct 27, 2018, at 5:25 PM, Carl Eugen Hoyos  wrote:

 2018-10-27 20:50 GMT+02:00, Mark Thompson :
> This reverts commit 6dbb64fdccafe846aaec75d3784f7ad49d8af5df.
>
> The additional braces cause build errors with Linux headers earlier
> than 4.5 because the first element of the structure was not originally
> a union.

> Not sure what compiler was warning about these, but it's definitely
> incorrect for it to do so.

 Must have been NDK clang.
>>>
>>> This fix isn’t enough for this. The references to the variables in the 
>>> union fail to compile. This doesn’t fix that.
>>
>> I tried both before and after the change at 4.5: 
>> ,
>>  
>> .
>>
>> What headers do you have and what are the errors in that version?
> 
> I've attach the header file that I have.
> 
> struct v4l2_ext_controls {
>  union {
>   __u32 ctrl_class;
>   __u32 which;
>  };
>  __u32 count;
>  __u32 error_idx;
>  __u32 reserved[2];
>  struct v4l2_ext_control *controls;
> };

That looks like a normal 4.5+ definition.

Does your compiler perhaps not support anonymous unions?  (Generally warnings 
in system header files are suppressed, so you would only see the results of 
that - it would deny the existence of the ctrl_class element in struct 
v4l2_ext_controls.)  They are a hard requirement for using a lot of Linux 
header files nowadays, so I suppose we might need to add a check for them if 
people are combining new headers with old compilers lacking that support.

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


Re: [FFmpeg-devel] [PATCH] avcodec/cbs_av1: fix decoder/encoder_buffer_delay variable types

2018-11-04 Thread Mark Thompson
On 04/11/18 20:13, James Almer wrote:
> buffer_delay_length_minus_1 is five bits long, meaning decode_buffer_delay and
> encoder_buffer_delay can have values up to 32 bits long.
> 
> Signed-off-by: James Almer 
> ---
> See https://0x0.st/sIv-.ivf
> 
>  libavcodec/cbs_av1.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
> index b66a09c389..614a0bf108 100644
> --- a/libavcodec/cbs_av1.h
> +++ b/libavcodec/cbs_av1.h
> @@ -87,8 +87,8 @@ typedef struct AV1RawSequenceHeader {
>  uint8_t  seq_level_idx[AV1_MAX_OPERATING_POINTS];
>  uint8_t  seq_tier[AV1_MAX_OPERATING_POINTS];
>  uint8_t  decoder_model_present_for_this_op[AV1_MAX_OPERATING_POINTS];
> -uint8_t  decoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
> -uint8_t  encoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
> +uint32_t decoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
> +uint32_t encoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
>  uint8_t  low_delay_mode_flag[AV1_MAX_OPERATING_POINTS];
>  uint8_t  
> initial_display_delay_present_for_this_op[AV1_MAX_OPERATING_POINTS];
>  uint8_t  initial_display_delay_minus_1[AV1_MAX_OPERATING_POINTS];
> 

Yep; LGTM.

Thanks,

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


Re: [FFmpeg-devel] [PATCH 3/3] configure: Fix av1_metadata BSF dependency

2018-11-04 Thread James Almer
On 11/4/2018 9:10 PM, Mark Thompson wrote:
> ---
> $ configure --disable-bsf=av1_metadata
> ...
> $ grep IVF_MUXER config.h
> #define CONFIG_IVF_MUXER 1

Ugh, sorry. LGTM.

> 
> 
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index f3fa0cde86..23ad59031c 100755
> --- a/configure
> +++ b/configure
> @@ -3180,7 +3180,7 @@ image2_alias_pix_demuxer_select="image2_demuxer"
>  image2_brender_pix_demuxer_select="image2_demuxer"
>  ipod_muxer_select="mov_muxer"
>  ismv_muxer_select="mov_muxer"
> -ivf_muxer_select="av1_metadata"
> +ivf_muxer_select="av1_metadata_bsf"
>  matroska_audio_muxer_select="matroska_muxer"
>  matroska_demuxer_select="iso_media riffdec"
>  matroska_demuxer_suggest="bzlib lzo zlib"
> 

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


[FFmpeg-devel] [PATCH 1/3] cbs_av1: Fix header writing when already aligned

2018-11-04 Thread Mark Thompson
---
Previously it lost the trailing bits byte but did include it in the OBU size, 
completely breaking the stream.


 libavcodec/cbs_av1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 9bac9dde09..1c49d90f51 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -1179,7 +1179,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
 if (err < 0)
 return err;
 end_pos = put_bits_count(pbc);
-obu->obu_size = (end_pos - start_pos + 7) / 8;
+obu->obu_size = header_size = (end_pos - start_pos + 7) / 8;
 } else {
 // Empty OBU.
 obu->obu_size = 0;
-- 
2.19.1

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


[FFmpeg-devel] [PATCH 2/3] cbs_av1: Support redundant frame headers

2018-11-04 Thread Mark Thompson
---
Includes support for using them when the normal frame header as been lost (try 
"-bsf:v filter_units=remove_types=3").


 libavcodec/cbs_av1.c |  8 +++-
 libavcodec/cbs_av1.h |  2 +
 libavcodec/cbs_av1_syntax_template.c | 64 +---
 3 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
index 1c49d90f51..b61b757f41 100644
--- a/libavcodec/cbs_av1.c
+++ b/libavcodec/cbs_av1.c
@@ -996,7 +996,9 @@ static int cbs_av1_read_unit(CodedBitstreamContext *ctx,
 case AV1_OBU_REDUNDANT_FRAME_HEADER:
 {
 err = cbs_av1_read_frame_header_obu(ctx, ,
->obu.frame_header);
+>obu.frame_header,
+obu->header.obu_type ==
+
AV1_OBU_REDUNDANT_FRAME_HEADER);
 if (err < 0)
 return err;
 }
@@ -1124,7 +1126,9 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
 case AV1_OBU_REDUNDANT_FRAME_HEADER:
 {
 err = cbs_av1_write_frame_header_obu(ctx, pbc,
- >obu.frame_header);
+ >obu.frame_header,
+ obu->header.obu_type ==
+ 
AV1_OBU_REDUNDANT_FRAME_HEADER);
 if (err < 0)
 return err;
 }
diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
index b66a09c389..af9e88df71 100644
--- a/libavcodec/cbs_av1.h
+++ b/libavcodec/cbs_av1.h
@@ -400,6 +400,8 @@ typedef struct CodedBitstreamAV1Context {
 AVBufferRef  *sequence_header_ref;
 
 int seen_frame_header;
+uint8_t *frame_header;
+size_t   frame_header_size;
 
 int temporal_id;
 int spatial_id;
diff --git a/libavcodec/cbs_av1_syntax_template.c 
b/libavcodec/cbs_av1_syntax_template.c
index e146bbf8bb..5649af841a 100644
--- a/libavcodec/cbs_av1_syntax_template.c
+++ b/libavcodec/cbs_av1_syntax_template.c
@@ -1463,24 +1463,76 @@ static int 
FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
 }
 
 static int FUNC(frame_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
-  AV1RawFrameHeader *current)
+  AV1RawFrameHeader *current, int redundant)
 {
 CodedBitstreamAV1Context *priv = ctx->priv_data;
-int err;
-
-HEADER("Frame Header");
+int start_pos, fh_bits, fh_bytes, err;
+const uint8_t *fh_start;
 
 if (priv->seen_frame_header) {
-// Nothing to do.
+if (!redundant) {
+av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid repeated "
+   "frame header OBU.\n");
+return AVERROR_INVALIDDATA;
+} else {
+GetBitContext fh;
+size_t k;
+int b;
+
+HEADER("Redundant Frame Header");
+
+init_get_bits(, priv->frame_header,
+  priv->frame_header_size);
+for (k = 0; k < priv->frame_header_size; k++) {
+b = get_bits1();
+xf(1, frame_header_copy[k], b, b, b, 1, k);
+}
+}
 } else {
+if (redundant)
+HEADER("Redundant Frame Header (used as Frame Header)");
+else
+HEADER("Frame Header");
+
 priv->seen_frame_header = 1;
 
+#ifdef READ
+start_pos = get_bits_count(rw);
+#else
+start_pos = put_bits_count(rw);
+#endif
+
 CHECK(FUNC(uncompressed_header)(ctx, rw, current));
 
 if (current->show_existing_frame) {
 priv->seen_frame_header = 0;
 } else {
 priv->seen_frame_header = 1;
+
+av_freep(>frame_header);
+
+#ifdef READ
+fh_bits  = get_bits_count(rw) - start_pos;
+fh_start = rw->buffer + start_pos / 8;
+#else
+// Need to flush the bitwriter so that we can copy its output,
+// but use a copy so we don't affect the caller's structure.
+{
+PutBitContext tmp = *rw;
+flush_put_bits();
+}
+
+fh_bits  = put_bits_count(rw) - start_pos;
+fh_start = rw->buf + start_pos / 8;
+#endif
+fh_bytes = (fh_bits + 7) / 8;
+
+priv->frame_header_size = fh_bits;
+priv->frame_header =
+av_mallocz(fh_bytes + AV_INPUT_BUFFER_PADDING_SIZE);
+if (!priv->frame_header)
+return AVERROR(ENOMEM);
+memcpy(priv->frame_header, fh_start, fh_bytes);
 }
 }
 
@@ -1528,7 +1580,7 @@ static int FUNC(frame_obu)(CodedBitstreamContext *ctx, 
RWContext *rw,
 {
 int err;
 
-CHECK(FUNC(frame_header_obu)(ctx, rw, >header));
+CHECK(FUNC(frame_header_obu)(ctx, 

[FFmpeg-devel] [PATCH 3/3] configure: Fix av1_metadata BSF dependency

2018-11-04 Thread Mark Thompson
---
$ configure --disable-bsf=av1_metadata
...
$ grep IVF_MUXER config.h
#define CONFIG_IVF_MUXER 1


 configure | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index f3fa0cde86..23ad59031c 100755
--- a/configure
+++ b/configure
@@ -3180,7 +3180,7 @@ image2_alias_pix_demuxer_select="image2_demuxer"
 image2_brender_pix_demuxer_select="image2_demuxer"
 ipod_muxer_select="mov_muxer"
 ismv_muxer_select="mov_muxer"
-ivf_muxer_select="av1_metadata"
+ivf_muxer_select="av1_metadata_bsf"
 matroska_audio_muxer_select="matroska_muxer"
 matroska_demuxer_select="iso_media riffdec"
 matroska_demuxer_suggest="bzlib lzo zlib"
-- 
2.19.1

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


Re: [FFmpeg-devel] [PATCH 2/2] avformat/ftp: allow nonstandard 202 reply to OPTS UTF8

2018-11-04 Thread Marton Balint



On Thu, 1 Nov 2018, Marton Balint wrote:


Fixes ticket #7481.

Signed-off-by: Marton Balint 
---
libavformat/ftp.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)



Applied and backported.

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


[FFmpeg-devel] [PATCH] avcodec/cbs_av1: fix decoder/encoder_buffer_delay variable types

2018-11-04 Thread James Almer
buffer_delay_length_minus_1 is five bits long, meaning decode_buffer_delay and
encoder_buffer_delay can have values up to 32 bits long.

Signed-off-by: James Almer 
---
See https://0x0.st/sIv-.ivf

 libavcodec/cbs_av1.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cbs_av1.h b/libavcodec/cbs_av1.h
index b66a09c389..614a0bf108 100644
--- a/libavcodec/cbs_av1.h
+++ b/libavcodec/cbs_av1.h
@@ -87,8 +87,8 @@ typedef struct AV1RawSequenceHeader {
 uint8_t  seq_level_idx[AV1_MAX_OPERATING_POINTS];
 uint8_t  seq_tier[AV1_MAX_OPERATING_POINTS];
 uint8_t  decoder_model_present_for_this_op[AV1_MAX_OPERATING_POINTS];
-uint8_t  decoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
-uint8_t  encoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
+uint32_t decoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
+uint32_t encoder_buffer_delay[AV1_MAX_OPERATING_POINTS];
 uint8_t  low_delay_mode_flag[AV1_MAX_OPERATING_POINTS];
 uint8_t  
initial_display_delay_present_for_this_op[AV1_MAX_OPERATING_POINTS];
 uint8_t  initial_display_delay_minus_1[AV1_MAX_OPERATING_POINTS];
-- 
2.19.1

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


Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_framerate: factorize SAD functions which compute SAD for a whole frame

2018-11-04 Thread Marton Balint


On Sun, 4 Nov 2018, James Almer wrote:


On 11/4/2018 9:06 AM, Marton Balint wrote:

Also add SIMD which works on lines because it is faster then calculating it on
8x8 blocks using pixelutils.

Signed-off-by: Marton Balint 
---
 configure|  3 +-
 libavfilter/Makefile |  1 +
 libavfilter/framerate.h  |  4 +--
 libavfilter/scene_sad.c  | 72 ++
 libavfilter/scene_sad.h  | 44 
 libavfilter/vf_framerate.c   | 61 -
 libavfilter/x86/Makefile |  4 +++
 libavfilter/x86/scene_sad.asm| 74 
 libavfilter/x86/scene_sad_init.c | 52 
 9 files changed, 257 insertions(+), 58 deletions(-)
 create mode 100644 libavfilter/scene_sad.c
 create mode 100644 libavfilter/scene_sad.h
 create mode 100644 libavfilter/x86/scene_sad.asm
 create mode 100644 libavfilter/x86/scene_sad_init.c

diff --git a/configure b/configure
index 2606b885b0..f5bec9fd62 100755
--- a/configure
+++ b/configure
@@ -2335,6 +2335,7 @@ CONFIG_EXTRA="
 rtpdec
 rtpenc_chain
 rv34dsp
+scene_sad
 sinewin
 snappy
 srtp
@@ -3395,7 +3396,7 @@ find_rect_filter_deps="avcodec avformat gpl"
 firequalizer_filter_deps="avcodec"
 firequalizer_filter_select="rdft"
 flite_filter_deps="libflite"
-framerate_filter_select="pixelutils"
+framerate_filter_select="scene_sad"
 frei0r_filter_deps="frei0r libdl"
 frei0r_src_filter_deps="frei0r libdl"
 fspp_filter_deps="gpl"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 51e48efc2e..390c2b7997 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -28,6 +28,7 @@ OBJS-$(HAVE_THREADS) += pthread.o
 OBJS-$(CONFIG_QSVVPP)+= qsvvpp.o
 DNN-OBJS-$(CONFIG_LIBTENSORFLOW) += dnn_backend_tf.o
 OBJS-$(CONFIG_DNN)   += dnn_interface.o 
dnn_backend_native.o $(DNN-OBJS-yes)
+OBJS-$(CONFIG_SCENE_SAD) += scene_sad.o

 # audio filters
 OBJS-$(CONFIG_ABENCH_FILTER) += f_bench.o


Can't you expand pixeutils instead? Adding a new set of functions that
work on lines rather than blocks.


That is kind of intentional, because it is only used by libavfilter, so I 
did not want to bloat libavutil with it. Also if I put it into libavutil 
then the interfaces have to be public. I tried to avoid that because for a 
generic scene SAD function bitdepth is not enough, you need endianness, 
float/int color support, etc. Public API should be finalized when 
something actually uses it IMHO.


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


Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_framerate: factorize SAD functions which compute SAD for a whole frame

2018-11-04 Thread James Almer
On 11/4/2018 9:06 AM, Marton Balint wrote:
> Also add SIMD which works on lines because it is faster then calculating it on
> 8x8 blocks using pixelutils.
> 
> Signed-off-by: Marton Balint 
> ---
>  configure|  3 +-
>  libavfilter/Makefile |  1 +
>  libavfilter/framerate.h  |  4 +--
>  libavfilter/scene_sad.c  | 72 ++
>  libavfilter/scene_sad.h  | 44 
>  libavfilter/vf_framerate.c   | 61 -
>  libavfilter/x86/Makefile |  4 +++
>  libavfilter/x86/scene_sad.asm| 74 
> 
>  libavfilter/x86/scene_sad_init.c | 52 
>  9 files changed, 257 insertions(+), 58 deletions(-)
>  create mode 100644 libavfilter/scene_sad.c
>  create mode 100644 libavfilter/scene_sad.h
>  create mode 100644 libavfilter/x86/scene_sad.asm
>  create mode 100644 libavfilter/x86/scene_sad_init.c
> 
> diff --git a/configure b/configure
> index 2606b885b0..f5bec9fd62 100755
> --- a/configure
> +++ b/configure
> @@ -2335,6 +2335,7 @@ CONFIG_EXTRA="
>  rtpdec
>  rtpenc_chain
>  rv34dsp
> +scene_sad
>  sinewin
>  snappy
>  srtp
> @@ -3395,7 +3396,7 @@ find_rect_filter_deps="avcodec avformat gpl"
>  firequalizer_filter_deps="avcodec"
>  firequalizer_filter_select="rdft"
>  flite_filter_deps="libflite"
> -framerate_filter_select="pixelutils"
> +framerate_filter_select="scene_sad"
>  frei0r_filter_deps="frei0r libdl"
>  frei0r_src_filter_deps="frei0r libdl"
>  fspp_filter_deps="gpl"
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 51e48efc2e..390c2b7997 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -28,6 +28,7 @@ OBJS-$(HAVE_THREADS) += pthread.o
>  OBJS-$(CONFIG_QSVVPP)+= qsvvpp.o
>  DNN-OBJS-$(CONFIG_LIBTENSORFLOW) += dnn_backend_tf.o
>  OBJS-$(CONFIG_DNN)   += dnn_interface.o 
> dnn_backend_native.o $(DNN-OBJS-yes)
> +OBJS-$(CONFIG_SCENE_SAD) += scene_sad.o
>  
>  # audio filters
>  OBJS-$(CONFIG_ABENCH_FILTER) += f_bench.o

Can't you expand pixeutils instead? Adding a new set of functions that
work on lines rather than blocks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/3] avfilter/vf_minterpolate: use common scene sad functions

2018-11-04 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 configure |  1 +
 libavfilter/vf_minterpolate.c | 17 +++--
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/configure b/configure
index f352ea121c..5eac2c92f3 100755
--- a/configure
+++ b/configure
@@ -3412,6 +3412,7 @@ mcdeint_filter_deps="avcodec gpl"
 movie_filter_deps="avcodec avformat"
 mpdecimate_filter_deps="gpl"
 mpdecimate_filter_select="pixelutils"
+minterpolate_filter_select="scene_sad"
 mptestsrc_filter_deps="gpl"
 negate_filter_deps="lut_filter"
 nnedi_filter_deps="gpl"
diff --git a/libavfilter/vf_minterpolate.c b/libavfilter/vf_minterpolate.c
index c6a5e63f90..532f5ed235 100644
--- a/libavfilter/vf_minterpolate.c
+++ b/libavfilter/vf_minterpolate.c
@@ -26,11 +26,11 @@
 #include "libavutil/motion_vector.h"
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
-#include "libavutil/pixelutils.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "scene_sad.h"
 
 #define ME_MODE_BIDIR 0
 #define ME_MODE_BILAT 1
@@ -188,7 +188,7 @@ typedef struct MIContext {
 
 int scd_method;
 int scene_changed;
-av_pixelutils_sad_fn sad;
+ff_scene_sad_fn sad;
 double prev_mafd;
 double scd_threshold;
 
@@ -383,7 +383,7 @@ static int config_input(AVFilterLink *inlink)
 }
 
 if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
-mi_ctx->sad = av_pixelutils_get_sad_fn(3, 3, 2, mi_ctx);
+mi_ctx->sad = ff_scene_sad_get_fn(8);
 if (!mi_ctx->sad)
 return AVERROR(EINVAL);
 }
@@ -827,18 +827,15 @@ static int detect_scene_change(MIContext *mi_ctx)
 {
 AVMotionEstContext *me_ctx = _ctx->me_ctx;
 int x, y;
-int linesize = me_ctx->linesize;
 uint8_t *p1 = mi_ctx->frames[1].avf->data[0];
+ptrdiff_t linesize1 = mi_ctx->frames[1].avf->linesize[0];
 uint8_t *p2 = mi_ctx->frames[2].avf->data[0];
+ptrdiff_t linesize2 = mi_ctx->frames[2].avf->linesize[0];
 
 if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
 double ret = 0, mafd, diff;
-int64_t sad;
-
-for (sad = y = 0; y < me_ctx->height; y += 8)
-for (x = 0; x < linesize; x += 8)
-sad += mi_ctx->sad(p1 + x + y * linesize, linesize, p2 + x + y 
* linesize, linesize);
-
+uint64_t sad;
+mi_ctx->sad(p1, linesize1, p2, linesize2, me_ctx->width, 
me_ctx->height, );
 emms_c();
 mafd = (double) sad / (me_ctx->height * me_ctx->width * 3);
 diff = fabs(mafd - mi_ctx->prev_mafd);
-- 
2.16.4

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


[FFmpeg-devel] [PATCH 2/3] avfilter/vf_select: use common scene sad functions

2018-11-04 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 configure  |  2 +-
 libavfilter/f_select.c | 26 +++---
 2 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/configure b/configure
index f5bec9fd62..f352ea121c 100755
--- a/configure
+++ b/configure
@@ -3440,7 +3440,7 @@ sab_filter_deps="gpl swscale"
 scale2ref_filter_deps="swscale"
 scale_filter_deps="swscale"
 scale_qsv_filter_deps="libmfx"
-select_filter_select="pixelutils"
+select_filter_select="scene_sad"
 sharpness_vaapi_filter_deps="vaapi"
 showcqt_filter_deps="avcodec avformat swscale"
 showcqt_filter_suggest="libfontconfig libfreetype"
diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index b1b2cbc21a..d67849bf26 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -28,12 +28,12 @@
 #include "libavutil/fifo.h"
 #include "libavutil/internal.h"
 #include "libavutil/opt.h"
-#include "libavutil/pixelutils.h"
 #include "avfilter.h"
 #include "audio.h"
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "scene_sad.h"
 
 static const char *const var_names[] = {
 "TB",///< timebase
@@ -145,7 +145,7 @@ typedef struct SelectContext {
 AVExpr *expr;
 double var_values[VAR_VARS_NB];
 int do_scene_detect;///< 1 if the expression requires scene 
detection variables, 0 otherwise
-av_pixelutils_sad_fn sad;   ///< Sum of the absolute difference 
function (scene detect only)
+ff_scene_sad_fn sad;///< Sum of the absolute difference 
function (scene detect only)
 double prev_mafd;   ///< previous MAFD 
  (scene detect only)
 AVFrame *prev_picref;   ///< previous frame
  (scene detect only)
 double select;
@@ -242,7 +242,7 @@ static int config_input(AVFilterLink *inlink)
 inlink->type == AVMEDIA_TYPE_AUDIO ? inlink->sample_rate : NAN;
 
 if (select->do_scene_detect) {
-select->sad = av_pixelutils_get_sad_fn(3, 3, 2, select); // 8x8 both 
sources aligned
+select->sad = ff_scene_sad_get_fn(8);
 if (!select->sad)
 return AVERROR(EINVAL);
 }
@@ -258,24 +258,12 @@ static double get_scene_score(AVFilterContext *ctx, 
AVFrame *frame)
 if (prev_picref &&
 frame->height == prev_picref->height &&
 frame->width  == prev_picref->width) {
-int x, y, nb_sad = 0;
-int64_t sad = 0;
+uint64_t sad;
 double mafd, diff;
-uint8_t *p1 =  frame->data[0];
-uint8_t *p2 = prev_picref->data[0];
-const int p1_linesize =   frame->linesize[0];
-const int p2_linesize = prev_picref->linesize[0];
-
-for (y = 0; y < frame->height - 7; y += 8) {
-for (x = 0; x < frame->width*3 - 7; x += 8) {
-sad += select->sad(p1 + x, p1_linesize, p2 + x, p2_linesize);
-nb_sad += 8 * 8;
-}
-p1 += 8 * p1_linesize;
-p2 += 8 * p2_linesize;
-}
+
+select->sad(prev_picref->data[0], prev_picref->linesize[0], 
frame->data[0], frame->linesize[0], frame->width * 3, frame->height, );
 emms_c();
-mafd = nb_sad ? (double)sad / nb_sad : 0;
+mafd = (double)sad / (frame->width * 3 * frame->height);
 diff = fabs(mafd - select->prev_mafd);
 ret  = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
 select->prev_mafd = mafd;
-- 
2.16.4

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


[FFmpeg-devel] [PATCH 1/3] avfilter/vf_framerate: factorize SAD functions which compute SAD for a whole frame

2018-11-04 Thread Marton Balint
Also add SIMD which works on lines because it is faster then calculating it on
8x8 blocks using pixelutils.

Signed-off-by: Marton Balint 
---
 configure|  3 +-
 libavfilter/Makefile |  1 +
 libavfilter/framerate.h  |  4 +--
 libavfilter/scene_sad.c  | 72 ++
 libavfilter/scene_sad.h  | 44 
 libavfilter/vf_framerate.c   | 61 -
 libavfilter/x86/Makefile |  4 +++
 libavfilter/x86/scene_sad.asm| 74 
 libavfilter/x86/scene_sad_init.c | 52 
 9 files changed, 257 insertions(+), 58 deletions(-)
 create mode 100644 libavfilter/scene_sad.c
 create mode 100644 libavfilter/scene_sad.h
 create mode 100644 libavfilter/x86/scene_sad.asm
 create mode 100644 libavfilter/x86/scene_sad_init.c

diff --git a/configure b/configure
index 2606b885b0..f5bec9fd62 100755
--- a/configure
+++ b/configure
@@ -2335,6 +2335,7 @@ CONFIG_EXTRA="
 rtpdec
 rtpenc_chain
 rv34dsp
+scene_sad
 sinewin
 snappy
 srtp
@@ -3395,7 +3396,7 @@ find_rect_filter_deps="avcodec avformat gpl"
 firequalizer_filter_deps="avcodec"
 firequalizer_filter_select="rdft"
 flite_filter_deps="libflite"
-framerate_filter_select="pixelutils"
+framerate_filter_select="scene_sad"
 frei0r_filter_deps="frei0r libdl"
 frei0r_src_filter_deps="frei0r libdl"
 fspp_filter_deps="gpl"
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 51e48efc2e..390c2b7997 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -28,6 +28,7 @@ OBJS-$(HAVE_THREADS) += pthread.o
 OBJS-$(CONFIG_QSVVPP)+= qsvvpp.o
 DNN-OBJS-$(CONFIG_LIBTENSORFLOW) += dnn_backend_tf.o
 OBJS-$(CONFIG_DNN)   += dnn_interface.o 
dnn_backend_native.o $(DNN-OBJS-yes)
+OBJS-$(CONFIG_SCENE_SAD) += scene_sad.o
 
 # audio filters
 OBJS-$(CONFIG_ABENCH_FILTER) += f_bench.o
diff --git a/libavfilter/framerate.h b/libavfilter/framerate.h
index a42d5af68a..8048dfa36a 100644
--- a/libavfilter/framerate.h
+++ b/libavfilter/framerate.h
@@ -19,7 +19,7 @@
 #ifndef AVFILTER_FRAMERATE_H
 #define AVFILTER_FRAMERATE_H
 
-#include "libavutil/pixelutils.h"
+#include "scene_sad.h"
 #include "avfilter.h"
 
 #define BLEND_FUNC_PARAMS const uint8_t *src1, ptrdiff_t src1_linesize, \
@@ -48,7 +48,7 @@ typedef struct FrameRateContext {
 AVRational srce_time_base;  ///< timebase of source
 AVRational dest_time_base;  ///< timebase of destination
 
-av_pixelutils_sad_fn sad;   ///< Sum of the absolute difference 
function (scene detect only)
+ff_scene_sad_fn sad;///< Sum of the absolute difference 
function (scene detect only)
 double prev_mafd;   ///< previous MAFD 
  (scene detect only)
 
 int blend_factor_max;
diff --git a/libavfilter/scene_sad.c b/libavfilter/scene_sad.c
new file mode 100644
index 00..fa57a25961
--- /dev/null
+++ b/libavfilter/scene_sad.c
@@ -0,0 +1,72 @@
+/*
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Scene SAD funtions
+ */
+
+#include "scene_sad.h"
+
+void ff_scene_sad16_c(SCENE_SAD_PARAMS)
+{
+uint64_t sad = 0;
+const uint16_t *src1w = (const uint16_t *)src1;
+const uint16_t *src2w = (const uint16_t *)src2;
+int x, y;
+
+stride1 /= 2;
+stride2 /= 2;
+
+for (y = 0; y < height; y++) {
+for (x = 0; x < width; x++)
+sad += FFABS(src1w[x] - src2w[x]);
+src1w += stride1;
+src2w += stride2;
+}
+*sum = sad;
+}
+
+void ff_scene_sad_c(SCENE_SAD_PARAMS)
+{
+uint64_t sad = 0;
+int x, y;
+
+for (y = 0; y < height; y++) {
+for (x = 0; x < width; x++)
+sad += FFABS(src1[x] - src2[x]);
+src1 += stride1;
+src2 += stride2;
+}
+*sum = sad;
+}
+
+ff_scene_sad_fn ff_scene_sad_get_fn(int depth)
+{
+ff_scene_sad_fn sad = NULL;
+if (ARCH_X86)
+sad = ff_scene_sad_get_fn_x86(depth);
+if (!sad) {
+if (depth == 8)
+sad = ff_scene_sad_c;
+

Re: [FFmpeg-devel] [PATCH 3/3] avcodec/pictordec: Error out if more than one plane is unused

2018-11-04 Thread Michael Niedermayer
On Wed, Sep 12, 2018 at 03:08:08AM +0200, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 
> 9797/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5664441659031552
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/pictordec.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply

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

Avoid a single point of failure, be that a person or equipment.


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


Re: [FFmpeg-devel] [PATCH] avcodec/mpegaudio_parser: Consume more than 0 bytes in case of the unsupported mp3adu case

2018-11-04 Thread Michael Niedermayer
On Mon, Oct 29, 2018 at 12:57:30AM +0100, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 
> 10966/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADU_fuzzer-5348695024336896
> Fixes: 
> 10969/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MP3ADUFLOAT_fuzzer-5691669402877952
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mpegaudio_parser.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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