Re: [FFmpeg-devel] [PATCH v2] avcodec/mips: [loongson] mmi optimizations for VP9 put and avg functions

2019-02-23 Thread Shiyou Yin


>-Original Message-
>From: ffmpeg-devel-boun...@ffmpeg.org [mailto:ffmpeg-devel-boun...@ffmpeg.org] 
>On Behalf Of gxw
>Sent: Thursday, February 21, 2019 8:39 PM
>To: ffmpeg-devel@ffmpeg.org
>Cc: gxw
>Subject: [FFmpeg-devel] [PATCH v2] avcodec/mips: [loongson] mmi optimizations 
>for VP9 put and avg
>functions
>
>VP9 decoding speed improved about 60.5%(from 38fps to 61fps, tested on 
>loongson 3A3000).
>---
> libavcodec/mips/Makefile   |   1 +
> libavcodec/mips/vp9_mc_mmi.c   | 692 +
> libavcodec/mips/vp9dsp_init_mips.c |  42 +++
> libavcodec/mips/vp9dsp_mips.h  |  50 +++
> libavutil/mips/mmiutils.h  |  15 +
> 5 files changed, 800 insertions(+)
> create mode 100644 libavcodec/mips/vp9_mc_mmi.c
>
>diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile
>index c827649..c5b54d5 100644
>--- a/libavcodec/mips/Makefile
>+++ b/libavcodec/mips/Makefile
>@@ -88,3 +88,4 @@ MMI-OBJS-$(CONFIG_VC1_DECODER)+= 
>mips/vc1dsp_mmi.o
> MMI-OBJS-$(CONFIG_WMV2DSP)+= mips/wmv2dsp_mmi.o
> MMI-OBJS-$(CONFIG_HEVC_DECODER)   += mips/hevcdsp_mmi.o
> MMI-OBJS-$(CONFIG_VP3DSP) += mips/vp3dsp_idct_mmi.o
>+MMI-OBJS-$(CONFIG_VP9_DECODER)+= mips/vp9_mc_mmi.o
>diff --git a/libavcodec/mips/vp9_mc_mmi.c b/libavcodec/mips/vp9_mc_mmi.c
>new file mode 100644
>index 000..58a920b
>--- /dev/null
>+++ b/libavcodec/mips/vp9_mc_mmi.c
>@@ -0,0 +1,692 @@
>+/*
>+ * Copyright (c) 2019 gxw 
>+ *
>+ * 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 "libavcodec/vp9dsp.h"
>+#include "libavutil/mips/mmiutils.h"
>+#include "vp9dsp_mips.h"
>+
>+#define GET_DATA_H_MMI   \
>+"pmaddhw%[ftmp4],%[ftmp4],   %[filter1]\n\t" \
>+"pmaddhw%[ftmp5],%[ftmp5],   %[filter2]\n\t" \
>+"paddw  %[ftmp4],%[ftmp4],   %[ftmp5]  \n\t" \
>+"punpckhwd  %[ftmp5],%[ftmp4],   %[ftmp0]  \n\t" \
>+"paddw  %[ftmp4],%[ftmp4],   %[ftmp5]  \n\t" \
>+"pmaddhw%[ftmp6],%[ftmp6],   %[filter1]\n\t" \
>+"pmaddhw%[ftmp7],%[ftmp7],   %[filter2]\n\t" \
>+"paddw  %[ftmp6],%[ftmp6],   %[ftmp7]  \n\t" \
>+"punpckhwd  %[ftmp7],%[ftmp6],   %[ftmp0]  \n\t" \
>+"paddw  %[ftmp6],%[ftmp6],   %[ftmp7]  \n\t" \
>+"punpcklwd  %[srcl], %[ftmp4],   %[ftmp6]  \n\t" \
>+"pmaddhw%[ftmp8],%[ftmp8],   %[filter1]\n\t" \
>+"pmaddhw%[ftmp9],%[ftmp9],   %[filter2]\n\t" \
>+"paddw  %[ftmp8],%[ftmp8],   %[ftmp9]  \n\t" \
>+"punpckhwd  %[ftmp9],%[ftmp8],   %[ftmp0]  \n\t" \
>+"paddw  %[ftmp8],%[ftmp8],   %[ftmp9]  \n\t" \
>+"pmaddhw%[ftmp10],   %[ftmp10],  %[filter1]\n\t" \
>+"pmaddhw%[ftmp11],   %[ftmp11],  %[filter2]\n\t" \
>+"paddw  %[ftmp10],   %[ftmp10],  %[ftmp11] \n\t" \
>+"punpckhwd  %[ftmp11],   %[ftmp10],  %[ftmp0]  \n\t" \
>+"paddw  %[ftmp10],   %[ftmp10],  %[ftmp11] \n\t" \
>+"punpcklwd  %[srch], %[ftmp8],   %[ftmp10] \n\t"
>+
>+#define GET_DATA_V_MMI   \
>+"punpcklhw  %[srcl], %[ftmp4],   %[ftmp5]  \n\t" \
>+"pmaddhw%[srcl], %[srcl],%[filter10]   \n\t" \
>+"punpcklhw  %[ftmp12],   %[ftmp6],   %[ftmp7]  \n\t" \
>+"pmaddhw%[ftmp12],   %[ftmp12],  %[filter32]   \n\t" \
>+"paddw  %[srcl], %[srcl],%[ftmp12] \n\t" \
>+"punpcklhw  %[ftmp12],   %[ftmp8],   %[ftmp9]  \n\t" \
>+"pmaddhw%[ftmp12],   %[ftmp12],  %[filter54]   \n\t" \
>+"paddw  %[srcl], %[srcl],%[ftmp12] \n\t" \
>+"punpcklhw  %[ftmp12],   %[ftmp10],  %[ftmp11] \n\t" \
>+"pmaddhw%[ftmp12],   %[ftmp12],  %[filter76]   \n\t" \
>+"paddw  %[srcl], %[srcl],%[ftmp12] \n\t" \
>+"punpckhhw  %[srch], %[ftmp4],   %[ftmp5]  \n\t" \
>+"pmaddhw%[srch], %[srch],%[filter10]   \n\t" \
>+"punpckhhw  %[ftmp12],   %[ftmp6],   %[ftmp7]  \n\t" \
>+"pmaddhw%[ftmp12],   %[ftmp12],  %[filter32]   \n\t" \
>+"paddw  %[srch], %[srch],%[ftm

[FFmpeg-devel] [PATCH] avcodec/qpeg: Limit copy in qpeg_decode_intra() to the available bytes

2019-02-23 Thread Michael Niedermayer
Fixes: Timeout (27 sec -> 39 milli sec)
Fixes: 
13151/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QPEG_fuzzer-5717536023248896

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

diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c
index 654fd998d6..d4195c5f0b 100644
--- a/libavcodec/qpeg.c
+++ b/libavcodec/qpeg.c
@@ -99,6 +99,8 @@ static void qpeg_decode_intra(QpegContext *qctx, uint8_t *dst,
 }
 }
 } else {
+if (bytestream2_get_bytes_left(&qctx->buffer) < copy)
+copy = bytestream2_get_bytes_left(&qctx->buffer);
 for(i = 0; i < copy; i++) {
 dst[filled++] = bytestream2_get_byte(&qctx->buffer);
 if (filled >= width) {
-- 
2.20.1

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


Re: [FFmpeg-devel] [PATCH 2/2] avformat/mpegtsenc: write format_identifier HEVC for HEVC streams

2019-02-23 Thread Carl Eugen Hoyos
Hi Marton!

> Am 23.02.2019 um 20:36 schrieb Marton Balint :
> 
> This improves compatibility with some consumer TVs which apparently either
> search a HEVC descriptor (which our mpegts muxer can't generate) or a format
> specifier.
> 
> Since the HEVC format specifier is not registered (but used in the wild), it 
> is
> not written if strict_std_compliance is higher than normal.


> This fixes the issue in ticket #7744.

Could you test yourself?

If not, please wait for the OP to comment.

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


Re: [FFmpeg-devel] [PATCH] avcodec/jvdec: Check available input space before decode8x8()

2019-02-23 Thread Michael Niedermayer
On Thu, Feb 21, 2019 at 12:13:50PM +0100, Paul B Mahol wrote:
> On 2/21/19, Michael Niedermayer  wrote:
> > Fixes: Timeout (78 sec -> 15 millisec)
> > Fixes:
> > 13147/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_JV_fuzzer-5727107827630080
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/jvdec.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c
> > index cbe83d3c10..bf8a55cbad 100644
> > --- a/libavcodec/jvdec.c
> > +++ b/libavcodec/jvdec.c
> > @@ -170,6 +170,11 @@ static int decode_frame(AVCodecContext *avctx, void
> > *data, int *got_frame,
> >  GetBitContext gb;
> >  init_get_bits(&gb, buf, 8 * video_size);
> >
> > +if ( avctx->height/8 * (avctx->width/8) > 4 * video_size) {
> > +av_log(avctx, AV_LOG_ERROR, "Insuffient input data for
> > dimensions\n");
> 
> Typo

will apply without the typo

thanks


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

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH] rtpenc_chain: forward strict_std_compliance flags to rtp muxer

2019-02-23 Thread Michael Niedermayer
On Fri, Feb 22, 2019 at 03:40:27PM -0500, Tristan Matthews wrote:
> fixes: https://trac.ffmpeg.org/ticket/6713
> ---
>  libavformat/rtpenc_chain.c | 1 +
>  1 file changed, 1 insertion(+)

will apply

thanks

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

If you fake or manipulate statistics in a paper in physics you will never
get a job again.
If you fake or manipulate statistics in a paper in medicin you will get
a job for life at the pharma industry.


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


[FFmpeg-devel] [PATCH 2/2] avformat/mpegtsenc: write format_identifier HEVC for HEVC streams

2019-02-23 Thread Marton Balint
This improves compatibility with some consumer TVs which apparently either
search a HEVC descriptor (which our mpegts muxer can't generate) or a format
specifier.

Since the HEVC format specifier is not registered (but used in the wild), it is
not written if strict_std_compliance is higher than normal.

This fixes the issue in ticket #7744.

Signed-off-by: Marton Balint 
---
 libavformat/mpegtsenc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 099d003f42..fc0ea225c6 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -606,6 +606,8 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 put_registration_descriptor(&q, MKTAG('d', 'r', 'a', 'c'));
 } else if (stream_type == STREAM_TYPE_VIDEO_VC1) {
 put_registration_descriptor(&q, MKTAG('V', 'C', '-', '1'));
+} else if (stream_type == STREAM_TYPE_VIDEO_HEVC && 
s->strict_std_compliance <= FF_COMPLIANCE_NORMAL) {
+put_registration_descriptor(&q, MKTAG('H', 'E', 'V', 'C'));
 }
 break;
 case AVMEDIA_TYPE_DATA:
-- 
2.16.4

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


[FFmpeg-devel] [PATCH 1/2] avformat/mpegtsenc: factorize writing registration_descriptor

2019-02-23 Thread Marton Balint
Signed-off-by: Marton Balint 
---
 libavformat/mpegtsenc.c | 50 ++---
 1 file changed, 18 insertions(+), 32 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 35a72002c8..099d003f42 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -270,6 +270,18 @@ static void putbuf(uint8_t **q_ptr, const uint8_t *buf, 
size_t len)
 *q_ptr += len;
 }
 
+static void put_registration_descriptor(uint8_t **q_ptr, uint32_t tag)
+{
+uint8_t *q = *q_ptr;
+*q++ = 0x05; /* MPEG-2 registration descriptor*/
+*q++ = 4;
+*q++ = tag;
+*q++ = tag >> 8;
+*q++ = tag >> 16;
+*q++ = tag >> 24;
+*q_ptr = q;
+}
+
 static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
 {
 MpegTSWrite *ts = s->priv_data;
@@ -396,14 +408,8 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 *q++=1; // 1 byte, all flags sets to 0
 *q++=0; // omit all fields...
 }
-if (st->codecpar->codec_id==AV_CODEC_ID_S302M) {
-*q++ = 0x05; /* MPEG-2 registration descriptor*/
-*q++ = 4;
-*q++ = 'B';
-*q++ = 'S';
-*q++ = 'S';
-*q++ = 'D';
-}
+if (st->codecpar->codec_id==AV_CODEC_ID_S302M)
+put_registration_descriptor(&q, MKTAG('B', 'S', 'S', 'D'));
 if (st->codecpar->codec_id==AV_CODEC_ID_OPUS) {
 /* 6 bytes registration descriptor, 4 bytes Opus audio 
descriptor */
 if (q - data > SECTION_LENGTH - 6 - 4) {
@@ -411,12 +417,7 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 break;
 }
 
-*q++ = 0x05; /* MPEG-2 registration descriptor*/
-*q++ = 4;
-*q++ = 'O';
-*q++ = 'p';
-*q++ = 'u';
-*q++ = 's';
+put_registration_descriptor(&q, MKTAG('O', 'p', 'u', 's'));
 
 *q++ = 0x7f; /* DVB extension descriptor */
 *q++ = 2;
@@ -602,29 +603,14 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 break;
 case AVMEDIA_TYPE_VIDEO:
 if (stream_type == STREAM_TYPE_VIDEO_DIRAC) {
-*q++ = 0x05; /*MPEG-2 registration descriptor*/
-*q++ = 4;
-*q++ = 'd';
-*q++ = 'r';
-*q++ = 'a';
-*q++ = 'c';
+put_registration_descriptor(&q, MKTAG('d', 'r', 'a', 'c'));
 } else if (stream_type == STREAM_TYPE_VIDEO_VC1) {
-*q++ = 0x05; /*MPEG-2 registration descriptor*/
-*q++ = 4;
-*q++ = 'V';
-*q++ = 'C';
-*q++ = '-';
-*q++ = '1';
+put_registration_descriptor(&q, MKTAG('V', 'C', '-', '1'));
 }
 break;
 case AVMEDIA_TYPE_DATA:
 if (st->codecpar->codec_id == AV_CODEC_ID_SMPTE_KLV) {
-*q++ = 0x05; /* MPEG-2 registration descriptor */
-*q++ = 4;
-*q++ = 'K';
-*q++ = 'L';
-*q++ = 'V';
-*q++ = 'A';
+put_registration_descriptor(&q, MKTAG('K', 'L', 'V', 'A'));
 } else if (st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
 const char *tag = "ID3 ";
 *q++ = 0x26; /* metadata descriptor */
-- 
2.16.4

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


[FFmpeg-devel] CAA

2019-02-23 Thread Michael Niedermayer
Hi all

if there are no objections then ill add the following 
"Certificate Authority Authorization" entry:

ffmpeg.org. IN  CAA 0 issue "letsencrypt.org"

to the zonefile

This should theoretically guard against some unlikely security issues

Thanks

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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


Re: [FFmpeg-devel] [PATCH] avformat:matroskadec: use a define to mark the EBML length is unknown

2019-02-23 Thread Paul B Mahol
On 2/23/19, Steve Lhomme  wrote:
> From: Steve Lhomme 
>
> ---
>  libavformat/matroskadec.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index 5aa8a105dc..0e3a6890c1 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -68,6 +68,8 @@
>
>  #include "qtpalette.h"
>
> +#define EBML_UNKNOWN_LENGTH  UINT64_MAX /* EBML unknown length, in uint64_t
> */
> +
>  typedef enum {
>  EBML_NONE,
>  EBML_UINT,
> @@ -869,7 +871,7 @@ static int ebml_read_length(MatroskaDemuxContext
> *matroska, AVIOContext *pb,
>  {
>  int res = ebml_read_num(matroska, pb, 8, number);
>  if (res > 0 && *number + 1 == 1ULL << (7 * res))
> -*number = 0xffULL;
> +*number = EBML_UNKNOWN_LENGTH;
>  return res;
>  }
>
> @@ -1049,7 +1051,7 @@ static int ebml_parse_id(MatroskaDemuxContext
> *matroska, EbmlSyntax *syntax,
>  break;
>  if (!syntax[i].id && id == MATROSKA_ID_CLUSTER &&
>  matroska->num_levels > 0   &&
> -matroska->levels[matroska->num_levels - 1].length ==
> 0xff)
> +matroska->levels[matroska->num_levels - 1].length ==
> EBML_UNKNOWN_LENGTH)
>  return 0;  // we reached the end of an unknown size cluster
>  if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) {
>  av_log(matroska->ctx, AV_LOG_DEBUG, "Unknown entry 0x%"PRIX32"\n",
> id);
> @@ -1201,7 +1203,7 @@ static int ebml_parse_elem(MatroskaDemuxContext
> *matroska,
>  MatroskaLevel *level = &matroska->levels[matroska->num_levels -
> 1];
>  AVIOContext *pb = matroska->ctx->pb;
>  int64_t pos = avio_tell(pb);
> -if (level->length != (uint64_t) -1 &&
> +if (level->length != EBML_UNKNOWN_LENGTH &&
>  (pos + length) > (level->start + level->length)) {
>  av_log(matroska->ctx, AV_LOG_ERROR,
> "Invalid length 0x%"PRIx64" > 0x%"PRIx64" in
> parent\n",
> @@ -1610,7 +1612,7 @@ static int
> matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
>  ret = AVERROR_INVALIDDATA;
>  } else {
>  level.start  = 0;
> -level.length = (uint64_t) -1;
> +level.length = EBML_UNKNOWN_LENGTH;
>  matroska->levels[matroska->num_levels] = level;
>  matroska->num_levels++;
>  matroska->current_id   = 0;
> @@ -1620,7 +1622,7 @@ static int
> matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
>  /* remove dummy level */
>  while (matroska->num_levels) {
>  uint64_t length =
> matroska->levels[--matroska->num_levels].length;
> -if (length == (uint64_t) -1)
> +if (length == EBML_UNKNOWN_LENGTH)
>  break;
>  }
>  }
> --
> 2.18.0
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

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


Re: [FFmpeg-devel] avcodec/proresenc_aw : add interlace encoding support

2019-02-23 Thread Martin Vignali
Pushed.

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


Re: [FFmpeg-devel] [PATCH] avformat:matroskadec: use a define to mark the EBML length is unknown

2019-02-23 Thread Michael Niedermayer
On Sat, Feb 23, 2019 at 11:14:33AM +0100, Steve Lhomme wrote:
> From: Steve Lhomme 
> 
> ---
>  libavformat/matroskadec.c | 12 +++-
>  1 file changed, 7 insertions(+), 5 deletions(-)

I think the commit message is a bit terse. This is not just a cosmetic
change (which one might think from reading just the commit message and
not looking at the change or related mails)

Can you provide a more verbose commit message ?
ill apply it with that

thanks

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

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



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


[FFmpeg-devel] [PATCH] avformat/mov: fix start_time for streams with empty edits in the middle

2019-02-23 Thread Vittorio Giovara
Empty edits can occur at any position within the edit list except for at
the end. Empty edits in the middle should not impact the reported stream
start_time or the video PTS adjustment, so only include empty edits at
the start of the list in empty_edits_sum_duration.

Please see attachment.
-- 
Vittorio


0001-avformat-mov-fix-start_time-for-streams-with-empty-e.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] avcodec/proresenc_aw : speed improvment

2019-02-23 Thread Martin Vignali
Hello,

Patch in attach improve prores_aw encoding speed

A basic encoding test (prores to prores)
test file 1 : 137fps -> 140fps
test file 2 : 49fps-> 54 fps

001 : Pre calc codebook switchbits, rice order, exp order and first_exp,
avoid to calc it in encode_codeword func.
002 : small code reorganization in ac coeff func

Martin


0002-avcodec-proresenc_aw-reorganize-ac_coeffs-code.patch
Description: Binary data


0001-avcodec-proresenc_aw-use-lut-for-codebook-to-switchb.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] fate/proresenc_aw : Add fate test for interlace and 444 encoding

2019-02-23 Thread Martin Vignali
Hello,

Patch in attach add fate test for interlace and 444 encoding

All prores_aw encoding test can be test with :

make fate-vsynth3-prores;make fate-vsynth2-prores;make
fate-vsynth1-prores;make fate-vsynth_lena-prores SAMPLES=fate-suite/;make
fate-vsynth3-prores_int;make fate-vsynth2-prores_int;make
fate-vsynth1-prores_int;make fate-vsynth_lena-prores_int
SAMPLES=fate-suite/;make fate-vsynth3-prores_444;make
fate-vsynth2-prores_444;make fate-vsynth1-prores_444;make
fate-vsynth_lena-prores_444 SAMPLES=fate-suite/;make
fate-vsynth3-prores_444_int;make fate-vsynth2-prores_444_int;make
fate-vsynth1-prores_444_int;make fate-vsynth_lena-prores_444_int
SAMPLES=fate-suite/

Martin


0001-fate-proresenc_aw-add-test-for-interlace-and-444.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] Fix handling of unknown length case for matroska files.

2019-02-23 Thread Steve Lhomme

On 23/02/2019 00:41, Dale Curtis wrote:

Unknown length has a special encoding which is not uint64_t(-1).

Signed-off-by: Dale Curtis 
---
  libavformat/matroskadec.c | 13 -
  1 file changed, 8 insertions(+), 5 deletions(-)


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

Ah sorry, I didn't see you proposed the same thing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] avcodec/qtrle : improve decoding speed of 24bpp and 32 bpp

2019-02-23 Thread Martin Vignali
Hello,

Patch in attach, improve decoding speed of qtrle (also known as Mov
Animation)

Can't test on big endian. Test on big endian is welcome.
fate test cmd : make fate-qtrle SAMPLES=fate-suite/

32bpp :
Mainly raw : 33fps -> 40 fps
Mainly rle : 128fps -> 153 fps

24bpp:
Mainly raw : 20fps->39fps
Mainly rle : 97fps ->119fps

Patchs :
001 : Use bgra output pixel for 32bpp fate test (instead of rgb24)
002 : 32bpp decoding : Avoid to swap each 32b value on little endian
003 : 32bpp decoding : for raw data, copy two argb value at the same time
004 : 24bpp decoding : in rle mode, copy 1 uint16 (rg), and one byte (b),
instead of three byte. In raw mode copy 2 rgb value at the same (using
32bit for RGBR, and 16bit for GB)

Pass fate test for me (osx X86_64).

Martin


0004-avcodec-qtrle-improve-24bbp-decoding-speed.patch
Description: Binary data


0002-avcodec-qtrle-avoid-swap-in-32bpp-decoding.patch
Description: Binary data


0001-fate-qtrle-change-32b-test-to-output-bgra-instead-of.patch
Description: Binary data


0003-avcodec-qtrle-32bpp-dec-copy-two-raw-argb-value-at-t.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat:matroskadec: use a define to mark the EBML length is unknown

2019-02-23 Thread Reto Kromer
Steve Lhomme wrote:

> libavformat/matroskadec.c | 12 +++-
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
>diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
>index 5aa8a105dc..0e3a6890c1 100644

Should be fine. Best regards, Reto

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


[FFmpeg-devel] [PATCH] avformat:matroskadec: use a define to mark the EBML length is unknown

2019-02-23 Thread Steve Lhomme
From: Steve Lhomme 

---
 libavformat/matroskadec.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 5aa8a105dc..0e3a6890c1 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -68,6 +68,8 @@
 
 #include "qtpalette.h"
 
+#define EBML_UNKNOWN_LENGTH  UINT64_MAX /* EBML unknown length, in uint64_t */
+
 typedef enum {
 EBML_NONE,
 EBML_UINT,
@@ -869,7 +871,7 @@ static int ebml_read_length(MatroskaDemuxContext *matroska, 
AVIOContext *pb,
 {
 int res = ebml_read_num(matroska, pb, 8, number);
 if (res > 0 && *number + 1 == 1ULL << (7 * res))
-*number = 0xffULL;
+*number = EBML_UNKNOWN_LENGTH;
 return res;
 }
 
@@ -1049,7 +1051,7 @@ static int ebml_parse_id(MatroskaDemuxContext *matroska, 
EbmlSyntax *syntax,
 break;
 if (!syntax[i].id && id == MATROSKA_ID_CLUSTER &&
 matroska->num_levels > 0   &&
-matroska->levels[matroska->num_levels - 1].length == 0xff)
+matroska->levels[matroska->num_levels - 1].length == 
EBML_UNKNOWN_LENGTH)
 return 0;  // we reached the end of an unknown size cluster
 if (!syntax[i].id && id != EBML_ID_VOID && id != EBML_ID_CRC32) {
 av_log(matroska->ctx, AV_LOG_DEBUG, "Unknown entry 0x%"PRIX32"\n", id);
@@ -1201,7 +1203,7 @@ static int ebml_parse_elem(MatroskaDemuxContext *matroska,
 MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1];
 AVIOContext *pb = matroska->ctx->pb;
 int64_t pos = avio_tell(pb);
-if (level->length != (uint64_t) -1 &&
+if (level->length != EBML_UNKNOWN_LENGTH &&
 (pos + length) > (level->start + level->length)) {
 av_log(matroska->ctx, AV_LOG_ERROR,
"Invalid length 0x%"PRIx64" > 0x%"PRIx64" in parent\n",
@@ -1610,7 +1612,7 @@ static int 
matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
 ret = AVERROR_INVALIDDATA;
 } else {
 level.start  = 0;
-level.length = (uint64_t) -1;
+level.length = EBML_UNKNOWN_LENGTH;
 matroska->levels[matroska->num_levels] = level;
 matroska->num_levels++;
 matroska->current_id   = 0;
@@ -1620,7 +1622,7 @@ static int 
matroska_parse_seekhead_entry(MatroskaDemuxContext *matroska,
 /* remove dummy level */
 while (matroska->num_levels) {
 uint64_t length = 
matroska->levels[--matroska->num_levels].length;
-if (length == (uint64_t) -1)
+if (length == EBML_UNKNOWN_LENGTH)
 break;
 }
 }
-- 
2.18.0

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


Re: [FFmpeg-devel] [PATCH] avformat/mov: fix hang while seek on a kind of fragmented mp4.

2019-02-23 Thread Michael Niedermayer
On Sat, Feb 23, 2019 at 03:22:08PM +0800, C.H.Liu wrote:
> I can’t reproduce the OOM. Is it possible the problem relate to a specific
> clip?
> 
> Here is my test steps:
> 1. To ensure that it’s not affected by caches, delete all except the .git
> dir in my code dir. Then checkout again.
> 2. To ensure that the latest test clips are used. make fate-rsync
> SAMPLES=fate-suite/
> 3. To ensure that OS environment is clean, run test in docker.
> Below is one of my test logs:

heres some massif output that should show where the exessive allocation happens:
(note the box has 14gb free and the input file is less than 4kb size)

snapshot=70
#---
time=1856698079
mem_heap_B=8487679
mem_heap_extra_B=522580313
mem_stacks_B=0
heap_tree=peak
n2: 8487679 (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
 n2: 8298639 0x12AAF2B: av_malloc (mem.c:87)
  n1: 8294364 0x12AAF59: av_malloc (mem.c:126)
   n1: 8294364 0x12AB24B: av_mallocz (mem.c:238)
n1: 8294364 0x12AB122: av_mallocz_array (mem.c:195)
 n1: 8294364 0x743749: update_frag_index (mov.c:1257)
  n1: 8294364 0x756174: read_tfra (mov.c:7293)
   n1: 8294364 0x7563F0: mov_read_mfra (mov.c:7344)
n1: 8294364 0x743B01: mov_read_moof (mov.c:1338)
 n1: 8294364 0x754A0C: mov_read_default (mov.c:6841)
  n1: 8294364 0x756596: mov_read_header (mov.c:7385)
   n1: 8294364 0x8254BB: avformat_open_input (utils.c:631)
n1: 8294364 0x415CE6: open_input_file (ffmpeg_opt.c:1104)
 n1: 8294364 0x41F666: open_files (ffmpeg_opt.c:3273)
  n1: 8294364 0x41F7F8: ffmpeg_parse_options (ffmpeg_opt.c:3313)
   n0: 8294364 0x43DFC6: main (ffmpeg.c:4869)
  n0: 4275 in 7 places, all below massif's threshold (01.00%)
 n0: 189040 in 8 places, all below massif's threshold (01.00%)


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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable


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


Re: [FFmpeg-devel] [PATCH] avformat/matroskadec: Check parents remaining length

2019-02-23 Thread Steve Lhomme
Hi,

It's possible that it fixes the issue. When I did the patch I noticed some 
places used a similar value and some are using -1. I think this should be a 
define (probably set to UINT64_MAX) that is used everywhere. It's just a marker 
to say the length is unknown.


> On February 22, 2019 at 9:31 PM Dale Curtis  wrote:
> 
> +steve who submitted the original patch.
> 
> - dale
> 
> 
> On Thu, Feb 21, 2019 at 2:30 PM Dale Curtis < dalecur...@chromium.org 
> mailto:dalecur...@chromium.org > wrote:
> 
> > > One of our test clips is behaving differently after this 
> patch:
> > 
> > https://cs.chromium.org/chromium/src/media/test/data/bear-320x240-live.webm
> > 
> > The printed log message is:
> > [matroska,webm @ 0x1516c84f4e00] Invalid length 0xff > 
> > 0x12f in parent
> > 
> > Looking through the code I'm unsure which of the mixed usage 
> > "(uint64_t)-1" and "2**56-1" as marker values is correct. Changing the code 
> > to:
> > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> > index 9b706ab4e0..3015a0b230 100644
> > --- a/libavformat/matroskadec.c
> > +++ b/libavformat/matroskadec.c
> > @@ -1205,7 +1205,7 @@ static int 
> > ebml_parse_elem(MatroskaDemuxContext *matroska,
> >  MatroskaLevel *level = 
> > &matroska->levels[matroska->num_levels - 1];
> >  AVIOContext *pb = matroska->ctx->pb;
> >  int64_t pos = avio_tell(pb);
> > -if (level->length != (uint64_t) -1 &&
> > +if (level->length != 0xffULL &&
> >  (pos + length) > (level->start + level->length)) {
> >  av_log(matroska->ctx, AV_LOG_ERROR,
> > "Invalid length 0x%"PRIx64" > 0x%"PRIx64" 
> > in parent\n",
> > 
> > Resolves our issues. Should all other length tests be done the same 
> > way?
> > 
> > - dale
> > 
> > On Sun, Feb 17, 2019 at 12:45 AM Michael Niedermayer < 
> > michae...@gmx.at mailto:michae...@gmx.at > wrote:
> > 
> > > > > On Wed, Feb 13, 2019 at 01:41:31PM +0100, Michael 
> > Niedermayer wrote:
> > > > Reported-by: Steve Lhomme
> > > > This was found through the Hacker One program on VLC but is 
> > > not a security issue in libavformat
> > > > Signed-off-by: Michael Niedermayer 
> > > > ---
> > > >  libavformat/matroskadec.c | 21 +
> > > >  1 file changed, 21 insertions(+)
> > > 
> > > will apply an equivalent variant from steve
> > > 
> > > [...]
> > > --
> > > Michael GnuPG fingerprint: 
> > > 9FF2128B147EF6730BADF133611EC787040B0FAB
> > > 
> > > Asymptotically faster algorithms should always be preferred 
> > > if you have
> > > asymptotical amounts of data
> > > ___
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org mailto:ffmpeg-devel@ffmpeg.org
> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > > 
> > > > > 
> > > 


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