Re: [FFmpeg-devel] [PATCH] configure: create the tests directory like the doc directory

2014-12-14 Thread Dave Yeo

On 12/14/14 07:42 PM, Michael Niedermayer wrote:

This fixes an issue where the tests directory is not created for out of tree
builds before its needed

Signed-off-by: Michael Niedermayer 
---
  configure |1 +
  1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 0ec1a7c..3328026 100755
--- a/configure
+++ b/configure
@@ -5722,6 +5722,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH


  mkdir -p doc
+mkdir -p tests
  echo "@c auto-generated by configure" > doc/config.texi

  print_config ARCH_   "$config_files" $ARCH_LIST



Works fine here
Dave
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-14 Thread arwa arif
>
>
> > +
> > +DECLARE_ASM_CONST(8, uint64_t, MM_FIX_0_382683433)   =
> FIX64(0.382683433, 14);
>
> > +DECLARE_ALIGNED  (8, uint64_t, ff_MM_FIX_0_541196100)=
> FIX64(0.541196100, 14);
> > +DECLARE_ALIGNED  (8, uint64_t, ff_MM_FIX_0_707106781)=
> FIX64(0.707106781, 14);
>
> these 2 conflict with the existing fspp filter, they should be removed
> from one to avoid that conflict
>

If I try to remove this, I am getting compilation errors. Also, when I am
trying to build the code, I am getting warnings -
"libavfilter/x86/vf_fspp.c:324: Warning: missing operand; zero assumed", I
don't know how to deal with it?
From d1190ca693ba382b0f7de344cea8b6730dd0e6a3 Mon Sep 17 00:00:00 2001
From: Arwa Arif 
Date: Sun, 14 Dec 2014 12:03:31 +0530
Subject: [PATCH] Port fspp to FFmpeg

---
 doc/filters.texi  |   24 +
 libavfilter/Makefile  |1 +
 libavfilter/allfilters.c  |1 +
 libavfilter/version.h |2 +-
 libavfilter/vf_fspp.c |  395 +
 libavfilter/vf_fspp.h |  352 
 libavfilter/x86/Makefile  |1 +
 libavfilter/x86/vf_fspp.c | 1388 +
 8 files changed, 2163 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_fspp.c
 create mode 100644 libavfilter/vf_fspp.h
 create mode 100644 libavfilter/x86/vf_fspp.c

diff --git a/doc/filters.texi b/doc/filters.texi
index 882caa0..eefc507 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4997,6 +4997,30 @@ frei0r=perspective:0.2/0.2|0.8/0.2
 For more information, see
 @url{http://frei0r.dyne.org}
 
+@section fspp
+
+Faster version of the simple postprocessing filter - @ref{spp}.
+
+The filter accepts the following options:
+
+@table @option
+@item quality
+Set quality. This option defines the number of levels for averaging. It accepts
+an integer in the range 0-5. If set to @code{0}, the filter will have no
+effect. A value of @code{5} means the higher quality. For each increment of
+that value the speed drops by a factor of approximately 2.  Default value is
+@code{4}.
+
+@item qp
+Force a constant quantization parameter. If not set, the filter will use the QP
+from the video stream (if available).
+
+@item use_bframe_qp
+Enable the use of the QP from the B-Frames if set to @code{1}. Using this
+option may cause flicker since the B-Frames have often larger QP. Default is
+@code{0} (not enabled).
+@end table
+
 @section geq
 
 The filter accepts the following options:
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 6b7291e..8c523b4 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -125,6 +125,7 @@ OBJS-$(CONFIG_FRAMESTEP_FILTER)  += vf_framestep.o
 OBJS-$(CONFIG_FPS_FILTER)+= vf_fps.o
 OBJS-$(CONFIG_FRAMEPACK_FILTER)  += vf_framepack.o
 OBJS-$(CONFIG_FREI0R_FILTER) += vf_frei0r.o
+OBJS-$(CONFIG_FSPP_FILTER)   += vf_fspp.o
 OBJS-$(CONFIG_GEQ_FILTER)+= vf_geq.o
 OBJS-$(CONFIG_GRADFUN_FILTER)+= vf_gradfun.o
 OBJS-$(CONFIG_HALDCLUT_FILTER)   += vf_lut3d.o dualinput.o framesync.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index adb86be..4a915c7 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -141,6 +141,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(FRAMEPACK,  framepack,  vf);
 REGISTER_FILTER(FRAMESTEP,  framestep,  vf);
 REGISTER_FILTER(FREI0R, frei0r, vf);
+REGISTER_FILTER(FSPP,   fspp,   vf);
 REGISTER_FILTER(GEQ,geq,vf);
 REGISTER_FILTER(GRADFUN,gradfun,vf);
 REGISTER_FILTER(HALDCLUT,   haldclut,   vf);
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 4bd18f3..22e3706 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFILTER_VERSION_MAJOR  5
 #define LIBAVFILTER_VERSION_MINOR  2
-#define LIBAVFILTER_VERSION_MICRO 104
+#define LIBAVFILTER_VERSION_MICRO 105
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
diff --git a/libavfilter/vf_fspp.c b/libavfilter/vf_fspp.c
new file mode 100644
index 000..0163e87
--- /dev/null
+++ b/libavfilter/vf_fspp.c
@@ -0,0 +1,395 @@
+/*
+ * Copyright (c) 2003 Michael Niedermayer 
+ * Copyright (C) 2005 Nikolaj Poroshin 
+ * Copyright (c) 2014 Arwa Arif 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 Gener

Re: [FFmpeg-devel] [PATCH] lavu/frame: fix malloc error path in av_frame_copy_props()

2014-12-14 Thread Michael Niedermayer
On Mon, Dec 15, 2014 at 04:32:58AM +0100, wm4 wrote:
> The error path frees all side data, but forgets to reset the side data
> count. This can blow up later in av_frame_unref() and free_side_data().
> ---
>  libavutil/frame.c | 1 +
>  1 file changed, 1 insertion(+)

applied

thanks

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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


[FFmpeg-devel] [PATCH] configure: create the tests directory like the doc directory

2014-12-14 Thread Michael Niedermayer
This fixes an issue where the tests directory is not created for out of tree
builds before its needed

Signed-off-by: Michael Niedermayer 
---
 configure |1 +
 1 file changed, 1 insertion(+)

diff --git a/configure b/configure
index 0ec1a7c..3328026 100755
--- a/configure
+++ b/configure
@@ -5722,6 +5722,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
 
 
 mkdir -p doc
+mkdir -p tests
 echo "@c auto-generated by configure" > doc/config.texi
 
 print_config ARCH_   "$config_files" $ARCH_LIST
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH] lavu/frame: fix malloc error path in av_frame_copy_props()

2014-12-14 Thread wm4
The error path frees all side data, but forgets to reset the side data
count. This can blow up later in av_frame_unref() and free_side_data().
---
 libavutil/frame.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index 4ee0630..5c9aa29 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -503,6 +503,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
 free_side_data(&dst->side_data[i]);
 }
 av_freep(&dst->side_data);
+dst->nb_side_data = 0;
 return AVERROR(ENOMEM);
 }
 memcpy(sd_dst->data, sd_src->data, sd_src->size);
-- 
2.1.3

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


Re: [FFmpeg-devel] [PATCH]Set the default for --shlibdir to --libdir

2014-12-14 Thread Carl Eugen Hoyos
Ivan Kalvachev  gmail.com> writes:

> Please, commit your current patch.

Merged by Michael.

> BTW, another possible solution is to remove 
> --shlibdir entirely. Is that option even used/useful?

Removing sounds like introducing a regression 
for no gain to me.

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH]Fix leak reading invalid mxf files

2014-12-14 Thread Carl Eugen Hoyos
Tomas Härdin  codemill.se> writes:

> > New patch attached that also fixes the remaining 
> > leaks from ticket #4173.
> > I would split in two parts, please tell me if 
> > you prefer more separate commits.
> 
> Eh, it's small enough that it's clear what the 
> patch does.

The patch was merged by Michael.

> (sorry for being a bit slow with replying - I 
> check the list about once per week)

Don't worry!

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH]Set the default for --shlibdir to --libdir

2014-12-14 Thread Ivan Kalvachev
On 12/13/14, Carl Eugen Hoyos  wrote:
> Clément Bœsch  pkh.me> writes:
>
>> > > > Attached patch fixes ticket #4183.
>
>> >--libdir=DIR install libs in DIR [PREFIX/lib]
>> > -  --shlibdir=DIR   install shared libs in DIR [PREFIX/lib]
>> > +  --shlibdir=DIR   install shared libs in DIR [LIBDIR]
>
>> What if LIBDIR is not defined? (is it possible?)

It is supposed to be set by the previous option (--libdir).
Just like there is no PREFIX env var, but it is the value set by the
--prefix option.

Probably "[same as --libdir]" would be easier to understand, but it
would not be consistent with the rest of how [] is used in configure
help. And if you go that way, how would you describe the --libdir
default?

"[ --prefix/lib]"
"[ ${--prefix}/lib]"
"[ ${prefix}/lib]"
"[$prefix/lib]"
"[$PREFIX/lib]"
"[PREFIX/lib]"

Hum, actually, I kind of like the 3'd  one.

> I believe you misunderstand (there are no shell
> variables involved afaict).
>
> I am not claiming that I am sure this patch is a
> good idea (I am against behaviour changes) but
> this was reported by a user and I believe the
> patch does what the user wants so a decision will
> have to be made: Either close as wont-fix or
> apply this (or a similar) patch.

autoconf handles a single --libdir and people do expect that other
configures work in a similar way.

Please, commit your current patch.

BTW, another possible solution is to remove --shlibdir entirely. Is
that option even used/useful?


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


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-14 Thread Michael Niedermayer
On Sun, Dec 14, 2014 at 12:26:15PM +0530, arwa arif wrote:
> I have tried to port fspp. Not sure, if it is correct or not.

[...]

> +static void filter(FSPPContext *p , uint8_t *dst , uint8_t *src,
> +   int dst_stride , int src_stride ,
> +   int width , int height ,
> +   uint8_t *qp_store , int qp_stride , int is_luma) {
> +
> +int x, x0, y, es, qy, t;
> +const int stride = is_luma ? p->temp_stride : (width+16); 
> //((width+16+15)&(~15))
> +const int step = 6 - p->log2_count;
> +const int qps = 3 + is_luma;
> +DECLARE_ALIGNED(32 , int32_t , block_align)[4 * 8 * BLOCKSZ + 4 * 8 * 
> BLOCKSZ];
> +int16_t *block = (int16_t *)block_align;
> +int16_t *block3 = (int16_t *)(block_align + 4 * 8 * BLOCKSZ);
> +
> +memset(block3 , 0 , 4 * 8 * BLOCKSZ);
> +
> +//p->src=src-src_stride*8-8;//!
> +if (!src || !dst) return; // HACK avoid crash for Y8 colourspace
> +for (y = 0 ; y < height ; y++) {
> +int index = 8 + 8*stride + y*stride;
> +memcpy(p->src + index , src + y*src_stride , width);//this line can 
> be avoided by using DR & user fr.buffers
> +for (x = 0 ; x < 8 ; x++) {
> +p->src[index - x - 1]= p->src[index + x];
> +p->src[index + width + x]= p->src[index + width - x - 1];
> +}
> +}
> +for (y = 0 ; y < 8 ; y++) {
> +memcpy(p->src + ( 7 - y) * stride , p->src + (y + 8) 
> * stride , stride);
> +memcpy(p->src + (height + 8 + y) * stride , p->src + (height -y + 7) 
> * stride , stride);
> +}
> +//FIXME (try edge emu)
> +
> +for (y = 8 ; y < 24 ; y++)
> +memset(p->temp + 8 + y * stride , 0 , width * sizeof(int16_t));
> +
> +for (y = step ; y < height + 8 ; y += step) {//step= 1,2
> +qy = y - 4;
> +if (qy > height - 1) qy = height - 1;
> +if (qy < 0) qy = 0;
> +qy = (qy >> qps) * qp_stride;
> +row_fdct_s(block , p->src + y * stride + 2 - (y&1) , stride , 2);
> +for (x0 = 0 ; x0 < width + 8 - 8 * (BLOCKSZ - 1) ; x0 += 8 * 
> (BLOCKSZ - 1)) {
> +row_fdct_s(block + 8 * 8 , p->src + y * stride + 8 + x0 + 2 - 
> (y&1) , stride , 2 * (BLOCKSZ - 1));
> +if(p->qp)
> +column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block + 0 * 
> 8 , block3 + 0 * 8 , 8 * (BLOCKSZ - 1)); //yes, this is a HOTSPOT
> +else
> +for (x = 0 ; x < 8 * (BLOCKSZ - 1) ; x += 8) {
> +t = x + x0 -2; //correct t=x+x0-2-(y&1), but its the same
> +if (t<0) t = 0;//t always < width-2
> +t = qp_store[qy+(t >> qps)];
> +t = norm_qscale(t, p->qscale_type);
> +if (t != p->prev_q) p->prev_q = t, mul_thrmat_s(p, t);
> +column_fidct_s((int16_t*)(&p->threshold_mtx[0]) , block 
> + x * 8 , block3 + x * 8 , 8); //yes, this is a HOTSPOT
> +}
> +row_idct_s(block3 + 0*8 , p->temp + (y&15) * stride + x0 + 2 - 
> (y&1) , stride , 2 * (BLOCKSZ - 1));
> +memmove(block, block + (BLOCKSZ - 1) * 64 , 8 * 8 * 
> sizeof(int16_t)); //cycling
> +memmove(block3, block3 + (BLOCKSZ - 1) * 64 , 6 * 8 * 
> sizeof(int16_t));
> +}
> +//
> +es = width + 8 - x0; //  8, ...
> +if (es > 8)
> +row_fdct_s(block + 8 * 8 , p->src + y * stride + 8 + x0 + 2 - 
> (y&1) , stride , (es - 4) >> 2);
> +column_fidct_s((int16_t*)(&p->threshold_mtx[0]) , block , block3 , 
> es&(~1));

> +row_idct_s(block3 + 0 * 8 , p->temp + (y&15) * stride + x0 + 2 - 
> (y&1) , stride , es >> 2);
> +const int y1 = y - 8 + step;//l5-7  l4-6

this mixes declaration and statents, some compilers have problems
with that


[...]
> +static void mul_thrmat_mmx(FSPPContext *p, int q) {
> +uint64_t *adr = &p->threshold_mtx_noq[0];
> +__asm__ volatile(
> +"movd %0, %%mm7\n\t"
> +"add $8*8*2, %%"REG_D"\n\t"
> +"movq 0*8(%%"REG_S"), %%mm0\n\t"
> +"punpcklwd %%mm7, %%mm7\n\t"
> +"movq 1*8(%%"REG_S"), %%mm1\n\t"
> +"punpckldq %%mm7, %%mm7\n\t"
> +"pmullw %%mm7, %%mm0   \n\t"
> +
> +"movq 2*8(%%"REG_S"), %%mm2\n\t"
> +"pmullw %%mm7, %%mm1   \n\t"
> +
> +"movq 3*8(%%"REG_S"), %%mm3\n\t"
> +"pmullw %%mm7, %%mm2   \n\t"
> +
> +"movq %%mm0, 0*8(%%"REG_D")\n\t"
> +"movq 4*8(%%"REG_S"), %%mm4\n\t"
> +"pmullw %%mm7, %%mm3   \n\t"
> +
> +"movq %%mm1, 1*8(%%"REG_D")\n\t"
> +"movq 5*8(%%"REG_S"), %%mm5\n\t"
> +"pmullw %%mm7, %%mm4   \n\t"
> +
> +"movq %%mm2, 2*8(%%"REG_D")\n\t"
> +"movq 6*8(%%"REG_S"), %%mm6\n\t"
> +"pmullw %%mm7, 

[FFmpeg-devel] [PATCH] lavd/alsa-audio-common: dont crash while closing not opened device

2014-12-14 Thread Lukasz Marek
snd_pcm_close() doesn't handle NULL correctly.

Signed-off-by: Lukasz Marek 
---
 libavdevice/alsa-audio-common.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavdevice/alsa-audio-common.c b/libavdevice/alsa-audio-common.c
index b7f5313..fff21a1 100644
--- a/libavdevice/alsa-audio-common.c
+++ b/libavdevice/alsa-audio-common.c
@@ -303,7 +303,10 @@ av_cold int ff_alsa_close(AVFormatContext *s1)
 av_freep(&s->reorder_buf);
 if (CONFIG_ALSA_INDEV)
 ff_timefilter_destroy(s->timefilter);
-snd_pcm_close(s->h);
+if (s->h) {
+snd_pcm_close(s->h);
+s->h = NULL;
+}
 return 0;
 }
 
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH] avformat: add dump_metadata_lines

2014-12-14 Thread Michael Niedermayer
On Fri, Dec 12, 2014 at 12:13:29PM +0100, wm4 wrote:
[...]

> If you really want to reduce rampant code duplication, improve the API
> so that you don't need tons of boilerplate to do ANYTHING. Basically,
> most code examples should be tiny and simple, instead of big and buggy
> like they are now.

yes


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

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please


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


Re: [FFmpeg-devel] [PATCH] cmdutils: dont call read_header before listing devices

2014-12-14 Thread Lukasz Marek

On 15.12.2014 00:33, Lukasz Marek wrote:

List device callback must be able to return valid list without opening device.
This callback should return input values for open function, not vice-versa.
Read header funtion is very likey to fail without proper configuration provided.

Signed-off-by: Lukasz Marek 
---
  cmdutils.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 06ce5d5..51fd777 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -2069,9 +2069,8 @@ static int print_device_sources(AVInputFormat *fmt, 
AVDictionary *opts)
  goto fail;
  }

-/* TODO: avformat_open_input calls read_header callback which is not 
necessary.
- Function like avformat_alloc_output_context2 for input could be 
helpful here. */
  av_dict_copy(&tmp_opts, opts, 0);
+dev->flags |= AVFMT_FLAG_PRIV_OPT;
  if ((ret = avformat_open_input(&dev, NULL, fmt, &tmp_opts)) < 0) {
  printf("Cannot open device: %s.\n", fmt->name);
  goto fail;



I forgot to amend. Updated patch attached.
>From 332bb7456c498518ea72dfdaa0e8c3e76d383f21 Mon Sep 17 00:00:00 2001
From: Lukasz Marek 
Date: Mon, 15 Dec 2014 00:31:42 +0100
Subject: [PATCH] cmdutils: dont call read_header before listing devices

List device callback must be able to return valid list without opening device.
This callback should return input values for open function, not vice-versa.
Read header funtion is very likey to fail without proper configuration provided.

Signed-off-by: Lukasz Marek 
---
 cmdutils.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 06ce5d5..3e932db 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -2069,9 +2069,13 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
 goto fail;
 }
 
-/* TODO: avformat_open_input calls read_header callback which is not necessary.
- Function like avformat_alloc_output_context2 for input could be helpful here. */
 av_dict_copy(&tmp_opts, opts, 0);
+dev = avformat_alloc_context();
+if (!dev) {
+ret = AVERROR(ENOMEM);
+goto fail;
+}
+dev->flags |= AVFMT_FLAG_PRIV_OPT;
 if ((ret = avformat_open_input(&dev, NULL, fmt, &tmp_opts)) < 0) {
 printf("Cannot open device: %s.\n", fmt->name);
 goto fail;
-- 
1.9.1

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


[FFmpeg-devel] [PATCH] cmdutils: dont call read_header before listing devices

2014-12-14 Thread Lukasz Marek
List device callback must be able to return valid list without opening device.
This callback should return input values for open function, not vice-versa.
Read header funtion is very likey to fail without proper configuration provided.

Signed-off-by: Lukasz Marek 
---
 cmdutils.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 06ce5d5..51fd777 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -2069,9 +2069,8 @@ static int print_device_sources(AVInputFormat *fmt, 
AVDictionary *opts)
 goto fail;
 }
 
-/* TODO: avformat_open_input calls read_header callback which is not 
necessary.
- Function like avformat_alloc_output_context2 for input could be 
helpful here. */
 av_dict_copy(&tmp_opts, opts, 0);
+dev->flags |= AVFMT_FLAG_PRIV_OPT;
 if ((ret = avformat_open_input(&dev, NULL, fmt, &tmp_opts)) < 0) {
 printf("Cannot open device: %s.\n", fmt->name);
 goto fail;
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH 2/2] lavd/avdevice: use better option types for caps options

2014-12-14 Thread Lukasz Marek

On 13.12.2014 23:11, Michael Niedermayer wrote:

On Sat, Dec 13, 2014 at 08:27:08PM +0100, Lukasz Marek wrote:

Using dedicated types allows to use format/layout names,
not just raw int values.

Signed-off-by: Lukasz Marek 


LGTM


pushed this one. first from patchset dropped.

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


Re: [FFmpeg-devel] [PATCH] cmdutils: use macros for device test

2014-12-14 Thread Lukasz Marek

On 13.12.2014 20:03, Michael Niedermayer wrote:

On Sat, Dec 13, 2014 at 07:54:57PM +0100, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek 
---
  cmdutils.c | 7 +--
  1 file changed, 1 insertion(+), 6 deletions(-)


LGTM


pushed

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


Re: [FFmpeg-devel] [PATCH] lavd/alsa-audio-common: mark default device in device list

2014-12-14 Thread Lukasz Marek

On 14.12.2014 17:10, Nicolas George wrote:

Le tridi 23 frimaire, an CCXXIII, Lukasz Marek a écrit :

Signed-off-by: Lukasz Marek 
---
  libavdevice/alsa-audio-common.c | 2 ++
  1 file changed, 2 insertions(+)


Looks right, thanks.


pushed

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


Re: [FFmpeg-devel] [PATCH]Fix leak reading invalid mxf files

2014-12-14 Thread Tomas Härdin
On Sat, 2014-12-13 at 13:18 +0100, Carl Eugen Hoyos wrote:
> On Friday 12 December 2014 01:43:19 pm Tomas Härdin wrote:
> > On Wed, 2014-12-10 at 11:30 +0100, Carl Eugen Hoyos wrote:
> > > Hi!
> > >
> > > Attached patch fixes ticket #4173 for me.
> > > To be split in two parts.
> > >
> > > Please comment, Carl Eugen
> >
> > Looks alright. Maybe you want to pass it a MXFMetadataSet** 
> > so you can use av_freep() like before?
> 
> New patch attached that also fixes the remaining leaks from 
> ticket #4173.
> I would split in two parts, please tell me if you prefer 
> more separate commits.

Eh, it's small enough that it's clear what the patch does.

(sorry for being a bit slow with replying - I check the list about once
per week)

/Tomas


signature.asc
Description: This is a digitally signed message part
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] mjpeg2jpeg_filter

2014-12-14 Thread Don Moir
I needed to convert AVI1 to normal jpeg. This happens a lot with camera streams 
and the code in mjpeg2jpeg_filter works fine.

I was looking at the code in mjpeg2jpeg_filter in file mjpeg2jpeg_bsf.c and 
noticing that just creates a constant array of bytes each time for the 
replacement header.

Unless I am missing something, those bytes could just be declared in a const 
array rather then building it each frame. Not sure if the values in the various 
const arrays are subject to change or not and just an observation.

The only thing variable appears to be the input_skip value.

Here's the code. 

These 2 just build a constant array of (sizeof(jpeg_header) + dht_segment_size) 
bytes.  dht_segment_size is a const.

out = append(out, jpeg_header, sizeof(jpeg_header));
out = append_dht_segment(out);

static int mjpeg2jpeg_filter(AVBitStreamFilterContext *bsfc,
 AVCodecContext *avctx, const char *args,
 uint8_t **poutbuf, int *poutbuf_size,
 const uint8_t *buf, int buf_size,
 int keyframe)
{
int input_skip, output_size;
uint8_t *output, *out;

if (buf_size < 12) {
av_log(avctx, AV_LOG_ERROR, "input is truncated\n");
return AVERROR_INVALIDDATA;
}
if (memcmp("AVI1", buf + 6, 4)) {
av_log(avctx, AV_LOG_ERROR, "input is not MJPEG/AVI1\n");
return AVERROR_INVALIDDATA;
}
input_skip = (buf[4] << 8) + buf[5] + 4;
if (buf_size < input_skip) {
av_log(avctx, AV_LOG_ERROR, "input is truncated\n");
return AVERROR_INVALIDDATA;
}
output_size = buf_size - input_skip +
  sizeof(jpeg_header) + dht_segment_size;
output = out = av_malloc(output_size);
if (!output)
return AVERROR(ENOMEM);
out = append(out, jpeg_header, sizeof(jpeg_header));
out = append_dht_segment(out);
out = append(out, buf + input_skip, buf_size - input_skip);
*poutbuf = output;
*poutbuf_size = output_size;
return 1;
}
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavd/alsa-audio-common: mark default device in device list

2014-12-14 Thread Nicolas George
Le tridi 23 frimaire, an CCXXIII, Lukasz Marek a écrit :
> Signed-off-by: Lukasz Marek 
> ---
>  libavdevice/alsa-audio-common.c | 2 ++
>  1 file changed, 2 insertions(+)

Looks right, thanks.

Regards,

-- 
  Nicolas George


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: Implement subtitle charenc guessing

2014-12-14 Thread Nicolas George
Le tridi 23 frimaire, an CCXXIII, Carl Eugen Hoyos a écrit :
> Imo, if your distribution contains the libraries 
> but does not install them by default, it is a 
> good indication that we should not auto-detect 
> them.

This is a matter of taste. FFmpeg has that policy, but MPlayer, on the other
hand, has the policy "if it is present on the system, enable it". I believe
most programs adopt the same policy as MPlayer for features that can not
normally cause problems when unused.

By the way, I would very much like (but not enough to start working on it
right now, sorry) to have the "--enable-auto" option to enable
auto-detection for all external libraries. Amongst other things, that would
allow MPlayer's configure to call FFmpeg's instead of reimplementing it.

Regards,

-- 
  Nicolas George


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: Implement subtitle charenc guessing

2014-12-14 Thread Nicolas George
Le tridi 23 frimaire, an CCXXIII, Rodger Combs a écrit :
> I couldn't see a sensible way to do this in lavc, since the detector
> libraries generally require more than one packet to work effectively.
> Looking at that doxy again, I can see how the detection could be done in
> lavf and the conversion in lavc, but I don't really see an advantage there
> other than fewer API changes.

There is no benefit in doing the conversion in lavc for text files, but text
files processed by lavf are not the only source of subtitles. The conversion
in lavc must stay there for those cases, and the conversion in lavf must
work gracefully with it.

> So, by default it'd just handle encoding, and then additional
> normalization features could be enabled by the consumer? Sounds useful
> indeed.

Something like that. You can have a look at the first draft for the API
there:

http://ffmpeg.org/pipermail/ffmpeg-devel/2013-August/146979.html

Splitting lines and normalizing LF was enabled by a flag.

The API itself will probably need to be changed to allow pluggable detection
modules without using more global state.

> I like this model in general, but it brings up a few questions that I kind
> of dodged in my patch. For instance, how should lavu determine which
> module's output to prefer if there are conflicting charenc guesses? How
> can the consumer choose between the given guesses?

> In my patch, preference is very simplistic and the order is hardcoded. In
> a more modular system, it'd have to be a bit more complex; I can imagine
> some form of scoring system, or even another type of module that ranks
> possible guesses, but that could get very complex very fast. Any ideas for
> this?

In this case, I believe that keeping simple at API level is the best
approach: the detection state is held in a structure, each detection module
is called in turn with the same structure and update it with its result.

Then, it is only a matter of specifying what an acceptable "update" is: only
change a value if the new value is more sure than the previous one.

As for the exact fields that must be present in the structure, that depends
on the exact useful information each relevant libraries can return.

> In my patch, the consumer can override the choice of encoding by making
> changes to the AVFormatContext between "header reading" and retrieving the
> packet; it seems like the best way to do so in your system would be to
> pass a callback.

Can you explain in what situation this kind of overriding would be
necessary?

> On a bit of a side-note: my system is designed to make every possible
> effort to return a recoded packet, with multiple layers of fallback
> behavior in case the first guess turns out to be incorrect or the source
> file is outright invalid. I wouldn't expect that to be significantly more
> difficult with your design, but I wonder what your opinions on the setup
> are?

For this, I believe this is on a per-user basis. Some users want that
everything works automagically, some users want to be notified even if the
smallest detail goes unexpected. In the end, it should probably come to an
option:

ffmpeg -text_encoding certainty_threshold=80:allow_substitute=invalid

for example, to accept a guess only when it has at least 80% certainty and
allow to replace invalid input sequences by a mask character.

> So, the text-file-read API would buffer the entire input file and perform
> charenc detection/conversion and/or other normalization, then FFTextReader
> would read from the normalized buffer?

Something like that. Since FFTextReader is internal, there is room to choose
the exact implementation.

Regards,

-- 
  Nicolas George


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


[FFmpeg-devel] [PATCH 2/2] Move AVSubtitle from lavc to lavu

2014-12-14 Thread Clément Bœsch
---
 doc/APIchanges   |   5 +++
 libavcodec/avcodec.h |  63 +++---
 libavcodec/utils.c   |  29 +++---
 libavcodec/version.h |   3 ++
 libavutil/Makefile   |   2 +
 libavutil/subtitle.c |  62 +
 libavutil/subtitle.h | 107 +++
 7 files changed, 191 insertions(+), 80 deletions(-)
 create mode 100644 libavutil/subtitle.c
 create mode 100644 libavutil/subtitle.h

diff --git a/doc/APIchanges b/doc/APIchanges
index ba7eae1..989794a 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,11 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2014-12-xx - xxx - lavc 56.16.100 / lavu 54.17.100 - lavc/avcodec.h 
lavu/picture.h
+  Move AVSubtitle definition from libavcodec to libavutil and add
+  av_subtitle_*() functions which should be used instead of stack allocation
+  and the now deprecated avsubtitle_free().
+
 2014-12-xx - xxx - lavc 56.15.100 / lavu 54.16.100 - lavc/avcodec.h 
lavu/picture.h
   Move AVPicture definition from libavcodec to libavutil. This should be
   transparent API and ABI wise.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 2c1918d..6ded06b 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -40,6 +40,7 @@
 #include "libavutil/picture.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/rational.h"
+#include "libavutil/subtitle.h"
 
 #include "version.h"
 
@@ -3149,8 +3150,6 @@ typedef struct AVProfile {
 
 typedef struct AVCodecDefault AVCodecDefault;
 
-struct AVSubtitle;
-
 /**
  * AVCodec.
  */
@@ -3401,61 +3400,6 @@ typedef struct AVHWAccel {
  * @}
  */
 
-enum AVSubtitleType {
-SUBTITLE_NONE,
-
-SUBTITLE_BITMAP,///< A bitmap, pict will be set
-
-/**
- * Plain text, the text field must be set by the decoder and is
- * authoritative. ass and pict fields may contain approximations.
- */
-SUBTITLE_TEXT,
-
-/**
- * Formatted text, the ass field must be set by the decoder and is
- * authoritative. pict and text fields may contain approximations.
- */
-SUBTITLE_ASS,
-};
-
-#define AV_SUBTITLE_FLAG_FORCED 0x0001
-
-typedef struct AVSubtitleRect {
-int x; ///< top left corner  of pict, undefined when pict is not 
set
-int y; ///< top left corner  of pict, undefined when pict is not 
set
-int w; ///< widthof pict, undefined when pict is not 
set
-int h; ///< height   of pict, undefined when pict is not 
set
-int nb_colors; ///< number of colors in pict, undefined when pict is not 
set
-
-/**
- * data+linesize for the bitmap of this subtitle.
- * can be set for text/ass as well once they are rendered
- */
-AVPicture pict;
-enum AVSubtitleType type;
-
-char *text; ///< 0 terminated plain UTF-8 text
-
-/**
- * 0 terminated ASS/SSA compatible event line.
- * The presentation of this is unaffected by the other values in this
- * struct.
- */
-char *ass;
-
-int flags;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
-uint16_t format; /* 0 = graphics */
-uint32_t start_display_time; /* relative to packet pts, in ms */
-uint32_t end_display_time; /* relative to packet pts, in ms */
-unsigned num_rects;
-AVSubtitleRect **rects;
-int64_t pts;///< Same as packet pts, in AV_TIME_BASE
-} AVSubtitle;
-
 /**
  * If c is NULL, returns the first registered codec,
  * if c is non-NULL, returns the next registered codec after c,
@@ -3652,12 +3596,17 @@ int avcodec_open2(AVCodecContext *avctx, const AVCodec 
*codec, AVDictionary **op
  */
 int avcodec_close(AVCodecContext *avctx);
 
+#if FF_API_AVSUBTITLE
 /**
  * Free all allocated data in the given subtitle struct.
+ * @deprecated use av_subtitle_*() functions (the immediate equivalent of
+ * avsubtitle_free() is av_subtitle_clear())
  *
  * @param sub AVSubtitle to free.
  */
+attribute_deprecated
 void avsubtitle_free(AVSubtitle *sub);
+#endif
 
 /**
  * @}
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index db79b67..dc0c1ec 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -39,6 +39,7 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/samplefmt.h"
+#include "libavutil/subtitle.h"
 #include "libavutil/dict.h"
 #include "avcodec.h"
 #include "libavutil/opt.h"
@@ -1270,12 +1271,6 @@ int av_codec_get_max_lowres(const AVCodec *codec)
 return codec->max_lowres;
 }
 
-static void get_subtitle_defaults(AVSubtitle *sub)
-{
-memset(sub, 0, sizeof(*sub));
-sub->pts = AV_NOPTS_VALUE;
-}
-
 static int get_bit_rate(AVCodecContext *ctx)
 {
 int bit_rate;
@@ -2706,7 +2701,7 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, 
AVSubtitle *sub,
 }
 
 *got_sub_ptr = 0;
-get_subtitle_defaults(sub);
+av_subtitle_get_defaults(sub);
 
 if ((avctx->codec->capabilities & 

[FFmpeg-devel] [PATCH 1/2] Move AVPicture definition from lavc to lavu

2014-12-14 Thread Clément Bœsch
This is necessary before moving AVSubtitle* structures.
---
 doc/APIchanges   |  4 
 libavcodec/avcodec.h | 25 ++---
 libavcodec/version.h |  2 +-
 libavutil/Makefile   |  1 +
 libavutil/picture.h  | 37 +
 libavutil/version.h  |  2 +-
 6 files changed, 46 insertions(+), 25 deletions(-)
 create mode 100644 libavutil/picture.h

diff --git a/doc/APIchanges b/doc/APIchanges
index 5b0e1e5..ba7eae1 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,10 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2014-12-xx - xxx - lavc 56.15.100 / lavu 54.16.100 - lavc/avcodec.h 
lavu/picture.h
+  Move AVPicture definition from libavcodec to libavutil. This should be
+  transparent API and ABI wise.
+
 2014-12-04 - xxx - lavc 56.14.100 - dv_profile.h
   Add av_dv_codec_profile2().
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 4b6b00c..2c1918d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -37,6 +37,7 @@
 #include "libavutil/dict.h"
 #include "libavutil/frame.h"
 #include "libavutil/log.h"
+#include "libavutil/picture.h"
 #include "libavutil/pixfmt.h"
 #include "libavutil/rational.h"
 
@@ -3400,28 +3401,6 @@ typedef struct AVHWAccel {
  * @}
  */
 
-/**
- * @defgroup lavc_picture AVPicture
- *
- * Functions for working with AVPicture
- * @{
- */
-
-/**
- * Picture data structure.
- *
- * Up to four components can be stored into it, the last component is
- * alpha.
- */
-typedef struct AVPicture {
-uint8_t *data[AV_NUM_DATA_POINTERS];///< pointers to the image data 
planes
-int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line
-} AVPicture;
-
-/**
- * @}
- */
-
 enum AVSubtitleType {
 SUBTITLE_NONE,
 
@@ -4676,7 +4655,7 @@ void av_resample_close(struct AVResampleContext *c);
 #endif
 
 /**
- * @addtogroup lavc_picture
+ * Functions for working with AVPicture
  * @{
  */
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index ef439d6..6610e8c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR  14
+#define LIBAVCODEC_VERSION_MINOR  15
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavutil/Makefile b/libavutil/Makefile
index c1aa8aa..ad703db 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -44,6 +44,7 @@ HEADERS = adler32.h   
  \
   old_pix_fmts.h\
   opt.h \
   parseutils.h  \
+  picture.h \
   pixdesc.h \
   pixelutils.h  \
   pixfmt.h  \
diff --git a/libavutil/picture.h b/libavutil/picture.h
new file mode 100644
index 000..825dd9d
--- /dev/null
+++ b/libavutil/picture.h
@@ -0,0 +1,37 @@
+/*
+ * 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
+ */
+
+#ifndef AVUTIL_PICTURE_H
+#define AVUTIL_PICTURE_H
+
+#include 
+
+#include "frame.h" // for AV_NUM_DATA_POINTERS
+
+/**
+ * Picture data structure.
+ *
+ * Up to four components can be stored into it, the last component is
+ * alpha.
+ */
+typedef struct AVPicture {
+uint8_t *data[AV_NUM_DATA_POINTERS];///< pointers to the image data 
planes
+int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line
+} AVPicture;
+
+#endif
diff --git a/libavutil/version.h b/libavutil/version.h
index c19e943..a1ed502 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,7 +56,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  54
-#define LIBAVUTIL_VERSION_MINOR  15
+#define LIBAVUTIL_VERSION_MINOR  16
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.1.3

___
ffmpeg-devel mailing list
ffmpeg-devel

[FFmpeg-devel] (no subject)

2014-12-14 Thread Clément Bœsch
Hi,

I'm moving the AVPicture structure to lavu because it's necessary for moving
the AVSubtitle* structures. After the two patchs, the AVSubtitle are unchanged
and available in libavutil with new functions:

 • AVSubtitle *av_subtitle_alloc(void);
 • void av_subtitle_get_defaults(AVSubtitle *sub);
 • void av_subtitle_clear(AVSubtitle *sub);
 • void av_subtitle_free(AVSubtitle **sub);

I let you read the doxy but they're straightforward.

After this commit, we can consider adding fields more easily, and more
interesting, we start considering the integration within libavfilter.

We also need to actually use this new API (yeah i know...); typically I don't
even know how we want to deal with code such as the one in ffmpeg.c which is
stack/sizeof swapping AVSubtitles. We should probably introduce a
av_subtitle_copy() and/or av_subtitle_copy_props().

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


Re: [FFmpeg-devel] [PATCH] lavfi: add colorlevels filter

2014-12-14 Thread Michael Niedermayer
On Wed, Dec 10, 2014 at 02:26:51PM +, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  doc/filters.texi |  41 +++
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/vf_colorlevels.c | 254 
> +++
>  4 files changed, 297 insertions(+)
>  create mode 100644 libavfilter/vf_colorlevels.c
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 0ea3955..444dfda 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -2934,6 +2934,47 @@ colorbalance=rs=.3
>  @end example
>  @end itemize
>  
> +@section colorlevels
> +
> +Adjust video input frames using levels.
> +
> +The filter accepts the following options:
> +
> +@table @option
> +@item rimim
> +@item gimin
> +@item bimin
> +@item aimin
> +Adjust red, green, blue and alpha input black point.
> +Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{0}.
> +
> +@item rimax
> +@item gimax
> +@item bimax
> +@item aimax
> +Adjust red, green, blue and alpha input white point.
> +Allowed ranges for options are @code{[-1.0, 1.0]}. Defaults are @code{1}.
> +
> +Input levels are used to lighten highlights (bright tones), darken shadows
> +(dark tones), change the balance of bright and dark tones.
> +
> +@item romim
> +@item gomin
> +@item bomin
> +@item aomin
> +Adjust red, green, blue and alpha output black point.
> +Allowed ranges for options are @code{[0, 1.0]}. Defaults are @code{0}.
> +
> +@item romax
> +@item gomax
> +@item bomax
> +@item aomax
> +Adjust red, green, blue and alpha output white point.
> +Allowed ranges for options are @code{[0, 1.0]}. Defaults are @code{1}.
> +
> +Output levels allows manual selection of a constrained output level range.
> +@end table
> +
>  @section colorchannelmixer
>  
>  Adjust video input frames by re-mixing color channels.
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 2c56e38..5918e10 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -100,6 +100,7 @@ OBJS-$(CONFIG_BOXBLUR_FILTER)+= 
> vf_boxblur.o
>  OBJS-$(CONFIG_CODECVIEW_FILTER)  += vf_codecview.o
>  OBJS-$(CONFIG_COLORBALANCE_FILTER)   += vf_colorbalance.o
>  OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER)  += vf_colorchannelmixer.o
> +OBJS-$(CONFIG_COLORLEVELS_FILTER)+= vf_colorlevels.o
>  OBJS-$(CONFIG_COLORMATRIX_FILTER)+= vf_colormatrix.o
>  OBJS-$(CONFIG_COPY_FILTER)   += vf_copy.o
>  OBJS-$(CONFIG_CROP_FILTER)   += vf_crop.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 2352d44..721a65d 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -116,6 +116,7 @@ void avfilter_register_all(void)
>  REGISTER_FILTER(CODECVIEW,  codecview,  vf);
>  REGISTER_FILTER(COLORBALANCE,   colorbalance,   vf);
>  REGISTER_FILTER(COLORCHANNELMIXER, colorchannelmixer, vf);
> +REGISTER_FILTER(COLORLEVELS,colorlevels,vf);
>  REGISTER_FILTER(COLORMATRIX,colormatrix,vf);
>  REGISTER_FILTER(COPY,   copy,   vf);
>  REGISTER_FILTER(CROP,   crop,   vf);
> diff --git a/libavfilter/vf_colorlevels.c b/libavfilter/vf_colorlevels.c
> new file mode 100644
> index 000..4ceea66
> --- /dev/null
> +++ b/libavfilter/vf_colorlevels.c
> @@ -0,0 +1,254 @@
> +/*
> + * Copyright (c) 2013 Paul B Mahol
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include "libavutil/imgutils.h"
> +#include "libavutil/opt.h"
> +#include "libavutil/pixdesc.h"
> +#include "avfilter.h"
> +#include "drawutils.h"
> +#include "formats.h"
> +#include "internal.h"
> +#include "video.h"
> +
> +#define R 0
> +#define G 1
> +#define B 2
> +#define A 3
> +
> +typedef struct {
> +double in_min, in_max;
> +double out_min, out_max;
> +} Range;
> +
> +typedef struct {
> +const AVClass *class;
> +Range range[4];
> +int nb_comp;
> +int bpp;
> +int step;
> +uint8_t rgba_map[4];
> +int linesize;
> +} ColorLevelsContext;
> +
> +#define OFFSET(x) offsetof(ColorLevelsContext, x)
> +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> +st

Re: [FFmpeg-devel] [PATCH] avcodec/xiph: mark returned header pointers const from avpriv_split_xiph_headers()

2014-12-14 Thread Michael Niedermayer
On Sun, Dec 14, 2014 at 11:29:52AM +0100, Reimar Döffinger wrote:
> On 12.12.2014, at 14:46, Michael Niedermayer  wrote:
> > Signed-off-by: Michael Niedermayer 
> 
> Should be fine.

applied

thanks

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

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


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


Re: [FFmpeg-devel] [PATCH] lavfi: Port fspp to FFmpeg

2014-12-14 Thread Carl Eugen Hoyos
arwa arif  gmail.com> writes:

> I have tried to port fspp. Not sure, if it is 
> correct or not.

Did you compare the output of -vf fspp and -vf mp=fspp?

> +av_cold void ff_fspp_init_x86(FSPPContext *s)
> +{
> +#if HAVE_MMX_INLINE
> +int cpu_flags = av_get_cpu_flags();
> +
> +if (cpu_flags & AV_CPU_FLAG_MMX) {
> +
> +#define store_slice_s store_slice_mmx
> +#define store_slice2_s store_slice2_mmx
> +#define mul_thrmat_s mul_thrmat_mmx
> +#define column_fidct_s column_fidct_mmx
> +#define row_idct_s row_idct_mmx
> +#define row_fdct_s row_fdct_mmx

This does not look correct:
You have to add function pointers to FSPPContext 
and these have to be initialized in init() and 
overwritten in ff_fspp_init_x86() if mmx is 
available.
See commits a2c547ff and 852f74bd by Clement 
for reference:
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=a2c547ff
http://git.videolan.org/?p=ffmpeg.git;a=commitdiff;h=852f74bd

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] avcodec/xiph: mark returned header pointers const from avpriv_split_xiph_headers()

2014-12-14 Thread Reimar Döffinger
On 12.12.2014, at 14:46, Michael Niedermayer  wrote:
> Signed-off-by: Michael Niedermayer 

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