Re: [FFmpeg-devel] [PATCH] avformat/vpcc: fix values in VP9 level detection heuristics

2018-09-14 Thread James Zern
On Fri, Sep 14, 2018 at 6:39 PM James Almer  wrote:
>
> On 8/27/2018 10:59 PM, James Almer wrote:
> > The levels are stored as decimal values, not hexadecimal.
> >
> > Signed-off-by: James Almer 
> > ---
> >  libavformat/vpcc.c | 28 ++--
> >  1 file changed, 14 insertions(+), 14 deletions(-)
> >

lgtm. For anyone following, one reference is here:
https://www.webmproject.org/vp9/mp4/#vp-codec-configuration-box

> > diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> > index 79514483af..e0b7f288a6 100644
> > --- a/libavformat/vpcc.c
> > +++ b/libavformat/vpcc.c
> > @@ -81,33 +81,33 @@ static int get_vp9_level(AVCodecParameters *par, 
> > AVRational *frame_rate) {
> >  if (picture_size <= 0) {
> >  return 0;
> >  } else if (sample_rate <= 829440 && picture_size <= 36864) {
> > -return 0x10;
> > +return 10;
> >  } else if (sample_rate <= 2764800&& picture_size <= 73728) {
> > -return 0x11;
> > +return 11;
> >  } else if (sample_rate <= 4608000&& picture_size <= 122880) {
> > -return 0x20;
> > +return 20;
> >  } else if (sample_rate <= 9216000&& picture_size <= 245760) {
> > -return 0x21;
> > +return 21;
> >  } else if (sample_rate <= 20736000   && picture_size <= 552960) {
> > -return 0x30;
> > +return 30;
> >  } else if (sample_rate <= 36864000   && picture_size <= 983040) {
> > -return 0x31;
> > +return 31;
> >  } else if (sample_rate <= 83558400   && picture_size <= 2228224) {
> > -return 0x40;
> > +return 40;
> >  } else if (sample_rate <= 160432128  && picture_size <= 2228224) {
> > -return 0x41;
> > +return 41;
> >  } else if (sample_rate <= 311951360  && picture_size <= 8912896) {
> > -return 0x50;
> > +return 50;
> >  } else if (sample_rate <= 588251136  && picture_size <= 8912896) {
> > -return 0x51;
> > +return 51;
> >  } else if (sample_rate <= 1176502272 && picture_size <= 8912896) {
> > -return 0x52;
> > +return 52;
> >  } else if (sample_rate <= 1176502272 && picture_size <= 35651584) {
> > -return 0x60;
> > +return 60;
> >  } else if (sample_rate <= 2353004544 && picture_size <= 35651584) {
> > -return 0x61;
> > +return 61;
> >  } else if (sample_rate <= 4706009088 && picture_size <= 35651584) {
> > -return 0x62;
> > +return 62;
> >  } else {
> >  return 0;
> >  }
>
> Ping.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/vpcc: fix values in VP9 level detection heuristics

2018-09-14 Thread James Almer
On 8/27/2018 10:59 PM, James Almer wrote:
> The levels are stored as decimal values, not hexadecimal.
> 
> Signed-off-by: James Almer 
> ---
>  libavformat/vpcc.c | 28 ++--
>  1 file changed, 14 insertions(+), 14 deletions(-)
> 
> diff --git a/libavformat/vpcc.c b/libavformat/vpcc.c
> index 79514483af..e0b7f288a6 100644
> --- a/libavformat/vpcc.c
> +++ b/libavformat/vpcc.c
> @@ -81,33 +81,33 @@ static int get_vp9_level(AVCodecParameters *par, 
> AVRational *frame_rate) {
>  if (picture_size <= 0) {
>  return 0;
>  } else if (sample_rate <= 829440 && picture_size <= 36864) {
> -return 0x10;
> +return 10;
>  } else if (sample_rate <= 2764800&& picture_size <= 73728) {
> -return 0x11;
> +return 11;
>  } else if (sample_rate <= 4608000&& picture_size <= 122880) {
> -return 0x20;
> +return 20;
>  } else if (sample_rate <= 9216000&& picture_size <= 245760) {
> -return 0x21;
> +return 21;
>  } else if (sample_rate <= 20736000   && picture_size <= 552960) {
> -return 0x30;
> +return 30;
>  } else if (sample_rate <= 36864000   && picture_size <= 983040) {
> -return 0x31;
> +return 31;
>  } else if (sample_rate <= 83558400   && picture_size <= 2228224) {
> -return 0x40;
> +return 40;
>  } else if (sample_rate <= 160432128  && picture_size <= 2228224) {
> -return 0x41;
> +return 41;
>  } else if (sample_rate <= 311951360  && picture_size <= 8912896) {
> -return 0x50;
> +return 50;
>  } else if (sample_rate <= 588251136  && picture_size <= 8912896) {
> -return 0x51;
> +return 51;
>  } else if (sample_rate <= 1176502272 && picture_size <= 8912896) {
> -return 0x52;
> +return 52;
>  } else if (sample_rate <= 1176502272 && picture_size <= 35651584) {
> -return 0x60;
> +return 60;
>  } else if (sample_rate <= 2353004544 && picture_size <= 35651584) {
> -return 0x61;
> +return 61;
>  } else if (sample_rate <= 4706009088 && picture_size <= 35651584) {
> -return 0x62;
> +return 62;
>  } else {
>  return 0;
>  }

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


[FFmpeg-devel] [PATCH 3/3] avcodec/mpeg4videodec: Fix undefined shift in get_amv()

2018-09-14 Thread Michael Niedermayer
Fixes: runtime error: shift exponent -1 is negative
Fixes: 
9938/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5653783529914368

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

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 853c6d9132..f435a520c8 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -598,7 +598,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
 len >>= s->quarter_sample;
 
 if (s->real_sprite_warping_points == 1) {
-if (ctx->divx_version == 500 && ctx->divx_build == 413)
+if (ctx->divx_version == 500 && ctx->divx_build == 413 && a >= 
s->quarter_sample)
 sum = s->sprite_offset[0][n] / (1 << (a - s->quarter_sample));
 else
 sum = RSHIFT(s->sprite_offset[0][n] * (1 << s->quarter_sample), a);
-- 
2.18.0

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


[FFmpeg-devel] [PATCH 1/3] avcodec/shorten: Fix bitstream end check in read_header()

2018-09-14 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
9961/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5687856176562176

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

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index 1ffb7d8d79..4b45e6d6dc 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -456,7 +456,7 @@ static int read_header(ShortenContext *s)
 }
 
 skip_bytes = get_uint(s, NSKIPSIZE);
-if ((unsigned)skip_bytes > get_bits_left(&s->gb)/8) {
+if ((unsigned)skip_bytes > FFMAX(get_bits_left(&s->gb), 0)/8) {
 av_log(s->avctx, AV_LOG_ERROR, "invalid skip_bytes: %d\n", 
skip_bytes);
 return AVERROR_INVALIDDATA;
 }
-- 
2.18.0

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


[FFmpeg-devel] [PATCH 2/3] avcodec/mpeg4videodec: Check rice_prefix_code

2018-09-14 Thread Michael Niedermayer
Fixes: out of array read
Fixes: 
10064/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5766801384800256
Fixes: 
10225/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5071833448054784
Fixes: 
10261/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5115048024866816

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

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 4c77081237..853c6d9132 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1968,6 +1968,10 @@ static int mpeg4_decode_dpcm_macroblock(MpegEncContext 
*s, int16_t macroblock[25
 if (rice_prefix_code == 11)
 dpcm_residual = get_bits(&s->gb, 
s->avctx->bits_per_raw_sample);
 else {
+if (rice_prefix_code == 12) {
+av_log(s->avctx, AV_LOG_ERROR, "Forbidden 
rice_prefix_code\n");
+return AVERROR_INVALIDDATA;
+}
 rice_suffix_code = get_bitsz(&s->gb, rice_parameter);
 dpcm_residual = (rice_prefix_code << rice_parameter) + 
rice_suffix_code;
 }
-- 
2.18.0

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


Re: [FFmpeg-devel] [PATCH] libavcodec/libaomenc.c: Added code for computing PSNR/SSIM for libaom encoder.

2018-09-14 Thread James Almer
On 9/14/2018 5:53 PM, Sam John wrote:
> James,
> 
>> Did you copy this chunk from the libvpxenc wrapper? Because I don't
>> think this is valid at all for libaom. A quick grep on their tree shows
>> that AOM_FRAME_IS_INVISIBLE is never set anywhere. It looks like a
>> leftover flag they forgot to remove from the libvpx codebase
> 
> I used the same logic as libvpx. The flag AOM_FRAME_IS_INVISIBLE is not set
> at present. But I hope that this flag will be updated soon. I will update
> the code to remove this flag from my patch for now.

I filed a bug in the libaom bug tracker to request the removal of this
flag. Afaik it's not even used for VP9 in the libvpx codebase, only VP8.
aom_codec_get_cx_data() can only return a complete TU, which must have a
visible frame, so i don't think it's appropriate for AV1.

https://bugs.chromium.org/p/aomedia/issues/detail?id=2157

> 
>> Does libaom have a flag or field to signal the type of the visible frame
>> in the returned packet?
> At present libaom doesn't set the flag for the INTRA_ONLY in the returned
> packet. Until this flag is updated, we can use the same logic as libvpx.

Given its name, AOM_FRAME_IS_KEY should only be set if frame_type ==
KEY_FRAME, and not for any other kind of frame type.
Knowing that the visible frame is not of type KEY_FRAME alone does not
guarantee that it's an inter frame, so setting pict_type to
AV_PICTURE_TYPE_P in that case is just not correct (I know INTRA_ONLY
frames are rare, but we shouldn't risk reporting an intra frame as inter).

A new AOM_FRAME_IS_INTRA flag set to the derived value "FrameIsIntra"
defined in the Uncompressed Header from the spec, or a new "type" field
in aom_codec_cx_pkt_t.data.frame would probably be enough to solve this.

> 
> I will make these corrections and update the patch for review.
> 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavcodec/libaomenc.c: Added code for computing PSNR/SSIM for libaom encoder.

2018-09-14 Thread Sam John
James,

> Did you copy this chunk from the libvpxenc wrapper? Because I don't
>think this is valid at all for libaom. A quick grep on their tree shows
>that AOM_FRAME_IS_INVISIBLE is never set anywhere. It looks like a
>leftover flag they forgot to remove from the libvpx codebase

I used the same logic as libvpx. The flag AOM_FRAME_IS_INVISIBLE is not set
at present. But I hope that this flag will be updated soon. I will update
the code to remove this flag from my patch for now.

> Does libaom have a flag or field to signal the type of the visible frame
> in the returned packet?
At present libaom doesn't set the flag for the INTRA_ONLY in the returned
packet. Until this flag is updated, we can use the same logic as libvpx.

I will make these corrections and update the patch for review.






On Sat, Sep 8, 2018 at 12:23 PM James Almer  wrote:

> On 9/7/2018 8:51 PM, Sam John wrote:
> > ---
> >  libavcodec/libaomenc.c | 117 +
> >  1 file changed, 96 insertions(+), 21 deletions(-)
> >
> > diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
> > index 9431179886..e62057177d 100644
> > --- a/libavcodec/libaomenc.c
> > +++ b/libavcodec/libaomenc.c
> > @@ -50,6 +50,9 @@ struct FrameListData {
> >  unsigned long duration;  /**< duration to show frame
> >(in timebase units) */
> >  uint32_t flags;  /**< flags for this frame */
> > +uint64_t sse[4];
> > +int have_sse;/**< true if we have pending sse[]
> */
> > +uint64_t frame_number;
> >  struct FrameListData *next;
> >  };
> >
> > @@ -68,6 +71,9 @@ typedef struct AOMEncoderContext {
> >  int static_thresh;
> >  int drop_threshold;
> >  int noise_sensitivity;
> > +uint64_t sse[4];
> > +int have_sse; /**< true if we have pending sse[] */
> > +uint64_t frame_number;
> >  } AOMContext;
> >
> >  static const char *const ctlidstr[] = {
> > @@ -289,7 +295,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >  {
> >  AOMContext *ctx = avctx->priv_data;
> >  struct aom_codec_enc_cfg enccfg = { 0 };
> > -aom_codec_flags_t flags = 0;
> > +aom_codec_flags_t flags =
> > +(avctx->flags & AV_CODEC_FLAG_PSNR) ? AOM_CODEC_USE_PSNR : 0;
> >  AVCPBProperties *cpb_props;
> >  int res;
> >  aom_img_fmt_t img_fmt;
> > @@ -499,13 +506,30 @@ static av_cold int aom_init(AVCodecContext *avctx,
> >  }
> >
> >  static inline void cx_pktcpy(struct FrameListData *dst,
> > - const struct aom_codec_cx_pkt *src)
> > + const struct aom_codec_cx_pkt *src,
> > + AOMContext *ctx)
> >  {
> >  dst->pts  = src->data.frame.pts;
> >  dst->duration = src->data.frame.duration;
> >  dst->flags= src->data.frame.flags;
> >  dst->sz   = src->data.frame.sz;
> >  dst->buf  = src->data.frame.buf;
> > +dst->have_sse = 0;
> > +/* For alt-ref frame, don't store PSNR or increment frame_number */
> > +if (!(dst->flags & AOM_FRAME_IS_INVISIBLE)) {
>
> Did you copy this chunk from the libvpxenc wrapper? Because I don't
> think this is valid at all for libaom. A quick grep on their tree shows
> that AOM_FRAME_IS_INVISIBLE is never set anywhere. It looks like a
> leftover flag they forgot to remove from the libvpx codebase.
>
> > +dst->frame_number = ++ctx->frame_number;
> > +dst->have_sse = ctx->have_sse;
> > +if (ctx->have_sse) {
> > +/* associate last-seen SSE to the frame. */
> > +/* Transfers ownership from ctx to dst. */
> > +/* WARNING! This makes the assumption that PSNR_PKT comes
> > +   just before the frame it refers to! */
> > +memcpy(dst->sse, ctx->sse, sizeof(dst->sse));
> > +ctx->have_sse = 0;
> > +}
> > +} else {
> > +dst->frame_number = -1;   /* sanity marker */
> > +}
> >  }
> >
> >  /**
> > @@ -524,26 +548,68 @@ static int storeframe(AVCodecContext *avctx,
> struct FrameListData *cx_frame,
> >  av_log(avctx, AV_LOG_ERROR,
> > "Error getting output packet of size
> %"SIZE_SPECIFIER".\n", cx_frame->sz);
> >  return ret;
> > -}
> > -memcpy(pkt->data, cx_frame->buf, pkt->size);
> > -pkt->pts = pkt->dts = cx_frame->pts;
> > +} else {
> > +int pict_type;
> > +memcpy(pkt->data, cx_frame->buf, pkt->size);
> > +pkt->pts = pkt->dts = cx_frame->pts;
> > +#if FF_API_CODED_FRAME
> > +FF_DISABLE_DEPRECATION_WARNINGS
> > +avctx->coded_frame->pts   = cx_frame->pts;
> > +avctx->coded_frame->key_frame = !!(cx_frame->flags &
> AOM_FRAME_IS_KEY);
>
> coded_frame is deprecated and it's not meant to be used in new modules.
> It's left on old ones until removal for backwards compatibility reasons.
>
> > +FF_ENABLE_DEPRECATION_WARNINGS
> > +#endif
> > +
> > +if

Re: [FFmpeg-devel] [PATCH 1/2] avcodec/dvdsubdec: Avoid branch in decode_run_8bit()

2018-09-14 Thread Paul B Mahol
On 9/13/18, Michael Niedermayer  wrote:
> Speed improvment 35.5 sec -> 34.7sec
>
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/dvdsubdec.c | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)
>

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


Re: [FFmpeg-devel] [PATCH 1/2] Fix typos

2018-09-14 Thread Carl Eugen Hoyos
2018-08-30 8:56 GMT+02:00, Michael Bunk :
> ---
>  libavcodec/qsvenc_h264.c | 2 +-
>  libavutil/avassert.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
> index 7aa65e9..dfa4666 100644
> --- a/libavcodec/qsvenc_h264.c
> +++ b/libavcodec/qsvenc_h264.c
> @@ -1,5 +1,5 @@
>  /*
> - * Intel MediaSDK QSV based H.264 enccoder
> + * Intel MediaSDK QSV based H.264 encoder
>   *
>   * copyright (c) 2013 Yukinori Yamazoe
>   *
> diff --git a/libavutil/avassert.h b/libavutil/avassert.h
> index 46f3fea..9abeade 100644
> --- a/libavutil/avassert.h
> +++ b/libavutil/avassert.h
> @@ -66,7 +66,7 @@
>  #endif
>
>  /**
> - * Assert that floating point opperations can be executed.
> + * Assert that floating point operations can be executed.

Patch applied.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libavformat/mxfenc: fix dnxhr ul typo

2018-09-14 Thread Paul B Mahol
On 9/13/18, Jason Stevens  wrote:
> byte 8 of dnxhr codec ul should be 0x0D
>
> Signed-off-by: Jason Stevens 
> ---
>  libavformat/mxfenc.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>

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


[FFmpeg-devel] [PATCH] configure: split the libaom check into decoder and encoder

2018-09-14 Thread James Almer
libaom can be built with either of the two modules alone, and a generic check
for aom_codec_version would blindly enable both wrappers.

Check directly for the modules instead, and print a more descriptive error when
one is requested but not available.

Signed-off-by: James Almer 
---
 configure | 11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 14aa311ffd..80225d475b 100755
--- a/configure
+++ b/configure
@@ -6047,7 +6047,16 @@ enabled gmp   && require gmp gmp.h 
mpz_export -lgmp
 enabled gnutls&& require_pkg_config gnutls gnutls gnutls/gnutls.h 
gnutls_global_init
 enabled jni   && { [ $target_os = "android" ] && check_headers 
jni.h && enabled pthreads || die "ERROR: jni not found"; }
 enabled ladspa&& require_headers ladspa.h
-enabled libaom&& require_pkg_config libaom "aom >= 1.0.0" 
aom/aom_codec.h aom_codec_version
+enabled libaom&& {
+enabled libaom_av1_decoder && {
+check_pkg_config libaom_av1_decoder "aom >= 1.0.0" "aom/aom_decoder.h 
aom/aomdx.h" aom_codec_av1_dx ||
+die "ERROR: libaom decoder version >= 1.0.0 not found";
+}
+enabled libaom_av1_encoder && {
+check_pkg_config libaom_av1_encoder "aom >= 1.0.0" "aom/aom_encoder.h 
aom/aomcx.h" aom_codec_av1_cx ||
+die "ERROR: libaom encoder version >= 1.0.0 not found";
+}
+}
 enabled lv2   && require_pkg_config lv2 lilv-0 "lilv/lilv.h" 
lilv_world_new
 enabled libiec61883   && require libiec61883 libiec61883/iec61883.h 
iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
 enabled libass&& require_pkg_config libass libass ass/ass.h 
ass_library_init
-- 
2.19.0

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


Re: [FFmpeg-devel] [PATCH 2/2] avutil/float_dsp: add ff_vector_dmul_{sse2, avx}

2018-09-14 Thread James Almer
On 9/14/2018 11:57 AM, Henrik Gramner wrote:
> On Fri, Sep 14, 2018 at 4:51 PM, Henrik Gramner  wrote:
>> I can't really think of any scenario where using a 32-bit register
>> address operand with a 64-bit destination for LEA is not a mistake.
> 
> To clarify on this, using a 32-bit memory operand means the calculated
> effective address will be 32-bit, not 64-bit, so if the result exceeds
> 0x it will be truncated and zero-extended (not even
> sign-extended like most other x86 things!). It's essentially i big
> trap because it really doesn't do what you'd expect it do to.

Alright, I'll change it and push. Thanks.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [RFC][WIP][PATCH] avcodec: add IMM5 decoder

2018-09-14 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavcodec/Makefile |  5 
 libavcodec/allcodecs.c  |  1 +
 libavcodec/avcodec.h|  1 +
 libavcodec/codec_desc.c |  7 +
 libavcodec/h264dec.c| 58 -
 libavcodec/h264dec.h|  3 +++
 libavformat/riff.c  |  1 +
 7 files changed, 75 insertions(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3e16a13004..22f456bda3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -386,6 +386,11 @@ OBJS-$(CONFIG_IDF_DECODER) += bintext.o 
cga_data.o
 OBJS-$(CONFIG_IFF_ILBM_DECODER)+= iff.o
 OBJS-$(CONFIG_IMC_DECODER) += imc.o
 OBJS-$(CONFIG_IMM4_DECODER)+= imm4.o
+OBJS-$(CONFIG_IMM5_DECODER)+= h264dec.o h264_cabac.o h264_cavlc.o \
+  h264_direct.o h264_loopfilter.o  \
+  h264_mb.o h264_picture.o \
+  h264_refs.o h264_sei.o \
+  h264_slice.o h264data.o
 OBJS-$(CONFIG_INDEO2_DECODER)  += indeo2.o
 OBJS-$(CONFIG_INDEO3_DECODER)  += indeo3.o
 OBJS-$(CONFIG_INDEO4_DECODER)  += indeo4.o ivi.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 7dbfcb3dda..29bf718fd4 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -155,6 +155,7 @@ extern AVCodec ff_huffyuv_decoder;
 extern AVCodec ff_idcin_decoder;
 extern AVCodec ff_iff_ilbm_decoder;
 extern AVCodec ff_imm4_decoder;
+extern AVCodec ff_imm5_decoder;
 extern AVCodec ff_indeo2_decoder;
 extern AVCodec ff_indeo3_decoder;
 extern AVCodec ff_indeo4_decoder;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 705a3ce4f3..356cf28325 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -452,6 +452,7 @@ enum AVCodecID {
 AV_CODEC_ID_MWSC,
 AV_CODEC_ID_WCMV,
 AV_CODEC_ID_RASC,
+AV_CODEC_ID_IMM5,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 67a30542d1..e630109db4 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1689,6 +1689,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("RemotelyAnywhere Screen Capture"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_IMM5,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "imm5",
+.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 
 /* various PCM "codecs" */
 {
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 7b4c5c76ea..19e1e743cf 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -412,7 +412,7 @@ static av_cold int h264_decode_init(AVCodecContext *avctx)
 }
 avctx->ticks_per_frame = 2;
 
-if (avctx->extradata_size > 0 && avctx->extradata) {
+if (avctx->codec_id != AV_CODEC_ID_IMM5 && avctx->extradata_size > 0 && 
avctx->extradata) {
 ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
&h->ps, &h->is_avc, &h->nal_length_size,
avctx->err_recognition, avctx);
@@ -958,6 +958,26 @@ static int send_next_delayed_frame(H264Context *h, AVFrame 
*dst_frame,
 return buf_index;
 }
 
+static const struct IMM5_unit {
+uint8_t bits[14];
+uint8_t len;
+} IMM5_units[14] = {
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x0B, 0x0F, 0x88 
}, 12 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x05, 0x83, 0xE2 
}, 12 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x05, 0x81, 
0xE8, 0x80 }, 13 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x0B, 0x04, 0xA2 
}, 12 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x05, 0x81, 
0x28, 0x80 }, 13 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x05, 0x80, 
0x92, 0x20 }, 13 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1E, 0x9A, 0x74, 0x0B, 
0x0F, 0xC8 }, 13 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1E, 0x9A, 0x74, 0x05, 
0x83, 0xF2 }, 13 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1E, 0x9A, 0x74, 0x05, 
0x81, 0xEC, 0x80 }, 14 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1E, 0x9A, 0x74, 0x0B, 
0x04, 0xB2 }, 13 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1E, 0x9A, 0x74, 0x05, 
0x81, 0x2C, 0x80 }, 14 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x00, 0x1E, 0x9A, 0x74, 0x05, 
0x80, 0x93, 0x20 }, 14 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x68, 0xDE, 0x3C, 0x80 }, 8 },
+{ { 0x00, 0x00, 0x00, 0x01, 0x68, 0xCE, 0x32, 0x28 }, 8 },
+};
+
 static int h264_decode_frame(AVCodecContext *avctx, void *data,
  

Re: [FFmpeg-devel] [RFC][WIP][PATCH] avcodec: add IMM5 decoder

2018-09-14 Thread Paul B Mahol
On 9/14/18, Moritz Barsnick  wrote:
> On Fri, Sep 14, 2018 at 14:24:04 +0200, Paul B Mahol wrote:
>> This decodes more or less single sample we have.
>
> Which sample would that be? This one?:
> https://samples.ffmpeg.org/V-codecs/IMM5/20120917072000_CH05_330672916.avi
>
> After your patch, it fails to decode with
>> Too many packets buffered for output stream 0:0.
> (and also with
>> [avi @ 0xafee680] probed stream 2 failed
>  which is identified as a subtitle stream.)

That is not my patch fault. Use -an.

>
> I found another sample, this one:
> https://forums.cocoaforge.com/download/file.php?id=504
> from
> https://forums.cocoaforge.com/viewtopic.php?t=23251
> (2011041311_CH03_759812.avi)

Obviously, because patch missing mode for this one.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avutil/float_dsp: add ff_vector_dmul_{sse2, avx}

2018-09-14 Thread Henrik Gramner
On Fri, Sep 14, 2018 at 3:26 PM, James Almer  wrote:
> On 9/14/2018 9:57 AM, Henrik Gramner wrote:
>> Also if you want a 32-bit result from lea it should be written as "lea
>> lend, [lenq*8 - mmsize*4]" which is equivalent but has a shorter
>> opcode (e.g. always use native sizes within brackets).
>
> len is an int, so I assume this is only possible here because it's an
> argument passed in a reg and not stack? Otherwise, the upper 32bits
> would probably make a mess with the multiplication.

As long as the destination register is 32-bit the upper half of the
input is irrelevant. Always use native sizes for registers within
brackets when using LEA, and select the size of the destination
register to pick 32-bit vs 64-bit.

I can't really think of any scenario where using a 32-bit register
address operand with a 64-bit destination for LEA is not a mistake.
The fact that doing so is even valid is probably just an artifact of
16-bit memory operands having some usefulness on x86-32 and that
behavior was just straight up copied over to AMD64, either because
nobody thought about it or that doing so made some implementation
detail easier.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avutil/float_dsp: add ff_vector_dmul_{sse2, avx}

2018-09-14 Thread Henrik Gramner
On Fri, Sep 14, 2018 at 4:51 PM, Henrik Gramner  wrote:
> I can't really think of any scenario where using a 32-bit register
> address operand with a 64-bit destination for LEA is not a mistake.

To clarify on this, using a 32-bit memory operand means the calculated
effective address will be 32-bit, not 64-bit, so if the result exceeds
0x it will be truncated and zero-extended (not even
sign-extended like most other x86 things!). It's essentially i big
trap because it really doesn't do what you'd expect it do to.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [RFC][WIP][PATCH] avcodec: add IMM5 decoder

2018-09-14 Thread Moritz Barsnick
On Fri, Sep 14, 2018 at 14:24:04 +0200, Paul B Mahol wrote:
> This decodes more or less single sample we have.

Which sample would that be? This one?:
https://samples.ffmpeg.org/V-codecs/IMM5/20120917072000_CH05_330672916.avi

After your patch, it fails to decode with
> Too many packets buffered for output stream 0:0.
(and also with
> [avi @ 0xafee680] probed stream 2 failed
 which is identified as a subtitle stream.)

I found another sample, this one:
https://forums.cocoaforge.com/download/file.php?id=504
from
https://forums.cocoaforge.com/viewtopic.php?t=23251
(2011041311_CH03_759812.avi)

It decodes only partially.

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


Re: [FFmpeg-devel] [PATCH 2/2] avutil/float_dsp: add ff_vector_dmul_{sse2, avx}

2018-09-14 Thread James Almer
On 9/14/2018 9:57 AM, Henrik Gramner wrote:
> On Thu, Sep 13, 2018 at 3:08 PM, James Almer  wrote:
>> +lea   lenq, [lend*8 - mmsize*4]
> 
> Is len guaranteed to be a multiple of mmsize/8? Otherwise this would
> cause misalignment. It will also break if len < mmsize/2.

len must be a multiple of 16 as per the doxy, so yes.
The only way for len to be < mmsize/2 is if we add an avx512 version.

> 
> Also if you want a 32-bit result from lea it should be written as "lea
> lend, [lenq*8 - mmsize*4]" which is equivalent but has a shorter
> opcode (e.g. always use native sizes within brackets).

len is an int, so I assume this is only possible here because it's an
argument passed in a reg and not stack? Otherwise, the upper 32bits
would probably make a mess with the multiplication. See for example
vector_fmul_add where len is the fifth argument.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avdevice/pulse_audio_dec: set channel map

2018-09-14 Thread Paul B Mahol
On 9/12/18, Paul B Mahol  wrote:
> This fixes opening devices with >6 channels.
>
> Signed-off-by: Paul B Mahol 
> ---
>  libavdevice/pulse_audio_dec.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Will apply.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] avutil/float_dsp: add ff_vector_dmul_{sse2, avx}

2018-09-14 Thread Henrik Gramner
On Thu, Sep 13, 2018 at 3:08 PM, James Almer  wrote:
> +lea   lenq, [lend*8 - mmsize*4]

Is len guaranteed to be a multiple of mmsize/8? Otherwise this would
cause misalignment. It will also break if len < mmsize/2.

Also if you want a 32-bit result from lea it should be written as "lea
lend, [lenq*8 - mmsize*4]" which is equivalent but has a shorter
opcode (e.g. always use native sizes within brackets).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/dashenc: only write video streams into HLS master playlist

2018-09-14 Thread Jian Yang
Agree! Audio-only stream should be supported.

Just tested adding the missed audio group for audio stream. Tool
mediastreamvalidator doesn't report error message any more, and the
playlist can be played in Safari.

Could you please help to add audio group for audio streams? I can update
the patch if you prefer me to do it.

Thank you very much!


Jeyapal, Karthick  于2018年9月14日周五 下午4:47写道:

>
> On 9/14/18 12:38 PM, Jian Yang wrote:
> > Tool mediastreamvalidator reports error "Variant media_[N].m3u8 is
> > missing audio group" for audio streams in HLS master playlist. As audio
> > streams are already listed in audio group, skip them as variant media
> > streams in master playlist.
> Skipping the audio stream altogether is not a good idea.
> Because somebody might want to play an audio-only stream.
> One possible fix could be to add the missing audio group, for audio
> streams as well.
> Or maybe the mediastreamvalidator tool is wrong as the spec doesn't
> mandate the presence of AUDIO group in all variants.
> > ---
> >  libavformat/dashenc.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> > index 87e31e25fc..45763301db 100644
> > --- a/libavformat/dashenc.c
> > +++ b/libavformat/dashenc.c
> > @@ -911,8 +911,10 @@ static int write_manifest(AVFormatContext *s, int
> final)
> >  OutputStream *os = &c->streams[i];
> >  char *agroup = NULL;
> >  int stream_bitrate = st->codecpar->bit_rate +
> os->muxer_overhead;
> > +if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
> > +continue;
> >  av_strlcpy(codec_str, os->codec_str, sizeof(codec_str));
> > -if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) &&
> max_audio_bitrate) {
> > +if (max_audio_bitrate) {
> >  agroup = (char *)audio_group;
> >  stream_bitrate += max_audio_bitrate;
> >  av_strlcat(codec_str, ",", sizeof(codec_str));
>
>

-- 
Best Regards
杨剑 (Jian Yang)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [RFC][WIP][PATCH] avcodec: add IMM5 decoder

2018-09-14 Thread Paul B Mahol
This decodes more or less single sample we have.

Why inter frame decoding looks bad?

Signed-off-by: Paul B Mahol 
---
 libavcodec/Makefile |   5 ++
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   7 +++
 libavcodec/h264dec.c| 103 +++-
 libavcodec/h264dec.h|   3 ++
 libavformat/riff.c  |   1 +
 7 files changed, 120 insertions(+), 1 deletion(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 3e16a13004..22f456bda3 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -386,6 +386,11 @@ OBJS-$(CONFIG_IDF_DECODER) += bintext.o 
cga_data.o
 OBJS-$(CONFIG_IFF_ILBM_DECODER)+= iff.o
 OBJS-$(CONFIG_IMC_DECODER) += imc.o
 OBJS-$(CONFIG_IMM4_DECODER)+= imm4.o
+OBJS-$(CONFIG_IMM5_DECODER)+= h264dec.o h264_cabac.o h264_cavlc.o \
+  h264_direct.o h264_loopfilter.o  \
+  h264_mb.o h264_picture.o \
+  h264_refs.o h264_sei.o \
+  h264_slice.o h264data.o
 OBJS-$(CONFIG_INDEO2_DECODER)  += indeo2.o
 OBJS-$(CONFIG_INDEO3_DECODER)  += indeo3.o
 OBJS-$(CONFIG_INDEO4_DECODER)  += indeo4.o ivi.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 7dbfcb3dda..29bf718fd4 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -155,6 +155,7 @@ extern AVCodec ff_huffyuv_decoder;
 extern AVCodec ff_idcin_decoder;
 extern AVCodec ff_iff_ilbm_decoder;
 extern AVCodec ff_imm4_decoder;
+extern AVCodec ff_imm5_decoder;
 extern AVCodec ff_indeo2_decoder;
 extern AVCodec ff_indeo3_decoder;
 extern AVCodec ff_indeo4_decoder;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 705a3ce4f3..356cf28325 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -452,6 +452,7 @@ enum AVCodecID {
 AV_CODEC_ID_MWSC,
 AV_CODEC_ID_WCMV,
 AV_CODEC_ID_RASC,
+AV_CODEC_ID_IMM5,
 
 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 67a30542d1..e630109db4 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1689,6 +1689,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("RemotelyAnywhere Screen Capture"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_IMM5,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "imm5",
+.long_name = NULL_IF_CONFIG_SMALL("Infinity IMM5"),
+.props = AV_CODEC_PROP_LOSSY,
+},
 
 /* various PCM "codecs" */
 {
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index 7b4c5c76ea..76caec65ba 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -412,7 +412,7 @@ static av_cold int h264_decode_init(AVCodecContext *avctx)
 }
 avctx->ticks_per_frame = 2;
 
-if (avctx->extradata_size > 0 && avctx->extradata) {
+if (avctx->codec_id != AV_CODEC_ID_IMM5 && avctx->extradata_size > 0 && 
avctx->extradata) {
 ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
&h->ps, &h->is_avc, &h->nal_length_size,
avctx->err_recognition, avctx);
@@ -958,6 +958,76 @@ static int send_next_delayed_frame(H264Context *h, AVFrame 
*dst_frame,
 return buf_index;
 }
 
+static uint8_t imm5_chunk0[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0xB, 0xF, 0x88,
+};
+
+static uint8_t imm5_chunk1[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x5, 0x83, 0xE2,
+};
+
+static uint8_t imm5_chunk2[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x5, 0x81, 0xE8, 
0x80,
+};
+
+static uint8_t imm5_chunk3[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0xB, 0x4, 0xA2,
+};
+
+static uint8_t imm5_chunk4[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x5, 0x81, 0x28, 
0x80,
+};
+
+static uint8_t imm5_chunk5[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x80, 0x1E, 0xF4, 0x5, 0x80, 0x92, 
0x20,
+};
+
+static uint8_t imm5_chunk6[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x0, 0x1E, 0x9A, 0x74, 0xB, 0xF, 0xC8,
+};
+
+static uint8_t imm5_chunk7[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x0, 0x1E, 0x9A, 0x74, 0x5, 0x83, 0xF2,
+};
+
+static uint8_t imm5_chunk8[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x0, 0x1E, 0x9A, 0x74, 0x5, 0x81, 
0xEC, 0x80,
+};
+
+static uint8_t imm5_chunk9[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x0, 0x1E, 0x9A, 0x74, 0xB, 0x4, 0xB2,
+};
+
+static uint8_t imm5_chunk10[] =
+{
+0x00, 0x00, 0x00, 0x01, 0x67, 0x42, 0x0, 0x1E, 0x9A, 0x74, 0x5, 0x81, 
0x2C, 0x80,
+};
+
+static uint8_t imm5_chunk11

[FFmpeg-devel] [PATCH] avformat/dashenc: Reduce Muxing overhead for chunked CMAF format

2018-09-14 Thread Karthick J
From: Karthick Jeyapal 

SIDX atom being inserted for every MOOF atom increases the muxing overhead.
This behaviour can be disabled for chunked CMAF format by enabling Global SIDX 
option of mov muxer.
---
 libavformat/dashenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 87e31e2..9a33321 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1065,7 +1065,7 @@ static int dash_init(AVFormatContext *s)
 
 if (c->segment_type == SEGMENT_TYPE_MP4) {
 if (c->streaming)
-av_dict_set(&opts, "movflags", 
"frag_every_frame+dash+delay_moov", 0);
+av_dict_set(&opts, "movflags", 
"frag_every_frame+dash+delay_moov+global_sidx", 0);
 else
 av_dict_set(&opts, "movflags", "frag_custom+dash+delay_moov", 
0);
 } else {
-- 
2.7.4

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


Re: [FFmpeg-devel] [PATCH] avformat/dashenc: only write video streams into HLS master playlist

2018-09-14 Thread Jeyapal, Karthick

On 9/14/18 12:38 PM, Jian Yang wrote:
> Tool mediastreamvalidator reports error "Variant media_[N].m3u8 is
> missing audio group" for audio streams in HLS master playlist. As audio
> streams are already listed in audio group, skip them as variant media
> streams in master playlist.
Skipping the audio stream altogether is not a good idea. 
Because somebody might want to play an audio-only stream.
One possible fix could be to add the missing audio group, for audio streams as 
well.
Or maybe the mediastreamvalidator tool is wrong as the spec doesn't mandate the 
presence of AUDIO group in all variants.
> ---
>  libavformat/dashenc.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index 87e31e25fc..45763301db 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -911,8 +911,10 @@ static int write_manifest(AVFormatContext *s, int final)
>  OutputStream *os = &c->streams[i];
>  char *agroup = NULL;
>  int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead;
> +if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
> +continue;
>  av_strlcpy(codec_str, os->codec_str, sizeof(codec_str));
> -if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && 
> max_audio_bitrate) {
> +if (max_audio_bitrate) {
>  agroup = (char *)audio_group;
>  stream_bitrate += max_audio_bitrate;
>  av_strlcat(codec_str, ",", sizeof(codec_str));

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


[FFmpeg-devel] [PATCH] avcodec/vaapi:free slice_buffers when decoding failed

2018-09-14 Thread Linjie Fu
If vaEndPicture failed in ff_vaapi_decode_issue, free
the pic->slice_buffer.

Fix the memory leak issue in ticket #7385

Signed-off-by: Linjie Fu 
---
 libavcodec/vaapi_decode.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index d0a6b5817d..700cd5c681 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -216,6 +216,11 @@ fail_with_picture:
 fail:
 ff_vaapi_decode_destroy_buffers(avctx, pic);
 fail_at_end:
+pic->nb_param_buffers = 0;
+pic->nb_slices= 0;
+pic->slices_allocated = 0;
+av_freep(&pic->slice_buffers);
+
 return err;
 }
 
-- 
2.17.1

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


[FFmpeg-devel] [PATCH] avformat/dashenc: only write video streams into HLS master playlist

2018-09-14 Thread Jian Yang
Tool mediastreamvalidator reports error "Variant media_[N].m3u8 is
missing audio group" for audio streams in HLS master playlist. As audio
streams are already listed in audio group, skip them as variant media
streams in master playlist.
---
 libavformat/dashenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 87e31e25fc..45763301db 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -911,8 +911,10 @@ static int write_manifest(AVFormatContext *s, int final)
 OutputStream *os = &c->streams[i];
 char *agroup = NULL;
 int stream_bitrate = st->codecpar->bit_rate + os->muxer_overhead;
+if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
+continue;
 av_strlcpy(codec_str, os->codec_str, sizeof(codec_str));
-if ((st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) && 
max_audio_bitrate) {
+if (max_audio_bitrate) {
 agroup = (char *)audio_group;
 stream_bitrate += max_audio_bitrate;
 av_strlcat(codec_str, ",", sizeof(codec_str));
-- 
2.18.0

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