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

2015-10-03 Thread Christophe Gisquet
Hi,

Le 4 oct. 2015 04:16, "Michael Niedermayer"  a écrit :
>
> On Sat, Oct 03, 2015 at 06:59:22PM +0200, Christophe Gisquet wrote:
> > The functions related to bitstream reading must use the natural zigzag
> > order, and not the one permuted for use in the iDCT.
> >
> > This resulted in a bitstream where the AC coefficients were encoded in
> > an unexpected order.
> > ---
> >  libavcodec/dnxhdenc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
>
> this still breaks
>
> ./ffmpeg -f lavfi -i testsrc=s=1440x1080  -vframes 1 -pix_fmt yuv422p
-vcodec dnxhd -vb 80M -flags +ildct file.mov

err, sorry badly split branch. This one is not part of the dnxhr support,
but new idct asm.

Please ignore, but I do need to fix it.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-03 Thread Ching-Yi Chan
2015-10-04 7:37 GMT+08:00 Michael Niedermayer :

> On Sat, Oct 03, 2015 at 01:14:26AM +0800, Ching-Yi Chan wrote:
>
> iam not sure changing the format flags is a great idea, i think no
> other demuxer does that
> that said, the documentation does not say that only the user can
> change them so this is more a note that this looks a bit odd not that
> it is wrong
>
> using a context to keep found_seektable state.


> > +
> > +reset_index_position(avio_tell(s->pb), st);
> >  return 0;
> >
> >  fail:
> > @@ -249,12 +283,33 @@ static av_unused int64_t
> flac_read_timestamp(AVFormatContext *s, int stream_inde
> >  return pts;
> >  }
> >
> > +static int flac_seek(AVFormatContext *s, int stream_index, int64_t
> timestamp, int flags) {
> > +int index;
> > +int64_t pos;
> > +AVIndexEntry e;
> > +if (!(s->flags&AVFMT_FLAG_FAST_SEEK)) {
> > +return -1;
> > +}
> > +
> > +index = av_index_search_timestamp(s->streams[0], timestamp, flags);
> > +if(index<0 || index >= s->streams[0]->nb_index_entries)
> > +return -1;
> > +
> > +e = s->streams[0]->index_entries[index];
> > +pos = avio_seek(s->pb, e.pos, SEEK_SET);
> > +if (pos >= 0) {
>
> > +return pos;
>
> if pos is larger than INT_MAX the this can overflow and be interpreted
> as an error by the caller
>
>
> fix it by returning 0


0001-avformat-flacdec-support-fast-seek.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avcodec/alacdec: split off decorrelate_stereo and append_extra_bits as alacdsp

2015-10-03 Thread James Almer
On 10/4/2015 12:44 AM, James Almer wrote:
> Signed-off-by: James Almer 
> ---
>  libavcodec/Makefile  |  2 +-
>  libavcodec/alac.c| 65 
> +++-
>  libavcodec/alacdsp.c | 57 +
>  libavcodec/alacdsp.h | 35 
>  4 files changed, 116 insertions(+), 43 deletions(-)
>  create mode 100644 libavcodec/alacdsp.c
>  create mode 100644 libavcodec/alacdsp.h
> 
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index b15e431..153c3f8 100644
> --- a/libavcodec/Makefile
> +++ b/libavcodec/Makefile
> @@ -143,7 +143,7 @@ OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o 
> ac3enc.o ac3tab.o \
>ac3.o kbdwin.o
>  OBJS-$(CONFIG_AC3_FIXED_ENCODER)   += ac3enc_fixed.o ac3enc.o ac3tab.o 
> ac3.o
>  OBJS-$(CONFIG_AIC_DECODER) += aic.o
> -OBJS-$(CONFIG_ALAC_DECODER)+= alac.o alac_data.o
> +OBJS-$(CONFIG_ALAC_DECODER)+= alac.o alac_data.o alacdsp.o
>  OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
>  OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
>  OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
> diff --git a/libavcodec/alac.c b/libavcodec/alac.c
> index 827c0db..b767438 100644
> --- a/libavcodec/alac.c
> +++ b/libavcodec/alac.c
> @@ -57,6 +57,7 @@
>  #include "unary.h"
>  #include "mathops.h"
>  #include "alac_data.h"
> +#include "alacdsp.h"
>  
>  #define ALAC_EXTRADATA_SIZE 36
>  
> @@ -81,6 +82,8 @@ typedef struct ALACContext {
>  
>  int direct_output;
>  int extra_bit_bug;
> +
> +ALACDSPContext dsp;
>  } ALACContext;
>  
>  static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps)
> @@ -230,35 +233,6 @@ static void lpc_prediction(int32_t *error_buffer, 
> int32_t *buffer_out,
>  }
>  }
>  
> -static void decorrelate_stereo(int32_t *buffer[2], int nb_samples,
> -   int decorr_shift, int decorr_left_weight)
> -{
> -int i;
> -
> -for (i = 0; i < nb_samples; i++) {
> -int32_t a, b;
> -
> -a = buffer[0][i];
> -b = buffer[1][i];
> -
> -a -= (b * decorr_left_weight) >> decorr_shift;
> -b += a;
> -
> -buffer[0][i] = b;
> -buffer[1][i] = a;
> -}
> -}
> -
> -static void append_extra_bits(int32_t *buffer[2], int32_t 
> *extra_bits_buffer[2],
> -  int extra_bits, int channels, int nb_samples)
> -{
> -int i, ch;
> -
> -for (ch = 0; ch < channels; ch++)
> -for (i = 0; i < nb_samples; i++)
> -buffer[ch][i] = (buffer[ch][i] << extra_bits) | 
> extra_bits_buffer[ch][i];
> -}
> -
>  static int decode_element(AVCodecContext *avctx, AVFrame *frame, int 
> ch_index,
>int channels)
>  {
> @@ -389,19 +363,24 @@ static int decode_element(AVCodecContext *avctx, 
> AVFrame *frame, int ch_index,
>  decorr_left_weight = 0;
>  }
>  
> -if (alac->extra_bits && alac->extra_bit_bug) {
> -append_extra_bits(alac->output_samples_buffer, 
> alac->extra_bits_buffer,
> -  alac->extra_bits, channels, alac->nb_samples);
> -}
> +if (channels == 2) {
> +if (alac->extra_bits && alac->extra_bit_bug) {
> +alac->dsp.append_extra_bits_stereo(alac->output_samples_buffer, 
> alac->extra_bits_buffer,
> +   alac->extra_bits, channels, 
> alac->nb_samples);
> +}
>  
> -if (channels == 2 && decorr_left_weight) {
> -decorrelate_stereo(alac->output_samples_buffer, alac->nb_samples,
> -   decorr_shift, decorr_left_weight);
> -}
> +if (decorr_left_weight) {

So while i was writing a checkasm unit i started looking at the possible
values for this, and found out that apparently it's either 0 or 1.
Since the function below is not called when it's 0, wouldn't that mean
it's a pointless argument?

I'll have to redo the asm function if that's the case, and change the
prototype and boilerplate c version.

> +alac->dsp.decorrelate_stereo(alac->output_samples_buffer, 
> alac->nb_samples,
> + decorr_shift, decorr_left_weight);
> +}

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


[FFmpeg-devel] [PATCH 2/2] x86/alacdsp: add simd optimized functions

2015-10-03 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/alacdsp.c  |   3 +
 libavcodec/alacdsp.h  |   1 +
 libavcodec/x86/Makefile   |   2 +
 libavcodec/x86/alacdsp.asm| 133 ++
 libavcodec/x86/alacdsp_init.c |  44 ++
 5 files changed, 183 insertions(+)
 create mode 100644 libavcodec/x86/alacdsp.asm
 create mode 100644 libavcodec/x86/alacdsp_init.c

diff --git a/libavcodec/alacdsp.c b/libavcodec/alacdsp.c
index 45a0e91..702a23b 100644
--- a/libavcodec/alacdsp.c
+++ b/libavcodec/alacdsp.c
@@ -54,4 +54,7 @@ av_cold void ff_alacdsp_init(ALACDSPContext *c)
 c->decorrelate_stereo   = decorrelate_stereo;
 c->append_extra_bits_stereo =
 c->append_extra_bits_mono   = append_extra_bits;
+
+if (ARCH_X86)
+ff_alacdsp_init_x86(c);
 }
diff --git a/libavcodec/alacdsp.h b/libavcodec/alacdsp.h
index 5078921..b9a7236 100644
--- a/libavcodec/alacdsp.h
+++ b/libavcodec/alacdsp.h
@@ -31,5 +31,6 @@ typedef struct ALACDSPContext {
 } ALACDSPContext;
 
 void ff_alacdsp_init(ALACDSPContext *c);
+void ff_alacdsp_init_x86(ALACDSPContext *c);
 
 #endif /* AVCODEC_ALACDSP_H */
diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 5ff3a77..d8b091a 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -42,6 +42,7 @@ OBJS-$(CONFIG_AAC_DECODER) += x86/aacpsdsp_init.o 
 \
   x86/sbrdsp_init.o
 OBJS-$(CONFIG_ADPCM_G722_DECODER)  += x86/g722dsp_init.o
 OBJS-$(CONFIG_ADPCM_G722_ENCODER)  += x86/g722dsp_init.o
+OBJS-$(CONFIG_ALAC_DECODER)+= x86/alacdsp_init.o
 OBJS-$(CONFIG_APNG_DECODER)+= x86/pngdsp_init.o
 OBJS-$(CONFIG_CAVS_DECODER)+= x86/cavsdsp.o
 OBJS-$(CONFIG_DCA_DECODER) += x86/dcadsp_init.o
@@ -134,6 +135,7 @@ YASM-OBJS-$(CONFIG_AAC_DECODER)+= x86/aacpsdsp.o
\
   x86/sbrdsp.o
 YASM-OBJS-$(CONFIG_ADPCM_G722_DECODER) += x86/g722dsp.o
 YASM-OBJS-$(CONFIG_ADPCM_G722_ENCODER) += x86/g722dsp.o
+YASM-OBJS-$(CONFIG_ALAC_DECODER)   += x86/alacdsp.o
 YASM-OBJS-$(CONFIG_APNG_DECODER)   += x86/pngdsp.o
 YASM-OBJS-$(CONFIG_DCA_DECODER)+= x86/dcadsp.o
 YASM-OBJS-$(CONFIG_HEVC_DECODER)   += x86/hevc_mc.o \
diff --git a/libavcodec/x86/alacdsp.asm b/libavcodec/x86/alacdsp.asm
new file mode 100644
index 000..bb2069f
--- /dev/null
+++ b/libavcodec/x86/alacdsp.asm
@@ -0,0 +1,133 @@
+;**
+;* ALAC DSP SIMD optimizations
+;*
+;* Copyright (C) 2015 James Almer
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or
+;* modify it under the terms of the GNU Lesser General Public
+;* License as published by the Free Software Foundation; either
+;* version 2.1 of the License, or (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;* Lesser General Public License for more details.
+;*
+;* You should have received a copy of the GNU Lesser General Public
+;* License along with FFmpeg; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;**
+
+%include "libavutil/x86/x86util.asm"
+
+SECTION .text
+
+INIT_XMM sse4
+%if ARCH_X86_64
+cglobal alac_decorrelate_stereo, 2, 5, 8, buf0, len, shift, weight, buf1
+%else
+cglobal alac_decorrelate_stereo, 2, 3, 8, buf0, len, shift, weight
+%define  buf1q  r2q
+%endif
+movdm6, shiftm
+movdm7, weightm
+SPLATD  m7
+shl   lend, 2
+mov  buf1q, [buf0q + gprsize]
+mov  buf0q, [buf0q]
+add  buf1q, lenq
+add  buf0q, lenq
+neg  lenq
+
+align 16
+.loop:
+movam0, [buf0q + lenq]
+movam1, [buf0q + lenq + mmsize]
+movam2, [buf1q + lenq]
+movam3, [buf1q + lenq + mmsize]
+pmulld  m4, m2, m7
+pmulld  m5, m3, m7
+psrad   m4, m6
+psrad   m5, m6
+psubd   m0, m4
+psubd   m1, m5
+paddd   m2, m0
+paddd   m3, m1
+mova [buf1q + lenq], m0
+mova [buf1q + lenq + mmsize], m1
+mova [buf0q + lenq], m2
+mova [buf0q + lenq + mmsize], m3
+
+add   lenq, mmsize*2
+jl .loop
+RET
+
+INIT_XMM sse2
+cglobal alac_append_extra_bits_stereo, 2, 5, 5, buf0, exbuf0, buf1, exbuf1, len
+movifnidn lend, lenm
+movd  m4, r2m ; exbits
+shl lend, 2
+movbuf1q, [buf0q + gprsize]
+movbuf0q, [buf0q]
+mov  exbuf1q, [exbuf0q + gprsize]
+mov  exbuf0q, [exbuf0q]
+addbuf1q, lenq
+addbuf0q, lenq
+add  exbuf1q, lenq
+add  exbuf0q, lenq
+neg lenq
+
+align 16
+.loop:
+mova  m0, [buf0q + lenq]
+mova   

[FFmpeg-devel] [PATCH 1/2] avcodec/alacdec: split off decorrelate_stereo and append_extra_bits as alacdsp

2015-10-03 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/Makefile  |  2 +-
 libavcodec/alac.c| 65 +++-
 libavcodec/alacdsp.c | 57 +
 libavcodec/alacdsp.h | 35 
 4 files changed, 116 insertions(+), 43 deletions(-)
 create mode 100644 libavcodec/alacdsp.c
 create mode 100644 libavcodec/alacdsp.h

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b15e431..153c3f8 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -143,7 +143,7 @@ OBJS-$(CONFIG_AC3_ENCODER) += ac3enc_float.o 
ac3enc.o ac3tab.o \
   ac3.o kbdwin.o
 OBJS-$(CONFIG_AC3_FIXED_ENCODER)   += ac3enc_fixed.o ac3enc.o ac3tab.o 
ac3.o
 OBJS-$(CONFIG_AIC_DECODER) += aic.o
-OBJS-$(CONFIG_ALAC_DECODER)+= alac.o alac_data.o
+OBJS-$(CONFIG_ALAC_DECODER)+= alac.o alac_data.o alacdsp.o
 OBJS-$(CONFIG_ALAC_ENCODER)+= alacenc.o alac_data.o
 OBJS-$(CONFIG_ALIAS_PIX_DECODER)   += aliaspixdec.o
 OBJS-$(CONFIG_ALIAS_PIX_ENCODER)   += aliaspixenc.o
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 827c0db..b767438 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -57,6 +57,7 @@
 #include "unary.h"
 #include "mathops.h"
 #include "alac_data.h"
+#include "alacdsp.h"
 
 #define ALAC_EXTRADATA_SIZE 36
 
@@ -81,6 +82,8 @@ typedef struct ALACContext {
 
 int direct_output;
 int extra_bit_bug;
+
+ALACDSPContext dsp;
 } ALACContext;
 
 static inline unsigned int decode_scalar(GetBitContext *gb, int k, int bps)
@@ -230,35 +233,6 @@ static void lpc_prediction(int32_t *error_buffer, int32_t 
*buffer_out,
 }
 }
 
-static void decorrelate_stereo(int32_t *buffer[2], int nb_samples,
-   int decorr_shift, int decorr_left_weight)
-{
-int i;
-
-for (i = 0; i < nb_samples; i++) {
-int32_t a, b;
-
-a = buffer[0][i];
-b = buffer[1][i];
-
-a -= (b * decorr_left_weight) >> decorr_shift;
-b += a;
-
-buffer[0][i] = b;
-buffer[1][i] = a;
-}
-}
-
-static void append_extra_bits(int32_t *buffer[2], int32_t 
*extra_bits_buffer[2],
-  int extra_bits, int channels, int nb_samples)
-{
-int i, ch;
-
-for (ch = 0; ch < channels; ch++)
-for (i = 0; i < nb_samples; i++)
-buffer[ch][i] = (buffer[ch][i] << extra_bits) | 
extra_bits_buffer[ch][i];
-}
-
 static int decode_element(AVCodecContext *avctx, AVFrame *frame, int ch_index,
   int channels)
 {
@@ -389,19 +363,24 @@ static int decode_element(AVCodecContext *avctx, AVFrame 
*frame, int ch_index,
 decorr_left_weight = 0;
 }
 
-if (alac->extra_bits && alac->extra_bit_bug) {
-append_extra_bits(alac->output_samples_buffer, alac->extra_bits_buffer,
-  alac->extra_bits, channels, alac->nb_samples);
-}
+if (channels == 2) {
+if (alac->extra_bits && alac->extra_bit_bug) {
+alac->dsp.append_extra_bits_stereo(alac->output_samples_buffer, 
alac->extra_bits_buffer,
+   alac->extra_bits, channels, 
alac->nb_samples);
+}
 
-if (channels == 2 && decorr_left_weight) {
-decorrelate_stereo(alac->output_samples_buffer, alac->nb_samples,
-   decorr_shift, decorr_left_weight);
-}
+if (decorr_left_weight) {
+alac->dsp.decorrelate_stereo(alac->output_samples_buffer, 
alac->nb_samples,
+ decorr_shift, decorr_left_weight);
+}
 
-if (alac->extra_bits && !alac->extra_bit_bug) {
-append_extra_bits(alac->output_samples_buffer, alac->extra_bits_buffer,
-  alac->extra_bits, channels, alac->nb_samples);
+if (alac->extra_bits && !alac->extra_bit_bug) {
+alac->dsp.append_extra_bits_stereo(alac->output_samples_buffer, 
alac->extra_bits_buffer,
+   alac->extra_bits, channels, 
alac->nb_samples);
+}
+} else if (alac->extra_bits) {
+alac->dsp.append_extra_bits_mono(alac->output_samples_buffer, 
alac->extra_bits_buffer,
+ alac->extra_bits, channels, 
alac->nb_samples);
 }
 
 switch(alac->sample_size) {
@@ -515,11 +494,11 @@ static int allocate_buffers(ALACContext *alac)
 alac->direct_output = alac->sample_size > 16;
 if (!alac->direct_output) {
 FF_ALLOC_OR_GOTO(alac->avctx, alac->output_samples_buffer[ch],
- buf_size, buf_alloc_fail);
+ buf_size + AV_INPUT_BUFFER_PADDING_SIZE, 
buf_alloc_fail);
 }
 
 FF_ALLOC_OR_GOTO(alac->avctx, alac->extra_bits_buffer[ch],
- buf_size, buf_alloc_fail);
+ buf_size + AV_IN

[FFmpeg-devel] [PATCH] Changelog: add note on ffplay dynamic volume control

2015-10-03 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 Changelog | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Changelog b/Changelog
index 4b18d00..2d1c842 100644
--- a/Changelog
+++ b/Changelog
@@ -15,6 +15,7 @@ version :
 - maskedmerge filter
 - Screenpresso SPV1 decoding
 - chromaprint fingerprinting muxer
+- ffplay dynamic volume control
 
 
 version 2.8:
-- 
2.6.0

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


Re: [FFmpeg-devel] modify ffplay for dumpstream in rtsp?

2015-10-03 Thread compn
On Sat, 3 Oct 2015 10:45:25 +0200
Nicolas George  wrote:

> Le duodi 12 vendémiaire, an CCXXIV, Jan Panteltje a écrit :
> > I was thinking about adding a command line option to ffplay to
> > enable the 'dump to stdout' modification, but am taken aback by why
> > I do not understand the double speed effect in playback.
> The double speed effect is probably caused by you saving the packets
> payloads but not their headers. The result is an elementary stream,

yes, ffplay uses some default fps for raw h264.

> limitations, and I am pretty sure it can already be done in a
> different but more robust way.
> 
> Most importantly, if ffplay is capable of playing the stream, then
> ffmpeg should be able to read and manipulate it

he wants to play and dump at the same time. like vlc can. 

should this functionality be added to ffmpeg or ffplay?

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


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

2015-10-03 Thread Michael Niedermayer
On Sat, Oct 03, 2015 at 06:59:22PM +0200, Christophe Gisquet wrote:
> The functions related to bitstream reading must use the natural zigzag
> order, and not the one permuted for use in the iDCT.
> 
> This resulted in a bitstream where the AC coefficients were encoded in
> an unexpected order.
> ---
>  libavcodec/dnxhdenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

this still breaks

./ffmpeg -f lavfi -i testsrc=s=1440x1080  -vframes 1 -pix_fmt yuv422p -vcodec 
dnxhd -vb 80M -flags +ildct file.mov


[...]
-- 
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] [PATCH 01/15] lavfi/af_aresample: remove looping on request_frame().

2015-10-03 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 05:13:12PM +0200, Nicolas George wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/af_aresample.c | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> 
> All patches in this series were tested with FATE or manually.

whole patchset should be ok

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


Re: [FFmpeg-devel] [PATCH] lavf: add chromaprint muxer

2015-10-03 Thread Michael Niedermayer
On Sat, Oct 03, 2015 at 05:24:06PM -0500, Rodger Combs wrote:
> ---
>  Changelog |   1 +
>  configure |   4 +
>  doc/muxers.texi   |  35 +
>  libavformat/Makefile  |   1 +
>  libavformat/allformats.c  |   1 +
>  libavformat/chromaprint.c | 186 
> ++
>  libavformat/version.h |   4 +-
>  7 files changed, 230 insertions(+), 2 deletions(-)
>  create mode 100644 libavformat/chromaprint.c

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-03 Thread Hendrik Leppkes
On Sun, Oct 4, 2015 at 1:37 AM, Michael Niedermayer  wrote:
> On Sat, Oct 03, 2015 at 01:14:26AM +0800, Ching-Yi Chan wrote:
>> Here is a new patch:
>>
>> 1. fix compilation warning
>> 2. remove ff_ prefix on my patch
>> 3. toggle AVFMT_FLAG_FAST_SEEK when no seektalbe in the flac metadata (this
>> will disable flac_seek when no seekpoint)
>
>>  flacdec.c |   59 +--
>>  1 file changed, 57 insertions(+), 2 deletions(-)
>> caa7d32b430da96d0dc377dbe7fe8518e872d132  
>> 0001-avformat-flacdec-support-fast-seek.patch
>> From ac4c0a99f87c31ac510772172fc13ad82955c0d6 Mon Sep 17 00:00:00 2001
>> From: "Ching Yi, Chan" 
>> Date: Thu, 24 Sep 2015 13:04:40 +0800
>> Subject: [PATCH] avformat/flacdec: support fast-seek
>>
>> ---
>>  libavformat/flacdec.c |   59 
>> +++-
>>  1 files changed, 57 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
>> index 4c1f943..3fdbccc 100644
>> --- a/libavformat/flacdec.c
>> +++ b/libavformat/flacdec.c
>> @@ -28,9 +28,20 @@
>>  #include "vorbiscomment.h"
>>  #include "replaygain.h"
>>
>> +#define SEEKPOINT_SIZE 18
>> +
>> +static void reset_index_position(int64_t metadata_head_size, AVStream *st)
>> +{
>> +/* the real seek index offset should be the size of metadata blocks 
>> with the offset in the frame blocks */
>> +int i;
>> +for(i=0; inb_index_entries; i++) {
>> +st->index_entries[i].pos += metadata_head_size;
>> +}
>> +}
>> +
>>  static int flac_read_header(AVFormatContext *s)
>>  {
>> -int ret, metadata_last=0, metadata_type, metadata_size, 
>> found_streaminfo=0;
>> +int ret, metadata_last=0, metadata_type, metadata_size, 
>> found_streaminfo=0, found_seektable=0;
>>  uint8_t header[4];
>>  uint8_t *buffer=NULL;
>>  AVStream *st = avformat_new_stream(s, NULL);
>> @@ -58,6 +69,7 @@ static int flac_read_header(AVFormatContext *s)
>>  case FLAC_METADATA_TYPE_CUESHEET:
>>  case FLAC_METADATA_TYPE_PICTURE:
>>  case FLAC_METADATA_TYPE_VORBIS_COMMENT:
>> +case FLAC_METADATA_TYPE_SEEKTABLE:
>>  buffer = av_mallocz(metadata_size + 
>> AV_INPUT_BUFFER_PADDING_SIZE);
>>  if (!buffer) {
>>  return AVERROR(ENOMEM);
>> @@ -132,7 +144,23 @@ static int flac_read_header(AVFormatContext *s)
>>  av_log(s, AV_LOG_ERROR, "Error parsing attached 
>> picture.\n");
>>  return ret;
>>  }
>> -} else {
>> +} else if (metadata_type == FLAC_METADATA_TYPE_SEEKTABLE) {
>> +const uint8_t *seekpoint = buffer;
>> +int i, seek_point_count = metadata_size/SEEKPOINT_SIZE;
>> +found_seektable = 1;
>> +if ((s->flags&AVFMT_FLAG_FAST_SEEK)) {

Parsing the seektable should be independent of that flag, no?
Its surely still useful even if you do an accurate seek, is it not?

>> +for(i=0; i> +int64_t timestamp = bytestream_get_be64(&seekpoint);
>> +int64_t pos = bytestream_get_be64(&seekpoint);
>> +/* skip number of samples */
>> +bytestream_get_be16(&seekpoint);
>> +av_add_index_entry(st, pos, timestamp, 0, 0, 
>> AVINDEX_KEYFRAME);
>> +}
>> +}
>> +av_freep(&buffer);
>> +}
>> +else {
>> +
>>  /* STREAMINFO must be the first block */
>>  if (!found_streaminfo) {
>>  RETURN_ERROR(AVERROR_INVALIDDATA);
>
>> @@ -169,6 +197,12 @@ static int flac_read_header(AVFormatContext *s)
>>  if (ret < 0)
>>  return ret;
>>
>> +if (!found_seektable) {
>> +s->flags &= ~AVFMT_FLAG_FAST_SEEK;
>> +av_log(s, AV_LOG_WARNING, "seektable not found, disable 
>> AVFMT_FLAG_FAST_SEEK flag\n");
>> +}
>
> iam not sure changing the format flags is a great idea, i think no
> other demuxer does that
> that said, the documentation does not say that only the user can
> change them so this is more a note that this looks a bit odd not that
> it is wrong
>
>
>> +
>> +reset_index_position(avio_tell(s->pb), st);
>>  return 0;
>>
>>  fail:
>> @@ -249,12 +283,33 @@ static av_unused int64_t 
>> flac_read_timestamp(AVFormatContext *s, int stream_inde
>>  return pts;
>>  }
>>
>> +static int flac_seek(AVFormatContext *s, int stream_index, int64_t 
>> timestamp, int flags) {
>> +int index;
>> +int64_t pos;
>> +AVIndexEntry e;
>> +if (!(s->flags&AVFMT_FLAG_FAST_SEEK)) {
>> +return -1;
>> +}
>> +
>> +index = av_index_search_timestamp(s->streams[0], timestamp, flags);
>> +if(index<0 || index >= s->streams[0]->nb_index_entries)
>> +return -1;
>> +
>> +e = s->streams[0]->index_entries[index];
>> +pos = avio_seek(s->pb, e.pos, SEEK_SET);
>> +if (pos >= 0) {
>
>> +return pos;
>
> if pos is large

Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-03 Thread Michael Niedermayer
On Sat, Oct 03, 2015 at 01:14:26AM +0800, Ching-Yi Chan wrote:
> Here is a new patch:
> 
> 1. fix compilation warning
> 2. remove ff_ prefix on my patch
> 3. toggle AVFMT_FLAG_FAST_SEEK when no seektalbe in the flac metadata (this
> will disable flac_seek when no seekpoint)

>  flacdec.c |   59 +--
>  1 file changed, 57 insertions(+), 2 deletions(-)
> caa7d32b430da96d0dc377dbe7fe8518e872d132  
> 0001-avformat-flacdec-support-fast-seek.patch
> From ac4c0a99f87c31ac510772172fc13ad82955c0d6 Mon Sep 17 00:00:00 2001
> From: "Ching Yi, Chan" 
> Date: Thu, 24 Sep 2015 13:04:40 +0800
> Subject: [PATCH] avformat/flacdec: support fast-seek
> 
> ---
>  libavformat/flacdec.c |   59 +++-
>  1 files changed, 57 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c
> index 4c1f943..3fdbccc 100644
> --- a/libavformat/flacdec.c
> +++ b/libavformat/flacdec.c
> @@ -28,9 +28,20 @@
>  #include "vorbiscomment.h"
>  #include "replaygain.h"
>  
> +#define SEEKPOINT_SIZE 18
> +
> +static void reset_index_position(int64_t metadata_head_size, AVStream *st)
> +{
> +/* the real seek index offset should be the size of metadata blocks with 
> the offset in the frame blocks */
> +int i;
> +for(i=0; inb_index_entries; i++) {
> +st->index_entries[i].pos += metadata_head_size;
> +}
> +}
> +
>  static int flac_read_header(AVFormatContext *s)
>  {
> -int ret, metadata_last=0, metadata_type, metadata_size, 
> found_streaminfo=0;
> +int ret, metadata_last=0, metadata_type, metadata_size, 
> found_streaminfo=0, found_seektable=0;
>  uint8_t header[4];
>  uint8_t *buffer=NULL;
>  AVStream *st = avformat_new_stream(s, NULL);
> @@ -58,6 +69,7 @@ static int flac_read_header(AVFormatContext *s)
>  case FLAC_METADATA_TYPE_CUESHEET:
>  case FLAC_METADATA_TYPE_PICTURE:
>  case FLAC_METADATA_TYPE_VORBIS_COMMENT:
> +case FLAC_METADATA_TYPE_SEEKTABLE:
>  buffer = av_mallocz(metadata_size + 
> AV_INPUT_BUFFER_PADDING_SIZE);
>  if (!buffer) {
>  return AVERROR(ENOMEM);
> @@ -132,7 +144,23 @@ static int flac_read_header(AVFormatContext *s)
>  av_log(s, AV_LOG_ERROR, "Error parsing attached picture.\n");
>  return ret;
>  }
> -} else {
> +} else if (metadata_type == FLAC_METADATA_TYPE_SEEKTABLE) {
> +const uint8_t *seekpoint = buffer;
> +int i, seek_point_count = metadata_size/SEEKPOINT_SIZE;
> +found_seektable = 1;
> +if ((s->flags&AVFMT_FLAG_FAST_SEEK)) {
> +for(i=0; i +int64_t timestamp = bytestream_get_be64(&seekpoint);
> +int64_t pos = bytestream_get_be64(&seekpoint);
> +/* skip number of samples */
> +bytestream_get_be16(&seekpoint);
> +av_add_index_entry(st, pos, timestamp, 0, 0, 
> AVINDEX_KEYFRAME);
> +}
> +}
> +av_freep(&buffer);
> +}
> +else {
> +
>  /* STREAMINFO must be the first block */
>  if (!found_streaminfo) {
>  RETURN_ERROR(AVERROR_INVALIDDATA);

> @@ -169,6 +197,12 @@ static int flac_read_header(AVFormatContext *s)
>  if (ret < 0)
>  return ret;
>  
> +if (!found_seektable) {
> +s->flags &= ~AVFMT_FLAG_FAST_SEEK;
> +av_log(s, AV_LOG_WARNING, "seektable not found, disable 
> AVFMT_FLAG_FAST_SEEK flag\n");
> +}

iam not sure changing the format flags is a great idea, i think no
other demuxer does that
that said, the documentation does not say that only the user can
change them so this is more a note that this looks a bit odd not that
it is wrong


> +
> +reset_index_position(avio_tell(s->pb), st);
>  return 0;
>  
>  fail:
> @@ -249,12 +283,33 @@ static av_unused int64_t 
> flac_read_timestamp(AVFormatContext *s, int stream_inde
>  return pts;
>  }
>  
> +static int flac_seek(AVFormatContext *s, int stream_index, int64_t 
> timestamp, int flags) {
> +int index;
> +int64_t pos;
> +AVIndexEntry e;
> +if (!(s->flags&AVFMT_FLAG_FAST_SEEK)) {
> +return -1;
> +}
> +
> +index = av_index_search_timestamp(s->streams[0], timestamp, flags);
> +if(index<0 || index >= s->streams[0]->nb_index_entries)
> +return -1;
> +
> +e = s->streams[0]->index_entries[index];
> +pos = avio_seek(s->pb, e.pos, SEEK_SET);
> +if (pos >= 0) {

> +return pos;

if pos is larger than INT_MAX the this can overflow and be interpreted
as an error by the caller


> +}
> +return -1;
> +}
> +
>  AVInputFormat ff_flac_demuxer = {
>  .name   = "flac",
>  .long_name  = NULL_IF_CONFIG_SMALL("raw FLAC"),
>  .read_probe = flac_probe,
>  .read_header= flac_read_header,

Re: [FFmpeg-devel] [PATCH] ffplay: more robust thread creation

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 6:05 PM, Marton Balint  wrote:
>
> On Sat, 3 Oct 2015, Ganesh Ajjanagadde wrote:
>
>> SDL_CreateThread can fail:
>> https://wiki.libsdl.org/SDL_CreateThread.
>> This patch makes thread creation more robust in one instance.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>> ffplay.c | 16 
>> 1 file changed, 12 insertions(+), 4 deletions(-)
>>
>> diff --git a/ffplay.c b/ffplay.c
>> index b7b2b0b..da0fd3a 100644
>> --- a/ffplay.c
>> +++ b/ffplay.c
>> @@ -2080,10 +2080,15 @@ static int audio_thread(void *arg)
>> return ret;
>> }
>>
>> -static void decoder_start(Decoder *d, int (*fn)(void *), void *arg)
>> +static int decoder_start(Decoder *d, int (*fn)(void *), void *arg)
>> {
>> packet_queue_start(d->queue);
>> d->decoder_tid = SDL_CreateThread(fn, arg);
>> +if (!d->decoder_tid) {
>> +av_log(d, AV_LOG_FATAL, "SDL_CreateThread(): %s\n",
>> SDL_GetError());
>> +return AVERROR(ENOMEM);
>> +}
>> +return 0;
>> }
>>
>> static int video_thread(void *arg)
>> @@ -2681,7 +2686,8 @@ static int stream_component_open(VideoState *is, int
>> stream_index)
>> is->auddec.start_pts = is->audio_st->start_time;
>> is->auddec.start_pts_tb = is->audio_st->time_base;
>> }
>> -decoder_start(&is->auddec, audio_thread, is);
>> +if (decoder_start(&is->auddec, audio_thread, is) < 0)
>> +goto fail;
>> SDL_PauseAudio(0);
>> break;
>> case AVMEDIA_TYPE_VIDEO:
>> @@ -2692,7 +2698,8 @@ static int stream_component_open(VideoState *is, int
>> stream_index)
>> is->viddec_height = avctx->height;
>>
>> decoder_init(&is->viddec, avctx, &is->videoq,
>> is->continue_read_thread);
>> -decoder_start(&is->viddec, video_thread, is);
>> +if (decoder_start(&is->viddec, video_thread, is) < 0)
>> +goto fail;
>> is->queue_attachments_req = 1;
>> break;
>> case AVMEDIA_TYPE_SUBTITLE:
>> @@ -2700,7 +2707,8 @@ static int stream_component_open(VideoState *is, int
>> stream_index)
>> is->subtitle_st = ic->streams[stream_index];
>>
>> decoder_init(&is->subdec, avctx, &is->subtitleq,
>> is->continue_read_thread);
>> -decoder_start(&is->subdec, subtitle_thread, is);
>> +if (decoder_start(&is->subdec, subtitle_thread, is) < 0)
>> +goto fail;
>
>
> You should propagate the error code to the failure path, otherwise
> stream_component_open will simply return with zero in case of error as well.

Thanks, updated patch. I also changed AV_LOG_FATAL to AV_LOG_ERROR,
since (I assume) even if one stream component fails, others might
still be able to be opened, i.e a "lossy playback" is still
theoretically possible.

>
> Regards,
> Marton
> ___
> 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] [PATCHv2] ffplay: more robust thread creation

2015-10-03 Thread Ganesh Ajjanagadde
SDL_CreateThread can fail:
https://wiki.libsdl.org/SDL_CreateThread.
This patch makes thread creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde 
---
 ffplay.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index b7b2b0b..c5a7895 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2080,10 +2080,15 @@ static int audio_thread(void *arg)
 return ret;
 }
 
-static void decoder_start(Decoder *d, int (*fn)(void *), void *arg)
+static int decoder_start(Decoder *d, int (*fn)(void *), void *arg)
 {
 packet_queue_start(d->queue);
 d->decoder_tid = SDL_CreateThread(fn, arg);
+if (!d->decoder_tid) {
+av_log(d, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError());
+return AVERROR(ENOMEM);
+}
+return 0;
 }
 
 static int video_thread(void *arg)
@@ -2681,7 +2686,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->auddec.start_pts = is->audio_st->start_time;
 is->auddec.start_pts_tb = is->audio_st->time_base;
 }
-decoder_start(&is->auddec, audio_thread, is);
+if ((ret = decoder_start(&is->auddec, audio_thread, is)) < 0)
+goto fail;
 SDL_PauseAudio(0);
 break;
 case AVMEDIA_TYPE_VIDEO:
@@ -2692,7 +2698,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->viddec_height = avctx->height;
 
 decoder_init(&is->viddec, avctx, &is->videoq, 
is->continue_read_thread);
-decoder_start(&is->viddec, video_thread, is);
+if ((ret = decoder_start(&is->viddec, video_thread, is)) < 0)
+goto fail;
 is->queue_attachments_req = 1;
 break;
 case AVMEDIA_TYPE_SUBTITLE:
@@ -2700,7 +2707,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->subtitle_st = ic->streams[stream_index];
 
 decoder_init(&is->subdec, avctx, &is->subtitleq, 
is->continue_read_thread);
-decoder_start(&is->subdec, subtitle_thread, is);
+if ((ret = decoder_start(&is->subdec, subtitle_thread, is)) < 0)
+goto fail;
 break;
 default:
 break;
-- 
2.6.0

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


[FFmpeg-devel] [PATCH] libavformat/tls_securetransport: silence uninitialized value warning

2015-10-03 Thread Rodger Combs
---
 libavformat/tls_securetransport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/tls_securetransport.c 
b/libavformat/tls_securetransport.c
index 73662d7..cdc7953 100644
--- a/libavformat/tls_securetransport.c
+++ b/libavformat/tls_securetransport.c
@@ -350,7 +350,7 @@ static int map_ssl_error(OSStatus status, size_t processed)
 static int tls_read(URLContext *h, uint8_t *buf, int size)
 {
 TLSContext *c = h->priv_data;
-size_t processed;
+size_t processed = 0;
 int ret = map_ssl_error(SSLRead(c->ssl_context, buf, size, &processed), 
processed);
 if (ret > 0)
 return ret;
@@ -362,7 +362,7 @@ static int tls_read(URLContext *h, uint8_t *buf, int size)
 static int tls_write(URLContext *h, const uint8_t *buf, int size)
 {
 TLSContext *c = h->priv_data;
-size_t processed;
+size_t processed = 0;
 int ret = map_ssl_error(SSLWrite(c->ssl_context, buf, size, &processed), 
processed);
 if (ret > 0)
 return ret;
-- 
2.6.0

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


[FFmpeg-devel] [PATCH] lavf: add chromaprint muxer

2015-10-03 Thread Rodger Combs
---
 Changelog |   1 +
 configure |   4 +
 doc/muxers.texi   |  35 +
 libavformat/Makefile  |   1 +
 libavformat/allformats.c  |   1 +
 libavformat/chromaprint.c | 186 ++
 libavformat/version.h |   4 +-
 7 files changed, 230 insertions(+), 2 deletions(-)
 create mode 100644 libavformat/chromaprint.c

diff --git a/Changelog b/Changelog
index bbb9ed0..4b18d00 100644
--- a/Changelog
+++ b/Changelog
@@ -14,6 +14,7 @@ version :
 - chromakey filter
 - maskedmerge filter
 - Screenpresso SPV1 decoding
+- chromaprint fingerprinting muxer
 
 
 version 2.8:
diff --git a/configure b/configure
index 3ee1ed2..3b1aea7 100755
--- a/configure
+++ b/configure
@@ -196,6 +196,7 @@ Individual component options:
 External library support:
   --enable-avisynthenable reading of AviSynth script files [no]
   --disable-bzlib  disable bzlib [autodetect]
+  --enable-chromaprint enable audio fingerprinting with chromaprint [no]
   --enable-fontconfig  enable fontconfig, useful for drawtext filter [no]
   --enable-frei0r  enable frei0r video filtering [no]
   --enable-gnutls  enable gnutls, needed for https support
@@ -1367,6 +1368,7 @@ EXAMPLE_LIST="
 EXTERNAL_LIBRARY_LIST="
 avisynth
 bzlib
+chromaprint
 crystalhd
 decklink
 frei0r
@@ -2507,6 +2509,7 @@ vc1_parser_select="mpegvideo startcode vc1_decoder"
 mjpeg2jpeg_bsf_select="jpegtables"
 
 # external libraries
+chromaprint_muxer_deps="chromaprint"
 libaacplus_encoder_deps="libaacplus"
 libcelt_decoder_deps="libcelt"
 libdcadec_decoder_deps="libdcadec"
@@ -5255,6 +5258,7 @@ enabled avfoundation_indev && { check_lib2 
CoreGraphics/CoreGraphics.h CGGetActi
 enabled avisynth  && { { check_lib2 "windows.h" LoadLibrary; } ||
{ check_lib2 "dlfcn.h" dlopen -ldl; } ||
die "ERROR: LoadLibrary/dlopen not found for 
avisynth"; }
+enabled chromaprint   && require chromaprint chromaprint.h 
chromaprint_get_version -lchromaprint
 enabled decklink  && { check_header DeckLinkAPI.h || die "ERROR: 
DeckLinkAPI.h header not found"; }
 enabled frei0r&& { check_header frei0r.h || die "ERROR: frei0r.h 
header not found"; }
 enabled gnutls&& require_pkg_config gnutls gnutls/gnutls.h 
gnutls_global_init
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 86ca4ad..91d131f 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -37,6 +37,41 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4.
 
 @end table
 
+@anchor{chromaprint}
+@section chromaprint
+
+Chromaprint fingerprinter
+
+This muxer feeds audio data to the Chromaprint library, which generates
+a fingerprint for the provided audio data. It takes a single signed
+native-endian 16-bit raw audio stream.
+
+@subsection Options
+
+@table @option
+@item silence_threshold
+Threshold for detecting silence, ranges from 0 to 32767. -1 for default
+(required for use with the AcoustID service).
+
+@item algorithm
+Algorithm index to fingerprint with.
+
+@item fp_format
+Format to output the fingerprint as. Accepts the following options:
+@table @samp
+@item raw
+Binary raw fingerprint
+
+@item compressed
+Binary compressed fingerprint
+
+@item base64
+Base64 compressed fingerprint
+
+@end table
+
+@end table
+
 @anchor{crc}
 @section crc
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 466da51..c9bf20f 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -487,6 +487,7 @@ OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER)+= yuv4mpegenc.o
 OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER)  += yuv4mpegdec.o
 
 # external libraries
+OBJS-$(CONFIG_CHROMAPRINT_MUXER) += chromaprint.o
 OBJS-$(CONFIG_LIBGME_DEMUXER)+= libgme.o
 OBJS-$(CONFIG_LIBMODPLUG_DEMUXER)+= libmodplug.o
 OBJS-$(CONFIG_LIBNUT_DEMUXER)+= libnut.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0a24ac7..0ccde9d 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -391,6 +391,7 @@ void av_register_all(void)
 REGISTER_PROTOCOL(UNIX, unix);
 
 /* external libraries */
+REGISTER_MUXER   (CHROMAPRINT,  chromaprint);
 REGISTER_DEMUXER (LIBGME,   libgme);
 REGISTER_DEMUXER (LIBMODPLUG,   libmodplug);
 REGISTER_MUXDEMUX(LIBNUT,   libnut);
diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
new file mode 100644
index 000..4d67f43
--- /dev/null
+++ b/libavformat/chromaprint.c
@@ -0,0 +1,186 @@
+/*
+ * Chromaprint fingerprinting muxer
+ * Copyright (c) 2015 Rodger Combs
+ *
+ * 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.

Re: [FFmpeg-devel] [PATCH] libavformat/hlsenc: Use of uninitialized memory unlinking old files

2015-10-03 Thread Michael Niedermayer
On Thu, Oct 01, 2015 at 07:21:33PM -0400, DeHackEd wrote:
> From: DHE 
> 
> Fixes ticket#4900
> 
> Signed-off-by: DHE 

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH] ffplay: more robust thread creation

2015-10-03 Thread Marton Balint


On Sat, 3 Oct 2015, Ganesh Ajjanagadde wrote:


SDL_CreateThread can fail:
https://wiki.libsdl.org/SDL_CreateThread.
This patch makes thread creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde 
---
ffplay.c | 16 
1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index b7b2b0b..da0fd3a 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2080,10 +2080,15 @@ static int audio_thread(void *arg)
return ret;
}

-static void decoder_start(Decoder *d, int (*fn)(void *), void *arg)
+static int decoder_start(Decoder *d, int (*fn)(void *), void *arg)
{
packet_queue_start(d->queue);
d->decoder_tid = SDL_CreateThread(fn, arg);
+if (!d->decoder_tid) {
+av_log(d, AV_LOG_FATAL, "SDL_CreateThread(): %s\n", SDL_GetError());
+return AVERROR(ENOMEM);
+}
+return 0;
}

static int video_thread(void *arg)
@@ -2681,7 +2686,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
is->auddec.start_pts = is->audio_st->start_time;
is->auddec.start_pts_tb = is->audio_st->time_base;
}
-decoder_start(&is->auddec, audio_thread, is);
+if (decoder_start(&is->auddec, audio_thread, is) < 0)
+goto fail;
SDL_PauseAudio(0);
break;
case AVMEDIA_TYPE_VIDEO:
@@ -2692,7 +2698,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
is->viddec_height = avctx->height;

decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread);
-decoder_start(&is->viddec, video_thread, is);
+if (decoder_start(&is->viddec, video_thread, is) < 0)
+goto fail;
is->queue_attachments_req = 1;
break;
case AVMEDIA_TYPE_SUBTITLE:
@@ -2700,7 +2707,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
is->subtitle_st = ic->streams[stream_index];

decoder_init(&is->subdec, avctx, &is->subtitleq, 
is->continue_read_thread);
-decoder_start(&is->subdec, subtitle_thread, is);
+if (decoder_start(&is->subdec, subtitle_thread, is) < 0)
+goto fail;


You should propagate the error code to the failure path, otherwise 
stream_component_open will simply return with zero in case of error as 
well.


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


Re: [FFmpeg-devel] [PATCH]Remove --disable-avutil and sanitize --disable-all

2015-10-03 Thread Carl Eugen Hoyos
On Thursday 24 September 2015 04:01:12 am Carl Eugen Hoyos wrote:

> diff --git a/configure b/configure
> index f6bc622..f9c035b 100755
> --- a/configure
> +++ b/configure
> @@ -128,7 +128,6 @@ Component options:
>    --disable-avdevice       disable libavdevice build
>    --disable-avcodec        disable libavcodec build
>    --disable-avformat       disable libavformat build
> -  --disable-avutil         disable libavutil build
>    --disable-swresample     disable libswresample build
>    --disable-swscale        disable libswscale build
>    --disable-postproc       disable libpostproc build

I applied this hunk.

> @@ -3110,6 +3109,7 @@ for opt do
>          --disable-all)
>              map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
>              disable $LIBRARY_LIST $PROGRAM_LIST doc
> +            enable avutil
>          ;;
>          --enable-random|--disable-random)
>              action=${opt%%-random}

I believe this simplifies using --disable-all, so I will commit 
if I find no better solution.

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


[FFmpeg-devel] [PATCH] concatdec: fix metadata memleak on error

2015-10-03 Thread Marton Balint
Fixes Coverity CID 1323077.

Signed-off-by: Marton Balint 
---
 libavformat/concatdec.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 88b6dbe..832b7f4 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -389,16 +389,16 @@ static int concat_read_header(AVFormatContext *avf)
 file->outpoint = dur;
 } else if (!strcmp(keyword, "file_packet_metadata")) {
 char *metadata;
-metadata = av_get_token((const char **)&cursor, SPACE_CHARS);
-if (!metadata) {
-av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata 
required\n", line);
-FAIL(AVERROR_INVALIDDATA);
-}
 if (!file) {
 av_log(avf, AV_LOG_ERROR, "Line %d: %s without file\n",
line, keyword);
 FAIL(AVERROR_INVALIDDATA);
 }
+metadata = av_get_token((const char **)&cursor, SPACE_CHARS);
+if (!metadata) {
+av_log(avf, AV_LOG_ERROR, "Line %d: packet metadata 
required\n", line);
+FAIL(AVERROR_INVALIDDATA);
+}
 if ((ret = av_dict_parse_string(&file->metadata, metadata, "=", 
"", 0)) < 0) {
 av_log(avf, AV_LOG_ERROR, "Line %d: failed to parse metadata 
string\n", line);
 av_freep(&metadata);
-- 
2.1.4

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


Re: [FFmpeg-devel] [PATCH]Set option flags for AV_CODEC_FLAG_TRUNCATED

2015-10-03 Thread Carl Eugen Hoyos
On Wednesday 23 September 2015 09:36:35 am Carl Eugen Hoyos wrote:

> The flag truncated is currently not shown by the help output.

Patch applied after being ok'ed by Michael.

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


Re: [FFmpeg-devel] [PATCH]lavf/rawdec: Simplify mlp/thd probe function

2015-10-03 Thread Carl Eugen Hoyos
On Saturday 03 October 2015 01:32:11 am Michael Niedermayer wrote:

> >  rawdec.c |   13 ++---
> >  1 file changed, 6 insertions(+), 7 deletions(-)
> > 2ac4375102534142befdaf1482543dceb73ae306  patchmlpprobe.diff
>
> LGTM
>
> thx

Patch applied after moving the demuxers in a new file.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/shortendec: Autodetect raw Shorten streams.

2015-10-03 Thread Carl Eugen Hoyos
On Saturday 03 October 2015 06:51:26 pm Michael Niedermayer wrote:

> >  Makefile |2 -
> >  rawdec.c |   12 -
> >  shortendec.c |   71
> > +++ version.h   
> > |2 -
> >  4 files changed, 73 insertions(+), 14 deletions(-)
> > 5c59131e01c4a4e864963890fdebf635eeb1df3c  patchshn.diff
>
> LGTM

Patch applied.

Thank you, Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libx264: copy A53 closed captions from source

2015-10-03 Thread Michael Niedermayer
On Tue, Sep 29, 2015 at 01:19:34PM -0400, DeHackEd wrote:
> Assumes 'GA94' format (ATSC standard)
> 
> Signed-off-by: DHE 
> ---
>  doc/encoders.texi|  4 
>  libavcodec/libx264.c | 45 +
>  2 files changed, 49 insertions(+)

applied

thanks

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-03 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 08:58:10AM +0200, Christophe Gisquet wrote:
> 2015-09-28 18:51 GMT+02:00 Christophe Gisquet :
> [SNIP]
> 
> Could someone also apply the cosmetic patch for reindentation?

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCHv3] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Michael Niedermayer
On Sat, Oct 03, 2015 at 02:48:14PM -0400, Ganesh Ajjanagadde wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied

thanks

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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


Re: [FFmpeg-devel] [PATCH] avcodec: remove old vdpau decoder implementation

2015-10-03 Thread wm4
On Sat, 3 Oct 2015 22:23:21 +0200
Carl Eugen Hoyos  wrote:

> On Saturday 03 October 2015 10:05:29 pm wm4 wrote:
> > Ping. Will push in 24 hours or so if nobody complains.
> 
> The reason I am against this is just that users told me 
> repeatedly (in person) that they switched from the dark 
> side to FFmpeg because this (and possibly) other API 
> was removed there.

As I've said several times, progress is not possible (or requires lots
of wasted energy) if we don't drop obsolete APIs. And at this point,
the new vdpau API is definitely superior over the old one. I don't know
why anyone would want to use the old API.

> I simply don't understand what the advantage is of 
> removing a few lines of code.

That's not a few lines, that's over 600 lines. To make it worse, it's
all duplicated code, duplicating functionality the vdpau hwaccel
provides. Unlike the hwaccel code, it's not cleanly integrated either.
Just look how intrusive it is, while hwaccel is basically just a bunch
of callbacks in the right places (and works for multiple hwdec APIs, not
just vdpau).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] ffmpeg: modify tty state when stderr is redirected

2015-10-03 Thread Ganesh Ajjanagadde
ping
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]configure: Simplify dependencies

2015-10-03 Thread Carl Eugen Hoyos
On Saturday 03 October 2015 05:45:46 pm Carl Eugen Hoyos wrote:

> Attached patch simplifies dependencies in configure, avutil is always
> built. It also simplifies usage of --disable-all

This does not work (fate fails), I will most likely apply the small patch that 
forces enabling avutil for --disable-all.

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


Re: [FFmpeg-devel] [PATCH] avcodec: remove old vdpau decoder implementation

2015-10-03 Thread Carl Eugen Hoyos
On Saturday 03 October 2015 10:05:29 pm wm4 wrote:
> Ping. Will push in 24 hours or so if nobody complains.

The reason I am against this is just that users told me 
repeatedly (in person) that they switched from the dark 
side to FFmpeg because this (and possibly) other API 
was removed there.

I simply don't understand what the advantage is of 
removing a few lines of code.

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


Re: [FFmpeg-devel] [PATCH] avcodec: remove old vdpau decoder implementation

2015-10-03 Thread wm4
On Fri,  2 Oct 2015 20:56:10 +0200
wm4  wrote:

> This is all duplicated functionality with the vdpau hwaccel API, which
> was introduced almost 3 years ago.
> 
> API users had time enough to switch to the new API. But note that the
> API stubs are kept, and old programs will still compile against modern
> libavcodec.
> ---
>  configure |  11 --
>  libavcodec/allcodecs.c|  16 --
>  libavcodec/error_resilience.c |   3 -
>  libavcodec/h263dec.c  |   8 -
>  libavcodec/h264.c |  43 +-
>  libavcodec/h264_picture.c |  13 --
>  libavcodec/h264_slice.c   |  23 +--
>  libavcodec/mpeg12dec.c|  64 +---
>  libavcodec/mpeg4videodec.c|  26 
>  libavcodec/mpegpicture.c  |   6 +-
>  libavcodec/mpegvideo.c|  13 +-
>  libavcodec/utils.c|   4 -
>  libavcodec/vc1dec.c   |  71 +
>  libavcodec/vdpau.c| 340 
> --
>  libavcodec/vdpau_compat.h |  48 --
>  15 files changed, 10 insertions(+), 679 deletions(-)
>  delete mode 100644 libavcodec/vdpau_compat.h
> 

Ping. Will push in 24 hours or so if nobody complains.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

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

On Sat, Oct 3, 2015 at 2:46 PM, James Darnley 
wrote:

> On 2015-10-03 04:08, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Fri, Oct 2, 2015 at 4:58 PM, Hendrik Leppkes 
> wrote:
> >
> >> On Fri, Oct 2, 2015 at 7:16 PM, Timothy Gu 
> wrote:
> >>> On Fri, Oct 2, 2015 at 10:08 AM James Darnley  >
> >>> wrote:
> >>>
>  The third patch uses them in the remaining inline assembly.
> 
> >>>
> >>> That's the crux of the problem: inline asm uses these constants, but
> will
> >>> be unable to without yasm. Either we drop compatibility for inline asm
> >> for
> >>> x86 platforms w/o yasm, or we can't do this.
> >>>
> >>
> >> A build without yasm is gimped as it is, so disabling inline asm in
> >> the same go doesn't seem like a too terrible thing.
> >
> >
> > I'm leaning towards this as well.
>
> Then you will all be pleased to hear that I have fixed building with
> --disable-yasm by adding a HAVE_YASM check to a few functions in cavs
> (the Chinese H.264 knockoff) and many functions in vc1.  One conditional
> in inline_asm has also been extended.  At least this fixes building
> ffmpeg for the people who use --disable-yasm.
>
> As for porting, I know I said "how hard can this be"...quite a lot
> actually.  I ported 1 function in cavs last night but after going though
> vc1 to fix building I can see just how much work that would be.


We've had various efforts in that direction. The problem is that typically
people add new inline asm over time, even if it's discouraged. Any effort
you're willing to put into conversion of that code would be hugely
appreciated. But as you can also see, people don't care much about
vc1/cavs, not remotely as much as they do about mpeg1/2/4/h264/etc. Which
is why their conversion is lagging :)

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


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 11:32 AM, Henrik Gramner  wrote:
> On Sat, Oct 3, 2015 at 4:22 PM, Ganesh Ajjanagadde  wrote:
>> Should we go ahead with the INT32_MIN then?
>
> That seems sensible.

updated patch.

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


Re: [FFmpeg-devel] [PATCH][RFC] configure: silence preprocessor noise from dependency generation

2015-10-03 Thread Michael Niedermayer
On Fri, Sep 18, 2015 at 03:28:47PM -0400, Ganesh Ajjanagadde wrote:
> Currently, errors are thrown for various macros while building that are 
> completely bogus.
> They occur during the dependency (.d) generation phase, and have no bearing 
> on the compiled output,
> since only the stdout is piped into the sed command to generate the .d files.
> They basically occur as the relevant -I paths are not (and cannot be passed) 
> during
> the dependancy generation phase.
> As such, this patch silences them.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index e5d7b12..6f9be48 100755
> --- a/configure
> +++ b/configure
> @@ -2975,7 +2975,7 @@ target_path='$(CURDIR)'
>  
>  # since the object filename is not given with the -MM flag, the compiler
>  # is only able to print the basename, and we must add the path ourselves
> -DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" 
> -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
> +DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e 
> "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
>  DEPFLAGS='-MM'

applied

thanks

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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


[FFmpeg-devel] [PATCHv3] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/apedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 7b34d26..fcccfbe 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int version, 
APEFilter *f,
 /* Update the adaption coefficients */
 absres = FFABS(res);
 if (absres)
-*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
+*f->adaptcoeffs = ((res & INT32_MIN) ^ (-(1<<30))) >>
   (25 + (absres <= f->avg*3) + (absres <= 
f->avg*4/3));
 else
 *f->adaptcoeffs = 0;
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

2015-10-03 Thread James Darnley
On 2015-10-03 04:08, Ronald S. Bultje wrote:
> Hi,
> 
> On Fri, Oct 2, 2015 at 4:58 PM, Hendrik Leppkes  wrote:
> 
>> On Fri, Oct 2, 2015 at 7:16 PM, Timothy Gu  wrote:
>>> On Fri, Oct 2, 2015 at 10:08 AM James Darnley 
>>> wrote:
>>>
 The third patch uses them in the remaining inline assembly.

>>>
>>> That's the crux of the problem: inline asm uses these constants, but will
>>> be unable to without yasm. Either we drop compatibility for inline asm
>> for
>>> x86 platforms w/o yasm, or we can't do this.
>>>
>>
>> A build without yasm is gimped as it is, so disabling inline asm in
>> the same go doesn't seem like a too terrible thing.
> 
> 
> I'm leaning towards this as well.

Then you will all be pleased to hear that I have fixed building with
--disable-yasm by adding a HAVE_YASM check to a few functions in cavs
(the Chinese H.264 knockoff) and many functions in vc1.  One conditional
in inline_asm has also been extended.  At least this fixes building
ffmpeg for the people who use --disable-yasm.

As for porting, I know I said "how hard can this be"...quite a lot
actually.  I ported 1 function in cavs last night but after going though
vc1 to fix building I can see just how much work that would be.



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


Re: [FFmpeg-devel] [PATCH] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 2:25 PM, Michael Niedermayer  wrote:
> On Sat, Oct 03, 2015 at 11:13:35AM -0400, Ronald S. Bultje wrote:
>> Hi,
>>
>> On Thu, Sep 17, 2015 at 7:51 AM, Michael Niedermayer 
>> wrote:
>>
>> > On Thu, Sep 17, 2015 at 06:54:37AM -0400, Ganesh Ajjanagadde wrote:
>> > > On Thu, Sep 17, 2015 at 6:17 AM, Michael Niedermayer 
>> > wrote:
>> > > > On Wed, Sep 16, 2015 at 10:22:27PM -0400, Ganesh Ajjanagadde wrote:
>> > > >> When compiled with --disable-pthreads, e.g
>> > > >>
>> > http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7
>> > ,
>> > > >> a bunch of -Wunused-functions are reported due to missing header
>> > guards
>> > > >> around threading related functions.
>> > > >> This patch should silence such warnings.
>> > > >>
>> > > >> Signed-off-by: Ganesh Ajjanagadde 
>> > > >> ---
>> > > >>  libavcodec/alac.c  | 2 ++
>> > > >>  libavcodec/exr.c   | 2 ++
>> > > >>  libavcodec/ffv1dec.c   | 4 
>> > > >>  libavcodec/flacdec.c   | 2 ++
>> > > >>  libavcodec/h264.c  | 2 ++
>> > > >>  libavcodec/huffyuvdec.c| 2 ++
>> > > >>  libavcodec/mdec.c  | 2 ++
>> > > >>  libavcodec/mimic.c | 4 
>> > > >>  libavcodec/mpeg12dec.c | 2 ++
>> > > >>  libavcodec/mpeg4videodec.c | 2 ++
>> > > >>  libavcodec/pngdec.c| 2 ++
>> > > >>  libavcodec/takdec.c| 2 ++
>> > > >>  libavcodec/tta.c   | 2 ++
>> > > >>  libavcodec/vp3.c   | 4 
>> > > >>  libavcodec/vp8.c   | 2 ++
>> > > >>  libavcodec/vp9.c   | 2 ++
>> > > >>  libavcodec/wavpack.c   | 2 ++
>> > > >>  17 files changed, 40 insertions(+)
>> > > >
>> > > > av_unused might be simpler to silence these warnings than #if
>> > >
>> > > I do not think this is consistent at the moment across the codebase;
>> > > sometimes we use header guards and sometimes we use av_unused. Please
>> > > tell me if what the rationale is for either of them; I am fine either
>> > > way. Any half decent compiler should anyway remove unused functions
>> > > when compiled with optimizations.
>> >
>> > #ifs will be more work to maintain as they can break build if a new
>> > function call or function is added. av_unused cannot break build
>> > #ifs also make the code harder to read, especially if there are
>> > already some #ifs there before
>> >
>> > #ifs make sense for non static symbols as they cannot be removed by
>> > the compiler or linker generally
>> >
>> > #ifs could also be used to structure code in a file if for some
>> > reason its unwanted to split it in several files
>> > #ifs also gurantee that code is removed and this makes sense in
>> > performance critical code
>> > #ifs can be used for any group of lines not just functions/variables
>> > as for av_unused
>>
>>
>> Michael, how strong is your objection here? Me and wm4 seem to have a
>> slight preference for #if over av_unused, since av_unused runs the risk of
>> rotting with code over time.
>
> iam almost neutral to the #if vs ununsed vs nothing question.
> i just felt that av_unused would be less work to maintain than #if,
> iam fine with any of the 3

As the author of this stuff, I am fine with any of the 3 as well, with
a very slight bias towards the HAVE_THREADS solution.

>
> [...]
> --
> 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 ..."
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

2015-10-03 Thread Michael Niedermayer
On Sat, Oct 03, 2015 at 11:13:35AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, Sep 17, 2015 at 7:51 AM, Michael Niedermayer 
> wrote:
> 
> > On Thu, Sep 17, 2015 at 06:54:37AM -0400, Ganesh Ajjanagadde wrote:
> > > On Thu, Sep 17, 2015 at 6:17 AM, Michael Niedermayer 
> > wrote:
> > > > On Wed, Sep 16, 2015 at 10:22:27PM -0400, Ganesh Ajjanagadde wrote:
> > > >> When compiled with --disable-pthreads, e.g
> > > >>
> > http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7
> > ,
> > > >> a bunch of -Wunused-functions are reported due to missing header
> > guards
> > > >> around threading related functions.
> > > >> This patch should silence such warnings.
> > > >>
> > > >> Signed-off-by: Ganesh Ajjanagadde 
> > > >> ---
> > > >>  libavcodec/alac.c  | 2 ++
> > > >>  libavcodec/exr.c   | 2 ++
> > > >>  libavcodec/ffv1dec.c   | 4 
> > > >>  libavcodec/flacdec.c   | 2 ++
> > > >>  libavcodec/h264.c  | 2 ++
> > > >>  libavcodec/huffyuvdec.c| 2 ++
> > > >>  libavcodec/mdec.c  | 2 ++
> > > >>  libavcodec/mimic.c | 4 
> > > >>  libavcodec/mpeg12dec.c | 2 ++
> > > >>  libavcodec/mpeg4videodec.c | 2 ++
> > > >>  libavcodec/pngdec.c| 2 ++
> > > >>  libavcodec/takdec.c| 2 ++
> > > >>  libavcodec/tta.c   | 2 ++
> > > >>  libavcodec/vp3.c   | 4 
> > > >>  libavcodec/vp8.c   | 2 ++
> > > >>  libavcodec/vp9.c   | 2 ++
> > > >>  libavcodec/wavpack.c   | 2 ++
> > > >>  17 files changed, 40 insertions(+)
> > > >
> > > > av_unused might be simpler to silence these warnings than #if
> > >
> > > I do not think this is consistent at the moment across the codebase;
> > > sometimes we use header guards and sometimes we use av_unused. Please
> > > tell me if what the rationale is for either of them; I am fine either
> > > way. Any half decent compiler should anyway remove unused functions
> > > when compiled with optimizations.
> >
> > #ifs will be more work to maintain as they can break build if a new
> > function call or function is added. av_unused cannot break build
> > #ifs also make the code harder to read, especially if there are
> > already some #ifs there before
> >
> > #ifs make sense for non static symbols as they cannot be removed by
> > the compiler or linker generally
> >
> > #ifs could also be used to structure code in a file if for some
> > reason its unwanted to split it in several files
> > #ifs also gurantee that code is removed and this makes sense in
> > performance critical code
> > #ifs can be used for any group of lines not just functions/variables
> > as for av_unused
> 
> 
> Michael, how strong is your objection here? Me and wm4 seem to have a
> slight preference for #if over av_unused, since av_unused runs the risk of
> rotting with code over time.

iam almost neutral to the #if vs ununsed vs nothing question.
i just felt that av_unused would be less work to maintain than #if,
iam fine with any of the 3

[...]
-- 
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] libavformat/hlsenc: Use of uninitialized memory unlinking old files

2015-10-03 Thread DeHackEd
Pinging this issue. While likely not a security concern it does cause
uninitialized memory to be printed to the user's terminal and that's pretty
bad.

On 10/01/2015 07:21 PM, DeHackEd wrote:
> From: DHE 
> 
> Fixes ticket#4900
> 
> Signed-off-by: DHE 
> ---
>  libavformat/hlsenc.c | 29 +
>  1 file changed, 17 insertions(+), 12 deletions(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 473ca3a..8daf53f 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -165,12 +165,6 @@ static int hls_delete_old_segments(HLSContext *hls) {
>  ret = AVERROR(ENOMEM);
>  goto fail;
>  }
> -sub_path_size = strlen(dirname) + strlen(segment->sub_filename) + 1;
> -sub_path = av_malloc(sub_path_size);
> -if (!sub_path) {
> -ret = AVERROR(ENOMEM);
> -goto fail;
> -}
>  
>  av_strlcpy(path, dirname, path_size);
>  av_strlcat(path, segment->filename, path_size);
> @@ -179,14 +173,23 @@ static int hls_delete_old_segments(HLSContext *hls) {
>   path, strerror(errno));
>  }
>  
> -av_strlcpy(sub_path, dirname, sub_path_size);
> -av_strlcat(sub_path, segment->sub_filename, sub_path_size);
> -if (unlink(sub_path) < 0) {
> -av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: 
> %s\n",
> - sub_path, strerror(errno));
> +if (segment->sub_filename[0] != '\0') {
> +sub_path_size = strlen(dirname) + strlen(segment->sub_filename) 
> + 1;
> +sub_path = av_malloc(sub_path_size);
> +if (!sub_path) {
> +ret = AVERROR(ENOMEM);
> +goto fail;
> +}
> +
> +av_strlcpy(sub_path, dirname, sub_path_size);
> +av_strlcat(sub_path, segment->sub_filename, sub_path_size);
> +if (unlink(sub_path) < 0) {
> +av_log(hls, AV_LOG_ERROR, "failed to delete old segment %s: 
> %s\n",
> + sub_path, strerror(errno));
> +}
> +av_free(sub_path);
>  }
>  av_freep(&path);
> -av_free(sub_path);
>  previous_segment = segment;
>  segment = previous_segment->next;
>  av_free(previous_segment);
> @@ -312,6 +315,8 @@ static int hls_append_segment(HLSContext *hls, double 
> duration, int64_t pos,
>  
>  if(hls->has_subtitle)
>  av_strlcpy(en->sub_filename, av_basename(hls->vtt_avf->filename), 
> sizeof(en->sub_filename));
> +else
> +en->sub_filename[0] = '\0';
>  
>  en->duration = duration;
>  en->pos  = pos;
> 

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


Re: [FFmpeg-devel] [PATCH 1/9] dnxhddec: cleanup frame header parsing

2015-10-03 Thread Carl Eugen Hoyos
On Saturday 03 October 2015 06:59:14 pm Christophe Gisquet wrote:
> +++ b/libavcodec/dnxhddec.c
> @@ -10,7 +10,6 @@
>   * 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.

Looks unintended...

Very impressive patchset!

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


Re: [FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

2015-10-03 Thread Paul B Mahol
On 9/19/15, Ganesh Ajjanagadde  wrote:
> This patch silences such warnings by placing initializations under a header
> guard,
> see e.g
> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale,
> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
> for examples of such warnings.
> It also has the benefit of placing library specific #defines next to each
> other.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  cmdutils.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/cmdutils.c b/cmdutils.c
> index b696008..38d6334 100644
> --- a/cmdutils.c
> +++ b/cmdutils.c
> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt, const
> char *arg)
>  #if CONFIG_AVRESAMPLE
>  const AVClass *rc = avresample_get_class();
>  #endif
> -const AVClass *sc, *swr_class;
> +#if CONFIG_SWSCALE
> +const AVClass *sc = sws_get_class();
> +#endif
> +#if CONFIG_SWRESAMPLE
> +const AVClass *swr_class = swr_get_class();
> +#endif
>
>  if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
>  av_log_set_level(AV_LOG_DEBUG);
> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt, const
> char *arg)
>  consumed = 1;
>  }
>  #if CONFIG_SWSCALE
> -sc = sws_get_class();
>  if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
>   AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)))
> {
>  struct SwsContext *sws = sws_alloc_context();
> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt, const
> char *arg)
>  }
>  #endif
>  #if CONFIG_SWRESAMPLE
> -swr_class = swr_get_class();
>  if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
>  AV_OPT_SEARCH_CHILDREN |
> AV_OPT_SEARCH_FAKE_OBJ))) {
>  struct SwrContext *swr = swr_alloc();
> --
> 2.5.2
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>

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


[FFmpeg-devel] [PATCH 6/9] dnxhd: add decoder support for DNxHR

2015-10-03 Thread Christophe Gisquet
From: Jeremy James 

Signed-off-by: Christophe Gisquet 
---
 libavcodec/dnxhddata.c | 8 
 libavcodec/dnxhddec.c  | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 798cc0e..5fb7a5e 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1073,6 +1073,14 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_ac_flags,
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 80, 90, 100, 110 } },
+{ 1274, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE,
+  0, 4, 8, 3,
+  dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
+  dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
+  dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
+  dnxhd_1237_ac_flags,
+  dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
+  { 0 } },
 };
 
 int ff_dnxhd_get_cid_table(int cid)
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index d7370a6..b39d68f 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -152,6 +152,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 {
 static const uint8_t header_prefix[]= { 0x00, 0x00, 0x02, 0x80, 0x01 };
 static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
+static const uint8_t header_prefixhr[] = { 0x00, 0x00, 0x02, 0x80, 0x03 };
 int i, cid, ret;
 int old_bit_depth = ctx->bit_depth;
 
@@ -161,7 +162,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 return AVERROR_INVALIDDATA;
 }
 
-if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
+if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5) && 
memcmp(buf, header_prefixhr, 5)) {
 av_log(ctx->avctx, AV_LOG_ERROR,
"unknown header 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n",
buf[0], buf[1], buf[2], buf[3], buf[4]);
-- 
2.5.2

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


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

2015-10-03 Thread Christophe Gisquet
The functions related to bitstream reading must use the natural zigzag
order, and not the one permuted for use in the iDCT.

This resulted in a bitstream where the AC coefficients were encoded in
an unexpected order.
---
 libavcodec/dnxhdenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 7d96cd4..6eb5e1e 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -471,7 +471,7 @@ void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t 
*block,
 ctx->m.last_dc[n] = block[0];
 
 for (i = 1; i <= last_index; i++) {
-j = ctx->m.intra_scantable.permutated[i];
+j = ctx->m.intra_scantable.scantable[i];
 slevel = block[j];
 if (slevel) {
 int run_level = i - last_non_zero - 1;
@@ -546,7 +546,7 @@ int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t 
*block, int last_index)
 int bits = 0;
 int i, j, level;
 for (i = 1; i <= last_index; i++) {
-j = ctx->m.intra_scantable.permutated[i];
+j = ctx->m.intra_scantable.scantable[i];
 level = block[j];
 if (level) {
 int run_level = i - last_non_zero - 1;
-- 
2.5.2

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


[FFmpeg-devel] [PATCH 8/9] dnxhd: add better support for CIDs 1270 to 1274

2015-10-03 Thread Christophe Gisquet
From: Jeremy James 

These are DNxHR profiles with the following properties:
- Variable size in a profile (property added in a previous commit),
  requiring variable-sized macroblock table;
- Variable bitdepth, up to 12 bits.
- Better validation of buffer sizes and positions

Signed-off-by: Christophe Gisquet 
---
 libavcodec/dnxhddata.c | 64 +--
 libavcodec/dnxhddec.c  | 92 ++
 2 files changed, 118 insertions(+), 38 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index e2838de..241ce23 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -49,7 +49,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = {
 90, 90, 85, 79, 73, 73, 73, 73,
 };
 
-/* Used in CID 1237, 1253, 1259 */
+/* Used in CID 1237, 1253, 1259, 1273, 1274 */
 static const uint8_t dnxhd_1237_luma_weight[] = {
  0,  32,  33,  34, 34, 36, 37, 36,
 36,  37,  38,  38, 38, 39, 41, 44,
@@ -61,7 +61,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = {
 97, 100, 104, 102, 98, 98, 99, 99,
 };
 
-/* Used in CID 1237, 1253, 1259 */
+/* Used in CID 1237, 1253, 1259, 1273, 1274 */
 static const uint8_t dnxhd_1237_chroma_weight[] = {
  0,  32,  36,  39, 39, 38, 39,  41,
 45,  51,  57,  58, 53, 48, 47,  51,
@@ -73,6 +73,7 @@ static const uint8_t dnxhd_1237_chroma_weight[] = {
 97, 100, 104, 102, 98, 98, 99,  99,
 };
 
+/* Used in CID 1238, 1272 */
 static const uint8_t dnxhd_1238_luma_weight[] = {
  0, 32, 32, 33, 34, 33, 33, 33,
 33, 33, 33, 33, 33, 35, 37, 37,
@@ -84,6 +85,7 @@ static const uint8_t dnxhd_1238_luma_weight[] = {
 51, 53, 55, 57, 58, 59, 57, 57,
 };
 
+/* Used in CID 1238, 1272 */
 static const uint8_t dnxhd_1238_chroma_weight[] = {
  0, 32, 35, 35, 35, 34, 34, 35,
 39, 43, 45, 45, 41, 39, 40, 41,
@@ -95,6 +97,7 @@ static const uint8_t dnxhd_1238_chroma_weight[] = {
 82, 77, 80, 86, 84, 82, 82, 82,
 };
 
+/* Used in CID 1241, 1271 */
 static const uint8_t dnxhd_1241_luma_weight[] = {
  0, 32, 33, 34, 34, 35, 36, 37,
 36, 37, 38, 38, 38, 39, 39, 40,
@@ -106,6 +109,7 @@ static const uint8_t dnxhd_1241_luma_weight[] = {
 48, 46, 47, 48, 48, 49, 49, 49,
 };
 
+/* Used in CID 1241, 1271 */
 static const uint8_t dnxhd_1241_chroma_weight[] = {
  0, 32, 36, 38, 37, 37, 40, 41,
 40, 40, 42, 42, 41, 41, 41, 41,
@@ -261,17 +265,17 @@ static const uint8_t dnxhd_1235_dc_bits[14] = {
 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
 };
 
-/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */
+/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260, 
1272, 1273, 1274 */
 static const uint8_t dnxhd_1237_dc_codes[12] = {
 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
 };
 
-/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */
+/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260, 
1272, 1273, 1274 */
 static const uint8_t dnxhd_1237_dc_bits[12] = {
 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint16_t dnxhd_1237_ac_codes[257] = {
 0, 1, 4, 5,12,26,27,56,
57,58,59,   120,   121,   244,   245,   246,
@@ -308,7 +312,7 @@ static const uint16_t dnxhd_1237_ac_codes[257] = {
 65535,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint8_t dnxhd_1237_ac_bits[257] = {
  2,  2,  3,  3,  4,  5,  5,  6,  6,  6,  6,  7,  7,  8,  8,  8,
  8,  8,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 11, 11, 11,
@@ -329,7 +333,7 @@ static const uint8_t dnxhd_1237_ac_bits[257] = {
 16,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint8_t dnxhd_1237_ac_level[257] = {
   3,  3,  5,  0,  7,  9,  5, 11, 13, 15,  7, 17, 19, 21, 23, 25,
   9, 11, 27, 29, 31, 33, 13, 35, 37, 39, 41, 43, 15, 45, 47, 49,
@@ -350,7 +354,7 @@ static const uint8_t dnxhd_1237_ac_level[257] = {
 129,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint8_t dnxhd_1237_ac_flags[257] = {
 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0,
 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,
@@ -450,6 +454,7 @@ static const uint8_t dnxhd_1238_ac_level[257] = {
 129,
 }; /* 0 is EOB */
 
+/* Used in CID 1238, 1243, 1272 */
 static const uint8_t dnxhd_1238_ac_flags[257] = {
 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,
@@ -528,7 +533,7 @@ static const uint8_t dnxhd_1235_ac_bits[257] = {
 16,
 };
 
-/* Used in CID 1235, 1241, 1256 */
+/* Used in CID 1235, 1241, 1256, 1270, 1271 */
 static const uint8_t dnxhd_1235_ac_level[257] = {
   3, 

[FFmpeg-devel] [PATCH 7/9] dnxhd: add CID 1270

2015-10-03 Thread Christophe Gisquet
This a 4:4:4 10 bits profile, where image size is not fixed by the
profile, and which strays a bit outside the old frame header parsing
code.

Fixes ticket #4581 (DNxHR is not stricly supported, but that sequence is).
---
 libavcodec/dnxhddata.c | 24 
 libavcodec/dnxhddec.c  |  2 +-
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 5fb7a5e..e2838de 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -25,7 +25,7 @@
 
 /* The quantization tables below are in zigzag order! */
 
-/* Used in CID 1235, 1256 */
+/* Used in CID 1235, 1256, 1270 */
 static const uint8_t dnxhd_1235_luma_weight[] = {
  0, 32, 32, 32, 33, 32, 32, 32,
 32, 31, 32, 33, 33, 33, 33, 35,
@@ -251,12 +251,12 @@ static const uint8_t dnxhd_1260_chroma_weight[] = {
 56, 56, 53, 53, 53, 54, 58, 58,
 };
 
-/* Used in CID 1235, 1241, 1250, 1256 */
+/* Used in CID 1235, 1236, 1241, 1250, 1256, 1257, 1270, 1271 */
 static const uint8_t dnxhd_1235_dc_codes[14] = {
 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127,
 };
 
-/* Used in CID 1235, 1241, 1250, 1256 */
+/* Used in CID 1235, 1236, 1241, 1250, 1256, 1257, 1270, 1271 */
 static const uint8_t dnxhd_1235_dc_bits[14] = {
 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
 };
@@ -371,7 +371,7 @@ static const uint8_t dnxhd_1237_ac_flags[257] = {
 3,
 };
 
-/* Used in CID 1238, 1243 */
+/* Used in CID 1238, 1240, 1243, 1272 */
 static const uint16_t dnxhd_1238_ac_codes[257] = {
 0, 1, 4,10,11,24,25,26,
54,55,56,57,   116,   117,   118,   119,
@@ -408,7 +408,7 @@ static const uint16_t dnxhd_1238_ac_codes[257] = {
 65535,
 };
 
-/* Used in CID 1238, 1243 */
+/* Used in CID 1238, 1240, 1243, 1272 */
 static const uint8_t dnxhd_1238_ac_bits[257] = {
  2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10,
@@ -429,7 +429,7 @@ static const uint8_t dnxhd_1238_ac_bits[257] = {
 16,
 };
 
-/* Used in CID 1238, 1243 */
+/* Used in CID 1238, 1240, 1243, 1272 */
 static const uint8_t dnxhd_1238_ac_level[257] = {
   3,  3,  5,  7,  0,  9, 11,  5, 13, 15, 17,  7, 19, 21, 23,  9,
  25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 45, 13, 15, 47, 49,
@@ -470,7 +470,7 @@ static const uint8_t dnxhd_1238_ac_flags[257] = {
 3,
 };
 
-/* Used in CID 1235, 1241, 1256 */
+/* Used in CID 1235, 1236, 1241, 1256, 1257, 1270, 1271 */
 static const uint16_t dnxhd_1235_ac_codes[257] = {
 0, 1, 4,10,11,24,25,26,
54,55,56,57,   116,   117,   118,   119,
@@ -507,7 +507,7 @@ static const uint16_t dnxhd_1235_ac_codes[257] = {
 65535,
 };
 
-/* Used in CID 1235, 1241, 1256 */
+/* Used in CID 1235, 1236, 1241, 1256, 1257, 1270, 1271 */
 static const uint8_t dnxhd_1235_ac_bits[257] = {
  2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10,
@@ -1073,6 +1073,14 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_ac_flags,
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 80, 90, 100, 110 } },
+{ 1270, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE,
+  DNXHD_444, 6, 10, 4,
+  dnxhd_1235_luma_weight, dnxhd_1235_luma_weight,
+  dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
+  dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
+  dnxhd_1235_ac_flags,
+  dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
+  { 0 } },
 { 1274, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE, DNXHD_VARIABLE,
   0, 4, 8, 3,
   dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index b39d68f..687f542 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -223,7 +223,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
"Adaptive MB interlace flag in an unsupported profile.\n");
 
 ctx->act = buf[0x2C] & 7;
-if (ctx->act && ctx->cid_table->cid != 1256)
+if (ctx->act && ctx->cid_table->cid != 1256 && ctx->cid_table->cid != 1270)
 av_log(ctx->avctx, AV_LOG_WARNING,
"Adaptive color transform in an unsupported profile.\n");
 
-- 
2.5.2

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


[FFmpeg-devel] [PATCH 4/9] dnxhddec: Introduce DNXHD_VARIABLE

2015-10-03 Thread Christophe Gisquet
Currently not used, but will be used to indicate that a CIDEntry field
is not set, because it is variable, and that checks should be adapted.
---
 libavcodec/dnxhddata.h | 3 +++
 libavcodec/dnxhddec.c  | 6 --
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h
index ade0b0b..e960fc9 100644
--- a/libavcodec/dnxhddata.h
+++ b/libavcodec/dnxhddata.h
@@ -30,6 +30,9 @@
 #define DNXHD_INTERLACED   (1<<0)
 #define DNXHD_444  (1<<1)
 
+/** Indicate that a CIDEntry value must be read in the bitstream */
+#define DNXHD_VARIABLE 0
+
 typedef struct CIDEntry {
 int cid;
 unsigned int width, height;
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 2f2d989..d7370a6 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -105,7 +105,8 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
 av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
 return AVERROR(ENOSYS);
 }
-if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth) {
+if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth &&
+ff_dnxhd_cid_table[index].bit_depth != DNXHD_VARIABLE) {
 av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", 
ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);
 return AVERROR_INVALIDDATA;
 }
@@ -227,7 +228,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 
 // make sure profile size constraints are respected
 // DNx100 allows 1920->1440 and 1280->960 subsampling
-if (ctx->width != ctx->cid_table->width) {
+if (ctx->width != ctx->cid_table->width &&
+ctx->cid_table->width != DNXHD_VARIABLE) {
 av_reduce(&ctx->avctx->sample_aspect_ratio.num,
   &ctx->avctx->sample_aspect_ratio.den,
   ctx->width, ctx->cid_table->width, 255);
-- 
2.5.2

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


[FFmpeg-devel] [PATCH 5/9] isom: add support for DNxHR codec family

2015-10-03 Thread Christophe Gisquet
This is actually similar to DNxHD.
---
 libavformat/isom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index eff04ff..e55738b 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -240,6 +240,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
 
 { AV_CODEC_ID_DIRAC, MKTAG('d', 'r', 'a', 'c') },
 { AV_CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n') }, /* AVID DNxHD */
+{ AV_CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'h') }, /* AVID DNxHR */
 { AV_CODEC_ID_H263,  MKTAG('H', '2', '6', '3') },
 { AV_CODEC_ID_MSMPEG4V3, MKTAG('3', 'I', 'V', 'D') }, /* 3ivx DivX Doctor 
*/
 { AV_CODEC_ID_RAWVIDEO,  MKTAG('A', 'V', '1', 'x') }, /* AVID 1:1x */
-- 
2.5.2

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


[FFmpeg-devel] [PATCH 3/9] dnxhdenc: do not select 4:4:4 profiles

2015-10-03 Thread Christophe Gisquet
The encoder can only deal with 4:2:2.
---
 libavcodec/dnxhddata.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 4bb215a..798cc0e 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -,7 +,7 @@ int ff_dnxhd_find_cid(AVCodecContext *avctx, int 
bit_depth)
 int interlaced = cid->flags & DNXHD_INTERLACED ? 1 : 0;
 if (cid->width == avctx->width && cid->height == avctx->height &&
 interlaced == !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) &&
-cid->bit_depth == bit_depth) {
+!(cid->flags & DNXHD_444) && cid->bit_depth == bit_depth) {
 for (j = 0; j < FF_ARRAY_ELEMS(cid->bit_rates); j++) {
 if (cid->bit_rates[j] == mbs)
 return cid->cid;
-- 
2.5.2

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


[FFmpeg-devel] [PATCH 2/9] dnxhd: profile flags

2015-10-03 Thread Christophe Gisquet
Move the 'interlaced' flag to this element (arbitrarily set to 16bits).
This should allow better detection/selection of profiles.
---
 libavcodec/dnxhddata.c | 49 -
 libavcodec/dnxhddata.h |  6 +-
 2 files changed, 37 insertions(+), 18 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index c45a225..4bb215a 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -950,7 +950,8 @@ static const uint8_t dnxhd_1250_run[62] = {
 };
 
 const CIDEntry ff_dnxhd_cid_table[] = {
-{ 1235, 1920, 1080, 0, 917504, 917504, 6, 10, 4,
+{ 1235, 1920, 1080, 917504, 917504,
+  0, 6, 10, 4,
   dnxhd_1235_luma_weight, dnxhd_1235_chroma_weight,
   dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
   dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
@@ -958,7 +959,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
   { 175, 185, 365, 440 },
   { { 24000, 1001 }, { 25, 1 }, { 50, 1 }, { 6, 1001 } } },
-{ 1237, 1920, 1080, 0, 606208, 606208, 4, 8, 3,
+{ 1237, 1920, 1080, 606208, 606208,
+  0, 4, 8, 3,
   dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
@@ -966,7 +968,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 115, 120, 145, 240, 290 },
   { { 24000, 1001 }, { 25, 1 }, { 3, 1001 }, { 50, 1 }, { 6, 1001 
} } },
-{ 1238, 1920, 1080, 0, 917504, 917504, 4, 8, 4,
+{ 1238, 1920, 1080, 917504, 917504,
+  0, 4, 8, 4,
   dnxhd_1238_luma_weight, dnxhd_1238_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
@@ -974,7 +977,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1238_run,
   { 175, 185, 220, 365, 440 },
   { { 24000, 1001 }, { 25, 1 }, { 3, 1001 }, { 50, 1 }, { 6, 1001 
} } },
-{ 1241, 1920, 1080, 1, 917504, 458752, 6, 10, 4,
+{ 1241, 1920, 1080, 917504, 458752,
+  DNXHD_INTERLACED, 6, 10, 4,
   dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight,
   dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
   dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
@@ -982,7 +986,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
   { 185, 220 },
   { { 25, 1 }, { 3, 1001 } } },
-{ 1242, 1920, 1080, 1, 606208, 303104, 4, 8, 3,
+{ 1242, 1920, 1080, 606208, 303104,
+  DNXHD_INTERLACED, 4, 8, 3,
   dnxhd_1242_luma_weight, dnxhd_1242_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
@@ -990,7 +995,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 120, 145 },
   { { 25, 1 }, { 3, 1001 } } },
-{ 1243, 1920, 1080, 1, 917504, 458752, 4, 8, 4,
+{ 1243, 1920, 1080, 917504, 458752,
+  DNXHD_INTERLACED, 4, 8, 4,
   dnxhd_1243_luma_weight, dnxhd_1243_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
@@ -998,7 +1004,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1238_run,
   { 185, 220 },
   { { 25, 1 }, { 3, 1001 } } },
-{ 1250, 1280,  720, 0, 458752, 458752, 6, 10, 4,
+{ 1250, 1280,  720, 458752, 458752,
+  0, 6, 10, 4,
   dnxhd_1250_luma_weight, dnxhd_1250_chroma_weight,
   dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
   dnxhd_1250_ac_codes, dnxhd_1250_ac_bits, dnxhd_1250_ac_level,
@@ -1006,7 +1013,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
   { 90, 90, 180, 220 },
   { { 24000, 1001 }, { 25, 1 }, { 50, 1 }, { 6, 1001 } } },
-{ 1251, 1280,  720, 0, 458752, 458752, 4, 8, 4,
+{ 1251, 1280,  720, 458752, 458752,
+  0, 4, 8, 4,
   dnxhd_1251_luma_weight, dnxhd_1251_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1251_ac_codes, dnxhd_1251_ac_bits, dnxhd_1251_ac_level,
@@ -1014,7 +1022,8 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1250_run_codes, dnxhd_1250_run_bits, dnxhd_1250_run,
   { 90, 90, 110, 180, 220 },
   { { 24000, 1001 }, { 25, 1 }, { 3, 1001 }, { 50, 1 }, { 6, 1001 
} } },
-{ 1252, 1280,  720, 0, 303104, 303104, 4, 8, 5,
+{ 1252, 1280,  720, 303104, 303104,
+  0, 4, 8, 5,
   dnxhd_1252_luma_weight, dnxhd_1252_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1252_ac_codes, dnxhd_1252_ac_bits, dnxhd_1252_ac_level,
@@ -1022,7 +1031,8 @@ const CIDEntry ff

[FFmpeg-devel] [PATCH 1/9] dnxhddec: cleanup frame header parsing

2015-10-03 Thread Christophe Gisquet
Rely more on the actual syntax from the specs (also seen in the
encoder code).
---
 libavcodec/dnxhddec.c | 55 +--
 1 file changed, 27 insertions(+), 28 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 296f7f7..2f2d989 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -10,7 +10,6 @@
  * 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.
  *
@@ -176,35 +175,35 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 } else {
 ctx->cur_field = 0;
 }
-ctx->mbaff = buf[0x6] & 32;
+ctx->mbaff = (buf[0x6] >> 5) & 1;
 
 ctx->height = AV_RB16(buf + 0x18);
 ctx->width  = AV_RB16(buf + 0x1a);
 
-ff_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
-
-if (buf[0x21] == 0x58) { /* 10 bit */
-ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 10;
+switch(buf[0x21] >> 5) {
+case 1: ctx->bit_depth = 8; break;
+case 2: ctx->bit_depth = 10; break;
+default:
+av_log(ctx->avctx, AV_LOG_ERROR,
+   "Unknown bitdepth indicator (%d)\n", buf[0x21] >> 5);
+return AVERROR_INVALIDDATA;
+}
+ctx->avctx->bits_per_raw_sample = ctx->bit_depth;
 
-if (buf[0x4] == 0x2) {
-ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
-ctx->pix_fmt = AV_PIX_FMT_YUV444P10;
-ctx->is_444 = 1;
-} else {
-ctx->decode_dct_block = dnxhd_decode_dct_block_10;
-ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
-ctx->is_444 = 0;
+ctx->is_444 = (buf[0x2C] >> 6) & 1;
+if (ctx->is_444) {
+if (ctx->bit_depth == 8) {
+avpriv_request_sample(ctx->avctx, "4:4:4 8 bits\n");
+return AVERROR_INVALIDDATA;
 }
-} else if (buf[0x21] == 0x38) { /* 8 bit */
-ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 8;
-
-ctx->pix_fmt = AV_PIX_FMT_YUV422P;
-ctx->is_444 = 0;
-ctx->decode_dct_block = dnxhd_decode_dct_block_8;
+ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
+ctx->pix_fmt = AV_PIX_FMT_YUV444P10;
+} else if (ctx->bit_depth == 10) {
+ctx->decode_dct_block = dnxhd_decode_dct_block_10;
+ctx->pix_fmt = AV_PIX_FMT_YUV422P10;
 } else {
-av_log(ctx->avctx, AV_LOG_ERROR,
-   "invalid bit depth value (%d).\n", buf[0x21]);
-return AVERROR_INVALIDDATA;
+ctx->decode_dct_block = dnxhd_decode_dct_block_8;
+ctx->pix_fmt = AV_PIX_FMT_YUV422P;
 }
 if (ctx->bit_depth != old_bit_depth) {
 ff_blockdsp_init(&ctx->bdsp, ctx->avctx);
@@ -214,7 +213,6 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 }
 
 cid = AV_RB32(buf + 0x28);
-ff_dlog(ctx->avctx, "compression id %d\n", cid);
 
 if ((ret = dnxhd_init_vlc(ctx, cid)) < 0)
 return ret;
@@ -242,15 +240,16 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 return AVERROR_INVALIDDATA;
 }
 
-ctx->mb_width  = ctx->width >> 4;
+ctx->mb_width  = (ctx->width + 15)>> 4;
 ctx->mb_height = buf[0x16d];
 
-ff_dlog(ctx->avctx,
-"mb width %d, mb height %d\n", ctx->mb_width, ctx->mb_height);
-
 if ((ctx->height + 15) >> 4 == ctx->mb_height && frame->interlaced_frame)
 ctx->height <<= 1;
 
+av_log(ctx->avctx, AV_LOG_VERBOSE, "%dx%d, 4:%s %d bits, MBAFF=%d 
ACT=%d\n",
+   ctx->width, ctx->height, ctx->is_444 ? "4:4" : "2:2",
+   ctx->bit_depth, ctx->mbaff, ctx->act);
+
 if (ctx->mb_height > 68 ||
 (ctx->mb_height << frame->interlaced_frame) > (ctx->height + 15) >> 4) 
{
 av_log(ctx->avctx, AV_LOG_ERROR,
-- 
2.5.2

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


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

2015-10-03 Thread Christophe Gisquet
Cleaned up version of v1, with the first patches fixing bugs exacerbated
by the following new code, in general improving the current code so as to
introduce DNxHR.

DNxHR is then added progressively, in particular the extended handling
needed.

Christophe Gisquet (7):
  dnxhddec: cleanup frame header parsing
  dnxhd: profile flags
  dnxhdenc: do not select 4:4:4 profiles
  dnxhddec: Introduce DNXHD_VARIABLE
  isom: add support for DNxHR codec family
  dnxhd: add CID 1270
  dnxhdenc: fix scan used for bitstream generation

Jeremy James (2):
  dnxhd: add decoder support for DNxHR
  dnxhd: add better support for CIDs 1270 to 1274

 libavcodec/dnxhddata.c | 145 +++--
 libavcodec/dnxhddata.h |   9 ++-
 libavcodec/dnxhddec.c  | 144 
 libavcodec/dnxhdenc.c  |   4 +-
 libavformat/isom.c |   1 +
 5 files changed, 212 insertions(+), 91 deletions(-)

-- 
2.5.2

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


[FFmpeg-devel] [PATCH] lavf/mov: add support for sidx fragment indexes

2015-10-03 Thread Rodger Combs
Fixes trac #3842
---
 libavformat/isom.h |   2 +
 libavformat/mov.c  | 250 -
 2 files changed, 213 insertions(+), 39 deletions(-)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index aee9d6e..6e921c0 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -103,6 +103,7 @@ typedef struct MOVSbgp {
 typedef struct MOVFragmentIndexItem {
 int64_t moof_offset;
 int64_t time;
+int headers_read;
 } MOVFragmentIndexItem;
 
 typedef struct MOVFragmentIndex {
@@ -197,6 +198,7 @@ typedef struct MOVContext {
 int has_looked_for_mfra;
 MOVFragmentIndex** fragment_index_data;
 unsigned fragment_index_count;
+int fragment_index_complete;
 int atom_depth;
 unsigned int aax_mode;  ///< 'aax' file has been detected
 uint8_t file_key[20];
diff --git a/libavformat/mov.c b/libavformat/mov.c
index da170a6..5aa7491 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3349,7 +3349,7 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 MOVFragment *frag = &c->fragment;
 MOVTrackExt *trex = NULL;
 MOVFragmentIndex* index = NULL;
-int flags, track_id, i;
+int flags, track_id, i, found = 0;
 
 avio_r8(pb); /* version */
 flags = avio_rb24(pb);
@@ -3367,15 +3367,6 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 av_log(c->fc, AV_LOG_ERROR, "could not find corresponding trex\n");
 return AVERROR_INVALIDDATA;
 }
-for (i = 0; i < c->fragment_index_count; i++) {
-MOVFragmentIndex* candidate = c->fragment_index_data[i];
-if (candidate->track_id == frag->track_id) {
-av_log(c->fc, AV_LOG_DEBUG,
-   "found fragment index for track %u\n", frag->track_id);
-index = candidate;
-break;
-}
-}
 
 frag->base_data_offset = flags & MOV_TFHD_BASE_DATA_OFFSET ?
  avio_rb64(pb) : flags & 
MOV_TFHD_DEFAULT_BASE_IS_MOOF ?
@@ -3389,23 +3380,32 @@ static int mov_read_tfhd(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 frag->flags= flags & MOV_TFHD_DEFAULT_FLAGS ?
  avio_rb32(pb) : trex->flags;
 frag->time = AV_NOPTS_VALUE;
-if (index) {
-int i, found = 0;
-for (i = index->current_item; i < index->item_count; i++) {
-if (frag->implicit_offset == index->items[i].moof_offset) {
-av_log(c->fc, AV_LOG_DEBUG, "found fragment index entry "
-"for track %u and moof_offset %"PRId64"\n",
-frag->track_id, index->items[i].moof_offset);
-frag->time = index->items[i].time;
-index->current_item = i + 1;
-found = 1;
+for (i = 0; i < c->fragment_index_count; i++) {
+int j;
+MOVFragmentIndex* candidate = c->fragment_index_data[i];
+if (candidate->track_id == frag->track_id) {
+av_log(c->fc, AV_LOG_DEBUG,
+   "found fragment index for track %u\n", frag->track_id);
+index = candidate;
+for (j = index->current_item; j < index->item_count; j++) {
+if (frag->implicit_offset == index->items[j].moof_offset) {
+av_log(c->fc, AV_LOG_DEBUG, "found fragment index entry "
+"for track %u and moof_offset %"PRId64"\n",
+frag->track_id, index->items[j].moof_offset);
+frag->time = index->items[j].time;
+index->current_item = j + 1;
+found = 1;
+break;
+}
 }
+if (found)
+break;
 }
-if (!found) {
-av_log(c->fc, AV_LOG_WARNING, "track %u has a fragment index "
-   "but it doesn't have an (in-order) entry for moof_offset "
-   "%"PRId64"\n", frag->track_id, frag->implicit_offset);
-}
+}
+if (index && !found) {
+av_log(c->fc, AV_LOG_DEBUG, "track %u has a fragment index but "
+   "it doesn't have an (in-order) entry for moof_offset "
+   "%"PRId64"\n", frag->track_id, frag->implicit_offset);
 }
 av_log(c->fc, AV_LOG_TRACE, "frag flags 0x%x\n", frag->flags);
 return 0;
@@ -3596,7 +3596,99 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return AVERROR_EOF;
 
 frag->implicit_offset = offset;
-st->duration = sc->track_end = dts + sc->time_offset;
+
+sc->track_end = dts + sc->time_offset;
+if (st->duration < sc->track_end)
+st->duration = sc->track_end;
+
+return 0;
+}
+
+static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+int64_t offset = avio_tell(pb) + atom.size, pts;
+uint8_t version;
+unsigned i, track_id;
+AVStream *st = NULL;
+MOVStreamContext *sc;
+MOVFragmentIndex *inde

[FFmpeg-devel] [PATCH] ffplay: more robust thread creation

2015-10-03 Thread Ganesh Ajjanagadde
SDL_CreateThread can fail:
https://wiki.libsdl.org/SDL_CreateThread.
This patch makes thread creation more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde 
---
 ffplay.c | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index b7b2b0b..da0fd3a 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2080,10 +2080,15 @@ static int audio_thread(void *arg)
 return ret;
 }
 
-static void decoder_start(Decoder *d, int (*fn)(void *), void *arg)
+static int decoder_start(Decoder *d, int (*fn)(void *), void *arg)
 {
 packet_queue_start(d->queue);
 d->decoder_tid = SDL_CreateThread(fn, arg);
+if (!d->decoder_tid) {
+av_log(d, AV_LOG_FATAL, "SDL_CreateThread(): %s\n", SDL_GetError());
+return AVERROR(ENOMEM);
+}
+return 0;
 }
 
 static int video_thread(void *arg)
@@ -2681,7 +2686,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->auddec.start_pts = is->audio_st->start_time;
 is->auddec.start_pts_tb = is->audio_st->time_base;
 }
-decoder_start(&is->auddec, audio_thread, is);
+if (decoder_start(&is->auddec, audio_thread, is) < 0)
+goto fail;
 SDL_PauseAudio(0);
 break;
 case AVMEDIA_TYPE_VIDEO:
@@ -2692,7 +2698,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->viddec_height = avctx->height;
 
 decoder_init(&is->viddec, avctx, &is->videoq, 
is->continue_read_thread);
-decoder_start(&is->viddec, video_thread, is);
+if (decoder_start(&is->viddec, video_thread, is) < 0)
+goto fail;
 is->queue_attachments_req = 1;
 break;
 case AVMEDIA_TYPE_SUBTITLE:
@@ -2700,7 +2707,8 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 is->subtitle_st = ic->streams[stream_index];
 
 decoder_init(&is->subdec, avctx, &is->subtitleq, 
is->continue_read_thread);
-decoder_start(&is->subdec, subtitle_thread, is);
+if (decoder_start(&is->subdec, subtitle_thread, is) < 0)
+goto fail;
 break;
 default:
 break;
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH]lavf/shortendec: Autodetect raw Shorten streams.

2015-10-03 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 01:05:50PM +0200, Carl Eugen Hoyos wrote:
> On Friday 02 October 2015 12:48:17 pm Paul B Mahol wrote:
> > On 10/2/15, Carl Eugen Hoyos  wrote:
> > > Hi!
> > >
> > > Attached patch implements Shorten auto-detection.
> > >
> > > Please comment, Carl Eugen
> >
> > You do not check byte size
> 
> I thought both the safe bitstream reader and the minimal 
> probe buffer size avoid an overread here.
> Is that wrong?
> 
> > and not using init_get_bits8. 
> 
> Fixed, thank you!
> 
> New patch attached, Carl Eugen

>  Makefile |2 -
>  rawdec.c |   12 -
>  shortendec.c |   71 
> +++
>  version.h|2 -
>  4 files changed, 73 insertions(+), 14 deletions(-)
> 5c59131e01c4a4e864963890fdebf635eeb1df3c  patchshn.diff

LGTM

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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


Re: [FFmpeg-devel] [PATCHv2] ffplay: more robust mutex, condition variable handling

2015-10-03 Thread Marton Balint



On Sat, 3 Oct 2015, Ganesh Ajjanagadde wrote:


SDL_CreateMutex and SDL_CreateCond can fail:
https://wiki.libsdl.org/SDL_CreateMutex.
This patch makes handling more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde 
---
ffplay.c | 18 ++
1 file changed, 14 insertions(+), 4 deletions(-)



Applied, thanks.

BTW I do not object that you push approved patches in the future by
yourself.

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


[FFmpeg-devel] [PATCH]configure: Simplify dependencies

2015-10-03 Thread Carl Eugen Hoyos
Hi!

Attached patch simplifies dependencies in configure, avutil is always built.
It also simplifies usage of --disable-all

Please comment, Carl Eugen
diff --git a/configure b/configure
index 3ee1ed2..89cb580 100755
--- a/configure
+++ b/configure
@@ -2821,33 +2821,28 @@ zmq_filter_deps="libzmq"
 zoompan_filter_deps="swscale"
 
 # examples
-avio_reading="avformat avcodec avutil"
-avio_dir_cmd="avformat avutil"
-avcodec_example_deps="avcodec avutil"
-decoding_encoding_example_deps="avcodec avformat avutil"
-demuxing_decoding_example_deps="avcodec avformat avutil"
-extract_mvs_example_deps="avcodec avformat avutil"
-filter_audio_example_deps="avfilter avutil"
-filtering_audio_example_deps="avfilter avcodec avformat avutil"
-filtering_video_example_deps="avfilter avcodec avformat avutil"
-metadata_example_deps="avformat avutil"
-muxing_example_deps="avcodec avformat avutil swscale"
-qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder vaapi_x11"
-remuxing_example_deps="avcodec avformat avutil"
-resampling_audio_example_deps="avutil swresample"
-scaling_video_example_deps="avutil swscale"
+avio_reading="avformat avcodec"
+avio_dir_cmd="avformat"
+avcodec_example_deps="avcodec"
+decoding_encoding_example_deps="avcodec avformat"
+demuxing_decoding_example_deps="avcodec avformat"
+extract_mvs_example_deps="avcodec avformat"
+filter_audio_example_deps="avfilter"
+filtering_audio_example_deps="avfilter avcodec avformat"
+filtering_video_example_deps="avfilter avcodec avformat"
+metadata_example_deps="avformat"
+muxing_example_deps="avcodec avformat swscale"
+qsvdec_example_deps="avcodec libmfx h264_qsv_decoder vaapi_x11"
+remuxing_example_deps="avcodec avformat"
+resampling_audio_example_deps="swresample"
+scaling_video_example_deps="swscale"
 transcode_aac_example_deps="avcodec avformat swresample"
-transcoding_example_deps="avfilter avcodec avformat avutil"
+transcoding_example_deps="avfilter avcodec avformat"
 
 # libraries, in linking order
-avcodec_deps="avutil"
-avdevice_deps="avformat avcodec avutil"
-avfilter_deps="avutil"
-avformat_deps="avcodec avutil"
-avresample_deps="avutil"
-postproc_deps="avutil gpl"
-swresample_deps="avutil"
-swscale_deps="avutil"
+avdevice_deps="avformat avcodec"
+avformat_deps="avcodec"
+postproc_deps="gpl"
 
 # programs
 ffmpeg_deps="avcodec avfilter avformat swresample"
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Henrik Gramner
On Sat, Oct 3, 2015 at 4:22 PM, Ganesh Ajjanagadde  wrote:
> Should we go ahead with the INT32_MIN then?

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


Re: [FFmpeg-devel] [PATCH] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

2015-10-03 Thread wm4
On Sat, 3 Oct 2015 11:13:35 -0400
"Ronald S. Bultje"  wrote:

> Hi,
> 
> On Thu, Sep 17, 2015 at 7:51 AM, Michael Niedermayer 
> wrote:
> 
> > On Thu, Sep 17, 2015 at 06:54:37AM -0400, Ganesh Ajjanagadde wrote:
> > > On Thu, Sep 17, 2015 at 6:17 AM, Michael Niedermayer 
> > wrote:
> > > > On Wed, Sep 16, 2015 at 10:22:27PM -0400, Ganesh Ajjanagadde wrote:
> > > >> When compiled with --disable-pthreads, e.g
> > > >>
> > http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7
> > ,
> > > >> a bunch of -Wunused-functions are reported due to missing header
> > guards
> > > >> around threading related functions.
> > > >> This patch should silence such warnings.
> > > >>
> > > >> Signed-off-by: Ganesh Ajjanagadde 
> > > >> ---
> > > >>  libavcodec/alac.c  | 2 ++
> > > >>  libavcodec/exr.c   | 2 ++
> > > >>  libavcodec/ffv1dec.c   | 4 
> > > >>  libavcodec/flacdec.c   | 2 ++
> > > >>  libavcodec/h264.c  | 2 ++
> > > >>  libavcodec/huffyuvdec.c| 2 ++
> > > >>  libavcodec/mdec.c  | 2 ++
> > > >>  libavcodec/mimic.c | 4 
> > > >>  libavcodec/mpeg12dec.c | 2 ++
> > > >>  libavcodec/mpeg4videodec.c | 2 ++
> > > >>  libavcodec/pngdec.c| 2 ++
> > > >>  libavcodec/takdec.c| 2 ++
> > > >>  libavcodec/tta.c   | 2 ++
> > > >>  libavcodec/vp3.c   | 4 
> > > >>  libavcodec/vp8.c   | 2 ++
> > > >>  libavcodec/vp9.c   | 2 ++
> > > >>  libavcodec/wavpack.c   | 2 ++
> > > >>  17 files changed, 40 insertions(+)
> > > >
> > > > av_unused might be simpler to silence these warnings than #if
> > >
> > > I do not think this is consistent at the moment across the codebase;
> > > sometimes we use header guards and sometimes we use av_unused. Please
> > > tell me if what the rationale is for either of them; I am fine either
> > > way. Any half decent compiler should anyway remove unused functions
> > > when compiled with optimizations.
> >
> > #ifs will be more work to maintain as they can break build if a new
> > function call or function is added. av_unused cannot break build
> > #ifs also make the code harder to read, especially if there are
> > already some #ifs there before
> >
> > #ifs make sense for non static symbols as they cannot be removed by
> > the compiler or linker generally
> >
> > #ifs could also be used to structure code in a file if for some
> > reason its unwanted to split it in several files
> > #ifs also gurantee that code is removed and this makes sense in
> > performance critical code
> > #ifs can be used for any group of lines not just functions/variables
> > as for av_unused
> 
> 
> Michael, how strong is your objection here? Me and wm4 seem to have a
> slight preference for #if over av_unused, since av_unused runs the risk of
> rotting with code over time.
> 
> (Other devs should also voice opinions if they care.)

For some obscure like disabling threading, I'd rather actually prefer
not to fix the warnings at all (if they only happen under the obscure
configuration). There is absolutely no point in avoiding the warnings
in these cases, and indeed the "fixes" will just bitrot over time.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

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

On Sat, Oct 3, 2015 at 10:22 AM, Ganesh Ajjanagadde 
wrote:

> On Sat, Oct 3, 2015 at 9:15 AM, Henrik Gramner  wrote:
> > On Sat, Oct 3, 2015 at 2:58 PM, Ronald S. Bultje 
> wrote:
> >> I wonder if some compilers will complain that this overflows (strictly
> >> speaking it does) and that it should be -0x8000 instead?
> >
> > -0x8000 isn't a valid 32-bit integer in C. For this reason
> > INT32_MIN is usually defined to something like (-0x7fff -1).
>
> Indeed, see e.g:
> "There are no negative integer literals. Expressions such as -1 apply
> the unary minus operator to the value represented by the literal,
> which may involve implicit type conversions." (from
> http://en.cppreference.com/w/cpp/language/integer_literal).
>
> Should we go ahead with the INT32_MIN then?


I would say yes.

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


Re: [FFmpeg-devel] [PATCH] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

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

On Thu, Sep 17, 2015 at 7:51 AM, Michael Niedermayer 
wrote:

> On Thu, Sep 17, 2015 at 06:54:37AM -0400, Ganesh Ajjanagadde wrote:
> > On Thu, Sep 17, 2015 at 6:17 AM, Michael Niedermayer 
> wrote:
> > > On Wed, Sep 16, 2015 at 10:22:27PM -0400, Ganesh Ajjanagadde wrote:
> > >> When compiled with --disable-pthreads, e.g
> > >>
> http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7
> ,
> > >> a bunch of -Wunused-functions are reported due to missing header
> guards
> > >> around threading related functions.
> > >> This patch should silence such warnings.
> > >>
> > >> Signed-off-by: Ganesh Ajjanagadde 
> > >> ---
> > >>  libavcodec/alac.c  | 2 ++
> > >>  libavcodec/exr.c   | 2 ++
> > >>  libavcodec/ffv1dec.c   | 4 
> > >>  libavcodec/flacdec.c   | 2 ++
> > >>  libavcodec/h264.c  | 2 ++
> > >>  libavcodec/huffyuvdec.c| 2 ++
> > >>  libavcodec/mdec.c  | 2 ++
> > >>  libavcodec/mimic.c | 4 
> > >>  libavcodec/mpeg12dec.c | 2 ++
> > >>  libavcodec/mpeg4videodec.c | 2 ++
> > >>  libavcodec/pngdec.c| 2 ++
> > >>  libavcodec/takdec.c| 2 ++
> > >>  libavcodec/tta.c   | 2 ++
> > >>  libavcodec/vp3.c   | 4 
> > >>  libavcodec/vp8.c   | 2 ++
> > >>  libavcodec/vp9.c   | 2 ++
> > >>  libavcodec/wavpack.c   | 2 ++
> > >>  17 files changed, 40 insertions(+)
> > >
> > > av_unused might be simpler to silence these warnings than #if
> >
> > I do not think this is consistent at the moment across the codebase;
> > sometimes we use header guards and sometimes we use av_unused. Please
> > tell me if what the rationale is for either of them; I am fine either
> > way. Any half decent compiler should anyway remove unused functions
> > when compiled with optimizations.
>
> #ifs will be more work to maintain as they can break build if a new
> function call or function is added. av_unused cannot break build
> #ifs also make the code harder to read, especially if there are
> already some #ifs there before
>
> #ifs make sense for non static symbols as they cannot be removed by
> the compiler or linker generally
>
> #ifs could also be used to structure code in a file if for some
> reason its unwanted to split it in several files
> #ifs also gurantee that code is removed and this makes sense in
> performance critical code
> #ifs can be used for any group of lines not just functions/variables
> as for av_unused


Michael, how strong is your objection here? Me and wm4 seem to have a
slight preference for #if over av_unused, since av_unused runs the risk of
rotting with code over time.

(Other devs should also voice opinions if they care.)

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


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 9:15 AM, Henrik Gramner  wrote:
> On Sat, Oct 3, 2015 at 2:58 PM, Ronald S. Bultje  wrote:
>> I wonder if some compilers will complain that this overflows (strictly
>> speaking it does) and that it should be -0x8000 instead?
>
> -0x8000 isn't a valid 32-bit integer in C. For this reason
> INT32_MIN is usually defined to something like (-0x7fff -1).

Indeed, see e.g:
"There are no negative integer literals. Expressions such as -1 apply
the unary minus operator to the value represented by the literal,
which may involve implicit type conversions." (from
http://en.cppreference.com/w/cpp/language/integer_literal).

Should we go ahead with the INT32_MIN then?

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


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Henrik Gramner
On Sat, Oct 3, 2015 at 2:58 PM, Ronald S. Bultje  wrote:
> I wonder if some compilers will complain that this overflows (strictly
> speaking it does) and that it should be -0x8000 instead?

-0x8000 isn't a valid 32-bit integer in C. For this reason
INT32_MIN is usually defined to something like (-0x7fff -1).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv2] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 7:55 AM, Ronald S. Bultje  wrote:
> Hi,
>
> On Fri, Sep 18, 2015 at 9:05 AM, Ganesh Ajjanagadde 
> wrote:
>
>> On Fri, Sep 18, 2015 at 4:40 AM, wm4  wrote:
>> > On 17.09.2015 15:07, Ganesh Ajjanagadde wrote:
>> >>
>> >> When compiled with --disable-pthreads, e.g
>> >>
>> >>
>> http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7
>> ,
>> >> a bunch of -Wunused-functions are reported.
>> >> This patch should silence such warnings.
>> >>
>> >> Signed-off-by: Ganesh Ajjanagadde 
>> >> ---
>> >>   libavcodec/alac.c  | 2 +-
>> >>   libavcodec/exr.c   | 2 +-
>> >>   libavcodec/ffv1dec.c   | 4 ++--
>> >>   libavcodec/flacdec.c   | 2 +-
>> >>   libavcodec/h264.c  | 2 +-
>> >>   libavcodec/huffyuvdec.c| 2 +-
>> >>   libavcodec/mdec.c  | 2 +-
>> >>   libavcodec/mimic.c | 4 ++--
>> >>   libavcodec/mpeg12dec.c | 2 +-
>> >>   libavcodec/mpeg4videodec.c | 2 +-
>> >>   libavcodec/pngdec.c| 2 +-
>> >>   libavcodec/takdec.c| 4 ++--
>> >>   libavcodec/tta.c   | 4 ++--
>> >>   libavcodec/vp3.c   | 4 ++--
>> >>   libavcodec/vp8.c   | 4 ++--
>> >>   libavcodec/vp9.c   | 2 +-
>> >>   libavcodec/wavpack.c   | 2 +-
>> >>   17 files changed, 23 insertions(+), 23 deletions(-)
>> >>
>> >> diff --git a/libavcodec/alac.c b/libavcodec/alac.c
>> >> index 827c0db..f2e5907 100644
>> >> --- a/libavcodec/alac.c
>> >> +++ b/libavcodec/alac.c
>> >> @@ -609,7 +609,7 @@ static av_cold int alac_decode_init(AVCodecContext *
>> >> avctx)
>> >>   return 0;
>> >>   }
>> >>
>> >> -static int init_thread_copy(AVCodecContext *avctx)
>> >> +av_unused static int init_thread_copy(AVCodecContext *avctx)
>> >>   {
>> >>   ALACContext *alac = avctx->priv_data;
>> >>   alac->avctx = avctx;
>> >> diff --git a/libavcodec/exr.c b/libavcodec/exr.c
>> >> index 3b6b245..778088e 100644
>> >> --- a/libavcodec/exr.c
>> >> +++ b/libavcodec/exr.c
>> >> @@ -1426,7 +1426,7 @@ static av_cold int decode_init(AVCodecContext
>> >> *avctx)
>> >>   return 0;
>> >>   }
>> >>
>> >> -static int decode_init_thread_copy(AVCodecContext *avctx)
>> >> +av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
>> >>   {EXRContext *s = avctx->priv_data;
>> >>
>> >>   // allocate thread data, used for non EXR_RAW compreesion types
>> >> diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
>> >> index 557b1a0..70ae37d 100644
>> >> --- a/libavcodec/ffv1dec.c
>> >> +++ b/libavcodec/ffv1dec.c
>> >> @@ -1008,7 +1008,7 @@ static int decode_frame(AVCodecContext *avctx,
>> void
>> >> *data, int *got_frame, AVPac
>> >>   return buf_size;
>> >>   }
>> >>
>> >> -static int init_thread_copy(AVCodecContext *avctx)
>> >> +av_unused static int init_thread_copy(AVCodecContext *avctx)
>> >>   {
>> >>   FFV1Context *f = avctx->priv_data;
>> >>   int i, ret;
>> >> @@ -1061,7 +1061,7 @@ static void copy_fields(FFV1Context *fsdst,
>> >> FFV1Context *fssrc, FFV1Context *fsr
>> >>   }
>> >>   }
>> >>
>> >> -static int update_thread_context(AVCodecContext *dst, const
>> >> AVCodecContext *src)
>> >> +av_unused static int update_thread_context(AVCodecContext *dst, const
>> >> AVCodecContext *src)
>> >>   {
>> >>   FFV1Context *fsrc = src->priv_data;
>> >>   FFV1Context *fdst = dst->priv_data;
>> >> diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
>> >> index 8653da7..00744da 100644
>> >> --- a/libavcodec/flacdec.c
>> >> +++ b/libavcodec/flacdec.c
>> >> @@ -623,7 +623,7 @@ static int flac_decode_frame(AVCodecContext *avctx,
>> >> void *data,
>> >>   return bytes_read;
>> >>   }
>> >>
>> >> -static int init_thread_copy(AVCodecContext *avctx)
>> >> +av_unused static int init_thread_copy(AVCodecContext *avctx)
>> >>   {
>> >>   FLACContext *s = avctx->priv_data;
>> >>   s->decoded_buffer = NULL;
>> >> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
>> >> index b797893..fa66b53 100644
>> >> --- a/libavcodec/h264.c
>> >> +++ b/libavcodec/h264.c
>> >> @@ -701,7 +701,7 @@ av_cold int ff_h264_decode_init(AVCodecContext
>> *avctx)
>> >>   return 0;
>> >>   }
>> >>
>> >> -static int decode_init_thread_copy(AVCodecContext *avctx)
>> >> +av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
>> >>   {
>> >>   H264Context *h = avctx->priv_data;
>> >>   int ret;
>> >> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
>> >> index a700abb..eda11ee 100644
>> >> --- a/libavcodec/huffyuvdec.c
>> >> +++ b/libavcodec/huffyuvdec.c
>> >> @@ -571,7 +571,7 @@ static av_cold int decode_init(AVCodecContext
>> *avctx)
>> >>   return ret;
>> >>   }
>> >>
>> >> -static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
>> >> +av_unused static av_cold int decode_init_thread_copy(AVCodecContext
>> >> *avctx)
>> >>   {
>> >>   HYuvContext *s = avctx->priv_data;
>> >>   int i, ret;
>> >> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
>> >> inde

Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 8:53 AM, Ganesh Ajjanagadde
 wrote:
> On Sat, Oct 3, 2015 at 7:58 AM, Ronald S. Bultje  wrote:
>> Hi,
>>
>> On Sat, Oct 3, 2015 at 8:31 AM, Ganesh Ajjanagadde 
>> wrote:
>>>
>>> Signed-off-by: Ganesh Ajjanagadde 
>>> ---
>>>  libavcodec/apedec.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>>> index 7b34d26..05cb17e 100644
>>> --- a/libavcodec/apedec.c
>>> +++ b/libavcodec/apedec.c
>>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
>>> version, APEFilter *f,
>>>  /* Update the adaption coefficients */
>>>  absres = FFABS(res);
>>>  if (absres)
>>> -*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>>> +*f->adaptcoeffs = ((res & 0x8000) ^ (-(1<<30))) >>
>>>(25 + (absres <= f->avg*3) + (absres <=
>>> f->avg*4/3));
>>>  else
>>>  *f->adaptcoeffs = 0;
>>> --
>>> 2.6.0
>>
>>
>> I wonder if some compilers will complain that this overflows (strictly
>> speaking it does) and that it should be -0x8000 instead?
>
> please ignore current patch, breaks fate. Ronald's idea also breaks fate.

Both the -2*1<<30 or the INT32_MIN idea work. I can create a patch
based on either of these depending on what people prefer.

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


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 7:58 AM, Ronald S. Bultje  wrote:
> Hi,
>
> On Sat, Oct 3, 2015 at 8:31 AM, Ganesh Ajjanagadde 
> wrote:
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavcodec/apedec.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
>> index 7b34d26..05cb17e 100644
>> --- a/libavcodec/apedec.c
>> +++ b/libavcodec/apedec.c
>> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
>> version, APEFilter *f,
>>  /* Update the adaption coefficients */
>>  absres = FFABS(res);
>>  if (absres)
>> -*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
>> +*f->adaptcoeffs = ((res & 0x8000) ^ (-(1<<30))) >>
>>(25 + (absres <= f->avg*3) + (absres <=
>> f->avg*4/3));
>>  else
>>  *f->adaptcoeffs = 0;
>> --
>> 2.6.0
>
>
> I wonder if some compilers will complain that this overflows (strictly
> speaking it does) and that it should be -0x8000 instead?

please ignore current patch, breaks fate. Ronald's idea also breaks fate.

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


[FFmpeg-devel] libavformat/segment : add option to increment timecode

2015-10-03 Thread Martin Vignali
Hello,

in attach a patch, who add an option to increment timecode using segment.

To test :

ffmpeg -i src.mov -timecode 10:00:00:00 -vcodec copy -f segment
-segment_time 2 -reset_timestamps 1 -increment_tc 1 target_%03d.mov

the second file have timecode 10:00:02:00 (after the patch)
instead of 10:00:00:00 (before the patch)


This patch is useful for two kind of uses :
- splitting a file, but keeping timecode of each part
- have a continuous timecode when recording a stream using segment.


Comments welcome.

Martin


0001-add-increment-timecode-option-using-segment.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 8:15 AM, Ronald S. Bultje  wrote:
> Hi,
>
> On Sat, Oct 3, 2015 at 9:11 AM, Ganesh Ajjanagadde  wrote:
>
>> On Sat, Oct 3, 2015 at 7:49 AM, Hendrik Leppkes 
>> wrote:
>> > On Sat, Oct 3, 2015 at 2:33 PM, Ganesh Ajjanagadde 
>> wrote:
>> >> On Tue, Sep 29, 2015 at 8:25 PM, Ganesh Ajjanagadde 
>> wrote:
>> >>> On Tue, Sep 29, 2015 at 9:08 PM, Michael Niedermayer 
>> wrote:
>>  On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
>> > Signed-off-by: Ganesh Ajjanagadde 
>> > ---
>> >  libavcodec/apedec.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>>  breaks fate
>> 
>>  --- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29
>> 13:42:22.893972599 +0200
>>  +++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30
>> 03:06:06.950988548 +0200
>>  @@ -1 +1 @@
>>  -a28d4e5f2192057f7d4bece870f40bd0
>>  +df8663c29d7cd7268d6ae77edd742bb5
>>  Test lossless-monkeysaudio-399 failed. Look at
>> tests/data/fate/lossless-monkeysaudio-399.err for details.
>>  make: *** [fate-lossless-monkeysaudio-399] Error 1
>> >>>
>> >>> Weird, unfortunately for whatever reason my fate does not test this
>> >>> (though apedec gets compiled) so I can't reproduce. One suggestion I
>> >>> have is removing the U at the end, that will prevent any unforeseen
>> >>> signed/unsigned business which I thought was ok. Please change the
>> >>> author tag if you do this.
>> >>
>> >> updated patch removing the U; like I said my fate does not test it so
>> >> it only has been compile tested.
>> >>
>> >
>> > You should figure out whats wrong with your FATE, the ape test doesn't
>> > use anything special in particular, so if it isnt running, a bunch of
>> > others may also not be.
>>
>> The faq mentions something about fate-suite, and setting the --samples
>> configure flag.
>> First off, I don't understand why this is needed since I don't change
>> paths except the install path (--prefix=/usr).
>> Second, where is this "fate-suite", and why is it not part of the
>> FFmpeg source repository?
>>
>
> It's HUGE. HHUUU. And it's binary files. We don't want that to live
> in git, it's not the right place.

Ah, so the only ones that are part of the repository are the small
ones or the synthesized ones. That makes sense.

>
>
>> And lastly, how can I set this up correctly?
>
>
> configure --samples=/path/to/some/dir/with/lots/of/space, and then make
> fate-rsync to download samples (or refresh), and make fate to run it.

Thank you, an RTFM would also have been fine :).

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


Re: [FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 7:52 AM, Ronald S. Bultje  wrote:
> Hi,
>
> On Sat, Oct 3, 2015 at 8:45 AM, Ganesh Ajjanagadde 
> wrote:
>>
>> On Sat, Oct 3, 2015 at 7:42 AM, Ronald S. Bultje 
>> wrote:
>> > Hi,
>> >
>> > On Sat, Oct 3, 2015 at 8:39 AM, Ganesh Ajjanagadde
>> > 
>> > wrote:
>> >>
>> >> On Sat, Sep 26, 2015 at 9:57 AM, Ganesh Ajjanagadde
>> >>  wrote:
>> >> > On Sat, Sep 19, 2015 at 10:20 AM, Ganesh Ajjanagadde
>> >> >  wrote:
>> >> >> This patch silences such warnings by placing initializations under a
>> >> >> header guard,
>> >> >> see e.g
>> >> >>
>> >> >>
>> >> >> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale,
>> >> >>
>> >> >>
>> >> >> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
>> >> >> for examples of such warnings.
>> >> >> It also has the benefit of placing library specific #defines next to
>> >> >> each other.
>> >> >>
>> >> >> Signed-off-by: Ganesh Ajjanagadde 
>> >> >> ---
>> >> >>  cmdutils.c | 9 ++---
>> >> >>  1 file changed, 6 insertions(+), 3 deletions(-)
>> >> >>
>> >> >> diff --git a/cmdutils.c b/cmdutils.c
>> >> >> index b696008..38d6334 100644
>> >> >> --- a/cmdutils.c
>> >> >> +++ b/cmdutils.c
>> >> >> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt,
>> >> >> const char *arg)
>> >> >>  #if CONFIG_AVRESAMPLE
>> >> >>  const AVClass *rc = avresample_get_class();
>> >> >>  #endif
>> >> >> -const AVClass *sc, *swr_class;
>> >> >> +#if CONFIG_SWSCALE
>> >> >> +const AVClass *sc = sws_get_class();
>> >> >> +#endif
>> >> >> +#if CONFIG_SWRESAMPLE
>> >> >> +const AVClass *swr_class = swr_get_class();
>> >> >> +#endif
>> >> >>
>> >> >>  if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
>> >> >>  av_log_set_level(AV_LOG_DEBUG);
>> >> >> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt,
>> >> >> const char *arg)
>> >> >>  consumed = 1;
>> >> >>  }
>> >> >>  #if CONFIG_SWSCALE
>> >> >> -sc = sws_get_class();
>> >> >>  if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
>> >> >>   AV_OPT_SEARCH_CHILDREN |
>> >> >> AV_OPT_SEARCH_FAKE_OBJ))) {
>> >> >>  struct SwsContext *sws = sws_alloc_context();
>> >> >> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt,
>> >> >> const char *arg)
>> >> >>  }
>> >> >>  #endif
>> >> >>  #if CONFIG_SWRESAMPLE
>> >> >> -swr_class = swr_get_class();
>> >> >>  if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
>> >> >>  AV_OPT_SEARCH_CHILDREN |
>> >> >> AV_OPT_SEARCH_FAKE_OBJ))) {
>> >> >>  struct SwrContext *swr = swr_alloc();
>> >> >> --
>> >> >> 2.5.2
>> >> >>
>> >> >
>> >> > ping
>> >>
>> >> been a week; hence ping again.
>> >
>> >
>> > Patch is fine with me. Do you have commit access?
>>
>> Technically I do, but some devs are not comfortable with me exercising
>> it at the moment. I plan to exercise it only when there are no
>> objections from anyone. As such, at the moment, please continue to
>> push my patches.
>
>
> Huh? What are they afraid of?

Hendrik (the only person currently with concerns) felt it is slightly
premature since I have been involved with FFmpeg for only 4 months. I
take any objection of this kind seriously as I do not want any
animosity or disagreement regarding development. These kinds of
things, sufficiently amplified over a period of time and multiple
instances, can lead to pain like the fork. I do not wish to go in that
direction however slight it may appear at the moment.

In fact, IMHO this is best done via a call for a "decision" by the
committee on the lines of Nicolas's proposal.

>
> You can push this patch yourself, it's harmless and consistent with the
> customs around it used for other libraries. There is nothing controversial
> in here. If not, you can blame me for saying it's ok.
>
> Ronald
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

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

On Sat, Oct 3, 2015 at 9:11 AM, Ganesh Ajjanagadde  wrote:

> On Sat, Oct 3, 2015 at 7:49 AM, Hendrik Leppkes 
> wrote:
> > On Sat, Oct 3, 2015 at 2:33 PM, Ganesh Ajjanagadde 
> wrote:
> >> On Tue, Sep 29, 2015 at 8:25 PM, Ganesh Ajjanagadde 
> wrote:
> >>> On Tue, Sep 29, 2015 at 9:08 PM, Michael Niedermayer 
> wrote:
>  On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
> > Signed-off-by: Ganesh Ajjanagadde 
> > ---
> >  libavcodec/apedec.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
>  breaks fate
> 
>  --- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29
> 13:42:22.893972599 +0200
>  +++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30
> 03:06:06.950988548 +0200
>  @@ -1 +1 @@
>  -a28d4e5f2192057f7d4bece870f40bd0
>  +df8663c29d7cd7268d6ae77edd742bb5
>  Test lossless-monkeysaudio-399 failed. Look at
> tests/data/fate/lossless-monkeysaudio-399.err for details.
>  make: *** [fate-lossless-monkeysaudio-399] Error 1
> >>>
> >>> Weird, unfortunately for whatever reason my fate does not test this
> >>> (though apedec gets compiled) so I can't reproduce. One suggestion I
> >>> have is removing the U at the end, that will prevent any unforeseen
> >>> signed/unsigned business which I thought was ok. Please change the
> >>> author tag if you do this.
> >>
> >> updated patch removing the U; like I said my fate does not test it so
> >> it only has been compile tested.
> >>
> >
> > You should figure out whats wrong with your FATE, the ape test doesn't
> > use anything special in particular, so if it isnt running, a bunch of
> > others may also not be.
>
> The faq mentions something about fate-suite, and setting the --samples
> configure flag.
> First off, I don't understand why this is needed since I don't change
> paths except the install path (--prefix=/usr).
> Second, where is this "fate-suite", and why is it not part of the
> FFmpeg source repository?
>

It's HUGE. HHUUU. And it's binary files. We don't want that to live
in git, it's not the right place.


> And lastly, how can I set this up correctly?


configure --samples=/path/to/some/dir/with/lots/of/space, and then make
fate-rsync to download samples (or refresh), and make fate to run it.

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


Re: [FFmpeg-devel] [PATCH] avcodec/libx264: silence -Waddress

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

On Thu, Sep 17, 2015 at 7:03 AM, Ganesh Ajjanagadde 
wrote:

> On Thu, Sep 17, 2015 at 6:15 AM, Hendrik Leppkes 
> wrote:
> > On Thu, Sep 17, 2015 at 12:19 AM, Ganesh Ajjanagadde
> >  wrote:
> >> This patch moves the pointer validity check outside the macro,
> >> and silences the -Waddress observed with GCC 5.2.
> >>
> >> Signed-off-by: Ganesh Ajjanagadde 
> >> ---
> >>  libavcodec/libx264.c | 8 +---
> >>  1 file changed, 5 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
> >> index 58fcfb0..c7c772e 100644
> >> --- a/libavcodec/libx264.c
> >> +++ b/libavcodec/libx264.c
> >> @@ -346,7 +346,7 @@ static av_cold int X264_close(AVCodecContext *avctx)
> >>  #define OPT_STR(opt, param)
>\
> >>  do {
> \
> >>  int ret;
> \
> >> -if (param && (ret = x264_param_parse(&x4->params, opt, param))
> < 0) { \
> >> +if ((ret = x264_param_parse(&x4->params, opt, param)) < 0) { \
> >>  if(ret == X264_PARAM_BAD_NAME)
> \
> >>  av_log(avctx, AV_LOG_ERROR,
>\
> >>  "bad option '%s': '%s'\n", opt, param);
>\
> >> @@ -437,7 +437,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
> >>  x4->params.i_log_level  = X264_LOG_DEBUG;
> >>  x4->params.i_csp= convert_pix_fmt(avctx->pix_fmt);
> >>
> >> -OPT_STR("weightp", x4->wpredp);
> >> +if (x4->wpredp)
> >> +OPT_STR("weightp", x4->wpredp);
> >>
> >>  if (avctx->bit_rate) {
> >>  x4->params.rc.i_bitrate   = avctx->bit_rate / 1000;
> >> @@ -467,7 +468,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
> >>  (float)avctx->rc_initial_buffer_occupancy /
> avctx->rc_buffer_size;
> >>  }
> >>
> >> -OPT_STR("level", x4->level);
> >> +if (x4->level)
> >> +OPT_STR("level", x4->level);
> >>
> >>  if (avctx->i_quant_factor > 0)
> >>  x4->params.rc.f_ip_factor = 1 /
> fabs(avctx->i_quant_factor);
> >
> >
> > Instead of adding explicit checks here, why not make the file more
> > consistent and use PARSE_X264_OPT for the things from the x4 context
> > (like its already done for a bunch of other variables), and only use
> > OPT_STR for the two special cases further down (without the check
> > then)
>
> The behavior then won't be identical before and after the patch; e.g
> the log portion of PARSE_X264_OPT is different from that of OPT_STR.
> The current patch retains identical behavior. In particular, your
> change does change the "user-facing" output slightly. Unless you (or
> someone else) can confirm that it is irrelevant; I do not think your
> proposal is good.


How does it change? I don't think that's necessarily a terrible thing. If
it's just cosmetic, we can live with it.

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 7:49 AM, Hendrik Leppkes  wrote:
> On Sat, Oct 3, 2015 at 2:33 PM, Ganesh Ajjanagadde  wrote:
>> On Tue, Sep 29, 2015 at 8:25 PM, Ganesh Ajjanagadde  wrote:
>>> On Tue, Sep 29, 2015 at 9:08 PM, Michael Niedermayer  
>>> wrote:
 On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

 breaks fate

 --- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29 
 13:42:22.893972599 +0200
 +++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30 
 03:06:06.950988548 +0200
 @@ -1 +1 @@
 -a28d4e5f2192057f7d4bece870f40bd0
 +df8663c29d7cd7268d6ae77edd742bb5
 Test lossless-monkeysaudio-399 failed. Look at 
 tests/data/fate/lossless-monkeysaudio-399.err for details.
 make: *** [fate-lossless-monkeysaudio-399] Error 1
>>>
>>> Weird, unfortunately for whatever reason my fate does not test this
>>> (though apedec gets compiled) so I can't reproduce. One suggestion I
>>> have is removing the U at the end, that will prevent any unforeseen
>>> signed/unsigned business which I thought was ok. Please change the
>>> author tag if you do this.
>>
>> updated patch removing the U; like I said my fate does not test it so
>> it only has been compile tested.
>>
>
> You should figure out whats wrong with your FATE, the ape test doesn't
> use anything special in particular, so if it isnt running, a bunch of
> others may also not be.

The faq mentions something about fate-suite, and setting the --samples
configure flag.
First off, I don't understand why this is needed since I don't change
paths except the install path (--prefix=/usr).
Second, where is this "fate-suite", and why is it not part of the
FFmpeg source repository?
And lastly, how can I set this up correctly?

Feel free to direct me to libav-user/ffmpeg-user if that is where such
questions need to go.

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


Re: [FFmpeg-devel] [PATCHv2] ffplay: more robust mutex, condition variable handling

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

On Sat, Oct 3, 2015 at 8:34 AM, Ganesh Ajjanagadde 
wrote:

> SDL_CreateMutex and SDL_CreateCond can fail:
> https://wiki.libsdl.org/SDL_CreateMutex.
> This patch makes handling more robust in one instance.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  ffplay.c | 18 ++
>  1 file changed, 14 insertions(+), 4 deletions(-)


Given that Marton reviewed original patch and you addressed his comments,
this is OK.

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


Re: [FFmpeg-devel] [PATCH] all: add _DEFAULT_SOURCE locally wherever needed

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

On Sat, Oct 3, 2015 at 8:47 AM, wm4  wrote:

> On Sat,  3 Oct 2015 07:41:00 -0500
> Ganesh Ajjanagadde  wrote:
>
> > Glibc 2.20 onwards generates a deprecation warning for usage of
> _BSD_SOURCE and _SVID_SOURCE.
> > The solution from man feature_test_macros is to define both
> _DEFAULT_SOURCE and the old macros.
> > This solution is on the lines of the one in commit
> af1818276ef271af98e2e2bbabb4dc875b4fa7d8.
> >
> > Signed-off-by: Ganesh Ajjanagadde 
> > ---
> >  libavformat/img2dec.c | 1 +
> >  libavformat/udp.c | 1 +
> >  libswscale/utils.c| 1 +
> >  3 files changed, 3 insertions(+)
> >
> > diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> > index 1697579..0cbcf4a 100644
> > --- a/libavformat/img2dec.c
> > +++ b/libavformat/img2dec.c
> > @@ -20,6 +20,7 @@
> >   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
> 02110-1301 USA
> >   */
> >
> > +#define _DEFAULT_SOURCE
> >  #define _BSD_SOURCE
> >  #include 
> >  #include "libavutil/avstring.h"
> > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > index d40ea97..1bda5af 100644
> > --- a/libavformat/udp.c
> > +++ b/libavformat/udp.c
> > @@ -24,6 +24,7 @@
> >   * UDP protocol
> >   */
> >
> > +#define _DEFAULT_SOURCE
> >  #define _BSD_SOURCE /* Needed for using struct ip_mreq with recent
> glibc */
> >
> >  #include "avformat.h"
> > diff --git a/libswscale/utils.c b/libswscale/utils.c
> > index eb1c940..651b07a 100644
> > --- a/libswscale/utils.c
> > +++ b/libswscale/utils.c
> > @@ -20,6 +20,7 @@
> >
> >  #include "config.h"
> >
> > +#define _DEFAULT_SOURCE
> >  #define _SVID_SOURCE // needed for MAP_ANONYMOUS
> >  #define _DARWIN_C_SOURCE // needed for MAP_ANON
> >  #include 
>
> IMHO much better than the previous attempts, and likely minimize the
> potential for regressions.


Agreed. Patch OK, you can commit yourself if you feel safe :)

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


Re: [FFmpeg-devel] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

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

On Sat, Oct 3, 2015 at 8:31 AM, Ganesh Ajjanagadde 
wrote:

> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/apedec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> index 7b34d26..05cb17e 100644
> --- a/libavcodec/apedec.c
> +++ b/libavcodec/apedec.c
> @@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int
> version, APEFilter *f,
>  /* Update the adaption coefficients */
>  absres = FFABS(res);
>  if (absres)
> -*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
> +*f->adaptcoeffs = ((res & 0x8000) ^ (-(1<<30))) >>
>(25 + (absres <= f->avg*3) + (absres <=
> f->avg*4/3));
>  else
>  *f->adaptcoeffs = 0;
> --
> 2.6.0


I wonder if some compilers will complain that this overflows (strictly
speaking it does) and that it should be -0x8000 instead?

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


Re: [FFmpeg-devel] [PATCHv2] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

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

On Fri, Sep 18, 2015 at 9:05 AM, Ganesh Ajjanagadde 
wrote:

> On Fri, Sep 18, 2015 at 4:40 AM, wm4  wrote:
> > On 17.09.2015 15:07, Ganesh Ajjanagadde wrote:
> >>
> >> When compiled with --disable-pthreads, e.g
> >>
> >>
> http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7
> ,
> >> a bunch of -Wunused-functions are reported.
> >> This patch should silence such warnings.
> >>
> >> Signed-off-by: Ganesh Ajjanagadde 
> >> ---
> >>   libavcodec/alac.c  | 2 +-
> >>   libavcodec/exr.c   | 2 +-
> >>   libavcodec/ffv1dec.c   | 4 ++--
> >>   libavcodec/flacdec.c   | 2 +-
> >>   libavcodec/h264.c  | 2 +-
> >>   libavcodec/huffyuvdec.c| 2 +-
> >>   libavcodec/mdec.c  | 2 +-
> >>   libavcodec/mimic.c | 4 ++--
> >>   libavcodec/mpeg12dec.c | 2 +-
> >>   libavcodec/mpeg4videodec.c | 2 +-
> >>   libavcodec/pngdec.c| 2 +-
> >>   libavcodec/takdec.c| 4 ++--
> >>   libavcodec/tta.c   | 4 ++--
> >>   libavcodec/vp3.c   | 4 ++--
> >>   libavcodec/vp8.c   | 4 ++--
> >>   libavcodec/vp9.c   | 2 +-
> >>   libavcodec/wavpack.c   | 2 +-
> >>   17 files changed, 23 insertions(+), 23 deletions(-)
> >>
> >> diff --git a/libavcodec/alac.c b/libavcodec/alac.c
> >> index 827c0db..f2e5907 100644
> >> --- a/libavcodec/alac.c
> >> +++ b/libavcodec/alac.c
> >> @@ -609,7 +609,7 @@ static av_cold int alac_decode_init(AVCodecContext *
> >> avctx)
> >>   return 0;
> >>   }
> >>
> >> -static int init_thread_copy(AVCodecContext *avctx)
> >> +av_unused static int init_thread_copy(AVCodecContext *avctx)
> >>   {
> >>   ALACContext *alac = avctx->priv_data;
> >>   alac->avctx = avctx;
> >> diff --git a/libavcodec/exr.c b/libavcodec/exr.c
> >> index 3b6b245..778088e 100644
> >> --- a/libavcodec/exr.c
> >> +++ b/libavcodec/exr.c
> >> @@ -1426,7 +1426,7 @@ static av_cold int decode_init(AVCodecContext
> >> *avctx)
> >>   return 0;
> >>   }
> >>
> >> -static int decode_init_thread_copy(AVCodecContext *avctx)
> >> +av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
> >>   {EXRContext *s = avctx->priv_data;
> >>
> >>   // allocate thread data, used for non EXR_RAW compreesion types
> >> diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
> >> index 557b1a0..70ae37d 100644
> >> --- a/libavcodec/ffv1dec.c
> >> +++ b/libavcodec/ffv1dec.c
> >> @@ -1008,7 +1008,7 @@ static int decode_frame(AVCodecContext *avctx,
> void
> >> *data, int *got_frame, AVPac
> >>   return buf_size;
> >>   }
> >>
> >> -static int init_thread_copy(AVCodecContext *avctx)
> >> +av_unused static int init_thread_copy(AVCodecContext *avctx)
> >>   {
> >>   FFV1Context *f = avctx->priv_data;
> >>   int i, ret;
> >> @@ -1061,7 +1061,7 @@ static void copy_fields(FFV1Context *fsdst,
> >> FFV1Context *fssrc, FFV1Context *fsr
> >>   }
> >>   }
> >>
> >> -static int update_thread_context(AVCodecContext *dst, const
> >> AVCodecContext *src)
> >> +av_unused static int update_thread_context(AVCodecContext *dst, const
> >> AVCodecContext *src)
> >>   {
> >>   FFV1Context *fsrc = src->priv_data;
> >>   FFV1Context *fdst = dst->priv_data;
> >> diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
> >> index 8653da7..00744da 100644
> >> --- a/libavcodec/flacdec.c
> >> +++ b/libavcodec/flacdec.c
> >> @@ -623,7 +623,7 @@ static int flac_decode_frame(AVCodecContext *avctx,
> >> void *data,
> >>   return bytes_read;
> >>   }
> >>
> >> -static int init_thread_copy(AVCodecContext *avctx)
> >> +av_unused static int init_thread_copy(AVCodecContext *avctx)
> >>   {
> >>   FLACContext *s = avctx->priv_data;
> >>   s->decoded_buffer = NULL;
> >> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> >> index b797893..fa66b53 100644
> >> --- a/libavcodec/h264.c
> >> +++ b/libavcodec/h264.c
> >> @@ -701,7 +701,7 @@ av_cold int ff_h264_decode_init(AVCodecContext
> *avctx)
> >>   return 0;
> >>   }
> >>
> >> -static int decode_init_thread_copy(AVCodecContext *avctx)
> >> +av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
> >>   {
> >>   H264Context *h = avctx->priv_data;
> >>   int ret;
> >> diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
> >> index a700abb..eda11ee 100644
> >> --- a/libavcodec/huffyuvdec.c
> >> +++ b/libavcodec/huffyuvdec.c
> >> @@ -571,7 +571,7 @@ static av_cold int decode_init(AVCodecContext
> *avctx)
> >>   return ret;
> >>   }
> >>
> >> -static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
> >> +av_unused static av_cold int decode_init_thread_copy(AVCodecContext
> >> *avctx)
> >>   {
> >>   HYuvContext *s = avctx->priv_data;
> >>   int i, ret;
> >> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
> >> index a9b7e82..b169ac6 100644
> >> --- a/libavcodec/mdec.c
> >> +++ b/libavcodec/mdec.c
> >> @@ -233,7 +233,7 @@ static av_cold int decode_init(AVCodecContext
> *avctx)
> >>   return 0;
> >>   }
> 

Re: [FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

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

On Sat, Oct 3, 2015 at 8:45 AM, Ganesh Ajjanagadde 
wrote:

> On Sat, Oct 3, 2015 at 7:42 AM, Ronald S. Bultje 
> wrote:
> > Hi,
> >
> > On Sat, Oct 3, 2015 at 8:39 AM, Ganesh Ajjanagadde <
> gajjanaga...@gmail.com>
> > wrote:
> >>
> >> On Sat, Sep 26, 2015 at 9:57 AM, Ganesh Ajjanagadde
> >>  wrote:
> >> > On Sat, Sep 19, 2015 at 10:20 AM, Ganesh Ajjanagadde
> >> >  wrote:
> >> >> This patch silences such warnings by placing initializations under a
> >> >> header guard,
> >> >> see e.g
> >> >>
> >> >>
> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale
> ,
> >> >>
> >> >>
> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
> >> >> for examples of such warnings.
> >> >> It also has the benefit of placing library specific #defines next to
> >> >> each other.
> >> >>
> >> >> Signed-off-by: Ganesh Ajjanagadde 
> >> >> ---
> >> >>  cmdutils.c | 9 ++---
> >> >>  1 file changed, 6 insertions(+), 3 deletions(-)
> >> >>
> >> >> diff --git a/cmdutils.c b/cmdutils.c
> >> >> index b696008..38d6334 100644
> >> >> --- a/cmdutils.c
> >> >> +++ b/cmdutils.c
> >> >> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt,
> >> >> const char *arg)
> >> >>  #if CONFIG_AVRESAMPLE
> >> >>  const AVClass *rc = avresample_get_class();
> >> >>  #endif
> >> >> -const AVClass *sc, *swr_class;
> >> >> +#if CONFIG_SWSCALE
> >> >> +const AVClass *sc = sws_get_class();
> >> >> +#endif
> >> >> +#if CONFIG_SWRESAMPLE
> >> >> +const AVClass *swr_class = swr_get_class();
> >> >> +#endif
> >> >>
> >> >>  if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
> >> >>  av_log_set_level(AV_LOG_DEBUG);
> >> >> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt,
> >> >> const char *arg)
> >> >>  consumed = 1;
> >> >>  }
> >> >>  #if CONFIG_SWSCALE
> >> >> -sc = sws_get_class();
> >> >>  if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
> >> >>   AV_OPT_SEARCH_CHILDREN |
> >> >> AV_OPT_SEARCH_FAKE_OBJ))) {
> >> >>  struct SwsContext *sws = sws_alloc_context();
> >> >> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt,
> >> >> const char *arg)
> >> >>  }
> >> >>  #endif
> >> >>  #if CONFIG_SWRESAMPLE
> >> >> -swr_class = swr_get_class();
> >> >>  if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
> >> >>  AV_OPT_SEARCH_CHILDREN |
> >> >> AV_OPT_SEARCH_FAKE_OBJ))) {
> >> >>  struct SwrContext *swr = swr_alloc();
> >> >> --
> >> >> 2.5.2
> >> >>
> >> >
> >> > ping
> >>
> >> been a week; hence ping again.
> >
> >
> > Patch is fine with me. Do you have commit access?
>
> Technically I do, but some devs are not comfortable with me exercising
> it at the moment. I plan to exercise it only when there are no
> objections from anyone. As such, at the moment, please continue to
> push my patches.


Huh? What are they afraid of?

You can push this patch yourself, it's harmless and consistent with the
customs around it used for other libraries. There is nothing controversial
in here. If not, you can blame me for saying it's ok.

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


Re: [FFmpeg-devel] [PATCH] all: add _DEFAULT_SOURCE locally wherever needed

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 7:47 AM, wm4  wrote:
> On Sat,  3 Oct 2015 07:41:00 -0500
> Ganesh Ajjanagadde  wrote:
>
>> Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE 
>> and _SVID_SOURCE.
>> The solution from man feature_test_macros is to define both _DEFAULT_SOURCE 
>> and the old macros.
>> This solution is on the lines of the one in commit 
>> af1818276ef271af98e2e2bbabb4dc875b4fa7d8.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavformat/img2dec.c | 1 +
>>  libavformat/udp.c | 1 +
>>  libswscale/utils.c| 1 +
>>  3 files changed, 3 insertions(+)
>>
>> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
>> index 1697579..0cbcf4a 100644
>> --- a/libavformat/img2dec.c
>> +++ b/libavformat/img2dec.c
>> @@ -20,6 +20,7 @@
>>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
>> USA
>>   */
>>
>> +#define _DEFAULT_SOURCE
>>  #define _BSD_SOURCE
>>  #include 
>>  #include "libavutil/avstring.h"
>> diff --git a/libavformat/udp.c b/libavformat/udp.c
>> index d40ea97..1bda5af 100644
>> --- a/libavformat/udp.c
>> +++ b/libavformat/udp.c
>> @@ -24,6 +24,7 @@
>>   * UDP protocol
>>   */
>>
>> +#define _DEFAULT_SOURCE
>>  #define _BSD_SOURCE /* Needed for using struct ip_mreq with recent 
>> glibc */
>>
>>  #include "avformat.h"
>> diff --git a/libswscale/utils.c b/libswscale/utils.c
>> index eb1c940..651b07a 100644
>> --- a/libswscale/utils.c
>> +++ b/libswscale/utils.c
>> @@ -20,6 +20,7 @@
>>
>>  #include "config.h"
>>
>> +#define _DEFAULT_SOURCE
>>  #define _SVID_SOURCE // needed for MAP_ANONYMOUS
>>  #define _DARWIN_C_SOURCE // needed for MAP_ANON
>>  #include 
>
> IMHO much better than the previous attempts, and likely minimize the
> potential for regressions.

I agree with the local idea now as well - I realized that the global
one is not really a "fire and forget"  (the only benefit I was
claiming for it).

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Hendrik Leppkes
On Sat, Oct 3, 2015 at 2:33 PM, Ganesh Ajjanagadde  wrote:
> On Tue, Sep 29, 2015 at 8:25 PM, Ganesh Ajjanagadde  wrote:
>> On Tue, Sep 29, 2015 at 9:08 PM, Michael Niedermayer  
>> wrote:
>>> On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
 Signed-off-by: Ganesh Ajjanagadde 
 ---
  libavcodec/apedec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> breaks fate
>>>
>>> --- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29 
>>> 13:42:22.893972599 +0200
>>> +++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30 
>>> 03:06:06.950988548 +0200
>>> @@ -1 +1 @@
>>> -a28d4e5f2192057f7d4bece870f40bd0
>>> +df8663c29d7cd7268d6ae77edd742bb5
>>> Test lossless-monkeysaudio-399 failed. Look at 
>>> tests/data/fate/lossless-monkeysaudio-399.err for details.
>>> make: *** [fate-lossless-monkeysaudio-399] Error 1
>>
>> Weird, unfortunately for whatever reason my fate does not test this
>> (though apedec gets compiled) so I can't reproduce. One suggestion I
>> have is removing the U at the end, that will prevent any unforeseen
>> signed/unsigned business which I thought was ok. Please change the
>> author tag if you do this.
>
> updated patch removing the U; like I said my fate does not test it so
> it only has been compile tested.
>

You should figure out whats wrong with your FATE, the ape test doesn't
use anything special in particular, so if it isnt running, a bunch of
others may also not be.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/libx264: silence -Waddress

2015-10-03 Thread Ganesh Ajjanagadde
On Thu, Sep 17, 2015 at 6:03 AM, Ganesh Ajjanagadde
 wrote:
> On Thu, Sep 17, 2015 at 6:15 AM, Hendrik Leppkes  wrote:
>> On Thu, Sep 17, 2015 at 12:19 AM, Ganesh Ajjanagadde
>>  wrote:
>>> This patch moves the pointer validity check outside the macro,
>>> and silences the -Waddress observed with GCC 5.2.
>>>
>>> Signed-off-by: Ganesh Ajjanagadde 
>>> ---
>>>  libavcodec/libx264.c | 8 +---
>>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
>>> index 58fcfb0..c7c772e 100644
>>> --- a/libavcodec/libx264.c
>>> +++ b/libavcodec/libx264.c
>>> @@ -346,7 +346,7 @@ static av_cold int X264_close(AVCodecContext *avctx)
>>>  #define OPT_STR(opt, param)
>>>\
>>>  do {   
>>>\
>>>  int ret;   
>>>\
>>> -if (param && (ret = x264_param_parse(&x4->params, opt, param)) < 
>>> 0) { \
>>> +if ((ret = x264_param_parse(&x4->params, opt, param)) < 0) { \
>>>  if(ret == X264_PARAM_BAD_NAME) 
>>>\
>>>  av_log(avctx, AV_LOG_ERROR,
>>>\
>>>  "bad option '%s': '%s'\n", opt, param);
>>>\
>>> @@ -437,7 +437,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
>>>  x4->params.i_log_level  = X264_LOG_DEBUG;
>>>  x4->params.i_csp= convert_pix_fmt(avctx->pix_fmt);
>>>
>>> -OPT_STR("weightp", x4->wpredp);
>>> +if (x4->wpredp)
>>> +OPT_STR("weightp", x4->wpredp);
>>>
>>>  if (avctx->bit_rate) {
>>>  x4->params.rc.i_bitrate   = avctx->bit_rate / 1000;
>>> @@ -467,7 +468,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
>>>  (float)avctx->rc_initial_buffer_occupancy / 
>>> avctx->rc_buffer_size;
>>>  }
>>>
>>> -OPT_STR("level", x4->level);
>>> +if (x4->level)
>>> +OPT_STR("level", x4->level);
>>>
>>>  if (avctx->i_quant_factor > 0)
>>>  x4->params.rc.f_ip_factor = 1 / 
>>> fabs(avctx->i_quant_factor);
>>
>>
>> Instead of adding explicit checks here, why not make the file more
>> consistent and use PARSE_X264_OPT for the things from the x4 context
>> (like its already done for a bunch of other variables), and only use
>> OPT_STR for the two special cases further down (without the check
>> then)
>
> The behavior then won't be identical before and after the patch; e.g
> the log portion of PARSE_X264_OPT is different from that of OPT_STR.
> The current patch retains identical behavior. In particular, your
> change does change the "user-facing" output slightly. Unless you (or
> someone else) can confirm that it is irrelevant; I do not think your
> proposal is good.

Ping, can someone confirm either way so that this can move forward?

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


Re: [FFmpeg-devel] [PATCH] all: add _DEFAULT_SOURCE locally wherever needed

2015-10-03 Thread wm4
On Sat,  3 Oct 2015 07:41:00 -0500
Ganesh Ajjanagadde  wrote:

> Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE 
> and _SVID_SOURCE.
> The solution from man feature_test_macros is to define both _DEFAULT_SOURCE 
> and the old macros.
> This solution is on the lines of the one in commit 
> af1818276ef271af98e2e2bbabb4dc875b4fa7d8.
> 
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavformat/img2dec.c | 1 +
>  libavformat/udp.c | 1 +
>  libswscale/utils.c| 1 +
>  3 files changed, 3 insertions(+)
> 
> diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
> index 1697579..0cbcf4a 100644
> --- a/libavformat/img2dec.c
> +++ b/libavformat/img2dec.c
> @@ -20,6 +20,7 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#define _DEFAULT_SOURCE
>  #define _BSD_SOURCE
>  #include 
>  #include "libavutil/avstring.h"
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index d40ea97..1bda5af 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -24,6 +24,7 @@
>   * UDP protocol
>   */
>  
> +#define _DEFAULT_SOURCE
>  #define _BSD_SOURCE /* Needed for using struct ip_mreq with recent glibc 
> */
>  
>  #include "avformat.h"
> diff --git a/libswscale/utils.c b/libswscale/utils.c
> index eb1c940..651b07a 100644
> --- a/libswscale/utils.c
> +++ b/libswscale/utils.c
> @@ -20,6 +20,7 @@
>  
>  #include "config.h"
>  
> +#define _DEFAULT_SOURCE
>  #define _SVID_SOURCE // needed for MAP_ANONYMOUS
>  #define _DARWIN_C_SOURCE // needed for MAP_ANON
>  #include 

IMHO much better than the previous attempts, and likely minimize the
potential for regressions.

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


Re: [FFmpeg-devel] [PATCH][RFC] configure: silence preprocessor noise from dependency generation

2015-10-03 Thread Ganesh Ajjanagadde
On Fri, Sep 18, 2015 at 2:28 PM, Ganesh Ajjanagadde
 wrote:
> Currently, errors are thrown for various macros while building that are 
> completely bogus.
> They occur during the dependency (.d) generation phase, and have no bearing 
> on the compiled output,
> since only the stdout is piped into the sed command to generate the .d files.
> They basically occur as the relevant -I paths are not (and cannot be passed) 
> during
> the dependancy generation phase.
> As such, this patch silences them.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index e5d7b12..6f9be48 100755
> --- a/configure
> +++ b/configure
> @@ -2975,7 +2975,7 @@ target_path='$(CURDIR)'
>
>  # since the object filename is not given with the -MM flag, the compiler
>  # is only able to print the basename, and we must add the path ourselves
> -DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" 
> -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
> +DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e 
> "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
>  DEPFLAGS='-MM'
>
>  # find source path
> --
> 2.5.2
>

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


Re: [FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

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

On Sat, Oct 3, 2015 at 8:39 AM, Ganesh Ajjanagadde 
wrote:

> On Sat, Sep 26, 2015 at 9:57 AM, Ganesh Ajjanagadde
>  wrote:
> > On Sat, Sep 19, 2015 at 10:20 AM, Ganesh Ajjanagadde
> >  wrote:
> >> This patch silences such warnings by placing initializations under a
> header guard,
> >> see e.g
> >>
> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale
> ,
> >>
> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
> >> for examples of such warnings.
> >> It also has the benefit of placing library specific #defines next to
> each other.
> >>
> >> Signed-off-by: Ganesh Ajjanagadde 
> >> ---
> >>  cmdutils.c | 9 ++---
> >>  1 file changed, 6 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/cmdutils.c b/cmdutils.c
> >> index b696008..38d6334 100644
> >> --- a/cmdutils.c
> >> +++ b/cmdutils.c
> >> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt,
> const char *arg)
> >>  #if CONFIG_AVRESAMPLE
> >>  const AVClass *rc = avresample_get_class();
> >>  #endif
> >> -const AVClass *sc, *swr_class;
> >> +#if CONFIG_SWSCALE
> >> +const AVClass *sc = sws_get_class();
> >> +#endif
> >> +#if CONFIG_SWRESAMPLE
> >> +const AVClass *swr_class = swr_get_class();
> >> +#endif
> >>
> >>  if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
> >>  av_log_set_level(AV_LOG_DEBUG);
> >> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt,
> const char *arg)
> >>  consumed = 1;
> >>  }
> >>  #if CONFIG_SWSCALE
> >> -sc = sws_get_class();
> >>  if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
> >>   AV_OPT_SEARCH_CHILDREN |
> AV_OPT_SEARCH_FAKE_OBJ))) {
> >>  struct SwsContext *sws = sws_alloc_context();
> >> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt,
> const char *arg)
> >>  }
> >>  #endif
> >>  #if CONFIG_SWRESAMPLE
> >> -swr_class = swr_get_class();
> >>  if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
> >>  AV_OPT_SEARCH_CHILDREN |
> AV_OPT_SEARCH_FAKE_OBJ))) {
> >>  struct SwrContext *swr = swr_alloc();
> >> --
> >> 2.5.2
> >>
> >
> > ping
>
> been a week; hence ping again.


Patch is fine with me. Do you have commit access?

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


Re: [FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Oct 3, 2015 at 7:42 AM, Ronald S. Bultje  wrote:
> Hi,
>
> On Sat, Oct 3, 2015 at 8:39 AM, Ganesh Ajjanagadde 
> wrote:
>>
>> On Sat, Sep 26, 2015 at 9:57 AM, Ganesh Ajjanagadde
>>  wrote:
>> > On Sat, Sep 19, 2015 at 10:20 AM, Ganesh Ajjanagadde
>> >  wrote:
>> >> This patch silences such warnings by placing initializations under a
>> >> header guard,
>> >> see e.g
>> >>
>> >> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale,
>> >>
>> >> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
>> >> for examples of such warnings.
>> >> It also has the benefit of placing library specific #defines next to
>> >> each other.
>> >>
>> >> Signed-off-by: Ganesh Ajjanagadde 
>> >> ---
>> >>  cmdutils.c | 9 ++---
>> >>  1 file changed, 6 insertions(+), 3 deletions(-)
>> >>
>> >> diff --git a/cmdutils.c b/cmdutils.c
>> >> index b696008..38d6334 100644
>> >> --- a/cmdutils.c
>> >> +++ b/cmdutils.c
>> >> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt,
>> >> const char *arg)
>> >>  #if CONFIG_AVRESAMPLE
>> >>  const AVClass *rc = avresample_get_class();
>> >>  #endif
>> >> -const AVClass *sc, *swr_class;
>> >> +#if CONFIG_SWSCALE
>> >> +const AVClass *sc = sws_get_class();
>> >> +#endif
>> >> +#if CONFIG_SWRESAMPLE
>> >> +const AVClass *swr_class = swr_get_class();
>> >> +#endif
>> >>
>> >>  if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
>> >>  av_log_set_level(AV_LOG_DEBUG);
>> >> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt,
>> >> const char *arg)
>> >>  consumed = 1;
>> >>  }
>> >>  #if CONFIG_SWSCALE
>> >> -sc = sws_get_class();
>> >>  if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
>> >>   AV_OPT_SEARCH_CHILDREN |
>> >> AV_OPT_SEARCH_FAKE_OBJ))) {
>> >>  struct SwsContext *sws = sws_alloc_context();
>> >> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt,
>> >> const char *arg)
>> >>  }
>> >>  #endif
>> >>  #if CONFIG_SWRESAMPLE
>> >> -swr_class = swr_get_class();
>> >>  if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
>> >>  AV_OPT_SEARCH_CHILDREN |
>> >> AV_OPT_SEARCH_FAKE_OBJ))) {
>> >>  struct SwrContext *swr = swr_alloc();
>> >> --
>> >> 2.5.2
>> >>
>> >
>> > ping
>>
>> been a week; hence ping again.
>
>
> Patch is fine with me. Do you have commit access?

Technically I do, but some devs are not comfortable with me exercising
it at the moment. I plan to exercise it only when there are no
objections from anyone. As such, at the moment, please continue to
push my patches.

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


Re: [FFmpeg-devel] [PATCHv2] configure: add -D_DEFAULT_SOURCE to silence -Wcpp

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Sep 19, 2015 at 2:05 PM, Ganesh Ajjanagadde  wrote:
> On Sat, Sep 19, 2015 at 2:13 PM, Hendrik Leppkes  wrote:
>> On Sat, Sep 19, 2015 at 6:07 PM, Ganesh Ajjanagadde  wrote:
>>> On Thu, Sep 17, 2015 at 6:45 AM, Ganesh Ajjanagadde  
>>> wrote:
 On Thu, Sep 17, 2015 at 4:54 AM, Clément Bœsch  wrote:
> On Wed, Sep 16, 2015 at 06:55:39PM -0400, Ganesh Ajjanagadde wrote:
>> Glibc 2.20 onwards generates a deprecation warning for usage of 
>> _BSD_SOURCE and _SVID_SOURCE.
>> The solution from man feature_test_macros is to define both 
>> _DEFAULT_SOURCE and the old macros.
>> This change is done in configure while testing for Glibc. Doing it in 
>> source code
>> would require __UCLIBC__ checks, etc since uclibc also defines __GLIBC__ 
>> and __GLIBC_MINOR__,
>> so placing it in configure avoids the repeated checks.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  configure| 6 ++
>>  libavformat/os_support.c | 1 -
>>  2 files changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index cd6f629..0cd0a6c 100755
>> --- a/configure
>> +++ b/configure
>> @@ -4520,6 +4520,12 @@ probe_libc(){
>>  elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
>>  eval ${pfx}libc_type=glibc
>>  add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
>> +# define _DEFAULT_SOURCE for glibc 2.20 onwards to silence 
>> deprecation
>> +# warnings for _BSD_SOURCE and _SVID_SOURCE.
>> +if check_${pfx}cpp_condition features.h "(__GLIBC__ == 2 && 
>> __GLIBC_MINOR__ >= 20) \
>> +|| (__GLIBC__ > 2)"; then
>> +add_${pfx}cppflags -D_DEFAULT_SOURCE
>> +fi
>
> Is this adding _DEFAULT_SOURCE to every compiled file while it was scope
> to a standalone source file before?

 Don't know exactly what you mean, but try e.g strings on any of these
 objects. There is no "DEFAULT_SOURCE", "BSD_SOURCE", or any such thing
 suggesting they are optimized out. Furthermore, a du on the libav*
 does not reveal any increase in size.
>>>
>>> ping
>>
>> I agree with Clément, adding a global define to every single file
>> while it was contained to a handful of select files before seems less
>> than ideal.
>
> Like I said, it causes no visible change in the result. One could add
> it to the specific files. However, think about the future: it is very
> easy to miss adding this, and warnings may be triggered in the future
> at any point if a dev uses the BSD, SVID, etc forgetting the DEFAULT.
> Who knows what glibc would do 3 releases down, when the deprecation
> becomes an actual error. I think FFmpeg devs should have better things
> to do in future than agonizing over some ugly glibc thing that is
> introduced for god knows what reason. In light of that I wanted to
> create a "fire and forget" solution which is global in character. This
> achieves this at no performance penalty and practically speaking no
> symbol problems. We already have a bunch of global things, see e.g the
> -DZLIB, etc - they are certainly not needed everywhere and your
> argument would apply to them as well.
>
> If this was required in just a single file, I would agree with you.
> However, it shows up in multiple places (IIRC at least 3).
>
> Anyway, if you (or others) still feel that way about it, I will change
> the patch.

Updated patch doing local defines wherever needed.

>
>>
>> - Hendrik
>> ___
>> 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] all: add _DEFAULT_SOURCE locally wherever needed

2015-10-03 Thread Ganesh Ajjanagadde
Glibc 2.20 onwards generates a deprecation warning for usage of _BSD_SOURCE and 
_SVID_SOURCE.
The solution from man feature_test_macros is to define both _DEFAULT_SOURCE and 
the old macros.
This solution is on the lines of the one in commit 
af1818276ef271af98e2e2bbabb4dc875b4fa7d8.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavformat/img2dec.c | 1 +
 libavformat/udp.c | 1 +
 libswscale/utils.c| 1 +
 3 files changed, 3 insertions(+)

diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index 1697579..0cbcf4a 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -20,6 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define _DEFAULT_SOURCE
 #define _BSD_SOURCE
 #include 
 #include "libavutil/avstring.h"
diff --git a/libavformat/udp.c b/libavformat/udp.c
index d40ea97..1bda5af 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -24,6 +24,7 @@
  * UDP protocol
  */
 
+#define _DEFAULT_SOURCE
 #define _BSD_SOURCE /* Needed for using struct ip_mreq with recent glibc */
 
 #include "avformat.h"
diff --git a/libswscale/utils.c b/libswscale/utils.c
index eb1c940..651b07a 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -20,6 +20,7 @@
 
 #include "config.h"
 
+#define _DEFAULT_SOURCE
 #define _SVID_SOURCE // needed for MAP_ANONYMOUS
 #define _DARWIN_C_SOURCE // needed for MAP_ANON
 #include 
-- 
2.6.0

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


Re: [FFmpeg-devel] Adding Closed Caption support to Decklink output

2015-10-03 Thread Deron

On 9/29/15 1:42 AM, Carl Eugen Hoyos wrote:

Deron  pagestream.org> writes:


For this to work, I have to output 10 bit YUV ‘v210’
4:2:2 representation (twelve 10-bit unsigned components
packed into four 32-bit little-endian words).

Can't you use the v210 encoder to produce this format?

Carl Eugen


Thanks, I did just that. Not an idea solution, but it so far it seems to 
work. At least the video works :-)


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


Re: [FFmpeg-devel] [PATCH] cmdutils: silence unused warnings under --disable-swscale, --disable-swresample

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Sep 26, 2015 at 9:57 AM, Ganesh Ajjanagadde
 wrote:
> On Sat, Sep 19, 2015 at 10:20 AM, Ganesh Ajjanagadde
>  wrote:
>> This patch silences such warnings by placing initializations under a header 
>> guard,
>> see e.g
>> http://fate.ffmpeg.org/log.cgi?time=20150919095430&log=compile&slot=x86_64-archlinux-gcc-disableswscale,
>> http://fate.ffmpeg.org/log.cgi?time=20150919095048&log=compile&slot=x86_64-archlinux-gcc-disableswresample
>> for examples of such warnings.
>> It also has the benefit of placing library specific #defines next to each 
>> other.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  cmdutils.c | 9 ++---
>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>
>> diff --git a/cmdutils.c b/cmdutils.c
>> index b696008..38d6334 100644
>> --- a/cmdutils.c
>> +++ b/cmdutils.c
>> @@ -533,7 +533,12 @@ int opt_default(void *optctx, const char *opt, const 
>> char *arg)
>>  #if CONFIG_AVRESAMPLE
>>  const AVClass *rc = avresample_get_class();
>>  #endif
>> -const AVClass *sc, *swr_class;
>> +#if CONFIG_SWSCALE
>> +const AVClass *sc = sws_get_class();
>> +#endif
>> +#if CONFIG_SWRESAMPLE
>> +const AVClass *swr_class = swr_get_class();
>> +#endif
>>
>>  if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
>>  av_log_set_level(AV_LOG_DEBUG);
>> @@ -557,7 +562,6 @@ int opt_default(void *optctx, const char *opt, const 
>> char *arg)
>>  consumed = 1;
>>  }
>>  #if CONFIG_SWSCALE
>> -sc = sws_get_class();
>>  if (!consumed && (o = opt_find(&sc, opt, NULL, 0,
>>   AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) 
>> {
>>  struct SwsContext *sws = sws_alloc_context();
>> @@ -579,7 +583,6 @@ int opt_default(void *optctx, const char *opt, const 
>> char *arg)
>>  }
>>  #endif
>>  #if CONFIG_SWRESAMPLE
>> -swr_class = swr_get_class();
>>  if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
>>  AV_OPT_SEARCH_CHILDREN | 
>> AV_OPT_SEARCH_FAKE_OBJ))) {
>>  struct SwrContext *swr = swr_alloc();
>> --
>> 2.5.2
>>
>
> ping

been a week; hence ping again.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/x86/hpeldsp_rnd_template: silence -Wunused-function on --disable-mmx

2015-10-03 Thread Michael Niedermayer
On Sat, Oct 03, 2015 at 07:18:16AM -0500, Ganesh Ajjanagadde wrote:
> On Tue, Sep 29, 2015 at 6:28 PM, Ganesh Ajjanagadde
>  wrote:
> > This silences some of the -Wunused-function warnings when compiled with 
> > --disable-mmx, e.g
> > http://fate.ffmpeg.org/log.cgi?time=20150919094617&log=compile&slot=x86_64-archlinux-gcc-disable-mmx.
> > Header guards are too brittle and ugly for this case.
> >
> > Signed-off-by: Ganesh Ajjanagadde 
> > ---
> >  libavcodec/x86/hpeldsp_rnd_template.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/x86/hpeldsp_rnd_template.c 
> > b/libavcodec/x86/hpeldsp_rnd_template.c
> > index abe3bb1..e20d065 100644
> > --- a/libavcodec/x86/hpeldsp_rnd_template.c
> > +++ b/libavcodec/x86/hpeldsp_rnd_template.c
> > @@ -106,7 +106,7 @@ av_unused static void DEF(put, pixels16_x2)(uint8_t 
> > *block, const uint8_t *pixel
> >  :REG_a, "memory");
> >  }
> >
> > -static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, 
> > ptrdiff_t line_size, int h)
> > +av_unused static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t 
> > *pixels, ptrdiff_t line_size, int h)
> >  {
> >  MOVQ_BFE(mm6);
> >  __asm__ volatile(
> > @@ -162,7 +162,7 @@ av_unused static void DEF(avg, pixels16_x2)(uint8_t 
> > *block, const uint8_t *pixel
> >  :"memory");
> >  }
> >
> > -static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, 
> > ptrdiff_t line_size, int h)
> > +av_unused static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t 
> > *pixels, ptrdiff_t line_size, int h)
> >  {
> >  MOVQ_BFE(mm6);
> >  __asm__ volatile(
> > --
> > 2.5.3
> >
> 
> ping

applied

thanks

[...]
-- 
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 1/2] avutil/attributes: extend av_uninit to clang

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Sep 26, 2015 at 1:32 PM, Ganesh Ajjanagadde
 wrote:
> On Sat, Sep 19, 2015 at 1:00 AM, Ganesh Ajjanagadde
>  wrote:
>> Commit 6dac8c8327 disabled av_uninit for clang, due to some useless warnings.
>> The concept of av_uninit is inherently useful though. This patch silences a
>> bunch of warnings on clang e.g
>> http://fate.ffmpeg.org/log.cgi?time=20150918181527&log=compile&slot=x86_64-darwin-clang-polly-vectorize-stripmine-3.7.
>> Furthermore, it should be useful for general usage of av_uninit in future.
>>
>> Signed-off-by: Ganesh Ajjanagadde 
>> ---
>>  libavutil/attributes.h | 6 ++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/libavutil/attributes.h b/libavutil/attributes.h
>> index 50e8eb3..b4b5f13 100644
>> --- a/libavutil/attributes.h
>> +++ b/libavutil/attributes.h
>> @@ -141,6 +141,12 @@
>>
>>  #if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__clang__)
>>  #define av_uninit(x) x=x
>> +#elif defined(__clang__)
>> +#define av_uninit(x) \
>> +_Pragma("clang diagnostic push") \
>> +_Pragma("clang diagnostic ignored \"-Wuninitialized\"") \
>> +x=x \
>> +_Pragma("clang diagnostic pop")
>>  #else
>>  #define av_uninit(x) x
>>  #endif
>> --
>> 2.5.2
>>
>
> ping

been a week, hence ping again.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avcodec: use av_unused to silence -Wunused-function on --disable-pthreads

2015-10-03 Thread Ganesh Ajjanagadde
When compiled with --disable-pthreads, e.g
http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7,
a bunch of -Wunused-functions are reported.
This patch should silence such warnings.
The alternative of header guards is slightly more brittle and was discouraged.

Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/alac.c  | 2 +-
 libavcodec/exr.c   | 2 +-
 libavcodec/ffv1dec.c   | 4 ++--
 libavcodec/flacdec.c   | 2 +-
 libavcodec/h264.c  | 2 +-
 libavcodec/huffyuvdec.c| 2 +-
 libavcodec/mdec.c  | 2 +-
 libavcodec/mimic.c | 4 ++--
 libavcodec/mpeg12dec.c | 2 +-
 libavcodec/mpeg4videodec.c | 2 +-
 libavcodec/pngdec.c| 2 +-
 libavcodec/takdec.c| 4 ++--
 libavcodec/tta.c   | 4 ++--
 libavcodec/vp3.c   | 4 ++--
 libavcodec/vp8.c   | 4 ++--
 libavcodec/vp9.c   | 2 +-
 libavcodec/wavpack.c   | 2 +-
 17 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index 827c0db..f2e5907 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -609,7 +609,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
 return 0;
 }
 
-static int init_thread_copy(AVCodecContext *avctx)
+av_unused static int init_thread_copy(AVCodecContext *avctx)
 {
 ALACContext *alac = avctx->priv_data;
 alac->avctx = avctx;
diff --git a/libavcodec/exr.c b/libavcodec/exr.c
index 3b6b245..778088e 100644
--- a/libavcodec/exr.c
+++ b/libavcodec/exr.c
@@ -1426,7 +1426,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static int decode_init_thread_copy(AVCodecContext *avctx)
+av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
 {EXRContext *s = avctx->priv_data;
 
 // allocate thread data, used for non EXR_RAW compreesion types
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 662ef13..76bd6cb 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -1017,7 +1017,7 @@ static int decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame, AVPac
 return buf_size;
 }
 
-static int init_thread_copy(AVCodecContext *avctx)
+av_unused static int init_thread_copy(AVCodecContext *avctx)
 {
 FFV1Context *f = avctx->priv_data;
 int i, ret;
@@ -1071,7 +1071,7 @@ static void copy_fields(FFV1Context *fsdst, FFV1Context 
*fssrc, FFV1Context *fsr
 }
 }
 
-static int update_thread_context(AVCodecContext *dst, const AVCodecContext 
*src)
+av_unused static int update_thread_context(AVCodecContext *dst, const 
AVCodecContext *src)
 {
 FFV1Context *fsrc = src->priv_data;
 FFV1Context *fdst = dst->priv_data;
diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 8653da7..00744da 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -623,7 +623,7 @@ static int flac_decode_frame(AVCodecContext *avctx, void 
*data,
 return bytes_read;
 }
 
-static int init_thread_copy(AVCodecContext *avctx)
+av_unused static int init_thread_copy(AVCodecContext *avctx)
 {
 FLACContext *s = avctx->priv_data;
 s->decoded_buffer = NULL;
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8b95003..e1061d8 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -701,7 +701,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static int decode_init_thread_copy(AVCodecContext *avctx)
+av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
 {
 H264Context *h = avctx->priv_data;
 int ret;
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index a700abb..eda11ee 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -571,7 +571,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 return ret;
 }
 
-static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
+av_unused static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
 {
 HYuvContext *s = avctx->priv_data;
 int i, ret;
diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index a9b7e82..b169ac6 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -233,7 +233,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
+av_unused static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
 {
 MDECContext * const a = avctx->priv_data;
 
diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c
index f5853b5..2d861b6 100644
--- a/libavcodec/mimic.c
+++ b/libavcodec/mimic.c
@@ -167,7 +167,7 @@ static av_cold int mimic_decode_init(AVCodecContext *avctx)
 return 0;
 }
 
-static int mimic_decode_update_thread_context(AVCodecContext *avctx, const 
AVCodecContext *avctx_from)
+av_unused static int mimic_decode_update_thread_context(AVCodecContext *avctx, 
const AVCodecContext *avctx_from)
 {
 MimicContext *dst = avctx->priv_data, *src = avctx_from->priv_data;
 int i, ret;
@@ -454,7 +454,7 @@ static int mimic_

Re: [FFmpeg-devel] [PATCHv2] avcodec: use HAVE_THREADS header guards to silence -Wunused-function

2015-10-03 Thread Ganesh Ajjanagadde
On Sat, Sep 26, 2015 at 1:11 PM, Ganesh Ajjanagadde  wrote:
> On Fri, Sep 18, 2015 at 9:05 AM, Ganesh Ajjanagadde  wrote:
>> On Fri, Sep 18, 2015 at 4:40 AM, wm4  wrote:
>>> On 17.09.2015 15:07, Ganesh Ajjanagadde wrote:

 When compiled with --disable-pthreads, e.g

 http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7,
 a bunch of -Wunused-functions are reported.
 This patch should silence such warnings.

 Signed-off-by: Ganesh Ajjanagadde 
 ---
   libavcodec/alac.c  | 2 +-
   libavcodec/exr.c   | 2 +-
   libavcodec/ffv1dec.c   | 4 ++--
   libavcodec/flacdec.c   | 2 +-
   libavcodec/h264.c  | 2 +-
   libavcodec/huffyuvdec.c| 2 +-
   libavcodec/mdec.c  | 2 +-
   libavcodec/mimic.c | 4 ++--
   libavcodec/mpeg12dec.c | 2 +-
   libavcodec/mpeg4videodec.c | 2 +-
   libavcodec/pngdec.c| 2 +-
   libavcodec/takdec.c| 4 ++--
   libavcodec/tta.c   | 4 ++--
   libavcodec/vp3.c   | 4 ++--
   libavcodec/vp8.c   | 4 ++--
   libavcodec/vp9.c   | 2 +-
   libavcodec/wavpack.c   | 2 +-
   17 files changed, 23 insertions(+), 23 deletions(-)

 diff --git a/libavcodec/alac.c b/libavcodec/alac.c
 index 827c0db..f2e5907 100644
 --- a/libavcodec/alac.c
 +++ b/libavcodec/alac.c
 @@ -609,7 +609,7 @@ static av_cold int alac_decode_init(AVCodecContext *
 avctx)
   return 0;
   }

 -static int init_thread_copy(AVCodecContext *avctx)
 +av_unused static int init_thread_copy(AVCodecContext *avctx)
   {
   ALACContext *alac = avctx->priv_data;
   alac->avctx = avctx;
 diff --git a/libavcodec/exr.c b/libavcodec/exr.c
 index 3b6b245..778088e 100644
 --- a/libavcodec/exr.c
 +++ b/libavcodec/exr.c
 @@ -1426,7 +1426,7 @@ static av_cold int decode_init(AVCodecContext
 *avctx)
   return 0;
   }

 -static int decode_init_thread_copy(AVCodecContext *avctx)
 +av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
   {EXRContext *s = avctx->priv_data;

   // allocate thread data, used for non EXR_RAW compreesion types
 diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
 index 557b1a0..70ae37d 100644
 --- a/libavcodec/ffv1dec.c
 +++ b/libavcodec/ffv1dec.c
 @@ -1008,7 +1008,7 @@ static int decode_frame(AVCodecContext *avctx, void
 *data, int *got_frame, AVPac
   return buf_size;
   }

 -static int init_thread_copy(AVCodecContext *avctx)
 +av_unused static int init_thread_copy(AVCodecContext *avctx)
   {
   FFV1Context *f = avctx->priv_data;
   int i, ret;
 @@ -1061,7 +1061,7 @@ static void copy_fields(FFV1Context *fsdst,
 FFV1Context *fssrc, FFV1Context *fsr
   }
   }

 -static int update_thread_context(AVCodecContext *dst, const
 AVCodecContext *src)
 +av_unused static int update_thread_context(AVCodecContext *dst, const
 AVCodecContext *src)
   {
   FFV1Context *fsrc = src->priv_data;
   FFV1Context *fdst = dst->priv_data;
 diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
 index 8653da7..00744da 100644
 --- a/libavcodec/flacdec.c
 +++ b/libavcodec/flacdec.c
 @@ -623,7 +623,7 @@ static int flac_decode_frame(AVCodecContext *avctx,
 void *data,
   return bytes_read;
   }

 -static int init_thread_copy(AVCodecContext *avctx)
 +av_unused static int init_thread_copy(AVCodecContext *avctx)
   {
   FLACContext *s = avctx->priv_data;
   s->decoded_buffer = NULL;
 diff --git a/libavcodec/h264.c b/libavcodec/h264.c
 index b797893..fa66b53 100644
 --- a/libavcodec/h264.c
 +++ b/libavcodec/h264.c
 @@ -701,7 +701,7 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx)
   return 0;
   }

 -static int decode_init_thread_copy(AVCodecContext *avctx)
 +av_unused static int decode_init_thread_copy(AVCodecContext *avctx)
   {
   H264Context *h = avctx->priv_data;
   int ret;
 diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
 index a700abb..eda11ee 100644
 --- a/libavcodec/huffyuvdec.c
 +++ b/libavcodec/huffyuvdec.c
 @@ -571,7 +571,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
   return ret;
   }

 -static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
 +av_unused static av_cold int decode_init_thread_copy(AVCodecContext
 *avctx)
   {
   HYuvContext *s = avctx->priv_data;
   int i, ret;
 diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
 index a9b7e82..b169ac6 100644
 --- a/libavcodec/mdec.c
 +++ b/libavcodec/mdec.c
 @@ -233,7 +233,7 @@ static av_cold int decode_init(AVCodecCont

Re: [FFmpeg-devel] [PATCH] ffplay: more robust mutex, condition variable handling

2015-10-03 Thread Ganesh Ajjanagadde
On Thu, Oct 1, 2015 at 7:16 AM, Ganesh Ajjanagadde
 wrote:
> On Sep 30, 2015 7:50 PM, "Marton Balint"  wrote:
>>
>>
>> On Tue, 29 Sep 2015, Ganesh Ajjanagadde wrote:
>>
>>> SDL_CreateMutex and SDL_CreateCond can fail:
>>> https://wiki.libsdl.org/SDL_CreateMutex.
>>> This patch makes handling more robust in one instance.
>>>
>>> Signed-off-by: Ganesh Ajjanagadde 
>>> ---
>>> ffplay.c | 17 +
>>> 1 file changed, 13 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/ffplay.c b/ffplay.c
>>> index 3c2407f..9466996 100644
>>> --- a/ffplay.c
>>> +++ b/ffplay.c
>>> @@ -451,12 +451,21 @@ static int packet_queue_put_nullpacket(PacketQueue
>>> *q, int stream_index)
>>> }
>>>
>>> /* packet queue handling */
>>> -static void packet_queue_init(PacketQueue *q)
>>> +static int packet_queue_init(PacketQueue *q)
>>> {
>>> memset(q, 0, sizeof(PacketQueue));
>>> q->mutex = SDL_CreateMutex();
>>> +if (!q->mutex) {
>>> +av_log(q, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n",
>>> SDL_GetError());
>>> +return AVERROR(ENOMEM);
>>> +}
>>> q->cond = SDL_CreateCond();
>>> +if (!q->cond) {
>>> +av_log(q, AV_LOG_FATAL, "SDL_CreateCond(): %s\n",
>>> SDL_GetError());
>>> +return AVERROR(ENOMEM);
>>> +}
>>> q->abort_request = 1;
>>> +return 0;
>>> }
>>>
>>> static void packet_queue_flush(PacketQueue *q)
>>> @@ -3136,9 +3145,9 @@ static VideoState *stream_open(const char
>>> *filename, AVInputFormat *iformat)
>>> if (frame_queue_init(&is->sampq, &is->audioq, SAMPLE_QUEUE_SIZE, 1) <
>>> 0)
>>> goto fail;
>>>
>>> -packet_queue_init(&is->videoq);
>>> -packet_queue_init(&is->audioq);
>>> -packet_queue_init(&is->subtitleq);
>>> +if (packet_queue_init(&is->videoq) || packet_queue_init(&is->audioq)
>>> +|| packet_queue_init(&is->subtitleq))
>>> +goto fail;
>>
>>
>> Only cosmetics, but maybe you could use ffmpeg-api-like less-than-zero
>> error checking with common indentation:
>>
>> if (packet_queue_init() < 0 ||
>> packet_queue_init() < 0 ||
>> packet_queue_init() < 0)
>
> Thanks for the style tip. I am currently away from a machine, will get to it
> in a few days.

Changed style and updated patch.

>
>>
>> Regards,
>> Marton
>> ___
>> 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] [PATCHv2] ffplay: more robust mutex, condition variable handling

2015-10-03 Thread Ganesh Ajjanagadde
SDL_CreateMutex and SDL_CreateCond can fail:
https://wiki.libsdl.org/SDL_CreateMutex.
This patch makes handling more robust in one instance.

Signed-off-by: Ganesh Ajjanagadde 
---
 ffplay.c | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/ffplay.c b/ffplay.c
index 3c2407f..b7b2b0b 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -451,12 +451,21 @@ static int packet_queue_put_nullpacket(PacketQueue *q, 
int stream_index)
 }
 
 /* packet queue handling */
-static void packet_queue_init(PacketQueue *q)
+static int packet_queue_init(PacketQueue *q)
 {
 memset(q, 0, sizeof(PacketQueue));
 q->mutex = SDL_CreateMutex();
+if (!q->mutex) {
+av_log(q, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError());
+return AVERROR(ENOMEM);
+}
 q->cond = SDL_CreateCond();
+if (!q->cond) {
+av_log(q, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError());
+return AVERROR(ENOMEM);
+}
 q->abort_request = 1;
+return 0;
 }
 
 static void packet_queue_flush(PacketQueue *q)
@@ -3136,9 +3145,10 @@ static VideoState *stream_open(const char *filename, 
AVInputFormat *iformat)
 if (frame_queue_init(&is->sampq, &is->audioq, SAMPLE_QUEUE_SIZE, 1) < 0)
 goto fail;
 
-packet_queue_init(&is->videoq);
-packet_queue_init(&is->audioq);
-packet_queue_init(&is->subtitleq);
+if (packet_queue_init(&is->videoq) < 0 ||
+packet_queue_init(&is->audioq) < 0 ||
+packet_queue_init(&is->subtitleq) < 0)
+goto fail;
 
 is->continue_read_thread = SDL_CreateCond();
 
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 8:25 PM, Ganesh Ajjanagadde  wrote:
> On Tue, Sep 29, 2015 at 9:08 PM, Michael Niedermayer  wrote:
>> On Tue, Sep 29, 2015 at 07:27:03PM -0400, Ganesh Ajjanagadde wrote:
>>> Signed-off-by: Ganesh Ajjanagadde 
>>> ---
>>>  libavcodec/apedec.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> breaks fate
>>
>> --- ./tests/ref/fate/lossless-monkeysaudio-399  2015-09-29 
>> 13:42:22.893972599 +0200
>> +++ tests/data/fate/lossless-monkeysaudio-399   2015-09-30 
>> 03:06:06.950988548 +0200
>> @@ -1 +1 @@
>> -a28d4e5f2192057f7d4bece870f40bd0
>> +df8663c29d7cd7268d6ae77edd742bb5
>> Test lossless-monkeysaudio-399 failed. Look at 
>> tests/data/fate/lossless-monkeysaudio-399.err for details.
>> make: *** [fate-lossless-monkeysaudio-399] Error 1
>
> Weird, unfortunately for whatever reason my fate does not test this
> (though apedec gets compiled) so I can't reproduce. One suggestion I
> have is removing the U at the end, that will prevent any unforeseen
> signed/unsigned business which I thought was ok. Please change the
> author tag if you do this.

updated patch removing the U; like I said my fate does not test it so
it only has been compile tested.

>
>>
>> [...]
>> --
>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> Concerning the gods, I have no means of knowing whether they exist or not
>> or of what sort they may be, because of the obscurity of the subject, and
>> the brevity of human life -- Protagoras
>>
>> ___
>> 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] [PATCHv2] avcodec/apedec: fix bug introduced in commit d3e5fbb1406995e07fccbff3ca8c1e24f57a1f7b

2015-10-03 Thread Ganesh Ajjanagadde
Signed-off-by: Ganesh Ajjanagadde 
---
 libavcodec/apedec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index 7b34d26..05cb17e 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1281,7 +1281,7 @@ static void do_apply_filter(APEContext *ctx, int version, 
APEFilter *f,
 /* Update the adaption coefficients */
 absres = FFABS(res);
 if (absres)
-*f->adaptcoeffs = ((res & (-(1<<31))) ^ (-(1<<30))) >>
+*f->adaptcoeffs = ((res & 0x8000) ^ (-(1<<30))) >>
   (25 + (absres <= f->avg*3) + (absres <= 
f->avg*4/3));
 else
 *f->adaptcoeffs = 0;
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH] avcodec/x86/hpeldsp_rnd_template: silence -Wunused-function on --disable-mmx

2015-10-03 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 6:28 PM, Ganesh Ajjanagadde
 wrote:
> This silences some of the -Wunused-function warnings when compiled with 
> --disable-mmx, e.g
> http://fate.ffmpeg.org/log.cgi?time=20150919094617&log=compile&slot=x86_64-archlinux-gcc-disable-mmx.
> Header guards are too brittle and ugly for this case.
>
> Signed-off-by: Ganesh Ajjanagadde 
> ---
>  libavcodec/x86/hpeldsp_rnd_template.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/x86/hpeldsp_rnd_template.c 
> b/libavcodec/x86/hpeldsp_rnd_template.c
> index abe3bb1..e20d065 100644
> --- a/libavcodec/x86/hpeldsp_rnd_template.c
> +++ b/libavcodec/x86/hpeldsp_rnd_template.c
> @@ -106,7 +106,7 @@ av_unused static void DEF(put, pixels16_x2)(uint8_t 
> *block, const uint8_t *pixel
>  :REG_a, "memory");
>  }
>
> -static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t *pixels, 
> ptrdiff_t line_size, int h)
> +av_unused static void DEF(put, pixels8_y2)(uint8_t *block, const uint8_t 
> *pixels, ptrdiff_t line_size, int h)
>  {
>  MOVQ_BFE(mm6);
>  __asm__ volatile(
> @@ -162,7 +162,7 @@ av_unused static void DEF(avg, pixels16_x2)(uint8_t 
> *block, const uint8_t *pixel
>  :"memory");
>  }
>
> -static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t *pixels, 
> ptrdiff_t line_size, int h)
> +av_unused static void DEF(avg, pixels8_y2)(uint8_t *block, const uint8_t 
> *pixels, ptrdiff_t line_size, int h)
>  {
>  MOVQ_BFE(mm6);
>  __asm__ volatile(
> --
> 2.5.3
>

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


Re: [FFmpeg-devel] [PATCH] lavf: add chromaprint muxer

2015-10-03 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 03:45:48PM -0500, Rodger Combs wrote:
[...]
> +break;/*
> +case FINGERPRINT_HASH_RAW:
> +case FINGERPRINT_HASH_HEX:
> +if (!chromaprint_hash_fingerprint(fp, size, &hash)) {
> +av_log(s, AV_LOG_ERROR, "Failed to hash fingerprint\n");
> +goto fail;
> +}
> +if (cpr->fp_format == FINGERPRINT_HASH_RAW) {
> +avio_wb32(pb, hash);
> +} else {
> +char buf[10];
> +snprintf(buf, sizeof(buf), "%08"PRIx32"\n", hash);
> +avio_write(s->pb, buf, strlen(buf));
> +}
> +break;*/
[...]
> +/*{ "hash_raw", "32-bit binary hash", 0, AV_OPT_TYPE_CONST, {.i64 = 
> FINGERPRINT_HASH_RAW }, INT_MIN, INT_MAX, FLAGS, "fp_format"},
> +{ "hash_hex", "32-bit hexadecimal hash", 0, AV_OPT_TYPE_CONST, {.i64 = 
> FINGERPRINT_HASH_HEX }, INT_MIN, INT_MAX, FLAGS, "fp_format"},*/

outcommented code

also fails to build here:
CC  libavformat/chromaprint.o
libavformat/chromaprint.c: In function ‘write_header’:
libavformat/chromaprint.c:67:9: error: implicit declaration of function 
‘chromaprint_set_option’ [-Werror=implicit-function-declaration]

that is with libchromaprint 0.6-1 from ubuntu 12.04 LTS

[...]
--
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] avformat/movenc: suppress -Wstrict-overflow warnings

2015-10-03 Thread Ganesh Ajjanagadde
On Tue, Sep 29, 2015 at 10:49 AM, Ganesh Ajjanagadde  wrote:
> On Sun, Sep 27, 2015 at 9:39 PM, Ganesh Ajjanagadde  wrote:
>> On Sun, Sep 27, 2015 at 9:18 PM, Michael Niedermayer  
>> wrote:
>>> On Sun, Sep 27, 2015 at 01:23:03PM -0400, Ganesh Ajjanagadde wrote:
 On Sun, Sep 27, 2015 at 12:58 PM, Michael Niedermayer  
 wrote:
 > On Sat, Sep 26, 2015 at 10:55:26PM -0400, Ganesh Ajjanagadde wrote:
 >> On Sat, Sep 26, 2015 at 10:32 PM, Ronald S. Bultje  
 >> wrote:
 >> > Hi,
 >> >
 >> > On Sat, Sep 26, 2015 at 7:19 PM, Ganesh Ajjanagadde 
 >> > wrote:
 >> >
 >> >> On Sat, Sep 26, 2015 at 7:11 PM, Michael Niedermayer 
 >> >> 
 >> >> wrote:
 >> >> > On Fri, Sep 18, 2015 at 05:15:50PM -0400, Ganesh Ajjanagadde wrote:
 >> >> >> This patch results in identical behavior of movenc, and suppresses
 >> >> -Wstrict-overflow
 >> >> >> warnings observed in GCC 5.2.
 >> >> >> I have manually checked that all usages are safe, and overflow
 >> >> possibility does
 >> >> >> not exist with this expression rewrite.
 >> >> >>
 >> >> >> Signed-off-by: Ganesh Ajjanagadde 
 >> >> >> ---
 >> >> >>  libavformat/movenc.c | 2 +-
 >> >> >>  1 file changed, 1 insertion(+), 1 deletion(-)
 >> >> >>
 >> >> >> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
 >> >> >> index af03d1e..6e4a1a6 100644
 >> >> >> --- a/libavformat/movenc.c
 >> >> >> +++ b/libavformat/movenc.c
 >> >> >> @@ -854,7 +854,7 @@ static int get_cluster_duration(MOVTrack 
 >> >> >> *track,
 >> >> int cluster_idx)
 >> >> >>  {
 >> >> >>  int64_t next_dts;
 >> >> >>
 >> >> >> -if (cluster_idx >= track->entry)
 >> >> >> +if (cluster_idx - track->entry >= 0)
 >> >> >
 >> >> > i do not understand what this fixes or why
 >> >> > also plese quote the actual warnings which are fixed in the commit
 >> >> > message
 >> >>
 >> >> I have posted v2 with a more detailed commit message. It should be
 >> >> self explanatory.
 >> >
 >> >
 >> > Even with the new message, it's still not clear to me what's being 
 >> > fixed.
 >> > What does the warning check for? What is the problem in the initial
 >> > expression?
 >>
 >> Compilers make transformations on the statements in order to possibly
 >> get better performance when compiled with optimizations. However, some
 >> of these optimizations require assumptions in the code. In particular,
 >> the compiler is internally rewriting cluster_idx >= track->entry to
 >> cluster_idx - track->entry >= 0 internally for some reason (I am not
 >> an asm/instruction set guy, so I can't comment why it likes this).
 >> However, such a transformation is NOT always safe as integer
 >> arithmetic can overflow (try e.g extreme values close to INT_MIN,
 >> INT_MAX). The warning is spit out since the compiler can't be sure
 >> that this is safe, but it still wants to do it (I suspect only the
 >> -O3/-O2 level that try this, can check if you want).
 >
 > iam not sure i understand correctly but
 > if the compiler changes the code and then warns that what it just
 > did might be unsafe then the compiler is broken

 https://stackoverflow.com/questions/12984861/dont-understand-assuming-signed-overflow-warning
 - gives a detailed explanation.

 Some more info: this is triggered only when -finline-functions is
 enabled (done by default on -O3, not enabled by default on -O2).
 -finline-functions tries to inline stuff even when "inline" keyword is
 absent (like in this case).
 As for the warning, http://linux.die.net/man/1/gcc - search for
 -Wstrict-overflow. It is enabled due to -Wall, and as the man page
 suggests, it depends on optimization level as we can see in this
 example.
 I do consider the compiler broken in this case, but then again
 compilers are broken in so many different ways it is not even funny:
 see e.g -Warray-bounds, can't use the ISO C correct { 0 } initializer
 for compound data types, etc.

 If you don't like this, we should add a -Wnostrict-overflow either to
 configure, or a local enable/disable via pragmas/macros. I don't like
 either of these as compared to this simple workaround:
 1. -Wnostrict-overflow: FFmpeg with the amount of integer arithmetic
 being done should benefit from this warning in general, so disabling
 it globally may be bad.
>>>
>>> how many actual bugs has Wstrict-overflow found ?
>>
>> No idea; maybe a good place to check is the Google fuzzing effort
>> where many bugs were fixed.
>
> See e.g your commit: 09ef98f1ae3c8a4e08b66f41c3bd97dd7b07405f -
> Wstrict-overflow is indeed useful.
> I am thus convinced that we should retain it.
> Given the fact that local suppression is not worth it for just 2
> instances and also that the patch does not reduce re

[FFmpeg-devel] [PATCH] vp9: 16bpp tm/dc/h/v intra pred simd (mostly sse2) functions.

2015-10-03 Thread Ronald S. Bultje
---
 libavcodec/x86/Makefile |   1 +
 libavcodec/x86/constants.c  |   4 +
 libavcodec/x86/constants.h  |   2 +
 libavcodec/x86/h264_idct_10bit.asm  |   5 +-
 libavcodec/x86/h264_intrapred_10bit.asm |   2 +-
 libavcodec/x86/vp9dsp_init.h|  23 ++
 libavcodec/x86/vp9dsp_init_16bpp.c  |  15 +
 libavcodec/x86/vp9dsp_init_16bpp_template.c |   7 +
 libavcodec/x86/vp9intrapred_16bpp.asm   | 615 
 9 files changed, 669 insertions(+), 5 deletions(-)
 create mode 100644 libavcodec/x86/vp9intrapred_16bpp.asm

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 01e5f18..5ff3a77 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -158,6 +158,7 @@ YASM-OBJS-$(CONFIG_VC1_DECODER)+= x86/vc1dsp.o
 YASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
 YASM-OBJS-$(CONFIG_VP6_DECODER)+= x86/vp6dsp.o
 YASM-OBJS-$(CONFIG_VP9_DECODER)+= x86/vp9intrapred.o\
+  x86/vp9intrapred_16bpp.o  \
   x86/vp9itxfm.o\
   x86/vp9lpf.o  \
   x86/vp9lpf_16bpp.o\
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index 9f3c8b4..19345f5 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -81,3 +81,7 @@ DECLARE_ALIGNED(16, const xmm_reg,  ff_ps_neg)  = { 
0x80008000ULL, 0x800
 
 DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_1)= { 0x00010001ULL, 
0x00010001ULL,
 0x00010001ULL, 
0x00010001ULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_16)   = { 0x00100010ULL, 
0x00100010ULL,
+0x00100010ULL, 
0x00100010ULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_32)   = { 0x00200020ULL, 
0x00200020ULL,
+0x00200020ULL, 
0x00200020ULL };
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index 37a1869..4a2451d 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -63,5 +63,7 @@ extern const uint64_t ff_pb_FC;
 extern const xmm_reg  ff_ps_neg;
 
 extern const ymm_reg  ff_pd_1;
+extern const ymm_reg  ff_pd_16;
+extern const ymm_reg  ff_pd_32;
 
 #endif /* AVCODEC_X86_CONSTANTS_H */
diff --git a/libavcodec/x86/h264_idct_10bit.asm 
b/libavcodec/x86/h264_idct_10bit.asm
index cc115b0..f1c2c81 100644
--- a/libavcodec/x86/h264_idct_10bit.asm
+++ b/libavcodec/x86/h264_idct_10bit.asm
@@ -24,14 +24,11 @@
 
 %include "libavutil/x86/x86util.asm"
 
-SECTION_RODATA
-
-pd_32:times 4 dd 32
-
 SECTION .text
 
 cextern pw_1023
 %define pw_pixel_max pw_1023
+cextern pd_32
 
 ;-
 ; void ff_h264_idct_add_10(pixel *dst, int16_t *block, int stride)
diff --git a/libavcodec/x86/h264_intrapred_10bit.asm 
b/libavcodec/x86/h264_intrapred_10bit.asm
index 9aeb702..9e40cfe 100644
--- a/libavcodec/x86/h264_intrapred_10bit.asm
+++ b/libavcodec/x86/h264_intrapred_10bit.asm
@@ -34,11 +34,11 @@ cextern pw_8
 cextern pw_4
 cextern pw_2
 cextern pw_1
+cextern pd_16
 
 pw_m32101234: dw -3, -2, -1, 0, 1, 2, 3, 4
 pw_m3:times 8 dw -3
 pd_17:times 4 dd 17
-pd_16:times 4 dd 16
 
 SECTION .text
 
diff --git a/libavcodec/x86/vp9dsp_init.h b/libavcodec/x86/vp9dsp_init.h
index d1a9514..47d2246 100644
--- a/libavcodec/x86/vp9dsp_init.h
+++ b/libavcodec/x86/vp9dsp_init.h
@@ -41,6 +41,18 @@ decl_mc_func(avg, sz, h, opt, type, fsz, bpp); \
 decl_mc_func(put, sz, v, opt, type, fsz, bpp); \
 decl_mc_func(avg, sz, v, opt, type, fsz, bpp)
 
+#define decl_ipred_fn(type, sz, bpp, opt) \
+void ff_vp9_ipred_##type##_##sz##x##sz##_##bpp##_##opt(uint8_t *dst, \
+   ptrdiff_t stride, \
+   const uint8_t *l, \
+   const uint8_t *a)
+
+#define decl_ipred_fns(type, bpp, opt4, opt8_16_32) \
+decl_ipred_fn(type,  4, bpp, opt4); \
+decl_ipred_fn(type,  8, bpp, opt8_16_32); \
+decl_ipred_fn(type, 16, bpp, opt8_16_32); \
+decl_ipred_fn(type, 32, bpp, opt8_16_32)
+
 #define mc_rep_func(avg, sz, hsz, hszb, dir, opt, type, f_sz, bpp) \
 static av_always_inline void \
 ff_vp9_##avg##_8tap_1d_##dir##_##sz##_##bpp##_##opt(uint8_t *dst, ptrdiff_t 
dst_stride, \
@@ -142,6 +154,17 @@ filters_8tap_2d_fn(op, 4, align, bpp, bytes, opt4, f_opt)
 init_subpel3_8to64(idx, type, bpp, opt); \
 init_subpel2(4, idx,  4, type, bpp, opt)
 
+#define cat(a, bpp, b) a##bpp##b
+
+#define init_ipred_func(type, enum, sz, bpp, opt) \
+dsp->intra_pred[TX_##sz

Re: [FFmpeg-devel] [PATCH 4/4] lavf/hls: allow subtitles to be read despite incomplete handling

2015-10-03 Thread Michael Niedermayer
On Mon, Sep 21, 2015 at 05:31:24AM -0500, Rodger Combs wrote:
> This will give incorrect results in some cases due to not parsing segments
> separately, so it currently requires -strict experimental.
> ---
>  libavformat/hls.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)

applied

thanks

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

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


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


  1   2   >