[FFmpeg-devel] [PATCH v3] avs2: Correct expression error and simplify log

2018-08-07 Thread hwren
Signed-off-by: hwren 
---
 doc/decoders.texi| 2 +-
 doc/general.texi | 2 +-
 libavcodec/avs2_parser.c | 2 +-
 libavcodec/codec_desc.c  | 2 +-
 libavcodec/libdavs2.c| 5 ++---
 5 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/doc/decoders.texi b/doc/decoders.texi
index 9439b7b..31e96fb 100644
--- a/doc/decoders.texi
+++ b/doc/decoders.texi
@@ -49,7 +49,7 @@ top-field-first is assumed
 
 @section libdavs2
 
-AVS2/IEEE 1857.4 video decoder wrapper.
+AVS2-P2/IEEE1857.4 video decoder wrapper.
 
 This decoder allows libavcodec to decode AVS2 streams with davs2 library.
 
diff --git a/doc/general.texi b/doc/general.texi
index cd725bb..3d15840 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to
 
 @section libdavs2
 
-FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video decoding.
+FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
 
 Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for
 installing the library. Then pass @code{--enable-libdavs2} to configure to
diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
index 520e98a..1c9b342 100644
--- a/libavcodec/avs2_parser.c
+++ b/libavcodec/avs2_parser.c
@@ -1,5 +1,5 @@
 /*
- * AVS2/IEEE 1857.4 video parser.
+ * AVS2-P2/IEEE1857.4 video parser.
  * Copyright (c) 2018  Huiwen Ren 
  *
  * This file is part of FFmpeg.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 2fe4aaa..1cbb241 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .id= AV_CODEC_ID_AVS2,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "avs2",
-.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
+.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
 .props = AV_CODEC_PROP_LOSSY,
 },
 {
diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 12db1f9..9cc86a2 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -51,7 +51,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
 
 /* init the decoder */
 cad->param.threads  = avctx->thread_count;
-cad->param.info_level   = 0;
+cad->param.info_level   = DAVS2_LOG_WARNING;
 cad->decoder= davs2_decoder_open(&cad->param);
 
 if (!cad->decoder) {
@@ -59,7 +59,6 @@ static av_cold int davs2_init(AVCodecContext *avctx)
 return AVERROR(EINVAL);
 }
 
-av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
 return 0;
 }
 
@@ -163,7 +162,7 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 
 AVCodec ff_libdavs2_decoder = {
 .name   = "libdavs2",
-.long_name  = NULL_IF_CONFIG_SMALL("Decoder for AVS2/IEEE 1857.4"),
+.long_name  = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"),
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_AVS2,
 .priv_data_size = sizeof(DAVS2Context),
-- 
2.7.4

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


Re: [FFmpeg-devel] [WIP][RFC][PATCH] avcodec: add IMM4 decoder

2018-08-07 Thread Moritz Barsnick
Hi,

On Mon, Aug 06, 2018 at 12:35:15 +0200, Paul B Mahol wrote:
> patch attached.

I can't judge on most of the procedural stuff, but here's some 2 cents:

>  libavcodec/Makefile |   1 +
>  libavcodec/allcodecs.c  |   1 +
>  libavcodec/avcodec.h|   1 +
>  libavcodec/codec_desc.c |   7 +
>  libavcodec/imm4.c   | 399 
> 
>  libavformat/riff.c  |   1 +

Changelog and docs missing.

>  OBJS-$(CONFIG_INTERPLAY_VIDEO_DECODER) += interplayvideo.o
> +OBJS-$(CONFIG_IMM4_DECODER)+= imm4.o
>  OBJS-$(CONFIG_JACOSUB_DECODER) += jacosubdec.o ass.o

Alphabetical order?

>  extern AVCodec ff_interplay_video_decoder;
> +extern AVCodec ff_imm4_decoder;
>  extern AVCodec ff_jpeg2000_encoder;

Alphabetical order?

> +static uint16_t table_7[304] = {
> +  0u, 0u, 0u, 0u, 0u, 0u, 0u, 0u, 16514u, 16514u, 16387u, 16387u,

Inconsisent to declare these explicitly with 'u',

> +static uint8_t table_8[] = {
> +0,  12,  11,  11,  11,  11,  11,  11,  12,  12,

but not these, but it doesn't really matter.

Shouldn't they be const, BTW?

> +if (x)
> +return table_5[2 * value];
> +else
> +return 15 - table_5[2 * value];

I've seen requests on this list to "simplify" such terms to
   return x ? table_5[2 * value] : 15 - table_5[2 * value];
but I don't care, and consider your syntax more readable.

> +if (!c) {
> +f |= 2;
> +av_assert0(0);
> +}

If it always aborts, what's the use of the operation on f?
   av_assert0(c); ?

> +printf("gb: %d\n", get_bits_left(gb));

Debug code?

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


Re: [FFmpeg-devel] [PATCH] avs2: Correct expression error and simplify log

2018-08-07 Thread Moritz Barsnick
On Mon, Aug 06, 2018 at 19:51:48 +0530, Gyan Doshi wrote:
> 
> 
> On 06-08-2018 07:13 PM, hwren wrote:
> 
> > -.long_name  = NULL_IF_CONFIG_SMALL("Decoder for AVS2/IEEE 1857.4"),
> > +.long_name  = NULL_IF_CONFIG_SMALL("Decoder for 
> > AVS2-P2/IEEE1857.4"),
> 
> "Decoder for" is not needed. The flag indicates its role in `ffmpeg 
> -codecs`.
> 
> Rest docs LGTM

And the change of codec description doesn't fit with the patch's commit
message. It should probably be split out into two patches, or the
commit message amended.

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


Re: [FFmpeg-devel] [PATCH] Documentation for sr filter

2018-08-07 Thread Moritz Barsnick
On Tue, Aug 07, 2018 at 00:24:29 +0300, Sergey Lavrushkin wrote:
> +@table @option
> +@item model
> +Specify what super-resolution model to use. This option accepts the 
> following values:
   ^ nit: which

> +Specify what DNN backend to use for model loading and execution. This option 
> accepts
Ditto

> +Allowed values are @code{2}, @code{3} and @code{4}. Scale factor is 
> neccessary
   ^ 
necessary

> +Note that different backends use different file format. If path to model
   ^ formats

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


[FFmpeg-devel] [PATCH] avs2: correct avs2 description

2018-08-07 Thread hwren
Signed-off-by: hwren 
---
 doc/decoders.texi| 2 +-
 doc/general.texi | 2 +-
 libavcodec/avs2_parser.c | 2 +-
 libavcodec/codec_desc.c  | 2 +-
 libavcodec/libdavs2.c| 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/decoders.texi b/doc/decoders.texi
index 9439b7b..31e96fb 100644
--- a/doc/decoders.texi
+++ b/doc/decoders.texi
@@ -49,7 +49,7 @@ top-field-first is assumed
 
 @section libdavs2
 
-AVS2/IEEE 1857.4 video decoder wrapper.
+AVS2-P2/IEEE1857.4 video decoder wrapper.
 
 This decoder allows libavcodec to decode AVS2 streams with davs2 library.
 
diff --git a/doc/general.texi b/doc/general.texi
index cd725bb..3d15840 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to
 
 @section libdavs2
 
-FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video decoding.
+FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video decoding.
 
 Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for
 installing the library. Then pass @code{--enable-libdavs2} to configure to
diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
index 520e98a..1c9b342 100644
--- a/libavcodec/avs2_parser.c
+++ b/libavcodec/avs2_parser.c
@@ -1,5 +1,5 @@
 /*
- * AVS2/IEEE 1857.4 video parser.
+ * AVS2-P2/IEEE1857.4 video parser.
  * Copyright (c) 2018  Huiwen Ren 
  *
  * This file is part of FFmpeg.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 2fe4aaa..1cbb241 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .id= AV_CODEC_ID_AVS2,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "avs2",
-.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
+.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
 .props = AV_CODEC_PROP_LOSSY,
 },
 {
diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
index 12db1f9..70aae3e 100644
--- a/libavcodec/libdavs2.c
+++ b/libavcodec/libdavs2.c
@@ -163,7 +163,7 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
*data,
 
 AVCodec ff_libdavs2_decoder = {
 .name   = "libdavs2",
-.long_name  = NULL_IF_CONFIG_SMALL("Decoder for AVS2/IEEE 1857.4"),
+.long_name  = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"),
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_AVS2,
 .priv_data_size = sizeof(DAVS2Context),
-- 
2.7.4

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


Re: [FFmpeg-devel] Mixture of homographies video stabilization

2018-08-07 Thread Matthew Lai
Ah cool! I didn't see that before. I have only recently started looking
into homographies, and most papers use SVD.

Good to know re. ME. I should stop trying to guess where bottlenecks are
likely to be without profiling :).

On Tue, Aug 7, 2018 at 12:33 AM Michael Niedermayer 
wrote:

> On Mon, Aug 06, 2018 at 03:49:00PM +0100, Matthew Lai wrote:
> > Sorry the matrices are actually 3x3, and most of the time will be spent
> on
> > solving a 8x9 * 9x1 = 0 systems. And then all the feature points will
> have
> > to be multiplied by the 9x1 matrix reshaped into 3x3.
> >
> > The math is here:
> >
> https://www.uio.no/studier/emner/matnat/its/UNIK4690/v16/forelesninger/lecture_4_3-estimating-homographies-from-feature-correspondences.pdf
> >
>
> > Multiplying 3x3 matrices is trivial, but SVD isn't. SVD is the standard
> > approach to decompose a homography matrix. I have not looked into
> > alternative approaches.
>
> Iam a bit puzzled.
> IIUC SVD is the slowest part of the filter from what you write above and we
> have no evidence that it is needed. And you did not look at alternatives ?
> ;)
>
> Quoting "Calibration-Free Rolling Shutter Removal" from
>Matthias Grundmann1,2   Vivek Kwatra1  Daniel Castro2
>Irfan Essa1,2
> ...
> Aggregating all linear constraints Ax for each feature match
> (x, y) yields an homogenous linear system, which can be
> solved for under the constraint ||h||2 = 1 using the SVD
> of A. Alternatively, the system can be transformed into a
> homogenous system by explicitly setting the bottom right
> element of each homography to 1, i.e. hk (3, 3) = 1 for all k,
> which is a reasonable choice for video, as the small inter-
> frame motions are virtually free of degenerated cases.
>
> this sounds like theres a very easy way to avoid
> SVD.
> from what i remember the main point of
> SVD is its ability to work with unstable / degenerate cases.
> But, in which case is such a degenrate case a good estimation for the
> motion/transform ?
>
>
> >
> > Cool! Will see re. ME. It's likely to be the performance-limiting part,
> and
> > it would be nice to run that on GPU.
>
> just a quick reference point, ME for encoding is many times real time.
> for example a 720x576 video encodes here with 1227 fps on a many years old
> box. That includes alot of other things like decoding and all the bitstream
> encoding and transforms, not just ME. And this is 100% on the CPU
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I have never wished to cater to the crowd; for what I know they do not
> approve, and what they approve I do not know. -- Epicurus
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/7] libavfilter: Fixes warnings for unused variables in dnn_srcnn.h, dnn_espcn.h, dnn_backend_tf.c.

2018-08-07 Thread Pedro Arthur
2018-08-06 18:13 GMT-03:00 Sergey Lavrushkin :
> Made variables static.
>
> 2018-08-06 21:19 GMT+03:00 Pedro Arthur :
>
>> 2018-08-02 15:52 GMT-03:00 Sergey Lavrushkin :
>> > ---
>> >  libavfilter/dnn_backend_tf.c | 64 ++
>> +-
>> >  libavfilter/dnn_espcn.h  | 37 -
>> >  libavfilter/dnn_srcnn.h  | 35 
>> >  3 files changed, 63 insertions(+), 73 deletions(-)
>> >
>> > diff --git a/libavfilter/dnn_backend_tf.c b/libavfilter/dnn_backend_tf.c
>> > index 6307c794a5..7a4ad72d27 100644
>> > --- a/libavfilter/dnn_backend_tf.c
>> > +++ b/libavfilter/dnn_backend_tf.c
>> > @@ -374,9 +374,71 @@ DNNModel *ff_dnn_load_default_model_tf(DNNDefaultModel
>> model_type)
>> >  TFModel *tf_model = NULL;
>> >  TF_OperationDescription *op_desc;
>> >  TF_Operation *op;
>> > -TF_Operation *const_ops_buffer[6];
>> >  TF_Output input;
>> >  int64_t input_shape[] = {1, -1, -1, 1};
>> > +const char tanh[] = "Tanh";
>> > +const char sigmoid[] = "Sigmoid";
>> > +const char relu[] = "Relu";
>> > +
>> > +const float *srcnn_consts[] = {
>> > +srcnn_conv1_kernel,
>> > +srcnn_conv1_bias,
>> > +srcnn_conv2_kernel,
>> > +srcnn_conv2_bias,
>> > +srcnn_conv3_kernel,
>> > +srcnn_conv3_bias
>> > +};
>> > +const long int *srcnn_consts_dims[] = {
>> > +srcnn_conv1_kernel_dims,
>> > +srcnn_conv1_bias_dims,
>> > +srcnn_conv2_kernel_dims,
>> > +srcnn_conv2_bias_dims,
>> > +srcnn_conv3_kernel_dims,
>> > +srcnn_conv3_bias_dims
>> > +};
>> > +const int srcnn_consts_dims_len[] = {
>> > +4,
>> > +1,
>> > +4,
>> > +1,
>> > +4,
>> > +1
>> > +};
>> > +const char *srcnn_activations[] = {
>> > +relu,
>> > +relu,
>> > +relu
>> > +};
>> > +
>> > +const float *espcn_consts[] = {
>> > +espcn_conv1_kernel,
>> > +espcn_conv1_bias,
>> > +espcn_conv2_kernel,
>> > +espcn_conv2_bias,
>> > +espcn_conv3_kernel,
>> > +espcn_conv3_bias
>> > +};
>> > +const long int *espcn_consts_dims[] = {
>> > +espcn_conv1_kernel_dims,
>> > +espcn_conv1_bias_dims,
>> > +espcn_conv2_kernel_dims,
>> > +espcn_conv2_bias_dims,
>> > +espcn_conv3_kernel_dims,
>> > +espcn_conv3_bias_dims
>> > +};
>> > +const int espcn_consts_dims_len[] = {
>> > +4,
>> > +1,
>> > +4,
>> > +1,
>> > +4,
>> > +1
>> > +};
>> > +const char *espcn_activations[] = {
>> > +tanh,
>> > +tanh,
>> > +sigmoid
>> > +};
>> >
>> >  input.index = 0;
>> >
>> > diff --git a/libavfilter/dnn_espcn.h b/libavfilter/dnn_espcn.h
>> > index a0dd61cd0d..9344aa90fe 100644
>> > --- a/libavfilter/dnn_espcn.h
>> > +++ b/libavfilter/dnn_espcn.h
>> > @@ -5398,41 +5398,4 @@ static const long int espcn_conv3_bias_dims[] = {
>> >  4
>> >  };
>> >
>> > -static const float *espcn_consts[] = {
>> > -espcn_conv1_kernel,
>> > -espcn_conv1_bias,
>> > -espcn_conv2_kernel,
>> > -espcn_conv2_bias,
>> > -espcn_conv3_kernel,
>> > -espcn_conv3_bias
>> > -};
>> > -
>> > -static const long int *espcn_consts_dims[] = {
>> > -espcn_conv1_kernel_dims,
>> > -espcn_conv1_bias_dims,
>> > -espcn_conv2_kernel_dims,
>> > -espcn_conv2_bias_dims,
>> > -espcn_conv3_kernel_dims,
>> > -espcn_conv3_bias_dims
>> > -};
>> > -
>> > -static const int espcn_consts_dims_len[] = {
>> > -4,
>> > -1,
>> > -4,
>> > -1,
>> > -4,
>> > -1
>> > -};
>> > -
>> > -static const char espcn_tanh[] = "Tanh";
>> > -
>> > -static const char espcn_sigmoid[] = "Sigmoid";
>> > -
>> > -static const char *espcn_activations[] = {
>> > -espcn_tanh,
>> > -espcn_tanh,
>> > -espcn_sigmoid
>> > -};
>> > -
>> >  #endif
>> > diff --git a/libavfilter/dnn_srcnn.h b/libavfilter/dnn_srcnn.h
>> > index 26143654b8..4f5332ce18 100644
>> > --- a/libavfilter/dnn_srcnn.h
>> > +++ b/libavfilter/dnn_srcnn.h
>> > @@ -2110,39 +2110,4 @@ static const long int srcnn_conv3_bias_dims[] = {
>> >  1
>> >  };
>> >
>> > -static const float *srcnn_consts[] = {
>> > -srcnn_conv1_kernel,
>> > -srcnn_conv1_bias,
>> > -srcnn_conv2_kernel,
>> > -srcnn_conv2_bias,
>> > -srcnn_conv3_kernel,
>> > -srcnn_conv3_bias
>> > -};
>> > -
>> > -static const long int *srcnn_consts_dims[] = {
>> > -srcnn_conv1_kernel_dims,
>> > -srcnn_conv1_bias_dims,
>> > -srcnn_conv2_kernel_dims,
>> > -srcnn_conv2_bias_dims,
>> > -srcnn_conv3_kernel_dims,
>> > -srcnn_conv3_bias_dims
>> > -};
>> > -
>> > -static const int srcnn_consts_dims_len[] = {
>> > -4,
>> > -1,
>> > -4,
>> > -1,
>> > -4,
>> > -1
>> > -};
>> > -
>> > -static const char srcnn_relu[] = "Relu";
>> > -
>> > -static co

Re: [FFmpeg-devel] [PATCH 2/7] libavfilter: Code style fixes for pointers in DNN module and sr filter.

2018-08-07 Thread Pedro Arthur
2018-08-06 18:11 GMT-03:00 Sergey Lavrushkin :
> Updated patch.
>
> 2018-08-06 17:55 GMT+03:00 Pedro Arthur :
>
>> 2018-08-02 15:52 GMT-03:00 Sergey Lavrushkin :
>> > ---
>> >  libavfilter/dnn_backend_native.c |  84 +++---
>> >  libavfilter/dnn_backend_native.h |   8 +--
>> >  libavfilter/dnn_backend_tf.c | 108 +++---
>> -
>> >  libavfilter/dnn_backend_tf.h |   8 +--
>> >  libavfilter/dnn_espcn.h  |   6 +--
>> >  libavfilter/dnn_interface.c  |   4 +-
>> >  libavfilter/dnn_interface.h  |  16 +++---
>> >  libavfilter/dnn_srcnn.h  |   6 +--
>> >  libavfilter/vf_sr.c  |  60 +++---
>> >  9 files changed, 150 insertions(+), 150 deletions(-)
>> >
>> > diff --git a/libavfilter/dnn_backend_native.c b/libavfilter/dnn_backend_
>> native.c
>> > index 3e6b86280d..baefea7fcb 100644
>> > --- a/libavfilter/dnn_backend_native.c
>> > +++ b/libavfilter/dnn_backend_native.c
>> > @@ -34,15 +34,15 @@ typedef enum {RELU, TANH, SIGMOID} ActivationFunc;
>> >
>> >  typedef struct Layer{
>> >  LayerType type;
>> > -float* output;
>> > -void* params;
>> > +float *output;
>> > +void *params;
>> >  } Layer;
>> >
>> >  typedef struct ConvolutionalParams{
>> >  int32_t input_num, output_num, kernel_size;
>> >  ActivationFunc activation;
>> > -float* kernel;
>> > -float* biases;
>> > +float *kernel;
>> > +float *biases;
>> >  } ConvolutionalParams;
>> >
>> >  typedef struct InputParams{
>> > @@ -55,16 +55,16 @@ typedef struct DepthToSpaceParams{
>> >
>> >  // Represents simple feed-forward convolutional network.
>> >  typedef struct ConvolutionalNetwork{
>> > -Layer* layers;
>> > +Layer *layers;
>> >  int32_t layers_num;
>> >  } ConvolutionalNetwork;
>> >
>> > -static DNNReturnType set_input_output_native(void* model, DNNData*
>> input, DNNData* output)
>> > +static DNNReturnType set_input_output_native(void *model, DNNData
>> *input, DNNData *output)
>> >  {
>> > -ConvolutionalNetwork* network = (ConvolutionalNetwork*)model;
>> > -InputParams* input_params;
>> > -ConvolutionalParams* conv_params;
>> > -DepthToSpaceParams* depth_to_space_params;
>> > +ConvolutionalNetwork *network = (ConvolutionalNetwork *)model;
>> > +InputParams *input_params;
>> > +ConvolutionalParams *conv_params;
>> > +DepthToSpaceParams *depth_to_space_params;
>> >  int cur_width, cur_height, cur_channels;
>> >  int32_t layer;
>> >
>> > @@ -72,7 +72,7 @@ static DNNReturnType set_input_output_native(void*
>> model, DNNData* input, DNNDat
>> >  return DNN_ERROR;
>> >  }
>> >  else{
>> > -input_params = (InputParams*)network->layers[0].params;
>> > +input_params = (InputParams *)network->layers[0].params;
>> >  input_params->width = cur_width = input->width;
>> >  input_params->height = cur_height = input->height;
>> >  input_params->channels = cur_channels = input->channels;
>> > @@ -88,14 +88,14 @@ static DNNReturnType set_input_output_native(void*
>> model, DNNData* input, DNNDat
>> >  for (layer = 1; layer < network->layers_num; ++layer){
>> >  switch (network->layers[layer].type){
>> >  case CONV:
>> > -conv_params = (ConvolutionalParams*)network-
>> >layers[layer].params;
>> > +conv_params = (ConvolutionalParams *)network->layers[layer].
>> params;
>> >  if (conv_params->input_num != cur_channels){
>> >  return DNN_ERROR;
>> >  }
>> >  cur_channels = conv_params->output_num;
>> >  break;
>> >  case DEPTH_TO_SPACE:
>> > -depth_to_space_params = (DepthToSpaceParams*)network->
>> layers[layer].params;
>> > +depth_to_space_params = (DepthToSpaceParams
>> *)network->layers[layer].params;
>> >  if (cur_channels % (depth_to_space_params->block_size *
>> depth_to_space_params->block_size) != 0){
>> >  return DNN_ERROR;
>> >  }
>> > @@ -127,16 +127,16 @@ static DNNReturnType set_input_output_native(void*
>> model, DNNData* input, DNNDat
>> >  // layers_num,layer_type,layer_parameterss,layer_type,layer_
>> parameters...
>> >  // For CONV layer: activation_function, input_num, output_num,
>> kernel_size, kernel, biases
>> >  // For DEPTH_TO_SPACE layer: block_size
>> > -DNNModel* ff_dnn_load_model_native(const char* model_filename)
>> > +DNNModel *ff_dnn_load_model_native(const char *model_filename)
>> >  {
>> > -DNNModel* model = NULL;
>> > -ConvolutionalNetwork* network = NULL;
>> > -AVIOContext* model_file_context;
>> > +DNNModel *model = NULL;
>> > +ConvolutionalNetwork *network = NULL;
>> > +AVIOContext *model_file_context;
>> >  int file_size, dnn_size, kernel_size, i;
>> >  int32_t layer;
>> >  LayerType layer_type;
>> > -ConvolutionalParams* conv_params;
>> > -DepthToSpaceParams* dep

Re: [FFmpeg-devel] [PATCH 1/7] libavfilter: Adds on the fly generation of default DNN models for tensorflow backend instead of storing binary model.

2018-08-07 Thread Pedro Arthur
2018-08-06 18:09 GMT-03:00 Sergey Lavrushkin :
> Changed sprintf to snprintf.
Patch pushed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/7] libavfilter: Adds on the fly generation of default DNN models for tensorflow backend instead of storing binary model.

2018-08-07 Thread Rostislav Pehlivanov
On 7 August 2018 at 17:32, Pedro Arthur  wrote:

> 2018-08-06 18:09 GMT-03:00 Sergey Lavrushkin :
> > Changed sprintf to snprintf.
> Patch pushed.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

Why are the weights changed? Sure, some have been removed, in fact a lot,
but at the end we agreed that there should be absolutely no binary weights
left in lavf, and everything should be loadable on runtime.
Is this going to be implemented with a later patchset?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/7] libavfilter: Adds on the fly generation of default DNN models for tensorflow backend instead of storing binary model.

2018-08-07 Thread Pedro Arthur
2018-08-07 13:34 GMT-03:00 Rostislav Pehlivanov :
> On 7 August 2018 at 17:32, Pedro Arthur  wrote:
>
>> 2018-08-06 18:09 GMT-03:00 Sergey Lavrushkin :
>> > Changed sprintf to snprintf.
>> Patch pushed.
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
> Why are the weights changed? Sure, some have been removed, in fact a lot,
The data is the same, I think just the formatting (spaces) changed.

> but at the end we agreed that there should be absolutely no binary weights
> left in lavf, and everything should be loadable on runtime.
> Is this going to be implemented with a later patchset?
We are removing things gradually, I'm still thinking in how to
distribute the filter data.
Do you have any tips on where it would be easily accessible for users?

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


[FFmpeg-devel] [PATCH]lavc/libx264: Support monochrome encoding

2018-08-07 Thread Carl Eugen Hoyos
Hi!

Attached patch allows monochrome encoding with libx264, supported in
master since a few hours.

Please comment, Carl Eugen
From a26245de63bdc9afc6b21ea6e97b95a2a7e1e765 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Tue, 7 Aug 2018 20:23:06 +0200
Subject: [PATCH] lavc/libx264: Support monochrome encoding.

---
 libavcodec/libx264.c |   14 ++
 1 file changed, 14 insertions(+)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 12379ff..cc9e5c8 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -443,6 +443,10 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
 #ifdef X264_CSP_NV21
 case AV_PIX_FMT_NV21:  return X264_CSP_NV21;
 #endif
+#ifdef X264_CSP_I400
+case AV_PIX_FMT_GRAY8:
+case AV_PIX_FMT_GRAY10:return X264_CSP_I400;
+#endif
 };
 return 0;
 }
@@ -855,6 +859,9 @@ static const enum AVPixelFormat pix_fmts_8bit[] = {
 #ifdef X264_CSP_NV21
 AV_PIX_FMT_NV21,
 #endif
+#ifdef X264_CSP_I400
+AV_PIX_FMT_GRAY8,
+#endif
 AV_PIX_FMT_NONE
 };
 static const enum AVPixelFormat pix_fmts_9bit[] = {
@@ -867,6 +874,9 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
 AV_PIX_FMT_YUV422P10,
 AV_PIX_FMT_YUV444P10,
 AV_PIX_FMT_NV20,
+#ifdef X264_CSP_I400
+AV_PIX_FMT_GRAY10,
+#endif
 AV_PIX_FMT_NONE
 };
 static const enum AVPixelFormat pix_fmts_all[] = {
@@ -885,6 +895,10 @@ static const enum AVPixelFormat pix_fmts_all[] = {
 AV_PIX_FMT_YUV422P10,
 AV_PIX_FMT_YUV444P10,
 AV_PIX_FMT_NV20,
+#ifdef X264_CSP_I400
+AV_PIX_FMT_GRAY8,
+AV_PIX_FMT_GRAY10,
+#endif
 AV_PIX_FMT_NONE
 };
 #if CONFIG_LIBX264RGB_ENCODER
-- 
1.7.10.4

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


Re: [FFmpeg-devel] [PATCH]lavc/libx264: Support monochrome encoding

2018-08-07 Thread James Almer
On 8/7/2018 3:25 PM, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch allows monochrome encoding with libx264, supported in
> master since a few hours.
> 
> Please comment, Carl Eugen
> 
> 
> 0001-lavc-libx264-Support-monochrome-encoding.patch
> 
> 
> From a26245de63bdc9afc6b21ea6e97b95a2a7e1e765 Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos 
> Date: Tue, 7 Aug 2018 20:23:06 +0200
> Subject: [PATCH] lavc/libx264: Support monochrome encoding.
> 
> ---
>  libavcodec/libx264.c |   14 ++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> index 12379ff..cc9e5c8 100644
> --- a/libavcodec/libx264.c
> +++ b/libavcodec/libx264.c
> @@ -443,6 +443,10 @@ static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
>  #ifdef X264_CSP_NV21
>  case AV_PIX_FMT_NV21:  return X264_CSP_NV21;
>  #endif
> +#ifdef X264_CSP_I400
> +case AV_PIX_FMT_GRAY8:
> +case AV_PIX_FMT_GRAY10:return X264_CSP_I400;
> +#endif
>  };
>  return 0;
>  }
> @@ -855,6 +859,9 @@ static const enum AVPixelFormat pix_fmts_8bit[] = {
>  #ifdef X264_CSP_NV21
>  AV_PIX_FMT_NV21,
>  #endif
> +#ifdef X264_CSP_I400
> +AV_PIX_FMT_GRAY8,
> +#endif

Unneeded. This array is only used with old x264 builds.

>  AV_PIX_FMT_NONE
>  };
>  static const enum AVPixelFormat pix_fmts_9bit[] = {
> @@ -867,6 +874,9 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
>  AV_PIX_FMT_YUV422P10,
>  AV_PIX_FMT_YUV444P10,
>  AV_PIX_FMT_NV20,
> +#ifdef X264_CSP_I400
> +AV_PIX_FMT_GRAY10,
> +#endif
>  AV_PIX_FMT_NONE
>  };

Same.

>  static const enum AVPixelFormat pix_fmts_all[] = {
> @@ -885,6 +895,10 @@ static const enum AVPixelFormat pix_fmts_all[] = {
>  AV_PIX_FMT_YUV422P10,
>  AV_PIX_FMT_YUV444P10,
>  AV_PIX_FMT_NV20,
> +#ifdef X264_CSP_I400
> +AV_PIX_FMT_GRAY8,
> +AV_PIX_FMT_GRAY10,
> +#endif
>  AV_PIX_FMT_NONE
>  };
>  #if CONFIG_LIBX264RGB_ENCODER
> -- 1.7.10.4

I think you need to add these two pixfmts to avfmt2_num_planes() as
well, so they may return 1 instead of the default 3.

It seems to work, so should be ok otherwise.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avs2: correct avs2 description

2018-08-07 Thread James Almer
On 8/7/2018 7:39 AM, hwren wrote:
> Signed-off-by: hwren 
> ---
>  doc/decoders.texi| 2 +-
>  doc/general.texi | 2 +-
>  libavcodec/avs2_parser.c | 2 +-
>  libavcodec/codec_desc.c  | 2 +-
>  libavcodec/libdavs2.c| 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/doc/decoders.texi b/doc/decoders.texi
> index 9439b7b..31e96fb 100644
> --- a/doc/decoders.texi
> +++ b/doc/decoders.texi
> @@ -49,7 +49,7 @@ top-field-first is assumed
>  
>  @section libdavs2
>  
> -AVS2/IEEE 1857.4 video decoder wrapper.
> +AVS2-P2/IEEE1857.4 video decoder wrapper.
>  
>  This decoder allows libavcodec to decode AVS2 streams with davs2 library.
>  
> diff --git a/doc/general.texi b/doc/general.texi
> index cd725bb..3d15840 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to
>  
>  @section libdavs2
>  
> -FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video decoding.
> +FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video 
> decoding.
>  
>  Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for
>  installing the library. Then pass @code{--enable-libdavs2} to configure to
> diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
> index 520e98a..1c9b342 100644
> --- a/libavcodec/avs2_parser.c
> +++ b/libavcodec/avs2_parser.c
> @@ -1,5 +1,5 @@
>  /*
> - * AVS2/IEEE 1857.4 video parser.
> + * AVS2-P2/IEEE1857.4 video parser.
>   * Copyright (c) 2018  Huiwen Ren 
>   *
>   * This file is part of FFmpeg.
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 2fe4aaa..1cbb241 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
>  .id= AV_CODEC_ID_AVS2,
>  .type  = AVMEDIA_TYPE_VIDEO,
>  .name  = "avs2",
> -.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
> +.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
>  .props = AV_CODEC_PROP_LOSSY,
>  },
>  {
> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
> index 12db1f9..70aae3e 100644
> --- a/libavcodec/libdavs2.c
> +++ b/libavcodec/libdavs2.c
> @@ -163,7 +163,7 @@ static int davs2_decode_frame(AVCodecContext *avctx, void 
> *data,
>  
>  AVCodec ff_libdavs2_decoder = {
>  .name   = "libdavs2",
> -.long_name  = NULL_IF_CONFIG_SMALL("Decoder for AVS2/IEEE 1857.4"),
> +.long_name  = NULL_IF_CONFIG_SMALL("libdavs2 AVS2-P2/IEEE1857.4"),
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_AVS2,
>  .priv_data_size = sizeof(DAVS2Context),

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


Re: [FFmpeg-devel] [PATCH] avs2: correct avs2 description

2018-08-07 Thread Gyan Doshi



On 08-08-2018 12:05 AM, James Almer wrote:


Should be ok.


Will push.

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


Re: [FFmpeg-devel] [PATCH] avs2: correct avs2 description

2018-08-07 Thread Gyan Doshi



On 08-08-2018 12:08 AM, Gyan Doshi wrote:


Will push.

Thanks,
Gyan


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


Re: [FFmpeg-devel] [PATCH]lavc/libx264: Support monochrome encoding

2018-08-07 Thread Carl Eugen Hoyos
2018-08-07 20:31 GMT+02:00, James Almer :
> On 8/7/2018 3:25 PM, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch allows monochrome encoding with libx264, supported in
>> master since a few hours.
>>
>> Please comment, Carl Eugen
>>
>>
>> 0001-lavc-libx264-Support-monochrome-encoding.patch
>>
>>
>> From a26245de63bdc9afc6b21ea6e97b95a2a7e1e765 Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos 
>> Date: Tue, 7 Aug 2018 20:23:06 +0200
>> Subject: [PATCH] lavc/libx264: Support monochrome encoding.
>>
>> ---
>>  libavcodec/libx264.c |   14 ++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
>> index 12379ff..cc9e5c8 100644
>> --- a/libavcodec/libx264.c
>> +++ b/libavcodec/libx264.c
>> @@ -443,6 +443,10 @@ static int convert_pix_fmt(enum AVPixelFormat
>> pix_fmt)
>>  #ifdef X264_CSP_NV21
>>  case AV_PIX_FMT_NV21:  return X264_CSP_NV21;
>>  #endif
>> +#ifdef X264_CSP_I400
>> +case AV_PIX_FMT_GRAY8:
>> +case AV_PIX_FMT_GRAY10:return X264_CSP_I400;
>> +#endif
>>  };
>>  return 0;
>>  }
>> @@ -855,6 +859,9 @@ static const enum AVPixelFormat pix_fmts_8bit[] = {
>>  #ifdef X264_CSP_NV21
>>  AV_PIX_FMT_NV21,
>>  #endif
>> +#ifdef X264_CSP_I400
>> +AV_PIX_FMT_GRAY8,
>> +#endif
>
> Unneeded. This array is only used with old x264 builds.
>
>>  AV_PIX_FMT_NONE
>>  };
>>  static const enum AVPixelFormat pix_fmts_9bit[] = {
>> @@ -867,6 +874,9 @@ static const enum AVPixelFormat pix_fmts_10bit[] = {
>>  AV_PIX_FMT_YUV422P10,
>>  AV_PIX_FMT_YUV444P10,
>>  AV_PIX_FMT_NV20,
>> +#ifdef X264_CSP_I400
>> +AV_PIX_FMT_GRAY10,
>> +#endif
>>  AV_PIX_FMT_NONE
>>  };
>
> Same.
>
>>  static const enum AVPixelFormat pix_fmts_all[] = {
>> @@ -885,6 +895,10 @@ static const enum AVPixelFormat pix_fmts_all[] = {
>>  AV_PIX_FMT_YUV422P10,
>>  AV_PIX_FMT_YUV444P10,
>>  AV_PIX_FMT_NV20,
>> +#ifdef X264_CSP_I400
>> +AV_PIX_FMT_GRAY8,
>> +AV_PIX_FMT_GRAY10,
>> +#endif
>>  AV_PIX_FMT_NONE
>>  };
>>  #if CONFIG_LIBX264RGB_ENCODER
>> -- 1.7.10.4
>
> I think you need to add these two pixfmts to avfmt2_num_planes() as
> well, so they may return 1 instead of the default 3.

Pushed with these changes.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/dashdec: Support negative value of the @r attrbute of S in SegmentTimeline element

2018-08-07 Thread sanil
Hi,
The following patch supports parsing negative value of the @r attribute of S in 
SegmentTimeline element.

Example streams:
1. http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/1/MultiRate.mpd
2. http://dash.edgesuite.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd

---
 libavformat/dashdec.c | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 89f3ac2..ea960bc 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -262,6 +262,12 @@ static int64_t 
get_segment_start_time_based_on_timeline(struct representation *p
 goto finish;
 
 start_time += pls->timelines[i]->duration;
+
+if (pls->timelines[i]->repeat == -1) {
+start_time = pls->timelines[i]->duration * cur_seq_no;
+goto finish;
+}
+
 for (j = 0; j < pls->timelines[i]->repeat; j++) {
 num++;
 if (num == cur_seq_no)
@@ -1341,9 +1347,15 @@ static int64_t calc_max_seg_no(struct representation 
*pls, DASHContext *c)
 } else if (pls->n_timelines) {
 int i = 0;
 num = pls->first_seq_no + pls->n_timelines - 1;
-for (i = 0; i < pls->n_timelines; i++) {
-num += pls->timelines[i]->repeat;
+ for (i = 0; i < pls->n_timelines; i++) {
+if (pls->timelines[i]->repeat == -1) {
+int length_of_each_segment = 
pls->timelines[i]->duration/pls->fragment_timescale;
+num =  c->period_duration/length_of_each_segment;
+} else {
+num += pls->timelines[i]->repeat;
+}
 }
+
 } else if (c->is_live && pls->fragment_duration) {
 num = pls->first_seq_no + (((get_current_time_in_sec() - 
c->availability_start_time)) * pls->fragment_timescale)  / 
pls->fragment_duration;
 } else if (pls->fragment_duration) {
@@ -1952,7 +1964,7 @@ static int dash_read_header(AVFormatContext *s)
 ++stream_index;
 }
 
-  c->is_init_section_common_audio = is_common_init_section_exist(c->audios, 
c->n_audios);
+c->is_init_section_common_audio = is_common_init_section_exist(c->audios, 
c->n_audios);
 
 for (i = 0; i < c->n_audios; i++) {
 struct representation *cur_audio = c->audios[i];
-- 
Thanks,

2.7.4

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


Re: [FFmpeg-devel] [PATCH] ffmpeg: correct units for raw pts in -progress report

2018-08-07 Thread Gyan Doshi



On 06-08-2018 08:00 PM, Nicolas George wrote:


Not really. I suppose you could add the field with the correct name and
remove the bogus one later. But your thoughts on this are probably
better than mine.


That will just defer the breaking change. The options, as I see it, are

wontfix, or

push with a easily grepped intuitive commit msg for those who like to 
use nightly builds and want to know why their script is (partially) 
broken. Best done at the time of a new release.


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


Re: [FFmpeg-devel] [PATCH] ffmpeg: correct units for raw pts in -progress report

2018-08-07 Thread Nicolas George
Gyan Doshi (2018-08-08):
> That will just defer the breaking change.

That will leave people time to notice the change and allow old and new
scripts to work during the transition.

Regards,

-- 
  Nicolas George


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


[FFmpeg-devel] [PATCH]lavc/h264: Output pix_fmt GRAY for monochrome input.

2018-08-07 Thread Carl Eugen Hoyos
Hi!

Attached patch makes the h264 decoder output AV_PIX_FMT_GRAY for
monochrome h264 streams.
fate output is identical (and identical with the reference decoder) if
compared with extractplanes=y.

Please review, Carl Eugen
From 6434eff6c14698db192ec2f8777d2b4d2fdd3e8c Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos 
Date: Tue, 7 Aug 2018 21:48:47 +0200
Subject: [PATCH] lavc/h264: Output pix_fmt GRAY for monochrome input.

fate output is identical when compared with extractplanes=y.
---
 libavcodec/h264_mb.c   |   10 +-
 libavcodec/h264_mb_template.c  |   11 +-
 libavcodec/h264_parser.c   |3 +
 libavcodec/h264_slice.c|   17 +-
 libavcodec/h264dec.h   |1 +
 .../fate/h264-conformance-frext-hpcamolq_brcm_b|  200 ++--
 .../fate/h264-conformance-frext-hpcvmolq_brcm_b|  200 ++--
 7 files changed, 229 insertions(+), 213 deletions(-)

diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c
index 3cd17b7..a269b5c 100644
--- a/libavcodec/h264_mb.c
+++ b/libavcodec/h264_mb.c
@@ -250,7 +250,7 @@ static av_always_inline void mc_dir_part(const H264Context *h, H264SliceContext
 if (!square)
 qpix_op[luma_xy](dest_y + delta, src_y + delta, sl->mb_linesize);
 
-if (CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
+if (CHROMA400(h) || CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
 return;
 
 if (chroma_idc == 3 /* yuv444 */) {
@@ -425,7 +425,7 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon
 int weight1 = 64 - weight0;
 luma_weight_avg(dest_y, tmp_y, sl->mb_linesize,
 height, 5, weight0, weight1, 0);
-if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
+if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY))) {
 chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize,
   chroma_height, 5, weight0, weight1, 0);
 chroma_weight_avg(dest_cr, tmp_cr, sl->mb_uvlinesize,
@@ -438,7 +438,7 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon
 sl->pwt.luma_weight[refn1][1][0],
 sl->pwt.luma_weight[refn0][0][1] +
 sl->pwt.luma_weight[refn1][1][1]);
-if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
+if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY))) {
 chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize, chroma_height,
   sl->pwt.chroma_log2_weight_denom,
   sl->pwt.chroma_weight[refn0][0][0][0],
@@ -465,7 +465,7 @@ static av_always_inline void mc_part_weighted(const H264Context *h, H264SliceCon
sl->pwt.luma_log2_weight_denom,
sl->pwt.luma_weight[refn][list][0],
sl->pwt.luma_weight[refn][list][1]);
-if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
+if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY))) {
 if (sl->pwt.use_weight_chroma) {
 chroma_weight_op(dest_cb, sl->mb_uvlinesize, chroma_height,
  sl->pwt.chroma_log2_weight_denom,
@@ -566,7 +566,7 @@ static av_always_inline void xchg_mb_border(const H264Context *h, H264SliceConte
 XCHG(sl->top_borders[top_idx][sl->mb_x + 1],
  src_y + (17 << pixel_shift), 1);
 }
-if (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
+if (!CHROMA400(h) && (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY))) {
 if (chroma444) {
 if (deblock_topleft) {
 XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
index d5ea26a..2abc864 100644
--- a/libavcodec/h264_mb_template.c
+++ b/libavcodec/h264_mb_template.c
@@ -52,6 +52,7 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
 void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
 const int block_h   = 16 >> h->chroma_y_shift;
 const int chroma422 = CHROMA422(h);
+const int chroma400 = CHROMA400(h);
 
 dest_y  = h->cur_pic.f->data[0] + ((mb_x << PIXEL_SHIFT) + mb_y * sl->linesize)  * 16;
 dest_cb = h->cur_pic.f->data[1] +  (mb_x << PIXEL_SHIFT) * 8 + mb_y * sl->uvlinesize * block_h;
@@ -108,7 +109,7 @@ static av_noinline void FUNC(hl_decode_mb)(const H264Context *h, H264SliceContex
 for (j = 0; j < 16; j++)
 tmp_y[j] = get_bits(&gb, bit_depth);
 }
-if (SIMPLE || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
+ 

[FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for Bug #7338

2018-08-07 Thread Colin NG
---
 libavformat/dashdec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
index 09b06ef..fa784f1 100644
--- a/libavformat/dashdec.c
+++ b/libavformat/dashdec.c
@@ -1040,7 +1040,6 @@ end:
 xmlFree(rep_bandwidth_val);
 if (rep_framerate_val)
 xmlFree(rep_framerate_val);
-
 return ret;
 }
 
@@ -1869,7 +1868,7 @@ static int is_common_init_section_exist(struct 
representation **pls, int n_pls)
 url = first_init_section->url;
 url_offset = first_init_section->url_offset;
 size = pls[0]->init_section->size;
-for (i=0;iinit_section->url,url) || 
pls[i]->init_section->url_offset != url_offset || pls[i]->init_section->size != 
size) {
 return 0;
 }
@@ -1879,7 +1878,6 @@ static int is_common_init_section_exist(struct 
representation **pls, int n_pls)
 
 static void copy_init_section(struct representation *rep_dest, struct 
representation *rep_src)
 {
-*rep_dest->init_section = *rep_src->init_section;
 rep_dest->init_sec_buf = av_mallocz(rep_src->init_sec_buf_size);
 memcpy(rep_dest->init_sec_buf, rep_src->init_sec_buf, 
rep_src->init_sec_data_len);
 rep_dest->init_sec_buf_size = rep_src->init_sec_buf_size;
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for Bug #7338

2018-08-07 Thread Carl Eugen Hoyos
2018-08-07 22:12 GMT+02:00, Colin NG :
> ---
>  libavformat/dashdec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c
> index 09b06ef..fa784f1 100644
> --- a/libavformat/dashdec.c
> +++ b/libavformat/dashdec.c
> @@ -1040,7 +1040,6 @@ end:
>  xmlFree(rep_bandwidth_val);
>  if (rep_framerate_val)
>  xmlFree(rep_framerate_val);
> -
>  return ret;
>  }

No unrelated changes please.

> @@ -1869,7 +1868,7 @@ static int is_common_init_section_exist(struct
> representation **pls, int n_pls)
>  url = first_init_section->url;
>  url_offset = first_init_section->url_offset;
>  size = pls[0]->init_section->size;
> -for (i=0;i +for (i=1; ihttp://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/dashdec: Fix for Bug #7338

2018-08-07 Thread Carl Eugen Hoyos
2018-08-07 22:12 GMT+02:00, Colin NG :
> ---
>  libavformat/dashdec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)

And I forgot: Please fix the commit message.
Something like "lavf/dashdec: Fix double free in case of ..."
And "Fixes ticket #7338" (bugs are elsewhere).

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavc/h264: Output pix_fmt GRAY for monochrome input.

2018-08-07 Thread James Almer
On 8/7/2018 4:51 PM, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch makes the h264 decoder output AV_PIX_FMT_GRAY for
> monochrome h264 streams.
> fate output is identical (and identical with the reference decoder) if
> compared with extractplanes=y.
> 
> Please review, Carl Eugen
> 
> 
> 0001-lavc-h264-Output-pix_fmt-GRAY-for-monochrome-input.patch
> 
> 
> From 6434eff6c14698db192ec2f8777d2b4d2fdd3e8c Mon Sep 17 00:00:00 2001
> From: Carl Eugen Hoyos 
> Date: Tue, 7 Aug 2018 21:48:47 +0200
> Subject: [PATCH] lavc/h264: Output pix_fmt GRAY for monochrome input.
> 
> fate output is identical when compared with extractplanes=y.
> ---
>  libavcodec/h264_mb.c   |   10 +-
>  libavcodec/h264_mb_template.c  |   11 +-
>  libavcodec/h264_parser.c   |3 +
>  libavcodec/h264_slice.c|   17 +-
>  libavcodec/h264dec.h   |1 +
>  .../fate/h264-conformance-frext-hpcamolq_brcm_b|  200 
> ++--
>  .../fate/h264-conformance-frext-hpcvmolq_brcm_b|  200 
> ++--
>  7 files changed, 229 insertions(+), 213 deletions(-)
> 
> diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c
> index 3cd17b7..a269b5c 100644
> --- a/libavcodec/h264_mb.c
> +++ b/libavcodec/h264_mb.c
> @@ -250,7 +250,7 @@ static av_always_inline void mc_dir_part(const 
> H264Context *h, H264SliceContext
>  if (!square)
>  qpix_op[luma_xy](dest_y + delta, src_y + delta, sl->mb_linesize);
>  
> -if (CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
> +if (CHROMA400(h) || CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
>  return;
>  
>  if (chroma_idc == 3 /* yuv444 */) {
> @@ -425,7 +425,7 @@ static av_always_inline void mc_part_weighted(const 
> H264Context *h, H264SliceCon
>  int weight1 = 64 - weight0;
>  luma_weight_avg(dest_y, tmp_y, sl->mb_linesize,
>  height, 5, weight0, weight1, 0);
> -if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
> +if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags & 
> AV_CODEC_FLAG_GRAY))) {
>  chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize,
>chroma_height, 5, weight0, weight1, 0);
>  chroma_weight_avg(dest_cr, tmp_cr, sl->mb_uvlinesize,
> @@ -438,7 +438,7 @@ static av_always_inline void mc_part_weighted(const 
> H264Context *h, H264SliceCon
>  sl->pwt.luma_weight[refn1][1][0],
>  sl->pwt.luma_weight[refn0][0][1] +
>  sl->pwt.luma_weight[refn1][1][1]);
> -if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
> +if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags & 
> AV_CODEC_FLAG_GRAY))) {
>  chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize, 
> chroma_height,
>sl->pwt.chroma_log2_weight_denom,
>sl->pwt.chroma_weight[refn0][0][0][0],
> @@ -465,7 +465,7 @@ static av_always_inline void mc_part_weighted(const 
> H264Context *h, H264SliceCon
> sl->pwt.luma_log2_weight_denom,
> sl->pwt.luma_weight[refn][list][0],
> sl->pwt.luma_weight[refn][list][1]);
> -if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
> +if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags & 
> AV_CODEC_FLAG_GRAY))) {
>  if (sl->pwt.use_weight_chroma) {
>  chroma_weight_op(dest_cb, sl->mb_uvlinesize, chroma_height,
>   sl->pwt.chroma_log2_weight_denom,
> @@ -566,7 +566,7 @@ static av_always_inline void xchg_mb_border(const 
> H264Context *h, H264SliceConte
>  XCHG(sl->top_borders[top_idx][sl->mb_x + 1],
>   src_y + (17 << pixel_shift), 1);
>  }
> -if (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
> +if (!CHROMA400(h) && (simple || !CONFIG_GRAY || !(h->flags & 
> AV_CODEC_FLAG_GRAY))) {
>  if (chroma444) {
>  if (deblock_topleft) {
>  XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << 
> pixel_shift), 1);
> diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
> index d5ea26a..2abc864 100644
> --- a/libavcodec/h264_mb_template.c
> +++ b/libavcodec/h264_mb_template.c
> @@ -52,6 +52,7 @@ static av_noinline void FUNC(hl_decode_mb)(const 
> H264Context *h, H264SliceContex
>  void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
>  const int block_h   = 16 >> h->chroma_y_shift;
>  const int chroma422 = CHROMA422(h);
> +const int chroma400 = CHROMA400(h);
>  
>  dest_y  = h->cur_pic.f->data[0] + ((mb_x << PIXEL_SHIFT) + mb_y * 
> sl->linesize)  * 16;
>  dest_cb = h->cur_pic.f->data[1] +  (mb_x << PIXEL_SHIFT) 

Re: [FFmpeg-devel] [PATCH]lavc/h264: Output pix_fmt GRAY for monochrome input.

2018-08-07 Thread Carl Eugen Hoyos
2018-08-07 22:26 GMT+02:00, James Almer :
> On 8/7/2018 4:51 PM, Carl Eugen Hoyos wrote:
>> Hi!
>>
>> Attached patch makes the h264 decoder output AV_PIX_FMT_GRAY for
>> monochrome h264 streams.
>> fate output is identical (and identical with the reference decoder) if
>> compared with extractplanes=y.
>>
>> Please review, Carl Eugen
>>
>>
>> 0001-lavc-h264-Output-pix_fmt-GRAY-for-monochrome-input.patch
>>
>>
>> From 6434eff6c14698db192ec2f8777d2b4d2fdd3e8c Mon Sep 17 00:00:00 2001
>> From: Carl Eugen Hoyos 
>> Date: Tue, 7 Aug 2018 21:48:47 +0200
>> Subject: [PATCH] lavc/h264: Output pix_fmt GRAY for monochrome input.
>>
>> fate output is identical when compared with extractplanes=y.
>> ---
>>  libavcodec/h264_mb.c   |   10 +-
>>  libavcodec/h264_mb_template.c  |   11 +-
>>  libavcodec/h264_parser.c   |3 +
>>  libavcodec/h264_slice.c|   17 +-
>>  libavcodec/h264dec.h   |1 +
>>  .../fate/h264-conformance-frext-hpcamolq_brcm_b|  200
>> ++--
>>  .../fate/h264-conformance-frext-hpcvmolq_brcm_b|  200
>> ++--
>>  7 files changed, 229 insertions(+), 213 deletions(-)
>>
>> diff --git a/libavcodec/h264_mb.c b/libavcodec/h264_mb.c
>> index 3cd17b7..a269b5c 100644
>> --- a/libavcodec/h264_mb.c
>> +++ b/libavcodec/h264_mb.c
>> @@ -250,7 +250,7 @@ static av_always_inline void mc_dir_part(const
>> H264Context *h, H264SliceContext
>>  if (!square)
>>  qpix_op[luma_xy](dest_y + delta, src_y + delta, sl->mb_linesize);
>>
>> -if (CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
>> +if (CHROMA400(h) || CONFIG_GRAY && h->flags & AV_CODEC_FLAG_GRAY)
>>  return;
>>
>>  if (chroma_idc == 3 /* yuv444 */) {
>> @@ -425,7 +425,7 @@ static av_always_inline void mc_part_weighted(const
>> H264Context *h, H264SliceCon
>>  int weight1 = 64 - weight0;
>>  luma_weight_avg(dest_y, tmp_y, sl->mb_linesize,
>>  height, 5, weight0, weight1, 0);
>> -if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
>> +if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags &
>> AV_CODEC_FLAG_GRAY))) {
>>  chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize,
>>chroma_height, 5, weight0, weight1, 0);
>>  chroma_weight_avg(dest_cr, tmp_cr, sl->mb_uvlinesize,
>> @@ -438,7 +438,7 @@ static av_always_inline void mc_part_weighted(const
>> H264Context *h, H264SliceCon
>>  sl->pwt.luma_weight[refn1][1][0],
>>  sl->pwt.luma_weight[refn0][0][1] +
>>  sl->pwt.luma_weight[refn1][1][1]);
>> -if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
>> +if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags &
>> AV_CODEC_FLAG_GRAY))) {
>>  chroma_weight_avg(dest_cb, tmp_cb, sl->mb_uvlinesize,
>> chroma_height,
>>sl->pwt.chroma_log2_weight_denom,
>>sl->pwt.chroma_weight[refn0][0][0][0],
>> @@ -465,7 +465,7 @@ static av_always_inline void mc_part_weighted(const
>> H264Context *h, H264SliceCon
>> sl->pwt.luma_log2_weight_denom,
>> sl->pwt.luma_weight[refn][list][0],
>> sl->pwt.luma_weight[refn][list][1]);
>> -if (!CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
>> +if (!CHROMA400(h) && (!CONFIG_GRAY || !(h->flags &
>> AV_CODEC_FLAG_GRAY))) {
>>  if (sl->pwt.use_weight_chroma) {
>>  chroma_weight_op(dest_cb, sl->mb_uvlinesize,
>> chroma_height,
>>   sl->pwt.chroma_log2_weight_denom,
>> @@ -566,7 +566,7 @@ static av_always_inline void xchg_mb_border(const
>> H264Context *h, H264SliceConte
>>  XCHG(sl->top_borders[top_idx][sl->mb_x + 1],
>>   src_y + (17 << pixel_shift), 1);
>>  }
>> -if (simple || !CONFIG_GRAY || !(h->flags & AV_CODEC_FLAG_GRAY)) {
>> +if (!CHROMA400(h) && (simple || !CONFIG_GRAY || !(h->flags &
>> AV_CODEC_FLAG_GRAY))) {
>>  if (chroma444) {
>>  if (deblock_topleft) {
>>  XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7
>> << pixel_shift), 1);
>> diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
>> index d5ea26a..2abc864 100644
>> --- a/libavcodec/h264_mb_template.c
>> +++ b/libavcodec/h264_mb_template.c
>> @@ -52,6 +52,7 @@ static av_noinline void FUNC(hl_decode_mb)(const
>> H264Context *h, H264SliceContex
>>  void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
>>  const int block_h   = 16 >> h->chroma_y_shift;
>>  const int chroma422 = CHROMA422(h);
>> +const int chroma400 = CHROMA400(h);
>>
>>  dest_y  = h->cur_pic.f->data[0] + ((

Re: [FFmpeg-devel] [PATCH] ffmpeg: simplify refcounting packets for the muxing queue

2018-08-07 Thread James Almer
On 8/5/2018 9:34 PM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  fftools/ffmpeg.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 55faec8ede..2459374f08 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -724,11 +724,11 @@ static void write_packet(OutputFile *of, AVPacket *pkt, 
> OutputStream *ost, int u
>  if (ret < 0)
>  exit_program(1);
>  }
> -ret = av_packet_ref(&tmp_pkt, pkt);
> +ret = av_packet_make_refcounted(pkt);
>  if (ret < 0)
>  exit_program(1);
> +av_packet_move_ref(&tmp_pkt, pkt);
>  av_fifo_generic_write(ost->muxing_queue, &tmp_pkt, sizeof(tmp_pkt), 
> NULL);
> -av_packet_unref(pkt);
>  return;
>  }

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


Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for audio too (in case of edit lists).

2018-08-07 Thread Michael Niedermayer
On Mon, Aug 06, 2018 at 04:32:29PM -0700, isasi-at-google@ffmpeg.org wrote:
> From: Sasi Inguva 
> 
> Fixes vorbis mp4 audio files, with edit list specified. Since
> st->skip_samples is not set in case of vorbis , ffmpeg computes the
> start_time as negative.
> 
> Signed-off-by: Sasi Inguva 
> ---
>  libavformat/mov.c  | 4 ++--
>  tests/fate/mov.mak | 5 +
>  tests/ref/fate/mov-neg-firstpts-discard-vorbis | 3 +++
>  3 files changed, 10 insertions(+), 2 deletions(-)
>  create mode 100644 tests/ref/fate/mov-neg-firstpts-discard-vorbis

The commit message speaks of audio, this changes subtitles too
is this intended ?

thx

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

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


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


Re: [FFmpeg-devel] [PATCH 4/7] Adds gray floating-point pixel formats.

2018-08-07 Thread Michael Niedermayer
On Tue, Aug 07, 2018 at 12:17:58AM +0300, Sergey Lavrushkin wrote:
> I split patch to one for libavutil and another for libswscale,
> also added LUT for unscaled conversion, added
> conversions for scaling and updated fate tests.

>  libavutil/pixdesc.c  |   22 ++
>  libavutil/pixfmt.h   |5 +
>  libavutil/version.h  |2 +-
>  tests/ref/fate/sws-pixdesc-query |3 +++
>  4 files changed, 31 insertions(+), 1 deletion(-)
> b58f328f5d90954c62957f127b1acbfad5795a4d  
> 0004-libavutil-Adds-gray-floating-point-pixel-formats.patch
> From 8bcc10b49c41612b4d6549e64d90acf3f0b3fc6a Mon Sep 17 00:00:00 2001
> From: Sergey Lavrushkin 
> Date: Fri, 3 Aug 2018 18:02:49 +0300
> Subject: [PATCH 4/9] libavutil: Adds gray floating-point pixel formats.
> 
> ---
>  libavutil/pixdesc.c  | 22 ++
>  libavutil/pixfmt.h   |  5 +
>  libavutil/version.h  |  2 +-
>  tests/ref/fate/sws-pixdesc-query |  3 +++
>  4 files changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index 96e079584a..970a83214c 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -2206,6 +2206,28 @@ static const AVPixFmtDescriptor 
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  .name  = "opencl",
>  .flags = AV_PIX_FMT_FLAG_HWACCEL,
>  },
> +[AV_PIX_FMT_GRAYF32BE] = {
> +.name = "grayf32be",
> +.nb_components = 1,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* Y */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT,
> +.alias = "yf32be",
> +},
> +[AV_PIX_FMT_GRAYF32LE] = {
> +.name = "grayf32le",
> +.nb_components = 1,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* Y */
> +},
> +.flags = AV_PIX_FMT_FLAG_FLOAT,
> +.alias = "yf32le",
> +},
>  };
>  #if FF_API_PLUS1_MINUS1
>  FF_ENABLE_DEPRECATION_WARNINGS
> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 2b3307845e..7b254732d8 100644
> --- a/libavutil/pixfmt.h
> +++ b/libavutil/pixfmt.h
> @@ -337,6 +337,9 @@ enum AVPixelFormat {
>  AV_PIX_FMT_GRAY14BE,   ///  AV_PIX_FMT_GRAY14LE,   ///  
> +AV_PIX_FMT_GRAYF32BE,  ///< IEEE-754 single precision Y, 32bpp, 
> big-endian
> +AV_PIX_FMT_GRAYF32LE,  ///< IEEE-754 single precision Y, 32bpp, 
> little-endian
> +
>  AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if 
> you want to link with shared libav* because the number of formats might 
> differ between versions
>  };
>  
> @@ -405,6 +408,8 @@ enum AVPixelFormat {
>  #define AV_PIX_FMT_GBRPF32AV_PIX_FMT_NE(GBRPF32BE,  GBRPF32LE)
>  #define AV_PIX_FMT_GBRAPF32   AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
>  
> +#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE)
> +
>  #define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
>  #define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
>  #define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
> diff --git a/libavutil/version.h b/libavutil/version.h
> index 44bdebdc93..5205c5bc60 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -79,7 +79,7 @@
>   */
>  
>  #define LIBAVUTIL_VERSION_MAJOR  56
> -#define LIBAVUTIL_VERSION_MINOR  18
> +#define LIBAVUTIL_VERSION_MINOR  19
>  #define LIBAVUTIL_VERSION_MICRO 102
>  
>  #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
> diff --git a/tests/ref/fate/sws-pixdesc-query 
> b/tests/ref/fate/sws-pixdesc-query
> index 8071ec484d..451c7d83b9 100644
> --- a/tests/ref/fate/sws-pixdesc-query
> +++ b/tests/ref/fate/sws-pixdesc-query
> @@ -126,6 +126,7 @@ isBE:
>gray14be
>gray16be
>gray9be
> +  grayf32be
>nv20be
>p010be
>p016be
> @@ -412,6 +413,8 @@ Gray:
>gray16le
>gray9be
>gray9le
> +  grayf32be
> +  grayf32le
>ya16be
>ya16le
>ya8
> -- 
> 2.14.1
> 

>  libswscale/input.c   |   38 +++
>  libswscale/output.c  |   60 
> +++
>  libswscale/ppc/swscale_altivec.c |1 
>  libswscale/swscale_internal.h|9 
>  libswscale/swscale_unscaled.c|   54 ++-
>  libswscale/utils.c   |   20 +-
>  libswscale/x86/swscale_template.c|3 +
>  tests/ref/fate/filter-pixdesc-grayf32be  |1 
>  tests/ref/fate/filter-pixdesc-grayf32le  |1 
>  tests/ref/fate/filter-pixfmts-copy   |2 +
>  tests/ref/fate/filter-pixfmts-crop   |2 +
>  tests/ref/fate/filter-pixfmts-field  |2 +
>  tests/ref/fate/filte

Re: [FFmpeg-devel] [PATCH 4/7] Adds gray floating-point pixel formats.

2018-08-07 Thread Michael Niedermayer
On Tue, Aug 07, 2018 at 12:17:58AM +0300, Sergey Lavrushkin wrote:
> I split patch to one for libavutil and another for libswscale,
> also added LUT for unscaled conversion, added
> conversions for scaling and updated fate tests.

>  libavutil/pixdesc.c  |   22 ++
>  libavutil/pixfmt.h   |5 +
>  libavutil/version.h  |2 +-
>  tests/ref/fate/sws-pixdesc-query |3 +++
>  4 files changed, 31 insertions(+), 1 deletion(-)
> b58f328f5d90954c62957f127b1acbfad5795a4d  
> 0004-libavutil-Adds-gray-floating-point-pixel-formats.patch
> From 8bcc10b49c41612b4d6549e64d90acf3f0b3fc6a Mon Sep 17 00:00:00 2001
> From: Sergey Lavrushkin 
> Date: Fri, 3 Aug 2018 18:02:49 +0300
> Subject: [PATCH 4/9] libavutil: Adds gray floating-point pixel formats.
> 
> ---
>  libavutil/pixdesc.c  | 22 ++
>  libavutil/pixfmt.h   |  5 +
>  libavutil/version.h  |  2 +-
>  tests/ref/fate/sws-pixdesc-query |  3 +++
>  4 files changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index 96e079584a..970a83214c 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -2206,6 +2206,28 @@ static const AVPixFmtDescriptor 
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  .name  = "opencl",
>  .flags = AV_PIX_FMT_FLAG_HWACCEL,
>  },
> +[AV_PIX_FMT_GRAYF32BE] = {
> +.name = "grayf32be",
> +.nb_components = 1,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* Y */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_FLOAT,
> +.alias = "yf32be",
> +},
> +[AV_PIX_FMT_GRAYF32LE] = {
> +.name = "grayf32le",
> +.nb_components = 1,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* Y */
> +},
> +.flags = AV_PIX_FMT_FLAG_FLOAT,
> +.alias = "yf32le",
> +},
>  };
>  #if FF_API_PLUS1_MINUS1
>  FF_ENABLE_DEPRECATION_WARNINGS
> diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
> index 2b3307845e..7b254732d8 100644
> --- a/libavutil/pixfmt.h
> +++ b/libavutil/pixfmt.h
> @@ -337,6 +337,9 @@ enum AVPixelFormat {
>  AV_PIX_FMT_GRAY14BE,   ///  AV_PIX_FMT_GRAY14LE,   ///  
> +AV_PIX_FMT_GRAYF32BE,  ///< IEEE-754 single precision Y, 32bpp, 
> big-endian
> +AV_PIX_FMT_GRAYF32LE,  ///< IEEE-754 single precision Y, 32bpp, 
> little-endian
> +
>  AV_PIX_FMT_NB ///< number of pixel formats, DO NOT USE THIS if 
> you want to link with shared libav* because the number of formats might 
> differ between versions
>  };
>  
> @@ -405,6 +408,8 @@ enum AVPixelFormat {
>  #define AV_PIX_FMT_GBRPF32AV_PIX_FMT_NE(GBRPF32BE,  GBRPF32LE)
>  #define AV_PIX_FMT_GBRAPF32   AV_PIX_FMT_NE(GBRAPF32BE, GBRAPF32LE)
>  
> +#define AV_PIX_FMT_GRAYF32 AV_PIX_FMT_NE(GRAYF32BE, GRAYF32LE)
> +
>  #define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
>  #define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
>  #define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
> diff --git a/libavutil/version.h b/libavutil/version.h
> index 44bdebdc93..5205c5bc60 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h

> @@ -79,7 +79,7 @@
>   */
>  
>  #define LIBAVUTIL_VERSION_MAJOR  56
> -#define LIBAVUTIL_VERSION_MINOR  18
> +#define LIBAVUTIL_VERSION_MINOR  19
>  #define LIBAVUTIL_VERSION_MICRO 102

a bump to minor must reset micro to 100

[...]

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


Re: [FFmpeg-devel] [PATCH] MAINTAINERS: add myself to MIPS section

2018-08-07 Thread Michael Niedermayer
On Mon, Aug 06, 2018 at 05:58:40AM +, Manojkumar Bhosale wrote:
> LGTM

will apply

thanks

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

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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


Re: [FFmpeg-devel] [PATCH v3] avs2: Correct expression error and simplify log

2018-08-07 Thread Michael Niedermayer
On Tue, Aug 07, 2018 at 05:37:30PM +0800, hwren wrote:
> Signed-off-by: hwren 
> ---
>  doc/decoders.texi| 2 +-
>  doc/general.texi | 2 +-
>  libavcodec/avs2_parser.c | 2 +-
>  libavcodec/codec_desc.c  | 2 +-
>  libavcodec/libdavs2.c| 5 ++---
>  5 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/doc/decoders.texi b/doc/decoders.texi
> index 9439b7b..31e96fb 100644
> --- a/doc/decoders.texi
> +++ b/doc/decoders.texi
> @@ -49,7 +49,7 @@ top-field-first is assumed
>  
>  @section libdavs2
>  
> -AVS2/IEEE 1857.4 video decoder wrapper.
> +AVS2-P2/IEEE1857.4 video decoder wrapper.
>  
>  This decoder allows libavcodec to decode AVS2 streams with davs2 library.
>  
> diff --git a/doc/general.texi b/doc/general.texi
> index cd725bb..3d15840 100644
> --- a/doc/general.texi
> +++ b/doc/general.texi
> @@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to
>  
>  @section libdavs2
>  
> -FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video decoding.
> +FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video 
> decoding.
>  
>  Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for
>  installing the library. Then pass @code{--enable-libdavs2} to configure to
> diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
> index 520e98a..1c9b342 100644
> --- a/libavcodec/avs2_parser.c
> +++ b/libavcodec/avs2_parser.c
> @@ -1,5 +1,5 @@
>  /*
> - * AVS2/IEEE 1857.4 video parser.
> + * AVS2-P2/IEEE1857.4 video parser.
>   * Copyright (c) 2018  Huiwen Ren 
>   *
>   * This file is part of FFmpeg.
> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
> index 2fe4aaa..1cbb241 100644
> --- a/libavcodec/codec_desc.c
> +++ b/libavcodec/codec_desc.c
> @@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
>  .id= AV_CODEC_ID_AVS2,
>  .type  = AVMEDIA_TYPE_VIDEO,
>  .name  = "avs2",
> -.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
> +.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
>  .props = AV_CODEC_PROP_LOSSY,
>  },
>  {
> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
> index 12db1f9..9cc86a2 100644
> --- a/libavcodec/libdavs2.c
> +++ b/libavcodec/libdavs2.c

> @@ -51,7 +51,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>  
>  /* init the decoder */
>  cad->param.threads  = avctx->thread_count;
> -cad->param.info_level   = 0;
> +cad->param.info_level   = DAVS2_LOG_WARNING;
>  cad->decoder= davs2_decoder_open(&cad->param);
>  
>  if (!cad->decoder) {

> @@ -59,7 +59,6 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>  return AVERROR(EINVAL);
>  }
>  
> -av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
>  return 0;
>  }

these things look unrelated to the other changes, they should be in 
seperate patches

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


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


[FFmpeg-devel] [PATCH] lavfi/vf_libvmaf: update to use libvmaf v1.3.9

2018-08-07 Thread Kyle Swanson
From: Kyle Swanson 

Signed-off-by: Kyle Swanson 
---
 configure| 2 +-
 libavfilter/vf_libvmaf.c | 9 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 15a58935de..e718c1531c 100755
--- a/configure
+++ b/configure
@@ -6089,7 +6089,7 @@ enabled libtwolame&& require libtwolame twolame.h 
twolame_init -ltwolame
die "ERROR: libtwolame must be installed and 
version must be >= 0.3.10"; }
 enabled libv4l2   && require_pkg_config libv4l2 libv4l2 libv4l2.h 
v4l2_ioctl
 enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" 
vid.stab/libvidstab.h vsMotionDetectInit
-enabled libvmaf   && require_pkg_config libvmaf "libvmaf >= 0.6.2" 
libvmaf.h compute_vmaf
+enabled libvmaf   && require_pkg_config libvmaf "libvmaf >= 1.3.9" 
libvmaf.h compute_vmaf
 enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h 
E_IF_init -lvo-amrwbenc
 enabled libvorbis && require_pkg_config libvorbis vorbis 
vorbis/codec.h vorbis_info_init &&
  require_pkg_config libvorbisenc vorbisenc 
vorbis/vorbisenc.h vorbis_encode_init
diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
index 5d47a74375..249e50c720 100644
--- a/libavfilter/vf_libvmaf.c
+++ b/libavfilter/vf_libvmaf.c
@@ -62,6 +62,9 @@ typedef struct LIBVMAFContext {
 int ssim;
 int ms_ssim;
 char *pool;
+int n_threads;
+int n_subsample;
+int enable_conf_interval;
 int error;
 } LIBVMAFContext;
 
@@ -78,6 +81,9 @@ static const AVOption libvmaf_options[] = {
 {"ssim",  "Enables computing ssim along with vmaf.",   
 OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 {"ms_ssim",  "Enables computing ms-ssim along with vmaf.", 
 OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 {"pool",  "Set the pool method to be used for computing vmaf.",
 OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS},
+{"n_threads", "Set number of threads to be used when computing vmaf.", 
 OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS},
+{"n_subsample", "Set interval for frame subsampling used when computing 
vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, FLAGS},
+{"enable_conf_interval",  "Enables confidence interval.",  
 OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
 { NULL }
 };
 
@@ -166,7 +172,8 @@ static void compute_vmaf_score(LIBVMAFContext *s)
 read_frame, s, s->model_path, s->log_path,
 s->log_fmt, 0, 0, s->enable_transform,
 s->phone_model, s->psnr, s->ssim,
-s->ms_ssim, s->pool);
+s->ms_ssim, s->pool,
+s->n_threads, s->n_subsample, 
s->enable_conf_interval);
 }
 
 static void *call_vmaf(void *ctx)
-- 
2.14.3 (Apple Git-98)

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vp9: Check in decode_tiles() if there is data remaining

2018-08-07 Thread Michael Niedermayer
On Mon, Aug 06, 2018 at 09:50:57PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 6, 2018 at 3:00 PM, Michael Niedermayer 
> wrote:
> 
> > On Tue, Aug 07, 2018 at 01:05:51AM +0800, Ronald S. Bultje wrote:
> > > Hi,
> > >
> > > On Sun, Aug 5, 2018, 9:17 AM Michael Niedermayer  > >
> > > wrote:
> > >
> > > > Fixes: Timeout
> > > > Fixes:
> > > > 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_
> > VP9_fuzzer-5707345857347584
> > > >
> > > > Found-by: continuous fuzzing process
> > > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > > Signed-off-by
> > > >  > ffmpegSigned-off-by>:
> > > > Michael Niedermayer 
> > > > ---
> > > >  libavcodec/vp9.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > > > index b1178c9c0c..4ca51ec108 100644
> > > > --- a/libavcodec/vp9.c
> > > > +++ b/libavcodec/vp9.c
> > > > @@ -1302,6 +1302,9 @@ static int decode_tiles(AVCodecContext *avctx,
> > > >  memset(lflvl_ptr->mask, 0,
> > > > sizeof(lflvl_ptr->mask));
> > > >  }
> > > >
> > > > +if (td->c->end <= td->c->buffer && td->c->bits >=
> > 0) {
> > > > +return AVERROR_INVALIDDATA;
> > > > +}
> > > >  if (s->pass == 2) {
> > > >  decode_sb_mem(td, row, col, lflvl_ptr,
> > > >yoff2, uvoff2, BL_64X64);
> > > >
> > >
> > > I don't think this matches spec. Implementations could use this to store
> > > auxiliary data.
> >
> > This checks, or rather is intended to check for a premature end of the
> > input.
> > Am i missing something? because a premature end of input seems not to lead
> > to more (auxiliary or other) data in the input.
> 
> 
> Hm, I misread it, sorry about that, my bad. Please ignore my first review.
> 

> Is end == buffer && bits == 0 something that can happen on valid input if
> things just align properly? Otherwise looks OK.

The same condition is used in vp5/6/8.
I think this condition only occurs if the input ends. The part i do not know
is if such premature ends might be a "valid compression"

Either way, if this check misbehaves for a valid file then it should be
reverted/removed unless its improv-able and improved.


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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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


Re: [FFmpeg-devel] [PATCH v3] avs2: Correct expression error and simplify log

2018-08-07 Thread Huiwen Ren







在 2018-08-08 06:59:52,"Michael Niedermayer"  写道:
>On Tue, Aug 07, 2018 at 05:37:30PM +0800, hwren wrote:
>> Signed-off-by: hwren 
>> ---
>>  doc/decoders.texi| 2 +-
>>  doc/general.texi | 2 +-
>>  libavcodec/avs2_parser.c | 2 +-
>>  libavcodec/codec_desc.c  | 2 +-
>>  libavcodec/libdavs2.c| 5 ++---
>>  5 files changed, 6 insertions(+), 7 deletions(-)
>>
>> diff --git a/doc/decoders.texi b/doc/decoders.texi
>> index 9439b7b..31e96fb 100644
>> --- a/doc/decoders.texi
>> +++ b/doc/decoders.texi
>> @@ -49,7 +49,7 @@ top-field-first is assumed
>>  
>>  @section libdavs2
>>  
>> -AVS2/IEEE 1857.4 video decoder wrapper.
>> +AVS2-P2/IEEE1857.4 video decoder wrapper.
>>  
>>  This decoder allows libavcodec to decode AVS2 streams with davs2 library.
>>  
>> diff --git a/doc/general.texi b/doc/general.texi
>> index cd725bb..3d15840 100644
>> --- a/doc/general.texi
>> +++ b/doc/general.texi
>> @@ -19,7 +19,7 @@ explicitly requested by passing the appropriate flags to
>>  
>>  @section libdavs2
>>  
>> -FFmpeg can make use of the davs2 library for AVS2/IEEE 1857.4 video 
>> decoding.
>> +FFmpeg can make use of the davs2 library for AVS2-P2/IEEE1857.4 video 
>> decoding.
>>  
>>  Go to @url{https://github.com/pkuvcl/davs2} and follow the instructions for
>>  installing the library. Then pass @code{--enable-libdavs2} to configure to
>> diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
>> index 520e98a..1c9b342 100644
>> --- a/libavcodec/avs2_parser.c
>> +++ b/libavcodec/avs2_parser.c
>> @@ -1,5 +1,5 @@
>>  /*
>> - * AVS2/IEEE 1857.4 video parser.
>> + * AVS2-P2/IEEE1857.4 video parser.
>>   * Copyright (c) 2018  Huiwen Ren 
>>   *
>>   * This file is part of FFmpeg.
>> diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
>> index 2fe4aaa..1cbb241 100644
>> --- a/libavcodec/codec_desc.c
>> +++ b/libavcodec/codec_desc.c
>> @@ -1398,7 +1398,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
>>  .id= AV_CODEC_ID_AVS2,
>>  .type  = AVMEDIA_TYPE_VIDEO,
>>  .name  = "avs2",
>> -.long_name = NULL_IF_CONFIG_SMALL("AVS2/IEEE 1857.4"),
>> +.long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
>>  .props = AV_CODEC_PROP_LOSSY,
>>  },
>>  {
>> diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c
>> index 12db1f9..9cc86a2 100644
>> --- a/libavcodec/libdavs2.c
>> +++ b/libavcodec/libdavs2.c
>
>> @@ -51,7 +51,7 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>>  
>>  /* init the decoder */
>>  cad->param.threads  = avctx->thread_count;
>> -cad->param.info_level   = 0;
>> +cad->param.info_level   = DAVS2_LOG_WARNING;
>>  cad->decoder= davs2_decoder_open(&cad->param);
>>  
>>  if (!cad->decoder) {
>
>> @@ -59,7 +59,6 @@ static av_cold int davs2_init(AVCodecContext *avctx)
>>  return AVERROR(EINVAL);
>>  }
>>  
>> -av_log(avctx, AV_LOG_VERBOSE, "decoder created. %p\n", cad->decoder);
>>  return 0;
>>  }
>
>these things look unrelated to the other changes, they should be in
>seperate patches
>
>thx

Seperated and committed in another patch.

>
>[...]
>
>--
>Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
>What does censorship reveal? It reveals fear. -- Julian Assange
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/vp9: Check in decode_tiles() if there is data remaining

2018-08-07 Thread Ronald S. Bultje
Hi,

On Tue, Aug 7, 2018 at 7:15 PM, Michael Niedermayer 
wrote:

> On Mon, Aug 06, 2018 at 09:50:57PM -0400, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Mon, Aug 6, 2018 at 3:00 PM, Michael Niedermayer
> 
> > wrote:
> >
> > > On Tue, Aug 07, 2018 at 01:05:51AM +0800, Ronald S. Bultje wrote:
> > > > Hi,
> > > >
> > > > On Sun, Aug 5, 2018, 9:17 AM Michael Niedermayer
>  > > >
> > > > wrote:
> > > >
> > > > > Fixes: Timeout
> > > > > Fixes:
> > > > > 9330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_
> > > VP9_fuzzer-5707345857347584
> > > > >
> > > > > Found-by: continuous fuzzing process
> > > > > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > > > > Signed-off-by
> > > > >  > > ffmpegSigned-off-by>:
> > > > > Michael Niedermayer 
> > > > > ---
> > > > >  libavcodec/vp9.c | 3 +++
> > > > >  1 file changed, 3 insertions(+)
> > > > >
> > > > > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > > > > index b1178c9c0c..4ca51ec108 100644
> > > > > --- a/libavcodec/vp9.c
> > > > > +++ b/libavcodec/vp9.c
> > > > > @@ -1302,6 +1302,9 @@ static int decode_tiles(AVCodecContext
> *avctx,
> > > > >  memset(lflvl_ptr->mask, 0,
> > > > > sizeof(lflvl_ptr->mask));
> > > > >  }
> > > > >
> > > > > +if (td->c->end <= td->c->buffer &&
> td->c->bits >=
> > > 0) {
> > > > > +return AVERROR_INVALIDDATA;
> > > > > +}
> > > > >  if (s->pass == 2) {
> > > > >  decode_sb_mem(td, row, col, lflvl_ptr,
> > > > >yoff2, uvoff2, BL_64X64);
> > > > >
> > > >
> > > > I don't think this matches spec. Implementations could use this to
> store
> > > > auxiliary data.
> > >
> > > This checks, or rather is intended to check for a premature end of the
> > > input.
> > > Am i missing something? because a premature end of input seems not to
> lead
> > > to more (auxiliary or other) data in the input.
> >
> >
> > Hm, I misread it, sorry about that, my bad. Please ignore my first
> review.
> >
>
> > Is end == buffer && bits == 0 something that can happen on valid input if
> > things just align properly? Otherwise looks OK.
>
> The same condition is used in vp5/6/8.
> I think this condition only occurs if the input ends. The part i do not
> know
> is if such premature ends might be a "valid compression"
>
> Either way, if this check misbehaves for a valid file then it should be
> reverted/removed unless its improv-able and improved.


 Yes, that's how production grade software works.  Can
you just make it not error out on the end == buffer && bits == 0 condition?
Or does that somehow not fix your timeout?

(Vp5/6 aren't used anywhere so nobody cares. Ffvp9 is used by e.g. Firefox
for Youtube playback so if it breaks 0.01% of files, we're going to
seriously screw a massive number of users.)

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


Re: [FFmpeg-devel] [PATCH] lavfi/vf_libvmaf: update to use libvmaf v1.3.9

2018-08-07 Thread James Almer
On 8/7/2018 7:37 PM, Kyle Swanson wrote:
> From: Kyle Swanson 
> 
> Signed-off-by: Kyle Swanson 
> ---
>  configure| 2 +-
>  libavfilter/vf_libvmaf.c | 9 -
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/configure b/configure
> index 15a58935de..e718c1531c 100755
> --- a/configure
> +++ b/configure
> @@ -6089,7 +6089,7 @@ enabled libtwolame&& require libtwolame 
> twolame.h twolame_init -ltwolame
> die "ERROR: libtwolame must be installed and 
> version must be >= 0.3.10"; }
>  enabled libv4l2   && require_pkg_config libv4l2 libv4l2 libv4l2.h 
> v4l2_ioctl
>  enabled libvidstab&& require_pkg_config libvidstab "vidstab >= 0.98" 
> vid.stab/libvidstab.h vsMotionDetectInit
> -enabled libvmaf   && require_pkg_config libvmaf "libvmaf >= 0.6.2" 
> libvmaf.h compute_vmaf
> +enabled libvmaf   && require_pkg_config libvmaf "libvmaf >= 1.3.9" 
> libvmaf.h compute_vmaf
>  enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h 
> E_IF_init -lvo-amrwbenc
>  enabled libvorbis && require_pkg_config libvorbis vorbis 
> vorbis/codec.h vorbis_info_init &&
>   require_pkg_config libvorbisenc vorbisenc 
> vorbis/vorbisenc.h vorbis_encode_init
> diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
> index 5d47a74375..249e50c720 100644
> --- a/libavfilter/vf_libvmaf.c
> +++ b/libavfilter/vf_libvmaf.c
> @@ -62,6 +62,9 @@ typedef struct LIBVMAFContext {
>  int ssim;
>  int ms_ssim;
>  char *pool;
> +int n_threads;
> +int n_subsample;
> +int enable_conf_interval;
>  int error;
>  } LIBVMAFContext;
>  
> @@ -78,6 +81,9 @@ static const AVOption libvmaf_options[] = {
>  {"ssim",  "Enables computing ssim along with vmaf.", 
>OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
>  {"ms_ssim",  "Enables computing ms-ssim along with vmaf.",   
>OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
>  {"pool",  "Set the pool method to be used for computing vmaf.",  
>OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS},
> +{"n_threads", "Set number of threads to be used when computing vmaf.",   
>OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0, UINT_MAX, FLAGS},
> +{"n_subsample", "Set interval for frame subsampling used when computing 
> vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1, UINT_MAX, 
> FLAGS},
> +{"enable_conf_interval",  "Enables confidence interval.",
>OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, 
> FLAGS},
>  { NULL }
>  };
>  
> @@ -166,7 +172,8 @@ static void compute_vmaf_score(LIBVMAFContext *s)
>  read_frame, s, s->model_path, s->log_path,
>  s->log_fmt, 0, 0, s->enable_transform,
>  s->phone_model, s->psnr, s->ssim,
> -s->ms_ssim, s->pool);
> +s->ms_ssim, s->pool,
> +s->n_threads, s->n_subsample, 
> s->enable_conf_interval);

It would be ideal if this library could stop breaking the API so often.
If the current API is not extensible, maybe you should consider
introducing a new one that is.

>  }
>  
>  static void *call_vmaf(void *ctx)
> 

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


Re: [FFmpeg-devel] [PATCH] lavfi/vf_libvmaf: update to use libvmaf v1.3.9

2018-08-07 Thread Kyle Swanson
Hi,

On Tue, Aug 7, 2018 at 8:02 PM, James Almer  wrote:

> On 8/7/2018 7:37 PM, Kyle Swanson wrote:
> > From: Kyle Swanson 
> >
> > Signed-off-by: Kyle Swanson 
> > ---
> >  configure| 2 +-
> >  libavfilter/vf_libvmaf.c | 9 -
> >  2 files changed, 9 insertions(+), 2 deletions(-)
> >
> > diff --git a/configure b/configure
> > index 15a58935de..e718c1531c 100755
> > --- a/configure
> > +++ b/configure
> > @@ -6089,7 +6089,7 @@ enabled libtwolame&& require libtwolame
> twolame.h twolame_init -ltwolame
> > die "ERROR: libtwolame must be installed
> and version must be >= 0.3.10"; }
> >  enabled libv4l2   && require_pkg_config libv4l2 libv4l2
> libv4l2.h v4l2_ioctl
> >  enabled libvidstab&& require_pkg_config libvidstab "vidstab >=
> 0.98" vid.stab/libvidstab.h vsMotionDetectInit
> > -enabled libvmaf   && require_pkg_config libvmaf "libvmaf >=
> 0.6.2" libvmaf.h compute_vmaf
> > +enabled libvmaf   && require_pkg_config libvmaf "libvmaf >=
> 1.3.9" libvmaf.h compute_vmaf
> >  enabled libvo_amrwbenc&& require libvo_amrwbenc
> vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
> >  enabled libvorbis && require_pkg_config libvorbis vorbis
> vorbis/codec.h vorbis_info_init &&
> >   require_pkg_config libvorbisenc vorbisenc
> vorbis/vorbisenc.h vorbis_encode_init
> > diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
> > index 5d47a74375..249e50c720 100644
> > --- a/libavfilter/vf_libvmaf.c
> > +++ b/libavfilter/vf_libvmaf.c
> > @@ -62,6 +62,9 @@ typedef struct LIBVMAFContext {
> >  int ssim;
> >  int ms_ssim;
> >  char *pool;
> > +int n_threads;
> > +int n_subsample;
> > +int enable_conf_interval;
> >  int error;
> >  } LIBVMAFContext;
> >
> > @@ -78,6 +81,9 @@ static const AVOption libvmaf_options[] = {
> >  {"ssim",  "Enables computing ssim along with vmaf.",
> OFFSET(ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
> >  {"ms_ssim",  "Enables computing ms-ssim along with vmaf.",
> OFFSET(ms_ssim), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
> >  {"pool",  "Set the pool method to be used for computing vmaf.",
>  OFFSET(pool), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1,
> FLAGS},
> > +{"n_threads", "Set number of threads to be used when computing
> vmaf.",  OFFSET(n_threads), AV_OPT_TYPE_INT, {.i64=0}, 0,
> UINT_MAX, FLAGS},
> > +{"n_subsample", "Set interval for frame subsampling used when
> computing vmaf.", OFFSET(n_subsample), AV_OPT_TYPE_INT, {.i64=1}, 1,
> UINT_MAX, FLAGS},
> > +{"enable_conf_interval",  "Enables confidence interval.",
>  OFFSET(enable_conf_interval), AV_OPT_TYPE_BOOL, {.i64=0},
> 0, 1, FLAGS},
> >  { NULL }
> >  };
> >
> > @@ -166,7 +172,8 @@ static void compute_vmaf_score(LIBVMAFContext *s)
> >  read_frame, s, s->model_path, s->log_path,
> >  s->log_fmt, 0, 0, s->enable_transform,
> >  s->phone_model, s->psnr, s->ssim,
> > -s->ms_ssim, s->pool);
> > +s->ms_ssim, s->pool,
> > +s->n_threads, s->n_subsample,
> s->enable_conf_interval);
>
> It would be ideal if this library could stop breaking the API so often.
> If the current API is not extensible, maybe you should consider
> introducing a new one that is.
>

Yes, I'm in agreement with you. The libvmaf API hasn't been stable and has
more or less been evolving over time. I've had a few discussions with Zhi
about a new API that is both more manageable to use and also extensible.
For now this is the interface, but I plan to invest some of my time in the
future to help with a new API. At that point there will be another breaking
change, but it should be more stable going forward. I can also manage the
updates to this filter during that time as well.


>
> >  }
> >
> >  static void *call_vmaf(void *ctx)
> >
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

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