[FFmpeg-devel] [PATCH] libavfilter/dnn_backend_native: check mem allocation

2020-10-12 Thread Chris Miceli
check that frame allocations return non-null.
---
 libavfilter/dnn/dnn_backend_native.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavfilter/dnn/dnn_backend_native.c 
b/libavfilter/dnn/dnn_backend_native.c
index d45e211f0c..7958ceb4f7 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -80,7 +80,18 @@ static DNNReturnType get_output_native(void *model, const 
char *input_name, int
 DNNReturnType ret;
 NativeModel *native_model = (NativeModel *)model;
 AVFrame *in_frame = av_frame_alloc();
-AVFrame *out_frame = av_frame_alloc();
+AVFrame *out_frame = NULL;
+
+if (!in_frame)
+return DNN_ERROR;
+
+out_frame = av_frame_alloc();
+
+if (!out_frame) {
+av_frame_free(_frame);
+return DNN_ERROR;
+}
+
 in_frame->width = input_width;
 in_frame->height = input_height;
 
-- 
2.28.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] libavformat/utils: Fix misleading indent

2020-10-12 Thread Chris Miceli
6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 introduced this and it was part
of a very large merging of refactoring. Current behaviour is what is
reflected by this indenting change, however my understanding of timing
is such that this correct behaviour.
---
 libavformat/utils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index a2e701ea1a..e8335a601f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1186,8 +1186,7 @@ static void update_initial_durations(AVFormatContext *s, 
AVStream *st,
 pktl->pkt.dts = cur_dts;
 if (!st->internal->avctx->has_b_frames)
 pktl->pkt.pts = cur_dts;
-//if (st->codecpar->codec_type != AVMEDIA_TYPE_AUDIO)
-pktl->pkt.duration = duration;
+pktl->pkt.duration = duration;
 } else
 break;
 cur_dts = pktl->pkt.dts + pktl->pkt.duration;
-- 
2.28.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".

Re: [FFmpeg-devel] [PATCH] libavfilter/dnn_backend_native: check mem allocation

2020-10-12 Thread Andreas Rheinhardt
Chris Miceli:
> check that frame allocations return non-null.
> ---
>  libavfilter/dnn/dnn_backend_native.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/libavfilter/dnn/dnn_backend_native.c 
> b/libavfilter/dnn/dnn_backend_native.c
> index d45e211f0c..cda857a9c5 100644
> --- a/libavfilter/dnn/dnn_backend_native.c
> +++ b/libavfilter/dnn/dnn_backend_native.c
> @@ -81,6 +81,15 @@ static DNNReturnType get_output_native(void *model, const 
> char *input_name, int
>  NativeModel *native_model = (NativeModel *)model;
>  AVFrame *in_frame = av_frame_alloc();
>  AVFrame *out_frame = av_frame_alloc();
> +
> +if (!in_frame)
> +return DNN_ERROR;
> +

out_frame may leak here.

> +if (!out_frame) {
> +av_frame_free(_frame);
> +return DNN_ERROR;
> +}
> +
>  in_frame->width = input_width;
>  in_frame->height = input_height;
>  
> 

___
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] libavfilter/dnn_backend_native: check mem allocation

2020-10-12 Thread Chris Miceli
check that frame allocations return non-null.
---
 libavfilter/dnn/dnn_backend_native.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/dnn/dnn_backend_native.c 
b/libavfilter/dnn/dnn_backend_native.c
index d45e211f0c..cda857a9c5 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -81,6 +81,15 @@ static DNNReturnType get_output_native(void *model, const 
char *input_name, int
 NativeModel *native_model = (NativeModel *)model;
 AVFrame *in_frame = av_frame_alloc();
 AVFrame *out_frame = av_frame_alloc();
+
+if (!in_frame)
+return DNN_ERROR;
+
+if (!out_frame) {
+av_frame_free(_frame);
+return DNN_ERROR;
+}
+
 in_frame->width = input_width;
 in_frame->height = input_height;
 
-- 
2.28.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] libavfilter/af_mcompand: Check for failure to allocate memory

2020-10-12 Thread Chris Miceli
This commit fixes some unchecked memory allocations from #8931.
---
 libavfilter/af_mcompand.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
index f142573bea..96293909de 100644
--- a/libavfilter/af_mcompand.c
+++ b/libavfilter/af_mcompand.c
@@ -386,8 +386,17 @@ static int config_output(AVFilterLink *outlink)
 }
 
 s->bands[i].attack_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].attack_rate)
+return AVERROR(ENOMEM);
+
 s->bands[i].decay_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].decay_rate)
+return AVERROR(ENOMEM);
+
 s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].volume)
+return AVERROR(ENOMEM);
+
 for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
 char *tstr3 = av_strtok(p3, ",", );
 
-- 
2.28.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] libavfilter/af_mcompand: Check for failure to allocate memory

2020-10-12 Thread Chris Miceli
This commit fixes some unchecked memory allocations from #8931.
---
 libavfilter/af_mcompand.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
index f142573bea..96293909de 100644
--- a/libavfilter/af_mcompand.c
+++ b/libavfilter/af_mcompand.c
@@ -386,8 +386,17 @@ static int config_output(AVFilterLink *outlink)
 }
 
 s->bands[i].attack_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].attack_rate)
+return AVERROR(ENOMEM);
+
 s->bands[i].decay_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].decay_rate)
+return AVERROR(ENOMEM);
+
 s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].volume)
+return AVERROR(ENOMEM);
+
 for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
 char *tstr3 = av_strtok(p3, ",", );
 
-- 
2.28.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] libavformat/avidec: check memory allocation

2020-10-12 Thread Chris Miceli
Memory allocation for AVIOContext should be checked. In this code,
all error conditions are sent to the "goto error".
---
 libavformat/avidec.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 9765e5e7b2..33e50e9878 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1072,11 +1072,15 @@ static int read_gab2_sub(AVFormatContext *s, AVStream 
*st, AVPacket *pkt)
 ff_const59 AVInputFormat *sub_demuxer;
 AVRational time_base;
 int size;
+AVProbeData pd;
+unsigned int desc_len;
 AVIOContext *pb = avio_alloc_context(pkt->data + 7,
  pkt->size - 7,
  0, NULL, NULL, NULL, NULL);
-AVProbeData pd;
-unsigned int desc_len = avio_rl32(pb);
+if (!pb)
+goto error;
+
+desc_len = avio_rl32(pb);
 
 if (desc_len > pb->buf_end - pb->buf_ptr)
 goto error;
-- 
2.28.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".

Re: [FFmpeg-devel] [PATCH] libavfilter/dnn_backend_native: check mem allocation

2020-10-12 Thread Andreas Rheinhardt
Chris Miceli:
> check that frame allocations return non-null.
> ---
>  libavfilter/dnn/dnn_backend_native.c | 8 
>  1 file changed, 8 insertions(+)
> 
> diff --git a/libavfilter/dnn/dnn_backend_native.c 
> b/libavfilter/dnn/dnn_backend_native.c
> index d45e211f0c..d1eb992335 100644
> --- a/libavfilter/dnn/dnn_backend_native.c
> +++ b/libavfilter/dnn/dnn_backend_native.c
> @@ -81,6 +81,14 @@ static DNNReturnType get_output_native(void *model, const 
> char *input_name, int
>  NativeModel *native_model = (NativeModel *)model;
>  AVFrame *in_frame = av_frame_alloc();
>  AVFrame *out_frame = av_frame_alloc();
> +
> +if (!in_frame) {
> +return DNN_ERROR;
> +}
> +
> +if (!out_frame) {
> +return DNN_ERROR;
> +}
>  in_frame->width = input_width;
>  in_frame->height = input_height;
>  
> If exactly one of the allocations fails, the other one will leak.

- 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] libavfilter/dnn_backend_native: chk mem allocation

2020-10-12 Thread Chris Miceli
Please disregard this for the replacement titled:
libavfilter/dnn_backend_native: check mem allocation.

Thanks,
*Chris Miceli*


On Tue, Oct 13, 2020 at 1:34 PM Chris Miceli  wrote:

> A report on Trac came in about this failure scenario where there are
> potential failures to allocate memory which are going unchecked in the
> code. This should fix that error in the same way that other parts of the
> codebase already handle similar situations
> ---
>  libavfilter/dnn/dnn_backend_native.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/libavfilter/dnn/dnn_backend_native.c
> b/libavfilter/dnn/dnn_backend_native.c
> index d45e211f0c..06980de6e7 100644
> --- a/libavfilter/dnn/dnn_backend_native.c
> +++ b/libavfilter/dnn/dnn_backend_native.c
> @@ -80,7 +80,15 @@ static DNNReturnType get_output_native(void *model,
> const char *input_name, int
>  DNNReturnType ret;
>  NativeModel *native_model = (NativeModel *)model;
>  AVFrame *in_frame = av_frame_alloc();
> +if (!in_frame) {
> +av_log(_model->ctx, AV_LOG_ERROR, "Could not allocate
> in_frame memory\n");
> +return DNN_ERROR;
> +}
>  AVFrame *out_frame = av_frame_alloc();
> +if (!out_frame) {
> +av_log(_model->ctx, AV_LOG_ERROR, "Could not allocate
> out_frame memory\n");
> +return DNN_ERROR;
> +}
>  in_frame->width = input_width;
>  in_frame->height = input_height;
>
> --
> 2.28.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] libavfilter/dnn_backend_native: check mem allocation

2020-10-12 Thread Chris Miceli
check that frame allocations return non-null.
---
 libavfilter/dnn/dnn_backend_native.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/dnn/dnn_backend_native.c 
b/libavfilter/dnn/dnn_backend_native.c
index d45e211f0c..d1eb992335 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -81,6 +81,14 @@ static DNNReturnType get_output_native(void *model, const 
char *input_name, int
 NativeModel *native_model = (NativeModel *)model;
 AVFrame *in_frame = av_frame_alloc();
 AVFrame *out_frame = av_frame_alloc();
+
+if (!in_frame) {
+return DNN_ERROR;
+}
+
+if (!out_frame) {
+return DNN_ERROR;
+}
 in_frame->width = input_width;
 in_frame->height = input_height;
 
-- 
2.28.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".

Re: [FFmpeg-devel] [PATCH] libavfilter/af_mcompand: Check for failure to allocate memory

2020-10-12 Thread Andreas Rheinhardt
Chris Miceli:
> This commit fixes some unchecked memory allocations from #8931.
> ---
>  libavfilter/af_mcompand.c | 9 +
>  1 file changed, 9 insertions(+)
> 
> diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
> index f142573bea..5309d884a5 100644
> --- a/libavfilter/af_mcompand.c
> +++ b/libavfilter/af_mcompand.c
> @@ -386,8 +386,17 @@ static int config_output(AVFilterLink *outlink)
>  }
>  
>  s->bands[i].attack_rate = av_calloc(outlink->channels, 
> sizeof(double));
> +if (!s->bands[i].attack_rate) {
> +return AVERROR(ENOMEM);
> +}
>  s->bands[i].decay_rate = av_calloc(outlink->channels, 
> sizeof(double));
> +if (!s->bands[i].decay_rate) {
> +return AVERROR(ENOMEM);
> +}
>  s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
> +if (!s->bands[i].volume) {
> +return AVERROR(ENOMEM);
> +}
>  for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
>  char *tstr3 = av_strtok(p3, ",", );
>  
> 
The {} are unnecessary.

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

[FFmpeg-devel] [PATCH] libavfilter/dnn_backend_native: chk mem allocation

2020-10-12 Thread Chris Miceli
A report on Trac came in about this failure scenario where there are
potential failures to allocate memory which are going unchecked in the
code. This should fix that error in the same way that other parts of the
codebase already handle similar situations
---
 libavfilter/dnn/dnn_backend_native.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/dnn/dnn_backend_native.c 
b/libavfilter/dnn/dnn_backend_native.c
index d45e211f0c..06980de6e7 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -80,7 +80,15 @@ static DNNReturnType get_output_native(void *model, const 
char *input_name, int
 DNNReturnType ret;
 NativeModel *native_model = (NativeModel *)model;
 AVFrame *in_frame = av_frame_alloc();
+if (!in_frame) {
+av_log(_model->ctx, AV_LOG_ERROR, "Could not allocate in_frame 
memory\n");
+return DNN_ERROR;
+}
 AVFrame *out_frame = av_frame_alloc();
+if (!out_frame) {
+av_log(_model->ctx, AV_LOG_ERROR, "Could not allocate out_frame 
memory\n");
+return DNN_ERROR;
+}
 in_frame->width = input_width;
 in_frame->height = input_height;
 
-- 
2.28.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] libavfilter/af_mcompand: Check for failure to allocate memory

2020-10-12 Thread Chris Miceli
This commit fixes some unchecked memory allocations from #8931.
---
 libavfilter/af_mcompand.c | 9 +
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
index f142573bea..5309d884a5 100644
--- a/libavfilter/af_mcompand.c
+++ b/libavfilter/af_mcompand.c
@@ -386,8 +386,17 @@ static int config_output(AVFilterLink *outlink)
 }
 
 s->bands[i].attack_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].attack_rate) {
+return AVERROR(ENOMEM);
+}
 s->bands[i].decay_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].decay_rate) {
+return AVERROR(ENOMEM);
+}
 s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].volume) {
+return AVERROR(ENOMEM);
+}
 for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
 char *tstr3 = av_strtok(p3, ",", );
 
-- 
2.28.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".

Re: [FFmpeg-devel] [PATCH] libavfilter/af_mcompand: Check for failure to allocate memory

2020-10-12 Thread Andreas Rheinhardt
Chris Miceli:
> ticket 8931 mentions some missing null pointer checks and so this is one
  ^

Nit: null pointer checks can be more than just checking allocations for
success. So how about "This commit fixes some of the unchecked
allocations mentioned in ticket #8931."

> diff of a few which are for these fixes. There are previous code pieces
> which return ENOMEM, so this should work as intended.

Better check: You can e.g. add av_max_alloc(1); before the allocations.

> ---
>  libavfilter/af_mcompand.c | 12 
>  1 file changed, 12 insertions(+)
> 
> diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
> index f142573bea..953f7cd407 100644
> --- a/libavfilter/af_mcompand.c
> +++ b/libavfilter/af_mcompand.c
> @@ -386,8 +386,20 @@ static int config_output(AVFilterLink *outlink)
>  }
>  
>  s->bands[i].attack_rate = av_calloc(outlink->channels, 
> sizeof(double));
> +if (!s->bands[i].attack_rate) {
> +av_log(ctx, AV_LOG_ERROR, "Could not allocate memory for the 
> attack_rate\n");
> +return AVERROR(ENOMEM);
> +}
>  s->bands[i].decay_rate = av_calloc(outlink->channels, 
> sizeof(double));
> +if (!s->bands[i].decay_rate) {
> +av_log(ctx, AV_LOG_ERROR, "Could not allocate memory for the 
> decay_rate\n");
> +return AVERROR(ENOMEM);
> +}
>  s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
> +if (!s->bands[i].volume) {
> +av_log(ctx, AV_LOG_ERROR, "Could not allocate memory for the 
> volume\n");
> +return AVERROR(ENOMEM);
> +}
>  for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
>  char *tstr3 = av_strtok(p3, ",", );
>  
> 
I don't think it is necessary to add a log message for any of these: It
is very unlikely that these errors will be triggered at all and if so,
these messages won't help the user at all (well, they could look up in
the source code what the array that couldn't be allocated is exactly,
but why would they do this?). They just take up space in the binary and
make the code less readable.

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

[FFmpeg-devel] [PATCH] libavfilter/dnn_backend_native: chk mem allocation

2020-10-12 Thread Chris Miceli
A report on Trac came in about this failure scenario where there are
potential failures to allocate memory which are going unchecked in the
code. This should fix that error in the same way that other parts of the
codebase already handle similar situations
---
 libavfilter/dnn/dnn_backend_native.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/dnn/dnn_backend_native.c 
b/libavfilter/dnn/dnn_backend_native.c
index d45e211f0c..06980de6e7 100644
--- a/libavfilter/dnn/dnn_backend_native.c
+++ b/libavfilter/dnn/dnn_backend_native.c
@@ -80,7 +80,15 @@ static DNNReturnType get_output_native(void *model, const 
char *input_name, int
 DNNReturnType ret;
 NativeModel *native_model = (NativeModel *)model;
 AVFrame *in_frame = av_frame_alloc();
+if (!in_frame) {
+av_log(_model->ctx, AV_LOG_ERROR, "Could not allocate in_frame 
memory\n");
+return DNN_ERROR;
+}
 AVFrame *out_frame = av_frame_alloc();
+if (!out_frame) {
+av_log(_model->ctx, AV_LOG_ERROR, "Could not allocate out_frame 
memory\n");
+return DNN_ERROR;
+}
 in_frame->width = input_width;
 in_frame->height = input_height;
 
-- 
2.28.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] libavfilter/af_mcompand: Check for failure to allocate memory

2020-10-12 Thread Chris Miceli
ticket 8931 mentions some missing null pointer checks and so this is one
diff of a few which are for these fixes. There are previous code pieces
which return ENOMEM, so this should work as intended.
---
 libavfilter/af_mcompand.c | 12 
 1 file changed, 12 insertions(+)

diff --git a/libavfilter/af_mcompand.c b/libavfilter/af_mcompand.c
index f142573bea..953f7cd407 100644
--- a/libavfilter/af_mcompand.c
+++ b/libavfilter/af_mcompand.c
@@ -386,8 +386,20 @@ static int config_output(AVFilterLink *outlink)
 }
 
 s->bands[i].attack_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].attack_rate) {
+av_log(ctx, AV_LOG_ERROR, "Could not allocate memory for the 
attack_rate\n");
+return AVERROR(ENOMEM);
+}
 s->bands[i].decay_rate = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].decay_rate) {
+av_log(ctx, AV_LOG_ERROR, "Could not allocate memory for the 
decay_rate\n");
+return AVERROR(ENOMEM);
+}
 s->bands[i].volume = av_calloc(outlink->channels, sizeof(double));
+if (!s->bands[i].volume) {
+av_log(ctx, AV_LOG_ERROR, "Could not allocate memory for the 
volume\n");
+return AVERROR(ENOMEM);
+}
 for (k = 0; k < FFMIN(nb_attacks / 2, outlink->channels); k++) {
 char *tstr3 = av_strtok(p3, ",", );
 
-- 
2.28.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".

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF

2020-10-12 Thread Steven Liu


> 2020年10月12日 下午11:43,Guangxin Xu  写道:
> 
> On Mon, Oct 12, 2020 at 9:57 PM Steven Liu  wrote:
> 
>> 
>> 
>>> 在 2020年10月12日,21:45,Guangxin Xu  写道:
>>> 
>>> 
>>> 
>>> On Mon, Oct 12, 2020 at 5:18 PM Steven Liu  wrote:
>>> fix ticket: 8904
>>> parse the SPS from extradata and get profile_tier_level
>>> write the profile_tier_level info into CODECS Attribute
>>> 
>>> reference to :
>> https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendixes
>>> 
>>> Signed-off-by: Steven Liu 
>>> ---
>>> libavformat/hlsenc.c | 41 +
>>> 1 file changed, 41 insertions(+)
>>> 
>>> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
>>> index cb31d6aed7..574d9f81e9 100644
>>> --- a/libavformat/hlsenc.c
>>> +++ b/libavformat/hlsenc.c
>>> @@ -337,6 +337,43 @@ static void write_codec_attr(AVStream *st,
>> VariantStream *vs)
>>> } else {
>>> goto fail;
>>> }
>>> +} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
>>> +uint8_t *data = st->codecpar->extradata;
>>> +int i = 0;
>>> +int profile = FF_PROFILE_UNKNOWN;
>>> +int level = FF_LEVEL_UNKNOWN;
>>> +
>>> +if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
>>> +profile = st->codecpar->profile;
>>> +if (st->codecpar->level != FF_LEVEL_UNKNOWN)
>>> +level = st->codecpar->level;
>>> +
>>> +while (data && (data - st->codecpar->extradata) <
>> st->codecpar->extradata_size) {
>>> +/* get HEVC SPS NAL and seek to profile_tier_level */
>>> +if (data && (data[0] | data[1] | data[2]) == 0 && data[3]
>> == 1 && ((data[4] & 0x42) == 0x42)) {
>>> Read beyond the boundary if data + 1 - st->codecpar->extradata  >=
>> st->codecpar->extradata_size
>> ok
>>> Is it possible reuese ff_hevc_decode_extradata here?
>> it is in libavcodec, i don’t think depend libavcodec in hlsenc is a good
>> way, so parse sps here.
>> 
> Then, we have a lot of hard work:
> 1. remove emulation prevent code.
> 2. get profile/level from vps too.
Do you mean it must or always show in VPS?
I think it should alway in SPS if I’m not misunderstand.
> full details you can check at
> https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/hevc.c#L713
I just want get profile, tier and level in hlsenc,
At first I parse the nalunit as the libavformat/hevc, but I think hlsenc maybe 
not
need alloc new memory to save the new extract_rbsp, just get the value is ok 
here.
So I think just check the boundary is ok here, isn’t it?
> 
> thanks
> 
> 
> 
>>> 
>>> +int rbsp_byte_size;
>>> +data += 7;
>>> +/* process by reference General NAL unit syntax */
>>> +profile = *data & 0x1f;
>>> +rbsp_byte_size = st->codecpar->extradata_size - (data -
>> st->codecpar->extradata);
>>> +for (i = 0; i < rbsp_byte_size; i++, data++) {
>>> +if (data[0] == 0 && data[1] == 0 && data[2] == 3) {
>>> +data += 2;
>>> +i++;
>>> +}
>>> +/* skip 8 + 32 + 4 + 43 + 1 bit */
>>> +if (i == 11)
>>> +level = *data;
>>> +}
>>> +break;
>>> +}
>>> +data++;
>>> +}
>>> +if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
>>> +profile != FF_PROFILE_UNKNOWN &&
>>> +level != FF_LEVEL_UNKNOWN) {
>>> +snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01",
>> av_fourcc2str(st->codecpar->codec_tag), profile, level);
>>> +}
>>> } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
>>> snprintf(attr, sizeof(attr), "mp4a.40.33");
>>> } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {
>>> @@ -2247,6 +2284,10 @@ static int hls_write_header(AVFormatContext *s)
>>> continue;
>>> }
>>> avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits,
>> inner_st->time_base.num, inner_st->time_base.den);
>>> +if (outer_st->codecpar->codec_id == AV_CODEC_ID_HEVC &&
>>> +outer_st->codecpar->codec_tag !=
>> MKTAG('h','v','c','1')) {
>>> +av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1, you
>> should use tag:v hvc1 to set it.\n");
>>> +}
>>> write_codec_attr(outer_st, vs);
>>> 
>>> }
>>> --
>>> 2.25.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".
>> 
>> Thanks
>> Steven
>> 
>> 
>> 
>> 
>> 
>> 
>> 
> ___
> ffmpeg-devel mailing list
> 

Re: [FFmpeg-devel] [PATCH] avfilter/vf_bwdif_cuda: CUDA implementation of bwdif

2020-10-12 Thread Philip Langdale
On Sun, 11 Oct 2020 18:36:42 +0200
Thomas Mundt  wrote:

> Hi Philip,
> 
> Am Fr., 9. Okt. 2020 um 18:33 Uhr schrieb Philip Langdale
>  >:  
> 
> > I've been sitting on this for a couple of years now, and I figured I
> > should just send it out. This is what I believe is a conceptually
> > correct port of bwdif to cuda (modulo edge handling which is not
> > done in the same way because the conditional checks for edges are
> > expensive in cuda, but that's the same as for yadif_cuda).
> >
> > However, I see glitches in some samples where black or white pixels
> > appear in white or black areas respectively. This seems like some
> > sort of under/overflow. I've tried to use the largest cuda types
> > everywhere, and that did appear to improve things but didn't make
> > it go away. This is what led to me never sending this diff over the
> > years, but maybe someone else has insights about this.
> >  
> 
> I am not familiar with cuda. So here is just one difference, which I
> noticed compared to the c code.
> Maybe that is the reason for the glitches.
> 
> > +
> > +template
> > +__inline__ __device__ T filter(T A, T B, T C, T D,
> > +   T a, T b, T c, T d, T e, T f, T g,
> > +   T h, T i, T j, T k, T l, T m, T n,
> > +   int clip_max)
> > +{
> > +T final;
> > +
> > +int fc = C;
> > +int fd = (c + l) >> 1;
> > +int fe = B;
> >  
> 
> In the following you sometimes use B and C directly and sometimes fc
> and fe. Is there a reason for this?

Unfortunately, I can't remember. This may have had something to do with
wanting those calculations to be done with smaller data types, but why
do that? Switch them did not have any obvious visual effect.

> 
> > +
> > +int temporal_diff0 = abs(c - l);
> > +int temporal_diff1 = (abs(g - fc) + abs(f - fe)) >> 1;
> > +int temporal_diff2 = (abs(i - fc) + abs(h - fe)) >> 1;
> > +int diff = max3(temporal_diff0 >> 1, temporal_diff1,
> > temporal_diff2); +
> > +if (!diff) {
> > +final = fd;
> > +} else {
> > +int fb = ((d + m) >> 1) - fc;
> > +int ff = ((c + l) >> 1) - fe;
> >  
> 
> If I don´t miss anything this should be:
> int ff = ((b + k) >> 1) - fe;

I think you're right. This also doesn't seem to change things
significantly; the glitches are still there, but that's not surprising.
This fix would make the non-glitched parts more correct.

Thanks for taking a look. I'll keep banging my head against this one.

--phil
___
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/webvttdec, enc: correctly process files containing STYLE, REGION blocks

2020-10-12 Thread Jan Ekström
On Tue, Oct 13, 2020 at 12:07 AM Dave Evans  wrote:
>
> This patch fixes the total failure to parse cues when style and region
> definition blocks are contained in the input file, and ensures those blocks
> are written to the output when copying.
>

Thank you for taking time to add a FATE test, but unfortunately I am
not sure if this test tests the functionality you have added.

You have added what appears to be parsing of webvtt styles into
extradata in the demuxer, and then writing it out in the muxer. And
the test just outputs this webvtt into ASS, which doesn't keep any of
this since the decoder doesn't translate the newly inserted things
into ASS styles :)

So, I think a more fitting test would be to add this to the webvtt
tests with -c copy and pushing it out as webvtt, I would think?

Jan
___
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/webvttdec, enc: correctly process files containing STYLE, REGION blocks

2020-10-12 Thread Dave Evans
This patch fixes the total failure to parse cues when style and region
definition blocks are contained in the input file, and ensures those blocks
are written to the output when copying.

The test attached needs to be added to samples at the path shown in the
patch in order to validate that the original issue is fixed.

First patch so please go easy :-)

Cheers,
Dave
WEBVTT

REGION
id:son
width:40%
lines:3
regionanchor:20%,80%
viewportanchor:20%,80%
scroll:up

REGION
id:father
width:40%
lines:3
regionanchor:80%,80%
viewportanchor:80%,80%
scroll:up

STYLE
::cue(i) {
  /* make i tags italic */
  font-style: italic
}

STYLE
::cue(v[voice="Son"]) {
  color: magenta
}

STYLE
::cue(v[voice="Father"]) {
  color: yellow
}

00:10.000 --> 00:25.000 region:son align:left
Can I tell you a joke, Dad?

00:12.500 --> 00:27.500 region:father align:right
Sure, I could do with a laugh.

00:15.000 --> 00:30.000 region:son align:left
Where do sheep go to get their hair cut?

00:17.500 --> 00:32.500 region:father align:right
I don't know, son. Where do sheep go to get their hair cut?

00:20.000 --> 00:35.000 region:son align:left
To the baa-baa shop!

00:22.500 --> 00:37.500 region:father align:right
[facepalms]


0001-avformat-webvttdec-enc-correctly-decode-files-contai.patch
Description: Binary data
___
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] [PATCHv2] Document community process

2020-10-12 Thread Tomas Härdin
mån 2020-10-12 klockan 21:31 +0200 skrev Jean-Baptiste Kempf:
> On Mon, 12 Oct 2020, at 20:34, Tomas Härdin wrote:
> > mån 2020-10-12 klockan 09:35 +0200 skrev Jean-Baptiste Kempf:
> > > +Contributors are considered "active contributors" if they have pushed 
> > > more
> > > +than 20 patches in the last 36 months in the main FFmpeg repository, or
> > > +if they have been voted in by the GA.
> > 
> > This might be a problem for parts of the code which see patches only
> > sporadically, like the MXF stuff me and Baptiste maintain. Probably
> > unlikely that the TC overrides devs with domain expertise, but I raise
> > it as a potential issue anyway.
> 
> This is a known issue that might arise, but we had to draw a line.
> Note that you can always voted in as "extra members" if requested.

Fair enough.

/Tomas

___
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 v3 5/6] avformat/rtsp: set return variable in error path

2020-10-12 Thread Andriy Gelman
From: Andriy Gelman 

In this error path ret still stores the number of bytes read in
ffurl_read().

Signed-off-by: Andriy Gelman 
---
 libavformat/rtsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index e9fca034b4..cb9fc31166 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2503,6 +2503,7 @@ static int rtp_read_header(AVFormatContext *s)
 av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d "
 "without an SDP file describing it\n",
  payload_type);
+ret = AVERROR_INVALIDDATA;
 goto fail;
 }
 if (par->codec_type != AVMEDIA_TYPE_DATA) {
-- 
2.28.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 v3 2/6] avformat/rtspdec: fix mem leaks in listen mode if init fails

2020-10-12 Thread Andriy Gelman
From: Andriy Gelman 

Signed-off-by: Andriy Gelman 
---
 libavformat/rtspdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 1ff84cdd56..5a383b5a19 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -694,12 +694,13 @@ static int rtsp_listen(AVFormatContext *s)
 } else if (methodcode == SETUP)
 ret = rtsp_read_setup(s, host, uri);
 if (ret) {
-ffurl_close(rt->rtsp_hd);
 ret = AVERROR_INVALIDDATA;
 goto fail;
 }
 }
 fail:
+ff_rtsp_close_streams(s);
+ff_rtsp_close_connections(s);
 ff_network_close();
 return ret;
 }
-- 
2.28.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 v3 4/6] avformat/rtspdec: cosmetics

2020-10-12 Thread Andriy Gelman
From: Andriy Gelman 

Make error check style consistent with rest of function.
---
 libavformat/rtspdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 7c617837ca..b9fbc45190 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -744,9 +744,9 @@ static int rtsp_read_header(AVFormatContext *s)
 if (rt->initial_pause) {
 /* do not start immediately */
 } else {
-if ((ret = rtsp_read_play(s)) < 0) {
+ret = rtsp_read_play(s);
+if (ret < 0)
 goto fail;
-}
 }
 }
 
-- 
2.28.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 v3 6/6] avformat/rtsp: don't forget to call ff_network_close() on error

2020-10-12 Thread Andriy Gelman
From: Andriy Gelman 

In sdp_read_header() some ff_network_close() calls were missed.

Also in rtp_read_header() update comment to explain why a single
call to ff_network_close() is enough to cover all cases even if
sdp_read_header() returns an error.

Signed-off-by: Andriy Gelman 
---
 libavformat/rtsp.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index cb9fc31166..a8c7ec4a46 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2347,11 +2347,14 @@ static int sdp_read_header(AVFormatContext *s)
 /* read the whole sdp file */
 /* XXX: better loading */
 content = av_malloc(SDP_MAX_SIZE);
-if (!content)
+if (!content) {
+ff_network_close();
 return AVERROR(ENOMEM);
+}
 size = avio_read(s->pb, content, SDP_MAX_SIZE - 1);
 if (size <= 0) {
 av_free(content);
+ff_network_close();
 return AVERROR_INVALIDDATA;
 }
 content[size] ='\0';
@@ -2550,7 +2553,9 @@ static int rtp_read_header(AVFormatContext *s)
 ffio_init_context(, sdp.str, sdp.len, 0, NULL, NULL, NULL, NULL);
 s->pb = 
 
-/* sdp_read_header initializes this again */
+/* if sdp_read_header() fails then following ff_network_close() cancels 
out */
+/* ff_network_init() at the start of this function. Otherwise it cancels 
out */
+/* ff_network_init() inside sdp_read_header() */
 ff_network_close();
 
 rt->media_type_mask = (1 << (AVMEDIA_TYPE_SUBTITLE+1)) - 1;
-- 
2.28.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 v3 3/6] avformat/rtspdec: fix mem leaks in connect mode if init fails

2020-10-12 Thread Andriy Gelman
From: Andriy Gelman 

Fixes #6334

Signed-off-by: Andriy Gelman 
---
 libavformat/rtspdec.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index 5a383b5a19..7c617837ca 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -735,22 +735,26 @@ static int rtsp_read_header(AVFormatContext *s)
 
 rt->real_setup_cache = !s->nb_streams ? NULL :
 av_mallocz_array(s->nb_streams, 2 * sizeof(*rt->real_setup_cache));
-if (!rt->real_setup_cache && s->nb_streams)
-return AVERROR(ENOMEM);
+if (!rt->real_setup_cache && s->nb_streams) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 rt->real_setup = rt->real_setup_cache + s->nb_streams;
 
 if (rt->initial_pause) {
 /* do not start immediately */
 } else {
 if ((ret = rtsp_read_play(s)) < 0) {
-ff_rtsp_close_streams(s);
-ff_rtsp_close_connections(s);
-return ret;
+goto fail;
 }
 }
 }
 
 return 0;
+
+fail:
+rtsp_read_close(s);
+return ret;
 }
 
 int ff_rtsp_tcp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
-- 
2.28.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 v3 1/6] avformat/rtspdec: add network init to listen mode

2020-10-12 Thread Andriy Gelman
From: Andriy Gelman 

As per the docs network initialization is required before ff_url_join().
Furthermore, because the ff_network_init() was skipped, this makes
one additional call to ff_network_close() if the stream exits without
errors.

The was forgotten in the origin commit of the listen mode:
a8ad6ffafe89e3a83f343f69249338e8245816f7

Signed-off-by: Andriy Gelman 
---
 libavformat/rtspdec.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
index ef084a8b2b..1ff84cdd56 100644
--- a/libavformat/rtspdec.c
+++ b/libavformat/rtspdec.c
@@ -640,6 +640,9 @@ static int rtsp_listen(AVFormatContext *s)
 int ret;
 enum RTSPMethod methodcode;
 
+if (!ff_network_init())
+return AVERROR(EIO);
+
 /* extract hostname and port */
 av_url_split(proto, sizeof(proto), auth, sizeof(auth), host, sizeof(host),
  , path, sizeof(path), s->url);
@@ -664,19 +667,19 @@ static int rtsp_listen(AVFormatContext *s)
>interrupt_callback, NULL,
s->protocol_whitelist, 
s->protocol_blacklist, NULL)) {
 av_log(s, AV_LOG_ERROR, "Unable to open RTSP for listening\n");
-return ret;
+goto fail;
 }
 rt->state   = RTSP_STATE_IDLE;
 rt->rtsp_hd_out = rt->rtsp_hd;
 for (;;) { /* Wait for incoming RTSP messages */
 ret = read_line(s, rbuf, sizeof(rbuf), );
 if (ret < 0)
-return ret;
+goto fail;
 ret = parse_command_line(s, rbuf, rbuflen, uri, sizeof(uri), method,
  sizeof(method), );
 if (ret) {
 av_log(s, AV_LOG_ERROR, "RTSP: Unexpected Command\n");
-return ret;
+goto fail;
 }
 
 if (methodcode == ANNOUNCE) {
@@ -692,9 +695,13 @@ static int rtsp_listen(AVFormatContext *s)
 ret = rtsp_read_setup(s, host, uri);
 if (ret) {
 ffurl_close(rt->rtsp_hd);
-return AVERROR_INVALIDDATA;
+ret = AVERROR_INVALIDDATA;
+goto fail;
 }
 }
+fail:
+ff_network_close();
+return ret;
 }
 
 static int rtsp_probe(const AVProbeData *p)
-- 
2.28.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".

Re: [FFmpeg-devel] [PATCHv2] Document community process

2020-10-12 Thread Jean-Baptiste Kempf
On Mon, 12 Oct 2020, at 20:34, Tomas Härdin wrote:
> mån 2020-10-12 klockan 09:35 +0200 skrev Jean-Baptiste Kempf:
> > +Contributors are considered "active contributors" if they have pushed more
> > +than 20 patches in the last 36 months in the main FFmpeg repository, or
> > +if they have been voted in by the GA.
> 
> This might be a problem for parts of the code which see patches only
> sporadically, like the MXF stuff me and Baptiste maintain. Probably
> unlikely that the TC overrides devs with domain expertise, but I raise
> it as a potential issue anyway.

This is a known issue that might arise, but we had to draw a line.
Note that you can always voted in as "extra members" if requested.

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

Re: [FFmpeg-devel] [PATCH] Document community process

2020-10-12 Thread Jean-Baptiste Kempf

On Mon, 12 Oct 2020, at 19:25, Michael Niedermayer wrote:
> On Tue, Oct 06, 2020 at 04:50:19PM +0200, Nicolas George wrote:
> > Jean-Baptiste Kempf (12020-10-05):
> > > General Assembly + Main Elections
> > > ---
> > >  doc/dev_community/community.md | 60 ++
> > >  1 file changed, 60 insertions(+)
> > >  create mode 100644 doc/dev_community/community.md
> > > 
> > > diff --git a/doc/dev_community/community.md 
> > > b/doc/dev_community/community.md
> > > new file mode 100644
> > > index 00..4e17ce4d4f
> > > --- /dev/null
> > > +++ b/doc/dev_community/community.md
> > > @@ -0,0 +1,60 @@
> > > +# FFmpeg project
> > > +
> > > +## Organisation
> > > +
> > > +The FFmpeg project is organized through a community working on global 
> > > consensus.
> > > +
> > > +Decisions are taken by the ensemble of active members, through voting 
> > > and are aided by two committees.
> > 
> > Global nit: I think it would be more readable without a Markdown engine
> > if it were pre-wrapped.
> > 
> > > +
> > > +## General Assembly
> > > +
> > > +The ensemble of active members is called the General Assembly (GA).
> > > +
> > > +The General Assembly is sovereign and legitimate for all its decisions 
> > > regarding the FFmpeg project.
> > > +
> > > +The General Assembly is made up of active contributors.
> > > +
> > > +Contributors are considered "active contributors" if they have pushed 
> > > more than 20 patches in the last 36 months in the main FFmpeg repository, 
> > > or if they have been voted in by the GA.
> > 
> > Should the vote for non-commit contributors expire after 36 months too?
> > 
> > > +
> > > +Additional members are added to the General Assembly through a vote 
> > > after proposal by a member of the General Assembly.
> > > +
> > > +## Voting
> > > +
> > > +Voting is done using a ranked voting system, currently running on 
> > > https://vote.ffmpeg.org/ .
> > > +
> > > +Majority vote means more than 50% of the expressed ballots.
> > > +
> > > +## Technical Committee
> > > +
> > > +The Technical Committee (TC) is here to arbitrage and take decisions 
> > > when technical conflicts occur in the project. They will consider the 
> > > merits of all the positions, judge them and take a decision.
> > > +
> > > +The TC resolves technical conflicts but is not a technical steering 
> > > committee.
> > > +
> > > +Decisions by the TC are binding for all the contributors.
> > > +
> > > +Decisions taken by the TC can be re-opened after 1 year or by a majority 
> > > vote of the General Assembly, requested by one of the member of the GA.
> > > +
> > > +The TC is elected by the General Assembly for a duration of 1 year, and 
> > > is composed of 5 members.
> > > +Members can be reelected if they wish. A majority vote in the General 
> > > Assembly can trigger a new election of the TC.
> > > +
> > > +The members of the TC can be elected from outside of the GA.
> > > +Candidates for election can either be suggested or self-nominated.
> > > +
> > > +The conflict resolution process is detailed in the [resolution process] 
> > > document.
> > > +
> > > +## Community committee
> > > +
> > > +The Community Committee (CC) is here to arbitrage and take decisions 
> > > when inter-personal conflicts occur in the project. It will decide 
> > > quickly and take actions, for the sake of the project.
> > > +
> > > +The CC can remove privileges of offending members, including removal of 
> > > commit access and temporary ban from the community.
> > > +
> > > +Decisions taken by the CC can be re-opened after 1 year or by a majority 
> > > vote of the General Assembly. Indefinite bans from the community must be 
> > > confirmed by the General Assembly, in a majority vote.
> > > +
> > > +The CC is elected by the General Assembly for a duration of 1 year, and 
> > > is composed of 5 members.
> > > +Members can be reelected if they wish. A majority vote in the General 
> > > Assembly can trigger a new election of the CC.
> > > +
> > > +The members of the CC can be elected from outside of the GA.
> > > +Candidates for election can either be suggested or self-nominated.
> > > +
> > > +The CC is governed by and responsible for enforcing the Code of Conduct.
> > > +
> > 
> > This looks good to me on the whole, not repeating comments by Chris.
> > 
> > Two extra comments:
> > 
> > The current list of members of both committees should probably be
> > somewhere on the web page.
> > 
> 
> > There is a need for a mail address to contact committees.
> 
> I can create them, thats easy.

cc@ and tc@ then.

> Has someone confirmed the vote results ?

I think we did, yes.

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

Re: [FFmpeg-devel] [PATCH] avfilter/vf_scale_cuda: unload cuModule when uninit

2020-10-12 Thread Timo Rothenpieler

applied
___
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] Add support for building fuzzer tools for an individual demuxer

2020-10-12 Thread Michael Niedermayer
On Sat, Oct 10, 2020 at 05:41:26PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  Makefile  |  4 
>  tools/Makefile|  3 +++
>  tools/target_dem_fuzzer.c | 11 ++-
>  3 files changed, 17 insertions(+), 1 deletion(-)

will apply

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


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

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

Re: [FFmpeg-devel] [PATCH v2 3/3] avformat/mxfdec: Read Apple private Content Light Level from MXF

2020-10-12 Thread Tomas Härdin
tis 2020-10-06 klockan 16:20 +0200 skrev Michael Niedermayer:
> On Mon, Oct 05, 2020 at 10:18:32AM +0200, Tomas Härdin wrote:
> > tor 2020-10-01 klockan 22:13 +0200 skrev Michael Niedermayer:
> > > On Thu, Oct 01, 2020 at 03:29:19PM +0100, Harry Mallon wrote:
> > > > > On 30 Sep 2020, at 08:32, Michael Niedermayer 
> > > > >  wrote:
> > > > > 
> > > > > fails on big endian
> > > > > 
> > > > > --- src/tests/ref/fate/mxf-probe-applehdr10   2020-09-28 
> > > > > 23:21:12.291897976 +0200
> > > > > +++ tests/data/fate/mxf-probe-applehdr10  2020-09-30 
> > > > > 09:31:38.614653806 +0200
> > > > > @@ -14,7 +14,7 @@
> > > > > has_b_frames=0
> > > > > sample_aspect_ratio=1:1
> > > > > display_aspect_ratio=16:9
> > > > > -pix_fmt=yuv422p10le
> > > > > +pix_fmt=yuv422p10be
> > > > > level=-99
> > > > > color_range=tv
> > > > > color_space=bt2020nc
> > > > > Test mxf-probe-applehdr10 failed. Look at 
> > > > > tests/data/fate/mxf-probe-applehdr10.err for details.
> > > > > src/tests/Makefile:255: recipe for target 'fate-mxf-probe-applehdr10' 
> > > > > failed
> > > > > make: *** [fate-mxf-probe-applehdr10] Error 1
> > > > 
> > > > It seems fair that the pixel type is in native endian.
> > > 
> > > maybe but the endianness of the decoder output doesnt belong in the
> > > comparission
> > > 
> > > 
> > > > I'm not really familiar enough with FATE to provide a patch to fix this 
> > > > though. Do any other FATE tests have wildcards or two versions for big 
> > > > and little endian?
> > > 
> > > i dont see another probe reference file that contains a le/be format
> > > 
> > > we had le/be issues in other places though where they where fixed by 
> > > forcing
> > > a format with specific endianness in the test IIRC
> > 
> > How about something like this?
> 
> it solves the problem here.
> so LGTM

Pushed

/Tomas

___
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 v9] avfilter/avf_aphasemeter: Add out of phase and mono detection

2020-10-12 Thread Paul B Mahol
On Mon, Oct 12, 2020 at 07:01:17PM +0200, Romane Lafon wrote:
> This patch extends aphasemeter to detect out of phase or mono sequences in
> stereo streams. Same patch as v8, but doc updated with the latest master
> branch.
> 

probably fine, gonna apply, if I forgot, ping me.

> Regards,
> Romane

> From 10bcfc2652514e9e212c5a643e83f6614c8017bd Mon Sep 17 00:00:00 2001
> From: Romane Lafon 
> Date: Mon, 12 Oct 2020 18:14:55 +0200
> Subject: [PATCH] avfilter/avf_aphasemeter: Add out of phase and mono detection
> 
> Signed-off-by: Romane Lafon 
> ---
>  doc/filters.texi  |  33 ++
>  libavfilter/avf_aphasemeter.c | 118 +-
>  2 files changed, 150 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 8404f4fb9a..27ff814f3e 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -23340,6 +23340,39 @@ Set color which will be used for drawing median 
> phase. If color is
>  Enable video output. Default is enabled.
>  @end table
>  
> +@subsection phasing detection
> +
> +The filter also detects out of phase and mono sequences in stereo streams.
> +It logs the sequence start, end and duration when it lasts longer or as long 
> as the minimum set.
> +
> +The filter accepts the following options for this detection:
> +
> +@table @option
> +@item phasing
> +Enable mono and out of phase detection. Default is disabled.
> +
> +@item tolerance, t
> +Set phase tolerance for mono detection, in amplitude ratio. Default is 
> @code{0}.
> +Allowed range is @code{[0, 1]}.
> +
> +@item angle, a
> +Set angle threshold for out of phase detection, in degree. Default is 
> @code{170}.
> +Allowed range is @code{[90, 180]}.
> +
> +@item duration, d
> +Set mono or out of phase duration until notification, expressed in seconds. 
> Default is @code{2}.
> +@end table
> +
> +@subsection Examples
> +
> +@itemize
> +@item
> +Complete example with @command{ffmpeg} to detect 1 second of mono with 0.001 
> phase tolerance:
> +@example
> +ffmpeg -i stereo.wav -af 
> aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
> +@end example
> +@end itemize
> +
>  @section avectorscope
>  
>  Convert input audio to a video output, representing the audio vector
> diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
> index 31fc8b1b3f..61da9a90b6 100644
> --- a/libavfilter/avf_aphasemeter.c
> +++ b/libavfilter/avf_aphasemeter.c
> @@ -28,26 +28,43 @@
>  #include "libavutil/intreadwrite.h"
>  #include "libavutil/opt.h"
>  #include "libavutil/parseutils.h"
> +#include "libavutil/timestamp.h"
>  #include "avfilter.h"
>  #include "formats.h"
>  #include "audio.h"
>  #include "video.h"
>  #include "internal.h"
> +#include "float.h"
>  
>  typedef struct AudioPhaseMeterContext {
>  const AVClass *class;
>  AVFrame *out;
>  int do_video;
> +int do_phasing_detection;
>  int w, h;
>  AVRational frame_rate;
>  int contrast[4];
>  uint8_t *mpc_str;
>  uint8_t mpc[4];
>  int draw_median_phase;
> +int is_mono;
> +int is_out_phase;
> +int start_mono_presence;
> +int start_out_phase_presence;
> +float tolerance;
> +float angle;
> +float phase;
> +AVRational time_base;
> +int64_t duration;
> +int64_t frame_end;
> +int64_t mono_idx[2];
> +int64_t out_phase_idx[2];
>  } AudioPhaseMeterContext;
>  
> +#define MAX_DURATION (24*60*60*100LL)
>  #define OFFSET(x) offsetof(AudioPhaseMeterContext, x)
>  #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> +#define get_duration(index) (index[1] - index[0])
>  
>  static const AVOption aphasemeter_options[] = {
>  { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, 
> {.str="25"}, 0, INT_MAX, FLAGS },
> @@ -59,6 +76,13 @@ static const AVOption aphasemeter_options[] = {
>  { "bc", "set blue contrast",  OFFSET(contrast[2]), AV_OPT_TYPE_INT, 
> {.i64=1}, 0, 255, FLAGS },
>  { "mpc", "set median phase color", OFFSET(mpc_str), AV_OPT_TYPE_STRING, 
> {.str = "none"}, 0, 0, FLAGS },
>  { "video", "set video output", OFFSET(do_video), AV_OPT_TYPE_BOOL, {.i64 
> = 1}, 0, 1, FLAGS },
> +{ "phasing", "set mono and out-of-phase detection output", 
> OFFSET(do_phasing_detection), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
> +{ "tolerance", "set phase tolerance for mono detection", 
> OFFSET(tolerance), AV_OPT_TYPE_FLOAT, {.dbl = 0.}, 0, 1, FLAGS },
> +{ "t", "set phase tolerance for mono detection", 
> OFFSET(tolerance), AV_OPT_TYPE_FLOAT, {.dbl = 0.}, 0, 1, FLAGS },
> +{ "angle", "set angle threshold for out-of-phase detection", 
> OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl = 170.}, 90, 180, FLAGS },
> +{ "a", "set angle threshold for out-of-phase detection", 
> OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl = 170.}, 90, 180, FLAGS },
> +{ "duration", "set minimum mono or out-of-phase duration in seconds", 
> OFFSET(duration), 

Re: [FFmpeg-devel] [PATCHv2] Document community process

2020-10-12 Thread Tomas Härdin
mån 2020-10-12 klockan 09:35 +0200 skrev Jean-Baptiste Kempf:
> +Contributors are considered "active contributors" if they have pushed more
> +than 20 patches in the last 36 months in the main FFmpeg repository, or
> +if they have been voted in by the GA.

This might be a problem for parts of the code which see patches only
sporadically, like the MXF stuff me and Baptiste maintain. Probably
unlikely that the TC overrides devs with domain expertise, but I raise
it as a potential issue anyway.

/Tomas

___
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/7] avcodec/vlc, bitstream: Allow to use BE codes to initialize LE VLC

2020-10-12 Thread Michael Niedermayer
Hi

On Mon, Oct 12, 2020 at 10:12:14AM +0200, Andreas Rheinhardt wrote:
> This is easily possible because ff_init_vlc_sparse() already transforms
> both LE as well as BE codes to a normal form internally before
> processing them further. This will be used in subsequent commits.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/bitstream.c |  6 +++---
>  libavcodec/vlc.h   | 29 +++--
>  2 files changed, 22 insertions(+), 13 deletions(-)

Probably ok

thx

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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 v9] avfilter/avf_aphasemeter: Add out of phase and mono detection

2020-10-12 Thread Romane Lafon
This patch extends aphasemeter to detect out of phase or mono sequences in
stereo streams. Same patch as v8, but doc updated with the latest master
branch.

Regards,
Romane
From 10bcfc2652514e9e212c5a643e83f6614c8017bd Mon Sep 17 00:00:00 2001
From: Romane Lafon 
Date: Mon, 12 Oct 2020 18:14:55 +0200
Subject: [PATCH] avfilter/avf_aphasemeter: Add out of phase and mono detection

Signed-off-by: Romane Lafon 
---
 doc/filters.texi  |  33 ++
 libavfilter/avf_aphasemeter.c | 118 +-
 2 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 8404f4fb9a..27ff814f3e 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -23340,6 +23340,39 @@ Set color which will be used for drawing median phase. If color is
 Enable video output. Default is enabled.
 @end table
 
+@subsection phasing detection
+
+The filter also detects out of phase and mono sequences in stereo streams.
+It logs the sequence start, end and duration when it lasts longer or as long as the minimum set.
+
+The filter accepts the following options for this detection:
+
+@table @option
+@item phasing
+Enable mono and out of phase detection. Default is disabled.
+
+@item tolerance, t
+Set phase tolerance for mono detection, in amplitude ratio. Default is @code{0}.
+Allowed range is @code{[0, 1]}.
+
+@item angle, a
+Set angle threshold for out of phase detection, in degree. Default is @code{170}.
+Allowed range is @code{[90, 180]}.
+
+@item duration, d
+Set mono or out of phase duration until notification, expressed in seconds. Default is @code{2}.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Complete example with @command{ffmpeg} to detect 1 second of mono with 0.001 phase tolerance:
+@example
+ffmpeg -i stereo.wav -af aphasemeter=video=0:phasing=1:duration=1:tolerance=0.001 -f null -
+@end example
+@end itemize
+
 @section avectorscope
 
 Convert input audio to a video output, representing the audio vector
diff --git a/libavfilter/avf_aphasemeter.c b/libavfilter/avf_aphasemeter.c
index 31fc8b1b3f..61da9a90b6 100644
--- a/libavfilter/avf_aphasemeter.c
+++ b/libavfilter/avf_aphasemeter.c
@@ -28,26 +28,43 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/opt.h"
 #include "libavutil/parseutils.h"
+#include "libavutil/timestamp.h"
 #include "avfilter.h"
 #include "formats.h"
 #include "audio.h"
 #include "video.h"
 #include "internal.h"
+#include "float.h"
 
 typedef struct AudioPhaseMeterContext {
 const AVClass *class;
 AVFrame *out;
 int do_video;
+int do_phasing_detection;
 int w, h;
 AVRational frame_rate;
 int contrast[4];
 uint8_t *mpc_str;
 uint8_t mpc[4];
 int draw_median_phase;
+int is_mono;
+int is_out_phase;
+int start_mono_presence;
+int start_out_phase_presence;
+float tolerance;
+float angle;
+float phase;
+AVRational time_base;
+int64_t duration;
+int64_t frame_end;
+int64_t mono_idx[2];
+int64_t out_phase_idx[2];
 } AudioPhaseMeterContext;
 
+#define MAX_DURATION (24*60*60*100LL)
 #define OFFSET(x) offsetof(AudioPhaseMeterContext, x)
 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
+#define get_duration(index) (index[1] - index[0])
 
 static const AVOption aphasemeter_options[] = {
 { "rate", "set video rate", OFFSET(frame_rate), AV_OPT_TYPE_VIDEO_RATE, {.str="25"}, 0, INT_MAX, FLAGS },
@@ -59,6 +76,13 @@ static const AVOption aphasemeter_options[] = {
 { "bc", "set blue contrast",  OFFSET(contrast[2]), AV_OPT_TYPE_INT, {.i64=1}, 0, 255, FLAGS },
 { "mpc", "set median phase color", OFFSET(mpc_str), AV_OPT_TYPE_STRING, {.str = "none"}, 0, 0, FLAGS },
 { "video", "set video output", OFFSET(do_video), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS },
+{ "phasing", "set mono and out-of-phase detection output", OFFSET(do_phasing_detection), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, FLAGS },
+{ "tolerance", "set phase tolerance for mono detection", OFFSET(tolerance), AV_OPT_TYPE_FLOAT, {.dbl = 0.}, 0, 1, FLAGS },
+{ "t", "set phase tolerance for mono detection", OFFSET(tolerance), AV_OPT_TYPE_FLOAT, {.dbl = 0.}, 0, 1, FLAGS },
+{ "angle", "set angle threshold for out-of-phase detection", OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl = 170.}, 90, 180, FLAGS },
+{ "a", "set angle threshold for out-of-phase detection", OFFSET(angle), AV_OPT_TYPE_FLOAT, {.dbl = 170.}, 90, 180, FLAGS },
+{ "duration", "set minimum mono or out-of-phase duration in seconds", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=200}, 0, MAX_DURATION, FLAGS },
+{ "d","set minimum mono or out-of-phase duration in seconds", OFFSET(duration), AV_OPT_TYPE_DURATION, {.i64=200}, 0, MAX_DURATION, FLAGS },
 { NULL }
 };
 
@@ -104,6 +128,7 @@ static int config_input(AVFilterLink *inlink)
 AVFilterContext *ctx = inlink->dst;
 AudioPhaseMeterContext *s = ctx->priv;
 int nb_samples;
+

Re: [FFmpeg-devel] [PATCH] Document community process

2020-10-12 Thread Michael Niedermayer
On Tue, Oct 06, 2020 at 04:50:19PM +0200, Nicolas George wrote:
> Jean-Baptiste Kempf (12020-10-05):
> > General Assembly + Main Elections
> > ---
> >  doc/dev_community/community.md | 60 ++
> >  1 file changed, 60 insertions(+)
> >  create mode 100644 doc/dev_community/community.md
> > 
> > diff --git a/doc/dev_community/community.md b/doc/dev_community/community.md
> > new file mode 100644
> > index 00..4e17ce4d4f
> > --- /dev/null
> > +++ b/doc/dev_community/community.md
> > @@ -0,0 +1,60 @@
> > +# FFmpeg project
> > +
> > +## Organisation
> > +
> > +The FFmpeg project is organized through a community working on global 
> > consensus.
> > +
> > +Decisions are taken by the ensemble of active members, through voting and 
> > are aided by two committees.
> 
> Global nit: I think it would be more readable without a Markdown engine
> if it were pre-wrapped.
> 
> > +
> > +## General Assembly
> > +
> > +The ensemble of active members is called the General Assembly (GA).
> > +
> > +The General Assembly is sovereign and legitimate for all its decisions 
> > regarding the FFmpeg project.
> > +
> > +The General Assembly is made up of active contributors.
> > +
> > +Contributors are considered "active contributors" if they have pushed more 
> > than 20 patches in the last 36 months in the main FFmpeg repository, or if 
> > they have been voted in by the GA.
> 
> Should the vote for non-commit contributors expire after 36 months too?
> 
> > +
> > +Additional members are added to the General Assembly through a vote after 
> > proposal by a member of the General Assembly.
> > +
> > +## Voting
> > +
> > +Voting is done using a ranked voting system, currently running on 
> > https://vote.ffmpeg.org/ .
> > +
> > +Majority vote means more than 50% of the expressed ballots.
> > +
> > +## Technical Committee
> > +
> > +The Technical Committee (TC) is here to arbitrage and take decisions when 
> > technical conflicts occur in the project. They will consider the merits of 
> > all the positions, judge them and take a decision.
> > +
> > +The TC resolves technical conflicts but is not a technical steering 
> > committee.
> > +
> > +Decisions by the TC are binding for all the contributors.
> > +
> > +Decisions taken by the TC can be re-opened after 1 year or by a majority 
> > vote of the General Assembly, requested by one of the member of the GA.
> > +
> > +The TC is elected by the General Assembly for a duration of 1 year, and is 
> > composed of 5 members.
> > +Members can be reelected if they wish. A majority vote in the General 
> > Assembly can trigger a new election of the TC.
> > +
> > +The members of the TC can be elected from outside of the GA.
> > +Candidates for election can either be suggested or self-nominated.
> > +
> > +The conflict resolution process is detailed in the [resolution process] 
> > document.
> > +
> > +## Community committee
> > +
> > +The Community Committee (CC) is here to arbitrage and take decisions when 
> > inter-personal conflicts occur in the project. It will decide quickly and 
> > take actions, for the sake of the project.
> > +
> > +The CC can remove privileges of offending members, including removal of 
> > commit access and temporary ban from the community.
> > +
> > +Decisions taken by the CC can be re-opened after 1 year or by a majority 
> > vote of the General Assembly. Indefinite bans from the community must be 
> > confirmed by the General Assembly, in a majority vote.
> > +
> > +The CC is elected by the General Assembly for a duration of 1 year, and is 
> > composed of 5 members.
> > +Members can be reelected if they wish. A majority vote in the General 
> > Assembly can trigger a new election of the CC.
> > +
> > +The members of the CC can be elected from outside of the GA.
> > +Candidates for election can either be suggested or self-nominated.
> > +
> > +The CC is governed by and responsible for enforcing the Code of Conduct.
> > +
> 
> This looks good to me on the whole, not repeating comments by Chris.
> 
> Two extra comments:
> 
> The current list of members of both committees should probably be
> somewhere on the web page.
> 

> There is a need for a mail address to contact committees.

I can create them, thats easy.

Has someone confirmed the vote results ?

In "0618 16:45 Jean-Baptiste K (2,6K) [FFmpeg-devel] [VOTE] General Assembly 
extra members"
it was announced that 
"
 The vote is anonymous. However, for transparency, you can add a self-defined 
identifier to your ballot (numbers only). With that you will be able to 
identify your own ballot in the list of ballots received after the vote has 
ended
 to make sure your ballot has been counted. You will also be able to download 
all ballots and process the ballots with your copy of the voting software to 
make sure the results have not been corrupted.

 The ballots are collected using the CIVS software from Cornell University. The 
results of this vote are computed according to 

Re: [FFmpeg-devel] [PATCH 2/3] avformat/rtspdec: fix mem leaks on init fail

2020-10-12 Thread Andriy Gelman
On Sun, 11. Oct 22:04, Andriy Gelman wrote:
> On Sun, 11. Oct 22:44, Andreas Rheinhardt wrote:
> > Andriy Gelman:
> > > From: Andriy Gelman 
> > > 
> > > Fixes #6334
> > > 
> > > Signed-off-by: Andriy Gelman 
> > > ---
> > >  libavformat/rtspdec.c | 17 ++---
> > >  1 file changed, 10 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c
> > > index b519b6f1a2..623f478585 100644
> > > --- a/libavformat/rtspdec.c
> > > +++ b/libavformat/rtspdec.c
> > > @@ -720,7 +720,7 @@ static int rtsp_read_header(AVFormatContext *s)
> > >  if (rt->rtsp_flags & RTSP_FLAG_LISTEN) {
> > >  ret = rtsp_listen(s);
> > >  if (ret)
> > > -return ret;
> > > +goto fail;
> 
> > 
> > This will add one ff_network_close() to this codepath. Is it really
> > certain that there was a corresponding ff_network_init()? 
> > (And where is
> > the ff_network_init() that is cancelled in rtsp_read_close() anyway?)
> 
> Besides my patch, there is an extra ff_network_init() in ff_rtsp_connect(),
> which is missing from rtsp_listen().
> 
> This means there'll be an extra ff_network_close() call in listen mode (when 
> the
> stream exits without errors). 
> 
> I think the best solution is to remove ff_network_init() from 
> ff_rtsp_connect()
> and then remove ff_network_close() from rtsp_read_close() and the fail path of
> ff_rtsp_connect().   
> 
> Calling ff_network_init() separately in ff_rtsp_connect() seems redundant
> because the function is called in each url_alloc_for_protocol() anyway.. and 
> it
> only complicates the cleanup after init failure. 
> 
> Something else I noticed when debugging the code: 
> From the ffmpeg executable, 
> avformat_network_deinit() is not called in the error path when
> rtsp_read_header() fails. This means we'll have an extra ff_network_init() 
> call
> after the code exits following an error rtsp_read_header().  
> 
> I'm not sure if this is an issue for windows users... (i.e. if it leaves some
> socket resources open), or whether all the resources are automatically closed
> when the ffmpeg binary exits. 
> Would it make sense to add an avformat_network_deinit() in the error path 
> (maybe
> around ffmpeg_opt.c:1167?)
> 
> > 
> > >  } else {
> > >  ret = ff_rtsp_connect(s);
> > >  if (ret)
> > > @@ -728,22 +728,25 @@ static int rtsp_read_header(AVFormatContext *s)
> > >  
> > >  rt->real_setup_cache = !s->nb_streams ? NULL :
> > >  av_mallocz_array(s->nb_streams, 2 * 
> > > sizeof(*rt->real_setup_cache));
> > > -if (!rt->real_setup_cache && s->nb_streams)
> > > -return AVERROR(ENOMEM);
> > > +if (!rt->real_setup_cache && s->nb_streams) {
> > > +ret = AVERROR(ENOMEM);
> > > +goto fail;
> > > +}
> 
> > 
> > With your patch, the calls to ff_network_init() and ff_network_close()
> > cancel each other out if the above allocation fails.
> > 
> 
> Yes, if libavformat is linked to the executable. All the
> ff_network_init()/ff_network_close() should cancel each other out.  

> 
> But from the ffmpeg binary we'll have +1 call to ff_network_init(), because 
> avformat_network_deinit() is skipped in ffmpeg's error path (but
> avforamt_network_init() is still called).
> 

sorry, it is called actually.. I had a mistake in the counts. Please disregard
this comment.

-- 
Andriy
___
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/aacdec_fixed: Limit index in vector_pow43()

2020-10-12 Thread Michael Niedermayer
Fixes: out of array access
Fixes: 
26087/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5724825462767616

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/aacdec_fixed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 9b2145c729..daaf765e0c 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -155,9 +155,9 @@ static void vector_pow43(int *coefs, int len)
 for (i=0; ihttps://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/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF

2020-10-12 Thread Guangxin Xu
On Mon, Oct 12, 2020 at 9:57 PM Steven Liu  wrote:

>
>
> > 在 2020年10月12日,21:45,Guangxin Xu  写道:
> >
> >
> >
> > On Mon, Oct 12, 2020 at 5:18 PM Steven Liu  wrote:
> > fix ticket: 8904
> > parse the SPS from extradata and get profile_tier_level
> > write the profile_tier_level info into CODECS Attribute
> >
> > reference to :
> https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendixes
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  libavformat/hlsenc.c | 41 +
> >  1 file changed, 41 insertions(+)
> >
> > diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> > index cb31d6aed7..574d9f81e9 100644
> > --- a/libavformat/hlsenc.c
> > +++ b/libavformat/hlsenc.c
> > @@ -337,6 +337,43 @@ static void write_codec_attr(AVStream *st,
> VariantStream *vs)
> >  } else {
> >  goto fail;
> >  }
> > +} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
> > +uint8_t *data = st->codecpar->extradata;
> > +int i = 0;
> > +int profile = FF_PROFILE_UNKNOWN;
> > +int level = FF_LEVEL_UNKNOWN;
> > +
> > +if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
> > +profile = st->codecpar->profile;
> > +if (st->codecpar->level != FF_LEVEL_UNKNOWN)
> > +level = st->codecpar->level;
> > +
> > +while (data && (data - st->codecpar->extradata) <
> st->codecpar->extradata_size) {
> > +/* get HEVC SPS NAL and seek to profile_tier_level */
> > +if (data && (data[0] | data[1] | data[2]) == 0 && data[3]
> == 1 && ((data[4] & 0x42) == 0x42)) {
> > Read beyond the boundary if data + 1 - st->codecpar->extradata  >=
> st->codecpar->extradata_size
> ok
> > Is it possible reuese ff_hevc_decode_extradata here?
> it is in libavcodec, i don’t think depend libavcodec in hlsenc is a good
> way, so parse sps here.
>
Then, we have a lot of hard work:
1. remove emulation prevent code.
2. get profile/level from vps too.
full details you can check at
https://github.com/FFmpeg/FFmpeg/blob/master/libavformat/hevc.c#L713
thanks



> >
> > +int rbsp_byte_size;
> > +data += 7;
> > +/* process by reference General NAL unit syntax */
> > +profile = *data & 0x1f;
> > +rbsp_byte_size = st->codecpar->extradata_size - (data -
> st->codecpar->extradata);
> > +for (i = 0; i < rbsp_byte_size; i++, data++) {
> > +if (data[0] == 0 && data[1] == 0 && data[2] == 3) {
> > +data += 2;
> > +i++;
> > +}
> > +/* skip 8 + 32 + 4 + 43 + 1 bit */
> > +if (i == 11)
> > +level = *data;
> > +}
> > +break;
> > +}
> > +data++;
> > +}
> > +if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
> > +profile != FF_PROFILE_UNKNOWN &&
> > +level != FF_LEVEL_UNKNOWN) {
> > +snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01",
> av_fourcc2str(st->codecpar->codec_tag), profile, level);
> > +}
> >  } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
> >  snprintf(attr, sizeof(attr), "mp4a.40.33");
> >  } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {
> > @@ -2247,6 +2284,10 @@ static int hls_write_header(AVFormatContext *s)
> >  continue;
> >  }
> >  avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits,
> inner_st->time_base.num, inner_st->time_base.den);
> > +if (outer_st->codecpar->codec_id == AV_CODEC_ID_HEVC &&
> > +outer_st->codecpar->codec_tag !=
> MKTAG('h','v','c','1')) {
> > +av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1, you
> should use tag:v hvc1 to set it.\n");
> > +}
> >  write_codec_attr(outer_st, vs);
> >
> >  }
> > --
> > 2.25.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".
>
> Thanks
> Steven
>
>
>
>
>
>
>
___
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] [PATCHv2] Document community process

2020-10-12 Thread Thilo Borgmann
Am 12.10.20 um 11:34 schrieb Jean-Baptiste Kempf:
> 
> On Mon, 12 Oct 2020, at 11:28, Steven Liu wrote:
>>> +Voting is done using a ranked voting system, currently running on 
>>> https://vote.ffmpeg.org/ .
>> Hi JB,
>>
>>  I cannot sure if vote.ffmpeg.org denny my IP,
>>  When I click this link, the web return:
>>  502 Bad Gateway
>>
>> nginx/1.10.3 (Ubuntu)
> 
> Yeah, it is currently down (we don't have a vote), but I'll see with Thilo.

vote.ffmpeg.org is up and running again.

-Thilo

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

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

Re: [FFmpeg-devel] [PATCH] avformat/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF

2020-10-12 Thread Guangxin Xu
On Mon, Oct 12, 2020 at 5:18 PM Steven Liu  wrote:

> fix ticket: 8904
> parse the SPS from extradata and get profile_tier_level
> write the profile_tier_level info into CODECS Attribute
>
> reference to :
> https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendixes
>
> Signed-off-by: Steven Liu 
> ---
>  libavformat/hlsenc.c | 41 +
>  1 file changed, 41 insertions(+)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index cb31d6aed7..574d9f81e9 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -337,6 +337,43 @@ static void write_codec_attr(AVStream *st,
> VariantStream *vs)
>  } else {
>  goto fail;
>  }
> +} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
> +uint8_t *data = st->codecpar->extradata;
> +int i = 0;
> +int profile = FF_PROFILE_UNKNOWN;
> +int level = FF_LEVEL_UNKNOWN;
> +
> +if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
> +profile = st->codecpar->profile;
> +if (st->codecpar->level != FF_LEVEL_UNKNOWN)
> +level = st->codecpar->level;
> +
> +while (data && (data - st->codecpar->extradata) <
> st->codecpar->extradata_size) {
> +/* get HEVC SPS NAL and seek to profile_tier_level */
> +if (data && (data[0] | data[1] | data[2]) == 0 && data[3] ==
> 1 && ((data[4] & 0x42) == 0x42)) {
>
Read beyond the boundary if data + 1 - st->codecpar->extradata  >=
st->codecpar->extradata_size
Is it possible reuese ff_hevc_decode_extradata here?

+int rbsp_byte_size;
> +data += 7;
> +/* process by reference General NAL unit syntax */
> +profile = *data & 0x1f;
> +rbsp_byte_size = st->codecpar->extradata_size - (data -
> st->codecpar->extradata);
> +for (i = 0; i < rbsp_byte_size; i++, data++) {
> +if (data[0] == 0 && data[1] == 0 && data[2] == 3) {
> +data += 2;
> +i++;
> +}
> +/* skip 8 + 32 + 4 + 43 + 1 bit */
> +if (i == 11)
> +level = *data;
> +}
> +break;
> +}
> +data++;
> +}
> +if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
> +profile != FF_PROFILE_UNKNOWN &&
> +level != FF_LEVEL_UNKNOWN) {
> +snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01",
> av_fourcc2str(st->codecpar->codec_tag), profile, level);
> +}
>  } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
>  snprintf(attr, sizeof(attr), "mp4a.40.33");
>  } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {
> @@ -2247,6 +2284,10 @@ static int hls_write_header(AVFormatContext *s)
>  continue;
>  }
>  avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits,
> inner_st->time_base.num, inner_st->time_base.den);
> +if (outer_st->codecpar->codec_id == AV_CODEC_ID_HEVC &&
> +outer_st->codecpar->codec_tag != MKTAG('h','v','c','1')) {
> +av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1, you
> should use tag:v hvc1 to set it.\n");
> +}
>  write_codec_attr(outer_st, vs);
>
>  }
> --
> 2.25.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 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/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF

2020-10-12 Thread Steven Liu


> 在 2020年10月12日,21:45,Guangxin Xu  写道:
> 
> 
> 
> On Mon, Oct 12, 2020 at 5:18 PM Steven Liu  wrote:
> fix ticket: 8904
> parse the SPS from extradata and get profile_tier_level
> write the profile_tier_level info into CODECS Attribute
> 
> reference to 
> :https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendixes
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/hlsenc.c | 41 +
>  1 file changed, 41 insertions(+)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index cb31d6aed7..574d9f81e9 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -337,6 +337,43 @@ static void write_codec_attr(AVStream *st, VariantStream 
> *vs)
>  } else {
>  goto fail;
>  }
> +} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
> +uint8_t *data = st->codecpar->extradata;
> +int i = 0;
> +int profile = FF_PROFILE_UNKNOWN;
> +int level = FF_LEVEL_UNKNOWN;
> +
> +if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
> +profile = st->codecpar->profile;
> +if (st->codecpar->level != FF_LEVEL_UNKNOWN)
> +level = st->codecpar->level;
> +
> +while (data && (data - st->codecpar->extradata) < 
> st->codecpar->extradata_size) {
> +/* get HEVC SPS NAL and seek to profile_tier_level */
> +if (data && (data[0] | data[1] | data[2]) == 0 && data[3] == 1 
> && ((data[4] & 0x42) == 0x42)) {
> Read beyond the boundary if data + 1 - st->codecpar->extradata  >=
> st->codecpar->extradata_size 
ok
> Is it possible reuese ff_hevc_decode_extradata here?
it is in libavcodec, i don’t think depend libavcodec in hlsenc is a good way, 
so parse sps here.
> 
> +int rbsp_byte_size;
> +data += 7;
> +/* process by reference General NAL unit syntax */
> +profile = *data & 0x1f;
> +rbsp_byte_size = st->codecpar->extradata_size - (data - 
> st->codecpar->extradata);
> +for (i = 0; i < rbsp_byte_size; i++, data++) {
> +if (data[0] == 0 && data[1] == 0 && data[2] == 3) {
> +data += 2;
> +i++;
> +}
> +/* skip 8 + 32 + 4 + 43 + 1 bit */
> +if (i == 11)
> +level = *data;
> +}
> +break;
> +}
> +data++;
> +}
> +if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
> +profile != FF_PROFILE_UNKNOWN &&
> +level != FF_LEVEL_UNKNOWN) {
> +snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", 
> av_fourcc2str(st->codecpar->codec_tag), profile, level);
> +}
>  } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
>  snprintf(attr, sizeof(attr), "mp4a.40.33");
>  } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {
> @@ -2247,6 +2284,10 @@ static int hls_write_header(AVFormatContext *s)
>  continue;
>  }
>  avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits, 
> inner_st->time_base.num, inner_st->time_base.den);
> +if (outer_st->codecpar->codec_id == AV_CODEC_ID_HEVC &&
> +outer_st->codecpar->codec_tag != MKTAG('h','v','c','1')) {
> +av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1, you 
> should use tag:v hvc1 to set it.\n");
> +}
>  write_codec_attr(outer_st, vs);
> 
>  }
> -- 
> 2.25.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".

Thanks
Steven






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

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

[FFmpeg-devel] [PATCH] avfilter/vf_scale_cuda: unload cuModule when uninit

2020-10-12 Thread leozhang
Signed-off-by: leozhang 
---
 libavfilter/vf_scale_cuda.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/libavfilter/vf_scale_cuda.c b/libavfilter/vf_scale_cuda.c
index 1ffb73f831..46d69b00ee 100644
--- a/libavfilter/vf_scale_cuda.c
+++ b/libavfilter/vf_scale_cuda.c
@@ -119,7 +119,15 @@ static av_cold int cudascale_init(AVFilterContext *ctx)
 static av_cold void cudascale_uninit(AVFilterContext *ctx)
 {
 CUDAScaleContext *s = ctx->priv;
+CUcontext dummy;
 
+if (s->hwctx && s->cu_module) {
+CudaFunctions *cu = s->hwctx->internal->cuda_dl;
+CHECK_CU(cu->cuCtxPushCurrent(s->hwctx->cuda_ctx));
+CHECK_CU(cu->cuModuleUnload(s->cu_module));
+s->cu_module = NULL;
+CHECK_CU(cu->cuCtxPopCurrent());
+}
 av_frame_free(>frame);
 av_buffer_unref(>frames_ctx);
 av_frame_free(>tmp_frame);
-- 
2.11.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".

Re: [FFmpeg-devel] [PATCH 5/7] avcodec/speedhq: Avoid reversing BE codes for LE bitstream reader

2020-10-12 Thread Paul B Mahol
On Mon, Oct 12, 2020 at 10:12:15AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/speedhq.c | 41 +
>  1 file changed, 9 insertions(+), 32 deletions(-)

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

Re: [FFmpeg-devel] [PATCH 1/7] avcodec/indeo2: Remove #ifdef BITSTREAM_READER_LE cruft

2020-10-12 Thread Paul B Mahol
On Mon, Oct 12, 2020 at 10:12:11AM +0200, Andreas Rheinhardt wrote:
> Before the LE bitstream reader was used in the Indeo 2 decoder,
> a standard BE bitstream reader with swapped bits was used; when the LE
> bitstream reader was added, the old code was only #ifdef'ed away and not
> removed. Said code has several problems: It modifies the input packet
> without ensuring that the packet is indeed writable; and it doesn't work
> since 09c4e5c5988c0037d108c5fc2a137d9ad488f7f4 because said commit
> removed the BE table used to initialize the VLC table. So just remove
> this cruft from the actual decoder, too.
> 
> Also use INIT_LE_VLC_STATIC while at it.

lgtm

> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/indeo2.c | 19 +++
>  1 file changed, 3 insertions(+), 16 deletions(-)
> 
> diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
> index ccf6cd84cb..7a568bfbc4 100644
> --- a/libavcodec/indeo2.c
> +++ b/libavcodec/indeo2.c
> @@ -174,10 +174,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
>  s->decode_delta = buf[18];
>  
>  /* decide whether frame uses deltas or not */
> -#ifndef BITSTREAM_READER_LE
> -for (i = 0; i < buf_size; i++)
> -buf[i] = ff_reverse[buf[i]];
> -#endif
>  
>  if ((ret = init_get_bits8(>gb, buf + start, buf_size - start)) < 0)
>  return ret;
> @@ -232,7 +228,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
>  static av_cold int ir2_decode_init(AVCodecContext *avctx)
>  {
>  Ir2Context * const ic = avctx->priv_data;
> -static VLC_TYPE vlc_tables[1 << CODE_VLC_BITS][2];
>  
>  ic->avctx = avctx;
>  
> @@ -242,17 +237,9 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx)
>  if (!ic->picture)
>  return AVERROR(ENOMEM);
>  
> -ir2_vlc.table = vlc_tables;
> -ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
> -#ifdef BITSTREAM_READER_LE
> -init_vlc(_vlc, CODE_VLC_BITS, IR2_CODES,
> - _codes[0][1], 4, 2,
> - _codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | 
> INIT_VLC_LE);
> -#else
> -init_vlc(_vlc, CODE_VLC_BITS, IR2_CODES,
> - _codes[0][1], 4, 2,
> - _codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
> -#endif
> +INIT_LE_VLC_STATIC(_vlc, CODE_VLC_BITS, IR2_CODES,
> +   _codes[0][1], 4, 2,
> +   _codes[0][0], 4, 2, 1 << CODE_VLC_BITS);
>  
>  return 0;
>  }
> -- 
> 2.25.1
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
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 6/7] avcodec/ivi: Avoid reversing BE VLC codes for LE bitstream reader

2020-10-12 Thread Paul B Mahol
On Mon, Oct 12, 2020 at 10:12:16AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/ivi.c | 22 ++
>  1 file changed, 2 insertions(+), 20 deletions(-)

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

Re: [FFmpeg-devel] [PATCH 7/7] avcodec/webp: Use LE VLC table for LE bitstream reader

2020-10-12 Thread Paul B Mahol
On Mon, Oct 12, 2020 at 10:12:17AM +0200, Andreas Rheinhardt wrote:
> The WebP format uses Huffman tables and the decoder therefore uses
> VLC tables. Given that WebP is a LE format, a LE bitreader is used;
> yet the VLC table is not created for a LE reader (the process used to
> create the tables puts the last bit to be read in the lowest bit) and
> therefore custom code for reading the VLCs that reverses the bits
> read is used instead of get_vlc2(). This commit changes this to use
> a table designed for LE bitreader which allows to use get_vlc2() directly.
> The necessary reversing of the codes is delegated to
> ff_init_vlc_sparse() (and is therefore only done during init and not
> when actually reading the VLCs).

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

Re: [FFmpeg-devel] [PATCH 3/7] avcodec/speedhq: Don't use ff_ prefix for static symbols

2020-10-12 Thread Paul B Mahol
On Mon, Oct 12, 2020 at 10:12:13AM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/speedhq.c | 34 +-
>  1 file changed, 17 insertions(+), 17 deletions(-)


lgtm

> 
> diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
> index 64758164de..5759cdb036 100644
> --- a/libavcodec/speedhq.c
> +++ b/libavcodec/speedhq.c
> @@ -132,7 +132,7 @@ static const uint8_t speedhq_run[121] = {
>  31,
>  };
>  
> -static RLTable ff_rl_speedhq = {
> +static RLTable rl_speedhq = {
>  121,
>  121,
>  (const uint16_t (*)[])speedhq_vlc,
> @@ -152,21 +152,21 @@ static const uint8_t unscaled_quant_matrix[64] = {
>  27, 29, 35, 38, 46, 56, 69, 83
>  };
>  
> -static uint8_t ff_speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 
> 3];
> +static uint8_t speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
>  
> -static VLC ff_dc_lum_vlc_le;
> -static VLC ff_dc_chroma_vlc_le;
> -static VLC ff_dc_alpha_run_vlc_le;
> -static VLC ff_dc_alpha_level_vlc_le;
> +static VLC dc_lum_vlc_le;
> +static VLC dc_chroma_vlc_le;
> +static VLC dc_alpha_run_vlc_le;
> +static VLC dc_alpha_level_vlc_le;
>  
>  static inline int decode_dc_le(GetBitContext *gb, int component)
>  {
>  int code, diff;
>  
>  if (component == 0 || component == 3) {
> -code = get_vlc2(gb, ff_dc_lum_vlc_le.table, DC_VLC_BITS, 2);
> +code = get_vlc2(gb, dc_lum_vlc_le.table, DC_VLC_BITS, 2);
>  } else {
> -code = get_vlc2(gb, ff_dc_chroma_vlc_le.table, DC_VLC_BITS, 2);
> +code = get_vlc2(gb, dc_chroma_vlc_le.table, DC_VLC_BITS, 2);
>  }
>  if (!code) {
>  diff = 0;
> @@ -190,7 +190,7 @@ static inline int decode_alpha_block(const SHQContext *s, 
> GetBitContext *gb, uin
>  int run, level;
>  
>  UPDATE_CACHE_LE(re, gb);
> -GET_VLC(run, re, gb, ff_dc_alpha_run_vlc_le.table, 
> ALPHA_VLC_BITS, 2);
> +GET_VLC(run, re, gb, dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 
> 2);
>  
>  if (run < 0) break;
>  i += run;
> @@ -198,7 +198,7 @@ static inline int decode_alpha_block(const SHQContext *s, 
> GetBitContext *gb, uin
>  return AVERROR_INVALIDDATA;
>  
>  UPDATE_CACHE_LE(re, gb);
> -GET_VLC(level, re, gb, ff_dc_alpha_level_vlc_le.table, 
> ALPHA_VLC_BITS, 2);
> +GET_VLC(level, re, gb, dc_alpha_level_vlc_le.table, 
> ALPHA_VLC_BITS, 2);
>  block[i++] = level;
>  }
>  
> @@ -236,7 +236,7 @@ static inline int decode_dct_block(const SHQContext *s, 
> GetBitContext *gb, int l
>  for ( ;; ) {
>  int level, run;
>  UPDATE_CACHE_LE(re, gb);
> -GET_RL_VLC(level, run, re, gb, ff_rl_speedhq.rl_vlc[0],
> +GET_RL_VLC(level, run, re, gb, rl_speedhq.rl_vlc[0],
> TEX_VLC_BITS, 2, 0);
>  if (level == 127) {
>  break;
> @@ -511,7 +511,7 @@ static av_cold void compute_alpha_vlcs(void)
>  
>  av_assert0(entry == FF_ARRAY_ELEMS(run_code));
>  
> -INIT_LE_VLC_SPARSE_STATIC(_dc_alpha_run_vlc_le, ALPHA_VLC_BITS,
> +INIT_LE_VLC_SPARSE_STATIC(_alpha_run_vlc_le, ALPHA_VLC_BITS,
>FF_ARRAY_ELEMS(run_code),
>run_bits, 1, 1,
>run_code, 2, 2,
> @@ -551,7 +551,7 @@ static av_cold void compute_alpha_vlcs(void)
>  
>  av_assert0(entry == FF_ARRAY_ELEMS(level_code));
>  
> -INIT_LE_VLC_SPARSE_STATIC(_dc_alpha_level_vlc_le, ALPHA_VLC_BITS,
> +INIT_LE_VLC_SPARSE_STATIC(_alpha_level_vlc_le, ALPHA_VLC_BITS,
>FF_ARRAY_ELEMS(level_code),
>level_bits, 1, 1,
>level_code, 2, 2,
> @@ -582,19 +582,19 @@ static av_cold void speedhq_static_init(void)
>   ff_mpeg12_vlc_dc_lum_bits,
>   ff_mpeg12_vlc_dc_lum_code_reversed,
>   12);
> -INIT_LE_VLC_STATIC(_dc_lum_vlc_le, DC_VLC_BITS, 12,
> +INIT_LE_VLC_STATIC(_lum_vlc_le, DC_VLC_BITS, 12,
> ff_mpeg12_vlc_dc_lum_bits, 1, 1,
> ff_mpeg12_vlc_dc_lum_code_reversed, 2, 2, 512);
>  reverse_code(ff_mpeg12_vlc_dc_chroma_code,
>   ff_mpeg12_vlc_dc_chroma_bits,
>   ff_mpeg12_vlc_dc_chroma_code_reversed,
>   12);
> -INIT_LE_VLC_STATIC(_dc_chroma_vlc_le, DC_VLC_BITS, 12,
> +INIT_LE_VLC_STATIC(_chroma_vlc_le, DC_VLC_BITS, 12,
> ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
> ff_mpeg12_vlc_dc_chroma_code_reversed, 2, 2, 514);
>  
> -ff_rl_init(_rl_speedhq, ff_speedhq_static_rl_table_store);
> -INIT_2D_VLC_RL(ff_rl_speedhq, 674, INIT_VLC_LE);
> +ff_rl_init(_speedhq, speedhq_static_rl_table_store);
> +INIT_2D_VLC_RL(rl_speedhq, 674, INIT_VLC_LE);
>  
>  

Re: [FFmpeg-devel] [PATCHv2] Document community process

2020-10-12 Thread Jean-Baptiste Kempf

On Mon, 12 Oct 2020, at 11:28, Steven Liu wrote:
> > +Voting is done using a ranked voting system, currently running on 
> > https://vote.ffmpeg.org/ .
> Hi JB,
> 
>   I cannot sure if vote.ffmpeg.org denny my IP,
>   When I click this link, the web return:
>   502 Bad Gateway
> 
> nginx/1.10.3 (Ubuntu)

Yeah, it is currently down (we don't have a vote), but I'll see with Thilo.

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

Re: [FFmpeg-devel] [PATCHv2] Document community process

2020-10-12 Thread Steven Liu


> 2020年10月12日 下午3:35,Jean-Baptiste Kempf  写道:
> 
> General Assembly + Main Elections
> ---
> doc/dev_community/community.md | 80 ++
> 1 file changed, 80 insertions(+)
> create mode 100644 doc/dev_community/community.md
> 
> diff --git a/doc/dev_community/community.md b/doc/dev_community/community.md
> new file mode 100644
> index 00..2ce3aa0b30
> --- /dev/null
> +++ b/doc/dev_community/community.md
> @@ -0,0 +1,80 @@
> +# FFmpeg project
> +
> +## Organisation
> +
> +The FFmpeg project is organized through a community working on global 
> consensus.
> +
> +Decisions are taken by the ensemble of active members, through voting and
> +are aided by two committees.
> +
> +## General Assembly
> +
> +The ensemble of active members is called the General Assembly (GA).
> +
> +The General Assembly is sovereign and legitimate for all its decisions
> +regarding the FFmpeg project.
> +
> +The General Assembly is made up of active contributors.
> +
> +Contributors are considered "active contributors" if they have pushed more
> +than 20 patches in the last 36 months in the main FFmpeg repository, or
> +if they have been voted in by the GA.
> +
> +Additional members are added to the General Assembly through a vote after
> +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.
> +
> +## Voting
> +
> +Voting is done using a ranked voting system, currently running on 
> https://vote.ffmpeg.org/ .
Hi JB,

I cannot sure if vote.ffmpeg.org denny my IP,
When I click this link, the web return:
502 Bad Gateway

nginx/1.10.3 (Ubuntu)


> +
> +Majority vote means more than 50% of the expressed ballots.
> +
> +## Technical Committee
> +
> +The Technical Committee (TC) is here to arbitrate and make decisions when
> +technical conflicts occur in the project.
> +They will consider the merits of all the positions, judge them and make a
> +decision.
> +
> +The TC resolves technical conflicts but is not a technical steering 
> committee.
> +
> +Decisions by the TC are binding for all the contributors.
> +
> +Decisions made by the TC can be re-opened after 1 year or by a majority vote
> +of the General Assembly, requested by one of the member of the GA.
> +
> +The TC is elected by the General Assembly for a duration of 1 year, and
> +is composed of 5 members.
> +Members can be re-elected if they wish. A majority vote in the General 
> Assembly
> +can trigger a new election of the TC.
> +
> +The members of the TC can be elected from outside of the GA.
> +Candidates for election can either be suggested or self-nominated.
> +
> +The conflict resolution process is detailed in the [resolution process] 
> document.
> +
> +## Community committee
> +
> +The Community Committee (CC) is here to arbitrage and make decisions when
> +inter-personal conflicts occur in the project. It will decide quickly and
> +take actions, for the sake of the project.
> +
> +The CC can remove privileges of offending members, including removal of
> +commit access and temporary ban from the community.
> +
> +Decisions made by the CC can be re-opened after 1 year or by a majority vote
> +of the General Assembly. Indefinite bans from the community must be confirmed
> +by the General Assembly, in a majority vote.
> +
> +The CC is elected by the General Assembly for a duration of 1 year, and is
> +composed of 5 members.
> +Members can be re-elected if they wish. A majority vote in the General 
> Assembly
> +can trigger a new election of the CC.
> +
> +The members of the CC can be elected from outside of the GA.
> +Candidates for election can either be suggested or self-nominated.
> +
> +The CC is governed by and responsible for enforcing the Code of Conduct.
> +
> -- 
> 2.28.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".

Thanks

Steven Liu



___
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/hlsenc: support CODECS Attribute in hevc EXT-X-STREAM-INF

2020-10-12 Thread Steven Liu
fix ticket: 8904
parse the SPS from extradata and get profile_tier_level
write the profile_tier_level info into CODECS Attribute

reference to 
:https://developer.apple.com/documentation/http_live_streaming/hls_authoring_specification_for_apple_devices/hls_authoring_specification_for_apple_devices_appendixes

Signed-off-by: Steven Liu 
---
 libavformat/hlsenc.c | 41 +
 1 file changed, 41 insertions(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index cb31d6aed7..574d9f81e9 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -337,6 +337,43 @@ static void write_codec_attr(AVStream *st, VariantStream 
*vs)
 } else {
 goto fail;
 }
+} else if (st->codecpar->codec_id == AV_CODEC_ID_HEVC) {
+uint8_t *data = st->codecpar->extradata;
+int i = 0;
+int profile = FF_PROFILE_UNKNOWN;
+int level = FF_LEVEL_UNKNOWN;
+
+if (st->codecpar->profile != FF_PROFILE_UNKNOWN)
+profile = st->codecpar->profile;
+if (st->codecpar->level != FF_LEVEL_UNKNOWN)
+level = st->codecpar->level;
+
+while (data && (data - st->codecpar->extradata) < 
st->codecpar->extradata_size) {
+/* get HEVC SPS NAL and seek to profile_tier_level */
+if (data && (data[0] | data[1] | data[2]) == 0 && data[3] == 1 && 
((data[4] & 0x42) == 0x42)) {
+int rbsp_byte_size;
+data += 7;
+/* process by reference General NAL unit syntax */
+profile = *data & 0x1f;
+rbsp_byte_size = st->codecpar->extradata_size - (data - 
st->codecpar->extradata);
+for (i = 0; i < rbsp_byte_size; i++, data++) {
+if (data[0] == 0 && data[1] == 0 && data[2] == 3) {
+data += 2;
+i++;
+}
+/* skip 8 + 32 + 4 + 43 + 1 bit */
+if (i == 11)
+level = *data;
+}
+break;
+}
+data++;
+}
+if (st->codecpar->codec_tag == MKTAG('h','v','c','1') &&
+profile != FF_PROFILE_UNKNOWN &&
+level != FF_LEVEL_UNKNOWN) {
+snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", 
av_fourcc2str(st->codecpar->codec_tag), profile, level);
+}
 } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
 snprintf(attr, sizeof(attr), "mp4a.40.33");
 } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {
@@ -2247,6 +2284,10 @@ static int hls_write_header(AVFormatContext *s)
 continue;
 }
 avpriv_set_pts_info(outer_st, inner_st->pts_wrap_bits, 
inner_st->time_base.num, inner_st->time_base.den);
+if (outer_st->codecpar->codec_id == AV_CODEC_ID_HEVC &&
+outer_st->codecpar->codec_tag != MKTAG('h','v','c','1')) {
+av_log(s, AV_LOG_WARNING, "Stream HEVC is not hvc1, you should 
use tag:v hvc1 to set it.\n");
+}
 write_codec_attr(outer_st, vs);
 
 }
-- 
2.25.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 5/7] avcodec/speedhq: Avoid reversing BE codes for LE bitstream reader

2020-10-12 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/speedhq.c | 41 +
 1 file changed, 9 insertions(+), 32 deletions(-)

diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index 5759cdb036..30a6924321 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -558,40 +558,17 @@ static av_cold void compute_alpha_vlcs(void)
   level_symbols, 2, 2, 288);
 }
 
-static uint32_t reverse(uint32_t num, int bits)
-{
-return bitswap_32(num) >> (32 - bits);
-}
-
-static void reverse_code(const uint16_t *code, const uint8_t *bits,
- uint16_t *reversed_code, int num_entries)
-{
-int i;
-for (i = 0; i < num_entries; i++) {
-reversed_code[i] = reverse(code[i], bits[i]);
-}
-}
-
 static av_cold void speedhq_static_init(void)
 {
-uint16_t ff_mpeg12_vlc_dc_lum_code_reversed[12];
-uint16_t ff_mpeg12_vlc_dc_chroma_code_reversed[12];
-
-/* Exactly the same as MPEG-2, except little-endian. */
-reverse_code(ff_mpeg12_vlc_dc_lum_code,
- ff_mpeg12_vlc_dc_lum_bits,
- ff_mpeg12_vlc_dc_lum_code_reversed,
- 12);
-INIT_LE_VLC_STATIC(_lum_vlc_le, DC_VLC_BITS, 12,
-   ff_mpeg12_vlc_dc_lum_bits, 1, 1,
-   ff_mpeg12_vlc_dc_lum_code_reversed, 2, 2, 512);
-reverse_code(ff_mpeg12_vlc_dc_chroma_code,
- ff_mpeg12_vlc_dc_chroma_bits,
- ff_mpeg12_vlc_dc_chroma_code_reversed,
- 12);
-INIT_LE_VLC_STATIC(_chroma_vlc_le, DC_VLC_BITS, 12,
-   ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
-   ff_mpeg12_vlc_dc_chroma_code_reversed, 2, 2, 514);
+/* Exactly the same as MPEG-2, except for a little-endian reader. */
+INIT_CUSTOM_VLC_STATIC(_lum_vlc_le, DC_VLC_BITS, 12,
+   ff_mpeg12_vlc_dc_lum_bits, 1, 1,
+   ff_mpeg12_vlc_dc_lum_code, 2, 2,
+   INIT_VLC_OUTPUT_LE, 512);
+INIT_CUSTOM_VLC_STATIC(_chroma_vlc_le, DC_VLC_BITS, 12,
+   ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
+   ff_mpeg12_vlc_dc_chroma_code, 2, 2,
+   INIT_VLC_OUTPUT_LE, 514);
 
 ff_rl_init(_speedhq, speedhq_static_rl_table_store);
 INIT_2D_VLC_RL(rl_speedhq, 674, INIT_VLC_LE);
-- 
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 4/7] avcodec/vlc, bitstream: Allow to use BE codes to initialize LE VLC

2020-10-12 Thread Andreas Rheinhardt
This is easily possible because ff_init_vlc_sparse() already transforms
both LE as well as BE codes to a normal form internally before
processing them further. This will be used in subsequent commits.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/bitstream.c |  6 +++---
 libavcodec/vlc.h   | 29 +++--
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c
index 95e5092b44..77c2b9ce05 100644
--- a/libavcodec/bitstream.c
+++ b/libavcodec/bitstream.c
@@ -182,7 +182,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int 
nb_codes,
 j = code >> (32 - table_nb_bits);
 nb = 1 << (table_nb_bits - n);
 inc = 1;
-if (flags & INIT_VLC_LE) {
+if (flags & INIT_VLC_OUTPUT_LE) {
 j = bitswap_32(code);
 inc = 1 << n;
 }
@@ -217,7 +217,7 @@ static int build_table(VLC *vlc, int table_nb_bits, int 
nb_codes,
 subtable_bits = FFMAX(subtable_bits, n);
 }
 subtable_bits = FFMIN(subtable_bits, table_nb_bits);
-j = (flags & INIT_VLC_LE) ? bitswap_32(code_prefix) >> (32 - 
table_nb_bits) : code_prefix;
+j = (flags & INIT_VLC_OUTPUT_LE) ? bitswap_32(code_prefix) >> (32 
- table_nb_bits) : code_prefix;
 table[j][1] = -subtable_bits;
 ff_dlog(NULL, "%4x: n=%d (subtable)\n",
 j, codes[i].bits + table_nb_bits);
@@ -319,7 +319,7 @@ int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int 
nb_codes,
 av_free(buf);   \
 return AVERROR(EINVAL); \
 }   \
-if (flags & INIT_VLC_LE)\
+if (flags & INIT_VLC_INPUT_LE)  \
 buf[j].code = bitswap_32(buf[j].code);  \
 else\
 buf[j].code <<= 32 - buf[j].bits;   \
diff --git a/libavcodec/vlc.h b/libavcodec/vlc.h
index 42ccddf3fc..22d3e33485 100644
--- a/libavcodec/vlc.h
+++ b/libavcodec/vlc.h
@@ -51,26 +51,35 @@ int ff_init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes,
int flags);
 void ff_free_vlc(VLC *vlc);
 
-#define INIT_VLC_LE 2
+/* If INIT_VLC_INPUT_LE is set, the LSB bit of the codes used to
+ * initialize the VLC table is the first bit to be read. */
+#define INIT_VLC_INPUT_LE   2
+/* If set the VLC is intended for a little endian bitstream reader. */
+#define INIT_VLC_OUTPUT_LE  8
+#define INIT_VLC_LE (INIT_VLC_INPUT_LE | INIT_VLC_OUTPUT_LE)
 #define INIT_VLC_USE_NEW_STATIC 4
 
-#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, 
static_size) \
+#define INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g,  \
+  h, i, j, flags, static_size) \
 do {   \
 static VLC_TYPE table[static_size][2]; \
 (vlc)->table   = table;\
 (vlc)->table_allocated = static_size;  \
 ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j,\
-INIT_VLC_USE_NEW_STATIC);  \
+   flags | INIT_VLC_USE_NEW_STATIC);   \
 } while (0)
 
+#define INIT_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, 
static_size) \
+INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g,  \
+  h, i, j, 0, static_size)
+
 #define INIT_LE_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g, h, i, j, 
static_size) \
-do {   \
-static VLC_TYPE table[static_size][2]; \
-(vlc)->table   = table;\
-(vlc)->table_allocated = static_size;  \
-ff_init_vlc_sparse(vlc, bits, a, b, c, d, e, f, g, h, i, j,\
-INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE);\
-} while (0)
+INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g,  \
+  h, i, j, INIT_VLC_LE, static_size)
+
+#define INIT_CUSTOM_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, flags, 
static_size) \
+INIT_CUSTOM_VLC_SPARSE_STATIC(vlc, bits, a, b, c, d, e, f, g,  \
+  NULL, 0, 0, flags, static_size)
 
 #define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)   \

[FFmpeg-devel] [PATCH 6/7] avcodec/ivi: Avoid reversing BE VLC codes for LE bitstream reader

2020-10-12 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/ivi.c | 22 ++
 1 file changed, 2 insertions(+), 20 deletions(-)

diff --git a/libavcodec/ivi.c b/libavcodec/ivi.c
index c10984e83e..5e1180a5f0 100644
--- a/libavcodec/ivi.c
+++ b/libavcodec/ivi.c
@@ -35,7 +35,6 @@
 #include "avcodec.h"
 #include "get_bits.h"
 #include "internal.h"
-#include "mathops.h"
 #include "ivi.h"
 #include "ivi_dsp.h"
 
@@ -115,23 +114,6 @@ static int ivi_mc(const IVIBandDesc *band, ivi_mc_func mc, 
ivi_mc_avg_func mc_av
 return 0;
 }
 
-/**
- *  Reverse "nbits" bits of the value "val" and return the result
- *  in the least significant bits.
- */
-static uint16_t inv_bits(uint16_t val, int nbits)
-{
-uint16_t res;
-
-if (nbits <= 8) {
-res = ff_reverse[val] >> (8 - nbits);
-} else
-res = ((ff_reverse[val & 0xFF] << 8) +
-   (ff_reverse[val >> 8])) >> (16 - nbits);
-
-return res;
-}
-
 /*
  *  Generate a huffman codebook from the given descriptor
  *  and convert it into the FFmpeg VLC table.
@@ -162,7 +144,7 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, 
VLC *vlc, int flag)
 if (bits[pos] > IVI_VLC_BITS)
 return AVERROR_INVALIDDATA; /* invalid descriptor */
 
-codewords[pos] = inv_bits((prefix | j), bits[pos]);
+codewords[pos] = prefix | j;
 if (!bits[pos])
 bits[pos] = 1;
 
@@ -172,7 +154,7 @@ static int ivi_create_huff_from_desc(const IVIHuffDesc *cb, 
VLC *vlc, int flag)
 
 /* number of codewords = pos */
 return init_vlc(vlc, IVI_VLC_BITS, pos, bits, 1, 1, codewords, 2, 2,
-(flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_LE);
+(flag ? INIT_VLC_USE_NEW_STATIC : 0) | INIT_VLC_OUTPUT_LE);
 }
 
 av_cold void ff_ivi_init_static_vlc(void)
-- 
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 2/7] avcodec/speedhq: Don't pretend reading DC can fail

2020-10-12 Thread Andreas Rheinhardt
It can't, because the tables used don't have any loose ends. This also
fixes a bug in the only caller of decode_dc_le(): It didn't check the
return value.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/speedhq.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index b834b79f28..64758164de 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -168,10 +168,6 @@ static inline int decode_dc_le(GetBitContext *gb, int 
component)
 } else {
 code = get_vlc2(gb, ff_dc_chroma_vlc_le.table, DC_VLC_BITS, 2);
 }
-if (code < 0) {
-av_log(NULL, AV_LOG_ERROR, "invalid dc code at\n");
-return 0x;
-}
 if (!code) {
 diff = 0;
 } else {
-- 
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 3/7] avcodec/speedhq: Don't use ff_ prefix for static symbols

2020-10-12 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/speedhq.c | 34 +-
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/speedhq.c b/libavcodec/speedhq.c
index 64758164de..5759cdb036 100644
--- a/libavcodec/speedhq.c
+++ b/libavcodec/speedhq.c
@@ -132,7 +132,7 @@ static const uint8_t speedhq_run[121] = {
 31,
 };
 
-static RLTable ff_rl_speedhq = {
+static RLTable rl_speedhq = {
 121,
 121,
 (const uint16_t (*)[])speedhq_vlc,
@@ -152,21 +152,21 @@ static const uint8_t unscaled_quant_matrix[64] = {
 27, 29, 35, 38, 46, 56, 69, 83
 };
 
-static uint8_t ff_speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
+static uint8_t speedhq_static_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
 
-static VLC ff_dc_lum_vlc_le;
-static VLC ff_dc_chroma_vlc_le;
-static VLC ff_dc_alpha_run_vlc_le;
-static VLC ff_dc_alpha_level_vlc_le;
+static VLC dc_lum_vlc_le;
+static VLC dc_chroma_vlc_le;
+static VLC dc_alpha_run_vlc_le;
+static VLC dc_alpha_level_vlc_le;
 
 static inline int decode_dc_le(GetBitContext *gb, int component)
 {
 int code, diff;
 
 if (component == 0 || component == 3) {
-code = get_vlc2(gb, ff_dc_lum_vlc_le.table, DC_VLC_BITS, 2);
+code = get_vlc2(gb, dc_lum_vlc_le.table, DC_VLC_BITS, 2);
 } else {
-code = get_vlc2(gb, ff_dc_chroma_vlc_le.table, DC_VLC_BITS, 2);
+code = get_vlc2(gb, dc_chroma_vlc_le.table, DC_VLC_BITS, 2);
 }
 if (!code) {
 diff = 0;
@@ -190,7 +190,7 @@ static inline int decode_alpha_block(const SHQContext *s, 
GetBitContext *gb, uin
 int run, level;
 
 UPDATE_CACHE_LE(re, gb);
-GET_VLC(run, re, gb, ff_dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 
2);
+GET_VLC(run, re, gb, dc_alpha_run_vlc_le.table, ALPHA_VLC_BITS, 2);
 
 if (run < 0) break;
 i += run;
@@ -198,7 +198,7 @@ static inline int decode_alpha_block(const SHQContext *s, 
GetBitContext *gb, uin
 return AVERROR_INVALIDDATA;
 
 UPDATE_CACHE_LE(re, gb);
-GET_VLC(level, re, gb, ff_dc_alpha_level_vlc_le.table, 
ALPHA_VLC_BITS, 2);
+GET_VLC(level, re, gb, dc_alpha_level_vlc_le.table, 
ALPHA_VLC_BITS, 2);
 block[i++] = level;
 }
 
@@ -236,7 +236,7 @@ static inline int decode_dct_block(const SHQContext *s, 
GetBitContext *gb, int l
 for ( ;; ) {
 int level, run;
 UPDATE_CACHE_LE(re, gb);
-GET_RL_VLC(level, run, re, gb, ff_rl_speedhq.rl_vlc[0],
+GET_RL_VLC(level, run, re, gb, rl_speedhq.rl_vlc[0],
TEX_VLC_BITS, 2, 0);
 if (level == 127) {
 break;
@@ -511,7 +511,7 @@ static av_cold void compute_alpha_vlcs(void)
 
 av_assert0(entry == FF_ARRAY_ELEMS(run_code));
 
-INIT_LE_VLC_SPARSE_STATIC(_dc_alpha_run_vlc_le, ALPHA_VLC_BITS,
+INIT_LE_VLC_SPARSE_STATIC(_alpha_run_vlc_le, ALPHA_VLC_BITS,
   FF_ARRAY_ELEMS(run_code),
   run_bits, 1, 1,
   run_code, 2, 2,
@@ -551,7 +551,7 @@ static av_cold void compute_alpha_vlcs(void)
 
 av_assert0(entry == FF_ARRAY_ELEMS(level_code));
 
-INIT_LE_VLC_SPARSE_STATIC(_dc_alpha_level_vlc_le, ALPHA_VLC_BITS,
+INIT_LE_VLC_SPARSE_STATIC(_alpha_level_vlc_le, ALPHA_VLC_BITS,
   FF_ARRAY_ELEMS(level_code),
   level_bits, 1, 1,
   level_code, 2, 2,
@@ -582,19 +582,19 @@ static av_cold void speedhq_static_init(void)
  ff_mpeg12_vlc_dc_lum_bits,
  ff_mpeg12_vlc_dc_lum_code_reversed,
  12);
-INIT_LE_VLC_STATIC(_dc_lum_vlc_le, DC_VLC_BITS, 12,
+INIT_LE_VLC_STATIC(_lum_vlc_le, DC_VLC_BITS, 12,
ff_mpeg12_vlc_dc_lum_bits, 1, 1,
ff_mpeg12_vlc_dc_lum_code_reversed, 2, 2, 512);
 reverse_code(ff_mpeg12_vlc_dc_chroma_code,
  ff_mpeg12_vlc_dc_chroma_bits,
  ff_mpeg12_vlc_dc_chroma_code_reversed,
  12);
-INIT_LE_VLC_STATIC(_dc_chroma_vlc_le, DC_VLC_BITS, 12,
+INIT_LE_VLC_STATIC(_chroma_vlc_le, DC_VLC_BITS, 12,
ff_mpeg12_vlc_dc_chroma_bits, 1, 1,
ff_mpeg12_vlc_dc_chroma_code_reversed, 2, 2, 514);
 
-ff_rl_init(_rl_speedhq, ff_speedhq_static_rl_table_store);
-INIT_2D_VLC_RL(ff_rl_speedhq, 674, INIT_VLC_LE);
+ff_rl_init(_speedhq, speedhq_static_rl_table_store);
+INIT_2D_VLC_RL(rl_speedhq, 674, INIT_VLC_LE);
 
 compute_alpha_vlcs();
 }
-- 
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 7/7] avcodec/webp: Use LE VLC table for LE bitstream reader

2020-10-12 Thread Andreas Rheinhardt
The WebP format uses Huffman tables and the decoder therefore uses
VLC tables. Given that WebP is a LE format, a LE bitreader is used;
yet the VLC table is not created for a LE reader (the process used to
create the tables puts the last bit to be read in the lowest bit) and
therefore custom code for reading the VLCs that reverses the bits
read is used instead of get_vlc2(). This commit changes this to use
a table designed for LE bitreader which allows to use get_vlc2() directly.
The necessary reversing of the codes is delegated to
ff_init_vlc_sparse() (and is therefore only done during init and not
when actually reading the VLCs).

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/webp.c | 42 ++
 1 file changed, 2 insertions(+), 40 deletions(-)

diff --git a/libavcodec/webp.c b/libavcodec/webp.c
index c6d0206846..6140c7ea4a 100644
--- a/libavcodec/webp.c
+++ b/libavcodec/webp.c
@@ -232,44 +232,6 @@ static void image_ctx_free(ImageContext *img)
 memset(img, 0, sizeof(*img));
 }
 
-
-/* Differs from get_vlc2() in the following ways:
- *   - codes are bit-reversed
- *   - assumes 8-bit table to make reversal simpler
- *   - assumes max depth of 2 since the max code length for WebP is 15
- */
-static av_always_inline int webp_get_vlc(GetBitContext *gb, VLC_TYPE 
(*table)[2])
-{
-int n, nb_bits;
-unsigned int index;
-int code;
-
-OPEN_READER(re, gb);
-UPDATE_CACHE(re, gb);
-
-index = SHOW_UBITS(re, gb, 8);
-index = ff_reverse[index];
-code  = table[index][0];
-n = table[index][1];
-
-if (n < 0) {
-LAST_SKIP_BITS(re, gb, 8);
-UPDATE_CACHE(re, gb);
-
-nb_bits = -n;
-
-index = SHOW_UBITS(re, gb, nb_bits);
-index = (ff_reverse[index] >> (8 - nb_bits)) + code;
-code  = table[index][0];
-n = table[index][1];
-}
-SKIP_BITS(re, gb, n);
-
-CLOSE_READER(re, gb);
-
-return code;
-}
-
 static int huff_reader_get_symbol(HuffReader *r, GetBitContext *gb)
 {
 if (r->simple) {
@@ -278,7 +240,7 @@ static int huff_reader_get_symbol(HuffReader *r, 
GetBitContext *gb)
 else
 return r->simple_symbols[get_bits1(gb)];
 } else
-return webp_get_vlc(gb, r->vlc.table);
+return get_vlc2(gb, r->vlc.table, 8, 2);
 }
 
 static int huff_reader_build_canonical(HuffReader *r, int *code_lengths,
@@ -332,7 +294,7 @@ static int huff_reader_build_canonical(HuffReader *r, int 
*code_lengths,
 
 ret = init_vlc(>vlc, 8, alphabet_size,
code_lengths, sizeof(*code_lengths), sizeof(*code_lengths),
-   codes, sizeof(*codes), sizeof(*codes), 0);
+   codes, sizeof(*codes), sizeof(*codes), INIT_VLC_OUTPUT_LE);
 if (ret < 0) {
 av_free(codes);
 return ret;
-- 
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 1/7] avcodec/indeo2: Remove #ifdef BITSTREAM_READER_LE cruft

2020-10-12 Thread Andreas Rheinhardt
Before the LE bitstream reader was used in the Indeo 2 decoder,
a standard BE bitstream reader with swapped bits was used; when the LE
bitstream reader was added, the old code was only #ifdef'ed away and not
removed. Said code has several problems: It modifies the input packet
without ensuring that the packet is indeed writable; and it doesn't work
since 09c4e5c5988c0037d108c5fc2a137d9ad488f7f4 because said commit
removed the BE table used to initialize the VLC table. So just remove
this cruft from the actual decoder, too.

Also use INIT_LE_VLC_STATIC while at it.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/indeo2.c | 19 +++
 1 file changed, 3 insertions(+), 16 deletions(-)

diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c
index ccf6cd84cb..7a568bfbc4 100644
--- a/libavcodec/indeo2.c
+++ b/libavcodec/indeo2.c
@@ -174,10 +174,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
 s->decode_delta = buf[18];
 
 /* decide whether frame uses deltas or not */
-#ifndef BITSTREAM_READER_LE
-for (i = 0; i < buf_size; i++)
-buf[i] = ff_reverse[buf[i]];
-#endif
 
 if ((ret = init_get_bits8(>gb, buf + start, buf_size - start)) < 0)
 return ret;
@@ -232,7 +228,6 @@ static int ir2_decode_frame(AVCodecContext *avctx,
 static av_cold int ir2_decode_init(AVCodecContext *avctx)
 {
 Ir2Context * const ic = avctx->priv_data;
-static VLC_TYPE vlc_tables[1 << CODE_VLC_BITS][2];
 
 ic->avctx = avctx;
 
@@ -242,17 +237,9 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx)
 if (!ic->picture)
 return AVERROR(ENOMEM);
 
-ir2_vlc.table = vlc_tables;
-ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;
-#ifdef BITSTREAM_READER_LE
-init_vlc(_vlc, CODE_VLC_BITS, IR2_CODES,
- _codes[0][1], 4, 2,
- _codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC | 
INIT_VLC_LE);
-#else
-init_vlc(_vlc, CODE_VLC_BITS, IR2_CODES,
- _codes[0][1], 4, 2,
- _codes[0][0], 4, 2, INIT_VLC_USE_NEW_STATIC);
-#endif
+INIT_LE_VLC_STATIC(_vlc, CODE_VLC_BITS, IR2_CODES,
+   _codes[0][1], 4, 2,
+   _codes[0][0], 4, 2, 1 << CODE_VLC_BITS);
 
 return 0;
 }
-- 
2.25.1

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

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

Re: [FFmpeg-devel] [PATCH] Document community process

2020-10-12 Thread Jean-Baptiste Kempf

On Tue, 6 Oct 2020, at 16:50, Nicolas George wrote:
> Global nit: I think it would be more readable without a Markdown engine
> if it were pre-wrapped.

Done.

> > +Contributors are considered "active contributors" if they have pushed more 
> > than 20 patches in the last 36 months in the main FFmpeg repository, or if 
> > they have been voted in by the GA.
> 
> Should the vote for non-commit contributors expire after 36 months too?

Done.


> Two extra comments:
> 
> The current list of members of both committees should probably be
> somewhere on the web page.

Sure, but that's the last thing to do.

> There is a need for a mail address to contact committees.

Outside of my competence, for now.


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

Re: [FFmpeg-devel] [PATCH] Document community process

2020-10-12 Thread Jean-Baptiste Kempf
Hello,

On Tue, 6 Oct 2020, at 05:33, Chris Miceli wrote:
>  - potentially rename Technical Committee to Technical Conflicts Committee to 
> avoid the confusion you documented around it's position describing technical 
> direction

This is not the usage in other communities.

>  - "They will consider the merits of all the positions, judge them and take a 
> decision." might be phrased as "Decisions will be made on meritorious 
> grounds". I would also consider stating whether those merits will be 
> available for review by the public (if they are in the form of a mailing list 
> or similar).

This makes it harder to read, especially for non-native readers.
Also, the way those decisions are taken is described in another document.

The rest was taken in account.

--
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] [PATCHv2] Document community process

2020-10-12 Thread Jean-Baptiste Kempf
General Assembly + Main Elections
---
 doc/dev_community/community.md | 80 ++
 1 file changed, 80 insertions(+)
 create mode 100644 doc/dev_community/community.md

diff --git a/doc/dev_community/community.md b/doc/dev_community/community.md
new file mode 100644
index 00..2ce3aa0b30
--- /dev/null
+++ b/doc/dev_community/community.md
@@ -0,0 +1,80 @@
+# FFmpeg project
+
+## Organisation
+
+The FFmpeg project is organized through a community working on global 
consensus.
+
+Decisions are taken by the ensemble of active members, through voting and
+are aided by two committees.
+
+## General Assembly
+
+The ensemble of active members is called the General Assembly (GA).
+
+The General Assembly is sovereign and legitimate for all its decisions
+regarding the FFmpeg project.
+
+The General Assembly is made up of active contributors.
+
+Contributors are considered "active contributors" if they have pushed more
+than 20 patches in the last 36 months in the main FFmpeg repository, or
+if they have been voted in by the GA.
+
+Additional members are added to the General Assembly through a vote after
+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.
+
+## Voting
+
+Voting is done using a ranked voting system, currently running on 
https://vote.ffmpeg.org/ .
+
+Majority vote means more than 50% of the expressed ballots.
+
+## Technical Committee
+
+The Technical Committee (TC) is here to arbitrate and make decisions when
+technical conflicts occur in the project.
+They will consider the merits of all the positions, judge them and make a
+decision.
+
+The TC resolves technical conflicts but is not a technical steering committee.
+
+Decisions by the TC are binding for all the contributors.
+
+Decisions made by the TC can be re-opened after 1 year or by a majority vote
+of the General Assembly, requested by one of the member of the GA.
+
+The TC is elected by the General Assembly for a duration of 1 year, and
+is composed of 5 members.
+Members can be re-elected if they wish. A majority vote in the General Assembly
+can trigger a new election of the TC.
+
+The members of the TC can be elected from outside of the GA.
+Candidates for election can either be suggested or self-nominated.
+
+The conflict resolution process is detailed in the [resolution process] 
document.
+
+## Community committee
+
+The Community Committee (CC) is here to arbitrage and make decisions when
+inter-personal conflicts occur in the project. It will decide quickly and
+take actions, for the sake of the project.
+
+The CC can remove privileges of offending members, including removal of
+commit access and temporary ban from the community.
+
+Decisions made by the CC can be re-opened after 1 year or by a majority vote
+of the General Assembly. Indefinite bans from the community must be confirmed
+by the General Assembly, in a majority vote.
+
+The CC is elected by the General Assembly for a duration of 1 year, and is
+composed of 5 members.
+Members can be re-elected if they wish. A majority vote in the General Assembly
+can trigger a new election of the CC.
+
+The members of the CC can be elected from outside of the GA.
+Candidates for election can either be suggested or self-nominated.
+
+The CC is governed by and responsible for enforcing the Code of Conduct.
+
-- 
2.28.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".