Re: [FFmpeg-devel] [PATCH] libavcodec/libvpx: Add VPx alpha decode support

2016-07-19 Thread James Zern
On Fri, Jul 15, 2016 at 3:29 PM, James Zern  wrote:
> On Thu, Jul 14, 2016 at 8:16 PM, James Zern  wrote:
>> On Thu, Jul 14, 2016 at 12:15 PM, Vignesh Venkatasubramanian
>>  wrote:
>>> +ret = vpx_init(
>>> +avctx,
>>> +(avctx->codec_id == AV_CODEC_ID_VP8) ?
>>> +_codec_vp8_dx_algo : _codec_vp9_dx_algo,
>>> +1);
>>> +if (ret)
>>
>> I can adjust this formatting to be more k like when I submit it.
>> Before that I'll leave this open for other comments for a bit.
>
> This will need CONFIG_LIBVPX_VP(8|9)_DECODER protection too.
>

applied with the fix.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] opt: delete duplicate "hwaccel_output_format" option

2016-07-19 Thread Jun Zhao
From d712488fd73bebaa8c8f38ee29b70aa34c1df7fa Mon Sep 17 00:00:00 2001
From: Jun Zhao 
Date: Fri, 24 Jun 2016 15:06:08 +0800
Subject: [PATCH] =?UTF-8?q?ffmpeg=5Fopt:=20Delete=20duplicate=20=E2=80=9Ch?=
 =?UTF-8?q?waccel=5Foutput=5Fformat=E2=80=9D=20option.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Delete duplicate “hwaccel_output_format” option.

Signed-off-by: Jun Zhao 
---
 ffmpeg_opt.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 7785a30..68bd090 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -3384,9 +3384,6 @@ const OptionDef options[] = {
 { "hwaccel_output_format", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
   OPT_SPEC | OPT_INPUT,
  { .off = OFFSET(hwaccel_output_formats) },
 "select output format used with HW accelerated decoding", "format" },
-{ "hwaccel_output_format", OPT_VIDEO | OPT_STRING | HAS_ARG | OPT_EXPERT |
-  OPT_SPEC | OPT_INPUT,
  { .off = OFFSET(hwaccel_output_formats) },
-"select output format used with HW accelerated decoding", "format" },
 #if CONFIG_VDA || CONFIG_VIDEOTOOLBOX
 { "videotoolbox_pixfmt", HAS_ARG | OPT_STRING | OPT_EXPERT, { 
_pixfmt}, "" },
 #endif
-- 
2.7.4

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


Re: [FFmpeg-devel] why ffmpeg 3.1.1 still uses AVStream::codec

2016-07-19 Thread qw
Hi,

If AVStream::codec is declared as deprecated, I think, there should be another 
way to open and close avcodec instead of using avcodec_open2() and 
avcodec_close(). Is that right?



Thanks!

Regards


Andrew



At 2016-07-19 19:30:58, "Timo Rothenpieler"  wrote:
>> Hi,
>> 
>> I have read part of source code of ffmpeg 3.1.1. In the structure of 'struct 
>> AVStream', 'AVCodecContext *codec' is declared as deprecated. But in 
>> ffmpeg.c, 'AVCodecContext *codec' is still used in some functions. Why?
>
>Because nobody felt like changing that yet.
>___
>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


[FFmpeg-devel] [PATCH] avutil: simplify LOCAL_ALIGNED macros

2016-07-19 Thread James Almer
Signed-off-by: James Almer 
---
 configure| 10 --
 libavutil/internal.h | 22 ++
 2 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/configure b/configure
index a220fa1..0c656af 100755
--- a/configure
+++ b/configure
@@ -1765,9 +1765,7 @@ ARCH_FEATURES="
 fast_64bit
 fast_clz
 fast_cmov
-local_aligned_8
-local_aligned_16
-local_aligned_32
+local_aligned
 simd_align_16
 "
 
@@ -4335,7 +4333,7 @@ elif enabled mips; then
 loongson*)
 enable loongson2
 enable loongson3
-enable local_aligned_8 local_aligned_16 local_aligned_32
+enable local_aligned
 enable simd_align_16
 enable fast_64bit
 enable fast_clz
@@ -5239,7 +5237,7 @@ elif enabled parisc; then
 
 elif enabled ppc; then
 
-enable local_aligned_8 local_aligned_16 local_aligned_32
+enable local_aligned
 
 check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
 check_inline_asm ibm_asm   '"add 0, 0, 0"'
@@ -5280,7 +5278,7 @@ elif enabled x86; then
 check_builtin rdtscintrin.h   "__rdtsc()"
 check_builtin mm_empty mmintrin.h "_mm_empty()"
 
-enable local_aligned_8 local_aligned_16 local_aligned_32
+enable local_aligned
 
 # check whether EBP is available on x86
 # As 'i' is stored on the stack, this program will crash
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 61784b5..7f4d101 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -107,25 +107,15 @@
 DECLARE_ALIGNED(a, t, la_##v) s o;  \
 t (*v) o = la_##v
 
-#define LOCAL_ALIGNED(a, t, v, ...) E1(LOCAL_ALIGNED_A(a, t, v, __VA_ARGS__,,))
-
-#if HAVE_LOCAL_ALIGNED_8
-#   define LOCAL_ALIGNED_8(t, v, ...) E1(LOCAL_ALIGNED_D(8, t, v, 
__VA_ARGS__,,))
-#else
-#   define LOCAL_ALIGNED_8(t, v, ...) LOCAL_ALIGNED(8, t, v, __VA_ARGS__)
-#endif
-
-#if HAVE_LOCAL_ALIGNED_16
-#   define LOCAL_ALIGNED_16(t, v, ...) E1(LOCAL_ALIGNED_D(16, t, v, 
__VA_ARGS__,,))
+#if HAVE_LOCAL_ALIGNED
+#   define LOCAL_ALIGNED(a, t, v, ...) E1(LOCAL_ALIGNED_D(a, t, v, 
__VA_ARGS__,,))
 #else
-#   define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
+#   define LOCAL_ALIGNED(a, t, v, ...) E1(LOCAL_ALIGNED_A(a, t, v, 
__VA_ARGS__,,))
 #endif
 
-#if HAVE_LOCAL_ALIGNED_32
-#   define LOCAL_ALIGNED_32(t, v, ...) E1(LOCAL_ALIGNED_D(32, t, v, 
__VA_ARGS__,,))
-#else
-#   define LOCAL_ALIGNED_32(t, v, ...) LOCAL_ALIGNED(32, t, v, __VA_ARGS__)
-#endif
+#define LOCAL_ALIGNED_8 (t, v, ...) LOCAL_ALIGNED(8,  t, v, __VA_ARGS__)
+#define LOCAL_ALIGNED_16(t, v, ...) LOCAL_ALIGNED(16, t, v, __VA_ARGS__)
+#define LOCAL_ALIGNED_32(t, v, ...) LOCAL_ALIGNED(32, t, v, __VA_ARGS__)
 
 #define FF_ALLOC_OR_GOTO(ctx, p, size, label)\
 {\
-- 
2.8.2

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


[FFmpeg-devel] [PATCH] x86/diracdsp: make ff_put_signed_rect_clamped_10_sse4 work on x86_32

2016-07-19 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/x86/diracdsp.asm| 37 -
 libavcodec/x86/diracdsp_init.c |  4 
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/libavcodec/x86/diracdsp.asm b/libavcodec/x86/diracdsp.asm
index d86b543..6b3f780 100644
--- a/libavcodec/x86/diracdsp.asm
+++ b/libavcodec/x86/diracdsp.asm
@@ -303,24 +303,30 @@ cglobal dequant_subband_32, 7, 7, 4, src, dst, stride, 
qf, qs, tot_v, tot_h
 
 RET
 
-%if ARCH_X86_64 == 1
+INIT_XMM sse4
 ; void put_signed_rect_clamped_10(uint8_t *dst, int dst_stride, const uint8_t 
*src, int src_stride, int width, int height)
-cglobal put_signed_rect_clamped_10, 6, 9, 6, dst, dst_stride, src, src_stride, 
w, h
-mov  r6, srcq
-mov  r7, dstq
-mov  r8, wq
+%if ARCH_X86_64
+cglobal put_signed_rect_clamped_10, 6, 8, 5, dst, dst_stride, src, src_stride, 
w, h, t1, t2
+%else
+cglobal put_signed_rect_clamped_10, 5, 7, 5, dst, dst_stride, src, src_stride, 
w, t1, t2
+%define  hd  r5mp
+%endif
+shl  wd, 2
+addsrcq, wq
+neg  wq
+mov t2q, dstq
+mov t1q, wq
 pxor m2, m2
 mova m3, [clip_10bit]
 mova m4, [convert_to_unsigned_10bit]
 
 .loop_h:
-mov  srcq, r6
-mov  dstq, r7
-mov  wq,   r8
+movdstq, t2q
+mov  wq, t1q
 
 .loop_w:
-movu m0, [srcq+0*mmsize]
-movu m1, [srcq+1*mmsize]
+movu m0, [srcq+wq+0*mmsize]
+movu m1, [srcq+wq+1*mmsize]
 
 padddm0, m4
 padddm1, m4
@@ -329,16 +335,13 @@ cglobal put_signed_rect_clamped_10, 6, 9, 6, dst, 
dst_stride, src, src_stride, w
 
 movu [dstq], m0
 
-add  srcq, 2*mmsize
 add  dstq, 1*mmsize
-sub  wd, 8
-jg   .loop_w
+add  wq,   2*mmsize
+jl   .loop_w
 
-add  r6, src_strideq
-add  r7, dst_strideq
+addsrcq, src_strideq
+add t2q, dst_strideq
 sub  hd, 1
 jg   .loop_h
 
 RET
-
-%endif
diff --git a/libavcodec/x86/diracdsp_init.c b/libavcodec/x86/diracdsp_init.c
index d7c7cd1..b195113 100644
--- a/libavcodec/x86/diracdsp_init.c
+++ b/libavcodec/x86/diracdsp_init.c
@@ -45,9 +45,7 @@ void ff_put_rect_clamped_mmx(uint8_t *dst, int dst_stride, 
const int16_t *src, i
 void ff_put_rect_clamped_sse2(uint8_t *dst, int dst_stride, const int16_t 
*src, int src_stride, int width, int height);
 void ff_put_signed_rect_clamped_mmx(uint8_t *dst, int dst_stride, const 
int16_t *src, int src_stride, int width, int height);
 void ff_put_signed_rect_clamped_sse2(uint8_t *dst, int dst_stride, const 
int16_t *src, int src_stride, int width, int height);
-#if ARCH_X86_64
 void ff_put_signed_rect_clamped_10_sse4(uint8_t *dst, int dst_stride, const 
uint8_t *src, int src_stride, int width, int height);
-#endif
 
 void ff_dequant_subband_32_sse4(uint8_t *src, uint8_t *dst, ptrdiff_t stride, 
const int qf, const int qs, int tot_v, int tot_h);
 
@@ -192,8 +190,6 @@ void ff_diracdsp_init_x86(DiracDSPContext* c)
 
 if (EXTERNAL_SSE4(mm_flags)) {
 c->dequant_subband[1] = ff_dequant_subband_32_sse4;
-#if ARCH_X86_64
 c->put_signed_rect_clamped[1] = ff_put_signed_rect_clamped_10_sse4;
-#endif
 }
 }
-- 
2.9.1

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


Re: [FFmpeg-devel] [PATCH] fate: add test for chorus filter

2016-07-19 Thread Michael Niedermayer
On Tue, Jul 19, 2016 at 07:37:16PM +, Petru Rares Sincraian wrote:
> 
> Hi there,
> 
> Here is a patch for the chorus filter. I tested on x64 and x86.
> 
> 
> Regards,
> Petru Rares.

>  fate/filter-audio.mak  |5 +
>  ref/fate/filter-chorus |   15 +++
>  2 files changed, 20 insertions(+)
> ecb2b496de8f11976bd81ba8857578acc3c2d2c4  
> 0001-fate-add-test-for-chorus-filter.patch
> From 4a06b5da1e4b3a3dcf8a8df09f650d2545fade6d Mon Sep 17 00:00:00 2001
> From: Petru Rares Sincraian 
> Date: Tue, 19 Jul 2016 21:18:08 +0200
> Subject: [PATCH] fate: add test for chorus filter

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH] avformat/avlanguage: deprecate av_convert_lang_to and make it internal

2016-07-19 Thread James Almer
On 5/21/2016 10:56 AM, Paul B Mahol wrote:
> On 5/21/16, James Almer  wrote:
>> On 5/13/2016 6:10 PM, James Almer wrote:
>>> The header was never installed and the function is only used in
>>> libavformat
>>>
>>> Signed-off-by: James Almer 
>>> ---
>>>  libavformat/asfdec_f.c|  2 +-
>>>  libavformat/asfdec_o.c|  2 +-
>>>  libavformat/asfenc.c  |  2 +-
>>>  libavformat/avienc.c  |  2 +-
>>>  libavformat/avlanguage.c  | 11 +--
>>>  libavformat/avlanguage.h  |  7 +++
>>>  libavformat/matroskaenc.c |  2 +-
>>>  7 files changed, 21 insertions(+), 7 deletions(-)
>>
>> Ping.
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
> 
> ok

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH 1/3] avformat/oggparsevp8: fix pts calculation on pages ending with an invisible frame

2016-07-19 Thread James Almer
On 7/18/2016 8:56 PM, Michael Niedermayer wrote:
> On Mon, Jul 18, 2016 at 01:56:29PM -0300, James Almer wrote:
>> On 7/12/2016 6:36 PM, James Almer wrote:
>>> Signed-off-by: James Almer 
>>> ---
>>>  libavformat/oggparsevp8.c | 6 +-
>>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> Ping for patchset.
> 
> you are the author of the oggparsevp8 code, also i tested this a bit
> with random ogg files, seems not breaking anything

Pushed the first two patches. I'll push the third one soon if nobody
comments on it.

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


Re: [FFmpeg-devel] [PATCH] configure: add support for new CPUs

2016-07-19 Thread James Almer
On 7/18/2016 6:52 AM, Michael Niedermayer wrote:
> On Sun, Jul 17, 2016 at 07:15:30PM -0300, James Almer wrote:
>> Add new -march values for Intel and AMD CPUs introduced with GCC 5 and 6, and
>> improve SunCC flags accordingly.
>>
>> Signed-off-by: James Almer 
>> ---
>>  configure | 7 ---
>>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> LGTM
> 
> thx

Pushed.

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


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/h264_slice: Move h264_init_ps() call into h264_field_start()

2016-07-19 Thread Michael Niedermayer
On Tue, Jul 19, 2016 at 10:31:56PM +0200, Michael Niedermayer wrote:
> ---
>  libavcodec/h264_slice.c |   14 +++---
>  1 file changed, 7 insertions(+), 7 deletions(-)

patchset applied

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


Re: [FFmpeg-devel] [PATCH] fate: add test for avfft

2016-07-19 Thread Michael Niedermayer
On Tue, Jul 19, 2016 at 07:02:10PM +, Petru Rares Sincraian wrote:
> Ups, sorry again.
> 
> Here is the patch. I tested and seems to work :)

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.


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


Re: [FFmpeg-devel] [PATCH 1/3] libopenmpt: change layout option to use string

2016-07-19 Thread Josh de Kock
On Tue, Jul 19, 2016, at 10:39 PM, Hendrik Leppkes wrote:
> 
> We do have this option, so I would prefer if we keep using it.
> 
Sure, that makes sense. I'll drop this patch from the set.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] libopenmpt: change layout option to use string

2016-07-19 Thread Hendrik Leppkes
On Tue, Jul 19, 2016 at 11:33 PM, Josh de Kock  wrote:
> Libav doesn't have AV_OPT_TYPE_CHANNEL_LAYOUT
> so use strings instead to maintain consistency.

We do have this option, so I would prefer if we keep using it.

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


[FFmpeg-devel] [PATCH 2/3 v3] libopenmpt: add subsong support

2016-07-19 Thread Josh de Kock
---
 libavformat/libopenmpt.c | 26 +++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 17eb611..d52ebd6 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -43,9 +43,12 @@ typedef struct OpenMPTContext {
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define D AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
-{"sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{.i64 = 48000},1000, INT_MAX,   A | D},
-{"layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_STRING, {.i64 = .str = "stereo"}, 0, INT64_MAX, A | D},
-{NULL}
+{ "sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{ .i64 = 48000 },1000, INT_MAX, A | D },
+{ "layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_STRING, { .str = "stereo" }, 0,0,   A | D },
+{ "subsong", "set subsong",OFFSET(subsong), 
AV_OPT_TYPE_INT,{ .i64 = -2 },   -2,   INT_MAX, A | D, "layout"},
+{ "all", "all",0,   
AV_OPT_TYPE_CONST,  { .i64 = -1},0,0,   A | D, "layout" },
+{ "auto","auto",   0,   
AV_OPT_TYPE_CONST,  { .i64 = -2},0,0,   A | D, "layout" },
+{ NULL }
 };
 
 static void openmpt_logfunc(const char *message, void *userdata)
@@ -72,6 +75,7 @@ static int read_header_openmpt(AVFormatContext *s)
 int64_t size = avio_size(s->pb);
 char *buf = av_malloc(size);
 int64_t layout;
+int ret;
 
 if (!buf)
 return AVERROR(ENOMEM);
@@ -96,6 +100,22 @@ static int read_header_openmpt(AVFormatContext *s)
 add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
"tracker"));
 add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
"message"));
 
+if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
+av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", 
openmpt->subsong);
+return AVERROR(EINVAL);
+}
+
+if (openmpt->subsong != -2) {
+if (openmpt->subsong >= 0) {
+av_dict_set_int(>metadata, "track", openmpt->subsong + 1, 0);
+}
+ret = openmpt_module_select_subsong(openmpt->module, openmpt->subsong);
+if (!ret){
+av_log(s, AV_LOG_ERROR, "Could not select requested subsong: %d", 
openmpt->subsong);
+return AVERROR(EINVAL);   
+}
+}
+
 st = avformat_new_stream(s, NULL);
 if (!st) {
 openmpt_module_destroy(openmpt->module);
-- 
2.7.4 (Apple Git-66)

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


[FFmpeg-devel] [PATCH 3/3 v2] docs/demuxers: add libopenmpt section

2016-07-19 Thread Josh de Kock
---
 doc/demuxers.texi | 27 +++
 1 file changed, 27 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index e34f8b3..69890c8 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -267,6 +267,33 @@ track. Track indexes start at 0. The demuxer exports the 
number of tracks as
 
 For very large files, the @option{max_size} option may have to be adjusted.
 
+@section libopenmpt
+
+libopenmpt based module demuxer
+
+See @url{https://lib.openmpt.org/libopenmpt/} for more information.
+
+Some files have multiple subsongs (tracks) this can be set with the 
@option{subsong}
+option.
+
+It accepts the following options:
+
+@table @option
+@item subsong
+Set the subsong index. This can be either  'all', 'auto', or the index of the
+subsong. Subsong indexes start at 0. The default is 'auto'.
+
+The default value is to let libopenmpt choose.
+
+@item layout
+Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
+The default value is STEREO.
+
+@item sample_rate
+Set the sample rate for libopenmpt to output.
+Range is from 1000 to INT_MAX. The value default is 48000.
+@end table
+
 @section gif
 
 Animated GIF demuxer.
-- 
2.7.4 (Apple Git-66)

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


[FFmpeg-devel] [PATCH 1/3] libopenmpt: change layout option to use string

2016-07-19 Thread Josh de Kock
Libav doesn't have AV_OPT_TYPE_CHANNEL_LAYOUT
so use strings instead to maintain consistency.
---
 libavformat/libopenmpt.c | 18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 58a02be..17eb611 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -35,15 +35,16 @@ typedef struct OpenMPTContext {
 double duration;
 /* options */
 int sample_rate;
-int64_t layout;
+const char *layout;
+int subsong;
 } OpenMPTContext;
 
 #define OFFSET(x) offsetof(OpenMPTContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define D AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
-{"sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{.i64 = 48000},   1000, INT_MAX,   
A|D},
-{"layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = AV_CH_LAYOUT_STEREO}, 0,INT64_MAX, 
A|D},
+{"sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{.i64 = 48000},1000, INT_MAX,   A | D},
+{"layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_STRING, {.i64 = .str = "stereo"}, 0, INT64_MAX, A | D},
 {NULL}
 };
 
@@ -70,17 +71,24 @@ static int read_header_openmpt(AVFormatContext *s)
 OpenMPTContext *openmpt = s->priv_data;
 int64_t size = avio_size(s->pb);
 char *buf = av_malloc(size);
+int64_t layout;
 
 if (!buf)
 return AVERROR(ENOMEM);
 size = avio_read(s->pb, buf, size);
 
+layout = av_get_channel_layout(openmpt->layout);
+if (!layout){
+av_log(s, AV_LOG_ERROR, "Invalid channel layout: %s\n", 
openmpt->layout);
+return AVERROR(EINVAL);
+}
+
 openmpt->module = openmpt_module_create_from_memory(buf, size, 
openmpt_logfunc, s, NULL);
 av_freep();
 if (!openmpt->module)
-return AVERROR_INVALIDDATA;
+return AVERROR_INVALIDDATA;
 
-openmpt->channels   = av_get_channel_layout_nb_channels(openmpt->layout);
+openmpt->channels   = av_get_channel_layout_nb_channels(layout);
 openmpt->duration   = openmpt_module_get_duration_seconds(openmpt->module);
 
 add_meta(s, "artist",  openmpt_module_get_metadata(openmpt->module, 
"artist"));
-- 
2.7.4 (Apple Git-66)

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


[FFmpeg-devel] [PATCH 1/2] avcodec/h264_slice: Move h264_init_ps() call into h264_field_start()

2016-07-19 Thread Michael Niedermayer
---
 libavcodec/h264_slice.c |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 2562041..ee7dedb 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1128,13 +1128,17 @@ static int h264_init_ps(H264Context *h, const 
H264SliceContext *sl, int first_sl
  * or a second field in a pair and does the necessary setup.
  */
 static int h264_field_start(H264Context *h, const H264SliceContext *sl,
-const H2645NAL *nal)
+const H2645NAL *nal, int first_slice)
 {
 int i;
 const SPS *sps;
 
 int last_pic_structure, last_pic_droppable, ret;
 
+ret = h264_init_ps(h, sl, first_slice);
+if (ret < 0)
+return ret;
+
 sps = h->ps.sps;
 
 last_pic_droppable   = h->droppable;
@@ -1452,11 +1456,6 @@ static int h264_slice_header_parse(H264Context *h, 
H264SliceContext *sl,
 }
 }
 
-// TODO: should probably be moved to h264_field_start()
-ret = h264_init_ps(h, sl, first_slice);
-if (ret < 0)
-return ret;
-
 sps = (const SPS*)h->ps.sps_list[pps->sps_id]->data;
 
 frame_num = get_bits(>gb, sps->log2_max_frame_num);
@@ -1661,13 +1660,14 @@ int ff_h264_decode_slice_header(H264Context *h, 
H264SliceContext *sl,
 const H2645NAL *nal)
 {
 int i, j, ret = 0;
+int first_slice = sl == h->slice_ctx && !h->current_slice;
 
 ret = h264_slice_header_parse(h, sl, nal);
 if (ret) // can not be ret<0 because of SLICE_SKIPED, SLICE_SINGLETHREAD, 
...
 return ret;
 
 if (h->current_slice == 0) {
-ret = h264_field_start(h, sl, nal);
+ret = h264_field_start(h, sl, nal, first_slice);
 if (ret < 0)
 return ret;
 }
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH 2/2] avcodec/h264: remove list_count and ref_count clearing

2016-07-19 Thread Michael Niedermayer
The code conflicts with moving the h264_init_ps() call point

Signed-off-by: Michael Niedermayer 
---
 libavcodec/h264.c  |2 --
 libavcodec/h264_refs.c |5 -
 2 files changed, 7 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index f79735b..db68c05 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -776,8 +776,6 @@ void ff_h264_flush_change(H264Context *h)
 h->frame_recovered = 0;
 h->current_slice = 0;
 h->mmco_reset = 1;
-for (i = 0; i < h->nb_slice_ctx; i++)
-h->slice_ctx[i].list_count = 0;
 }
 
 /* forget old pics after a seek */
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 7fafb82..6bac897a 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -581,11 +581,6 @@ void ff_h264_remove_all_refs(H264Context *h)
 h->short_ref_count = 0;
 
 memset(h->default_ref, 0, sizeof(h->default_ref));
-for (i = 0; i < h->nb_slice_ctx; i++) {
-H264SliceContext *sl = >slice_ctx[i];
-sl->list_count = sl->ref_count[0] = sl->ref_count[1] = 0;
-memset(sl->ref_list, 0, sizeof(sl->ref_list));
-}
 }
 
 static void generate_sliding_window_mmcos(H264Context *h)
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] vp9: add mxext versions of the single-block (w=8, npx=8) h/v loopfilters.

2016-07-19 Thread Ronald S. Bultje
Each takes about 0.1% of runtime in my profiles, and they didn't have
any SIMD yet so far (we only had simd for npx=16 double-block versions).
---
 libavcodec/x86/vp9dsp_init.c |  3 ++
 libavcodec/x86/vp9lpf.asm| 99 +++-
 2 files changed, 63 insertions(+), 39 deletions(-)

diff --git a/libavcodec/x86/vp9dsp_init.c b/libavcodec/x86/vp9dsp_init.c
index 359d38e..cc781a0 100644
--- a/libavcodec/x86/vp9dsp_init.c
+++ b/libavcodec/x86/vp9dsp_init.c
@@ -127,6 +127,7 @@ void ff_vp9_loop_filter_h_##size1##_##size2##_##opt(uint8_t 
*dst, ptrdiff_t stri
 int E, int I, int H)
 
 lpf_funcs(4, 8, mmxext);
+lpf_funcs(8, 8, mmxext);
 lpf_funcs(16, 16, sse2);
 lpf_funcs(16, 16, ssse3);
 lpf_funcs(16, 16, avx);
@@ -284,6 +285,8 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int 
bpp, int bitexact)
 if (EXTERNAL_MMXEXT(cpu_flags)) {
 dsp->loop_filter_8[0][0] = ff_vp9_loop_filter_h_4_8_mmxext;
 dsp->loop_filter_8[0][1] = ff_vp9_loop_filter_v_4_8_mmxext;
+dsp->loop_filter_8[1][0] = ff_vp9_loop_filter_h_8_8_mmxext;
+dsp->loop_filter_8[1][1] = ff_vp9_loop_filter_v_8_8_mmxext;
 init_subpel2(4, 0, 4, put, 8, mmxext);
 init_subpel2(4, 1, 4, avg, 8, mmxext);
 init_fpel_func(4, 1,  4, avg, _8, mmxext);
diff --git a/libavcodec/x86/vp9lpf.asm b/libavcodec/x86/vp9lpf.asm
index 56bba4d..4e7ede22 100644
--- a/libavcodec/x86/vp9lpf.asm
+++ b/libavcodec/x86/vp9lpf.asm
@@ -112,27 +112,27 @@ SECTION .text
 
 %macro FILTER_SUBx2_ADDx2 11 ; %1=dst %2=h/l %3=cache %4=stack_off %5=sub1 
%6=sub2 %7=add1
  ; %8=add2 %9=rshift, [unpack], 
[unpack_is_mem_on_x86_32]
-psubw   %3, [rsp+%4+%5*32]
-psubw   %3, [rsp+%4+%6*32]
-paddw   %3, [rsp+%4+%7*32]
+psubw   %3, [rsp+%4+%5*mmsize*2]
+psubw   %3, [rsp+%4+%6*mmsize*2]
+paddw   %3, [rsp+%4+%7*mmsize*2]
 %ifnidn %10, ""
 %if %11 == 0
 punpck%2bw  %1, %10, m0
 %else
 UNPACK  %2, %1, %10, m0
 %endif
-mova[rsp+%4+%8*32], %1
+mova [rsp+%4+%8*mmsize*2], %1
 paddw   %3, %1
 %else
-paddw   %3, [rsp+%4+%8*32]
+paddw   %3, [rsp+%4+%8*mmsize*2]
 %endif
 psraw   %1, %3, %9
 %endmacro
 
 ; FIXME interleave l/h better (for instruction pairing)
 %macro FILTER_INIT 9 ; tmp1, tmp2, cacheL, cacheH, dstp, stack_off, filterid, 
mask, source
-FILTER%7_INIT   %1, l, %3, %6 +  0
-FILTER%7_INIT   %2, h, %4, %6 + 16
+FILTER%7_INIT   %1, l, %3, %6 +  0
+FILTER%7_INIT   %2, h, %4, %6 + mmsize
 packuswb%1, %2
 MASK_APPLY  %1, %9, %8, %2
 mova%5, %1
@@ -147,8 +147,8 @@ SECTION .text
 mova   %14, %15
 %endif
 %endif
-FILTER_SUBx2_ADDx2  %1, l, %3, %6 +  0, %7, %8, %9, %10, %11, %14, %16
-FILTER_SUBx2_ADDx2  %2, h, %4, %6 + 16, %7, %8, %9, %10, %11, %14, %16
+FILTER_SUBx2_ADDx2  %1, l, %3, %6 +  0, %7, %8, %9, %10, %11, %14, %16
+FILTER_SUBx2_ADDx2  %2, h, %4, %6 + mmsize, %7, %8, %9, %10, %11, %14, %16
 packuswb%1, %2
 %ifnidn %13, ""
 MASK_APPLY  %1, %13, %12, %2
@@ -195,21 +195,21 @@ SECTION .text
 
 %macro FILTER6_INIT 4 ; %1=dst %2=h/l %3=cache, %4=stack_off
 UNPACK  %2, %1, rp3, m0 ; p3: B->W
-mova [rsp+%4+0*32], %1
+mova [rsp+%4+0*mmsize*2], %1
 paddw   %3, %1, %1  ; p3*2
 paddw   %3, %1  ; p3*3
 punpck%2bw  %1, m1,  m0 ; p2: B->W
-mova [rsp+%4+1*32], %1
+mova [rsp+%4+1*mmsize*2], %1
 paddw   %3, %1  ; p3*3 + p2
 paddw   %3, %1  ; p3*3 + p2*2
 UNPACK  %2, %1, rp1, m0 ; p1: B->W
-mova [rsp+%4+2*32], %1
+mova [rsp+%4+2*mmsize*2], %1
 paddw   %3, %1  ; p3*3 + p2*2 + p1
 UNPACK  %2, %1, rp0, m0 ; p0: B->W
-mova [rsp+%4+3*32], %1
+mova [rsp+%4+3*mmsize*2], %1
 paddw   %3, %1  ; p3*3 + p2*2 + p1 + p0
 UNPACK  %2, %1, rq0, m0 ; q0: B->W
-mova [rsp+%4+4*32], %1
+mova [rsp+%4+4*mmsize*2], %1
 paddw   %3, %1  ; p3*3 + p2*2 + p1 + 
p0 + q0
 paddw   %3, [pw_4]  ; p3*3 + p2*2 + p1 + 
p0 + q0 + 4
 psraw   %1, %3, 3   ; (p3*3 + p2*2 + p1 + 
p0 + q0 + 4) >> 3
@@ -217,24 +217,24 @@ SECTION .text
 
 %macro FILTER14_INIT 4 ; %1=dst %2=h/l %3=cache, %4=stack_off
 punpck%2bw  %1, m2, m0  ; p7: B->W
-mova[rsp+%4+ 8*32], %1
+

[FFmpeg-devel] [PATCH] fate: add test for chorus filter

2016-07-19 Thread Petru Rares Sincraian

Hi there,

Here is a patch for the chorus filter. I tested on x64 and x86.


Regards,
Petru Rares.From 4a06b5da1e4b3a3dcf8a8df09f650d2545fade6d Mon Sep 17 00:00:00 2001
From: Petru Rares Sincraian 
Date: Tue, 19 Jul 2016 21:18:08 +0200
Subject: [PATCH] fate: add test for chorus filter

---
 tests/fate/filter-audio.mak  |  5 +
 tests/ref/fate/filter-chorus | 15 +++
 2 files changed, 20 insertions(+)
 create mode 100644 tests/ref/fate/filter-chorus

diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak
index 1a52320..21f68ee 100644
--- a/tests/fate/filter-audio.mak
+++ b/tests/fate/filter-audio.mak
@@ -94,6 +94,11 @@ fate-filter-asetrate: tests/data/asynth-44100-2.wav
 fate-filter-asetrate: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.wav
 fate-filter-asetrate: CMD = framecrc -i $(SRC) -aframes 20 -af asetrate=2
 
+FATE_AFILTER-$(call FILTERDEMDECENCMUX, CHORUS, WAV, PCM_S16LE, PCM_S16LE, WAV) += fate-filter-chorus
+fate-filter-chorus: tests/data/asynth-22050-1.wav
+fate-filter-chorus: SRC = $(TARGET_PATH)/tests/data/asynth-22050-1.wav
+fate-filter-chorus: CMD = framecrc -i $(SRC) -aframes 10 -af chorus=0.5:0.5:64:0.5:0.25:2
+
 tests/data/hls-list.m3u8: TAG = GEN
 tests/data/hls-list.m3u8: ffmpeg$(PROGSSUF)$(EXESUF) | tests/data
 	$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
diff --git a/tests/ref/fate/filter-chorus b/tests/ref/fate/filter-chorus
new file mode 100644
index 000..777a378
--- /dev/null
+++ b/tests/ref/fate/filter-chorus
@@ -0,0 +1,15 @@
+#tb 0: 1/22050
+#media_type 0: audio
+#codec_id 0: pcm_s16le
+#sample_rate 0: 22050
+#channel_layout 0: 4
+0,  0,  0, 2048, 4096, 0x4cd2fbdf
+0,   2048,   2048, 2048, 4096, 0x233cfca2
+0,   4096,   4096, 2048, 4096, 0xf43af2b0
+0,   6144,   6144, 2048, 4096, 0xea6eff9f
+0,   8192,   8192, 2048, 4096, 0xa5ecf6a0
+0,  10240,  10240, 2048, 4096, 0x40d4f3b1
+0,  12288,  12288, 2048, 4096, 0x6b2bf76b
+0,  14336,  14336, 2048, 4096, 0xf19df862
+0,  16384,  16384, 2048, 4096, 0x736ef763
+0,  18432,  18432, 2048, 4096, 0x93b6f640
-- 
1.9.1

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


[FFmpeg-devel] [PATCH] vp9: add mxext versions of the single-block (w=8, npx=8) h/v loopfilters.

2016-07-19 Thread Ronald S. Bultje
Each takes about 0.1% of runtime in my profiles, and they didn't have
any SIMD yet so far (we only had simd for npx=16 double-block versions).
---
 libavcodec/x86/vp9dsp_init.c |  3 +++
 libavcodec/x86/vp9lpf.asm| 40 
 2 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/libavcodec/x86/vp9dsp_init.c b/libavcodec/x86/vp9dsp_init.c
index 359d38e..cc781a0 100644
--- a/libavcodec/x86/vp9dsp_init.c
+++ b/libavcodec/x86/vp9dsp_init.c
@@ -127,6 +127,7 @@ void ff_vp9_loop_filter_h_##size1##_##size2##_##opt(uint8_t 
*dst, ptrdiff_t stri
 int E, int I, int H)
 
 lpf_funcs(4, 8, mmxext);
+lpf_funcs(8, 8, mmxext);
 lpf_funcs(16, 16, sse2);
 lpf_funcs(16, 16, ssse3);
 lpf_funcs(16, 16, avx);
@@ -284,6 +285,8 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int 
bpp, int bitexact)
 if (EXTERNAL_MMXEXT(cpu_flags)) {
 dsp->loop_filter_8[0][0] = ff_vp9_loop_filter_h_4_8_mmxext;
 dsp->loop_filter_8[0][1] = ff_vp9_loop_filter_v_4_8_mmxext;
+dsp->loop_filter_8[1][0] = ff_vp9_loop_filter_h_8_8_mmxext;
+dsp->loop_filter_8[1][1] = ff_vp9_loop_filter_v_8_8_mmxext;
 init_subpel2(4, 0, 4, put, 8, mmxext);
 init_subpel2(4, 1, 4, avg, 8, mmxext);
 init_fpel_func(4, 1,  4, avg, _8, mmxext);
diff --git a/libavcodec/x86/vp9lpf.asm b/libavcodec/x86/vp9lpf.asm
index 56bba4d..b25fb1c 100644
--- a/libavcodec/x86/vp9lpf.asm
+++ b/libavcodec/x86/vp9lpf.asm
@@ -650,7 +650,7 @@ cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 + %4 
+ %5, dst, stride, m
 ABSSUB_GT   m1, rp2, rp0, m6, m5, rb80  ; abs(p2 - p0) <= 1
 por m2, m1
 ABSSUB  m4, rp1, rp0, m5; abs(p1 - p0)
-%if %2 == 16
+%if %2 <= 16
 %if cpuflag(ssse3)
 pxorm0, m0
 %endif
@@ -855,7 +855,7 @@ cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 + %4 
+ %5, dst, stride, m
 ; filter6()
 %if %2 != 44 && %2 != 4
 pxorm0, m0
-%if %2 > 16
+%if %2 != 16
 pandm3, m2
 %else
 pandm2, m3  ;   
mask(fm) & mask(in)
@@ -1102,12 +1102,12 @@ cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 
+ %4 + %5, dst, stride, m
 movam3, [P0]
 movam4, [Q0]
 movam5, [Q1]
-%if ARCH_X86_64
+%ifdef m8
 movam6, [Q2]
 %endif
 movam7, [Q3]
 DEFINE_REAL_P7_TO_Q7
-%if ARCH_X86_64
+%ifdef m8
 SBUTTERFLY  bw,  0,  1, 8
 SBUTTERFLY  bw,  2,  3, 8
 SBUTTERFLY  bw,  4,  5, 8
@@ -1122,27 +1122,32 @@ cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 
+ %4 + %5, dst, stride, m
 SBUTTERFLY  dq,  3,  7, 8
 %else
 SBUTTERFLY  bw,  0,  1, 6
-mova  [rsp+64], m1
-movam6, [rsp+96]
+mova [rsp+mmsize*4], m1
+movam6, [rsp+mmsize*6]
 SBUTTERFLY  bw,  2,  3, 1
 SBUTTERFLY  bw,  4,  5, 1
 SBUTTERFLY  bw,  6,  7, 1
 SBUTTERFLY  wd,  0,  2, 1
-mova  [rsp+96], m2
-movam1, [rsp+64]
+mova [rsp+mmsize*6], m2
+movam1, [rsp+mmsize*4]
 SBUTTERFLY  wd,  1,  3, 2
 SBUTTERFLY  wd,  4,  6, 2
 SBUTTERFLY  wd,  5,  7, 2
 SBUTTERFLY  dq,  0,  4, 2
 SBUTTERFLY  dq,  1,  5, 2
+%if mmsize == 16
 movh  [Q0], m1
 movhps[Q1], m1
-movam2, [rsp+96]
+%else
+mova  [P3], m1
+%endif
+movam2, [rsp+mmsize*6]
 SBUTTERFLY  dq,  2,  6, 1
 SBUTTERFLY  dq,  3,  7, 1
 %endif
 SWAP 3, 6
 SWAP 1, 4
+%if mmsize == 16
 movh  [P7], m0
 movhps[P6], m0
 movh  [P5], m1
@@ -1151,7 +1156,7 @@ cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 + 
%4 + %5, dst, stride, m
 movhps[P2], m2
 movh  [P1], m3
 movhps[P0], m3
-%if ARCH_X86_64
+%ifdef m8
 movh  [Q0], m4
 movhps[Q1], m4
 %endif
@@ -1161,6 +1166,15 @@ cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 + 
%4 + %5, dst, stride, m
 movhps[Q5], m6
 movh  [Q6], m7
 movhps[Q7], m7
+%else
+mova  [P7], m0
+mova  [P6], m1
+mova  [P5], m2
+mova  [P4], m3
+mova  [P2], m5
+mova  [P1], m6
+mova  [P0], m7
+%endif
 %endif
 %endif
 
@@ -1186,5 +1200,7 @@ LPF_16_VH_ALL_OPTS 84, 256, 128, 16
 LPF_16_VH_ALL_OPTS 88, 256, 128, 16
 
 INIT_MMX mmxext
-LOOPFILTER v, 4, 0,  0, 0
-LOOPFILTER h, 4, 0, 64, 0
+LOOPFILTER v, 4,   0,  0, 0
+LOOPFILTER h, 4,   0, 64, 0
+LOOPFILTER v, 8, 128,  0, 8
+LOOPFILTER h, 8, 128, 64, 8
-- 
2.8.1

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


Re: [FFmpeg-devel] [PATCH] fate: add test for avfft

2016-07-19 Thread Petru Rares Sincraian
Ups, sorry again.

Here is the patch. I tested and seems to work :)



From: ffmpeg-devel  on behalf of Michael 
Niedermayer 
Sent: Tuesday, July 19, 2016 12:38:36 AM
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] [PATCH] fate: add test for avfft

On Mon, Jul 18, 2016 at 03:27:12PM +, Petru Rares Sincraian wrote:
> Hi,
>
>
> Here is the rest of the test. I changed the tabs to spaces, sorry for this.

it seems this doesnt build

make distclean ; ./configure && make -j12 fate

tests/api/api-seek-test.c: In function ‘main’:
tests/api/api-seek-test.c:246:36: warning: ‘j’ may be used uninitialized in 
this function [-Wuninitialized]
tests/api/api-seek-test.c:183:12: note: ‘j’ was declared here
tests/api/api-seek-test.c:246:36: warning: ‘i’ may be used uninitialized in 
this function [-Wuninitialized]
tests/api/api-seek-test.c:183:9: note: ‘i’ was declared here
...
libavcodec/tests/fft.c:656:6: warning: "AVFFT" is not defined [-Wundef]
libavcodec/tests/fft.c:659:13: error: ‘r’ undeclared (first use in this 
function)
libavcodec/tests/fft.c:659:13: note: each undeclared identifier is reported 
only once for each function it appears in
libavcodec/tests/fft.c:660:13: error: ‘d’ undeclared (first use in this 
function)

>
>
>
> Thanks,
>
> Petru Rares.
>
> 
> From: ffmpeg-devel  on behalf of Michael 
> Niedermayer 
> Sent: Saturday, July 16, 2016 3:22:24 PM
> To: FFmpeg development discussions and patches
> Subject: Re: [FFmpeg-devel] [PATCH] fate: add test for avfft
>
> On Fri, Jul 15, 2016 at 02:07:08PM +, Petru Rares Sincraian wrote:
> > Hi there,
> >
> > Here is a patch that changes the avfft test. This test is similar to 
> > libavcodec/tests/fft-fixed.c. I modified libavcodec/tests/fft.c a bit to 
> > adapt to make use of the new abi. At the moment I only did test for fft and 
> > mdct, If no more suggestions then I'll do tests for the remaining modules.
>
> its a bit difficult to test with just fft and mdct but the code overall
> looks good to me
>
> there are also a few stray tabs in there, they should be replaced by
> spaces as tabs cannot be pushed to git master
>
> thx

[...]

--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.
From 01951de1de141c10e92722f8a14cf7795a8c7d83 Mon Sep 17 00:00:00 2001
From: Petru Rares Sincraian 
Date: Mon, 4 Jul 2016 17:23:14 +0200
Subject: [PATCH] fate: add test for avfft

---
 libavcodec/tests/avfft.c   |  40 ++--
 libavcodec/tests/fft-fixed.c   |   1 +
 libavcodec/tests/fft-fixed32.c |   1 +
 libavcodec/tests/fft.c | 201 -
 tests/fate/fft.mak |  33 ++-
 5 files changed, 216 insertions(+), 60 deletions(-)

diff --git a/libavcodec/tests/avfft.c b/libavcodec/tests/avfft.c
index 6bc48ea..22aa99a 100644
--- a/libavcodec/tests/avfft.c
+++ b/libavcodec/tests/avfft.c
@@ -16,38 +16,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
-#include "libavutil/mem.h"
-#include "libavcodec/avfft.h"
-
-int main(int argc, char **argv)
-{
-int i;
-#define LEN 1024
-FFTSample *ref  = av_malloc_array(LEN, sizeof(*ref));
-FFTSample *data = av_malloc_array(LEN, sizeof(*data));
-RDFTContext *rdft_context  = av_rdft_init(10, DFT_R2C);
-RDFTContext *irdft_context = av_rdft_init(10, IDFT_C2R);
-
-if (!ref || !data || !rdft_context || !irdft_context)
-return 2;
-for (i=0; i 1) {
-fprintf(stderr, "Failed at %d (%f %f)\n", i, ref[i], data[i]/LEN*2);
-return 1;
-}
-}
-
-av_rdft_end(rdft_context);
-av_rdft_end(irdft_context);
-av_free(data);
-av_free(ref);
+/*
+ * This test is similar to fft-fixed.c or fft-fixed32.c
+ */
 
-return 0;
-}
+#define AVFFT 1
+#define FFT_FLOAT 1
+#include "fft.c"
diff --git a/libavcodec/tests/fft-fixed.c b/libavcodec/tests/fft-fixed.c
index fe1b57a..3c50bf1 100644
--- a/libavcodec/tests/fft-fixed.c
+++ b/libavcodec/tests/fft-fixed.c
@@ -17,4 +17,5 @@
  */
 
 #define FFT_FLOAT 0
+#define AVFFT 0
 #include "fft.c"
diff --git a/libavcodec/tests/fft-fixed32.c b/libavcodec/tests/fft-fixed32.c
index f33494f..9fadd8a 100644
--- a/libavcodec/tests/fft-fixed32.c
+++ b/libavcodec/tests/fft-fixed32.c
@@ -18,4 +18,5 @@
 
 #define FFT_FLOAT 0
 #define FFT_FIXED_32 1
+#define AVFFT 0
 #include "fft.c"
diff --git a/libavcodec/tests/fft.c b/libavcodec/tests/fft.c
index 4717303..1ce964e 100644
--- a/libavcodec/tests/fft.c

[FFmpeg-devel] [PATCH] avfilter: Add max stats to PSNR log

2016-07-19 Thread Lucas Cooper
This allows retroactive aggregation of the PSNR statistics (e.g.
calculating average PSNR for entire video or a segment of the video).
---
 libavfilter/vf_psnr.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavfilter/vf_psnr.c b/libavfilter/vf_psnr.c
index 89acd3c..f3dff62 100644
--- a/libavfilter/vf_psnr.c
+++ b/libavfilter/vf_psnr.c
@@ -180,6 +180,11 @@ static AVFrame *do_psnr(AVFilterContext *ctx, AVFrame 
*main,
 fprintf(s->stats_file, "psnr_%c:%0.2f ", s->comps[j],
 get_psnr(comp_mse[c], 1, s->max[c]));
 }
+fprintf(s->stats_file, "max_avg:%d ", s->average_max);
+for (j = 0; j < s->nb_components; j++) {
+c = s->is_rgb ? s->rgba_map[j] : j;
+fprintf(s->stats_file, "max_%c:%d ", s->comps[j], s->max[c]);
+}
 fprintf(s->stats_file, "\n");
 }
 
-- 
2.8.0.rc3.226.g39d4020

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


Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: implement floating point decoding

2016-07-19 Thread Umair Khan
Updated patch.

On Tue, Jul 19, 2016 at 8:19 PM, Thilo Borgmann  wrote:
> Am 19.07.16 um 15:42 schrieb Umair Khan:
>> On Tue, Jul 19, 2016 at 5:20 PM, Thilo Borgmann  
>> wrote:
>>> Am 19.07.16 um 09:22 schrieb Umair Khan:
 On Tue, Jul 19, 2016 at 12:29 PM, Paul B Mahol  wrote:
>
> On 7/19/16, Umair Khan  wrote:
>> On Tue, Jul 19, 2016 at 3:08 AM, Michael Niedermayer
>>  wrote:
>>> On Mon, Jul 18, 2016 at 11:42:48PM +0530, Umair Khan wrote:
 On Sun, Jul 17, 2016 at 3:38 PM, Michael Niedermayer
  wrote:
> On Sun, Jul 17, 2016 at 11:54:49AM +0200, Michael Niedermayer wrote:
>> On Sun, Jul 17, 2016 at 09:00:48AM +0530, Umair Khan wrote:
>>> Hi,
>>>
>>> On Sun, Jul 17, 2016 at 12:25 AM, Thilo Borgmann
>>>  wrote:
 Hi,

> From 70e65b26cc3f84c9c664c30808b43a5e1cf16eaa Mon Sep 17 00:00:00
> 2001
> From: Umair Khan 
> Date: Sat, 16 Jul 2016 23:52:39 +0530
> Subject: [PATCH 1/1] avcodec/alsdec: implement floating point
> decoding
>
> It conforms to RM22 version of the reference codec.
>
> Signed-off-by: Umair Khan 
> ---
>  libavcodec/Makefile   |   2 +-
>  libavcodec/alsdec.c   | 284
> +-
>  libavcodec/mlz.c  | 171 +
>  libavcodec/mlz.h  |  69 ++
>  libavutil/softfloat_ieee754.h | 115 +
>  5 files changed, 638 insertions(+), 3 deletions(-)
>  create mode 100644 libavcodec/mlz.c
>  create mode 100644 libavcodec/mlz.h
>  create mode 100644 libavutil/softfloat_ieee754.h
>
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index abef19e..a03adf5 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -163,7 +163,7 @@ OBJS-$(CONFIG_ALAC_DECODER)+=
> alac.o alac_data.o alacdsp.o
>  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
>  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
>  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
> -OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o
> mpeg4audio.o
> +OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mlz.o
> mpeg4audio.o
>  OBJS-$(CONFIG_AMRNB_DECODER)   += amrnbdec.o
> celp_filters.o   \
>celp_math.o
> acelp_filters.o \
>acelp_vectors.o
>  \
> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
> index a7e58a2..c710fc3 100644
> --- a/libavcodec/alsdec.c
> +++ b/libavcodec/alsdec.c
> @@ -35,8 +35,11 @@
>  [...]
>
> +/** multiply two softfloats and handle the rounding off
> + */
> +static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a,
> SoftFloat_IEEE754 b) {
> [...]

 Why is this in alsdec.c?
>>>
>>> This is not the actual IEEE 754 multiplication. It is as is
>>> mentioned
>>> in the reference spec.
>>> The typical one for 754 floats, I've implemented here separately -
>>> https://github.com/omerjerk/FFmpeg/commit/d6cd4bf66b9da46dd87580d7d974ce44abdcfba2#diff-4dd4b2d8d523f336fbefa96e9252187cR93
>>>
 [...]

> diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
> new file mode 100644
> index 000..cb2ed6a
> --- /dev/null
> +++ b/libavcodec/mlz.c
> [...]

> +static int input_code(GetBitContext* gb, int len) {
> +int tmp_code = 0;
> +int i;
> +for (i = 0; i < len; ++i) {
> +tmp_code += get_bits1(gb) << i;
>>>  |=
>>> should be better.
>>>
> +}
> +return tmp_code;
> +}
>>>
>>> Also, you could revert it byte-wise using ff_revert[]... if len is often 
>>> bigger
>>> than 8 that might be worth it.
>>
>> I didn't get you.
>
> tmp_code |= get_bits1(gb) << i;
>
>
>> I tried logging that variable and len is always greater than 8. So
>> what should we go with?
>> It was 9 or 10 for the file I ran. And going with the 

[FFmpeg-devel] ffbox0 server hosting

2016-07-19 Thread Clément Bœsch
Hi,

As stated in previous meeting¹ I'd like to stop paying for ffbox0. This is
not exactly an issue today for me, but I feel like it could be avoided.
There was a need for a fast solution a while ago, but it's now long past
that time (it was about one year ago), and I'd like to be discharged from
this.

So on 19th October 2016 (3 months from now), I will close the ffbox0
subscription.

Note that this is not only a money problem, it comes with a hosting
responsibility I'd like to get rid of; I'm thinking notably about the
abuse complaints I got wrt rtmpdump (because yes, this box is not only for
the FFmpeg project, but also all kind of other projects I have absolutely
0 interest in funding, hosting and taking responsibility for myself).

Regards,

[1]: https://trac.ffmpeg.org/wiki/FFmeeting/2016-05

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avformat: Add multi protocol

2016-07-19 Thread Michael Niedermayer
On Mon, Jul 18, 2016 at 04:08:59PM +0200, Nicolas George wrote:
> Le primidi 1er thermidor, an CCXXIV, Michael Niedermayer a écrit :
> > TODO: docs, version bump,
> > TODO: option passing support (as seperate commit/patch)
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/Makefile|1 +
> >  libavformat/multi.c |  134 
> > +++
> >  libavformat/protocols.c |1 +
> >  3 files changed, 136 insertions(+)
> >  create mode 100644 libavformat/multi.c
> 
> Is it similar to the tee muxer for protocols? If so, maybe use a similar
> name.

yes, renamed it to tee

> 
> > 
> > diff --git a/libavformat/Makefile b/libavformat/Makefile
> > index 6451c1c..b4dd6df 100644
> > --- a/libavformat/Makefile
> > +++ b/libavformat/Makefile
> > @@ -553,6 +553,7 @@ OBJS-$(CONFIG_ICECAST_PROTOCOL)  += icecast.o
> >  OBJS-$(CONFIG_MD5_PROTOCOL)  += md5proto.o
> >  OBJS-$(CONFIG_MMSH_PROTOCOL) += mmsh.o mms.o asf.o
> >  OBJS-$(CONFIG_MMST_PROTOCOL) += mmst.o mms.o asf.o
> > +OBJS-$(CONFIG_MULTI_PROTOCOL)+= multi.o
> >  OBJS-$(CONFIG_PIPE_PROTOCOL) += file.o
> >  OBJS-$(CONFIG_RTMP_PROTOCOL) += rtmpproto.o rtmppkt.o
> >  OBJS-$(CONFIG_RTMPE_PROTOCOL)+= rtmpproto.o rtmppkt.o
> > diff --git a/libavformat/multi.c b/libavformat/multi.c
> > new file mode 100644
> > index 000..f2e4243
> > --- /dev/null
> > +++ b/libavformat/multi.c
> > @@ -0,0 +1,134 @@
> > +/*
> > + * Multi output protocol
> > + * Copyright (c) 2016 Michael Niedermayer
> > + *
> > + * 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/avstring.h"
> > +#include "libavutil/opt.h"
> > +#include "avformat.h"
> > +#include "avio_internal.h"
> > +
> > +typedef struct ChildContext {
> > +URLContext *url_context;
> > +} ChildContext;
> > +
> > +typedef struct MultiContext {
> > +const AVClass *class;
> > +int child_count;
> > +ChildContext *child;
> > +} MultiContext;
> > +
> > +static const AVOption multi_options[] = {
> > +{ NULL }
> > +};
> > +
> > +static const AVClass multi_class = {
> > +.class_name = "multi",
> > +.item_name  = av_default_item_name,
> > +.option = multi_options,
> > +.version= LIBAVUTIL_VERSION_INT,
> > +};
> > +
> > +static const char *const child_delim = "|";
> > +
> > +static int multi_write(URLContext *h, const unsigned char *buf, int size)
> > +{
> > +MultiContext *c = h->priv_data;
> > +int i;
> > +int main_ret = size;
> > +
> > +for (i=0; ichild_count; i++) {
> > +int ret = ffurl_write(c->child[i].url_context, buf, size);
> > +if (ret < 0)
> > +main_ret = ret;
> > +}
> > +return main_ret;
> > +}
> > +
> > +static int multi_close(URLContext *h)
> > +{
> > +MultiContext *c = h->priv_data;
> > +int i;
> > +
> > +for (i=0; ichild_count; i++) {
> 
> > +ffurl_closep(>child[i].url_context);
> 
> Return value ignored

fixed

applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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


Re: [FFmpeg-devel] [PATCH] avformat: Add multi protocol

2016-07-19 Thread Michael Niedermayer
On Mon, Jul 18, 2016 at 04:58:57PM +0200, Moritz Barsnick wrote:
> On Mon, Jul 18, 2016 at 14:42:22 +0200, Michael Niedermayer wrote:
> > \ No newline at end of file
> 
> Not recommended, I guess. ;-)

fixed

thx

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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


Re: [FFmpeg-devel] [PATCH] avformat: Add multi protocol

2016-07-19 Thread Michael Niedermayer
On Mon, Jul 18, 2016 at 01:42:52PM +, Steven Liu wrote:
> LGTM
> 
> But why don't add rtmp?

added

thx

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

During times of universal deceit, telling the truth becomes a
revolutionary act. -- George Orwell


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


[FFmpeg-devel] [PATCH] vp9: add mxext versions of the single-block (w=4, npx=8) h/v loopfilters.

2016-07-19 Thread Ronald S. Bultje
Each takes about 0.5% of runtime in my profiles, and they didn't have
any SIMD yet so far (we only had simd for npx=16 double-block versions).
---
 libavcodec/x86/vp9dsp_init.c |   3 +
 libavcodec/x86/vp9lpf.asm| 149 +--
 2 files changed, 103 insertions(+), 49 deletions(-)

diff --git a/libavcodec/x86/vp9dsp_init.c b/libavcodec/x86/vp9dsp_init.c
index 10751e5..359d38e 100644
--- a/libavcodec/x86/vp9dsp_init.c
+++ b/libavcodec/x86/vp9dsp_init.c
@@ -126,6 +126,7 @@ void ff_vp9_loop_filter_v_##size1##_##size2##_##opt(uint8_t 
*dst, ptrdiff_t stri
 void ff_vp9_loop_filter_h_##size1##_##size2##_##opt(uint8_t *dst, ptrdiff_t 
stride, \
 int E, int I, int H)
 
+lpf_funcs(4, 8, mmxext);
 lpf_funcs(16, 16, sse2);
 lpf_funcs(16, 16, ssse3);
 lpf_funcs(16, 16, avx);
@@ -281,6 +282,8 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int 
bpp, int bitexact)
 }
 
 if (EXTERNAL_MMXEXT(cpu_flags)) {
+dsp->loop_filter_8[0][0] = ff_vp9_loop_filter_h_4_8_mmxext;
+dsp->loop_filter_8[0][1] = ff_vp9_loop_filter_v_4_8_mmxext;
 init_subpel2(4, 0, 4, put, 8, mmxext);
 init_subpel2(4, 1, 4, avg, 8, mmxext);
 init_fpel_func(4, 1,  4, avg, _8, mmxext);
diff --git a/libavcodec/x86/vp9lpf.asm b/libavcodec/x86/vp9lpf.asm
index 2c4fe21..56bba4d 100644
--- a/libavcodec/x86/vp9lpf.asm
+++ b/libavcodec/x86/vp9lpf.asm
@@ -52,7 +52,7 @@ mask_mix48: times 8 db 0x00
 SECTION .text
 
 %macro SCRATCH 3
-%if ARCH_X86_64
+%ifdef m8
 SWAP%1, %2
 %else
 mova  [%3], m%1
@@ -60,7 +60,7 @@ SECTION .text
 %endmacro
 
 %macro UNSCRATCH 3
-%if ARCH_X86_64
+%ifdef m8
 SWAP%1, %2
 %else
 mova   m%1, [%3]
@@ -69,7 +69,7 @@ SECTION .text
 
 ; %1 = abs(%2-%3)
 %macro ABSSUB 4 ; dst, src1 (RO), src2 (RO), tmp
-%if ARCH_X86_64
+%ifdef m8
 psubusb %1, %3, %2
 psubusb %4, %2, %3
 %else
@@ -102,7 +102,7 @@ SECTION .text
 %endmacro
 
 %macro UNPACK 4
-%if ARCH_X86_64
+%ifdef m8
 punpck%1bw  %2, %3, %4
 %else
 mova%2, %3
@@ -334,22 +334,24 @@ SECTION .text
 %endmacro
 
 %macro DEFINE_TRANSPOSED_P7_TO_Q7 0-1 0
-%define P3 rsp +   0 + %1
-%define P2 rsp +  16 + %1
-%define P1 rsp +  32 + %1
-%define P0 rsp +  48 + %1
-%define Q0 rsp +  64 + %1
-%define Q1 rsp +  80 + %1
-%define Q2 rsp +  96 + %1
-%define Q3 rsp + 112 + %1
-%define P7 rsp + 128 + %1
-%define P6 rsp + 144 + %1
-%define P5 rsp + 160 + %1
-%define P4 rsp + 176 + %1
-%define Q4 rsp + 192 + %1
-%define Q5 rsp + 208 + %1
-%define Q6 rsp + 224 + %1
-%define Q7 rsp + 240 + %1
+%define P3 rsp +  0*mmsize + %1
+%define P2 rsp +  1*mmsize + %1
+%define P1 rsp +  2*mmsize + %1
+%define P0 rsp +  3*mmsize + %1
+%define Q0 rsp +  4*mmsize + %1
+%define Q1 rsp +  5*mmsize + %1
+%define Q2 rsp +  6*mmsize + %1
+%define Q3 rsp +  7*mmsize + %1
+%if mmsize == 16
+%define P7 rsp +  8*mmsize + %1
+%define P6 rsp +  9*mmsize + %1
+%define P5 rsp + 10*mmsize + %1
+%define P4 rsp + 11*mmsize + %1
+%define Q4 rsp + 12*mmsize + %1
+%define Q5 rsp + 13*mmsize + %1
+%define Q6 rsp + 14*mmsize + %1
+%define Q7 rsp + 15*mmsize + %1
+%endif
 %endmacro
 
 ; ..AB -> 
@@ -365,12 +367,12 @@ SECTION .text
 
 %macro LOOPFILTER 5 ; %1=v/h %2=size1 %3+%4=stack, %5=32bit stack only
 %if UNIX64
-cglobal vp9_loop_filter_%1_%2_16, 5, 9, 16, %3 + %4, dst, stride, E, I, H, 
mstride, dst2, stride3, mstride3
+cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 5, 9, 16, %3 + %4, dst, stride, E, 
I, H, mstride, dst2, stride3, mstride3
 %else
 %if WIN64
-cglobal vp9_loop_filter_%1_%2_16, 4, 8, 16, %3 + %4, dst, stride, E, I, 
mstride, dst2, stride3, mstride3
+cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 4, 8, 16, %3 + %4, dst, stride, E, 
I, mstride, dst2, stride3, mstride3
 %else
-cglobal vp9_loop_filter_%1_%2_16, 2, 6, 16, %3 + %4 + %5, dst, stride, 
mstride, dst2, stride3, mstride3
+cglobal vp9_loop_filter_%1_%2_ %+ mmsize, 2, 6, 16, %3 + %4 + %5, dst, stride, 
mstride, dst2, stride3, mstride3
 %define Ed dword r2m
 %define Id dword r3m
 %endif
@@ -384,18 +386,22 @@ cglobal vp9_loop_filter_%1_%2_16, 2, 6, 16, %3 + %4 + %5, 
dst, stride, mstride,
 lea  mstride3q, [mstrideq*3]
 
 %ifidn %1, h
-%if %2 > 16
+%if %2 != 16
+%if mmsize == 16
 %define movx movh
+%else
+%define movx mova
+%endif
 lea   dstq, [dstq + 4*strideq - 4]
 %else
 %define movx movu
 lea   dstq, [dstq + 4*strideq - 8] ; go from top center (h 
pos) to center left (v pos)
 %endif
-lea  dst2q, [dstq + 8*strideq]
 %else
 lea   dstq, [dstq + 4*mstrideq]
-lea  dst2q, [dstq + 8*strideq]
 %endif
+; FIXME we shouldn't need two dts registers if mmsize == 8
+lea  dst2q, [dstq + 8*strideq]
 
 DEFINE_REAL_P7_TO_Q7
 
@@ -406,11 +412,11 @@ cglobal 

Re: [FFmpeg-devel] [PATCH 1/2 v3] libopenmpt: add subsong support

2016-07-19 Thread Clément Bœsch
On Tue, Jul 19, 2016 at 04:39:11PM +0100, Josh de Kock wrote:
> ---
>  libavformat/libopenmpt.c | 21 +++--
>  1 file changed, 19 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
> index 58a02be..670866f 100644
> --- a/libavformat/libopenmpt.c
> +++ b/libavformat/libopenmpt.c
> @@ -36,14 +36,19 @@ typedef struct OpenMPTContext {
>  /* options */
>  int sample_rate;
>  int64_t layout;
> +int subsong;
>  } OpenMPTContext;
>  
> +
> +#define LIBOPENMPT_SUBSONG_DEFAULT -2
> +

not a really pretty value...

>  #define OFFSET(x) offsetof(OpenMPTContext, x)
>  #define A AV_OPT_FLAG_AUDIO_PARAM
>  #define D AV_OPT_FLAG_DECODING_PARAM
>  static const AVOption options[] = {
> -{"sample_rate", "set sample rate",OFFSET(sample_rate), 
> AV_OPT_TYPE_INT,{.i64 = 48000},   1000, INT_MAX,  
>  A|D},
> -{"layout",  "set channel layout", OFFSET(layout),  
> AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = AV_CH_LAYOUT_STEREO}, 0,
> INT64_MAX, A|D},
> +{"sample_rate", "set sample rate",OFFSET(sample_rate), 
> AV_OPT_TYPE_INT,{.i64 = 48000},  1000, 
> INT_MAX,   A|D},
> +{"layout",  "set channel layout", OFFSET(layout),  
> AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = AV_CH_LAYOUT_STEREO},0,
> INT64_MAX, A|D},
> +{"subsong", "set subsong",OFFSET(subsong), 
> AV_OPT_TYPE_INT,{.i64 = LIBOPENMPT_SUBSONG_DEFAULT}, -2,   
> INT_MAX,   A|D},
>  {NULL}
>  };
>  
> @@ -88,6 +93,18 @@ static int read_header_openmpt(AVFormatContext *s)
>  add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
> "tracker"));
>  add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
> "message"));
>  
> +if (openmpt->subsong >= 
> openmpt_module_get_num_subsongs(openmpt->module)) {
> +av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", 
> openmpt->subsong);
> +return AVERROR(EINVAL);
> +}
> +
> +if (openmpt->subsong != LIBOPENMPT_SUBSONG_DEFAULT) {
> +if (openmpt->subsong >= 0) {
> +av_dict_set_int(>metadata, "track", openmpt->subsong + 1, 0);
> +}
> +openmpt_module_select_subsong(openmpt->module, openmpt->subsong);

no failure possible?

> +}
> +

you should add an AV_OPT_TYPE_CONST entry associated with "auto", which
will be much more accessible for users

[...]

-- 
Clément B.


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


[FFmpeg-devel] [PATCH 2/2] docs/demuxers: add libopenmpt section

2016-07-19 Thread Josh de Kock
---
 doc/demuxers.texi | 26 ++
 1 file changed, 26 insertions(+)

diff --git a/doc/demuxers.texi b/doc/demuxers.texi
index e34f8b3..3646e29 100644
--- a/doc/demuxers.texi
+++ b/doc/demuxers.texi
@@ -267,6 +267,32 @@ track. Track indexes start at 0. The demuxer exports the 
number of tracks as
 
 For very large files, the @option{max_size} option may have to be adjusted.
 
+@section libopenmpt
+
+libopenmpt based module demuxer
+
+See @url{https://lib.openmpt.org/libopenmpt/} for more information.
+
+Some files have multiple subsongs (tracks) this can be set with the 
@option{subsong}
+option.
+
+It accepts the following options:
+
+@table @option
+@item subsong
+The range for the option is -2 to 65535. If set to -2, libopenmpt will
+choose a subsong. If set to -1 then all the tracks will be exported. Subsong 
indexes
+start at 0. The default value is to let libopenmpt choose.
+
+@item layout
+Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
+The default value is STEREO.
+
+@item sample_rate
+Set the sample rate for libopenmpt to output.
+Range is from 1000 to INT_MAX. The value default is 48000.
+@end table
+
 @section gif
 
 Animated GIF demuxer.
-- 
2.7.4 (Apple Git-66)

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


[FFmpeg-devel] [PATCH 1/2 v3] libopenmpt: add subsong support

2016-07-19 Thread Josh de Kock
---
 libavformat/libopenmpt.c | 21 +++--
 1 file changed, 19 insertions(+), 2 deletions(-)

diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
index 58a02be..670866f 100644
--- a/libavformat/libopenmpt.c
+++ b/libavformat/libopenmpt.c
@@ -36,14 +36,19 @@ typedef struct OpenMPTContext {
 /* options */
 int sample_rate;
 int64_t layout;
+int subsong;
 } OpenMPTContext;
 
+
+#define LIBOPENMPT_SUBSONG_DEFAULT -2
+
 #define OFFSET(x) offsetof(OpenMPTContext, x)
 #define A AV_OPT_FLAG_AUDIO_PARAM
 #define D AV_OPT_FLAG_DECODING_PARAM
 static const AVOption options[] = {
-{"sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{.i64 = 48000},   1000, INT_MAX,   
A|D},
-{"layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = AV_CH_LAYOUT_STEREO}, 0,INT64_MAX, 
A|D},
+{"sample_rate", "set sample rate",OFFSET(sample_rate), 
AV_OPT_TYPE_INT,{.i64 = 48000},  1000, INT_MAX, 
  A|D},
+{"layout",  "set channel layout", OFFSET(layout),  
AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64 = AV_CH_LAYOUT_STEREO},0,
INT64_MAX, A|D},
+{"subsong", "set subsong",OFFSET(subsong), 
AV_OPT_TYPE_INT,{.i64 = LIBOPENMPT_SUBSONG_DEFAULT}, -2,   INT_MAX, 
  A|D},
 {NULL}
 };
 
@@ -88,6 +93,18 @@ static int read_header_openmpt(AVFormatContext *s)
 add_meta(s, "encoder", openmpt_module_get_metadata(openmpt->module, 
"tracker"));
 add_meta(s, "comment", openmpt_module_get_metadata(openmpt->module, 
"message"));
 
+if (openmpt->subsong >= openmpt_module_get_num_subsongs(openmpt->module)) {
+av_log(s, AV_LOG_ERROR, "Invalid subsong index: %d\n", 
openmpt->subsong);
+return AVERROR(EINVAL);
+}
+
+if (openmpt->subsong != LIBOPENMPT_SUBSONG_DEFAULT) {
+if (openmpt->subsong >= 0) {
+av_dict_set_int(>metadata, "track", openmpt->subsong + 1, 0);
+}
+openmpt_module_select_subsong(openmpt->module, openmpt->subsong);
+}
+
 st = avformat_new_stream(s, NULL);
 if (!st) {
 openmpt_module_destroy(openmpt->module);
-- 
2.7.4 (Apple Git-66)

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


Re: [FFmpeg-devel] [PATCH] libavformat: Add FIFO pseudo-muxer

2016-07-19 Thread Jan Sebechlebsky

Hello Nicolas,

On 07/15/2016 02:17 PM, Nicolas George wrote:



Therefore I would like to keep the fifo muxer as Jan submitted it, without
EAGAIN support. If there is a use case for non-blockingingness in a sense
you use the phrase, then it can be added later.

I am against it. As it is, I consider it is way too specific to be added to
the code base.
We've talked with Marton and decided that I will try to implement the 
non-blocking mode as described in my previous e-mail as a separate patch 
at the top of current fifo muxer (also with necessary API patches as 
separate patches).
However, I don't see a reason why the fifo muxer couldn't be 
accepted to codebase before the patch adding AVFMT_FLAG_NONBLOCK support 
is completed - non-blocking mode will not be used in FFmpeg anyway. 
Although developers using libavformat can benefit from nonblocking fifo 
muxer, there is no reason not to provide functionality it adds to ffmpeg 
users (and adding AVFMT_FLAG_NONBLOCK support will not change the 
functionality it provides for users).
So, I would like to send current version of fifo muxer to the ML 
and I hope we can deal separately with the support for 
AVFMT_FLAG_NONBLOCK later. I think this way it will also simplify the 
review process. Can we do it this way? :)


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


Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: implement floating point decoding

2016-07-19 Thread Thilo Borgmann
Am 19.07.16 um 15:42 schrieb Umair Khan:
> On Tue, Jul 19, 2016 at 5:20 PM, Thilo Borgmann  
> wrote:
>> Am 19.07.16 um 09:22 schrieb Umair Khan:
>>> On Tue, Jul 19, 2016 at 12:29 PM, Paul B Mahol  wrote:

 On 7/19/16, Umair Khan  wrote:
> On Tue, Jul 19, 2016 at 3:08 AM, Michael Niedermayer
>  wrote:
>> On Mon, Jul 18, 2016 at 11:42:48PM +0530, Umair Khan wrote:
>>> On Sun, Jul 17, 2016 at 3:38 PM, Michael Niedermayer
>>>  wrote:
 On Sun, Jul 17, 2016 at 11:54:49AM +0200, Michael Niedermayer wrote:
> On Sun, Jul 17, 2016 at 09:00:48AM +0530, Umair Khan wrote:
>> Hi,
>>
>> On Sun, Jul 17, 2016 at 12:25 AM, Thilo Borgmann
>>  wrote:
>>> Hi,
>>>
 From 70e65b26cc3f84c9c664c30808b43a5e1cf16eaa Mon Sep 17 00:00:00
 2001
 From: Umair Khan 
 Date: Sat, 16 Jul 2016 23:52:39 +0530
 Subject: [PATCH 1/1] avcodec/alsdec: implement floating point
 decoding

 It conforms to RM22 version of the reference codec.

 Signed-off-by: Umair Khan 
 ---
  libavcodec/Makefile   |   2 +-
  libavcodec/alsdec.c   | 284
 +-
  libavcodec/mlz.c  | 171 +
  libavcodec/mlz.h  |  69 ++
  libavutil/softfloat_ieee754.h | 115 +
  5 files changed, 638 insertions(+), 3 deletions(-)
  create mode 100644 libavcodec/mlz.c
  create mode 100644 libavcodec/mlz.h
  create mode 100644 libavutil/softfloat_ieee754.h

 diff --git a/libavcodec/Makefile b/libavcodec/Makefile
 index abef19e..a03adf5 100644
 --- a/libavcodec/Makefile
 +++ b/libavcodec/Makefile
 @@ -163,7 +163,7 @@ OBJS-$(CONFIG_ALAC_DECODER)+=
 alac.o alac_data.o alacdsp.o
  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
 -OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o
 mpeg4audio.o
 +OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mlz.o
 mpeg4audio.o
  OBJS-$(CONFIG_AMRNB_DECODER)   += amrnbdec.o
 celp_filters.o   \
celp_math.o
 acelp_filters.o \
acelp_vectors.o
  \
 diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
 index a7e58a2..c710fc3 100644
 --- a/libavcodec/alsdec.c
 +++ b/libavcodec/alsdec.c
 @@ -35,8 +35,11 @@
  [...]

 +/** multiply two softfloats and handle the rounding off
 + */
 +static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a,
 SoftFloat_IEEE754 b) {
 [...]
>>>
>>> Why is this in alsdec.c?
>>
>> This is not the actual IEEE 754 multiplication. It is as is
>> mentioned
>> in the reference spec.
>> The typical one for 754 floats, I've implemented here separately -
>> https://github.com/omerjerk/FFmpeg/commit/d6cd4bf66b9da46dd87580d7d974ce44abdcfba2#diff-4dd4b2d8d523f336fbefa96e9252187cR93
>>
>>> [...]
>>>
 diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
 new file mode 100644
 index 000..cb2ed6a
 --- /dev/null
 +++ b/libavcodec/mlz.c
 [...]
>>>
 +static int input_code(GetBitContext* gb, int len) {
 +int tmp_code = 0;
 +int i;
 +for (i = 0; i < len; ++i) {
 +tmp_code += get_bits1(gb) << i;
>>  |=
>> should be better.
>>
 +}
 +return tmp_code;
 +}
>>
>> Also, you could revert it byte-wise using ff_revert[]... if len is often 
>> bigger
>> than 8 that might be worth it.
> 
> I didn't get you.

tmp_code |= get_bits1(gb) << i;


> I tried logging that variable and len is always greater than 8. So
> what should we go with?
> It was 9 or 10 for the file I ran. And going with the logic of lzw, it
> will hardly be greater than 11 ever.

I think it would not benefit enough from ff_reverse then. Keep the loop.

-Thilo

___
ffmpeg-devel mailing list

Re: [FFmpeg-devel] [PATCH] vp9: add 32x32 idct AVX2 implementation.

2016-07-19 Thread Ronald S. Bultje
Hi,

On Sat, Jul 16, 2016 at 5:55 AM, Henrik Gramner  wrote:

> On Wed, Jul 13, 2016 at 6:37 PM, Ronald S. Bultje 
> wrote:
> > +cglobal vp9_idct_idct_32x32_add, 4, 9, 16, 2048, dst, stride, block, eob
> [...]
> > +movd   xm0, [blockq]
> > +movam1, [pw_11585x2]
> > +pmulhrswm0, m1
> > +pmulhrswm0, m1
> > +vpbroadcastwm0, xm0
> > +pmulhrswm0, [pw_512]
>
> [..]

Is it mathematically possible to merge consecutive pmulhrsw
> instructions into a single one using a different constant? I'm
> guessing no, but I'm not sure.


To my knowledge: no. The intermediate rounding step gets rid of the least
significant bits before the second mul, and merging the muls would remove
this which would change the integer result.

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


Re: [FFmpeg-devel] [PATCH] Avoid sending packets to network when multicast ttl is 0 in udp

2016-07-19 Thread Omid Ghaffarinia
Is the patch approved or does it need more explanation?

On Wed, Jul 13, 2016 at 3:09 PM, Omid Ghaffarinia
 wrote:
> I attached the patch.
>
> The actual bug is, when creating a local multicast stream (i.e. giving
> "rtp://224.1.1.1:1?ttl=0" to avio_open), then you can see the
> packets on the network and not just on local machine (despite setting
> multicast ttl to 0) which was a security bug in my purpose of usage
> (it also made a lot of unused traffic on network)
>
> The user does not choose to enable/disable the kernel hack, that is
> how it is designed.
>
> This behavior does NOT happen in Windows machines, but the patch given
> does no harm at all (it does nothing in Windows)
>
> On Wed, Jul 13, 2016 at 3:12 AM, Moritz Barsnick  wrote:
>> On Tue, Jul 12, 2016 at 18:31:36 +0430, Omid Ghaffarinia wrote:
>>
>> Your mailer has broken the patch by inserting line breaks. You should
>> try attaching the patch as a file, or directly using "git send-email".
>>
>>> Bug is due to kernel handling multicast ttl 0 differently (as noted in
>>> kernel code net/ipv4/route.c:2191 see:
>>
>> ffmpeg is not a Linux-only tool/library, so comments should point out
>> which "kernel" more precisely (and possibly which versions this applies
>> to). Admitted, the link to github contains the string "linux". ;-)
>>
>> Furthermore: Please explain what the actual bug (i.e. misbehavior) is,
>> and what this fix changes (or how it fixes it).
>>
>> Are you allowing ffmpeg to work when the user is making use of the
>> kernel hack?
>>
>> What does this patch achieve on non-Linux operating systems?
>>
>> (Sorry for the stupid questions, all this isn't obvious to me, and I do
>> have at least some understanding of network stuff.)
>>
>> Moritz
>> ___
>> 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] avcodec/alsdec: implement floating point decoding

2016-07-19 Thread Umair Khan
On Tue, Jul 19, 2016 at 5:20 PM, Thilo Borgmann  wrote:
> Am 19.07.16 um 09:22 schrieb Umair Khan:
>> On Tue, Jul 19, 2016 at 12:29 PM, Paul B Mahol  wrote:
>>>
>>> On 7/19/16, Umair Khan  wrote:
 On Tue, Jul 19, 2016 at 3:08 AM, Michael Niedermayer
  wrote:
> On Mon, Jul 18, 2016 at 11:42:48PM +0530, Umair Khan wrote:
>> On Sun, Jul 17, 2016 at 3:38 PM, Michael Niedermayer
>>  wrote:
>>> On Sun, Jul 17, 2016 at 11:54:49AM +0200, Michael Niedermayer wrote:
 On Sun, Jul 17, 2016 at 09:00:48AM +0530, Umair Khan wrote:
> Hi,
>
> On Sun, Jul 17, 2016 at 12:25 AM, Thilo Borgmann
>  wrote:
>> Hi,
>>
>>> From 70e65b26cc3f84c9c664c30808b43a5e1cf16eaa Mon Sep 17 00:00:00
>>> 2001
>>> From: Umair Khan 
>>> Date: Sat, 16 Jul 2016 23:52:39 +0530
>>> Subject: [PATCH 1/1] avcodec/alsdec: implement floating point
>>> decoding
>>>
>>> It conforms to RM22 version of the reference codec.
>>>
>>> Signed-off-by: Umair Khan 
>>> ---
>>>  libavcodec/Makefile   |   2 +-
>>>  libavcodec/alsdec.c   | 284
>>> +-
>>>  libavcodec/mlz.c  | 171 +
>>>  libavcodec/mlz.h  |  69 ++
>>>  libavutil/softfloat_ieee754.h | 115 +
>>>  5 files changed, 638 insertions(+), 3 deletions(-)
>>>  create mode 100644 libavcodec/mlz.c
>>>  create mode 100644 libavcodec/mlz.h
>>>  create mode 100644 libavutil/softfloat_ieee754.h
>>>
>>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>>> index abef19e..a03adf5 100644
>>> --- a/libavcodec/Makefile
>>> +++ b/libavcodec/Makefile
>>> @@ -163,7 +163,7 @@ OBJS-$(CONFIG_ALAC_DECODER)+=
>>> alac.o alac_data.o alacdsp.o
>>>  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
>>>  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
>>>  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
>>> -OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o
>>> mpeg4audio.o
>>> +OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mlz.o
>>> mpeg4audio.o
>>>  OBJS-$(CONFIG_AMRNB_DECODER)   += amrnbdec.o
>>> celp_filters.o   \
>>>celp_math.o
>>> acelp_filters.o \
>>>acelp_vectors.o
>>>  \
>>> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
>>> index a7e58a2..c710fc3 100644
>>> --- a/libavcodec/alsdec.c
>>> +++ b/libavcodec/alsdec.c
>>> @@ -35,8 +35,11 @@
>>>  [...]
>>>
>>> +/** multiply two softfloats and handle the rounding off
>>> + */
>>> +static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a,
>>> SoftFloat_IEEE754 b) {
>>> [...]
>>
>> Why is this in alsdec.c?
>
> This is not the actual IEEE 754 multiplication. It is as is
> mentioned
> in the reference spec.
> The typical one for 754 floats, I've implemented here separately -
> https://github.com/omerjerk/FFmpeg/commit/d6cd4bf66b9da46dd87580d7d974ce44abdcfba2#diff-4dd4b2d8d523f336fbefa96e9252187cR93
>
>> [...]
>>
>>> diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
>>> new file mode 100644
>>> index 000..cb2ed6a
>>> --- /dev/null
>>> +++ b/libavcodec/mlz.c
>>> [...]
>>
>>> +static int input_code(GetBitContext* gb, int len) {
>>> +int tmp_code = 0;
>>> +int i;
>>> +for (i = 0; i < len; ++i) {
>>> +tmp_code += get_bits1(gb) << i;
>  |=
> should be better.
>
>>> +}
>>> +return tmp_code;
>>> +}
>
> Also, you could revert it byte-wise using ff_revert[]... if len is often 
> bigger
> than 8 that might be worth it.

I didn't get you.
I tried logging that variable and len is always greater than 8. So
what should we go with?
It was 9 or 10 for the file I ran. And going with the logic of lzw, it
will hardly be greater than 11 ever.

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


Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: implement floating point decoding

2016-07-19 Thread Thilo Borgmann
Am 19.07.16 um 09:22 schrieb Umair Khan:
> On Tue, Jul 19, 2016 at 12:29 PM, Paul B Mahol  wrote:
>>
>> On 7/19/16, Umair Khan  wrote:
>>> On Tue, Jul 19, 2016 at 3:08 AM, Michael Niedermayer
>>>  wrote:
 On Mon, Jul 18, 2016 at 11:42:48PM +0530, Umair Khan wrote:
> On Sun, Jul 17, 2016 at 3:38 PM, Michael Niedermayer
>  wrote:
>> On Sun, Jul 17, 2016 at 11:54:49AM +0200, Michael Niedermayer wrote:
>>> On Sun, Jul 17, 2016 at 09:00:48AM +0530, Umair Khan wrote:
 Hi,

 On Sun, Jul 17, 2016 at 12:25 AM, Thilo Borgmann
  wrote:
> Hi,
>
>> From 70e65b26cc3f84c9c664c30808b43a5e1cf16eaa Mon Sep 17 00:00:00
>> 2001
>> From: Umair Khan 
>> Date: Sat, 16 Jul 2016 23:52:39 +0530
>> Subject: [PATCH 1/1] avcodec/alsdec: implement floating point
>> decoding
>>
>> It conforms to RM22 version of the reference codec.
>>
>> Signed-off-by: Umair Khan 
>> ---
>>  libavcodec/Makefile   |   2 +-
>>  libavcodec/alsdec.c   | 284
>> +-
>>  libavcodec/mlz.c  | 171 +
>>  libavcodec/mlz.h  |  69 ++
>>  libavutil/softfloat_ieee754.h | 115 +
>>  5 files changed, 638 insertions(+), 3 deletions(-)
>>  create mode 100644 libavcodec/mlz.c
>>  create mode 100644 libavcodec/mlz.h
>>  create mode 100644 libavutil/softfloat_ieee754.h
>>
>> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>> index abef19e..a03adf5 100644
>> --- a/libavcodec/Makefile
>> +++ b/libavcodec/Makefile
>> @@ -163,7 +163,7 @@ OBJS-$(CONFIG_ALAC_DECODER)+=
>> alac.o alac_data.o alacdsp.o
>>  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
>>  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
>>  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
>> -OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o
>> mpeg4audio.o
>> +OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mlz.o
>> mpeg4audio.o
>>  OBJS-$(CONFIG_AMRNB_DECODER)   += amrnbdec.o
>> celp_filters.o   \
>>celp_math.o
>> acelp_filters.o \
>>acelp_vectors.o
>>  \
>> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
>> index a7e58a2..c710fc3 100644
>> --- a/libavcodec/alsdec.c
>> +++ b/libavcodec/alsdec.c
>> @@ -35,8 +35,11 @@
>>  [...]
>>
>> +/** multiply two softfloats and handle the rounding off
>> + */
>> +static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a,
>> SoftFloat_IEEE754 b) {
>> [...]
>
> Why is this in alsdec.c?

 This is not the actual IEEE 754 multiplication. It is as is
 mentioned
 in the reference spec.
 The typical one for 754 floats, I've implemented here separately -
 https://github.com/omerjerk/FFmpeg/commit/d6cd4bf66b9da46dd87580d7d974ce44abdcfba2#diff-4dd4b2d8d523f336fbefa96e9252187cR93

> [...]
>
>> diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
>> new file mode 100644
>> index 000..cb2ed6a
>> --- /dev/null
>> +++ b/libavcodec/mlz.c
>> [...]
>
>> +static int input_code(GetBitContext* gb, int len) {
>> +int tmp_code = 0;
>> +int i;
>> +for (i = 0; i < len; ++i) {
>> +tmp_code += get_bits1(gb) << i;
 |=
should be better.

>> +}
>> +return tmp_code;
>> +}

Also, you could revert it byte-wise using ff_revert[]... if len is often bigger
than 8 that might be worth it.

-Thilo

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


Re: [FFmpeg-devel] why ffmpeg 3.1.1 still uses AVStream::codec

2016-07-19 Thread Timo Rothenpieler
> Hi,
> 
> I have read part of source code of ffmpeg 3.1.1. In the structure of 'struct 
> AVStream', 'AVCodecContext *codec' is declared as deprecated. But in 
> ffmpeg.c, 'AVCodecContext *codec' is still used in some functions. Why?

Because nobody felt like changing that yet.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] why ffmpeg 3.1.1 still uses AVStream::codec

2016-07-19 Thread qw
Hi,

I have read part of source code of ffmpeg 3.1.1. In the structure of 'struct 
AVStream', 'AVCodecContext *codec' is declared as deprecated. But in ffmpeg.c, 
'AVCodecContext *codec' is still used in some functions. Why?

Thanks!

Regards

Andrew


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


[FFmpeg-devel] CORRECTED: IETF CELLAR meeting today at 14:00 CEST to discuss FFV1, Matroska, EBML

2016-07-19 Thread Tessa Fallon
The IETF CELLAR Working Group is holding its inaugural meeting today at
14:00 CEST.  We will be discussing work done/to be done on FFV1, Matroska,
and EBML specifications.

You can participate/watch remotely using the IETF tools found here:

*Watch*
Streaming Video
https://tiergarten.conf.meetecho.com/q-meetecho/login.jsp?ietf=cellar

*Participate:*
Jabber roomxmpp:cel...@jabber.ietf.org?join


*Meeting Materials *(will continue to be updated until the meeting starts)
https://datatracker.ietf.org/meeting/96/agenda/cellar-drafts.pdf

*Working Discussions (*after the meeting)
You may also sign up for the CELLAR discussion list--all work done on
specifications takes place on the list.
https://datatracker.ietf.org/group/cellar/charter/

Best wishes,

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


[FFmpeg-devel] IETF CELLAR meeting today to discuss FFV1, Matroska, EBML

2016-07-19 Thread Tessa Fallon
The IETF CELLAR Working Group is holding its inaugural meeting today at
14:00 CEST.  We will be discussing work done/to be done on Matroska and
EBML specifications.

You can participate/watch remotely using the IETF tools found here:

*Watch*
Streaming Video
https://tiergarten.conf.meetecho.com/q-meetecho/login.jsp?ietf=cellar

*Participate:*
Jabber roomxmpp:cel...@jabber.ietf.org?join

*Meeting Materials *(will continue to be updated until the meeting starts)
https://datatracker.ietf.org/meeting/96/agenda/cellar-drafts.pdf

*Working Discussions (*after the meeting)
You may also sign up for the CELLAR discussion list--all work done on
specifications takes place on the list.
https://datatracker.ietf.org/group/cellar/charter/

Best wishes,

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


Re: [FFmpeg-devel] [PATCH] avformat/matroskaenc: Write duration early during mkv_write_header

2016-07-19 Thread Moritz Barsnick
On Tue, Jul 19, 2016 at 01:02:07 +, Soft Works wrote:
> I apologize - I'm new to this project and have to get familiar with the 
> coding styles..

Before writing your first line of code, read other ffmpeg code as well
as the developer guidelines. Those things mentioned in this thread are
all noted here:
https://ffmpeg.org/developer.html#Coding-Rules-1

:-)

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


Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: implement floating point decoding

2016-07-19 Thread Umair Khan
On Tue, Jul 19, 2016 at 12:29 PM, Paul B Mahol  wrote:
>
> On 7/19/16, Umair Khan  wrote:
> > On Tue, Jul 19, 2016 at 3:08 AM, Michael Niedermayer
> >  wrote:
> >> On Mon, Jul 18, 2016 at 11:42:48PM +0530, Umair Khan wrote:
> >>> On Sun, Jul 17, 2016 at 3:38 PM, Michael Niedermayer
> >>>  wrote:
> >>> > On Sun, Jul 17, 2016 at 11:54:49AM +0200, Michael Niedermayer wrote:
> >>> >> On Sun, Jul 17, 2016 at 09:00:48AM +0530, Umair Khan wrote:
> >>> >> > Hi,
> >>> >> >
> >>> >> > On Sun, Jul 17, 2016 at 12:25 AM, Thilo Borgmann
> >>> >> >  wrote:
> >>> >> > > Hi,
> >>> >> > >
> >>> >> > >> From 70e65b26cc3f84c9c664c30808b43a5e1cf16eaa Mon Sep 17 00:00:00
> >>> >> > >> 2001
> >>> >> > >> From: Umair Khan 
> >>> >> > >> Date: Sat, 16 Jul 2016 23:52:39 +0530
> >>> >> > >> Subject: [PATCH 1/1] avcodec/alsdec: implement floating point
> >>> >> > >> decoding
> >>> >> > >>
> >>> >> > >> It conforms to RM22 version of the reference codec.
> >>> >> > >>
> >>> >> > >> Signed-off-by: Umair Khan 
> >>> >> > >> ---
> >>> >> > >>  libavcodec/Makefile   |   2 +-
> >>> >> > >>  libavcodec/alsdec.c   | 284
> >>> >> > >> +-
> >>> >> > >>  libavcodec/mlz.c  | 171 +
> >>> >> > >>  libavcodec/mlz.h  |  69 ++
> >>> >> > >>  libavutil/softfloat_ieee754.h | 115 +
> >>> >> > >>  5 files changed, 638 insertions(+), 3 deletions(-)
> >>> >> > >>  create mode 100644 libavcodec/mlz.c
> >>> >> > >>  create mode 100644 libavcodec/mlz.h
> >>> >> > >>  create mode 100644 libavutil/softfloat_ieee754.h
> >>> >> > >>
> >>> >> > >> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> >>> >> > >> index abef19e..a03adf5 100644
> >>> >> > >> --- a/libavcodec/Makefile
> >>> >> > >> +++ b/libavcodec/Makefile
> >>> >> > >> @@ -163,7 +163,7 @@ OBJS-$(CONFIG_ALAC_DECODER)+=
> >>> >> > >> alac.o alac_data.o alacdsp.o
> >>> >> > >>  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
> >>> >> > >>  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
> >>> >> > >>  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
> >>> >> > >> -OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o
> >>> >> > >> mpeg4audio.o
> >>> >> > >> +OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mlz.o
> >>> >> > >> mpeg4audio.o
> >>> >> > >>  OBJS-$(CONFIG_AMRNB_DECODER)   += amrnbdec.o
> >>> >> > >> celp_filters.o   \
> >>> >> > >>celp_math.o
> >>> >> > >> acelp_filters.o \
> >>> >> > >>acelp_vectors.o
> >>> >> > >>  \
> >>> >> > >> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
> >>> >> > >> index a7e58a2..c710fc3 100644
> >>> >> > >> --- a/libavcodec/alsdec.c
> >>> >> > >> +++ b/libavcodec/alsdec.c
> >>> >> > >> @@ -35,8 +35,11 @@
> >>> >> > >>  [...]
> >>> >> > >>
> >>> >> > >> +/** multiply two softfloats and handle the rounding off
> >>> >> > >> + */
> >>> >> > >> +static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a,
> >>> >> > >> SoftFloat_IEEE754 b) {
> >>> >> > >> [...]
> >>> >> > >
> >>> >> > > Why is this in alsdec.c?
> >>> >> >
> >>> >> > This is not the actual IEEE 754 multiplication. It is as is
> >>> >> > mentioned
> >>> >> > in the reference spec.
> >>> >> > The typical one for 754 floats, I've implemented here separately -
> >>> >> > https://github.com/omerjerk/FFmpeg/commit/d6cd4bf66b9da46dd87580d7d974ce44abdcfba2#diff-4dd4b2d8d523f336fbefa96e9252187cR93
> >>> >> >
> >>> >> > > [...]
> >>> >> > >
> >>> >> > >> diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
> >>> >> > >> new file mode 100644
> >>> >> > >> index 000..cb2ed6a
> >>> >> > >> --- /dev/null
> >>> >> > >> +++ b/libavcodec/mlz.c
> >>> >> > >> [...]
> >>> >> > >
> >>> >> > >> +static int input_code(GetBitContext* gb, int len) {
> >>> >> > >> +int tmp_code = 0;
> >>> >> > >> +int i;
> >>> >> > >> +for (i = 0; i < len; ++i) {
> >>> >> > >> +tmp_code += get_bits1(gb) << i;
> >>> >> > >> +}
> >>> >> > >> +return tmp_code;
> >>> >> > >> +}
> >>> >> > >
> >>> >> > > Is there nothing in get_bits.h that solves that already?
> >>> >> > >
> >>> >> > > -Thilo
> >>> >> >
> >>> >> > I'm not sure. It is just reading the bits in the reverse order. May
> >>> >> > be
> >>> >> > someone else can help.
> >>> >>
> >>> >> theres asv2_get_bits()
> >>> >> if it works here it could be shared
> >>> >
> >>> > note though asv2_get_bits() is maximum 8 bits, for more bits more
> >>> > table lookups or a bigger table is needed
> >>>
> >>> What should be the best way to use this function? It is not present in
> >>> any header file.
> >>
> >> it could be moved into a header and made static inlinw with a more
> >> generic name.
> >> That is if it works ...
> >
> > I did this 

Re: [FFmpeg-devel] [PATCH] avcodec/alsdec: implement floating point decoding

2016-07-19 Thread Paul B Mahol
On 7/19/16, Umair Khan  wrote:
> On Tue, Jul 19, 2016 at 3:08 AM, Michael Niedermayer
>  wrote:
>> On Mon, Jul 18, 2016 at 11:42:48PM +0530, Umair Khan wrote:
>>> On Sun, Jul 17, 2016 at 3:38 PM, Michael Niedermayer
>>>  wrote:
>>> > On Sun, Jul 17, 2016 at 11:54:49AM +0200, Michael Niedermayer wrote:
>>> >> On Sun, Jul 17, 2016 at 09:00:48AM +0530, Umair Khan wrote:
>>> >> > Hi,
>>> >> >
>>> >> > On Sun, Jul 17, 2016 at 12:25 AM, Thilo Borgmann
>>> >> >  wrote:
>>> >> > > Hi,
>>> >> > >
>>> >> > >> From 70e65b26cc3f84c9c664c30808b43a5e1cf16eaa Mon Sep 17 00:00:00
>>> >> > >> 2001
>>> >> > >> From: Umair Khan 
>>> >> > >> Date: Sat, 16 Jul 2016 23:52:39 +0530
>>> >> > >> Subject: [PATCH 1/1] avcodec/alsdec: implement floating point
>>> >> > >> decoding
>>> >> > >>
>>> >> > >> It conforms to RM22 version of the reference codec.
>>> >> > >>
>>> >> > >> Signed-off-by: Umair Khan 
>>> >> > >> ---
>>> >> > >>  libavcodec/Makefile   |   2 +-
>>> >> > >>  libavcodec/alsdec.c   | 284
>>> >> > >> +-
>>> >> > >>  libavcodec/mlz.c  | 171 +
>>> >> > >>  libavcodec/mlz.h  |  69 ++
>>> >> > >>  libavutil/softfloat_ieee754.h | 115 +
>>> >> > >>  5 files changed, 638 insertions(+), 3 deletions(-)
>>> >> > >>  create mode 100644 libavcodec/mlz.c
>>> >> > >>  create mode 100644 libavcodec/mlz.h
>>> >> > >>  create mode 100644 libavutil/softfloat_ieee754.h
>>> >> > >>
>>> >> > >> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
>>> >> > >> index abef19e..a03adf5 100644
>>> >> > >> --- a/libavcodec/Makefile
>>> >> > >> +++ b/libavcodec/Makefile
>>> >> > >> @@ -163,7 +163,7 @@ OBJS-$(CONFIG_ALAC_DECODER)+=
>>> >> > >> alac.o alac_data.o alacdsp.o
>>> >> > >>  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
>>> >> > >>  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
>>> >> > >>  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
>>> >> > >> -OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o
>>> >> > >> mpeg4audio.o
>>> >> > >> +OBJS-$(CONFIG_ALS_DECODER) += alsdec.o bgmc.o mlz.o
>>> >> > >> mpeg4audio.o
>>> >> > >>  OBJS-$(CONFIG_AMRNB_DECODER)   += amrnbdec.o
>>> >> > >> celp_filters.o   \
>>> >> > >>celp_math.o
>>> >> > >> acelp_filters.o \
>>> >> > >>acelp_vectors.o
>>> >> > >>  \
>>> >> > >> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
>>> >> > >> index a7e58a2..c710fc3 100644
>>> >> > >> --- a/libavcodec/alsdec.c
>>> >> > >> +++ b/libavcodec/alsdec.c
>>> >> > >> @@ -35,8 +35,11 @@
>>> >> > >>  [...]
>>> >> > >>
>>> >> > >> +/** multiply two softfloats and handle the rounding off
>>> >> > >> + */
>>> >> > >> +static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a,
>>> >> > >> SoftFloat_IEEE754 b) {
>>> >> > >> [...]
>>> >> > >
>>> >> > > Why is this in alsdec.c?
>>> >> >
>>> >> > This is not the actual IEEE 754 multiplication. It is as is
>>> >> > mentioned
>>> >> > in the reference spec.
>>> >> > The typical one for 754 floats, I've implemented here separately -
>>> >> > https://github.com/omerjerk/FFmpeg/commit/d6cd4bf66b9da46dd87580d7d974ce44abdcfba2#diff-4dd4b2d8d523f336fbefa96e9252187cR93
>>> >> >
>>> >> > > [...]
>>> >> > >
>>> >> > >> diff --git a/libavcodec/mlz.c b/libavcodec/mlz.c
>>> >> > >> new file mode 100644
>>> >> > >> index 000..cb2ed6a
>>> >> > >> --- /dev/null
>>> >> > >> +++ b/libavcodec/mlz.c
>>> >> > >> [...]
>>> >> > >
>>> >> > >> +static int input_code(GetBitContext* gb, int len) {
>>> >> > >> +int tmp_code = 0;
>>> >> > >> +int i;
>>> >> > >> +for (i = 0; i < len; ++i) {
>>> >> > >> +tmp_code += get_bits1(gb) << i;
>>> >> > >> +}
>>> >> > >> +return tmp_code;
>>> >> > >> +}
>>> >> > >
>>> >> > > Is there nothing in get_bits.h that solves that already?
>>> >> > >
>>> >> > > -Thilo
>>> >> >
>>> >> > I'm not sure. It is just reading the bits in the reverse order. May
>>> >> > be
>>> >> > someone else can help.
>>> >>
>>> >> theres asv2_get_bits()
>>> >> if it works here it could be shared
>>> >
>>> > note though asv2_get_bits() is maximum 8 bits, for more bits more
>>> > table lookups or a bigger table is needed
>>>
>>> What should be the best way to use this function? It is not present in
>>> any header file.
>>
>> it could be moved into a header and made static inlinw with a more
>> generic name.
>> That is if it works ...
>
> I did this for now and it doesn't seem to read the reversed bits properly.
> https://github.com/omerjerk/FFmpeg/commit/c58bdd74518444022c753e24d8048e2fd9febd72
>
> No idea what's wrong. If it was reversing the bits properly, this code
> should've worked I guess.

Because it is wrong, use what you had before.

>
>