Re: [FFmpeg-devel] [PATCH] avfilter/split: switch to activate()

2022-03-06 Thread Nicolas George
Paul B Mahol (12022-03-01):
> Signed-off-by: Paul B Mahol 
> ---
> 
> Fix possible hangs if (a)split filter is used in graph and one of outputs ends
> earlier than others.
> Then filter may never receive EOF from input provided by (a)split filter.
> 
> See ticket #9152 for commands how to reproduce issue.
> 
> ---
>  libavfilter/split.c | 68 +
>  1 file changed, 51 insertions(+), 17 deletions(-)

Ok, the problem is in forward_status_change() in avfilter.c: it makes a
request on the first output, that triggers the status change on the
input, and therefore it considers itself satisfied without making a
request on the other outputs.

It could be changed to make at least one round and requesting on each
output, but it would be inefficient for filters that have several
outputs connected to different inputs, and that is a more common case.

Therefore, I agree, filters with several outputs connected to the same
input like split need a real activate implementation.

Patch ok, I did not look very carefully at the code itself.

Can you disclose why it was so urgent to push a fix for a but seven
months old that you would rather be rude than wait a few days?

-- 
  Nicolas George


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

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


[FFmpeg-devel] [PATCH] avcodec/hevc_refs: don't use the frame's AVBufferRef sizes when initializing planes

2022-03-06 Thread James Almer
Use the actual plane sizes instead.

Signed-off-by: James Almer 
---
 libavcodec/hevc_refs.c | 14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/libavcodec/hevc_refs.c b/libavcodec/hevc_refs.c
index 35b8e5e696..b0035356ac 100644
--- a/libavcodec/hevc_refs.c
+++ b/libavcodec/hevc_refs.c
@@ -22,6 +22,7 @@
  */
 
 #include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
 
 #include "thread.h"
 #include "hevc.h"
@@ -401,9 +402,16 @@ static HEVCFrame *generate_missing_ref(HEVCContext *s, int 
poc)
 
 if (!s->avctx->hwaccel) {
 if (!s->ps.sps->pixel_shift) {
-for (i = 0; frame->frame->buf[i]; i++)
-memset(frame->frame->buf[i]->data, 1 << (s->ps.sps->bit_depth 
- 1),
-   frame->frame->buf[i]->size);
+size_t sizes[4];
+ptrdiff_t linesizes[4];
+for (i = 0; i < 4; i++)
+linesizes[i] = frame->frame->linesize[i];
+if (av_image_fill_plane_sizes(sizes, frame->frame->format, 
frame->frame->height, linesizes) < 0) {
+ff_hevc_unref_frame(s, frame, ~0);
+return NULL;
+}
+for (i = 0; frame->frame->data[i]; i++)
+memset(frame->frame->data[i], 1 << (s->ps.sps->bit_depth - 1), 
sizes[i]);
 } else {
 for (i = 0; frame->frame->data[i]; i++)
 for (y = 0; y < (s->ps.sps->height >> s->ps.sps->vshift[i]); 
y++) {
-- 
2.35.1

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

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


Re: [FFmpeg-devel] [FFmpeg-cvslog] avfilter/vf_colorlevels: add planar rgb formats support

2022-03-06 Thread Michael Niedermayer
On Sun, Mar 06, 2022 at 12:59:01PM +, Paul B Mahol wrote:
> ffmpeg | branch: master | Paul B Mahol  | Sun Mar  6 
> 13:57:34 2022 +0100| [10c2ef1ca41dbe7811f0588f4163c8cf7b8fda66] | committer: 
> Paul B Mahol
> 
> avfilter/vf_colorlevels: add planar rgb formats support
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=10c2ef1ca41dbe7811f0588f4163c8cf7b8fda66
> ---
> 
>  libavfilter/vf_colorlevels.c | 232 
> +++
>  1 file changed, 189 insertions(+), 43 deletions(-)
[...]
> @@ -182,31 +178,126 @@ typedef struct ThreadData {
>  dst_a += dst_linesize;   
>\
>  }
>  
> +#define CLIP8(x, depth) av_clip_uint8(x)
> +#define CLIP16(x, depth) av_clip_uint16(x)
[...]
> +static int colorlevels_slice_9_planar(AVFilterContext *ctx, void *arg, int 
> jobnr, int nb_jobs)
> +{
> +ColorLevelsContext *s = ctx->priv;
> +const int depth = s->depth;
> +DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
> +return 0;

These things break build on ARM

Is there any particular reason why you dont post patches for some changes?
These breakages could be avoided if you posted this 1-2 days before applying


In file included from src/libavutil/intmath.h:30:0,
 from src/libavutil/common.h:88,
 from src/libavutil/avutil.h:296,
 from src/libavutil/opt.h:31,
 from src/libavfilter/vf_colorlevels.c:22:
src/libavutil/arm/intmath.h: In function ‘colorlevels_slice_9_planar’:
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: error: impossible constraint in ‘asm’
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: error: impossible constraint in ‘asm’
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: error: impossible constraint in ‘asm’
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: error: impossible constraint in ‘asm’
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h: In function ‘colorlevels_preserve_slice_9_planar’:
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/libavutil/arm/intmath.h:77:5: warning: asm operand 2 probably doesn’t match 
constraints
 __asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
 ^~~
src/ffbuild/common.mak:78: recipe for target 'libavfilter/vf_colorlevels.o' 
failed
make: *** [libavfilter/vf_colorlevels.o] Error 1




thx

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


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

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


[FFmpeg-devel] [PATCH] avfilter/vf_colorlevels: Fix build failure on ARM

2022-03-06 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavfilter/vf_colorlevels.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index a8859795dd..76adfbd8c8 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -219,7 +219,7 @@ static int colorlevels_slice_8_planar(AVFilterContext *ctx, 
void *arg, int jobnr
 static int colorlevels_slice_9_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 9;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -227,7 +227,7 @@ static int colorlevels_slice_9_planar(AVFilterContext *ctx, 
void *arg, int jobnr
 static int colorlevels_slice_10_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 10;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -235,7 +235,7 @@ static int colorlevels_slice_10_planar(AVFilterContext 
*ctx, void *arg, int jobn
 static int colorlevels_slice_12_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 12;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -243,7 +243,7 @@ static int colorlevels_slice_12_planar(AVFilterContext 
*ctx, void *arg, int jobn
 static int colorlevels_slice_14_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 14;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -265,7 +265,7 @@ static int 
colorlevels_preserve_slice_8_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_9_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 9;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
@@ -273,7 +273,7 @@ static int 
colorlevels_preserve_slice_9_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_10_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 10;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
@@ -281,7 +281,7 @@ static int 
colorlevels_preserve_slice_10_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_12_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 12;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
@@ -289,7 +289,7 @@ static int 
colorlevels_preserve_slice_12_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_14_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 14;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
-- 
2.17.1

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

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_colorlevels: Fix build failure on ARM

2022-03-06 Thread Paul B Mahol
On 3/6/22, Michael Niedermayer  wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavfilter/vf_colorlevels.c | 16 
>  1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
> index a8859795dd..76adfbd8c8 100644
> --- a/libavfilter/vf_colorlevels.c
> +++ b/libavfilter/vf_colorlevels.c
> @@ -219,7 +219,7 @@ static int colorlevels_slice_8_planar(AVFilterContext
> *ctx, void *arg, int jobnr
>  static int colorlevels_slice_9_planar(AVFilterContext *ctx, void *arg, int
> jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 9;
>  DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
>  return 0;
>  }
> @@ -227,7 +227,7 @@ static int colorlevels_slice_9_planar(AVFilterContext
> *ctx, void *arg, int jobnr
>  static int colorlevels_slice_10_planar(AVFilterContext *ctx, void *arg, int
> jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 10;
>  DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
>  return 0;
>  }
> @@ -235,7 +235,7 @@ static int colorlevels_slice_10_planar(AVFilterContext
> *ctx, void *arg, int jobn
>  static int colorlevels_slice_12_planar(AVFilterContext *ctx, void *arg, int
> jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 12;
>  DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
>  return 0;
>  }
> @@ -243,7 +243,7 @@ static int colorlevels_slice_12_planar(AVFilterContext
> *ctx, void *arg, int jobn
>  static int colorlevels_slice_14_planar(AVFilterContext *ctx, void *arg, int
> jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 14;
>  DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
>  return 0;
>  }
> @@ -265,7 +265,7 @@ static int
> colorlevels_preserve_slice_8_planar(AVFilterContext *ctx, void *arg,
>  static int colorlevels_preserve_slice_9_planar(AVFilterContext *ctx, void
> *arg, int jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 9;
>  DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
>  return 0;
>  }
> @@ -273,7 +273,7 @@ static int
> colorlevels_preserve_slice_9_planar(AVFilterContext *ctx, void *arg,
>  static int colorlevels_preserve_slice_10_planar(AVFilterContext *ctx, void
> *arg, int jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 10;
>  DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
>  return 0;
>  }
> @@ -281,7 +281,7 @@ static int
> colorlevels_preserve_slice_10_planar(AVFilterContext *ctx, void *arg,
>  static int colorlevels_preserve_slice_12_planar(AVFilterContext *ctx, void
> *arg, int jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 12;
>  DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
>  return 0;
>  }
> @@ -289,7 +289,7 @@ static int
> colorlevels_preserve_slice_12_planar(AVFilterContext *ctx, void *arg,
>  static int colorlevels_preserve_slice_14_planar(AVFilterContext *ctx, void
> *arg, int jobnr, int nb_jobs)
>  {
>  ColorLevelsContext *s = ctx->priv;
> -const int depth = s->depth;
> +const int depth = 14;
>  DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
>  return 0;
>  }
> --
> 2.17.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>


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

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


[FFmpeg-devel] [PATCH] avfilter/vf_colorlevels: Fix building for arm

2022-03-06 Thread Martin Storsjö
This fixes building for arm after 10c2ef1ca41dbe7811f0588f4163c8cf7b8fda66.
The argument to av_clip_uintp2 must be an assembly time immediate
constant.

Signed-off-by: Martin Storsjö 
---
 libavfilter/vf_colorlevels.c | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
index a8859795dd..76adfbd8c8 100644
--- a/libavfilter/vf_colorlevels.c
+++ b/libavfilter/vf_colorlevels.c
@@ -219,7 +219,7 @@ static int colorlevels_slice_8_planar(AVFilterContext *ctx, 
void *arg, int jobnr
 static int colorlevels_slice_9_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 9;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -227,7 +227,7 @@ static int colorlevels_slice_9_planar(AVFilterContext *ctx, 
void *arg, int jobnr
 static int colorlevels_slice_10_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 10;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -235,7 +235,7 @@ static int colorlevels_slice_10_planar(AVFilterContext 
*ctx, void *arg, int jobn
 static int colorlevels_slice_12_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 12;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -243,7 +243,7 @@ static int colorlevels_slice_12_planar(AVFilterContext 
*ctx, void *arg, int jobn
 static int colorlevels_slice_14_planar(AVFilterContext *ctx, void *arg, int 
jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 14;
 DO_COMMON(uint16_t, av_clip_uintp2, 0, 1)
 return 0;
 }
@@ -265,7 +265,7 @@ static int 
colorlevels_preserve_slice_8_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_9_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 9;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
@@ -273,7 +273,7 @@ static int 
colorlevels_preserve_slice_9_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_10_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 10;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
@@ -281,7 +281,7 @@ static int 
colorlevels_preserve_slice_10_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_12_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 12;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
@@ -289,7 +289,7 @@ static int 
colorlevels_preserve_slice_12_planar(AVFilterContext *ctx, void *arg,
 static int colorlevels_preserve_slice_14_planar(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_jobs)
 {
 ColorLevelsContext *s = ctx->priv;
-const int depth = s->depth;
+const int depth = 14;
 DO_COMMON(uint16_t, av_clip_uintp2, 1, 1)
 return 0;
 }
-- 
2.25.1

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

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_colorlevels: Fix build failure on ARM

2022-03-06 Thread Martin Storsjö

On Sun, 6 Mar 2022, Michael Niedermayer wrote:


Signed-off-by: Michael Niedermayer 
---
libavfilter/vf_colorlevels.c | 16 
1 file changed, 8 insertions(+), 8 deletions(-)


LGTM

(Sorry I didn't check the ML before sending my patch. Maybe mention the 
commit that introduced the regression and the reason, about immediate 
constants, too.)


// Martin

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

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_colorlevels: Fix build failure on ARM

2022-03-06 Thread Michael Niedermayer
On Sun, Mar 06, 2022 at 08:12:26PM +0200, Martin Storsjö wrote:
> On Sun, 6 Mar 2022, Michael Niedermayer wrote:
> 
> > Signed-off-by: Michael Niedermayer 
> > ---
> > libavfilter/vf_colorlevels.c | 16 
> > 1 file changed, 8 insertions(+), 8 deletions(-)
> 
> LGTM
> 

> (Sorry I didn't check the ML before sending my patch. Maybe mention the
> commit that introduced the regression and the reason, about immediate
> constants, too.)

I will steal your commit message then
will apply

thx

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

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


Re: [FFmpeg-devel] [PATCH v2] lavfi/drawtext: Add localtime_ms for millisecond precision

2022-03-06 Thread Thilo Borgmann

Am 22.02.22 um 12:36 schrieb Thilo Borgmann:

Am 08.02.22 um 11:41 schrieb Thilo Borgmann:

Am 08.02.22 um 10:27 schrieb Andreas Rheinhardt:

Thilo Borgmann:

Am 01.02.22 um 00:40 schrieb Andreas Rheinhardt:

Thilo Borgmann:

Am 31.01.22 um 14:08 schrieb Nicolas George:

Thilo Borgman (12022-01-31):

v10 attached.


Also going to apply soon if there are no more comments.


I think you neglected to attach the file.


omg stupid me. Here it is...

-Thilo



Seems like I misunderstood your code and ignored the outer while. Your
code can leak if there are multiple 'N', because (as I said)



+
+    if (fmt_new && fmt_new != argv[0] && fmt_new !=
fmt_default)
+    av_freep(&fmt_new);
+


does not free fmt if it is already allocated. It is possible to fix this
by adding an char *fmt_allocated = NULL; at outer scope and a fmt_new in
the block that is executed if a 'N' is executed. (You have to free
fmt_allocated immediately after av_asprintf().)



But maybe it would be best to use an AVBPrint to write the new string
instead of allocating a new string for every %N encountered.


v11 does it that way.





+    av_bprintf(&fmt_bp, "%s", fmt_begin);
+    av_bprint_finalize(&fmt_bp, (char**)&fmt);
+    if (!fmt)
+    return AVERROR(ENOMEM);
+
  av_bprint_strftime(bp, fmt, &tm);
+    av_freep(&fmt);
+


This is not how one uses an AVBPrint: You are loosing the
small-string-optimization that way.
Furthermore, you do not check for truncation.


v12 including IRC comments.


Ping.


Will push soon if there are no more comments.

-Thilo

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

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


Re: [FFmpeg-devel] [PATCH] avfilter: Added siti filter

2022-03-06 Thread Thilo Borgmann

Am 22.02.22 um 12:30 schrieb Thilo Borgmann:

Am 18.02.22 um 17:08 schrieb Paul B Mahol:

On Sat, Feb 12, 2022 at 11:55 AM Thilo Borgmann 
wrote:


Am 31.01.22 um 12:55 schrieb James Almer:



On 1/31/2022 8:53 AM, Anton Khirnov wrote:

Quoting Thilo Borgmann (2022-01-18 14:58:07)

Violations of code style.


Enhanced.


Not enough. There are still many remaining, e.g.
* opening brace of a function definition should be on its own line
* the context should generally be the first argument
* unsigned char* should be uint8_t*
* mixed declarations and code (the compiler should warn about that)


I think someone said that clang (or some versions) is apparently not

warning about this, hence why so many of these end up being missed in
reviews or even by the patch author.

This and all of Anton's comments in v3. Also removed some more obviously
useless doubles.



Why it uses doubles in so many places?
Is there any real benefit in that, except extra slowdown?


I guess because it's originating in some c&p Matlab code.
I did %s#double#float#g for v4, loosing some precision we can ignore IMHO.



v3:

Total frames: 2

Spatial Information:
Average: 165.451985
Max: 165.817542
Min: 165.086427

Temporal Information:
Average: 1.007263
Max: 2.014525
Min: 0.00



v4:

Total frames: 2

Spatial Information:
Average: 164.385895
Max: 164.742325
Min: 164.029480

Temporal Information:
Average: 1.007241
Max: 2.014483
Min: 0.00



Ping.

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

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


Re: [FFmpeg-devel] [PATCH] avfilter: Added siti filter

2022-03-06 Thread Paul B Mahol
On 3/6/22, Thilo Borgmann  wrote:
> Am 22.02.22 um 12:30 schrieb Thilo Borgmann:
>> Am 18.02.22 um 17:08 schrieb Paul B Mahol:
>>> On Sat, Feb 12, 2022 at 11:55 AM Thilo Borgmann 
>>> wrote:
>>>
 Am 31.01.22 um 12:55 schrieb James Almer:
>
>
> On 1/31/2022 8:53 AM, Anton Khirnov wrote:
>> Quoting Thilo Borgmann (2022-01-18 14:58:07)
> Violations of code style.
>>>
>>> Enhanced.
>>
>> Not enough. There are still many remaining, e.g.
>> * opening brace of a function definition should be on its own line
>> * the context should generally be the first argument
>> * unsigned char* should be uint8_t*
>> * mixed declarations and code (the compiler should warn about that)
>
> I think someone said that clang (or some versions) is apparently not
 warning about this, hence why so many of these end up being missed in
 reviews or even by the patch author.

 This and all of Anton's comments in v3. Also removed some more
 obviously
 useless doubles.

>>>
>>> Why it uses doubles in so many places?
>>> Is there any real benefit in that, except extra slowdown?
>>
>> I guess because it's originating in some c&p Matlab code.
>> I did %s#double#float#g for v4, loosing some precision we can ignore
>> IMHO.
>>
>>
>>
>> v3:
>>
>> Total frames: 2
>>
>> Spatial Information:
>> Average: 165.451985
>> Max: 165.817542
>> Min: 165.086427
>>
>> Temporal Information:
>> Average: 1.007263
>> Max: 2.014525
>> Min: 0.00
>>
>>
>>
>> v4:
>>
>> Total frames: 2
>>
>> Spatial Information:
>> Average: 164.385895
>> Max: 164.742325
>> Min: 164.029480
>>
>> Temporal Information:
>> Average: 1.007241
>> Max: 2.014483
>> Min: 0.00
>>
>
> Ping.

Into wrong section of changelog added entry.

Useless cast of allocation results.

Does filter changes pixels? If not, add metadata flag to appropriate place.

>
> -Thilo
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH] mlp_parser: fetch a new timestamp when major sync is found

2022-03-06 Thread Jan Ekström
From: Hendrik Leppkes 

Decoding can only start on a major sync and the parser discards
any data received until that point. Therefore, previously received
timestamps are no longer relevant to the data being returned from
the parser.

Additionally, adds a test which remuxes an existing TrueHD sample
with the first keyframe dropped using copyinkf, and then demuxes
this remux with ffprobe. Previously this would have pushed the
first random access point packet out as pts=1, even though it would
have contained the data received from packet containing pts=13.

With this fix, the first data received from the parser properly
contains the pts of the packet in which it was contained.

Fixes #9428

Co-authored-by: Jan Ekström 
---
 libavcodec/mlp_parser.c |  1 +
 tests/fate/truehd.mak   | 12 
 tests/ref/fate/truehd-parser-timestamps | 26 +
 3 files changed, 39 insertions(+)
 create mode 100644 tests/ref/fate/truehd-parser-timestamps

diff --git a/libavcodec/mlp_parser.c b/libavcodec/mlp_parser.c
index 9fea7db955..70d7b3f601 100644
--- a/libavcodec/mlp_parser.c
+++ b/libavcodec/mlp_parser.c
@@ -96,6 +96,7 @@ static int mlp_parse(AVCodecParserContext *s,
 return ret;
 }
 
+s->fetch_timestamp = 1;
 return i - 7;
 }
 
diff --git a/tests/fate/truehd.mak b/tests/fate/truehd.mak
index 7da8c93cff..6f451cc327 100644
--- a/tests/fate/truehd.mak
+++ b/tests/fate/truehd.mak
@@ -13,5 +13,17 @@ fate-truehd-core-bsf: CMD = md5pipe -i 
$(TARGET_SAMPLES)/truehd/atmos.thd -c:a c
 fate-truehd-core-bsf: CMP = oneline
 fate-truehd-core-bsf: REF = 3aa5d0c7825051f3657b71fd6135183b
 
+# Tests that the result from reading a copyinkf remux with the first random
+# access point dropped will receive the correct timestamp for the first packet,
+# which is not the packet of the first packet read.
+FATE_TRUEHD-$(call ALLYES, FILE_PROTOCOL PIPE_PROTOCOL TRUEHD_DEMUXER \
+   MLP_PARSER MATROSKA_MUXER NOISE_BSF) \
+   += fate-truehd-parser-timestamps
+fate-truehd-parser-timestamps: CMD = stream_remux "truehd" \
+"$(TARGET_SAMPLES)/lossless-audio/truehd_5.1.raw" "matroska" \
+"-map 0:a -copyinkf -bsf:a noise=drop=not\(n\)*key -t 0.030" \
+"-c copy -copyts"
+fate-truehd-parser-timestamps: CMP = diff
+
 FATE_SAMPLES_AUDIO += $(FATE_TRUEHD-yes)
 fate-truehd: $(FATE_TRUEHD-yes)
diff --git a/tests/ref/fate/truehd-parser-timestamps 
b/tests/ref/fate/truehd-parser-timestamps
new file mode 100644
index 00..94d5a05640
--- /dev/null
+++ b/tests/ref/fate/truehd-parser-timestamps
@@ -0,0 +1,26 @@
+#tb 0: 1/1000
+#media_type 0: audio
+#codec_id 0: truehd
+#sample_rate 0: 48000
+#channel_layout 0: 60f
+#channel_layout_name 0: 5.1(side)
+0, 13, 13,1,  368, 0x256d
+0, 14, 14,1,  190, 0x7b975b90, F=0x0
+0, 15, 15,1,  178, 0xfdc85dc0, F=0x0
+0, 16, 16,1,  184, 0x3a605a1c, F=0x0
+0, 17, 17,1,  184, 0xf00e5aef, F=0x0
+0, 18, 18,1,  186, 0x95125c74, F=0x0
+0, 18, 18,1,  184, 0xc6ae624e, F=0x0
+0, 19, 19,1,  186, 0x5f9e5de9, F=0x0
+0, 20, 20,1,  188, 0x80135cc7, F=0x0
+0, 21, 21,1,  188, 0x10dc5a3d, F=0x0
+0, 22, 22,1,  188, 0x63ff5980, F=0x0
+0, 23, 23,1,  198, 0x42265ec5, F=0x0
+0, 23, 23,1,  210, 0x4d2f6d78, F=0x0
+0, 24, 24,1,  202, 0x44b6654f, F=0x0
+0, 25, 25,1,  192, 0x098e6271, F=0x0
+0, 26, 26,1,  194, 0x090f691d, F=0x0
+0, 27, 27,1,  382, 0x88b0ac79
+0, 28, 28,1,  196, 0xf0765d20, F=0x0
+0, 28, 28,1,  188, 0x72c65e8d, F=0x0
+0, 29, 29,1,  186, 0x913a5fcb, F=0x0
-- 
2.35.1

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

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


Re: [FFmpeg-devel] [PATCH] libavfilter: vf_scale: Properly take in->color_range into account

2022-03-06 Thread Martin Storsjö

On Sun, 6 Mar 2022, Michael Niedermayer wrote:


On Sat, Mar 05, 2022 at 11:33:15PM +0200, Martin Storsjö wrote:

On Fri, 4 Mar 2022, Michael Niedermayer wrote:


On Thu, Mar 03, 2022 at 02:06:45PM +0200, Martin Storsjö wrote:

While swscale can be reconfigured with sws_setColorspaceDetails,
the in/out ranges also need to be set before calling
sws_init_context, otherwise the initialization might choose
fastpaths that don't take the ranges into account.

Therefore, look at in->color_range too, when deciding on whether
the scaler needs to be reconfigured.

Add a new member variable for keeping track of this, for being
able to differentiate between whether the scale filter parameter
"in_range" has been set (which should override whatever the input
frame has set) or whether it has been configured based on the
latest frame (which should trigger reconfiguring the scaler if
the input frame ranges change).

Signed-off-by: Martin Storsjö 
---
To test this (without risking running many conflicting swscale
filters in one filter pipeline), we'd need to be able to tag
the incoming raw yuv data with colorspace and range without setting
the in_color_matrix and in_range options on the scale filter.

When using the rawvideo demuxer, the pixel format is set via the
ffmpeg -pix_fmt option, but there's no corresponding option for
setting color matrix or range for it.
---
 libavfilter/vf_scale.c | 13 +
 1 file changed, 13 insertions(+)


This changes the output for:
ffmpeg -i tickets/524/AVCI50.mov   -vframes 3 file-avci50dec.nut
ffmpeg -i tickets/4493/AVCI100.mov -vframes 3 file-avci100dec.nut

https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket524/

Is that intended ?

- 233903 file-avci100dec.nut
- 383853 file-avci50dec.nut
+ 196558 file-avci100dec.nut
+ 333893 file-avci50dec.nut


Looks like these source files have full range content; for any data with
full range input, this patch makes sure it uses the right intended
conversion through swscale. So yes, I guess it's expected that these
conversions change.


patch ok then


Pushed, thanks.

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

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


[FFmpeg-devel] [PATCH v1] doc/examples/transcoding: set ret before goto end

2022-03-06 Thread sunzhenliang
Signed-off-by: sunzhenliang 
---
 doc/examples/transcoding.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/doc/examples/transcoding.c b/doc/examples/transcoding.c
index badfba62cb..24e64e572e 100644
--- a/doc/examples/transcoding.c
+++ b/doc/examples/transcoding.c
@@ -524,8 +524,10 @@ int main(int argc, char **argv)
 goto end;
 if ((ret = init_filters()) < 0)
 goto end;
-if (!(packet = av_packet_alloc()))
+if (!(packet = av_packet_alloc())) {
+ret = AVERROR(ENOMEM);
 goto end;
+}
 
 /* read all packets */
 while (1) {
-- 
2.25.1

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

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