[FFmpeg-devel] [PATCH 1/5] avcodec/iff: Fix off by x error

2020-06-13 Thread Michael Niedermayer
Fixes: out of array access
Fixes: 
23245/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5723121327013888.fuzz

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

diff --git a/libavcodec/iff.c b/libavcodec/iff.c
index 66879cbf5d..79f6215c77 100644
--- a/libavcodec/iff.c
+++ b/libavcodec/iff.c
@@ -723,7 +723,7 @@ static void decode_deep_rle32(uint8_t *dst, const uint8_t 
*src, int src_size, in
 if (opcode >= 0) {
 int size = opcode + 1;
 for (i = 0; i < size; i++) {
-int length = FFMIN(size - i, width);
+int length = FFMIN(size - i, width - x);
 if (src_end - src < length * 4)
 return;
 memcpy(dst + y*linesize + x * 4, src, length * 4);
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 2/5] avformat/ape: Cleanup after ape_read_header() failure

2020-06-13 Thread Michael Niedermayer
Fixes: memleaks
Fixes: 
23306/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5635436931448832

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/ape.c | 26 +++---
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index ed6752a415..39a584aa98 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -83,6 +83,8 @@ typedef struct APEContext {
 uint8_t  *bittable;
 } APEContext;
 
+static int ape_read_close(AVFormatContext * s);
+
 static int ape_probe(const AVProbeData * p)
 {
 int version = AV_RL16(p->buf+4);
@@ -281,14 +283,18 @@ static int ape_read_header(AVFormatContext * s)
 
 if (ape->seektablelength > 0) {
 ape->seektable = av_mallocz(ape->seektablelength);
-if (!ape->seektable)
-return AVERROR(ENOMEM);
+if (!ape->seektable) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 for (i = 0; i < ape->seektablelength / sizeof(uint32_t) && 
!pb->eof_reached; i++)
 ape->seektable[i] = avio_rl32(pb);
 if (ape->fileversion < 3810) {
 ape->bittable = av_mallocz(ape->totalframes);
-if (!ape->bittable)
-return AVERROR(ENOMEM);
+if (!ape->bittable) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 for (i = 0; i < ape->totalframes && !pb->eof_reached; i++)
 ape->bittable[i] = avio_r8(pb);
 }
@@ -341,8 +347,10 @@ static int ape_read_header(AVFormatContext * s)
 
 /* now we are ready: build format streams */
 st = avformat_new_stream(s, NULL);
-if (!st)
-return AVERROR(ENOMEM);
+if (!st) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
 
 total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * 
ape->blocksperframe) + ape->finalframeblocks;
 
@@ -359,7 +367,7 @@ static int ape_read_header(AVFormatContext * s)
 avpriv_set_pts_info(st, 64, 1, ape->samplerate);
 
 if ((ret = ff_alloc_extradata(st->codecpar, APE_EXTRADATA_SIZE)) < 0)
-return ret;
+goto fail;
 AV_WL16(st->codecpar->extradata + 0, ape->fileversion);
 AV_WL16(st->codecpar->extradata + 2, ape->compressiontype);
 AV_WL16(st->codecpar->extradata + 4, ape->formatflags);
@@ -378,6 +386,10 @@ static int ape_read_header(AVFormatContext * s)
 }
 
 return 0;
+fail:
+ape_read_close(s);
+
+return ret;
 }
 
 static int ape_read_packet(AVFormatContext * s, AVPacket * pkt)
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 3/5] avcodec/pixlet: Fix log(0) check

2020-06-13 Thread Michael Niedermayer
Fixes: passing zero to clz(), which is not a valid argument
Fixes: 
23337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PIXLET_fuzzer-5179131989065728

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

diff --git a/libavcodec/pixlet.c b/libavcodec/pixlet.c
index 7b068b1ce5..78f571cd5f 100644
--- a/libavcodec/pixlet.c
+++ b/libavcodec/pixlet.c
@@ -221,7 +221,7 @@ static int read_high_coeffs(AVCodecContext *avctx, uint8_t 
*src, int16_t *dst,
 length = 25 - nbits;
 
 while (i < size) {
-if (state >> 8 != -3)
+if (((state >> 8) + 3) & 0xFFF)
 value = ff_clz((state >> 8) + 3) ^ 0x1F;
 else
 value = -1;
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 5/5] avformat/oggdec: Disable mid stream codec changes

2020-06-13 Thread Michael Niedermayer
The code crashes and neither the authors nor anyone else did fix this
We cannot release code which crashes, so if noone fixes it, the only
option left is to disable or revert. Revert is difficult as there are
multiple commits afterwards

Fixes: 
22082/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5688619118624768
Fixes: crash from V-codecs/Theora/theora_testsuite_broken/multi2.ogg

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

diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index 9eb45499c6..1f3ed8024c 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -229,6 +229,15 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t 
serial, char *magic,
 /* We only have a single stream anyway, so if there's a new stream with
  * a different codec just replace it */
 os = &ogg->streams[0];
+if (os->codec != codec) {
+/*
+ * The codec change code from 8296443a70f052a6f5c9a867d28b83a5eb7d304d 
and surounding commits
+ * crashes with out of array accesses
+ * testcase is 
https://samples.ffmpeg.org/V-codecs/Theora/theora_testsuite_broken/multi2.ogg
+ */
+return AVERROR_PATCHWELCOME;
+}
+
 os->serial  = serial;
 os->codec   = codec;
 os->serial  = serial;
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 4/5] avcodec/mpeg4videodec: avoid invalid values and reinitialize in format changes for studio profile

2020-06-13 Thread Michael Niedermayer
Fixes: out of array access
Fixes: 
23327/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5134822992510976

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

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 7e52bbef1b..f5021208c3 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3134,6 +3134,7 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, 
GetBitContext *gb)
 MpegEncContext *s = &ctx->m;
 int width, height;
 int bits_per_raw_sample;
+int rgb, chroma_format;
 
 // random_accessible_vol and video_object_type_indication have 
already
 // been read by the caller decode_vol_header()
@@ -3141,28 +3142,36 @@ static int decode_studio_vol_header(Mpeg4DecContext 
*ctx, GetBitContext *gb)
 ctx->shape = get_bits(gb, 2); /* video_object_layer_shape */
 skip_bits(gb, 4); /* video_object_layer_shape_extension */
 skip_bits1(gb); /* progressive_sequence */
+if (ctx->shape != RECT_SHAPE) {
+avpriv_request_sample(s->avctx, "MPEG-4 Studio profile non 
rectangular shape");
+return AVERROR_PATCHWELCOME;
+}
 if (ctx->shape != BIN_ONLY_SHAPE) {
-ctx->rgb = get_bits1(gb); /* rgb_components */
-s->chroma_format = get_bits(gb, 2); /* chroma_format */
-if (!s->chroma_format) {
+rgb = get_bits1(gb); /* rgb_components */
+chroma_format = get_bits(gb, 2); /* chroma_format */
+if (!chroma_format || chroma_format == CHROMA_420 || (rgb && 
chroma_format == CHROMA_422)) {
 av_log(s->avctx, AV_LOG_ERROR, "illegal chroma format\n");
 return AVERROR_INVALIDDATA;
 }
 
 bits_per_raw_sample = get_bits(gb, 4); /* bit_depth */
 if (bits_per_raw_sample == 10) {
-if (ctx->rgb) {
+if (rgb) {
 s->avctx->pix_fmt = AV_PIX_FMT_GBRP10;
 }
 else {
-s->avctx->pix_fmt = s->chroma_format == CHROMA_422 ? 
AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV444P10;
+s->avctx->pix_fmt = chroma_format == CHROMA_422 ? 
AV_PIX_FMT_YUV422P10 : AV_PIX_FMT_YUV444P10;
 }
 }
 else {
 avpriv_request_sample(s->avctx, "MPEG-4 Studio profile 
bit-depth %u", bits_per_raw_sample);
 return AVERROR_PATCHWELCOME;
 }
+if (rgb != ctx->rgb || s->chroma_format != chroma_format)
+s->context_reinit = 1;
 s->avctx->bits_per_raw_sample = bits_per_raw_sample;
+ctx->rgb = rgb;
+s->chroma_format = chroma_format;
 }
 if (ctx->shape == RECT_SHAPE) {
 check_marker(s->avctx, gb, "before video_object_layer_width");
-- 
2.17.1

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

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

Re: [FFmpeg-devel] [PATCH 5/5] avformat/oggdec: Disable mid stream codec changes

2020-06-13 Thread Paul B Mahol
On 6/13/20, Michael Niedermayer  wrote:
> The code crashes and neither the authors nor anyone else did fix this
> We cannot release code which crashes, so if noone fixes it, the only
> option left is to disable or revert. Revert is difficult as there are
> multiple commits afterwards
>
> Fixes:
> 22082/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5688619118624768
> Fixes: crash from V-codecs/Theora/theora_testsuite_broken/multi2.ogg
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/oggdec.c | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
> index 9eb45499c6..1f3ed8024c 100644
> --- a/libavformat/oggdec.c
> +++ b/libavformat/oggdec.c
> @@ -229,6 +229,15 @@ static int ogg_replace_stream(AVFormatContext *s,
> uint32_t serial, char *magic,
>  /* We only have a single stream anyway, so if there's a new stream with
>   * a different codec just replace it */
>  os = &ogg->streams[0];
> +if (os->codec != codec) {
> +/*
> + * The codec change code from
> 8296443a70f052a6f5c9a867d28b83a5eb7d304d and surounding commits
> + * crashes with out of array accesses
> + * testcase is
> https://samples.ffmpeg.org/V-codecs/Theora/theora_testsuite_broken/multi2.ogg
> + */
> +return AVERROR_PATCHWELCOME;
> +}
> +
>  os->serial  = serial;
>  os->codec   = codec;
>  os->serial  = serial;
> --
> 2.17.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

NAK

It very aggressive and also pointless.
___
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] OS/2:Support linking against libcx

2020-06-13 Thread KO Myung-Hun
Hi/2.

Dave Yeo wrote:
> On 06/11/20 10:26 AM, Michael Niedermayer wrote:
>> On Wed, Jun 10, 2020 at 09:24:51PM -0700, Dave Yeo wrote:
>>> On 06/10/20 02:09 PM, Michael Niedermayer wrote:
 On Tue, Jun 09, 2020 at 11:11:48PM -0700, Dave Yeo wrote:
> Hi, could I get this pushed to trunk and the 4.3 branch? Fixes a
> build break
> in libavformat/ip.c (implicit declaration of function
> 'getaddrinfo') and
> also need the prototype.
> Thanks,
> Dave
 it seems this breaks build on linux
>>>
>>> Sorry about that, I'll test on Linux in the future.
>>> Here's a better patch as it doesn't touch configure.
>>> Thanks,
>>> Dave
>>
>> I can confirm this does not break build anymore, but iam not OS/2
>> maintainer nor do i have such box so ill leave review / application
>> to someone better suited for this
>>
>> thx
>> [...]
> 
> Fair enough, I'll CC KOMH

I have no problems at all with gcc 9.1.0 because FFmpeg already has
replacements for missing functions such as getaddrinfo().

What is your build environment ? Maybe is libcx linked by default ?

-- 
KO Myung-Hun

Using Mozilla SeaMonkey 2.7.2
Under OS/2 Warp 4 for Korean with FixPak #15
In VirtualBox v6.1.10 on Intel Core i7-3615QM 2.30GHz with 8GB RAM

Korean OS/2 User Community : http://www.os2.kr/

___
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 v12 3/4] avfilter/vf_showinfo: display H.26[45] user data unregistered sei message

2020-06-13 Thread lance . lmwang
On Thu, Jun 11, 2020 at 06:35:15PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  libavfilter/vf_showinfo.c | 37 +
> >  1 file changed, 37 insertions(+)
> > 
> > diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
> > index 5d4aee4..3658234 100644
> > --- a/libavfilter/vf_showinfo.c
> > +++ b/libavfilter/vf_showinfo.c
> > @@ -37,6 +37,7 @@
> >  #include "libavutil/timecode.h"
> >  #include "libavutil/mastering_display_metadata.h"
> >  #include "libavutil/video_enc_params.h"
> > +#include "libavutil/avstring.h"
> >  
> >  #include "avfilter.h"
> >  #include "internal.h"
> > @@ -190,6 +191,39 @@ static void dump_video_enc_params(AVFilterContext 
> > *ctx, AVFrameSideData *sd)
> >  av_log(ctx, AV_LOG_INFO, "%u blocks; ", par->nb_blocks);
> >  }
> >  
> > +static int string_is_print(const uint8_t *str)
> > +{
> > +while (*str && *str >= 0x20 && *str <= 0x7e ) str++;
> > +return !*str;
> > +}
> > +
> > +static void dump_sei_unregistered_metadata(AVFilterContext *ctx, 
> > AVFrameSideData *sd)
> > +{
> > +const int uuid_size = 16;
> > +uint8_t *user_data = sd->data;
> > +
> > +if (sd->size < uuid_size) {
> > +av_log(ctx, AV_LOG_ERROR, "invalid data(%d < UUID(%d-bytes))", 
> > sd->size, uuid_size);
> > +return;
> > +}
> > +
> > +av_log(ctx, AV_LOG_INFO, "User Data Unregistered:\n");
> > +av_log(ctx, AV_LOG_INFO, "UUID=");
> > +for (int i = 0; i < uuid_size; i++) {
> > +av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]);
> > +if (i == 3 || i == 5 || i == 7 || i == 9)
> > +av_log(ctx, AV_LOG_INFO, "-");
> > +}
> > +av_log(ctx, AV_LOG_INFO, "\n");
> > +
> > +user_data += uuid_size;
> > +/* Only print the user data details if it's string or partial string*/
> > +if (string_is_print(user_data)) {
> > +av_log(ctx, AV_LOG_INFO, "User Data=");
> > +av_log(ctx, AV_LOG_INFO, "%s", user_data);
> > +}
> > +}
> > +
> >  static void dump_color_property(AVFilterContext *ctx, AVFrame *frame)
> >  {
> >  const char *color_range_str = 
> > av_color_range_name(frame->color_range);
> > @@ -375,6 +409,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
> > *frame)
> >  case AV_FRAME_DATA_VIDEO_ENC_PARAMS:
> >  dump_video_enc_params(ctx, sd);
> >  break;
> > +case AV_FRAME_DATA_SEI_UNREGISTERED:
> > +dump_sei_unregistered_metadata(ctx, sd);
> > +break;
> >  default:
> >  av_log(ctx, AV_LOG_WARNING, "unknown side data type %d (%d 
> > bytes)",
> > sd->type, sd->size);
> > 
> This new version has the same issues as the old one plus one more: It
> adds a new header that is now unnecessary.

Andreas, I have updated the patch with hex dump, do you any further comments? 

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

-- 
Thanks,
Limin Wang
___
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/5] avformat/oggdec: Disable mid stream codec changes

2020-06-13 Thread James Almer
On 6/13/2020 9:12 AM, Lynne wrote:
> Jun 13, 2020, 12:23 by mich...@niedermayer.cc:
> 
>> The code crashes and neither the authors nor anyone else did fix this
>> We cannot release code which crashes, so if noone fixes it, the only
>> option left is to disable or revert. Revert is difficult as there are
>> multiple commits afterwards
>>
> 
> You're suggesting a revert when disabling it is so simple?
> As if the commits didn't fix an issue users have been begging for for years?
> Do you want a permanently dead project where no code changes because it may 
> crash
> or break things? You should fork instead, we'd all be better off then.

It would be very helpful too if you could stop being so goddamn
aggressive with every subject.

> 
> I even asked you on IRC whether your previous 2 commits fixed the crash, so I 
> know whether
> to try fixing it, and you didn't even respond. You didn't even ping me 
> anytime to check up.
> And yet you claim I've abandoned it? As if I don't have a million things to 
> work on or worry
> about already.

This patch was a good opportunity to ping him about your question that
went unanswered on IRC, while also NAKing the patch itself, instead of
the above.
___
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/2] fix the bug that AV_PKT_FLAG_CORRUPT flags lost after parse_packet()

2020-06-13 Thread levizhao
From: zhaoyi 

---
 libavformat/utils.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 667249362c..a74c0f74a2 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1516,6 +1516,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
 out_pkt.dts  = st->parser->dts;
 out_pkt.pos  = st->parser->pos;
 out_pkt.flags   |= pkt->flags & AV_PKT_FLAG_DISCARD;
+out_pkt.flags   |= pkt->flags & AV_PKT_FLAG_CORRUPT;
 
 if (st->need_parsing == AVSTREAM_PARSE_FULL_RAW)
 out_pkt.pos = st->parser->frame_offset;
-- 
2.27.0.windows.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 v3 0/7] adpcm_ima_apm encoder + apm muxer

2020-06-13 Thread Zane van Iperen
On Fri, 12 Jun 2020 11:46:08 +
"Zane van Iperen"  wrote:

> 
> Add support for encoding adpcm_ima_apm and muxing to apm.
> 
> If possible, I would like to get this functionality into the 4.3
> release.
>

Ping.

Zane

___
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/4] avcodec/mpegvideo: remove extra space

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/mpegvideo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index 52a0ec3..c28d1ad 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1112,7 +1112,7 @@ void ff_mpv_common_end(MpegEncContext *s)
 int i;
 
 if (!s)
-return ;
+return;
 
 if (s->slice_context_count > 1) {
 for (i = 0; i < s->slice_context_count; i++) {
-- 
1.8.3.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/4] swscale/utils: reindent

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libswscale/utils.c | 71 +++---
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index ff99e79..6e218ba 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1575,41 +1575,42 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 if (CONFIG_SWSCALE_ALPHA && isALPHA(srcFormat) && !isALPHA(dstFormat)) {
 enum AVPixelFormat tmpFormat = alphaless_fmt(srcFormat);
 
-if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != 
SWS_ALPHA_BLEND_NONE)
-if (!unscaled ||
-dstFormat != tmpFormat ||
-usesHFilter || usesVFilter ||
-c->srcRange != c->dstRange
-) {
-c->cascaded_mainindex = 1;
-ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
-srcW, srcH, tmpFormat, 64);
-if (ret < 0)
-return ret;
-
-c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, srcFormat,
-srcW, srcH, tmpFormat,
-flags, c->param);
-if (!c->cascaded_context[0])
-return -1;
-c->cascaded_context[0]->alphablend = c->alphablend;
-ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
-if (ret < 0)
-return ret;
-
-c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, tmpFormat,
-dstW, dstH, dstFormat,
-flags, c->param);
-if (!c->cascaded_context[1])
-return -1;
-
-c->cascaded_context[1]->srcRange = c->srcRange;
-c->cascaded_context[1]->dstRange = c->dstRange;
-ret = sws_init_context(c->cascaded_context[1], srcFilter , 
dstFilter);
-if (ret < 0)
-return ret;
-
-return 0;
+if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != 
SWS_ALPHA_BLEND_NONE) {
+if (!unscaled ||
+dstFormat != tmpFormat ||
+usesHFilter || usesVFilter ||
+c->srcRange != c->dstRange
+) {
+c->cascaded_mainindex = 1;
+ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
+ srcW, srcH, tmpFormat, 64);
+if (ret < 0)
+return ret;
+
+c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, 
srcFormat,
+srcW, srcH, 
tmpFormat,
+flags, c->param);
+if (!c->cascaded_context[0])
+return -1;
+c->cascaded_context[0]->alphablend = c->alphablend;
+ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
+if (ret < 0)
+return ret;
+
+c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, 
tmpFormat,
+dstW, dstH, 
dstFormat,
+flags, c->param);
+if (!c->cascaded_context[1])
+return -1;
+
+c->cascaded_context[1]->srcRange = c->srcRange;
+c->cascaded_context[1]->dstRange = c->dstRange;
+ret = sws_init_context(c->cascaded_context[1], srcFilter , 
dstFilter);
+if (ret < 0)
+return ret;
+
+return 0;
+}
 }
 }
 
-- 
1.8.3.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/4] swscale/utils: return better error code from initFilter()

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libswscale/utils.c | 27 ++-
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 6e218ba..dcd1dba 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -612,7 +612,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t 
**filterPos,
 av_assert0(filterSize > 0);
 filter = av_malloc_array(dstW, filterSize * sizeof(*filter));
 if (!filter)
-goto fail;
+goto nomem;
 if (filterSize >= MAX_FILTER_SIZE * 16 /
   ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16)) {
 ret = RETCODE_USE_CASCADE;
@@ -1491,7 +1491,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 srcW, srcH, tmpFmt,
 flags, NULL, NULL, c->param);
 if (!c->cascaded_context[0]) {
-return -1;
+return AVERROR(ENOMEM);
 }
 
 c->cascaded_context[1] = sws_getContext(srcW, srcH, tmpFmt,
@@ -1499,7 +1499,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 flags, srcFilter, dstFilter, 
c->param);
 
 if (!c->cascaded_context[1])
-return -1;
+return AVERROR(ENOMEM);
 
 c2 = c->cascaded_context[1];
 c2->is_internal_gamma = 1;
@@ -1512,10 +1512,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 // to properly create the gamma convert FilterDescriptor
 // we have to re-initialize it
 ff_free_filters(c2);
-if (ff_init_filters(c2) < 0) {
+if ((ret = ff_init_filters(c2)) < 0) {
 sws_freeContext(c2);
 c->cascaded_context[1] = NULL;
-return -1;
+return ret;
 }
 
 c->cascaded_context[2] = NULL;
@@ -1529,7 +1529,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 dstW, dstH, dstFormat,
 flags, NULL, NULL, c->param);
 if (!c->cascaded_context[2])
-return -1;
+return AVERROR(ENOMEM);
 }
 return 0;
 }
@@ -1548,13 +1548,13 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 srcW, srcH, tmpFormat,
 flags, srcFilter, NULL, 
c->param);
 if (!c->cascaded_context[0])
-return -1;
+return AVERROR(ENOMEM);
 
 c->cascaded_context[1] = sws_getContext(srcW, srcH, tmpFormat,
 dstW, dstH, dstFormat,
 flags, NULL, dstFilter, 
c->param);
 if (!c->cascaded_context[1])
-return -1;
+return AVERROR(ENOMEM);
 return 0;
 }
 }
@@ -1591,7 +1591,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 srcW, srcH, 
tmpFormat,
 flags, c->param);
 if (!c->cascaded_context[0])
-return -1;
+return AVERROR(EINVAL);
 c->cascaded_context[0]->alphablend = c->alphablend;
 ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
 if (ret < 0)
@@ -1601,7 +1601,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 dstW, dstH, 
dstFormat,
 flags, c->param);
 if (!c->cascaded_context[1])
-return -1;
+return AVERROR(EINVAL);
 
 c->cascaded_context[1]->srcRange = c->srcRange;
 c->cascaded_context[1]->dstRange = c->dstRange;
@@ -1678,6 +1678,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 if (   mprotect(c->lumMmxextFilterCode, 
c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1
 || mprotect(c->chrMmxextFilterCode, 
c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1) {
 av_log(c, AV_LOG_ERROR, "mprotect failed, cannot use fast 
bilinear scaler\n");
+ret = AVERROR(EINVAL);
 goto fail;
 }
 #endif
@@ -1870,16 +1871,16 @@ fail: // FIXME replace things by appropriate error codes
 tmpW, tmpH, tmpFormat,
 flags, srcFilter, NULL, 
c->param);
 if (!c->cascaded_context[0])
-return -1;
+return A

[FFmpeg-devel] [PATCH 4/4] avcodec/smvjpegdec: remove uninitialized ret

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/smvjpegdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 209f3ff..973a911 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -79,13 +79,12 @@ static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)
 {
 SMVJpegDecodeContext *s = avctx->priv_data;
 MJpegDecodeContext *jpg = &s->jpg;
-int ret;
 
 jpg->picture_ptr = NULL;
 av_frame_free(&s->picture[0]);
 av_frame_free(&s->picture[1]);
 avcodec_free_context(&s->avctx);
-return ret;
+return 0;
 }
 
 static av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
-- 
1.8.3.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/4] avcodec/smvjpegdec: remove uninitialized ret

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavcodec/smvjpegdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavcodec/smvjpegdec.c b/libavcodec/smvjpegdec.c
index 209f3ff..973a911 100644
--- a/libavcodec/smvjpegdec.c
+++ b/libavcodec/smvjpegdec.c
@@ -79,13 +79,12 @@ static av_cold int smvjpeg_decode_end(AVCodecContext *avctx)
 {
 SMVJpegDecodeContext *s = avctx->priv_data;
 MJpegDecodeContext *jpg = &s->jpg;
-int ret;
 
 jpg->picture_ptr = NULL;
 av_frame_free(&s->picture[0]);
 av_frame_free(&s->picture[1]);
 avcodec_free_context(&s->avctx);
-return ret;
+return 0;
 }
 
 static av_cold int smvjpeg_decode_init(AVCodecContext *avctx)
-- 
1.8.3.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/4] swscale/utils: return better error code from initFilter()

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libswscale/utils.c | 27 ++-
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 6e218ba..dcd1dba 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -612,7 +612,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t 
**filterPos,
 av_assert0(filterSize > 0);
 filter = av_malloc_array(dstW, filterSize * sizeof(*filter));
 if (!filter)
-goto fail;
+goto nomem;
 if (filterSize >= MAX_FILTER_SIZE * 16 /
   ((flags & SWS_ACCURATE_RND) ? APCK_SIZE : 16)) {
 ret = RETCODE_USE_CASCADE;
@@ -1491,7 +1491,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 srcW, srcH, tmpFmt,
 flags, NULL, NULL, c->param);
 if (!c->cascaded_context[0]) {
-return -1;
+return AVERROR(ENOMEM);
 }
 
 c->cascaded_context[1] = sws_getContext(srcW, srcH, tmpFmt,
@@ -1499,7 +1499,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 flags, srcFilter, dstFilter, 
c->param);
 
 if (!c->cascaded_context[1])
-return -1;
+return AVERROR(ENOMEM);
 
 c2 = c->cascaded_context[1];
 c2->is_internal_gamma = 1;
@@ -1512,10 +1512,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 // to properly create the gamma convert FilterDescriptor
 // we have to re-initialize it
 ff_free_filters(c2);
-if (ff_init_filters(c2) < 0) {
+if ((ret = ff_init_filters(c2)) < 0) {
 sws_freeContext(c2);
 c->cascaded_context[1] = NULL;
-return -1;
+return ret;
 }
 
 c->cascaded_context[2] = NULL;
@@ -1529,7 +1529,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 dstW, dstH, dstFormat,
 flags, NULL, NULL, c->param);
 if (!c->cascaded_context[2])
-return -1;
+return AVERROR(ENOMEM);
 }
 return 0;
 }
@@ -1548,13 +1548,13 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 srcW, srcH, tmpFormat,
 flags, srcFilter, NULL, 
c->param);
 if (!c->cascaded_context[0])
-return -1;
+return AVERROR(ENOMEM);
 
 c->cascaded_context[1] = sws_getContext(srcW, srcH, tmpFormat,
 dstW, dstH, dstFormat,
 flags, NULL, dstFilter, 
c->param);
 if (!c->cascaded_context[1])
-return -1;
+return AVERROR(ENOMEM);
 return 0;
 }
 }
@@ -1591,7 +1591,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 srcW, srcH, 
tmpFormat,
 flags, c->param);
 if (!c->cascaded_context[0])
-return -1;
+return AVERROR(EINVAL);
 c->cascaded_context[0]->alphablend = c->alphablend;
 ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
 if (ret < 0)
@@ -1601,7 +1601,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 dstW, dstH, 
dstFormat,
 flags, c->param);
 if (!c->cascaded_context[1])
-return -1;
+return AVERROR(EINVAL);
 
 c->cascaded_context[1]->srcRange = c->srcRange;
 c->cascaded_context[1]->dstRange = c->dstRange;
@@ -1678,6 +1678,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 if (   mprotect(c->lumMmxextFilterCode, 
c->lumMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1
 || mprotect(c->chrMmxextFilterCode, 
c->chrMmxextFilterCodeSize, PROT_EXEC | PROT_READ) == -1) {
 av_log(c, AV_LOG_ERROR, "mprotect failed, cannot use fast 
bilinear scaler\n");
+ret = AVERROR(EINVAL);
 goto fail;
 }
 #endif
@@ -1870,16 +1871,16 @@ fail: // FIXME replace things by appropriate error codes
 tmpW, tmpH, tmpFormat,
 flags, srcFilter, NULL, 
c->param);
 if (!c->cascaded_context[0])
-return -1;
+return A

[FFmpeg-devel] [PATCH 2/2] add socks5 support for tcp clients

2020-06-13 Thread levizhao
From: zhaoyi 

---
 libavformat/tcp.c | 204 ++
 1 file changed, 204 insertions(+)

diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index 2198e0f00e..ca6ba2867e 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -45,6 +45,7 @@ typedef struct TCPContext {
 #if !HAVE_WINSOCK2_H
 int tcp_mss;
 #endif /* !HAVE_WINSOCK2_H */
+char *socks_proxy;
 } TCPContext;
 
 #define OFFSET(x) offsetof(TCPContext, x)
@@ -52,6 +53,7 @@ typedef struct TCPContext {
 #define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
 { "listen",  "Listen for incoming connections",  OFFSET(listen),   
  AV_OPT_TYPE_INT, { .i64 = 0 }, 0,   2,   .flags = D|E },
+{ "socks_proxy", "set socks proxy for connection", 
OFFSET(socks_proxy),   AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0,   
.flags = D },
 { "timeout", "set timeout (in microseconds) of socket I/O operations", 
OFFSET(rw_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
 { "listen_timeout",  "Connection awaiting timeout (in milliseconds)",  
OFFSET(listen_timeout), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
 { "send_buffer_size", "Socket send buffer size (in bytes)",
OFFSET(send_buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, 
.flags = D|E },
@@ -213,6 +215,207 @@ static int tcp_open(URLContext *h, const char *uri, int 
flags)
 return ret;
 }
 
+/* use options for socks5 proxy from input */
+static int tcp_open2(URLContext *h, const char *uri, int flags, AVDictionary 
**options) {
+struct addrinfo hints = { 0 }, *ai, *cur_ai;
+int port, fd = -1;
+TCPContext *s = h->priv_data;
+const char *p;
+char buf[256];
+int ret;
+char hostname[1024],proto[1024],path[1024];
+char portstr[10];
+/* current just processing the socks5 non authentication */
+const char *proxy_path;
+char hostname_proxy[1024] = { 0 },portstr_proxy[10] = { 0 
},proto_proxy[1024] = { 0 },path_proxy[1024] = { 0 };
+int use_proxy = 0;
+proxy_path = getenv("socks_proxy");
+use_proxy = proxy_path && av_strstart(proxy_path, "socks5://", NULL);
+if(use_proxy) {
+av_url_split(proto_proxy, sizeof(proto_proxy), NULL, 0, 
hostname_proxy, sizeof(hostname_proxy),
+&port, path_proxy, sizeof(path_proxy), proxy_path);
+port = (port > 0 && port < 65536) ? port : 1080;
+snprintf(portstr_proxy, sizeof(portstr_proxy), "%d", port);
+}
+
+s->open_timeout = 500;
+av_url_split(proto, sizeof(proto), NULL, 0, hostname, sizeof(hostname),
+&port, path, sizeof(path), uri);
+if (strcmp(proto, "tcp"))
+return AVERROR(EINVAL);
+if (port <= 0 || port >= 65536) {
+av_log(h, AV_LOG_ERROR, "Port missing in uri\n");
+return AVERROR(EINVAL);
+}
+p = strchr(uri, '?');
+if (p) {
+if (av_find_info_tag(buf, sizeof(buf), "listen", p)) {
+char *endptr = NULL;
+s->listen = strtol(buf, &endptr, 10);
+/* assume if no digits were found it is a request to enable it */
+if (buf == endptr)
+s->listen = 1;
+}
+if (av_find_info_tag(buf, sizeof(buf), "timeout", p)) {
+s->rw_timeout = strtol(buf, NULL, 10);
+}
+if (av_find_info_tag(buf, sizeof(buf), "listen_timeout", p)) {
+s->listen_timeout = strtol(buf, NULL, 10);
+}
+}
+if (s->rw_timeout >= 0) {
+s->open_timeout =
+h->rw_timeout   = s->rw_timeout;
+}
+hints.ai_family = AF_UNSPEC;
+hints.ai_socktype = SOCK_STREAM;
+snprintf(portstr, sizeof(portstr), "%d", port);
+if (s->listen)
+hints.ai_flags |= AI_PASSIVE;
+if (!hostname[0])
+ret = getaddrinfo(NULL, portstr, &hints, &ai);
+else if (use_proxy)
+ret = getaddrinfo(hostname_proxy, portstr_proxy, &hints, &ai); 
+else
+ret = getaddrinfo(hostname, portstr, &hints, &ai);
+if (ret) {
+av_log(h, AV_LOG_ERROR,
+   "Failed to resolve hostname %s: %s\n",
+   hostname, gai_strerror(ret));
+return AVERROR(EIO);
+}
+
+cur_ai = ai;
+
+#if HAVE_STRUCT_SOCKADDR_IN6
+// workaround for IOS9 getaddrinfo in IPv6 only network use hardcode IPv4 
address can not resolve port number.
+if (cur_ai->ai_family == AF_INET6){
+struct sockaddr_in6 * sockaddr_v6 = (struct sockaddr_in6 
*)cur_ai->ai_addr;
+if (!sockaddr_v6->sin6_port){
+sockaddr_v6->sin6_port = htons(port);
+}
+}
+#endif
+
+if (s->listen > 0) {
+while (cur_ai && fd < 0) {
+fd = ff_socket(cur_ai->ai_family,
+   cur_ai->ai_socktype,
+   cur_ai->ai_protocol);
+if (fd < 0) {
+ret = ff_neterrno();
+cur_ai = cur_ai->a

[FFmpeg-devel] [PATCH 1/4] swscale/utils: reindent

2020-06-13 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libswscale/utils.c | 71 +++---
 1 file changed, 36 insertions(+), 35 deletions(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index ff99e79..6e218ba 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -1575,41 +1575,42 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
 if (CONFIG_SWSCALE_ALPHA && isALPHA(srcFormat) && !isALPHA(dstFormat)) {
 enum AVPixelFormat tmpFormat = alphaless_fmt(srcFormat);
 
-if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != 
SWS_ALPHA_BLEND_NONE)
-if (!unscaled ||
-dstFormat != tmpFormat ||
-usesHFilter || usesVFilter ||
-c->srcRange != c->dstRange
-) {
-c->cascaded_mainindex = 1;
-ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
-srcW, srcH, tmpFormat, 64);
-if (ret < 0)
-return ret;
-
-c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, srcFormat,
-srcW, srcH, tmpFormat,
-flags, c->param);
-if (!c->cascaded_context[0])
-return -1;
-c->cascaded_context[0]->alphablend = c->alphablend;
-ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
-if (ret < 0)
-return ret;
-
-c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, tmpFormat,
-dstW, dstH, dstFormat,
-flags, c->param);
-if (!c->cascaded_context[1])
-return -1;
-
-c->cascaded_context[1]->srcRange = c->srcRange;
-c->cascaded_context[1]->dstRange = c->dstRange;
-ret = sws_init_context(c->cascaded_context[1], srcFilter , 
dstFilter);
-if (ret < 0)
-return ret;
-
-return 0;
+if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != 
SWS_ALPHA_BLEND_NONE) {
+if (!unscaled ||
+dstFormat != tmpFormat ||
+usesHFilter || usesVFilter ||
+c->srcRange != c->dstRange
+) {
+c->cascaded_mainindex = 1;
+ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
+ srcW, srcH, tmpFormat, 64);
+if (ret < 0)
+return ret;
+
+c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, 
srcFormat,
+srcW, srcH, 
tmpFormat,
+flags, c->param);
+if (!c->cascaded_context[0])
+return -1;
+c->cascaded_context[0]->alphablend = c->alphablend;
+ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
+if (ret < 0)
+return ret;
+
+c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, 
tmpFormat,
+dstW, dstH, 
dstFormat,
+flags, c->param);
+if (!c->cascaded_context[1])
+return -1;
+
+c->cascaded_context[1]->srcRange = c->srcRange;
+c->cascaded_context[1]->dstRange = c->dstRange;
+ret = sws_init_context(c->cascaded_context[1], srcFilter , 
dstFilter);
+if (ret < 0)
+return ret;
+
+return 0;
+}
 }
 }
 
-- 
1.8.3.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] MPEG-2 FLAGS2_FAST benchmarks

2020-06-13 Thread Kieran Kunhya
Hello,

I have run the following commands on the following CPU which is 7 years old:
Intel(R) Xeon(R) CPU E3-1265L v3

ffmpeg_g -i matrixbench_mpeg2.mpg -f null -
and
ffmpeg_g -flags2 fast -i matrixbench_mpeg2.mpg -f null -

Here are the results:

Normal Fast
2202 2168
2155 2057
2210 2128
2104 2051
2132 2053
2035 2014
2021 2037
2247 1999
2095 2015
2232 2119
Mean 2143.3 2064.1
Stdev 79.82209385 55.9075626

It can therefore be shown that the difference is statistically
insignificant.

I would like to propose removing MPEG-2 fast mode.
Removing it also saves ~4KB on the stripped ffmpeg binary.

Regards,
Kieran Kunhya
___
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/5] avformat/oggdec: Disable mid stream codec changes

2020-06-13 Thread Lynne
Jun 13, 2020, 12:23 by mich...@niedermayer.cc:

> The code crashes and neither the authors nor anyone else did fix this
> We cannot release code which crashes, so if noone fixes it, the only
> option left is to disable or revert. Revert is difficult as there are
> multiple commits afterwards
>

You're suggesting a revert when disabling it is so simple?
As if the commits didn't fix an issue users have been begging for for years?
Do you want a permanently dead project where no code changes because it may 
crash
or break things? You should fork instead, we'd all be better off then.

I even asked you on IRC whether your previous 2 commits fixed the crash, so I 
know whether
to try fixing it, and you didn't even respond. You didn't even ping me anytime 
to check up.
And yet you claim I've abandoned it? As if I don't have a million things to 
work on or worry
about already.

___
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] MPEG-2 FLAGS2_FAST benchmarks

2020-06-13 Thread Derek Buitenhuis
On 13/06/2020 17:11, Kieran Kunhya wrote:
> It can therefore be shown that the difference is statistically
> insignificant.

I really think the onus of proving FAST is useful should be on
the people who claim it is useful - something I haven't seen
any evidence for.

- Derek
___
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: add MCC demuxer

2020-06-13 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/mccdec.c | 217 +++
 3 files changed, 219 insertions(+)
 create mode 100644 libavformat/mccdec.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 0658fa3710..26af859a28 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -303,6 +303,7 @@ OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o 
matroska.o \
 av1.o avc.o hevc.o \
 flacenc_header.o avlanguage.o \
 vorbiscomment.o wv.o
+OBJS-$(CONFIG_MCC_DEMUXER)   += mccdec.o subtitles.o
 OBJS-$(CONFIG_MD5_MUXER) += hashenc.o
 OBJS-$(CONFIG_MGSTS_DEMUXER) += mgsts.o
 OBJS-$(CONFIG_MICRODVD_DEMUXER)  += microdvddec.o subtitles.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index a7c5c9db89..97fd06debb 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -230,6 +230,7 @@ extern AVInputFormat  ff_lvf_demuxer;
 extern AVInputFormat  ff_lxf_demuxer;
 extern AVInputFormat  ff_m4v_demuxer;
 extern AVOutputFormat ff_m4v_muxer;
+extern AVInputFormat  ff_mcc_demuxer;
 extern AVOutputFormat ff_md5_muxer;
 extern AVInputFormat  ff_matroska_demuxer;
 extern AVOutputFormat ff_matroska_muxer;
diff --git a/libavformat/mccdec.c b/libavformat/mccdec.c
new file mode 100644
index 00..2445e30867
--- /dev/null
+++ b/libavformat/mccdec.c
@@ -0,0 +1,217 @@
+/*
+ * MCC subtitle demuxer
+ * Copyright (c) 2020 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "internal.h"
+#include "subtitles.h"
+#include "libavutil/avstring.h"
+#include "libavutil/bprint.h"
+#include "libavutil/intreadwrite.h"
+
+typedef struct MCCContext {
+FFDemuxSubtitlesQueue q;
+} MCCContext;
+
+static int mcc_probe(const AVProbeData *p)
+{
+char buf[31];
+FFTextReader tr;
+
+ff_text_init_buf(&tr, p->buf, p->buf_size);
+
+while (ff_text_peek_r8(&tr) == '\r' || ff_text_peek_r8(&tr) == '\n')
+ff_text_r8(&tr);
+
+ff_text_read(&tr, buf, sizeof(buf));
+
+if (!memcmp(buf, "File Format=MacCaption_MCC V1.0", 31))
+return AVPROBE_SCORE_MAX;
+
+return 0;
+}
+
+static int convert(uint8_t x)
+{
+if (x >= 'a')
+x -= 87;
+else if (x >= 'A')
+x -= 55;
+else
+x -= '0';
+return x;
+}
+
+typedef struct alias {
+uint8_t key;
+int len;
+const char *value;
+} alias;
+
+static const alias aliases[20] = {
+{ .key = 16, .len =  3, .value = "\xFA\x0\x0", },
+{ .key = 17, .len =  6, .value = "\xFA\x0\x0\xFA\x0\x0", },
+{ .key = 18, .len =  9, .value = "\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
+{ .key = 19, .len = 12, .value = 
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
+{ .key = 20, .len = 15, .value = 
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
+{ .key = 21, .len = 18, .value = 
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
+{ .key = 22, .len = 21, .value = 
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0", },
+{ .key = 23, .len = 24, .value = 
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0",
 },
+{ .key = 24, .len = 27, .value = 
"\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0\xFA\x0\x0",
 },
+{ .key = 25, .len =  3, .value = "\xFB\x80\x80", },
+{ .key = 26, .len =  3, .value = "\xFC\x80\x80", },
+{ .key = 27, .len =  3, .value = "\xFD\x80\x80", },
+{ .key = 28, .len =  2, .value = "\x96\x69", },
+{ .key = 29, .len =  2, .value = "\x61\x01", },
+{ .key = 30, .len =  3, .value = "\xFC\x80\x80", },
+{ .key = 31, .len =  3, .value = "\xFC\x80\x80", },
+{ .key = 32, .len =  4, .value = "\xE1\x00\x00\x00", },
+{ .key = 33, .len =  0, .value = NULL, },
+{ .key = 34, .len =  0, .value = NULL, },
+{ .key = 35, .len =  1, .value = "\x0", },
+};
+
+static int mcc_read_header(AVFormatContext *s)
+{
+MCCContext *mcc = s->priv_data;
+AVStream *st = avformat_new_stream(s, NULL)

Re: [FFmpeg-devel] [PATCH] avformat: add MCC demuxer

2020-06-13 Thread Kieran Kunhya
>
> +if (av_sscanf(line, "%d:%d:%d:%d", &hh, &mm, &ss, &fs) != 4)
>
+continue;
>

Maybe worth a comment saying you're converting a timecode to a PTS here.
These are often not the same.

Kieran
___
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] fix the bug that AV_PKT_FLAG_CORRUPT flags lost after parse_packet()

2020-06-13 Thread Andreas Rheinhardt
leviz...@live.cn:
> From: zhaoyi 
> 
> ---
>  libavformat/utils.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 667249362c..a74c0f74a2 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1516,6 +1516,7 @@ static int parse_packet(AVFormatContext *s, AVPacket 
> *pkt,
>  out_pkt.dts  = st->parser->dts;
>  out_pkt.pos  = st->parser->pos;
>  out_pkt.flags   |= pkt->flags & AV_PKT_FLAG_DISCARD;
> +out_pkt.flags   |= pkt->flags & AV_PKT_FLAG_CORRUPT;
>  
>  if (st->need_parsing == AVSTREAM_PARSE_FULL_RAW)
>  out_pkt.pos = st->parser->frame_offset;
> 
You can combine this with the line above via pkt->flags &
(AV_PKT_FLAG_DISCARD | AV_PKT_FLAG_CORRUPT).

- 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 2/2] avcodec/mv30: check mode_size vs. input space

2020-06-13 Thread Michael Niedermayer
Fixes: Timeout (longer than my patience vs 1sec)
Fixes: 
22984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MV30_fuzzer-5630021988515840

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

diff --git a/libavcodec/mv30.c b/libavcodec/mv30.c
index 013a5753fe..76b9170eaf 100644
--- a/libavcodec/mv30.c
+++ b/libavcodec/mv30.c
@@ -410,6 +410,9 @@ static int decode_intra(AVCodecContext *avctx, 
GetBitContext *gb, AVFrame *frame
 int ret;
 
 mgb = *gb;
+if (get_bits_left(gb) < s->mode_size * 8)
+return AVERROR_INVALIDDATA;
+
 skip_bits_long(gb, s->mode_size * 8);
 
 linesize[0] = frame->linesize[0];
-- 
2.17.1

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

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

[FFmpeg-devel] [PATCH 1/2] avcodec/ffwavesynth: Avoid undefined operation on ts overflow

2020-06-13 Thread Michael Niedermayer
Alternatively these conditions could be treated as errors
Fixes: 
23147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5639254549200896
Fixes: signed integer overflow: 9223372036854775807 + 1 cannot be represented 
in type 'int64_t' (aka 'long')

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

diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c
index a446aa2fdf..8d3ac81aef 100644
--- a/libavcodec/ffwavesynth.c
+++ b/libavcodec/ffwavesynth.c
@@ -444,7 +444,7 @@ static int wavesynth_decode(AVCodecContext *avc, void 
*rframe, int *rgot_frame,
 if (r < 0)
 return r;
 pcm = (int16_t *)frame->data[0];
-for (s = 0; s < duration; s++, ts++) {
+for (s = 0; s < duration; s++, ts+=(uint64_t)1) {
 memset(channels, 0, avc->channels * sizeof(*channels));
 if (ts >= ws->next_ts)
 wavesynth_enter_intervals(ws, ts);
@@ -452,7 +452,7 @@ static int wavesynth_decode(AVCodecContext *avc, void 
*rframe, int *rgot_frame,
 for (c = 0; c < avc->channels; c++)
 *(pcm++) = channels[c] >> 16;
 }
-ws->cur_ts += duration;
+ws->cur_ts += (uint64_t)duration;
 *rgot_frame = 1;
 return packet->size;
 }
-- 
2.17.1

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

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

Re: [FFmpeg-devel] [PATCH] avformat: add MCC demuxer

2020-06-13 Thread Lou Logan
On Sat, Jun 13, 2020, at 9:49 AM, Paul B Mahol wrote:
[...]
> +static int mcc_read_header(AVFormatContext *s)
> +{
> +MCCContext *mcc = s->priv_data;
> +AVStream *st = avformat_new_stream(s, NULL);
> +AVRational rate;
> +int64_t ts, pos;
> +ptrdiff_t len;

‘len’ set but not used
___
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/icecast: Add option to use TLS connection

2020-06-13 Thread Marvin Scholz
---
 doc/protocols.texi| 3 +++
 libavformat/icecast.c | 7 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 7aa758541c..32c829d2a3 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -520,6 +520,9 @@ audio/mpeg.
 This enables support for Icecast versions < 2.4.0, that do not support the
 HTTP PUT method but the SOURCE method.
 
+@item tls
+Establish a TLS (HTTPS) connection to Icecast.
+
 @end table
 
 @example
diff --git a/libavformat/icecast.c b/libavformat/icecast.c
index 38af16b99e..5073367fd4 100644
--- a/libavformat/icecast.c
+++ b/libavformat/icecast.c
@@ -43,6 +43,7 @@ typedef struct IcecastContext {
 int public;
 char *url;
 char *user_agent;
+int tls;
 } IcecastContext;
 
 #define DEFAULT_ICE_USER "source"
@@ -62,6 +63,7 @@ static const AVOption options[] = {
 { "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { .str = 
NULL }, 0, 0, E },
 { "content_type", "set content-type, MUST be set if not audio/mpeg", 
OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
 { "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", 
OFFSET(legacy_icecast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
+{ "tls", "use a TLS connection", OFFSET(tls), AV_OPT_TYPE_BOOL, { .i64 = 0 
}, 0, 1, E },
 { NULL }
 };
 
@@ -161,8 +163,11 @@ static int icecast_open(URLContext *h, const char *uri, 
int flags)
 goto cleanup;
 }
 
+// Check which underlying protocol should be used
+const char *real_proto = (s->tls) ? "https" : "http";
+
 // Build new URI for passing to http protocol
-ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, "%s", path);
+ff_url_join(h_url, sizeof(h_url), real_proto, auth, host, port, "%s", 
path);
 // Finally open http proto handler
 ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, NULL,
&opt_dict, h->protocol_whitelist, 
h->protocol_blacklist, h);
-- 
2.24.1 (Apple Git-126)

___
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/icecast: Add option to use TLS connection

2020-06-13 Thread Andreas Rheinhardt
Marvin Scholz:
> ---
>  doc/protocols.texi| 3 +++
>  libavformat/icecast.c | 7 ++-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 7aa758541c..32c829d2a3 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -520,6 +520,9 @@ audio/mpeg.
>  This enables support for Icecast versions < 2.4.0, that do not support the
>  HTTP PUT method but the SOURCE method.
>  
> +@item tls
> +Establish a TLS (HTTPS) connection to Icecast.
> +
>  @end table
>  
>  @example
> diff --git a/libavformat/icecast.c b/libavformat/icecast.c
> index 38af16b99e..5073367fd4 100644
> --- a/libavformat/icecast.c
> +++ b/libavformat/icecast.c
> @@ -43,6 +43,7 @@ typedef struct IcecastContext {
>  int public;
>  char *url;
>  char *user_agent;
> +int tls;
>  } IcecastContext;
>  
>  #define DEFAULT_ICE_USER "source"
> @@ -62,6 +63,7 @@ static const AVOption options[] = {
>  { "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { .str = 
> NULL }, 0, 0, E },
>  { "content_type", "set content-type, MUST be set if not audio/mpeg", 
> OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
>  { "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", 
> OFFSET(legacy_icecast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
> +{ "tls", "use a TLS connection", OFFSET(tls), AV_OPT_TYPE_BOOL, { .i64 = 
> 0 }, 0, 1, E },
>  { NULL }
>  };
>  
> @@ -161,8 +163,11 @@ static int icecast_open(URLContext *h, const char *uri, 
> int flags)
>  goto cleanup;
>  }
>  
> +// Check which underlying protocol should be used
> +const char *real_proto = (s->tls) ? "https" : "http";

This should give a "mixed declaration and code" compiler warning.

> +
>  // Build new URI for passing to http protocol
> -ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, "%s", path);
> +ff_url_join(h_url, sizeof(h_url), real_proto, auth, host, port, "%s", 
> path);
>  // Finally open http proto handler
>  ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, NULL,
> &opt_dict, h->protocol_whitelist, 
> h->protocol_blacklist, h);
> 

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

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

[FFmpeg-devel] [PATCH v2] avformat/icecast: Add option to use TLS connection

2020-06-13 Thread Marvin Scholz
---
 doc/protocols.texi| 3 +++
 libavformat/icecast.c | 8 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 7aa758541c..32c829d2a3 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -520,6 +520,9 @@ audio/mpeg.
 This enables support for Icecast versions < 2.4.0, that do not support the
 HTTP PUT method but the SOURCE method.
 
+@item tls
+Establish a TLS (HTTPS) connection to Icecast.
+
 @end table
 
 @example
diff --git a/libavformat/icecast.c b/libavformat/icecast.c
index 38af16b99e..cd70d3d337 100644
--- a/libavformat/icecast.c
+++ b/libavformat/icecast.c
@@ -43,6 +43,7 @@ typedef struct IcecastContext {
 int public;
 char *url;
 char *user_agent;
+int tls;
 } IcecastContext;
 
 #define DEFAULT_ICE_USER "source"
@@ -62,6 +63,7 @@ static const AVOption options[] = {
 { "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { .str = 
NULL }, 0, 0, E },
 { "content_type", "set content-type, MUST be set if not audio/mpeg", 
OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
 { "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", 
OFFSET(legacy_icecast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
+{ "tls", "use a TLS connection", OFFSET(tls), AV_OPT_TYPE_BOOL, { .i64 = 0 
}, 0, 1, E },
 { NULL }
 };
 
@@ -89,6 +91,7 @@ static int icecast_open(URLContext *h, const char *uri, int 
flags)
 // URI part variables
 char h_url[1024], host[1024], auth[1024], path[1024];
 char *headers, *user = NULL;
+const char *real_proto;
 int port, ret;
 AVBPrint bp;
 
@@ -161,8 +164,11 @@ static int icecast_open(URLContext *h, const char *uri, 
int flags)
 goto cleanup;
 }
 
+// Check which underlying protocol should be used
+real_proto = (s->tls) ? "https" : "http";
+
 // Build new URI for passing to http protocol
-ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, "%s", path);
+ff_url_join(h_url, sizeof(h_url), real_proto, auth, host, port, "%s", 
path);
 // Finally open http proto handler
 ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, NULL,
&opt_dict, h->protocol_whitelist, 
h->protocol_blacklist, h);
-- 
2.24.1 (Apple Git-126)

___
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: add MCC demuxer

2020-06-13 Thread Carl Eugen Hoyos
Am Sa., 13. Juni 2020 um 19:56 Uhr schrieb Paul B Mahol :

[...]

Please mention ticket #7680.

Carl Eugen
___
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] avformat/icecast: Add option to use TLS connection

2020-06-13 Thread Carl Eugen Hoyos
Am So., 14. Juni 2020 um 00:32 Uhr schrieb Marvin Scholz :

> +// Check which underlying protocol should be used
> +real_proto = (s->tls) ? "https" : "http";

Both comment and parentheses are useless.

Carl Eugen
___
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] MPEG-2 FLAGS2_FAST benchmarks

2020-06-13 Thread Michael Niedermayer
On Sat, Jun 13, 2020 at 05:11:05PM +0100, Kieran Kunhya wrote:
> Hello,
> 
> I have run the following commands on the following CPU which is 7 years old:
> Intel(R) Xeon(R) CPU E3-1265L v3
> 
> ffmpeg_g -i matrixbench_mpeg2.mpg -f null -
> and
> ffmpeg_g -flags2 fast -i matrixbench_mpeg2.mpg -f null -
> 
> Here are the results:
> 
> Normal Fast
> 2202 2168
> 2155 2057
> 2210 2128
> 2104 2051
> 2132 2053
> 2035 2014
> 2021 2037
> 2247 1999
> 2095 2015
> 2232 2119
> Mean 2143.3 2064.1
> Stdev 79.82209385 55.9075626
> 
> It can therefore be shown that the difference is statistically
> insignificant.
> 
> I would like to propose removing MPEG-2 fast mode.
> Removing it also saves ~4KB on the stripped ffmpeg binary.

I would have preferred not to have to defend my code contributions
repeatedly. Something which seems unevenly requested from developers.
But then whatever, writing this here also is a useful and informative
mail i hope. 

Lets go through it, each problem alone more or less invalidates the claim IMO.

Problem 1
you have a mean of around 2100 and Stdev of about between 55 and 80 so if by
statistically significant you man 2 Stdev, then with the mean you have.
You would declare every optimization of less than 6% to be statistically
insignificant.
So by what you say here, it seems to me you would have to suggest that
every optimization which provides 6% or less overall speedup to be
removed.
That i doubt many will agree with

Problem 2
We do not meassure speed this way because its not realiable nor practical
just look at this, especially the difference and variation
./ffmpeg -threads 1 -i ~/videos/matrixbench_mpeg2.mpg -f null -
   8941 decicycles in non-intra, 2097003 runs,149 skipste=N/A speed=53.2x   
 
   8941 decicycles in non-intra, 2097013 runs,139 skipste=N/A speed=54.1x   
 
   8942 decicycles in non-intra, 2097038 runs,114 skipste=N/A speed=54.1x   
 
   8970 decicycles in non-intra, 2097037 runs,115 skipste=N/A speed=  54x   
 

./ffmpeg -threads 1 -flags2 fast -i ~/videos/matrixbench_mpeg2.mpg -f null -
   8718 decicycles in non-intra, 2097020 runs,132 skipste=N/A speed=54.6x   
 
   8701 decicycles in non-intra, 2097044 runs,108 skipste=N/A speed=54.6x   
 
   8718 decicycles in non-intra, 2097034 runs,118 skipste=N/A speed=54.5x   
 
   8702 decicycles in non-intra, 2097029 runs,123 skipste=N/A speed=54.5x   
 
  
This difference is statistically significant, i can say this without the need
to check
Tested on a AMD Ryzen 9 3950X but i expect you will see similar on most CPUs


Problem 3
You dont search for useless code, this is not a "i tested 100 optimizations and 
found these not worth it"
You search for an argument to remove specific pieces of my code.
thats seriously not making sense to me. really not


Problem 4
try H264 using good old time
time ./ffmpeg -thread_type slice -i fate-suite//h264/bbc2.sample.h264 -f null -
real0m0,252s
real0m0,254s
real0m0,254s
real0m0,255s

time ./ffmpeg -flags2 fast  -thread_type slice -i 
fate-suite//h264/bbc2.sample.h264 -f null -
real0m0,217s
real0m0,220s
real0m0,218s
real0m0,217s

Here even with a crude way of meassuring we can see a clear and strong 
difference


Thanks

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

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


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
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] avformat/icecast: Add option to use TLS connection

2020-06-13 Thread Marvin Scholz
---
 doc/protocols.texi| 3 +++
 libavformat/icecast.c | 6 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 7aa758541c..32c829d2a3 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -520,6 +520,9 @@ audio/mpeg.
 This enables support for Icecast versions < 2.4.0, that do not support the
 HTTP PUT method but the SOURCE method.
 
+@item tls
+Establish a TLS (HTTPS) connection to Icecast.
+
 @end table
 
 @example
diff --git a/libavformat/icecast.c b/libavformat/icecast.c
index 38af16b99e..b06c53cabd 100644
--- a/libavformat/icecast.c
+++ b/libavformat/icecast.c
@@ -43,6 +43,7 @@ typedef struct IcecastContext {
 int public;
 char *url;
 char *user_agent;
+int tls;
 } IcecastContext;
 
 #define DEFAULT_ICE_USER "source"
@@ -62,6 +63,7 @@ static const AVOption options[] = {
 { "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, { .str = 
NULL }, 0, 0, E },
 { "content_type", "set content-type, MUST be set if not audio/mpeg", 
OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
 { "legacy_icecast", "use legacy SOURCE method, for Icecast < v2.4", 
OFFSET(legacy_icecast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E },
+{ "tls", "use a TLS connection", OFFSET(tls), AV_OPT_TYPE_BOOL, { .i64 = 0 
}, 0, 1, E },
 { NULL }
 };
 
@@ -162,7 +164,9 @@ static int icecast_open(URLContext *h, const char *uri, int 
flags)
 }
 
 // Build new URI for passing to http protocol
-ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, "%s", path);
+ff_url_join(h_url, sizeof(h_url),
+s->tls ? "https" : "http",
+auth, host, port, "%s", path);
 // Finally open http proto handler
 ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, NULL,
&opt_dict, h->protocol_whitelist, 
h->protocol_blacklist, h);
-- 
2.24.1 (Apple Git-126)

___
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/5] avformat/oggdec: Disable mid stream codec changes

2020-06-13 Thread Michael Niedermayer
On Sat, Jun 13, 2020 at 02:12:55PM +0200, Lynne wrote:
> Jun 13, 2020, 12:23 by mich...@niedermayer.cc:
> 
> > The code crashes and neither the authors nor anyone else did fix this
> > We cannot release code which crashes, so if noone fixes it, the only
> > option left is to disable or revert. Revert is difficult as there are
> > multiple commits afterwards
> >
> 
> You're suggesting a revert when disabling it is so simple?
> As if the commits didn't fix an issue users have been begging for for years?
> Do you want a permanently dead project where no code changes because it may 
> crash
> or break things? You should fork instead, we'd all be better off then.
> 
> I even asked you on IRC whether your previous 2 commits fixed the crash, so I 
> know whether
> to try fixing it, and you didn't even respond. You didn't even ping me 
> anytime to check up.
> And yet you claim I've abandoned it? As if I don't have a million things to 
> work on or worry
> about already.

I missed your questions on IRC, in fact ive been a little sick in the last
few days, nothing serious, just some migraine and mild fever after a dentist.
But that probably kept me from looking at IRC for too long at the wrong time

sorry

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

Those who are best at talking, realize last or never when they are wrong.


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

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

Re: [FFmpeg-devel] [PATCH] avformat/icecast: Add option to use TLS connection

2020-06-13 Thread Marvin Scholz



On 14 Jun 2020, at 0:18, Andreas Rheinhardt wrote:


Marvin Scholz:

---
 doc/protocols.texi| 3 +++
 libavformat/icecast.c | 7 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 7aa758541c..32c829d2a3 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -520,6 +520,9 @@ audio/mpeg.
 This enables support for Icecast versions < 2.4.0, that do not 
support the

 HTTP PUT method but the SOURCE method.

+@item tls
+Establish a TLS (HTTPS) connection to Icecast.
+
 @end table

 @example
diff --git a/libavformat/icecast.c b/libavformat/icecast.c
index 38af16b99e..5073367fd4 100644
--- a/libavformat/icecast.c
+++ b/libavformat/icecast.c
@@ -43,6 +43,7 @@ typedef struct IcecastContext {
 int public;
 char *url;
 char *user_agent;
+int tls;
 } IcecastContext;

 #define DEFAULT_ICE_USER "source"
@@ -62,6 +63,7 @@ static const AVOption options[] = {
 { "password", "set password", OFFSET(pass), AV_OPT_TYPE_STRING, 
{ .str = NULL }, 0, 0, E },
 { "content_type", "set content-type, MUST be set if not 
audio/mpeg", OFFSET(content_type), AV_OPT_TYPE_STRING, { .str = NULL 
}, 0, 0, E },
 { "legacy_icecast", "use legacy SOURCE method, for Icecast < 
v2.4", OFFSET(legacy_icecast), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, 
E },
+{ "tls", "use a TLS connection", OFFSET(tls), AV_OPT_TYPE_BOOL, 
{ .i64 = 0 }, 0, 1, E },

 { NULL }
 };

@@ -161,8 +163,11 @@ static int icecast_open(URLContext *h, const 
char *uri, int flags)

 goto cleanup;
 }

+// Check which underlying protocol should be used
+const char *real_proto = (s->tls) ? "https" : "http";


This should give a "mixed declaration and code" compiler warning.



It does not for me, using Apple clang version 11.0.3 
(clang-1103.0.32.29)


I had no idea ffmpeg has this requirement still, will send a new version
that separates declaration and assignment.


+
 // Build new URI for passing to http protocol
-ff_url_join(h_url, sizeof(h_url), "http", auth, host, port, 
"%s", path);
+ff_url_join(h_url, sizeof(h_url), real_proto, auth, host, port, 
"%s", path);

 // Finally open http proto handler
 ret = ffurl_open_whitelist(&s->hd, h_url, AVIO_FLAG_READ_WRITE, 
NULL,
&opt_dict, h->protocol_whitelist, 
h->protocol_blacklist, h);




___
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 v2] avformat/icecast: Add option to use TLS connection

2020-06-13 Thread Marvin Scholz



On 14 Jun 2020, at 0:36, Carl Eugen Hoyos wrote:

Am So., 14. Juni 2020 um 00:32 Uhr schrieb Marvin Scholz 
:



+// Check which underlying protocol should be used
+real_proto = (s->tls) ? "https" : "http";


Both comment and parentheses are useless.



Sent new version that gets rid of the intermediate variable,
comment and parentheses.


Carl Eugen
___
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 1/4] swscale/utils: reindent

2020-06-13 Thread lance . lmwang

Sorry, please ignore the repeat sending for 1,3,4. I haven't got them for a
while so I think something is wrong with client and resend. 


On Sat, Jun 13, 2020 at 11:05:36PM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  libswscale/utils.c | 71 
> +++---
>  1 file changed, 36 insertions(+), 35 deletions(-)
> 
> diff --git a/libswscale/utils.c b/libswscale/utils.c
> index ff99e79..6e218ba 100644
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -1575,41 +1575,42 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
> *srcFilter,
>  if (CONFIG_SWSCALE_ALPHA && isALPHA(srcFormat) && !isALPHA(dstFormat)) {
>  enum AVPixelFormat tmpFormat = alphaless_fmt(srcFormat);
>  
> -if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != 
> SWS_ALPHA_BLEND_NONE)
> -if (!unscaled ||
> -dstFormat != tmpFormat ||
> -usesHFilter || usesVFilter ||
> -c->srcRange != c->dstRange
> -) {
> -c->cascaded_mainindex = 1;
> -ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
> -srcW, srcH, tmpFormat, 64);
> -if (ret < 0)
> -return ret;
> -
> -c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, 
> srcFormat,
> -srcW, srcH, 
> tmpFormat,
> -flags, c->param);
> -if (!c->cascaded_context[0])
> -return -1;
> -c->cascaded_context[0]->alphablend = c->alphablend;
> -ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
> -if (ret < 0)
> -return ret;
> -
> -c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, 
> tmpFormat,
> -dstW, dstH, 
> dstFormat,
> -flags, c->param);
> -if (!c->cascaded_context[1])
> -return -1;
> -
> -c->cascaded_context[1]->srcRange = c->srcRange;
> -c->cascaded_context[1]->dstRange = c->dstRange;
> -ret = sws_init_context(c->cascaded_context[1], srcFilter , 
> dstFilter);
> -if (ret < 0)
> -return ret;
> -
> -return 0;
> +if (tmpFormat != AV_PIX_FMT_NONE && c->alphablend != 
> SWS_ALPHA_BLEND_NONE) {
> +if (!unscaled ||
> +dstFormat != tmpFormat ||
> +usesHFilter || usesVFilter ||
> +c->srcRange != c->dstRange
> +) {
> +c->cascaded_mainindex = 1;
> +ret = av_image_alloc(c->cascaded_tmp, c->cascaded_tmpStride,
> + srcW, srcH, tmpFormat, 64);
> +if (ret < 0)
> +return ret;
> +
> +c->cascaded_context[0] = sws_alloc_set_opts(srcW, srcH, 
> srcFormat,
> +srcW, srcH, 
> tmpFormat,
> +flags, c->param);
> +if (!c->cascaded_context[0])
> +return -1;
> +c->cascaded_context[0]->alphablend = c->alphablend;
> +ret = sws_init_context(c->cascaded_context[0], NULL , NULL);
> +if (ret < 0)
> +return ret;
> +
> +c->cascaded_context[1] = sws_alloc_set_opts(srcW, srcH, 
> tmpFormat,
> +dstW, dstH, 
> dstFormat,
> +flags, c->param);
> +if (!c->cascaded_context[1])
> +return -1;
> +
> +c->cascaded_context[1]->srcRange = c->srcRange;
> +c->cascaded_context[1]->dstRange = c->dstRange;
> +ret = sws_init_context(c->cascaded_context[1], srcFilter , 
> dstFilter);
> +if (ret < 0)
> +return ret;
> +
> +return 0;
> +}
>  }
>  }
>  
> -- 
> 1.8.3.1
> 

-- 
Thanks,
Limin Wang
___
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] MPEG-2 FLAGS2_FAST benchmarks

2020-06-13 Thread Kieran Kunhya
Hi,


> Problem 1
> you have a mean of around 2100 and Stdev of about between 55 and 80 so if
> by
> statistically significant you man 2 Stdev, then with the mean you have.
> You would declare every optimization of less than 6% to be statistically
> insignificant.
> So by what you say here, it seems to me you would have to suggest that
> every optimization which provides 6% or less overall speedup to be
> removed.
> That i doubt many will agree with
>

Logical fallacy.


> Problem 2
> We do not meassure speed this way because its not realiable nor practical
> just look at this, especially the difference and variation
> ./ffmpeg -threads 1 -i ~/videos/matrixbench_mpeg2.mpg -f null -
>8941 decicycles in non-intra, 2097003 runs,149 skipste=N/A
> speed=53.2x
>8941 decicycles in non-intra, 2097013 runs,139 skipste=N/A
> speed=54.1x
>8942 decicycles in non-intra, 2097038 runs,114 skipste=N/A
> speed=54.1x
>8970 decicycles in non-intra, 2097037 runs,115 skipste=N/A speed=
> 54x
>
> ./ffmpeg -threads 1 -flags2 fast -i ~/videos/matrixbench_mpeg2.mpg -f null
> -
>8718 decicycles in non-intra, 2097020 runs,132 skipste=N/A
> speed=54.6x
>8701 decicycles in non-intra, 2097044 runs,108 skipste=N/A
> speed=54.6x
>8718 decicycles in non-intra, 2097034 runs,118 skipste=N/A
> speed=54.5x
>8702 decicycles in non-intra, 2097029 runs,123 skipste=N/A
> speed=54.5x
>
> This difference is statistically significant, i can say this without the
> need
> to check
> Tested on a AMD Ryzen 9 3950X but i expect you will see similar on most
> CPUs
>

Did you remove the branch for FLAGS2_FAST and the large amount of inlined
code when making this measurement?
I also note that you just ignore mb_block_count in FLAGS2_FAST mode so this
is not a fair comparison.


> Problem 3
> You dont search for useless code, this is not a "i tested 100
> optimizations and found these not worth it"
> You search for an argument to remove specific pieces of my code.
> thats seriously not making sense to me. really not


I am not going to even try to respond to that as it clearly extends into
issues larger than FFmpeg.


> Problem 4
> try H264 using good old time
> time ./ffmpeg -thread_type slice -i fate-suite//h264/bbc2.sample.h264 -f
> null -
> real0m0,252s
> real0m0,254s
> real0m0,254s
> real0m0,255s
>
> time ./ffmpeg -flags2 fast  -thread_type slice -i
> fate-suite//h264/bbc2.sample.h264 -f null -
> real0m0,217s
> real0m0,220s
> real0m0,218s
> real0m0,217s
>
> Here even with a crude way of meassuring we can see a clear and strong
> difference
>

That's H.264, not MPEG-2, not relevant to this discussion. Is that file
even capable of using slice threading to decode?

Going back to the original point about MPEG-2, if a user chooses
FLAGS2_FAST, they expect it to make a major difference.
I had tested MPEG-2 expecting it to be much more significant but it is not.
Not 200 decicycles on a single function (making up your own dequant).

Kieran
___
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] OS/2:Support linking against libcx

2020-06-13 Thread Dave Yeo

On 06/13/20 07:03 AM, KO Myung-Hun wrote:

Hi/2.

Dave Yeo wrote:

On 06/11/20 10:26 AM, Michael Niedermayer wrote:

On Wed, Jun 10, 2020 at 09:24:51PM -0700, Dave Yeo wrote:

On 06/10/20 02:09 PM, Michael Niedermayer wrote:

On Tue, Jun 09, 2020 at 11:11:48PM -0700, Dave Yeo wrote:

Hi, could I get this pushed to trunk and the 4.3 branch? Fixes a
build break
in libavformat/ip.c (implicit declaration of function
'getaddrinfo') and
also need the prototype.
Thanks,
Dave

it seems this breaks build on linux


Sorry about that, I'll test on Linux in the future.
Here's a better patch as it doesn't touch configure.
Thanks,
Dave


I can confirm this does not break build anymore, but iam not OS/2
maintainer nor do i have such box so ill leave review / application
to someone better suited for this

thx
[...]


Fair enough, I'll CC KOMH


I have no problems at all with gcc 9.1.0 because FFmpeg already has
replacements for missing functions such as getaddrinfo().

What is your build environment ? Maybe is libcx linked by default ?



The problem only occurs if I link in libcx, LIBS=-lcx.
Note that with libcx, the build system finds its getaddrinfo() and later 
fails due to no prototype and will also fail as part of the addrinfo 
struct uses a different type (char vs int IIRC). Without LIBS=-lcx, the 
build falls back to FFmpeg's builtin getaddrinfo().
One of the main reasons to link to libcx is for the exceptq support. 
Also as it is recommended, others are likely to do the same thing.

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