[libav-devel] [PATCH] avfilter: add compare filter

2012-10-15 Thread Luca Barbato
The diff method shows the per pixel difference while the dssim method
also outputs the dssim value.
---
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/dssim.c  | 318 +++
 libavfilter/vf_compare.c | 274 
 4 files changed, 594 insertions(+)
 create mode 100644 libavfilter/dssim.c
 create mode 100644 libavfilter/vf_compare.c

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 530aa57..06c9766 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -41,6 +41,7 @@ OBJS-$(CONFIG_ANULLSINK_FILTER)  += 
asink_anullsink.o
 
 OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
 OBJS-$(CONFIG_BOXBLUR_FILTER)+= vf_boxblur.o
+OBJS-$(CONFIG_COMPARE_FILTER)+= vf_compare.o dssim.o
 OBJS-$(CONFIG_COPY_FILTER)   += vf_copy.o
 OBJS-$(CONFIG_CROP_FILTER)   += vf_crop.o
 OBJS-$(CONFIG_CROPDETECT_FILTER) += vf_cropdetect.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 94b3115..c6fd312 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -52,6 +52,7 @@ void avfilter_register_all(void)
 
 REGISTER_FILTER (BLACKFRAME,  blackframe,  vf);
 REGISTER_FILTER (BOXBLUR, boxblur, vf);
+REGISTER_FILTER (COMPARE, compare, vf);
 REGISTER_FILTER (COPY,copy,vf);
 REGISTER_FILTER (CROP,crop,vf);
 REGISTER_FILTER (CROPDETECT,  cropdetect,  vf);
diff --git a/libavfilter/dssim.c b/libavfilter/dssim.c
new file mode 100644
index 000..65c8ed6
--- /dev/null
+++ b/libavfilter/dssim.c
@@ -0,0 +1,318 @@
+/*
+ * Copyright (c) 2011 porneL. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "dssim.h"
+#include "avfilter.h"
+#include "libavutil/common.h"
+
+typedef struct {
+float l, A, b, a;
+} LABA;
+
+static const float D65x = 0.9505f, D65y = 1.0f, D65z = 1.089f;
+
+static inline LABA rgba_to_laba(const float gamma, const uint8_t *pix)
+{
+float b = powf(pix[0] / 255.0f, 1.0f / gamma),
+  g = powf(pix[1] / 255.0f, 1.0f / gamma),
+  r = powf(pix[2] / 255.0f, 1.0f / gamma),
+  a = pix[3] / 255.0f;
+
+float fx= (r * 0.4124f + g * 0.3576f + b * 0.1805f) / D65x;
+float fy= (r * 0.2126f + g * 0.7152f + b * 0.0722f) / D65y;
+float fz= (r * 0.0193f + g * 0.1192f + b * 0.9505f) / D65z;
+const float epsilon = 216.0 / 24389.0;
+
+fx =
+((fx > epsilon) ? powf(fx,
+   (1.0f / 3.0f)) : (7.787f * fx + 16.0f / 
116.0f));
+fy =
+((fy > epsilon) ? powf(fy,
+   (1.0f / 3.0f)) : (7.787f * fy + 16.0f / 
116.0f));
+fz =
+((fz > epsilon) ? powf(fz,
+   (1.0f / 3.0f)) : (7.787f * fz + 16.0f / 
116.0f));
+return (LABA) {
+   (116.0f * fy - 16.0f) / 100.0 * a,
+   (86.2f + 500.0f * (fx - fy)) / 220.0 * a, /* 86 is a fudge to 
make the value positive */
+   (107.9f + 200.0f * (fy - fz)) / 220.0 * a, /* 107 is a fudge to 
make the value positive */
+   a
+};
+}
+
+/* Macros to avoid repeating every line 4 times */
+
+#define LABA_OP(dst, X, op, Y) dst = (LABA) { \
+(X).l op(Y).l, \
+(X).A op(Y).A, \
+(X).b op(Y).b, \
+(X).a op(Y).a } \
+
+#define LABA_OPC(dst, X, op, Y) dst = (LABA) { \
+(X).l op(Y), \
+(X).A op(Y), \
+(X).b op(Y), \
+(X).a op(Y) } \
+
+#define LABA_OP1(dst, op, Y) dst = (LABA) { \
+dst.l op(Y).l, \
+dst.A op(Y).A, \
+dst.b op(Y).b, \
+dst.a op(Y).a } \
+
+
+typedef void rowcallback (LABA *, int width);
+
+static void square_row(LABA *row, int width)
+{
+for (int i = 0; i < width; i++)
+LABA_OP(row[i], row[i], *, row[i]);
+}
+
+/*
+ * Blurs ima

Re: [libav-devel] [PATCH] configure: Disable Snow decoder and encoder by default

2012-10-15 Thread Måns Rullgård
Diego Biurrun  writes:

> Snow has serious unfixed bugs and no real-world use.
> ---
>  configure |2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 5240a7c..8b4342b 100755
> --- a/configure
> +++ b/configure
> @@ -1931,6 +1931,8 @@ done
>
>  enable $ARCH_EXT_LIST $ALL_TESTS
>
> +disable snow_decoder snow_encoder
> +
>  die_unknown(){
>  echo "Unknown option \"$1\"."
>  echo "See $0 --help for available options."
> -- 

This will foul up fate until dependencies there are properly done.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] configure: Disable Snow decoder and encoder by default

2012-10-15 Thread Diego Biurrun
Snow has serious unfixed bugs and no real-world use.
---
 configure |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/configure b/configure
index 5240a7c..8b4342b 100755
--- a/configure
+++ b/configure
@@ -1931,6 +1931,8 @@ done
 
 enable $ARCH_EXT_LIST $ALL_TESTS
 
+disable snow_decoder snow_encoder
+
 die_unknown(){
 echo "Unknown option \"$1\"."
 echo "See $0 --help for available options."
-- 
1.7.1

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avserver: move avserver-specific code from ffmdec.c to avserver.c

2012-10-15 Thread Diego Biurrun
On Mon, Oct 15, 2012 at 10:26:05PM +0100, Mans Rullgard wrote:
> This way avserver only depends on the data structures of the ffm
> demuxer, which it already does, and not also on private functions
> being exported by the library.
> 
> Signed-off-by: Mans Rullgard 
> ---
>  avserver.c   | 32 
>  libavformat/ffm.h|  4 
>  libavformat/ffmdec.c | 33 -
>  3 files changed, 32 insertions(+), 37 deletions(-)

LGTM

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avserver: move avserver-specific code from ffmdec.c to avserver.c

2012-10-15 Thread Luca Barbato
On 10/15/2012 11:26 PM, Mans Rullgard wrote:
> This way avserver only depends on the data structures of the ffm
> demuxer, which it already does, and not also on private functions
> being exported by the library.
> 
> Signed-off-by: Mans Rullgard 
> ---
>  avserver.c   | 32 
>  libavformat/ffm.h|  4 
>  libavformat/ffmdec.c | 33 -
>  3 files changed, 32 insertions(+), 37 deletions(-)

Fine for me.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] avserver: move avserver-specific code from ffmdec.c to avserver.c

2012-10-15 Thread Mans Rullgard
This way avserver only depends on the data structures of the ffm
demuxer, which it already does, and not also on private functions
being exported by the library.

Signed-off-by: Mans Rullgard 
---
 avserver.c   | 32 
 libavformat/ffm.h|  4 
 libavformat/ffmdec.c | 33 -
 3 files changed, 32 insertions(+), 37 deletions(-)

diff --git a/avserver.c b/avserver.c
index 6b01b15..994edcd 100644
--- a/avserver.c
+++ b/avserver.c
@@ -39,6 +39,7 @@
 #include "libavutil/avstring.h"
 #include "libavutil/lfg.h"
 #include "libavutil/dict.h"
+#include "libavutil/intreadwrite.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/random_seed.h"
 #include "libavutil/parseutils.h"
@@ -323,6 +324,37 @@ static AVLFG random_state;
 
 static FILE *logfile = NULL;
 
+static int64_t ffm_read_write_index(int fd)
+{
+uint8_t buf[8];
+
+lseek(fd, 8, SEEK_SET);
+if (read(fd, buf, 8) != 8)
+return AVERROR(EIO);
+return AV_RB64(buf);
+}
+
+static int ffm_write_write_index(int fd, int64_t pos)
+{
+uint8_t buf[8];
+int i;
+
+for(i=0;i<8;i++)
+buf[i] = (pos >> (56 - i * 8)) & 0xff;
+lseek(fd, 8, SEEK_SET);
+if (write(fd, buf, 8) != 8)
+return AVERROR(EIO);
+return 8;
+}
+
+static void ffm_set_write_index(AVFormatContext *s, int64_t pos,
+int64_t file_size)
+{
+FFMContext *ffm = s->priv_data;
+ffm->write_index = pos;
+ffm->file_size = file_size;
+}
+
 /* FIXME: make avserver work with IPv6 */
 /* resolve host with also IP address parsing */
 static int resolve_host(struct in_addr *sin_addr, const char *hostname)
diff --git a/libavformat/ffm.h b/libavformat/ffm.h
index 6ce5e04..70c3e88 100644
--- a/libavformat/ffm.h
+++ b/libavformat/ffm.h
@@ -56,8 +56,4 @@ typedef struct FFMContext {
 uint8_t packet[FFM_PACKET_SIZE];
 } FFMContext;
 
-int64_t ffm_read_write_index(int fd);
-int ffm_write_write_index(int fd, int64_t pos);
-void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size);
-
 #endif /* AVFORMAT_FFM_H */
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 50c7416..e6730eb 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -24,39 +24,6 @@
 #include "avformat.h"
 #include "internal.h"
 #include "ffm.h"
-#if CONFIG_AVSERVER
-#include 
-
-int64_t ffm_read_write_index(int fd)
-{
-uint8_t buf[8];
-
-lseek(fd, 8, SEEK_SET);
-if (read(fd, buf, 8) != 8)
-return AVERROR(EIO);
-return AV_RB64(buf);
-}
-
-int ffm_write_write_index(int fd, int64_t pos)
-{
-uint8_t buf[8];
-int i;
-
-for(i=0;i<8;i++)
-buf[i] = (pos >> (56 - i * 8)) & 0xff;
-lseek(fd, 8, SEEK_SET);
-if (write(fd, buf, 8) != 8)
-return AVERROR(EIO);
-return 8;
-}
-
-void ffm_set_write_index(AVFormatContext *s, int64_t pos, int64_t file_size)
-{
-FFMContext *ffm = s->priv_data;
-ffm->write_index = pos;
-ffm->file_size = file_size;
-}
-#endif // CONFIG_AVSERVER
 
 static int ffm_is_avail_data(AVFormatContext *s, int size)
 {
-- 
1.7.12.3

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/20] lavf: copy packet duration if parser is not splitting packets

2012-10-15 Thread Justin Ruggles
On 10/15/2012 03:55 PM, Anton Khirnov wrote:
> 
> On Mon,  8 Oct 2012 13:38:59 -0400, Justin Ruggles  
> wrote:
>> Also, only use parser duration if it is greater than zero.
>> ---
>>  libavformat/utils.c |4 
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/libavformat/utils.c b/libavformat/utils.c
>> index e74afb8..ff8b971 100644
>> --- a/libavformat/utils.c
>> +++ b/libavformat/utils.c
>> @@ -1070,6 +1070,9 @@ static int parse_packet(AVFormatContext *s, AVPacket 
>> *pkt, int stream_index)
>>  
>>  /* set the duration */
>>  out_pkt.duration = 0;
>> +if (pkt->duration > 0 && st->need_parsing == 
>> AVSTREAM_PARSE_HEADERS) {
>> +out_pkt.duration = pkt->duration;
>> +} else if (st->parser->duration > 0) {
>>  if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
>>  if (st->codec->sample_rate > 0) {
>>  out_pkt.duration = av_rescale_q_rnd(st->parser->duration,
>> @@ -1084,6 +1087,7 @@ static int parse_packet(AVFormatContext *s, AVPacket 
>> *pkt, int stream_index)
>>  st->time_base,
>>  AV_ROUND_DOWN);
>>  }
>> +}
>>  
>>  out_pkt.stream_index = st->index;
>>  out_pkt.pts = st->parser->pts;
>> -- 
>> 1.7.1
>>
> 
> Should be ok.
> 
> Though I have to wonder about the sanity of using parser duration for video. I
> don't see how a parser can possibly know anything useful about video duration.
> 

None currently do. So that code doesn't really do anything for video
right now. It was needed for audio, and it wasn't really any more work
to also give the option to video parsers if needed. But if there is
really no possiblity it will ever be needed we can just alter the
documentation and remove the handling code for video in libavformat.

-Justin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 03/20] lavf: cosmetics: indentation

2012-10-15 Thread Anton Khirnov

On Mon,  8 Oct 2012 13:39:00 -0400, Justin Ruggles  
wrote:
> ---
>  libavformat/utils.c |   20 ++--
>  1 files changed, 10 insertions(+), 10 deletions(-)
> 

Obviously ok.

-- 
Anton Khirnov
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/20] lavf: copy packet duration if parser is not splitting packets

2012-10-15 Thread Anton Khirnov

On Mon,  8 Oct 2012 13:38:59 -0400, Justin Ruggles  
wrote:
> Also, only use parser duration if it is greater than zero.
> ---
>  libavformat/utils.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index e74afb8..ff8b971 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1070,6 +1070,9 @@ static int parse_packet(AVFormatContext *s, AVPacket 
> *pkt, int stream_index)
>  
>  /* set the duration */
>  out_pkt.duration = 0;
> +if (pkt->duration > 0 && st->need_parsing == AVSTREAM_PARSE_HEADERS) 
> {
> +out_pkt.duration = pkt->duration;
> +} else if (st->parser->duration > 0) {
>  if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
>  if (st->codec->sample_rate > 0) {
>  out_pkt.duration = av_rescale_q_rnd(st->parser->duration,
> @@ -1084,6 +1087,7 @@ static int parse_packet(AVFormatContext *s, AVPacket 
> *pkt, int stream_index)
>  st->time_base,
>  AV_ROUND_DOWN);
>  }
> +}
>  
>  out_pkt.stream_index = st->index;
>  out_pkt.pts = st->parser->pts;
> -- 
> 1.7.1
> 

Should be ok.

Though I have to wonder about the sanity of using parser duration for video. I
don't see how a parser can possibly know anything useful about video duration.

-- 
Anton Khirnov
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/20] lavf: send parser parameter changes via packet side_data

2012-10-15 Thread Anton Khirnov

On Mon,  8 Oct 2012 13:38:58 -0400, Justin Ruggles  
wrote:
> If a changed parameter was previously set prior to parsing, change it back to
> the old value and send packet side data instead.
> ---
>  libavformat/utils.c |   34 ++
>  1 files changed, 34 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index b932322..e74afb8 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -21,6 +21,7 @@
>  
>  /* #define DEBUG */
>  
> +#include "libavutil/common.h"
>  #include "avformat.h"
>  #include "avio_internal.h"
>  #include "internal.h"
> @@ -1018,6 +1019,11 @@ static int parse_packet(AVFormatContext *s, AVPacket 
> *pkt, int stream_index)
>  
>  while (size > 0 || (pkt == &flush_pkt && got_output)) {
>  int len;
> +int old_sample_rate = st->codec->sample_rate;
> +int old_channels= st->codec->channels;
> +uint64_t old_channel_layout = st->codec->channel_layout;
> +int old_width   = st->codec->width;
> +int old_height  = st->codec->height;
>  
>  av_init_packet(&out_pkt);
>  len = av_parser_parse2(st->parser,  st->codec,
> @@ -1034,6 +1040,34 @@ static int parse_packet(AVFormatContext *s, AVPacket 
> *pkt, int stream_index)
>  if (!out_pkt.size)
>  continue;
>  
> +/* only allow a parameter to change if it was not set prior to 
> parsing
> +   or by sending packet side data */
> +if (old_sample_rate == st->codec->sample_rate)
> +old_sample_rate = 0;
> +else if (old_sample_rate)
> +FFSWAP(int, st->codec->sample_rate, old_sample_rate);
> +if (old_channels == st->codec->channels)
> +old_channels = 0;
> +else if (old_channels)
> +FFSWAP(int, st->codec->channels, old_channels);
> +if (old_channel_layout == st->codec->channel_layout)
> +old_channel_layout = 0;
> +else if (old_channel_layout)
> +FFSWAP(uint64_t, st->codec->channel_layout, old_channel_layout);
> +if (old_width == st->codec->width)
> +old_width = 0;
> +else if (old_width)
> +FFSWAP(int, st->codec->width, old_width);
> +if (old_height == st->codec->height)
> +old_height = 0;
> +else if (old_height)
> +FFSWAP(int, st->codec->height, old_height);

As I already said on IRC, this could be simplified with macros.

> +if (old_sample_rate || old_channels || old_channel_layout ||
> +old_width || old_height) {
> +ff_add_param_change(&out_pkt, old_channels, old_channel_layout,
> +old_sample_rate, old_width, old_height);
> +}
> +
>  /* set the duration */
>  out_pkt.duration = 0;
>  if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
> -- 
> 1.7.1
> 

I must say this approach looks quite hacky to me, the parsers shouldn't mess
with the codec context (and lavf probably shouldn't contain a codec context at
all), but I guess it's good enough for now.

-- 
Anton Khirnov
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] rangecoder-test: Return in case of an error

2012-10-15 Thread Diego Biurrun
On Fri, Oct 12, 2012 at 09:15:27PM +0200, Diego Biurrun wrote:
> ---
>  libavcodec/rangecoder.c |4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)

OKed by Kostya on IRC.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/4] rangecoder-test: Drop timer output that clutters stderr

2012-10-15 Thread Måns Rullgård
Diego Biurrun  writes:

> ---
>  libavcodec/rangecoder.c |4 
>  1 files changed, 0 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/rangecoder.c b/libavcodec/rangecoder.c
> index b0c9f21..02e8cf3 100644
> --- a/libavcodec/rangecoder.c
> +++ b/libavcodec/rangecoder.c
> @@ -134,9 +134,7 @@ int main(void){
>  }
>
>  for(i=0; i -START_TIMER
>  put_rac(&c, state, r[i]&1);
> -STOP_TIMER("put_rac")
>  }
>
>  ff_rac_terminate(&c);
> @@ -146,10 +144,8 @@ STOP_TIMER("put_rac")
>  memset(state, 128, sizeof(state));
>
>  for(i=0; i -START_TIMER
>  if( (r[i]&1) != get_rac(&c, state) )
>  av_log(NULL, AV_LOG_DEBUG, "rac failure at %d\n", i);
> -STOP_TIMER("get_rac")
>  }
>
>  return 0;
> -- 

OK

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] fate: Add rangecoder test

2012-10-15 Thread Diego Biurrun
On Mon, Oct 15, 2012 at 07:59:45PM +0100, Måns Rullgård wrote:
> Diego Biurrun  writes:
> 
> > ---
> > Now correctly setting CMP.
> >
> >  tests/fate/libavcodec.mak |6 ++
> >  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> Kill the START/STOP_TIMER calls in the test program.

See 1/4 in the patchset, which does exactly this.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] fate: Add rangecoder test

2012-10-15 Thread Måns Rullgård
Diego Biurrun  writes:

> ---
> Now correctly setting CMP.
>
>  tests/fate/libavcodec.mak |6 ++
>  1 files changed, 6 insertions(+), 0 deletions(-)

Kill the START/STOP_TIMER calls in the test program.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avcodec_encode_audio(): fix invalid free

2012-10-15 Thread Justin Ruggles
On 10/15/2012 01:04 PM, Luca Barbato wrote:
> On 10/15/2012 06:41 PM, Rafaël Carré wrote:
>> Since 2bc0de385, AVFrame needs to be initialized
>> before calling avcodec_get_frame_defaults().
>> ---
>>  libavcodec/utils.c |2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
>> index bb99a5a..836d953 100644
>> --- a/libavcodec/utils.c
>> +++ b/libavcodec/utils.c
>> @@ -1073,7 +1073,7 @@ int attribute_align_arg 
>> avcodec_encode_audio(AVCodecContext *avctx,
>>   const short *samples)
>>  {
>>  AVPacket pkt;
>> -AVFrame frame0;
>> +AVFrame frame0 = { 0 };
>>  AVFrame *frame;
>>  int ret, samples_size, got_packet;
>>  
>>
> 
> Looks fine for me, Justin?

Yeah, looks fine.

-Justin

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 14/20] pcmdec: validate channel count in pcm_decode_frame()

2012-10-15 Thread Justin Ruggles
On 10/15/2012 01:08 PM, Luca Barbato wrote:
> On 10/08/2012 07:39 PM, Justin Ruggles wrote:
>> Allows for changing channel layout during decoding.
>> ---
>>  libavcodec/pcm.c |5 +
>>  1 files changed, 5 insertions(+), 0 deletions(-)
>>
> 
> The commit message doesn't seem to apply. the codec itself would support
> that already.
> 
> (patch in itself looks fine, would be nicer reporting how many an where
> though)

Yeah, that check probably isn't really needed for pcm. MAX_CHANNELS
looks arbitrary. We already limit channels to 128 in avcodec_open2(), so
SANE_NB_CHANNELS could be moved to internal.h and used instead for the 1
use of MAX_CHANNELS in the decoder. The <= 0 case should be handled
already by get_buffer(). I'll redo the patch.

Thanks,
Justin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] fate: Add rangecoder test

2012-10-15 Thread Diego Biurrun
---
Now correctly setting CMP.

 tests/fate/libavcodec.mak |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tests/fate/libavcodec.mak b/tests/fate/libavcodec.mak
index 2aa9596..765a1b8 100644
--- a/tests/fate/libavcodec.mak
+++ b/tests/fate/libavcodec.mak
@@ -7,4 +7,10 @@ FATE_LIBAVCODEC += fate-iirfilter
 fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
 fate-iirfilter: CMD = run libavcodec/iirfilter-test
 
+FATE_LIBAVCODEC += fate-rangecoder
+fate-rangecoder: libavcodec/rangecoder-test$(EXESUF)
+fate-rangecoder: CMD = run libavcodec/rangecoder-test
+fate-rangecoder: CMP = null
+fate-rangecoder: REF = /dev/null
+
 fate-libavcodec: $(FATE_LIBAVCODEC)
-- 
1.7.1

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 20/20] lavc: add CODEC_CAP_PARAM_CHANGE to capabilities for some audio decoders

2012-10-15 Thread Måns Rullgård
Luca Barbato  writes:

> On 10/08/2012 07:39 PM, Justin Ruggles wrote:
>> Decoders setting this capability allow the user to safely change the sample
>> rate, channel count, or channel layout parameters in AVCodecContext during
>> decoding. It is also used by libavcodec to determine whether to apply
>> parameter changes as signaled by packet side data.
>> ---
>
> Seems fine. s/signalled/signaled btw

Signalled is correct.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 20/20] lavc: add CODEC_CAP_PARAM_CHANGE to capabilities for some audio decoders

2012-10-15 Thread Diego Biurrun
On Mon, Oct 15, 2012 at 07:09:07PM +0200, Luca Barbato wrote:
> On 10/08/2012 07:39 PM, Justin Ruggles wrote:
> > Decoders setting this capability allow the user to safely change the sample
> > rate, channel count, or channel layout parameters in AVCodecContext during
> > decoding. It is also used by libavcodec to determine whether to apply
> > parameter changes as signaled by packet side data.
> > ---
> 
> Seems fine. s/signalled/signaled btw

"signalled" is British, "signaled" is American, funny that Justin uses
the British variant :)

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 20/20] lavc: add CODEC_CAP_PARAM_CHANGE to capabilities for some audio decoders

2012-10-15 Thread Luca Barbato
On 10/08/2012 07:39 PM, Justin Ruggles wrote:
> Decoders setting this capability allow the user to safely change the sample
> rate, channel count, or channel layout parameters in AVCodecContext during
> decoding. It is also used by libavcodec to determine whether to apply
> parameter changes as signaled by packet side data.
> ---

Seems fine. s/signalled/signaled btw

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 14/20] pcmdec: validate channel count in pcm_decode_frame()

2012-10-15 Thread Luca Barbato
On 10/08/2012 07:39 PM, Justin Ruggles wrote:
> Allows for changing channel layout during decoding.
> ---
>  libavcodec/pcm.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 

The commit message doesn't seem to apply. the codec itself would support
that already.

(patch in itself looks fine, would be nicer reporting how many an where
though)

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 13/20] nellymoser: set channels and channel_layout in each decode call

2012-10-15 Thread Luca Barbato
On 10/08/2012 07:39 PM, Justin Ruggles wrote:
> Only mono is supported.
> ---
>  libavcodec/nellymoserdec.c |5 -
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 

Ok.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] avcodec_encode_audio(): fix invalid free

2012-10-15 Thread Luca Barbato
On 10/15/2012 06:41 PM, Rafaël Carré wrote:
> Since 2bc0de385, AVFrame needs to be initialized
> before calling avcodec_get_frame_defaults().
> ---
>  libavcodec/utils.c |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/utils.c b/libavcodec/utils.c
> index bb99a5a..836d953 100644
> --- a/libavcodec/utils.c
> +++ b/libavcodec/utils.c
> @@ -1073,7 +1073,7 @@ int attribute_align_arg 
> avcodec_encode_audio(AVCodecContext *avctx,
>   const short *samples)
>  {
>  AVPacket pkt;
> -AVFrame frame0;
> +AVFrame frame0 = { 0 };
>  AVFrame *frame;
>  int ret, samples_size, got_packet;
>  
> 

Looks fine for me, Justin?
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] avcodec_encode_audio(): fix invalid free

2012-10-15 Thread Rafaël Carré
Since 2bc0de385, AVFrame needs to be initialized
before calling avcodec_get_frame_defaults().
---
 libavcodec/utils.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index bb99a5a..836d953 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1073,7 +1073,7 @@ int attribute_align_arg 
avcodec_encode_audio(AVCodecContext *avctx,
  const short *samples)
 {
 AVPacket pkt;
-AVFrame frame0;
+AVFrame frame0 = { 0 };
 AVFrame *frame;
 int ret, samples_size, got_packet;
 
-- 
1.7.10.4
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag

2012-10-15 Thread Diego Biurrun
On Mon, Oct 15, 2012 at 06:01:17PM +0200, John Stebbins wrote:
> On 10/15/2012 05:38 PM, Diego Biurrun wrote:
> > On Sun, Oct 14, 2012 at 05:41:03PM +0200, John Stebbins wrote:
> >> On 10/14/2012 05:14 PM, Luca Barbato wrote:
> >>> On 10/14/2012 04:52 PM, John Stebbins wrote:
>  +uint8_t forced;
> >>> why uint8_t ? I guess it would require a version bump btw.
> >>>
> >>> In itself looks a good feature (and probably the players would enjoy
> >>> having this information)
> >> Is the version number bump something I should do in the patch, or do you
> >> prefer handling that yourselves?
> > It's preferable you do it lest it be forgotten.
> 
> Ok.  I'm unfamiliar with how libav versioning works.  Can you educate me
> or point me to the write document? I.e. what file and what define gets
> changed in this case?

http://www.libav.org/developer.html#Development-Policy

  16. Remember to check if you need to bump versions for the specific
  libav parts (libavutil, libavcodec, libavformat) you are changing. You
  need to change the version integer. Incrementing the first component
  means no backward compatibility to previous versions (e.g. removal of
  a function from the public API). Incrementing the second component
  means backward compatible change (e.g. addition of a function to the
  public API or extension of an existing data structure). Incrementing
  the third component means a noteworthy binary compatible change (e.g.
  encoder bug fix that matters for the decoder).

In your case I think bumping the minor number should be appropriate.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 00/20] audio param changes (v2)

2012-10-15 Thread Justin Ruggles
On 10/08/2012 01:38 PM, Justin Ruggles wrote:
> - Squashed the patches for setting CODEC_CAP_PARAM_CHANGE
> - Dropped some patches
> - Made some cosmetic changes for vertical alignment
> 
> Justin Ruggles (20):
>   lavf: send parser parameter changes via packet side_data
>   lavf: copy packet duration if parser is not splitting packets
>   lavf: cosmetics: indentation
>   dca_parser: allow the parser to change the sample rate
>   adpcmdec: validate channel count in adpcm_decode_frame()
>   g722dec: set channels and channel_layout in each decode call
>   g726dec: set channels and channel_layout in each decode call
>   amrnbdec: set channels, channel_layout, and sample_rate
>   amrwbdec: set channels, channel_layout, and sample_rate
>   gsmdec: set channels and channel_layout in each decode call
>   libgsm: set channels and channel_layout in each decode call
>   mace: validate channel count in mace_decode_frame()
>   nellymoser: set channels and channel_layout in each decode call
>   pcmdec: validate channel count in pcm_decode_frame()
>   qcelp: set channels and channel_layout in each decode call
>   ra144dec: set channels and channel_layout in each decode call
>   ra288dec: set channels and channel_layout in each decode call
>   sipr: set channels and channel_layout in each decode call
>   truespeech: set channels, channel_layout, and sample_rate
>   lavc: add CODEC_CAP_PARAM_CHANGE to capabilities for some audio
> decoders
> 
>  libavcodec/aacdec.c |6 +++-
>  libavcodec/ac3dec.c |4 +-
>  libavcodec/adpcm.c  |   25 +++--
>  libavcodec/amrnbdec.c   |6 +++-
>  libavcodec/amrwbdec.c   |6 +++-
>  libavcodec/dca_parser.c |3 +-
>  libavcodec/g722dec.c|   15 +-
>  libavcodec/g726.c   |   14 +
>  libavcodec/gsmdec.c |   12 +---
>  libavcodec/libgsm.c |   19 +---
>  libavcodec/mace.c   |   10 ---
>  libavcodec/mlpdec.c |4 +-
>  libavcodec/mpegaudiodec.c   |8 +++---
>  libavcodec/mpegaudiodec_float.c |8 +++---
>  libavcodec/nellymoserdec.c  |5 +++-
>  libavcodec/pcm-mpeg.c   |2 +-
>  libavcodec/pcm.c|7 -
>  libavcodec/qcelpdec.c   |9 +-
>  libavcodec/ra144dec.c   |9 +-
>  libavcodec/ra288.c  |   10 +-
>  libavcodec/s302m.c  |2 +-
>  libavcodec/sipr.c   |9 +-
>  libavcodec/truespeech.c |   11 +++
>  libavformat/utils.c |   56 --
>  24 files changed, 180 insertions(+), 80 deletions(-)

patch set ping.

-Justin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] build: support asan and tsan toolchain shortcuts

2012-10-15 Thread Luca Barbato
On 10/15/2012 05:51 PM, Måns Rullgård wrote:
> Diego Biurrun  writes:
> 
>> On Mon, Oct 15, 2012 at 03:40:33AM +0200, Luca Barbato wrote:
>>> ---
>>>  configure | 10 ++
>>>  1 file changed, 10 insertions(+)
>>
>> LGTM
> 
> What, you don't want the entries sorted?
> 

Right. updating and pushing this.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag

2012-10-15 Thread John Stebbins
On 10/15/2012 05:38 PM, Diego Biurrun wrote:
> On Sun, Oct 14, 2012 at 05:41:03PM +0200, John Stebbins wrote:
>> On 10/14/2012 05:14 PM, Luca Barbato wrote:
>>> On 10/14/2012 04:52 PM, John Stebbins wrote:
 +uint8_t forced;
>>> why uint8_t ? I guess it would require a version bump btw.
>>>
>>> In itself looks a good feature (and probably the players would enjoy
>>> having this information)
>> Is the version number bump something I should do in the patch, or do you
>> prefer handling that yourselves?
> It's preferable you do it lest it be forgotten.
>
>

Ok.  I'm unfamiliar with how libav versioning works.  Can you educate me
or point me to the write document? I.e. what file and what define gets
changed in this case?


___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] build: support asan and tsan toolchain shortcuts

2012-10-15 Thread Måns Rullgård
Diego Biurrun  writes:

> On Mon, Oct 15, 2012 at 03:40:33AM +0200, Luca Barbato wrote:
>> ---
>>  configure | 10 ++
>>  1 file changed, 10 insertions(+)
>
> LGTM

What, you don't want the entries sorted?

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] build: support asan and tsan toolchain shortcuts

2012-10-15 Thread Diego Biurrun
On Mon, Oct 15, 2012 at 03:40:33AM +0200, Luca Barbato wrote:
> ---
>  configure | 10 ++
>  1 file changed, 10 insertions(+)

LGTM

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag

2012-10-15 Thread Diego Biurrun
On Sun, Oct 14, 2012 at 05:41:03PM +0200, John Stebbins wrote:
> On 10/14/2012 05:14 PM, Luca Barbato wrote:
> > On 10/14/2012 04:52 PM, John Stebbins wrote:
> >> +uint8_t forced;
> > why uint8_t ? I guess it would require a version bump btw.
> >
> > In itself looks a good feature (and probably the players would enjoy
> > having this information)
> 
> Is the version number bump something I should do in the patch, or do you
> prefer handling that yourselves?

It's preferable you do it lest it be forgotten.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag

2012-10-15 Thread Luca Barbato
On 10/15/2012 05:33 PM, John Stebbins wrote:
> Ok, I'm an idiot.  Forgot to attach the updated patch...
> 

The patch looks fine IMHO.

In order to support multiple rects we would have to enhance the subtitle
support a lot (so you can select what to show) and that could happen
later if enough people are interested.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag

2012-10-15 Thread John Stebbins
On 10/14/2012 07:37 PM, John Stebbins wrote:
> On 10/14/2012 06:28 PM, John Stebbins wrote:
>> On 10/14/2012 05:17 PM, Måns Rullgård wrote:
>>> Luca Barbato  writes:
>>>
 On 10/14/2012 04:52 PM, John Stebbins wrote:
> +uint8_t forced;
 why uint8_t ? I guess it would require a version bump btw.
>>> Add a flags member instead so more things can be added later without
>>> changing ABI incompatibly again.
>>>
>
>
> ubitux rightly points out on irc that the forced flag should be per
> rect. Although libav currently only fills one rect per PGS sub it could
> and should support multiple, and each can be flagged as forced.
>
>

Ok, I'm an idiot.  Forgot to attach the updated patch...
>From 0a1a465857bbd3ac929b9066f57629b071a52ef3 Mon Sep 17 00:00:00 2001
From: John Stebbins 
Date: Sun, 14 Oct 2012 19:32:31 +0200
Subject: [PATCH] PGS subtitles: Expose forced flag

Useful for detection of subtitles displayed during foreign language
scenes.
---
 libavcodec/avcodec.h   |3 +++
 libavcodec/pgssubdec.c |   11 ---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 51270e6..7353671 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3137,6 +3137,8 @@ enum AVSubtitleType {
 SUBTITLE_ASS,
 };
 
+#define AV_SUBTITLE_FLAG_FORCED 0x0001
+
 typedef struct AVSubtitleRect {
 int x; ///< top left corner  of pict, undefined when pict is not set
 int y; ///< top left corner  of pict, undefined when pict is not set
@@ -3159,6 +3161,7 @@ typedef struct AVSubtitleRect {
  * struct.
  */
 char *ass;
+int flags;
 } AVSubtitleRect;
 
 typedef struct AVSubtitle {
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index 9fd26d8..0326ea8 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -45,6 +45,7 @@ typedef struct PGSSubPresentation {
 int y;
 int id_number;
 int object_number;
+uint8_t composition_flag;
 } PGSSubPresentation;
 
 typedef struct PGSSubPicture {
@@ -299,16 +300,17 @@ static void parse_presentation_segment(AVCodecContext *avctx,
 buf += 3;
 
 ctx->presentation.object_number = bytestream_get_byte(&buf);
+ctx->presentation.composition_flag = 0;
 if (!ctx->presentation.object_number)
 return;
 
 /*
- * Skip 4 bytes of unknown:
+ * Skip 3 bytes of unknown:
  * object_id_ref (2 bytes),
  * window_id_ref,
- * composition_flag (0x80 - object cropped, 0x40 - object forced)
  */
-buf += 4;
+buf += 3;
+ctx->presentation.composition_flag = bytestream_get_byte(&buf);
 
 x = bytestream_get_be16(&buf);
 y = bytestream_get_be16(&buf);
@@ -368,6 +370,9 @@ static int display_end_segment(AVCodecContext *avctx, void *data,
 sub->rects[0]  = av_mallocz(sizeof(*sub->rects[0]));
 sub->num_rects = 1;
 
+if (ctx->presentation.composition_flag & 0x40)
+sub->rects[0]->flags |= AV_SUBTITLE_FLAG_FORCED;
+
 sub->rects[0]->x= ctx->presentation.x;
 sub->rects[0]->y= ctx->presentation.y;
 sub->rects[0]->w= ctx->picture.w;
-- 
1.7.9.5

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] nut: export codec_tag provided by rawvideo

2012-10-15 Thread Luca Barbato
On 10/13/2012 09:05 PM, Luca Barbato wrote:
> Raw audio does not provide valid audio tags while rawvideo does.
> The fate refs have to be updated because it undoes the previous tag
> change.
> ---
> 

Ping.

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/2] footer: add more supporters.

2012-10-15 Thread Luca Barbato
---
 src/template_footer | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/src/template_footer b/src/template_footer
index 070ee1e..43034a5 100644
--- a/src/template_footer
+++ b/src/template_footer
@@ -1,11 +1,22 @@
 
-  http://plus.google.com/109970378897678547866?prsrc=3"; 
rel="publisher" style="text-decoration:none;">
-  https://ssl.gstatic.com/images/icons/gplus-16.png"; alt="Google+" 
style="border:0;width:16px;height:16px;"/>
   
 Server donated by
-http://code.google.com/opensource/";>Google
+http://code.google.com/opensource/";>Google
   
+  
+  
+Bandwidth provided by
+http://www.init7.net";>init7
+  
+  
+  
+  
+Rackspace provided by
+http://www.nine.ch";>nine.ch
+  
+  
 
+
 
 
 
-- 
1.7.12

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/2] index: report just the latest 10 news items

2012-10-15 Thread Luca Barbato
Limit the space taken to 30 lines anyway.
---
 Makefile |  7 ---
 htdocs/css/bootstrap.css | 13 +++--
 sed_commands | 13 -
 split.awk| 20 
 4 files changed, 31 insertions(+), 22 deletions(-)
 delete mode 100644 sed_commands
 create mode 100644 split.awk

diff --git a/Makefile b/Makefile
index e843bef..bf95afa 100644
--- a/Makefile
+++ b/Makefile
@@ -16,11 +16,12 @@ all: $(TARGETS)
 clean:
rm -f $(TARGETS)
 
-htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS)
+htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) split.awk
cat src/template_head1 $<_title \
src/template_head2 \
-   src/template_head3 $< src/news \
-   src/template_footer > $@
+   src/template_head3 $<  > $@
+   awk -f split.awk src/news >> $@
+   cat  src/template_footer  >> $@
 
 htdocs/%.html: src/% src/%_title $(PAGE_DEPS)
cat src/template_head1 $<_title \
diff --git a/htdocs/css/bootstrap.css b/htdocs/css/bootstrap.css
index a398f84..ca4ec73 100644
--- a/htdocs/css/bootstrap.css
+++ b/htdocs/css/bootstrap.css
@@ -1166,16 +1166,17 @@ legend small {
 .pager a,
 .pager span {
   display: inline-block;
-  padding: 5px 14px;
+  padding: 4px 10px;
   background-color: #fff;
-  border: 1px solid #ddd;
-  -webkit-border-radius: 15px;
-  -moz-border-radius: 15px;
-  border-radius: 15px;
+  -webkit-border-radius: 4px;
+  -moz-border-radius: 4px;
+  border-radius: 4px;
+  color: #356635;
+  border: 1px solid #D0E6BE;
 }
 .pager a:hover {
   text-decoration: none;
-  background-color: #f5f5f5;
+  background-color: #DFF0D8;
 }
 .pager .next a,
 .pager .next span {
diff --git a/sed_commands b/sed_commands
deleted file mode 100644
index d0bd7fa..000
--- a/sed_commands
+++ /dev/null
@@ -1,13 +0,0 @@
-/LIBAV_ABOUT_NAVBAR/a\
-\
-About/ \
-Projects Using Libav\
-
-/LIBAV_ABOUT_NAVBAR/d
-
-/LIBAV_LEGAL_NAVBAR/a\
-\
-License and Legal Issues\
-Hall of Shame\
-
-/LIBAV_LEGAL_NAVBAR/d
diff --git a/split.awk b/split.awk
new file mode 100644
index 000..e3b4950
--- /dev/null
+++ b/split.awk
@@ -0,0 +1,20 @@
+BEGIN {
+url = ARGV[1] ".html"
+sub(/^.*\//, "", url)
+}
+
+/ 5 || NR > 30) {
+print "read 
more";
+exit 0;
+}
+}
+{ print }
-- 
1.7.12

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 15/15] build: Plan 9 support

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Måns Rullgård wrote:


Martin Storsjö  writes:


On Mon, 15 Oct 2012, Måns Rullgård wrote:


Martin Storsjö  writes:


On Mon, 15 Oct 2012, Mans Rullgard wrote:


+add_cppflags -I${source_path}/compat/plan9 \
+ -D_C99_SNPRINTF_EXTENSION \
+ -D_REENTRANT_SOURCE   \
+ -D_RESEARCH_SOURCE
+add_compat strtod.o strtod=avpriv_strtod
+network_extralibs='-lbsd'
+exeobjs=compat/plan9/main.o
+disable avserver


I take it that plan9 currently has everything that we check for, but
still fails on something else. Is there some other function we could
add to the avserver deps to make this be disabled automatically?


It fails on SA_RESTART.  If I define that to zero, the link fails with
atoll, lrintf, and unsetenv missing.


Ah, I see. In that case I'm ok with the 'disable avserver'.


Hacking around these is certainly possible, but I don't really have much
motivation to do that just for avserver.  It probably won't work anyway.


I agree, it's not worth the trouble, and none of those are good indicative 
APIs as "the one that avserver needs for being buildable".


// Martin___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] rmdec: Move SIPR code shared with Matroska demuxer to a separate file

2012-10-15 Thread Kostya Shishkov
On Mon, Oct 15, 2012 at 01:35:49PM +0200, Diego Biurrun wrote:
> ---
> Now calling the files rmsipr.[ch].
> 
>  libavformat/Makefile  |6 ++--
>  libavformat/matroskadec.c |2 +-
>  libavformat/rm.h  |8 --
>  libavformat/rmdec.c   |   42 +--
>  libavformat/rmsipr.c  |   61 
> +
>  libavformat/rmsipr.h  |   35 +
>  6 files changed, 101 insertions(+), 53 deletions(-)
>  create mode 100644 libavformat/rmsipr.c
>  create mode 100644 libavformat/rmsipr.h

LGTM
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 15/15] build: Plan 9 support

2012-10-15 Thread Måns Rullgård
Martin Storsjö  writes:

> On Mon, 15 Oct 2012, Måns Rullgård wrote:
>
>> Martin Storsjö  writes:
>>
>>> On Mon, 15 Oct 2012, Mans Rullgard wrote:
>>>
 +add_cppflags -I${source_path}/compat/plan9 \
 + -D_C99_SNPRINTF_EXTENSION \
 + -D_REENTRANT_SOURCE   \
 + -D_RESEARCH_SOURCE
 +add_compat strtod.o strtod=avpriv_strtod
 +network_extralibs='-lbsd'
 +exeobjs=compat/plan9/main.o
 +disable avserver
>>>
>>> I take it that plan9 currently has everything that we check for, but
>>> still fails on something else. Is there some other function we could
>>> add to the avserver deps to make this be disabled automatically?
>>
>> It fails on SA_RESTART.  If I define that to zero, the link fails with
>> atoll, lrintf, and unsetenv missing.
>
> Ah, I see. In that case I'm ok with the 'disable avserver'.

Hacking around these is certainly possible, but I don't really have much
motivation to do that just for avserver.  It probably won't work anyway.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 15/15] build: Plan 9 support

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Måns Rullgård wrote:


Martin Storsjö  writes:


On Mon, 15 Oct 2012, Mans Rullgard wrote:


diff --git a/configure b/configure
index 0acaf3e..25e2e83 100755
--- a/configure
+++ b/configure
@@ -956,7 +956,7 @@ apply(){
cp_if_changed(){
cmp -s "$1" "$2" && echo "$2 is unchanged" && return
mkdir -p "$(dirname $2)"
-cp -f "$1" "$2"
+$cp_f "$1" "$2"
}

# CONFIG_LIST contains configurable options, while HAVE_LIST is for


Perhaps the cp_f addition could be split out to a separate commit?


Sure.


@@ -1790,6 +1790,7 @@ shlibdir_default="$libdir_default"
ar_default="ar"
cc_default="gcc"
host_cc_default="gcc"
+cp_f="cp -f"
ln_s="ln -sf"
nm_default="nm -g"
objformat="elf"
@@ -2898,6 +2899,19 @@ case $target_os in
;;
minix)
;;
+plan9)
+add_host_cflags -I${source_path}/compat/plan9


Hmm, what headers is this for? This isn't totally clean for cross
compilation I guess, but OTOH I don't see what headers the host tools
would use from this dir at all.


Oops, that one wasn't supposed to be there.


+add_cppflags -I${source_path}/compat/plan9 \
+ -D_C99_SNPRINTF_EXTENSION \
+ -D_REENTRANT_SOURCE   \
+ -D_RESEARCH_SOURCE
+add_compat strtod.o strtod=avpriv_strtod
+network_extralibs='-lbsd'
+exeobjs=compat/plan9/main.o
+disable avserver


I take it that plan9 currently has everything that we check for, but
still fails on something else. Is there some other function we could
add to the avserver deps to make this be disabled automatically?


It fails on SA_RESTART.  If I define that to zero, the link fails with
atoll, lrintf, and unsetenv missing.


Ah, I see. In that case I'm ok with the 'disable avserver'.

// Martin___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] rmdec: Move SIPR code shared with Matroska demuxer to a separate file

2012-10-15 Thread Diego Biurrun
---
Now calling the files rmsipr.[ch].

 libavformat/Makefile  |6 ++--
 libavformat/matroskadec.c |2 +-
 libavformat/rm.h  |8 --
 libavformat/rmdec.c   |   42 +--
 libavformat/rmsipr.c  |   61 +
 libavformat/rmsipr.h  |   35 +
 6 files changed, 101 insertions(+), 53 deletions(-)
 create mode 100644 libavformat/rmsipr.c
 create mode 100644 libavformat/rmsipr.h

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d89a2e..26c9803 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -135,8 +135,8 @@ OBJS-$(CONFIG_LMLM4_DEMUXER) += lmlm4.o
 OBJS-$(CONFIG_LXF_DEMUXER)   += lxfdec.o
 OBJS-$(CONFIG_M4V_DEMUXER)   += m4vdec.o rawdec.o
 OBJS-$(CONFIG_M4V_MUXER) += rawenc.o
-OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o matroska.o \
-isom.o rmdec.o rm.o
+OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o matroska.o  \
+isom.o rmsipr.o
 OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \
 isom.o avc.o \
 flacenc_header.o avlanguage.o
@@ -242,7 +242,7 @@ OBJS-$(CONFIG_R3D_DEMUXER)   += r3d.o
 OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o rawdec.o
 OBJS-$(CONFIG_RAWVIDEO_MUXER)+= rawenc.o
 OBJS-$(CONFIG_RL2_DEMUXER)   += rl2.o
-OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o
+OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o rmsipr.o
 OBJS-$(CONFIG_RM_MUXER)  += rmenc.o rm.o
 OBJS-$(CONFIG_ROQ_DEMUXER)   += idroqdec.o
 OBJS-$(CONFIG_ROQ_MUXER) += idroqenc.o rawenc.o
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 094b055..68c936c 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -35,7 +35,7 @@
 /* For ff_codec_get_id(). */
 #include "riff.h"
 #include "isom.h"
-#include "rm.h"
+#include "rmsipr.h"
 #include "matroska.h"
 #include "libavcodec/bytestream.h"
 #include "libavcodec/mpeg4audio.h"
diff --git a/libavformat/rm.h b/libavformat/rm.h
index 9d104ad..a06ea01 100644
--- a/libavformat/rm.h
+++ b/libavformat/rm.h
@@ -26,7 +26,6 @@
 #include "internal.h"
 
 extern const char * const ff_rm_metadata[4];
-extern const unsigned char ff_sipr_subpk_size[4];
 extern const AVCodecTag ff_rm_codec_tags[];
 
 typedef struct RMStream RMStream;
@@ -93,11 +92,4 @@ int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
 int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
   AVStream *st, RMStream *rst, AVPacket *pkt);
 
-/**
- * Perform 4-bit block reordering for SIPR data.
- *
- * @param buf SIPR data
- */
-void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize);
-
 #endif /* AVFORMAT_RM_H */
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index eefd2c5..07d218e 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -25,6 +25,7 @@
 #include "avformat.h"
 #include "internal.h"
 #include "riff.h"
+#include "rmsipr.h"
 #include "rm.h"
 
 #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r') ///< interleaving for 
Cooker/Atrac
@@ -59,21 +60,6 @@ typedef struct {
 int audio_pkt_cnt; ///< Output packet counter
 } RMDemuxContext;
 
-static const unsigned char sipr_swaps[38][2] = {
-{  0, 63 }, {  1, 22 }, {  2, 44 }, {  3, 90 },
-{  5, 81 }, {  7, 31 }, {  8, 86 }, {  9, 58 },
-{ 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 },
-{ 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 },
-{ 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 },
-{ 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 },
-{ 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 },
-{ 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 },
-{ 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 },
-{ 67, 83 }, { 77, 80 }
-};
-
-const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 };
-
 static inline void get_strl(AVIOContext *pb, char *buf, int buf_size, int len)
 {
 int i;
@@ -719,32 +705,6 @@ rm_ac3_swap_bytes (AVStream *st, AVPacket *pkt)
 }
 }
 
-/**
- * Perform 4-bit block reordering for SIPR data.
- * @todo This can be optimized, e.g. use memcpy() if data blocks are aligned
- */
-void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
-{
-int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket
-
-for (n = 0; n < 38; n++) {
-int j;
-int i = bs * sipr_swaps[n][0];
-int o = bs * sipr_swaps[n][1];
-
-/* swap 4bit-nibbles of block 'i' with 'o' */
-for (j = 0; j < bs; j++, i++, o++) {
-int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF,
-y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF;
-
-buf[o >> 1] = (x << (4 * (o & 1

Re: [libav-devel] [PATCH 15/15] build: Plan 9 support

2012-10-15 Thread Måns Rullgård
Martin Storsjö  writes:

> On Mon, 15 Oct 2012, Mans Rullgard wrote:
>
>> diff --git a/configure b/configure
>> index 0acaf3e..25e2e83 100755
>> --- a/configure
>> +++ b/configure
>> @@ -956,7 +956,7 @@ apply(){
>> cp_if_changed(){
>> cmp -s "$1" "$2" && echo "$2 is unchanged" && return
>> mkdir -p "$(dirname $2)"
>> -cp -f "$1" "$2"
>> +$cp_f "$1" "$2"
>> }
>>
>> # CONFIG_LIST contains configurable options, while HAVE_LIST is for
>
> Perhaps the cp_f addition could be split out to a separate commit?

Sure.

>> @@ -1790,6 +1790,7 @@ shlibdir_default="$libdir_default"
>> ar_default="ar"
>> cc_default="gcc"
>> host_cc_default="gcc"
>> +cp_f="cp -f"
>> ln_s="ln -sf"
>> nm_default="nm -g"
>> objformat="elf"
>> @@ -2898,6 +2899,19 @@ case $target_os in
>> ;;
>> minix)
>> ;;
>> +plan9)
>> +add_host_cflags -I${source_path}/compat/plan9
>
> Hmm, what headers is this for? This isn't totally clean for cross
> compilation I guess, but OTOH I don't see what headers the host tools
> would use from this dir at all.

Oops, that one wasn't supposed to be there.

>> +add_cppflags -I${source_path}/compat/plan9 \
>> + -D_C99_SNPRINTF_EXTENSION \
>> + -D_REENTRANT_SOURCE   \
>> + -D_RESEARCH_SOURCE
>> +add_compat strtod.o strtod=avpriv_strtod
>> +network_extralibs='-lbsd'
>> +exeobjs=compat/plan9/main.o
>> +disable avserver
>
> I take it that plan9 currently has everything that we check for, but
> still fails on something else. Is there some other function we could
> add to the avserver deps to make this be disabled automatically?

It fails on SA_RESTART.  If I define that to zero, the link fails with
atoll, lrintf, and unsetenv missing.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes

2012-10-15 Thread Sami Pietilä
Hi,

please find attached a stream for reproducing this issue. It's CIF
resolution 8 frames high QP, with pics=5 and 7 having multiple occurences
of the issue.

Br, Sami


On Fri, Oct 12, 2012 at 5:20 PM, Ronald Bultje  wrote:

> Hi Sami,
>
> On Fri, Oct 12, 2012 at 3:42 AM, Sami Pietilä 
> wrote:
> >
> > Hi all,
> >
> > while testing a VP8 encoder I found a mismatch between FFMPEG and libvpx
> VP8
> > decoders. The reason for this mismatch is that FFMPEG doesn't reset
> > loopfilter delta values at keyframes. Patch that fixes the issue is
> below.
> > I've verified that the output of ffmpeg after this patch matches libvpx.
> If
> > you need I can send you a stream that shows the issue.
> >
> > Br,
> > Sami Pietila
> >
> >
> > diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
> > index 3f07b90..0bb5495 100644
> > --- a/libavcodec/vp8.c
> > +++ b/libavcodec/vp8.c
> > @@ -353,6 +353,7 @@ static int decode_frame_header(VP8Context *s, const
> > uint8_t *buf, int
> > buf_size)
> >  memcpy(s->prob->pred8x8c , vp8_pred8x8c_prob_inter ,
> > sizeof(s->prob->pred8x8c));
> >  memcpy(s->prob->mvc  , vp8_mv_default_prob ,
> > sizeof(s->prob->mvc));
> >  memset(&s->segmentation, 0, sizeof(s->segmentation));
> > +memset(&s->lf_delta, 0, sizeof(s->lf_delta));
> >  }
>
> Nice catch, thanks for noticing. I've applied it upstream (will flow
> to ffmpeg-devel in a few hours), and I'll update Chrome's tree ASAP.
> As Luca said on libav-devel, a test vector would be nice for
> archiving/regression testing purposes if it's not too much of a
> hassle.
>
> Ronald
>


lf_delta_keyframe_reset.ivf
Description: Binary data
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/4] fate: Add rangecoder test

2012-10-15 Thread Måns Rullgård
Diego Biurrun  writes:

> On Fri, Oct 05, 2012 at 06:24:15PM +0100, Måns Rullgård wrote:
>> Diego Biurrun  writes:
>> > --- a/tests/fate/libavcodec.mak
>> > +++ b/tests/fate/libavcodec.mak
>> > @@ -7,4 +7,9 @@ FATE_LIBAVCODEC += fate-iirfilter
>> >  fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
>> >  fate-iirfilter: CMD = run libavcodec/iirfilter-test
>> >
>> > +FATE_LIBAVCODEC += fate-rangecoder
>> > +fate-rangecoder: libavcodec/rangecoder-test$(EXESUF)
>> > +fate-rangecoder: CMD = run libavcodec/rangecoder-test
>> > +fate-rangecoder: REF = /dev/null
>> > +
>> >  fate-libavcodec: $(FATE_LIBAVCODEC)
>> > -- 
>> 
>> This doesn't actually test anything.
>
> True that, good catch.  It does after the follow-up patch I sent, however.

The correct way to run tests with meaningless stdout is CMP = null.

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/4] fate: Add rangecoder test

2012-10-15 Thread Diego Biurrun
On Fri, Oct 05, 2012 at 06:24:15PM +0100, Måns Rullgård wrote:
> Diego Biurrun  writes:
> > --- a/tests/fate/libavcodec.mak
> > +++ b/tests/fate/libavcodec.mak
> > @@ -7,4 +7,9 @@ FATE_LIBAVCODEC += fate-iirfilter
> >  fate-iirfilter: libavcodec/iirfilter-test$(EXESUF)
> >  fate-iirfilter: CMD = run libavcodec/iirfilter-test
> >
> > +FATE_LIBAVCODEC += fate-rangecoder
> > +fate-rangecoder: libavcodec/rangecoder-test$(EXESUF)
> > +fate-rangecoder: CMD = run libavcodec/rangecoder-test
> > +fate-rangecoder: REF = /dev/null
> > +
> >  fate-libavcodec: $(FATE_LIBAVCODEC)
> > -- 
> 
> This doesn't actually test anything.

True that, good catch.  It does after the follow-up patch I sent, however.

Diego
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 03/15] build: simplify enabling of compat objects

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Måns Rullgård wrote:


Martin Storsjö  writes:


On Mon, 15 Oct 2012, Mans Rullgard wrote:


Add a configure function to pull in a compat object and set up
redirects in one operation.  This avoids duplicating conditions
across configure and makefiles.

Signed-off-by: Mans Rullgard 
---
configure  | 15 +++
libavutil/Makefile |  3 +--
2 files changed, 12 insertions(+), 6 deletions(-)


[...]


Ok


Did you verify that this didn't accidentally break the msvc build?


Yes, I ran a test build with MSVC with this whole patchset, and it worked 
just fine.


// Martin___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 03/15] build: simplify enabling of compat objects

2012-10-15 Thread Måns Rullgård
Martin Storsjö  writes:

> On Mon, 15 Oct 2012, Mans Rullgard wrote:
>
>> Add a configure function to pull in a compat object and set up
>> redirects in one operation.  This avoids duplicating conditions
>> across configure and makefiles.
>>
>> Signed-off-by: Mans Rullgard 
>> ---
>> configure  | 15 +++
>> libavutil/Makefile |  3 +--
>> 2 files changed, 12 insertions(+), 6 deletions(-)

[...]

> Ok

Did you verify that this didn't accidentally break the msvc build?

-- 
Måns Rullgård
m...@mansr.com
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] rmdec: Move SIPR code shared with Matroska demuxer to a separate file

2012-10-15 Thread Kostya Shishkov
On Mon, Oct 15, 2012 at 10:51:05AM +0200, Luca Barbato wrote:
> On 10/15/2012 10:44 AM, Kostya Shishkov wrote:
> > On Mon, Oct 15, 2012 at 10:38:38AM +0200, Diego Biurrun wrote:
> >> ---
> >> Now the SIPR code is moved to a separate file instead of to the shared RM 
> >> code.
> >>
> >>  libavformat/Makefile  |6 ++--
> >>  libavformat/matroskadec.c |2 +-
> >>  libavformat/rm.h  |8 --
> >>  libavformat/rmdec.c   |   42 +--
> >>  libavformat/sipr.c|   61 
> >> +
> >>  libavformat/sipr.h|   35 +
> >>  6 files changed, 101 insertions(+), 53 deletions(-)
> >>  create mode 100644 libavformat/sipr.c
> >>  create mode 100644 libavformat/sipr.h
> > 
> > I'd move it to rm.c instead.
> > That code is not Sipro codec specific, it's specific only to Sipro-in-RM or
> > the garbage container that copies it. Sipro in AVI doesn't need that at all.
> 
> It is shared between rm and mkv thus this new file, rmmkvsipr doesn't
> sound or look as good as plain sipr.

Again, it has nothing to do with MKV directly, rmsipr should be better and not
so misleading.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] rmdec: Move SIPR code shared with Matroska demuxer to a separate file

2012-10-15 Thread Luca Barbato
On 10/15/2012 10:44 AM, Kostya Shishkov wrote:
> On Mon, Oct 15, 2012 at 10:38:38AM +0200, Diego Biurrun wrote:
>> ---
>> Now the SIPR code is moved to a separate file instead of to the shared RM 
>> code.
>>
>>  libavformat/Makefile  |6 ++--
>>  libavformat/matroskadec.c |2 +-
>>  libavformat/rm.h  |8 --
>>  libavformat/rmdec.c   |   42 +--
>>  libavformat/sipr.c|   61 
>> +
>>  libavformat/sipr.h|   35 +
>>  6 files changed, 101 insertions(+), 53 deletions(-)
>>  create mode 100644 libavformat/sipr.c
>>  create mode 100644 libavformat/sipr.h
> 
> I'd move it to rm.c instead.
> That code is not Sipro codec specific, it's specific only to Sipro-in-RM or
> the garbage container that copies it. Sipro in AVI doesn't need that at all.

It is shared between rm and mkv thus this new file, rmmkvsipr doesn't
sound or look as good as plain sipr.

lu

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] rmdec: Move SIPR code shared with Matroska demuxer to a separate file

2012-10-15 Thread Kostya Shishkov
On Mon, Oct 15, 2012 at 10:38:38AM +0200, Diego Biurrun wrote:
> ---
> Now the SIPR code is moved to a separate file instead of to the shared RM 
> code.
> 
>  libavformat/Makefile  |6 ++--
>  libavformat/matroskadec.c |2 +-
>  libavformat/rm.h  |8 --
>  libavformat/rmdec.c   |   42 +--
>  libavformat/sipr.c|   61 
> +
>  libavformat/sipr.h|   35 +
>  6 files changed, 101 insertions(+), 53 deletions(-)
>  create mode 100644 libavformat/sipr.c
>  create mode 100644 libavformat/sipr.h

I'd move it to rm.c instead.
That code is not Sipro codec specific, it's specific only to Sipro-in-RM or
the garbage container that copies it. Sipro in AVI doesn't need that at all.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] rmdec: Move SIPR code shared with Matroska demuxer to a separate file

2012-10-15 Thread Diego Biurrun
---
Now the SIPR code is moved to a separate file instead of to the shared RM code.

 libavformat/Makefile  |6 ++--
 libavformat/matroskadec.c |2 +-
 libavformat/rm.h  |8 --
 libavformat/rmdec.c   |   42 +--
 libavformat/sipr.c|   61 +
 libavformat/sipr.h|   35 +
 6 files changed, 101 insertions(+), 53 deletions(-)
 create mode 100644 libavformat/sipr.c
 create mode 100644 libavformat/sipr.h

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 5d89a2e..e732407 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -135,8 +135,8 @@ OBJS-$(CONFIG_LMLM4_DEMUXER) += lmlm4.o
 OBJS-$(CONFIG_LXF_DEMUXER)   += lxfdec.o
 OBJS-$(CONFIG_M4V_DEMUXER)   += m4vdec.o rawdec.o
 OBJS-$(CONFIG_M4V_MUXER) += rawenc.o
-OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o matroska.o \
-isom.o rmdec.o rm.o
+OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o matroska.o  \
+isom.o sipr.o
 OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \
 isom.o avc.o \
 flacenc_header.o avlanguage.o
@@ -242,7 +242,7 @@ OBJS-$(CONFIG_R3D_DEMUXER)   += r3d.o
 OBJS-$(CONFIG_RAWVIDEO_DEMUXER)  += rawvideodec.o rawdec.o
 OBJS-$(CONFIG_RAWVIDEO_MUXER)+= rawenc.o
 OBJS-$(CONFIG_RL2_DEMUXER)   += rl2.o
-OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o
+OBJS-$(CONFIG_RM_DEMUXER)+= rmdec.o rm.o sipr.o
 OBJS-$(CONFIG_RM_MUXER)  += rmenc.o rm.o
 OBJS-$(CONFIG_ROQ_DEMUXER)   += idroqdec.o
 OBJS-$(CONFIG_ROQ_MUXER) += idroqenc.o rawenc.o
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 094b055..508c7b4 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -35,7 +35,7 @@
 /* For ff_codec_get_id(). */
 #include "riff.h"
 #include "isom.h"
-#include "rm.h"
+#include "sipr.h"
 #include "matroska.h"
 #include "libavcodec/bytestream.h"
 #include "libavcodec/mpeg4audio.h"
diff --git a/libavformat/rm.h b/libavformat/rm.h
index 9d104ad..a06ea01 100644
--- a/libavformat/rm.h
+++ b/libavformat/rm.h
@@ -26,7 +26,6 @@
 #include "internal.h"
 
 extern const char * const ff_rm_metadata[4];
-extern const unsigned char ff_sipr_subpk_size[4];
 extern const AVCodecTag ff_rm_codec_tags[];
 
 typedef struct RMStream RMStream;
@@ -93,11 +92,4 @@ int ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
 int ff_rm_retrieve_cache (AVFormatContext *s, AVIOContext *pb,
   AVStream *st, RMStream *rst, AVPacket *pkt);
 
-/**
- * Perform 4-bit block reordering for SIPR data.
- *
- * @param buf SIPR data
- */
-void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize);
-
 #endif /* AVFORMAT_RM_H */
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index eefd2c5..bac45b4 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -25,6 +25,7 @@
 #include "avformat.h"
 #include "internal.h"
 #include "riff.h"
+#include "sipr.h"
 #include "rm.h"
 
 #define DEINT_ID_GENR MKTAG('g', 'e', 'n', 'r') ///< interleaving for 
Cooker/Atrac
@@ -59,21 +60,6 @@ typedef struct {
 int audio_pkt_cnt; ///< Output packet counter
 } RMDemuxContext;
 
-static const unsigned char sipr_swaps[38][2] = {
-{  0, 63 }, {  1, 22 }, {  2, 44 }, {  3, 90 },
-{  5, 81 }, {  7, 31 }, {  8, 86 }, {  9, 58 },
-{ 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 },
-{ 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 },
-{ 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 },
-{ 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 },
-{ 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 },
-{ 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 },
-{ 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 },
-{ 67, 83 }, { 77, 80 }
-};
-
-const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 };
-
 static inline void get_strl(AVIOContext *pb, char *buf, int buf_size, int len)
 {
 int i;
@@ -719,32 +705,6 @@ rm_ac3_swap_bytes (AVStream *st, AVPacket *pkt)
 }
 }
 
-/**
- * Perform 4-bit block reordering for SIPR data.
- * @todo This can be optimized, e.g. use memcpy() if data blocks are aligned
- */
-void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize)
-{
-int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket
-
-for (n = 0; n < 38; n++) {
-int j;
-int i = bs * sipr_swaps[n][0];
-int o = bs * sipr_swaps[n][1];
-
-/* swap 4bit-nibbles of block 'i' with 'o' */
-for (j = 0; j < bs; j++, i++, o++) {
-int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF,
-y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF;
-
-  

Re: [libav-devel] [PATCH 15/15] build: Plan 9 support

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


diff --git a/configure b/configure
index 0acaf3e..25e2e83 100755
--- a/configure
+++ b/configure
@@ -956,7 +956,7 @@ apply(){
cp_if_changed(){
cmp -s "$1" "$2" && echo "$2 is unchanged" && return
mkdir -p "$(dirname $2)"
-cp -f "$1" "$2"
+$cp_f "$1" "$2"
}

# CONFIG_LIST contains configurable options, while HAVE_LIST is for


Perhaps the cp_f addition could be split out to a separate commit?


@@ -1790,6 +1790,7 @@ shlibdir_default="$libdir_default"
ar_default="ar"
cc_default="gcc"
host_cc_default="gcc"
+cp_f="cp -f"
ln_s="ln -sf"
nm_default="nm -g"
objformat="elf"
@@ -2898,6 +2899,19 @@ case $target_os in
;;
minix)
;;
+plan9)
+add_host_cflags -I${source_path}/compat/plan9


Hmm, what headers is this for? This isn't totally clean for cross 
compilation I guess, but OTOH I don't see what headers the host tools 
would use from this dir at all.



+add_cppflags -I${source_path}/compat/plan9 \
+ -D_C99_SNPRINTF_EXTENSION \
+ -D_REENTRANT_SOURCE   \
+ -D_RESEARCH_SOURCE
+add_compat strtod.o strtod=avpriv_strtod
+network_extralibs='-lbsd'
+exeobjs=compat/plan9/main.o
+disable avserver


I take it that plan9 currently has everything that we check for, but still 
fails on something else. Is there some other function we could add to the 
avserver deps to make this be disabled automatically?


// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 09/15] swscale: avoid pointless use of compound literals

2012-10-15 Thread Luca Barbato
On 10/15/2012 05:53 AM, Ronald S. Bultje wrote:
> On Sun, Oct 14, 2012 at 8:11 PM, Mans Rullgard  wrote:
>> Some compilers (e.g. old gcc) have trouble with these.
>>
>> Signed-off-by: Mans Rullgard 
>> ---
>>  libswscale/swscale_unscaled.c | 17 +
>>  1 file changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
>> index 70eff72..5efc647 100644
>> --- a/libswscale/swscale_unscaled.c
>> +++ b/libswscale/swscale_unscaled.c
>> @@ -396,6 +396,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const 
>> uint8_t *src[],
>>   uint8_t *dst[], int dstStride[])
>>  {
>>  int alpha_first = 0;
>> +const uint8_t *src102[] = { src[1], src[0], src[2] };
>> +const uint8_t *src201[] = { src[2], src[0], src[1] };
>> +int stride102[] = { srcStride[1], srcStride[0], srcStride[2] };
>> +int stride201[] = { srcStride[2], srcStride[0], srcStride[1] };
>> +
>>  if (c->srcFormat != AV_PIX_FMT_GBRP) {
>>  av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> 
>> %s\n",
>> av_get_pix_fmt_name(c->srcFormat),
>> @@ -405,15 +410,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const 
>> uint8_t *src[],
>>
>>  switch (c->dstFormat) {
>>  case AV_PIX_FMT_BGR24:
>> -gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
>> - (int []) { srcStride[1], srcStride[0], 
>> srcStride[2] },
>> +gbr24ptopacked24(src102, stride102,
>>   dst[0] + srcSliceY * dstStride[0], dstStride[0],
>>   srcSliceH, c->srcW);
>>  break;
> 
> I find it slightly hilarious that there is no way in hell this would
> have gotten in had the compiler's name been "gcc". Why don't you use
> c99-to-c89 for this so-called "compiler"?

As a matter of fact lots of patches went in to please a certain compiler
for microsoft.

As I said for the patches that didn't make the code less ugly even if is
something spotted by msvc, "why not?"

lu
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 11/15] tiny_psnr: check for specified sample size less than 1

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


A zero or negative sample size is impossible and should be
reported as an error.

Signed-off-by: Mans Rullgard 
---
tests/tiny_psnr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c
index 5db2662..a53a670 100644
--- a/tests/tiny_psnr.c
+++ b/tests/tiny_psnr.c
@@ -139,7 +139,7 @@ int main(int argc, char *argv[])
} else {
char *end;
len = strtol(argv[3], &end, 0);
-if (*end || len > 2) {
+if (*end || len < 1 || len > 2) {
fprintf(stderr, "Unsupported sample format: %s\n", argv[3]);
return 1;
}
--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 10/15] fate: improve md5sum utility selection

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


The 'md5sum' command is used with the -b flag so the presence test
must also use this flag.

Signed-off-by: Mans Rullgard 
---
tests/md5.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/md5.sh b/tests/md5.sh
index 4b95127..0b382b1 100644
--- a/tests/md5.sh
+++ b/tests/md5.sh
@@ -1,6 +1,6 @@
# try to find an md5 program

-if [ X"$(echo | md5sum 2> /dev/null)" != X ]; then
+if [ X"$(echo | md5sum -b 2> /dev/null)" != X ]; then
do_md5sum() { md5sum -b $1; }
elif [ X"$(echo | command md5 2> /dev/null)" != X ]; then
do_md5sum() { command md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; }
--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 08/15] libm: add fallbacks for various single-precision functions

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


Signed-off-by: Mans Rullgard 
---
configure   | 16 
libavcodec/aacps_tablegen.h |  1 +
libavutil/libm.h| 40 
3 files changed, 57 insertions(+)


LGTM

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 07/15] network: use getservbyport() only if available

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


The absence of this function will only give a less informative
string back from our fallback implementation of getnameinfo().

Signed-off-by: Mans Rullgard 
---
configure| 2 ++
libavformat/os_support.c | 2 ++
2 files changed, 4 insertions(+)

diff --git a/configure b/configure
index defc2bf..5426c92 100755
--- a/configure
+++ b/configure
@@ -1171,6 +1171,7 @@ HAVE_LIST="
GetProcessTimes
GetSystemTimeAsFileTime
getrusage
+getservbyport
gettimeofday
gnu_as
ibm_asm
@@ -3177,6 +3178,7 @@ if enabled network; then
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
check_type netinet/sctp.h "struct sctp_event_subscribe"
check_func getaddrinfo $network_extralibs
+check_func getservbyport $network_extralibs
# Prefer arpa/inet.h over winsock2
if check_header arpa/inet.h ; then
check_func closesocket
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 7618708..451801f 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -235,8 +235,10 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen,

if (serv && servlen > 0) {
struct servent *ent = NULL;
+#if HAVE_GETSERVBYPORT
if (!(flags & NI_NUMERICSERV))
ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : 
"tcp");
+#endif

if (ent)
snprintf(serv, servlen, "%s", ent->s_name);
--
1.7.12.3


LGTM

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 06/15] network: add fallbacks for INADDR_LOOPBACK and INET_ADDRSTRLEN

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


Signed-off-by: Mans Rullgard 
---
libavformat/network.h | 8 
1 file changed, 8 insertions(+)

diff --git a/libavformat/network.h b/libavformat/network.h
index da9d926..5160767 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -188,6 +188,14 @@ const char *ff_gai_strerror(int ecode);
#define gai_strerror ff_gai_strerror
#endif

+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f01
+#endif
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN INET_ADDRSTRLEN
#endif
--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/15] network: #include stdint.h in network.h

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


This header uses various types provided by stdint.h without
explicitly including it.

Signed-off-by: Mans Rullgard 
---
libavformat/network.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/libavformat/network.h b/libavformat/network.h
index 19c5a92..da9d926 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -22,6 +22,7 @@
#define AVFORMAT_NETWORK_H

#include 
+#include 

#include "config.h"
#include "libavutil/error.h"
--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 04/15] Include sys/time.h before sys/resource.h

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


Some systems require sys/time.h being explicitly included before
sys/resource.h.  The configure check already does this.

Signed-off-by: Mans Rullgard 
---
avconv.c   | 1 +
cmdutils.c | 1 +
2 files changed, 2 insertions(+)

diff --git a/avconv.c b/avconv.c
index 4d9c7c0..20d873e 100644
--- a/avconv.c
+++ b/avconv.c
@@ -53,6 +53,7 @@
# include "libavfilter/buffersink.h"

#if HAVE_SYS_RESOURCE_H
+#include 
#include 
#include 
#elif HAVE_GETPROCESSTIMES
diff --git a/cmdutils.c b/cmdutils.c
index 34c52ca..6570968 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -49,6 +49,7 @@
#include "libavformat/network.h"
#endif
#if HAVE_SYS_RESOURCE_H
+#include 
#include 
#endif

--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 03/15] build: simplify enabling of compat objects

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


Add a configure function to pull in a compat object and set up
redirects in one operation.  This avoids duplicating conditions
across configure and makefiles.

Signed-off-by: Mans Rullgard 
---
configure  | 15 +++
libavutil/Makefile |  3 +--
2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/configure b/configure
index eeefeaf..defc2bf 100755
--- a/configure
+++ b/configure
@@ -641,6 +641,12 @@ add_host_ldflags(){
append host_ldflags $($host_ldflags_filter "$@")
}

+add_compat(){
+append compat_objs $1
+shift
+map 'add_cppflags -D$v' "$@"
+}
+
check_cmd(){
log "$@"
"$@" >> $logfile 2>&1
@@ -2906,10 +2912,10 @@ elif check_cpp_condition newlib.h "defined 
_NEWLIB_VERSION"; then
libc_type=newlib
elif check_func_headers stdlib.h _get_doserrno; then
libc_type=msvcrt
-add_cflags -Dstrtod=avpriv_strtod
-add_cflags -Dsnprintf=avpriv_snprintf   \
-   -D_snprintf=avpriv_snprintf  \
-   -Dvsnprintf=avpriv_vsnprintf
+add_compat strtod.o strtod=avpriv_strtod
+add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf   \
+ _snprintf=avpriv_snprintf  \
+ vsnprintf=avpriv_vsnprintf
elif check_cpp_condition stddef.h "defined __KLIBC__"; then
libc_type=klibc
fi
@@ -3754,6 +3760,7 @@ CFLAGS-avplay=$sdl_cflags
ZLIB=$($ldflags_filter -lz)
LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
EXTRALIBS=$extralibs
+COMPAT_OBJS=$compat_objs
INSTALL=install
LIBTARGET=${LIBTARGET}
SLIBNAME=${SLIBNAME}
diff --git a/libavutil/Makefile b/libavutil/Makefile
index e2b84e0..a85d3ae 100644
--- a/libavutil/Makefile
+++ b/libavutil/Makefile
@@ -88,8 +88,7 @@ OBJS = adler32.o  
  \
   utils.o  \
   xtea.o   \

-OBJS-$(HAVE_MSVCRT) += ../compat/msvcrt/snprintf.o  \
-   ../compat/strtod.o
+OBJS += $(COMPAT_OBJS:%=../compat/%)

SKIPHEADERS  = old_pix_fmts.h

--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/15] configure: simplify argument handling in check_ld

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


Use the existing filter functions instead of open-coding the
separation of general flags and libraries.

Signed-off-by: Mans Rullgard 
---
configure | 7 ++-
1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 3bb8fff..eeefeaf 100755
--- a/configure
+++ b/configure
@@ -704,11 +704,8 @@ ld_o(){

check_ld(){
log check_ld "$@"
-flags=''
-libs=''
-for f; do
-test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
-done
+flags=$(filter_out '-l*' "$@")
+libs=$(filter '-l*' "$@")
check_cc $($cflags_filter $flags) || return
flags=$($ldflags_filter $flags)
libs=$($ldflags_filter $libs)
--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 01/15] configure: simplify get_version() function

2012-10-15 Thread Martin Storsjö

On Mon, 15 Oct 2012, Mans Rullgard wrote:


awk alone can do this, no need for grep.

Signed-off-by: Mans Rullgard 
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure b/configure
index 700e99d..3bb8fff 100755
--- a/configure
+++ b/configure
@@ -3775,7 +3775,7 @@ get_version(){
lcname=$1
name=$(toupper $lcname)
file=$source_path/$lcname/version.h
-eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
+eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
eval 
${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
--
1.7.12.3


Ok

// Martin
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel