Re: [FFmpeg-devel] [PATCH] This patch addresses Trac ticket #5570. The optimized functions are in file libswscale/ppc/input_vsx.c. Each optimized function name is a concatenation of the corresponding

2019-03-31 Thread Lauri Kasanen
On Mon, 1 Apr 2019 09:07:48 +0300
slava  wrote:

> Sorry for title. It is my first experience in git send-email. Can I make
> a benchmark with handwritten tests or have some standard tool in ffmeg?
> And will the benchmark on x86-64 be informative?

We have standard bench macros, START_TIMER and STOP_TIMER. Put those
around the function's callsite, then do some ffmpeg run that calls that
specific function. Then add "-cpuflags 0" to the call to get the C
results, and from the numbers you can calculate the speedup.

Both the C and VSX runs should be done on the POWER machine. A Qemu VM,
emulating POWER instructions on x86-64, would probably be useless for
benchmark purposes. There are free POWER VMs available for testing from
a few places.

- Lauri
___
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] [fixme] avformat/hlsenc.c miss pat&pmt info

2019-03-31 Thread myp...@gmail.com
On Mon, Apr 1, 2019 at 12:02 PM lmzeng(曾令明)  wrote:
>
> When I try use ffmpeg 4.1 concat some mp3 files like this:
>
> >>ffconcat version 1.0
> >>
> >>file
http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/8e15b6325285890787361152529/f0.mp3
> >>file
http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/ee02b7825285890787362994665/f0.mp3
> >>file
http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/726920765285890787364016855/f0.mp3
>
> >>ffmpeg -safe 0 -protocol_whitelist "file,tcp,http,hls" -i mp3.txt -vn
-map 0:a? -acodec copy -hls_list_size 0 -hls_ts_options mpegts_copyts=1
 -hls_time 10 -hls_flags single_file -f hls 26374_2256155.f3.m3u8
>
> VlC player can’t seek, here miss add PAT&PMT at per segment(except the
first segment)?
>
> hlsenc.c:2281
> >>>if (use_temp_file) {
> >>>if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <= 0))
> >>>if ((vs->avf->oformat->priv_class && vs->avf->priv_data) &&
hls->segment_type != SEGMENT_TYPE_FMP4)
> >>>av_opt_set(vs->avf->priv_data, "mpegts_flags",
"resend_headers", 0);
> >>>}

I think you need to create a bug in trac if it's a issue, more information
you can refer to https://trac.ffmpeg.org/ticket/7820, tks
___
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] This patch addresses Trac ticket #5570. The optimized functions are in file libswscale/ppc/input_vsx.c. Each optimized function name is a concatenation of the corresponding

2019-03-31 Thread slava
Sorry for title. It is my first experience in git send-email. Can I make 
a benchmark with handwritten tests or have some standard tool in ffmeg? 
And will the benchmark on x86-64 be informative?



On 03/29/2019 06:02 PM, Lauri Kasanen wrote:

On Fri, 29 Mar 2019 17:00:38 +0300
Вячеслав  wrote:


---
  libswscale/ppc/Makefile   |3 +-
  libswscale/ppc/input_vsx.c| 3801 +
  libswscale/swscale.c  |3 +
  libswscale/swscale_internal.h |1 +
  4 files changed, 3807 insertions(+), 1 deletion(-)
  create mode 100644 libswscale/ppc/input_vsx.c

Please include performance benchmarks for each function. The
description should go in the patch main part, not in the title.

- Lauri
___
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 v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

2019-03-31 Thread Sun, Jing A

-Original Message-
From: Li, Zhong 
Sent: Monday, April 1, 2019 1:21 PM
To: FFmpeg development discussions and patches 
Cc: Sun, Jing A ; Huang, Zhengxu 
; Jun Zhao ; Tmar, Hassene 

Subject: RE: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
encoder wrapper

> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf 
> Of Jing Sun
> Sent: Monday, April 1, 2019 10:38 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu 
> ; Jun Zhao ; Tmar, 
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc 
> encoder wrapper

>I haven't seen any of my comments was addressed. 

Thanks for your valuable comments! I am working on them.

- Jing
___
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 v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

2019-03-31 Thread Li, Zhong
> From: ffmpeg-devel [mailto:ffmpeg-devel-boun...@ffmpeg.org] On Behalf
> Of Jing Sun
> Sent: Monday, April 1, 2019 10:38 AM
> To: ffmpeg-devel@ffmpeg.org
> Cc: Sun, Jing A ; Huang, Zhengxu
> ; Jun Zhao ; Tmar,
> Hassene 
> Subject: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc
> encoder wrapper

I haven't seen any of my comments was addressed. 
___
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] lavf/mov: skip extradata check in esds for MPEG-1/2 audio

2019-03-31 Thread Gyan



On 28-03-2019 11:04 PM, Gyan wrote:


0001-lavf-mov-skip-extradata-check-in-esds-for-MPEG-1-2-a.patch

 From 7e10e1c58e69137487ff0da85caf1c350b3262ae Mon Sep 17 00:00:00 2001
From: Gyan Doshi
Date: Thu, 28 Mar 2019 22:59:30 +0530
Subject: [PATCH] lavf/mov: skip extradata check in esds for MPEG-1/2 audio

As per 14496-3 9.D.2.2, it's not defined for these audio object types.

Fixes #7817.
---
  libavformat/isom.c | 4 
  1 file changed, 4 insertions(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index 0a4d901be5..4358dc4a6a 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -534,6 +534,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
  len = ff_mp4_read_descr(fc, pb, &tag);
  if (tag == MP4DecSpecificDescrTag) {
  av_log(fc, AV_LOG_TRACE, "Specific MPEG-4 header len=%d\n", len);
+/* As per 14496-3:2009 9.D.2.2, No decSpecificInfo is defined
+   for MPEG-1 Audio or MPEG-2 Audio; MPEG-2 AAC excluded. */
+if (object_type_id == 0x69 || object_type_id == 0x6b)
+return 0;
  if (!len || (uint64_t)len > (1<<30))
  return AVERROR_INVALIDDATA;
  if ((ret = ff_get_extradata(fc, st->codecpar, pb, len)) < 0)
-- 2.19.2


Will push soon.

Gyan
___
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] ffmpeg: add -drop_deviant_frames option

2019-03-31 Thread Gyan



On 27-03-2019 08:26 PM, Gyan wrote:

Weird. Attached corrected patch.

Thanks.


Ping.

Gyan
___
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] [fixme] avformat/hlsenc.c miss pat&pmt info

2019-03-31 Thread 曾令明
When I try use ffmpeg 4.1 concat some mp3 files like this:

>>ffconcat version 1.0
>>
>>file 
>>http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/8e15b6325285890787361152529/f0.mp3
>>file 
>>http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/ee02b7825285890787362994665/f0.mp3
>>file 
>>http://1251953721.vod2.myqcloud.com/0ec02e46vodcq1251953721/726920765285890787364016855/f0.mp3

>>ffmpeg -safe 0 -protocol_whitelist "file,tcp,http,hls" -i mp3.txt -vn -map 
>>0:a? -acodec copy -hls_list_size 0 -hls_ts_options mpegts_copyts=1  -hls_time 
>>10 -hls_flags single_file -f hls 26374_2256155.f3.m3u8

VlC player can’t seek, here miss add PAT&PMT at per segment(except the first 
segment)?

hlsenc.c:2281
>>>if (use_temp_file) {
>>>if (!(hls->flags & HLS_SINGLE_FILE) || (hls->max_seg_size <= 0))
>>>if ((vs->avf->oformat->priv_class && vs->avf->priv_data) && 
>>> hls->segment_type != SEGMENT_TYPE_FMP4)
>>>av_opt_set(vs->avf->priv_data, "mpegts_flags", "resend_headers", 
>>> 0);
>>>}
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

2019-03-31 Thread Sun, Jing A
The one made the below change:

- if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10LE) {
+if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10) {

No special handling for 10 bit anymore.

Regards,
SUN, Jing
___
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 v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

2019-03-31 Thread Sun, Jing A
The one made the below change:

___
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 v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

2019-03-31 Thread Jing Sun
Signed-off-by: Zhengxu Huang 
Signed-off-by: Hassene Tmar 
Signed-off-by: Jun Zhao 
Signed-off-by: Jing Sun 
---
 configure|   4 +
 libavcodec/Makefile  |   1 +
 libavcodec/allcodecs.c   |   1 +
 libavcodec/libsvt_hevc.c | 482 +++
 4 files changed, 488 insertions(+)
 create mode 100644 libavcodec/libsvt_hevc.c

diff --git a/configure b/configure
index 938ff10..2aabac4 100755
--- a/configure
+++ b/configure
@@ -264,6 +264,7 @@ External library support:
   --enable-libspeexenable Speex de/encoding via libspeex [no]
   --enable-libsrt  enable Haivision SRT protocol via libsrt [no]
   --enable-libssh  enable SFTP protocol via libssh [no]
+  --enable-libsvthevc  enable HEVC encoding via svt [no]
   --enable-libtensorflow   enable TensorFlow as a DNN module backend
for DNN based filters like sr [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
@@ -1784,6 +1785,7 @@ EXTERNAL_LIBRARY_LIST="
 libspeex
 libsrt
 libssh
+libsvthevc
 libtensorflow
 libtesseract
 libtheora
@@ -3173,6 +3175,7 @@ libshine_encoder_select="audio_frame_queue"
 libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
+libsvt_hevc_encoder_deps="libsvthevc"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
@@ -6209,6 +6212,7 @@ enabled libsoxr   && require libsoxr soxr.h 
soxr_create -lsoxr
 enabled libssh&& require_pkg_config libssh libssh libssh/sftp.h 
sftp_init
 enabled libspeex  && require_pkg_config libspeex speex speex/speex.h 
speex_decoder_init
 enabled libsrt&& require_pkg_config libsrt "srt >= 1.3.0" 
srt/srt.h srt_socket
+enabled libsvthevc&& require_pkg_config libsvthevc SvtHevcEnc EbApi.h 
EbInitHandle
 enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h 
TF_Version -ltensorflow
 enabled libtesseract  && require_pkg_config libtesseract tesseract 
tesseract/capi.h TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 15c43a8..c93e545 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -987,6 +987,7 @@ OBJS-$(CONFIG_LIBOPUS_ENCODER)+= libopusenc.o 
libopus.o \
 OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
+OBJS-$(CONFIG_LIBSVT_HEVC_ENCODER)+= libsvt_hevc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index b26aeca..e93f66f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -703,6 +703,7 @@ extern AVCodec ff_librsvg_decoder;
 extern AVCodec ff_libshine_encoder;
 extern AVCodec ff_libspeex_encoder;
 extern AVCodec ff_libspeex_decoder;
+extern AVCodec ff_libsvt_hevc_encoder;
 extern AVCodec ff_libtheora_encoder;
 extern AVCodec ff_libtwolame_encoder;
 extern AVCodec ff_libvo_amrwbenc_encoder;
diff --git a/libavcodec/libsvt_hevc.c b/libavcodec/libsvt_hevc.c
new file mode 100644
index 000..2ab5323
--- /dev/null
+++ b/libavcodec/libsvt_hevc.c
@@ -0,0 +1,482 @@
+/*
+* Scalable Video Technology for HEVC encoder library plugin
+*
+* Copyright (c) 2018 Intel Corporation
+*
+* 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 this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "EbErrorCodes.h"
+#include "EbTime.h"
+#include "EbApi.h"
+
+#include "libavutil/common.h"
+#include "libavutil/frame.h"
+#include "libavutil/opt.h"
+
+#include "internal.h"
+#include "avcodec.h"
+
+typedef enum eos_status {
+EOS_NOT_REACHED = 0,
+EOS_REACHED,
+EOS_TOTRIGGER
+}EOS_STATUS;
+
+typedef struct SvtContext {
+AVClass *class;
+
+EB_H265_ENC_CONFIGURATION enc_params;
+EB_COMPONENTTYPE *svt_handle;
+EB_BUFFERHEADERTYPE in_buf;
+EOS_STATUS eos_flag;
+
+// User options.
+int hierarchical_l

Re: [FFmpeg-devel] [PATCH v10 1/2] lavc/svt_hevc: add libsvt hevc encoder wrapper

2019-03-31 Thread Sun, Jing A
On Fri, Mar 29, 2019 at 5:28 AM Jing Sun  wrote:
+static int config_enc_params(EB_H265_ENC_CONFIGURATION *param,
+                             AVCodecContext *avctx)
+{
+    SvtContext *svt_enc = avctx->priv_data;
+    int ret;
+
+    param->sourceWidth = avctx->width;
+    param->sourceHeight = avctx->height;
+    param->encoderBitDepth = 8;
+
+    if (avctx->pix_fmt == AV_PIX_FMT_YUV420P10LE) {
+        av_log(avctx, AV_LOG_DEBUG, "Encoder 10 bits depth input\n");
+
+        param->encoderBitDepth = 10;
+    }
+    param->encoderColorFormat = EB_YUV420;

>this patch blatantly ignores my review(s) and therefore it is rejected

>to reiterate:
>- if the encoder does not support 10 bit (or if scales down from 10 to 8 
>internally), this feature should not be present in the wrapper either (or it 
>should at least warn the user)

>- if the encoder does not support setting the color properties in the VUI, the 
>wrapper should definitely warn the user of the loss of information (or we 
>should wait until this features is present upstream)

>reagrds
>-- 
>Vittorio

--
So what is happening in this case? The encoder is slower because it converts 
from 10 to 8 bit internally? And then the output encode is 8 bit right now? If 
that is the case, I'd rather have this functionality removed since the 
conversion can happen directly within ffmpeg. Having the conversion performed 
by the encoder is guaranteed to be slower and less precise, and if the output 
is not 10 bit it is very surprising too.

At the same time the comment in the code is useless because users will never 
read something buried deep in the code, I'd suggest printing something at the 
warning level so that it will be shown during the conversion (and please have 
it proofread by a native English-speaking person).
-

You said that functionality should be removed and the comment in the code is 
useless, so I removed it. The 10 bit works fine this way, no need to warn the 
users.


--
nit: excessive whitespace alignment
-- 
I have corrected the whitespace.


--
Where is the warning that notifies the lack of color properties support?
--
I was with you, so added the warning in v9, then I removed the hdr/vui 
interfaces entirely in v10, after I saw mark's review. I think you are right, 
that the SVT-HEVC's implementation of hdr/vui is not a complete one , hence the 
removal. And I have explained the removal in the former reply: to add hdr back 
once the feature is fully supported in SVT-HEVC.


--
IMO these options help text could be improved. 
--
I have improved it in v9/v10. 
+{ "aud", "Include Access Unit Delimiter", OFFSET(aud),
+  AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VE },

- Jing
___
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] doc/general.texi: add note about 32-bit GCC builds of AviSynth+

2019-03-31 Thread Stephen Hutchinson
---
The text has been updated to reflect that 32-bit builds of FFmpeg
in general don't default to AviSynth+GCC compatibility.
 doc/general.texi | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/doc/general.texi b/doc/general.texi
index bafa1e2ea2..6c1acb517c 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -51,6 +51,21 @@ For Windows, supported AviSynth variants are
 For Linux and OS X, the supported AviSynth variant is
 @url{https://github.com/avxsynth/avxsynth, AvxSynth}.
 
+@float NOTE
+In 2016, AviSynth+ added support for building with GCC. However, due to
+the eccentricities of Windows' calling conventions, 32-bit GCC builds
+of AviSynth+ are not compatible with typical 32-bit builds of FFmpeg.
+
+By default, FFmpeg assumes compatibility with 32-bit MSVC builds of
+AviSynth+ since that is the most widely-used and entrenched build
+configuration.  Users can override this and enable support for 32-bit
+GCC builds of AviSynth+ by passing @code{-DAVSC_WIN32_GCC32} to
+@code{--extra-cflags} when configuring FFmpeg.
+
+64-bit builds of FFmpeg are not affected, and can use either MSVC or
+GCC builds of AviSynth+ without any special flags.
+@end float
+
 @float NOTE
 AviSynth and AvxSynth are loaded dynamically.  Distributors can build FFmpeg
 with @code{--enable-avisynth}, and the binaries will work regardless of the
-- 
2.19.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 for supporting m264 on h.264 decoding and encoding.

2019-03-31 Thread Carl Eugen Hoyos
2019-03-29 17:14 GMT+01:00, Yufei He :

> This is the fixed version of this patch that follows the
> way other companies do on supporting FFmpeg.

Both header files look unneeded to me.

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] avcodec/rscc: Check that the to be uncompressed input is large enough

2019-03-31 Thread Michael Niedermayer
On Sun, Mar 31, 2019 at 05:35:33PM +0200, Paul B Mahol wrote:
> On 3/31/19, Michael Niedermayer  wrote:
> > Fixes: Out of array access
> > Fixes:
> > 13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/rscc.c | 7 +++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
> > index 7d4e842cd3..4adee9d7d4 100644
> > --- a/libavcodec/rscc.c
> > +++ b/libavcodec/rscc.c
> > @@ -199,6 +199,13 @@ static int rscc_decode_frame(AVCodecContext *avctx,
> > void *data,
> >  /* If necessary, uncompress tiles, and hijack the bytestream reader
> > */
> >  if (packed_tiles_size != tiles_nb * TILE_SIZE) {
> >  uLongf length = tiles_nb * TILE_SIZE;
> > +
> > +if (bytestream2_get_bytes_left(gbc) < packed_tiles_size) {
> > +av_log(avctx, AV_LOG_ERROR, "compressed input
> > truncated\n");
> > +ret = AVERROR_INVALIDDATA;
> > +goto end;
> > +}
> > +
> >  inflated_tiles = av_malloc(length);
> >  if (!inflated_tiles) {
> >  ret = AVERROR(ENOMEM);
> > --
> > 2.21.0
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> 
> Please commit without log message.

if you prefer that, sure, will do.
this will be the only AVERROR_INVALIDDATA case in that file without a log
message though.

Thanks

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


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 4/5] x86/opusdsp: implement FMA3 accelerated postfilter and deemphasis

2019-03-31 Thread James Almer
On 3/16/2019 1:33 PM, Lynne wrote:
> diff --git a/libavcodec/x86/opusdsp.asm b/libavcodec/x86/opusdsp.asm
> new file mode 100644
> index 00..ed65614e06
> --- /dev/null
> +++ b/libavcodec/x86/opusdsp.asm
> @@ -0,0 +1,114 @@
> +;**
> +;* Opus SIMD functions
> +;*
> +;* 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 "libavutil/x86/x86util.asm"
> +
> +SECTION_RODATA
> +
> + ; 0.85..^10.85..^20.85..^30.85..^4
> +tab_st: dd 0x3f599a00, 0x3f38f671, 0x3f1d382a, 0x3f05a32f
> +tab_x0: dd 0x0,0x3f599a00, 0x3f599a00, 0x3f599a00
> +tab_x1: dd 0x0,0x0,0x3f38f671, 0x3f38f671
> +tab_x2: dd 0x0,0x0,0x0,0x3f1d382a
> +
> +SECTION .text
> +
> +INIT_XMM fma3
> +%if UNIX64
> +cglobal opus_deemphasis, 3, 3, 8, out, in, len
> +%else
> +cglobal opus_deemphasis, 4, 4, 8, out, in, coeff, len
> +%endif
> +%if ARCH_X86_32
> +VBROADCASTSS m0, coeffm
> +%else
> +%if WIN64
> +SWAP 0, 2
> +%endif
> +shufps m0, m0, 0
> +%endif
> +
> +movaps m4, [tab_st]
> +movaps m5, [tab_x0]
> +movaps m6, [tab_x1]
> +movaps m7, [tab_x2]
> +
> +.loop:
> +movaps  m1, [inq]; x0, x1, x2, x3
> +
> +pslldq  m2, m1, 4;  0, x0, x1, x2
> +pslldq  m3, m1, 8;  0,  0, x0, x1
> +
> +fmaddps m2, m2, m5, m1   ; x + c1*x[0-2]
> +pslldq  m1, 12   ;  0,  0,  0, x0
> +
> +fmaddps m2, m3, m6, m2   ; x + c1*x[0-2] + c2*x[0-1]
> +fmaddps m1, m1, m7, m2   ; x + c1*x[0-2] + c2*x[0-1] + c3*x[0]
> +fmaddps m0, m0, m4, m1   ; x + c1*x[0-2] + c2*x[0-1] + c3*x[0] + 
> c*s
> +
> +movaps [outq], m0
> +shufps m0, m0, q ; new state
> +
> +add inq,  mmsize
> +add outq, mmsize
> +sub lenq, mmsize >> 2
> +jg .loop
> +
> +%if ARCH_X86_64 == 0
> +movss r0m, m0
> +fld dword r0m
> +%endif
> +RET

A float ret value needs to be in xmm0, and you swapped m0 with m2 on
Win64. This is the source of the fate failure.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 4/5] x86/opusdsp: implement FMA3 accelerated postfilter and deemphasis

2019-03-31 Thread James Almer
On 3/31/2019 7:26 PM, Carl Eugen Hoyos wrote:
> 2019-03-29 19:05 GMT+01:00, Lynne :
>> Mar 16, 2019, 4:33 PM by d...@lynne.ee :
>>
>>> 58893 decicycles in deemphasis_c,  130548 runs,524 skips
>>> 9475 decicycles in deemphasis_fma3,  130686 runs,386 skips -> 6.21x
>>> speedup
>>>
>>> 24866 decicycles in postfilter_c,   65386 runs,150 skips
>>> 5268 decicycles in postfilter_fma3,   65505 runs, 31 skips -> 4.72x
>>> speedup
>>>
>>> Total decoder speedup: ~14%
>>>
>>> Deemphasis SIMD based on the following unrolling:
>>> const float c1 = CELT_EMPH_COEFF, c2 = c1*c1, c3 = c2*c1, c4 = c3*c1;
>>> float state = coeff;
>>>
>>> for (int i = 0; i < len; i += 4) {
>>> y[0] = x[0] + c1*state;
>>> y[1] = x[1] + c2*state + c1*x[0];
>>> y[2] = x[2] + c3*state + c1*x[1] + c2*x[0];
>>> y[3] = x[3] + c4*state + c1*x[2] + c2*x[1] + c3*x[0];
>>>
>>> state = y[3];
>>> y += 4;
>>> x += 4;
>>> }
>>>
>>
>> Ping to this part of the patchset while I fix android?
> 
> Done.
> 
> Please run fate on future patches (it did not pass).
> 
> Carl Eugen

This fails on mingw-w64:

TESTopus-testvector01
stddev:  183.65 PSNR: 51.05 MAXDIFF:14569 bytes:  5660160/  5660160
stddev: |183.65 - 0| >= 3
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 4/5] x86/opusdsp: implement FMA3 accelerated postfilter and deemphasis

2019-03-31 Thread Carl Eugen Hoyos
2019-03-29 19:05 GMT+01:00, Lynne :
> Mar 16, 2019, 4:33 PM by d...@lynne.ee :
>
>> 58893 decicycles in deemphasis_c,  130548 runs,524 skips
>> 9475 decicycles in deemphasis_fma3,  130686 runs,386 skips -> 6.21x
>> speedup
>>
>> 24866 decicycles in postfilter_c,   65386 runs,150 skips
>> 5268 decicycles in postfilter_fma3,   65505 runs, 31 skips -> 4.72x
>> speedup
>>
>> Total decoder speedup: ~14%
>>
>> Deemphasis SIMD based on the following unrolling:
>> const float c1 = CELT_EMPH_COEFF, c2 = c1*c1, c3 = c2*c1, c4 = c3*c1;
>> float state = coeff;
>>
>> for (int i = 0; i < len; i += 4) {
>> y[0] = x[0] + c1*state;
>> y[1] = x[1] + c2*state + c1*x[0];
>> y[2] = x[2] + c3*state + c1*x[1] + c2*x[0];
>> y[3] = x[3] + c4*state + c1*x[2] + c2*x[1] + c3*x[0];
>>
>> state = y[3];
>> y += 4;
>> x += 4;
>> }
>>
>
> Ping to this part of the patchset while I fix android?

Done.

Please run fate on future patches (it did not pass).

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 v3] avcodec: add AV1 frame split bitstream filter

2019-03-31 Thread James Almer
On 3/26/2019 9:25 PM, James Almer wrote:
> This will be needed by the eventual native AV1 decoder.
> 
> Signed-off-by: James Almer 
> ---
> Now propagating the Temporal Unit unchanged if splitting can't be performed.

Ping.
___
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/movenc: free eac3 private data only when closing the stream

2019-03-31 Thread James Almer
On 3/28/2019 10:41 PM, James Almer wrote:
> This makes sure the data is available when writing the moov atom during the
> second pass triggered by the faststart movflag.
> 
> Fixes ticket #7780

Will push soon.
___
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] Fixed corrupt segment video files when using hls_init_time option.

2019-03-31 Thread Kovács László
Hi!

Thank you for your advice! Next time I'm going to do on that way ;). By the 
way, it was the first time I used git and this mailing list and I was confused 
a bit.
(On the other hand this time my first reply went to wrong place but I think I’m 
ok now. 😊)

Best regards,
Laszlo
___
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] Fixed corrupt segment video files when using hls_init_time option.

2019-03-31 Thread Kovács László
Hi!

Thank you for your advice! Next time I'm going to do on that way ;). By the 
way, it was the first time I used git and this mailing list and I was confused 
a bit :).

Best regards,
Laszlo
___
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/5] avcodec/proresdec2: decode picture header before frame allocation

2019-03-31 Thread Michael Niedermayer
On Sun, Mar 24, 2019 at 11:44:22PM +0100, Michael Niedermayer wrote:
> Fixes: Timeout (21sec -> 0.3sec)
> Fixes: 
> 13716/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PRORES_fuzzer-575559145600
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/proresdec2.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)

will apply patchset

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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 v5] avformat/doc, http, icecast, rtsp: Add option to disable send-expect-100

2019-03-31 Thread Michael Niedermayer
On Sat, Mar 30, 2019 at 09:35:51PM -0700, Jun Li wrote:
> Fix ticket #7297
> The current setting for send-expect-100 option is either
> enabled if applicable or forced enabled, no option to force
> disable the header. This change is to expand the option setting
> to provide more flexibility, which is useful for rstp case.
> ---
>  doc/protocols.texi|  5 +
>  libavformat/http.c| 28 +---
>  libavformat/icecast.c |  2 +-
>  libavformat/rtsp.c|  1 +
>  4 files changed, 24 insertions(+), 12 deletions(-)

will apply

thanks

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire


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] avcodec/rscc: Check that the to be uncompressed input is large enough

2019-03-31 Thread Paul B Mahol
On 3/31/19, Michael Niedermayer  wrote:
> Fixes: Out of array access
> Fixes:
> 13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/rscc.c | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
> index 7d4e842cd3..4adee9d7d4 100644
> --- a/libavcodec/rscc.c
> +++ b/libavcodec/rscc.c
> @@ -199,6 +199,13 @@ static int rscc_decode_frame(AVCodecContext *avctx,
> void *data,
>  /* If necessary, uncompress tiles, and hijack the bytestream reader
> */
>  if (packed_tiles_size != tiles_nb * TILE_SIZE) {
>  uLongf length = tiles_nb * TILE_SIZE;
> +
> +if (bytestream2_get_bytes_left(gbc) < packed_tiles_size) {
> +av_log(avctx, AV_LOG_ERROR, "compressed input
> truncated\n");
> +ret = AVERROR_INVALIDDATA;
> +goto end;
> +}
> +
>  inflated_tiles = av_malloc(length);
>  if (!inflated_tiles) {
>  ret = AVERROR(ENOMEM);
> --
> 2.21.0
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Please commit without log message.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

[FFmpeg-devel] [PATCH] avcodec/rscc: Check that the to be uncompressed input is large enough

2019-03-31 Thread Michael Niedermayer
Fixes: Out of array access
Fixes: 
13984/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-5734128093233152

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

diff --git a/libavcodec/rscc.c b/libavcodec/rscc.c
index 7d4e842cd3..4adee9d7d4 100644
--- a/libavcodec/rscc.c
+++ b/libavcodec/rscc.c
@@ -199,6 +199,13 @@ static int rscc_decode_frame(AVCodecContext *avctx, void 
*data,
 /* If necessary, uncompress tiles, and hijack the bytestream reader */
 if (packed_tiles_size != tiles_nb * TILE_SIZE) {
 uLongf length = tiles_nb * TILE_SIZE;
+
+if (bytestream2_get_bytes_left(gbc) < packed_tiles_size) {
+av_log(avctx, AV_LOG_ERROR, "compressed input truncated\n");
+ret = AVERROR_INVALIDDATA;
+goto end;
+}
+
 inflated_tiles = av_malloc(length);
 if (!inflated_tiles) {
 ret = AVERROR(ENOMEM);
-- 
2.21.0

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

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

[FFmpeg-devel] [PATCH] swscale/ppc: VSX-optimize non-full-chroma yuv2rgb_1

2019-03-31 Thread Lauri Kasanen
./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 -sws_flags 
fast_bilinear \
-s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
-cpuflags 0 -v error -

32-bit mul, power8 only.

1.8-2.3x speedup:

rgb24
  18192 UNITS in yuv2packed1,   32767 runs,  1 skips
   9983 UNITS in yuv2packed1,   32760 runs,  8 skips
bgr24
  18665 UNITS in yuv2packed1,   32766 runs,  2 skips
   9925 UNITS in yuv2packed1,   32763 runs,  5 skips
rgba
  20239 UNITS in yuv2packed1,   32767 runs,  1 skips
   8794 UNITS in yuv2packed1,   32759 runs,  9 skips
bgra
  20354 UNITS in yuv2packed1,   32768 runs,  0 skips
   8770 UNITS in yuv2packed1,   32761 runs,  7 skips
argb
  20185 UNITS in yuv2packed1,   32768 runs,  0 skips
   8761 UNITS in yuv2packed1,   32761 runs,  7 skips
bgra
  20360 UNITS in yuv2packed1,   32766 runs,  2 skips
   8759 UNITS in yuv2packed1,   32764 runs,  4 skips

This is a low speedup, but the x86 mmx version also gets only ~2x. The mmx 
version
is also heavily inaccurate, while the vsx version has high accuracy.

Signed-off-by: Lauri Kasanen 
---
 libswscale/ppc/swscale_vsx.c | 425 +--
 1 file changed, 330 insertions(+), 95 deletions(-)

Okay, so I'm a bit unsure what to do here. I'm sure it could be faster if made 
as
inaccurate as the mmx version, but that differs a lot from the C version, which 
itself
is inaccurate vs the _full C and vsx versions. There are no other versions than 
mmx and
C to compare against.

I took the approach of using the accurate _full YUV logic, just writing two 
pixels for
each UV value. The C version uses a LUT, resulting in ~1/255 rounding errors in 
most
pixels compared to the accurate C/VSX _full logic. The MMX version does low 
accuracy
logic, differing from the C LUT as much as 10/255 per pixel.

Speed or accuracy? IMHO the mmx errors are far too large.

diff --git a/libswscale/ppc/swscale_vsx.c b/libswscale/ppc/swscale_vsx.c
index 69ec63d..0ac8cac 100644
--- a/libswscale/ppc/swscale_vsx.c
+++ b/libswscale/ppc/swscale_vsx.c
@@ -422,6 +422,104 @@ yuv2NBPSX(16, BE, 1, 16, int32_t)
 yuv2NBPSX(16, LE, 0, 16, int32_t)
 #endif

+#define WRITERGB \
+R_l = vec_max(R_l, zero32); \
+R_r = vec_max(R_r, zero32); \
+G_l = vec_max(G_l, zero32); \
+G_r = vec_max(G_r, zero32); \
+B_l = vec_max(B_l, zero32); \
+B_r = vec_max(B_r, zero32); \
+\
+R_l = vec_min(R_l, rgbclip); \
+R_r = vec_min(R_r, rgbclip); \
+G_l = vec_min(G_l, rgbclip); \
+G_r = vec_min(G_r, rgbclip); \
+B_l = vec_min(B_l, rgbclip); \
+B_r = vec_min(B_r, rgbclip); \
+\
+R_l = vec_sr(R_l, shift22); \
+R_r = vec_sr(R_r, shift22); \
+G_l = vec_sr(G_l, shift22); \
+G_r = vec_sr(G_r, shift22); \
+B_l = vec_sr(B_l, shift22); \
+B_r = vec_sr(B_r, shift22); \
+\
+rd16 = vec_packsu(R_l, R_r); \
+gd16 = vec_packsu(G_l, G_r); \
+bd16 = vec_packsu(B_l, B_r); \
+rd = vec_packsu(rd16, zero16); \
+gd = vec_packsu(gd16, zero16); \
+bd = vec_packsu(bd16, zero16); \
+\
+switch(target) { \
+case AV_PIX_FMT_RGB24: \
+out0 = vec_perm(rd, gd, perm3rg0); \
+out0 = vec_perm(out0, bd, perm3tb0); \
+out1 = vec_perm(rd, gd, perm3rg1); \
+out1 = vec_perm(out1, bd, perm3tb1); \
+\
+vec_vsx_st(out0, 0, dest); \
+vec_vsx_st(out1, 16, dest); \
+\
+dest += 24; \
+break; \
+case AV_PIX_FMT_BGR24: \
+out0 = vec_perm(bd, gd, perm3rg0); \
+out0 = vec_perm(out0, rd, perm3tb0); \
+out1 = vec_perm(bd, gd, perm3rg1); \
+out1 = vec_perm(out1, rd, perm3tb1); \
+\
+vec_vsx_st(out0, 0, dest); \
+vec_vsx_st(out1, 16, dest); \
+\
+dest += 24; \
+break; \
+case AV_PIX_FMT_BGRA: \
+out0 = vec_mergeh(bd, gd); \
+out1 = vec_mergeh(rd, ad); \
+\
+tmp8 = (vector uint8_t) vec_mergeh((vector uint16_t) out0, (vector 
uint16_t) out1); \
+vec_vsx_st(tmp8, 0, dest); \
+tmp8 = (vector uint8_t) vec_mergel((vector uint16_t) out0, (vector 
uint16_t) out1); \
+vec_vsx_st(tmp8, 16, dest); \
+\
+dest += 32; \
+break; \
+case AV_PIX_FMT_RGBA: \
+out0 = vec_mergeh(rd, gd); \
+out1 = vec_mergeh(bd, ad); \
+\
+tmp8 = (vector uint8_t) vec_mergeh((vector uint16_t) out0, (vector 
uint16_t) out1); \
+vec_vsx_st(tmp8, 0, dest); \
+tmp8 = (vector uint8_t) vec_mergel((vector uint16_t) out0, (vector 
uint16_t) out1); \
+vec_vsx_st(tmp8, 16, dest); \
+\
+dest += 32; \
+break; \
+case AV_PIX_FMT_ARGB: \
+out0 = vec_mergeh(ad, rd); \
+out1 = vec_mergeh(gd, bd); \
+\
+   

Re: [FFmpeg-devel] [PATCH 1/3] swscale/ppc: VSX-optimize yuv2422_1

2019-03-31 Thread Lauri Kasanen
On Sun, 24 Mar 2019 15:10:35 +0200
Lauri Kasanen  wrote:

> ./ffmpeg -f lavfi -i yuvtestsrc=duration=1:size=1200x1440 \
> -s 1200x1440 -f null -vframes 100 -pix_fmt $i -nostats \
> -cpuflags 0 -v error -
>
> 15.3x speedup:
>
> yuyv422
>   14513 UNITS in yuv2packed1,   32768 runs,  0 skips
> 949 UNITS in yuv2packed1,   32767 runs,  1 skips
> yvyu422
>   14516 UNITS in yuv2packed1,   32767 runs,  1 skips
> 943 UNITS in yuv2packed1,   32767 runs,  1 skips
> uyvy422
>   14530 UNITS in yuv2packed1,   32767 runs,  1 skips
> 941 UNITS in yuv2packed1,   32766 runs,  2 skips
>
> Signed-off-by: Lauri Kasanen 
> ---
>  libswscale/ppc/swscale_vsx.c | 149 
> +++
>  1 file changed, 149 insertions(+)

Applying these.

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