[FFmpeg-cvslog] avfilter/vf_maskedclamp: make C version consistent with ASM one

2020-02-08 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Feb  8 10:44:38 
2020 +0100| [68416e4ba7e26965fa567249bbec1057f68ca9cf] | committer: Paul B Mahol

avfilter/vf_maskedclamp: make C version consistent with ASM one

In case of undefined behaviour.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=68416e4ba7e26965fa567249bbec1057f68ca9cf
---

 libavfilter/vf_maskedclamp.c | 8 ++--
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/libavfilter/vf_maskedclamp.c b/libavfilter/vf_maskedclamp.c
index b0dc8a3550..52392c4c86 100644
--- a/libavfilter/vf_maskedclamp.c
+++ b/libavfilter/vf_maskedclamp.c
@@ -178,12 +178,8 @@ static void maskedclamp##name(const uint8_t *bbsrc, 
uint8_t *ddst,
 type *dst = (type *)ddst;  
   \

   \
 for (int x = 0; x < w; x++) {  
   \
-if (bsrc[x] < darksrc[x] - undershoot) 
   \
-dst[x] = darksrc[x] - undershoot;  
   \
-else if (bsrc[x] > brightsrc[x] + overshoot)   
   \
-dst[x] = brightsrc[x] + overshoot; 
   \
-else   
   \
-dst[x] = bsrc[x];  
   \
+dst[x] = FFMAX(bsrc[x], darksrc[x] - undershoot);  
   \
+dst[x] = FFMIN(dst[x], brightsrc[x] + overshoot);  
   \
 }  
   \
 }
 

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

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

[FFmpeg-cvslog] avfilter/vf_fade: improve type option description

2020-02-08 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Feb  8 12:40:23 
2020 +0100| [a8d82cc2b849aa867bd030a07aa7abf3e9cd0349] | committer: Paul B Mahol

avfilter/vf_fade: improve type option description

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a8d82cc2b849aa867bd030a07aa7abf3e9cd0349
---

 libavfilter/vf_fade.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index ae5cd42279..26a81ee8d0 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -411,8 +411,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption fade_options[] = {
-{ "type", "'in' or 'out' for fade-in/fade-out", OFFSET(type), 
AV_OPT_TYPE_INT, { .i64 = FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
-{ "t","'in' or 'out' for fade-in/fade-out", OFFSET(type), 
AV_OPT_TYPE_INT, { .i64 = FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
+{ "type", "set the fade direction", OFFSET(type), AV_OPT_TYPE_INT, { .i64 
= FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
+{ "t","set the fade direction", OFFSET(type), AV_OPT_TYPE_INT, { .i64 
= FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
 { "in",  "fade-in",  0, AV_OPT_TYPE_CONST, { .i64 = FADE_IN },  .flags 
= FLAGS, .unit = "type" },
 { "out", "fade-out", 0, AV_OPT_TYPE_CONST, { .i64 = FADE_OUT }, .flags 
= FLAGS, .unit = "type" },
 { "start_frame", "Number of the first frame to which to apply the effect.",

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

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

[FFmpeg-cvslog] avfilter/vf_fade: add missing .flags for type option

2020-02-08 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Feb  8 12:36:59 
2020 +0100| [8cab0ce5dc42e92fe2e9b3bedb7b62294876321d] | committer: Paul B Mahol

avfilter/vf_fade: add missing .flags for type option

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=8cab0ce5dc42e92fe2e9b3bedb7b62294876321d
---

 libavfilter/vf_fade.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index 6fa02e6bfa..ae5cd42279 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -413,8 +413,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*frame)
 static const AVOption fade_options[] = {
 { "type", "'in' or 'out' for fade-in/fade-out", OFFSET(type), 
AV_OPT_TYPE_INT, { .i64 = FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
 { "t","'in' or 'out' for fade-in/fade-out", OFFSET(type), 
AV_OPT_TYPE_INT, { .i64 = FADE_IN }, FADE_IN, FADE_OUT, FLAGS, "type" },
-{ "in",  "fade-in",  0, AV_OPT_TYPE_CONST, { .i64 = FADE_IN },  .unit 
= "type" },
-{ "out", "fade-out", 0, AV_OPT_TYPE_CONST, { .i64 = FADE_OUT }, .unit 
= "type" },
+{ "in",  "fade-in",  0, AV_OPT_TYPE_CONST, { .i64 = FADE_IN },  .flags 
= FLAGS, .unit = "type" },
+{ "out", "fade-out", 0, AV_OPT_TYPE_CONST, { .i64 = FADE_OUT }, .flags 
= FLAGS, .unit = "type" },
 { "start_frame", "Number of the first frame to which to apply the effect.",
 OFFSET(start_frame), 
AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
 { "s",   "Number of the first frame to which to apply the effect.",

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

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

[FFmpeg-cvslog] avfilter/vf_alphamerge: add timeline support

2020-02-08 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Feb  8 14:28:01 
2020 +0100| [cbd5a4536c0339fa3bdafa63e253d70bebb5e64a] | committer: Paul B Mahol

avfilter/vf_alphamerge: add timeline support

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cbd5a4536c0339fa3bdafa63e253d70bebb5e64a
---

 libavfilter/vf_alphamerge.c | 12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index eb5a4d6e78..72b93c780f 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -26,6 +26,7 @@
 #include 
 
 #include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
 #include "libavutil/pixfmt.h"
 #include "avfilter.h"
 #include "drawutils.h"
@@ -154,7 +155,8 @@ static int activate(AVFilterContext *ctx)
 }
 
 if (s->main_frame && s->alpha_frame) {
-draw_frame(ctx, s->main_frame, s->alpha_frame);
+if (!ctx->is_disabled)
+draw_frame(ctx, s->main_frame, s->alpha_frame);
 ret = ff_filter_frame(outlink, s->main_frame);
 av_frame_free(&s->alpha_frame);
 s->main_frame = NULL;
@@ -203,13 +205,21 @@ static const AVFilterPad alphamerge_outputs[] = {
 { NULL }
 };
 
+static const AVOption alphamerge_options[] = {
+{ NULL }
+};
+
+AVFILTER_DEFINE_CLASS(alphamerge);
+
 AVFilter ff_vf_alphamerge = {
 .name   = "alphamerge",
 .description= NULL_IF_CONFIG_SMALL("Copy the luma value of the second "
   "input into the alpha channel of the first input."),
 .priv_size  = sizeof(AlphaMergeContext),
+.priv_class = &alphamerge_class,
 .query_formats  = query_formats,
 .inputs = alphamerge_inputs,
 .outputs= alphamerge_outputs,
 .activate   = activate,
+.flags  = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL,
 };

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

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

[FFmpeg-cvslog] avcodec/mlpdec: use get_bits_long for huff lsbs

2020-02-08 Thread Jai Luthra
ffmpeg | branch: master | Jai Luthra  | Sat Feb  8 02:04:12 
2020 +0530| [4566cfed9c13ee509efb3cc9531ca8965e50c13d] | committer: Michael 
Niedermayer

avcodec/mlpdec: use get_bits_long for huff lsbs

lsb bits may go beyond 25 bits, so to be safe use get_bits_long

Signed-off-by: Jai Luthra 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4566cfed9c13ee509efb3cc9531ca8965e50c13d
---

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

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 22a6efd63d..1a2c0f29ac 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -266,7 +266,7 @@ static inline int read_huff_channels(MLPDecodeContext *m, 
GetBitContext *gbp,
 return AVERROR_INVALIDDATA;
 
 if (lsb_bits > 0)
-result = (result << lsb_bits) + get_bits(gbp, lsb_bits);
+result = (result << lsb_bits) + get_bits_long(gbp, lsb_bits);
 
 result  += cp->sign_huff_offset;
 result *= 1 << quant_step_size;

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

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

[FFmpeg-cvslog] avfilter/vf_paletteuse: Fix potential double-free of AVFrame

2020-02-08 Thread Andreas Rheinhardt
ffmpeg | branch: master | Andreas Rheinhardt  | 
Mon Jan 27 09:28:20 2020 +0100| [adea33f46513821c111c602a0692b78315688c1b] | 
committer: Michael Niedermayer

avfilter/vf_paletteuse: Fix potential double-free of AVFrame

apply_palette() would free an AVFrame given to it only via an AVFrame *
(and not via AVFrame **) in three of its four exists (namely in the
normal path and in two error paths). So upon error the caller has no way
to know whether the frame has already been freed or not;
load_apply_palette(), the only caller, opted to free the frame in this
scenario.

This commit changes this by making apply_palette not freeing the frame
at all, which is left to load_apply_palette().

Fixes Coverity issue #1452434.

Signed-off-by: Andreas Rheinhardt 
Reviewed-by: Paul B Mahol 
Signed-off-by: Michael Niedermayer 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=adea33f46513821c111c602a0692b78315688c1b
---

 libavfilter/vf_paletteuse.c | 14 --
 1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index ed128813d6..255c9d79e3 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -903,7 +903,6 @@ static int apply_palette(AVFilterLink *inlink, AVFrame *in, 
AVFrame **outf)
 
 AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
 if (!out) {
-av_frame_free(&in);
 *outf = NULL;
 return AVERROR(ENOMEM);
 }
@@ -916,7 +915,6 @@ static int apply_palette(AVFilterLink *inlink, AVFrame *in, 
AVFrame **outf)
 if (av_frame_ref(s->last_in, in) < 0 ||
 av_frame_ref(s->last_out, out) < 0 ||
 av_frame_make_writable(s->last_in) < 0) {
-av_frame_free(&in);
 av_frame_free(&out);
 *outf = NULL;
 return AVERROR(ENOMEM);
@@ -934,7 +932,6 @@ static int apply_palette(AVFilterLink *inlink, AVFrame *in, 
AVFrame **outf)
 memcpy(out->data[1], s->palette, AVPALETTE_SIZE);
 if (s->calc_mean_err)
 debug_mean_error(s, in, out, inlink->frame_count_out);
-av_frame_free(&in);
 *outf = out;
 return 0;
 }
@@ -1023,20 +1020,17 @@ static int load_apply_palette(FFFrameSync *fs)
 if (ret < 0)
 return ret;
 if (!master || !second) {
-ret = AVERROR_BUG;
-goto error;
+av_frame_free(&master);
+return AVERROR_BUG;
 }
 if (!s->palette_loaded) {
 load_palette(s, second);
 }
 ret = apply_palette(inlink, master, &out);
+av_frame_free(&master);
 if (ret < 0)
-goto error;
+return ret;
 return ff_filter_frame(ctx->outputs[0], out);
-
-error:
-av_frame_free(&master);
-return ret;
 }
 
 #define DEFINE_SET_FRAME(color_search, name, value)
 \

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

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

[FFmpeg-cvslog] avfilter/vf_alphamerge: add AVClass to private context

2020-02-08 Thread Paul B Mahol
ffmpeg | branch: master | Paul B Mahol  | Sat Feb  8 21:54:09 
2020 +0100| [3750e36aa8ecb53764e5549470a39cd14ff6b513] | committer: Paul B Mahol

avfilter/vf_alphamerge: add AVClass to private context

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3750e36aa8ecb53764e5549470a39cd14ff6b513
---

 libavfilter/vf_alphamerge.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 72b93c780f..85b6d9b61a 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -38,6 +38,8 @@
 enum { Y, U, V, A };
 
 typedef struct AlphaMergeContext {
+const AVClass *class;
+
 int is_packed_rgb;
 uint8_t rgba_map[4];
 AVFrame *main_frame;

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

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

[FFmpeg-cvslog] checkasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon for sum_square

2020-02-08 Thread Martin Storsjö
ffmpeg | branch: master | Martin Storsjö  | Wed Feb  5 
22:18:19 2020 +0200| [5181f491ee3688317e236130d79d91c940526aa9] | committer: 
Martin Storsjö

checkasm: sbrdsp: Fix a spurious test failure by calculating a better epsilon 
for sum_square

Signed-off-by: Martin Storsjö 

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5181f491ee3688317e236130d79d91c940526aa9
---

 tests/checkasm/sbrdsp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/checkasm/sbrdsp.c b/tests/checkasm/sbrdsp.c
index 558f452c9b..516b9f0ec6 100644
--- a/tests/checkasm/sbrdsp.c
+++ b/tests/checkasm/sbrdsp.c
@@ -17,6 +17,7 @@
  */
 
 #include "libavcodec/sbrdsp.h"
+#include 
 
 #include "checkasm.h"
 
@@ -51,13 +52,14 @@ static void test_sum_square(void)
 INTFLOAT res0;
 INTFLOAT res1;
 LOCAL_ALIGNED_16(INTFLOAT, src, [256], [2]);
+double t = 4 * 256;
 
 declare_func_float(INTFLOAT, INTFLOAT (*x)[2], int n);
 
 randomize((INTFLOAT *)src, 256 * 2);
 res0 = call_ref(src, 256);
 res1 = call_new(src, 256);
-if (!float_near_abs_eps(res0, res1, EPS))
+if (!float_near_abs_eps(res0, res1, t * 2 * FLT_EPSILON))
 fail();
 bench_new(src, 256);
 }

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

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

[FFmpeg-cvslog] lavu/tx: mention FFT output is not normalized

2020-02-08 Thread Lynne
ffmpeg | branch: master | Lynne  | Sat Feb  8 23:06:09 2020 
+| [d500eff3cce7ab0c6f7101860b633ca955a9f85e] | committer: Lynne

lavu/tx: mention FFT output is not normalized

Not even FFTW's output is normalized.
This should prevent at least some users from complaining that doing a forward
transform followed by an inverse transform has a mismatching output to the
original input.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d500eff3cce7ab0c6f7101860b633ca955a9f85e
---

 libavutil/tx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/tx.h b/libavutil/tx.h
index d6cdfdf9f2..8b405c0021 100644
--- a/libavutil/tx.h
+++ b/libavutil/tx.h
@@ -35,7 +35,7 @@ typedef struct AVComplexDouble {
 enum AVTXType {
 /**
  * Standard complex to complex FFT with sample data type AVComplexFloat.
- * Scaling currently unsupported
+ * Output is not 1/len normalized. Scaling currently unsupported.
  */
 AV_TX_FLOAT_FFT = 0,
 /**

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

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

[FFmpeg-cvslog] doc/APIchanges: fix vulkan hwcontext date

2020-02-08 Thread Lynne
ffmpeg | branch: master | Lynne  | Sat Feb  8 23:32:46 2020 
+| [9b9f441ab39d12086bfae044094dbcd8979b8d90] | committer: Lynne

doc/APIchanges: fix vulkan hwcontext date

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9b9f441ab39d12086bfae044094dbcd8979b8d90
---

 doc/APIchanges | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e9bea1daee..81969c301c 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,7 +15,7 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
-2020-ww-xx - xx - lavu 56.39.100 - hwcontext.h
+2020-02-04 - xx - lavu 56.39.100 - hwcontext.h
   Add AV_PIX_FMT_VULKAN
   Add AV_HWDEVICE_TYPE_VULKAN and implementation.
 

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

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