[FFmpeg-devel] [PATCH] avcodec: Remove libutvideo support

2016-02-10 Thread Derek Buitenhuis
* Upstream libutvideo doesn't build as a lib, and Linux is not supported.
  It has no API.
* The fork that was used as an argument to keep support is *also* broken and
  unmaintained now, and it's maintainer/author is fine with removal.
* A third fork on github, *also* doesn't work.
* The only working library that I can find is a package for an obscure distro,
  in German only, with a bunch of patches applied.
* The ASM in libutvideo doesn't even work on x86_64.
* More, I'm sure others can fill in.

Signed-off-by: Derek Buitenhuis 
---
 Changelog|   1 +
 LICENSE.md   |   3 -
 MAINTAINERS  |   1 -
 configure|   6 -
 libavcodec/Makefile  |   3 -
 libavcodec/allcodecs.c   |   1 -
 libavcodec/libutvideo.h  |  72 ---
 libavcodec/libutvideodec.cpp | 272 -
 libavcodec/libutvideoenc.cpp | 281 ---
 libavcodec/version.h |   4 +-
 10 files changed, 3 insertions(+), 641 deletions(-)
 delete mode 100644 libavcodec/libutvideo.h
 delete mode 100644 libavcodec/libutvideodec.cpp
 delete mode 100644 libavcodec/libutvideoenc.cpp

diff --git a/Changelog b/Changelog
index 749eb61..424434d 100644
--- a/Changelog
+++ b/Changelog
@@ -67,6 +67,7 @@ version :
 - streamselect video and astreamselect audio filter
 - swaprect filter
 - metadata video and ametadata audio filter
+- libutvideo encoder and decoder removed
 
 
 version 2.8:
diff --git a/LICENSE.md b/LICENSE.md
index 0c53d0f..6c45705 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -17,8 +17,6 @@ Specifically, the GPL parts of FFmpeg are:
   - `libavcodec/x86/flac_dsp_gpl.asm`
   - `libavcodec/x86/idct_mmx.c`
   - `libavfilter/x86/vf_removegrain.asm`
-- libutvideo encoding/decoding wrappers in
-  `libavcodec/libutvideo*.cpp`
 - the X11 grabber in `libavdevice/x11grab.c`
 - the swresample test app in
   `libswresample/swresample-test.c`
@@ -86,7 +84,6 @@ The following libraries are under GPL:
 - frei0r
 - libcdio
 - librubberband
-- libutvideo
 - libvidstab
 - libx264
 - libx265
diff --git a/MAINTAINERS b/MAINTAINERS
index b62a4f8..d7d4af1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -209,7 +209,6 @@ Codecs:
   libschroedinger*  David Conrad
   libspeexdec.c Justin Ruggles
   libtheoraenc.cDavid Conrad
-  libutvideo*   Derek Buitenhuis
   libvorbis.c   David Conrad
   libvpx*   James Zern
   libx264.c Mans Rullgard, Jason Garrett-Glaser
diff --git a/configure b/configure
index 2148f11..90a4169 100755
--- a/configure
+++ b/configure
@@ -251,7 +251,6 @@ External library support:
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
   --enable-libtheora   enable Theora encoding via libtheora [no]
   --enable-libtwolame  enable MP2 encoding via libtwolame [no]
-  --enable-libutvideo  enable Ut Video encoding and decoding via 
libutvideo [no]
   --enable-libv4l2 enable libv4l2/v4l-utils [no]
   --enable-libvidstab  enable video stabilization using vid.stab [no]
   --enable-libvo-amrwbenc  enable AMR-WB encoding via libvo-amrwbenc [no]
@@ -1475,7 +1474,6 @@ EXTERNAL_LIBRARY_LIST="
 libtesseract
 libtheora
 libtwolame
-libutvideo
 libv4l2
 libvidstab
 libvo_amrwbenc
@@ -2637,8 +2635,6 @@ libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
 libtheora_encoder_deps="libtheora"
 libtwolame_encoder_deps="libtwolame"
-libutvideo_decoder_deps="libutvideo"
-libutvideo_encoder_deps="libutvideo"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
 libvorbis_decoder_deps="libvorbis"
 libvorbis_encoder_deps="libvorbis"
@@ -4875,7 +4871,6 @@ die_license_disabled gpl frei0r
 die_license_disabled gpl libcdio
 die_license_disabled gpl librubberband
 die_license_disabled gpl libsmbclient
-die_license_disabled gpl libutvideo
 die_license_disabled gpl libvidstab
 die_license_disabled gpl libx264
 die_license_disabled gpl libx265
@@ -5513,7 +5508,6 @@ enabled libtheora && require libtheora 
theora/theoraenc.h th_info_init -
 enabled libtwolame&& require libtwolame twolame.h twolame_init 
-ltwolame &&
  { check_lib twolame.h 
twolame_encode_buffer_float32_interleaved -ltwolame ||
die "ERROR: libtwolame must be installed and 
version must be >= 0.3.10"; }
-enabled libutvideo&& require_cpp utvideo "stdint.h stdlib.h 
utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
 enabled libv4l2   && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
 enabled libvidstab&& require_pkg_config "vidstab >= 0.98" 
vid.stab/libvidstab.h vsMotionDetectInit
 enabled libvo_amrwbenc&& require libvo_amrwbenc vo-amrwbenc/enc_if.h 
E_IF_init 

[FFmpeg-devel] [PATCH] options_table: update maximum bitrate limit

2016-02-10 Thread Rostislav Pehlivanov
The type of the option has been changed but the limit was apparently forgotten.
Some video codes can handle bitrates of over ~2.2 Gbps (like VC-2).

Signed-off-by: Rostislav Pehlivanov 
---
 libavcodec/options_table.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 75fb093..aa8bfac 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -42,7 +42,7 @@
 #define AV_CODEC_DEFAULT_BITRATE 200*1000
 
 static const AVOption avcodec_options[] = {
-{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 
AV_CODEC_DEFAULT_BITRATE }, 0, INT_MAX, A|V|E},
+{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 
AV_CODEC_DEFAULT_BITRATE }, 0, INT64_MAX, A|V|E},
 {"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 
128*1000 }, 0, INT_MAX, A|E},
 {"bt", "Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate 
tolerance specifies how far "
"ratecontrol is willing to deviate from the target average bitrate 
value. This is not related "
-- 
2.7.0

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


Re: [FFmpeg-devel] [PATCH] avfilter/dualinput: use pts provided from framesync

2016-02-10 Thread Paul B Mahol
On 2/9/16, Paul B Mahol  wrote:
> Hi,
>
> patch attached.
>

This fixes serious bug with overlay filter, so I will apply this soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Tobias Rapp

On 10.02.2016 11:40, Paul B Mahol wrote:

On 2/10/16, Tobias Rapp  wrote:

On 10.02.2016 10:59, Paul B Mahol wrote:

On 2/10/16, Tobias Rapp  wrote:

On 10.02.2016 10:01, Paul B Mahol wrote:

On 2/10/16, Tobias Rapp  wrote:

On 06.02.2016 23:30, Paul B Mahol wrote:

On 2/6/16, Paul B Mahol  wrote:

Hi,

patch attached.



Improved version attached.

[...]
+
+static int string(const char *value1, const char *value2, size_t
length)
+{
+return !strncmp(value1, value2, length);
+}


If I understand correctly this function is used to compare if the start
of value2 matches value1. Maybe this function should be called
"starts_with" (also in the "function" option enum)?


+
+static int equal(const char *value1, const char *value2, size_t
length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 != f2;
+}
+
+static int less(const char *value1, const char *value2, size_t
length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 > f2;
+}
+
+static int greater(const char *value1, const char *value2, size_t
length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 < f2;
+}
+
[...]


I think it would be better to not compare float values directly with
"==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <=
epsilon".

BTW: Is the return value of "equal", "less" and "greater" inverse on
purpose?


Not for equal, but for other it is.


OK, now I got it that the argument order is flipped but matches the
documentation. In that case it is a bit counter-intuitive that one has
to do something like

mode=print:key=mykey:value=1.0:function=less

to print all metadata values of "mykey" which are *bigger* than 1.0.



Nope, this works fine here. It prints values less than 1.0


Then I have problems understanding the documentation text of "less" and
"greater".


Ah, the problem was in documenation and code, hopefully it should be clear now.


Yes, with commit 408ea50ca6bcc666babc8b8e654eb135164480af everything is 
fine.


Thanks for writing the metadata filter! Last week I had an idea for a 
similar filter but had not started implementation yet -- thus my 
interest in it.


Regards,
Tobias

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


Re: [FFmpeg-devel] [PATCH] options_table: update maximum bitrate limit

2016-02-10 Thread Derek Buitenhuis
On 2/10/2016 3:26 PM, Rostislav Pehlivanov wrote:
> The type of the option has been changed but the limit was apparently 
> forgotten.
> Some video codes can handle bitrates of over ~2.2 Gbps (like VC-2).
> 
> Signed-off-by: Rostislav Pehlivanov 
> ---
>  libavcodec/options_table.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Since bit_rate is 64 bits now, I see no issue.

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


Re: [FFmpeg-devel] [PATCH] avcodec: Remove libutvideo support

2016-02-10 Thread Paul B Mahol
On 2/10/16, Carl Eugen Hoyos  wrote:
> Derek Buitenhuis  gmail.com> writes:
>
>> * The ASM in libutvideo doesn't even work on x86_64.
>
> Just to make sure (I am only guessing):
> 32bit libutvideo (on 64bit) is faster than 64bit native decoder / encoder?

Maybe on Windows. On Linux it crashes.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: Remove libutvideo support

2016-02-10 Thread Paul B Mahol
On 2/10/16, Derek Buitenhuis  wrote:
> * Upstream libutvideo doesn't build as a lib, and Linux is not supported.
>   It has no API.
> * The fork that was used as an argument to keep support is *also* broken and
>   unmaintained now, and it's maintainer/author is fine with removal.
> * A third fork on github, *also* doesn't work.
> * The only working library that I can find is a package for an obscure
> distro,
>   in German only, with a bunch of patches applied.
> * The ASM in libutvideo doesn't even work on x86_64.
> * More, I'm sure others can fill in.
>

I'm fine by this, but it would be nice to have SIMD and 10 bit support
in decoder.

I started writing asm but got distracted by other things.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] New task ideas for GSoC and Outreachy

2016-02-10 Thread Kieran Kunhya
Hello,

It seems that we're trotting out the same old GSoC and Outreachy tasks that
students haven't picked for years.

So, in the spirit of open source, I'd like to ask you, the developers and
users what students should work on.

Note that this needs to be a clearly defined task that a student needs to
work on for two months FULL-TIME so it can't just be fixing the odd thing
here and there.

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


Re: [FFmpeg-devel] [PATCH] avcodec: Remove libutvideo support

2016-02-10 Thread Carl Eugen Hoyos
Derek Buitenhuis  gmail.com> writes:

> * The ASM in libutvideo doesn't even work on x86_64.

Just to make sure (I am only guessing):
32bit libutvideo (on 64bit) is faster than 64bit native decoder / encoder?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH 2/2] x86/vf_blend: Add SSE2 optimization for screen

2016-02-10 Thread Paul B Mahol
On 2/9/16, Timothy Gu  wrote:
> ---
>  libavfilter/x86/vf_blend.asm| 29 +
>  libavfilter/x86/vf_blend_init.c |  2 ++
>  2 files changed, 31 insertions(+)
>

Nice!

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


Re: [FFmpeg-devel] [PATCH 1/2] x86/vf_blend: Move multiplying to a macro

2016-02-10 Thread Paul B Mahol
On 2/9/16, Timothy Gu  wrote:
> ---
>  libavfilter/x86/vf_blend.asm | 16 ++--
>  1 file changed, 10 insertions(+), 6 deletions(-)
>

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


Re: [FFmpeg-devel] [PATCH 01/12] avutil/parseutils: use microsecond precision when parsing "now" in av_parse_time()

2016-02-10 Thread Marton Balint


On Sun, 7 Feb 2016, Marton Balint wrote:



On Sun, 7 Feb 2016, Michael Niedermayer wrote:


On Sat, Feb 06, 2016 at 08:13:12PM +0100, Marton Balint wrote:

Use av_gettime() instead of time(0) for querying current time.

Signed-off-by: Marton Balint 
---
 libavutil/parseutils.c| 12 +++-
 tests/ref/fate/parseutils |  4 ++--
 2 files changed, 9 insertions(+), 7 deletions(-)


after this (whole) patchset
./ffmpeg  -i lena.pnm -timestamp "2016-01-01 01:01:01" test.mp4
exiftool test.mp4
results in
Create Date : 1904:01:01 00:00:00
Modify Date : 1904:01:01 00:00:00



Hmm, apparently I missed the fact iso 8601 time specs can have timezone 
specifiers as well, even if they were not parsed but silently ignored by 
the existing function.


I will rework the second patch to fix that.


Anybody against this series? With the issues fixed pointed out by Michael, 
I believe it is pretty safe to apply, the one patch which may need 
consideration is the last one patching ffmpeg_opt.c and removing hardcoded 
"now" support in creation_time metadata because it may cause writing the 
actual string "now" as creation time for formats which do not parse 
creation_time metadata but write all metadata to the output blindly as a 
string.


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


Re: [FFmpeg-devel] List of FFmpeg API changes

2016-02-10 Thread Nicolas George
Le nonidi 19 pluviôse, an CCXXIV, Ponomarenko Andrey a écrit :
> I continue maintaining list of API changes in FFmpeg here:
> http://abi-laboratory.pro/tracker/timeline/ffmpeg/

Interesting. Out of curiosity, is it automated? If so, how do you handle
changes in structure fields, especially for parts of the structure that are
marked public versus private in the documentation?

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 1/2] x86/vf_blend: Move multiplying to a macro

2016-02-10 Thread Timothy Gu
On Wed, Feb 10, 2016 at 08:09:07PM +0100, Paul B Mahol wrote:
> On 2/9/16, Timothy Gu  wrote:
> > ---
> >  libavfilter/x86/vf_blend.asm | 16 ++--
> >  1 file changed, 10 insertions(+), 6 deletions(-)
> >
> 
> ok

Pushed.

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


Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Paul B Mahol
On 2/10/16, Paul B Mahol  wrote:
> On 2/10/16, Michael Niedermayer  wrote:
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  libavutil/pixdesc.c |  105
>> +++
>>  libavutil/pixfmt.h  |   13 +++
>>  2 files changed, 118 insertions(+)
>>
>

[...]

>
> This is all nice, but I do not think swscale infrastructure/design is
> usefriendly for such additions.
>

Also, If you plan to work on it - go for it, I do not want to discourage you.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/2] checkasm: Add vf_blend tests

2016-02-10 Thread Timothy Gu
---
 tests/checkasm/Makefile   |   1 +
 tests/checkasm/checkasm.c |   3 ++
 tests/checkasm/checkasm.h |   1 +
 tests/checkasm/vf_blend.c | 111 ++
 4 files changed, 116 insertions(+)
 create mode 100644 tests/checkasm/vf_blend.c

diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index 07fe5bc..bfd7c11 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -1,5 +1,6 @@
 # libavcodec tests
 AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o
+AVCODECOBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o
 AVCODECOBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
 AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
 AVCODECOBJS-$(CONFIG_FLACDSP)  += flacdsp.o
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 49fd2af..1e73e34 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -68,6 +68,9 @@ static const struct {
 #if CONFIG_ALAC_DECODER
 { "alacdsp", checkasm_check_alacdsp },
 #endif
+#if CONFIG_BLEND_FILTER
+{ "vf_blend", checkasm_check_blend },
+#endif
 #if CONFIG_BSWAPDSP
 { "bswapdsp", checkasm_check_bswapdsp },
 #endif
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index 5c07f89..0c8bc2d 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -31,6 +31,7 @@
 #include "libavutil/timer.h"
 
 void checkasm_check_alacdsp(void);
+void checkasm_check_blend(void);
 void checkasm_check_bswapdsp(void);
 void checkasm_check_flacdsp(void);
 void checkasm_check_fmtconvert(void);
diff --git a/tests/checkasm/vf_blend.c b/tests/checkasm/vf_blend.c
new file mode 100644
index 000..51c4999
--- /dev/null
+++ b/tests/checkasm/vf_blend.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2016 Tiancheng "Timothy" Gu
+ *
+ * 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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 
+#include "checkasm.h"
+#include "libavfilter/blend.h"
+#include "libavutil/common.h"
+#include "libavutil/internal.h"
+#include "libavutil/intreadwrite.h"
+
+#define WIDTH 64
+#define LINESIZE 64
+#define HEIGHT 8
+#define BUF_UNITS 9
+#define SIZE_PER_UNIT (LINESIZE * HEIGHT)
+#define BUF_SIZE (BUF_UNITS * SIZE_PER_UNIT)
+
+#define randomize_buffers() \
+do {\
+int i;  \
+for (i = 0; i < BUF_SIZE; i += 4) { \
+uint32_t r = rnd(); \
+AV_WN32A(top1 + i, r);  \
+AV_WN32A(top2 + i, r);  \
+r = rnd();  \
+AV_WN32A(bot1 + i, r);  \
+AV_WN32A(bot2 + i, r);  \
+r = rnd();  \
+AV_WN32A(dst1 + i, r);  \
+AV_WN32A(dst2 + i, r);  \
+}   \
+} while (0)
+
+#define check_blend_func() 
\
+do {   
\
+int i; 
\
+declare_func(void, const uint8_t *top, ptrdiff_t top_linesize, 
\
+ const uint8_t *bottom, ptrdiff_t bottom_linesize, 
\
+ uint8_t *dst, ptrdiff_t dst_linesize, 
\
+ ptrdiff_t width, ptrdiff_t start, ptrdiff_t end,  
\
+ struct FilterParams *param, double *values);  
\
+   
\
+for (i = 0; i < BUF_UNITS - 1; i++) {  
\
+int src_offset = i * SIZE_PER_UNIT + i; /* Test various alignments 
*/  \
+int dst_offset = i * SIZE_PER_UNIT; /* dst must be aligned */  
\
+randomize_buffers();   
\
+call_ref(top1 + src_offset, LINESIZE, bot1 + src_offset, LINESIZE, 
\
+ dst1 + dst_offset, LINESIZE, WIDTH, 0, HEIGHT, , 
NULL); \
+

Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Paul B Mahol
On 2/10/16, Michael Niedermayer  wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavutil/pixdesc.c |  105
> +++
>  libavutil/pixfmt.h  |   13 +++
>  2 files changed, 118 insertions(+)
>
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index 58833cf..5fda5bd 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  },
>  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>  },
> +[AV_PIX_FMT_YUVA444P32FBE] = {
> +.name = "yuva444p32fbe",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_YUVA444P32FLE] = {
> +.name = "yuva444p32fle",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_YUV444P32FBE] = {
> +.name = "yuv444p32fbe",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
> +},
> +[AV_PIX_FMT_YUV444P32FLE] = {
> +.name = "yuv444p32fle",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR,
> +},
> +
>  #if FF_API_VDPAU
>  [AV_PIX_FMT_VDPAU_H264] = {
>  .name = "vdpau_h264",
> @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>  },
> +[AV_PIX_FMT_GBRAP32FLE] = {
> +.name = "gbrap32fle",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_GBRAP32FBE] = {
> +.name = "gbrap32fbe",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_GBRP32FLE] = {
> +.name = "gbrp32fle",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB,
> +},
> +[AV_PIX_FMT_GBRP32FBE] = {
> +.name = "gbrp32fbe",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB,
> +},
>  

Re: [FFmpeg-devel] New task ideas for GSoC and Outreachy

2016-02-10 Thread Michael Niedermayer
On Wed, Feb 10, 2016 at 04:21:09PM +, Kieran Kunhya wrote:
> Hello,
> 
> It seems that we're trotting out the same old GSoC and Outreachy tasks that
> students haven't picked for years.
> 
> So, in the spirit of open source, I'd like to ask you, the developers and
> users what students should work on.

one thing is swscale cleanup and improvments
the last years GSoC has lead to some nice restructuring but theres
alot more that can be done. float support, multithreading support
and a lot more besides more general cleanup along the way
one advantange of swscale work is also that there are many idividual
and seperate tasks possible, which gives this some flexibility
in terms of the amount of work and allows individual adjustment
depending on the students ability and performace during the summer


> 
> Note that this needs to be a clearly defined task that a student needs to
> work on for two months FULL-TIME so it can't just be fixing the odd thing
> here and there.
> 
> Regards,
> Kieran Kunhya
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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


Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread wm4
On Wed, 10 Feb 2016 21:56:07 +0100
Michael Niedermayer  wrote:

> Signed-off-by: Michael Niedermayer 
> ---
>  libavutil/pixdesc.c |  105 
> +++
>  libavutil/pixfmt.h  |   13 +++
>  2 files changed, 118 insertions(+)
> 
> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> index 58833cf..5fda5bd 100644
> --- a/libavutil/pixdesc.c
> +++ b/libavutil/pixdesc.c
> @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor 
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  },
>  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>  },
> +[AV_PIX_FMT_YUVA444P32FBE] = {
> +.name = "yuva444p32fbe",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | 
> AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_YUVA444P32FLE] = {
> +.name = "yuva444p32fle",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_YUV444P32FBE] = {
> +.name = "yuv444p32fbe",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
> +},
> +[AV_PIX_FMT_YUV444P32FLE] = {
> +.name = "yuv444p32fle",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR,
> +},
> +
>  #if FF_API_VDPAU
>  [AV_PIX_FMT_VDPAU_H264] = {
>  .name = "vdpau_h264",
> @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor 
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>  },
> +[AV_PIX_FMT_GBRAP32FLE] = {
> +.name = "gbrap32fle",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_GBRAP32FBE] = {
> +.name = "gbrap32fbe",
> +.nb_components = 4,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> +},
> +[AV_PIX_FMT_GBRP32FLE] = {
> +.name = "gbrp32fle",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +},
> +.flags = AV_PIX_FMT_FLAG_PLANAR |
> + AV_PIX_FMT_FLAG_RGB,
> +},
> +[AV_PIX_FMT_GBRP32FBE] = {
> +.name = "gbrp32fbe",
> +.nb_components = 3,
> +.log2_chroma_w = 0,
> +.log2_chroma_h = 0,
> +.comp = {
> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> +},
> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> + 

[FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavutil/pixdesc.c |  105 +++
 libavutil/pixfmt.h  |   13 +++
 2 files changed, 118 insertions(+)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 58833cf..5fda5bd 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -926,6 +926,57 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
 },
+[AV_PIX_FMT_YUVA444P32FBE] = {
+.name = "yuva444p32fbe",
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
+{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
+{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | 
AV_PIX_FMT_FLAG_ALPHA,
+},
+[AV_PIX_FMT_YUVA444P32FLE] = {
+.name = "yuva444p32fle",
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
+{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
+{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
+},
+[AV_PIX_FMT_YUV444P32FBE] = {
+.name = "yuv444p32fbe",
+.nb_components = 3,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
+{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
+},
+[AV_PIX_FMT_YUV444P32FLE] = {
+.name = "yuv444p32fle",
+.nb_components = 3,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
+{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR,
+},
+
 #if FF_API_VDPAU
 [AV_PIX_FMT_VDPAU_H264] = {
 .name = "vdpau_h264",
@@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
  AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
 },
+[AV_PIX_FMT_GBRAP32FLE] = {
+.name = "gbrap32fle",
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
+{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
+{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR |
+ AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
+},
+[AV_PIX_FMT_GBRAP32FBE] = {
+.name = "gbrap32fbe",
+.nb_components = 4,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
+{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
+{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
+ AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
+},
+[AV_PIX_FMT_GBRP32FLE] = {
+.name = "gbrp32fle",
+.nb_components = 3,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
+{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
+},
+.flags = AV_PIX_FMT_FLAG_PLANAR |
+ AV_PIX_FMT_FLAG_RGB,
+},
+[AV_PIX_FMT_GBRP32FBE] = {
+.name = "gbrp32fbe",
+.nb_components = 3,
+.log2_chroma_w = 0,
+.log2_chroma_h = 0,
+.comp = {
+{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
+{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
+{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
+},
+.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
+ AV_PIX_FMT_FLAG_RGB,
+},
 [AV_PIX_FMT_VDPAU] = {
 .name = "vdpau",
 .log2_chroma_w = 1,
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index c01c057..24110f6 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -292,6 +292,15 @@ enum AVPixelFormat {
 AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per 

Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Hendrik Leppkes
On Wed, Feb 10, 2016 at 10:21 PM, wm4  wrote:
> On Wed, 10 Feb 2016 21:56:07 +0100
> Michael Niedermayer  wrote:
>
>> Signed-off-by: Michael Niedermayer 
>> ---
>>  libavutil/pixdesc.c |  105 
>> +++
>>  libavutil/pixfmt.h  |   13 +++
>>  2 files changed, 118 insertions(+)
>>
>> diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
>> index 58833cf..5fda5bd 100644
>> --- a/libavutil/pixdesc.c
>> +++ b/libavutil/pixdesc.c
>> @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor 
>> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>>  },
>>  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>>  },
>> +[AV_PIX_FMT_YUVA444P32FBE] = {
>> +.name = "yuva444p32fbe",
>> +.nb_components = 4,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | 
>> AV_PIX_FMT_FLAG_ALPHA,
>> +},
>> +[AV_PIX_FMT_YUVA444P32FLE] = {
>> +.name = "yuva444p32fle",
>> +.nb_components = 4,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>> +},
>> +[AV_PIX_FMT_YUV444P32FBE] = {
>> +.name = "yuv444p32fbe",
>> +.nb_components = 3,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
>> +},
>> +[AV_PIX_FMT_YUV444P32FLE] = {
>> +.name = "yuv444p32fle",
>> +.nb_components = 3,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_PLANAR,
>> +},
>> +
>>  #if FF_API_VDPAU
>>  [AV_PIX_FMT_VDPAU_H264] = {
>>  .name = "vdpau_h264",
>> @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor 
>> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>>  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>>   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>>  },
>> +[AV_PIX_FMT_GBRAP32FLE] = {
>> +.name = "gbrap32fle",
>> +.nb_components = 4,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_PLANAR |
>> + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> +},
>> +[AV_PIX_FMT_GBRAP32FBE] = {
>> +.name = "gbrap32fbe",
>> +.nb_components = 4,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>> + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> +},
>> +[AV_PIX_FMT_GBRP32FLE] = {
>> +.name = "gbrp32fle",
>> +.nb_components = 3,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> +},
>> +.flags = AV_PIX_FMT_FLAG_PLANAR |
>> + AV_PIX_FMT_FLAG_RGB,
>> +},
>> +[AV_PIX_FMT_GBRP32FBE] = {
>> +.name = "gbrp32fbe",
>> +.nb_components = 3,
>> +.log2_chroma_w = 0,
>> +.log2_chroma_h = 0,
>> +.comp = {
>> +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> +{ 0, 4, 

Re: [FFmpeg-devel] [PATCH 2/2] checkasm: Add vf_blend tests

2016-02-10 Thread Paul B Mahol
On 2/10/16, Timothy Gu  wrote:
> ---
>  tests/checkasm/Makefile   |   1 +
>  tests/checkasm/checkasm.c |   3 ++
>  tests/checkasm/checkasm.h |   1 +
>  tests/checkasm/vf_blend.c | 111
> ++
>  4 files changed, 116 insertions(+)
>  create mode 100644 tests/checkasm/vf_blend.c
>
> diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
> index 07fe5bc..bfd7c11 100644
> --- a/tests/checkasm/Makefile
> +++ b/tests/checkasm/Makefile
> @@ -1,5 +1,6 @@
>  # libavcodec tests
>  AVCODECOBJS-$(CONFIG_ALAC_DECODER) += alacdsp.o
> +AVCODECOBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o
>  AVCODECOBJS-$(CONFIG_BSWAPDSP) += bswapdsp.o
>  AVCODECOBJS-$(CONFIG_DCA_DECODER) += synth_filter.o
>  AVCODECOBJS-$(CONFIG_FLACDSP)  += flacdsp.o
> diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
> index 49fd2af..1e73e34 100644
> --- a/tests/checkasm/checkasm.c
> +++ b/tests/checkasm/checkasm.c
> @@ -68,6 +68,9 @@ static const struct {
>  #if CONFIG_ALAC_DECODER
>  { "alacdsp", checkasm_check_alacdsp },
>  #endif
> +#if CONFIG_BLEND_FILTER
> +{ "vf_blend", checkasm_check_blend },
> +#endif
>  #if CONFIG_BSWAPDSP
>  { "bswapdsp", checkasm_check_bswapdsp },
>  #endif
> diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
> index 5c07f89..0c8bc2d 100644
> --- a/tests/checkasm/checkasm.h
> +++ b/tests/checkasm/checkasm.h
> @@ -31,6 +31,7 @@
>  #include "libavutil/timer.h"
>
>  void checkasm_check_alacdsp(void);
> +void checkasm_check_blend(void);
>  void checkasm_check_bswapdsp(void);
>  void checkasm_check_flacdsp(void);
>  void checkasm_check_fmtconvert(void);
> diff --git a/tests/checkasm/vf_blend.c b/tests/checkasm/vf_blend.c
> new file mode 100644
> index 000..51c4999
> --- /dev/null
> +++ b/tests/checkasm/vf_blend.c
> @@ -0,0 +1,111 @@
> +/*
> + * Copyright (c) 2016 Tiancheng "Timothy" Gu
> + *
> + * 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 General Public License for more details.
> + *
> + * You should have received a copy of the GNU 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 
> +#include "checkasm.h"
> +#include "libavfilter/blend.h"
> +#include "libavutil/common.h"
> +#include "libavutil/internal.h"
> +#include "libavutil/intreadwrite.h"
> +
> +#define WIDTH 64
> +#define LINESIZE 64
> +#define HEIGHT 8
> +#define BUF_UNITS 9
> +#define SIZE_PER_UNIT (LINESIZE * HEIGHT)
> +#define BUF_SIZE (BUF_UNITS * SIZE_PER_UNIT)
> +
> +#define randomize_buffers() \
> +do {\
> +int i;  \
> +for (i = 0; i < BUF_SIZE; i += 4) { \
> +uint32_t r = rnd(); \
> +AV_WN32A(top1 + i, r);  \
> +AV_WN32A(top2 + i, r);  \
> +r = rnd();  \
> +AV_WN32A(bot1 + i, r);  \
> +AV_WN32A(bot2 + i, r);  \
> +r = rnd();  \
> +AV_WN32A(dst1 + i, r);  \
> +AV_WN32A(dst2 + i, r);  \
> +}   \

It would be more useful if 2 buffers are 256x256 gradients.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread wm4
On Wed, 10 Feb 2016 23:00:00 +0100
Michael Niedermayer  wrote:

> On Wed, Feb 10, 2016 at 10:21:34PM +0100, wm4 wrote:
> > On Wed, 10 Feb 2016 21:56:07 +0100
> > Michael Niedermayer  wrote:
> >   
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavutil/pixdesc.c |  105 
> > > +++
> > >  libavutil/pixfmt.h  |   13 +++
> > >  2 files changed, 118 insertions(+)
> > > 
> > > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > > index 58833cf..5fda5bd 100644
> > > --- a/libavutil/pixdesc.c
> > > +++ b/libavutil/pixdesc.c
> > > @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor 
> > > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> > >  },
> > >  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > >  },
> > > +[AV_PIX_FMT_YUVA444P32FBE] = {
> > > +.name = "yuva444p32fbe",
> > > +.nb_components = 4,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > > +},
> > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | 
> > > AV_PIX_FMT_FLAG_ALPHA,
> > > +},
> > > +[AV_PIX_FMT_YUVA444P32FLE] = {
> > > +.name = "yuva444p32fle",
> > > +.nb_components = 4,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > > +},
> > > +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > > +},
> > > +[AV_PIX_FMT_YUV444P32FBE] = {
> > > +.name = "yuv444p32fbe",
> > > +.nb_components = 3,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > +},
> > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
> > > +},
> > > +[AV_PIX_FMT_YUV444P32FLE] = {
> > > +.name = "yuv444p32fle",
> > > +.nb_components = 3,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > +},
> > > +.flags = AV_PIX_FMT_FLAG_PLANAR,
> > > +},
> > > +
> > >  #if FF_API_VDPAU
> > >  [AV_PIX_FMT_VDPAU_H264] = {
> > >  .name = "vdpau_h264",
> > > @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor 
> > > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> > >  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > >   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > >  },
> > > +[AV_PIX_FMT_GBRAP32FLE] = {
> > > +.name = "gbrap32fle",
> > > +.nb_components = 4,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > > +},
> > > +.flags = AV_PIX_FMT_FLAG_PLANAR |
> > > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > +},
> > > +[AV_PIX_FMT_GBRAP32FBE] = {
> > > +.name = "gbrap32fbe",
> > > +.nb_components = 4,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > > +},
> > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > +},
> > > +[AV_PIX_FMT_GBRP32FLE] = {
> > > +.name = "gbrp32fle",
> > > +.nb_components = 3,
> > > +.log2_chroma_w = 0,
> > > +.log2_chroma_h = 0,
> > > +.comp = {
> > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > +{ 1, 

Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Paul B Mahol
On 2/10/16, Michael Niedermayer  wrote:
> On Wed, Feb 10, 2016 at 10:21:34PM +0100, wm4 wrote:
>> On Wed, 10 Feb 2016 21:56:07 +0100
>> Michael Niedermayer  wrote:
>>
>> > Signed-off-by: Michael Niedermayer 
>> > ---
>> >  libavutil/pixdesc.c |  105
>> > +++
>> >  libavutil/pixfmt.h  |   13 +++
>> >  2 files changed, 118 insertions(+)
>> >
>> > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
>> > index 58833cf..5fda5bd 100644
>> > --- a/libavutil/pixdesc.c
>> > +++ b/libavutil/pixdesc.c
>> > @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor
>> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>> >  },
>> >  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>> >  },
>> > +[AV_PIX_FMT_YUVA444P32FBE] = {
>> > +.name = "yuva444p32fbe",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>> > AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_YUVA444P32FLE] = {
>> > +.name = "yuva444p32fle",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_YUV444P32FBE] = {
>> > +.name = "yuv444p32fbe",
>> > +.nb_components = 3,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
>> > +},
>> > +[AV_PIX_FMT_YUV444P32FLE] = {
>> > +.name = "yuv444p32fle",
>> > +.nb_components = 3,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR,
>> > +},
>> > +
>> >  #if FF_API_VDPAU
>> >  [AV_PIX_FMT_VDPAU_H264] = {
>> >  .name = "vdpau_h264",
>> > @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor
>> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>> >  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>> >   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> >  },
>> > +[AV_PIX_FMT_GBRAP32FLE] = {
>> > +.name = "gbrap32fle",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR |
>> > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_GBRAP32FBE] = {
>> > +.name = "gbrap32fbe",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>> > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_GBRP32FLE] = {
>> > +.name = "gbrp32fle",
>> > +.nb_components = 3,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR |
>> > + AV_PIX_FMT_FLAG_RGB,

Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Ronald S. Bultje
Hi,

On Wed, Feb 10, 2016 at 5:12 PM, wm4  wrote:

> On Wed, 10 Feb 2016 23:00:00 +0100
> Michael Niedermayer  wrote:
>
> > On Wed, Feb 10, 2016 at 10:21:34PM +0100, wm4 wrote:
> > > On Wed, 10 Feb 2016 21:56:07 +0100
> > > Michael Niedermayer  wrote:
> > >
> > > > Signed-off-by: Michael Niedermayer 
> > > > ---
> > > >  libavutil/pixdesc.c |  105
> +++
> > > >  libavutil/pixfmt.h  |   13 +++
> > > >  2 files changed, 118 insertions(+)
> > > >
> > > > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > > > index 58833cf..5fda5bd 100644
> > > > --- a/libavutil/pixdesc.c
> > > > +++ b/libavutil/pixdesc.c
> > > > @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> > > >  },
> > > >  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > > >  },
> > > > +[AV_PIX_FMT_YUVA444P32FBE] = {
> > > > +.name = "yuva444p32fbe",
> > > > +.nb_components = 4,
> > > > +.log2_chroma_w = 0,
> > > > +.log2_chroma_h = 0,
> > > > +.comp = {
> > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > > > +},
> > > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> AV_PIX_FMT_FLAG_ALPHA,
> > > > +},
> > > > +[AV_PIX_FMT_YUVA444P32FLE] = {
> > > > +.name = "yuva444p32fle",
> > > > +.nb_components = 4,
> > > > +.log2_chroma_w = 0,
> > > > +.log2_chroma_h = 0,
> > > > +.comp = {
> > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > > > +},
> > > > +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > > > +},
> > > > +[AV_PIX_FMT_YUV444P32FBE] = {
> > > > +.name = "yuv444p32fbe",
> > > > +.nb_components = 3,
> > > > +.log2_chroma_w = 0,
> > > > +.log2_chroma_h = 0,
> > > > +.comp = {
> > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > +},
> > > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
> > > > +},
> > > > +[AV_PIX_FMT_YUV444P32FLE] = {
> > > > +.name = "yuv444p32fle",
> > > > +.nb_components = 3,
> > > > +.log2_chroma_w = 0,
> > > > +.log2_chroma_h = 0,
> > > > +.comp = {
> > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > +},
> > > > +.flags = AV_PIX_FMT_FLAG_PLANAR,
> > > > +},
> > > > +
> > > >  #if FF_API_VDPAU
> > > >  [AV_PIX_FMT_VDPAU_H264] = {
> > > >  .name = "vdpau_h264",
> > > > @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor
> av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> > > >  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > > >   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > >  },
> > > > +[AV_PIX_FMT_GBRAP32FLE] = {
> > > > +.name = "gbrap32fle",
> > > > +.nb_components = 4,
> > > > +.log2_chroma_w = 0,
> > > > +.log2_chroma_h = 0,
> > > > +.comp = {
> > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > > > +},
> > > > +.flags = AV_PIX_FMT_FLAG_PLANAR |
> > > > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > > +},
> > > > +[AV_PIX_FMT_GBRAP32FBE] = {
> > > > +.name = "gbrap32fbe",
> > > > +.nb_components = 4,
> > > > +.log2_chroma_w = 0,
> > > > +.log2_chroma_h = 0,
> > > > +.comp = {
> > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > > > +},
> > > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > > > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > > +},
> > > > +[AV_PIX_FMT_GBRP32FLE] = {
> > > > +.name = "gbrp32fle",
> > > > +  

Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Michael Niedermayer
On Wed, Feb 10, 2016 at 10:21:34PM +0100, wm4 wrote:
> On Wed, 10 Feb 2016 21:56:07 +0100
> Michael Niedermayer  wrote:
> 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavutil/pixdesc.c |  105 
> > +++
> >  libavutil/pixfmt.h  |   13 +++
> >  2 files changed, 118 insertions(+)
> > 
> > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > index 58833cf..5fda5bd 100644
> > --- a/libavutil/pixdesc.c
> > +++ b/libavutil/pixdesc.c
> > @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor 
> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> >  },
> >  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> >  },
> > +[AV_PIX_FMT_YUVA444P32FBE] = {
> > +.name = "yuva444p32fbe",
> > +.nb_components = 4,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | 
> > AV_PIX_FMT_FLAG_ALPHA,
> > +},
> > +[AV_PIX_FMT_YUVA444P32FLE] = {
> > +.name = "yuva444p32fle",
> > +.nb_components = 4,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > +},
> > +[AV_PIX_FMT_YUV444P32FBE] = {
> > +.name = "yuv444p32fbe",
> > +.nb_components = 3,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
> > +},
> > +[AV_PIX_FMT_YUV444P32FLE] = {
> > +.name = "yuv444p32fle",
> > +.nb_components = 3,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_PLANAR,
> > +},
> > +
> >  #if FF_API_VDPAU
> >  [AV_PIX_FMT_VDPAU_H264] = {
> >  .name = "vdpau_h264",
> > @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor 
> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> >  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> >   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> >  },
> > +[AV_PIX_FMT_GBRAP32FLE] = {
> > +.name = "gbrap32fle",
> > +.nb_components = 4,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_PLANAR |
> > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > +},
> > +[AV_PIX_FMT_GBRAP32FBE] = {
> > +.name = "gbrap32fbe",
> > +.nb_components = 4,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > +},
> > +[AV_PIX_FMT_GBRP32FLE] = {
> > +.name = "gbrp32fle",
> > +.nb_components = 3,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,
> > +.comp = {
> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > +},
> > +.flags = AV_PIX_FMT_FLAG_PLANAR |
> > + AV_PIX_FMT_FLAG_RGB,
> > +},
> > +[AV_PIX_FMT_GBRP32FBE] = {
> > +.name = "gbrp32fbe",
> > +.nb_components = 3,
> > +.log2_chroma_w = 0,
> > +.log2_chroma_h = 0,

Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Hendrik Leppkes
On Wed, Feb 10, 2016 at 11:00 PM, Michael Niedermayer
 wrote:
> On Wed, Feb 10, 2016 at 10:21:34PM +0100, wm4 wrote:
>> On Wed, 10 Feb 2016 21:56:07 +0100
>> Michael Niedermayer  wrote:
>>
>> > Signed-off-by: Michael Niedermayer 
>> > ---
>> >  libavutil/pixdesc.c |  105 
>> > +++
>> >  libavutil/pixfmt.h  |   13 +++
>> >  2 files changed, 118 insertions(+)
>> >
>> > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
>> > index 58833cf..5fda5bd 100644
>> > --- a/libavutil/pixdesc.c
>> > +++ b/libavutil/pixdesc.c
>> > @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor 
>> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>> >  },
>> >  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>> >  },
>> > +[AV_PIX_FMT_YUVA444P32FBE] = {
>> > +.name = "yuva444p32fbe",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR | 
>> > AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_YUVA444P32FLE] = {
>> > +.name = "yuva444p32fle",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_YUV444P32FBE] = {
>> > +.name = "yuv444p32fbe",
>> > +.nb_components = 3,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
>> > +},
>> > +[AV_PIX_FMT_YUV444P32FLE] = {
>> > +.name = "yuv444p32fle",
>> > +.nb_components = 3,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR,
>> > +},
>> > +
>> >  #if FF_API_VDPAU
>> >  [AV_PIX_FMT_VDPAU_H264] = {
>> >  .name = "vdpau_h264",
>> > @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor 
>> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
>> >  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>> >   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> >  },
>> > +[AV_PIX_FMT_GBRAP32FLE] = {
>> > +.name = "gbrap32fle",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR |
>> > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_GBRAP32FBE] = {
>> > +.name = "gbrap32fbe",
>> > +.nb_components = 4,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
>> > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
>> > +},
>> > +[AV_PIX_FMT_GBRP32FLE] = {
>> > +.name = "gbrp32fle",
>> > +.nb_components = 3,
>> > +.log2_chroma_w = 0,
>> > +.log2_chroma_h = 0,
>> > +.comp = {
>> > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
>> > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
>> > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
>> > +},
>> > +.flags = AV_PIX_FMT_FLAG_PLANAR |
>> > +  

[FFmpeg-devel] [PATCH] avfilter/vf_nnedi: Simplify away some trivial mem*()

2016-02-10 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 libavfilter/vf_nnedi.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
index 9a98ec2..d265fea 100644
--- a/libavfilter/vf_nnedi.c
+++ b/libavfilter/vf_nnedi.c
@@ -362,7 +362,7 @@ static int32_t process_line0(const uint8_t *tempu, int 
width, uint8_t *dstp8, co
 tmp /= 32;
 dstp[x] = FFMAX(FFMIN(tmp, maximum), minimum);
 } else {
-memset(dstp + x, 255, sizeof(uint8_t));
+dstp[x] = 255;
 count++;
 }
 }
@@ -612,14 +612,10 @@ static void evalfunc_1(NNEDIContext *s, FrameData 
*frame_data)
 
 for (y = ystart; y < ystop; y += 2) {
 for (x = 32; x < width - 32; x++) {
-uint32_t pixel = 0;
-uint32_t all_ones = 0;
+uint32_t pixel = dstp[x];
 float mstd[4];
 
-memcpy(, dstp + x, sizeof(uint8_t));
-memset(_ones, 255, sizeof(uint8_t));
-
-if (pixel != all_ones)
+if (pixel != 255)
 continue;
 
 s->extract((const uint8_t *)(srcpp + x), src_stride, xdia, 
ydia, mstd, input);
-- 
1.7.9.5

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


Re: [FFmpeg-devel] FFplay with 2 video streams in concurrent time

2016-02-10 Thread Chau Pham
Ok, first of all, sorry for my English.

By default, ffplay only plays first video stream and it doesn't care about the 
rest of video streams. 

I meant that I would like to play 2 video streams concurrently,

Anyway, I have found the way to play 2 video streams..



From: ffmpeg-devel  on behalf of Paul B Mahol 

Sent: Friday, February 5, 2016 9:09 PM
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] FFplay with 2 video streams in concurrent time

On 2/5/16, Chau Pham  wrote:
> Dear Senior,
>
>
> I would like to ask something about ffplay.
>
>
> ffmpeg define AVMediaType in avutil.h with 5 type of media as below
>
>
> enum AVMediaType {
> AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
> AVMEDIA_TYPE_VIDEO,
> AVMEDIA_TYPE_AUDIO,
> AVMEDIA_TYPE_DATA,  ///< Opaque data information usually
> continuous
> AVMEDIA_TYPE_SUBTITLE,
> AVMEDIA_TYPE_ATTACHMENT,///< Opaque data information usually sparse
> AVMEDIA_TYPE_NB
> };
>
>
> as my understanding that AVMEDIA_TYPE_VIDEO allow to play video stream.
>
> currently ffmpeg can play only 1 video stream,
> is there anyway to play 2 video streams in concurrent time? because my avi
> content includes 2 video streams.. and others stream

Depends what you mean by 'play 2 video streams'.
___
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 1/2] lavc/ccaption_dec: do not ignore repeated character commands

2016-02-10 Thread Aman Gupta
From: Aman Gupta 

control codes in a cc stream can be repeated, and must be ignored.
however, repeated characters must not be ignored. the code attempted to
wipe prev_cmd in handle_char to allow repeated characters to be
processed, but prev_cmd would previously get reset _after_ handle_char()

i also moved the prev_cmd reset out from handle_char() so it can be
re-used for special character sets, which _must_ be ignored when
repeated.
---
 libavcodec/ccaption_dec.c | 19 ++-
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 790f071..5fb2ec6 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -484,9 +484,6 @@ static void handle_char(CCaptionSubContext *ctx, char hi, 
char lo, int64_t pts)
 if (ctx->mode != CCMODE_POPON)
 ctx->screen_touched = 1;
 
-/* reset prev command since character can repeat */
-ctx->prev_cmd[0] = 0;
-ctx->prev_cmd[1] = 0;
 if (lo)
ff_dlog(ctx, "(%c,%c)\n", hi, lo);
 else
@@ -497,8 +494,15 @@ static void process_cc608(CCaptionSubContext *ctx, int64_t 
pts, uint8_t hi, uint
 {
 if (hi == ctx->prev_cmd[0] && lo == ctx->prev_cmd[1]) {
 /* ignore redundant command */
-} else if ( (hi == 0x10 && (lo >= 0x40 && lo <= 0x5f)) ||
-  ( (hi >= 0x11 && hi <= 0x17) && (lo >= 0x40 && lo <= 0x7f) ) ) {
+return;
+}
+
+/* set prev command */
+ctx->prev_cmd[0] = hi;
+ctx->prev_cmd[1] = lo;
+
+if ( (hi == 0x10 && (lo >= 0x40 && lo <= 0x5f)) ||
+   ( (hi >= 0x11 && hi <= 0x17) && (lo >= 0x40 && lo <= 0x7f) ) ) {
 handle_pac(ctx, hi, lo);
 } else if ( ( hi == 0x11 && lo >= 0x20 && lo <= 0x2f ) ||
 ( hi == 0x17 && lo >= 0x2e && lo <= 0x2f) ) {
@@ -559,14 +563,11 @@ static void process_cc608(CCaptionSubContext *ctx, 
int64_t pts, uint8_t hi, uint
 } else if (hi >= 0x20) {
 /* Standard characters (always in pairs) */
 handle_char(ctx, hi, lo, pts);
+ctx->prev_cmd[0] = ctx->prev_cmd[1] = 0;
 } else {
 /* Ignoring all other non data code */
 ff_dlog(ctx, "Unknown command 0x%hhx 0x%hhx\n", hi, lo);
 }
-
-/* set prev command */
-ctx->prev_cmd[0] = hi;
-ctx->prev_cmd[1] = lo;
 }
 
 static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket 
*avpkt)
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 2/2] lavc/ccaption_dec: implement special and extended character sets

2016-02-10 Thread Aman Gupta
From: Aman Gupta 

---
 libavcodec/ccaption_dec.c | 151 +-
 1 file changed, 148 insertions(+), 3 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 5fb2ec6..c22f939 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -63,6 +63,116 @@ enum cc_font {
 CCFONT_UNDERLINED_ITALICS,
 };
 
+enum cc_charset {
+CCSET_BASIC_AMERICAN,
+CCSET_SPECIAL_AMERICAN,
+CCSET_EXTENDED_SPANISH_FRENCH,
+CCSET_EXTENDED_PORTUGUESE_GERMAN,
+};
+
+static const char *charset_overrides[4][128] =
+{
+[CCSET_BASIC_AMERICAN] = {
+[0x27] = "’",
+[0x2a] = "á",
+[0x5c] = "é",
+[0x5e] = "í",
+[0x5f] = "ó",
+[0x60] = "ú",
+[0x7b] = "ç",
+[0x7c] = "÷",
+[0x7d] = "Ñ",
+[0x7e] = "ñ",
+[0x7f] = "\u2588"
+},
+[CCSET_SPECIAL_AMERICAN] = {
+[0x30] = "®",
+[0x31] = "°",
+[0x32] = "½",
+[0x33] = "¿",
+[0x34] = "™",
+[0x35] = "¢",
+[0x36] = "£",
+[0x37] = "♪",
+[0x38] = "à",
+[0x39] = "\u00A0",
+[0x3a] = "è",
+[0x3b] = "â",
+[0x3c] = "ê",
+[0x3d] = "î",
+[0x3e] = "ô",
+[0x3f] = "û",
+},
+[CCSET_EXTENDED_SPANISH_FRENCH] = {
+[0x20] = "Á",
+[0x21] = "É",
+[0x22] = "Ó",
+[0x23] = "Ú",
+[0x24] = "Ü",
+[0x25] = "ü",
+[0x26] = "´",
+[0x27] = "¡",
+[0x28] = "*",
+[0x29] = "‘",
+[0x2a] = "-",
+[0x2b] = "©",
+[0x2c] = "℠",
+[0x2d] = "·",
+[0x2e] = "“",
+[0x2f] = "”",
+[0x30] = "À",
+[0x31] = "Â",
+[0x32] = "Ç",
+[0x33] = "È",
+[0x34] = "Ê",
+[0x35] = "Ë",
+[0x36] = "ë",
+[0x37] = "Î",
+[0x38] = "Ï",
+[0x39] = "ï",
+[0x3a] = "Ô",
+[0x3b] = "Ù",
+[0x3c] = "ù",
+[0x3d] = "Û",
+[0x3e] = "«",
+[0x3f] = "»",
+},
+[CCSET_EXTENDED_PORTUGUESE_GERMAN] = {
+[0x20] = "Ã",
+[0x21] = "ã",
+[0x22] = "Í",
+[0x23] = "Ì",
+[0x24] = "ì",
+[0x25] = "Ò",
+[0x26] = "ò",
+[0x27] = "Õ",
+[0x28] = "õ",
+[0x29] = "{",
+[0x2a] = "}",
+[0x2b] = "\\",
+[0x2c] = "^",
+[0x2d] = "_",
+[0x2e] = "|",
+[0x2f] = "~",
+[0x30] = "Ä",
+[0x31] = "ä",
+[0x32] = "Ö",
+[0x33] = "ö",
+[0x34] = "ß",
+[0x35] = "¥",
+[0x36] = "¤",
+[0x37] = "¦",
+[0x38] = "Å",
+[0x39] = "å",
+[0x3a] = "Ø",
+[0x3b] = "ø",
+[0x3c] = "┌",
+[0x3d] = "┐",
+[0x3e] = "└",
+[0x3f] = "┘",
+},
+};
+
 static const unsigned char pac2_attribs[32][3] = // Color, font, ident
 {
 { CCCOL_WHITE,   CCFONT_REGULAR,0 },  // 0x40 || 0x60
@@ -103,6 +213,7 @@ static const unsigned char pac2_attribs[32][3] = // Color, 
font, ident
 struct Screen {
 /* +1 is used to compensate null character of string */
 uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1];
+uint8_t charsets[SCREEN_ROWS][SCREEN_COLUMNS+1];
 uint8_t colors[SCREEN_ROWS][SCREEN_COLUMNS+1];
 uint8_t fonts[SCREEN_ROWS][SCREEN_COLUMNS+1];
 /*
@@ -123,6 +234,7 @@ typedef struct CCaptionSubContext {
 uint8_t cursor_column;
 uint8_t cursor_color;
 uint8_t cursor_font;
+uint8_t cursor_charset;
 AVBPrint buffer;
 int buffer_changed;
 int rollup;
@@ -189,6 +301,7 @@ static void flush_decoder(AVCodecContext *avctx)
 ctx->cursor_column = 0;
 ctx->cursor_font = 0;
 ctx->cursor_color = 0;
+ctx->cursor_charset = 0;
 ctx->active_screen = 0;
 ctx->last_real_time = 0;
 ctx->screen_touched = 0;
@@ -204,10 +317,13 @@ static int write_char(CCaptionSubContext *ctx, struct 
Screen *screen, char ch)
 uint8_t col = ctx->cursor_column;
 char *row = screen->characters[ctx->cursor_row];
 char *font = screen->fonts[ctx->cursor_row];
+char *charset = screen->charsets[ctx->cursor_row];
 
 if (col < SCREEN_COLUMNS) {
 row[col] = ch;
 font[col] = ctx->cursor_font;
+charset[col] = ctx->cursor_charset;
+ctx->cursor_charset = CCSET_BASIC_AMERICAN;
 if (ch) ctx->cursor_column++;
 return 0;
 }
@@ -325,10 +441,12 @@ static int capture_screen(CCaptionSubContext *ctx)
 if (CHECK_FLAG(screen->row_used, i)) {
 const char *row = screen->characters[i];
 const char *font = screen->fonts[i];
+const char *charset = screen->charsets[i];
+const char *override;
 int j = 0;
 
 /* skip leading space */
-while (row[j] == ' ')
+while (row[j] == ' ' && charset[j] == CCSET_BASIC_AMERICAN)
   

Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Tobias Rapp

On 10.02.2016 10:01, Paul B Mahol wrote:

On 2/10/16, Tobias Rapp  wrote:

On 06.02.2016 23:30, Paul B Mahol wrote:

On 2/6/16, Paul B Mahol  wrote:

Hi,

patch attached.



Improved version attached.

[...]
+
+static int string(const char *value1, const char *value2, size_t length)
+{
+return !strncmp(value1, value2, length);
+}


If I understand correctly this function is used to compare if the start
of value2 matches value1. Maybe this function should be called
"starts_with" (also in the "function" option enum)?


+
+static int equal(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 != f2;
+}
+
+static int less(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 > f2;
+}
+
+static int greater(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 < f2;
+}
+
[...]


I think it would be better to not compare float values directly with
"==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <= epsilon".

BTW: Is the return value of "equal", "less" and "greater" inverse on
purpose?


Not for equal, but for other it is.


OK, now I got it that the argument order is flipped but matches the 
documentation. In that case it is a bit counter-intuitive that one has 
to do something like


mode=print:key=mykey:value=1.0:function=less

to print all metadata values of "mykey" which are *bigger* than 1.0.



Another sidenote: I have seen that some filters use a common expression
language (e.g. aeval, crop, scale). Not sure if this expression language
supports string operators or if it is limited to numbers but in my
opinion it would be great to re-use it here.


Added and applied. Filter is easily extendable.


Thanks for adding expression support.

I know my response has come late and I'm only an occasional FFmpeg 
developer so my thoughts might not have big weight. Still I think it 
would have been more polite to first respond on the list to all my 
comments (see the "starts_with" suggestion above) before applying the patch.


Regards,
Tobias

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


Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Paul B Mahol
On 2/10/16, Tobias Rapp  wrote:
> On 10.02.2016 10:01, Paul B Mahol wrote:
>> On 2/10/16, Tobias Rapp  wrote:
>>> On 06.02.2016 23:30, Paul B Mahol wrote:
 On 2/6/16, Paul B Mahol  wrote:
> Hi,
>
> patch attached.
>

 Improved version attached.

 [...]
 +
 +static int string(const char *value1, const char *value2, size_t
 length)
 +{
 +return !strncmp(value1, value2, length);
 +}
>>>
>>> If I understand correctly this function is used to compare if the start
>>> of value2 matches value1. Maybe this function should be called
>>> "starts_with" (also in the "function" option enum)?
>>>
 +
 +static int equal(const char *value1, const char *value2, size_t length)
 +{
 +float f1, f2;
 +
 +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
 +return 0;
 +
 +return f1 != f2;
 +}
 +
 +static int less(const char *value1, const char *value2, size_t length)
 +{
 +float f1, f2;
 +
 +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
 +return 0;
 +
 +return f1 > f2;
 +}
 +
 +static int greater(const char *value1, const char *value2, size_t
 length)
 +{
 +float f1, f2;
 +
 +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
 +return 0;
 +
 +return f1 < f2;
 +}
 +
 [...]
>>>
>>> I think it would be better to not compare float values directly with
>>> "==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <= epsilon".
>>>
>>> BTW: Is the return value of "equal", "less" and "greater" inverse on
>>> purpose?
>>
>> Not for equal, but for other it is.
>
> OK, now I got it that the argument order is flipped but matches the
> documentation. In that case it is a bit counter-intuitive that one has
> to do something like
>
> mode=print:key=mykey:value=1.0:function=less
>
> to print all metadata values of "mykey" which are *bigger* than 1.0.
>

Nope, this works fine here. It prints values less than 1.0

>>>
>>> Another sidenote: I have seen that some filters use a common expression
>>> language (e.g. aeval, crop, scale). Not sure if this expression language
>>> supports string operators or if it is limited to numbers but in my
>>> opinion it would be great to re-use it here.
>>
>> Added and applied. Filter is easily extendable.
>
> Thanks for adding expression support.
>
> I know my response has come late and I'm only an occasional FFmpeg
> developer so my thoughts might not have big weight. Still I think it
> would have been more polite to first respond on the list to all my
> comments (see the "starts_with" suggestion above) before applying the patch.

You can post another patch anytime here and if it makes sense I will
gladly apply it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Tobias Rapp

On 06.02.2016 23:30, Paul B Mahol wrote:

On 2/6/16, Paul B Mahol  wrote:

Hi,

patch attached.



Improved version attached.

[...]
+
+static int string(const char *value1, const char *value2, size_t length)
+{
+return !strncmp(value1, value2, length);
+}


If I understand correctly this function is used to compare if the start 
of value2 matches value1. Maybe this function should be called 
"starts_with" (also in the "function" option enum)?



+
+static int equal(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 != f2;
+}
+
+static int less(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 > f2;
+}
+
+static int greater(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 < f2;
+}
+
[...]


I think it would be better to not compare float values directly with 
"==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <= epsilon".


BTW: Is the return value of "equal", "less" and "greater" inverse on 
purpose?


Another sidenote: I have seen that some filters use a common expression 
language (e.g. aeval, crop, scale). Not sure if this expression language 
supports string operators or if it is limited to numbers but in my 
opinion it would be great to re-use it here.


Regards,
Tobias

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


Re: [FFmpeg-devel] [PATCH v6] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/10/2016 10:12 AM, Mats Peterson wrote:

The stride will be calculated incorrectly for the attached 3 x 3 pixel
pal8 nut file, since there is some padding in the packet after the video
data and before the palette. It will be properly rounded down to the
real width of the video data for larger sizes, but this one will be 4
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all.
Anyway, run ffplay with "-v debug" to output the packet size and the
stride.

If you have a better solution, feel free to change the stride
calculation code.



Perhaps it's not that bad after all, because before this patch, any 
odd-width pal8 nut file would be skewed on display. And there aren't too 
many people who use 3 x 3 pixel videos. But it's a bit irritating 
nevertheless.


Mats

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


Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Paul B Mahol
On 2/10/16, Tobias Rapp  wrote:
> On 10.02.2016 10:59, Paul B Mahol wrote:
>> On 2/10/16, Tobias Rapp  wrote:
>>> On 10.02.2016 10:01, Paul B Mahol wrote:
 On 2/10/16, Tobias Rapp  wrote:
> On 06.02.2016 23:30, Paul B Mahol wrote:
>> On 2/6/16, Paul B Mahol  wrote:
>>> Hi,
>>>
>>> patch attached.
>>>
>>
>> Improved version attached.
>>
>> [...]
>> +
>> +static int string(const char *value1, const char *value2, size_t
>> length)
>> +{
>> +return !strncmp(value1, value2, length);
>> +}
>
> If I understand correctly this function is used to compare if the start
> of value2 matches value1. Maybe this function should be called
> "starts_with" (also in the "function" option enum)?
>
>> +
>> +static int equal(const char *value1, const char *value2, size_t
>> length)
>> +{
>> +float f1, f2;
>> +
>> +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
>> +return 0;
>> +
>> +return f1 != f2;
>> +}
>> +
>> +static int less(const char *value1, const char *value2, size_t
>> length)
>> +{
>> +float f1, f2;
>> +
>> +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
>> +return 0;
>> +
>> +return f1 > f2;
>> +}
>> +
>> +static int greater(const char *value1, const char *value2, size_t
>> length)
>> +{
>> +float f1, f2;
>> +
>> +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
>> +return 0;
>> +
>> +return f1 < f2;
>> +}
>> +
>> [...]
>
> I think it would be better to not compare float values directly with
> "==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <=
> epsilon".
>
> BTW: Is the return value of "equal", "less" and "greater" inverse on
> purpose?

 Not for equal, but for other it is.
>>>
>>> OK, now I got it that the argument order is flipped but matches the
>>> documentation. In that case it is a bit counter-intuitive that one has
>>> to do something like
>>>
>>> mode=print:key=mykey:value=1.0:function=less
>>>
>>> to print all metadata values of "mykey" which are *bigger* than 1.0.
>>>
>>
>> Nope, this works fine here. It prints values less than 1.0
>
> Then I have problems understanding the documentation text of "less" and
> "greater".

Ah, the problem was in documenation and code, hopefully it should be clear now.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v6] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/10/2016 12:26 PM, Mats Peterson wrote:

for nut. It would of course be much easier. One will have to divide the
packet size with the height, in the same way as the stride is calculated

, of

For nut, the packet size minus the palette size, of course.

Mats

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


Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Tobias Rapp

On 10.02.2016 10:59, Paul B Mahol wrote:

On 2/10/16, Tobias Rapp  wrote:

On 10.02.2016 10:01, Paul B Mahol wrote:

On 2/10/16, Tobias Rapp  wrote:

On 06.02.2016 23:30, Paul B Mahol wrote:

On 2/6/16, Paul B Mahol  wrote:

Hi,

patch attached.



Improved version attached.

[...]
+
+static int string(const char *value1, const char *value2, size_t
length)
+{
+return !strncmp(value1, value2, length);
+}


If I understand correctly this function is used to compare if the start
of value2 matches value1. Maybe this function should be called
"starts_with" (also in the "function" option enum)?


+
+static int equal(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 != f2;
+}
+
+static int less(const char *value1, const char *value2, size_t length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 > f2;
+}
+
+static int greater(const char *value1, const char *value2, size_t
length)
+{
+float f1, f2;
+
+if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
+return 0;
+
+return f1 < f2;
+}
+
[...]


I think it would be better to not compare float values directly with
"==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <= epsilon".

BTW: Is the return value of "equal", "less" and "greater" inverse on
purpose?


Not for equal, but for other it is.


OK, now I got it that the argument order is flipped but matches the
documentation. In that case it is a bit counter-intuitive that one has
to do something like

mode=print:key=mykey:value=1.0:function=less

to print all metadata values of "mykey" which are *bigger* than 1.0.



Nope, this works fine here. It prints values less than 1.0


Then I have problems understanding the documentation text of "less" and 
"greater".




Another sidenote: I have seen that some filters use a common expression
language (e.g. aeval, crop, scale). Not sure if this expression language
supports string operators or if it is limited to numbers but in my
opinion it would be great to re-use it here.


Added and applied. Filter is easily extendable.


Thanks for adding expression support.

I know my response has come late and I'm only an occasional FFmpeg
developer so my thoughts might not have big weight. Still I think it
would have been more polite to first respond on the list to all my
comments (see the "starts_with" suggestion above) before applying the patch.


You can post another patch anytime here and if it makes sense I will
gladly apply it.


OK.

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


Re: [FFmpeg-devel] [PATCH v6] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/10/2016 11:14 AM, Mats Peterson wrote:

On 02/10/2016 10:12 AM, Mats Peterson wrote:

The stride will be calculated incorrectly for the attached 3 x 3 pixel
pal8 nut file, since there is some padding in the packet after the video
data and before the palette. It will be properly rounded down to the
real width of the video data for larger sizes, but this one will be 4
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all.
Anyway, run ffplay with "-v debug" to output the packet size and the
stride.

If you have a better solution, feel free to change the stride
calculation code.



Perhaps it's not that bad after all, because before this patch, any
odd-width pal8 nut file would be skewed on display. And there aren't too
many people who use 3 x 3 pixel videos. But it's a bit irritating
nevertheless.



When using "-vcodec copy" with pal8 nut as the output, FFmpeg will 
happily copy the video to the file without ever considering the stride 
of it. Therefore, it's not possible to base the stride on avctx->width 
for nut. It would of course be much easier. One will have to divide the 
packet size with the height, in the same way as the stride is calculated 
for AVI and QuickTime. They don't contain any palette in the packets, of 
course.


Mats

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


[FFmpeg-devel] [PATCH v6] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson
The stride will be calculated incorrectly for the attached 3 x 3 pixel 
pal8 nut file, since there is some padding in the packet after the video 
data and before the palette. It will be properly rounded down to the 
real width of the video data for larger sizes, but this one will be 4 
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all. 
Anyway, run ffplay with "-v debug" to output the packet size and the stride.


If you have a better solution, feel free to change the stride 
calculation code.


Original description follows:


This patch removes the monowhite switching code for 1 bpp raw AVI 
without a palette. I don't see any reason to keep it, since it's 
semantically incorrect to use monowhite for palettized data in my book, 
it adds unnecessary noise to the code, and it's inconsistent with the 
rest of the code in FFmpeg.


For black & white AVI or QuickTime files, in order to produce a 
monochrome nut file, force the pixel format with "-pix_fmt monow" or 
"-pix_fmt monob".


Unfortunately, there is a problem with converting from pal8 to monow, 
and I know what it is now. There seems to be some weird dithering going 
on of the white color, so there will be black pixels here and there in 
the monow output. A better way is to use "ffmpeg -i 1bpp.avi -vcodec 
copy -vtag B1W0 1bpp.nut". The "-vtag" option is currently needed, 
otherwise FFmpeg will use a RGB[15] codec tag for some reason.


I have also updated the 1 bpp FATE test files (once again).

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
>From dc621b883570f00226a55dcbdeea6e23980a28ad Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Wed, 10 Feb 2016 10:01:02 +0100
Subject: [PATCH v6] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

---
 libavcodec/rawdec.c   |   37 +
 tests/ref/vsynth/vsynth1-bpp1 |4 ++--
 tests/ref/vsynth/vsynth2-bpp1 |4 ++--
 tests/ref/vsynth/vsynth3-bpp1 |4 ++--
 tests/ref/vsynth/vsynth_lena-bpp1 |4 ++--
 5 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index b7ce2b6..d2aacda 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -100,7 +100,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt);
 else {
 memset(context->palette->data, 0, AVPALETTE_SIZE);
-if (avctx->bits_per_coded_sample <= 1)
+if (avctx->bits_per_coded_sample == 1)
 memset(context->palette->data, 0xff, 4);
 }
 }
@@ -121,17 +121,13 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 if (avctx->codec_tag == MKTAG('B','1','W','0') ||
 avctx->codec_tag == MKTAG('B','0','W','1'))
 context->is_nut_mono = 1;
-else if (avctx->codec_tag == MKTAG('P','A','L','8'))
+else if (avctx->codec_tag == MKTAG('P','A','L',8))
 context->is_nut_pal8 = 1;
 
 if (avctx->codec_tag == AV_RL32("yuv2") &&
 avctx->pix_fmt   == AV_PIX_FMT_YUYV422)
 context->is_yuv2 = 1;
 
-/* Temporary solution until PAL8 is implemented in nut */
-if (context->is_pal8 && avctx->bits_per_coded_sample == 1)
-avctx->pix_fmt = AV_PIX_FMT_NONE;
-
 return 0;
 }
 
@@ -192,33 +188,16 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
 return AVERROR_INVALIDDATA;
 }
 
-if (context->is_nut_mono)
-stride = avctx->width / 8 + (avctx->width & 7 ? 1 : 0);
-else if (context->is_nut_pal8)
-stride = avctx->width;
-else
-stride = avpkt->size / avctx->height;
+stride = (avpkt->size - (context->is_nut_pal8 ? AVPALETTE_SIZE : 0)) / avctx->height;
+
+av_log(avctx, AV_LOG_DEBUG, "PACKET SIZE: %d\n", avpkt->size);
+av_log(avctx, AV_LOG_DEBUG, "STRIDE: %d\n", stride);
 
-if (stride == 0 || avpkt->size < stride * avctx->height) {
+if (stride <= 0 || avpkt->size < stride * avctx->height) {
 av_log(avctx, AV_LOG_ERROR, "Packet too small (%d)\n", avpkt->size);
 return AVERROR_INVALIDDATA;
 }
 
-/* Temporary solution until PAL8 is implemented in nut */
-if (avctx->pix_fmt == AV_PIX_FMT_NONE &&
-avctx->bits_per_coded_sample == 1 &&
-avctx->frame_number == 0 &&
-context->palette &&
-AV_RB64(context->palette->data) == 0x
-) {
-const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL);
-if (!pal) {
-avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
-context->is_pal8 = 0;
-context->is_mono = 1;
-} else
-avctx->pix_fmt = AV_PIX_FMT_PAL8;
-}
 desc = av_pix_fmt_desc_get(avctx->pix_fmt);
 
 if ((avctx->bits_per_coded_sample == 8 || avctx->bits_per_coded_sample == 4
@@ -417,6 +396,8 @@ static int 

Re: [FFmpeg-devel] [PATCH 4/4] tests: Add test for proper header guard

2016-02-10 Thread Timothy Gu
On Sun, Jan 31, 2016 at 3:47 PM Timothy Gu  wrote:

> On Fri, Jan 29, 2016 at 10:10:48AM +0100, Clément Bœsch wrote:
> > On Thu, Jan 28, 2016 at 06:33:56PM -0800, Timothy Gu wrote:
> > > ---
> > >  tests/fate/source-check.sh | 11 +++
> > >  tests/ref/fate/source  | 12 
> > >  2 files changed, 23 insertions(+)
> > >
> > > diff --git a/tests/fate/source-check.sh b/tests/fate/source-check.sh
> > > index fb7af98..5524236 100755
> > > --- a/tests/fate/source-check.sh
> > > +++ b/tests/fate/source-check.sh
> > > @@ -16,5 +16,16 @@ git grep -L -E "This file is part of FFmpeg|This
> file is part of libswresample|"
> > >  "This program is free software; you can redistribute it and/or
> modify|"\
> > >  "This file is placed in the public domain" | grep -E
> '\.c$|\.h$|\.S$|\.asm$'
> > >
> > > +echo Headers without standard inclusion guards:
> > > +for f in `git ls-files | grep '\.h$'` ; do
> > > +macro="`echo $f | sed \
> > > +-e '/\/\|^ff/!{s/\(.*\)/ffmpeg\/\1/}' \
> > > +-e 's/^lib//' \
> > > +-e 's/[^A-Za-z0-9]\{1\,\}/_/g' \
> > > +-e 's/_\(a\|v\|av\)f_/_/' \
> >
> > > +| tr '[:lower:]' '[:upper:]'`"
> >
> > Not sure about the portability of these arguments. I think it might be
> > safer to copy/use toupper() from the configure.
>
> Changed locally.
>

Reviewed by Clément on IRC and pushed.

01:07 <@ubitux> Timothy_Gu: no other comment from me, i like the idea

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


Re: [FFmpeg-devel] [PATCH] avfilter: add metadata filters

2016-02-10 Thread Paul B Mahol
On 2/10/16, Tobias Rapp  wrote:
> On 06.02.2016 23:30, Paul B Mahol wrote:
>> On 2/6/16, Paul B Mahol  wrote:
>>> Hi,
>>>
>>> patch attached.
>>>
>>
>> Improved version attached.
>>
>> [...]
>> +
>> +static int string(const char *value1, const char *value2, size_t length)
>> +{
>> +return !strncmp(value1, value2, length);
>> +}
>
> If I understand correctly this function is used to compare if the start
> of value2 matches value1. Maybe this function should be called
> "starts_with" (also in the "function" option enum)?
>
>> +
>> +static int equal(const char *value1, const char *value2, size_t length)
>> +{
>> +float f1, f2;
>> +
>> +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
>> +return 0;
>> +
>> +return f1 != f2;
>> +}
>> +
>> +static int less(const char *value1, const char *value2, size_t length)
>> +{
>> +float f1, f2;
>> +
>> +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
>> +return 0;
>> +
>> +return f1 > f2;
>> +}
>> +
>> +static int greater(const char *value1, const char *value2, size_t length)
>> +{
>> +float f1, f2;
>> +
>> +if (sscanf(value1, "%f", ) + sscanf(value2, "%f", ) != 2)
>> +return 0;
>> +
>> +return f1 < f2;
>> +}
>> +
>> [...]
>
> I think it would be better to not compare float values directly with
> "==", "<" or ">". Instead use some code like "fabsf(f1 - f2) <= epsilon".
>
> BTW: Is the return value of "equal", "less" and "greater" inverse on
> purpose?

Not for equal, but for other it is.

>
> Another sidenote: I have seen that some filters use a common expression
> language (e.g. aeval, crop, scale). Not sure if this expression language
> supports string operators or if it is limited to numbers but in my
> opinion it would be great to re-use it here.

Added and applied. Filter is easily extendable.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v6] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/10/2016 12:26 PM, Mats Peterson wrote:




When using "-vcodec copy" with pal8 nut as the output, FFmpeg will
happily copy the video to the file without ever considering the stride
of it.


This is an imaginary situation, since I'm not able to enter the 'PAL[8]' 
tag using "-vtag", in order to overcome the incorrect usage of RGB[15].


Mats

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


Re: [FFmpeg-devel] [PATCH v7] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/11/2016 03:21 AM, Mats Peterson wrote:

On 02/11/2016 02:29 AM, Mats Peterson wrote:

On 02/11/2016 02:20 AM, Mats Peterson wrote:

have you tried updating your git checkout ?
it might be fixed by: 23261e60014908da7446e9b5bc7401dc30fdecd6



I just pulled the latest. Let's see what happens. It seems you've
changed the *bpp1 files in tests/ref/vsynth for some reason. I'm
creating a new patch here, since the old one will fail.

Mats



Yeah, that one looks promising.

Mats



Yes, it works fine.

Mats




It even passes my "1 bpp test suite". Thanks, Michael.

Mats

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


Re: [FFmpeg-devel] [PATCH v8] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/11/2016 03:20 AM, Mats Peterson wrote:

Updated the FATE test files for the latest checkout.

The stride will be calculated incorrectly for the attached 3 x 3 pixel
pal8 nut file, since there is some padding in the packet after the video
data and before the palette. It will be properly rounded down to the
real width of the video data for larger sizes, but this one will be 4
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all.
Anyway, run ffplay with "-v debug" to output the packet size and the
stride.

If you have a better solution, feel free to change the stride
calculation code. I suppose it's not that bad after all, since there
aren't too many users who use 3 x 3 pixel videos out there. But it's a
bit irritating nevertheless. Life would be easier if there were no
padding between the video data and the palette, but I guess it's done
for memory alignment purposes.

Just remember this: When using "-vcodec copy" with nut as the output,
FFmpeg will happily copy the video to the file without ever considering
the stride of it. Therefore, it's not possible to base the stride on
avctx->width for nut. It would of course be much easier. One will have
to divide the packet size (minus the palette size, 1024 bytes, in the
case of pal8 nut) with the height, in the same way as the stride is
calculated for AVI and QuickTime. They don't contain any palette in the
packets, of course.

Description follows:

This patch removes the monowhite switching code for 1 bpp raw AVI
without a palette. I don't see any reason to keep it, since it's
semantically incorrect to use monowhite for palettized data in my book,
it adds unnecessary noise to the code, and it's inconsistent with the
rest of the code in FFmpeg.

For black & white AVI or QuickTime files, in order to produce a
monochrome nut file, force the pixel format with "-pix_fmt monow" or
"-pix_fmt monob".

Another way is to use "ffmpeg -i 1bpp.avi -vcodec copy -vtag B1W0
1bpp.nut". The "-vtag" option is currently needed, otherwise FFmpeg will
use a RGB[15] codec tag for some reason.

I have also updated the 1 bpp FATE test files (once again).

Mats


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



Nice. The patch fails on tests/ref/fate/sub2video, since you JUST 
changed it over there. Can you fix that on your side?


Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avutil: add AV_PIX_FMT_GBR(A)P32F?E & AV_PIX_FMT_YUV(A)P32?E

2016-02-10 Thread Michael Niedermayer
On Wed, Feb 10, 2016 at 05:23:04PM -0500, Ronald S. Bultje wrote:
> Hi,
> 
> On Wed, Feb 10, 2016 at 5:12 PM, wm4  wrote:
> 
> > On Wed, 10 Feb 2016 23:00:00 +0100
> > Michael Niedermayer  wrote:
> >
> > > On Wed, Feb 10, 2016 at 10:21:34PM +0100, wm4 wrote:
> > > > On Wed, 10 Feb 2016 21:56:07 +0100
> > > > Michael Niedermayer  wrote:
> > > >
> > > > > Signed-off-by: Michael Niedermayer 
> > > > > ---
> > > > >  libavutil/pixdesc.c |  105
> > +++
> > > > >  libavutil/pixfmt.h  |   13 +++
> > > > >  2 files changed, 118 insertions(+)
> > > > >
> > > > > diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
> > > > > index 58833cf..5fda5bd 100644
> > > > > --- a/libavutil/pixdesc.c
> > > > > +++ b/libavutil/pixdesc.c
> > > > > @@ -926,6 +926,57 @@ static const AVPixFmtDescriptor
> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> > > > >  },
> > > > >  .flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > > > >  },
> > > > > +[AV_PIX_FMT_YUVA444P32FBE] = {
> > > > > +.name = "yuva444p32fbe",
> > > > > +.nb_components = 4,
> > > > > +.log2_chroma_w = 0,
> > > > > +.log2_chroma_h = 0,
> > > > > +.comp = {
> > > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > > > > +},
> > > > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > AV_PIX_FMT_FLAG_ALPHA,
> > > > > +},
> > > > > +[AV_PIX_FMT_YUVA444P32FLE] = {
> > > > > +.name = "yuva444p32fle",
> > > > > +.nb_components = 4,
> > > > > +.log2_chroma_w = 0,
> > > > > +.log2_chroma_h = 0,
> > > > > +.comp = {
> > > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },/* A */
> > > > > +},
> > > > > +.flags = AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_ALPHA,
> > > > > +},
> > > > > +[AV_PIX_FMT_YUV444P32FBE] = {
> > > > > +.name = "yuv444p32fbe",
> > > > > +.nb_components = 3,
> > > > > +.log2_chroma_w = 0,
> > > > > +.log2_chroma_h = 0,
> > > > > +.comp = {
> > > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > > +},
> > > > > +.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
> > > > > +},
> > > > > +[AV_PIX_FMT_YUV444P32FLE] = {
> > > > > +.name = "yuv444p32fle",
> > > > > +.nb_components = 3,
> > > > > +.log2_chroma_w = 0,
> > > > > +.log2_chroma_h = 0,
> > > > > +.comp = {
> > > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },/* Y */
> > > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },/* U */
> > > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },/* V */
> > > > > +},
> > > > > +.flags = AV_PIX_FMT_FLAG_PLANAR,
> > > > > +},
> > > > > +
> > > > >  #if FF_API_VDPAU
> > > > >  [AV_PIX_FMT_VDPAU_H264] = {
> > > > >  .name = "vdpau_h264",
> > > > > @@ -1819,6 +1870,60 @@ static const AVPixFmtDescriptor
> > av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
> > > > >  .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR |
> > > > >   AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > > >  },
> > > > > +[AV_PIX_FMT_GBRAP32FLE] = {
> > > > > +.name = "gbrap32fle",
> > > > > +.nb_components = 4,
> > > > > +.log2_chroma_w = 0,
> > > > > +.log2_chroma_h = 0,
> > > > > +.comp = {
> > > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 },   /* A */
> > > > > +},
> > > > > +.flags = AV_PIX_FMT_FLAG_PLANAR |
> > > > > + AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
> > > > > +},
> > > > > +[AV_PIX_FMT_GBRAP32FBE] = {
> > > > > +.name = "gbrap32fbe",
> > > > > +.nb_components = 4,
> > > > > +.log2_chroma_w = 0,
> > > > > +.log2_chroma_h = 0,
> > > > > +.comp = {
> > > > > +{ 2, 4, 0, 0, 32, 3, 31, 1 },   /* R */
> > > > > +{ 0, 4, 0, 0, 32, 3, 31, 1 },   /* G */
> > > > > +{ 1, 4, 0, 0, 32, 3, 31, 1 },   /* B */
> > > > > +{ 3, 4, 0, 0, 32, 3, 31, 1 

Re: [FFmpeg-devel] [PATCH v7] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/11/2016 12:07 AM, Mats Peterson wrote:

For black & white AVI or QuickTime files, in order to produce a
monochrome nut file, force the pixel format with "-pix_fmt monow" or
"-pix_fmt monob".

Unfortunately, there is a problem with converting from pal8 to monow,
and I know what it is now. There seems to be some weird dithering going
on of the white color, so there will be black pixels here and there in
the monow output. A better way is to use "ffmpeg -i 1bpp.avi -vcodec
copy -vtag B1W0 1bpp.nut". The "-vtag" option is currently needed,
otherwise FFmpeg will use a RGB[15] codec tag for some reason.



An alternative is to use "-sws_dither none", it seems to work fine. I 
just don't understand why the fully white color is dithered at all when 
converting from pal8 to monow.


Mats

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


Re: [FFmpeg-devel] [PATCH v7] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson


Sorry for the double posting. Don't bother about this one.

Mats

--
Mats Peterson
http://matsp888.no-ip.org/~mats/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v7] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/11/2016 01:11 AM, Mats Peterson wrote:

On 02/11/2016 12:07 AM, Mats Peterson wrote:

For black & white AVI or QuickTime files, in order to produce a
monochrome nut file, force the pixel format with "-pix_fmt monow" or
"-pix_fmt monob".

Unfortunately, there is a problem with converting from pal8 to monow,
and I know what it is now. There seems to be some weird dithering going
on of the white color, so there will be black pixels here and there in
the monow output. A better way is to use "ffmpeg -i 1bpp.avi -vcodec
copy -vtag B1W0 1bpp.nut". The "-vtag" option is currently needed,
otherwise FFmpeg will use a RGB[15] codec tag for some reason.



An alternative is to use "-sws_dither none", it seems to work fine. I
just don't understand why the fully white color is dithered at all when
converting from pal8 to monow.



Nope, doesn't work. I forgot to use "-pix_fmt monow", and it's the same 
as before.


Mats

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_nnedi: Simplify away some trivial mem*()

2016-02-10 Thread James Almer
On 2/10/2016 9:30 PM, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavfilter/vf_nnedi.c |   10 +++---
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/libavfilter/vf_nnedi.c b/libavfilter/vf_nnedi.c
> index 9a98ec2..d265fea 100644
> --- a/libavfilter/vf_nnedi.c
> +++ b/libavfilter/vf_nnedi.c
> @@ -362,7 +362,7 @@ static int32_t process_line0(const uint8_t *tempu, int 
> width, uint8_t *dstp8, co
>  tmp /= 32;
>  dstp[x] = FFMAX(FFMIN(tmp, maximum), minimum);
>  } else {
> -memset(dstp + x, 255, sizeof(uint8_t));
> +dstp[x] = 255;
>  count++;
>  }
>  }
> @@ -612,14 +612,10 @@ static void evalfunc_1(NNEDIContext *s, FrameData 
> *frame_data)
>  
>  for (y = ystart; y < ystop; y += 2) {
>  for (x = 32; x < width - 32; x++) {
> -uint32_t pixel = 0;
> -uint32_t all_ones = 0;
> +uint32_t pixel = dstp[x];
>  float mstd[4];
>  
> -memcpy(, dstp + x, sizeof(uint8_t));
> -memset(_ones, 255, sizeof(uint8_t));
> -
> -if (pixel != all_ones)

lol

> +if (pixel != 255)

Just make it "if (dstp[x] != 255)". No point using a local variable.

>  continue;
>  
>  s->extract((const uint8_t *)(srcpp + x), src_stride, xdia, 
> ydia, mstd, input);
> 

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


Re: [FFmpeg-devel] [PATCH v7] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Michael Niedermayer
On Thu, Feb 11, 2016 at 01:15:38AM +0100, Mats Peterson wrote:
> On 02/11/2016 01:11 AM, Mats Peterson wrote:
> >On 02/11/2016 12:07 AM, Mats Peterson wrote:
> >>For black & white AVI or QuickTime files, in order to produce a
> >>monochrome nut file, force the pixel format with "-pix_fmt monow" or
> >>"-pix_fmt monob".
> >>
> >>Unfortunately, there is a problem with converting from pal8 to monow,
> >>and I know what it is now. There seems to be some weird dithering going
> >>on of the white color, so there will be black pixels here and there in
> >>the monow output. A better way is to use "ffmpeg -i 1bpp.avi -vcodec
> >>copy -vtag B1W0 1bpp.nut". The "-vtag" option is currently needed,
> >>otherwise FFmpeg will use a RGB[15] codec tag for some reason.
> >>
> >
> >An alternative is to use "-sws_dither none", it seems to work fine. I
> >just don't understand why the fully white color is dithered at all when
> >converting from pal8 to monow.
> >
> 
> Nope, doesn't work. I forgot to use "-pix_fmt monow", and it's the
> same as before.

have you tried updating your git checkout ?
it might be fixed by: 23261e60014908da7446e9b5bc7401dc30fdecd6

[...]
-- 
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


[FFmpeg-devel] [PATCH v8] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

Updated the FATE test files for the latest checkout.

The stride will be calculated incorrectly for the attached 3 x 3 pixel 
pal8 nut file, since there is some padding in the packet after the video 
data and before the palette. It will be properly rounded down to the 
real width of the video data for larger sizes, but this one will be 4 
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all. 
Anyway, run ffplay with "-v debug" to output the packet size and the stride.


If you have a better solution, feel free to change the stride 
calculation code. I suppose it's not that bad after all, since there 
aren't too many users who use 3 x 3 pixel videos out there. But it's a 
bit irritating nevertheless. Life would be easier if there were no 
padding between the video data and the palette, but I guess it's done 
for memory alignment purposes.


Just remember this: When using "-vcodec copy" with nut as the output, 
FFmpeg will happily copy the video to the file without ever considering 
the stride of it. Therefore, it's not possible to base the stride on 
avctx->width for nut. It would of course be much easier. One will have 
to divide the packet size (minus the palette size, 1024 bytes, in the 
case of pal8 nut) with the height, in the same way as the stride is 
calculated for AVI and QuickTime. They don't contain any palette in the 
packets, of course.


Description follows:

This patch removes the monowhite switching code for 1 bpp raw AVI 
without a palette. I don't see any reason to keep it, since it's 
semantically incorrect to use monowhite for palettized data in my book, 
it adds unnecessary noise to the code, and it's inconsistent with the 
rest of the code in FFmpeg.


For black & white AVI or QuickTime files, in order to produce a 
monochrome nut file, force the pixel format with "-pix_fmt monow" or 
"-pix_fmt monob".


Another way is to use "ffmpeg -i 1bpp.avi -vcodec copy -vtag B1W0 
1bpp.nut". The "-vtag" option is currently needed, otherwise FFmpeg will 
use a RGB[15] codec tag for some reason.


I have also updated the 1 bpp FATE test files (once again).

Mats
>From 999aa8311b0b018accf35b5825af2c027efeb474 Mon Sep 17 00:00:00 2001
From: Mats Peterson 
Date: Thu, 11 Feb 2016 03:16:00 +0100
Subject: [PATCH v8] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

---
 libavcodec/rawdec.c   |   62 ++-
 tests/ref/fate/sub2video  |   85 -
 tests/ref/vsynth/vsynth1-bpp1 |4 +-
 tests/ref/vsynth/vsynth2-bpp1 |4 +-
 tests/ref/vsynth/vsynth3-bpp1 |4 +-
 tests/ref/vsynth/vsynth_lena-bpp1 |4 +-
 6 files changed, 115 insertions(+), 48 deletions(-)

diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index b7ce2b6..83ca576 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -100,7 +100,7 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 avpriv_set_systematic_pal2((uint32_t*)context->palette->data, avctx->pix_fmt);
 else {
 memset(context->palette->data, 0, AVPALETTE_SIZE);
-if (avctx->bits_per_coded_sample <= 1)
+if (avctx->bits_per_coded_sample == 1)
 memset(context->palette->data, 0xff, 4);
 }
 }
@@ -121,17 +121,13 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 if (avctx->codec_tag == MKTAG('B','1','W','0') ||
 avctx->codec_tag == MKTAG('B','0','W','1'))
 context->is_nut_mono = 1;
-else if (avctx->codec_tag == MKTAG('P','A','L','8'))
+else if (avctx->codec_tag == MKTAG('P','A','L',8))
 context->is_nut_pal8 = 1;
 
 if (avctx->codec_tag == AV_RL32("yuv2") &&
 avctx->pix_fmt   == AV_PIX_FMT_YUYV422)
 context->is_yuv2 = 1;
 
-/* Temporary solution until PAL8 is implemented in nut */
-if (context->is_pal8 && avctx->bits_per_coded_sample == 1)
-avctx->pix_fmt = AV_PIX_FMT_NONE;
-
 return 0;
 }
 
@@ -192,33 +188,16 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
 return AVERROR_INVALIDDATA;
 }
 
-if (context->is_nut_mono)
-stride = avctx->width / 8 + (avctx->width & 7 ? 1 : 0);
-else if (context->is_nut_pal8)
-stride = avctx->width;
-else
-stride = avpkt->size / avctx->height;
+stride = (avpkt->size - (context->is_nut_pal8 ? AVPALETTE_SIZE : 0)) / avctx->height;
+
+av_log(avctx, AV_LOG_DEBUG, "PACKET SIZE: %d\n", avpkt->size);
+av_log(avctx, AV_LOG_DEBUG, "STRIDE: %d\n", stride);
 
-if (stride == 0 || avpkt->size < stride * avctx->height) {
+if (stride <= 0 || avpkt->size < stride * avctx->height) {
 av_log(avctx, AV_LOG_ERROR, "Packet too small (%d)\n", avpkt->size);
 return AVERROR_INVALIDDATA;
 }
 
-/* Temporary solution until PAL8 is implemented in nut */
-if (avctx->pix_fmt == AV_PIX_FMT_NONE &&
-

Re: [FFmpeg-devel] [PATCH v7] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/11/2016 02:29 AM, Mats Peterson wrote:

On 02/11/2016 02:20 AM, Mats Peterson wrote:

have you tried updating your git checkout ?
it might be fixed by: 23261e60014908da7446e9b5bc7401dc30fdecd6



I just pulled the latest. Let's see what happens. It seems you've
changed the *bpp1 files in tests/ref/vsynth for some reason. I'm
creating a new patch here, since the old one will fail.

Mats



Yeah, that one looks promising.

Mats



Yes, it works fine.

Mats

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


Re: [FFmpeg-devel] [PATCH v8] lavc/rawdec: Remove monowhite switching code for 1 bpp AVI without a palette

2016-02-10 Thread Mats Peterson

On 02/11/2016 03:20 AM, Mats Peterson wrote:

Updated the FATE test files for the latest checkout.

The stride will be calculated incorrectly for the attached 3 x 3 pixel
pal8 nut file, since there is some padding in the packet after the video
data and before the palette. It will be properly rounded down to the
real width of the video data for larger sizes, but this one will be 4
instead of 3. I've tried a 1x1 file, but that one wouldn't play at all.
Anyway, run ffplay with "-v debug" to output the packet size and the
stride.



And I of course forgot the nut file. Here it is.

Mats



3x3.nut
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel