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

2022-02-15 Thread Anton Khirnov
Quoting Thilo Borgmann (2022-02-12 11:55:39)
> Am 31.01.22 um 12:55 schrieb James Almer:
> +static int config_input(AVFilterLink *inlink)
> +{
> +// Video input data avilable
> +AVFilterContext *ctx = inlink->dst;
> +SiTiContext *s = ctx->priv;
> +int max_pixsteps[4];
> +size_t pixel_sz;
> +size_t data_sz;
> +size_t gradient_sz;
> +size_t motion_sz;
> +
> +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> +av_image_fill_max_pixsteps(max_pixsteps, NULL, desc);
> +
> +s->pixel_depth = max_pixsteps[0];
> +s->width = inlink->w;
> +s->height = inlink->h;
> +pixel_sz = s->pixel_depth == 1 ? sizeof(uint8_t) : sizeof(uint16_t);
> +data_sz = s->width * pixel_sz * s->height;
> +
> +s->prev_frame = av_malloc(data_sz);
> +
> +gradient_sz = (s->width - 2) * sizeof(double) * (s->height - 2);
> +s->gradient_matrix = (double*)av_malloc(gradient_sz);
> +
> +motion_sz = s->width * sizeof(double) * s->height;
> +s->motion_matrix = (double*)av_malloc(motion_sz);

useless casts

> +
> +if (!s->prev_frame || ! s->gradient_matrix || !s->motion_matrix) {
> +av_freep(&s->prev_frame);
> +av_freep(&s->gradient_matrix);
> +av_freep(&s->motion_matrix);

You don't need to free them on failure, that will be done in uninit. But
you should free them at the beginning of this function, because
config_input can be called multiple times.

> +// Applies sobel convolution
> +static void convolve_sobel(SiTiContext *s, const uint8_t *src, double *dst, 
> int linesize)
> +{
> +double x_conv_sum;
> +double y_conv_sum;
> +double gradient;
> +int ki;
> +int kj;
> +int index;
> +uint16_t data;
> +int filter_width = 3;
> +int filter_size = filter_width * filter_width;
> +int stride = linesize / s->pixel_depth;
> +
> +// Dst matrix is smaller than src since we ignore edges that can't be 
> convolved
> +#define CONVOLVE(bps)   \
> +{   \
> +uint##bps##_t *vsrc = (uint##bps##_t*)src;  \
> +for (int j = 1; j < s->height - 1; j++) {   \
> +for (int i = 1; i < s->width - 1; i++) {\
> +x_conv_sum = 0.0;   \
> +y_conv_sum = 0.0;   \
> +for (int k = 0; k < filter_size; k++) { \
> +ki = k % filter_width - 1;  \
> +kj = floor(k / filter_width) - 1;   \
> +index = (j + kj) * stride + (i + ki);   \
> +data = convert_full_range(s, vsrc[index]);  \

Pass bps as a parameter to convert_full_range() instead of accessing
s->pixel_depth, so the compiler can optimize the branch away.

> +// Calculate pixel difference between current and previous frame, and update 
> previous
> +static void calculate_motion(SiTiContext *s, const uint8_t *curr,
> + double *motion_matrix, int linesize)
> +{
> +int stride = linesize / s->pixel_depth;
> +double motion;
> +int curr_index;
> +int prev_index;
> +uint16_t curr_data;
> +
> +// Previous frame is already converted to full range
> +#define CALCULATE(bps)   \
> +{\
> +uint##bps##_t *vsrc = (uint##bps##_t*)curr;  \
> +for (int j = 0; j < s->height; j++) {\
> +for (int i = 0; i < s->width; i++) { \
> +motion = 0;  \
> +curr_index = j * stride + i; \
> +prev_index = j * s->width + i;   \
> +curr_data = convert_full_range(s, vsrc[curr_index]); \
> +if (s->nb_frames > 1)\
> +motion = curr_data - s->prev_frame[prev_index];  \
> +s->prev_frame[prev_index] = curr_data;   \

previous code accessed this as uint8_t or uint16_t based on bps

-- 
Anton Khirnov
___
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-02-15 Thread Paul B Mahol
On Tue, Feb 15, 2022 at 9:55 AM Anton Khirnov  wrote:

> Quoting Thilo Borgmann (2022-02-12 11:55:39)
> > Am 31.01.22 um 12:55 schrieb James Almer:
> > +static int config_input(AVFilterLink *inlink)
> > +{
> > +// Video input data avilable
> > +AVFilterContext *ctx = inlink->dst;
> > +SiTiContext *s = ctx->priv;
> > +int max_pixsteps[4];
> > +size_t pixel_sz;
> > +size_t data_sz;
> > +size_t gradient_sz;
> > +size_t motion_sz;
> > +
> > +const AVPixFmtDescriptor *desc =
> av_pix_fmt_desc_get(inlink->format);
> > +av_image_fill_max_pixsteps(max_pixsteps, NULL, desc);
> > +
> > +s->pixel_depth = max_pixsteps[0];
> > +s->width = inlink->w;
> > +s->height = inlink->h;
> > +pixel_sz = s->pixel_depth == 1 ? sizeof(uint8_t) : sizeof(uint16_t);
> > +data_sz = s->width * pixel_sz * s->height;
> > +
> > +s->prev_frame = av_malloc(data_sz);
> > +
> > +gradient_sz = (s->width - 2) * sizeof(double) * (s->height - 2);
> > +s->gradient_matrix = (double*)av_malloc(gradient_sz);
> > +
> > +motion_sz = s->width * sizeof(double) * s->height;
> > +s->motion_matrix = (double*)av_malloc(motion_sz);
>
> useless casts
>
> > +
> > +if (!s->prev_frame || ! s->gradient_matrix || !s->motion_matrix) {
> > +av_freep(&s->prev_frame);
> > +av_freep(&s->gradient_matrix);
> > +av_freep(&s->motion_matrix);
>
> You don't need to free them on failure, that will be done in uninit. But
> you should free them at the beginning of this function, because
> config_input can be called multiple times.
>

In which scenarios? When its called, uninit is also called before.
Was thinking to add better support for frame w/h changes when midstream
filtering


>
> > +// Applies sobel convolution
> > +static void convolve_sobel(SiTiContext *s, const uint8_t *src, double
> *dst, int linesize)
> > +{
> > +double x_conv_sum;
> > +double y_conv_sum;
> > +double gradient;
> > +int ki;
> > +int kj;
> > +int index;
> > +uint16_t data;
> > +int filter_width = 3;
> > +int filter_size = filter_width * filter_width;
> > +int stride = linesize / s->pixel_depth;
> > +
> > +// Dst matrix is smaller than src since we ignore edges that can't
> be convolved
> > +#define CONVOLVE(bps)   \
> > +{   \
> > +uint##bps##_t *vsrc = (uint##bps##_t*)src;  \
> > +for (int j = 1; j < s->height - 1; j++) {   \
> > +for (int i = 1; i < s->width - 1; i++) {\
> > +x_conv_sum = 0.0;   \
> > +y_conv_sum = 0.0;   \
> > +for (int k = 0; k < filter_size; k++) { \
> > +ki = k % filter_width - 1;  \
> > +kj = floor(k / filter_width) - 1;   \
> > +index = (j + kj) * stride + (i + ki);   \
> > +data = convert_full_range(s, vsrc[index]);  \
>
> Pass bps as a parameter to convert_full_range() instead of accessing
> s->pixel_depth, so the compiler can optimize the branch away.
>
> > +// Calculate pixel difference between current and previous frame, and
> update previous
> > +static void calculate_motion(SiTiContext *s, const uint8_t *curr,
> > + double *motion_matrix, int linesize)
> > +{
> > +int stride = linesize / s->pixel_depth;
> > +double motion;
> > +int curr_index;
> > +int prev_index;
> > +uint16_t curr_data;
> > +
> > +// Previous frame is already converted to full range
> > +#define CALCULATE(bps)   \
> > +{\
> > +uint##bps##_t *vsrc = (uint##bps##_t*)curr;  \
> > +for (int j = 0; j < s->height; j++) {\
> > +for (int i = 0; i < s->width; i++) { \
> > +motion = 0;  \
> > +curr_index = j * stride + i; \
> > +prev_index = j * s->width + i;   \
> > +curr_data = convert_full_range(s, vsrc[curr_index]); \
> > +if (s->nb_frames > 1)\
> > +motion = curr_data - s->prev_frame[prev_index];  \
> > +s->prev_frame[prev_index] = curr_data;   \
>
> previous code accessed this as uint8_t or uint16_t based on bps
>
> --
> Anton Khirnov
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-deve

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

2022-02-15 Thread Anton Khirnov
Quoting Paul B Mahol (2022-02-15 10:10:17)
> On Tue, Feb 15, 2022 at 9:55 AM Anton Khirnov  wrote:
> 
> > Quoting Thilo Borgmann (2022-02-12 11:55:39)
> > > Am 31.01.22 um 12:55 schrieb James Almer:
> > > +static int config_input(AVFilterLink *inlink)
> > > +{
> > > +// Video input data avilable
> > > +AVFilterContext *ctx = inlink->dst;
> > > +SiTiContext *s = ctx->priv;
> > > +int max_pixsteps[4];
> > > +size_t pixel_sz;
> > > +size_t data_sz;
> > > +size_t gradient_sz;
> > > +size_t motion_sz;
> > > +
> > > +const AVPixFmtDescriptor *desc =
> > av_pix_fmt_desc_get(inlink->format);
> > > +av_image_fill_max_pixsteps(max_pixsteps, NULL, desc);
> > > +
> > > +s->pixel_depth = max_pixsteps[0];
> > > +s->width = inlink->w;
> > > +s->height = inlink->h;
> > > +pixel_sz = s->pixel_depth == 1 ? sizeof(uint8_t) : sizeof(uint16_t);
> > > +data_sz = s->width * pixel_sz * s->height;
> > > +
> > > +s->prev_frame = av_malloc(data_sz);
> > > +
> > > +gradient_sz = (s->width - 2) * sizeof(double) * (s->height - 2);
> > > +s->gradient_matrix = (double*)av_malloc(gradient_sz);
> > > +
> > > +motion_sz = s->width * sizeof(double) * s->height;
> > > +s->motion_matrix = (double*)av_malloc(motion_sz);
> >
> > useless casts
> >
> > > +
> > > +if (!s->prev_frame || ! s->gradient_matrix || !s->motion_matrix) {
> > > +av_freep(&s->prev_frame);
> > > +av_freep(&s->gradient_matrix);
> > > +av_freep(&s->motion_matrix);
> >
> > You don't need to free them on failure, that will be done in uninit. But
> > you should free them at the beginning of this function, because
> > config_input can be called multiple times.
> >
> 
> In which scenarios? When its called, uninit is also called before.
> Was thinking to add better support for frame w/h changes when midstream
> filtering

Actually I'm not sure it currently will be called more than once, but
IIRC the code was supposed to assume it, precisely for future parameter
change support.

-- 
Anton Khirnov
___
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/avcodec: Remove MpegEncContext forward declaration

2022-02-15 Thread Andreas Rheinhardt
Forgotten in be95df12bb06b183c8d2aea3b0831fdf05466cf3.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 5362446092..79af8dcc05 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2029,8 +2029,6 @@ typedef struct AVCodecContext {
 int (*get_encode_buffer)(struct AVCodecContext *s, AVPacket *pkt, int 
flags);
 } AVCodecContext;
 
-struct MpegEncContext;
-
 /**
  * @defgroup lavc_hwaccel AVHWAccel
  *
-- 
2.32.0

___
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/error_resilience: Remove unused label

2022-02-15 Thread Andreas Rheinhardt
Forgotten in be95df12bb06b183c8d2aea3b0831fdf05466cf3.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/error_resilience.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 91b7b277a3..e9764f8d96 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -1327,7 +1327,6 @@ void ff_er_frame_end(ERContext *s)
 }
 }
 
-ec_clean:
 /* clean a few tables */
 for (i = 0; i < s->mb_num; i++) {
 const int mb_xy = s->mb_index2xy[i];
-- 
2.32.0

___
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/vp3: Add missing check for av_malloc

2022-02-15 Thread Jiasheng Jiang
Since the av_malloc() may fail and return NULL pointer,
it is needed that the 's->edge_emu_buffer' should be checked
whether the new allocation is success.

Fixes: d14723861b ("VP3: fix decoding of videos with stride > 2048")
Signed-off-by: Jiasheng Jiang 
---
 libavcodec/vp3.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index e9ab54d736..e2418eb6fa 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -2679,8 +2679,13 @@ static int vp3_decode_frame(AVCodecContext *avctx,
 AV_GET_BUFFER_FLAG_REF)) < 0)
 goto error;
 
-if (!s->edge_emu_buffer)
+if (!s->edge_emu_buffer) {
 s->edge_emu_buffer = av_malloc(9 * 
FFABS(s->current_frame.f->linesize[0]));
+if (!s->edge_emu_buffer) {
+ret = AVERROR(ENOMEM);
+goto error;
+}
+}
 
 if (s->keyframe) {
 if (!s->theora) {
-- 
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".


[FFmpeg-devel] [PATCH] swscale/utils: Add missing check for av_malloc

2022-02-15 Thread Jiasheng Jiang
As the potential failure of the memory allocation, the return
value of the av_malloc() could be NULL and be dereferenced on.
Therefore it should be better to check it and return error if fails.
Also, the callers of the ff_shuffle_filter_coefficients() should deal
with the return value.

Fixes: f900a19fa9 ("libswscale: Adds ff_hscale8to15_4_avx2 and 
ff_hscale8to15_X4_avx2 for all filter sizes.")
Signed-off-by: Jiasheng Jiang 
---
 libswscale/swscale_internal.h |  2 +-
 libswscale/utils.c| 13 ++---
 tests/checkasm/sw_scale.c |  3 ++-
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 3a78d95ba6..26d28d42e6 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -1144,5 +1144,5 @@ void ff_sws_slice_worker(void *priv, int jobnr, int 
threadnr,
 #define MAX_LINES_AHEAD 4
 
 //shuffle filter and filterPos for hyScale and hcScale filters in avx2
-void ff_shuffle_filter_coefficients(SwsContext *c, int* filterPos, int 
filterSize, int16_t *filter, int dstW);
+int ff_shuffle_filter_coefficients(SwsContext *c, int* filterPos, int 
filterSize, int16_t *filter, int dstW);
 #endif /* SWSCALE_SWSCALE_INTERNAL_H */
diff --git a/libswscale/utils.c b/libswscale/utils.c
index c5ea8853d5..7754a03e00 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -278,7 +278,7 @@ static const FormatEntry format_entries[] = {
 [AV_PIX_FMT_P416LE]  = { 1, 1 },
 };
 
-void ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, int 
filterSize, int16_t *filter, int dstW){
+int ff_shuffle_filter_coefficients(SwsContext *c, int *filterPos, int 
filterSize, int16_t *filter, int dstW){
 #if ARCH_X86_64
 int i, j, k, l;
 int cpu_flags = av_get_cpu_flags();
@@ -292,6 +292,9 @@ void ff_shuffle_filter_coefficients(SwsContext *c, int 
*filterPos, int filterSiz
 }
 if (filterSize > 4){
 int16_t *tmp2 = av_malloc(dstW * filterSize * 2);
+if (!tmp2)
+return AVERROR(ENOMEM);
+
 memcpy(tmp2, filter, dstW * filterSize * 2);
 for (i = 0; i < dstW; i += 16){//pixel
 for (k = 0; k < filterSize / 4; ++k){//fcoeff
@@ -311,6 +314,8 @@ void ff_shuffle_filter_coefficients(SwsContext *c, int 
*filterPos, int filterSiz
 }
 }
 #endif
+
+return 0;
 }
 
 int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
@@ -1836,7 +1841,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
get_local_pos(c, 0, 0, 0),
get_local_pos(c, 0, 0, 0))) < 0)
 goto fail;
-ff_shuffle_filter_coefficients(c, c->hLumFilterPos, 
c->hLumFilterSize, c->hLumFilter, dstW);
+if ((ret = ff_shuffle_filter_coefficients(c, c->hLumFilterPos, 
c->hLumFilterSize, c->hLumFilter, dstW)) < 0)
+goto fail;
 if ((ret = initFilter(&c->hChrFilter, &c->hChrFilterPos,
&c->hChrFilterSize, c->chrXInc,
c->chrSrcW, c->chrDstW, filterAlign, 1 << 14,
@@ -1846,7 +1852,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
get_local_pos(c, c->chrSrcHSubSample, 
c->src_h_chr_pos, 0),
get_local_pos(c, c->chrDstHSubSample, 
c->dst_h_chr_pos, 0))) < 0)
 goto fail;
-ff_shuffle_filter_coefficients(c, c->hChrFilterPos, 
c->hChrFilterSize, c->hChrFilter, c->chrDstW);
+if ((ret = ff_shuffle_filter_coefficients(c, c->hChrFilterPos, 
c->hChrFilterSize, c->hChrFilter, c->chrDstW)) < 0)
+goto fail;
 }
 } // initialize horizontal stuff
 
diff --git a/tests/checkasm/sw_scale.c b/tests/checkasm/sw_scale.c
index 3c0a083b42..0cb0ac4a4a 100644
--- a/tests/checkasm/sw_scale.c
+++ b/tests/checkasm/sw_scale.c
@@ -218,7 +218,8 @@ static void check_hscale(void)
 ff_sws_init_scale(ctx);
 memcpy(filterAvx2, filter, sizeof(uint16_t) * (SRC_PIXELS * 
MAX_FILTER_WIDTH + MAX_FILTER_WIDTH));
 if ((cpu_flags & AV_CPU_FLAG_AVX2) && !(cpu_flags & 
AV_CPU_FLAG_SLOW_GATHER))
-ff_shuffle_filter_coefficients(ctx, filterPosAvx, width, 
filterAvx2, SRC_PIXELS);
+if (ff_shuffle_filter_coefficients(ctx, filterPosAvx, width, 
filterAvx2, SRC_PIXELS) < 0)
+fail();
 
 if (check_func(ctx->hcScale, "hscale_%d_to_%d_width%d", 
ctx->srcBpc, ctx->dstBpc + 1, width)) {
 memset(dst0, 0, SRC_PIXELS * sizeof(dst0[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 "unsubsc

[FFmpeg-devel] [PATCH] avcodec/mlz: Add the check after calling av_mallocz

2022-02-15 Thread Jiasheng Jiang
Since the potential failure of memory allocation, the av_mallocz()
may return NULL pointer if fails, which is assigned to 'mlz->dict'.
And then 'mlz->dict' will be used in ff_mlz_flush_dict().
Therefore, it should be better to check it and return error if fails
in order to prevent the dereference of the NULL pointer.
Also, the caller, the decode_init() needs to deal with the return value
of ff_mlz_init_dict().

Fixes: 2f7a12fab5 ("avcodec/mlz: clear dict on allocation to ensure there are 
no uninitialized values")
Signed-off-by: Jiasheng Jiang 
---
 libavcodec/alsdec.c | 5 -
 libavcodec/mlz.c| 6 +-
 libavcodec/mlz.h| 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 9e1aaf065a..2fbb309d33 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -2122,7 +2122,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
 goto fail;
 }
 
-ff_mlz_init_dict(avctx, ctx->mlz);
+ret = ff_mlz_init_dict(avctx, ctx->mlz);
+if (ret < 0)
+goto fail;
+
 ff_mlz_flush_dict(ctx->mlz);
 
 for (c = 0; c < avctx->channels; ++c) {
diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
index dbeb7dcad9..b35607cc7c 100644
--- a/libavcodec/mlz.c
+++ b/libavcodec/mlz.c
@@ -20,8 +20,10 @@
 
 #include "mlz.h"
 
-av_cold void ff_mlz_init_dict(void* context, MLZ *mlz) {
+av_cold int ff_mlz_init_dict(void* context, MLZ *mlz) {
 mlz->dict = av_mallocz(TABLE_SIZE * sizeof(*mlz->dict));
+if (!mlz->dict)
+return AVERROR(ENOMEM);
 
 mlz->flush_code= FLUSH_CODE;
 mlz->current_dic_index_max = DIC_INDEX_INIT;
@@ -30,6 +32,8 @@ av_cold void ff_mlz_init_dict(void* context, MLZ *mlz) {
 mlz->next_code = FIRST_CODE;
 mlz->freeze_flag   = 0;
 mlz->context   = context;
+
+return 0;
 }
 
 av_cold void ff_mlz_flush_dict(MLZ *mlz) {
diff --git a/libavcodec/mlz.h b/libavcodec/mlz.h
index c3df52c9b4..01f8e78ec2 100644
--- a/libavcodec/mlz.h
+++ b/libavcodec/mlz.h
@@ -57,7 +57,7 @@ typedef struct MLZ {
 
 /** Initialize the dictionary
  */
-void ff_mlz_init_dict(void* context, MLZ *mlz);
+int ff_mlz_init_dict(void* context, MLZ *mlz);
 
 /** Flush the dictionary
  */
-- 
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] avcodec/mlz: Add the check after calling av_mallocz

2022-02-15 Thread Andreas Rheinhardt
Jiasheng Jiang:
> Since the potential failure of memory allocation, the av_mallocz()
> may return NULL pointer if fails, which is assigned to 'mlz->dict'.
> And then 'mlz->dict' will be used in ff_mlz_flush_dict().
> Therefore, it should be better to check it and return error if fails
> in order to prevent the dereference of the NULL pointer.
> Also, the caller, the decode_init() needs to deal with the return value
> of ff_mlz_init_dict().
> 
> Fixes: 2f7a12fab5 ("avcodec/mlz: clear dict on allocation to ensure there are 
> no uninitialized values")

This is the wrong reference; there was an unchecked allocation before
that, it was just and unchecked av_malloc_array instead of av_mallocz_array.

> Signed-off-by: Jiasheng Jiang 
> ---
>  libavcodec/alsdec.c | 5 -
>  libavcodec/mlz.c| 6 +-
>  libavcodec/mlz.h| 2 +-
>  3 files changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
> index 9e1aaf065a..2fbb309d33 100644
> --- a/libavcodec/alsdec.c
> +++ b/libavcodec/alsdec.c
> @@ -2122,7 +2122,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
>  goto fail;
>  }
>  
> -ff_mlz_init_dict(avctx, ctx->mlz);
> +ret = ff_mlz_init_dict(avctx, ctx->mlz);
> +if (ret < 0)
> +goto fail;
> +
>  ff_mlz_flush_dict(ctx->mlz);
>  
>  for (c = 0; c < avctx->channels; ++c) {
> diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
> index dbeb7dcad9..b35607cc7c 100644
> --- a/libavcodec/mlz.c
> +++ b/libavcodec/mlz.c
> @@ -20,8 +20,10 @@
>  
>  #include "mlz.h"
>  
> -av_cold void ff_mlz_init_dict(void* context, MLZ *mlz) {
> +av_cold int ff_mlz_init_dict(void* context, MLZ *mlz) {
>  mlz->dict = av_mallocz(TABLE_SIZE * sizeof(*mlz->dict));
> +if (!mlz->dict)
> +return AVERROR(ENOMEM);
>  
>  mlz->flush_code= FLUSH_CODE;
>  mlz->current_dic_index_max = DIC_INDEX_INIT;
> @@ -30,6 +32,8 @@ av_cold void ff_mlz_init_dict(void* context, MLZ *mlz) {
>  mlz->next_code = FIRST_CODE;
>  mlz->freeze_flag   = 0;
>  mlz->context   = context;
> +
> +return 0;
>  }
>  
>  av_cold void ff_mlz_flush_dict(MLZ *mlz) {
> diff --git a/libavcodec/mlz.h b/libavcodec/mlz.h
> index c3df52c9b4..01f8e78ec2 100644
> --- a/libavcodec/mlz.h
> +++ b/libavcodec/mlz.h
> @@ -57,7 +57,7 @@ typedef struct MLZ {
>  
>  /** Initialize the dictionary
>   */
> -void ff_mlz_init_dict(void* context, MLZ *mlz);
> +int ff_mlz_init_dict(void* context, MLZ *mlz);
>  
>  /** Flush the dictionary
>   */

See https://ffmpeg.org/pipermail/ffmpeg-devel/2022-February/292904.html

- Andreas
___
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 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used

2022-02-15 Thread Anton Khirnov
Quoting James Almer (2022-02-14 23:41:54)
> A keyframe could be buffered in the bsf and not be output until more packets
> had been fed to it.
> 
> Signed-off-by: James Almer 
> ---
>  fftools/ffmpeg.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> index 6aa0986f02..48d9016b4c 100644
> --- a/fftools/ffmpeg.c
> +++ b/fftools/ffmpeg.c
> @@ -2026,7 +2026,8 @@ static void do_streamcopy(InputStream *ist, 
> OutputStream *ost, const AVPacket *p
>  }
>  
>  if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
> -!ost->copy_initial_nonkeyframes)
> +!ost->copy_initial_nonkeyframes &&
> +!(ost->bsf_ctx && ost->bsf_ctx->filter->capabilities & 
> AV_BSF_CAP_DELAY))
>  return;

Wouldn't it be simpler to add an OutputStream field that tracks whether
we've seen a keyframe packet yet? No new API required.

-- 
Anton Khirnov
___
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 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used

2022-02-15 Thread James Almer




On 2/15/2022 8:41 AM, Anton Khirnov wrote:

Quoting James Almer (2022-02-14 23:41:54)

A keyframe could be buffered in the bsf and not be output until more packets
had been fed to it.

Signed-off-by: James Almer 
---
  fftools/ffmpeg.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6aa0986f02..48d9016b4c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2026,7 +2026,8 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
  }
  
  if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&

-!ost->copy_initial_nonkeyframes)
+!ost->copy_initial_nonkeyframes &&
+!(ost->bsf_ctx && ost->bsf_ctx->filter->capabilities & 
AV_BSF_CAP_DELAY))
  return;


Wouldn't it be simpler to add an OutputStream field that tracks whether
we've seen a keyframe packet yet? No new API required.


Probably. It would also only trigger when a keyframe was seen instead of 
unconditionally for all delay flagged bsfs.


I still think this new API is a good addition, either way. Only a 
handful of bsfs buffer packets and require the caller to flush them 
after sending NULL (av1_frame_merge, vp9_superframe, and setts after 
this set) so library users could have all this time never signaled EOF 
and never noticed anything wrong, much like it happened here.
The presence of this flag might help library users know they really need 
to signal EOF.

___
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 275/281] avfilter: convert to new channel layout API

2022-02-15 Thread Anton Khirnov
Quoting James Almer (2022-01-13 03:09:07)
> diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
> index ed3c75311a..96704e041c 100644
> --- a/libavfilter/af_aformat.c
> +++ b/libavfilter/af_aformat.c
> @@ -104,9 +104,36 @@ static av_cold int init(AVFilterContext *ctx)
>ff_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, 
> "sample format");
>  PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format,
>get_sample_rate, 0, "sample rate");
> -PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts,
> -  ff_add_channel_layout, av_get_channel_layout, 0,
> -  "channel layout");
> +{
> +AVChannelLayout fmt = { 0 };
> +const char *cur = s->channel_layouts_str;
> +int ret;
> +
> +if (s->channel_layouts_str && strchr(s->channel_layouts_str, ',')) {
> +av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' 
> to "
> +   "separate channel layout.\n");

It might be unclear to the user what "this syntax" refers to, maybe make
it "Using ',' to separate channel layouts is deprecated"

> diff --git a/libavfilter/af_biquads.c b/libavfilter/af_biquads.c
> index ee42b2a034..2a0747a037 100644
> --- a/libavfilter/af_biquads.c
> +++ b/libavfilter/af_biquads.c
> @@ -125,7 +125,7 @@ typedef struct BiquadsContext {
>  double frequency;
>  double width;
>  double mix;
> -uint64_t channels;
> +AVChannelLayout ch_layout;
>  int normalize;
>  int order;
>  
> @@ -716,11 +716,11 @@ static int config_filter(AVFilterLink *outlink, int 
> reset)
>  s->b2 *= factor;
>  }
>  
> -s->cache = av_realloc_f(s->cache, sizeof(ChanCache), inlink->channels);
> +s->cache = av_realloc_f(s->cache, sizeof(ChanCache), 
> inlink->ch_layout.nb_channels);
>  if (!s->cache)
>  return AVERROR(ENOMEM);
>  if (reset)
> -memset(s->cache, 0, sizeof(ChanCache) * inlink->channels);
> +memset(s->cache, 0, sizeof(ChanCache) * 
> inlink->ch_layout.nb_channels);
>  
>  switch (s->transform_type) {
>  case DI:
> @@ -838,12 +838,14 @@ static int filter_channel(AVFilterContext *ctx, void 
> *arg, int jobnr, int nb_job
>  AVFrame *buf = td->in;
>  AVFrame *out_buf = td->out;
>  BiquadsContext *s = ctx->priv;
> -const int start = (buf->channels * jobnr) / nb_jobs;
> -const int end = (buf->channels * (jobnr+1)) / nb_jobs;
> +const int start = (buf->ch_layout.nb_channels * jobnr) / nb_jobs;
> +const int end = (buf->ch_layout.nb_channels * (jobnr+1)) / nb_jobs;
>  int ch;
>  
>  for (ch = start; ch < end; ch++) {
> -if (!((av_channel_layout_extract_channel(inlink->channel_layout, ch) 
> & s->channels))) {
> +if (!(av_channel_layout_channel_from_index(&inlink->ch_layout, ch) 
> >= 0 &&
> +  av_channel_layout_channel_from_index(&s->ch_layout, ch) >= 0)) 
> {

This doesn't look right. The original code tests whether the channel
with index ch in inlink->channel_layout is present in s->channels.

The new code tests whether the channel with index ch exists in both
inlink->ch_layout and s->ch_layout (the test is also broken, because it
should compare against AV_CHAN_NONE).

Same applies to af_speechnorm

> diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
> index b2030d..2fe36368c1 100644
> --- a/libavfilter/af_headphone.c
> +++ b/libavfilter/af_headphone.c
> @@ -85,13 +85,13 @@ typedef struct HeadphoneContext {
>  uint64_t mapping[64];
>  } HeadphoneContext;
>  
> -static int parse_channel_name(const char *arg, uint64_t *rchannel)
> +static int parse_channel_name(const char *arg, int *rchannel)

enum AVChannel everywhere?

>  {
> -uint64_t layout = av_get_channel_layout(arg);
> +int channel = av_channel_from_string(arg);
>  
> -if (av_get_channel_layout_nb_channels(layout) != 1)
> +if (channel < 0)
>  return AVERROR(EINVAL);
> -*rchannel = layout;
> +*rchannel = channel;
>  return 0;
>  }
>  
> @@ -103,14 +103,14 @@ static void parse_map(AVFilterContext *ctx)
>  
>  p = s->map;
>  while ((arg = av_strtok(p, "|", &tokenizer))) {
> -uint64_t out_channel;
> +int out_channel;
>  
>  p = NULL;
>  if (parse_channel_name(arg, &out_channel)) {
>  av_log(ctx, AV_LOG_WARNING, "Failed to parse \'%s\' as channel 
> name.\n", arg);
>  continue;
>  }
> -if (used_channels & out_channel) {
> +if (used_channels & (1ULL << out_channel)) {

should check that out_channel < 64

> diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
> index ccd85148e9..71d713e4ed 100644
> --- a/libavfilter/af_surround.c
> +++ b/libavfilter/af_surround.c
> @@ -92,8 +92,8 @@ typedef struct AudioSurroundContext {
>  float lowcut;
>  float highcut;
>  
> -uint64_t out_channel_layout;
> -uint64_t in_channel_lay

[FFmpeg-devel] [PATCH] tools: add general_assembly.pl

2022-02-15 Thread J. Dekker
This script generates the current general assembly voters according to
the criteria of '20 code commits in the last 36 months'.

Signed-off-by: J. Dekker 
---

 This was rejected last time but I would really like to get this in the
 tools or at least publicly recorded on mailing list since the script
 was updated.

 tools/general_assembly.pl | 45 +++
 1 file changed, 45 insertions(+)
 create mode 100644 tools/general_assembly.pl

diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl
new file mode 100644
index 00..c3aea14d79
--- /dev/null
+++ b/tools/general_assembly.pl
@@ -0,0 +1,45 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+use POSIX qw(strftime);
+use Encode qw(decode);
+use Data::Dumper;
+
+sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
+
+my @shortlog = split /\n/, decode('UTF-8', `git log --pretty=format:"%aN 
<%aE>" --since="last 36 months" | sort | uniq -c | sort -r`, Encode::FB_CROAK);
+my %assembly = ();
+
+foreach my $line (@shortlog) {
+my ($count, $name, $email) = $line =~ m/^ *(\d+) *(.*?) <(.*?)>/;
+
+if ($count < 20) {
+next;
+}
+
+$name = trim $name;
+
+# assume people with 50 commits have at least 20 source commits
+if ($count < 50) {
+my $true = 0;
+my @commits = split /(^|\n)commit [a-z0-9]{40}(\n|$)/, decode('UTF-8', 
`git log --name-only --use-mailmap --author="$email" --since="last 36 months"`, 
Encode::FB_CROAK);
+foreach my $commit (@commits) {
+if ($commit =~ /\n[\w\/]+\.(c|h|S|asm)/) {
+$true++;
+}
+}
+
+if ($true < 20) {
+next;
+}
+}
+
+$assembly{$name} = $email;
+}
+
+printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git 
rev-parse HEAD`, Encode::FB_CROAK));
+foreach my $email (sort values %assembly) {
+printf("%s\n", $email);
+}
-- 
2.32.0 (Apple Git-132)

___
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 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used

2022-02-15 Thread Anton Khirnov
Quoting James Almer (2022-02-15 12:48:09)
> 
> 
> On 2/15/2022 8:41 AM, Anton Khirnov wrote:
> > Quoting James Almer (2022-02-14 23:41:54)
> >> A keyframe could be buffered in the bsf and not be output until more 
> >> packets
> >> had been fed to it.
> >>
> >> Signed-off-by: James Almer 
> >> ---
> >>   fftools/ffmpeg.c | 3 ++-
> >>   1 file changed, 2 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
> >> index 6aa0986f02..48d9016b4c 100644
> >> --- a/fftools/ffmpeg.c
> >> +++ b/fftools/ffmpeg.c
> >> @@ -2026,7 +2026,8 @@ static void do_streamcopy(InputStream *ist, 
> >> OutputStream *ost, const AVPacket *p
> >>   }
> >>   
> >>   if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
> >> -!ost->copy_initial_nonkeyframes)
> >> +!ost->copy_initial_nonkeyframes &&
> >> +!(ost->bsf_ctx && ost->bsf_ctx->filter->capabilities & 
> >> AV_BSF_CAP_DELAY))
> >>   return;
> > 
> > Wouldn't it be simpler to add an OutputStream field that tracks whether
> > we've seen a keyframe packet yet? No new API required.
> 
> Probably. It would also only trigger when a keyframe was seen instead of 
> unconditionally for all delay flagged bsfs.
> 
> I still think this new API is a good addition, either way. Only a 
> handful of bsfs buffer packets and require the caller to flush them 
> after sending NULL (av1_frame_merge, vp9_superframe, and setts after 
> this set) so library users could have all this time never signaled EOF 
> and never noticed anything wrong, much like it happened here.
> The presence of this flag might help library users know they really need 
> to signal EOF.

I don't see where the advantage would be. The callers still need to have
the flushing code, so might as well always call it.

The disadvantage for us is more complixity and we have to maintain the
list of delay BSFs.

-- 
Anton Khirnov
___
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 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with delay is used

2022-02-15 Thread James Almer

On 2/15/2022 9:03 AM, Anton Khirnov wrote:

Quoting James Almer (2022-02-15 12:48:09)



On 2/15/2022 8:41 AM, Anton Khirnov wrote:

Quoting James Almer (2022-02-14 23:41:54)

A keyframe could be buffered in the bsf and not be output until more packets
had been fed to it.

Signed-off-by: James Almer 
---
   fftools/ffmpeg.c | 3 ++-
   1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6aa0986f02..48d9016b4c 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2026,7 +2026,8 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
   }
   
   if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&

-!ost->copy_initial_nonkeyframes)
+!ost->copy_initial_nonkeyframes &&
+!(ost->bsf_ctx && ost->bsf_ctx->filter->capabilities & 
AV_BSF_CAP_DELAY))
   return;


Wouldn't it be simpler to add an OutputStream field that tracks whether
we've seen a keyframe packet yet? No new API required.


Probably. It would also only trigger when a keyframe was seen instead of
unconditionally for all delay flagged bsfs.

I still think this new API is a good addition, either way. Only a
handful of bsfs buffer packets and require the caller to flush them
after sending NULL (av1_frame_merge, vp9_superframe, and setts after
this set) so library users could have all this time never signaled EOF
and never noticed anything wrong, much like it happened here.
The presence of this flag might help library users know they really need
to signal EOF.


I don't see where the advantage would be. The callers still need to have
the flushing code, so might as well always call it.


Then we probably need to enforce it in the doxy, or at least strongly 
suggest it with a @note or @warning line to ensure you get complete output.
Right now it's optional, mentioned as "If you send a NULL packet, it 
will trigger EOF", meaning not doing so is still a valid scenario, and 
there's nothing letting the user know he's got packets stuck in the bsf 
even after receive_packet() returned EAGAIN if they don't.




The disadvantage for us is more complixity and we have to maintain the
list of delay BSFs.


___
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 275/281] avfilter: convert to new channel layout API

2022-02-15 Thread James Almer

On 2/15/2022 8:50 AM, Anton Khirnov wrote:

Quoting James Almer (2022-01-13 03:09:07)

@@ -212,31 +212,31 @@ static int config_input(AVFilterLink *inlink)
  return AVERROR(ENOMEM);
  for (ch = 0;  ch < s->nb_in_channels; ch++)
  s->input_levels[ch] = s->level_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_FRONT_CENTER);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_FRONT_CENTER);
  if (ch >= 0)
  s->input_levels[ch] *= s->fc_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_FRONT_LEFT);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_FRONT_LEFT);
  if (ch >= 0)
  s->input_levels[ch] *= s->fl_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_FRONT_RIGHT);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_FRONT_RIGHT);
  if (ch >= 0)
  s->input_levels[ch] *= s->fr_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_SIDE_LEFT);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_SIDE_LEFT);
  if (ch >= 0)
  s->input_levels[ch] *= s->sl_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_SIDE_RIGHT);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_SIDE_RIGHT);
  if (ch >= 0)
  s->input_levels[ch] *= s->sr_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_BACK_LEFT);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_BACK_LEFT);
  if (ch >= 0)
  s->input_levels[ch] *= s->bl_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_BACK_RIGHT);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_BACK_RIGHT);
  if (ch >= 0)
  s->input_levels[ch] *= s->br_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_BACK_CENTER);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_BACK_CENTER);
  if (ch >= 0)
  s->input_levels[ch] *= s->bc_in;
-ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
AV_CH_LOW_FREQUENCY);
+ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
AV_CHAN_LOW_FREQUENCY);
  if (ch >= 0)


Make all those compare to AV_CHAN_NONE


ch is an index, so either >= 0, or EINVAL.
___
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 275/281] avfilter: convert to new channel layout API

2022-02-15 Thread Anton Khirnov
Quoting James Almer (2022-02-15 13:27:37)
> On 2/15/2022 8:50 AM, Anton Khirnov wrote:
> > Quoting James Almer (2022-01-13 03:09:07)
> >> @@ -212,31 +212,31 @@ static int config_input(AVFilterLink *inlink)
> >>   return AVERROR(ENOMEM);
> >>   for (ch = 0;  ch < s->nb_in_channels; ch++)
> >>   s->input_levels[ch] = s->level_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_FRONT_CENTER);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_FRONT_CENTER);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->fc_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_FRONT_LEFT);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_FRONT_LEFT);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->fl_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_FRONT_RIGHT);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_FRONT_RIGHT);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->fr_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_SIDE_LEFT);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_SIDE_LEFT);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->sl_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_SIDE_RIGHT);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_SIDE_RIGHT);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->sr_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_BACK_LEFT);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_BACK_LEFT);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->bl_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_BACK_RIGHT);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_BACK_RIGHT);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->br_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_BACK_CENTER);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_BACK_CENTER);
> >>   if (ch >= 0)
> >>   s->input_levels[ch] *= s->bc_in;
> >> -ch = av_get_channel_layout_channel_index(inlink->channel_layout, 
> >> AV_CH_LOW_FREQUENCY);
> >> +ch = av_channel_layout_index_from_channel(&inlink->ch_layout, 
> >> AV_CHAN_LOW_FREQUENCY);
> >>   if (ch >= 0)
> > 
> > Make all those compare to AV_CHAN_NONE
> 
> ch is an index, so either >= 0, or EINVAL.

right, nevermind then

-- 
Anton Khirnov
___
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] avformat/argo_cvg: Fix checksum

2022-02-15 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavformat/argo_cvg.c | 15 +--
 libavformat/version.h  |  2 +-
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c
index c5da32536d..dfdf126c17 100644
--- a/libavformat/argo_cvg.c
+++ b/libavformat/argo_cvg.c
@@ -335,19 +335,14 @@ static int argo_cvg_write_trailer(AVFormatContext *s)
 ArgoCVGMuxContext *ctx = s->priv_data;
 int64_t ret;
 
+ctx->checksum +=  (ctx->size  & 255)
+   + ((ctx->size>> 8) & 255)
+   + ((ctx->size>>16) & 255)
+   +  (ctx->size>>24);
+
 av_log(s, AV_LOG_TRACE, "size = %zu\n", ctx->size);
 av_log(s, AV_LOG_TRACE, "checksum = %u\n",  ctx->checksum);
 
-/*
- * NB: This is wrong. We're always slightly under the original.
- * Verified by remuxing. For reference (orig - remuxed):
- * - TCLD.CVG: 4706074 - 4705696 = 378
- * - DANLOOP1.CVG: 5684641 - 5684212 = 429
- * - CRYS.CVG: 2495499 - 2495367 = 132
- * - PICKUP88.CVG: 1348091 - 1347937 = 154
- * - SELECT1.CVG:   549987 - 549752  = 235
- * Also NB: it doesn't matter, the game doesn't check them.
- */
 avio_wl32(s->pb, ctx->checksum);
 
 if ((ret = avio_seek(s->pb, 0, SEEK_SET)) < 0)
diff --git a/libavformat/version.h b/libavformat/version.h
index 5439dad170..26234573b8 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -33,7 +33,7 @@
 // Also please add any ticket numbers that you believe might be affected here
 #define LIBAVFORMAT_VERSION_MAJOR  59
 #define LIBAVFORMAT_VERSION_MINOR  17
-#define LIBAVFORMAT_VERSION_MICRO 101
+#define LIBAVFORMAT_VERSION_MICRO 102
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
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 4/4] avformat: add Argonaut Games CVG muxer

2022-02-15 Thread Michael Niedermayer
On Tue, Feb 15, 2022 at 10:09:50AM +1000, Zane van Iperen wrote:
> 
> 
> On 15/2/22 05:32, Michael Niedermayer wrote:
> 
> > > +static int argo_cvg_write_trailer(AVFormatContext *s)
> > > +{
> > > +ArgoCVGMuxContext *ctx = s->priv_data;
> > > +int64_t ret;
> > > +
> > > +av_log(s, AV_LOG_TRACE, "size = %zu\n", ctx->size);
> > > +av_log(s, AV_LOG_TRACE, "checksum = %u\n",  ctx->checksum);
> > > +
> > > +/*
> > > + * NB: This is wrong. We're always slightly under the original.
> > > + * Verified by remuxing. For reference (orig - remuxed):
> > 
> > > + * - TCLD.CVG: 4706074 - 4705696 = 378
> > > + * - DANLOOP1.CVG: 5684641 - 5684212 = 429
> > > + * - CRYS.CVG: 2495499 - 2495367 = 132
> > > + * - PICKUP88.CVG: 1348091 - 1347937 = 154
> > > + * - SELECT1.CVG:   549987 - 549752  = 235
> > 
> > Are these files available somewhere ?
> > 
> 
> Yup, here you go: https://0x0.st/o8NK.xz
> 
> That's a .tar.xz, the extension was stripped.

thanks, just posted a patch which fixes the checksum

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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 2/4] avcodec/movtextdec: add () to CMP() macro to avoid unexpected behavior

2022-02-15 Thread Michael Niedermayer
On Mon, Feb 14, 2022 at 08:52:52PM +0100, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/movtextdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
> > index 825632ca9b..dc30fdc698 100644
> > --- a/libavcodec/movtextdec.c
> > +++ b/libavcodec/movtextdec.c
> > @@ -263,7 +263,7 @@ static int decode_hclr(const uint8_t *tsmb, 
> > MovTextContext *m, uint64_t size)
> >  
> >  static int styles_equivalent(const StyleBox *a, const StyleBox *b)
> >  {
> > -#define CMP(field) a->field == b->field
> > +#define CMP(field) ((a)->field == (b)->field)
> >  return CMP(bold)  && CMP(italic)   && CMP(underline) && CMP(color) &&
> > CMP(alpha) && CMP(fontsize) && CMP(font_id);
> >  #undef CMP
> 
> LGTM.
> (Did you find the issues in patches 2-4 by code inspection or by a
> static analyzer?)

some old grep commands

[...]

-- 
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
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] avformat/argo_cvg: Fix checksum

2022-02-15 Thread Zane van Iperen




On 15/2/22 23:05, Michael Niedermayer wrote:

Signed-off-by: Michael Niedermayer 
---
  libavformat/argo_cvg.c | 15 +--
  libavformat/version.h  |  2 +-
  2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c
index c5da32536d..dfdf126c17 100644
--- a/libavformat/argo_cvg.c
+++ b/libavformat/argo_cvg.c
@@ -335,19 +335,14 @@ static int argo_cvg_write_trailer(AVFormatContext *s)
  ArgoCVGMuxContext *ctx = s->priv_data;
  int64_t ret;
  
+ctx->checksum +=  (ctx->size  & 255)

+   + ((ctx->size>> 8) & 255)
+   + ((ctx->size>>16) & 255)
+   +  (ctx->size>>24);
+


...because of course it's that simple. How did I miss that?
No matter, 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 2/4] ffmpeg: ensure a keyframe was not seen before skipping packets

2022-02-15 Thread James Almer
A keyframe could be buffered in the bsf and not be output until more packets
had been fed to it.

Signed-off-by: James Almer 
---
This replaces/supersedes

[PATCH 2/6] avcodec/bsf: add a capabilities field to AVBitStreamFilter
[PATCH 4/6] ffmpeg: don't skip packets before a keyframe was seen if a bsf with 
delay is used

 fftools/ffmpeg.c | 4 +++-
 fftools/ffmpeg.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6aa0986f02..2a56b2f0e7 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -889,6 +889,8 @@ static void output_packet(OutputFile *of, AVPacket *pkt,
 
 /* apply the output bitstream filters */
 if (ost->bsf_ctx) {
+if (pkt && (pkt->flags & AV_PKT_FLAG_KEY))
+ost->seen_kf = 1;
 ret = av_bsf_send_packet(ost->bsf_ctx, eof ? NULL : pkt);
 if (ret < 0)
 goto finish;
@@ -2026,7 +2028,7 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
 }
 
 if ((!ost->frame_number && !(pkt->flags & AV_PKT_FLAG_KEY)) &&
-!ost->copy_initial_nonkeyframes)
+!ost->copy_initial_nonkeyframes && !ost->seen_kf)
 return;
 
 if (!ost->frame_number && !ost->copy_prior_start) {
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index 1b8bbace3f..cc8f767e5d 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -535,6 +535,7 @@ typedef struct OutputStream {
 int inputs_done;
 
 const char *attachment_filename;
+int seen_kf;
 int copy_initial_nonkeyframes;
 int copy_prior_start;
 char *disposition;
-- 
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] tools: add general_assembly.pl

2022-02-15 Thread Jean-Baptiste Kempf
Hello,

On Tue, 15 Feb 2022, at 12:50, J. Dekker wrote:
>  This was rejected last time but I would really like to get this in the
>  tools or at least publicly recorded on mailing list since the script
>  was updated.

Why was this rejected?

> +foreach my $commit (@commits) {
> +if ($commit =~ /\n[\w\/]+\.(c|h|S|asm)/) {
> +$true++;
> +}

Why do we filter on those file types? .md, .pl and other things for docs are 
active in the community.

-- 
Jean-Baptiste Kempf -  President
+33 672 704 734
___
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 02/19] avdevice/decklink_(common_c|dec|enc).h: Fix checkheaders

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavdevice/decklink_common_c.h | 3 +++
 libavdevice/decklink_dec.h  | 2 ++
 libavdevice/decklink_enc.h  | 2 ++
 3 files changed, 7 insertions(+)

diff --git a/libavdevice/decklink_common_c.h b/libavdevice/decklink_common_c.h
index c2577210a6..75896ad32b 100644
--- a/libavdevice/decklink_common_c.h
+++ b/libavdevice/decklink_common_c.h
@@ -23,8 +23,11 @@
 #ifndef AVDEVICE_DECKLINK_COMMON_C_H
 #define AVDEVICE_DECKLINK_COMMON_C_H
 
+#include 
 #include 
 
+#include "libavutil/log.h"
+
 typedef enum DecklinkPtsSource {
 PTS_SRC_AUDIO = 1,
 PTS_SRC_VIDEO = 2,
diff --git a/libavdevice/decklink_dec.h b/libavdevice/decklink_dec.h
index fbfbe6280e..19757be45c 100644
--- a/libavdevice/decklink_dec.h
+++ b/libavdevice/decklink_dec.h
@@ -26,6 +26,8 @@
 extern "C" {
 #endif
 
+#include "libavformat/avformat.h"
+
 int ff_decklink_read_header(AVFormatContext *avctx);
 int ff_decklink_read_packet(AVFormatContext *avctx, AVPacket *pkt);
 int ff_decklink_read_close(AVFormatContext *avctx);
diff --git a/libavdevice/decklink_enc.h b/libavdevice/decklink_enc.h
index 39237673b4..5798f19dfd 100644
--- a/libavdevice/decklink_enc.h
+++ b/libavdevice/decklink_enc.h
@@ -26,6 +26,8 @@
 extern "C" {
 #endif
 
+#include "libavformat/avformat.h"
+
 int ff_decklink_write_header(AVFormatContext *avctx);
 int ff_decklink_write_packet(AVFormatContext *avctx, AVPacket *pkt);
 int ff_decklink_write_trailer(AVFormatContext *avctx);
-- 
2.32.0

___
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 03/19] avcodec/cabac_functions: Add missing headers

2022-02-15 Thread Andreas Rheinhardt
Fixes make checkheaders on PPC, for which no arch-specific header
exists that indirectly includes attributes.h.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/cabac_functions.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/cabac_functions.h b/libavcodec/cabac_functions.h
index 2f2d48a8f8..c3f08d3410 100644
--- a/libavcodec/cabac_functions.h
+++ b/libavcodec/cabac_functions.h
@@ -30,6 +30,8 @@
 #include 
 #include 
 
+#include "libavutil/attributes.h"
+#include "libavutil/intmath.h"
 #include "cabac.h"
 #include "config.h"
 
-- 
2.32.0

___
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 04/19] avcodec/aarch64/idct: Add missing stddef

2022-02-15 Thread Andreas Rheinhardt
Fixes checkheaders on aarch64.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/aarch64/idct.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/aarch64/idct.h b/libavcodec/aarch64/idct.h
index 5c49046148..97ee0a64af 100644
--- a/libavcodec/aarch64/idct.h
+++ b/libavcodec/aarch64/idct.h
@@ -19,6 +19,7 @@
 #ifndef AVCODEC_AARCH64_IDCT_H
 #define AVCODEC_AARCH64_IDCT_H
 
+#include 
 #include 
 
 void ff_simple_idct_neon(int16_t *data);
-- 
2.32.0

___
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 05/19] avcodec/mips: Fix checkheaders

2022-02-15 Thread Andreas Rheinhardt
mips has several headers that are only meant for inclusion in another
non-arch specific file; they do not even try to be standalone. So don't
test them in checkheaders.

Also fix vp9dsp_mips.h, an ordinary header missing some includes.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/mips/Makefile  | 4 
 libavcodec/mips/lsp_mips.h| 2 ++
 libavcodec/mips/vp9dsp_mips.h | 3 +++
 3 files changed, 9 insertions(+)

diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile
index 81a73a4d0e..05ed63bf3e 100644
--- a/libavcodec/mips/Makefile
+++ b/libavcodec/mips/Makefile
@@ -1,3 +1,7 @@
+ARCH_HEADERS   = aacsbr_mips.h aacpsy_mips.h   \
+ cabac.h compute_antialias_fixed.h 
\
+ compute_antialias_float.h \
+
 MIPSFPU-OBJS-$(CONFIG_AMRNB_DECODER)  += mips/acelp_filters_mips.o \
  mips/celp_filters_mips.o  \
  mips/celp_math_mips.o \
diff --git a/libavcodec/mips/lsp_mips.h b/libavcodec/mips/lsp_mips.h
index 23b2b6bfda..c69f8b770c 100644
--- a/libavcodec/mips/lsp_mips.h
+++ b/libavcodec/mips/lsp_mips.h
@@ -54,6 +54,8 @@
 #ifndef AVCODEC_MIPS_LSP_MIPS_H
 #define AVCODEC_MIPS_LSP_MIPS_H
 
+#include "config.h"
+
 #if HAVE_MIPSFPU && HAVE_INLINE_ASM
 #if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
 #include "libavutil/attributes.h"
diff --git a/libavcodec/mips/vp9dsp_mips.h b/libavcodec/mips/vp9dsp_mips.h
index 0b6ce7cd7d..021ae9e59d 100644
--- a/libavcodec/mips/vp9dsp_mips.h
+++ b/libavcodec/mips/vp9dsp_mips.h
@@ -21,6 +21,9 @@
 #ifndef AVCODEC_MIPS_VP9DSP_MIPS_H
 #define AVCODEC_MIPS_VP9DSP_MIPS_H
 
+#include 
+#include 
+
 #define VP9_8TAP_MIPS_MSA_FUNC(SIZE, type, type_idx) \
 void ff_put_8tap_##type##_##SIZE##h_msa(uint8_t *dst, ptrdiff_t dststride,   \
 const uint8_t *src,  \
-- 
2.32.0

___
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 06/19] avformat/avio: Don't include common.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavformat/avio.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/avio.h b/libavformat/avio.h
index cd63322a62..ca970b1ce3 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -27,8 +27,9 @@
  */
 
 #include 
+#include 
 
-#include "libavutil/common.h"
+#include "libavutil/attributes.h"
 #include "libavutil/dict.h"
 #include "libavutil/log.h"
 
-- 
2.32.0

___
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 07/19] avutil/log: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
It has been included since af5f434f8c0fb3b4ee3b206ebc1946ca660a8abe
for deprecation reasons, but removing it has been forgotten after
it had served is purpose. So remove it.

For convenience, include version.h instead as LIBAVUTIL_VERSION_INT
is supposed to be used when creating AVClasses.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/ffjni.c | 1 +
 libavcodec/libopenh264.c   | 1 +
 libavformat/avc.h  | 1 +
 libavformat/data_uri.c | 1 +
 libavformat/ip.c   | 2 ++
 libavutil/cuda_check.h | 1 +
 libavutil/log.h| 2 +-
 libavutil/tests/camellia.c | 4 
 libavutil/tests/cast5.c| 4 
 libavutil/tests/twofish.c  | 2 ++
 libavutil/thread.h | 4 
 libavutil/timecode.c   | 1 +
 libavutil/timer.h  | 1 +
 tools/ffescape.c   | 6 ++
 14 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/libavcodec/ffjni.c b/libavcodec/ffjni.c
index f5b581f0f6..154be9ae99 100644
--- a/libavcodec/ffjni.c
+++ b/libavcodec/ffjni.c
@@ -26,6 +26,7 @@
 
 #include "libavutil/bprint.h"
 #include "libavutil/log.h"
+#include "libavutil/mem.h"
 
 #include "config.h"
 #include "jni.h"
diff --git a/libavcodec/libopenh264.c b/libavcodec/libopenh264.c
index 59c61a3a4c..0f6d28ed88 100644
--- a/libavcodec/libopenh264.c
+++ b/libavcodec/libopenh264.c
@@ -23,6 +23,7 @@
 #include 
 #include 
 
+#include "libavutil/error.h"
 #include "libavutil/log.h"
 
 #include "libopenh264.h"
diff --git a/libavformat/avc.h b/libavformat/avc.h
index aced285c7a..0ce95c194e 100644
--- a/libavformat/avc.h
+++ b/libavformat/avc.h
@@ -23,6 +23,7 @@
 #define AVFORMAT_AVC_H
 
 #include 
+#include "libavutil/rational.h"
 #include "avio.h"
 
 typedef struct NALU {
diff --git a/libavformat/data_uri.c b/libavformat/data_uri.c
index 1863830abe..28eb2b9e08 100644
--- a/libavformat/data_uri.c
+++ b/libavformat/data_uri.c
@@ -20,6 +20,7 @@
 
 #include 
 #include "libavutil/avstring.h"
+#include "libavutil/avutil.h"
 #include "libavutil/base64.h"
 #include "url.h"
 
diff --git a/libavformat/ip.c b/libavformat/ip.c
index 70c5529b72..b2c7ef07e5 100644
--- a/libavformat/ip.c
+++ b/libavformat/ip.c
@@ -18,8 +18,10 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
 #include "ip.h"
 #include "libavutil/avstring.h"
+#include "libavutil/mem.h"
 
 static int compare_addr(const struct sockaddr_storage *a,
 const struct sockaddr_storage *b)
diff --git a/libavutil/cuda_check.h b/libavutil/cuda_check.h
index 3aea085c07..f5a9234eaf 100644
--- a/libavutil/cuda_check.h
+++ b/libavutil/cuda_check.h
@@ -21,6 +21,7 @@
 #define AVUTIL_CUDA_CHECK_H
 
 #include "compat/cuda/dynlink_loader.h"
+#include "error.h"
 
 typedef CUresult CUDAAPI cuda_check_GetErrorName(CUresult error, const char** 
pstr);
 typedef CUresult CUDAAPI cuda_check_GetErrorString(CUresult error, const 
char** pstr);
diff --git a/libavutil/log.h b/libavutil/log.h
index 99625af538..ab7ceabe22 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -22,8 +22,8 @@
 #define AVUTIL_LOG_H
 
 #include 
-#include "avutil.h"
 #include "attributes.h"
+#include "version.h"
 
 typedef enum {
 AV_CLASS_CATEGORY_NA = 0,
diff --git a/libavutil/tests/camellia.c b/libavutil/tests/camellia.c
index 1716b59a38..9fdd6cd7e8 100644
--- a/libavutil/tests/camellia.c
+++ b/libavutil/tests/camellia.c
@@ -19,8 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
+#include 
+
 #include "libavutil/camellia.h"
 #include "libavutil/log.h"
+#include "libavutil/mem.h"
 
 int main(int argc, char *argv[])
 {
diff --git a/libavutil/tests/cast5.c b/libavutil/tests/cast5.c
index ce3aa80b5b..1ba3075e73 100644
--- a/libavutil/tests/cast5.c
+++ b/libavutil/tests/cast5.c
@@ -19,8 +19,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
+#include 
+
 #include "libavutil/cast5.h"
 #include "libavutil/log.h"
+#include "libavutil/mem.h"
 
 int main(int argc, char** argv)
 {
diff --git a/libavutil/tests/twofish.c b/libavutil/tests/twofish.c
index 7e8b129230..a4ccbfd379 100644
--- a/libavutil/tests/twofish.c
+++ b/libavutil/tests/twofish.c
@@ -20,10 +20,12 @@
  */
 
 #include "libavutil/log.h"
+#include "libavutil/mem.h"
 #include "libavutil/twofish.h"
 
 #include 
 #include 
+#include 
 
 int main(int argc, char *argv[])
 {
diff --git a/libavutil/thread.h b/libavutil/thread.h
index be5c4b1340..7106fd0d47 100644
--- a/libavutil/thread.h
+++ b/libavutil/thread.h
@@ -31,7 +31,11 @@
 
 #if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1
 
+#include 
+
+#include "error.h"
 #include "log.h"
+#include "macros.h"
 
 #define ASSERT_PTHREAD_ABORT(func, ret) do {\
 char errbuf[AV_ERROR_MAX_STRING_SIZE] = ""; \
diff --git a/libavutil/timecode.c b/libavutil/timecode.c
index 2fc3295e25..a37d725fc7 100644
--- a/libavutil/timecode.c
+++ b/libavutil/timecode.c
@@ -27,6 +27,7 @@
  */
 
 #i

[FFmpeg-devel] [PATCH 08/19] avutil/audio_fifo: Avoid avutil.h inclusion

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/audio_fifo.c | 7 +--
 libavutil/audio_fifo.h | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavutil/audio_fifo.c b/libavutil/audio_fifo.c
index b1355e55a0..f4103178ba 100644
--- a/libavutil/audio_fifo.c
+++ b/libavutil/audio_fifo.c
@@ -24,10 +24,13 @@
  * Audio FIFO
  */
 
-#include "avutil.h"
+#include 
+#include 
+
 #include "audio_fifo.h"
-#include "common.h"
+#include "error.h"
 #include "fifo.h"
+#include "macros.h"
 #include "mem.h"
 #include "samplefmt.h"
 
diff --git a/libavutil/audio_fifo.h b/libavutil/audio_fifo.h
index 9d570b04c0..d1e4c856dc 100644
--- a/libavutil/audio_fifo.h
+++ b/libavutil/audio_fifo.h
@@ -27,7 +27,7 @@
 #ifndef AVUTIL_AUDIO_FIFO_H
 #define AVUTIL_AUDIO_FIFO_H
 
-#include "avutil.h"
+#include "attributes.h"
 #include "samplefmt.h"
 
 /**
-- 
2.32.0

___
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 12/19] avutil/imgutils: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
It is a remnant of an FF_API_* inclusion (back from when they were in
avutil.h and not in version.h).

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/imgutils.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h
index cb2d74728e..be53335568 100644
--- a/libavutil/imgutils.h
+++ b/libavutil/imgutils.h
@@ -27,8 +27,10 @@
  * @{
  */
 
-#include "avutil.h"
+#include 
+#include 
 #include "pixdesc.h"
+#include "pixfmt.h"
 #include "rational.h"
 
 /**
-- 
2.32.0

___
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 09/19] avutil/fifo: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/fifo.c  | 5 -
 libavutil/fifo.h  | 4 +++-
 libavutil/threadmessage.c | 2 ++
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/libavutil/fifo.c b/libavutil/fifo.c
index 09c984143f..51a5af6f39 100644
--- a/libavutil/fifo.c
+++ b/libavutil/fifo.c
@@ -21,10 +21,13 @@
  */
 
 #include 
+#include 
 
 #include "avassert.h"
-#include "common.h"
+#include "error.h"
 #include "fifo.h"
+#include "macros.h"
+#include "mem.h"
 
 // by default the FIFO can be auto-grown to 1MB
 #define AUTO_GROW_DEFAULT_BYTES (1024 * 1024)
diff --git a/libavutil/fifo.h b/libavutil/fifo.h
index 4eb2ce42f8..4eed364afc 100644
--- a/libavutil/fifo.h
+++ b/libavutil/fifo.h
@@ -24,9 +24,11 @@
 #ifndef AVUTIL_FIFO_H
 #define AVUTIL_FIFO_H
 
+#include 
 #include 
-#include "avutil.h"
+
 #include "attributes.h"
+#include "version.h"
 
 typedef struct AVFifo AVFifo;
 
diff --git a/libavutil/threadmessage.c b/libavutil/threadmessage.c
index 6f25da76d7..f0e23f28fc 100644
--- a/libavutil/threadmessage.c
+++ b/libavutil/threadmessage.c
@@ -18,7 +18,9 @@
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
 #include "fifo.h"
+#include "mem.h"
 #include "threadmessage.h"
 #include "thread.h"
 
-- 
2.32.0

___
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 10/19] avutil/file: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/file.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/file.h b/libavutil/file.h
index 3ef4a6022c..8ec210e783 100644
--- a/libavutil/file.h
+++ b/libavutil/file.h
@@ -19,9 +19,10 @@
 #ifndef AVUTIL_FILE_H
 #define AVUTIL_FILE_H
 
+#include 
 #include 
 
-#include "avutil.h"
+#include "attributes.h"
 
 /**
  * @file
-- 
2.32.0

___
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 11/19] avutil/eval: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
It has been added for an FF_API_* at a time when these were in avutil.h.

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/eval.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavutil/eval.h b/libavutil/eval.h
index 068c62cdab..57afc2d562 100644
--- a/libavutil/eval.h
+++ b/libavutil/eval.h
@@ -26,8 +26,6 @@
 #ifndef AVUTIL_EVAL_H
 #define AVUTIL_EVAL_H
 
-#include "avutil.h"
-
 typedef struct AVExpr AVExpr;
 
 /**
-- 
2.32.0

___
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 13/19] avutil/samplefmt: Don't include attributes.h, avutil.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/samplefmt.c | 6 --
 libavutil/samplefmt.h | 3 ---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavutil/samplefmt.c b/libavutil/samplefmt.c
index c7428940e1..6d3ec34dab 100644
--- a/libavutil/samplefmt.c
+++ b/libavutil/samplefmt.c
@@ -16,11 +16,13 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "common.h"
+#include "error.h"
+#include "macros.h"
+#include "mem.h"
 #include "samplefmt.h"
 
+#include 
 #include 
-#include 
 #include 
 
 typedef struct SampleFmtInfo {
diff --git a/libavutil/samplefmt.h b/libavutil/samplefmt.h
index f270199195..1999c9bca6 100644
--- a/libavutil/samplefmt.h
+++ b/libavutil/samplefmt.h
@@ -21,9 +21,6 @@
 
 #include 
 
-#include "avutil.h"
-#include "attributes.h"
-
 /**
  * @addtogroup lavu_audio
  * @{
-- 
2.32.0

___
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 14/19] avutil/pixelutils: Don't include common.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/pixelutils.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavutil/pixelutils.h b/libavutil/pixelutils.h
index a8dbc157e1..7a997cde1c 100644
--- a/libavutil/pixelutils.h
+++ b/libavutil/pixelutils.h
@@ -21,7 +21,6 @@
 
 #include 
 #include 
-#include "common.h"
 
 /**
  * Sum of abs(src1[x] - src2[x])
-- 
2.32.0

___
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 15/19] avutil/integer: Don't include common.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/integer.c | 4 +++-
 libavutil/integer.h | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/integer.c b/libavutil/integer.c
index 78e252fbde..b709c6d487 100644
--- a/libavutil/integer.c
+++ b/libavutil/integer.c
@@ -25,9 +25,11 @@
  * @author Michael Niedermayer 
  */
 
-#include "common.h"
+#include 
+
 #include "integer.h"
 #include "avassert.h"
+#include "intmath.h"
 
 static const AVInteger zero_i;
 
diff --git a/libavutil/integer.h b/libavutil/integer.h
index 45f733c04c..2d9b5bb10f 100644
--- a/libavutil/integer.h
+++ b/libavutil/integer.h
@@ -29,7 +29,7 @@
 #define AVUTIL_INTEGER_H
 
 #include 
-#include "common.h"
+#include "attributes.h"
 
 #define AV_INTEGER_SIZE 8
 
-- 
2.32.0

___
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 16/19] avutil/display: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavutil/display.c   | 1 +
 libavutil/display.h   | 1 -
 libavutil/tests/display.c | 1 +
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/display.c b/libavutil/display.c
index a0076e067b..d31061283c 100644
--- a/libavutil/display.c
+++ b/libavutil/display.c
@@ -23,6 +23,7 @@
 #include 
 
 #include "display.h"
+#include "libm.h"
 #include "mathematics.h"
 
 // fixed point to double
diff --git a/libavutil/display.h b/libavutil/display.h
index d87bf68425..31d8bef361 100644
--- a/libavutil/display.h
+++ b/libavutil/display.h
@@ -27,7 +27,6 @@
 #define AVUTIL_DISPLAY_H
 
 #include 
-#include "common.h"
 
 /**
  * @addtogroup lavu_video
diff --git a/libavutil/tests/display.c b/libavutil/tests/display.c
index 893ebb5543..19b07fc15f 100644
--- a/libavutil/tests/display.c
+++ b/libavutil/tests/display.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
 #include "libavutil/display.c"
 
 static void print_matrix(int32_t matrix[9])
-- 
2.32.0

___
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 17/19] Remove obsolete version.h inclusions

2022-02-15 Thread Andreas Rheinhardt
Forgotten in e7bd47e657bbf9e1ce9915e93bc80cb1a29fb7f3.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/vc2enc.c| 2 +-
 libavcodec/x86/blockdsp_init.c | 2 --
 libavfilter/internal.h | 1 -
 libavfilter/vf_swapuv.c| 1 -
 libavformat/url.h  | 1 -
 libavutil/common.h | 1 -
 libavutil/internal.h   | 1 -
 libswscale/swscale_internal.h  | 1 -
 8 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index ccca78d281..bfa43b3c03 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -21,11 +21,11 @@
 
 #include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
+#include "libavutil/version.h"
 #include "dirac.h"
 #include "encode.h"
 #include "put_bits.h"
 #include "internal.h"
-#include "version.h"
 
 #include "vc2enc_dwt.h"
 #include "diractab.h"
diff --git a/libavcodec/x86/blockdsp_init.c b/libavcodec/x86/blockdsp_init.c
index be3eef0021..d7f8a8e508 100644
--- a/libavcodec/x86/blockdsp_init.c
+++ b/libavcodec/x86/blockdsp_init.c
@@ -20,11 +20,9 @@
 
 #include "config.h"
 #include "libavutil/attributes.h"
-#include "libavutil/internal.h"
 #include "libavutil/cpu.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/blockdsp.h"
-#include "libavcodec/version.h"
 
 void ff_clear_block_mmx(int16_t *block);
 void ff_clear_block_sse(int16_t *block);
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 1099b82b4b..53883101a8 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -28,7 +28,6 @@
 #include "avfilter.h"
 #include "formats.h"
 #include "framequeue.h"
-#include "version.h"
 #include "video.h"
 
 typedef struct AVFilterCommand {
diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c
index 27d083f026..4452028262 100644
--- a/libavfilter/vf_swapuv.c
+++ b/libavfilter/vf_swapuv.c
@@ -25,7 +25,6 @@
 
 #include "libavutil/opt.h"
 #include "libavutil/pixdesc.h"
-#include "libavutil/version.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "internal.h"
diff --git a/libavformat/url.h b/libavformat/url.h
index a129150d76..3cfe3ecc5c 100644
--- a/libavformat/url.h
+++ b/libavformat/url.h
@@ -25,7 +25,6 @@
 #define AVFORMAT_URL_H
 
 #include "avio.h"
-#include "libavformat/version.h"
 
 #include "libavutil/dict.h"
 #include "libavutil/log.h"
diff --git a/libavutil/common.h b/libavutil/common.h
index 3eb9bc5f74..fd1404be6c 100644
--- a/libavutil/common.h
+++ b/libavutil/common.h
@@ -41,7 +41,6 @@
 
 #include "attributes.h"
 #include "macros.h"
-#include "version.h"
 
 //rounded division & shift
 #define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + 
((1<<(b))>>1)-1)>>(b))
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 0a7f1c6257..79c2130be0 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -43,7 +43,6 @@
 #include "dict.h"
 #include "macros.h"
 #include "pixfmt.h"
-#include "version.h"
 
 #if ARCH_X86
 #   include "x86/emms.h"
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 3a78d95ba6..2be23458a1 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -24,7 +24,6 @@
 #include 
 
 #include "config.h"
-#include "version.h"
 
 #include "libavutil/avassert.h"
 #include "libavutil/avutil.h"
-- 
2.32.0

___
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 18/19] avutil/avassert: Don't include avutil.h

2022-02-15 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/dct.c  | 2 ++
 libavcodec/mpegaudiodec_common.c  | 1 +
 libavcodec/mqcenc.c   | 2 ++
 libavcodec/put_bits.h | 1 +
 libavcodec/rdft.c | 1 +
 libavcodec/tests/fft.c| 1 +
 libavcodec/x86/mdct15_init.c  | 2 ++
 libavfilter/colorspacedsp.c   | 1 +
 libavfilter/window_func.h | 1 +
 libavutil/avassert.h  | 2 +-
 libavutil/mathematics.c   | 1 +
 libavutil/slicethread.c   | 1 +
 libavutil/tests/aes_ctr.c | 2 ++
 libavutil/tests/encryption_info.c | 1 +
 14 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index 52f082d062..7581b3241f 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -30,7 +30,9 @@
 #include 
 #include 
 
+#include "libavutil/error.h"
 #include "libavutil/mathematics.h"
+#include "libavutil/mem.h"
 #include "dct.h"
 #include "dct32.h"
 
diff --git a/libavcodec/mpegaudiodec_common.c b/libavcodec/mpegaudiodec_common.c
index a963f6683a..ed2de8adbb 100644
--- a/libavcodec/mpegaudiodec_common.c
+++ b/libavcodec/mpegaudiodec_common.c
@@ -28,6 +28,7 @@
 #include 
 
 #include "libavutil/avassert.h"
+#include "libavutil/libm.h"
 #include "libavutil/thread.h"
 
 #include "mpegaudiodata.h"
diff --git a/libavcodec/mqcenc.c b/libavcodec/mqcenc.c
index 6d0368f827..a8c35c8db3 100644
--- a/libavcodec/mqcenc.c
+++ b/libavcodec/mqcenc.c
@@ -25,6 +25,8 @@
  * @author Kamil Nowosad
  */
 
+#include 
+
 #include "libavutil/avassert.h"
 #include "mqc.h"
 
diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h
index 689c6b282e..4b4f977ad5 100644
--- a/libavcodec/put_bits.h
+++ b/libavcodec/put_bits.h
@@ -32,6 +32,7 @@
 #include "config.h"
 #include "libavutil/intreadwrite.h"
 #include "libavutil/avassert.h"
+#include "libavutil/common.h"
 
 #if ARCH_X86_64
 // TODO: Benchmark and optionally enable on other 64-bit architectures.
diff --git a/libavcodec/rdft.c b/libavcodec/rdft.c
index 6ba7484238..8228eb247b 100644
--- a/libavcodec/rdft.c
+++ b/libavcodec/rdft.c
@@ -20,6 +20,7 @@
  */
 #include 
 #include 
+#include "libavutil/error.h"
 #include "libavutil/mathematics.h"
 #include "rdft.h"
 
diff --git a/libavcodec/tests/fft.c b/libavcodec/tests/fft.c
index 9a5e5bd1c0..cc951b0dd4 100644
--- a/libavcodec/tests/fft.c
+++ b/libavcodec/tests/fft.c
@@ -38,6 +38,7 @@
 #include 
 
 #include "libavutil/cpu.h"
+#include "libavutil/error.h"
 #include "libavutil/lfg.h"
 #include "libavutil/log.h"
 #include "libavutil/mathematics.h"
diff --git a/libavcodec/x86/mdct15_init.c b/libavcodec/x86/mdct15_init.c
index 641bfd043f..31ce19d31c 100644
--- a/libavcodec/x86/mdct15_init.c
+++ b/libavcodec/x86/mdct15_init.c
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
+
 #include "config.h"
 
 #include "libavutil/attributes.h"
diff --git a/libavfilter/colorspacedsp.c b/libavfilter/colorspacedsp.c
index b8ba5c06e4..65ea74c584 100644
--- a/libavfilter/colorspacedsp.c
+++ b/libavfilter/colorspacedsp.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/common.h"
 #include "colorspacedsp.h"
 
 /*
diff --git a/libavfilter/window_func.h b/libavfilter/window_func.h
index b7c8c00270..bff1fa6041 100644
--- a/libavfilter/window_func.h
+++ b/libavfilter/window_func.h
@@ -24,6 +24,7 @@
 
 #include 
 #include "libavutil/avassert.h"
+#include "libavutil/common.h"
 
 enum WindowFunc { WFUNC_RECT, WFUNC_HANNING, WFUNC_HAMMING, WFUNC_BLACKMAN,
   WFUNC_BARTLETT, WFUNC_WELCH, WFUNC_FLATTOP,
diff --git a/libavutil/avassert.h b/libavutil/avassert.h
index 9abeadea4a..51e462bbae 100644
--- a/libavutil/avassert.h
+++ b/libavutil/avassert.h
@@ -28,8 +28,8 @@
 #define AVUTIL_AVASSERT_H
 
 #include 
-#include "avutil.h"
 #include "log.h"
+#include "macros.h"
 
 /**
  * assert() equivalent, that is always enabled.
diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index f4e541fa24..b878317d63 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -26,6 +26,7 @@
 #include 
 #include 
 
+#include "avutil.h"
 #include "mathematics.h"
 #include "libavutil/intmath.h"
 #include "libavutil/common.h"
diff --git a/libavutil/slicethread.c b/libavutil/slicethread.c
index 867ce32238..ea1c9c8311 100644
--- a/libavutil/slicethread.c
+++ b/libavutil/slicethread.c
@@ -18,6 +18,7 @@
 
 #include 
 #include "cpu.h"
+#include "internal.h"
 #include "slicethread.h"
 #include "mem.h"
 #include "thread.h"
diff --git a/libavutil/tests/aes_ctr.c b/libavutil/tests/aes_ctr.c
index 9dbf0af8aa..486dae3348 100644
--- a/libavutil/tests/aes_ctr.c
+++ b/libavutil/tests/aes_ctr.c
@@ -16,6 +16,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include 
+
 #include "libavutil/log.h"
 #include "libavutil/mem_internal.h"
 #include "libavutil/aes_ctr.h"
di

[FFmpeg-devel] [PATCH 19/19] Remove unnecessary libavutil/(avutil|common|internal).h inclusions

2022-02-15 Thread Andreas Rheinhardt
Some of these were made possible by moving several common macros to
libavutil/macros.h.

While just at it, also improve the other headers a bit.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/ac3.c  |  3 ++-
 libavcodec/ac3.h  |  1 +
 libavcodec/ass_split.c|  8 +++-
 libavcodec/av1_parse.h|  2 +-
 libavcodec/bitstream.c|  2 +-
 libavcodec/cabac.c|  5 +
 libavcodec/celp_math.c|  7 +++
 libavcodec/codec_desc.c   |  3 ++-
 libavcodec/dca_exss.h |  2 +-
 libavcodec/dcadct.c   |  2 +-
 libavcodec/dcadct.h   |  3 ++-
 libavcodec/dcadec.h   |  4 +++-
 libavcodec/dcahuff.c  |  2 +-
 libavcodec/dirac_vlc.h|  2 +-
 libavcodec/dnxhddata.c|  4 +++-
 libavcodec/dnxhddata.h|  3 ++-
 libavcodec/dv_profile.c   |  3 ++-
 libavcodec/elsdec.c   |  7 +--
 libavcodec/exrdsp.h   |  2 +-
 libavcodec/flacdsp.c  |  1 +
 libavcodec/flacdsp.h  |  2 +-
 libavcodec/flacdsp_lpc_template.c |  2 +-
 libavcodec/flacdsp_template.c |  2 +-
 libavcodec/fmtconvert.c   |  3 ++-
 libavcodec/golomb.c   |  2 +-
 libavcodec/h264_levels.c  |  2 +-
 libavcodec/h264_redundant_pps_bsf.c   |  7 ---
 libavcodec/h264_sei.c |  2 +-
 libavcodec/huffman.c  |  5 -
 libavcodec/jfdctfst.c |  5 ++---
 libavcodec/jpeg2000dwt.c  |  3 ++-
 libavcodec/jrevdct.c  |  4 +++-
 libavcodec/lagarithrac.h  |  1 -
 libavcodec/libopus.c  |  1 -
 libavcodec/lsp.c  |  4 ++--
 libavcodec/lzwenc.c   |  2 +-
 libavcodec/mdct15.c   |  3 ++-
 libavcodec/mips/mpegaudiodsp_mips_fixed.c |  1 +
 libavcodec/mips/mpegaudiodsp_mips_float.c |  1 +
 libavcodec/mjpegenc_huffman.c |  3 ---
 libavcodec/mpegaudiodecheader.c   |  2 +-
 libavcodec/mpegaudiodsp.h |  2 +-
 libavcodec/msmpeg4data.h  |  2 +-
 libavcodec/opusdsp.c  |  2 ++
 libavcodec/opusdsp.h  |  2 --
 libavcodec/pngdsp.c   |  2 +-
 libavcodec/ra288.h|  2 +-
 libavcodec/rangecoder.h   |  2 +-
 libavcodec/raw.c  |  2 +-
 libavcodec/rle.c  |  2 +-
 libavcodec/scpr3.h|  7 +--
 libavcodec/tests/cabac.c  |  2 +-
 libavcodec/tests/jpeg2000dwt.c|  5 +
 libavcodec/tests/rangecoder.c |  1 +
 libavcodec/trace_headers_bsf.c|  4 ++--
 libavcodec/videodsp.c |  3 ++-
 libavcodec/vp56data.h |  2 +-
 libavcodec/vp56rac.c  |  4 +++-
 libavcodec/vp9dsp.c   |  4 +++-
 libavcodec/wavpack.h  |  5 -
 libavcodec/wavpackenc.h   |  2 ++
 libavcodec/x86/fdct.c |  3 ++-
 libavcodec/x86/mpegaudiodsp.c |  4 +++-
 libavcodec/x86/pngdsp_init.c  |  3 ++-
 libavcodec/xiph.c |  2 ++
 libavcodec/xiph.h |  2 +-
 libavdevice/timefilter.c  |  6 +-
 libavfilter/af_afir.h | 13 ++---
 libavfilter/af_volume.h   |  4 ++--
 libavfilter/avfiltergraph.c   |  2 --
 libavfilter/colorspace.h  |  2 +-
 libavfilter/ebur128.c |  3 ++-
 libavfilter/motion_estimation.c   |  1 +
 libavfilter/motion_estimation.h   |  2 +-
 libavfilter/pthread.c |  6 +++---
 libavformat/argo_asf.h|  2 +-
 libavformat/asfcrypt.c|  3 ++-
 libavformat/avlanguage.c  |  3 +--
 libavformat/hlsplaylist.h |  1 -
 libavformat/matroska.h|  2 +-
 libavformat/network.c |  1 -
 libavformat/riff.c|  3 ++-
 libavformat/tee_common.c  |  5 +++--
 libavformat/webmdashenc.c |  2 ++
 libavformat/wv.c  |  3 ++-
 libavutil/adler32.c   |  2 +-
 libavutil/aes.c   |  8 ++--
 libavutil/aes_ctr.c   |  5 -
 libavutil/avsscanf.c  |  8 +---
 libavutil/avstring.c  |  5 -
 libavutil/base64.c|  6 --
 libavutil/blowfish.c  |  5 +++--
 libavuti

Re: [FFmpeg-devel] [PATCH 275/281] avfilter: convert to new channel layout API

2022-02-15 Thread James Almer




On 2/15/2022 8:50 AM, Anton Khirnov wrote:

Quoting James Almer (2022-01-13 03:09:07)

diff --git a/libavfilter/af_aformat.c b/libavfilter/af_aformat.c
index ed3c75311a..96704e041c 100644
--- a/libavfilter/af_aformat.c
+++ b/libavfilter/af_aformat.c
@@ -104,9 +104,36 @@ static av_cold int init(AVFilterContext *ctx)
ff_add_format, av_get_sample_fmt, AV_SAMPLE_FMT_NONE, "sample 
format");
  PARSE_FORMATS(s->sample_rates_str, int, s->sample_rates, ff_add_format,
get_sample_rate, 0, "sample rate");
-PARSE_FORMATS(s->channel_layouts_str, uint64_t, s->channel_layouts,
-  ff_add_channel_layout, av_get_channel_layout, 0,
-  "channel layout");
+{
+AVChannelLayout fmt = { 0 };
+const char *cur = s->channel_layouts_str;
+int ret;
+
+if (s->channel_layouts_str && strchr(s->channel_layouts_str, ',')) {
+av_log(ctx, AV_LOG_WARNING, "This syntax is deprecated, use '|' to 
"
+   "separate channel layout.\n");

It might be unclear to the user what "this syntax" refers to, maybe make
it "Using ',' to separate channel layouts is deprecated"


This is copy-paste from the PARSE_FORMATS() macro. I'd rather leave 
changing it to a separate commit, and do it for sample rate and sample 
format too.

___
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 1/2] avformat/mov: Corner case encryption error cleanup in mov_read_senc()

2022-02-15 Thread Michael Niedermayer
On Thu, Feb 10, 2022 at 12:34:40PM +0100, Michael Niedermayer wrote:
> Fixes: memleak
> Fixes: 
> 42341/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4566632823914496
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mov.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

[...]
-- 
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
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 2/2] avcodec/jpeglsdec: Check get_ur_golomb_jpegls() for error

2022-02-15 Thread Michael Niedermayer
On Sat, Feb 12, 2022 at 10:27:13PM +0100, Paul B Mahol wrote:
> Please follow code style.

ill add the space between if and ( before applying
also, ill fix the other similar issues in the file in a seperate commit

thx

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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] avformat/argo_cvg: Fix checksum

2022-02-15 Thread Michael Niedermayer
On Wed, Feb 16, 2022 at 12:25:52AM +1000, Zane van Iperen wrote:
> 
> 
> On 15/2/22 23:05, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
> > ---
> >   libavformat/argo_cvg.c | 15 +--
> >   libavformat/version.h  |  2 +-
> >   2 files changed, 6 insertions(+), 11 deletions(-)
> > 
> > diff --git a/libavformat/argo_cvg.c b/libavformat/argo_cvg.c
> > index c5da32536d..dfdf126c17 100644
> > --- a/libavformat/argo_cvg.c
> > +++ b/libavformat/argo_cvg.c
> > @@ -335,19 +335,14 @@ static int argo_cvg_write_trailer(AVFormatContext *s)
> >   ArgoCVGMuxContext *ctx = s->priv_data;
> >   int64_t ret;
> > +ctx->checksum +=  (ctx->size  & 255)
> > +   + ((ctx->size>> 8) & 255)
> > +   + ((ctx->size>>16) & 255)
> > +   +  (ctx->size>>24);
> > +
> 
> ...because of course it's that simple. How did I miss that?
> No matter, lgtm!

will apply

thx

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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 2/3] avcodec/speexdec: Use correct doxygen comments

2022-02-15 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/speexdec.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index dcbdf5e010..7c61c9b0e0 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -164,7 +164,7 @@ typedef struct SpeexSubmode {
 } SpeexSubmode;
 
 typedef struct SpeexMode {
-int modeID; /** ID of the mode */
+int modeID; /**< ID of the mode */
 int (*decode)(AVCodecContext *avctx, void *dec, GetBitContext *gb, float 
*out);
 int frame_size; /**< Size of frames used for decoding */
 int subframe_size; /**< Size of sub-frames used for decoding */
@@ -176,8 +176,8 @@ typedef struct SpeexMode {
 
 typedef struct DecoderState {
 const SpeexMode *mode;
-int modeID; /** ID of the decoder mode */
-int first; /** Is first frame  */
+int modeID; /**< ID of the decoder mode */
+int first;  /**< Is first frame  */
 int full_frame_size; /**< Length of full-band frames */
 int is_wideband; /**< If wideband is present */
 int count_lost; /**< Was the last frame lost? */
@@ -186,12 +186,12 @@ typedef struct DecoderState {
 int nb_subframes; /**< Number of high-band sub-frames */
 int lpc_size; /**< Order of high-band LPC analysis */
 float last_ol_gain; /**< Open-loop gain for previous frame */
-float *innov_save; /** If non-NULL, innovation is copied here */
+float *innov_save;  /**< If non-NULL, innovation is copied here */
 
 /* This is used in packet loss concealment */
 int last_pitch; /**< Pitch of last correctly decoded frame */
 float last_pitch_gain; /**< Pitch gain of last correctly decoded frame */
-uint32_t seed; /** Seed used for random number generation */
+uint32_t seed;  /**< Seed used for random number generation */
 
 int encode_submode;
 const SpeexSubmode *const *submodes; /**< Sub-mode data */
-- 
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".


[FFmpeg-devel] [PATCH 3/3] avcodec/speexdec: Align some comments

2022-02-15 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavcodec/speexdec.c | 40 
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 7c61c9b0e0..ee95417deb 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -166,37 +166,37 @@ typedef struct SpeexSubmode {
 typedef struct SpeexMode {
 int modeID; /**< ID of the mode */
 int (*decode)(AVCodecContext *avctx, void *dec, GetBitContext *gb, float 
*out);
-int frame_size; /**< Size of frames used for decoding */
-int subframe_size; /**< Size of sub-frames used for decoding */
-int lpc_size; /**< Order of LPC filter */
-float folding_gain; /**< Folding gain */
+int frame_size; /**< Size of frames used for decoding */
+int subframe_size;  /**< Size of sub-frames used for decoding */
+int lpc_size;   /**< Order of LPC filter */
+float folding_gain; /**< Folding gain */
 const SpeexSubmode *submodes[NB_SUBMODES]; /**< Sub-mode data for the mode 
*/
-int default_submode; /**< Default sub-mode to use when decoding */
+int default_submode;/**< Default sub-mode to use when decoding */
 } SpeexMode;
 
 typedef struct DecoderState {
 const SpeexMode *mode;
 int modeID; /**< ID of the decoder mode */
 int first;  /**< Is first frame  */
-int full_frame_size; /**< Length of full-band frames */
-int is_wideband; /**< If wideband is present */
-int count_lost; /**< Was the last frame lost? */
-int frame_size; /**< Length of high-band frames */
-int subframe_size; /**< Length of high-band sub-frames */
-int nb_subframes; /**< Number of high-band sub-frames */
-int lpc_size; /**< Order of high-band LPC analysis */
-float last_ol_gain; /**< Open-loop gain for previous frame */
+int full_frame_size;/**< Length of full-band frames */
+int is_wideband;/**< If wideband is present */
+int count_lost; /**< Was the last frame lost? */
+int frame_size; /**< Length of high-band frames */
+int subframe_size;  /**< Length of high-band sub-frames */
+int nb_subframes;   /**< Number of high-band sub-frames */
+int lpc_size;   /**< Order of high-band LPC analysis */
+float last_ol_gain; /**< Open-loop gain for previous frame */
 float *innov_save;  /**< If non-NULL, innovation is copied here */
 
 /* This is used in packet loss concealment */
-int last_pitch; /**< Pitch of last correctly decoded frame */
-float last_pitch_gain; /**< Pitch gain of last correctly decoded frame */
+int last_pitch; /**< Pitch of last correctly decoded frame */
+float last_pitch_gain;  /**< Pitch gain of last correctly decoded frame */
 uint32_t seed;  /**< Seed used for random number generation */
 
 int encode_submode;
 const SpeexSubmode *const *submodes; /**< Sub-mode data */
-int submodeID; /**< Activated sub-mode */
-int lpc_enh_enabled; /**< 1 when LPC enhancer is on, 0 otherwise */
+int submodeID;  /**< Activated sub-mode */
+int lpc_enh_enabled;/**< 1 when LPC enhancer is on, 0 otherwise */
 
 /* Vocoder data */
 float voc_m1;
@@ -205,10 +205,10 @@ typedef struct DecoderState {
 int voc_offset;
 
 int dtx_enabled;
-int highpass_enabled; /**< Is the input filter enabled */
+int highpass_enabled;   /**< Is the input filter enabled */
 
-float *exc; /**< Start of excitation frame */
-float mem_hp[2]; /**< High-pass filter memory */
+float *exc; /**< Start of excitation frame */
+float mem_hp[2];/**< High-pass filter memory */
 float exc_buf[NB_DEC_BUFFER]; /**< Excitation buffer */
 float old_qlsp[NB_ORDER]; /**< Quantized LSPs for previous frame */
 float interp_qlpc[NB_ORDER]; /**< Interpolated quantized LPCs */
-- 
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".


[FFmpeg-devel] [PATCH 1/3] avfilter: Rename blend_modes.c -> blend_modes_template.c

2022-02-15 Thread Michael Niedermayer
This is more consistent with similar usage

Signed-off-by: Michael Niedermayer 
---
 .../{blend_modes.c => blend_modes_template.c}  |  0
 libavfilter/vf_blend.c | 14 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)
 rename libavfilter/{blend_modes.c => blend_modes_template.c} (100%)

diff --git a/libavfilter/blend_modes.c b/libavfilter/blend_modes_template.c
similarity index 100%
rename from libavfilter/blend_modes.c
rename to libavfilter/blend_modes_template.c
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index 2d433e439f..e912ba4cb8 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -34,31 +34,31 @@
 #define BOTTOM 1
 
 #define DEPTH 8
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 #undef DEPTH
 #define DEPTH 9
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 #undef DEPTH
 #define DEPTH 10
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 #undef DEPTH
 #define DEPTH 12
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 #undef DEPTH
 #define DEPTH 14
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 #undef DEPTH
 #define DEPTH 16
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 #undef DEPTH
 #define DEPTH 32
-#include "blend_modes.c"
+#include "blend_modes_template.c"
 
 typedef struct BlendContext {
 const AVClass *class;
-- 
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 3/3] configure: check avisynth header version

2022-02-15 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512



On 2022-02-14 17:03, Stephen Hutchinson wrote:

> Should be fixed in 
> https://github.com/AviSynth/AviSynthPlus/commit/0e583378116c857372232e9886c5
99df2fb8da85
>
> 
with the caveat (noted in AviSynth+'s README.md) that the `make install` step
> now needs to explicitly invoke the VersionGen target, `make VersionGen 
> install`.  I fiddled with it for a while, but I couldn't get the install 
> process to invoke it automatically.
> 
> Related, the older GNUmakefile method is not set up to generate version.h
> and arch.h (especially considering both of those use *.cmake scripts), so
> it's now pretty clearly deprecated.

What is the solution?

I am compiling ffmpeg with AviSynthPlus-3.5.1 and my configure just errored
out with

ERROR: avisynth/avisynth_c.h avisynth/avs/version.h not found

Which makes sense because I don't have a version.h

Do I have to use the latest git version of AviSynthPlus. Is there a fix
coming for configure so that I can compile it as I did 2 days ago?

Cheers,
  K. C.

- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAmIMIu0ACgkQvgmFNJ1E
3QCIRBAAt2kUYvy3+rMfskOBLISsDQm0epV4/RYWROqfUfzdn7ZWyUbshEGzEfSP
EuxYSgAXcvHhNYKhdgCLPFPTD5dqmxHR/9xYagelCEoEDY898DSOw0LFWyrBpak4
qvBtZP7Xt7bzFTvtoDAr+J4yrQCZN4M8gmQLhNqsh4nOawvmYlhONjXZ1eHX49Ki
9R3XFvm8jbdUqrvsil5+SNHtrf0734HYcZ5wcXNgulcfzdGDxvuGw1wS+XI9USQv
lyyom9AjgQaKZK/Kv68pVY4wLpkpVyO0KPYrfv3isNctwP69bNupRMc1BKKAPnhT
48FfSwZpU5d3CETdIXve/oX7VyWtYvNxbhqDCexlQICQgZEoWWgmUncxhVrQkMbF
e5N0mYhKTd2kJ3/31qaV/OfHqCznh2/BFzz3yeM+sH1NLj/bkAQQtCQ0I4jlW2jc
3sDxhtGmLtLXen1hnvAQLsEreT+jnlilhs1kTV8j4zZZ0rZexn7q6MFGMCR8Bmsb
7YZv0gY/1evuIvcjeviuPU9eYtbKqIeWqhIg+cRvmAJkqu1f2As0jl34Uuvw2agX
JdpfQ+x4R16wXlOYKTVu8hiX9l4pNvmeeNxUFLQSFs+Vz+bPVW9me4VCbVzbV+Dc
MwjxnhEOnarIcozsslvJLrQIwXnN+98RSpZJFmwRAM56w6QvZ1A=
=mifW
-END 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 3/3] configure: check avisynth header version

2022-02-15 Thread Stephen Hutchinson

On 2/15/22 5:02 PM, Helmut K. C. Tessarek wrote:


What is the solution?

I am compiling ffmpeg with AviSynthPlus-3.5.1 and my configure just errored
out with

ERROR: avisynth/avisynth_c.h avisynth/avs/version.h not found

Which makes sense because I don't have a version.h

Do I have to use the latest git version of AviSynthPlus. Is there a fix
coming for configure so that I can compile it as I did 2 days ago?

Cheers,
   K. C.



git clone --recursive -b 3.7 https://github.com/AviSynth/AviSynthPlus
[build/install as usual]

-b 3.7 is equal to the tarball for 3.7.1a (which has the fix for the 
case of building the entire library), --recursive pulls in the submodule 
needed for the default AppleClang on 10.13 & 10.14.  Unfortunately, 
Github doesn't put submodules in the tarballs.


The fix on latest git was specifically for those that want to use the 
HEADERS_ONLY option when configuring.

___
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 3/3] configure: check avisynth header version

2022-02-15 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512



On 2022-02-15 18:55, Stephen Hutchinson wrote:
> 
> git clone --recursive -b 3.7 https://github.com/AviSynth/AviSynthPlus 
> [build/install as usual]
> 
> -b 3.7 is equal to the tarball for 3.7.1a (which has the fix for the case
> of building the entire library), --recursive pulls in the submodule
> needed for the default AppleClang on 10.13 & 10.14.  Unfortunately,
> Github doesn't put submodules in the tarballs.
> 
> The fix on latest git was specifically for those that want to use the 
> HEADERS_ONLY option when configuring.


Unfortunately this didn't work.

Building the new AviSynthPlus results in the following errors:

[ 10%] Building CXX object
avs_core/CMakeFiles/AvsCore.dir/core/FilterGraph.cpp.o
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:27
:
error: 'path' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:739:24:
note: 'path' has been explicitly marked unavailable here
class _LIBCPP_TYPE_VIS path {
   ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:23
:
error: 'path' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:773:3:
note: 'path' has been explicitly marked unavailable here
  path(const _Source& __src, format = format::auto_format) {
  ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:23
:
error: '~path' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:791:3:
note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:35
:
error: 'lexically_normal' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:1110:8:
note: 'lexically_normal' has been explicitly marked unavailable here
  path lexically_normal() const;
   ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:35
:
error: '~path' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:791:3:
note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:14
:
error: 'absolute' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:1477:39:
note: 'absolute' has been explicitly marked unavailable here
inline _LIBCPP_INLINE_VISIBILITY path absolute(const path& __p) {
  ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:10
:
error: '~path' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
 ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:791:3:
note: '~path' has been explicitly marked unavailable here
  ~path() = default;
  ^
/Users/Shared/ffmpeg/compile/AviSynthPlus/avs_core/core/FilterGraph.cpp:510:55
:
error: 'generic_string' is unavailable: introduced in macOS 10.15
  return fs::absolute(fs::path(f).lexically_normal()).generic_string();
  ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
/usr/bin/../include/c++/v1/filesystem:1019:15:
note: 'generic_string' has been explicitly marked unavailable here
  std::string generic_string() const { return __pn_; }
  ^
8 errors generated.
make[2]: *** [avs_core/CMakeFiles/AvsCore.dir/core/FilterGraph.cpp.o] Error 1
make[1]: *** [avs_core/CMakeFiles/AvsCore.dir/all] Error 2
make: *** [all] Error 2




- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await t

Re: [FFmpeg-devel] [PATCH] tools: add general_assembly.pl

2022-02-15 Thread J, Dekker

On 15/02/2022 17:46, Jean-Baptiste Kempf wrote:

Hello,

On Tue, 15 Feb 2022, at 12:50, J. Dekker wrote:

  This was rejected last time but I would really like to get this in the
  tools or at least publicly recorded on mailing list since the script
  was updated.


Why was this rejected?


It was blocked by Nicolas as the procedure to determine the general 
assembly was not fully decided.



+foreach my $commit (@commits) {
+if ($commit =~ /\n[\w\/]+\.(c|h|S|asm)/) {
+$true++;
+}


Why do we filter on those file types? .md, .pl and other things for docs are 
active in the community.


It was just discussed at the in person meeting, our documentation states 
otherwise and I think we should stick to the documentation here. It 
doesn't make that much sense to filter out people who have majority 
documentation commits either--20 documentation commits is still a 
significant enough contribution.


See updated patch.

--
J. Dekker
___
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 v2 1/2] tools: add general_assembly.pl

2022-02-15 Thread J. Dekker
This script generates the current general assembly voters according to
the criteria of '20 commits in the last 36 months'.

Signed-off-by: J. Dekker 
---
 doc/dev_community/community.md |  3 +++
 tools/general_assembly.pl  | 40 ++
 2 files changed, 43 insertions(+)
 create mode 100644 tools/general_assembly.pl

diff --git a/doc/dev_community/community.md b/doc/dev_community/community.md
index 21e08e20e3..516ca5c05e 100644
--- a/doc/dev_community/community.md
+++ b/doc/dev_community/community.md
@@ -25,6 +25,9 @@ proposal by a member of the General Assembly.
 They are part of the GA for two years, after which they need a confirmation by
 the GA.
 
+A script to generate the current members of the general assembly (minus members
+voted in) can be found in `tools/general_assembly.pl`.
+
 ## Voting
 
 Voting is done using a ranked voting system, currently running on 
https://vote.ffmpeg.org/ .
diff --git a/tools/general_assembly.pl b/tools/general_assembly.pl
new file mode 100644
index 00..898a6262ef
--- /dev/null
+++ b/tools/general_assembly.pl
@@ -0,0 +1,40 @@
+#!/usr/bin/env perl
+
+use warnings;
+use strict;
+
+use POSIX qw(strftime);
+use Encode qw(decode);
+use Data::Dumper;
+
+sub trim { my $s = shift; $s =~ s/^\s+|\s+$//g; return $s };
+
+my @shortlog = split /\n/, decode('UTF-8', `git log --pretty=format:"%aN 
<%aE>" --since="last 36 months" | sort | uniq -c | sort -r`, Encode::FB_CROAK);
+my %assembly = ();
+
+foreach my $line (@shortlog) {
+my ($count, $name, $email) = $line =~ m/^ *(\d+) *(.*?) <(.*?)>/;
+if ($count < 20) {
+next;
+}
+
+$name = trim $name;
+if ($count < 50) {
+my $true = 0;
+my @commits = split /(^|\n)commit [a-z0-9]{40}(\n|$)/, decode('UTF-8', 
`git log --name-only --use-mailmap --author="$email" --since="last 36 months"`, 
Encode::FB_CROAK);
+foreach my $commit (@commits) {
+$true++; # if ($commit =~ /\n[\w\/]+\.(c|h|S|asm|texi)/);
+}
+
+if ($true < 20) {
+next;
+}
+}
+
+$assembly{$name} = $email;
+}
+
+printf("# %s %s", strftime("%Y-%m-%d", localtime), decode('UTF-8', `git 
rev-parse HEAD`, Encode::FB_CROAK));
+foreach my $email (sort values %assembly) {
+printf("%s\n", $email);
+}
-- 
2.32.0 (Apple Git-132)

___
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 2/2] mailmap: update entry

2022-02-15 Thread J. Dekker
Signed-off-by: J. Dekker 
---
 .mailmap | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/.mailmap b/.mailmap
index ba072f38c8..5544fc5b5c 100644
--- a/.mailmap
+++ b/.mailmap
@@ -8,7 +8,8 @@
  
  
  
- 
+ 
+J. Dekker  
  
  
  
-- 
2.32.0 (Apple Git-132)

___
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 3/3] configure: check avisynth header version

2022-02-15 Thread Stephen Hutchinson

On 2/15/22 8:33 PM, Helmut K. C. Tessarek wrote:

Unfortunately this didn't work.

Building the new AviSynthPlus results in the following errors:



Those errors would indicate you're not on the 3.7 branch, because if the 
filesystem submodule isn't present, it doesn't emit those errors, it 
stops dead because of the missing  header.  If the 
submodule is there, it compiles as it should.  Is the filesystem 
subdirectory empty?

___
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 1/3] avfilter: Rename blend_modes.c -> blend_modes_template.c

2022-02-15 Thread Andreas Rheinhardt
Michael Niedermayer:
> This is more consistent with similar usage
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  .../{blend_modes.c => blend_modes_template.c}  |  0
>  libavfilter/vf_blend.c | 14 +++---
>  2 files changed, 7 insertions(+), 7 deletions(-)
>  rename libavfilter/{blend_modes.c => blend_modes_template.c} (100%)
> 
> diff --git a/libavfilter/blend_modes.c b/libavfilter/blend_modes_template.c
> similarity index 100%
> rename from libavfilter/blend_modes.c
> rename to libavfilter/blend_modes_template.c
> diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
> index 2d433e439f..e912ba4cb8 100644
> --- a/libavfilter/vf_blend.c
> +++ b/libavfilter/vf_blend.c
> @@ -34,31 +34,31 @@
>  #define BOTTOM 1
>  
>  #define DEPTH 8
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  #undef DEPTH
>  #define DEPTH 9
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  #undef DEPTH
>  #define DEPTH 10
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  #undef DEPTH
>  #define DEPTH 12
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  #undef DEPTH
>  #define DEPTH 14
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  #undef DEPTH
>  #define DEPTH 16
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  #undef DEPTH
>  #define DEPTH 32
> -#include "blend_modes.c"
> +#include "blend_modes_template.c"
>  
>  typedef struct BlendContext {
>  const AVClass *class;

Right now make's vf_blend.d contains an entry
src/libavfilter/blend_modes.c; if one applies this patch, said file does
no longer exist and make errors out with "No rule to make target
'src/libavfilter/blend_modes.c', needed by 'libavfilter/vf_blend.o'.",
because the blend_modes.c prerequisite can't be made. In
3044d0efee9136c19dfdcf6dcdf957e910a73fd5 I made the build process treat
templates just like headers so that they can be deleted without this
error. Would there be any negative side-effects of doing the same for
all files?
(Btw: The AC-3 decoder also uses a misnamed template; I didn't fix it
because of the aforementioned issue.)

- Andreas
___
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 3/3] configure: check avisynth header version

2022-02-15 Thread Helmut K. C. Tessarek
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 2022-02-15 22:50, Stephen Hutchinson wrote:
> Those errors would indicate you're not on the 3.7 branch, because if the 
> filesystem submodule isn't present, it doesn't emit those errors, it
> stops dead because of the missing  header.  If the
> submodule is there, it compiles as it should.  Is the filesystem
> subdirectory empty?

Nope, I used the git command you posted. I also checked the filesystem dir:

[tessus@epsilon3 0 ~/data/ext/ffmpeg/compile/AviSynthPlus/filesystem
:3f1c185|✔]$ ll
total 76
drwxr-xr-x 18 tessus wheel   576 2022-02-15 20:23 .
drwxr-xr-x 16 tessus wheel   512 2022-02-15 20:31 ..
- -rw-r--r--  1 tessus wheel  2842 2022-02-15 20:23 .appveyor.yml
drwxr-xr-x  4 tessus wheel   128 2022-02-15 20:23 .ci
- -rw-r--r--  1 tessus wheel   313 2022-02-15 20:23 .cirrus.yml
- -rw-r--r--  1 tessus wheel   576 2022-02-15 20:23 .clang-format
- -rw-r--r--  1 tessus wheel   795 2022-02-15 20:23 .drone.yml
- -rw-r--r--  1 tessus wheel35 2022-02-15 20:23 .git
drwxr-xr-x  3 tessus wheel96 2022-02-15 20:23 .github
- -rw-r--r--  1 tessus wheel32 2022-02-15 20:23 .gitignore
- -rw-r--r--  1 tessus wheel  4141 2022-02-15 20:23 .travis.yml
- -rw-r--r--  1 tessus wheel  1937 2022-02-15 20:23 CMakeLists.txt
- -rw-r--r--  1 tessus wheel  1086 2022-02-15 20:23 LICENSE
- -rw-r--r--  1 tessus wheel 35982 2022-02-15 20:23 README.md
drwxr-xr-x  4 tessus wheel   128 2022-02-15 20:23 cmake
drwxr-xr-x  5 tessus wheel   160 2022-02-15 20:23 examples
drwxr-xr-x  3 tessus wheel96 2022-02-15 20:23 include
drwxr-xr-x 11 tessus wheel   352 2022-02-15 20:23 test

I'm building AviSynth like this:

[tessus@epsilon3 0 ~/data/ext/ffmpeg/compile/AviSynthPlus]

mkdir avisynth-build && cd avisynth-build
cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGET} -DBUILD_SHARED_LIBS=OFF ..
make VersionGen install

- 

Until 2 days ago I could compile ffmpeg with AviSynth 3.5.1 just fine. So
something must have made my configure to fail.


- -- 
regards Helmut K. C. Tessarek  KeyID 0x172380A011EF4944
Key fingerprint = 8A55 70C1 BD85 D34E ADBC 386C 1723 80A0 11EF 4944

/*
   Thou shalt not follow the NULL pointer for chaos and madness
   await thee at its end.
*/
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE191csiqpm8f5Ln9WvgmFNJ1E3QAFAmIMhzEACgkQvgmFNJ1E
3QDprg/+NckvpYpfWeq6jPKKjGmJQazTxFpE0PyyZAngEx9Du6UP49iitT4UefJH
5hOnm7Ps6gkmdNK5WZaeUHL87Vyarya6WIzdNAymzwERsapRfxdsc4YyEbh26bK6
eMf7Qz+4kZ2tfqSGvdTfCDqoYybr/nmR4W/T06jEbeV4v2OmZZieNrDPsel+BUjU
2pSSSCmglJ5qDXcDKfaqCXUtXI5TGJGKm0299yHcZq6Y+OOQGGTCz6f2JbMo0QL/
9X9CNUXxGkCuMgJ4fsOfSq1GkhFQt0eVAIBY9/vIcXKdAPnw+qHgi/Y6OVh6FUc2
S8Y5BEcE73jkjuakimje4DV5h/TfAe6vlavM1MCuHhMblQKYstsrYaRoEkYidb2E
sPp87KadqxCveYW7sTuNs0TxBuUJjWef/7NeShoBAsJTlgGgqM7Iel7ctEZz9gD7
TMOAwSqGy+B2OVXeQvQA5oLJf7I4a4WoVCUgSySKTRNh8Dq52X9wfmJPMD5iGz6K
eAR0Z4jlZ3ihZ9NgrjHBqVaSNwbGsrvOlpdrNptxKwFV3ob2VFGuIw5rSJy53y++
e+WI+beujsNc1KX/oU+2CEDX5M1jua6+xBMW08gOpawB4YRxMyx3NfcJjgNwdNZq
PWix846IxGDfd9O0pP7KAEmzX00Cld6b9k417ql/0m5zF1LMYw0=
=NM4f
-END 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] libavcodec/qsvdec: use the parameter from decodeHeader to configure surface

2022-02-15 Thread Xiang, Haihao
On Fri, 2022-02-11 at 10:37 +0800, Wenbin Chen wrote:
> MSDK recognizes both yuv420p10 and yuv420p9 as MFX_FOURCC_P010, but
> parameters are different. When decode yuv420p9 video, ffmpeg-qsv will use
> yuv420p10le to configure surface which is different with param from
> DecoderHeader and this will lead to error. Now change it use
> param from decoderHeader to configure surface.
> 
> Signed-off-by: Wenbin Chen 
> ---
>  libavcodec/qsvdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c
> index f81737ab6d..6236391357 100644
> --- a/libavcodec/qsvdec.c
> +++ b/libavcodec/qsvdec.c
> @@ -423,13 +423,13 @@ static int alloc_frame(AVCodecContext *avctx, QSVContext
> *q, QSVFrame *frame)
>  if (frame->frame->format == AV_PIX_FMT_QSV) {
>  frame->surface = *(mfxFrameSurface1*)frame->frame->data[3];
>  } else {
> -frame->surface.Info = q->frame_info;
> -
>  frame->surface.Data.PitchLow = frame->frame->linesize[0];
>  frame->surface.Data.Y= frame->frame->data[0];
>  frame->surface.Data.UV   = frame->frame->data[1];
>  }
>  
> +frame->surface.Info = q->frame_info;
> +
>  if (q->frames_ctx.mids) {
>  ret = ff_qsv_find_surface_idx(&q->frames_ctx, frame);
>  if (ret < 0)

LGTM, will apply

-Haihao

___
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/fifo: Remove unused buffer frame

2022-02-15 Thread Andreas Rheinhardt
Forgotten in 03c8fe49ea3f2a2444607e541dff15a1ccd7f0c2.

Signed-off-by: Andreas Rheinhardt 
---
What is actually the use-case of these filters? The documentation states
that they are auto-inserted, yet this is no longer true any more since
4ca1fb9d2a91757c8c4c34dd456abf340e3f765f.

 libavfilter/fifo.c | 9 -
 1 file changed, 9 deletions(-)

diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c
index 1c7be88ae1..8b34055fde 100644
--- a/libavfilter/fifo.c
+++ b/libavfilter/fifo.c
@@ -38,13 +38,6 @@ typedef struct Buf {
 typedef struct FifoContext {
 Buf  root;
 Buf *last;   ///< last buffered frame
-
-/**
- * When a specific number of output samples is requested, the partial
- * buffer is stored here
- */
-AVFrame *out;
-int allocated_samples;  ///< number of samples out was allocated for
 } FifoContext;
 
 static av_cold int init(AVFilterContext *ctx)
@@ -65,8 +58,6 @@ static av_cold void uninit(AVFilterContext *ctx)
 av_frame_free(&buf->frame);
 av_free(buf);
 }
-
-av_frame_free(&s->out);
 }
 
 static int add_to_queue(AVFilterLink *inlink, AVFrame *frame)
-- 
2.32.0

___
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] avformat/nutdec: Add check for avformat_new_stream

2022-02-15 Thread Jiasheng Jiang
As the potential failure of the memory allocation,
the avformat_new_stream() could return NULL pointer.
Therefore, it should be better to check it and return
error if fails.

Fixes: 84ad31ff18 ("lavf: replace av_new_stream->avformat_new_stream part II.")
Signed-off-by: Jiasheng Jiang 
---
 libavformat/nutdec.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index 0a8a700acf..eb2ba4840a 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -352,7 +352,11 @@ static int decode_main_header(NUTContext *nut)
 goto fail;
 }
 for (i = 0; i < stream_count; i++)
-avformat_new_stream(s, NULL);
+if (!avformat_new_stream(s, NULL)) {
+av_free(nut->stream);
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 
 return 0;
 fail:
-- 
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] avformat/nutdec: Add check for avformat_new_stream

2022-02-15 Thread Andreas Rheinhardt
Jiasheng Jiang:
> As the potential failure of the memory allocation,
> the avformat_new_stream() could return NULL pointer.
> Therefore, it should be better to check it and return
> error if fails.
> 
> Fixes: 84ad31ff18 ("lavf: replace av_new_stream->avformat_new_stream part 
> II.")

This commit did not introduce this bug; it merely replaced the unchecked
function.

> Signed-off-by: Jiasheng Jiang 
> ---
>  libavformat/nutdec.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
> index 0a8a700acf..eb2ba4840a 100644
> --- a/libavformat/nutdec.c
> +++ b/libavformat/nutdec.c
> @@ -352,7 +352,11 @@ static int decode_main_header(NUTContext *nut)
>  goto fail;
>  }
>  for (i = 0; i < stream_count; i++)
> -avformat_new_stream(s, NULL);
> +if (!avformat_new_stream(s, NULL)) {
> +av_free(nut->stream);
> +ret = AVERROR(ENOMEM);
> +goto fail;
> +}
>  
>  return 0;
>  fail:

If you look at nut_read_header() you will see that it just retries even
on allocation failure. So this is not a complete fix. And if it retries
and finds a different packet header, it adds ever more streams, because
the already created streams have not been deleted. A proper fix would
need to check the return value of decode_main_header for ENOMEM, but if
time_base_count were invalid and huge, one could get an allocation error
even though there might be a valid header somewhere else. So one would
need an equivalent of NUT_MAX_STREAMS for timebases or some other
criterion to rule this out.

- Andreas
___
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] avcodec/vp3: Add missing check for av_malloc

2022-02-15 Thread Peter Ross
On Tue, Feb 15, 2022 at 05:58:08PM +0800, Jiasheng Jiang wrote:
> Since the av_malloc() may fail and return NULL pointer,
> it is needed that the 's->edge_emu_buffer' should be checked
> whether the new allocation is success.
> 
> Fixes: d14723861b ("VP3: fix decoding of videos with stride > 2048")
> Signed-off-by: Jiasheng Jiang 
> ---
>  libavcodec/vp3.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
> index e9ab54d736..e2418eb6fa 100644
> --- a/libavcodec/vp3.c
> +++ b/libavcodec/vp3.c
> @@ -2679,8 +2679,13 @@ static int vp3_decode_frame(AVCodecContext *avctx,
>  AV_GET_BUFFER_FLAG_REF)) < 0)
>  goto error;
>  
> -if (!s->edge_emu_buffer)
> +if (!s->edge_emu_buffer) {
>  s->edge_emu_buffer = av_malloc(9 * 
> FFABS(s->current_frame.f->linesize[0]));
> +if (!s->edge_emu_buffer) {
> +ret = AVERROR(ENOMEM);
> +goto error;
> +}
> +}
>  

looks good to me.
i will apply in couple of days.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)


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 3/3] configure: check avisynth header version

2022-02-15 Thread Stephen Hutchinson

On 2/16/22 12:10 AM, Helmut K. C. Tessarek wrote:

On 2022-02-15 22:50, Stephen Hutchinson wrote:

Those errors would indicate you're not on the 3.7 branch, because if the
filesystem submodule isn't present, it doesn't emit those errors, it
stops dead because of the missing  header.  If the
submodule is there, it compiles as it should.  Is the filesystem
subdirectory empty?


Nope, I used the git command you posted. I also checked the filesystem dir:

[tessus@epsilon3 0 ~/data/ext/ffmpeg/compile/AviSynthPlus/filesystem
:3f1c185|✔]$ ll
total 76
drwxr-xr-x 18 tessus wheel   576 2022-02-15 20:23 .
drwxr-xr-x 16 tessus wheel   512 2022-02-15 20:31 ..
-rw-r--r--  1 tessus wheel  2842 2022-02-15 20:23 .appveyor.yml
drwxr-xr-x  4 tessus wheel   128 2022-02-15 20:23 .ci
-rw-r--r--  1 tessus wheel   313 2022-02-15 20:23 .cirrus.yml
-rw-r--r--  1 tessus wheel   576 2022-02-15 20:23 .clang-format
-rw-r--r--  1 tessus wheel   795 2022-02-15 20:23 .drone.yml
-rw-r--r--  1 tessus wheel35 2022-02-15 20:23 .git
drwxr-xr-x  3 tessus wheel96 2022-02-15 20:23 .github
-rw-r--r--  1 tessus wheel32 2022-02-15 20:23 .gitignore
-rw-r--r--  1 tessus wheel  4141 2022-02-15 20:23 .travis.yml
-rw-r--r--  1 tessus wheel  1937 2022-02-15 20:23 CMakeLists.txt
-rw-r--r--  1 tessus wheel  1086 2022-02-15 20:23 LICENSE
-rw-r--r--  1 tessus wheel 35982 2022-02-15 20:23 README.md
drwxr-xr-x  4 tessus wheel   128 2022-02-15 20:23 cmake
drwxr-xr-x  5 tessus wheel   160 2022-02-15 20:23 examples
drwxr-xr-x  3 tessus wheel96 2022-02-15 20:23 include
drwxr-xr-x 11 tessus wheel   352 2022-02-15 20:23 test

I'm building AviSynth like this:

[tessus@epsilon3 0 ~/data/ext/ffmpeg/compile/AviSynthPlus]

mkdir avisynth-build && cd avisynth-build
cmake -DCMAKE_INSTALL_PREFIX:PATH=${TARGET} -DBUILD_SHARED_LIBS=OFF ..
make VersionGen install



Until 2 days ago I could compile ffmpeg with AviSynth 3.5.1 just fine. So
something must have made my configure to fail.




I can't reproduce under the 10.14 VM.  BUILD_SHARED_LIBS or not, if 
filesystem isn't present, it stops with a missing header error, and if 
it was properly '--recursive'ly cloned, the build succeeds.  The only 
thing I can think of at this point is that the default Command Line 
Developer Tools fetch the utilities from Xcode 10, which are blissfully 
unaware of things Apple might have tried getting clever about in Xcode 
11.  That repeated 'error:  is unavailable: introduced in macOS 
10.15' message seems like something is new enough to *know* about it 
being present in 10.15, and might be interfering with it somehow.


There is another option, basically what Gyan suggested earlier: grab the 
release build of 3.7.1, fetch the extra headers from the Github repo, 
then copy either all the contents of the tarball's /usr directory into 
the system /usr directory (or wherever your working ${prefix} is), or 
just the 'avisynth' directory into ${prefix}/include.  Then try FFmpeg 
again.


curl -L -O 
https://github.com/AviSynth/AviSynthPlus/releases/download/v3.7.1/AviSynthPlus_3.7.1_macOS_10.13_._10.14_x64-filesonly.tar.xz


tar -xJvf AviSynthPlus_3.7.1_macOS_10.13_._10.14_x64-filesonly.tar.xz

cd 
avisynthplus_3.7.1_macOS_10.13_\&_10.14_x64-filesonly/usr/include/avisynth/avs


curl -L -o arch.h 
https://raw.githubusercontent.com/AviSynth/AviSynthPlus/master/avs_core/core/arch.h.in


curl -L -o version.h 
https://raw.githubusercontent.com/AviSynth/AviSynthPlus/master/avs_core/core/version.h.in


cd ../../../
sudo cp -R * /usr

or

cd ../../
sudo cp -R avisynth /usr/include

The first option will at least allow you to test that AviSynth works 
when trying to use it with FFmpeg, because it'll make sure 
libavisynth.dylib is present.

___
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".