Re: [FFmpeg-devel] [PATCH] h264_i386: Optimize decode_significance_8x8_x86 for 64 bit.

2014-12-03 Thread Reimar Döffinger
On 03.12.2014, at 01:40, Michael Niedermayer michae...@gmx.at wrote:
 On Sat, Nov 22, 2014 at 02:09:01PM +0100, Reimar Döffinger wrote:
 On Mon, Nov 17, 2014 at 01:41:13PM +0100, Michael Niedermayer wrote:
 On Mon, Nov 17, 2014 at 08:19:32AM +0100, Reimar Döffinger wrote:
 On 17.11.2014, at 02:37, Michael Niedermayer michae...@gmx.at wrote:
 On Sat, Nov 15, 2014 at 06:16:03PM +0100, Reimar Döffinger wrote:
 11674 - 10877 decicycles on my Phenom II.
 Overall speedup was unfortunately within measurement error.
 
 here its  10153 -10135
 
 I suspect it also depends a bit on the compiler and how it changes the 
 surrounding code.
 Note that I also tested with PIC actually.
 
 but ive a slightly odd feeling about the chnages to the asm code,
 iam not sure if all assemblers will be happy about the changed
 code
 
 Do you mean particularly the movzbl change?
 
 yes and the k stuff
 
 
 I am also unsure about that, I think there was a reason for that %k6 
 mess...
 But this as well as movzx seemed to work for me...
 
 it works here too i just have the feeling it might fail on some odd
 assembler or platform. Thats not meant to keep you from pushing this
 just that it might require to be reverted or fixed if such
 problems actually occor
 
 I pushed it.
 If anyone sees issues please tell me and I'll look into it!
 
 i think these fate failures are caused by it but thats based just
 on other commits in the range looking unlikely:
 
 http://fate.ffmpeg.org/report.cgi?time=20141122231657slot=x86_64-darwin-clang-3.5-O3
 http://fate.ffmpeg.org/report.cgi?time=2014113720slot=x86_64-darwin-clang-3.5

That's annoying, I only expected compile errors, this looks more like a 
compiler bug.
Can someone run tests?
Does just using the m instead of r constraint like on 32 bit fix it?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] pngdsp x86: use scalar loop for unaligned dest buffers.

2014-12-03 Thread Benoit Fouet
Hi,

- Mail original -
 Hi,
 
 2014-12-02 14:31 GMT+01:00 Benoit Fouet benoit.fo...@free.fr:
  Fixes ticket #4148
 
 Please try that one instead.
 

Works fine, thanks.
Please fix commit message: s/onlu/only

 As all your changes have been reverted, I've put myself as the only
 author. I've left your signed-off-by, but I'm not sure of its
 purpose now.
 

Just remove my name.

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


[FFmpeg-devel] ffmpeg developer needed

2014-12-03 Thread james gordon
Hi All,

I am currently looking for a developer to work on a remote project,
details
below;

Basically I am working with an open source Android which is based on the
PJSIP sipstack. Currently FFMPEG is used for H264 video
encoding/decoding
(software) and it is pretty slow on most Android devices.

I am aware that that FFMPEG has some support for H264 HW decoding on the
Android platform using libstagefright, however I could not get this to
build.

Ideally what I would like is to add support into FFMPEG to use the new
Android MediaCodec API for H264 HW decoding and encoding

Summary: Add Android MediaCodec API support into FFMPEG / OR / fix
libstagefright and add encoding support.

Let me know if your interested.

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


Re: [FFmpeg-devel] ffmpeg developer needed

2014-12-03 Thread Anshul
On 12/03/2014 03:18 PM, james gordon wrote:
 Hi All,

 I am currently looking for a developer to work on a remote project,
 details
 below;

 Basically I am working with an open source Android which is based on the
 PJSIP sipstack. Currently FFMPEG is used for H264 video
 encoding/decoding
 (software) and it is pretty slow on most Android devices.

 I am aware that that FFMPEG has some support for H264 HW decoding on the
 Android platform using libstagefright, however I could not get this to
 build.

 Ideally what I would like is to add support into FFMPEG to use the new
 Android MediaCodec API for H264 HW decoding and encoding

 Summary: Add Android MediaCodec API support into FFMPEG / OR / fix
 libstagefright and add encoding support.

 Let me know if your interested.

 Thanks
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
I would suggest put this requirement as feature or wish in
https://trac.ffmpeg.org/
and put Whatever bounty you prefer to give to the person who complete
this work.

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


Re: [FFmpeg-devel] need help

2014-12-03 Thread Anshul
On 12/03/2014 03:57 PM, Chetan wrote:
  

 Hi i want to create video using Text with html tages and effect ...
 please let me know .. command 
I would suggest, use this ffmpeg user questions ffmpeg-u...@ffmpeg.org
mailing list
please.

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


Re: [FFmpeg-devel] [PATCH] pngdsp x86: use scalar loop for unaligned dest buffers.

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 09:47:45AM +0100, Benoit Fouet wrote:
 Hi,
 
 - Mail original -
  Hi,
  
  2014-12-02 14:31 GMT+01:00 Benoit Fouet benoit.fo...@free.fr:
   Fixes ticket #4148
  
  Please try that one instead.
  
 
 Works fine, thanks.

 Please fix commit message: s/onlu/only

fixed


 
  As all your changes have been reverted, I've put myself as the only
  author. I've left your signed-off-by, but I'm not sure of its
  purpose now.
  
 
 Just remove my name.

removed

applied

thanks

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

No great genius has ever existed without some touch of madness. -- Aristotle


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


Re: [FFmpeg-devel] Patch for device list error in decklink_common.cpp

2014-12-03 Thread Jon bae
Thanks Ramiro for the correction!
Here is the new patch. (Is it better to post directly the patch, or is ok
as a attachment?)

Regards
Jonathan

2014-12-02 22:19 GMT+01:00 Ramiro Polla ramiro.po...@gmail.com:


 On 02.12.2014 20:30, Jon bae wrote:

 Here is the other patch for decklink_common.cpp. It fix the error:

 COM initialization failed
 [decklink @ 02e5b520] Could not create DeckLink iterator
 dummy: Immediate exit request


  From 203eba2fad14dd6d84552d6c22899792e80b53bb Mon Sep 17 00:00:00 2001
 From: Jonathan Baecker jonba...@gmail.com
 Date: Tue, 2 Dec 2014 20:12:38 +0100
 Subject: [PATCH 2/2] device list error in decklink_common

 Signed-off-by: Jonathan Baecker jonba...@gmail.com
 ---
  libavdevice/decklink_common.cpp | 24 ++--
  1 file changed, 14 insertions(+), 10 deletions(-)

 diff --git a/libavdevice/decklink_common.cpp
 b/libavdevice/decklink_common.cpp
 index 8eff910..8f7e32a 100644
 --- a/libavdevice/decklink_common.cpp
 +++ b/libavdevice/decklink_common.cpp
 @@ -42,16 +42,20 @@ IDeckLinkIterator *CreateDeckLinkIteratorInstance
 (void)
  {
  IDeckLinkIterator *iter;

 -if (CoInitialize(NULL) != S_OK) {
 -av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
 -return NULL;
 -}
 -
 -if (CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
 - IID_IDeckLinkIterator, (void**) iter) != S_OK)
 {
 -av_log(NULL, AV_LOG_ERROR, DeckLink drivers not installed.\n);
 -return NULL;
 -}
 +HRESULT result;
 +/* Initialize COM on this thread */
 +result = CoInitialize(NULL);
 +if (FAILED(result)) {
 +av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
 +return NULL;
 +}
 +
 +/* Create an IDeckLinkIterator object to enumerate all DeckLink
 cards in the system */
 +result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL,
 CLSCTX_ALL, IID_IDeckLinkIterator, (void**)iter);
 +if (FAILED(result)) {
 +av_log(NULL, AV_LOG_ERROR, DeckLink drivers not installed.\n);
 +return NULL;
 +}

  return iter;
  }
 --
 2.2.0


 This code is Copyright (c) Blackmagic Design. Try just changing the check
 for CoInitialize(NULL) from != S_OK to  0.
 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



0001-fix-COM-initialization-failed.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] web/legal: move Legal Threats to bottom of page

2014-12-03 Thread Michael Niedermayer
On Tue, Dec 02, 2014 at 02:53:08PM -0900, Lou Logan wrote:
 This places Legal Threats under all of the more useful stuff.
 
 Signed-off-by: Lou Logan l...@lrcd.com
 ---
  src/legal | 23 +++
  1 file changed, 11 insertions(+), 12 deletions(-)

LGTM

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

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


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


[FFmpeg-devel] select different dv profiles using framerates

2014-12-03 Thread Steve Jiekak

720p60 and 720p50 are currently not differentiable during profile selection.
If set to a profile value the framerate will be used as the last criteria.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] dv codec : allow selecting between 720p60 and 720p50 profiles based on framerate

2014-12-03 Thread Steve Jiekak

Signed-off-by: Steve Jiekak devaure...@gmail.com
---
 libavcodec/dv_profile.c |   14 +++---
 libavcodec/dv_profile.h |2 +-
 libavcodec/dvenc.c  |2 +-
 libavformat/dv.c|2 +-
 libavformat/dvenc.c |3 ++-
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
index b301cbf..5c4e23c 100644
--- a/libavcodec/dv_profile.c
+++ b/libavcodec/dv_profile.c
@@ -312,18 +312,26 @@ const AVDVProfile *av_dv_frame_profile(const AVDVProfile 
*sys,
 }
 
 const AVDVProfile *av_dv_codec_profile(int width, int height,
-   enum AVPixelFormat pix_fmt)
+   enum AVPixelFormat pix_fmt,
+   AVRational time_base)
 {
+const AVDVProfile *p = NULL;
 #if CONFIG_DVPROFILE
 int i;
+/* frame rate is necessary to select between 720p50 and 720p60 profiles */
+int validtimebase = time_base.num == 0 || time_base.den == 0;
 
 for (i = 0; i  FF_ARRAY_ELEMS(dv_profiles); i++)
 if (height  == dv_profiles[i].height  
 pix_fmt == dv_profiles[i].pix_fmt 
 width   == dv_profiles[i].width)
-return dv_profiles[i];
+{
+p = dv_profiles[i];
+if( !validtimebase || av_div_q(p-time_base, time_base).num == 1 )
+return p;
+}
 #endif
 
-return NULL;
+return p;
 }
 
diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
index d4437c9..c595f21 100644
--- a/libavcodec/dv_profile.h
+++ b/libavcodec/dv_profile.h
@@ -81,6 +81,6 @@ const AVDVProfile *av_dv_frame_profile(const AVDVProfile *sys,
 /**
  * Get a DV profile for the provided stream parameters.
  */
-const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
AVPixelFormat pix_fmt);
+const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
AVPixelFormat pix_fmt, AVRational time_base);
 
 #endif /* AVCODEC_DV_PROFILE_H */
diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 5d810e3..2163757 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -47,7 +47,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
 PixblockDSPContext pdsp;
 int ret;
 
-s-sys = av_dv_codec_profile(avctx-width, avctx-height, avctx-pix_fmt);
+s-sys = av_dv_codec_profile(avctx-width, avctx-height, avctx-pix_fmt, 
avctx-time_base);
 if (!s-sys) {
 av_log(avctx, AV_LOG_ERROR, Found no DV profile for %ix%i %s video. 
 Valid DV profiles are:\n,
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 095966c..3d32910 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -423,7 +423,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, 
DVDemuxContext *c,
 {
 // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
 const AVDVProfile *sys = av_dv_codec_profile(c-vst-codec-width, 
c-vst-codec-height,
- c-vst-codec-pix_fmt);
+ c-vst-codec-pix_fmt, 
c-vst-codec-time_base);
 int64_t offset;
 int64_t size   = avio_size(s-pb) - s-data_offset;
 int64_t max_offset = ((size - 1) / sys-frame_size) * sys-frame_size;
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 18fdf9f..1a30a15 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -337,7 +337,8 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
 goto bail_out;
 }
 }
-c-sys = av_dv_codec_profile(vst-codec-width, vst-codec-height, 
vst-codec-pix_fmt);
+c-sys = av_dv_codec_profile(vst-codec-width, vst-codec-height, 
+vst-codec-pix_fmt, 
vst-codec-time_base);
 if (!c-sys)
 goto bail_out;
 
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] h264_i386: Optimize decode_significance_8x8_x86 for 64 bit.

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 09:00:39AM +0100, Reimar Döffinger wrote:
 On 03.12.2014, at 01:40, Michael Niedermayer michae...@gmx.at wrote:
  On Sat, Nov 22, 2014 at 02:09:01PM +0100, Reimar Döffinger wrote:
  On Mon, Nov 17, 2014 at 01:41:13PM +0100, Michael Niedermayer wrote:
  On Mon, Nov 17, 2014 at 08:19:32AM +0100, Reimar Döffinger wrote:
  On 17.11.2014, at 02:37, Michael Niedermayer michae...@gmx.at wrote:
  On Sat, Nov 15, 2014 at 06:16:03PM +0100, Reimar Döffinger wrote:
  11674 - 10877 decicycles on my Phenom II.
  Overall speedup was unfortunately within measurement error.
  
  here its  10153 -10135
  
  I suspect it also depends a bit on the compiler and how it changes the 
  surrounding code.
  Note that I also tested with PIC actually.
  
  but ive a slightly odd feeling about the chnages to the asm code,
  iam not sure if all assemblers will be happy about the changed
  code
  
  Do you mean particularly the movzbl change?
  
  yes and the k stuff
  
  
  I am also unsure about that, I think there was a reason for that %k6 
  mess...
  But this as well as movzx seemed to work for me...
  
  it works here too i just have the feeling it might fail on some odd
  assembler or platform. Thats not meant to keep you from pushing this
  just that it might require to be reverted or fixed if such
  problems actually occor
  
  I pushed it.
  If anyone sees issues please tell me and I'll look into it!
  
  i think these fate failures are caused by it but thats based just
  on other commits in the range looking unlikely:
  
  http://fate.ffmpeg.org/report.cgi?time=20141122231657slot=x86_64-darwin-clang-3.5-O3
  http://fate.ffmpeg.org/report.cgi?time=2014113720slot=x86_64-darwin-clang-3.5
 
 That's annoying, I only expected compile errors, this looks more like a 
 compiler bug.
 Can someone run tests?
 Does just using the m instead of r constraint like on 32 bit fix it?

still aborts with:

@@ -37,7 +37,7 @@
 #if HAVE_INLINE_ASM

 #if ARCH_X86_64
-#define REG64 r
+#define REG64 m
 #else
 #define REG64 m
 #endif

ggdb shows not much usefull:
Program received signal SIGABRT, Aborted.
0x7fff82a31866 in ?? ()
(gdb) bt
#0  0x7fff82a31866 in ?? ()
#1  0x7fff8ec4735c in ?? ()
warning: (Internal error: pc 0x0 in read in psymtab, but not in symtab.)

#2  0x in ?? ()
(gdb) disassemble $rip-32,$rip+32
Dump of assembler code from 0x7fff82a31846 to 0x7fff82a31886:
   0x7fff82a31846:  add%eax,(%rax)
   0x7fff82a31848:  add-0x77(%rcx),%cl
   0x7fff82a3184b:  lret   $0x50f
   0x7fff82a3184e:  jae0x7fff82a31858
   0x7fff82a31850:  mov%rax,%rdi
   0x7fff82a31853:  jmpq   0x7fff82a2e175
   0x7fff82a31858:  retq
   0x7fff82a31859:  nop
   0x7fff82a3185a:  nop
   0x7fff82a3185b:  nop
   0x7fff82a3185c:  mov$0x2000148,%eax
   0x7fff82a31861:  mov%rcx,%r10
   0x7fff82a31864:  syscall
= 0x7fff82a31866:  jae0x7fff82a31870
   0x7fff82a31868:  mov%rax,%rdi
   0x7fff82a3186b:  jmpq   0x7fff82a2e175
   0x7fff82a31870:  retq
   0x7fff82a31871:  nop
   0x7fff82a31872:  nop
   0x7fff82a31873:  nop
   0x7fff82a31874:  mov$0x200014c,%eax
   0x7fff82a31879:  mov%rcx,%r10
   0x7fff82a3187c:  syscall
   0x7fff82a3187e:  jae0x7fff82a31888
   0x7fff82a31880:  mov%rax,%rdi
   0x7fff82a31883:  jmpq   0x7fff82a2e175



-- 
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


[FFmpeg-devel] [PATCH 1/2] allow to extract subcc

2014-12-03 Thread anshul . ffmpeg
From: Nicolas George geo...@nsup.org

---
 doc/indevs.texi |  9 ++
 libavdevice/lavfi.c | 80 +
 2 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 5d2a308..f31e2e3 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -494,6 +494,9 @@ number starting from 0 corresponding to the mapped input 
stream
 generated by the device.
 The first unlabelled output is automatically assigned to the out0
 label, but all the others need to be specified explicitly.
+The suffix +subcc can be appended to the output label to create an extra
+stream with the closed captions packets attached to that output
+(experimental).
 
 If not specified defaults to the filename specified for the input
 device.
@@ -541,6 +544,12 @@ Read an audio stream and a video stream and play it back 
with
 ffplay -f lavfi movie=test.avi[out0];amovie=test.wav[out1]
 @end example
 
+@item
+Dump decoded frames to images and closed captions to a file (experimental):
+@example
+ffmpeg -f lavfi -i movie=test.ts[out0+subcc] -map v frame%08d.png -map s -c 
copy -f rawvideo subcc.bin
+@end example
+
 @end itemize
 
 @section libcdio
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 1398ece..bc45117 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -51,7 +51,10 @@ typedef struct {
 int *sink_stream_map;
 int *sink_eof;
 int *stream_sink_map;
+int *sink_stream_subcc_map;
 AVFrame *decoded_frame;
+int nb_sinks;
+AVPacket subcc_packet;
 } LavfiContext;
 
 static int *create_all_formats(int n)
@@ -82,6 +85,7 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
 av_freep(lavfi-sink_stream_map);
 av_freep(lavfi-sink_eof);
 av_freep(lavfi-stream_sink_map);
+av_freep(lavfi-sink_stream_subcc_map);
 av_freep(lavfi-sinks);
 avfilter_graph_free(lavfi-graph);
 av_frame_free(lavfi-decoded_frame);
@@ -89,6 +93,27 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
 return 0;
 }
 
+static int create_subcc_streams(AVFormatContext *avctx)
+{
+LavfiContext *lavfi = avctx-priv_data;
+AVStream *st;
+int stream_idx, sink_idx;
+
+for (stream_idx = 0; stream_idx  lavfi-nb_sinks; stream_idx++) {
+sink_idx = lavfi-stream_sink_map[stream_idx];
+if (lavfi-sink_stream_subcc_map[sink_idx]) {
+lavfi-sink_stream_subcc_map[sink_idx] = avctx-nb_streams;
+if (!(st = avformat_new_stream(avctx, NULL)))
+return AVERROR(ENOMEM);
+st-codec-codec_id = AV_CODEC_ID_EIA_608;
+st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
+} else {
+lavfi-sink_stream_subcc_map[sink_idx] = -1;
+}
+}
+return 0;
+}
+
 av_cold static int lavfi_read_header(AVFormatContext *avctx)
 {
 LavfiContext *lavfi = avctx-priv_data;
@@ -153,6 +178,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 
 /* count the outputs */
 for (n = 0, inout = output_links; inout; n++, inout = inout-next);
+lavfi-nb_sinks = n;
 
 if (!(lavfi-sink_stream_map = av_malloc(sizeof(int) * n)))
 FAIL(AVERROR(ENOMEM));
@@ -160,6 +186,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 FAIL(AVERROR(ENOMEM));
 if (!(lavfi-stream_sink_map = av_malloc(sizeof(int) * n)))
 FAIL(AVERROR(ENOMEM));
+if (!(lavfi-sink_stream_subcc_map = av_malloc(sizeof(int) * n)))
+FAIL(AVERROR(ENOMEM));
 
 for (i = 0; i  n; i++)
 lavfi-stream_sink_map[i] = -1;
@@ -167,10 +195,10 @@ av_cold static int lavfi_read_header(AVFormatContext 
*avctx)
 /* parse the output link names - they need to be of the form out0, out1, 
...
  * create a mapping between them and the streams */
 for (i = 0, inout = output_links; inout; i++, inout = inout-next) {
-int stream_idx;
+int stream_idx, use_subcc = 0;
 if (!strcmp(inout-name, out))
 stream_idx = 0;
-else if (sscanf(inout-name, out%d\n, stream_idx) != 1) {
+else if (sscanf(inout-name, out%d+subcc%n\n, stream_idx, 
use_subcc) != 1) {
 av_log(avctx,  AV_LOG_ERROR,
Invalid outpad name '%s'\n, inout-name);
 FAIL(AVERROR(EINVAL));
@@ -192,6 +220,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 }
 lavfi-sink_stream_map[i] = stream_idx;
 lavfi-stream_sink_map[stream_idx] = i;
+lavfi-sink_stream_subcc_map[stream_idx] = !!use_subcc;
 }
 
 /* for each open output create a corresponding stream */
@@ -203,7 +232,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 }
 
 /* create a sink for each output and connect them to the graph */
-lavfi-sinks = av_malloc_array(avctx-nb_streams, sizeof(AVFilterContext 
*));
+lavfi-sinks = av_malloc_array(lavfi-nb_sinks, sizeof(AVFilterContext *));
 if (!lavfi-sinks)
 

[FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-03 Thread anshul . ffmpeg
From: Anshul Maheshwari anshul.ffm...@gmail.com

---
I did implement lots of other thing, with respect to older patch.
like multi screen and rollup feature.

This implementation is working well with srt output format.
As of now ffplay is not able to show the decoded frames on screen.
I dont know why?

May be someone look at output and help, that what is missing.

 libavcodec/Makefile   |   1 +
 libavcodec/allcodecs.c|   1 +
 libavcodec/ccaption_dec.c | 376 ++
 3 files changed, 378 insertions(+)
 create mode 100644 libavcodec/ccaption_dec.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fa0f53d..bbc516d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -173,6 +173,7 @@ OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
 OBJS-$(CONFIG_C93_DECODER) += c93.o
 OBJS-$(CONFIG_CAVS_DECODER)+= cavs.o cavsdec.o cavsdsp.o \
   cavsdata.o mpeg12data.o
+OBJS-$(CONFIG_CCAPTION_DECODER)+= ccaption_dec.o
 OBJS-$(CONFIG_CDGRAPHICS_DECODER)  += cdgraphics.o
 OBJS-$(CONFIG_CDXL_DECODER)+= cdxl.o
 OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0d39d33..8c07388 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -480,6 +480,7 @@ void avcodec_register_all(void)
 /* subtitles */
 REGISTER_ENCDEC (SSA,   ssa);
 REGISTER_ENCDEC (ASS,   ass);
+REGISTER_DECODER(CCAPTION,  ccaption);
 REGISTER_ENCDEC (DVBSUB,dvbsub);
 REGISTER_ENCDEC (DVDSUB,dvdsub);
 REGISTER_DECODER(JACOSUB,   jacosub);
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
new file mode 100644
index 000..57443e4
--- /dev/null
+++ b/libavcodec/ccaption_dec.c
@@ -0,0 +1,376 @@
+/*
+ * Closed Caption Decoding
+ * Copyright (c) 2014 Anshul Maheshwari
+ *
+ * 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 avcodec.h
+#include libavcodec/ass.h
+
+#define SCREEN_ROWS 15
+#define SCREEN_COLUMNS 32
+
+#define SET_FLAG(var, val) ( var |= ( 1  (val) ) )
+#define UNSET_FLAG(var, val) ( var =  ~( 1  (val)) )
+#define CHECK_FLAG(var, val) ( (var)  (1  (val) ) )
+
+enum cc_mode {
+CCMODE_POPON,
+CCMODE_PAINTON,
+CCMODE_ROLLUP_2,
+CCMODE_ROLLUP_3,
+CCMODE_ROLLUP_4,
+CCMODE_TEXT,
+};
+typedef struct {
+int row;
+int column;
+} cursor_t;
+
+// buffer for CC
+typedef struct {
+uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1];
+/*
+ * row used flag will be 0 when none in use other wise it will have its
+ * corrosponding bit high.
+ * for setting row 1  use row | (1  1)
+ * for setting row 15 use row | (1  15)
+ */
+int16_t  row_used;
+} screen_t;
+
+
+typedef struct CCaptionSubContext {
+int parity_table[256];
+int row_cnt;
+screen_t screen[2];
+int active_screen;
+cursor_t cursor;
+char *buffer;
+int index;
+int data_len;
+int buf_len;
+/* erase display memory */
+int edm;
+int rollup;
+enum  cc_mode mode;
+int64_t start_time;
+/* visible screen time */
+int64_t startv_time;
+int64_t end_time;
+char prev_cmd[2];
+}CCaptionSubContext;
+
+static unsigned int av_always_inline is_oddparity1p7(unsigned int val)
+{
+//#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || 
defined(_M_IX86)
+#if 0
+asm goto (
+and  $0x7F, %0\n\t
+jnp %l1 \/n\t
+:/* no output */
+:r(val)
+:cc
+:odd
+);
+val = !(val0x8);
+odd:
+val = !!(val0x80);
+#else
+int ones = 0;
+int i = 0;
+
+for (i = 0; i  7; i++) {
+if (val  (1  i))
+ones++;
+}
+val = ones  1;
+#endif
+return val;
+}
+
+static void build_parity_table(int *parity_table)
+{
+unsigned int byte;
+int parity_v;
+for (byte = 0; byte = 127; byte++) {
+parity_v = is_oddparity1p7(byte);
+parity_table[byte] = parity_v;
+parity_table[byte | 0x80] = !parity_v;
+}
+}
+
+static av_cold int init_decoder(AVCodecContext *avctx)
+{
+
+CCaptionSubContext *ctx = 

Re: [FFmpeg-devel] [PATCH 2/2] ffmpeg: use avcodec_copy_context before avcodec_open2 and open both ctxs

2014-12-03 Thread Lukasz Marek
On 3 December 2014 at 03:15, Michael Niedermayer michae...@gmx.at wrote:

 On Wed, Dec 03, 2014 at 02:02:21AM +0100, Lukasz Marek wrote:
  On 03.12.2014 01:53, Michael Niedermayer wrote:
  On Wed, Dec 03, 2014 at 01:39:12AM +0100, Lukasz Marek wrote:
  On 03.12.2014 00:35, Michael Niedermayer wrote:
  On Tue, Dec 02, 2014 at 07:27:33PM +0100, Lukasz Marek wrote:
  avcodec_copy_context make dest context unopened.
  ffmpeg treats it as opened.
  
  Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
  ---
ffmpeg.c | 29 -
1 file changed, 20 insertions(+), 9 deletions(-)
  
  diff --git a/ffmpeg.c b/ffmpeg.c
  index b44401f..4fa9f1e 100644
  --- a/ffmpeg.c
  +++ b/ffmpeg.c
  @@ -2932,6 +2932,7 @@ static int transcode_init(void)
if (ost-encoding_needed) {
AVCodec  *codec = ost-enc;
AVCodecContext *dec = NULL;
  +AVDictionary   *opt_copy = NULL;
  
if ((ist = get_input_stream(ost)))
dec = ist-dec_ctx;
  @@ -2949,13 +2950,24 @@ static int transcode_init(void)
av_dict_set(ost-encoder_opts, threads, auto,
 0);
av_dict_set(ost-encoder_opts,
 side_data_only_packets, 1, 0);
  
  -if ((ret = avcodec_open2(ost-enc_ctx, codec,
 ost-encoder_opts))  0) {
  +ret = avcodec_copy_context(ost-st-codec,
 ost-enc_ctx);
  +if (ret  0) {
  +av_log(NULL, AV_LOG_FATAL,
  +   Error initializing the output stream codec
 context.\n);
  +exit_program(1);
  +}
  +
  +av_dict_copy(opt_copy, ost-encoder_opts, 0);
  +if ((ret = avcodec_open2(ost-enc_ctx, codec,
 ost-encoder_opts))  0 ||
  +(ret = avcodec_open2(ost-st-codec, codec,
 opt_copy))  0) {
  
  if the encoder is opened twice it would print any info or warnings
  twice. libxvid would open 2pass files twice potentially i think
  
  maybe coded_frame could just be allocated somewhere before use
  in ffmpeg raw and leaving the copy as it is in ffmpeg ?
  
  I'm not familiar with ffmpeg.c code closely; is ost-st-codec
  context used by ffmpeg for anything? I guess not (but im not sure).
  If so, I think is all working because of that. You have two contexts
  that share some pointers (like mentioned coded_frame). Of cource it
  can be reallocated here, but this code is still in contradiction
  with doxy of avcodec_copy_context that states dest context should be
  treat as  not opened. FFmpeg uses it as opened.
  
  where does ffmpeg treat the context as open ?
 
  I saw this coded_frame allocated in init function of codecs, so I
  assumed that.
 
  i know of the coded_frame case but thats only used to transfer some
  flags into the muxer and isnt really a pretty way to do it but
  for that simply allocating the frame so the flags can be set
  should work
  i mean you can probably just check if its NULL and allocate
  before the few flags are set in it
 
  So basically, I can just alloc it in avcodec_copy_context in case it
  is present in src object? It is working, but I thought it is wrong
  way to solve it.

 I suspect that would lead to some memleak, also it doesnt feel
 right.


Yes, probably would require some cleaning somewhere too.


 Ive removed the troubblesome coded_frame use in ffmpeg.c, it served
 no purpose anymore
 does that solve the issue?


Yes. Test is not crushing anymore. Thanks.
This patch can be dropped then.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] libavcodec/options: print a warning when copying open context

2014-12-03 Thread Lukasz Marek
On 2 December 2014 at 19:27, Lukasz Marek lukasz.m.lu...@gmail.com wrote:

 Context copied from open context cannot be treated as opened.
 avcodec_open2 modifies context so reopening it is also questionable.
 It is worth to warn when it happens.

 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  libavcodec/options.c | 3 +++
  1 file changed, 3 insertions(+)

 diff --git a/libavcodec/options.c b/libavcodec/options.c
 index 3dd5df3..dab5140 100644
 --- a/libavcodec/options.c
 +++ b/libavcodec/options.c
 @@ -182,6 +182,9 @@ int avcodec_copy_context(AVCodecContext *dest, const
 AVCodecContext *src)
  const AVCodec *orig_codec = dest-codec;
  uint8_t *orig_priv_data = dest-priv_data;

 +if (avcodec_is_open(src))
 +av_log(dest, AV_LOG_WARNING, AVCodecContext is copied from
 opened context.\n);


I still think copying opened codec is a bit tricky, but this would spam
this warning by ffmpeg, so dropped.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-03 Thread Nicolas George
Le tridi 13 frimaire, an CCXXIII, anshul.ffm...@gmail.com a écrit :
 Subject: Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

Very good news!

 I did implement lots of other thing, with respect to older patch.
 like multi screen and rollup feature.
 
 This implementation is working well with srt output format.
 As of now ffplay is not able to show the decoded frames on screen.
 I dont know why?

As far as I know, ffplay can only handle bitmap subtitles, not text
subtitles.

I do not have time to check right now: can you tell if you changed something
in the first patch or if it is mine unchanged?

Just a quick few words for the rest:

 May be someone look at output and help, that what is missing.
 
  libavcodec/Makefile   |   1 +
  libavcodec/allcodecs.c|   1 +
  libavcodec/ccaption_dec.c | 376 
 ++
  3 files changed, 378 insertions(+)
  create mode 100644 libavcodec/ccaption_dec.c
 
 diff --git a/libavcodec/Makefile b/libavcodec/Makefile
 index fa0f53d..bbc516d 100644
 --- a/libavcodec/Makefile
 +++ b/libavcodec/Makefile
 @@ -173,6 +173,7 @@ OBJS-$(CONFIG_BRENDER_PIX_DECODER) += brenderpix.o
  OBJS-$(CONFIG_C93_DECODER) += c93.o
  OBJS-$(CONFIG_CAVS_DECODER)+= cavs.o cavsdec.o cavsdsp.o \
cavsdata.o mpeg12data.o
 +OBJS-$(CONFIG_CCAPTION_DECODER)+= ccaption_dec.o
  OBJS-$(CONFIG_CDGRAPHICS_DECODER)  += cdgraphics.o
  OBJS-$(CONFIG_CDXL_DECODER)+= cdxl.o
  OBJS-$(CONFIG_CINEPAK_DECODER) += cinepak.o
 diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
 index 0d39d33..8c07388 100644
 --- a/libavcodec/allcodecs.c
 +++ b/libavcodec/allcodecs.c
 @@ -480,6 +480,7 @@ void avcodec_register_all(void)
  /* subtitles */
  REGISTER_ENCDEC (SSA,   ssa);
  REGISTER_ENCDEC (ASS,   ass);
 +REGISTER_DECODER(CCAPTION,  ccaption);
  REGISTER_ENCDEC (DVBSUB,dvbsub);
  REGISTER_ENCDEC (DVDSUB,dvdsub);
  REGISTER_DECODER(JACOSUB,   jacosub);
 diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
 new file mode 100644
 index 000..57443e4
 --- /dev/null
 +++ b/libavcodec/ccaption_dec.c
 @@ -0,0 +1,376 @@
 +/*
 + * Closed Caption Decoding
 + * Copyright (c) 2014 Anshul Maheshwari
 + *
 + * 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 avcodec.h

 +#include libavcodec/ass.h

Looks suspicious. Just ass.h maybe?

 +
 +#define SCREEN_ROWS 15
 +#define SCREEN_COLUMNS 32
 +
 +#define SET_FLAG(var, val) ( var |= ( 1  (val) ) )
 +#define UNSET_FLAG(var, val) ( var =  ~( 1  (val)) )
 +#define CHECK_FLAG(var, val) ( (var)  (1  (val) ) )
 +
 +enum cc_mode {
 +CCMODE_POPON,
 +CCMODE_PAINTON,
 +CCMODE_ROLLUP_2,
 +CCMODE_ROLLUP_3,
 +CCMODE_ROLLUP_4,
 +CCMODE_TEXT,
 +};
 +typedef struct {
 +int row;
 +int column;

 +} cursor_t;

Names ending in _t are reserved by the C standard.

(And this one specifically looks not really useful: you could just use two
fields cursor_row and cursor_col.)

 +
 +// buffer for CC
 +typedef struct {
 +uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1];
 +/*
 + * row used flag will be 0 when none in use other wise it will have its
 + * corrosponding bit high.
 + * for setting row 1  use row | (1  1)
 + * for setting row 15 use row | (1  15)
 + */
 +int16_t  row_used;

 +} screen_t;

Ditto.

 +
 +
 +typedef struct CCaptionSubContext {
 +int parity_table[256];
 +int row_cnt;
 +screen_t screen[2];
 +int active_screen;
 +cursor_t cursor;

 +char *buffer;
 +int index;
 +int data_len;
 +int buf_len;

Maybe you could use the AVBPrint API.

 +/* erase display memory */
 +int edm;
 +int rollup;
 +enum  cc_mode mode;
 +int64_t start_time;
 +/* visible screen time */
 +int64_t startv_time;
 +int64_t end_time;
 +char prev_cmd[2];
 +}CCaptionSubContext;
 +
 +static unsigned int av_always_inline is_oddparity1p7(unsigned int val)
 +{

 +//#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || 
 defined(_M_IX86)
 +#if 0
 +asm goto (
 +and  $0x7F, %0\n\t
 +   

Re: [FFmpeg-devel] [PATCH] dv codec : allow selecting between 720p60 and 720p50 profiles based on framerate

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 12:48:46PM +0100, Steve Jiekak wrote:
 
 Signed-off-by: Steve Jiekak devaure...@gmail.com
 ---
  libavcodec/dv_profile.c |   14 +++---
  libavcodec/dv_profile.h |2 +-
  libavcodec/dvenc.c  |2 +-
  libavformat/dv.c|2 +-
  libavformat/dvenc.c |3 ++-
  5 files changed, 16 insertions(+), 7 deletions(-)
 
 diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
 index b301cbf..5c4e23c 100644
 --- a/libavcodec/dv_profile.c
 +++ b/libavcodec/dv_profile.c
 @@ -312,18 +312,26 @@ const AVDVProfile *av_dv_frame_profile(const 
 AVDVProfile *sys,
  }
  
  const AVDVProfile *av_dv_codec_profile(int width, int height,
 -   enum AVPixelFormat pix_fmt)
 +   enum AVPixelFormat pix_fmt,
 +   AVRational time_base)
  {
 +const AVDVProfile *p = NULL;
  #if CONFIG_DVPROFILE
  int i;
 +/* frame rate is necessary to select between 720p50 and 720p60 profiles 
 */
 +int validtimebase = time_base.num == 0 || time_base.den == 0;
  
  for (i = 0; i  FF_ARRAY_ELEMS(dv_profiles); i++)
  if (height  == dv_profiles[i].height  
  pix_fmt == dv_profiles[i].pix_fmt 
  width   == dv_profiles[i].width)
 -return dv_profiles[i];
 +{
 +p = dv_profiles[i];
 +if( !validtimebase || av_div_q(p-time_base, time_base).num == 1 
 )

is av_div_q() what you meant to use or av_cmp_q() ?


 +return p;
 +}
  #endif
  
 -return NULL;
 +return p;
  }
  
 diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
 index d4437c9..c595f21 100644
 --- a/libavcodec/dv_profile.h
 +++ b/libavcodec/dv_profile.h
 @@ -81,6 +81,6 @@ const AVDVProfile *av_dv_frame_profile(const AVDVProfile 
 *sys,
  /**
   * Get a DV profile for the provided stream parameters.
   */
 -const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
 AVPixelFormat pix_fmt);
 +const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
 AVPixelFormat pix_fmt, AVRational time_base);

you cannot change public API, you can add new public API if needed
though

make sure you bump minor version and update APIChanges accordingly
though

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] avfilter/tinterlace: merge code with interlace

2014-12-03 Thread Michael Niedermayer
On Tue, Dec 02, 2014 at 07:43:47PM +0100, Clément Bœsch wrote:
 ---
 After this commit, interlace doesn't behave the same if the input frames
 are already interlaced. Does anyone wants me to keep this behaviour?

probably best if its kept but can be forced enabled/disabled with
an option. these interlacing flags on the input can be wrong

otherwise LGTM

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

No great genius has ever existed without some touch of madness. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH] lavu/opt: handle NULL during class comparsion

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 12:06:18AM +0100, Lukasz Marek wrote:
 av_opt_copy compares classes to avoid copying between mismatched objects.
 This protection fails when dest class is NULL.

does this case actually occur ?

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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 


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


[FFmpeg-devel] [PATCH 1/4] libavcodec/pngdec: support 'previous' dispose operation for APNG.

2014-12-03 Thread Benoit Fouet
---
 libavcodec/pngdec.c | 72 +
 1 file changed, 50 insertions(+), 22 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 229a6d6..b1e77e5 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -38,6 +38,7 @@ typedef struct PNGDecContext {
 AVCodecContext *avctx;
 
 GetByteContext gb;
+ThreadFrame previous_picture;
 ThreadFrame last_picture;
 ThreadFrame picture;
 
@@ -55,6 +56,7 @@ typedef struct PNGDecContext {
 int bits_per_pixel;
 int bpp;
 
+int frame_id;
 uint8_t *image_buf;
 int image_linesize;
 uint32_t palette[256];
@@ -827,13 +829,14 @@ static int decode_fctl_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 return AVERROR_INVALIDDATA;
 
 /* always (re)start with a clean frame */
-if (sequence_number == 0)
+if (sequence_number == 0) {
 s-dispose_op = APNG_DISPOSE_OP_BACKGROUND;
-
-if (s-dispose_op == APNG_DISPOSE_OP_PREVIOUS) {
-av_log(avctx, AV_LOG_ERROR,
-   Dispose operation 'previous' is not yet implemented, using 
'none'.\n);
-s-dispose_op = APNG_DISPOSE_OP_NONE;
+s-frame_id = 0;
+} else {
+s-frame_id++;
+if (s-frame_id == 1  s-dispose_op == APNG_DISPOSE_OP_PREVIOUS)
+/* previous for the second frame is the first frame */
+s-dispose_op = APNG_DISPOSE_OP_NONE;
 }
 
 return 0;
@@ -864,8 +867,9 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 {
 int i, j;
 uint8_t *pd  = p-data[0];
-/* TODO make pd_last point to the one before for APNG_DISPOSE_OP_PREVIOUS 
*/
 uint8_t *pd_last = s-last_picture.f-data[0];
+uint8_t *pd_last_region = s-dispose_op == APNG_DISPOSE_OP_PREVIOUS ?
+s-previous_picture.f-data[0] : 
s-last_picture.f-data[0];
 int ls = FFMIN(av_image_get_linesize(p-format, s-width, 0), s-width * 
s-bpp);
 
 if (s-blend_op == APNG_BLEND_OP_OVER 
@@ -876,6 +880,9 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 }
 
 ff_thread_await_progress(s-last_picture, INT_MAX, 0);
+if (s-dispose_op == APNG_DISPOSE_OP_PREVIOUS)
+ff_thread_await_progress(s-previous_picture, INT_MAX, 0);
+
 for (j = 0; j  s-y_offset; j++) {
 for (i = 0; i  ls; i++)
 pd[i] = pd_last[i];
@@ -886,6 +893,7 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 if (s-dispose_op != APNG_DISPOSE_OP_BACKGROUND  s-blend_op == 
APNG_BLEND_OP_OVER) {
 uint8_t ri, gi, bi, ai;
 
+pd_last_region += s-y_offset * s-image_linesize;
 if (avctx-pix_fmt == AV_PIX_FMT_RGBA) {
 ri = 0;
 gi = 1;
@@ -907,17 +915,17 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 /* output = alpha * foreground + (1-alpha) * background */
 switch (alpha) {
 case 0:
-pd[i+ri] = pd_last[i+ri];
-pd[i+gi] = pd_last[i+gi];
-pd[i+bi] = pd_last[i+bi];
+pd[i+ri] = pd_last_region[i+ri];
+pd[i+gi] = pd_last_region[i+gi];
+pd[i+bi] = pd_last_region[i+bi];
 pd[i+ai] = 0xff;
 break;
 case 255:
 break;
 default:
-pd[i+ri] = FAST_DIV255(alpha * pd[i+ri] + (255 - alpha) * 
pd_last[i+ri]);
-pd[i+gi] = FAST_DIV255(alpha * pd[i+gi] + (255 - alpha) * 
pd_last[i+gi]);
-pd[i+bi] = FAST_DIV255(alpha * pd[i+bi] + (255 - alpha) * 
pd_last[i+bi]);
+pd[i+ri] = FAST_DIV255(alpha * pd[i+ri] + (255 - alpha) * 
pd_last_region[i+ri]);
+pd[i+gi] = FAST_DIV255(alpha * pd[i+gi] + (255 - alpha) * 
pd_last_region[i+gi]);
+pd[i+bi] = FAST_DIV255(alpha * pd[i+bi] + (255 - alpha) * 
pd_last_region[i+bi]);
 pd[i+ai] = 0xff;
 break;
 }
@@ -926,6 +934,7 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 pd[i] = pd_last[i];
 pd  += s-image_linesize;
 pd_last += s-image_linesize;
+pd_last_region += s-image_linesize;
 }
 } else {
 for (j = s-y_offset; j  s-y_offset + s-cur_h; j++) {
@@ -955,6 +964,7 @@ static int decode_frame_common(AVCodecContext *avctx, 
PNGDecContext *s,
 uint32_t tag, length;
 int decode_next_dat = 0;
 int ret = AVERROR_INVALIDDATA;
+AVFrame *ref;
 
 for (;;) {
 length = bytestream2_get_bytes_left(s-gb);
@@ -1053,11 +1063,13 @@ exit_loop:
 handle_small_bpp(s, p);
 
 /* handle p-frames only if a predecessor frame is available */
-if (s-last_picture.f-data[0]) {
+ref = s-dispose_op == APNG_DISPOSE_OP_PREVIOUS 

[FFmpeg-devel] [PATCH 4/4] avcodec/pngdec: use memcpy instead of byte loops for P frames.

2014-12-03 Thread Benoit Fouet
Rely on the way memcpy is optimized for one's system instead of looping
on a byte buffer for buffer copies to handle P frames.
---
 libavcodec/pngdec.c | 30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 7e7b285..8b004bd 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -844,15 +844,14 @@ static int decode_fctl_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 
 static void handle_p_frame_png(PNGDecContext *s, AVFrame *p)
 {
-int i, j;
+int j;
 uint8_t *pd  = p-data[0];
 uint8_t *pd_last = s-last_picture.f-data[0];
 int ls = FFMIN(av_image_get_linesize(p-format, s-width, 0), s-width * 
s-bpp);
 
 ff_thread_await_progress(s-last_picture, INT_MAX, 0);
 for (j = 0; j  s-height; j++) {
-for (i = 0; i  ls; i++)
-pd[i] += pd_last[i];
+memcpy(pd, pd_last, ls);
 pd  += s-image_linesize;
 pd_last += s-image_linesize;
 }
@@ -884,8 +883,7 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 ff_thread_await_progress(s-previous_picture, INT_MAX, 0);
 
 for (j = 0; j  s-y_offset; j++) {
-for (i = 0; i  ls; i++)
-pd[i] = pd_last[i];
+memcpy(pd, pd_last, ls);
 pd  += s-image_linesize;
 pd_last += s-image_linesize;
 }
@@ -907,8 +905,9 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 }
 
 for (j = s-y_offset; j  s-y_offset + s-cur_h; j++) {
-for (i = 0; i  s-x_offset * s-bpp; i++)
-pd[i] = pd_last[i];
+i = s-x_offset * s-bpp;
+if (i)
+memcpy(pd, pd_last, i);
 for (; i  (s-x_offset + s-cur_w) * s-bpp; i += s-bpp) {
 uint8_t alpha = pd[i+ai];
 
@@ -930,26 +929,27 @@ static int handle_p_frame_apng(AVCodecContext *avctx, 
PNGDecContext *s,
 break;
 }
 }
-for (; i  ls; i++)
-pd[i] = pd_last[i];
+if (ls - i)
+memcpy(pd+i, pd_last+i, ls - i);
 pd  += s-image_linesize;
 pd_last += s-image_linesize;
 pd_last_region += s-image_linesize;
 }
 } else {
 for (j = s-y_offset; j  s-y_offset + s-cur_h; j++) {
-for (i = 0; i  s-x_offset * s-bpp; i++)
-pd[i] = pd_last[i];
-for (i = (s-x_offset + s-cur_w) * s-bpp; i  ls; i++)
-pd[i] = pd_last[i];
+int end_offset = (s-x_offset + s-cur_w) * s-bpp;
+int end_len= ls - end_offset;
+if (s-x_offset)
+memcpy(pd, pd_last, s-x_offset * s-bpp);
+if (end_len)
+memcpy(pd+end_offset, pd_last+end_offset, end_len);
 pd  += s-image_linesize;
 pd_last += s-image_linesize;
 }
 }
 
 for (j = s-y_offset + s-cur_h; j  s-height; j++) {
-for (i = 0; i  ls; i++)
-pd[i] = pd_last[i];
+memcpy(pd, pd_last, ls);
 pd  += s-image_linesize;
 pd_last += s-image_linesize;
 }
-- 
2.2.0

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


[FFmpeg-devel] [PATCH 2/4] avcodec/pngdec: fix mem leak in init()

2014-12-03 Thread Benoit Fouet
---
 libavcodec/pngdec.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index b1e77e5..3905e0f 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1237,8 +1237,12 @@ static av_cold int png_dec_init(AVCodecContext *avctx)
 s-previous_picture.f = av_frame_alloc();
 s-last_picture.f = av_frame_alloc();
 s-picture.f = av_frame_alloc();
-if (!s-previous_picture.f || !s-last_picture.f || !s-picture.f)
+if (!s-previous_picture.f || !s-last_picture.f || !s-picture.f) {
+av_frame_free(s-previous_picture.f);
+av_frame_free(s-last_picture.f);
+av_frame_free(s-picture.f);
 return AVERROR(ENOMEM);
+}
 
 if (!avctx-internal-is_copy) {
 avctx-internal-allocate_progress = 1;
-- 
2.2.0

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


[FFmpeg-devel] [PATCH 3/4] avcodec/pngdec: fix indentation in handle_row()

2014-12-03 Thread Benoit Fouet
---
 libavcodec/pngdec.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 3905e0f..7e7b285 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -307,13 +307,13 @@ static void png_handle_row(PNGDecContext *s)
 
 if (!s-interlace_type) {
 ptr = s-image_buf + s-image_linesize * (s-y + s-y_offset) + 
s-x_offset * s-bpp;
-if (s-y == 0)
-last_row = s-last_row;
-else
-last_row = ptr - s-image_linesize;
+if (s-y == 0)
+last_row = s-last_row;
+else
+last_row = ptr - s-image_linesize;
 
-png_filter_row(s-dsp, ptr, s-crow_buf[0], s-crow_buf + 1,
-   last_row, s-row_size, s-bpp);
+png_filter_row(s-dsp, ptr, s-crow_buf[0], s-crow_buf + 1,
+   last_row, s-row_size, s-bpp);
 /* loco lags by 1 row so that it doesn't interfere with top prediction 
*/
 if (s-filter_type == PNG_FILTER_TYPE_LOCO  s-y  0) {
 if (s-bit_depth == 16) {
-- 
2.2.0

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


Re: [FFmpeg-devel] [PATCH 4/4] avcodec/pngdec: use memcpy instead of byte loops for P frames.

2014-12-03 Thread Benoit Fouet
Hi,

- Mail original -
 Rely on the way memcpy is optimized for one's system instead of
 looping
 on a byte buffer for buffer copies to handle P frames.
 ---
  libavcodec/pngdec.c | 30 +++---
  1 file changed, 15 insertions(+), 15 deletions(-)
 
 diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
 index 7e7b285..8b004bd 100644
 --- a/libavcodec/pngdec.c
 +++ b/libavcodec/pngdec.c
 @@ -844,15 +844,14 @@ static int decode_fctl_chunk(AVCodecContext
 *avctx, PNGDecContext *s,
  
  static void handle_p_frame_png(PNGDecContext *s, AVFrame *p)
  {
 -int i, j;
 +int j;
  uint8_t *pd  = p-data[0];
  uint8_t *pd_last = s-last_picture.f-data[0];
  int ls = FFMIN(av_image_get_linesize(p-format, s-width, 0),
  s-width * s-bpp);
  
  ff_thread_await_progress(s-last_picture, INT_MAX, 0);
  for (j = 0; j  s-height; j++) {
 -for (i = 0; i  ls; i++)
 -pd[i] += pd_last[i];
 +memcpy(pd, pd_last, ls);
 

Ouch... Reverted locally...

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


Re: [FFmpeg-devel] [PATCH] lavu/opt: handle NULL during class comparsion

2014-12-03 Thread Lukasz Marek
On 3 December 2014 at 14:10, Michael Niedermayer michae...@gmx.at wrote:

 On Wed, Dec 03, 2014 at 12:06:18AM +0100, Lukasz Marek wrote:
  av_opt_copy compares classes to avoid copying between mismatched objects.
  This protection fails when dest class is NULL.

 does this case actually occur ?


Yes and no.

There was a crush in ffmpeg, when avcodec_copy_context was called on
context of codec that has no class in priv context.
It is fixed by:
[PATCH] lavc/options: don't copy priv context when it is not AVOption
object.

Calling this function on non-avclass object is misuse of this function of
course. So probably patch is not needed, but maybe doesn't hurt.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavu/opt: handle NULL during class comparsion

2014-12-03 Thread Lukasz Marek
On 3 December 2014 at 14:29, Lukasz Marek lukasz.m.lu...@gmail.com wrote:


 On 3 December 2014 at 14:10, Michael Niedermayer michae...@gmx.at wrote:

 On Wed, Dec 03, 2014 at 12:06:18AM +0100, Lukasz Marek wrote:
  av_opt_copy compares classes to avoid copying between mismatched
 objects.
  This protection fails when dest class is NULL.

 does this case actually occur ?


 Yes and no.

 There was a crush in ffmpeg, when avcodec_copy_context was called on
 context of codec that has no class in priv context.
 It is fixed by:
 [PATCH] lavc/options: don't copy priv context when it is not AVOption
 object.

 Calling this function on non-avclass object is misuse of this function of
 course. So probably patch is not needed, but maybe doesn't hurt.


To summarize, I drop this patch for now.
I will create some tests for avcodec_copy_context for corner cases and some
fixes if needed.
If extra checks are needed then probably not here.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Patch for device list error in decklink_common.cpp

2014-12-03 Thread Ramiro Polla


On 03.12.2014 12:06, Jon bae wrote:

Thanks Ramiro for the correction!
Here is the new patch. (Is it better to post directly the patch, or is ok
as a attachment?)


Attachment is better. But please avoid top-posting in this mailing-list.


2014-12-02 22:19 GMT+01:00 Ramiro Polla ramiro.po...@gmail.com:

On 02.12.2014 20:30, Jon bae wrote:

Here is the other patch for decklink_common.cpp. It fix the error:

 COM initialization failed
 [decklink @ 02e5b520] Could not create DeckLink iterator
 dummy: Immediate exit request



  From 203eba2fad14dd6d84552d6c22899792e80b53bb Mon Sep 17 00:00:00 2001

From: Jonathan Baecker jonba...@gmail.com
Date: Tue, 2 Dec 2014 20:12:38 +0100
Subject: [PATCH 2/2] device list error in decklink_common

Signed-off-by: Jonathan Baecker jonba...@gmail.com
---
  libavdevice/decklink_common.cpp | 24 ++--
  1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/libavdevice/decklink_common.cpp
b/libavdevice/decklink_common.cpp
index 8eff910..8f7e32a 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -42,16 +42,20 @@ IDeckLinkIterator *CreateDeckLinkIteratorInstance
(void)
  {
  IDeckLinkIterator *iter;

-if (CoInitialize(NULL) != S_OK) {
-av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
-return NULL;
-}
-
-if (CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
- IID_IDeckLinkIterator, (void**) iter) != S_OK)
{
-av_log(NULL, AV_LOG_ERROR, DeckLink drivers not installed.\n);
-return NULL;
-}
+HRESULT result;
+/* Initialize COM on this thread */
+result = CoInitialize(NULL);
+if (FAILED(result)) {
+av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
+return NULL;
+}
+
+/* Create an IDeckLinkIterator object to enumerate all DeckLink
cards in the system */
+result = CoCreateInstance(CLSID_CDeckLinkIterator, NULL,
CLSCTX_ALL, IID_IDeckLinkIterator, (void**)iter);
+if (FAILED(result)) {
+av_log(NULL, AV_LOG_ERROR, DeckLink drivers not installed.\n);
+return NULL;
+}

  return iter;
  }
--
2.2.0



This code is Copyright (c) Blackmagic Design. Try just changing the check
for CoInitialize(NULL) from != S_OK to  0.




From 3c3d5dda659fe30c68a81b0a711cb09bcb5be443 Mon Sep 17 00:00:00 2001
From: Jonathan Baecker jonba...@gmail.com
Date: Wed, 3 Dec 2014 12:03:12 +0100
Subject: [PATCH] fix COM initialization failed

Signed-off-by: Jonathan Baecker jonba...@gmail.com
---
 libavdevice/decklink_common.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 6899bd2..4252552 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -42,13 +42,13 @@ IDeckLinkIterator *CreateDeckLinkIteratorInstance(void)
 {
 IDeckLinkIterator *iter;

-if (CoInitialize(NULL) != S_OK) {
+if (CoInitialize(NULL)  0) {
 av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
 return NULL;
 }



 if (CoCreateInstance(CLSID_CDeckLinkIterator, NULL, CLSCTX_ALL,
- IID_IDeckLinkIterator, (void**) iter) != S_OK) {
+ IID_IDeckLinkIterator, (void**) iter)  0) {
 av_log(NULL, AV_LOG_ERROR, DeckLink drivers not installed.\n);
 return NULL;
 }


The CoCreateInstance check doesn't need to be changed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] dv codec : allow selecting between 720p60 and 720p50 profiles based on framerate

2014-12-03 Thread aureshy lapoiss

 is av_div_q() what you meant to use or av_cmp_q() ?


I use av_div_q to allow both frame rates 25/1 and 50/1 to select the same
profile.

you cannot change public API, you can add new public API if needed
 though


I forgot that. Should I use av_dv_codec_profile2 for the new name?

Steve



On Wed, Dec 3, 2014 at 1:46 PM, Michael Niedermayer michae...@gmx.at
wrote:

 On Wed, Dec 03, 2014 at 12:48:46PM +0100, Steve Jiekak wrote:
 
  Signed-off-by: Steve Jiekak devaure...@gmail.com
  ---
   libavcodec/dv_profile.c |   14 +++---
   libavcodec/dv_profile.h |2 +-
   libavcodec/dvenc.c  |2 +-
   libavformat/dv.c|2 +-
   libavformat/dvenc.c |3 ++-
   5 files changed, 16 insertions(+), 7 deletions(-)
 
  diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
  index b301cbf..5c4e23c 100644
  --- a/libavcodec/dv_profile.c
  +++ b/libavcodec/dv_profile.c
  @@ -312,18 +312,26 @@ const AVDVProfile *av_dv_frame_profile(const
 AVDVProfile *sys,
   }
 
   const AVDVProfile *av_dv_codec_profile(int width, int height,
  -   enum AVPixelFormat pix_fmt)
  +   enum AVPixelFormat pix_fmt,
  +   AVRational time_base)
   {
  +const AVDVProfile *p = NULL;
   #if CONFIG_DVPROFILE
   int i;
  +/* frame rate is necessary to select between 720p50 and 720p60
 profiles */
  +int validtimebase = time_base.num == 0 || time_base.den == 0;
 
   for (i = 0; i  FF_ARRAY_ELEMS(dv_profiles); i++)
   if (height  == dv_profiles[i].height  
   pix_fmt == dv_profiles[i].pix_fmt 
   width   == dv_profiles[i].width)
  -return dv_profiles[i];
  +{
  +p = dv_profiles[i];
  +if( !validtimebase || av_div_q(p-time_base, time_base).num
 == 1 )

 is av_div_q() what you meant to use or av_cmp_q() ?


  +return p;
  +}
   #endif
 
  -return NULL;
  +return p;
   }
 
  diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
  index d4437c9..c595f21 100644
  --- a/libavcodec/dv_profile.h
  +++ b/libavcodec/dv_profile.h
  @@ -81,6 +81,6 @@ const AVDVProfile *av_dv_frame_profile(const
 AVDVProfile *sys,
   /**
* Get a DV profile for the provided stream parameters.
*/
  -const AVDVProfile *av_dv_codec_profile(int width, int height, enum
 AVPixelFormat pix_fmt);
  +const AVDVProfile *av_dv_codec_profile(int width, int height, enum
 AVPixelFormat pix_fmt, AVRational time_base);

 you cannot change public API, you can add new public API if needed
 though

 make sure you bump minor version and update APIChanges accordingly
 though

 [...]

 --
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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

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


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


[FFmpeg-devel] [PATCH 1/2] add av_dv_codec_profile2 : uses framerate to select best matching profile. default on first matching profile

2014-12-03 Thread Steve Jiekak
Signed-off-by: Steve Jiekak devaure...@gmail.com
---
 doc/APIchanges  |3 +++
 libavcodec/dv_profile.c |   27 +++
 libavcodec/dv_profile.h |6 ++
 libavcodec/version.h|2 +-
 4 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 5915ad3..a81c3b9 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2014-12-03 - xxx - lavc 56.14.100 - dv_profile.h
+  Add av_dv_codec_profile2().
+
 2014-11-21 - xxx - lavu 54.15.100 - dict.h
Add av_dict_get_string().
 
diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
index b301cbf..362afe4 100644
--- a/libavcodec/dv_profile.c
+++ b/libavcodec/dv_profile.c
@@ -311,19 +311,38 @@ const AVDVProfile *av_dv_frame_profile(const AVDVProfile 
*sys,
 return ff_dv_frame_profile(NULL, sys, frame, buf_size);
 }
 
-const AVDVProfile *av_dv_codec_profile(int width, int height,
-   enum AVPixelFormat pix_fmt)
+const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
AVPixelFormat pix_fmt)
 {
 #if CONFIG_DVPROFILE
+return av_dv_codec_profile2(width, height, pix_fmt, (AVRational){0, 0});
+#endif
+
+return NULL;
+}
+
+const AVDVProfile *av_dv_codec_profile2(int width, int height,
+   enum AVPixelFormat pix_fmt,
+   AVRational frame_rate)
+{
+const AVDVProfile *p = NULL;
+#if CONFIG_DVPROFILE
 int i;
+/* frame rate is necessary to select between 720p50 and 720p60 profiles */
+int invalid_framerate = frame_rate.num == 0 || frame_rate.den == 0;
 
 for (i = 0; i  FF_ARRAY_ELEMS(dv_profiles); i++)
 if (height  == dv_profiles[i].height  
 pix_fmt == dv_profiles[i].pix_fmt 
 width   == dv_profiles[i].width)
-return dv_profiles[i];
+{
+if( !invalid_framerate || av_div_q(dv_profiles[i].time_base, 
frame_rate).num == 1 )
+return dv_profiles[i];
+
+if(!p)
+p = dv_profiles[i];
+}
 #endif
 
-return NULL;
+return p;
 }
 
diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h
index d4437c9..d22ad26 100644
--- a/libavcodec/dv_profile.h
+++ b/libavcodec/dv_profile.h
@@ -83,4 +83,10 @@ const AVDVProfile *av_dv_frame_profile(const AVDVProfile 
*sys,
  */
 const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
AVPixelFormat pix_fmt);
 
+/**
+ * Get a DV profile for the provided stream parameters.
+ * The frame rate is used as a best-effort parameter.
+ */
+const AVDVProfile *av_dv_codec_profile2(int width, int height, enum 
AVPixelFormat pix_fmt, AVRational frame_rate);
+
 #endif /* AVCODEC_DV_PROFILE_H */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 23443ed..ef439d6 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
 #include libavutil/version.h
 
 #define LIBAVCODEC_VERSION_MAJOR 56
-#define LIBAVCODEC_VERSION_MINOR  13
+#define LIBAVCODEC_VERSION_MINOR  14
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH 2/2] replaced av_dv_codec_profile by av_dv_codec_profile2 in encoder and dv muxers

2014-12-03 Thread Steve Jiekak

Signed-off-by: Steve Jiekak devaure...@gmail.com
---
 libavcodec/dvenc.c |2 +-
 libavformat/dv.c   |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dvenc.c b/libavcodec/dvenc.c
index 5d810e3..7061508 100644
--- a/libavcodec/dvenc.c
+++ b/libavcodec/dvenc.c
@@ -47,7 +47,7 @@ static av_cold int dvvideo_encode_init(AVCodecContext *avctx)
 PixblockDSPContext pdsp;
 int ret;
 
-s-sys = av_dv_codec_profile(avctx-width, avctx-height, avctx-pix_fmt);
+s-sys = av_dv_codec_profile2(avctx-width, avctx-height, avctx-pix_fmt, 
avctx-time_base);
 if (!s-sys) {
 av_log(avctx, AV_LOG_ERROR, Found no DV profile for %ix%i %s video. 
 Valid DV profiles are:\n,
diff --git a/libavformat/dv.c b/libavformat/dv.c
index 095966c..4b8593d 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -422,8 +422,8 @@ static int64_t dv_frame_offset(AVFormatContext *s, 
DVDemuxContext *c,
int64_t timestamp, int flags)
 {
 // FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
-const AVDVProfile *sys = av_dv_codec_profile(c-vst-codec-width, 
c-vst-codec-height,
- c-vst-codec-pix_fmt);
+const AVDVProfile *sys = av_dv_codec_profile2(c-vst-codec-width, 
c-vst-codec-height,
+ c-vst-codec-pix_fmt, 
c-vst-codec-time_base);
 int64_t offset;
 int64_t size   = avio_size(s-pb) - s-data_offset;
 int64_t max_offset = ((size - 1) / sys-frame_size) * sys-frame_size;
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] dv codec : allow selecting between 720p60 and 720p50 profiles based on framerate

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 03:41:55PM +0100, aureshy lapoiss wrote:
 
  is av_div_q() what you meant to use or av_cmp_q() ?
 
 
 I use av_div_q to allow both frame rates 25/1 and 50/1 to select the same
 profile.
 
 you cannot change public API, you can add new public API if needed
  though
 
 
 I forgot that. Should I use av_dv_codec_profile2 for the new name?

yes, thats a possibility

[...]
-- 
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 for device list error in decklink_common.cpp

2014-12-03 Thread Ramiro Polla


On 03.12.2014 16:44, Jon bae wrote:

Ok finally... Here now only the first line changed. Sorry for the mess, I
'm not the right person for that.



From 2cddda59076b2ac5a539f7016c0aa1883d37c6d8 Mon Sep 17 00:00:00 2001
From: Jonathan Baecker jonba...@gmail.com
Date: Wed, 3 Dec 2014 16:41:41 +0100
Subject: [PATCH] fix COM initialization failed

Signed-off-by: Jonathan Baecker jonba...@gmail.com
---
 libavdevice/decklink_common.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 6899bd2..07e1651 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -42,7 +42,7 @@ IDeckLinkIterator *CreateDeckLinkIteratorInstance(void)
 {
 IDeckLinkIterator *iter;

-if (CoInitialize(NULL) != S_OK) {
+if (CoInitialize(NULL)  0) {
 av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
 return NULL;
 }


LGTM. Thanks for submitting the patches!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] avcodec/pngdec: use memcpy instead of byte loops for P frames.

2014-12-03 Thread Benoit Fouet

Hi,

Le 03/12/2014 14:51, Christophe Gisquet a écrit :

Hi,

2014-12-03 14:16 GMT+01:00 Benoit Fouet benoit.fo...@free.fr:

Rely on the way memcpy is optimized for one's system instead of looping
on a byte buffer for buffer copies to handle P frames.

Are there many compilers left that actually perform a call here
instead of inlining code? Some people will smugly call that ricing,
but it would be interesting to bench this for small and large images.
As you mention P frames, that might be smaller widths here, where
the overhead of checking the various aligments etc in a C lib memcpy
is larger.



When the overhead here is high, then it means that we are going to 
perform a lot on the frame itself, looping using byte buffers.
I believe this is a good compromise (and also I had up to 20% better 
performances on the APNG samples I have).


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


Re: [FFmpeg-devel] [PATCH 1/2] add av_dv_codec_profile2 : uses framerate to select best matching profile. default on first matching profile

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 05:10:16PM +0100, Steve Jiekak wrote:
 Signed-off-by: Steve Jiekak devaure...@gmail.com
 ---
  doc/APIchanges  |3 +++
  libavcodec/dv_profile.c |   27 +++
  libavcodec/dv_profile.h |6 ++
  libavcodec/version.h|2 +-
  4 files changed, 33 insertions(+), 5 deletions(-)
 
 diff --git a/doc/APIchanges b/doc/APIchanges
 index 5915ad3..a81c3b9 100644
 --- a/doc/APIchanges
 +++ b/doc/APIchanges
 @@ -15,6 +15,9 @@ libavutil: 2014-08-09
  
  API changes, most recent first:
  
 +2014-12-03 - xxx - lavc 56.14.100 - dv_profile.h
 +  Add av_dv_codec_profile2().
 +
  2014-11-21 - xxx - lavu 54.15.100 - dict.h
 Add av_dict_get_string().
  
 diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c
 index b301cbf..362afe4 100644
 --- a/libavcodec/dv_profile.c
 +++ b/libavcodec/dv_profile.c
 @@ -311,19 +311,38 @@ const AVDVProfile *av_dv_frame_profile(const 
 AVDVProfile *sys,
  return ff_dv_frame_profile(NULL, sys, frame, buf_size);
  }
  
 -const AVDVProfile *av_dv_codec_profile(int width, int height,
 -   enum AVPixelFormat pix_fmt)
 +const AVDVProfile *av_dv_codec_profile(int width, int height, enum 
 AVPixelFormat pix_fmt)
  {
  #if CONFIG_DVPROFILE
 +return av_dv_codec_profile2(width, height, pix_fmt, (AVRational){0, 0});
 +#endif
 +
 +return NULL;
 +}
 +
 +const AVDVProfile *av_dv_codec_profile2(int width, int height,
 +   enum AVPixelFormat pix_fmt,
 +   AVRational frame_rate)
 +{
 +const AVDVProfile *p = NULL;
 +#if CONFIG_DVPROFILE
  int i;
 +/* frame rate is necessary to select between 720p50 and 720p60 profiles 
 */
 +int invalid_framerate = frame_rate.num == 0 || frame_rate.den == 0;
  
  for (i = 0; i  FF_ARRAY_ELEMS(dv_profiles); i++)
  if (height  == dv_profiles[i].height  
  pix_fmt == dv_profiles[i].pix_fmt 
  width   == dv_profiles[i].width)
 -return dv_profiles[i];
 +{

 +if( !invalid_framerate || av_div_q(dv_profiles[i].time_base, 
 frame_rate).num == 1 )
 +return dv_profiles[i];

this looks wrong

if valid frame_rate or check frame_rate

a check on the framerate should be done if its valid not if its
invalid

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

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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


Re: [FFmpeg-devel] [PATCH]Fix standalone compilation of the iec61883 input device.

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 03:37:13PM +0100, Carl Eugen Hoyos wrote:
 Hi!
 
 Attached patch fixes standalone compilation of the iec61883 input device.
 
 Please comment, Carl Eugen

probably ok

[...]

-- 
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


Re: [FFmpeg-devel] Patch for device list error in decklink_common.cpp

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 06:29:37PM +0100, Ramiro Polla wrote:
 
 On 03.12.2014 16:44, Jon bae wrote:
 Ok finally... Here now only the first line changed. Sorry for the mess, I
 'm not the right person for that.
 
 From 2cddda59076b2ac5a539f7016c0aa1883d37c6d8 Mon Sep 17 00:00:00 2001
 From: Jonathan Baecker jonba...@gmail.com
 Date: Wed, 3 Dec 2014 16:41:41 +0100
 Subject: [PATCH] fix COM initialization failed
 
 Signed-off-by: Jonathan Baecker jonba...@gmail.com
 ---
  libavdevice/decklink_common.cpp | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/libavdevice/decklink_common.cpp 
 b/libavdevice/decklink_common.cpp
 index 6899bd2..07e1651 100644
 --- a/libavdevice/decklink_common.cpp
 +++ b/libavdevice/decklink_common.cpp
 @@ -42,7 +42,7 @@ IDeckLinkIterator *CreateDeckLinkIteratorInstance(void)
  {
  IDeckLinkIterator *iter;
 
 -if (CoInitialize(NULL) != S_OK) {
 +if (CoInitialize(NULL)  0) {
  av_log(NULL, AV_LOG_ERROR, COM initialization failed.\n);
  return NULL;
  }
 
 LGTM. Thanks for submitting the patches!

applied

thanks

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

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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


Re: [FFmpeg-devel] [PATCH 4/4] avcodec/pngdec: use memcpy instead of byte loops for P frames.

2014-12-03 Thread Benoit Fouet
Hi,

On December 3, 2014 6:39:12 PM GMT+01:00, Christophe Gisquet 
christophe.gisq...@gmail.com wrote:
Hi,

2014-12-03 18:32 GMT+01:00 Benoit Fouet benoit.fo...@free.fr:
 When the overhead here is high, then it means that we are going to
perform a
 lot on the frame itself, looping using byte buffers.
 I believe this is a good compromise (and also I had up to 20% better
 performances on the APNG samples I have).

I have just benchmarked on a few animated pngs, and it's
systematically much better here.


Cool, and also thanks for testing this!

-- 
Ben


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


Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-03 Thread Anshul
On 12/03/2014 10:19 PM, Clément Bœsch wrote:
 unless i'm mistaken, i think you just want:
 return av_popcount(val  0x7f)  1;


Thanks I was searching for this, even I asked for same on Irc.

Nicolas: The changes from your pair of patch,
1) I removed c708 part (whole) since both are same, 708 just have some
extra feature then 608.
In your first patch it was just registering c708, and I have not
used that patch.

2) you used i as the index of subcc, but I have used stream_idx
your code was lavfi-sink_stream_subcc_map[i] = !!use_subcc; 
I changed it to
 lavfi-sink_stream_subcc_map[stream_idx] = !!use_subcc; 

There were one more changes but that was  to get your patch in mainstream
like av_malloc_array instead av_malloc.


I have considered all your comments, but it would be better to check again.

I have also tested with valgrind, its report is good.

I have attached both patch here.

  -Anshul
From 09a199afa72eeb7b8be8527da7239f4abcc52dbe Mon Sep 17 00:00:00 2001
From: Nicolas George geo...@nsup.org
Date: Tue, 28 Oct 2014 14:41:15 +0530
Subject: [PATCH 1/2] allow to extract subcc

---
 doc/indevs.texi |  9 ++
 libavdevice/lavfi.c | 80 +
 2 files changed, 84 insertions(+), 5 deletions(-)

diff --git a/doc/indevs.texi b/doc/indevs.texi
index 5d2a308..f31e2e3 100644
--- a/doc/indevs.texi
+++ b/doc/indevs.texi
@@ -494,6 +494,9 @@ number starting from 0 corresponding to the mapped input stream
 generated by the device.
 The first unlabelled output is automatically assigned to the out0
 label, but all the others need to be specified explicitly.
+The suffix +subcc can be appended to the output label to create an extra
+stream with the closed captions packets attached to that output
+(experimental).
 
 If not specified defaults to the filename specified for the input
 device.
@@ -541,6 +544,12 @@ Read an audio stream and a video stream and play it back with
 ffplay -f lavfi movie=test.avi[out0];amovie=test.wav[out1]
 @end example
 
+@item
+Dump decoded frames to images and closed captions to a file (experimental):
+@example
+ffmpeg -f lavfi -i movie=test.ts[out0+subcc] -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
+@end example
+
 @end itemize
 
 @section libcdio
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
index 1398ece..bc45117 100644
--- a/libavdevice/lavfi.c
+++ b/libavdevice/lavfi.c
@@ -51,7 +51,10 @@ typedef struct {
 int *sink_stream_map;
 int *sink_eof;
 int *stream_sink_map;
+int *sink_stream_subcc_map;
 AVFrame *decoded_frame;
+int nb_sinks;
+AVPacket subcc_packet;
 } LavfiContext;
 
 static int *create_all_formats(int n)
@@ -82,6 +85,7 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
 av_freep(lavfi-sink_stream_map);
 av_freep(lavfi-sink_eof);
 av_freep(lavfi-stream_sink_map);
+av_freep(lavfi-sink_stream_subcc_map);
 av_freep(lavfi-sinks);
 avfilter_graph_free(lavfi-graph);
 av_frame_free(lavfi-decoded_frame);
@@ -89,6 +93,27 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
 return 0;
 }
 
+static int create_subcc_streams(AVFormatContext *avctx)
+{
+LavfiContext *lavfi = avctx-priv_data;
+AVStream *st;
+int stream_idx, sink_idx;
+
+for (stream_idx = 0; stream_idx  lavfi-nb_sinks; stream_idx++) {
+sink_idx = lavfi-stream_sink_map[stream_idx];
+if (lavfi-sink_stream_subcc_map[sink_idx]) {
+lavfi-sink_stream_subcc_map[sink_idx] = avctx-nb_streams;
+if (!(st = avformat_new_stream(avctx, NULL)))
+return AVERROR(ENOMEM);
+st-codec-codec_id = AV_CODEC_ID_EIA_608;
+st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
+} else {
+lavfi-sink_stream_subcc_map[sink_idx] = -1;
+}
+}
+return 0;
+}
+
 av_cold static int lavfi_read_header(AVFormatContext *avctx)
 {
 LavfiContext *lavfi = avctx-priv_data;
@@ -153,6 +178,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 
 /* count the outputs */
 for (n = 0, inout = output_links; inout; n++, inout = inout-next);
+lavfi-nb_sinks = n;
 
 if (!(lavfi-sink_stream_map = av_malloc(sizeof(int) * n)))
 FAIL(AVERROR(ENOMEM));
@@ -160,6 +186,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 FAIL(AVERROR(ENOMEM));
 if (!(lavfi-stream_sink_map = av_malloc(sizeof(int) * n)))
 FAIL(AVERROR(ENOMEM));
+if (!(lavfi-sink_stream_subcc_map = av_malloc(sizeof(int) * n)))
+FAIL(AVERROR(ENOMEM));
 
 for (i = 0; i  n; i++)
 lavfi-stream_sink_map[i] = -1;
@@ -167,10 +195,10 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
 /* parse the output link names - they need to be of the form out0, out1, ...
  * create a mapping between them and the streams */
 for (i = 0, inout = output_links; inout; i++, inout = inout-next) {
-int stream_idx;
+int stream_idx, 

Re: [FFmpeg-devel] [PATCH] web/legal: move Legal Threats to bottom of page

2014-12-03 Thread Lou Logan
On Wed, 3 Dec 2014 12:22:41 +0100, Michael Niedermayer wrote:

 LGTM

Pushed. Thanks to you and Timothy for taking a look.

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


Re: [FFmpeg-devel] [PATCH 1/2] allow to extract subcc

2014-12-03 Thread Anshul
On 12/04/2014 12:36 AM, wm4 wrote:
 On Wed,  3 Dec 2014 17:58:57 +0530
 anshul.ffm...@gmail.com wrote:

 From: Nicolas George geo...@nsup.org

 ---
  doc/indevs.texi |  9 ++
  libavdevice/lavfi.c | 80 
 +
  2 files changed, 84 insertions(+), 5 deletions(-)

 diff --git a/doc/indevs.texi b/doc/indevs.texi
 index 5d2a308..f31e2e3 100644
 --- a/doc/indevs.texi
 +++ b/doc/indevs.texi
 @@ -494,6 +494,9 @@ number starting from 0 corresponding to the mapped input 
 stream
  generated by the device.
  The first unlabelled output is automatically assigned to the out0
  label, but all the others need to be specified explicitly.
 +The suffix +subcc can be appended to the output label to create an extra
 +stream with the closed captions packets attached to that output
 +(experimental).
  
  If not specified defaults to the filename specified for the input
  device.
 @@ -541,6 +544,12 @@ Read an audio stream and a video stream and play it 
 back with
  ffplay -f lavfi movie=test.avi[out0];amovie=test.wav[out1]
  @end example
  
 +@item
 +Dump decoded frames to images and closed captions to a file (experimental):
 +@example
 +ffmpeg -f lavfi -i movie=test.ts[out0+subcc] -map v frame%08d.png -map s 
 -c copy -f rawvideo subcc.bin
 +@end example
 +
  @end itemize
  
  @section libcdio
 diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c
 index 1398ece..bc45117 100644
 --- a/libavdevice/lavfi.c
 +++ b/libavdevice/lavfi.c
 @@ -51,7 +51,10 @@ typedef struct {
  int *sink_stream_map;
  int *sink_eof;
  int *stream_sink_map;
 +int *sink_stream_subcc_map;
  AVFrame *decoded_frame;
 +int nb_sinks;
 +AVPacket subcc_packet;
  } LavfiContext;
  
  static int *create_all_formats(int n)
 @@ -82,6 +85,7 @@ av_cold static int lavfi_read_close(AVFormatContext *avctx)
  av_freep(lavfi-sink_stream_map);
  av_freep(lavfi-sink_eof);
  av_freep(lavfi-stream_sink_map);
 +av_freep(lavfi-sink_stream_subcc_map);
  av_freep(lavfi-sinks);
  avfilter_graph_free(lavfi-graph);
  av_frame_free(lavfi-decoded_frame);
 @@ -89,6 +93,27 @@ av_cold static int lavfi_read_close(AVFormatContext 
 *avctx)
  return 0;
  }
  
 +static int create_subcc_streams(AVFormatContext *avctx)
 +{
 +LavfiContext *lavfi = avctx-priv_data;
 +AVStream *st;
 +int stream_idx, sink_idx;
 +
 +for (stream_idx = 0; stream_idx  lavfi-nb_sinks; stream_idx++) {
 +sink_idx = lavfi-stream_sink_map[stream_idx];
 +if (lavfi-sink_stream_subcc_map[sink_idx]) {
 +lavfi-sink_stream_subcc_map[sink_idx] = avctx-nb_streams;
 +if (!(st = avformat_new_stream(avctx, NULL)))
 +return AVERROR(ENOMEM);
 +st-codec-codec_id = AV_CODEC_ID_EIA_608;
 +st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE;
 +} else {
 +lavfi-sink_stream_subcc_map[sink_idx] = -1;
 +}
 +}
 +return 0;
 +}
 +
  av_cold static int lavfi_read_header(AVFormatContext *avctx)
  {
  LavfiContext *lavfi = avctx-priv_data;
 @@ -153,6 +178,7 @@ av_cold static int lavfi_read_header(AVFormatContext 
 *avctx)
  
  /* count the outputs */
  for (n = 0, inout = output_links; inout; n++, inout = inout-next);
 +lavfi-nb_sinks = n;
  
  if (!(lavfi-sink_stream_map = av_malloc(sizeof(int) * n)))
  FAIL(AVERROR(ENOMEM));
 @@ -160,6 +186,8 @@ av_cold static int lavfi_read_header(AVFormatContext 
 *avctx)
  FAIL(AVERROR(ENOMEM));
  if (!(lavfi-stream_sink_map = av_malloc(sizeof(int) * n)))
  FAIL(AVERROR(ENOMEM));
 +if (!(lavfi-sink_stream_subcc_map = av_malloc(sizeof(int) * n)))
 +FAIL(AVERROR(ENOMEM));
  
  for (i = 0; i  n; i++)
  lavfi-stream_sink_map[i] = -1;
 @@ -167,10 +195,10 @@ av_cold static int lavfi_read_header(AVFormatContext 
 *avctx)
  /* parse the output link names - they need to be of the form out0, 
 out1, ...
   * create a mapping between them and the streams */
  for (i = 0, inout = output_links; inout; i++, inout = inout-next) {
 -int stream_idx;
 +int stream_idx, use_subcc = 0;
  if (!strcmp(inout-name, out))
  stream_idx = 0;
 -else if (sscanf(inout-name, out%d\n, stream_idx) != 1) {
 +else if (sscanf(inout-name, out%d+subcc%n\n, stream_idx, 
 use_subcc) != 1) {
  av_log(avctx,  AV_LOG_ERROR,
 Invalid outpad name '%s'\n, inout-name);
  FAIL(AVERROR(EINVAL));
 @@ -192,6 +220,7 @@ av_cold static int lavfi_read_header(AVFormatContext 
 *avctx)
  }
  lavfi-sink_stream_map[i] = stream_idx;
  lavfi-stream_sink_map[stream_idx] = i;
 +lavfi-sink_stream_subcc_map[stream_idx] = !!use_subcc;
  }
  
  /* for each open output create a corresponding stream */
 @@ -203,7 +232,7 @@ av_cold static int lavfi_read_header(AVFormatContext 
 *avctx)
  }
  
  /* create a sink for each 

Re: [FFmpeg-devel] [PATCH 2/2] Adding closed caption decoder

2014-12-03 Thread Nicolas George
Le tridi 13 frimaire, an CCXXIII, Anshul a écrit :
 Thanks I was searching for this, even I asked for same on Irc.
 
 Nicolas: The changes from your pair of patch,
 1) I removed c708 part (whole) since both are same, 708 just have some
 extra feature then 608.
 In your first patch it was just registering c708, and I have not
 used that patch.

Ok, but is it correct? I mean: if the video that is being decoded contains
c708 with the extra features used, then the output will not be valid 608,
right? Or am I just writing nonsense?

 2) you used i as the index of subcc, but I have used stream_idx
 your code was lavfi-sink_stream_subcc_map[i] = !!use_subcc; 
 I changed it to
  lavfi-sink_stream_subcc_map[stream_idx] = !!use_subcc; 

That looks suspicious. Can you explain your change? Did you test it with
filter graphs that contains several sinks?

 There were one more changes but that was  to get your patch in mainstream
 like av_malloc_array instead av_malloc.

Ok, seen it, this one looks good.

 I have considered all your comments, but it would be better to check again.

Will do, of course. But very busy week ahead. Just a few words below:


 From 09a199afa72eeb7b8be8527da7239f4abcc52dbe Mon Sep 17 00:00:00 2001
 From: Nicolas George geo...@nsup.org
 Date: Tue, 28 Oct 2014 14:41:15 +0530

 Subject: [PATCH 1/2] allow to extract subcc

The commit message was prefixed with lavd/lavdi:. You should use git am
to apply patches including commit message and such.

 --- a/doc/indevs.texi
 +++ b/doc/indevs.texi
 @@ -494,6 +494,9 @@ number starting from 0 corresponding to the mapped input 
 stream
  generated by the device.
  The first unlabelled output is automatically assigned to the out0
  label, but all the others need to be specified explicitly.

 +The suffix +subcc can be appended to the output label to create an extra
 +stream with the closed captions packets attached to that output
 +(experimental).

I have a local change adding ; only for CEA-708 for now after
experimental.

  
  if (!strcmp(inout-name, out))
  stream_idx = 0;
 -else if (sscanf(inout-name, out%d\n, stream_idx) != 1) {
 +else if (sscanf(inout-name, out%d+subcc%n\n, stream_idx, 
 use_subcc) != 1) {
  av_log(avctx,  AV_LOG_ERROR,
 Invalid outpad name '%s'\n, inout-name);

Stefano requested a stricter parsing here, and I have it in my tree.

I would do a quick git send-email, except I am pretty sure I messed up the
rebase.

I will be in touch when I can. Thanks for advancing this.

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 2/2] Adding closed caption decoder

2014-12-03 Thread Anshul
On 12/04/2014 02:33 AM, Nicolas George wrote:
 Le tridi 13 frimaire, an CCXXIII, Anshul a écrit :
 Thanks I was searching for this, even I asked for same on Irc.

 Nicolas: The changes from your pair of patch,
 1) I removed c708 part (whole) since both are same, 708 just have some
 extra feature then 608.
 In your first patch it was just registering c708, and I have not
 used that patch.
 Ok, but is it correct? I mean: if the video that is being decoded contains
 c708 with the extra features used, then the output will not be valid 608,
 right? Or am I just writing nonsense?
It would be valid, c708 is backward compatible as far as
I have seen while working with ccextractor.
C708 is made in such a way that people dont have to throw there older TV
sets or device.
if any decoder is not able to decode c708 part, even then they can get
correct subtitle.
 2) you used i as the index of subcc, but I have used stream_idx
 your code was lavfi-sink_stream_subcc_map[i] = !!use_subcc; 
 I changed it to
  lavfi-sink_stream_subcc_map[stream_idx] = !!use_subcc; 
 That looks suspicious. Can you explain your change? Did you test it with
 filter graphs that contains several sinks?
Yes while doing that only I realized,  if we use i then cc must be in
first stream.
When I had multiple stream(with audio), then I was not able to map subcc
to my video stream.
using stream_idx , we are saying that if we can use  out0+subcc and
out1+subcc.
i logic fails when there is audio in 1st stream, there was no way i 
could get the subtitle
if my first stream is not the one where closed caption are present.

 There were one more changes but that was  to get your patch in mainstream
 like av_malloc_array instead av_malloc.
 Ok, seen it, this one looks good.

 I have considered all your comments, but it would be better to check again.
 Will do, of course. But very busy week ahead. Just a few words below:


 From 09a199afa72eeb7b8be8527da7239f4abcc52dbe Mon Sep 17 00:00:00 2001
 From: Nicolas George geo...@nsup.org
 Date: Tue, 28 Oct 2014 14:41:15 +0530
 Subject: [PATCH 1/2] allow to extract subcc
 The commit message was prefixed with lavd/lavdi:. You should use git am
 to apply patches including commit message and such.
sorry for that
 --- a/doc/indevs.texi
 +++ b/doc/indevs.texi
 @@ -494,6 +494,9 @@ number starting from 0 corresponding to the mapped input 
 stream
  generated by the device.
  The first unlabelled output is automatically assigned to the out0
  label, but all the others need to be specified explicitly.
 +The suffix +subcc can be appended to the output label to create an extra
 +stream with the closed captions packets attached to that output
 +(experimental).
 I have a local change adding ; only for CEA-708 for now after
 experimental.

  
  if (!strcmp(inout-name, out))
  stream_idx = 0;
 -else if (sscanf(inout-name, out%d\n, stream_idx) != 1) {
 +else if (sscanf(inout-name, out%d+subcc%n\n, stream_idx, 
 use_subcc) != 1) {
  av_log(avctx,  AV_LOG_ERROR,
 Invalid outpad name '%s'\n, inout-name);
 Stefano requested a stricter parsing here, and I have it in my tree.

 I would do a quick git send-email, except I am pretty sure I messed up the
 rebase.

 I will be in touch when I can. Thanks for advancing this.

 Regards,



 ___
 ffmpeg-devel mailing list
 ffmpeg-devel@ffmpeg.org
 http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
thanks for looking.
-Anshul
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] h264_i386: Optimize decode_significance_8x8_x86 for 64 bit.

2014-12-03 Thread Reimar Döffinger
On Wed, Dec 03, 2014 at 01:19:48PM +0100, Michael Niedermayer wrote:
 On Wed, Dec 03, 2014 at 09:00:39AM +0100, Reimar Döffinger wrote:
  On 03.12.2014, at 01:40, Michael Niedermayer michae...@gmx.at wrote:
   On Sat, Nov 22, 2014 at 02:09:01PM +0100, Reimar Döffinger wrote:
   On Mon, Nov 17, 2014 at 01:41:13PM +0100, Michael Niedermayer wrote:
   On Mon, Nov 17, 2014 at 08:19:32AM +0100, Reimar Döffinger wrote:
   On 17.11.2014, at 02:37, Michael Niedermayer michae...@gmx.at wrote:
   On Sat, Nov 15, 2014 at 06:16:03PM +0100, Reimar Döffinger wrote:
   11674 - 10877 decicycles on my Phenom II.
   Overall speedup was unfortunately within measurement error.
   
   here its  10153 -10135
   
   I suspect it also depends a bit on the compiler and how it changes the 
   surrounding code.
   Note that I also tested with PIC actually.
   
   but ive a slightly odd feeling about the chnages to the asm code,
   iam not sure if all assemblers will be happy about the changed
   code
   
   Do you mean particularly the movzbl change?
   
   yes and the k stuff
   
   
   I am also unsure about that, I think there was a reason for that %k6 
   mess...
   But this as well as movzx seemed to work for me...
   
   it works here too i just have the feeling it might fail on some odd
   assembler or platform. Thats not meant to keep you from pushing this
   just that it might require to be reverted or fixed if such
   problems actually occor
   
   I pushed it.
   If anyone sees issues please tell me and I'll look into it!
   
   i think these fate failures are caused by it but thats based just
   on other commits in the range looking unlikely:
   
   http://fate.ffmpeg.org/report.cgi?time=20141122231657slot=x86_64-darwin-clang-3.5-O3
   http://fate.ffmpeg.org/report.cgi?time=2014113720slot=x86_64-darwin-clang-3.5
  
  That's annoying, I only expected compile errors, this looks more like a 
  compiler bug.
  Can someone run tests?
  Does just using the m instead of r constraint like on 32 bit fix it?
 
 still aborts with:

Oh dear.
On re-reading the code it seems I got a bit confused on what %0 actually
points to (I somehow thought it actually pointed to the on-stack x86_reg).
I can't test and benchmark today, but I think this one might fix it:
--- a/libavcodec/x86/h264_i386.h
+++ b/libavcodec/x86/h264_i386.h
@@ -178,7 +178,7 @@ static int decode_significance_8x8_x86(CABACContext *c,
 
 mov %2, %0 \n\t
 mov %1, %6 \n\t
-mov %6, (%0)   \n\t
+mov %k6, (%0)  \n\t
 
 test $1, %4\n\t
  jnz 5f\n\t
@@ -191,7 +191,7 @@ static int decode_significance_8x8_x86(CABACContext *c,
 cmp $63, %6\n\t
  jb 3b \n\t
 mov %2, %0 \n\t
-mov %6, (%0)   \n\t
+mov %k6, (%0)  \n\t
 5: \n\t
 addl %8, %k0   \n\t
 shr $2, %k0\n\t

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


Re: [FFmpeg-devel] [PATCH] h264_i386: Optimize decode_significance_8x8_x86 for 64 bit.

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 10:39:00PM +0100, Reimar Döffinger wrote:
 On Wed, Dec 03, 2014 at 01:19:48PM +0100, Michael Niedermayer wrote:
  On Wed, Dec 03, 2014 at 09:00:39AM +0100, Reimar Döffinger wrote:
   On 03.12.2014, at 01:40, Michael Niedermayer michae...@gmx.at wrote:
On Sat, Nov 22, 2014 at 02:09:01PM +0100, Reimar Döffinger wrote:
On Mon, Nov 17, 2014 at 01:41:13PM +0100, Michael Niedermayer wrote:
On Mon, Nov 17, 2014 at 08:19:32AM +0100, Reimar Döffinger wrote:
On 17.11.2014, at 02:37, Michael Niedermayer michae...@gmx.at 
wrote:
On Sat, Nov 15, 2014 at 06:16:03PM +0100, Reimar Döffinger wrote:
11674 - 10877 decicycles on my Phenom II.
Overall speedup was unfortunately within measurement error.

here its  10153 -10135

I suspect it also depends a bit on the compiler and how it changes 
the surrounding code.
Note that I also tested with PIC actually.

but ive a slightly odd feeling about the chnages to the asm code,
iam not sure if all assemblers will be happy about the changed
code

Do you mean particularly the movzbl change?

yes and the k stuff


I am also unsure about that, I think there was a reason for that %k6 
mess...
But this as well as movzx seemed to work for me...

it works here too i just have the feeling it might fail on some odd
assembler or platform. Thats not meant to keep you from pushing this
just that it might require to be reverted or fixed if such
problems actually occor

I pushed it.
If anyone sees issues please tell me and I'll look into it!

i think these fate failures are caused by it but thats based just
on other commits in the range looking unlikely:

http://fate.ffmpeg.org/report.cgi?time=20141122231657slot=x86_64-darwin-clang-3.5-O3
http://fate.ffmpeg.org/report.cgi?time=2014113720slot=x86_64-darwin-clang-3.5
   
   That's annoying, I only expected compile errors, this looks more like a 
   compiler bug.
   Can someone run tests?
   Does just using the m instead of r constraint like on 32 bit fix it?
  
  still aborts with:
 
 Oh dear.
 On re-reading the code it seems I got a bit confused on what %0 actually
 points to (I somehow thought it actually pointed to the on-stack x86_reg).
 I can't test and benchmark today, but I think this one might fix it:

applied

thanks

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

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


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


[FFmpeg-devel] [PATCH] imc: make issue non-fatal

2014-12-03 Thread Christophe Gisquet
Until a noticeably distorted output or crash is reported, it's better
ignoring the error, as this results in better output on the affected
samples. (ticket #3886)

On the other hand, I have a hard time understanding the purpose of
that check. I would have expected maybe get_bits_count(q-gb) 
cw_len, but the next parsing step, inverse_quant_coeff, does not even
check what's left.

-- 
Christophe
From 90b5642bd53b24f66f1c36c070b4c490dd72a6cf Mon Sep 17 00:00:00 2001
From: Christophe Gisquet christophe.gisq...@gmail.com
Date: Wed, 3 Dec 2014 23:52:52 +0100
Subject: [PATCH] imc: make issue non-fatal

The faulty samples actually sound fine when ignoring this issue.

For ticket #3886, more samples are decoded.
---
 libavcodec/imc.c | 15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/libavcodec/imc.c b/libavcodec/imc.c
index 6c9ffd7..0d7c97b 100644
--- a/libavcodec/imc.c
+++ b/libavcodec/imc.c
@@ -790,7 +790,8 @@ static int inverse_quant_coeff(IMCContext *q, IMCChannel *chctx,
 }
 
 
-static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
+static void imc_get_coeffs(AVCodecContext *avctx,
+   IMCContext *q, IMCChannel *chctx)
 {
 int i, j, cw_len, cw;
 
@@ -803,8 +804,9 @@ static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
 cw = 0;
 
 if (get_bits_count(q-gb) + cw_len  512) {
-av_dlog(NULL, Band %i coeff %i cw_len %i\n, i, j, cw_len);
-return AVERROR_INVALIDDATA;
+av_log(avctx, AV_LOG_WARNING,
+   Potential problem on band %i, coefficient %i
+   : cw_len=%i\n, i, j, cw_len);
 }
 
 if (cw_len  (!chctx-bandFlagsBuf[i] || !chctx-skipFlags[j]))
@@ -814,7 +816,6 @@ static int imc_get_coeffs(IMCContext *q, IMCChannel *chctx)
 }
 }
 }
-return 0;
 }
 
 static void imc_refine_bit_allocation(IMCContext *q, IMCChannel *chctx)
@@ -995,11 +996,7 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
 
 memset(chctx-codewords, 0, sizeof(chctx-codewords));
 
-if (imc_get_coeffs(q, chctx)  0) {
-av_log(avctx, AV_LOG_ERROR, Read coefficients failed\n);
-chctx-decoder_reset = 1;
-return AVERROR_INVALIDDATA;
-}
+imc_get_coeffs(avctx, q, chctx);
 
 if (inverse_quant_coeff(q, chctx, stream_format_code)  0) {
 av_log(avctx, AV_LOG_ERROR, Inverse quantization of coefficients failed\n);
-- 
1.9.2.msysgit.0

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


Re: [FFmpeg-devel] [PATCH 3/3] lavc/libxvid: workaround for bug in libxvidcore

2014-12-03 Thread Lukasz Marek

On 24.11.2014 01:17, Lukasz Marek wrote:

libxvidcore calculate number of threads basing on video height.
If height is small enough it allocates 0 bytes long memory and
writes to it.
Setting thread_count to 0 uses 1 thread and skips bugged code.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/libxvid.c | 11 +++
  1 file changed, 11 insertions(+)

diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 70d52b9..efe7b8a 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -471,6 +471,17 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)
  xvid_enc_create.num_zones = 0;

  xvid_enc_create.num_threads = avctx-thread_count;
+/* workaround for a bug in libxvidcore */
+if (avctx-height  18) {
+if (avctx-thread_count  2) {
+xvid_enc_create.num_threads = 0;
+} else {
+av_log(avctx, AV_LOG_ERROR,
+   Too small height for threads  1.);
+ret = AVERROR(EINVAL);
+goto fail;
+}
+}

  xvid_enc_create.plugins = plugins;
  xvid_enc_create.num_plugins = 0;



Please comment this patch. xvid accepted fix for it.
Personally I don't care, but when configured correctly ffmpeg is using 
not allocated memory via external library.

I just don't know if keep it or just forget about it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/4] avcodec/pngdec: fix indentation in handle_row()

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 02:16:57PM +0100, Benoit Fouet wrote:
 ---
  libavcodec/pngdec.c | 12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)

applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH 1/4] libavcodec/pngdec: support 'previous' dispose operation for APNG.

2014-12-03 Thread Michael Niedermayer
On Wed, Dec 03, 2014 at 02:16:55PM +0100, Benoit Fouet wrote:
 ---
  libavcodec/pngdec.c | 72 
 +
  1 file changed, 50 insertions(+), 22 deletions(-)

applied

thanks

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

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


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/3] lavc/libxvid: workaround for bug in libxvidcore

2014-12-03 Thread Michael Niedermayer
On Thu, Dec 04, 2014 at 12:39:29AM +0100, Lukasz Marek wrote:
 On 24.11.2014 01:17, Lukasz Marek wrote:
 libxvidcore calculate number of threads basing on video height.
 If height is small enough it allocates 0 bytes long memory and
 writes to it.
 Setting thread_count to 0 uses 1 thread and skips bugged code.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/libxvid.c | 11 +++
   1 file changed, 11 insertions(+)
 
 diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
 index 70d52b9..efe7b8a 100644
 --- a/libavcodec/libxvid.c
 +++ b/libavcodec/libxvid.c
 @@ -471,6 +471,17 @@ static av_cold int xvid_encode_init(AVCodecContext 
 *avctx)
   xvid_enc_create.num_zones = 0;
 
   xvid_enc_create.num_threads = avctx-thread_count;
 +/* workaround for a bug in libxvidcore */
 +if (avctx-height  18) {
 +if (avctx-thread_count  2) {
 +xvid_enc_create.num_threads = 0;
 +} else {
 +av_log(avctx, AV_LOG_ERROR,
 +   Too small height for threads  1.);
 +ret = AVERROR(EINVAL);
 +goto fail;
 +}
 +}
 
   xvid_enc_create.plugins = plugins;
   xvid_enc_create.num_plugins = 0;
 
 
 Please comment this patch. xvid accepted fix for it.
 Personally I don't care, but when configured correctly ffmpeg is
 using not allocated memory via external library.
 I just don't know if keep it or just forget about it.

patch LGTM

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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


Re: [FFmpeg-devel] [PATCH] lavc/options: don't copy priv context when it is not AVOption object

2014-12-03 Thread Lukasz Marek

On 03.12.2014 01:28, Michael Niedermayer wrote:

On Wed, Dec 03, 2014 at 01:24:55AM +0100, Lukasz Marek wrote:

On 03.12.2014 01:15, Michael Niedermayer wrote:

On Wed, Dec 03, 2014 at 12:06:47AM +0100, Lukasz Marek wrote:

This prevents potential crash when opt API is used without a class.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/options.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 7f9fb07..42ef754 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -196,7 +196,7 @@ int avcodec_copy_context(AVCodecContext *dest, const 
AVCodecContext *src)

  dest-priv_data   = orig_priv_data;

-if (orig_priv_data)
+if (orig_priv_data  src-codec  src-codec-priv_class)
  av_opt_copy(orig_priv_data, src-priv_data);



 src-codec-priv_class --- LGTM
the src-codec check is probably ok too but is it NULL ever ?


after avcodec_alloc_context3(NULL)?
IIRC there was a patch recently that set codec in
avcodec_alloc_context3 (via avcodec_get_context_defaults3) when
provided. Maybe after that it is not so common case. But still when
allocated with NULL then you have NULL there. src context doesn't
have to be open neither.


ok


I'm sorry for doing a mess recently regarding this damn 
avcodec_copy_context function. I'm sending updated patch.

I will send in a moment patchset with test for it.
The test doesn't cover everything (it is kinda hard to test it), but it 
should cover options management.
Just to clear, I will ping in one more in a moment and don't bother with 
any other atm :)


From d8884452f3bd0af45e459c7c2b2549b7a225ed4d Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Tue, 2 Dec 2014 23:24:15 +0100
Subject: [PATCH] lavc/options: don't copy priv context when it is not AVOption
 object

This prevents potential crash when opt API is used without a class.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 libavcodec/options.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 7f9fb07..49c8b40 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -195,11 +195,12 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
 av_opt_copy(dest, src);
 
 dest-priv_data   = orig_priv_data;
+dest-codec   = orig_codec;
 
-if (orig_priv_data)
+if (orig_priv_data  src-codec  src-codec-priv_class 
+dest-codec  dest-codec-priv_class)
 av_opt_copy(orig_priv_data, src-priv_data);
 
-dest-codec   = orig_codec;
 
 /* set values specific to opened codecs back to their default state */
 dest-slice_offset= NULL;
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 1/2] lavc/options: add test for avcodec_copy_context

2014-12-03 Thread Lukasz Marek
This test doesn't cover every possible issue with this function.
It covers options management only.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 libavcodec/Makefile  |   2 +
 libavcodec/options.c | 173 +++
 2 files changed, 175 insertions(+)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fa0f53d..48c3a85 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -858,6 +858,8 @@ SKIPHEADERS-$(CONFIG_VDA)  += vda.h 
vda_internal.h
 SKIPHEADERS-$(CONFIG_VDPAU)+= vdpau.h vdpau_internal.h
 
 TESTPROGS = imgconvert  \
+options \
+
 
 TESTPROGS-$(CONFIG_CABAC) += cabac
 TESTPROGS-$(CONFIG_FFT)   += fft fft-fixed fft-fixed32
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 49c8b40..4148752 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -303,3 +303,176 @@ const AVClass *avcodec_get_subtitle_rect_class(void)
 {
 return av_subtitle_rect_class;
 }
+
+#define TEST
+#ifdef TEST
+
+static int dummy_init(AVCodecContext *ctx)
+{
+//TODO: this code should set every possible pointer that could be set by 
codec and is not an option;
+ctx-extradata_size = 8;
+ctx-extradata = av_malloc(ctx-extradata_size);
+ctx-coded_frame = av_frame_alloc();
+return 0;
+}
+
+static int dummy_close(AVCodecContext *ctx)
+{
+av_freep(ctx-extradata);
+ctx-extradata_size = 0;
+av_frame_free(ctx-coded_frame);
+return 0;
+}
+
+static int dummy_encode(AVCodecContext *ctx, AVPacket *pkt, const AVFrame 
*frame, int *got_packet)
+{
+return AVERROR(ENOSYS);
+}
+
+typedef struct Dummy12Context {
+AVClass  *av_class;
+int  num;
+char*str;
+} Dummy12Context;
+
+typedef struct Dummy3Context {
+void *fake_av_class;
+int  num;
+char*str;
+} Dummy3Context;
+
+#define OFFSET(x) offsetof(Dummy12Context, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption dummy_options[] = {
+{ str, set str, OFFSET(str), AV_OPT_TYPE_STRING, { .str = i'm src 
default value }, 0, 0, VE},
+{ num, set num, OFFSET(num), AV_OPT_TYPE_INT,{ .i64 = 1500100900 
},0, INT_MAX, VE},
+{ NULL },
+};
+
+static const AVClass dummy_v1_class = {
+.class_name = dummy_v1_class,
+.item_name  = av_default_item_name,
+.option = dummy_options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
+static const AVClass dummy_v2_class = {
+.class_name = dummy_v2_class,
+.item_name  = av_default_item_name,
+.option = dummy_options,
+.version= LIBAVUTIL_VERSION_INT,
+};
+
+/* codec with options */
+AVCodec dummy_v1_encoder = {
+.name = dummy_v1_codec,
+.type = AVMEDIA_TYPE_VIDEO,
+.id   = AV_CODEC_ID_NONE - 1,
+.encode2  = dummy_encode,
+.init = dummy_init,
+.close= dummy_close,
+.priv_class   = dummy_v1_class,
+.priv_data_size   = sizeof(Dummy12Context),
+};
+
+/* codec with options, different class */
+AVCodec dummy_v2_encoder = {
+.name = dummy_v2_codec,
+.type = AVMEDIA_TYPE_VIDEO,
+.id   = AV_CODEC_ID_NONE - 2,
+.encode2  = dummy_encode,
+.init = dummy_init,
+.close= dummy_close,
+.priv_class   = dummy_v2_class,
+.priv_data_size   = sizeof(Dummy12Context),
+};
+
+/* codec with priv data, but no class */
+AVCodec dummy_v3_encoder = {
+.name = dummy_v3_codec,
+.type = AVMEDIA_TYPE_VIDEO,
+.id   = AV_CODEC_ID_NONE - 3,
+.encode2  = dummy_encode,
+.init = dummy_init,
+.close= dummy_close,
+.priv_data_size   = sizeof(Dummy3Context),
+};
+
+/* codec without priv data */
+AVCodec dummy_v4_encoder = {
+.name = dummy_v4_codec,
+.type = AVMEDIA_TYPE_VIDEO,
+.id   = AV_CODEC_ID_NONE - 4,
+.encode2  = dummy_encode,
+.init = dummy_init,
+.close= dummy_close,
+};
+
+static void test_copy_print_codec(const AVCodecContext *ctx)
+{
+printf(%-14s: %dx%d prv: %s,
+   ctx-codec ? ctx-codec-name : NULL,
+   ctx-width, ctx-height,
+   ctx-priv_data ? set  : null);
+if (ctx-codec  ctx-codec-priv_class  ctx-codec-priv_data_size) {
+int64_t i64;
+char *str = NULL;
+av_opt_get_int(ctx-priv_data, num, 0, i64);
+av_opt_get(ctx-priv_data, str, 0, (uint8_t**)str);
+printf( opts: %PRId64 %s, i64, str);
+av_free(str);
+}
+printf(\n);
+}
+
+static void test_copy(const AVCodec *c1, const AVCodec *c2)
+{
+AVCodecContext *ctx1, *ctx2;
+printf(%s - %s\nclosed:\n, c1 ? c1-name : NULL, c2 ? c2-name : 
NULL);

Re: [FFmpeg-devel] [PATCH 2/2] lavc/options: fix leaks in avcodec_copy_context

2014-12-03 Thread Lukasz Marek

On 27.11.2014 04:17, Michael Niedermayer wrote:

On Thu, Nov 27, 2014 at 12:43:57AM +0100, Lukasz Marek wrote:

On 24.11.2014 05:16, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/options.c | 23 +++
  1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 7f9fb07..8ba997c 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const 
AVCodecContext *src)
  }

  av_opt_free(dest);
+av_freep(dest-rc_override);
+av_freep(dest-intra_matrix);
+av_freep(dest-inter_matrix);
+av_freep(dest-extradata);
+av_freep(dest-subtitle_header);

  memcpy(dest, src, sizeof(*dest));
  av_opt_copy(dest, src);
@@ -205,13 +210,7 @@ int avcodec_copy_context(AVCodecContext *dest, const 
AVCodecContext *src)
  dest-slice_offset= NULL;
  dest-hwaccel = NULL;
  dest-internal= NULL;
-
-/* reallocate values that should be allocated separately */
-dest-extradata   = NULL;
-dest-intra_matrix= NULL;
-dest-inter_matrix= NULL;
-dest-rc_override = NULL;
-dest-subtitle_header = NULL;



This should stay. Updated version attched




  options.c |   16 +++-
  1 file changed, 11 insertions(+), 5 deletions(-)
971d1769e50d2e853d7359003f8c924092a96e6b  
0001-lavc-options-fix-leaks-in-avcodec_copy_context.patch
 From 722d7e837093212d6e6e6b17814ed408300d25a6 Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Thu, 27 Nov 2014 00:41:16 +0100
Subject: [PATCH] lavc/options: fix leaks in avcodec_copy_context

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/options.c | 16 +++-
  1 file changed, 11 insertions(+), 5 deletions(-)


breaks make fate-lavf-yuv4mpeg

--- ./tests/ref/lavf/yuv4mpeg   2014-11-26 20:04:48.466295490 +0100
+++ tests/data/fate/lavf-yuv4mpeg   2014-11-27 04:16:07.234916526 +0100
@@ -1,2 +0,0 @@
-ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m
-3801808 ./tests/data/lavf/lavf.y4m
Test lavf-yuv4mpeg failed. Look at tests/data/fate/lavf-yuv4mpeg.err for 
details.
make: *** [fate-lavf-yuv4mpeg] Error 139


I will rerun whole fate, but I assume I can push it if nothing fails?
The one mentioned above is OK.

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


Re: [FFmpeg-devel] [PATCH 1/2] lavc/options: add test for avcodec_copy_context

2014-12-03 Thread Lukasz Marek

On 04.12.2014 00:50, Lukasz Marek wrote:

This test doesn't cover every possible issue with this function.
It covers options management only.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/Makefile  |   2 +
  libavcodec/options.c | 173 +++
  2 files changed, 175 insertions(+)



bugged case on current git is
test_copy(dummy_v1_encoder, dummy_v3_encoder); as I remmember


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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add libavcodec/options-test

2014-12-03 Thread Timothy Gu
On Wed, Dec 3, 2014 at 3:50 PM, Lukasz Marek lukasz.m.lu...@gmail.com wrote:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  tests/fate/libavcodec.mak |   4 +
  tests/ref/fate/libavcodec-options | 161 
 ++
  2 files changed, 165 insertions(+)
  create mode 100644 tests/ref/fate/libavcodec-options

Did you forget to git add the test .c?

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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add libavcodec/options-test

2014-12-03 Thread Lukasz Marek

On 04.12.2014 01:01, Timothy Gu wrote:

On Wed, Dec 3, 2014 at 3:50 PM, Lukasz Marek lukasz.m.lu...@gmail.com wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  tests/fate/libavcodec.mak |   4 +
  tests/ref/fate/libavcodec-options | 161 ++
  2 files changed, 165 insertions(+)
  create mode 100644 tests/ref/fate/libavcodec-options


Did you forget to git add the test .c?


It is in a separate patch.

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


Re: [FFmpeg-devel] [PATCH 2/2] fate: add libavcodec/options-test

2014-12-03 Thread Timothy Gu
On Wed, Dec 3, 2014 at 4:05 PM, Lukasz Marek lukasz.m.lu...@gmail.com wrote:
 On 04.12.2014 01:01, Timothy Gu wrote:

 On Wed, Dec 3, 2014 at 3:50 PM, Lukasz Marek lukasz.m.lu...@gmail.com
 wrote:

 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   tests/fate/libavcodec.mak |   4 +
   tests/ref/fate/libavcodec-options | 161
 ++
   2 files changed, 165 insertions(+)
   create mode 100644 tests/ref/fate/libavcodec-options


 Did you forget to git add the test .c?


 It is in a separate patch.

Oops sorry

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


[FFmpeg-devel] [2.5] [PATCH 1/2] Changelog/RELEASE_NOTES: Add APNG decoder

2014-12-03 Thread Timothy Gu
Signed-off-by: Timothy Gu timothyg...@gmail.com
---
 Changelog | 2 +-
 RELEASE_NOTES | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 0130ca8..7187a15 100644
--- a/Changelog
+++ b/Changelog
@@ -16,7 +16,7 @@ version 2.5:
 - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
 - WebP muxer with animated WebP support
 - zygoaudio decoding support
-- APNG demuxer
+- APNG decoder and demuxer
 - postproc visualization support
 
 
diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index a1ddd35..b78efe3 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -56,6 +56,7 @@
 • libutvideo YUV 4:2:2 10bit support
 • animated WebP decoding support
 • zygoaudio decoding support
+• APNG decoder
 
┌┐
│ libavdevice│
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 1/2] RELEASE_NOTES: Reset after release

2014-12-03 Thread Timothy Gu
Signed-off-by: Timothy Gu timothyg...@gmail.com
---
 RELEASE_NOTES | 61 ++-
 1 file changed, 27 insertions(+), 34 deletions(-)

diff --git a/RELEASE_NOTES b/RELEASE_NOTES
index a1ddd35..adcab42 100644
--- a/RELEASE_NOTES
+++ b/RELEASE_NOTES
@@ -1,10 +1,13 @@
  ┌┐
- │ RELEASE NOTES for FFmpeg 2.5 Bohr│
+ │ RELEASE NOTES for FFmpeg 2.6 TODO│
  └┘
 
-   The FFmpeg Project proudly presents FFmpeg 2.5 Bohr, just 2.5 months
-   after the release of 2.4. Since this wasn't a long time ago, the Changelog
-   is a bit short this time.
+   The FFmpeg Project proudly presents FFmpeg 2.6 TODO, TODO months
+   after the release of 2.5.
+
+   XXX, YYY, and ZZZ are the most exciting features in this release. For C
+   feature users, we have also made additions in the D demuxer for better
+   support of TODO.
 
As usual, if you have any question on this release or any FFmpeg related
topic, feel free to join us on the #ffmpeg IRC channel (on
@@ -14,21 +17,21 @@
│   API Information │
└┘
 
- FFmpeg 2.5 includes the following library versions:
-
-   • libavutil  54.15.100
-   • libavcodec 56.13.100
-   • libavformat56.15.102
-   • libavdevice56. 3.100
-   • libavfilter 5. 2.103
-   • libswscale  3. 1.101
-   • libswresample   1. 1.100
-   • libpostproc53. 3.100
+ FFmpeg 2.6 is mostly backwards compatible with the 2.5 series, and
+ includes the following library versions:
 
- Important API changes since 2.4:
+   • libavutil  5x.xx.1xx
+   • libavcodec 5x.xx.1xx
+   • libavformat5x.xx.1xx
+   • libavdevice5x. x.1xx
+   • libavfilter x. x.1xx
+   • libswscale  x. x.1xx
+   • libswresample   x. x.1xx
+   • libpostproc5x. x.1xx
 
-   • avpriv_dv_frame_profile2() has been deprecated
+ Important API changes since 2.5:
 
+   • `this()` has been deprecated
 
  Please refer to the doc/APIchanges file for more information.
 
@@ -40,59 +43,49 @@
│ ffprobe│
└┘
 
-• -show_pixel_formats option
+• TODo
 
┌┐
│ ffserver   │
└┘
 
-• codec private options support
+• TODO
 
┌┐
│ libavcodec │
└┘
 
-• STL subtitle decoder
-• libutvideo YUV 4:2:2 10bit support
-• animated WebP decoding support
-• zygoaudio decoding support
+• TODO
 
┌┐
│ libavdevice│
└┘
 
-• XCB-based screen-grabber
-• AVFoundation screen capturing support
+• TODO
 
┌┐
│ libavformat│
└┘
 
-• HEVC/H.265 RTP payload format (draft v6) packetizer
-• SUP/PGS subtitle demuxer
-• STL subtitle demuxer
-• UDP-Lite support (RFC 3828)
-• creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
-• WebP muxer
-• APNG demuxer
+• TODO
 
┌┐
│ libavfilter│
└┘
 
-• xBR scaling filter
+• TODO
 
┌┐
│ libavutil  │
└┘
 
-• CAST128 symmetric block cipher, ECB mode
+• TODO
 
┌┐
│ libpostproc│
└┘
 
-• visualization support
+• TODO
 
  ┌┐
  │ ⚠  Behaviour changes   │
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 2/2] RELEASE: Bump

2014-12-03 Thread Timothy Gu
Signed-off-by: Timothy Gu timothyg...@gmail.com
---
 RELEASE | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/RELEASE b/RELEASE
index 5360d2e..5db7a1a 100644
--- a/RELEASE
+++ b/RELEASE
@@ -1 +1 @@
-2.4.git
+2.5.git
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH 1/2] RELEASE_NOTES: Reset after release

2014-12-03 Thread James Almer
On 04/12/14 1:15 AM, Timothy Gu wrote:
 Signed-off-by: Timothy Gu timothyg...@gmail.com
 ---
  RELEASE_NOTES | 61 
 ++-
  1 file changed, 27 insertions(+), 34 deletions(-)
 

I personally think this is not needed for now. It can be updated just fine 
close to release.

 diff --git a/RELEASE_NOTES b/RELEASE_NOTES
 index a1ddd35..adcab42 100644
 --- a/RELEASE_NOTES
 +++ b/RELEASE_NOTES
 @@ -1,10 +1,13 @@
   ┌┐
 - │ RELEASE NOTES for FFmpeg 2.5 Bohr│
 + │ RELEASE NOTES for FFmpeg 2.6 TODO│
   └┘
  
 -   The FFmpeg Project proudly presents FFmpeg 2.5 Bohr, just 2.5 months
 -   after the release of 2.4. Since this wasn't a long time ago, the Changelog
 -   is a bit short this time.
 +   The FFmpeg Project proudly presents FFmpeg 2.6 TODO, TODO months
 +   after the release of 2.5.
 +
 +   XXX, YYY, and ZZZ are the most exciting features in this release. For 
 C
 +   feature users, we have also made additions in the D demuxer for better
 +   support of TODO.

Sorry, but this is silly. Might as well go with lorem ipsum.
Same goes with the mostly backwards compatible comment below. Making 
assumptions like this 
in a placeholder makes no sense.

Either leave the file as is until the 2.6 release is made, or clean the file 
and leave every 
section empty (or with a single TODO), allowing people to add lines at the same 
time as they 
are added to changelog if they want to.

  
 As usual, if you have any question on this release or any FFmpeg related
 topic, feel free to join us on the #ffmpeg IRC channel (on
 @@ -14,21 +17,21 @@
 │   API Information │
 └┘
  
 - FFmpeg 2.5 includes the following library versions:
 -
 -   • libavutil  54.15.100
 -   • libavcodec 56.13.100
 -   • libavformat56.15.102
 -   • libavdevice56. 3.100
 -   • libavfilter 5. 2.103
 -   • libswscale  3. 1.101
 -   • libswresample   1. 1.100
 -   • libpostproc53. 3.100
 + FFmpeg 2.6 is mostly backwards compatible with the 2.5 series, and
 + includes the following library versions:
  
 - Important API changes since 2.4:
 +   • libavutil  5x.xx.1xx
 +   • libavcodec 5x.xx.1xx
 +   • libavformat5x.xx.1xx
 +   • libavdevice5x. x.1xx
 +   • libavfilter x. x.1xx
 +   • libswscale  x. x.1xx
 +   • libswresample   x. x.1xx
 +   • libpostproc5x. x.1xx
  
 -   • avpriv_dv_frame_profile2() has been deprecated
 + Important API changes since 2.5:
  
 +   • `this()` has been deprecated
  
   Please refer to the doc/APIchanges file for more information.
  
 @@ -40,59 +43,49 @@
 │ ffprobe│
 └┘
  
 -• -show_pixel_formats option
 +• TODo
  
 ┌┐
 │ ffserver   │
 └┘
  
 -• codec private options support
 +• TODO
  
 ┌┐
 │ libavcodec │
 └┘
  
 -• STL subtitle decoder
 -• libutvideo YUV 4:2:2 10bit support
 -• animated WebP decoding support
 -• zygoaudio decoding support
 +• TODO
  
 ┌┐
 │ libavdevice│
 └┘
  
 -• XCB-based screen-grabber
 -• AVFoundation screen capturing support
 +• TODO
  
 ┌┐
 │ libavformat│
 └┘
  
 -• HEVC/H.265 RTP payload format (draft v6) packetizer
 -• SUP/PGS subtitle demuxer
 -• STL subtitle demuxer
 -• UDP-Lite support (RFC 3828)
 -• creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
 -• WebP muxer
 -• APNG demuxer
 +• TODO
  
 ┌┐
 │ libavfilter│
 └┘
  
 -• xBR scaling filter
 +• TODO
  
 ┌┐
 │ libavutil  │
 └┘
  
 -• CAST128 symmetric block cipher, ECB mode
 +• TODO
  
 ┌┐
 │ libpostproc│
 └┘
  
 -• visualization support
 +• TODO
  
   ┌┐
   │ ⚠  Behaviour changes   │
 

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


[FFmpeg-devel] [PATCH 1/3] web/style.less: Styles for heading anchors

2014-12-03 Thread Timothy Gu
Signed-off-by: Timothy Gu timothyg...@gmail.com
---
 generate-doc.sh |  1 +
 src/less/style.less | 12 
 2 files changed, 13 insertions(+)

diff --git a/generate-doc.sh b/generate-doc.sh
index f953a9a..d8d01d3 100755
--- a/generate-doc.sh
+++ b/generate-doc.sh
@@ -30,6 +30,7 @@ export FFMPEG_HEADER1=$(cat src/template_head1)
 export FFMPEG_HEADER2=$(cat src/template_head_prod src/template_head2)
 export FFMPEG_HEADER3=$(cat src/template_head3)
 export FFMPEG_FOOTER=$(cat src/template_footer1 src/template_footer_prod 
src/template_footer2)
+export FA_ICONS=true
 
 rm -rf build-doc
 mkdir build-doc  cd build-doc
diff --git a/src/less/style.less b/src/less/style.less
index 378a972..adb6e17 100644
--- a/src/less/style.less
+++ b/src/less/style.less
@@ -84,6 +84,12 @@ main {
 margin: auto;
 }
 
+h1, h2, h3, h4, h5, h6 {
+a.anchor {
+font-size: 18px;
+}
+}
+
 h1, h2, h3, h4 {
 font-weight: bold;
 text-align: left;
@@ -94,6 +100,9 @@ h1, h2, h3 {
 strong {
 color: @Cinvert;
 }
+a.anchor {
+color: @Cmainlightlightl;
+}
 }
 
 h4, h5, h6 {
@@ -115,6 +124,9 @@ h4 {
 padding: 10px 0;
 margin: 20px 0;
 color: @Cinvert;
+a.anchor {
+color: @Cinvert;
+}
 }
 
 .list-group {
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 0/3] doc: Add separate buttons for anchors

2014-12-03 Thread Timothy Gu
Right now the links to anchors in headings are within the heading text itself.
This causes ugly green headings. This patch set separates the links into its
own buttons with nice styling.

Screenshots: http://imgur.com/kcAy5kKZUcMJG4 The first one is local
installation. Second one is http://ffmpeg.org/.

Timothy Gu (3):
  web/style.less: Styles for heading anchors
  doc: Do not use the headings as links to TOC anchors
  doc: html: Use native viewport

ffmpeg.git:
 doc/t2h.pm | 105 +++--
 1 file changed, 103 insertions(+), 2 deletions(-)

ffmpeg-web.git:
 generate-doc.sh |  1 +
 src/less/style.less | 12 
 2 files changed, 13 insertions(+)

-- 
1.9.1

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


[FFmpeg-devel] [PATCH 2/3] doc: Do not use the headings as links to TOC anchors

2014-12-03 Thread Timothy Gu
Instead, use FontAwesome icons (if configured to be this way) or separate
text.

Signed-off-by: Timothy Gu timothyg...@gmail.com
---
 doc/t2h.pm | 104 +++--
 1 file changed, 102 insertions(+), 2 deletions(-)

diff --git a/doc/t2h.pm b/doc/t2h.pm
index a927071..7f771f9 100644
--- a/doc/t2h.pm
+++ b/doc/t2h.pm
@@ -23,8 +23,108 @@
 # no navigation elements
 set_from_init_file('HEADERS', 0);
 
-# TOC and Chapter headings link
-set_from_init_file('TOC_LINKS', 1);
+sub ffmpeg_heading_command($)
+{
+my $self = shift;
+my $cmdname = shift;
+my $command = shift;
+my $args = shift;
+my $content = shift;
+
+my $result = '';
+
+# not clear that it may really happen
+if ($self-in_string) {
+$result .= $self-command_string($command) .\n if ($cmdname ne 
'node');
+$result .= $content if (defined($content));
+return $result;
+}
+
+my $element_id = $self-command_id($command);
+$result .= a name=\$element_id\/a\n
+if (defined($element_id) and $element_id ne '');
+
+print STDERR Process $command 
+.Texinfo::Structuring::_print_root_command_texi($command).\n
+if ($self-get_conf('DEBUG'));
+my $element;
+if ($Texinfo::Common::root_commands{$command-{'cmdname'}}
+and $command-{'parent'}
+and $command-{'parent'}-{'type'}
+and $command-{'parent'}-{'type'} eq 'element') {
+$element = $command-{'parent'};
+}
+if ($element) {
+$result .= {$self-{'format_element_header'}}($self, $cmdname,
+   $command, $element);
+}
+
+my $heading_level;
+# node is used as heading if there is nothing else.
+if ($cmdname eq 'node') {
+if (!$element or (!$element-{'extra'}-{'section'}
+and $element-{'extra'}-{'node'}
+and $element-{'extra'}-{'node'} eq $command
+ # bogus node may not have been normalized
+and defined($command-{'extra'}-{'normalized'}))) {
+if ($command-{'extra'}-{'normalized'} eq 'Top') {
+$heading_level = 0;
+} else {
+$heading_level = 3;
+}
+}
+} else {
+$heading_level = $command-{'level'};
+}
+
+my $heading = $self-command_text($command);
+# $heading not defined may happen if the command is a @node, for example
+# if there is an error in the node.
+if (defined($heading) and $heading ne '' and defined($heading_level)) {
+
+if ($Texinfo::Common::root_commands{$cmdname}
+and $Texinfo::Common::sectioning_commands{$cmdname}) {
+my $content_href = $self-command_contents_href($command, 
'contents',
+
$self-{'current_filename'});
+if ($content_href) {
+my $this_href = $content_href =~ s/^\#toc-/\#/r;
+$heading .= 'span class=pull-right'.
+  'a class=anchor hidden-xs '.
+ href=\$this_href\ aria-hidden=\true\.
+($ENV{FA_ICONS} ? 'i class=fa fa-link/i'
+  : '#').
+  '/a '.
+  'a class=anchor hidden-xs'.
+ href=\$content_href\ 
aria-hidden=\true\.
+($ENV{FA_ICONS} ? 'i class=fa fa-navicon/i'
+  : 'TOC').
+  '/a'.
+'/span';
+}
+}
+
+if ($self-in_preformatted()) {
+$result .= $heading.\n;
+} else {
+# if the level was changed, set the command name right
+if ($cmdname ne 'node'
+and $heading_level ne 
$Texinfo::Common::command_structuring_level{$cmdname}) {
+$cmdname
+= 
$Texinfo::Common::level_to_structuring_command{$cmdname}-[$heading_level];
+}
+$result .= {$self-{'format_heading_text'}}(
+$self, $cmdname, $heading,
+$heading_level +
+$self-get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
+}
+}
+$result .= $content if (defined($content));
+return $result;
+}
+
+foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
+texinfo_register_command_formatting($command, \ffmpeg_heading_command);
+}
 
 # print the TOC where @contents is used
 set_from_init_file('INLINE_CONTENTS', 1);
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 3/3] doc: html: Use native viewport

2014-12-03 Thread Timothy Gu
Fixes displaying docs on small-screen devices.

Signed-off-by: Timothy Gu timothyg...@gmail.com
---
 doc/t2h.pm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/doc/t2h.pm b/doc/t2h.pm
index 7f771f9..ca77842 100644
--- a/doc/t2h.pm
+++ b/doc/t2h.pm
@@ -169,6 +169,7 @@ EOT
 
 my $head2 = $ENV{FFMPEG_HEADER2} || EOT;
 /title
+meta name=viewport content=width=device-width,initial-scale=1.0
 link rel=stylesheet type=text/css href=bootstrap.min.css
 link rel=stylesheet type=text/css href=style.min.css
   /head
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 4/4] style: Update from ffmpeg-web

2014-12-03 Thread Timothy Gu
Signed-off-by: Timothy Gu timothyg...@gmail.com
---

Forgot this one

--
 doc/style.min.css | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/style.min.css b/doc/style.min.css
index 6843fda..e146be8 100644
--- a/doc/style.min.css
+++ b/doc/style.min.css
@@ -20,4 +20,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES 
OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
- */body{background-color:#313131;color:#e6e6e6;text-align:justify}body, h1, 
h2, h3, h4, h5, h6{font-family:Lucida Grande,Lucida Sans Unicode,Lucida 
Sans,Helvetica Neue,Helvetica,Verdana,Tahoma,sans-serif}a{color:#4cae4c}a 
strong{color:#e6e6e6}a:hover{color:#7fc77f}a:hover 
strong{color:#4cae4c}main{width:100% ! 
important;min-height:600px;margin:auto}h1, h2, h3, 
h4{font-weight:bold;text-align:left}h1, h2, h3{color:#bebebe}h1 strong, h2 
strong, h3 strong{color:#e6e6e6}h4, h5, h6{color:#3c8b3c}h1{border-bottom:4px 
#bebebe solid;padding:20px 2%}h3{border-bottom:2px #bebebe solid;padding:15px 
1%}h4{border-bottom:1px solid #e6e6e6;padding:10px 0;margin:20px 
0;color:#e6e6e6}.list-group 
.list-group-item{background-color:#3e3e3e;border-color:black}.list-group.list-group-big
 .list-group-item{padding:25px}.list-group 
a.list-group-item{color:#7fc77f}.list-group 
a.list-group-item:hover{background-color:#313131;color:#4cae4c}.well{background-color:#242424;border-color:black;color:#
 bebebe}.well strong{color:#e6e6e6}.well code{background-color:#313131}.well 
hr{border-color:#3c8b3c}.well h3{margin:5px 0 15px 0;border:0;padding:0}.well 
a{color:#4cae4c}.well a.btn{color:white}.well small{display:block;padding:0 
10px;font-style:italic}.well.example{padding-top:40px;margin-bottom:130px}.well.example
 pre{margin:50px;margin-bottom:30px;font-size:1.5em}.well.example 
.btn{margin-right:50px;margin-bottom:20px}.well.well-with-icon{min-height:136px}.well.well-with-icon
 .pull-right,.well.well-with-icon 
.pull-left{background-color:#4cae4c;color:#e6e6e6;padding:10px;border-radius:5px;margin:5px}.well.well-with-icon
 .pull-right{margin-left:20px}.well.well-with-icon 
.pull-left{margin-right:20px}a.well{display:block}a.well:hover{text-decoration:none;opacity:0.8}.info,
 .warning{margin:10px;padding:10px;background-color:#3e3e3e;color:#e6e6e6}.info 
code, .warning code{background-color:#313131}.info{border-left:10px #4cae4c 
solid}.warning{border-left:10px #ae4c4c solid}.with
 -icon{padding:30px}.with-icon .pull-left{padding-right:30px}.with-icon 
.pull-right{padding-left:30px}dd{margin-left:20px}code{background-color:#242424;color:#7fc77f;display:inline-block;margin:5px}.table{margin:20px
 0;border-radius:4px}.table th,.table td,.table tr{border:1px solid 
#171717}.table tr th{background-color:#3e3e3e;border-bottom:2px solid 
#e6e6e6}.table tr:nth-child(odd){background-color:#242424}#sidebar-wrapper, 
.navbar{background-color:#171717;overflow-x:hidden}#sidebar-wrapper 
.sidebar-brand img,#sidebar-wrapper .navbar-brand img, .navbar .sidebar-brand 
img, .navbar .navbar-brand img{opacity:0.6;margin-right:8px}#sidebar-wrapper 
.sidebar-brand:hover,#sidebar-wrapper .navbar-brand:hover, .navbar 
.sidebar-brand:hover, .navbar .navbar-brand:hover{color:#fff}#sidebar-wrapper 
.sidebar-brand:hover img,#sidebar-wrapper .navbar-brand:hover img, .navbar 
.sidebar-brand:hover img, .navbar .navbar-brand:hover 
img{opacity:1}#sidebar-wrapper .sidebar-nav li ul, .navbar .sid
 ebar-nav li ul{list-style-type:none;padding:0}#sidebar-wrapper .sidebar-nav li 
ul li, .navbar .sidebar-nav li ul li{line-height:20px}#sidebar-wrapper 
.sidebar-nav li ul li a, .navbar .sidebar-nav li ul li 
a{padding-left:20px}.content-header{height:auto;background-color:#242424}.content-header
 
h1{color:#e6e6e6;display:block;margin:0;margin-bottom:20px;line-height:normal;border-bottom:none}#download
 h4, #index h4{margin-top:180px}#download h4.first, #index 
h4.first{margin-top:20px}#download h4.first small, #index h4.first 
small{color:inherit;font-size:1em}#download .btn-download-wrapper, #index 
.btn-download-wrapper{text-align:center;margin:160px auto}#download 
.btn-download-wrapper .btn, #index .btn-download-wrapper 
.btn{font-size:3em;padding:3%;display:inline-block;margin-bottom:5px}#download 
.btn-download-wrapper small, #index .btn-download-wrapper 
small{display:block;font-size:0.4em}#download h2.description, #index 
h2.description{color:#e6e6e6;font-size:2em;font-weight:bol
 d;margin:120px 50px;line-height:2em}#download h2.description .label, #index 
h2.description .label{font-size:0.5em}#download 
.btn-download-wrapper{margin:40px auto}#download 
.os-selector{text-align:center;color:#e6e6e6;margin:30px 0}#download 
.os-selector 
a.btn-build{color:#e6e6e6;display:block;padding:20px;border-radius:2px}#download
 .os-selector .btn-build[href=#build-linux]{background-color:#e43}#download 
.os-selector 

[FFmpeg-devel] Fix bug for POWER LE: avcodec/ppc/vc1dsp_altivec.c

2014-12-03 Thread rongyan
Hi,
We propose this patch to fix vc1 bugs for POWER8 little endian. Function 
vc1_inv_trans_8x4_altivec() is fixed.
The passed test cases change from  2296/2328 to 2303/2328‍.
 
‍‍
 
Thanks for your review.
Rong Yan
  
  --
  The world has enough for everyone's need, but not enough for everyone's greed.

0001-avcodec-ppc-vc1dsp_altivec-POWER-LE-support-vc1_inv_.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel