Re: [FFmpeg-devel] Fw: [PATCH] Refactor two near-identical clauses.

2018-06-28 Thread Shlomi Fish
Hi Michael!

Thanks for your review.

On Thu, 28 Jun 2018 02:38:51 +0200
Michael Niedermayer  wrote:

> On Sun, Jun 17, 2018 at 03:40:19PM +0300, Shlomi Fish wrote:
> > On Sun, 17 Jun 2018 03:05:27 +0200
> > Michael Niedermayer  wrote:
> >   
> > > On Tue, Jun 12, 2018 at 12:53:20PM +0300, Shlomi Fish wrote:  
> > > > This message did not arrive to the list after three submissions.
> > > > 
> > > > Begin forwarded message:
> > > > 
> > > > Date: Tue, 12 Jun 2018 12:42:52 +0300
> > > > From: Shlomi Fish 
> > > > To: ffmpeg-devel@ffmpeg.org
> > > > Cc: Shlomi Fish 
> > > > Subject: [PATCH] Refactor two near-identical clauses.
> > > > 
> > > > 
> > > > Placed under the Expat licence . All tests pass.
> > > > ---
> > > >  libavfilter/vf_weave.c | 33 ++---
> > > >  1 file changed, 14 insertions(+), 19 deletions(-)
> > > > 
> > > > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c
> > > > index 037f5d1cf2..be371201e1 100644
> > > > --- a/libavfilter/vf_weave.c
> > > > +++ b/libavfilter/vf_weave.c
> > > > @@ -23,6 +23,7 @@
> > > >  #include "libavutil/pixdesc.h"
> > > >  #include "avfilter.h"
> > > >  #include "internal.h"
> > > > +#include 
> > > >  
> > > >  typedef struct WeaveContext {
> > > >  const AVClass *class;
> > > > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> > > > *in) AVFilterLink *outlink = ctx->outputs[0];
> > > >  AVFrame *out;
> > > >  int i;
> > > > +bool weave;
> > > > +int field1, field2;
> > > >  
> > > >  if (!s->prev) {
> > > >  s->prev = in;
> > > > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink,
> > > > AVFrame *in) }
> > > >  av_frame_copy_props(out, in);
> > > >  
> > > > +weave = (s->double_weave && !(inlink->frame_count_out & 1));
> > > > +field1 = s->first_field * weave;
> > > > +field2 = s->first_field * !weave;
> > > >  for (i = 0; i < s->nb_planes; i++) {
> > > > -if (s->double_weave && !(inlink->frame_count_out & 1)) {
> > > > -av_image_copy_plane(out->data[i] + out->linesize[i] *
> > > > s->first_field,
> > > 
> > > this seems to be corrupted by line breaks
> > >   
> > 
> > Well, the git send-email email was silently dropped three times... See:
> > 
> > http://www.shlomifish.org/Files/files/code/0001-Refactor-two-near-identical-clauses.patch
> > 
> > also attached here. Email has sadly become unreliable.
> >   
> > > [...]
> > >   
> > 
> >   
> 
> >  vf_weave.c |   33 ++---
> >  1 file changed, 14 insertions(+), 19 deletions(-)
> > f5a0afe735e322c2539a11dd7d8b28534d96c99c
> > 0001-Refactor-two-near-identical-clauses.patch From
> > b6678799848297cd7079085035259baf6d8c54f0 Mon Sep 17 00:00:00 2001 From:
> > Shlomi Fish  Date: Fri, 25 May 2018 23:44:54 +0300
> > Subject: [PATCH] Refactor two near-identical clauses.
> > 
> > Placed under the Expat licence . All tests pass.
> > ---
> >  libavfilter/vf_weave.c | 33 ++---
> >  1 file changed, 14 insertions(+), 19 deletions(-)
> > 
> > diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c
> > index 037f5d1cf2..be371201e1 100644
> > --- a/libavfilter/vf_weave.c
> > +++ b/libavfilter/vf_weave.c
> > @@ -23,6 +23,7 @@
> >  #include "libavutil/pixdesc.h"
> >  #include "avfilter.h"
> >  #include "internal.h"
> > +#include 
> >  
> >  typedef struct WeaveContext {
> >  const AVClass *class;
> > @@ -84,6 +85,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> >  AVFilterLink *outlink = ctx->outputs[0];
> >  AVFrame *out;
> >  int i;
> > +bool weave;
> > +int field1, field2;
> >  
> >  if (!s->prev) {
> >  s->prev = in;
> > @@ -98,26 +101,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> > *in) }
> >  av_frame_copy_props(out, in);
> >  
> > +weave = (s->double_weave && !(inlink->frame_count_out & 1));
> > +field1 = s->first_field * weave;
> > +field2 = s->first_field * !weave;  
> 
> if first_field is 0 both field1 and 2 are 0 while !s->first_field was not 0
> but gets replaced by it
> am i missing something ?
> 

so first_field is a boolean? I guess I can amend the code to the effect.

> stdbool seems unneeded
> 

I prefer to use it, but I guess I can avoid it.

> and what is "Placed under the Expat licence" supposed to mean ?
> the file is under LGPL
> 

It means I licence my changes under Expat, on top of the original terms of the
original code.

Regards,

Shlomi

> 
> [...]
> 
> 



-- 
-
Shlomi Fish   http://www.shlomifish.org/
https://youtu.be/n6KAGqjdmsk - “Hurt Me Tomorrow”

Tomorrow never dies, unless Chuck Norris volunteers to take it out of its
misery.
— http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .
___
ffmpeg-devel mailing 

Re: [FFmpeg-devel] [PATCH] libavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in Y4M. Also set pixel format and color_range for YUVJ pixel formats.

2018-06-28 Thread Wang Cao
>
> If this is a type we are choosing then it would be probably better
> to use something else than mpeg/jpeg as names
> these are 2 standard comittees and their standards support more than
> one color range.
> maybe "full" and "limited" or some other terms may be better

Thanks for pointing out this. I feel "MPEG" and "JPEG" is more consistent
with the defined variable names (.e.g AVCOL_RANGE_MPEG and
AVCOL_RANGE_JPEG). If you think "FULL" and "LIMITED" look better to you, it
also looks good to me not to use "MPEG" and "JPEG" names.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in Y4M.

2018-06-28 Thread Wang Cao
Set pixel format and color_range for YUVJ pixel formats. Also set
color_range based on AVFormatContext.

Signed-off-by: Wang Cao 
---
 libavformat/yuv4mpegdec.c |  8 
 libavformat/yuv4mpegenc.c | 37 +++--
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/libavformat/yuv4mpegdec.c b/libavformat/yuv4mpegdec.c
index eff7fc518e..855fadbb31 100644
--- a/libavformat/yuv4mpegdec.c
+++ b/libavformat/yuv4mpegdec.c
@@ -41,6 +41,7 @@ static int yuv4_read_header(AVFormatContext *s)
 enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = 
AV_PIX_FMT_NONE;
 enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED;
 enum AVFieldOrder field_order = AV_FIELD_UNKNOWN;
+enum AVColorRange color_range = AVCOL_RANGE_UNSPECIFIED;
 AVStream *st;
 
 for (i = 0; i < MAX_YUV4_HEADER; i++) {
@@ -220,6 +221,12 @@ static int yuv4_read_header(AVFormatContext *s)
 alt_pix_fmt = AV_PIX_FMT_YUV422P;
 else if (strncmp("444", tokstart, 3) == 0)
 alt_pix_fmt = AV_PIX_FMT_YUV444P;
+} else if (strncmp("COLORRANGE=", tokstart, 11) == 0) {
+  tokstart += 11;
+  if (strncmp("FULL",tokstart, 4) == 0)
+  color_range = AVCOL_RANGE_JPEG;
+  else if (strncmp("LIMITED", tokstart, 7) == 0)
+  color_range = AVCOL_RANGE_MPEG;
 }
 while (tokstart < header_end && *tokstart != 0x20)
 tokstart++;
@@ -263,6 +270,7 @@ static int yuv4_read_header(AVFormatContext *s)
 st->codecpar->codec_id= AV_CODEC_ID_RAWVIDEO;
 st->sample_aspect_ratio   = (AVRational){ aspectn, aspectd };
 st->codecpar->chroma_location = chroma_sample_location;
+st->codecpar->color_range = color_range;
 st->codecpar->field_order = field_order;
 s->packet_size = av_image_get_buffer_size(st->codecpar->format, width, 
height, 1) + Y4M_FRAME_MAGIC_LEN;
 if ((int) s->packet_size < 0)
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c
index 44f40bbad9..e84dbf9568 100644
--- a/libavformat/yuv4mpegenc.c
+++ b/libavformat/yuv4mpegenc.c
@@ -33,6 +33,7 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
 int raten, rated, aspectn, aspectd, n;
 char inter;
 const char *colorspace = "";
+const char *colorrange = "";
 int field_order;
 
 st = s->streams[0];
@@ -57,6 +58,17 @@ static int yuv4_generate_header(AVFormatContext *s, char* 
buf)
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
+switch(st->codecpar->color_range) {
+case AVCOL_RANGE_MPEG:
+colorrange = " XCOLORRANGE=LIMITED";
+break;
+case AVCOL_RANGE_JPEG:
+colorrange = " XCOLORRANGE=FULL";
+break;
+default:
+break;
+}
+
 switch (field_order) {
 case AV_FIELD_TB:
 case AV_FIELD_TT: inter = 't'; break;
@@ -84,6 +96,18 @@ static int yuv4_generate_header(AVFormatContext *s, char* 
buf)
 case AV_PIX_FMT_YUV411P:
 colorspace = " C411 XYSCSS=411";
 break;
+case AV_PIX_FMT_YUVJ420P:
+colorspace = " C420jpeg XYSCSS=420JPEG";
+colorrange = " XCOLORRANGE=FULL";
+break;
+case AV_PIX_FMT_YUVJ422P:
+colorspace = " C422 XYSCSS=422";
+colorrange = " XCOLORRANGE=FULL";
+break;
+case AV_PIX_FMT_YUVJ444P:
+colorspace = " C444 XYSCSS=444";
+colorrange = " XCOLORRANGE=FULL";
+break;
 case AV_PIX_FMT_YUV420P:
 switch (st->codecpar->chroma_location) {
 case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; 
break;
@@ -145,13 +169,14 @@ static int yuv4_generate_header(AVFormatContext *s, char* 
buf)
 }
 
 /* construct stream header, if this is the first frame */
-n = snprintf(buf, Y4M_LINE_MAX, "%s W%d H%d F%d:%d I%c A%d:%d%s\n",
+n = snprintf(buf, Y4M_LINE_MAX, "%s W%d H%d F%d:%d I%c A%d:%d%s%s\n",
  Y4M_MAGIC, width, height, raten, rated, inter,
- aspectn, aspectd, colorspace);
+ aspectn, aspectd, colorspace, colorrange);
 
 return n;
 }
 
+
 static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
 {
 AVStream *st = s->streams[pkt->stream_index];
@@ -192,6 +217,10 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket 
*pkt)
 case AV_PIX_FMT_YUV420P:
 case AV_PIX_FMT_YUV422P:
 case AV_PIX_FMT_YUV444P:
+// TODO: remove YUVJ pixel formats when they are completely removed from 
the codebase.
+case AV_PIX_FMT_YUVJ420P:
+case AV_PIX_FMT_YUVJ422P:
+case AV_PIX_FMT_YUVJ444P:
 break;
 case AV_PIX_FMT_GRAY9:
 case AV_PIX_FMT_GRAY10:
@@ -271,6 +300,10 @@ static int yuv4_write_header(AVFormatContext *s)
 case AV_PIX_FMT_YUV420P:
 case AV_PIX_FMT_YUV422P:
 case AV_PIX_FMT_YUV444P:
+// TODO: remove YUVJ pixel formats when they are completely 

[FFmpeg-devel] (no subject)

2018-06-28 Thread Wang Cao
I created a newer version to change "MPEG" to "LIMITED" and "JPEG" to
"FULL".


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


Re: [FFmpeg-devel] [PATCH] ffmpeg.c: allow ffmpeg to output stats for each video stream

2018-06-28 Thread Wang Cao
Friendly ping. Thanks!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: add option to hide vsync warnings

2018-06-28 Thread Gyan Doshi

Alt patch attached. Plan to push tonight.
From 07987404a8b7346e1904501b88320c9bab353298 Mon Sep 17 00:00:00 2001
From: Gyan Doshi 
Date: Thu, 28 Jun 2018 14:05:31 +0530
Subject: [PATCH] ffmpeg: make loglevel verbose for frame duration warning

---
 fftools/ffmpeg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 8d311a9ac8..5d9dbffc3b 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1121,7 +1121,7 @@ static void do_video_out(OutputFile *of,
 format_video_sync != VSYNC_PASSTHROUGH &&
 format_video_sync != VSYNC_DROP) {
 if (delta0 < -0.6) {
-av_log(NULL, AV_LOG_WARNING, "Past duration %f too large\n", 
-delta0);
+av_log(NULL, AV_LOG_VERBOSE, "Past duration %f too large\n", 
-delta0);
 } else
 av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion 
by %f\n", -delta0);
 sync_ipts = ost->sync_opts;
-- 
2.12.2.windows.2___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] Refactor two near-identical clauses - take 2

2018-06-28 Thread Shlomi Fish
Hi all!

Attached is the 2nd take of the patch for vf_weave.c. Please review.

-- 
-
Shlomi Fish   http://www.shlomifish.org/
Freecell Solver - http://fc-solve.shlomifish.org/

Chuck Norris once counted all the real numbers on his fingers. (by: ZadYree)
— http://www.shlomifish.org/humour/bits/facts/Chuck-Norris/

Please reply to list if it's a mailing list post - http://shlom.in/reply .
>From c94e6cc8272e2bdb1d23014814dde02eafd739a6 Mon Sep 17 00:00:00 2001
From: Shlomi Fish 
Date: Thu, 28 Jun 2018 11:42:45 +0300
Subject: [PATCH] Refactor two near-identical clauses.

The changes contained in this patch are hereby placed under the Expat licence.
Share and enjoy!

All tests pass.

This is a revised version of the first patch, after incorporating some input.
---
 libavfilter/vf_weave.c | 32 +---
 1 file changed, 13 insertions(+), 19 deletions(-)

diff --git a/libavfilter/vf_weave.c b/libavfilter/vf_weave.c
index 037f5d1cf2..663d79f511 100644
--- a/libavfilter/vf_weave.c
+++ b/libavfilter/vf_weave.c
@@ -84,6 +84,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 AVFilterLink *outlink = ctx->outputs[0];
 AVFrame *out;
 int i;
+int weave;
+int field1, field2;
 
 if (!s->prev) {
 s->prev = in;
@@ -98,26 +100,18 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 }
 av_frame_copy_props(out, in);
 
+weave = (s->double_weave && !(inlink->frame_count_out & 1));
+field1 = weave ? s->first_field : (!s->first_field);
+field2 = weave ? (!s->first_field) : s->first_field;
 for (i = 0; i < s->nb_planes; i++) {
-if (s->double_weave && !(inlink->frame_count_out & 1)) {
-av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field,
-out->linesize[i] * 2,
-in->data[i], in->linesize[i],
-s->linesize[i], s->planeheight[i]);
-av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field,
-out->linesize[i] * 2,
-s->prev->data[i], s->prev->linesize[i],
-s->linesize[i], s->planeheight[i]);
-} else {
-av_image_copy_plane(out->data[i] + out->linesize[i] * !s->first_field,
-out->linesize[i] * 2,
-in->data[i], in->linesize[i],
-s->linesize[i], s->planeheight[i]);
-av_image_copy_plane(out->data[i] + out->linesize[i] * s->first_field,
-out->linesize[i] * 2,
-s->prev->data[i], s->prev->linesize[i],
-s->linesize[i], s->planeheight[i]);
-}
+av_image_copy_plane(out->data[i] + out->linesize[i] * field1,
+out->linesize[i] * 2,
+in->data[i], in->linesize[i],
+s->linesize[i], s->planeheight[i]);
+av_image_copy_plane(out->data[i] + out->linesize[i] * field2,
+out->linesize[i] * 2,
+s->prev->data[i], s->prev->linesize[i],
+s->linesize[i], s->planeheight[i]);
 }
 
 out->pts = s->double_weave ? s->prev->pts : in->pts / 2;
-- 
2.18.0

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


Re: [FFmpeg-devel] [PATCH 2/2] ffmpeg: fix -stream_loop with multiple inputs

2018-06-28 Thread Moritz Barsnick
On Wed, Jun 27, 2018 at 23:05:23 +0200, Marton Balint wrote:
> The input thread need to be properly cleaned up and re-initalized before we 
> can
^ "threads need" or "thread needs"

> start reading again in threaded mode. (threaded input reading is used when
 ^ Threaded
> there are mode than one input file).
^ is more

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


Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: add option to hide vsync warnings

2018-06-28 Thread Gyan Doshi



On 28-06-2018 02:13 PM, Gyan Doshi wrote:

Alt patch attached. Plan to push tonight.


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


Re: [FFmpeg-devel] [PATCH] lavfi/colorspace: Add namespace prefix to global functions

2018-06-28 Thread Mark Thompson
On 26/06/18 01:50, Song, Ruiling wrote:
>> -Original Message-
>> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf Of
>> Mark Thompson
>> Sent: Tuesday, June 26, 2018 5:02 AM
>> To: ffmpeg-devel@ffmpeg.org
>> Subject: [FFmpeg-devel] [PATCH] lavfi/colorspace: Add namespace prefix to
>> global functions
>>
>> ---
>> On 25/06/18 02:34, Song, Ruiling wrote:
 -Original Message-
 From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
>> Of
 Mark Thompson
 Sent: Monday, June 25, 2018 2:26 AM
 To: ffmpeg-devel@ffmpeg.org
 Subject: [FFmpeg-devel] [PATCH 1/5] lavfi/colorspace: Add namespace prefix
>> to
 global functions

 ---
  libavfilter/colorspace.c| 13 +++--
  libavfilter/colorspace.h| 10 ++
  libavfilter/vf_colorspace.c | 22 +++---
  libavfilter/vf_tonemap_opencl.c |  8 
  4 files changed, 28 insertions(+), 25 deletions(-)

 ...
 --- a/libavfilter/colorspace.h
 +++ b/libavfilter/colorspace.h
 @@ -34,8 +34,10 @@ struct WhitepointCoefficients {
  double xw, yw;
  };

 -void invert_matrix3x3(const double in[3][3], double out[3][3]);
 -void mul3x3(double dst[3][3], const double src1[3][3], const double
>> src2[3][3]);
 -void fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
 -const struct WhitepointCoefficients *wp, double 
 rgb2xyz[3][3]);
 +void ff_invert_matrix3x3(const double in[3][3], double out[3][3]);
 +void ff_mul3x3(double dst[3][3],
 +   const double src1[3][3], const double src2[3][3]);
 +void ff_fill_rgb2xyz_table(const struct PrimaryCoefficients *coeffs,
 +   const struct WhitepointCoefficients *wp,
 +   double rgb2xyz[3][3]);
>>> I am basically ok with the patch. But I am not sure whether below function
>> names would be more applicable as now they are under 'ff_' prefix.
>>> ff_matrix_inverse_3x3()
>>> ff_matrix_mul_3x3()
>>
>> Yeah, those names would probably be better.
>>
>> How about this?
> This version LGTM!

Applied.

Thanks,

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


Re: [FFmpeg-devel] [PATCH v2 2/4] hwcontext_opencl: dump the device name when can't match device type.

2018-06-28 Thread Mark Thompson
On 21/06/18 12:45, Jun Zhao wrote:
> afther the change, we can get more detail debug message like:
> "Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz" does not match device type "gpu".
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavutil/hwcontext_opencl.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
> index f6cceef..9e96e96 100644
> --- a/libavutil/hwcontext_opencl.c
> +++ b/libavutil/hwcontext_opencl.c
> @@ -430,7 +430,8 @@ static int opencl_filter_device(AVHWDeviceContext *hwdev,
>  }
>  
>  if (!(device_type & match_type)) {
> -av_log(hwdev, AV_LOG_DEBUG, "device_type does not match.\n");
> +av_log(hwdev, AV_LOG_DEBUG, "\"%s\" does not match device type 
> \"%s\".\n",
> +   device_name, param->value);
>  return 1;
>  }
>  }
> 

Unless you want to change the other messages, this should probably match them 
(so it shows what type the device is and what type you're matching to - the 
name isn't really what you want there).

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


Re: [FFmpeg-devel] [PATCH v2 3/4] hwcontext_opencl: Remove the opencl_device_init in opencl_device_derive

2018-06-28 Thread Mark Thompson
On 21/06/18 12:45, Jun Zhao wrote:
> In opencl device derived case, don't need to call opencl_device_init.
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavutil/hwcontext_opencl.c | 7 ++-
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
> index 9e96e96..295d6be 100644
> --- a/libavutil/hwcontext_opencl.c
> +++ b/libavutil/hwcontext_opencl.c
> @@ -1196,7 +1196,7 @@ static int opencl_device_derive(AVHWDeviceContext 
> *hwdev,
>  AVHWDeviceContext *src_ctx,
>  int flags)
>  {
> -int err;
> +int err = 0;

This looks wrong - initialising it here may hide useful warnings.  If there is 
a specific case where it isn't set then set it there.

>  switch (src_ctx->type) {
>  
>  #if HAVE_OPENCL_DRM_BEIGNET
> @@ -1362,10 +1362,7 @@ static int opencl_device_derive(AVHWDeviceContext 
> *hwdev,
>  break;
>  }
>  
> -if (err < 0)
> -return err;
> -
> -return opencl_device_init(hwdev);
> +return err;

This part looks good.  (Not sure how I missed this case, the hwdevice test does 
show it when run at higher debug level.)

>  }
>  
>  static int opencl_get_plane_format(enum AVPixelFormat pixfmt,
> 

Thanks,

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


Re: [FFmpeg-devel] [PATCH v2 1/4] configure: fix check for opencl_vaapi_intel_media.

2018-06-28 Thread Mark Thompson
On 21/06/18 12:45, Jun Zhao wrote:
> opencl_vaapi_intel_media doesn't depend on libmfx, OpenCL™ Drivers
> and Runtimes for Intel® Architectureis is a standalone release, more
> information can be found in the link:
> https://software.intel.com/en-us/articles/opencl-drivers.
> 
> Signed-off-by: Jun Zhao 
> ---
>  configure| 6 ++
>  libavutil/hwcontext_opencl.c | 7 ++-
>  2 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index 6ad5ce8..717b2f1 100755
> --- a/configure
> +++ b/configure
> @@ -6336,10 +6336,8 @@ fi
>  
>  if enabled_all opencl vaapi ; then
>  enabled opencl_drm_beignet && enable opencl_vaapi_beignet
> -if enabled libmfx ; then
> -check_type "CL/cl.h CL/va_ext.h" 
> "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
> -enable opencl_vaapi_intel_media
> -fi
> +check_type "CL/cl.h CL/va_ext.h" 
> "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
> +enable opencl_vaapi_intel_media
>  fi
>  
>  if enabled_all opencl dxva2 ; then
> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
> index 07458c2..f6cceef 100644
> --- a/libavutil/hwcontext_opencl.c
> +++ b/libavutil/hwcontext_opencl.c
> @@ -46,7 +46,9 @@
>  #endif
>  
>  #if HAVE_OPENCL_VAAPI_INTEL_MEDIA
> +#if CONFIG_LIBMFX
>  #include 
> +#endif
>  #include 
>  #include 
>  #include "hwcontext_vaapi.h"
> @@ -2249,10 +2251,13 @@ static int opencl_map_from_qsv(AVHWFramesContext 
> *dst_fc, AVFrame *dst,
>  cl_int cle;
>  int err, p;
>  
> +#if CONFIG_LIBMFX
>  if (src->format == AV_PIX_FMT_QSV) {
>  mfxFrameSurface1 *mfx_surface = (mfxFrameSurface1*)src->data[3];
>  va_surface = *(VASurfaceID*)mfx_surface->Data.MemId;
> -} else if (src->format == AV_PIX_FMT_VAAPI) {
> +} else
> +#endif
> +if (src->format == AV_PIX_FMT_VAAPI) {
>  va_surface = (VASurfaceID)(uintptr_t)src->data[3];
>  } else {
>  return AVERROR(ENOSYS);
> 

Looks ok to me.

Thanks,

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


Re: [FFmpeg-devel] [PATCH v2 4/4] hwcontext_opencl: remove an unused variable

2018-06-28 Thread Mark Thompson
On 21/06/18 12:45, Jun Zhao wrote:
> remove an unused variable
> 
> Signed-off-by: Jun Zhao 
> ---
>  libavutil/hwcontext_opencl.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_opencl.c b/libavutil/hwcontext_opencl.c
> index 295d6be..4718a86 100644
> --- a/libavutil/hwcontext_opencl.c
> +++ b/libavutil/hwcontext_opencl.c
> @@ -929,7 +929,6 @@ static int 
> opencl_enumerate_intel_media_vaapi_devices(AVHWDeviceContext *hwdev,
>  clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn
>  clGetDeviceIDsFromVA_APIMediaAdapterINTEL;
>  cl_int cle;
> -int err;
>  
>  clGetDeviceIDsFromVA_APIMediaAdapterINTEL =
>  clGetExtensionFunctionAddressForPlatform(platform_id,
> 

LGTM.

Thanks,

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


Re: [FFmpeg-devel] [PATCH] lavfi: add sobel, prewitt, roberts filters

2018-06-28 Thread Mark Thompson
On 25/06/18 01:23, Danil Iashchenko wrote:
> Add opencl version of sobel, prewitt, roberts filters.
> ---
>  configure   |   3 +
>  libavfilter/Makefile|   8 +-
>  libavfilter/allfilters.c|   3 +
>  libavfilter/opencl/convolution.cl   |  82 ++
>  libavfilter/vf_convolution_opencl.c | 306 
> ++--
>  5 files changed, 353 insertions(+), 49 deletions(-)
> 
> ...
> diff --git a/libavfilter/opencl/convolution.cl 
> b/libavfilter/opencl/convolution.cl
> index 03ef4ef..a2ddeba 100644
> --- a/libavfilter/opencl/convolution.cl
> +++ b/libavfilter/opencl/convolution.cl
> @@ -43,3 +43,85 @@ __kernel void convolution_global(__write_only image2d_t 
> dst,
>   float4 dstPix = convPix * div + bias;
>   write_imagef(dst, loc, dstPix);
>  }
> +
> +
> +__kernel void sobel_global(__write_only image2d_t dst,
> +   __read_only  image2d_t src,
> + float div,
> + float bias)
> +{
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
> +   CLK_ADDRESS_CLAMP_TO_EDGE   |
> +   CLK_FILTER_NEAREST);
> +
> +int2 loc = (int2)(get_global_id(0), get_global_id(1));
> +
> +float4 sum1 = read_imagef(src, sampler, loc + (int2)(-1,-1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 0,-1)) * -2 +
> +  read_imagef(src, sampler, loc + (int2)( 1,-1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)(-1, 1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)( 0, 1)) *  2 +
> +  read_imagef(src, sampler, loc + (int2)( 1, 1)) *  1;
> +
> +float4 sum2 = read_imagef(src, sampler, loc + (int2)(-1,-1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)(-1, 0)) * -2 +
> +  read_imagef(src, sampler, loc + (int2)(-1, 1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 1,-1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)( 1, 0)) *  2 +
> +  read_imagef(src, sampler, loc + (int2)( 1, 1)) *  1;
> +
> +float4 dstPix = (sqrt(sum1*sum1 + sum2*sum2)) * div + bias;

^ hypot(sum1, sum2) ?

> +write_imagef(dst, loc, dstPix);
> +}
> +
> +__kernel void prewitt_global(__write_only image2d_t dst,
> + __read_only  image2d_t src,
> + float div,
> + float bias)
> +{
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
> +   CLK_ADDRESS_CLAMP_TO_EDGE   |
> +   CLK_FILTER_NEAREST);
> +
> +int2 loc = (int2)(get_global_id(0), get_global_id(1));
> +
> +float4 sum1 = read_imagef(src, sampler, loc + (int2)(-1,-1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)( 0,-1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)( 1,-1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)(-1, 1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 0, 1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 1, 1)) * -1;
> +
> +float4 sum2 = read_imagef(src, sampler, loc + (int2)(-1,-1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)(-1, 0)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)(-1, 1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)( 1,-1)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 1, 0)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 1, 1)) * -1;
> +
> +float4 dstPix = (sqrt(sum1*sum1 + sum2*sum2)) * div + bias;

Also here, and below.

> +write_imagef(dst, loc, dstPix);
> +}
> +
> +__kernel void roberts_global(__write_only image2d_t dst,
> + __read_only  image2d_t src,
> + float div,
> + float bias)
> +{
> +const sampler_t sampler = (CLK_NORMALIZED_COORDS_FALSE |
> +   CLK_ADDRESS_CLAMP_TO_EDGE   |
> +   CLK_FILTER_NEAREST);
> +
> +int2 loc = (int2)(get_global_id(0), get_global_id(1));
> +
> +float4 sum1 = read_imagef(src, sampler, loc + (int2)(-1,-1)) *  1 +
> +  read_imagef(src, sampler, loc + (int2)( 0,-1)) * -1;
> +
> +
> +float4 sum2 = read_imagef(src, sampler, loc + (int2)(-1, 0)) * -1 +
> +  read_imagef(src, sampler, loc + (int2)( 0, 0)) *  1;
> +
> +
> +float4 dstPix = (sqrt(sum1*sum1 + sum2*sum2)) * div + bias;
> +write_imagef(dst, loc, dstPix);
> +}
> diff --git a/libavfilter/vf_convolution_opencl.c 
> b/libavfilter/vf_convolution_opencl.c
> index 4d0ecf8..8d12191 100644
> --- a/libavfilter/vf_convolution_opencl.c
> +++ b/libavfilter/vf_convolution_opencl.c
> @@ -36,7 +36,7

Re: [FFmpeg-devel] [PATCH 3/8] avcodec/dpx: Check elements in 12bps planar path

2018-06-28 Thread Michael Niedermayer
On Thu, Jun 28, 2018 at 12:56:29AM +0200, Carl Eugen Hoyos wrote:
> 2018-06-27 20:11 GMT+02:00, Michael Niedermayer :
> > Fixes: null pointer dereference
> > Fixes:
> > 8946/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DPX_fuzzer-5078915222601728
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/dpx.c | 10 ++
> >  1 file changed, 6 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> > index f75e2cbbca..cf23bb6ba1 100644
> > --- a/libavcodec/dpx.c
> > +++ b/libavcodec/dpx.c
> > @@ -395,12 +395,14 @@ static int decode_frame(AVCodecContext *avctx,
> >  if (elements == 4)
> >  *dst[3]++ = read16(&buf, endian) >> shift & 0xFFF;
> >  } else {
> > -*dst[2]++ = read12in32(&buf, &rgbBuffer,
> > -   &n_datum, endian);
> > +if (elements >= 3)
> > +*dst[2]++ = read12in32(&buf, &rgbBuffer,
> > +   &n_datum, endian);
> >  *dst[0]++ = read12in32(&buf, &rgbBuffer,
> > &n_datum, endian);
> > -*dst[1]++ = read12in32(&buf, &rgbBuffer,
> > -   &n_datum, endian);
> > +if (elements >= 2)
> > +*dst[1]++ = read12in32(&buf, &rgbBuffer,
> > +   &n_datum, endian);
> >  if (elements == 4)
> >  *dst[3]++ = read12in32(&buf, &rgbBuffer,
> > &n_datum, endian);
> 
> Looks good to me, please commit.

will apply

thx

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

There will always be a question for which you do not know the correct answer.


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


Re: [FFmpeg-devel] [PATCH 8/8] tools/target_dec_fuzzer: Also optionally fuzz with a parser

2018-06-28 Thread Michael Niedermayer
On Wed, Jun 27, 2018 at 08:11:21PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 42 ++-
>  1 file changed, 37 insertions(+), 5 deletions(-)

will apply

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

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


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


Re: [FFmpeg-devel] [PATCH 7/8] avcodec/mpeg4videodec: Check read profile before setting it

2018-06-28 Thread Michael Niedermayer
On Wed, Jun 27, 2018 at 08:11:20PM +0200, Michael Niedermayer wrote:
> Fixes: null pointer dereference
> Fixes: ffmpeg_crash_7.avi
> 
> Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan 
> Caciulescu with AFLSmart
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/mpeg4videodec.c | 23 +++
>  1 file changed, 15 insertions(+), 8 deletions(-)

will apply

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


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


Re: [FFmpeg-devel] [PATCH 5/8] avcodec/ac3_parser: Check init_get_bits8() for failure

2018-06-28 Thread Michael Niedermayer
On Wed, Jun 27, 2018 at 08:36:42PM +0200, Paul B Mahol wrote:
> On 6/27/18, Michael Niedermayer  wrote:
> > Fixes: null pointer dereference
> > Fixes: ffmpeg_crash_6.avi
> >
> > Found-by: Thuan Pham, Marcel Boehme, Andrew Santosa and Alexandru Razvan
> > Caciulescu with AFLSmart
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/ac3_parser.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> 
> ok

will apply

thanks

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

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin


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/8] avformat/movenc: Check that frame_types other than EAC3_FRAME_TYPE_INDEPENDENT have a supported substream id

2018-06-28 Thread Michael Niedermayer
On Wed, Jun 27, 2018 at 08:11:17PM +0200, Michael Niedermayer wrote:
> Fixes: out of array access
> Fixes: ffmpeg_bof_1.avi
> 
> Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan 
> Caciulescu with AFLSmart
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/movenc.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index e2c5613f98..00567db586 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -437,6 +437,12 @@ static int handle_eac3(MOVMuxContext *mov, AVPacket 
> *pkt, MOVTrack *track)
>  info->ec3_done = 1;
>  goto concatenate;
>  }
> +} else {
> +if (hdr->substreamid != 0) {
> +avpriv_request_sample(track->par, "Multiple dependent 
> substreams");

Changed the wording to be more precisse and also fixed the copy and paste bug
in the context

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


Re: [FFmpeg-devel] [PATCH] h264_slice: Fix return of incomplete frames from decoder

2018-06-28 Thread Michael Niedermayer
On Wed, Jun 27, 2018 at 03:12:24PM -0700, John Stebbins wrote:
> When not using libavformat for demuxing, AVCodecContext.has_b_frames
> gets set too late causing the recovery frame heuristic in h264_refs to
> incorrectly flag an early frame as recovered.
> 
> This patch sets has_b_frames earlier to prevent improperly flagging the
> frame as recovered.
> ---
>  libavcodec/h264_slice.c | 5 +
>  1 file changed, 5 insertions(+)

will apply

thanks

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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


[FFmpeg-devel] [PATCH] avformat/apngdec: set pts to AV_NOPTS_VALUE

2018-06-28 Thread Marton Balint
And let the generic code figure out the proper PTS. This is needed because apng
does not provide seek functions, but after a generic seek (e.g. to file start)
timestamps are not reset which causes broken timestamps when looping apngs,
like in ticket #6121.

Signed-off-by: Marton Balint 
---
 libavformat/apngdec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 03710a..f9a97e5681 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -44,7 +44,6 @@ typedef struct APNGDemuxContext {
 int max_fps;
 int default_fps;
 
-int64_t pkt_pts;
 int pkt_duration;
 
 int is_key_frame;
@@ -390,9 +389,8 @@ static int apng_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 
 if (ctx->is_key_frame)
 pkt->flags |= AV_PKT_FLAG_KEY;
-pkt->pts = ctx->pkt_pts;
+pkt->pts = pkt->dts = AV_NOPTS_VALUE;
 pkt->duration = ctx->pkt_duration;
-ctx->pkt_pts += ctx->pkt_duration;
 return ret;
 case MKTAG('I', 'E', 'N', 'D'):
 ctx->cur_loop++;
-- 
2.16.4

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


Re: [FFmpeg-devel] [PATCH] avformat/apngdec: set pts to AV_NOPTS_VALUE

2018-06-28 Thread Paul B Mahol
On 6/28/18, Marton Balint  wrote:
> And let the generic code figure out the proper PTS. This is needed because
> apng
> does not provide seek functions, but after a generic seek (e.g. to file
> start)
> timestamps are not reset which causes broken timestamps when looping apngs,
> like in ticket #6121.
>
> Signed-off-by: Marton Balint 
> ---
>  libavformat/apngdec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>

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


Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: check sseof value and clash with ss

2018-06-28 Thread Morten With
Hi, currently on the -toeof patch, and while working on it I noticed that
maybe

>av_log(NULL, AV_LOG_WARNING, "-sseof value seeks to before start of file
%s; ignored\n", filename);

should be an AV_LOG_ERROR and an exit_program(1) afterwards. The warning is
very high up and on a file with lots of info you will probably miss it and
wonder what's going on. Throwing an error will instantly clear it up.

Thoughts?

Regards,
Morten

2018-06-26 6:21 GMT+02:00 Gyan Doshi :

>
>
> On 25-06-2018 10:07 AM, Gyan Doshi wrote:
>
>
>> Revised. Will push soon.
>>
>> Thanks,
>> Gyan
>>
>
> Pushed in a0ac49e38ee1d1011c394d7be67d0f08b2281526
>
> ___
> 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] avcodec/vc1_block: Fix mqaunt check for negative values

2018-06-28 Thread Michael Niedermayer
Fixes: out of array access
Fixes: ffmpeg_bof_4.avi
Fixes: ffmpeg_bof_5.avi
Fixes: ffmpeg_bof_6.avi

Found-by: Thuan Pham, Marcel Böhme, Andrew Santosa and Alexandru Razvan 
Caciulescu with AFLSmart
Signed-off-by: Michael Niedermayer 
---
 libavcodec/vc1_block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
index 5427de4ec6..74d5e27803 100644
--- a/libavcodec/vc1_block.c
+++ b/libavcodec/vc1_block.c
@@ -204,7 +204,7 @@ static void vc1_put_blocks_clamped(VC1Context *v, int 
put_signed)
 if ((edges&8) &&   \
 s->mb_y == ((s->mb_height >> v->field_mode) - 1))  \
 mquant = -v->altpq;\
-if (!mquant || mquant > 31) {  \
+if (!mquant || mquant > 31 || mquant < -31) {  
\
 av_log(v->s.avctx, AV_LOG_ERROR,   \
"Overriding invalid mquant %d\n", mquant);  \
 mquant = 1;\
-- 
2.18.0

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


Re: [FFmpeg-devel] [PATCH 1/3] avcodec/vc1: fix condition guarding overlap filter on I picture

2018-06-28 Thread Carl Eugen Hoyos
2018-06-20 13:10 GMT+02:00, Jerome Borsboom :
> The overlap filter needs to run when PQUANT is 9 or higher, irrespective
> of CONDOVER.
>
> Signed-off-by: Jerome Borsboom 
> ---
> This patch set should fix decoding of the SA10125.vc1 test file to make it
> bit-equal to the reference decoder.

Patch set applied.

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


Re: [FFmpeg-devel] [PATCH] avcodec/vc1: fix check for missing CBPTAB

2018-06-28 Thread Carl Eugen Hoyos
2018-06-20 15:17 GMT+02:00, Jerome Borsboom :
> CBPTAB must be present in (non skipped) P and B pictures.
>
> Signed-off-by: Jerome Borsboom 
> ---
> This patch set should fix decoding of the SA10135.vc1 test file to make it
> bit-equal to the reference decoder.

Patch applied.

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


Re: [FFmpeg-devel] [PATCH] libavformat/yuv4mpeg: Add color range support for Y4M Add color_range support in Y4M. Also set pixel format and color_range for YUVJ pixel formats.

2018-06-28 Thread Michael Niedermayer
On Thu, Jun 28, 2018 at 04:28:24PM +0800, Wang Cao wrote:
> >
> > If this is a type we are choosing then it would be probably better
> > to use something else than mpeg/jpeg as names
> > these are 2 standard comittees and their standards support more than
> > one color range.
> > maybe "full" and "limited" or some other terms may be better
> 
> Thanks for pointing out this. I feel "MPEG" and "JPEG" is more consistent
> with the defined variable names (.e.g AVCOL_RANGE_MPEG and
> AVCOL_RANGE_JPEG). If you think "FULL" and "LIMITED" look better to you, it
> also looks good to me not to use "MPEG" and "JPEG" names.

We should not "extend" fileformats with (bad) internal name choices from
our source code


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"Nothing to hide" only works if the folks in power share the values of
you and everyone you know entirely and always will -- Tom Scott



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


Re: [FFmpeg-devel] [PATCH] fftools/ffmpeg: check sseof value and clash with ss

2018-06-28 Thread Gyan Doshi


On 29-06-2018 01:58 AM, Morten With wrote:


av_log(NULL, AV_LOG_WARNING, "-sseof value seeks to before start of file

%s; ignored\n", filename);

should be an AV_LOG_ERROR and an exit_program(1) afterwards. The warning is
very high up and on a file with lots of info you will probably miss it and
wonder what's going on. Throwing an error will instantly clear it up.


The user can't do anything about it. If one is seeking to *before* start 
of file, then at most one can start from start of file, which is what 
ffmpeg falls back on.


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