Re: [FFmpeg-devel] [PATCH] ffplay: log possible error of SDL_EnableKeyRepeat

2015-10-09 Thread wm4
On Thu,  8 Oct 2015 18:46:44 -0400
Ganesh Ajjanagadde  wrote:

> Note that for the current SDL source code, 0 is always returned.
> Nevertheless, this makes the code more robust.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  ffplay.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index 79f430d..c143e96 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -3814,7 +3814,8 @@ int main(int argc, char **argv)
>  SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
>  SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
>  
> -SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 
> SDL_DEFAULT_REPEAT_INTERVAL);
> +if (SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 
> SDL_DEFAULT_REPEAT_INTERVAL) < 0)
> +av_log(NULL, AV_LOG_ERROR, "SDL_EnableKeyRepeat(): %s\n", 
> SDL_GetError());
>  
>  if (av_lockmgr_register(lockmgr)) {
>  av_log(NULL, AV_LOG_FATAL, "Could not initialize lock manager!\n");

How does this make the code more "robust"?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL acceleration

2015-10-09 Thread Timo Rothenpieler


Using this sample: https://btbn.de/files/chromakey_sample.mp4

ffmpeg -f lavfi -i color=c=black:s=1280x720 -i chromakey_sample.mp4 -an
-c:v libx264 -preset veryfast -crf 18 -shortest -filter_complex
"[1:v]chromakey=0x70de77:0.1:0.2:0:1[ckout];[0:v][ckout]overlay[out]"
-map "[out]" -y output.mkv

The last parameter to the chromakey filter enables opencl acceleration.

Hi,

Could you please send the patch as attachments? I merge the code, but some 
compile errors occur.

Thanks
Best regards



You can pull from my github, the patches are in the chromakey branch:

https://github.com/BtbN/FFmpeg/tree/chromakey

If you want just the chromakey patch itself:

https://github.com/BtbN/FFmpeg/commit/29294c283a656cf809461cbae21d612b5a0f2159.patch



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


Re: [FFmpeg-devel] [PATCH] build system: fix dependency generation

2015-10-09 Thread Christophe Gisquet
Hi,

2015-10-09 3:34 GMT+02:00 Michael Niedermayer :
> should i apply this ?
> i cant really say if this is correct or not
> though whie testing i noticed that
> rm ffmpeg ffprobe ; ./configure --progs-suffix=abc  && make -j12 fate
> ends with
> make: *** No rule to make target `ffprobe', needed by `fate-ffprobe_compact'.

Does that actually work even without the patch? I have the same issue
and a lot of files in tests/ actually hardcode the binary filenames...

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


[FFmpeg-devel] [PATCH] fix b frame n_quant_offset

2015-10-09 Thread Agatha Hu

---
 libavcodec/nvenc.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 18bcd96..0e6ef43 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -742,8 +742,6 @@ static av_cold int nvenc_encode_init(AVCodecContext 
*avctx)

 switch (avctx->codec->id) {
 case AV_CODEC_ID_H264:
 ctx->encode_config.encodeCodecConfig.h264Config.idrPeriod 
= avctx->gop_size;
- 
ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalPFrames = 1;
- 
ctx->encode_config.encodeCodecConfig.h264Config.hierarchicalBFrames = 1;

 break;
 case AV_CODEC_ID_H265:
 ctx->encode_config.encodeCodecConfig.hevcConfig.idrPeriod 
= avctx->gop_size;
@@ -843,9 +841,9 @@ static av_cold int nvenc_encode_init(AVCodecContext 
*avctx)


 if(avctx->i_quant_factor != 0.0 && avctx->b_quant_factor != 0.0) {
 ctx->encode_config.rcParams.initialRCQP.qpIntra = 
qp_inter_p * fabs(avctx->i_quant_factor);
-ctx->encode_config.rcParams.initialRCQP.qpIntra += 
qp_inter_p * avctx->i_quant_offset;
+ctx->encode_config.rcParams.initialRCQP.qpIntra += 
avctx->i_quant_offset;
 ctx->encode_config.rcParams.initialRCQP.qpInterB = 
qp_inter_p * fabs(avctx->b_quant_factor);
-ctx->encode_config.rcParams.initialRCQP.qpInterB += 
qp_inter_p * avctx->b_quant_offset;
+ctx->encode_config.rcParams.initialRCQP.qpInterB += 
avctx->b_quant_offset;

 } else {
 ctx->encode_config.rcParams.initialRCQP.qpIntra = qp_inter_p;
 ctx->encode_config.rcParams.initialRCQP.qpInterB = qp_inter_p;
--
1.9.5.github.0



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


Re: [FFmpeg-devel] [PATCH] build system: fix dependency generation

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 10:58:50AM +0200, Christophe Gisquet wrote:
> Hi,
> 
> 2015-10-09 3:34 GMT+02:00 Michael Niedermayer :
> > should i apply this ?
> > i cant really say if this is correct or not
> > though whie testing i noticed that
> > rm ffmpeg ffprobe ; ./configure --progs-suffix=abc  && make -j12 fate
> > ends with
> > make: *** No rule to make target `ffprobe', needed by 
> > `fate-ffprobe_compact'.
> 
> Does that actually work even without the patch? I have the same issue

no, it doesnt work before either, its unrelated, i just stumbled
accross it while testing ...
sorry if i wasnt clear about that


> and a lot of files in tests/ actually hardcode the binary filenames...
> 
> -- 
> Christophe
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] build system: fix dependency generation

2015-10-09 Thread Christophe Gisquet
2015-10-09 11:49 GMT+02:00 Michael Niedermayer :
>> Does that actually work even without the patch? I have the same issue
>
> no, it doesnt work before either, its unrelated

Well I thought it was relevant to the patch and it was causing that
regression. So as far as I know, replacing the previous pattern by the
new one doesn't seem to cause issues to something else, so it's
actually good.

>, i just stumbled accross it while testing ...
> sorry if i wasnt clear about that

Try the attached patch for that separate issue. It's not the
prettiest, and the next new test might break it, but if that's the
first time ever this issue appeared, it's probably not worth bothering
more with it.

-- 
Christophe
From 689d75fcb2f4f8a0202eecdcd5629ff6b2fac02e Mon Sep 17 00:00:00 2001
From: Christophe Gisquet 
Date: Fri, 9 Oct 2015 11:42:18 +0200
Subject: [PATCH] fate: use PROGSSUF

May require exporting in the shell var PROGSUF when invoking a
shell script.
---
 tests/Makefile  | 11 +++
 tests/fate-run.sh   | 38 +++---
 tests/fate/ffprobe.mak  |  2 +-
 tests/fate/filter-video.mak |  4 ++--
 tests/fate/probe.mak|  2 +-
 tests/fate/vpx.mak  | 10 +-
 tests/regression-funcs.sh   |  4 ++--
 7 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/tests/Makefile b/tests/Makefile
index c0c1958..dbf1a23 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -7,6 +7,8 @@ AREF = tests/data/asynth1.sw
 FATEW = 34
 FATEH = 34
 
+FFMPEG=ffmpeg$(PROGSSUF)$(EXESUF)
+
 $(AREF): CMP=
 
 ffservertest: ffserver$(EXESUF) tests/vsynth1/00.pgm tests/data/asynth1.sw
@@ -44,7 +46,7 @@ tests/test_copy.ffmeta: TAG = COPY
 tests/test_copy.ffmeta: tests/data
 	$(M)cp -f $(SRC_PATH)/tests/test.ffmeta tests/test_copy.ffmeta
 
-tests/data/ffprobe-test.nut: ffmpeg$(EXESUF) tests/test_copy.ffmeta
+tests/data/ffprobe-test.nut: ffmpeg$(PROGSSUF)$(EXESUF) tests/test_copy.ffmeta
 	$(M)$(TARGET_EXEC) $(TARGET_PATH)/$< \
 -f lavfi -i "aevalsrc=sin(400*PI*2*t):d=0.125[out0]; testsrc=d=0.125[out1]; testsrc=s=100x100:d=0.125[out2]" \
 -f ffmetadata -i $(TARGET_PATH)/tests/test_copy.ffmeta \
@@ -177,9 +179,9 @@ FATE += $(FATE-yes)
 RSYNC_OPTIONS-$(HAVE_RSYNC_CONTIMEOUT) += --contimeout=60
 RSYNC_OPTIONS = -vrltLW --timeout=60 $(RSYNC_OPTIONS-yes)
 
-$(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(EXESUF)
+$(FATE_FFMPEG) $(FATE_SAMPLES_AVCONV) $(FATE_SAMPLES_FFMPEG): ffmpeg$(PROGSSUF)$(EXESUF)
 
-$(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(EXESUF)
+$(FATE_FFPROBE) $(FATE_SAMPLES_FFPROBE): ffprobe$(PROGSSUF)$(EXESUF)
 
 ifdef SAMPLES
 FATE += $(FATE_FULL) $(FATE_FULL-yes)
@@ -201,6 +203,7 @@ TOOL = ffmpeg
 
 fate:: $(FATE)
 
+$(FATE) $(FATE_TESTS-no): export PROGSUF = $(PROGSSUF)
 $(FATE) $(FATE_TESTS-no): $(FATE_UTILS:%=tests/%$(HOSTEXESUF))
 	@echo "TEST$(@:fate-%=%)"
 	$(Q)$(SRC_PATH)/tests/fate-run.sh $@ "$(TARGET_SAMPLES)" "$(TARGET_EXEC)" "$(TARGET_PATH)" '$(CMD)' '$(CMP)' '$(REF)' '$(FUZZ)' '$(THREADS)' '$(THREAD_TYPE)' '$(CPUFLAGS)' '$(CMP_SHIFT)' '$(CMP_TARGET)' '$(SIZE_TOLERANCE)' '$(CMP_UNIT)' '$(GEN)' '$(HWACCEL)'
@@ -226,7 +229,7 @@ lcov-reset:
 clean:: testclean
 
 testclean::
-	$(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(EXESUF)
+	$(RM) -r tests/vsynth1 tests/data tools/lavfi-showfiltfmts$(PROGSSUF)$(EXESUF)
 	$(RM) $(CLEANSUFFIXES:%=tests/%)
 	$(RM) $(TESTTOOLS:%=tests/%$(HOSTEXESUF))
 	$(RM) tests/pixfmts.mak tests/test_copy.ffmeta
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 76f66d3..648c67d 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -84,7 +84,7 @@ runecho(){
 }
 
 probefmt(){
-run ffprobe -show_entries format=format_name -print_format default=nw=1:nk=1 -v 0 "$@"
+run ffprobe${PROGSUF} -show_entries format=format_name -print_format default=nw=1:nk=1 -v 0 "$@"
 }
 
 runlocal(){
@@ -93,7 +93,7 @@ runlocal(){
 }
 
 probeframes(){
-run ffprobe -show_frames -v 0 "$@"
+run ffprobe${PROGSUF} -show_frames -v 0 "$@"
 }
 
 ffmpeg(){
@@ -103,33 +103,33 @@ ffmpeg(){
 [ x${arg} = x-i ] && ffmpeg_args="${ffmpeg_args} ${dec_opts}"
 ffmpeg_args="${ffmpeg_args} ${arg}"
 done
-run ffmpeg ${ffmpeg_args}
+run ./ffmpeg${PROGSUF} ${ffmpeg_args}
 }
 
 framecrc(){
-ffmpeg "$@" -flags +bitexact -fflags +bitexact -f framecrc -
+./ffmpeg${PROGSUF} "$@" -flags +bitexact -fflags +bitexact -f framecrc -
 }
 
 framemd5(){
-ffmpeg "$@" -flags +bitexact -fflags +bitexact -f framemd5 -
+./ffmpeg${PROGSUF} "$@" -flags +bitexact -fflags +bitexact -f framemd5 -
 }
 
 crc(){
-ffmpeg "$@" -f crc -
+./ffmpeg${PROGSUF} "$@" -f crc -
 }
 
 md5(){
-ffmpeg "$@" md5:
+./ffmpeg${PROGSUF} "$@" md5:
 }
 
 pcm(){
-ffmpeg "$@" -vn -f s16le -
+./ffmpeg${PROGSUF} "$@" -vn -f s16le -
 }
 
 fmtstdout(){
 fmt=$1
 shift 1
-ffmpeg -flags +bitexact -fflags +bitexact "$@" -f 

Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-09 Thread Clément Bœsch
On Fri, Oct 02, 2015 at 12:36:54PM +0200, Clément Bœsch wrote:
> On Fri, Oct 02, 2015 at 12:20:10PM +0200, wm4 wrote:
> > On Fri, 2 Oct 2015 11:23:59 +0200
> > Clément Bœsch  wrote:
> > 
> > > On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
> > > [...]
> > > > > +#if HAVE_UTGETOSTYPEFROMSTRING
> > > > >  vdactx->cv_pix_fmt_type = 
> > > > > UTGetOSTypeFromString(pixfmt_str);
> > > > > +#else
> > > > > +av_log(s, loglevel, "UTGetOSTypeFromString() is not 
> > > > > available "
> > > > > +   "on this platform, %s pixel format can not be 
> > > > > honored from "
> > > > > +   "the command line\n", videotoolbox_pixfmt);
> > > > > +#endif
> > > > >  ret = av_vda_default_init2(s, vdactx);
> > > > >  CFRelease(pixfmt_str);
> > > > >  }
> > > > 
> > > > I'd question the use of this in the first place. What does it do at
> > > > all? I couldn't find documentation for this option at all.
> > > > 
> > > > You could just do a numerical conversion from FourCC or a plain numeric
> > > > value, but I question why this needs to be user-settable at all.
> > > 
> > > This is a CLI option to save a software convert by making VT outputs
> > > directly in a given pixel format (the NV12 → BGRA can be faster than
> > > swscale for instance).
> > > 
> > > So the function is just to map from the vt pixel format string (user
> > > specified) to the vt pixel format.
> > > 
> > > What we can do also is to make a mapping from our pixel format strings to
> > > the VT pixel formats, which could make more sense. But this is a behaviour
> > > change, and I'm just trying to fix the build here.
> > > 
> > 
> > Why not disable ffmpeg_videotoolbox.c on iOS then? (I don't mind either
> > way, but this fix feels slightly wrong. But I don't want to block it.)
> 
> I could do that, but it would require to add that build granularity, and I
> would still need to fix the link to the CoreServices. I don't think the
> diff will be simpler & shorter.

Applied.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avcodec/xvmc: apply attribute_deprecated correctly

2015-10-09 Thread Ganesh Ajjanagadde
On Fri, Oct 9, 2015 at 7:34 PM, Ivan Kalvachev  wrote:
> On 10/10/15, Ganesh Ajjanagadde  wrote:
>> This fixes a warning observed on Clang 3.7:
>> "warning: attribute 'deprecated' is ignored, place it after "struct" to
>> apply attribute to type declaration [-Wignored-attributes]"
>> and thus enables deprecation warning for the relevant struct.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavcodec/xvmc.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/xvmc.h b/libavcodec/xvmc.h
>> index c2e187c..465ee78 100644
>> --- a/libavcodec/xvmc.h
>> +++ b/libavcodec/xvmc.h
>> @@ -43,7 +43,7 @@
>>  #define AV_XVMC_ID0x1DC711C0  /**< special value to
>> ensure that regular pixel routines haven't corrupted the struct
>> the number is 1337
>> speak for the letters IDCT MCo (motion compensation) */
>>
>> -attribute_deprecated struct xvmc_pix_fmt {
>> +struct attribute_deprecated xvmc_pix_fmt {
>>  /** The field contains the special constant value AV_XVMC_ID.
>>  It is used as a test that the application correctly uses the API,
>>  and that there is no corruption caused by pixel routines.
>
> That struct should not be deprecated at all in FFmpeg.
>
> Should I send a patch?

Why then was there an attribute_deprecated? Was this a merge from
Libav? I myself have no opinions at all (and am not even qualified to
comment on it).

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


Re: [FFmpeg-devel] [PATCH] fate/subtitles: Add a new test for WebVTT

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 07:21:04PM +0100, Ricardo wrote:
> Attached is the sample mentioned.

uploaded

(note, until its used te first time the sample can still be changed
 and reuploaded if needed)

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] fate/subtitles: Add a new test for WebVTT

2015-10-09 Thread Ricardo Constantino
I had git misconfigured to convert CRLF to LF, so I'll probably reupload
the patches (if it makes a difference?), but the sample should be OK as is.

On 10 October 2015 at 01:26, Michael Niedermayer 
wrote:

> On Fri, Oct 09, 2015 at 07:21:04PM +0100, Ricardo wrote:
> > Attached is the sample mentioned.
>
> uploaded
>
> (note, until its used te first time the sample can still be changed
>  and reuploaded if needed)
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> I do not agree with what you have to say, but I'll defend to the death your
> right to say it. -- Voltaire
>
> ___
> 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/3] avcodec/webvttdec: Deal with WebVTT escapes

2015-10-09 Thread Ricardo Constantino
Bare ampersand characters are still accepted, even though out-of-spec.
Also fixes adjacent tags not being parsed.

Fixes trac #4915

Signed-off-by: Ricardo Constantino 
---
 libavcodec/webvttdec.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 1284a17..3b98e98 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -37,11 +37,14 @@ static const struct {
 {"", "{\\b1}"}, {"", "{\\b0}"},
 {"", "{\\u1}"}, {"", "{\\u0}"},
 {"{", "\\{"}, {"}", "\\}"}, // escape to avoid ASS markup conflicts
+{"", ">"}, {"", "<"},
+{"", ""}, {"", ""}, // FIXME: properly honor bidi marks
+{"", "&"}, {"", " "},
 };
 
 static int webvtt_event_to_ass(AVBPrint *buf, const char *p)
 {
-int i, skip = 0;
+int i, again, skip = 0;
 
 while (*p) {
 
@@ -51,13 +54,19 @@ static int webvtt_event_to_ass(AVBPrint *buf, const char *p)
 if (!strncmp(p, from, len)) {
 av_bprintf(buf, "%s", webvtt_tag_replace[i].to);
 p += len;
+again = 1;
 break;
 }
 }
 if (!*p)
 break;
 
-if (*p == '<')
+if (again) {
+again = 0;
+skip = 0;
+continue;
+}
+else if (*p == '<')
 skip = 1;
 else if (*p == '>')
 skip = 0;
-- 
2.6.0

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


[FFmpeg-devel] [PATCH 2/3] avformat/webvttdec: Don't stop parsing on comments

2015-10-09 Thread Ricardo Constantino
Signed-off-by: Ricardo Constantino 
---
 libavformat/webvttdec.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index 43c2a63..47a3255 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -92,7 +92,8 @@ static int webvtt_read_header(AVFormatContext *s)
 
 /* ignore header chunk */
 if (!strncmp(p, "\xEF\xBB\xBFWEBVTT", 9) ||
-!strncmp(p, "WEBVTT", 6))
+!strncmp(p, "WEBVTT", 6) ||
+!strncmp(p, "NOTE", 4))
 continue;
 
 /* optional cue identifier (can be a number like in SRT or some kind of
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH] configure: fix build error with freetype2 during preprocessing

2015-10-09 Thread Ganesh Ajjanagadde
On Sat, Sep 5, 2015 at 11:24 PM, Ganesh Ajjanagadde  wrote:
> On Sat, Sep 5, 2015 at 8:21 PM, Ganesh Ajjanagadde  wrote:
>> On Sat, Sep 5, 2015 at 8:08 AM, proud zhu  wrote:
>>> this patch fix the below error when build with --enable-libfreetype
>>> libavfilter/avf_showcqt.c:38:10: error: #include expects "FILENAME" or
>>> 
>>> #include FT_FREETYPE_H
>>
>> I noticed that this does not affect clang, while it does affect gcc.
>> Note that this "computed include" stuff is rather arcane, see e.g
>> https://gcc.gnu.org/onlinedocs/cpp/Computed-Includes.html.
>>
>> Your patch does not seem to cause any issues, and fixes an issue on GCC.
>> However, I do not like the patch as is; and suggest the following 
>> improvement:
>>
>> Expand the commit message to reflect the above analysis, i.e mention
>> that this is compiler specific (GCC and not clang), and also that it
>> fixes a multitude of such errors. You don't have to list all of them
>> if there are too many, but at least change "fix the below error" to
>> "fix errors of the form ...".
>
> Also add a relevant comment to configure; otherwise it will be unclear
> that this is a hack for future readers. Please also note your gcc
> version in the comment; ideally in the commit message as well.

Fixed differently in commit 8d1226e623b270969a04e455a14ed036dc8466bc.

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


Re: [FFmpeg-devel] [PATCH] avcodec/xvmc: apply attribute_deprecated correctly

2015-10-09 Thread Ivan Kalvachev
On 10/10/15, Ganesh Ajjanagadde  wrote:
> This fixes a warning observed on Clang 3.7:
> "warning: attribute 'deprecated' is ignored, place it after "struct" to
> apply attribute to type declaration [-Wignored-attributes]"
> and thus enables deprecation warning for the relevant struct.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/xvmc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/xvmc.h b/libavcodec/xvmc.h
> index c2e187c..465ee78 100644
> --- a/libavcodec/xvmc.h
> +++ b/libavcodec/xvmc.h
> @@ -43,7 +43,7 @@
>  #define AV_XVMC_ID0x1DC711C0  /**< special value to
> ensure that regular pixel routines haven't corrupted the struct
> the number is 1337
> speak for the letters IDCT MCo (motion compensation) */
>
> -attribute_deprecated struct xvmc_pix_fmt {
> +struct attribute_deprecated xvmc_pix_fmt {
>  /** The field contains the special constant value AV_XVMC_ID.
>  It is used as a test that the application correctly uses the API,
>  and that there is no corruption caused by pixel routines.

That struct should not be deprecated at all in FFmpeg.

Should I send a patch?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL acceleration

2015-10-09 Thread highgod0401

From: Timo Rothenpieler
Date: 2015-10-09 16:41
To: FFmpeg development discussions and patches
CC: highgod0401
Subject: Re: [FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL 
acceleration
>
> Using this sample: https://btbn.de/files/chromakey_sample.mp4
>
> ffmpeg -f lavfi -i color=c=black:s=1280x720 -i chromakey_sample.mp4 -an
> -c:v libx264 -preset veryfast -crf 18 -shortest -filter_complex
> "[1:v]chromakey=0x70de77:0.1:0.2:0:1[ckout];[0:v][ckout]overlay[out]"
> -map "[out]" -y output.mkv
>
> The last parameter to the chromakey filter enables opencl acceleration.
>
> Hi,
>
> Could you please send the patch as attachments? I merge the code, but some 
> compile errors occur.
>
> Thanks
> Best regards
>

You can pull from my github, the patches are in the chromakey branch:

https://github.com/BtbN/FFmpeg/tree/chromakey

If you want just the chromakey patch itself:

https://github.com/BtbN/FFmpeg/commit/29294c283a656cf809461cbae21d612b5a0f2159.patch

Hi
OK, I will test as soon as possible

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


[FFmpeg-devel] [PATCH] vp9: add itxfm_add eob shortcuts to 10/12bpp functions.

2015-10-09 Thread Ronald S. Bultje
These aren't quite as helpful as the ones in 8bpp, since over there,
we can use pmulhrsw, but here the coefficients have too many bits to
be able to take advantage of pmulhrsw. However, we can still skip
cols for which all coefs are 0, and instead just zero the input data
for the row itx. This helps a few % on overall decoding speed.
---
 libavcodec/x86/vp9itxfm_16bpp.asm | 217 ++
 tests/checkasm/vp9dsp.c   |   2 +-
 2 files changed, 195 insertions(+), 24 deletions(-)

diff --git a/libavcodec/x86/vp9itxfm_16bpp.asm 
b/libavcodec/x86/vp9itxfm_16bpp.asm
index 199f611e..9cb01ce 100644
--- a/libavcodec/x86/vp9itxfm_16bpp.asm
+++ b/libavcodec/x86/vp9itxfm_16bpp.asm
@@ -97,6 +97,40 @@ pw_m3196_m16069: times 4 dw -3196, -16069
 pw_m13623_m9102: times 4 dw -13623, -9102
 pw_m6270_m15137: times 4 dw -6270, -15137
 
+default_8x8:
+times 12 db 1
+times 52 db 2
+row_8x8:
+times 18 db 1
+times 46 db 2
+col_8x8:
+times 6 db 1
+times 58 db 2
+default_16x16:
+times 10 db 1
+times 28 db 2
+times 51 db 3
+times 167 db 4
+row_16x16:
+times 21 db 1
+times 45 db 2
+times 60 db 3
+times 130 db 4
+col_16x16:
+times 5 db 1
+times 12 db 2
+times 25 db 3
+times 214 db 4
+default_32x32:
+times 9 db 1
+times 25 db 2
+times 36 db 3
+times 65 db 4
+times 105 db 5
+times 96 db 6
+times 112 db 7
+times 576 db 8
+
 SECTION .text
 
 %macro VP9_STORE_2X 6-7 dstq ; reg1, reg2, tmp1, tmp2, min, max, dst
@@ -648,12 +682,19 @@ cglobal vp9_idct_idct_8x8_add_10, 4, 6 + ARCH_X86_64, 10, 
\
 
 .idctfull:
 mova   [rsp+16*mmsize], m0
-DEFINE_ARGS dst, stride, block, cnt, ptr, stride3, dstbak
+DEFINE_ARGS dst, stride, block, cnt, ptr, skip, dstbak
 %if ARCH_X86_64
 movdstbakq, dstq
+movsxdcntq, cntd
 %endif
-lea   stride3q, [strideq*3]
-mov   cntd, 2
+%ifdef PIC
+lea   ptrq, [default_8x8]
+movzx cntd, byte [ptrq+cntq-1]
+%else
+movzx cntd, byte [default_8x8+cntq-1]
+%endif
+mov  skipd, 2
+sub  skipd, cntd
 mov   ptrq, rsp
 .loop_1:
 IDCT8_1Dblockq
@@ -674,6 +715,24 @@ cglobal vp9_idct_idct_8x8_add_10, 4, 6 + ARCH_X86_64, 10, \
 dec   cntd
 jg .loop_1
 
+; zero-pad the remainder (skipped cols)
+test skipd, skipd
+jz .end
+shl  skipd, 1
+lea blockq, [blockq+skipq*(mmsize>>1)]
+pxorm0, m0
+.loop_z:
+mova   [ptrq+mmsize*0], m0
+mova   [ptrq+mmsize*1], m0
+mova   [ptrq+mmsize*2], m0
+mova   [ptrq+mmsize*3], m0
+add   ptrq, 4 * mmsize
+dec  skipd
+jg .loop_z
+.end:
+
+DEFINE_ARGS dst, stride, block, cnt, ptr, stride3, dstbak
+lea   stride3q, [strideq*3]
 mov   cntd, 2
 mov   ptrq, rsp
 .loop_2:
@@ -860,7 +919,7 @@ cglobal vp9_idct_idct_8x8_add_12, 4, 6 + ARCH_X86_64, 10, \
 SWAP 2, 7, 6
 %endmacro
 
-%macro IADST8_FN 4
+%macro IADST8_FN 5
 cglobal vp9_%1_%3_8x8_add_10, 3, 6 + ARCH_X86_64, 13, \
   17 * mmsize + ARCH_X86_32 * 5 * mmsize, \
   dst, stride, block, eob
@@ -868,12 +927,19 @@ cglobal vp9_%1_%3_8x8_add_10, 3, 6 + ARCH_X86_64, 13, \
 
 .body:
 mova   [rsp+16*mmsize], m0
-DEFINE_ARGS dst, stride, block, cnt, ptr, stride3, dstbak
+DEFINE_ARGS dst, stride, block, cnt, ptr, skip, dstbak
 %if ARCH_X86_64
 movdstbakq, dstq
+movsxdcntq, cntd
 %endif
-lea   stride3q, [strideq*3]
-mov   cntd, 2
+%ifdef PIC
+lea   ptrq, [%5_8x8]
+movzx cntd, byte [ptrq+cntq-1]
+%else
+movzx cntd, byte [%5_8x8+cntq-1]
+%endif
+mov  skipd, 2
+sub  skipd, cntd
 mov   ptrq, rsp
 .loop_1:
 %2_1D   blockq
@@ -894,6 +960,24 @@ cglobal vp9_%1_%3_8x8_add_10, 3, 6 + ARCH_X86_64, 13, \
 dec   cntd
 jg .loop_1
 
+; zero-pad the remainder (skipped cols)
+test skipd, skipd
+jz .end
+shl  skipd, 1
+lea blockq, [blockq+skipq*(mmsize>>1)]
+pxorm0, m0
+.loop_z:
+mova   [ptrq+mmsize*0], m0
+mova   [ptrq+mmsize*1], m0
+mova   [ptrq+mmsize*2], m0
+mova   [ptrq+mmsize*3], m0
+add   ptrq, 4 * mmsize
+dec  skipd
+jg .loop_z
+.end:
+
+DEFINE_ARGS dst, stride, block, cnt, ptr, stride3, dstbak
+lea   stride3q, [strideq*3]
 mov   cntd, 2
 mov   ptrq, rsp
 .loop_2:
@@ -927,9 +1011,9 @@ cglobal vp9_%1_%3_8x8_add_12, 3, 6 + ARCH_X86_64, 13, \
 %endmacro
 
 INIT_XMM sse2
-IADST8_FN idct,  IDCT8,  iadst, IADST8
-IADST8_FN iadst, IADST8, idct,  IDCT8
-IADST8_FN iadst, IADST8, iadst, IADST8
+IADST8_FN idct,  IDCT8,  iadst, IADST8, row
+IADST8_FN iadst, 

Re: [FFmpeg-devel] [PATCH 2/5] lavu/jni: add more JNI helper

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 06:26:50PM +0200, Matthieu Bouron wrote:
> From: Matthieu Bouron 
> 
> ---
>  libavutil/jni_internal.c | 290 
> +++
>  libavutil/jni_internal.h | 101 +
>  2 files changed, 391 insertions(+)
> 
> diff --git a/libavutil/jni_internal.c b/libavutil/jni_internal.c
> index b17275d..2c1dc70 100644
> --- a/libavutil/jni_internal.c
> +++ b/libavutil/jni_internal.c
> @@ -18,6 +18,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#include "bprint.h"
>  #include "config.h"
>  #include "jni.h"
>  #include "jni_internal.h"
> @@ -67,3 +68,292 @@ int avpriv_jni_detach_env(void *log_ctx)
>  
>  return (*java_vm)->DetachCurrentThread(java_vm);
>  }
> +
> +char *avpriv_jni_jstring_to_utf_chars(JNIEnv *env, jstring string, void 
> *log_ctx)
> +{
> +char *ret = NULL;
> +const char *utf_chars = NULL;
> +
> +jboolean copy = 0;
> +
> +utf_chars = (*env)->GetStringUTFChars(env, string, );
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "String.getStringUTFChars() threw an 
> exception\n");
> +return NULL;
> +}
> +
> +ret = av_strdup(utf_chars);
> +
> +(*env)->ReleaseStringUTFChars(env, string, utf_chars);
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "String.releaseStringUTFChars() threw 
> an exception\n");
> +return NULL;;
> +}
> +
> +return ret;
> +}
> +
> +jstring avpriv_jni_utf_chars_to_jstring(JNIEnv *env, const char *utf_chars, 
> void *log_ctx)
> +{
> +jstring ret;
> +
> +ret = (*env)->NewStringUTF(env, utf_chars);
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "NewStringUTF() threw an exception\n");
> +return NULL;
> +}
> +
> +return ret;
> +}
> +
> +int avpriv_jni_exception_get_summary(JNIEnv *env, jthrowable exception, char 
> **error, void *log_ctx)
> +{
> +int ret = 0;
> +
> +AVBPrint bp;
> +
> +char *name = NULL;
> +char *message = NULL;
> +
> +jclass class_class = NULL;
> +jmethodID get_name_id = NULL;
> +
> +jclass exception_class = NULL;
> +jmethodID get_message_id = NULL;
> +
> +jstring string;
> +
> +av_bprint_init(, 0, AV_BPRINT_SIZE_AUTOMATIC);
> +
> +exception_class = (*env)->GetObjectClass(env, exception);
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "Could not find Throwable class\n");
> +ret = AVERROR_EXTERNAL;
> +goto done;
> +}
> +
> +class_class = (*env)->GetObjectClass(env, exception_class);
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "Could not find Throwable class's 
> class\n");
> +ret = AVERROR_EXTERNAL;
> +goto done;
> +}
> +
> +get_name_id = (*env)->GetMethodID(env, class_class, "getName", 
> "()Ljava/lang/String;");
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "Could not find method 
> Class.getName()\n");
> +ret = AVERROR_EXTERNAL;
> +goto done;
> +}
> +
> +string = (*env)->CallObjectMethod(env, exception_class, get_name_id);
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "Class.getName() threw an 
> exception\n");
> +ret = AVERROR_EXTERNAL;
> +goto done;
> +}
> +
> +name = avpriv_jni_jstring_to_utf_chars(env, string, log_ctx);
> +if (!name) {
> +ret = AVERROR(ENOMEM);
> +goto done;
> +}
> +
> +(*env)->DeleteLocalRef(env, string);
> +
> +get_message_id = (*env)->GetMethodID(env, exception_class, "getMessage", 
> "()Ljava/lang/String;");
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "Could not find method 
> java/lang/Throwable.getMessage()\n");
> +ret = AVERROR_EXTERNAL;
> +goto done;
> +}
> +
> +string = (*env)->CallObjectMethod(env, exception, get_message_id);
> +if ((*env)->ExceptionCheck(env)) {
> +(*env)->ExceptionClear(env);
> +av_log(log_ctx, AV_LOG_ERROR, "Throwable.getMessage() threw an 
> exception\n");
> +ret = AVERROR_EXTERNAL;
> +goto done;
> +}
> +
> +message = avpriv_jni_jstring_to_utf_chars(env, string, log_ctx);
> +if (!message) {
> +ret = AVERROR(ENOMEM);
> +goto done;
> +}
> +
> +(*env)->DeleteLocalRef(env, string);
> +
> +av_bprintf(, "%s: %s", name, message);
> +ret = av_bprint_finalize(, error);
> +
> +done:
> +
> +av_free(name);
> +

[FFmpeg-devel] [PATCH 3/3] fate/subtitles: Add a new test for WebVTT

2015-10-09 Thread Ricardo Constantino
Includes escapes that should now be supported and a few features not yet
fully supported, like comments, regions, classes, ruby, and lang.

All were tested with https://quuz.org/webvtt/ for validation, except
regions because the validator doesn't support them yet, and I couldn't
find any other way to validate WebVTT.

Signed-off-by: Ricardo Constantino 
---
 tests/fate/subtitles.mak   |  3 +++
 tests/ref/fate/sub-webvtt2 | 24 
 2 files changed, 27 insertions(+)
 create mode 100644 tests/ref/fate/sub-webvtt2

diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 81ad4d7..2d9eb50 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -70,6 +70,9 @@ fate-sub-vplayer: CMD = fmtstdout ass -i 
$(TARGET_SAMPLES)/sub/VPlayer_capabilit
 FATE_SUBTITLES_ASS-$(call DEMDEC, WEBVTT, WEBVTT) += fate-sub-webvtt
 fate-sub-webvtt: CMD = fmtstdout ass -i 
$(TARGET_SAMPLES)/sub/WebVTT_capability_tester.vtt
 
+FATE_SUBTITLES_ASS-$(call DEMDEC, WEBVTT, WEBVTT) += fate-sub-webvtt2
+fate-sub-webvtt2: CMD = fmtstdout ass -i 
$(TARGET_SAMPLES)/sub/WebVTT_extended_tester.vtt
+
 FATE_SUBTITLES-$(call ALLYES, SRT_DEMUXER SUBRIP_DECODER WEBVTT_ENCODER 
WEBVTT_MUXER) += fate-sub-webvttenc
 fate-sub-webvttenc: CMD = fmtstdout webvtt -i 
$(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt
 
diff --git a/tests/ref/fate/sub-webvtt2 b/tests/ref/fate/sub-webvtt2
new file mode 100644
index 000..91081f7
--- /dev/null
+++ b/tests/ref/fate/sub-webvtt2
@@ -0,0 +1,24 @@
+[Script Info]
+; Script generated by FFmpeg/Lavc
+ScriptType: v4.00+
+PlayResX: 384
+PlayResY: 288
+
+[V4+ Styles]
+Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, 
OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, 
Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, 
MarginV, Encoding
+Style: 
Default,Arial,16,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0
+
+[Events]
+Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
+Dialogue: 0,0:00:00.00,0:00:20.00,Default,,0,0,0,,Hi, my name is Fred
+Dialogue: 0,0:00:02.50,0:00:22.50,Default,,0,0,0,,Hi, I’m Bill
+Dialogue: 0,0:00:05.00,0:00:25.00,Default,,0,0,0,,Would you like to get a 
coffee?
+Dialogue: 0,0:00:07.50,0:00:27.50,Default,,0,0,0,,Sure! I’ve only had one 
today.
+Dialogue: 0,0:00:10.00,0:00:30.00,Default,,0,0,0,,This is my fourth!
+Dialogue: 0,0:00:12.50,0:00:32.50,Default,,0,0,0,,OK, let’s go.
+Dialogue: 0,0:00:38.00,0:00:43.00,Default,,0,0,0,,I want to 愛あい love 
you\NThat's not proper English!
+Dialogue: 0,0:00:43.00,0:00:46.00,Default,,0,0,0,,{\i1}キツネ{\i0}じゃない 
キツネじゃない\N乙女おとめは
+Dialogue: 0,0:00:50.00,0:00:55.00,Default,,0,0,0,,Some time ago in a rather 
distant place
+Dialogue: 0,0:00:55.00,0:01:00.00,Default,,0,0,0,,Descending: 
123456\NAscending: 123456
+Dialogue: 0,0:01:00.00,0:01:05.00,Default,,0,0,0,,>> Never gonna give you up 
Never gonna let you down\NNever gonna run around & desert you
+Dialogue: 0,0:55:00.00,1:00:00.00,Default,,0,0,0,,Transcrit par Célestes™
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH 1/7] lavc: move bitstream filter args to the bsf ctx

2015-10-09 Thread Michael Niedermayer
On Thu, Oct 08, 2015 at 03:07:35PM -0500, Rodger Combs wrote:
> ---
>  libavcodec/avcodec.h  | 1 +
>  libavcodec/bitstream_filter.c | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index ff70d25..ce42e57 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -5026,6 +5026,7 @@ typedef struct AVBitStreamFilterContext {
>  struct AVBitStreamFilter *filter;
>  AVCodecParserContext *parser;
>  struct AVBitStreamFilterContext *next;
> +char *args;

as avcodec.h is a public header, this field should be documented
minimally the documentation should list if the lib user is allowed
to read/write it

except that the patch LGTM

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

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


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


Re: [FFmpeg-devel] [PATCH] x86/takdsp: use arithmetic shift instructions

2015-10-09 Thread James Almer
On 10/9/2015 11:48 PM, Ronald S. Bultje wrote:
> Hi,
> 
> On Fri, Oct 9, 2015 at 10:42 PM, James Almer  wrote:
> 
>> p1 and p2 are int32_t.
>>
>> Signed-off-by: James Almer 
>> ---
>>  libavcodec/x86/takdsp.asm | 8 
>>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> 
> ok.
> 
> Ronald

Pushed, thanks.

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


Re: [FFmpeg-devel] [PATCH] doc: fix spelling errors

2015-10-09 Thread Andreas Cadhalpun
On 30.09.2015 03:27, Lou Logan wrote:
> On Tue, 29 Sep 2015 20:34:09 +0200, Andreas Cadhalpun wrote:
> 
>> Signed-off-by: Andreas Cadhalpun 
>> ---
>>  doc/encoders.texi  |  2 +-
>>  doc/filters.texi   | 14 +++---
>>  libavcodec/g726.c  |  2 +-
>>  libavcodec/vaapi_hevc.c|  2 +-
>>  libavfilter/x86/vf_removegrain.asm |  4 ++--
>>  libavformat/asfdec_o.c |  6 +++---
>>  libavformat/ffmdec.c   |  2 +-
>>  libavformat/mov.c  |  4 ++--
>>  8 files changed, 18 insertions(+), 18 deletions(-)
> 
> Patch LGTM, thanks.

Pushed.

> There are some existing grammar issues that I
> noticed because of your patch (this is just a typo patch anyway), but I
> can fix those "someday".

OK.

> Consider adding "bellow" to tools/patcheck, and whatever other typos you
> think are appropriate.

Well, "bellow" is actually a regular word, so it depends on the context.
I'll just fix whenever I notice a spelling error.

Best regards,
Andreas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/mpegvideoenc: fix undefined negative left shift

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 02:43:04PM -0400, Ganesh Ajjanagadde wrote:
> This should fix the first undefined behavior reported in:
> https://trac.ffmpeg.org/ticket/4727.
> 
> I can't reproduce the runtime behavior reported in the ticket, hence I
> can't confirm that this actually fixes the exact issue reported in the
> ticket.
> 
> Regardless, I can confirm that this is a genuine issue, and that
> negative shifts can (and do) occur, fixed by this.
> 
> Tested with FATE.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/mpegvideo_enc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

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

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


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


[FFmpeg-devel] [PATCH 6/9] x86: simple_idct: 12bits versions

2015-10-09 Thread Christophe Gisquet
On 12 frames of a 444p 12 bits DNxHR sequence, _put function:
C: 78902 decicycles in idct,  262071 runs, 73 skips
avx:   32478 decicycles in idct,  262045 runs, 99 skips

Difference between the 2:
stddev:0.39 PSNR:104.47 MAXDIFF:2

This is unavoidable and due to the scale factors used in the x86
version, which cannot match the C ones, as this would cause
overflows (there's one less 1bit of precision). In particular,
the trick to merge an addition into a multiplication of the first
butterfly of the pass can cause an overflow (15bits coeff now
needing 16).
---
 libavcodec/x86/idctdsp_init.c| 21 +++--
 libavcodec/x86/simple_idct.h |  6 ++
 libavcodec/x86/simple_idct10.asm | 17 +
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 4fc9b0d..be563c2 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -86,8 +86,8 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, 
AVCodecContext *avctx,
 c->add_pixels_clamped= ff_add_pixels_clamped_sse2;
 }
 
-if (ARCH_X86_64 &&
-avctx->bits_per_raw_sample == 10 && avctx->lowres == 0 &&
+if (ARCH_X86_64 && avctx->lowres == 0) {
+if (avctx->bits_per_raw_sample == 10 &&
 (avctx->idct_algo == FF_IDCT_AUTO ||
  avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
  avctx->idct_algo == FF_IDCT_SIMPLE)) {
@@ -102,5 +102,22 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, 
AVCodecContext *avctx,
 c->idct_put  = ff_simple_idct10_put_avx;
 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
 }
+}
+
+if (avctx->bits_per_raw_sample == 12 &&
+(avctx->idct_algo == FF_IDCT_AUTO ||
+ avctx->idct_algo == FF_IDCT_SIMPLEMMX)) {
+if (EXTERNAL_SSE2(cpu_flags)) {
+c->idct  = ff_simple_idct12_sse2;
+c->idct_put  = ff_simple_idct12_put_sse2;
+c->perm_type = FF_IDCT_PERM_TRANSPOSE;
+
+}
+if (EXTERNAL_AVX(cpu_flags)) {
+c->idct  = ff_simple_idct12_avx;
+c->idct_put  = ff_simple_idct12_put_avx;
+c->perm_type = FF_IDCT_PERM_TRANSPOSE;
+}
+}
 }
 }
diff --git a/libavcodec/x86/simple_idct.h b/libavcodec/x86/simple_idct.h
index e8f59c1..8eeb31e 100644
--- a/libavcodec/x86/simple_idct.h
+++ b/libavcodec/x86/simple_idct.h
@@ -31,4 +31,10 @@ void ff_simple_idct10_avx(int16_t *block);
 void ff_simple_idct10_put_sse2(uint8_t *dest, int line_size, int16_t *block);
 void ff_simple_idct10_put_avx(uint8_t *dest, int line_size, int16_t *block);
 
+void ff_simple_idct12_sse2(int16_t *block);
+void ff_simple_idct12_avx(int16_t *block);
+
+void ff_simple_idct12_put_sse2(uint8_t *dest, int line_size, int16_t *block);
+void ff_simple_idct12_put_avx(uint8_t *dest, int line_size, int16_t *block);
+
 #endif /* AVCODEC_X86_SIMPLE_IDCT_H */
diff --git a/libavcodec/x86/simple_idct10.asm b/libavcodec/x86/simple_idct10.asm
index b1f45ea..a410191 100644
--- a/libavcodec/x86/simple_idct10.asm
+++ b/libavcodec/x86/simple_idct10.asm
@@ -29,9 +29,13 @@
 
 SECTION_RODATA
 
+cextern pw_1
+cextern pw_2
 cextern pw_8
 cextern pw_1023
+cextern pw_4095
 pd_round: times 4 dd 1<<(13-1)
+pd_round2: times 4 dd 1<<(15-1)
 
 %include "libavcodec/x86/simple_idct10_template.asm"
 
@@ -47,6 +51,19 @@ cglobal simple_idct10_put, 3, 3, 16
 mova  m15, [pd_round]
 IDCT_FN"", 13, pw_8, 18, 0, pw_1023
 RET
+
+cglobal simple_idct12, 1, 1, 16
+mova  m15, [pd_round2]
+IDCT_FN"", 15, pw_2, 16
+RET
+
+cglobal simple_idct12_put, 3, 3, 16
+; range isn't known, so the C simple_idct range is used
+; Also, using a bias on input overflows, so use the bias
+; on output of the first butterfly instead
+mova  m15, [pd_round2]
+IDCT_FN"", 15, pw_2, 16, 0, pw_4095
+RET
 %endmacro
 
 INIT_XMM sse2
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH] avcodec/xvmc: apply attribute_deprecated correctly

2015-10-09 Thread Ronald S. Bultje
Hi,

On Fri, Oct 9, 2015 at 6:44 PM, Ganesh Ajjanagadde 
wrote:

> This fixes a warning observed on Clang 3.7:
> "warning: attribute 'deprecated' is ignored, place it after "struct" to
> apply attribute to type declaration [-Wignored-attributes]"
> and thus enables deprecation warning for the relevant struct.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/xvmc.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/xvmc.h b/libavcodec/xvmc.h
> index c2e187c..465ee78 100644
> --- a/libavcodec/xvmc.h
> +++ b/libavcodec/xvmc.h
> @@ -43,7 +43,7 @@
>  #define AV_XVMC_ID0x1DC711C0  /**< special value to
> ensure that regular pixel routines haven't corrupted the struct
> the number is 1337
> speak for the letters IDCT MCo (motion compensation) */
>
> -attribute_deprecated struct xvmc_pix_fmt {
> +struct attribute_deprecated xvmc_pix_fmt {
>  /** The field contains the special constant value AV_XVMC_ID.
>  It is used as a test that the application correctly uses the API,
>  and that there is no corruption caused by pixel routines.
> --
> 2.6.1


OK, pushed.

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


Re: [FFmpeg-devel] [PATCH] avfilter/drawtext: allow to format pts with strftime

2015-10-09 Thread Nicolas George
Le septidi 17 vendémiaire, an CCXXIV, Alex Agranovsky a écrit :
> From a51f49007381701df18309c73083749413df3cb8 Mon Sep 17 00:00:00 2001
> From: Alex Agranovsky 
> Date: Thu, 8 Oct 2015 15:54:59 -0400
> Subject: [PATCH] avfilter/drawtext: allow to format pts with strftime
> 
> ---
>  libavfilter/vf_drawtext.c | 5 +
>  1 file changed, 5 insertions(+)

Thanks for the patch. Unfortunately, there are a few issues to be fixed.

First: please update the docs too.

Next: see below.

> 
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
> index 9fd9461..5c4a7fa 100644
> --- a/libavfilter/vf_drawtext.c
> +++ b/libavfilter/vf_drawtext.c
> @@ -824,6 +824,12 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
> (int)(ms / 1000) % 60,
> (int)ms % 1000);
>  }
> +} else if (!strcmp(fmt, "strftime")) {

> +  struct tm ltime;

There is a tab here.

> +int64_t ms = (int64_t)pts;

This is not the correct type: since it is passed as a pointer, it must be
time_t, nothing else.

> +const char *fmt = (argc >= 3) ? argv[2] : "%Y-%m-%d %H:%M:%S";

Did you test this? As far as I know, at this point it is not possible to
have argc >= 3.

> +localtime_r(, );

Are you sure about that? pts is only occasionally a wall-clock timestamp.

And if it is, the default formats leaves a timestamp without a time zone,
that is Evil. And maybe the user wants UTC.

> +av_bprint_strftime(bp, fmt, );
>  } else {
>  av_log(ctx, AV_LOG_ERROR, "Invalid format '%s'\n", fmt);
>  return AVERROR(EINVAL);

Regards,

-- 
  Nicolas George


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


[FFmpeg-devel] Trac Outage - Notification of planned works

2015-10-09 Thread Kieran Kunhya
Hello,

Please note there will be a trac outage owing to the rerouting of fibre as
part of the London Underground extension.

Regards,
Kieran Kunhya

-- Forwarded message -



Hello,

There is going to be a loss of service at some point during the time frame
stated below whilst Virgin complete the maintenance work. This is a
diversionary job. The cable needs to be run because of the Northern line
extension project in Kennington, London.

Planned Work Start (Local UK): 22/10/2015 00:01

Planned Work End (Local UK): 22/10/2015 06:01

During the first hour of the change and up to the maximum time stated below
you will experience a service outage. For the remainder of the change
window your service is at risk and should the need arise, Virgin will take
down your service to resolve any issues.

If you have any queries, please contact the Support Team at
supp...@venus.co.uk or call 0207 240 5858.

Best Regards,

Erik

-- 

*Erikas* *Francas*

Venus Business Communications Ltd

25-27 Oxford St, London W1D 2DW

 VENUS

020 7240 5858

www.venus.co.uk
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build system: fix dependency generation

2015-10-09 Thread Christophe Gisquet
Hi,

2015-10-09 3:34 GMT+02:00 Michael Niedermayer :
> should i apply this ?
> i cant really say if this is correct or not
> though whie testing i noticed that
> rm ffmpeg ffprobe ; ./configure --progs-suffix=abc  && make -j12 fate
> ends with
> make: *** No rule to make target `ffprobe', needed by `fate-ffprobe_compact'.

So the sed seems to be applied to programs too instead of just object
files (I haven't verified but that's what it looks like with this).
That's why the stem is used ($(*F) instead of $(@F)) and appended with
'.o'.

But then, why is the stem truncated from dct-test to dct? I have no
idea either. Another rule somewhere?

Another thing: is it windows-specific? Without the patch, what do you
get in libavcodec/dct-test.d ?

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


Re: [FFmpeg-devel] [PATCH] configure: disabling --enable-libmfx and --enable-gpl combination

2015-10-09 Thread Ivan Uskov
Hello Hendrik,

Thursday, October 8, 2015, 11:43:37 PM, you wrote:


HL> We're not talking about dynamic linking here though, but runtime loading.
HL> Can I not use VAAPI because the underlying driver behind it may be closed
HL> source?
I  do  not  know  I'm  not  expert.  But most likely VAAPI treats as "system
library" in GPL terms.
HL> In fact we talked about this exact topic with j-b the other day, and he is
HL> the closest to a lawyer we have around here ;), and he agreed that FFmpeg
HL> built against the mfx dispatcher is no problem - it only becomes a problem
HL> when you start distributing the Intel binary with it, which you shouldn't
HL> do.
Ok, got it.

-- 
Best regards,
 Ivanmailto:ivan.us...@nablet.com

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


Re: [FFmpeg-devel] [PATCH] build system: fix dependency generation

2015-10-09 Thread Christophe Gisquet
Hi,

2015-10-09 7:59 GMT+02:00 Christophe Gisquet :
> But then, why is the stem truncated from dct-test to dct? I have no
> idea either. Another rule somewhere?

Updating goal targets
Considering target file 'libavcodec/dct-test.o'.
 File 'libavcodec/dct-test.o' does not exist.
 Looking for an implicit rule for 'libavcodec/dct-test.o'.
 Trying pattern rule with stem 'dct'.
 Trying implicit prerequisite 'libavcodec/dct-test.c'
 Found prerequisite 'libavcodec/dct-test.c' as VPATH [redacted]
 Found an implicit rule for 'libavcodec/dct-test.o'.
  No need to remake target 'libavcodec/dct-test.c'; using VPATH name [redacted]
  Considering target file 'libavcodec/'.
   Finished prerequisites of target file 'libavcodec/'.
  No need to remake target 'libavcodec/'.
  Pruning file 'libavcodec/'.
 Finished prerequisites of target file 'libavcodec/dct-test.o'.
Must remake target 'libavcodec/dct-test.o'.

So the patch is wrong, and here the issue is that there's a pattern
rule with stem 'dct' that actually triggers the compilation, and fills
$(*F).

No idea for that issue.

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


[FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_w3fdif.c  | 127 +-
 libavfilter/w3fdif.h |  47 +++
 libavfilter/x86/Makefile |   2 +
 libavfilter/x86/vf_w3fdif.asm| 270 +++
 libavfilter/x86/vf_w3fdif_init.c |  65 ++
 5 files changed, 478 insertions(+), 33 deletions(-)
 create mode 100644 libavfilter/w3fdif.h
 create mode 100644 libavfilter/x86/vf_w3fdif.asm
 create mode 100644 libavfilter/x86/vf_w3fdif_init.c

diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index f7703cc..e7463cb 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -29,6 +29,7 @@
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "w3fdif.h"
 
 typedef struct W3FDIFContext {
 const AVClass *class;
@@ -42,6 +43,8 @@ typedef struct W3FDIFContext {
 AVFrame *prev, *cur, *next;  ///< previous, current, next frames
 int32_t **work_line;  ///< lines we are calculating
 int nb_threads;
+
+W3FDIFDSPContext dsp;
 } W3FDIFContext;
 
 #define OFFSET(x) offsetof(W3FDIFContext, x)
@@ -81,6 +84,78 @@ static int query_formats(AVFilterContext *ctx)
 return ff_set_common_formats(ctx, fmts_list);
 }
 
+static void filter_simple_low(int32_t *work_line,
+  uint8_t *in_lines_cur[2],
+  const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line++ += *in_lines_cur[1]++ * coef[1];
+}
+}
+
+static void filter_complex_low(int32_t *work_line,
+   uint8_t *in_lines_cur[4],
+   const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line++ += *in_lines_cur[3]++ * coef[3];
+}
+}
+
+static void filter_simple_high(int32_t *work_line,
+   uint8_t *in_lines_cur[3],
+   uint8_t *in_lines_adj[3],
+   const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_adj[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_adj[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line++ += *in_lines_adj[2]++ * coef[2];
+}
+}
+
+static void filter_complex_high(int32_t *work_line,
+uint8_t *in_lines_cur[5],
+uint8_t *in_lines_adj[5],
+const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_adj[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_adj[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line   += *in_lines_adj[2]++ * coef[2];
+*work_line   += *in_lines_cur[3]++ * coef[3];
+*work_line   += *in_lines_adj[3]++ * coef[3];
+*work_line   += *in_lines_cur[4]++ * coef[4];
+*work_line++ += *in_lines_adj[4]++ * coef[4];
+}
+}
+
+static void filter_scale(uint8_t *out_pixel, const int32_t *work_pixel, int 
linesize)
+{
+int j;
+
+for (j = 0; j < linesize; j++, out_pixel++, work_pixel++)
+*out_pixel = av_clip(*work_pixel, 0, 255 * 256 * 128) >> 15;
+}
+
 static int config_input(AVFilterLink *inlink)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -106,6 +181,15 @@ static int config_input(AVFilterLink *inlink)
 return AVERROR(ENOMEM);
 }
 
+s->dsp.filter_simple_low   = filter_simple_low;
+s->dsp.filter_complex_low  = filter_complex_low;
+s->dsp.filter_simple_high  = filter_simple_high;
+s->dsp.filter_complex_high = filter_complex_high;
+s->dsp.filter_scale= filter_scale;
+
+if (ARCH_X86)
+ff_w3fdif_init_x86(>dsp);
+
 return 0;
 }
 
@@ -163,7 +247,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_
 const int dst_line_stride = out->linesize[plane];
 const int start = (height * jobnr) / nb_jobs;
 const int end = (height * (jobnr+1)) / nb_jobs;
-int i, j, y_in, y_out;
+int j, y_in, y_out;
 
 /* copy unchanged the lines of the field */
 y_out = start + (s->field == cur->top_field_first) - (start & 1);
@@ -202,18 +286,12 @@ static int deinterlace_slice(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_
 work_line = s->work_line[jobnr];
 switch (n_coef_lf[filter]) {
 case 2:
-

[FFmpeg-devel] [PATCH 2/9] x86: prores: templatize 10 bits simple_idct

2015-10-09 Thread Christophe Gisquet
This should be reused for a generic simple_idct10 function.
Requires a bit of trickery to declare common constants in C.
---
 libavcodec/x86/constants.c|  28 +++
 libavcodec/x86/constants.h|  16 ++
 libavcodec/x86/proresdsp.asm  | 263 +-
 libavcodec/x86/simple_idct10_template.asm | 299 ++
 4 files changed, 346 insertions(+), 260 deletions(-)
 create mode 100644 libavcodec/x86/simple_idct10_template.asm

diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index 3f3ee0f..9592fa7 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -87,3 +87,31 @@ DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_32)   = { 
0x00200020ULL, 0x000
 0x00200020ULL, 
0x00200020ULL };
 DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_65535)= { 0xULL, 
0xULL,
 0xULL, 
0xULL };
+
+/* simple idct 10 */
+#define W1sh2 22725 // W1 = 90901 = 22725<<2 + 1
+#define W2sh2 21407 // W2 = 85627 = 21407<<2 - 1
+#define W3sh2 19265 // W3 = 77062 = 19265<<2 + 2
+#define W4sh2 16384 // W4 = 65535 = 16384<<2 - 1
+#define W5sh2 12873 // W5 = 51491 = 12873<<2 - 1
+#define W6sh2  8867 // W6 = 35468 =  8867<<2
+#define W7sh2  4520 // W7 = 18081 =  4520<<2 + 1
+
+#define TIMES4(a, b)\
+ 
(((b)&0xLL)<<48)+(((a)&0xLL)<<32)+(((b)&0xLL)<<16)+((a)&0xLL), \
+ 
(((b)&0xLL)<<48)+(((a)&0xLL)<<32)+(((b)&0xLL)<<16)+((a)&0xLL)
+
+#if ARCH_X86_64
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w4_plus_w2) = { TIMES4(W4sh2,  W2sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w4_min_w2)  = { TIMES4(W4sh2, -W2sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w4_plus_w6) = { TIMES4(W4sh2, +W6sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w4_min_w6)  = { TIMES4(W4sh2, -W6sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w1_plus_w3) = { TIMES4(W1sh2, +W3sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w3_min_w1)  = { TIMES4(W3sh2, -W1sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w7_plus_w3) = { TIMES4(W7sh2, +W3sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w3_min_w7)  = { TIMES4(W3sh2, -W7sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w1_plus_w5) = { TIMES4(W1sh2, +W5sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w5_min_w1)  = { TIMES4(W5sh2, -W1sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w5_plus_w7) = { TIMES4(W5sh2, +W7sh2) };
+DECLARE_ALIGNED(16, const xmm_reg,  ff_w7_min_w5)  = { TIMES4(W7sh2, -W5sh2) };
+#endif
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index ee8422e..3605b63 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -67,4 +67,20 @@ extern const ymm_reg  ff_pd_16;
 extern const ymm_reg  ff_pd_32;
 extern const ymm_reg  ff_pd_65535;
 
+# if ARCH_X86_64
+/* simple_idct10, used by prores and dnxhd */
+extern const xmm_reg  ff_w4_plus_w2;
+extern const xmm_reg  ff_w4_min_w2;
+extern const xmm_reg  ff_w4_plus_w6;
+extern const xmm_reg  ff_w4_min_w6;
+extern const xmm_reg  ff_w1_plus_w3;
+extern const xmm_reg  ff_w3_min_w1;
+extern const xmm_reg  ff_w7_plus_w3;
+extern const xmm_reg  ff_w3_min_w7;
+extern const xmm_reg  ff_w1_plus_w5;
+extern const xmm_reg  ff_w5_min_w1;
+extern const xmm_reg  ff_w5_plus_w7;
+extern const xmm_reg  ff_w7_min_w5;
+# endif
+
 #endif /* AVCODEC_X86_CONSTANTS_H */
diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
index 632ece6..18cf15b 100644
--- a/libavcodec/x86/proresdsp.asm
+++ b/libavcodec/x86/proresdsp.asm
@@ -24,279 +24,22 @@
 
 %include "libavutil/x86/x86util.asm"
 
-%define W1sh2 22725 ; W1 = 90901 = 22725<<2 + 1
-%define W2sh2 21407 ; W2 = 85627 = 21407<<2 - 1
-%define W3sh2 19265 ; W3 = 77062 = 19265<<2 + 2
-%define W4sh2 16384 ; W4 = 65535 = 16384<<2 - 1
-%define W5sh2 12873 ; W5 = 51491 = 12873<<2 - 1
-%define W6sh2  8867 ; W6 = 35468 =  8867<<2
-%define W7sh2  4520 ; W7 = 18081 =  4520<<2 + 1
-
 %if ARCH_X86_64
 
 SECTION_RODATA
 
-w4_plus_w2: times 4 dw W4sh2, +W2sh2
-w4_min_w2:  times 4 dw W4sh2, -W2sh2
-w4_plus_w6: times 4 dw W4sh2, +W6sh2
-w4_min_w6:  times 4 dw W4sh2, -W6sh2
-w1_plus_w3: times 4 dw W1sh2, +W3sh2
-w3_min_w1:  times 4 dw W3sh2, -W1sh2
-w7_plus_w3: times 4 dw W7sh2, +W3sh2
-w3_min_w7:  times 4 dw W3sh2, -W7sh2
-w1_plus_w5: times 4 dw W1sh2, +W5sh2
-w5_min_w1:  times 4 dw W5sh2, -W1sh2
-w5_plus_w7: times 4 dw W5sh2, +W7sh2
-w7_min_w5:  times 4 dw W7sh2, -W5sh2
 pw_88:  times 8 dw 0x2008
-
 cextern pw_1
 cextern pw_4
-cextern pw_512
 cextern pw_1019
 
-section .text align=16
-
-; interleave data while maintaining source
-; %1=type, %2=dstlo, %3=dsthi, %4=src, %5=interleave
-%macro SBUTTERFLY3 5
-punpckl%1   m%2, m%4, m%5
-punpckh%1   m%3, m%4, m%5
-%endmacro
-
-; %1/%2=src1/dst1, %3/%4=dst2, %5/%6=src2, %7=shift
-; action: 

[FFmpeg-devel] [PATCH 4/9] x86: proresdsp: simple_idct: free or use 1 xmm reg

2015-10-09 Thread Christophe Gisquet
m15 is zeroed but never used. If it's not needed, decrease by 1 the
number of xmm regs used (prores), otherwise, make use of it, for the
rounder in the row pass of simple_idct.
---
 libavcodec/x86/proresdsp.asm  |  8 
 libavcodec/x86/simple_idct10.asm  |  9 +
 libavcodec/x86/simple_idct10_template.asm | 17 -
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
index 18cf15b..3fb71ba 100644
--- a/libavcodec/x86/proresdsp.asm
+++ b/libavcodec/x86/proresdsp.asm
@@ -37,17 +37,17 @@ cextern pw_1019
 
 section .text align=16
 
-%macro idct_put_fn 1
-cglobal prores_idct_put_10, 4, 4, %1
+%macro idct_put_fn 0
+cglobal prores_idct_put_10, 4, 4, 15
 IDCT_PUT_FNpw_1, 15, pw_88, 18, pw_4, pw_1019, r3
 RET
 %endmacro
 
 INIT_XMM sse2
-idct_put_fn 16
+idct_put_fn
 %if HAVE_AVX_EXTERNAL
 INIT_XMM avx
-idct_put_fn 16
+idct_put_fn
 %endif
 
 %endif
diff --git a/libavcodec/x86/simple_idct10.asm b/libavcodec/x86/simple_idct10.asm
index 77db0a7..725de82 100644
--- a/libavcodec/x86/simple_idct10.asm
+++ b/libavcodec/x86/simple_idct10.asm
@@ -37,17 +37,18 @@ pd_round: times 4 dd 1<<(13-1)
 
 section .text align=16
 
-%macro idct_put_fn 1
-cglobal simple_idct10_put, 3, 3, %1
+%macro idct_put_fn 0
+cglobal simple_idct10_put, 3, 3, 16
+mova  m15, [pd_round]
 IDCT_PUT_FN"", 13, pw_8, 18, 0, pw_1023
 RET
 %endmacro
 
 INIT_XMM sse2
-idct_put_fn 16
+idct_put_fn
 %if HAVE_AVX_EXTERNAL
 INIT_XMM avx
-idct_put_fn 16
+idct_put_fn
 %endif
 
 %endif
diff --git a/libavcodec/x86/simple_idct10_template.asm 
b/libavcodec/x86/simple_idct10_template.asm
index 86c2765..d4a08f8 100644
--- a/libavcodec/x86/simple_idct10_template.asm
+++ b/libavcodec/x86/simple_idct10_template.asm
@@ -90,14 +90,14 @@ cextern w7_min_w5
 pmaddwd m1, [w4_plus_w2]
 %ifstr %1
 ; 1<<(%1-1)
-paddd   m2, [pd_round]
-paddd   m3, [pd_round]
-paddd   m4, [pd_round]
-paddd   m5, [pd_round]
-paddd   m6, [pd_round]
-paddd   m7, [pd_round]
-paddd   m0, [pd_round]
-paddd   m1, [pd_round]
+paddd   m2, m15
+paddd   m3, m15
+paddd   m4, m15
+paddd   m5, m15
+paddd   m6, m15
+paddd   m7, m15
+paddd   m0, m15
+paddd   m1, m15
 %endif
 
 ; a0: -1*row[0]-1*row[2]
@@ -237,7 +237,6 @@ cextern w7_min_w5
 
 %macro IDCT_PUT_FN 6-7
 movsxd  r1,  r1d
-pxorm15, m15   ; zero
 
 ; for (i = 0; i < 8; i++)
 ; idctRowCondDC(block + i*8);
-- 
2.6.0

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


[FFmpeg-devel] [PATCH] vp9: add 10/12bpp idct_idct_32x32 sse2 SIMD version.

2015-10-09 Thread Ronald S. Bultje
---
 libavcodec/x86/vp9dsp_init_16bpp_template.c |   2 +
 libavcodec/x86/vp9itxfm_16bpp.asm   | 531 +---
 2 files changed, 489 insertions(+), 44 deletions(-)

diff --git a/libavcodec/x86/vp9dsp_init_16bpp_template.c 
b/libavcodec/x86/vp9dsp_init_16bpp_template.c
index e8422c1..eed36f5 100644
--- a/libavcodec/x86/vp9dsp_init_16bpp_template.c
+++ b/libavcodec/x86/vp9dsp_init_16bpp_template.c
@@ -136,6 +136,7 @@ decl_itxfm_func(iadst, idct,  4, BPC, sse2);
 decl_itxfm_func(iadst, iadst, 4, BPC, sse2);
 decl_itxfm_funcs(8, BPC, sse2);
 decl_itxfm_funcs(16, BPC, sse2);
+decl_itxfm_func(idct,  idct, 32, BPC, sse2);
 #endif /* HAVE_YASM */
 
 av_cold void INIT_FUNC(VP9DSPContext *dsp, int bitexact)
@@ -208,6 +209,7 @@ av_cold void INIT_FUNC(VP9DSPContext *dsp, int bitexact)
 #endif
 init_itx_funcs(TX_8X8, 8, BPC, sse2);
 init_itx_funcs(TX_16X16, 16, BPC, sse2);
+init_itx_func(TX_32X32, DCT_DCT, idct, idct, 32, BPC, sse2);
 }
 
 if (EXTERNAL_SSSE3(cpu_flags)) {
diff --git a/libavcodec/x86/vp9itxfm_16bpp.asm 
b/libavcodec/x86/vp9itxfm_16bpp.asm
index c23c0aa..199f611e 100644
--- a/libavcodec/x86/vp9itxfm_16bpp.asm
+++ b/libavcodec/x86/vp9itxfm_16bpp.asm
@@ -93,6 +93,10 @@ pw_9102_13623: times 4 dw 9102, 13623
 pw_m13623_9102: times 4 dw -13623, 9102
 pw_m11585_m11585: times 8 dw -11585
 
+pw_m3196_m16069: times 4 dw -3196, -16069
+pw_m13623_m9102: times 4 dw -13623, -9102
+pw_m6270_m15137: times 4 dw -6270, -15137
+
 SECTION .text
 
 %macro VP9_STORE_2X 6-7 dstq ; reg1, reg2, tmp1, tmp2, min, max, dst
@@ -927,21 +931,21 @@ IADST8_FN idct,  IDCT8,  iadst, IADST8
 IADST8_FN iadst, IADST8, idct,  IDCT8
 IADST8_FN iadst, IADST8, iadst, IADST8
 
-%macro IDCT16_1D 1 ; src
-IDCT8_1D%1, 8 * mmsize, 67  ; m0-3=t0-3a, 
m4-5/m8|r67/m7=t4-7
-; SCRATCH6, 8, rsp+67*mmsize; t6
-SCRATCH  0, 15, rsp+74*mmsize   ; t0a
-SCRATCH  1, 14, rsp+73*mmsize   ; t1a
-SCRATCH  2, 13, rsp+72*mmsize   ; t2a
-SCRATCH  3, 12, rsp+71*mmsize   ; t3a
-SCRATCH  4, 11, rsp+70*mmsize   ; t4
-mova   [rsp+65*mmsize], m5  ; t5
-mova   [rsp+66*mmsize], m7  ; t7
-
-movam0, [%1+ 1*4*mmsize]; in1
-movam3, [%1+ 7*4*mmsize]; in7
-movam4, [%1+ 9*4*mmsize]; in9
-movam7, [%1+15*4*mmsize]; in15
+%macro IDCT16_1D 1-4 4 * mmsize, 65, 67 ; src, src_stride, stack_offset, 
mm32bit_stack_offset
+IDCT8_1D%1, %2 * 2, %4  ; m0-3=t0-3a, 
m4-5/m8|r67/m7=t4-7
+; SCRATCH6, 8, rsp+(%4+0)*mmsize; t6
+SCRATCH  0, 15, rsp+(%4+7)*mmsize   ; t0a
+SCRATCH  1, 14, rsp+(%4+6)*mmsize   ; t1a
+SCRATCH  2, 13, rsp+(%4+5)*mmsize   ; t2a
+SCRATCH  3, 12, rsp+(%4+4)*mmsize   ; t3a
+SCRATCH  4, 11, rsp+(%4+3)*mmsize   ; t4
+mova [rsp+(%3+0)*mmsize], m5; t5
+mova [rsp+(%3+1)*mmsize], m7; t7
+
+movam0, [%1+ 1*%2]  ; in1
+movam3, [%1+ 7*%2]  ; in7
+movam4, [%1+ 9*%2]  ; in9
+movam7, [%1+15*%2]  ; in15
 
 SUMSUB_MUL   0, 7, 1, 2, 16305,  1606   ; m0=t15a, m7=t8a
 SUMSUB_MUL   4, 3, 1, 2, 10394, 12665   ; m4=t14a, m3=t9a
@@ -949,13 +953,13 @@ IADST8_FN iadst, IADST8, iadst, IADST8
 SUMSUB_BA d, 4, 0, 1; m4=t15,m0=t14
 SUMSUB_MUL   0, 7, 1, 2, 15137,  6270   ; m0=t14a, m7=t9a
 
-movam1, [%1+ 3*4*mmsize]; in3
-movam2, [%1+ 5*4*mmsize]; in5
-movam5, [%1+11*4*mmsize]; in11
-movam6, [%1+13*4*mmsize]; in13
+movam1, [%1+ 3*%2]  ; in3
+movam2, [%1+ 5*%2]  ; in5
+movam5, [%1+11*%2]  ; in11
+movam6, [%1+13*%2]  ; in13
 
-SCRATCH  0,  9, rsp+68*mmsize
-SCRATCH  7, 10, rsp+69*mmsize
+SCRATCH  0,  9, rsp+(%4+1)*mmsize
+SCRATCH  7, 10, rsp+(%4+2)*mmsize
 
 SUMSUB_MUL   2, 5, 0, 7, 14449,  7723   ; m2=t13a, m5=t10a
 SUMSUB_MUL   6, 1, 0, 7,  4756, 15679   ; m6=t12a, m1=t11a
@@ -964,45 +968,45 @@ IADST8_FN iadst, IADST8, iadst, IADST8
 NEGDm1  ; m1=-t10
 SUMSUB_MUL   1, 6, 0, 7, 15137,  6270   ; m1=t13a, m6=t10a
 
-UNSCRATCH7, 10, rsp+69*mmsize
+UNSCRATCH7, 10, rsp+(%4+2)*mmsize
 SUMSUB_BA d, 5, 3, 0; m5=t8a, m3=t11a
 SUMSUB_BA d, 6, 

[FFmpeg-devel] [PATCH 1/9] dnxhdenc: fix scan used for bitstream generation

2015-10-09 Thread Christophe Gisquet
The functions related to bitstream reading must use the natural zigzag
order, and not the one permuted for use in the iDCT. This currently
results in bitstreams with 2 issues:
- AC coefficients are encoded in an unexpected order;
- Incorrect weights are applied in the (de)quantization.

This currently can't show up because there's no simple_idct which
requires a permutation.

With one that does (based on prores'), and using the following source:
-f lavfi -i testsrc=s=1920x1080 -vframes 1 -pix_fmt yuv422p10le
and encoding to CID 1241 (interlaced 1080p YUV422) using:
-vcodec dnxhd -flags +ildct -vb 185M

before: stddev:   55.57 PSNR: 61.43 MAXDIFF:  960
after:  stddev:0.35 PSNR:105.45 MAXDIFF:   11
---
 libavcodec/dnxhdenc.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 7d96cd4..fa0b1dc 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -213,14 +213,14 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, 
int lbias, int cbias)
 
 if (ctx->cid_table->bit_depth == 8) {
 for (i = 1; i < 64; i++) {
-int j = ctx->m.idsp.idct_permutation[ff_zigzag_direct[i]];
+int j = ctx->m.intra_scantable.scantable[i];
 weight_matrix[j] = ctx->cid_table->luma_weight[i];
 }
 ff_convert_matrix(>m, ctx->qmatrix_l, ctx->qmatrix_l16,
   weight_matrix, ctx->intra_quant_bias, 1,
   ctx->m.avctx->qmax, 1);
 for (i = 1; i < 64; i++) {
-int j = ctx->m.idsp.idct_permutation[ff_zigzag_direct[i]];
+int j = ctx->m.intra_scantable.scantable[i];
 weight_matrix[j] = ctx->cid_table->chroma_weight[i];
 }
 ff_convert_matrix(>m, ctx->qmatrix_c, ctx->qmatrix_c16,
@@ -241,7 +241,7 @@ static av_cold int dnxhd_init_qmat(DNXHDEncContext *ctx, 
int lbias, int cbias)
 // 10-bit
 for (qscale = 1; qscale <= ctx->m.avctx->qmax; qscale++) {
 for (i = 1; i < 64; i++) {
-int j = ctx->m.idsp.idct_permutation[ff_zigzag_direct[i]];
+int j = ctx->m.intra_scantable.scantable[i];
 
 /* The quantization formula from the VC-3 standard is:
  * quantized = sign(block[i]) * floor(abs(block[i]/s) * p /
@@ -464,6 +464,7 @@ static av_always_inline
 void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block,
 int last_index, int n)
 {
+const uint8_t *scan = ctx->m.intra_scantable.scantable;
 int last_non_zero = 0;
 int slevel, i, j;
 
@@ -471,7 +472,7 @@ void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t 
*block,
 ctx->m.last_dc[n] = block[0];
 
 for (i = 1; i <= last_index; i++) {
-j = ctx->m.intra_scantable.permutated[i];
+j = scan[i];
 slevel = block[j];
 if (slevel) {
 int run_level = i - last_non_zero - 1;
@@ -542,11 +543,12 @@ static av_always_inline int dnxhd_ssd_block(int16_t 
*qblock, int16_t *block)
 static av_always_inline
 int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index)
 {
+const uint8_t *scan = ctx->m.intra_scantable.scantable;
 int last_non_zero = 0;
 int bits = 0;
 int i, j, level;
 for (i = 1; i <= last_index; i++) {
-j = ctx->m.intra_scantable.permutated[i];
+j = scan[i];
 level = block[j];
 if (level) {
 int run_level = i - last_non_zero - 1;
-- 
2.6.0

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


[FFmpeg-devel] [PATCH] gitignore: ignore object file temporaries

2015-10-09 Thread Ganesh Ajjanagadde
During a build, a lot of *.o-hash files are created - had not noticed
this as they are usually dumped in tmpfs on Linux. However, they
sometimes are present during a long build in the project directory, making it
annoying to commit while the project is being built.

Signed-off-by: Ganesh Ajjanagadde 
---
 .gitignore | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index 5cabe50..db6248e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,5 @@
 *.a
-*.o
+*.o*
 *.d
 *.def
 *.dll
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] configure: Add FFMPEG_CONFIGURATION and FFMPEG_LICENSE defines to avconfig.h

2015-10-09 Thread Hendrik Leppkes
On Fri, Oct 9, 2015 at 9:58 PM, Nicolas George  wrote:
> L'octidi 18 vendémiaire, an CCXXIV, Gonzalo a écrit :
>> This was sent in another mail, but may be lost since it did not specify a
>> PATCH.
>>
>> The patch is to get the license and compile flags from any application, I
>> add them to the distribution of avconfig.h.
>
>> diff --git a/configure b/configure
>> index b572d59..4196088 100755
>
> You should use git send-email or git format-patch, it includes author
> information and commit message.
>
>> --- a/configure
>> +++ b/configure
>> @@ -6224,6 +6224,8 @@ cat > $TMPH <>  /* Generated by ffconf */
>>  #ifndef AVUTIL_AVCONFIG_H
>>  #define AVUTIL_AVCONFIG_H
>
>> +#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
>> +#define FFMPEG_LICENSE "$(c_escape $license)"
>>  EOF
>
> This information is already available through avcodec_configuration() and
> avcodec_license(). Do you really need a static version? With a shared
> library, it may not match.
>

I agree, that information is available through the APIs which will
ensure it matches what the binaries were built with. Using those
functions is preferred.

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


[FFmpeg-devel] [PATCH 9/9] x86: dct-test: add 12 bits versions

2015-10-09 Thread Christophe Gisquet
---
 libavcodec/dct-test.c | 15 +++
 libavcodec/x86/dct-test.c | 13 -
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 9a195ab..1c17dd3 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -71,6 +71,10 @@ static const struct algo fdct_tab10[] = {
 { 0 }
 };
 
+static const struct algo fdct_tab12[] = {
+{ 0 }
+};
+
 static void ff_prores_idct_wrap(int16_t *dst){
 LOCAL_ALIGNED(16, int16_t, qmat, [64]);
 int i;
@@ -103,6 +107,11 @@ static const struct algo idct_tab10[] = {
 { 0 }
 };
 
+static const struct algo idct_tab12[] = {
+{ "SIMPLE12-C",  ff_simple_idct_12,FF_IDCT_PERM_NONE },
+{ 0 }
+};
+
 #if ARCH_ARM
 #include "arm/dct-test.c"
 #elif ARCH_PPC
@@ -114,6 +123,8 @@ static const struct algo fdct_tab_arch8[] = { { 0 } };
 static const struct algo idct_tab_arch8[] = { { 0 } };
 static const struct algo fdct_tab_arch10[] = { { 0 } };
 static const struct algo idct_tab_arch10[] = { { 0 } };
+static const struct algo fdct_tab_arch12[] = { { 0 } };
+static const struct algo idct_tab_arch12[] = { { 0 } };
 #endif
 
 #define AANSCALE_BITS 12
@@ -518,6 +529,10 @@ int main(int argc, char **argv)
 idct_tab = idct_tab10; fdct_tab = fdct_tab10;
 idct_tab_arch = idct_tab_arch10; fdct_tab_arch = fdct_tab_arch10;
 break;
+case 12:
+idct_tab = idct_tab12; fdct_tab = fdct_tab12;
+idct_tab_arch = idct_tab_arch12; fdct_tab_arch = fdct_tab_arch12;
+break;
 default: fprintf(stderr, "No tests for %i bits\n", bits); return 1;
 }
 if (test_idct) {
diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index 22a3ecf..6d4a7ed 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -102,7 +102,18 @@ static const struct algo idct_tab_arch10[] = {
 { 0 }
 };
 static const struct algo fdct_tab_arch12[] = { { 0 } };
-static const struct algo idct_tab_arch12[] = { { 0 } };
+
+static const struct algo idct_tab_arch12[] = {
+#if HAVE_YASM
+#if HAVE_SSE2_EXTERNAL
+{ "SIMPLE12-SSE2",  ff_simple_idct12_sse2, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_SSE2, 1 },
+#endif
+#if HAVE_AVX_EXTERNAL
+{ "SIMPLE12-AVX",   ff_simple_idct12_avx,  FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_AVX,  1 },
+#endif
+#endif
+{ 0 }
+};
 
 static const uint8_t idct_simple_mmx_perm[64] = {
 0x00, 0x08, 0x04, 0x09, 0x01, 0x0C, 0x05, 0x0D,
-- 
2.6.0

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


[FFmpeg-devel] [PATCH] avcodec/xvmc: apply attribute_deprecated correctly

2015-10-09 Thread Ganesh Ajjanagadde
This fixes a warning observed on Clang 3.7:
"warning: attribute 'deprecated' is ignored, place it after "struct" to apply 
attribute to type declaration [-Wignored-attributes]"
and thus enables deprecation warning for the relevant struct.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/xvmc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/xvmc.h b/libavcodec/xvmc.h
index c2e187c..465ee78 100644
--- a/libavcodec/xvmc.h
+++ b/libavcodec/xvmc.h
@@ -43,7 +43,7 @@
 #define AV_XVMC_ID0x1DC711C0  /**< special value to ensure 
that regular pixel routines haven't corrupted the struct
the number is 1337 
speak for the letters IDCT MCo (motion compensation) */
 
-attribute_deprecated struct xvmc_pix_fmt {
+struct attribute_deprecated xvmc_pix_fmt {
 /** The field contains the special constant value AV_XVMC_ID.
 It is used as a test that the application correctly uses the API,
 and that there is no corruption caused by pixel routines.
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH 0/9] Initial support for DNxHR, v2

2015-10-09 Thread Michael Niedermayer
On Thu, Oct 08, 2015 at 07:52:40AM +0200, Christophe Gisquet wrote:
> Hi,
> 
> 2015-10-08 1:38 GMT+02:00 Michael Niedermayer :
> >> So I have made a fate test on 1 frame for each sequence (total around 
> >> 1.8MB).
> >>
> >> Is it ok?
> >
> > ok
> 
> Here you go. Hendrik has kindly volunteered to upload the 2 samples for me.
> 
> -- 
> Christophe

>  Makefile |1 +
>  fate/dnxhd.mak   |8 
>  ref/fate/dnxhd-mbaff |2 ++
>  ref/fate/dnxhr-444   |2 ++
>  4 files changed, 13 insertions(+)
> dba9766a9100350ee166c78ca4cdd6249bb0b526  0001-fate-add-DNxHD-HR-tests.patch
> From 332b92d977ae04db0080973426ddc019d93a040b Mon Sep 17 00:00:00 2001
> From: Christophe Gisquet 
> Date: Mon, 5 Oct 2015 17:37:38 +0200
> Subject: [PATCH] fate: add DNxHD/HR tests
> 
> Currently only 2 profiles are evaluated because they are the only 2
> with distributed test sequences.
> - CID 1260: YUV 4:2:2 10 bits with block-adaptive interlace coding,
>   from ticket 4876;
> - CID 1270: YUV 4:4:4 10 bits (HR), 1920x839, from ticket 4581.
> 
> They were generated from the ticket sequences by running the
> following kind of command-line;
> ffmpeg -i $INPUT -an -sn -vcodec copy -vframes 1 -y $OUTPUT.mov

applied

thanks


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


Re: [FFmpeg-devel] [PATCH] doc: fix spelling errors

2015-10-09 Thread Ganesh Ajjanagadde
On Fri, Oct 9, 2015 at 4:13 PM, Andreas Cadhalpun
 wrote:
> On 30.09.2015 03:27, Lou Logan wrote:
>> On Tue, 29 Sep 2015 20:34:09 +0200, Andreas Cadhalpun wrote:
>>
>>> Signed-off-by: Andreas Cadhalpun 
>>> ---
>>>  doc/encoders.texi  |  2 +-
>>>  doc/filters.texi   | 14 +++---
>>>  libavcodec/g726.c  |  2 +-
>>>  libavcodec/vaapi_hevc.c|  2 +-
>>>  libavfilter/x86/vf_removegrain.asm |  4 ++--
>>>  libavformat/asfdec_o.c |  6 +++---
>>>  libavformat/ffmdec.c   |  2 +-
>>>  libavformat/mov.c  |  4 ++--
>>>  8 files changed, 18 insertions(+), 18 deletions(-)
>>
>> Patch LGTM, thanks.
>
> Pushed.
>
>> There are some existing grammar issues that I
>> noticed because of your patch (this is just a typo patch anyway), but I
>> can fix those "someday".
>
> OK.
>
>> Consider adding "bellow" to tools/patcheck, and whatever other typos you
>> think are appropriate.
>
> Well, "bellow" is actually a regular word, so it depends on the context.
> I'll just fix whenever I notice a spelling error.

I doubt that "bellow" has a place in any comment/doc in FFmpeg ;).

>
> Best regards,
> Andreas
> ___
> 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 0/9] v2: simple_idct for 10/12 bits and DNxHD

2015-10-09 Thread Christophe Gisquet
Summary of changes since last version:
- implemented pure idcts, needed for vf_spp
- consequently, modified dct-test as the wrapper is no longer needed
- fixed overflow in 12bits version by disabling a trick
- freed a xmm reg for prores, and used it for the rounder in simple_idct

Christophe Gisquet (9):
  dnxhdenc: fix scan used for bitstream generation
  x86: prores: templatize 10 bits simple_idct
  x86: simple_idct_put: 10bits versions
  x86: proresdsp: simple_idct: free or use 1 xmm reg
  x86: simple_idct: add pure idct functions
  x86: simple_idct: 12bits versions
  dct-test: add infrastructure for 10 bits
  x86: dct-test: add 10 bits versions.
  x86: dct-test: add 12 bits versions

 libavcodec/arm/dct-test.c |  10 +-
 libavcodec/dct-test.c |  56 -
 libavcodec/dnxhdenc.c |  12 +-
 libavcodec/ppc/dct-test.c |  10 +-
 libavcodec/x86/Makefile   |   1 +
 libavcodec/x86/constants.c|  28 +++
 libavcodec/x86/constants.h|  16 ++
 libavcodec/x86/dct-test.c |  31 ++-
 libavcodec/x86/idctdsp_init.c |  35 
 libavcodec/x86/proresdsp.asm  | 271 +---
 libavcodec/x86/simple_idct.h  |  12 ++
 libavcodec/x86/simple_idct10.asm  |  76 +++
 libavcodec/x86/simple_idct10_template.asm | 328 ++
 13 files changed, 605 insertions(+), 281 deletions(-)
 create mode 100644 libavcodec/x86/simple_idct10.asm
 create mode 100644 libavcodec/x86/simple_idct10_template.asm

-- 
2.6.0

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


[FFmpeg-devel] [PATCH 5/9] x86: simple_idct: add pure idct functions

2015-10-09 Thread Christophe Gisquet
This is done by not passing clamping regs to the macro, and there,
deducing that this is a pure idct.

There are not many users (vf_spp is one), and the _add version doesn't
look like it will ever be used.
---
 libavcodec/x86/idctdsp_init.c |  2 +
 libavcodec/x86/proresdsp.asm  |  8 ++--
 libavcodec/x86/simple_idct.h  |  3 ++
 libavcodec/x86/simple_idct10.asm  | 13 --
 libavcodec/x86/simple_idct10_template.asm | 76 +++
 5 files changed, 65 insertions(+), 37 deletions(-)

diff --git a/libavcodec/x86/idctdsp_init.c b/libavcodec/x86/idctdsp_init.c
index 17ddc9e..4fc9b0d 100644
--- a/libavcodec/x86/idctdsp_init.c
+++ b/libavcodec/x86/idctdsp_init.c
@@ -92,11 +92,13 @@ av_cold void ff_idctdsp_init_x86(IDCTDSPContext *c, 
AVCodecContext *avctx,
  avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
  avctx->idct_algo == FF_IDCT_SIMPLE)) {
 if (EXTERNAL_SSE2(cpu_flags)) {
+c->idct  = ff_simple_idct10_sse2;
 c->idct_put  = ff_simple_idct10_put_sse2;
 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
 
 }
 if (EXTERNAL_AVX(cpu_flags)) {
+c->idct  = ff_simple_idct10_avx;
 c->idct_put  = ff_simple_idct10_put_avx;
 c->perm_type = FF_IDCT_PERM_TRANSPOSE;
 }
diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
index 3fb71ba..88f3153 100644
--- a/libavcodec/x86/proresdsp.asm
+++ b/libavcodec/x86/proresdsp.asm
@@ -37,17 +37,17 @@ cextern pw_1019
 
 section .text align=16
 
-%macro idct_put_fn 0
+%macro IDCT_FN 0
 cglobal prores_idct_put_10, 4, 4, 15
-IDCT_PUT_FNpw_1, 15, pw_88, 18, pw_4, pw_1019, r3
+IDCT_FNpw_1, 15, pw_88, 18, pw_4, pw_1019, r3
 RET
 %endmacro
 
 INIT_XMM sse2
-idct_put_fn
+IDCT_FN
 %if HAVE_AVX_EXTERNAL
 INIT_XMM avx
-idct_put_fn
+IDCT_FN
 %endif
 
 %endif
diff --git a/libavcodec/x86/simple_idct.h b/libavcodec/x86/simple_idct.h
index d886434..e8f59c1 100644
--- a/libavcodec/x86/simple_idct.h
+++ b/libavcodec/x86/simple_idct.h
@@ -25,6 +25,9 @@ void ff_simple_idct_mmx(int16_t *block);
 void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
 void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
 
+void ff_simple_idct10_sse2(int16_t *block);
+void ff_simple_idct10_avx(int16_t *block);
+
 void ff_simple_idct10_put_sse2(uint8_t *dest, int line_size, int16_t *block);
 void ff_simple_idct10_put_avx(uint8_t *dest, int line_size, int16_t *block);
 
diff --git a/libavcodec/x86/simple_idct10.asm b/libavcodec/x86/simple_idct10.asm
index 725de82..b1f45ea 100644
--- a/libavcodec/x86/simple_idct10.asm
+++ b/libavcodec/x86/simple_idct10.asm
@@ -37,18 +37,23 @@ pd_round: times 4 dd 1<<(13-1)
 
 section .text align=16
 
-%macro idct_put_fn 0
+%macro idct_fn 0
+cglobal simple_idct10, 1, 1, 16
+mova  m15, [pd_round]
+IDCT_FN"", 13, pw_8, 18
+RET
+
 cglobal simple_idct10_put, 3, 3, 16
 mova  m15, [pd_round]
-IDCT_PUT_FN"", 13, pw_8, 18, 0, pw_1023
+IDCT_FN"", 13, pw_8, 18, 0, pw_1023
 RET
 %endmacro
 
 INIT_XMM sse2
-idct_put_fn
+idct_fn
 %if HAVE_AVX_EXTERNAL
 INIT_XMM avx
-idct_put_fn
+idct_fn
 %endif
 
 %endif
diff --git a/libavcodec/x86/simple_idct10_template.asm 
b/libavcodec/x86/simple_idct10_template.asm
index d4a08f8..5368ac7 100644
--- a/libavcodec/x86/simple_idct10_template.asm
+++ b/libavcodec/x86/simple_idct10_template.asm
@@ -128,18 +128,18 @@ cextern w7_min_w5
 psubd   m3,  m9; a1[4-7] intermediate
 
 ; load/store
-mova   [r2+  0], m0
-mova   [r2+ 32], m2
-mova   [r2+ 64], m4
-mova   [r2+ 96], m6
-movam10,[r2+ 16]   ; { row[1] }[0-7]
-movam8, [r2+ 48]   ; { row[3] }[0-7]
-movam13,[r2+ 80]   ; { row[5] }[0-7]
-movam14,[r2+112]   ; { row[7] }[0-7]
-mova   [r2+ 16], m1
-mova   [r2+ 48], m3
-mova   [r2+ 80], m5
-mova   [r2+112], m7
+mova   [COEFFS+  0], m0
+mova   [COEFFS+ 32], m2
+mova   [COEFFS+ 64], m4
+mova   [COEFFS+ 96], m6
+movam10,[COEFFS+ 16]   ; { row[1] }[0-7]
+movam8, [COEFFS+ 48]   ; { row[3] }[0-7]
+movam13,[COEFFS+ 80]   ; { row[5] }[0-7]
+movam14,[COEFFS+112]   ; { row[7] }[0-7]
+mova   [COEFFS+ 16], m1
+mova   [COEFFS+ 48], m3
+mova   [COEFFS+ 80], m5
+mova   [COEFFS+112], m7
 %if %0 == 3
 pmullw  m10,[%3+ 16]
 pmullw  m8, [%3+ 48]
@@ -210,17 +210,17 @@ cextern w7_min_w5
 ; row[5] = (a2 - b2) >> 15;
 ; row[3] = (a3 + b3) >> 15;
 ; row[4] = (a3 - b3) >> 15;
-movam8, [r2+ 0]; a0[0-3]
-movam9, [r2+16]; a0[4-7]
+movam8, [COEFFS+ 0]; a0[0-3]
+movam9, [COEFFS+16]; a0[4-7]
 SUMSUB_SHPK m8,  m9,  m10, m11, m0,  m1,  %2
-movam0, [r2+32]; a1[0-3]
-

[FFmpeg-devel] [PATCH 7/9] dct-test: add infrastructure for 10 bits

2015-10-09 Thread Christophe Gisquet
---
 libavcodec/arm/dct-test.c | 10 --
 libavcodec/dct-test.c | 41 +++--
 libavcodec/ppc/dct-test.c | 10 --
 libavcodec/x86/dct-test.c |  9 +++--
 4 files changed, 58 insertions(+), 12 deletions(-)

diff --git a/libavcodec/arm/dct-test.c b/libavcodec/arm/dct-test.c
index f9076b3..fd86b9d 100644
--- a/libavcodec/arm/dct-test.c
+++ b/libavcodec/arm/dct-test.c
@@ -20,11 +20,11 @@
 
 #include "idct.h"
 
-static const struct algo fdct_tab_arch[] = {
+static const struct algo fdct_tab_arch8[] = {
 { 0 }
 };
 
-static const struct algo idct_tab_arch[] = {
+static const struct algo idct_tab_arch8[] = {
 { "SIMPLE-ARM", ff_simple_idct_arm, FF_IDCT_PERM_NONE },
 { "INT-ARM",ff_j_rev_dct_arm,   FF_IDCT_PERM_LIBMPEG2 },
 #if HAVE_ARMV5TE
@@ -38,3 +38,9 @@ static const struct algo idct_tab_arch[] = {
 #endif
 { 0 }
 };
+
+static const struct algo fdct_tab_arch10[] = { { 0 } };
+static const struct algo idct_tab_arch10[] = { { 0 } };
+static const struct algo fdct_tab_arch12[] = { { 0 } };
+static const struct algo idct_tab_arch12[] = { { 0 } };
+
diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 56e1a62..9a195ab 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -56,13 +56,19 @@ struct algo {
 int nonspec;
 };
 
-static const struct algo fdct_tab[] = {
+static const struct algo fdct_tab8[] = {
 { "REF-DBL", ff_ref_fdct,  FF_IDCT_PERM_NONE },
 { "IJG-AAN-INT", ff_fdct_ifast,FF_IDCT_PERM_NONE },
 { "IJG-LLM-INT", ff_jpeg_fdct_islow_8, FF_IDCT_PERM_NONE },
 #if CONFIG_FAANDCT
 { "FAAN",ff_faandct,   FF_IDCT_PERM_NONE },
 #endif /* CONFIG_FAANDCT */
+{ 0 }
+};
+
+static const struct algo fdct_tab10[] = {
+{ "IJG-LLM-INT10", ff_jpeg_fdct_islow_10, FF_IDCT_PERM_NONE },
+{ 0 }
 };
 
 static void ff_prores_idct_wrap(int16_t *dst){
@@ -78,7 +84,7 @@ static void ff_prores_idct_wrap(int16_t *dst){
 }
 }
 
-static const struct algo idct_tab[] = {
+static const struct algo idct_tab8[] = {
 { "REF-DBL", ff_ref_idct,  FF_IDCT_PERM_NONE },
 { "INT", ff_j_rev_dct, FF_IDCT_PERM_LIBMPEG2 },
 { "SIMPLE-C",ff_simple_idct_8, FF_IDCT_PERM_NONE },
@@ -89,6 +95,12 @@ static const struct algo idct_tab[] = {
 #if CONFIG_MPEG4_DECODER
 { "XVID",ff_xvid_idct, FF_IDCT_PERM_NONE, 0, 1 },
 #endif /* CONFIG_MPEG4_DECODER */
+{ 0 }
+};
+
+static const struct algo idct_tab10[] = {
+{ "SIMPLE10-C",  ff_simple_idct_10,FF_IDCT_PERM_NONE },
+{ 0 }
 };
 
 #if ARCH_ARM
@@ -98,8 +110,10 @@ static const struct algo idct_tab[] = {
 #elif ARCH_X86
 #include "x86/dct-test.c"
 #else
-static const struct algo fdct_tab_arch[] = { { 0 } };
-static const struct algo idct_tab_arch[] = { { 0 } };
+static const struct algo fdct_tab_arch8[] = { { 0 } };
+static const struct algo idct_tab_arch8[] = { { 0 } };
+static const struct algo fdct_tab_arch10[] = { { 0 } };
+static const struct algo idct_tab_arch10[] = { { 0 } };
 #endif
 
 #define AANSCALE_BITS 12
@@ -451,6 +465,10 @@ static void help(void)
 
 int main(int argc, char **argv)
 {
+const struct algo* idct_tab = NULL;
+const struct algo* fdct_tab = NULL;
+const struct algo* fdct_tab_arch = NULL;
+const struct algo* idct_tab_arch = NULL;
 int test_idct = 0, test_248_dct = 0;
 int c, i;
 int test = 1;
@@ -491,8 +509,19 @@ int main(int argc, char **argv)
 idct248_error("SIMPLE-C", ff_simple_idct248_put, speed);
 } else {
 const int cpu_flags = av_get_cpu_flags();
+switch(bits) {
+case  8:
+idct_tab =  idct_tab8; fdct_tab =  fdct_tab8;
+idct_tab_arch = idct_tab_arch8; fdct_tab_arch = fdct_tab_arch8;
+break;
+case 10:
+idct_tab = idct_tab10; fdct_tab = fdct_tab10;
+idct_tab_arch = idct_tab_arch10; fdct_tab_arch = fdct_tab_arch10;
+break;
+default: fprintf(stderr, "No tests for %i bits\n", bits); return 1;
+}
 if (test_idct) {
-for (i = 0; i < FF_ARRAY_ELEMS(idct_tab); i++)
+for (i = 0; idct_tab[i].name; i++)
 err |= dct_error(_tab[i], test, test_idct, speed, bits);
 
 for (i = 0; idct_tab_arch[i].name; i++)
@@ -501,7 +530,7 @@ int main(int argc, char **argv)
 }
 #if CONFIG_FDCTDSP
 else {
-for (i = 0; i < FF_ARRAY_ELEMS(fdct_tab); i++)
+for (i = 0; fdct_tab[i].name; i++)
 err |= dct_error(_tab[i], test, test_idct, speed, bits);
 
 for (i = 0; fdct_tab_arch[i].name; i++)
diff --git a/libavcodec/ppc/dct-test.c b/libavcodec/ppc/dct-test.c
index 2328516..a646c2e 100644
--- a/libavcodec/ppc/dct-test.c
+++ b/libavcodec/ppc/dct-test.c
@@ -20,13 +20,19 @@
 
 #include "fdct.h"
 
-static const struct algo fdct_tab_arch[] = {
+static const struct algo fdct_tab_arch8[] = {
 

[FFmpeg-devel] [PATCH 8/9] x86: dct-test: add 10 bits versions.

2015-10-09 Thread Christophe Gisquet
---
 libavcodec/x86/dct-test.c | 13 -
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c
index 692c23b..22a3ecf 100644
--- a/libavcodec/x86/dct-test.c
+++ b/libavcodec/x86/dct-test.c
@@ -89,7 +89,18 @@ static const struct algo idct_tab_arch8[] = {
 };
 
 static const struct algo fdct_tab_arch10[] = { { 0 } };
-static const struct algo idct_tab_arch10[] = { { 0 } };
+
+static const struct algo idct_tab_arch10[] = {
+#if HAVE_YASM
+#if HAVE_SSE2_EXTERNAL
+{ "SIMPLE10-SSE2",  ff_simple_idct10_sse2, FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_SSE2, 1 },
+#endif
+#if HAVE_AVX_EXTERNAL
+{ "SIMPLE10-AVX",   ff_simple_idct10_avx,  FF_IDCT_PERM_TRANSPOSE, 
AV_CPU_FLAG_AVX,  1 },
+#endif
+#endif
+{ 0 }
+};
 static const struct algo fdct_tab_arch12[] = { { 0 } };
 static const struct algo idct_tab_arch12[] = { { 0 } };
 
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH] configure: Add FFMPEG_CONFIGURATION and FFMPEG_LICENSE defines to avconfig.h

2015-10-09 Thread Gonzalo



El 09/10/15 a las 16:58, Nicolas George escribió:

This information is already available through avcodec_configuration() and
avcodec_license(). Do you really need a static version? With a shared
library, it may not match.


Thank you very much.  That was exactly the functions I was looking for.  
I apologize for the patch.

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


Re: [FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL acceleration

2015-10-09 Thread highgod0401

From: Timo Rothenpieler
Date: 2015-10-09 16:41
To: FFmpeg development discussions and patches
CC: highgod0401
Subject: Re: [FFmpeg-devel] [PATCH 3/3][RFC] avfilter/vf_chromakey: Add OpenCL 
acceleration
>
> Using this sample: https://btbn.de/files/chromakey_sample.mp4
>
> ffmpeg -f lavfi -i color=c=black:s=1280x720 -i chromakey_sample.mp4 -an
> -c:v libx264 -preset veryfast -crf 18 -shortest -filter_complex
> "[1:v]chromakey=0x70de77:0.1:0.2:0:1[ckout];[0:v][ckout]overlay[out]"
> -map "[out]" -y output.mkv
>
> The last parameter to the chromakey filter enables opencl acceleration.
>
> Hi,
>
> Could you please send the patch as attachments? I merge the code, but some 
> compile errors occur.
>
> Thanks
> Best regards
>

You can pull from my github, the patches are in the chromakey branch:

https://github.com/BtbN/FFmpeg/tree/chromakey

If you want just the chromakey patch itself:

https://github.com/BtbN/FFmpeg/commit/29294c283a656cf809461cbae21d612b5a0f2159.patch

Hi

I downloaded and merged the patch again, but the error still exists as follow:

$ git am opencl_chromakey.patch
Applying: avfilter/vf_chromakey: Add OpenCL acceleration
fatal: corrupt patch at line 380
Patch failed at 0001 avfilter/vf_chromakey: Add OpenCL acceleration
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

I check the code,
These codes are in the patch of corrupt patch at line 380.
@@ -192,6 +368,7 @@ AVFilter ff_vf_chromakey = {
 .priv_size = sizeof(ChromakeyContext),
 .priv_class= _class,
 .init  = initialize_chromakey,
+.uninit= uninitialize_chromakey,
 .query_formats = query_formats,
 .inputs= chromakey_inputs,
 .outputs   = chromakey_outputs,
the following codes are the latest ffmpeg master branch codes.
AVFilter ff_vf_chromakey = {
.name  = "chromakey",
.description   = NULL_IF_CONFIG_SMALL("Turns a certain color into 
transparency. Operates on YUV colors."),
.priv_size = sizeof(ChromakeyContext),
.priv_class= _class,
.init  = initialize_chromakey,
.query_formats = query_formats,
.inputs= chromakey_inputs,
.outputs   = chromakey_outputs,
.flags = AVFILTER_FLAG_SUPPORT_TIMELINE_GENERIC | 
AVFILTER_FLAG_SLICE_THREADS,
};
I think this is the reason why the conflict occurs.

Could you please fix it?

Thanks

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


Re: [FFmpeg-devel] [PATCH 3/5] lavu/jni: add helpers to manage android application contexts

2015-10-09 Thread Zhang Rui
2015-10-10 0:26 GMT+08:00 Matthieu Bouron :
> From: Matthieu Bouron 
>
> ---
>  libavutil/jni.c  | 104 
> +++
>  libavutil/jni.h  |  28 +
>  libavutil/jni_internal.c |  30 ++
>  libavutil/jni_internal.h |  11 +
>  4 files changed, 173 insertions(+)
>
> diff --git a/libavutil/jni.c b/libavutil/jni.c
> index c6ce3a5..0c4c8ca 100644
> --- a/libavutil/jni.c
> +++ b/libavutil/jni.c
> @@ -20,12 +20,18 @@
>
>  #include "config.h"
>  #include "jni.h"
> +#include "jni_internal.h"
>  #include "log.h"
>
>  #include 
>
>  JavaVM *java_vm = NULL;
>
> +jobject application_context = NULL;
> +
> +jobject application_class_loader = NULL;
> +jmethodID find_class_id = NULL;

Maybe static is better for --enable-static.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [RFC] Poll for the community

2015-10-09 Thread Ganesh Ajjanagadde
On Fri, Oct 9, 2015 at 9:51 AM, Clément Bœsch  wrote:
> On Fri, Sep 25, 2015 at 10:41:44AM +0200, Clément Bœsch wrote:
>> Hi,
>>
>> I'd like to suggest a poll for the community in order to define some more
>> clear directions for the project. I plan to post the poll on the mailing
>> lists and IRC, people are free to forward them elsewhere.
>>
>> If anyone has a suggestion for a free & simple online poll, I'm listening.
>> A poll system where people can pick the importance of each entry would be
>> perfect.
>>
>> Here is the poll suggestion:
>>
>> Evaluate in the following list what is important and what isn't for
>> you in the FFmpeg project:
>>
>> - More bug fixes (please [+] them in the bug tracker)
>> - More test coverage to prevent regressions
>> - More "simple" features (new demuxers, new options, ...)
>> - More "advanced" features (high level API, scripting language
>>   binding, filters rethinking, ...)
>> - More speed optimizations
>> - Better releases (LTS, more backports, ...)
>> - Overall cleanups (merge redundant decoders or dead/clumsy stuff)
>> - More API changes
>> - Less API changes
>> - Better API documentation (please specify)
>> - Better command line documentation (please specify)
>> - Other (please specify)
>>
>> I'd like to submit the poll by the end of next week. Comments on how to
>> improve this list are very welcome, as well as my initial request about a
>> poll system to use.
>>
>> Regards,
>>
>
> So here is the prototype: https://www.surveymonkey.com/r/XGXPHXZ
>
> You can answer it now but I will reset the collecting and distribute it
> publicly if we agree on its current form.
>
> It will be published on the 3 FFmpeg mailing-lists and IRC channels.
> People responsible for the twitter account, G+ and others will be free to
> share it there then as well.
>
> You have 24 hours to make comments.

24 hours is IMHO too little. What is the hurry? Maybe at least 96 hours?

>
> Thanks for surveymonkey.com and other suggestions.
>
> Regards,
>
> --
> Clément B.
>
> ___
> 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] ffserver_config: check for INT_MIN before doing FFABS

2015-10-09 Thread Ganesh Ajjanagadde
FFABS(INT_MIN) is not safe. Alternative of using FFNABS is not as
readable.

Signed-off-by: Ganesh Ajjanagadde 
---
 ffserver_config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 691ff7b..9fc1f00 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -460,7 +460,7 @@ static int ffserver_set_int_param(int *dest, const char 
*value, int factor,
 if (tmp < min || tmp > max)
 goto error;
 if (factor) {
-if (FFABS(tmp) > INT_MAX / FFABS(factor))
+if (tmp == INT_MIN || FFABS(tmp) > INT_MAX / FFABS(factor))
 goto error;
 tmp *= factor;
 }
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] h264_mp4toannexb

2015-10-09 Thread 赵宇龙
From 9654bf635c72fd3bd4208afcf4a1b8b8667735db Mon Sep 17 00:00:00 2001
From: zylthinking 
Date: Fri, 9 Oct 2015 13:46:45 +0800
Subject: [PATCH] fix pps offfset fault when there are more than one sps in
 avcc

the pps offset is used to locate pps in the spspps_buf; however, the
current calc method maybe be wrong because it is the offset of the original
avctx->extradata;
when there is only one sps in the avcc; the value is correct by
coincidence, however, it will
fail in avcc with multi sps
---
 libavcodec/h264_mp4toannexb_bsf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h264_mp4toannexb_bsf.c
b/libavcodec/h264_mp4toannexb_bsf.c
index a5da84a..6c620fa 100644
--- a/libavcodec/h264_mp4toannexb_bsf.c
+++ b/libavcodec/h264_mp4toannexb_bsf.c
@@ -122,7 +122,7 @@ pps:
 if (!unit_nb && !sps_done++) {
 unit_nb = *extradata++; /* number of pps unit(s) */
 if (unit_nb) {
-ctx->pps_offset = (extradata - 1) - (avctx->extradata + 4);
+ctx->pps_offset = total_size;
 pps_seen = 1;
 }
 }
-- 
2.3.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/5] lavu/jni: add more JNI helper

2015-10-09 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 libavutil/jni_internal.c | 290 +++
 libavutil/jni_internal.h | 101 +
 2 files changed, 391 insertions(+)

diff --git a/libavutil/jni_internal.c b/libavutil/jni_internal.c
index b17275d..2c1dc70 100644
--- a/libavutil/jni_internal.c
+++ b/libavutil/jni_internal.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "bprint.h"
 #include "config.h"
 #include "jni.h"
 #include "jni_internal.h"
@@ -67,3 +68,292 @@ int avpriv_jni_detach_env(void *log_ctx)
 
 return (*java_vm)->DetachCurrentThread(java_vm);
 }
+
+char *avpriv_jni_jstring_to_utf_chars(JNIEnv *env, jstring string, void 
*log_ctx)
+{
+char *ret = NULL;
+const char *utf_chars = NULL;
+
+jboolean copy = 0;
+
+utf_chars = (*env)->GetStringUTFChars(env, string, );
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "String.getStringUTFChars() threw an 
exception\n");
+return NULL;
+}
+
+ret = av_strdup(utf_chars);
+
+(*env)->ReleaseStringUTFChars(env, string, utf_chars);
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "String.releaseStringUTFChars() threw an 
exception\n");
+return NULL;;
+}
+
+return ret;
+}
+
+jstring avpriv_jni_utf_chars_to_jstring(JNIEnv *env, const char *utf_chars, 
void *log_ctx)
+{
+jstring ret;
+
+ret = (*env)->NewStringUTF(env, utf_chars);
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "NewStringUTF() threw an exception\n");
+return NULL;
+}
+
+return ret;
+}
+
+int avpriv_jni_exception_get_summary(JNIEnv *env, jthrowable exception, char 
**error, void *log_ctx)
+{
+int ret = 0;
+
+AVBPrint bp;
+
+char *name = NULL;
+char *message = NULL;
+
+jclass class_class = NULL;
+jmethodID get_name_id = NULL;
+
+jclass exception_class = NULL;
+jmethodID get_message_id = NULL;
+
+jstring string;
+
+av_bprint_init(, 0, AV_BPRINT_SIZE_AUTOMATIC);
+
+exception_class = (*env)->GetObjectClass(env, exception);
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "Could not find Throwable class\n");
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+class_class = (*env)->GetObjectClass(env, exception_class);
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "Could not find Throwable class's 
class\n");
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+get_name_id = (*env)->GetMethodID(env, class_class, "getName", 
"()Ljava/lang/String;");
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "Could not find method 
Class.getName()\n");
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+string = (*env)->CallObjectMethod(env, exception_class, get_name_id);
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "Class.getName() threw an exception\n");
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+name = avpriv_jni_jstring_to_utf_chars(env, string, log_ctx);
+if (!name) {
+ret = AVERROR(ENOMEM);
+goto done;
+}
+
+(*env)->DeleteLocalRef(env, string);
+
+get_message_id = (*env)->GetMethodID(env, exception_class, "getMessage", 
"()Ljava/lang/String;");
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "Could not find method 
java/lang/Throwable.getMessage()\n");
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+string = (*env)->CallObjectMethod(env, exception, get_message_id);
+if ((*env)->ExceptionCheck(env)) {
+(*env)->ExceptionClear(env);
+av_log(log_ctx, AV_LOG_ERROR, "Throwable.getMessage() threw an 
exception\n");
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+message = avpriv_jni_jstring_to_utf_chars(env, string, log_ctx);
+if (!message) {
+ret = AVERROR(ENOMEM);
+goto done;
+}
+
+(*env)->DeleteLocalRef(env, string);
+
+av_bprintf(, "%s: %s", name, message);
+ret = av_bprint_finalize(, error);
+
+done:
+
+av_free(name);
+av_free(message);
+
+if (class_class) {
+(*env)->DeleteLocalRef(env, class_class);
+}
+
+if (exception_class) {
+(*env)->DeleteLocalRef(env, exception_class);
+}
+
+return ret;
+}
+
+int avpriv_jni_exception_check(JNIEnv *env, int log, void *log_ctx)
+{
+int ret;
+
+jthrowable exception;
+
+char *message;
+
+if (!(*(env))->ExceptionCheck((env))) {
+

[FFmpeg-devel] [PATCH 3/5] lavu/jni: add helpers to manage android application contexts

2015-10-09 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 libavutil/jni.c  | 104 +++
 libavutil/jni.h  |  28 +
 libavutil/jni_internal.c |  30 ++
 libavutil/jni_internal.h |  11 +
 4 files changed, 173 insertions(+)

diff --git a/libavutil/jni.c b/libavutil/jni.c
index c6ce3a5..0c4c8ca 100644
--- a/libavutil/jni.c
+++ b/libavutil/jni.c
@@ -20,12 +20,18 @@
 
 #include "config.h"
 #include "jni.h"
+#include "jni_internal.h"
 #include "log.h"
 
 #include 
 
 JavaVM *java_vm = NULL;
 
+jobject application_context = NULL;
+
+jobject application_class_loader = NULL;
+jmethodID find_class_id = NULL;
+
 void av_jni_register_java_vm(JavaVM *vm)
 {
 java_vm = vm;
@@ -35,3 +41,101 @@ JavaVM *av_jni_get_java_vm(void)
 {
 return java_vm;
 }
+
+#ifdef __ANDROID__
+int av_jni_register_application_context(JNIEnv *env, jobject context)
+{
+int ret = 0;
+
+jclass application_context_class;
+jmethodID get_class_loader_id;
+
+jclass application_class_loader_class;
+
+if (application_context) {
+(*env)->DeleteGlobalRef(env, application_context);
+application_context = NULL;
+}
+
+if (application_class_loader) {
+ (*env)->DeleteGlobalRef(env, application_class_loader);
+application_class_loader = NULL;
+}
+
+application_context_class = (*env)->GetObjectClass(env, context);
+if ((ret = avpriv_jni_exception_check(env, 1, NULL)) < 0) {
+goto done;
+}
+
+get_class_loader_id = (*env)->GetMethodID(env, application_context_class, 
"getClassLoader", "()Ljava/lang/ClassLoader;");
+if ((ret = avpriv_jni_exception_check(env, 1, NULL)) < 0) {
+goto done;
+}
+
+application_context = (*env)->NewGlobalRef(env, context);
+application_class_loader = (*env)->CallObjectMethod(env, 
application_context, get_class_loader_id);
+if ((ret = avpriv_jni_exception_check(env, 1, NULL)) < 0) {
+goto done;
+}
+
+application_class_loader = (*env)->NewGlobalRef(env, 
application_class_loader);
+if ((ret = avpriv_jni_exception_check(env, 1, NULL)) < 0) {
+goto done;
+}
+
+application_class_loader_class = (*env)->GetObjectClass(env, 
application_class_loader);
+if ((ret = avpriv_jni_exception_check(env, 1, NULL)) < 0) {
+goto done;
+}
+
+find_class_id = (*env)->GetMethodID(env, application_class_loader_class, 
"findClass", "(Ljava/lang/String;)Ljava/lang/Class;");
+if ((ret = avpriv_jni_exception_check(env, 1, NULL)) < 0) {
+goto done;
+}
+
+done:
+if (application_context_class) {
+(*env)->DeleteLocalRef(env, application_context_class);
+}
+
+if (application_class_loader_class) {
+(*env)->DeleteLocalRef(env, application_class_loader_class);
+}
+
+if (ret != 0) {
+
+if (application_context) {
+(*env)->DeleteGlobalRef(env, application_context);
+application_context = NULL;
+}
+
+if (application_class_loader) {
+(*env)->DeleteGlobalRef(env, application_class_loader);
+application_context = NULL;
+}
+}
+
+return 0;
+}
+
+jobject av_jni_get_application_context(void)
+{
+return application_context;
+}
+
+int av_jni_unregister_application_context(JNIEnv *env)
+{
+if (application_context) {
+(*env)->DeleteGlobalRef(env, application_context);
+application_context = NULL;
+}
+
+if (application_class_loader) {
+(*env)->DeleteGlobalRef(env, application_class_loader);
+application_class_loader = NULL;
+}
+
+return 0;
+}
+
+#endif
diff --git a/libavutil/jni.h b/libavutil/jni.h
index 3c36eaf..1bf783a 100644
--- a/libavutil/jni.h
+++ b/libavutil/jni.h
@@ -39,4 +39,32 @@ void av_jni_register_java_vm(JavaVM *vm);
  */
 JavaVM *av_jni_get_java_vm(void);
 
+#ifdef __ANDROID__
+/*
+ * Register an Android application context that will be used later on
+ * to load application classes.
+ *
+ * @param env JNI environment
+ * @param context application context
+ * @return 0 on success, a negative number otherwise
+ */
+int av_jni_register_application_context(JNIEnv *env, jobject context);
+
+/*
+ * Get the registered android application context.
+ *
+ * @return the registered android application context
+ */
+jobject av_jni_get_application_context(void);
+
+/*
+ * Unregister the previously registered Android application context.
+ *
+ * @param env JNI environment
+ * @return 0 on success, a negative number otherwise
+ *
+ */
+int av_jni_unregister_application_context(JNIEnv *env);
+#endif
+
 #endif /* AVUTIL_JNI_H */
diff --git a/libavutil/jni_internal.c b/libavutil/jni_internal.c
index 2c1dc70..58eb570 100644
--- a/libavutil/jni_internal.c
+++ b/libavutil/jni_internal.c
@@ -28,6 +28,11 @@
 
 extern JavaVM *java_vm;
 
+extern jobject application_context;
+
+extern jobject application_class_loader;
+extern jmethodID 

[FFmpeg-devel] [PATCH 1/5] lavu: add JNI support

2015-10-09 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 configure|  4 +++
 libavutil/Makefile   |  4 +++
 libavutil/jni.c  | 37 ++
 libavutil/jni.h  | 42 +
 libavutil/jni_internal.c | 69 
 libavutil/jni_internal.h | 42 +
 6 files changed, 198 insertions(+)
 create mode 100644 libavutil/jni.c
 create mode 100644 libavutil/jni.h
 create mode 100644 libavutil/jni_internal.c
 create mode 100644 libavutil/jni_internal.h

diff --git a/configure b/configure
index dba7d46..de5b905 100755
--- a/configure
+++ b/configure
@@ -202,6 +202,7 @@ External library support:
   --enable-gnutls  enable gnutls, needed for https support
if openssl is not used [no]
   --disable-iconv  disable iconv [autodetect]
+  --enable-jni enable JNI support [no]
   --enable-ladspa  enable LADSPA audio filtering [no]
   --enable-libaacplus  enable AAC+ encoding via libaacplus [no]
   --enable-libass  enable libass subtitles rendering,
@@ -1374,6 +1375,7 @@ EXTERNAL_LIBRARY_LIST="
 frei0r
 gnutls
 iconv
+jni
 ladspa
 libaacplus
 libass
@@ -5263,6 +5265,7 @@ enabled chromaprint   && require chromaprint 
chromaprint.h chromaprint_get_v
 enabled decklink  && { check_header DeckLinkAPI.h || die "ERROR: 
DeckLinkAPI.h header not found"; }
 enabled frei0r&& { check_header frei0r.h || die "ERROR: frei0r.h 
header not found"; }
 enabled gnutls&& require_pkg_config gnutls gnutls/gnutls.h 
gnutls_global_init
+enabled jni   && { check_header jni.h; }
 enabled ladspa&& { check_header ladspa.h || die "ERROR: ladspa.h 
header not found"; }
 enabled libiec61883   && require libiec61883 libiec61883/iec61883.h 
iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
 enabled libaacplus&& require "libaacplus >= 2.0.0" aacplus.h 
aacplusEncOpen -laacplus
@@ -6000,6 +6003,7 @@ echo "threading support ${thread_type-no}"
 echo "safe bitstream reader ${safe_bitstream_reader-no}"
 echo "SDL support   ${sdl-no}"
 echo "opencl enabled${opencl-no}"
+echo "JNI support   ${jni-no}"
 echo "texi2html enabled ${texi2html-no}"
 echo "perl enabled  ${perl-no}"
 echo "pod2man enabled   ${pod2man-no}"
diff --git a/libavutil/Makefile b/libavutil/Makefile
index 7439750..f7386c6 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -67,6 +67,8 @@ HEADERS-$(CONFIG_LZO)   += lzo.h
 
 HEADERS-$(CONFIG_OPENCL)+= opencl.h
 
+HEADERS-$(CONFIG_JNI)   += jni.h
+
 ARCH_HEADERS = bswap.h  \
intmath.h\
intreadwrite.h   \
@@ -140,6 +142,7 @@ OBJS-$(!HAVE_ATOMICS_NATIVE)+= atomic.o 
\
 
 OBJS-$(CONFIG_LZO)  += lzo.o
 OBJS-$(CONFIG_OPENCL)   += opencl.o opencl_internal.o
+OBJS-$(CONFIG_JNI)  += jni.o jni_internal.o
 
 OBJS += $(COMPAT_OBJS:%=../compat/%)
 
@@ -150,6 +153,7 @@ SKIPHEADERS-$(HAVE_ATOMICS_GCC)+= atomic_gcc.h
 SKIPHEADERS-$(HAVE_ATOMICS_SUNCC)  += atomic_suncc.h
 SKIPHEADERS-$(HAVE_ATOMICS_WIN32)  += atomic_win32.h
 SKIPHEADERS-$(CONFIG_OPENCL)   += opencl.h
+SKIPHEADERS-$(CONFIG_JNI)  += jni_internal.h
 
 TESTPROGS = adler32 \
 aes \
diff --git a/libavutil/jni.c b/libavutil/jni.c
new file mode 100644
index 000..c6ce3a5
--- /dev/null
+++ b/libavutil/jni.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) Stupeflix 2015
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "jni.h"
+#include "log.h"
+
+#include 
+
+JavaVM *java_vm = NULL;
+
+void av_jni_register_java_vm(JavaVM *vm)
+{
+java_vm = vm;
+}
+
+JavaVM *av_jni_get_java_vm(void)
+{
+return java_vm;
+}

Re: [FFmpeg-devel] [PATCH] winrt: multithreading support

2015-10-09 Thread Wang Bin
I will update the patch next week
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/webvttdec: Deal with WebVTT escapes

2015-10-09 Thread Ricardo Constantino
Bare ampersand characters are still accepted, even though out-of-spec.
Also fixes adjacent tags not being parsed.

Fixes trac #4915

Signed-off-by: Ricardo Constantino 
---
 libavcodec/webvttdec.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/libavcodec/webvttdec.c b/libavcodec/webvttdec.c
index 1284a17..3b98e98 100644
--- a/libavcodec/webvttdec.c
+++ b/libavcodec/webvttdec.c
@@ -37,11 +37,14 @@ static const struct {
 {"", "{\\b1}"}, {"", "{\\b0}"},
 {"", "{\\u1}"}, {"", "{\\u0}"},
 {"{", "\\{"}, {"}", "\\}"}, // escape to avoid ASS markup conflicts
+{"", ">"}, {"", "<"},
+{"", ""}, {"", ""}, // FIXME: properly honor bidi marks
+{"", "&"}, {"", " "},
 };
 
 static int webvtt_event_to_ass(AVBPrint *buf, const char *p)
 {
-int i, skip = 0;
+int i, again, skip = 0;
 
 while (*p) {
 
@@ -51,13 +54,19 @@ static int webvtt_event_to_ass(AVBPrint *buf, const char *p)
 if (!strncmp(p, from, len)) {
 av_bprintf(buf, "%s", webvtt_tag_replace[i].to);
 p += len;
+again = 1;
 break;
 }
 }
 if (!*p)
 break;
 
-if (*p == '<')
+if (again) {
+again = 0;
+skip = 0;
+continue;
+}
+else if (*p == '<')
 skip = 1;
 else if (*p == '>')
 skip = 0;
-- 
2.6.0

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


Re: [FFmpeg-devel] [RFC] Poll for the community

2015-10-09 Thread Clément Bœsch
On Fri, Oct 09, 2015 at 10:45:17AM -0400, Ganesh Ajjanagadde wrote:
> On Fri, Oct 9, 2015 at 9:51 AM, Clément Bœsch  wrote:
> > On Fri, Sep 25, 2015 at 10:41:44AM +0200, Clément Bœsch wrote:
> >> Hi,
> >>
> >> I'd like to suggest a poll for the community in order to define some more
> >> clear directions for the project. I plan to post the poll on the mailing
> >> lists and IRC, people are free to forward them elsewhere.
> >>
> >> If anyone has a suggestion for a free & simple online poll, I'm listening.
> >> A poll system where people can pick the importance of each entry would be
> >> perfect.
> >>
> >> Here is the poll suggestion:
> >>
> >> Evaluate in the following list what is important and what isn't for
> >> you in the FFmpeg project:
> >>
> >> - More bug fixes (please [+] them in the bug tracker)
> >> - More test coverage to prevent regressions
> >> - More "simple" features (new demuxers, new options, ...)
> >> - More "advanced" features (high level API, scripting language
> >>   binding, filters rethinking, ...)
> >> - More speed optimizations
> >> - Better releases (LTS, more backports, ...)
> >> - Overall cleanups (merge redundant decoders or dead/clumsy stuff)
> >> - More API changes
> >> - Less API changes
> >> - Better API documentation (please specify)
> >> - Better command line documentation (please specify)
> >> - Other (please specify)
> >>
> >> I'd like to submit the poll by the end of next week. Comments on how to
> >> improve this list are very welcome, as well as my initial request about a
> >> poll system to use.
> >>
> >> Regards,
> >>
> >
> > So here is the prototype: https://www.surveymonkey.com/r/XGXPHXZ
> >
> > You can answer it now but I will reset the collecting and distribute it
> > publicly if we agree on its current form.
> >
> > It will be published on the 3 FFmpeg mailing-lists and IRC channels.
> > People responsible for the twitter account, G+ and others will be free to
> > share it there then as well.
> >
> > You have 24 hours to make comments.
> 
> 24 hours is IMHO too little. What is the hurry? Maybe at least 96 hours?
> 

People had time to comment on the thread already, but sure OK for 96
hours.

-- 
Clément B.


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


[FFmpeg-devel] [PATCH 5/5] lavf: add Android content resolver protocol support

2015-10-09 Thread Matthieu Bouron
From: Matthieu Bouron 

Handles uri starting with content://.
---
 configure|   5 ++
 libavformat/Makefile |   1 +
 libavformat/allformats.c |   1 +
 libavformat/file.c   | 155 +++
 libavutil/jni.c  |   2 +-
 5 files changed, 163 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index de5b905..17bd721 100755
--- a/configure
+++ b/configure
@@ -194,6 +194,7 @@ Individual component options:
   --disable-filtersdisable all filters
 
 External library support:
+  --enable-android-content enable Android content resolver
   --enable-avisynthenable reading of AviSynth script files [no]
   --disable-bzlib  disable bzlib [autodetect]
   --enable-chromaprint enable audio fingerprinting with chromaprint [no]
@@ -1367,6 +1368,7 @@ EXAMPLE_LIST="
 "
 
 EXTERNAL_LIBRARY_LIST="
+android_content
 avisynth
 bzlib
 chromaprint
@@ -2702,6 +2704,7 @@ x11grab_xcb_indev_deps="libxcb"
 
 # protocols
 async_protocol_deps="threads"
+android_content_protocol_deps="file_protocol android_content"
 bluray_protocol_deps="libbluray"
 ffrtmpcrypt_protocol_deps="!librtmp_protocol"
 ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl"
@@ -5255,6 +5258,7 @@ for func in $MATH_FUNCS; do
 done
 
 # these are off by default, so fail if requested and not available
+enabled android_content   && { check_header jni.h && [ $target_os = android ]; 
}
 enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || 
disable avfoundation_indev; }
 enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h 
CGGetActiveDisplayList -framework CoreGraphics ||
 check_lib2 
ApplicationServices/ApplicationServices.h CGGetActiveDisplayList -framework 
ApplicationServices; }
@@ -6004,6 +6008,7 @@ echo "safe bitstream reader 
${safe_bitstream_reader-no}"
 echo "SDL support   ${sdl-no}"
 echo "opencl enabled${opencl-no}"
 echo "JNI support   ${jni-no}"
+echo "Android content support   ${jni-no}"
 echo "texi2html enabled ${texi2html-no}"
 echo "perl enabled  ${perl-no}"
 echo "pod2man enabled   ${pod2man-no}"
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 2971912..7ed8c9e 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -499,6 +499,7 @@ OBJS-$(CONFIG_LIBSMBCLIENT_PROTOCOL) += libsmbclient.o
 
 # protocols I/O
 OBJS-$(CONFIG_ASYNC_PROTOCOL)+= async.o
+OBJS-$(CONFIG_ANDROID_CONTENT_PROTOCOL)  += file.o
 OBJS-$(CONFIG_APPLEHTTP_PROTOCOL)+= hlsproto.o
 OBJS-$(CONFIG_BLURAY_PROTOCOL)   += bluray.o
 OBJS-$(CONFIG_CACHE_PROTOCOL)+= cache.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0ccde9d..7a62af2 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -353,6 +353,7 @@ void av_register_all(void)
 
 /* protocols */
 REGISTER_PROTOCOL(ASYNC,async);
+REGISTER_PROTOCOL(ANDROID_CONTENT,  android_content);
 REGISTER_PROTOCOL(BLURAY,   bluray);
 REGISTER_PROTOCOL(CACHE,cache);
 REGISTER_PROTOCOL(CONCAT,   concat);
diff --git a/libavformat/file.c b/libavformat/file.c
index d59aa42..8058794 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -37,6 +37,12 @@
 #include 
 #include "os_support.h"
 #include "url.h"
+#if CONFIG_ANDROID_CONTENT_PROTOCOL
+#include "libavutil/jni.h"
+#include "libavutil/jni_internal.h"
+#include 
+#endif
+
 
 /* Some systems may not have S_ISFIFO */
 #ifndef S_ISFIFO
@@ -102,6 +108,13 @@ static const AVClass pipe_class = {
 .version= LIBAVUTIL_VERSION_INT,
 };
 
+static const AVClass android_content_class = {
+.class_name = "android_content",
+.item_name  = av_default_item_name,
+.option = file_options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
 static int file_read(URLContext *h, unsigned char *buf, int size)
 {
 FileContext *c = h->priv_data;
@@ -390,3 +403,145 @@ URLProtocol ff_pipe_protocol = {
 };
 
 #endif /* CONFIG_PIPE_PROTOCOL */
+
+#if CONFIG_ANDROID_CONTENT_PROTOCOL
+
+struct JFields {
+
+jclass uri_class;
+jclass parse_id;
+
+jclass context_class;
+jmethodID get_content_resolver_id;
+
+jclass content_resolver_class;
+jmethodID open_file_descriptor_id;
+
+jclass parcel_file_descriptor_class;
+jmethodID detach_fd_id;
+
+} JFields;
+
+static const struct FFJniField jfields_mapping[] = {
+
+{ "android/net/Uri", NULL, NULL, FF_JNI_CLASS, offsetof(struct JFields, 
uri_class), 1 },
+{ "android/net/Uri", "parse", "(Ljava/lang/String;)Landroid/net/Uri;", 
FF_JNI_STATIC_METHOD, offsetof(struct JFields, parse_id), 1 },
+
+{ "android/content/Context", NULL, NULL, FF_JNI_CLASS, offsetof(struct 
JFields, context_class), 1 },
+{ "android/content/Context", "getContentResolver", 

Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Ronald S. Bultje
Hi,

looking better already!

On Fri, Oct 9, 2015 at 3:58 AM, Paul B Mahol  wrote:

> +INIT_XMM sse4
> +cglobal w3fdif_scale, 3, 3, 3, 0, out_pixel, work_pixel, linesize
> +pxor  m1, m1
> +mova  m2, [pd_2_23]
> +shrlinesized, 2
>

Is linesize guaranteed to be a multiple of 4? If not, just sub 4 below and
remove this line.

+.loop
> +mova m0, [work_pixelq]
> +pmaxsd   m0, m1
>

Not necessary if you use packssdw instead of packusdw and use psrad instead
of psrld.

+pminsd   m0, m2
>

Why? packusdw+packuswb already clip within the same range. This line is
probably unnecessary.

+psrldm0, 15
> +packusdw m0, m0
>

If you use packssdw, this works on sse2 instead of sse4. It doesn't affect
the output, since you clip using packusbw right after.


> +packuswb m0, m0
> +movd   [out_pixelq], m0
> +add  out_pixelq, mmsize/4
> +add work_pixelq, mmsize
> +sub   linesized, 1
> +jg .loop
> +REP_RET
>

In some cases, like here, where the prototype for each function is
different, it's sometimes helpful for observers (like me) if you put the
function prototype as a comment directly above the cglobal line, so that we
know the types of arguments. E.g.:

; void ff_w3fdif_scale_(uint8_t *out_pixel, int32_t *work_pixel,
ptrdiff_t linesize);

Now, as for assembly, you'll notice you're not using a lot of registers
here, and your registers are there's a lot of dependency on m0, so I'd
unroll this x2 and do two pixels at a time. That also allows you to store
using movh insetad of movd.

+INIT_XMM sse2
> +cglobal w3fdif_simple_low, 4, 6, 5, 0, work_line, in_lines_cur0, coef,
> linesize
> +movd  m1, [coefq+0]
> +SPLATWm0, m1, 0
> +SPLATWm1, m1, 1
> +mov  r4q, 0
> +mov  r5q, [in_lines_cur0q + gprsize]
> +mov   in_lines_cur0q, [in_lines_cur0q]
> +%define   in_lines_cur1q  r5q
>

You can use coef as in_lines_cur1q, then the function uses 5 instead of 6
GPRs. Then, don't use define, but use x86inc's DEFINE_ARGS:

cglobal funcname, 4, 5, 5, 0, work_line, in_lines_cur0, coef, linesize,
offset
use coef
DEFINE_ARGS work_line, in_lines_cur0, in_lines_cur1, linesize, offset

and then use offsetq instead of r4q, and in_lines_cur1q is now r3 instead
of r5.

+.loop
>

Labels should be -4 indented:

.loop:
code
dec cntr
jg .loop


> +movhm2, [in_lines_cur0q+r4q]
> +movhm3, [in_lines_cur1q+r4q]
> +pxorm4, m4
> +punpcklbw   m2, m4
> +punpcklbw   m3, m4
> +SBUTTERFLY  wd, 2, 3, 4
> +pmaddwd m2, m0
> +pmaddwd m3, m1
> +mova[work_lineq+r4q*4], m2
> +mova [work_lineq+r4q*4+mmsize], m3
> +addr4q, 8

+sub  linesized, 8
>

You're using two counters here, you should be able to merge them and use
another argument (plus another instruction in your inner loop) less than
you do now.


> +cglobal w3fdif_simple_high, 5, 10, 8, 0, work_line, in_lines_cur0,
> in_lines_adj0, coef, linesize
> +movq  m2, [coefq+0]
> +SPLATWm0, m2, 0
> +SPLATWm1, m2, 1
> +SPLATWm2, m2, 2
> +SBUTTERFLYwd, 0, 1, 7
> +mov  r5q, 0
> +mov  r7q, [in_lines_cur0q+gprsize*2]
> +mov  r6q, [in_lines_cur0q+gprsize]
> +mov   in_lines_cur0q, [in_lines_cur0q]
> +%define   in_lines_cur1q  r6q
> +%define   in_lines_cur2q  r7q
> +mov  r9q, [in_lines_adj0q+gprsize*2]
> +mov  r8q, [in_lines_adj0q+gprsize]
> +mov   in_lines_adj0q, [in_lines_adj0q]
> +%define   in_lines_adj1q  r8q
> +%define   in_lines_adj2q  r9q
>

Same as above, use DEFINE_ARGS, not %define, and reuse coef so you use one
GPR less.

+.loop
>

Indent.

+movhm3, [in_lines_cur0q+r5q]
> +movhm4, [in_lines_cur1q+r5q]
> +pxorm7, m7
> +punpcklbw   m3, m7
> +punpcklbw   m4, m7
> +SBUTTERFLY  wd, 3, 4, 7
> +pmaddwd m3, m0
> +pmaddwd m4, m1
> +movhm5, [in_lines_adj0q+r5q]
> +movhm6, [in_lines_adj1q+r5q]
> +pxorm7, m7
> +punpcklbw   m5, m7
> +

Re: [FFmpeg-devel] [PATCH] avcodec/webvttdec: Unescape HTML entities

2015-10-09 Thread Clément Bœsch
On Thu, Oct 08, 2015 at 10:50:49PM +0100, Ricardo wrote:
> That would probably be considered a broken WebVTT file, since "&" need to
> be encoded as "".
> 

What about "Clment" or any unsupported escape?

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [RFC][PATCH] ffmpeg: add option to transform metadata using iconv

2015-10-09 Thread Nicolas George
Le quartidi 4 vendémiaire, an CCXXIV, James Darnley a écrit :
> I can.  You should find it attached to this email.  I cleaned it up and
> put two test cases of data into the file.  You will need Lua and the
> Lua-iconv module.  If your package manager doesn't have that see here:
> https://ittner.github.io/lua-iconv/
> 
> To run it: lua 

Sorry, I have not had time yet to look into it, and I would like to spend
the time I have tackling the issue of request_frame() recursiveness. But I
did not forget. Is your need for the feature urgent?

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH] avformat/srtdec: give WebVTT priority

2015-10-09 Thread Clément Bœsch
On Thu, Oct 08, 2015 at 11:51:32PM +0200, wm4 wrote:
> On Thu,  8 Oct 2015 19:40:38 +0200
> wm4  wrote:
> 
> > WevVTT and SRT can look very similar. For some samples, they both
> > succeed and return AVPROBE_SCORE_MAX, which leads to probing failure.
> > 
> > This gives priority to WebVTT in ambiguous cases. Since WebVTT only
> > succeeds if the header is present, it's pretty sure WebVTT should win in
> > these cases.
> > ---
> >  libavformat/srtdec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c
> > index e9cd647..6067122 100644
> > --- a/libavformat/srtdec.c
> > +++ b/libavformat/srtdec.c
> > @@ -53,7 +53,7 @@ static int srt_probe(AVProbeData *p)
> >  return 0;
> >  if (buf[0] >= '0' && buf[0] <= '9' && strstr(buf, " --> ")
> >  && sscanf(buf, "%*d:%*2d:%*2d%*1[,.]%*3d --> 
> > %*d:%*2d:%*2d%*1[,.]%3d", ) == 1)
> > -return AVPROBE_SCORE_MAX;
> > +return AVPROBE_SCORE_MAX - 1;
> >  
> >  return 0;
> >  }
> 
> Patch withdrawn. This is actually a regression due to bad strtol()
> usage, and will be fixed by ubitux later.

Fixed & backported, sry & thx


-- 
Clément B.


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


Re: [FFmpeg-devel] [RFC] Poll for the community

2015-10-09 Thread Clément Bœsch
On Fri, Sep 25, 2015 at 10:41:44AM +0200, Clément Bœsch wrote:
> Hi,
> 
> I'd like to suggest a poll for the community in order to define some more
> clear directions for the project. I plan to post the poll on the mailing
> lists and IRC, people are free to forward them elsewhere.
> 
> If anyone has a suggestion for a free & simple online poll, I'm listening.
> A poll system where people can pick the importance of each entry would be
> perfect.
> 
> Here is the poll suggestion:
> 
> Evaluate in the following list what is important and what isn't for
> you in the FFmpeg project:
> 
> - More bug fixes (please [+] them in the bug tracker)
> - More test coverage to prevent regressions
> - More "simple" features (new demuxers, new options, ...)
> - More "advanced" features (high level API, scripting language
>   binding, filters rethinking, ...)
> - More speed optimizations
> - Better releases (LTS, more backports, ...)
> - Overall cleanups (merge redundant decoders or dead/clumsy stuff)
> - More API changes
> - Less API changes
> - Better API documentation (please specify)
> - Better command line documentation (please specify)
> - Other (please specify)
> 
> I'd like to submit the poll by the end of next week. Comments on how to
> improve this list are very welcome, as well as my initial request about a
> poll system to use.
> 
> Regards,
> 

So here is the prototype: https://www.surveymonkey.com/r/XGXPHXZ

You can answer it now but I will reset the collecting and distribute it
publicly if we agree on its current form.

It will be published on the 3 FFmpeg mailing-lists and IRC channels.
People responsible for the twitter account, G+ and others will be free to
share it there then as well.

You have 24 hours to make comments.

Thanks for surveymonkey.com and other suggestions.

Regards,

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avcodec/pthread_frame: update doxygen for update_context_from_thread

2015-10-09 Thread Ronald S. Bultje
Hi,

On Fri, Oct 9, 2015 at 9:27 AM, Ganesh Ajjanagadde 
wrote:

> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/pthread_frame.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
> index c89b4ca..7651211 100644
> --- a/libavcodec/pthread_frame.c
> +++ b/libavcodec/pthread_frame.c
> @@ -187,6 +187,7 @@ static attribute_align_arg void
> *frame_worker_thread(void *arg)
>   * @param dst The destination context.
>   * @param src The source context.
>   * @param for_user 0 if the destination is a codec thread, 1 if the
> destination is the user's thread
> + * @return 0 on success, negative error code on failure
>   */
>  static int update_context_from_thread(AVCodecContext *dst, AVCodecContext
> *src, int for_user)
>  {
> --
> 2.6.1


Pushed, thanks.

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


Re: [FFmpeg-devel] [RFC] Poll for the community

2015-10-09 Thread Clément Bœsch
On Fri, Sep 25, 2015 at 08:39:16AM -0400, Ganesh Ajjanagadde wrote:
> On Fri, Sep 25, 2015 at 4:41 AM, Clément Bœsch  wrote:
> > Hi,
> >
> > I'd like to suggest a poll for the community in order to define some more
> > clear directions for the project. I plan to post the poll on the mailing
> > lists and IRC, people are free to forward them elsewhere.
> >
> > If anyone has a suggestion for a free & simple online poll, I'm listening.
> > A poll system where people can pick the importance of each entry would be
> > perfect.
> >
> > Here is the poll suggestion:
> >
> > Evaluate in the following list what is important and what isn't for
> > you in the FFmpeg project:
> >
> > - More bug fixes (please [+] them in the bug tracker)
> > - More test coverage to prevent regressions
> > - More "simple" features (new demuxers, new options, ...)
> > - More "advanced" features (high level API, scripting language
> >   binding, filters rethinking, ...)
> > - More speed optimizations
> > - Better releases (LTS, more backports, ...)
> > - Overall cleanups (merge redundant decoders or dead/clumsy stuff)
> > - More API changes
> > - Less API changes
> > - Better API documentation (please specify)
> > - Better command line documentation (please specify)
> > - Other (please specify)
> >
> > I'd like to submit the poll by the end of next week. Comments on how to
> > improve this list are very welcome, as well as my initial request about a
> > poll system to use.
> 
> List looks mostly good to me. Here are some suggestions:
> 1. http://jk.ozlabs.org/projects/patchwork/ - I recall Nicolas
> mentioning this as possibly useful - many projects (e.g VLC, glibc)
> use it. I had a look at its use in these projects, and do think it
> would be useful for FFmpeg. I think it is especially useful for
> relatively high mailing volume lists like ffmpeg-devel. Patches
> sometimes get forgotten, sometimes reviews are missing, etc -
> patchwork helps alleviate such problems without disrupting the current
> workflow. See for instance the quote on the webpage: "patchwork should
> supplement mailing lists, not replace them".
> 

This is mostly a developer thing, I don't think it really belongs in a
community poll...

> I suggest creating an "infrastructure" section covering this and other
> ideas of similar spirit.
> 

Feel free to suggest an entry. Maybe "Improve your overall developers
infrastructure to ease contributions"?

> 2. I don't know whether "more/less API changes" covers the nuances of
> API changes. There are other questions related to how/when API changes
> need to be done. Maybe this is useful as a starting point, but I
> suggest further thought on this.

Please be specific :)

> 
> As for the actual polling system, I do not have any ideas.
> 

Thanks, and sorry for ignoring most of what you suggested; I just don't
really know what to do with it. Feel free to be more specific in the next
24 hours.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] build system: fix dependency generation

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 12:13:05PM +0200, Christophe Gisquet wrote:
> 2015-10-09 11:49 GMT+02:00 Michael Niedermayer :
> >> Does that actually work even without the patch? I have the same issue
> >
> > no, it doesnt work before either, its unrelated
> 
> Well I thought it was relevant to the patch and it was causing that
> regression. So as far as I know, replacing the previous pattern by the
> new one doesn't seem to cause issues to something else, so it's
> actually good.

applied


> 
> >, i just stumbled accross it while testing ...
> > sorry if i wasnt clear about that
> 
> Try the attached patch for that separate issue. It's not the
> prettiest, and the next new test might break it, but if that's the
> first time ever this issue appeared, it's probably not worth bothering
> more with it.

sems working

ill wait a day or 2 (in case someone has a idea for how to do this in
some nicer way) and then apply unless i forget

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] avcodec/webvttdec: Unescape HTML entities

2015-10-09 Thread Ricardo
I think those were needed when UTF-8 wasn't expected, but WebVTT makes it
mandatory, according to https://w3c.github.io/webvtt/#file-structure

Are you saying that  and  should be removed (like it
was)?

On 9 October 2015 at 13:50, Clément Bœsch  wrote:

> On Thu, Oct 08, 2015 at 10:50:49PM +0100, Ricardo wrote:
> > That would probably be considered a broken WebVTT file, since "&" need to
> > be encoded as "".
> >
>
> What about "Clment" or any unsupported escape?
>
> [...]
>
> --
> Clément B.
>
> ___
> 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] Tools for MIPS MSA (MIPS SIMD-Arch)

2015-10-09 Thread Shivraj Patil

Hi all,

Please find below the toolchain and QEMU installables for the build and test of 
MIPS p5600 and i6400 cpu targets,

MIPS Toolchain:

* Download the toolchain for MIPS 32Bit (p5600) from following link 
(For 64Bit linux host)

http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.01-5/Codescape.GNU.Tools.2015.01-5.for.MIPS.MTI.Linux.CentOS-5.x86_64.tar.gz



* Download the toolchain for MIPS 64Bit (i6400) from following link 
(For 64Bit linux host)

http://codescape-mips-sdk.imgtec.com/components/toolchain/2015.01-5/Codescape.GNU.Tools.2015.01-5.for.MIPS.IMG.Linux.CentOS-5.x86_64.tar.gz

QEMU:

* Download the qemu from following link,

https://github.com/prplfoundation/qemu/archive/rel/2.4.0.1.0.tar.gz

* untar 2.4.0.1.0.tar.gz

* configure

./configure --target-list="mipsel-linux-user mips64el-linux-user"

* make

FFMpeg Configure (cpu p5600):

* ./configure --enable-cross-compile 
--cross-prefix=/install-mips-mti-linux-gnu/bin/mips-mti-linux-gnu-
 --arch=mips --cpu=p5600 --target-os=linux --extra-cflags="-EL -static" 
--extra-ldflags="-EL -static" --target- 
exec="/mipsel-linux-user/qemu-mipsel -cpu p5600" --disable-iconv

* make SAMPLES=./fate-suite/ fate

FFMpeg Configure (cpu i6400):

1.   ./configure --enable-cross-compile 
--cross-prefix=/install-mips-img-linux-gnu/bin/mips-img-linux-gnu-
 --arch=mips64 --cpu=i6400 --target-os=linux --extra-cflags="-EL -static" 
--extra-ldflags="-EL -static" 
--target-exec="/mips64el-linux-user/qemu-mips64el -cpu i6400" 
--disable-iconv

2.   make SAMPLES=./fate-suite/ fate

Shivraj

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


[FFmpeg-devel] [PATCH 4/5] lavu/jni: let avpriv_init_jfields load application classes

2015-10-09 Thread Matthieu Bouron
From: Matthieu Bouron 

---
 libavutil/jni_internal.c | 25 +
 libavutil/jni_internal.h |  1 +
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/libavutil/jni_internal.c b/libavutil/jni_internal.c
index 58eb570..78d13a4 100644
--- a/libavutil/jni_internal.c
+++ b/libavutil/jni_internal.c
@@ -257,14 +257,31 @@ int avpriv_jni_init_jfields(JNIEnv *env, void *jfields, 
const struct FFJniField
 int mandatory = jfields_mapping[i].mandatory;
 enum FFJniFieldType type = jfields_mapping[i].type;
 
-if (type == FF_JNI_CLASS) {
+if (type == FF_JNI_CLASS || type == FF_JNI_APPLICATION_CLASS) {
 jclass clazz;
 
 last_clazz = NULL;
 
-clazz = (*env)->FindClass(env, jfields_mapping[i].name);
-if ((ret = avpriv_jni_exception_check(env, mandatory, log_ctx) && 
mandatory) < 0) {
-goto done;
+if  (application_class_loader && type == FF_JNI_APPLICATION_CLASS) 
{
+
+jobject tmp = avpriv_jni_utf_chars_to_jstring(env, 
jfields_mapping[i].name, log_ctx);
+if (!tmp) {
+ret = AVERROR_EXTERNAL;
+goto done;
+}
+
+clazz = (*env)->CallObjectMethod(env, 
application_class_loader, find_class_id, tmp);
+if ((ret = avpriv_jni_exception_check(env, 1, log_ctx)) < 0 && 
mandatory) {
+goto done;
+}
+
+(*env)->DeleteLocalRef(env, tmp);
+
+} else {
+clazz = (*env)->FindClass(env, jfields_mapping[i].name);
+if ((ret = avpriv_jni_exception_check(env, mandatory, log_ctx) 
&& mandatory) < 0) {
+goto done;
+}
 }
 
 last_clazz = *(jclass*)((uint8_t*)jfields + 
jfields_mapping[i].offset) =
diff --git a/libavutil/jni_internal.h b/libavutil/jni_internal.h
index 24c4b4e..c1c206d 100644
--- a/libavutil/jni_internal.h
+++ b/libavutil/jni_internal.h
@@ -88,6 +88,7 @@ int avpriv_jni_exception_check(JNIEnv *env, int log, void 
*log_ctx);
 enum FFJniFieldType {
 
 FF_JNI_CLASS,
+FF_JNI_APPLICATION_CLASS,
 FF_JNI_FIELD,
 FF_JNI_METHOD,
 FF_JNI_STATIC_METHOD
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH 1/5] lavu: add JNI support

2015-10-09 Thread Jean-Baptiste Kempf
On 09 Oct, Matthieu Bouron wrote :
> +HEADERS-$(CONFIG_JNI)   += jni.h

You are going to install a jni.h header?

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Install config.h?

2015-10-09 Thread Ronald S. Bultje
Hi,

On Fri, Oct 9, 2015 at 12:49 PM, Gonzalo  wrote:

> Hi,
>
> I would like my program to print out its ffmpeg compile options like
> ffplay or ffmpeg do.  However, that info seems to be part of config.h which
> is not installed.  I would like to make a request to install it unless
> there's other way to get that info.


avconfig.h is the installed counterpart. If you want something from
config.h available in applications, move it to avconfig.h. config.h will
never be installed.

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


Re: [FFmpeg-devel] Add JNI and Android content resolver support

2015-10-09 Thread wm4
On Fri,  9 Oct 2015 18:26:48 +0200
Matthieu Bouron  wrote:

> Hello,
> 
> The following patchset add support for the Java Native Interface in
> FFmpeg through different helpers to:
> 
>   * manage the JNI environment (attach/detach),
>   * load classes/methods/fields from a single interface 
> (avpriv_jni_init_jfields)
>   * manage android application context and class loader, so FFmpeg will be 
> able to
>   load custom classes (which is needed if we want to use the MediaCodec 
> ability to
>   decode to a surface)
>   * other helpers.
> 
> Supporting JNI in FFmpeg will allow us to support hardware decoding on the 
> Android
> platform through the MediaCodec API.
> 
> The latest patch of the serie add support of the Android content resolver 
> which is
> retreived from the application context and will allow FFmpeg to handle uris 
> starting
> with content://

Java support has no place in libavutil, or anywhere else in ffmpeg.

Besides, even Google is gaining some sanity, and adding C APIs to some
components commonly needed by native code. (As j-b said, MediaCodec is
one of them.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/9] x86: simple_idct_put: 12bits versions

2015-10-09 Thread Michael Niedermayer
On Thu, Oct 08, 2015 at 08:22:51AM +0200, Christophe Gisquet wrote:
> On 12 frames of a 444p 12 bits DNxHR sequence:
> C: 78902 decicycles in idct,  262071 runs, 73 skips
> avx:   32478 decicycles in idct,  262045 runs, 99 skips
> 
> Difference between the 2:
> stddev:0.39 PSNR:104.47 MAXDIFF:2
> 
> This is unavoidable and due to the scale factors used in the x86
> version, which cannot match the C ones, as this would cause
> overflows (there's one less 1bit of precision).
> ---
>  libavcodec/x86/idctdsp_init.c| 19 +--
>  libavcodec/x86/simple_idct.h |  3 +++
>  libavcodec/x86/simple_idct10.asm | 18 +++---
>  3 files changed, 35 insertions(+), 5 deletions(-)

this causes overflows somewhere with mjpeg
see https://trac.ffmpeg.org/attachment/ticket/4683/12bpp.jpg

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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


[FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_w3fdif.c  | 132 ++--
 libavfilter/w3fdif.h |  47 
 libavfilter/x86/Makefile |   2 +
 libavfilter/x86/vf_w3fdif.asm| 252 +++
 libavfilter/x86/vf_w3fdif_init.c |  62 ++
 5 files changed, 458 insertions(+), 37 deletions(-)
 create mode 100644 libavfilter/w3fdif.h
 create mode 100644 libavfilter/x86/vf_w3fdif.asm
 create mode 100644 libavfilter/x86/vf_w3fdif_init.c

diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index f7703cc..a07efe4 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -29,6 +29,7 @@
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "w3fdif.h"
 
 typedef struct W3FDIFContext {
 const AVClass *class;
@@ -42,6 +43,8 @@ typedef struct W3FDIFContext {
 AVFrame *prev, *cur, *next;  ///< previous, current, next frames
 int32_t **work_line;  ///< lines we are calculating
 int nb_threads;
+
+W3FDIFDSPContext dsp;
 } W3FDIFContext;
 
 #define OFFSET(x) offsetof(W3FDIFContext, x)
@@ -81,6 +84,78 @@ static int query_formats(AVFilterContext *ctx)
 return ff_set_common_formats(ctx, fmts_list);
 }
 
+static void filter_simple_low(int32_t *work_line,
+  uint8_t *in_lines_cur[2],
+  const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line= *in_lines_cur[0]++ * coef[0];
+*work_line++ += *in_lines_cur[1]++ * coef[1];
+}
+}
+
+static void filter_complex_low(int32_t *work_line,
+   uint8_t *in_lines_cur[4],
+   const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line= *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line++ += *in_lines_cur[3]++ * coef[3];
+}
+}
+
+static void filter_simple_high(int32_t *work_line,
+   uint8_t *in_lines_cur[3],
+   uint8_t *in_lines_adj[3],
+   const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_adj[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_adj[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line++ += *in_lines_adj[2]++ * coef[2];
+}
+}
+
+static void filter_complex_high(int32_t *work_line,
+uint8_t *in_lines_cur[5],
+uint8_t *in_lines_adj[5],
+const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_adj[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_adj[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line   += *in_lines_adj[2]++ * coef[2];
+*work_line   += *in_lines_cur[3]++ * coef[3];
+*work_line   += *in_lines_adj[3]++ * coef[3];
+*work_line   += *in_lines_cur[4]++ * coef[4];
+*work_line++ += *in_lines_adj[4]++ * coef[4];
+}
+}
+
+static void filter_scale(uint8_t *out_pixel, const int32_t *work_pixel, int 
linesize)
+{
+int j;
+
+for (j = 0; j < linesize; j++, out_pixel++, work_pixel++)
+*out_pixel = av_clip(*work_pixel, 0, 255 * 256 * 128) >> 15;
+}
+
 static int config_input(AVFilterLink *inlink)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -101,11 +176,20 @@ static int config_input(AVFilterLink *inlink)
 return AVERROR(ENOMEM);
 
 for (i = 0; i < s->nb_threads; i++) {
-s->work_line[i] = av_calloc(s->linesize[0], sizeof(*s->work_line[0]));
+s->work_line[i] = av_calloc(FFALIGN(s->linesize[0], 32), 
sizeof(*s->work_line[0]));
 if (!s->work_line[i])
 return AVERROR(ENOMEM);
 }
 
+s->dsp.filter_simple_low   = filter_simple_low;
+s->dsp.filter_complex_low  = filter_complex_low;
+s->dsp.filter_simple_high  = filter_simple_high;
+s->dsp.filter_complex_high = filter_complex_high;
+s->dsp.filter_scale= filter_scale;
+
+if (ARCH_X86)
+ff_w3fdif_init_x86(>dsp);
+
 return 0;
 }
 
@@ -163,7 +247,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_
 const int dst_line_stride = out->linesize[plane];
 const int start = (height * jobnr) / nb_jobs;
 const int end = (height * (jobnr+1)) / nb_jobs;
-int i, j, y_in, y_out;
+int j, y_in, y_out;
 
 /* copy unchanged the lines of the 

[FFmpeg-devel] Install config.h?

2015-10-09 Thread Gonzalo

Hi,

I would like my program to print out its ffmpeg compile options like 
ffplay or ffmpeg do.  However, that info seems to be part of config.h 
which is not installed.  I would like to make a request to install it 
unless there's other way to get that info.

Thank you very much.

Gonzalo Garramuño
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 5/5] lavf: add Android content resolver protocol support

2015-10-09 Thread Jean-Baptiste Kempf
On 09 Oct, Matthieu Bouron wrote :
> Handles uri starting with content://.

I don't see what this has to do with libavformat.

It's OS specific, not a file format, trivial to do within any calling
application and probably going to break easily...

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Add JNI and Android content resolver support

2015-10-09 Thread Matthieu Bouron
On Fri, Oct 9, 2015 at 6:55 PM, Jean-Baptiste Kempf  wrote:

> On 09 Oct, Matthieu Bouron wrote :
> > The following patchset add support for the Java Native Interface in
> > FFmpeg through different helpers to:
> >
> >   * manage the JNI environment (attach/detach),
> >   * load classes/methods/fields from a single interface
> (avpriv_jni_init_jfields)
> >   * manage android application context and class loader, so FFmpeg will
> be able to
> >   load custom classes (which is needed if we want to use the MediaCodec
> ability to
> >   decode to a surface)
> >   * other helpers.
> >
> > Supporting JNI in FFmpeg will allow us to support hardware decoding on
> the Android
> > platform through the MediaCodec API.
>
> Mediacodec has an API in C.
>

Isn't the C API only available since android 5.0 ?

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Ronald S. Bultje
Hi,

On Fri, Oct 9, 2015 at 12:44 PM, Paul B Mahol  wrote:

> +packssdw m0, m0
>
+packuswb m0, m0
> +packssdw m1, m1
> +packuswb m1, m1
> +SBUTTERFLY   dq, 0, 1, 2
> +movh   [out_pixelq], m0
>

This should be shorted:

packssdw m0, m1
packuswb m0, m0
movh [out_pixelq], m0

One thing to notice is that SBUTTERFLY only makes sense if you care about
the high and low parts of the register. Here, you pack'ed them away so
they're effectively empty, so even in the above construct, you'd only want
punpckldq, not SBUTTERFLY dq, the second expands to punpckldq+punpckhdq.

Rest of patch looked OK at a quick glance.

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


Re: [FFmpeg-devel] [PATCH] ffplay: log possible error of SDL_EnableKeyRepeat

2015-10-09 Thread Ganesh Ajjanagadde
On Fri, Oct 9, 2015 at 4:21 AM, wm4  wrote:
> On Thu,  8 Oct 2015 18:46:44 -0400
> Ganesh Ajjanagadde  wrote:
>
>> Note that for the current SDL source code, 0 is always returned.
>> Nevertheless, this makes the code more robust.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  ffplay.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/ffplay.c b/ffplay.c
>> index 79f430d..c143e96 100644
>> --- a/ffplay.c
>> +++ b/ffplay.c
>> @@ -3814,7 +3814,8 @@ int main(int argc, char **argv)
>>  SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
>>  SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
>>
>> -SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 
>> SDL_DEFAULT_REPEAT_INTERVAL);
>> +if (SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, 
>> SDL_DEFAULT_REPEAT_INTERVAL) < 0)
>> +av_log(NULL, AV_LOG_ERROR, "SDL_EnableKeyRepeat(): %s\n", 
>> SDL_GetError());
>>
>>  if (av_lockmgr_register(lockmgr)) {
>>  av_log(NULL, AV_LOG_FATAL, "Could not initialize lock manager!\n");
>
> How does this make the code more "robust"?

If in future some limitations are placed on the repeat delay/repeat
interval apart from nonnegativity, or if someone accidentally changes
the repeat delay to e.g something dynamic and forgot to check that it
is > 0, etc we would get a log message from ffplay allowing quick
fixing of the issue.

I don't know if "robust" is the right word for it, maybe "more complete"?

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


Re: [FFmpeg-devel] [PATCH] avfilter/drawtext: allow to format pts with strftime

2015-10-09 Thread Alex Agranovsky
Thanks for your comments. I’m attaching the amended patch, hopefully it 
addresses all of them. Please let me know if something else is out of order.

- Alex




On October 9, 2015 at 2:23:42 AM, Nicolas George (geo...@nsup.org) wrote:

Le septidi 17 vendémiaire, an CCXXIV, Alex Agranovsky a écrit :  
> From a51f49007381701df18309c73083749413df3cb8 Mon Sep 17 00:00:00 2001  
> From: Alex Agranovsky   
> Date: Thu, 8 Oct 2015 15:54:59 -0400  
> Subject: [PATCH] avfilter/drawtext: allow to format pts with strftime  
>  
> ---  
> libavfilter/vf_drawtext.c | 5 +  
> 1 file changed, 5 insertions(+)  

Thanks for the patch. Unfortunately, there are a few issues to be fixed.  

First: please update the docs too.  

Next: see below.  

>  
> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c  
> index 9fd9461..5c4a7fa 100644  
> --- a/libavfilter/vf_drawtext.c  
> +++ b/libavfilter/vf_drawtext.c  
> @@ -824,6 +824,12 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,  
> (int)(ms / 1000) % 60,  
> (int)ms % 1000);  
> }  
> + } else if (!strcmp(fmt, "strftime")) {  

> + struct tm ltime;  

There is a tab here.  

> + int64_t ms = (int64_t)pts;  

This is not the correct type: since it is passed as a pointer, it must be  
time_t, nothing else.  

> + const char *fmt = (argc >= 3) ? argv[2] : "%Y-%m-%d %H:%M:%S";  

Did you test this? As far as I know, at this point it is not possible to  
have argc >= 3.  

> + localtime_r(, );  

Are you sure about that? pts is only occasionally a wall-clock timestamp.  

And if it is, the default formats leaves a timestamp without a time zone,  
that is Evil. And maybe the user wants UTC.  

> + av_bprint_strftime(bp, fmt, );  
> } else {  
> av_log(ctx, AV_LOG_ERROR, "Invalid format '%s'\n", fmt);  
> return AVERROR(EINVAL);  

Regards,  

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


0001-avfilter-drawtext-allow-to-format-pts-with-strftime.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/pthread_frame: update doxygen for update_context_from_thread

2015-10-09 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/pthread_frame.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index c89b4ca..7651211 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -187,6 +187,7 @@ static attribute_align_arg void *frame_worker_thread(void 
*arg)
  * @param dst The destination context.
  * @param src The source context.
  * @param for_user 0 if the destination is a codec thread, 1 if the 
destination is the user's thread
+ * @return 0 on success, negative error code on failure
  */
 static int update_context_from_thread(AVCodecContext *dst, AVCodecContext 
*src, int for_user)
 {
-- 
2.6.1

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 07:58:45PM +0200, Michael Niedermayer wrote:
> On Fri, Oct 09, 2015 at 06:44:03PM +0200, Paul B Mahol wrote:
> > Signed-off-by: Paul B Mahol 
> > ---
> >  libavfilter/vf_w3fdif.c  | 132 ++--
> >  libavfilter/w3fdif.h |  47 
> >  libavfilter/x86/Makefile |   2 +
> >  libavfilter/x86/vf_w3fdif.asm| 252 
> > +++
> >  libavfilter/x86/vf_w3fdif_init.c |  62 ++
> >  5 files changed, 458 insertions(+), 37 deletions(-)
> >  create mode 100644 libavfilter/w3fdif.h
> >  create mode 100644 libavfilter/x86/vf_w3fdif.asm
> >  create mode 100644 libavfilter/x86/vf_w3fdif_init.c
> 
> breaks build on x86-32
> 
> ffmpeg/libavfilter/x86/vf_w3fdif_init.c:54: undefined reference to 
> `ff_w3fdif_simple_high_sse2'

to reproduce on x86-64:
./configure --arch=x86_32 --target-os=linux --extra-cflags=-m32 
--extra-ldflags=-m32  --enable-cross-compile && make -j12

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread James Almer
On 10/9/2015 1:44 PM, Paul B Mahol wrote:
> +cglobal w3fdif_complex_low, 4, 7, 9, 0, work_line, in_lines_cur0, coef, 
> linesize
> +movq  m3, [coefq]
> +DEFINE_ARGSwork_line, in_lines_cur0, in_lines_cur1, linesize, 
> offset, in_lines_cur2, in_lines_cur3
> +SPLATWm0, m3, 0
> +SPLATWm1, m3, 1
> +SPLATWm2, m3, 2
> +SPLATWm3, m3, 3
> +SBUTTERFLYwd, 0, 1, 7
> +SBUTTERFLYwd, 2, 3, 7

Looking at this again, m0 and m1 end up having the same data. And so do m2
and m3. No need for the sbutterfly to interleave the coeffs. You just splat
two of them per register.

movq   m0, [coefq+0]
pshufd m2, m0, q
SPLATD m0

And since you're saving two regs with this you can enable the function for
x86_32.

> +mov  offsetq, 0
> +mov   in_lines_cur3q, [in_lines_cur0q+gprsize*3]
> +mov   in_lines_cur2q, [in_lines_cur0q+gprsize*2]
> +mov   in_lines_cur1q, [in_lines_cur0q+gprsize]
> +mov   in_lines_cur0q, [in_lines_cur0q]
> +
> +.loop
> +movh   m4, [in_lines_cur0q+offsetq]
> +movh   m5, [in_lines_cur1q+offsetq]
> +pxor   m7, m7

You can zero this outside the loop without worrying about overwriting it.
It will be one pxor total instead of two per loop.

> +punpcklbw  m4, m7
> +punpcklbw  m5, m7
> +SBUTTERFLY wd, 4, 5, 7

Use any free reg here and below for the fourth argument to avoid overwriting
the zeroed one.

> +pmaddwdm4, m0
> +pmaddwdm5, m1

Use m0 for both here, of course.

> +movh   m6, [in_lines_cur2q+offsetq]
> +movh   m8, [in_lines_cur3q+offsetq]
> +pxor   m7, m7
> +punpcklbw  m6, m7
> +punpcklbw  m8, m7
> +SBUTTERFLY wd, 6, 8, 7
> +pmaddwdm6, m2
> +pmaddwdm8, m3

And m2 here (or make it m1).

> +paddd  m4, m6
> +paddd  m5, m8
> +mova   [work_lineq+offsetq*4], m4
> +mova[work_lineq+offsetq*4+mmsize], m5
> +add   offsetq, mmsize/2
> +sub linesized, mmsize/2
> +jg .loop
> +REP_RET

The same can be done for complex_high (even if it's not enough to get it
working on x86_32).

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 06:44:03PM +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/vf_w3fdif.c  | 132 ++--
>  libavfilter/w3fdif.h |  47 
>  libavfilter/x86/Makefile |   2 +
>  libavfilter/x86/vf_w3fdif.asm| 252 
> +++
>  libavfilter/x86/vf_w3fdif_init.c |  62 ++
>  5 files changed, 458 insertions(+), 37 deletions(-)
>  create mode 100644 libavfilter/w3fdif.h
>  create mode 100644 libavfilter/x86/vf_w3fdif.asm
>  create mode 100644 libavfilter/x86/vf_w3fdif_init.c

breaks build on x86-32

ffmpeg/libavfilter/x86/vf_w3fdif_init.c:54: undefined reference to 
`ff_w3fdif_simple_high_sse2'

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

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


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


Re: [FFmpeg-devel] [PATCH 3/9] x86: simple_idct_put: 10bits versions

2015-10-09 Thread Michael Niedermayer
On Thu, Oct 08, 2015 at 08:22:50AM +0200, Christophe Gisquet wrote:
> Modeled from the prores version. Clips to [0;1023] and is bitexact.
> Bitexactness requires to add an offset in a different place compared
> to prores or C, and makes the function approximately 2% slower.
> 
> For 16 frames of a DNxHD 4:2:2 10bits test sequence:
> 
> C:60861 decicycles in idct, 1048205 runs,371 skips
> sse2: 27567 decicycles in idct, 1048216 runs,360 skips
> avx:  26272 decicycles in idct, 1048171 runs,405 skips
> ---
>  libavcodec/x86/Makefile   |  1 +
>  libavcodec/x86/idctdsp_init.c | 16 ++
>  libavcodec/x86/simple_idct.h  |  3 ++
>  libavcodec/x86/simple_idct10.asm  | 53 
> +++
>  libavcodec/x86/simple_idct10_template.asm | 12 +++
>  5 files changed, 85 insertions(+)
>  create mode 100644 libavcodec/x86/simple_idct10.asm

breaks (something with scantables from how it looks)
./ffplay -f lavfi  testsrc -vf spp=1:40,format=yuv420p10

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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


[FFmpeg-devel] [PATCH] avcodec/apedec: use int64_t for FFABS

2015-10-09 Thread Ganesh Ajjanagadde
res, absres are currently int's, which on most platforms is 32 bits.
Unfortunately, data is untrusted, and on line 1267 res is manipulated
with data. Thus, res can take on INT32_MIN/INT_MIN with crafted data,
making FFABS on line 1282 unsafe.

Once again, using FFNABS will make it less readable: logic is less
clear, diff is bigger, and there is scope for mistakes during the
expression rewrites.

Tested with FATE.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/apedec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index fcccfbe..e46558e 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1254,8 +1254,8 @@ static void init_filter(APEContext *ctx, APEFilter *f, 
int16_t *buf, int order)
 static void do_apply_filter(APEContext *ctx, int version, APEFilter *f,
 int32_t *data, int count, int order, int fracbits)
 {
-int res;
-int absres;
+int64_t res;
+int64_t absres;
 
 while (count--) {
 /* round fixedpoint scalar product */
-- 
2.6.1

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


Re: [FFmpeg-devel] Install config.h?

2015-10-09 Thread Gonzalo



El 09/10/15 a las 14:18, Ronald S. Bultje escribió:

avconfig.h is the installed counterpart. If you want something from
config.h available in applications, move it to avconfig.h. config.h will
never be installed.
Thanks.  Find attached a patch for configure to have avconfig.h list the 
configuration and license.



diff --git a/configure b/configure
index b572d59..4196088 100755
--- a/configure
+++ b/configure
@@ -6224,6 +6224,8 @@ cat > $TMPH <___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] fate/subtitles: Add a new test for WebVTT

2015-10-09 Thread Ricardo Constantino
Includes escapes that should now be supported and a few features not yet
supported, like comments, regions, classes, ruby, lang.

All were tested with https://quuz.org/webvtt/ for validation, except
regions because the validator doesn't support them yet.

Signed-off-by: Ricardo Constantino 
---
 tests/fate/subtitles.mak   |  3 +++
 tests/ref/fate/sub-webvtt2 | 23 +++
 2 files changed, 26 insertions(+)
 create mode 100644 tests/ref/fate/sub-webvtt2

diff --git a/tests/fate/subtitles.mak b/tests/fate/subtitles.mak
index 81ad4d7..2d9eb50 100644
--- a/tests/fate/subtitles.mak
+++ b/tests/fate/subtitles.mak
@@ -70,6 +70,9 @@ fate-sub-vplayer: CMD = fmtstdout ass -i 
$(TARGET_SAMPLES)/sub/VPlayer_capabilit
 FATE_SUBTITLES_ASS-$(call DEMDEC, WEBVTT, WEBVTT) += fate-sub-webvtt
 fate-sub-webvtt: CMD = fmtstdout ass -i 
$(TARGET_SAMPLES)/sub/WebVTT_capability_tester.vtt
 
+FATE_SUBTITLES_ASS-$(call DEMDEC, WEBVTT, WEBVTT) += fate-sub-webvtt2
+fate-sub-webvtt2: CMD = fmtstdout ass -i 
$(TARGET_SAMPLES)/sub/WebVTT_extended_tester.vtt
+
 FATE_SUBTITLES-$(call ALLYES, SRT_DEMUXER SUBRIP_DECODER WEBVTT_ENCODER 
WEBVTT_MUXER) += fate-sub-webvttenc
 fate-sub-webvttenc: CMD = fmtstdout webvtt -i 
$(TARGET_SAMPLES)/sub/SubRip_capability_tester.srt
 
diff --git a/tests/ref/fate/sub-webvtt2 b/tests/ref/fate/sub-webvtt2
new file mode 100644
index 000..b9514d3
--- /dev/null
+++ b/tests/ref/fate/sub-webvtt2
@@ -0,0 +1,23 @@
+[Script Info]
+; Script generated by FFmpeg/Lavc
+ScriptType: v4.00+
+PlayResX: 384
+PlayResY: 288
+
+[V4+ Styles]
+Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, 
OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, 
Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, 
MarginV, Encoding
+Style: 
Default,Arial,16,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0
+
+[Events]
+Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
+Dialogue: 0,0:00:00.00,0:00:20.00,Default,,0,0,0,,Hi, my name is Fred
+Dialogue: 0,0:00:02.50,0:00:22.50,Default,,0,0,0,,Hi, I’m Bill
+Dialogue: 0,0:00:05.00,0:00:25.00,Default,,0,0,0,,Would you like to get a 
coffee?
+Dialogue: 0,0:00:07.50,0:00:27.50,Default,,0,0,0,,Sure! I’ve only had one 
today.
+Dialogue: 0,0:00:10.00,0:00:30.00,Default,,0,0,0,,This is my fourth!
+Dialogue: 0,0:00:12.50,0:00:32.50,Default,,0,0,0,,OK, let’s go.
+Dialogue: 0,0:00:38.00,0:00:43.00,Default,,0,0,0,,I want to 愛あい love 
you\NThat's not proper English!
+Dialogue: 0,0:00:43.00,0:00:46.00,Default,,0,0,0,,{\i1}キツネ{\i0}じゃない 
キツネじゃない\N乙女おとめは
+Dialogue: 0,0:00:50.00,0:00:55.00,Default,,0,0,0,,Some time ago in a rather 
distant place
+Dialogue: 0,0:00:55.00,0:01:00.00,Default,,0,0,0,,Descending: 
123456\NAscending: 123456
+Dialogue: 0,0:01:00.00,0:01:05.00,Default,,0,0,0,,>> Never gonna give you up 
Never gonna let you down\NNever gonna run around & desert you
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH] fate/subtitles: Add a new test for WebVTT

2015-10-09 Thread Ricardo
Attached is the sample mentioned.


WebVTT_extended_tester.vtt
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec/mpegvideoenc: fix undefined negative left shift

2015-10-09 Thread Ganesh Ajjanagadde
This should fix the first undefined behavior reported in:
https://trac.ffmpeg.org/ticket/4727.

I can't reproduce the runtime behavior reported in the ticket, hence I
can't confirm that this actually fixes the exact issue reported in the
ticket.

Regardless, I can confirm that this is a genuine issue, and that
negative shifts can (and do) occur, fixed by this.

Tested with FATE.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/mpegvideo_enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 8e565c1..a6af8bd 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -148,7 +148,7 @@ void ff_convert_matrix(MpegEncContext *s, int (*qmat)[64],
 qmat16[qscale][0][i] == 128 * 256)
 qmat16[qscale][0][i] = 128 * 256 - 1;
 qmat16[qscale][1][i] =
-ROUNDED_DIV(bias << (16 - QUANT_BIAS_SHIFT),
+ROUNDED_DIV(bias * (1<<(16 - QUANT_BIAS_SHIFT)),
 qmat16[qscale][0][i]);
 }
 }
-- 
2.6.1

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


[FFmpeg-devel] [PATCH] avformat/webvttdec: Don't stop parsing on comments

2015-10-09 Thread Ricardo Constantino
Signed-off-by: Ricardo Constantino 
---
 libavformat/webvttdec.c| 3 ++-
 tests/ref/fate/sub-webvtt2 | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/webvttdec.c b/libavformat/webvttdec.c
index 43c2a63..47a3255 100644
--- a/libavformat/webvttdec.c
+++ b/libavformat/webvttdec.c
@@ -92,7 +92,8 @@ static int webvtt_read_header(AVFormatContext *s)
 
 /* ignore header chunk */
 if (!strncmp(p, "\xEF\xBB\xBFWEBVTT", 9) ||
-!strncmp(p, "WEBVTT", 6))
+!strncmp(p, "WEBVTT", 6) ||
+!strncmp(p, "NOTE", 4))
 continue;
 
 /* optional cue identifier (can be a number like in SRT or some kind of
diff --git a/tests/ref/fate/sub-webvtt2 b/tests/ref/fate/sub-webvtt2
index b9514d3..91081f7 100644
--- a/tests/ref/fate/sub-webvtt2
+++ b/tests/ref/fate/sub-webvtt2
@@ -21,3 +21,4 @@ Dialogue: 
0,0:00:43.00,0:00:46.00,Default,,0,0,0,,{\i1}キツネ{\i0}じゃな
 Dialogue: 0,0:00:50.00,0:00:55.00,Default,,0,0,0,,Some time ago in a rather 
distant place
 Dialogue: 0,0:00:55.00,0:01:00.00,Default,,0,0,0,,Descending: 
123456\NAscending: 123456
 Dialogue: 0,0:01:00.00,0:01:05.00,Default,,0,0,0,,>> Never gonna give you up 
Never gonna let you down\NNever gonna run around & desert you
+Dialogue: 0,0:55:00.00,1:00:00.00,Default,,0,0,0,,Transcrit par Célestes™
-- 
2.6.0

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


[FFmpeg-devel] [PATCH] configure: Add FFMPEG_CONFIGURATION and FFMPEG_LICENSE defines to avconfig.h

2015-10-09 Thread Gonzalo
This was sent in another mail, but may be lost since it did not specify 
a PATCH.


The patch is to get the license and compile flags from any application, 
I add them to the distribution of avconfig.h.


Thanks.
diff --git a/configure b/configure
index b572d59..4196088 100755
--- a/configure
+++ b/configure
@@ -6224,6 +6224,8 @@ cat > $TMPH <___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/vf_w3fdif.c  | 132 +++---
 libavfilter/w3fdif.h |  47 
 libavfilter/x86/Makefile |   2 +
 libavfilter/x86/vf_w3fdif.asm| 234 +++
 libavfilter/x86/vf_w3fdif_init.c |  62 +++
 5 files changed, 440 insertions(+), 37 deletions(-)
 create mode 100644 libavfilter/w3fdif.h
 create mode 100644 libavfilter/x86/vf_w3fdif.asm
 create mode 100644 libavfilter/x86/vf_w3fdif_init.c

diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index f7703cc..a07efe4 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -29,6 +29,7 @@
 #include "formats.h"
 #include "internal.h"
 #include "video.h"
+#include "w3fdif.h"
 
 typedef struct W3FDIFContext {
 const AVClass *class;
@@ -42,6 +43,8 @@ typedef struct W3FDIFContext {
 AVFrame *prev, *cur, *next;  ///< previous, current, next frames
 int32_t **work_line;  ///< lines we are calculating
 int nb_threads;
+
+W3FDIFDSPContext dsp;
 } W3FDIFContext;
 
 #define OFFSET(x) offsetof(W3FDIFContext, x)
@@ -81,6 +84,78 @@ static int query_formats(AVFilterContext *ctx)
 return ff_set_common_formats(ctx, fmts_list);
 }
 
+static void filter_simple_low(int32_t *work_line,
+  uint8_t *in_lines_cur[2],
+  const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line= *in_lines_cur[0]++ * coef[0];
+*work_line++ += *in_lines_cur[1]++ * coef[1];
+}
+}
+
+static void filter_complex_low(int32_t *work_line,
+   uint8_t *in_lines_cur[4],
+   const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line= *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line++ += *in_lines_cur[3]++ * coef[3];
+}
+}
+
+static void filter_simple_high(int32_t *work_line,
+   uint8_t *in_lines_cur[3],
+   uint8_t *in_lines_adj[3],
+   const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_adj[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_adj[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line++ += *in_lines_adj[2]++ * coef[2];
+}
+}
+
+static void filter_complex_high(int32_t *work_line,
+uint8_t *in_lines_cur[5],
+uint8_t *in_lines_adj[5],
+const int16_t *coef, int linesize)
+{
+int i;
+
+for (i = 0; i < linesize; i++) {
+*work_line   += *in_lines_cur[0]++ * coef[0];
+*work_line   += *in_lines_adj[0]++ * coef[0];
+*work_line   += *in_lines_cur[1]++ * coef[1];
+*work_line   += *in_lines_adj[1]++ * coef[1];
+*work_line   += *in_lines_cur[2]++ * coef[2];
+*work_line   += *in_lines_adj[2]++ * coef[2];
+*work_line   += *in_lines_cur[3]++ * coef[3];
+*work_line   += *in_lines_adj[3]++ * coef[3];
+*work_line   += *in_lines_cur[4]++ * coef[4];
+*work_line++ += *in_lines_adj[4]++ * coef[4];
+}
+}
+
+static void filter_scale(uint8_t *out_pixel, const int32_t *work_pixel, int 
linesize)
+{
+int j;
+
+for (j = 0; j < linesize; j++, out_pixel++, work_pixel++)
+*out_pixel = av_clip(*work_pixel, 0, 255 * 256 * 128) >> 15;
+}
+
 static int config_input(AVFilterLink *inlink)
 {
 AVFilterContext *ctx = inlink->dst;
@@ -101,11 +176,20 @@ static int config_input(AVFilterLink *inlink)
 return AVERROR(ENOMEM);
 
 for (i = 0; i < s->nb_threads; i++) {
-s->work_line[i] = av_calloc(s->linesize[0], sizeof(*s->work_line[0]));
+s->work_line[i] = av_calloc(FFALIGN(s->linesize[0], 32), 
sizeof(*s->work_line[0]));
 if (!s->work_line[i])
 return AVERROR(ENOMEM);
 }
 
+s->dsp.filter_simple_low   = filter_simple_low;
+s->dsp.filter_complex_low  = filter_complex_low;
+s->dsp.filter_simple_high  = filter_simple_high;
+s->dsp.filter_complex_high = filter_complex_high;
+s->dsp.filter_scale= filter_scale;
+
+if (ARCH_X86)
+ff_w3fdif_init_x86(>dsp);
+
 return 0;
 }
 
@@ -163,7 +247,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void 
*arg, int jobnr, int nb_
 const int dst_line_stride = out->linesize[plane];
 const int start = (height * jobnr) / nb_jobs;
 const int end = (height * (jobnr+1)) / nb_jobs;
-int i, j, y_in, y_out;
+int j, y_in, y_out;
 
 /* copy unchanged the lines of the 

Re: [FFmpeg-devel] [PATCH] ffmpeg: avoid possible undefined behavior

2015-10-09 Thread Michael Niedermayer
On Fri, Oct 09, 2015 at 10:39:27AM -0400, Ganesh Ajjanagadde wrote:
> On lines 1633,1634 FFABS(pts) is performed. However, if av_stream_get_end_pts
> returns AV_NOPTS_VALUE always, pts remains stuck at INT64_MIN, leading
> to undefined behavior on FFABS.
> 
> One could conceive of a solution using FFNABS. However, such a solution
> has to deal with the implementation defined rounding of integer division
> with at least one negative operand in ANSI C89. C99 forces truncation to
> zero, but I am not sure that all of our platforms compile with full C99
> support, and in particular whether we can safely assume a fixed
> rounding behavior across all platforms.
> 
> This solution is simple, and I doubt changing INT64_MIN to INT64_MIN + 1
> has any practical loss - if it is stuck at its initial value, the stream
> is messed up anyway.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  ffmpeg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread Ronald S. Bultje
Hi,

On Fri, Oct 9, 2015 at 3:19 PM, Paul B Mahol  wrote:

> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/vf_w3fdif.c  | 132 +++---
>  libavfilter/w3fdif.h |  47 
>  libavfilter/x86/Makefile |   2 +
>  libavfilter/x86/vf_w3fdif.asm| 234
> +++
>  libavfilter/x86/vf_w3fdif_init.c |  62 +++
>  5 files changed, 440 insertions(+), 37 deletions(-)
>  create mode 100644 libavfilter/w3fdif.h
>  create mode 100644 libavfilter/x86/vf_w3fdif.asm
>  create mode 100644 libavfilter/x86/vf_w3fdif_init.c


No further comments from me, LGTM.

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


Re: [FFmpeg-devel] [PATCH 5/5] lavf: add Android content resolver protocol support

2015-10-09 Thread Clément Bœsch
On Fri, Oct 09, 2015 at 06:54:31PM +0200, Jean-Baptiste Kempf wrote:
> On 09 Oct, Matthieu Bouron wrote :
> > Handles uri starting with content://.
> 
> I don't see what this has to do with libavformat.
> 
> It's OS specific, not a file format, trivial to do within any calling
> application and probably going to break easily...
> 

It's a protocol like many others we have.

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_w3fdif: add x86 SIMD

2015-10-09 Thread James Almer
On 10/9/2015 4:19 PM, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/vf_w3fdif.c  | 132 +++---
>  libavfilter/w3fdif.h |  47 
>  libavfilter/x86/Makefile |   2 +
>  libavfilter/x86/vf_w3fdif.asm| 234 
> +++
>  libavfilter/x86/vf_w3fdif_init.c |  62 +++
>  5 files changed, 440 insertions(+), 37 deletions(-)
>  create mode 100644 libavfilter/w3fdif.h
>  create mode 100644 libavfilter/x86/vf_w3fdif.asm
>  create mode 100644 libavfilter/x86/vf_w3fdif_init.c

LGTM. Further improvements (like making simple_high work on x86_32) can
be done later in a separate patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Install config.h?

2015-10-09 Thread Nicolas George
L'octidi 18 vendémiaire, an CCXXIV, Ronald S. Bultje a écrit :
> avconfig.h is the installed counterpart. If you want something from
> config.h available in applications, move it to avconfig.h.

Before that, look at avcodec_configuration() and cousins. ffmpeg.c and the
other command line programs do nothing special at this level.

>config.h will
> never be installed.

Actually, I was lazily considering making a patch to install it, but in
share/doc/, for reference: when upgrading, comparing the new configuration
with the old may have some use.

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] configure: Add FFMPEG_CONFIGURATION and FFMPEG_LICENSE defines to avconfig.h

2015-10-09 Thread Nicolas George
L'octidi 18 vendémiaire, an CCXXIV, Gonzalo a écrit :
> This was sent in another mail, but may be lost since it did not specify a
> PATCH.
> 
> The patch is to get the license and compile flags from any application, I
> add them to the distribution of avconfig.h.

> diff --git a/configure b/configure
> index b572d59..4196088 100755

You should use git send-email or git format-patch, it includes author
information and commit message.

> --- a/configure
> +++ b/configure
> @@ -6224,6 +6224,8 @@ cat > $TMPH <  /* Generated by ffconf */
>  #ifndef AVUTIL_AVCONFIG_H
>  #define AVUTIL_AVCONFIG_H

> +#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
> +#define FFMPEG_LICENSE "$(c_escape $license)"
>  EOF

This information is already available through avcodec_configuration() and
avcodec_license(). Do you really need a static version? With a shared
library, it may not match.

Regards,

-- 
  Nicolas George


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


[FFmpeg-devel] [PATCH] avcodec/ac3enc: fix undefined negative left shift

2015-10-09 Thread Ganesh Ajjanagadde
This should fix the undefined behavior reported in:
https://trac.ffmpeg.org/ticket/4727.

I can reproduce this at runtime: simply stick in an abort call in
asym_quant to check if c < 0 and run FATE. I don't know ac3 so I can't
confirm if negative coefficients are intentional, but at the moment they
clearly are according to FATE.

This resolves the undefined behavior. Tested with FATE.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/ac3enc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 35e721a..c8a0caa 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -1183,7 +1183,7 @@ static inline int asym_quant(int c, int e, int qbits)
 {
 int m;
 
-c = (((c << e) >> (24 - qbits)) + 1) >> 1;
+c = (((c * (1<> (24 - qbits)) + 1) >> 1;
 m = (1 << (qbits-1));
 if (c >= m)
 c = m - 1;
-- 
2.6.1

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


Re: [FFmpeg-devel] Add JNI and Android content resolver support

2015-10-09 Thread compn
On Fri, 9 Oct 2015 19:16:01 +0200
wm4  wrote:

> On Fri,  9 Oct 2015 18:26:48 +0200
> Matthieu Bouron  wrote:
> 
> > Hello,
> > 
> > The following patchset add support for the Java Native Interface in
> > FFmpeg through different helpers to:
> > 
> >   * manage the JNI environment (attach/detach),
> >   * load classes/methods/fields from a single interface
> > (avpriv_jni_init_jfields)
> >   * manage android application context and class loader, so FFmpeg
> > will be able to load custom classes (which is needed if we want to
> > use the MediaCodec ability to decode to a surface)
> >   * other helpers.
> > 
> > Supporting JNI in FFmpeg will allow us to support hardware decoding
> > on the Android platform through the MediaCodec API.
> > 
> > The latest patch of the serie add support of the Android content
> > resolver which is retreived from the application context and will
> > allow FFmpeg to handle uris starting with content://
> 
> Java support has no place in libavutil, or anywhere else in ffmpeg.

it may prevent further forking of ffmpeg which is always a good idea.

at least when the "oh it burns" java stuff does not intrude too much on
the project.

reducing forks is especially a good idea, since some embedded device
ffmpeg forks dont return their changes to us. were all of rockbox's
changes ever ported back? ffmpeg4android? androidffmpeg? ffmpeg4iphone?
etc etc etc etc etc etc etc

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


  1   2   >