Re: [FFmpeg-devel] [PATCH] lavc/pthread_slice: release entries

2015-02-24 Thread Christophe Gisquet
Hi,

2015-02-05 16:53 GMT+01:00 Christophe Gisquet christophe.gisq...@gmail.com:
 when running fate-hevc under valgrind + memory poisoning, I ran into
 this issue when running with THREAD_TYPE=slice and THREADS1.

 pthread is not my forte at all, and I'm not sure I'm handling the
 thread/... signalling correctly before freeing the leaking variables.

Ping?

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


[FFmpeg-devel] [PATCH] Port FFT domain filter.

2015-02-24 Thread arwa arif
Hello,

I have written a very primitive code for porting FFT domain filter. It
accepts only gray8 format images. The output should be a grayscale image,
but the ouput image is coming out to be a black and white image. Also, I am
getting confused when to do the vertical pass. After taking irdft of the
horizontal pass or before it?

I have attached the patch.
From 455a261d7e2b3afba767aac2e73448aeee02d159 Mon Sep 17 00:00:00 2001
From: Arwa Arif arwaarif1...@gmail.com
Date: Tue, 24 Feb 2015 12:17:30 +0530
Subject: [PATCH] Port FFT domain filter.

---
 libavfilter/Makefile |1 +
 libavfilter/allfilters.c |1 +
 libavfilter/vf_fftfilt.c |  139 ++
 3 files changed, 141 insertions(+)
 create mode 100644 libavfilter/vf_fftfilt.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 289c63b..b184f07 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -120,6 +120,7 @@ OBJS-$(CONFIG_EDGEDETECT_FILTER) += vf_edgedetect.o
 OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
 OBJS-$(CONFIG_EXTRACTPLANES_FILTER)  += vf_extractplanes.o
 OBJS-$(CONFIG_FADE_FILTER)   += vf_fade.o
+OBJS-$(CONFIG_FFTFILT_FILTER)+= vf_fftfilt.o
 OBJS-$(CONFIG_FIELD_FILTER)  += vf_field.o
 OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o
 OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 55de154..043ac56 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -136,6 +136,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(EQ, eq, vf);
 REGISTER_FILTER(EXTRACTPLANES,  extractplanes,  vf);
 REGISTER_FILTER(FADE,   fade,   vf);
+REGISTER_FILTER(FFTFILT,fftfilt,vf);
 REGISTER_FILTER(FIELD,  field,  vf);
 REGISTER_FILTER(FIELDMATCH, fieldmatch, vf);
 REGISTER_FILTER(FIELDORDER, fieldorder, vf);
diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
new file mode 100644
index 000..753bc8e
--- /dev/null
+++ b/libavfilter/vf_fftfilt.c
@@ -0,0 +1,139 @@
+/*
+ * Copyright (c) 2015 Arwa Arif arwaarif1...@gmail.com
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/**
+ * @file
+ * FFT domain filtering.
+ */
+
+#include libavfilter/internal.h
+#include libavutil/common.h
+#include libavutil/imgutils.h
+#include libavutil/opt.h
+#include libavutil/pixdesc.h
+#include libavcodec/avfft.h
+
+typedef struct {
+const AVClass *class;
+
+RDFTContext *rdft;
+int rdft_bits;
+FFTSample *rdft_data;
+
+} FFTFILTContext;
+
+static int filter_frame(AVFilterLink *inlink, AVFrame *in)
+{
+AVFilterContext *ctx = inlink-dst;
+AVFilterLink *outlink = inlink-dst-outputs[0];
+FFTFILTContext *fftfilt = ctx-priv;
+AVFrame *out;
+int i, j, k, rdft_bits;
+size_t rdft_len, w, h;
+
+w = inlink-w;
+h = inlink-h;
+
+/* RDFT window size (precision) according to the requested output frame height */
+for (rdft_bits = 1; 1  rdft_bits  2 * w; rdft_bits++);
+rdft_len = 1  rdft_bits;
+fftfilt-rdft_data = av_malloc_array(h, rdft_len * sizeof(FFTSample));
+memset(fftfilt-rdft_data, 0, rdft_len * h * sizeof(FFTSample));
+
+out = ff_get_video_buffer(outlink, inlink-w, inlink-h);
+if (!out)
+return AVERROR(ENOMEM);
+
+av_frame_copy_props(out, in);
+
+/*Horizontal pass - RDFT*/
+fftfilt-rdft = av_rdft_init(rdft_bits, DFT_R2C);
+k = 0;
+for (i = 0; i  h; i++)
+for (j = 0; j  w; j++)
+{
+fftfilt-rdft_data[k] = *(in-data[0] + in-linesize[0] * i + j);
+k++;
+}
+
+for (i = 0; i  h; i++)
+av_rdft_calc(fftfilt-rdft, fftfilt-rdft_data + i * rdft_len);
+
+av_rdft_end(fftfilt-rdft);
+
+/*Horizontal pass - IRDFT*/
+fftfilt-rdft = av_rdft_init(rdft_bits, IDFT_C2R);
+
+for (i = 0; i  h; i++)
+av_rdft_calc(fftfilt-rdft, fftfilt-rdft_data + i * rdft_len);
+
+k = 0;
+for (i = 0; i  h; i++)
+for (j = 0; j  w; j++)
+{
+*(out-data[0] + out-linesize[0] * i + j) = fftfilt-rdft_data[k];
+k++;
+

Re: [FFmpeg-devel] [PATCH]Silence warnings when compiling avfoundation

2015-02-24 Thread Thilo Borgmann
Am 23.02.15 um 19:46 schrieb Carl Eugen Hoyos:
 Thilo Borgmann thilo.borgmann at mail.de writes:
 
 For the second, what is that patch needed for?
 
 It is meant to fix warnings when compiling avfoundation 
 for ios, see for example:
 http://fate.ffmpeg.org/log.cgi?time=20150223010210log=compileslot=aarch64-bo

You just misread me, I know what the first patch is for - which is what you just
wrote. However, my question was about reason for the second #define patch.

 Is the existing check for MAC_OS_VERSION insufficient
 
 I would say it is neither sufficient nor insufficient, 
 MAX_OS_VERSION is not defined for ios.
 
 it implicitly avoids IOS_VERSIONs thus any iPhone
 anyway, not?
 
 No?

Thus, if MAC_OS_VERSION is undefined on iOS, the check will always be false
and therefore we should not need another test about !iOS.
Correct   - I don't understand the second patch (apply if necessary).
Incorrect - Please apply the second patch.

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


Re: [FFmpeg-devel] Why is writing the colr atom not the default in the mov muxer?

2015-02-24 Thread tim nicholson
On 21/02/15 01:34, Dave Rice wrote:
 Hi Robert, Kevin,
 
 On Feb 20, 2015, at 9:56 AM, Robert Krüger krue...@lesspain.de wrote:

 Am Freitag, 20. Februar 2015 schrieb Kevin Wheatley :

 On Fri, Feb 20, 2015 at 1:30 PM, Robert Krüger krue...@lesspain.de
 javascript:; wrote:
 if I read the code correctly, the colr atom is only written in the mov
 muxer if the flag write_colr is specified. Was that behaviour chosen to
 have better backward compatibility or is there another reason not to
 write
 this standard atom by default?

 I chose that way to preserve the older behaviour, as it can change how
 files will be interpreted.

 I assumed that but isn't the change then a change for the better (then
 maybe requiring a version bump and an entry in the release notes)? After
 all Apple muxers write it by default as well and not trusting the input
 metadata seems to me like something that should be opt-out rather than
 opt-in but that's just my 2c.
 
 That's also my two cents and I also wondered why users have to opt-in to a 
 correctly written file. The QuickTime spec says that colr is required with 
 some streams (such as raw uyvy422 and v210), see: 
 https://developer.apple.com/library/mac/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9.
 
 I'd propose that colr be written by default. The interpretation may be 
 different but, since a file with a colr atom is more self-descriptive, the 
 interpretation is more likely to be correct.

+1

 Dave Rice
 
 [...]


-- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Gaining access to a encoder context in avformat?

2015-02-24 Thread Kevin Wheatley
On Fri, Feb 20, 2015 at 5:51 PM, Michael Niedermayer michae...@gmx.at wrote:

 theres some code that memcpies extradata into vos_data and that is
 skiped if TAG_IS_AVCI(trk-tag), try to also skip this for DNxHD

Michael,

thanks for the pointer, there are actually two points in the code that
appear to need the guard against overwriting, I'm attaching an updated
patch for comments.

Kevin
From bd5543cd6a227e64e66eb5ac909e5efeddfeb3a8 Mon Sep 17 00:00:00 2001
From: Kevin Wheatley kevin.j.wheat...@gmail.com
Date: Tue, 24 Feb 2015 10:00:07 +
Subject: [PATCH] Using the copy codec ACLR atoms are incorrectly written - fix.

During the creation of the ACLR atom we are assuming the vos_data
contains the DNxHD header. This change makes this explicit and
ensures we don't over write the stream with the extra_data.

Signed-off-by: Kevin Wheatley kevin.j.wheat...@gmail.com
---
 libavformat/movenc.c |   31 +++
 1 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 210f78e..276b711 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1033,6 +1033,27 @@ static int mov_write_hvcc_tag(AVIOContext *pb, MOVTrack *track)
 static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
 {
 int i;
+int interlaced;
+int cid;
+
+if (track-vos_data  track-vos_len  0x29) { 
+if (track-vos_data[0] == 0x00 
+track-vos_data[1] == 0x00 
+track-vos_data[2] == 0x02 
+track-vos_data[3] == 0x80 
+(track-vos_data[4] == 0x01 || track-vos_data[4] == 0x02)) {
+/* looks like a DNxHD bit stream */
+interlaced = (track-vos_data[5]  2);
+cid = AV_RB32(track-vos_data + 0x28);
+} else {
+av_log(NULL, AV_LOG_WARNING, Could not locate DNxHD bit stream in vos_data\n);
+return 0;
+}
+} else {
+av_log(NULL, AV_LOG_WARNING, Could not locate DNxHD bit stream, vos_data too small\n);
+return 0;
+}
+
 avio_wb32(pb, 24); /* size */
 ffio_wfourcc(pb, ACLR);
 ffio_wfourcc(pb, ACLR);
@@ -1056,10 +1077,10 @@ static int mov_write_avid_tag(AVIOContext *pb, MOVTrack *track)
 ffio_wfourcc(pb, ARES);
 ffio_wfourcc(pb, ARES);
 ffio_wfourcc(pb, 0001);
-avio_wb32(pb, AV_RB32(track-vos_data + 0x28)); /* dnxhd cid, some id ? */
+avio_wb32(pb, cid); /* dnxhd cid, some id ? */
 avio_wb32(pb, track-enc-width);
 /* values below are based on samples created with quicktime and avid codecs */
-if (track-vos_data[5]  2) { // interlaced
+if (interlaced) {
 avio_wb32(pb, track-enc-height / 2);
 avio_wb32(pb, 2); /* unknown */
 avio_wb32(pb, 0); /* unknown */
@@ -4165,7 +4186,9 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
 samples_in_chunk = 1;
 
 /* copy extradata if it exists */
-if (trk-vos_len == 0  enc-extradata_size  0  !TAG_IS_AVCI(trk-tag)) {
+if (trk-vos_len == 0  enc-extradata_size  0 
+!TAG_IS_AVCI(trk-tag) 
+(enc-codec_id != AV_CODEC_ID_DNXHD)) {
 trk-vos_len  = enc-extradata_size;
 trk-vos_data = av_malloc(trk-vos_len);
 if (!trk-vos_data) {
@@ -4952,7 +4975,7 @@ static int mov_write_header(AVFormatContext *s)
 if (st-codec-extradata_size) {
 if (st-codec-codec_id == AV_CODEC_ID_DVD_SUBTITLE)
 mov_create_dvd_sub_decoder_specific_info(track, st);
-else if (!TAG_IS_AVCI(track-tag)){
+else if (!TAG_IS_AVCI(track-tag)  st-codec-codec_id != AV_CODEC_ID_DNXHD) {
 track-vos_len  = st-codec-extradata_size;
 track-vos_data = av_malloc(track-vos_len);
 if (!track-vos_data) {
-- 
1.7.1

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


Re: [FFmpeg-devel] [PATCH]Fix invalid memory accesses using the fade filter

2015-02-24 Thread Michael Niedermayer
On Tue, Feb 24, 2015 at 11:41:02AM +0100, Carl Eugen Hoyos wrote:
 On Monday 23 February 2015 02:02:42 pm Clément Bœsch wrote:
  On Mon, Feb 23, 2015 at 01:59:45PM +0100, Michael Niedermayer wrote:
   On Mon, Feb 23, 2015 at 03:27:54AM +0100, Carl Eugen Hoyos wrote:
 
+int width = av_pix_fmt_desc_get(frame-format)-flags 
AV_PIX_FMT_FLAG_PLANAR ? +frame-width :
+frame-width * s-bpp;
-for (j = 0; j  frame-width * s-bpp; j++) {
+for (j = 0; j  width; j++) {
  
   should be ok, alternatively bpp could be renamed and set to 1 for
   planar
 
  And moved out of the loop
 
 New patch attached.

ok if tested

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


Re: [FFmpeg-devel] [PATCH]Silence warnings when compiling avfoundation

2015-02-24 Thread Carl Eugen Hoyos
Thilo Borgmann thilo.borgmann at mail.de writes:

 You just misread me, I know what the first patch is for 
 - which is what you just wrote. However, my question 
 was about reason for the second #define patch.

My comment was only about the second patch.

Is the second patch ok?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH]Fix invalid memory accesses using the fade filter

2015-02-24 Thread Carl Eugen Hoyos
On Monday 23 February 2015 02:02:42 pm Clément Bœsch wrote:
 On Mon, Feb 23, 2015 at 01:59:45PM +0100, Michael Niedermayer wrote:
  On Mon, Feb 23, 2015 at 03:27:54AM +0100, Carl Eugen Hoyos wrote:

   +int width = av_pix_fmt_desc_get(frame-format)-flags 
   AV_PIX_FMT_FLAG_PLANAR ? +frame-width :
   +frame-width * s-bpp;
   -for (j = 0; j  frame-width * s-bpp; j++) {
   +for (j = 0; j  width; j++) {
 
  should be ok, alternatively bpp could be renamed and set to 1 for
  planar

 And moved out of the loop

New patch attached.

Thank you, Carl Eugen
diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c
index 80ce75d..a7597cd 100644
--- a/libavfilter/vf_fade.c
+++ b/libavfilter/vf_fade.c
@@ -138,7 +138,9 @@ static int config_props(AVFilterLink *inlink)
 s-hsub = pixdesc-log2_chroma_w;
 s-vsub = pixdesc-log2_chroma_h;
 
-s-bpp = av_get_bits_per_pixel(pixdesc)  3;
+s-bpp = pixdesc-flags  AV_PIX_FMT_FLAG_PLANAR ?
+ 1 :
+ av_get_bits_per_pixel(pixdesc)  3;
 s-alpha = !!(pixdesc-flags  AV_PIX_FMT_FLAG_ALPHA);
 s-is_packed_rgb = ff_fill_rgba_map(s-rgba_map, inlink-format) = 0;
 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] Why is writing the colr atom not the default in the mov muxer?

2015-02-24 Thread Michael Niedermayer
On Tue, Feb 24, 2015 at 08:00:07AM +, tim nicholson wrote:
 On 21/02/15 01:34, Dave Rice wrote:
  Hi Robert, Kevin,
  
  On Feb 20, 2015, at 9:56 AM, Robert Krüger krue...@lesspain.de wrote:
 
  Am Freitag, 20. Februar 2015 schrieb Kevin Wheatley :
 
  On Fri, Feb 20, 2015 at 1:30 PM, Robert Krüger krue...@lesspain.de
  javascript:; wrote:
  if I read the code correctly, the colr atom is only written in the mov
  muxer if the flag write_colr is specified. Was that behaviour chosen to
  have better backward compatibility or is there another reason not to
  write
  this standard atom by default?
 
  I chose that way to preserve the older behaviour, as it can change how
  files will be interpreted.
 
  I assumed that but isn't the change then a change for the better (then
  maybe requiring a version bump and an entry in the release notes)? After
  all Apple muxers write it by default as well and not trusting the input
  metadata seems to me like something that should be opt-out rather than
  opt-in but that's just my 2c.
  
  That's also my two cents and I also wondered why users have to opt-in to a 
  correctly written file. The QuickTime spec says that colr is required with 
  some streams (such as raw uyvy422 and v210), see: 
  https://developer.apple.com/library/mac/technotes/tn2162/_index.html#//apple_ref/doc/uid/DTS40013070-CH1-TNTAG9.
  
  I'd propose that colr be written by default. The interpretation may be 
  different but, since a file with a colr atom is more self-descriptive, the 
  interpretation is more likely to be correct.
 
 +1

if someone posts a patch, ill apply it

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

You can kill me, but you cannot change the truth.


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


Re: [FFmpeg-devel] [PATCH] Port FFT domain filter.

2015-02-24 Thread Michael Niedermayer
On Tue, Feb 24, 2015 at 02:27:01PM +0530, arwa arif wrote:
 Hello,
 
 I have written a very primitive code for porting FFT domain filter. It
 accepts only gray8 format images. The output should be a grayscale image,
 but the ouput image is coming out to be a black and white image. Also, I am
 getting confused when to do the vertical pass. After taking irdft of the
 horizontal pass or before it?

you can do both rdft first and then the 2 irdft passes, this should
give more possibilities in filtering but it could be done the other
way around too


 
 I have attached the patch.

  Makefile |1 
  allfilters.c |1 
  vf_fftfilt.c |  139 
 +++
  3 files changed, 141 insertions(+)
 d4b25d6a204534a66400f52c1f5312652e8208af  0001-Port-FFT-domain-filter.patch
 From 455a261d7e2b3afba767aac2e73448aeee02d159 Mon Sep 17 00:00:00 2001
 From: Arwa Arif arwaarif1...@gmail.com
 Date: Tue, 24 Feb 2015 12:17:30 +0530
 Subject: [PATCH] Port FFT domain filter.
 
 ---
  libavfilter/Makefile |1 +
  libavfilter/allfilters.c |1 +
  libavfilter/vf_fftfilt.c |  139 
 ++
  3 files changed, 141 insertions(+)
  create mode 100644 libavfilter/vf_fftfilt.c
 
 diff --git a/libavfilter/Makefile b/libavfilter/Makefile
 index 289c63b..b184f07 100644
 --- a/libavfilter/Makefile
 +++ b/libavfilter/Makefile
 @@ -120,6 +120,7 @@ OBJS-$(CONFIG_EDGEDETECT_FILTER) += 
 vf_edgedetect.o
  OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
  OBJS-$(CONFIG_EXTRACTPLANES_FILTER)  += vf_extractplanes.o
  OBJS-$(CONFIG_FADE_FILTER)   += vf_fade.o
 +OBJS-$(CONFIG_FFTFILT_FILTER)+= vf_fftfilt.o
  OBJS-$(CONFIG_FIELD_FILTER)  += vf_field.o
  OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o
  OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
 diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
 index 55de154..043ac56 100644
 --- a/libavfilter/allfilters.c
 +++ b/libavfilter/allfilters.c
 @@ -136,6 +136,7 @@ void avfilter_register_all(void)
  REGISTER_FILTER(EQ, eq, vf);
  REGISTER_FILTER(EXTRACTPLANES,  extractplanes,  vf);
  REGISTER_FILTER(FADE,   fade,   vf);
 +REGISTER_FILTER(FFTFILT,fftfilt,vf);
  REGISTER_FILTER(FIELD,  field,  vf);
  REGISTER_FILTER(FIELDMATCH, fieldmatch, vf);
  REGISTER_FILTER(FIELDORDER, fieldorder, vf);
 diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
 new file mode 100644
 index 000..753bc8e
 --- /dev/null
 +++ b/libavfilter/vf_fftfilt.c
 @@ -0,0 +1,139 @@
 +/*
 + * Copyright (c) 2015 Arwa Arif arwaarif1...@gmail.com
 + *
 + * This file is part of FFmpeg.
 + *
 + * FFmpeg is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *
 + * FFmpeg is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License along
 + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 + */
 +
 +/**
 + * @file
 + * FFT domain filtering.
 + */
 +
 +#include libavfilter/internal.h
 +#include libavutil/common.h
 +#include libavutil/imgutils.h
 +#include libavutil/opt.h
 +#include libavutil/pixdesc.h
 +#include libavcodec/avfft.h
 +
 +typedef struct {
 +const AVClass *class;
 +
 +RDFTContext *rdft;
 +int rdft_bits;
 +FFTSample *rdft_data;
 +
 +} FFTFILTContext;
 +
 +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 +{
 +AVFilterContext *ctx = inlink-dst;
 +AVFilterLink *outlink = inlink-dst-outputs[0];
 +FFTFILTContext *fftfilt = ctx-priv;
 +AVFrame *out;
 +int i, j, k, rdft_bits;
 +size_t rdft_len, w, h;
 +
 +w = inlink-w;
 +h = inlink-h;
 +
 +/* RDFT window size (precision) according to the requested output frame 
 height */
 +for (rdft_bits = 1; 1  rdft_bits  2 * w; rdft_bits++);
 +rdft_len = 1  rdft_bits;
 +fftfilt-rdft_data = av_malloc_array(h, rdft_len * sizeof(FFTSample));
 +memset(fftfilt-rdft_data, 0, rdft_len * h * sizeof(FFTSample));
 +
 +out = ff_get_video_buffer(outlink, inlink-w, inlink-h);
 +if (!out)
 +return AVERROR(ENOMEM);
 +
 +av_frame_copy_props(out, in);
 +
 +/*Horizontal pass - RDFT*/
 +fftfilt-rdft = av_rdft_init(rdft_bits, DFT_R2C);

 +k = 0;
 +for (i = 0; i  h; i++)
 +for (j = 0; j  w; j++)
 +{
 +

[FFmpeg-devel] [PATCH] avformat/dss: set packet duration

2015-02-24 Thread Michael Niedermayer
Value taken from the decoder implementation

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/dss.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dss.c b/libavformat/dss.c
index 85cd26a..12a4034 100644
--- a/libavformat/dss.c
+++ b/libavformat/dss.c
@@ -228,7 +228,7 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (ret  0)
 return ret;
 
-pkt-duration = 0;
+pkt-duration = 264;
 pkt-pos = pos;
 pkt-stream_index = 0;
 
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCHv2][RFC] mov: Write colr atom by default

2015-02-24 Thread Derek Buitenhuis
Some formats require this, such as v210. The consensus seems to be
to write it by default.

Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com
---
This is a silent behavior change, and I have updated the API doc
accordingly.
---
 doc/APIchanges| 3 +++
 libavformat/movenc.c  | 2 +-
 libavformat/version.h | 4 ++--
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 5fdfc82..0e96091 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
 
 API changes, most recent first:
 
+2015-xx-xx - xxx - lavf 56.24
+  mov/mp4 muxer now writes colr atom by default.
+
 2015-xx-xx - xxx - lavc 56.13
   Add width, height, coded_width, coded_height and format to
   AVCodecParserContext.
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 210f78e..0c74a91 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -49,7 +49,7 @@
 #include mov_chan.h
 
 static const AVOption options[] = {
-{ movflags, MOV muxer flags, offsetof(MOVMuxContext, flags), 
AV_OPT_TYPE_FLAGS, {.i64 = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
movflags },
+{ movflags, MOV muxer flags, offsetof(MOVMuxContext, flags), 
AV_OPT_TYPE_FLAGS, {.i64 = FF_MOV_FLAG_WRITE_COLR}, INT_MIN, INT_MAX, 
AV_OPT_FLAG_ENCODING_PARAM, movflags },
 { rtphint, Add RTP hint tracks, 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, movflags 
},
 { moov_size, maximum moov size so it can be placed at the begin, 
offsetof(MOVMuxContext, reserved_moov_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 
INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 0 },
 { empty_moov, Make the initial moov atom empty, 0, AV_OPT_TYPE_CONST, 
{.i64 = FF_MOV_FLAG_EMPTY_MOOV}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
movflags },
diff --git a/libavformat/version.h b/libavformat/version.h
index c23ce57..08ab50b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include libavutil/version.h
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR  23
-#define LIBAVFORMAT_VERSION_MICRO 104
+#define LIBAVFORMAT_VERSION_MINOR  24
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
1.8.3.1

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


[FFmpeg-devel] Interpretation of duration field in AVI super index chunk

2015-02-24 Thread Tobias Rapp

Hi,

I am currently trying to interpret the index data of HuffYuv/PCM AVI 
files written by FFmpeg. If the file is larger than 2GiB an AVIX RIFF 
chunk is added for each 2GiB-block, each of these blocks gets an OpenDML 
chunk index ix00 and an OpenDML super index chunk indx is written 
for each stream that contains the file offset of the according chunk 
indexes together with its size and total duration.


For this super index duration entry the documentation I have found 
states that it shall be the time span in stream ticks [1]. FFmpeg 
seems to write the chunk count instead which is correct for video 
streams where one data chunk 00dc corresponds to one frame. For audio 
streams one data chunk 01wb usually contains multiple samples.


I guess for audio streams the duration should be multiplied by the 
samples-per-chunk factor in avienc.c to allow third-party applications 
to jump to the correct AVIX RIFF segment based on a given timestamp.


Any comments?

Regards,
Tobias


Links:
[1] http://www.the-labs.com/Video/odmlff2-avidef.pdf

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


Re: [FFmpeg-devel] [PATCH][RFC] mov: Write colr atom by default

2015-02-24 Thread Derek Buitenhuis
On 2/24/2015 2:49 PM, Clément Bœsch wrote:
 Well, unfortunately this breaks the API. I'd just add the flag to the
 default values. People who set flags are supposed to use a + as a prefix
 so that won't be a problem.

Right.

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


Re: [FFmpeg-devel] Gaining access to a encoder context in avformat?

2015-02-24 Thread Michael Niedermayer
On Tue, Feb 24, 2015 at 10:10:21AM +, Kevin Wheatley wrote:
 On Fri, Feb 20, 2015 at 5:51 PM, Michael Niedermayer michae...@gmx.at wrote:
 
  theres some code that memcpies extradata into vos_data and that is
  skiped if TAG_IS_AVCI(trk-tag), try to also skip this for DNxHD
 
 Michael,
 
 thanks for the pointer, there are actually two points in the code that
 appear to need the guard against overwriting, I'm attaching an updated
 patch for comments.

i think that patch is a big improvment relative to what is in git
so applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Democracy is the form of government in which you can choose your dictator


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


[FFmpeg-devel] [PATCH][RFC] mov: Write colr atom by default

2015-02-24 Thread Derek Buitenhuis
Several formats require the colr atom, and the consensus seems
to be to write it by default.

Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com
---
Changing the flag as I do here is one approach. Comments needed.
---
 libavformat/movenc.c  | 4 ++--
 libavformat/movenc.h  | 2 +-
 libavformat/version.h | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 210f78e..39cd70b 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -64,7 +64,7 @@ static const AVOption options[] = {
 { dash, Write DASH compatible fragmented MP4, 0, AV_OPT_TYPE_CONST, 
{.i64 = FF_MOV_FLAG_DASH}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
movflags },
 { frag_discont, Signal that the next fragment is discontinuous from 
earlier ones, 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FRAG_DISCONT}, 
INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, movflags },
 { delay_moov, Delay writing the initial moov until the first fragment 
is cut, or until the first fragment flush, 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_MOV_FLAG_DELAY_MOOV}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
movflags },
-{ write_colr, Write colr atom, 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_MOV_FLAG_WRITE_COLR}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 
movflags },
+{ no_colr, Write colr atom, 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_MOV_FLAG_NO_COLR}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, movflags 
},
 FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
 { skip_iods, Skip writing iods atom., offsetof(MOVMuxContext, 
iods_skip), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
 { iods_audio_profile, iods audio profile atom., 
offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 
255, AV_OPT_FLAG_ENCODING_PARAM},
@@ -1666,7 +1666,7 @@ static int mov_write_video_tag(AVIOContext *pb, 
MOVMuxContext *mov, MOVTrack *tr
 if (track-enc-field_order != AV_FIELD_UNKNOWN)
 mov_write_fiel_tag(pb, track);
 
-if (mov-flags  FF_MOV_FLAG_WRITE_COLR)
+if (!(mov-flags  FF_MOV_FLAG_NO_COLR))
 mov_write_colr_tag(pb, track);
 
 if (track-enc-sample_aspect_ratio.den  
track-enc-sample_aspect_ratio.num 
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index 3a72937..f80514a 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -201,7 +201,7 @@ typedef struct MOVMuxContext {
 #define FF_MOV_FLAG_DASH  (1  11)
 #define FF_MOV_FLAG_FRAG_DISCONT  (1  12)
 #define FF_MOV_FLAG_DELAY_MOOV(1  13)
-#define FF_MOV_FLAG_WRITE_COLR(1  14)
+#define FF_MOV_FLAG_NO_COLR   (1  14)
 
 int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);
 
diff --git a/libavformat/version.h b/libavformat/version.h
index c23ce57..08ab50b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,8 +30,8 @@
 #include libavutil/version.h
 
 #define LIBAVFORMAT_VERSION_MAJOR 56
-#define LIBAVFORMAT_VERSION_MINOR  23
-#define LIBAVFORMAT_VERSION_MICRO 104
+#define LIBAVFORMAT_VERSION_MINOR  24
+#define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
-- 
1.8.3.1

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


[FFmpeg-devel] [PATCH 1/3] avformat/dss: correct sample rate

2015-02-24 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/dss.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/dss.c b/libavformat/dss.c
index 66a30aa..76538d77 100644
--- a/libavformat/dss.c
+++ b/libavformat/dss.c
@@ -143,7 +143,7 @@ static int dss_read_header(AVFormatContext *s)
 
 if (ctx-audio_codec == DSS_ACODEC_DSS_SP) {
 st-codec-codec_id= AV_CODEC_ID_DSS_SP;
-st-codec-sample_rate = 12000;
+st-codec-sample_rate = 11025;
 } else if (ctx-audio_codec == DSS_ACODEC_G723_1) {
 st-codec-codec_id= AV_CODEC_ID_G723_1;
 st-codec-sample_rate = 8000;
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH 3/3] avformat/dss: implement seeking

2015-02-24 Thread Michael Niedermayer
This assumes CBR (which is true for all samples i have)

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/dss.c |   39 +++
 1 file changed, 39 insertions(+)

diff --git a/libavformat/dss.c b/libavformat/dss.c
index c595982..72c7e1a 100644
--- a/libavformat/dss.c
+++ b/libavformat/dss.c
@@ -340,6 +340,44 @@ static int dss_read_close(AVFormatContext *s)
 return 0;
 }
 
+static int dss_read_seek(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
+{
+DSSDemuxContext *ctx = s-priv_data;
+int64_t ret, seekto;
+uint8_t header[6];
+int offset;
+
+if (ctx-audio_codec == DSS_ACODEC_DSS_SP)
+seekto = timestamp / 264 * 41 / 506 * 512;
+else
+seekto = timestamp / 240 * ctx-packet_size / 506 * 512;
+
+if (seekto  0)
+seekto = 0;
+
+seekto += DSS_HEADER_SIZE;
+
+ret = avio_seek(s-pb, seekto, SEEK_SET);
+if (ret  0)
+return ret;
+
+avio_read(s-pb, header, 6);
+ctx-swap = !!(header[0]  0x80);
+offset = 2*header[1] + 2*ctx-swap;
+if (offset  DSS_AUDIO_BLOCK_HEADER_SIZE)
+return AVERROR_INVALIDDATA;
+if (offset == DSS_AUDIO_BLOCK_HEADER_SIZE) {
+ctx-counter = 0;
+offset = avio_skip(s-pb, -DSS_AUDIO_BLOCK_HEADER_SIZE);
+} else {
+ctx-counter = DSS_BLOCK_SIZE - offset;
+offset = avio_skip(s-pb, offset - DSS_AUDIO_BLOCK_HEADER_SIZE);
+}
+return 0;
+}
+
+
 AVInputFormat ff_dss_demuxer = {
 .name   = dss,
 .long_name  = NULL_IF_CONFIG_SMALL(Digital Speech Standard (DSS)),
@@ -348,5 +386,6 @@ AVInputFormat ff_dss_demuxer = {
 .read_header= dss_read_header,
 .read_packet= dss_read_packet,
 .read_close = dss_read_close,
+.read_seek  = dss_read_seek,
 .extensions = dss
 };
-- 
1.7.9.5

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


[FFmpeg-devel] [PATCH 2/3] avformat/dss: set bitrate

2015-02-24 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/dss.c |8 
 1 file changed, 8 insertions(+)

diff --git a/libavformat/dss.c b/libavformat/dss.c
index 76538d77..c595982 100644
--- a/libavformat/dss.c
+++ b/libavformat/dss.c
@@ -54,6 +54,8 @@ typedef struct DSSDemuxContext {
 int swap;
 int dss_sp_swap_byte;
 int8_t *dss_sp_buf;
+
+int packet_size;
 } DSSDemuxContext;
 
 static int dss_probe(AVProbeData *p)
@@ -210,6 +212,7 @@ static void dss_sp_byte_swap(DSSDemuxContext *ctx,
 static int dss_sp_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
 DSSDemuxContext *ctx = s-priv_data;
+AVStream *st = s-streams[0];
 int read_size, ret, offset = 0, buff_offset = 0;
 int64_t pos = avio_tell(s-pb);;
 
@@ -223,6 +226,7 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 read_size = DSS_FRAME_SIZE;
 
 ctx-counter -= read_size;
+ctx-packet_size = DSS_FRAME_SIZE - 1;
 
 ret = av_new_packet(pkt, DSS_FRAME_SIZE);
 if (ret  0)
@@ -231,6 +235,7 @@ static int dss_sp_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 pkt-pos = pos;
 pkt-duration = 264;
 pkt-stream_index = 0;
+s-bit_rate = 8LL * ctx-packet_size * st-codec-sample_rate * 512 / (506 
* pkt-duration);
 
 if (ctx-counter  0) {
 int size2 = ctx-counter + read_size;
@@ -264,6 +269,7 @@ error_eof:
 static int dss_723_1_read_packet(AVFormatContext *s, AVPacket *pkt)
 {
 DSSDemuxContext *ctx = s-priv_data;
+AVStream *st = s-streams[0];
 int size, byte, ret, offset;
 int64_t pos = avio_tell(s-pb);
 
@@ -277,6 +283,7 @@ static int dss_723_1_read_packet(AVFormatContext *s, 
AVPacket *pkt)
 
 size = frame_size[byte  3];
 
+ctx-packet_size = size;
 ctx-counter -= size;
 
 ret = av_new_packet(pkt, size);
@@ -287,6 +294,7 @@ static int dss_723_1_read_packet(AVFormatContext *s, 
AVPacket *pkt)
 pkt-data[0]  = byte;
 offset= 1;
 pkt-duration = 240;
+s-bit_rate = 8LL * size * st-codec-sample_rate * 512 / (506 * 
pkt-duration);
 
 pkt-stream_index = 0;
 
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] doc/filters.texi: Added reference link to video size syntax description

2015-02-24 Thread Stefano Sabatini
On date Tuesday 2015-02-24 13:23:56 +0100, Tobias Rapp encoded:
 Attached patch updates the filter option documentation text to link to
 ffmpeg-utils documentation for video size syntax description.

 From 3c73ad81f31eedde3ed7f500af1ed23a5458652b Mon Sep 17 00:00:00 2001
 From: Tobias Rapp t.r...@noa-audio.com
 Date: Tue, 24 Feb 2015 13:14:07 +0100
 Subject: [PATCH] doc/filters.texi: Added reference link to video size syntax
  description
 
 Updated filter option text referencing the video size syntax to link to
 ffmpeg-utils documentation.
 ---
  doc/filters.texi | 57 
 +---
  1 file changed, 30 insertions(+), 27 deletions(-)

Applied, thanks.
-- 
FFmpeg = Freak Fostering Magic Pure Educated Guru
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv2][RFC] mov: Write colr atom by default

2015-02-24 Thread Robert Krüger
On Tue, Feb 24, 2015 at 6:34 PM, Michael Niedermayer michae...@gmx.at
wrote:

 On Tue, Feb 24, 2015 at 03:11:44PM +, Derek Buitenhuis wrote:
  Some formats require this, such as v210. The consensus seems to be
  to write it by default.
 
  Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com
  ---
  This is a silent behavior change, and I have updated the API doc
  accordingly.
  ---
   doc/APIchanges| 3 +++
   libavformat/movenc.c  | 2 +-
   libavformat/version.h | 4 ++--
   3 files changed, 6 insertions(+), 3 deletions(-)

 is this correct for all mov, mp4, 3gp, psp, ... ?
 or should it be writteb by default only for some of them ?

 neither am I aware of its use in iso-base formats nor is there a mention
of it in the two spec documents I found, so I guess limiting this to mov
seems at least the safer choice until someone comes up with proof that it
is used there.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/movenc: add STSD termination when FIEL/COLR/PASP is used

2015-02-24 Thread Michael Niedermayer
Only add it when in MOV mode, its in the QT spec
This matches libquicktime

See: 0216 11:49 Kevin Wheatley  ( 38K) [FFmpeg-devel] [PATCH] avformat: 
Outputting DNxHD into .mov containers 'corrupts' following atoms until end of 
stsd
See: libquicktime/src/stsdtable.c

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 libavformat/movenc.c   |   15 ++-
 tests/ref/vsynth/vsynth1-avui  |4 ++--
 tests/ref/vsynth/vsynth1-prores|4 ++--
 tests/ref/vsynth/vsynth1-prores_ks |4 ++--
 tests/ref/vsynth/vsynth1-qtrle |4 ++--
 tests/ref/vsynth/vsynth1-qtrlegray |4 ++--
 tests/ref/vsynth/vsynth1-svq1  |4 ++--
 tests/ref/vsynth/vsynth2-avui  |4 ++--
 tests/ref/vsynth/vsynth2-prores|4 ++--
 tests/ref/vsynth/vsynth2-prores_ks |4 ++--
 tests/ref/vsynth/vsynth2-qtrle |4 ++--
 tests/ref/vsynth/vsynth2-qtrlegray |4 ++--
 tests/ref/vsynth/vsynth2-svq1  |4 ++--
 tests/ref/vsynth/vsynth3-prores|4 ++--
 tests/ref/vsynth/vsynth3-prores_ks |4 ++--
 tests/ref/vsynth/vsynth3-qtrle |4 ++--
 tests/ref/vsynth/vsynth3-svq1  |4 ++--
 tests/ref/vsynth/vsynth_lena-avui  |4 ++--
 tests/ref/vsynth/vsynth_lena-prores|4 ++--
 tests/ref/vsynth/vsynth_lena-prores_ks |4 ++--
 tests/ref/vsynth/vsynth_lena-qtrle |4 ++--
 tests/ref/vsynth/vsynth_lena-qtrlegray |4 ++--
 tests/ref/vsynth/vsynth_lena-svq1  |4 ++--
 23 files changed, 54 insertions(+), 49 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index c5b5851..55b147d 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1611,7 +1611,7 @@ static int mov_write_video_tag(AVIOContext *pb, 
MOVMuxContext *mov, MOVTrack *tr
 {
 int64_t pos = avio_tell(pb);
 char compressor_name[32] = { 0 };
-int avid = 0;
+int add_terminator = 0;
 
 avio_wb32(pb, 0); /* size */
 avio_wl32(pb, track-tag); // store it byteswapped
@@ -1662,7 +1662,7 @@ static int mov_write_video_tag(AVIOContext *pb, 
MOVMuxContext *mov, MOVTrack *tr
 avio_wb32(pb, 0);
 } else if (track-enc-codec_id == AV_CODEC_ID_DNXHD) {
 mov_write_avid_tag(pb, track);
-avid = 1;
+add_terminator = 1;
 } else if (track-enc-codec_id == AV_CODEC_ID_HEVC)
 mov_write_hvcc_tag(pb, track);
 else if (track-enc-codec_id == AV_CODEC_ID_H264  
!TAG_IS_AVCI(track-tag)) {
@@ -1684,20 +1684,25 @@ static int mov_write_video_tag(AVIOContext *pb, 
MOVMuxContext *mov, MOVTrack *tr
 if (track-enc-codec_id != AV_CODEC_ID_H264 
 track-enc-codec_id != AV_CODEC_ID_MPEG4 
 track-enc-codec_id != AV_CODEC_ID_DNXHD)
-if (track-enc-field_order != AV_FIELD_UNKNOWN)
+if (track-enc-field_order != AV_FIELD_UNKNOWN) {
 mov_write_fiel_tag(pb, track);
+add_terminator = 1;
+}
 
-if (mov-flags  FF_MOV_FLAG_WRITE_COLR)
+if (mov-flags  FF_MOV_FLAG_WRITE_COLR) {
 mov_write_colr_tag(pb, track);
+add_terminator = 1;
+}
 
 if (track-enc-sample_aspect_ratio.den  
track-enc-sample_aspect_ratio.num 
 track-enc-sample_aspect_ratio.den != 
track-enc-sample_aspect_ratio.num) {
 mov_write_pasp_tag(pb, track);
+add_terminator = 1;
 }
 
 /* extra padding for avid stsd */
 /* 
https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/QTFFChap2/qtff2.html#//apple_ref/doc/uid/TP4939-CH204-61112
 */
-if (avid)
+if (add_terminator  track-mode == MODE_MOV)
 avio_wb32(pb, 0);
 
 return update_size(pb, pos);
diff --git a/tests/ref/vsynth/vsynth1-avui b/tests/ref/vsynth/vsynth1-avui
index 1f08053..ff094d3 100644
--- a/tests/ref/vsynth/vsynth1-avui
+++ b/tests/ref/vsynth/vsynth1-avui
@@ -1,4 +1,4 @@
-25ef49e1aee0b20d4feee89b8dc093b4 *tests/data/fate/vsynth1-avui.mov
-42625037 tests/data/fate/vsynth1-avui.mov
+b45460e127601347105ca4ef6f3669d6 *tests/data/fate/vsynth1-avui.mov
+42625041 tests/data/fate/vsynth1-avui.mov
 c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-avui.out.rawvideo
 stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores b/tests/ref/vsynth/vsynth1-prores
index 14de8b9..641b25d 100644
--- a/tests/ref/vsynth/vsynth1-prores
+++ b/tests/ref/vsynth/vsynth1-prores
@@ -1,4 +1,4 @@
-7ca7d2f9f5d8ac2ead691b1b6a70d409 *tests/data/fate/vsynth1-prores.mov
-5022821 tests/data/fate/vsynth1-prores.mov
+b3ec0eb568ad8a28c38bd3ee00466efe *tests/data/fate/vsynth1-prores.mov
+5022825 tests/data/fate/vsynth1-prores.mov
 fb4a9e025d12afc0dbbca8d82831858f *tests/data/fate/vsynth1-prores.out.rawvideo
 stddev:2.47 PSNR: 40.27 MAXDIFF:   31 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth1-prores_ks 
b/tests/ref/vsynth/vsynth1-prores_ks
index 6e5ed17..edd8ba9 100644
--- a/tests/ref/vsynth/vsynth1-prores_ks
+++ 

Re: [FFmpeg-devel] [PATCH] avformat: Outputting DNxHD into .mov containers 'corrupts' following atoms until end of stsd

2015-02-24 Thread Michael Niedermayer
On Fri, Feb 20, 2015 at 07:00:48PM +0100, Michael Niedermayer wrote:
 On Fri, Feb 20, 2015 at 04:04:52PM +, Kevin Wheatley wrote:
  On Fri, Feb 20, 2015 at 11:36 AM, Michael Niedermayer michae...@gmx.at 
  wrote:
   applied the case for DNxHD, for the more general case, please
   explain which case(s) and software need them, and how to reproduce
   that
  
  My experience and by the looks of things other people using
  libquicktime have seen issues with Final Cut having problems reading
  the files if the stds
  
  http://libquicktime.cvs.sourceforge.net/viewvc/libquicktime/libquicktime/src/stsdtable.c?view=markup
  
  quicktime_write_stsd_video() line 643 is where they sometimes pad.
  
  http://comments.gmane.org/gmane.comp.video.libquicktime.devel/1348
  
  appears to be the discussion around why they do it
 
 hmm, ok, i guess doing the same sometimes padding is what we should
 do then too

 if you want to submit a patch along these lines, ill apply it unless
 it breaks something

posted a patch that would do this

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
100% positive feedback - All either got their money back or didnt complain
Best seller ever, very honest - Seller refunded buyer after failed scam


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


Re: [FFmpeg-devel] [PATCHv2][RFC] mov: Write colr atom by default

2015-02-24 Thread Michael Niedermayer
On Tue, Feb 24, 2015 at 03:11:44PM +, Derek Buitenhuis wrote:
 Some formats require this, such as v210. The consensus seems to be
 to write it by default.
 
 Signed-off-by: Derek Buitenhuis derek.buitenh...@gmail.com
 ---
 This is a silent behavior change, and I have updated the API doc
 accordingly.
 ---
  doc/APIchanges| 3 +++
  libavformat/movenc.c  | 2 +-
  libavformat/version.h | 4 ++--
  3 files changed, 6 insertions(+), 3 deletions(-)

is this correct for all mov, mp4, 3gp, psp, ... ?
or should it be writteb by default only for some of them ?

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCHv2][RFC] mov: Write colr atom by default

2015-02-24 Thread Derek Buitenhuis
On 2/24/2015 5:46 PM, Robert Krüger wrote:
 is this correct for all mov, mp4, 3gp, psp, ... ?
 or should it be writteb by default only for some of them ?

Good point, but this raises the whole ugly question of the least crappy
way of setting a default for only one format in the monster that is
movenc.c, and if that's even a good idea. It's non-obvious behavior to
have different movflag defaults for different formats, IMO.

Actually, I'm wondering why we allow it to be written for other formats
at all in the first place?

 of it in the two spec documents I found, so I guess limiting this to mov
 seems at least the safer choice until someone comes up with proof that it
 is used there.

https://github.com/l-smash/l-smash/blob/6682f497d5aa48efb3961d7d05c9d0d0c229b77d/core/box.h#L503-515

It looks like those are quoted from the JPEG XR sequence spec? Confusing.

I have CC'd Yusuke on this email, as he may be able to provide insight.

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


Re: [FFmpeg-devel] [PATCH] Port FFT domain filter.

2015-02-24 Thread arwa arif
On Tue, Feb 24, 2015 at 4:12 PM, Michael Niedermayer michae...@gmx.at
wrote:

 On Tue, Feb 24, 2015 at 02:27:01PM +0530, arwa arif wrote:
  Hello,
 
  I have written a very primitive code for porting FFT domain filter. It
  accepts only gray8 format images. The output should be a grayscale image,
  but the ouput image is coming out to be a black and white image. Also, I
 am
  getting confused when to do the vertical pass. After taking irdft of the
  horizontal pass or before it?

 you can do both rdft first and then the 2 irdft passes, this should
 give more possibilities in filtering but it could be done the other
 way around too


 
  I have attached the patch.

   Makefile |1
   allfilters.c |1
   vf_fftfilt.c |  139
 +++
   3 files changed, 141 insertions(+)
  d4b25d6a204534a66400f52c1f5312652e8208af
 0001-Port-FFT-domain-filter.patch
  From 455a261d7e2b3afba767aac2e73448aeee02d159 Mon Sep 17 00:00:00 2001
  From: Arwa Arif arwaarif1...@gmail.com
  Date: Tue, 24 Feb 2015 12:17:30 +0530
  Subject: [PATCH] Port FFT domain filter.
 
  ---
   libavfilter/Makefile |1 +
   libavfilter/allfilters.c |1 +
   libavfilter/vf_fftfilt.c |  139
 ++
   3 files changed, 141 insertions(+)
   create mode 100644 libavfilter/vf_fftfilt.c
 
  diff --git a/libavfilter/Makefile b/libavfilter/Makefile
  index 289c63b..b184f07 100644
  --- a/libavfilter/Makefile
  +++ b/libavfilter/Makefile
  @@ -120,6 +120,7 @@ OBJS-$(CONFIG_EDGEDETECT_FILTER) +=
 vf_edgedetect.o
   OBJS-$(CONFIG_EQ_FILTER) += vf_eq.o
   OBJS-$(CONFIG_EXTRACTPLANES_FILTER)  += vf_extractplanes.o
   OBJS-$(CONFIG_FADE_FILTER)   += vf_fade.o
  +OBJS-$(CONFIG_FFTFILT_FILTER)+= vf_fftfilt.o
   OBJS-$(CONFIG_FIELD_FILTER)  += vf_field.o
   OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o
   OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
  diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
  index 55de154..043ac56 100644
  --- a/libavfilter/allfilters.c
  +++ b/libavfilter/allfilters.c
  @@ -136,6 +136,7 @@ void avfilter_register_all(void)
   REGISTER_FILTER(EQ, eq, vf);
   REGISTER_FILTER(EXTRACTPLANES,  extractplanes,  vf);
   REGISTER_FILTER(FADE,   fade,   vf);
  +REGISTER_FILTER(FFTFILT,fftfilt,vf);
   REGISTER_FILTER(FIELD,  field,  vf);
   REGISTER_FILTER(FIELDMATCH, fieldmatch, vf);
   REGISTER_FILTER(FIELDORDER, fieldorder, vf);
  diff --git a/libavfilter/vf_fftfilt.c b/libavfilter/vf_fftfilt.c
  new file mode 100644
  index 000..753bc8e
  --- /dev/null
  +++ b/libavfilter/vf_fftfilt.c
  @@ -0,0 +1,139 @@
  +/*
  + * Copyright (c) 2015 Arwa Arif arwaarif1...@gmail.com
  + *
  + * This file is part of FFmpeg.
  + *
  + * FFmpeg is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License as published by
  + * the Free Software Foundation; either version 2 of the License, or
  + * (at your option) any later version.
  + *
  + * FFmpeg is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
 along
  + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
  + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  + */
  +
  +/**
  + * @file
  + * FFT domain filtering.
  + */
  +
  +#include libavfilter/internal.h
  +#include libavutil/common.h
  +#include libavutil/imgutils.h
  +#include libavutil/opt.h
  +#include libavutil/pixdesc.h
  +#include libavcodec/avfft.h
  +
  +typedef struct {
  +const AVClass *class;
  +
  +RDFTContext *rdft;
  +int rdft_bits;
  +FFTSample *rdft_data;
  +
  +} FFTFILTContext;
  +
  +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
  +{
  +AVFilterContext *ctx = inlink-dst;
  +AVFilterLink *outlink = inlink-dst-outputs[0];
  +FFTFILTContext *fftfilt = ctx-priv;
  +AVFrame *out;
  +int i, j, k, rdft_bits;
  +size_t rdft_len, w, h;
  +
  +w = inlink-w;
  +h = inlink-h;
  +
  +/* RDFT window size (precision) according to the requested output
 frame height */
  +for (rdft_bits = 1; 1  rdft_bits  2 * w; rdft_bits++);
  +rdft_len = 1  rdft_bits;
  +fftfilt-rdft_data = av_malloc_array(h, rdft_len *
 sizeof(FFTSample));
  +memset(fftfilt-rdft_data, 0, rdft_len * h * sizeof(FFTSample));
  +
  +out = ff_get_video_buffer(outlink, inlink-w, inlink-h);
  +if (!out)
  +return AVERROR(ENOMEM);
  +
  +av_frame_copy_props(out, in);
  +
  +

Re: [FFmpeg-devel] [PATCH]Accept startcode 001 when remuxing H264 into mpegts

2015-02-24 Thread Carl Eugen Hoyos
On Tuesday 09 April 2013 03:21:33 pm Carl Eugen Hoyos wrote:
 Hi!

 Attached patch fixes remuxing of h264 into mpeg-ts for some wtv input
 files.

Updated patch attached, WMP and QT play such samples.
Fixes ticket #4324.

Please comment, Carl Eugen
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index a56ca0e..926f041 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1202,7 +1202,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream 
*st,
 
 int ff_check_h264_startcode(AVFormatContext *s, const AVStream *st, const 
AVPacket *pkt)
 {
-if (pkt-size  5 || AV_RB32(pkt-data) != 0x001) {
+if (pkt-size  5 || AV_RB32(pkt-data) != 0x001  AV_RB24(pkt-data) 
!= 0x01) {
 if (!st-nb_frames) {
 av_log(s, AV_LOG_ERROR, H.264 bitstream malformed, 
no startcode found, use the video bitstream filter 
'h264_mp4toannexb' to fix it 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] libavutil: add x86 optimized av_popcount

2015-02-24 Thread James Almer
Signed-off-by: James Almer jamr...@gmail.com
---
I decided to go the configure route since other features (cmov, clz) also do
it , but if prefered this could instead be done with a new intmath.h header 
in the x86/ folder containing something like

#if defined(__GNUC__)  defined(__POPCNT__)
#define av_popcount   __builtin_popcount
#if ARCH_X86_64
#define av_popcount64 __builtin_popcountll
#endif
#endif

For a cleaner compile time check.

 configure   | 12 ++--
 libavutil/intmath.h | 13 +
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index d037da1..3f1c394 100755
--- a/configure
+++ b/configure
@@ -1610,6 +1610,7 @@ ARCH_FEATURES=
 fast_64bit
 fast_clz
 fast_cmov
+fast_popcnt
 local_aligned_8
 local_aligned_16
 local_aligned_32
@@ -3908,13 +3909,20 @@ elif enabled x86; then
 cpuflags=-march=$cpu
 disable i686
 ;;
-# targets that do support nopl and conditional mov (cmov)
+# targets that do support nopl and conditional mov (cmov) but not 
popcnt
 
i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx\
-
|core*|atom|bonnell|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
+|core2*|atom|bonnell)
 cpuflags=-march=$cpu
 enable i686
 enable fast_cmov
 ;;
+# targets that do support nopl, conditional mov (cmov) and popcnt
+
core-*|corei*|nehalem|westmere|silvermont|sandybridge|ivybridge|haswell|broadwell|amdfam10|barcelona|b[dt]ver*)
+cpuflags=-march=$cpu
+enable i686
+enable fast_cmov
+enable fast_popcnt
+;;
 # targets that do support conditional mov but on which it's slow
 pentium4|pentium4m|prescott|nocona)
 cpuflags=-march=$cpu
diff --git a/libavutil/intmath.h b/libavutil/intmath.h
index fa549c8..e95eced 100644
--- a/libavutil/intmath.h
+++ b/libavutil/intmath.h
@@ -53,6 +53,19 @@
 #endif
 #endif /* AV_GCC_VERSION_AT_LEAST(3,4) */
 
+#if HAVE_FAST_POPCNT
+#if AV_GCC_VERSION_AT_LEAST(4,5)
+#ifndef av_popcount
+#define av_popcount   __builtin_popcount
+#endif /* av_popcount */
+#if HAVE_FAST_64BIT
+#ifndef av_popcount64
+#define av_popcount64 __builtin_popcountll
+#endif /* av_popcount64 */
+#endif /* HAVE_FAST_64BIT */
+#endif /* AV_GCC_VERSION_AT_LEAST(4,5) */
+#endif /* HAVE_FAST_POPCNT */
+
 extern const uint8_t ff_log2_tab[256];
 
 #ifndef ff_log2
-- 
2.3.0

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


Re: [FFmpeg-devel] [PATCH]Accept startcode 001 when remuxing H264 into mpegts

2015-02-24 Thread Michael Niedermayer
On Wed, Feb 25, 2015 at 12:05:27AM +0100, Carl Eugen Hoyos wrote:
 On Tuesday 09 April 2013 03:21:33 pm Carl Eugen Hoyos wrote:
  Hi!
 
  Attached patch fixes remuxing of h264 into mpeg-ts for some wtv input
  files.
 
 Updated patch attached, WMP and QT play such samples.
 Fixes ticket #4324.
 
 Please comment, Carl Eugen

  mpegtsenc.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 6bf84ed90b2c449b1f2db69247c9a71ab4ba1fe5  patchh264startcode.diff

should be ok

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


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