Re: [libav-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Vitor Sessak

On 05/09/2011 11:50 PM, Benjamin Larsson wrote:

Hi, it's time to elect a new board for the FFmtech foundation. If you
want to candidate or participate in electing the new board then please
respond to this email. To be eligible for this you must fulfil the
following.

"People who had svn accounts and were active in the last year are
allowed to vote, in case of contention the board can decide."

(FFmpeg repository svn account. And last year since the meeting on March
19th 2011)


The time line for this is 2 weeks for responding that you intend to
either candidate or partake in the voting. Then 5 days for the
candidates to present them self’s and then 2 days for the election
process. If all goes according to plan we will have a new board by the
end of May.


I wish to vote.

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


Re: [libav-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Can Wu
I want to vote

On Tue, May 10, 2011 at 5:50 AM, Benjamin Larsson  wrote:

> Hi, it's time to elect a new board for the FFmtech foundation. If you
> want to candidate or participate in electing the new board then please
> respond to this email. To be eligible for this you must fulfil the
> following.
>
> "People who had svn accounts and were active in the last year are
> allowed to vote, in case of contention the board can decide."
>
> (FFmpeg repository svn account. And last year since the meeting on March
> 19th 2011)
>
>
> The time line for this is 2 weeks for responding that you intend to
> either candidate or partake in the voting. Then 5 days for the
> candidates to present them self’s and then 2 days for the election
> process. If all goes according to plan we will have a new board by the
> end of May.
>
>
> MvH
> Benjamin Larsson
> Current president of the FFmtech foundation
> ___
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
>



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


Re: [libav-devel] [PATCH 2/2] mdec: enable frame-level multithreading.

2011-05-17 Thread Alexander Strange
On Tue, May 17, 2011 at 10:03 AM, Kostya  wrote:
> On Tue, May 10, 2011 at 11:29:09AM -0400, Ronald S. Bultje wrote:
>> From: Alexander Strange 
>>
>> Signed-off-by: Ronald S. Bultje 
>> ---
>>  libavcodec/mdec.c |   20 +---
>>  1 files changed, 17 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
>> index 9b6e6b6..17671cf 100644
>> --- a/libavcodec/mdec.c
>> +++ b/libavcodec/mdec.c
>> @@ -31,6 +31,7 @@
>>  #include "dsputil.h"
>>  #include "mpegvideo.h"
>>  #include "mpeg12.h"
>> +#include "thread.h"
>>
>>  typedef struct MDECContext{
>>      AVCodecContext *avctx;
>> @@ -163,10 +164,10 @@ static int decode_frame(AVCodecContext *avctx,
>>      int i;
>>
>>      if(p->data[0])
>> -        avctx->release_buffer(avctx, p);
>> +        ff_thread_release_buffer(avctx, p);
>>
>>      p->reference= 0;
>> -    if(avctx->get_buffer(avctx, p) < 0){
>> +    if(ff_thread_get_buffer(avctx, p) < 0){
>>          av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>>          return -1;
>>      }
>> @@ -239,6 +240,18 @@ static av_cold int decode_init(AVCodecContext *avctx){
>>      return 0;
>>  }
>>
>> +static av_cold int decode_init_thread_copy(AVCodecContext *avctx){
>> +    MDECContext * const a = avctx->priv_data;
>> +    AVFrame *p = (AVFrame*)&a->picture;
>> +
>> +    avctx->coded_frame= p;
>> +    a->avctx= avctx;
>> +
>> +    p->qscale_table= av_mallocz( a->mb_width);
>> +
>> +    return 0;
>> +}
>> +
>>  static av_cold int decode_end(AVCodecContext *avctx){
>>      MDECContext * const a = avctx->priv_data;
>>
>> @@ -260,7 +273,8 @@ AVCodec ff_mdec_decoder = {
>>      NULL,
>>      decode_end,
>>      decode_frame,
>> -    CODEC_CAP_DR1,
>> +    CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
>>      .long_name= NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion 
>> DECoder)"),
>> +    .init_thread_copy= ONLY_IF_THREADS_ENABLED(decode_init_thread_copy)
>>  };
>>
>> --
>
> looks ok except for idiotic "var= val;" assignment style (and yes, "I've
> copied it from elsewhere" argument is too old that it stinks)

In this case I copied it from the function immediately above.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Fix compilation of iirfilter-test.

2011-05-17 Thread Måns Rullgård
Justin Ruggles  writes:

> ---
>  libavcodec/iirfilter.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
> index 56d17d2..98366e2 100644
> --- a/libavcodec/iirfilter.c
> +++ b/libavcodec/iirfilter.c
> @@ -324,7 +324,7 @@ int main(void)
>  int i;
>  FILE* fd;
>  
> -fcoeffs = ff_iir_filter_init_coeffs(FF_FILTER_TYPE_BUTTERWORTH,
> +fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH,
>  FF_FILTER_MODE_LOWPASS, FILT_ORDER,
>  cutoff_coeff, 0.0, 0.0);
>  fstate  = ff_iir_filter_init_state(FILT_ORDER);

Looks OK.

-- 
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] Fix compilation of iirfilter-test.

2011-05-17 Thread Justin Ruggles
---
 libavcodec/iirfilter.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/iirfilter.c b/libavcodec/iirfilter.c
index 56d17d2..98366e2 100644
--- a/libavcodec/iirfilter.c
+++ b/libavcodec/iirfilter.c
@@ -324,7 +324,7 @@ int main(void)
 int i;
 FILE* fd;
 
-fcoeffs = ff_iir_filter_init_coeffs(FF_FILTER_TYPE_BUTTERWORTH,
+fcoeffs = ff_iir_filter_init_coeffs(NULL, FF_FILTER_TYPE_BUTTERWORTH,
 FF_FILTER_MODE_LOWPASS, FILT_ORDER,
 cutoff_coeff, 0.0, 0.0);
 fstate  = ff_iir_filter_init_state(FILT_ORDER);
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Clean up header #includes in cmdutils.h.

2011-05-17 Thread Stefano Sabatini
On date Tuesday 2011-05-17 16:24:43 -0400, Ronald S. Bultje encoded:
> Hi,
> 
> On Tue, May 17, 2011 at 4:18 PM, Stefano Sabatini
>  wrote:
> > On date Tuesday 2011-05-17 20:31:53 +0200, Diego Biurrun encoded:
> >> Do not #include avfilter.h conditionally, #include (just) required headers.
> >> ---
> >>  cmdutils.h |   10 --
> >>  1 files changed, 4 insertions(+), 6 deletions(-)
> >>
> >> diff --git a/cmdutils.h b/cmdutils.h
> >> index f97ea80..fef2774 100644
> >> --- a/cmdutils.h
> >> +++ b/cmdutils.h
> >> @@ -22,8 +22,11 @@
> >>  #ifndef LIBAV_CMDUTILS_H
> >>  #define LIBAV_CMDUTILS_H
> >>
> >> -#include 
> >> +#include 
> >> +#include 
> >> +
> >>  #include "libavcodec/avcodec.h"
> >> +#include "libavfilter/avfilter.h"
> >>  #include "libavformat/avformat.h"
> >>  #include "libswscale/swscale.h"
> >>
> >> @@ -278,9 +281,6 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, 
> >> int64_t pts, int64_t dts);
> >>  FILE *get_preset_file(char *filename, size_t filename_size,
> >>                        const char *preset_name, int is_path, const char 
> >> *codec_name);
> >>
> >> -#if CONFIG_AVFILTER
> >> -#include "libavfilter/avfilter.h"
> >> -
> >>  typedef struct {
> >>      enum PixelFormat pix_fmt;
> >>  } FFSinkContext;
> >> @@ -296,6 +296,4 @@ extern AVFilter ffsink;
> >>  int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame,
> >>                               AVFilterBufferRef **picref, AVRational 
> >> *pts_tb);
> >>
> >> -#endif /* CONFIG_AVFILTER */
> >> -
> >
> > If libavfilter is not enabled (which is still possible, and for some
> > specific purposes even recommended) the declared functions are not
> > compiled, so not having the symbols defined in the binary is safer.
> 
> Including a header has no effect on symbols, only if you use them.

Uhm, even in that case not including the function declarations will
cause a compile error if the functions are erroneously called, which
is better than a linking error, correct me if I'm wrong.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] mpegaudio: sanitise compute_antialias_* names

2011-05-17 Thread Luca Barbato

On 5/17/11 9:39 PM, Mans Rullgard wrote:

This makes the compute_antialias functions use the same naming
convention as everything else.

Signed-off-by: Mans Rullgard
---
  libavcodec/mpegaudiodec.c |9 +++--
  1 files changed, 3 insertions(+), 6 deletions(-)


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


[libav-devel] [PATCH 3/3] dct32: Add AVX implementation of 32-point DCT

2011-05-17 Thread Vitor Sessak
 >From 5f3a8fb8f98da0b249db143b43d2914f9c7340dd Mon Sep 17 00:00:00 2001
From: Vitor Sessak 
Date: Sat, 14 May 2011 14:17:15 +0200
Subject: [PATCH 3/3] dct32: Add AVX implementation of 32-point DCT

---
 libavcodec/mpegaudio.h   |4 +-
 libavcodec/x86/dct32_sse.asm |  334 +++---
 libavcodec/x86/fft.c |4 +-
 libavcodec/x86/fft.h |1 +
 4 files changed, 224 insertions(+), 119 deletions(-)

diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h
index 3422b6d..a9331cb 100644
--- a/libavcodec/mpegaudio.h
+++ b/libavcodec/mpegaudio.h
@@ -130,9 +130,9 @@ typedef struct MPADecodeContext {
 uint32_t free_format_next_header;
 GetBitContext gb;
 GetBitContext in_gb;
-DECLARE_ALIGNED(16, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512 * 2];
+DECLARE_ALIGNED(32, MPA_INT, synth_buf)[MPA_MAX_CHANNELS][512 * 2];
 int synth_buf_offset[MPA_MAX_CHANNELS];
-DECLARE_ALIGNED(16, INTFLOAT, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT];
+DECLARE_ALIGNED(32, INTFLOAT, sb_samples)[MPA_MAX_CHANNELS][36][SBLIMIT];
 INTFLOAT mdct_buf[MPA_MAX_CHANNELS][SBLIMIT * 18]; /* previous samples, for layer 3 MDCT */
 GranuleDef granules[2][2]; /* Used in Layer 3 */
 #ifdef DEBUG
diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm
index fa0a502..2e1176c 100644
--- a/libavcodec/x86/dct32_sse.asm
+++ b/libavcodec/x86/dct32_sse.asm
@@ -20,31 +20,41 @@
 ;**
 
 %include "x86inc.asm"
+%include "config.asm"
 
 SECTION_RODATA 32
 
 align 32
 ps_cos_vec: dd   0.500603,  0.505471,  0.515447,  0.531043
 dd   0.553104,  0.582935,  0.622504,  0.674808
-dd  -1.169440, -0.972568, -0.839350, -0.744536
 dd -10.190008, -3.407609, -2.057781, -1.484165
+dd  -1.169440, -0.972568, -0.839350, -0.744536
 dd   0.502419,  0.522499,  0.566944,  0.646822
 dd   0.788155,  1.060678,  1.722447,  5.101149
 dd   0.509796,  0.601345,  0.899976,  2.562916
+dd   0.509796,  0.601345,  0.899976,  2.562916
 dd   1.00,  1.00,  1.306563,  0.541196
+dd   1.00,  1.00,  1.306563,  0.541196
+dd   1.00,  0.707107,  1.00, -0.707107
 dd   1.00,  0.707107,  1.00, -0.707107
 
 
-ps_p1p1m1m1: dd 0, 0, 0x8000, 0x8000
+ps_p1p1m1m1: dd 0, 0, 0x8000, 0x8000, 0, 0, 0x8000, 0x8000
 
-%macro BUTTERFLY 4
+%macro BUTTERFLY_SSE 4
 movaps %4, %1
 subps  %1, %2
 addps  %2, %4
 mulps  %1, %3
 %endmacro
 
-%macro BUTTERFLY0 5
+%macro BUTTERFLY_AVX 4
+vsubps  %4, %1, %2
+vaddps  %2, %2, %1
+vmulps  %1, %4, %3
+%endmacro
+
+%macro BUTTERFLY0_SSE 5
 movaps %4, %1
 shufps %1, %1, %5
 xorps  %4, %2
@@ -52,6 +62,13 @@ ps_p1p1m1m1: dd 0, 0, 0x8000, 0x8000
 mulps  %1, %3
 %endmacro
 
+%macro BUTTERFLY0_AVX 5
+vshufps %4, %1, %1, %5
+vxorps  %1, %1, %2
+vaddps  %4, %4, %1
+vmulps  %1, %4, %3
+%endmacro
+
 %macro BUTTERFLY2 4
 BUTTERFLY0 %1, %2, %3, %4, 0x1b
 %endmacro
@@ -60,8 +77,199 @@ ps_p1p1m1m1: dd 0, 0, 0x8000, 0x8000
 BUTTERFLY0 %1, %2, %3, %4, 0xb1
 %endmacro
 
-INIT_XMM
+%macro PASS6_AND_PERMUTE 0
+mov tmpd, [outq+4]
+movss m7, [outq+72]
+addss m7, [outq+76]
+movss m3, [outq+56]
+addss m3, [outq+60]
+addss m4, m3
+movss m2, [outq+52]
+addss m2, m3
+movss m3, [outq+104]
+addss m3, [outq+108]
+addss m1, m3
+addss m5, m4
+movss [outq+ 16], m1
+movss m1, [outq+100]
+addss m1, m3
+movss m3, [outq+40]
+movss [outq+ 48], m1
+addss m3, [outq+44]
+movss m1, [outq+100]
+addss m4, m3
+addss m3, m2
+addss m1, [outq+108]
+movss [outq+ 40], m3
+addss m2, [outq+36]
+movss m3, [outq+8]
+movss [outq+ 56], m2
+addss m3, [outq+12]
+movss [outq+ 32], m3
+movss m3, [outq+80]
+movss [outq+  8], m5
+movss [outq+ 80], m1
+movss m2, [outq+52]
+movss m5, [outq+120]
+addss m5, [outq+124]
+movss m1, [outq+64]
+addss m2, [outq+60]
+addss m0, m5
+addss m5, [outq+116]
+mov[outq+64], tmpd
+addss m6, m0
+addss m1, m6
+mov tmpd, [outq+12]
+mov   [outq+ 96], tmpd
+movss [outq+  4], m1
+movss m1, [outq+24]
+movss [outq+ 24], m4
+movss m4, [outq+88]
+addss m4, [outq+92]
+addss m3, m4
+addss m4, [outq+84]
+mov tmpd, [outq+108]
+addss m1, [outq+28]
+addss m0, m1
+addss m1, m5
+addss m6, m3
+addss

[libav-devel] [PATCH 2/3] dct32: Change pass 6 permutation to allow for AVX implementation

2011-05-17 Thread Vitor Sessak
 >From 770c75fa43df1454b5d9591784bcc1b82ab5afb2 Mon Sep 17 00:00:00 2001
From: Vitor Sessak 
Date: Sat, 14 May 2011 14:16:30 +0200
Subject: [PATCH 2/3] dct32: Change pass 6 permutation to allow for AVX implementation

---
 libavcodec/x86/dct32_sse.asm |   98 +-
 1 files changed, 49 insertions(+), 49 deletions(-)

diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm
index f6d5bcf..fa0a502 100644
--- a/libavcodec/x86/dct32_sse.asm
+++ b/libavcodec/x86/dct32_sse.asm
@@ -156,7 +156,7 @@ cglobal dct32_float_sse, 2,3,8, out, in, tmp
 
 movaps  m1, [outq+16]
 BUTTERFLY3  m1, m3, m2, m5
-movaps  [outq+16], m1
+movaps  [outq+96], m1
 
 BUTTERFLY3  m4, m3, m2, m5
 movaps  [outq+64], m4
@@ -173,47 +173,46 @@ cglobal dct32_float_sse, 2,3,8, out, in, tmp
 movaps  [outq+48], m4
 
 BUTTERFLY3  m6, m3, m2, m7
-movaps  [outq+96], m6
+movaps  [outq+16], m6
 
 BUTTERFLY3  m0, m3, m2, m7
 movaps  [outq+112], m0
 
 
 ;pass 6, no SIMD...
-movss m3, [outq+56]
 mov tmpd, [outq+4]
-addss m3, [outq+60]
 movss m7, [outq+72]
+addss m7, [outq+76]
+movss m3, [outq+56]
+addss m3, [outq+60]
 addss m4, m3
 movss m2, [outq+52]
 addss m2, m3
-movss m3, [outq+24]
-addss m3, [outq+28]
-addss m7, [outq+76]
+movss m3, [outq+104]
+addss m3, [outq+108]
 addss m1, m3
 addss m5, m4
 movss [outq+ 16], m1
-movss m1, [outq+20]
+movss m1, [outq+100]
 addss m1, m3
 movss m3, [outq+40]
 movss [outq+ 48], m1
 addss m3, [outq+44]
-movss m1, [outq+20]
+movss m1, [outq+100]
 addss m4, m3
 addss m3, m2
-addss m1, [outq+28]
+addss m1, [outq+108]
 movss [outq+ 40], m3
 addss m2, [outq+36]
 movss m3, [outq+8]
 movss [outq+ 56], m2
 addss m3, [outq+12]
-movss [outq+  8], m5
 movss [outq+ 32], m3
-movss m2, [outq+52]
 movss m3, [outq+80]
-movss m5, [outq+120]
+movss [outq+  8], m5
 movss [outq+ 80], m1
-movss [outq+ 24], m4
+movss m2, [outq+52]
+movss m5, [outq+120]
 addss m5, [outq+124]
 movss m1, [outq+64]
 addss m2, [outq+60]
@@ -223,67 +222,68 @@ cglobal dct32_float_sse, 2,3,8, out, in, tmp
 addss m6, m0
 addss m1, m6
 mov tmpd, [outq+12]
-movss [outq+  4], m1
-movss m1, [outq+88]
 mov   [outq+ 96], tmpd
-addss m1, [outq+92]
-movss m4, [outq+104]
-mov tmpd, [outq+28]
-addss m4, [outq+108]
-addss m0, m4
-addss m3, m1
-addss m1, [outq+84]
-addss m4, m5
+movss [outq+  4], m1
+movss m1, [outq+24]
+movss [outq+ 24], m4
+movss m4, [outq+88]
+addss m4, [outq+92]
+addss m3, m4
+addss m4, [outq+84]
+mov tmpd, [outq+108]
+addss m1, [outq+28]
+addss m0, m1
+addss m1, m5
 addss m6, m3
 addss m3, m0
 addss m0, m7
-addss m5, [outq+100]
-addss m7, m4
+addss m5, [outq+20]
+addss m7, m1
+movss [outq+ 12], m6
 mov   [outq+112], tmpd
+movss m6, [outq+28]
 movss [outq+ 28], m0
 movss m0, [outq+36]
 movss [outq+ 36], m7
-addss m4, m1
+addss m1, m4
 movss m7, [outq+116]
 addss m0, m2
 addss m7, [outq+124]
 movss [outq+ 72], m0
 movss m0, [outq+44]
-movss [outq+ 12], m6
-movss [outq+ 20], m3
 addss m2, m0
-movss [outq+ 44], m4
+movss [outq+ 44], m1
 movss [outq+ 88], m2
 addss m0, [outq+60]
 mov tmpd, [outq+60]
 mov   [outq+120], tmpd
 movss [outq+104], m0
-addss m1, m5
+addss m4, m5
 addss m5, [outq+68]
-movss  [outq+52], m1
+movss  [outq+52], m4
 movss  [outq+60], m5
-movss m1, [outq+68]
-movss m5, [outq+100]
+movss m4, [outq+68]
+movss m5, [outq+20]
+movss [outq+ 20], m3
 addss m5, m7
-addss m7, [outq+108]
-addss m1, m5
+addss m7, m6
+addss m4, m5
 movss m2, [outq+84]
 addss m2, [outq+92]
 addss m5, m2
-movss [outq+ 68], m1
+movss [outq+ 68], m4
 addss m2, m7
-movss m1, [outq+76]
+movss m4, [outq+76]
 movss [outq+ 84], m2
 movss [outq+ 76], m5
-movss m2, [outq+108

[libav-devel] [PATCH 1/3] dct32: port SSE 32-point DCT to YASM

2011-05-17 Thread Vitor Sessak
 >From 86761d96de214f746aa764c2c94d00b0bae1cbf1 Mon Sep 17 00:00:00 2001
From: Vitor Sessak 
Date: Tue, 17 May 2011 18:26:01 +0200
Subject: [PATCH 1/3] dct32: port SSE 32-point DCT to YASM

---
 libavcodec/x86/Makefile  |3 +-
 libavcodec/x86/dct32_sse.asm |  289 +
 libavcodec/x86/dct32_sse.c   |  296 --
 3 files changed, 291 insertions(+), 297 deletions(-)
 create mode 100644 libavcodec/x86/dct32_sse.asm
 delete mode 100644 libavcodec/x86/dct32_sse.c

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 1cde951..765b520 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -1,6 +1,8 @@
 OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp.o
 OBJS-$(CONFIG_TRUEHD_DECODER)  += x86/mlpdsp.o
 
+YASM-OBJS-$(CONFIG_DCT)+= x86/dct32_sse.o
+
 YASM-OBJS-FFT-$(HAVE_AMD3DNOW) += x86/fft_3dn.o
 YASM-OBJS-FFT-$(HAVE_AMD3DNOWEXT)  += x86/fft_3dn2.o
 YASM-OBJS-FFT-$(HAVE_SSE)  += x86/fft_sse.o
@@ -58,4 +60,3 @@ OBJS-$(HAVE_MMX)   += x86/dnxhd_mmx.o   \
   x86/mpegvideo_mmx.o   \
   x86/simple_idct_mmx.o \
 
-MMX-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o
diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm
new file mode 100644
index 000..f6d5bcf
--- /dev/null
+++ b/libavcodec/x86/dct32_sse.asm
@@ -0,0 +1,289 @@
+;**
+;* 32 point SSE-optimized DCT transform
+;* Copyright (c) 2010 Vitor Sessak
+;*
+;* This file is part of Libav.
+;*
+;* Libav 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.
+;*
+;* Libav 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 Libav; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;**
+
+%include "x86inc.asm"
+
+SECTION_RODATA 32
+
+align 32
+ps_cos_vec: dd   0.500603,  0.505471,  0.515447,  0.531043
+dd   0.553104,  0.582935,  0.622504,  0.674808
+dd  -1.169440, -0.972568, -0.839350, -0.744536
+dd -10.190008, -3.407609, -2.057781, -1.484165
+dd   0.502419,  0.522499,  0.566944,  0.646822
+dd   0.788155,  1.060678,  1.722447,  5.101149
+dd   0.509796,  0.601345,  0.899976,  2.562916
+dd   1.00,  1.00,  1.306563,  0.541196
+dd   1.00,  0.707107,  1.00, -0.707107
+
+
+ps_p1p1m1m1: dd 0, 0, 0x8000, 0x8000
+
+%macro BUTTERFLY 4
+movaps %4, %1
+subps  %1, %2
+addps  %2, %4
+mulps  %1, %3
+%endmacro
+
+%macro BUTTERFLY0 5
+movaps %4, %1
+shufps %1, %1, %5
+xorps  %4, %2
+addps  %1, %4
+mulps  %1, %3
+%endmacro
+
+%macro BUTTERFLY2 4
+BUTTERFLY0 %1, %2, %3, %4, 0x1b
+%endmacro
+
+%macro BUTTERFLY3 4
+BUTTERFLY0 %1, %2, %3, %4, 0xb1
+%endmacro
+
+INIT_XMM
+section .text align=16
+; void ff_dct32_float_sse(FFTSample *out, const FFTSample *in)
+cglobal dct32_float_sse, 2,3,8, out, in, tmp
+; pass 1
+
+movaps  m0, [inq+0]
+movaps  m1, [inq+112]
+shufps  m1, m1, 0x1b
+BUTTERFLY   m0, m1, [ps_cos_vec], m3
+
+movaps  m7, [inq+64]
+movaps  m4, [inq+48]
+shufps  m4, m4, 0x1b
+BUTTERFLY   m7,  m4, [ps_cos_vec+48], m3
+
+
+; pass 2
+movaps  m2, [ps_cos_vec+64]
+BUTTERFLY   m1, m4, m2, m3
+movaps  [outq+48], m1
+movaps  [outq+ 0], m4
+
+; pass 1
+movaps  m1, [inq+16]
+movaps  m6, [inq+96]
+shufps  m6, m6, 0x1b
+BUTTERFLY   m1, m6, [ps_cos_vec+16], m3
+
+movaps  m4, [inq+80]
+movaps  m5, [inq+32]
+shufps  m5, m5, 0x1b
+BUTTERFLY   m4, m5, [ps_cos_vec+32], m3
+
+; pass 2
+BUTTERFLY   m0, m7, m2, m3
+
+movaps  m2, [ps_cos_vec+80]
+BUTTERFLY   m6, m5, m2, m3
+
+BUTTERFLY   m1, m4, m2, m3
+
+; pass 3
+movaps  m2, [ps_cos_vec+96]
+shufps  m1, m1, 0x1b
+BUTTERFLY   m0, m1, m2, m3
+movaps  [outq+112], m0
+movaps  [outq+ 96], m1
+
+movaps  m0, [outq+0]
+shufps  m5, m5, 0x1b
+BUTTERFLY   m0, m5, m2, m3
+
+movaps  m1, [outq+48]
+shufps  m6, m6, 0x1b
+BUTTERFLY   m1, m6, m2, m3
+movaps  [ou

Re: [libav-devel] [PATCH 3/3] dct32: Add AVX implementation of 32-point DCT

2011-05-17 Thread Vitor Sessak

On 05/17/2011 07:20 PM, Reinhard Tartler wrote:

Vitor,

Is it just me? It seems that your latest AVX patches doesn't apply any
longer to current master. Can you please resend them? I'd be happy to
have another look at them!


I rebased before sending the next patchset. Thanks for looking!

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


Re: [libav-devel] [PATCH] g729: Merge g729.h into g729dec.c.

2011-05-17 Thread Vitor Sessak

On 05/17/2011 03:31 PM, Diego Biurrun wrote:

The header contains just a single define that is only used in g729dec.c.


lgtm

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


Re: [libav-devel] [PATCH 3/3] dct32: Add AVX implementation of 32-point DCT

2011-05-17 Thread Vitor Sessak

On 05/17/2011 11:31 AM, Loren Merritt wrote:

Use 16 xmmregs instead of spills, and transpose in pass5.
125->104 cycles on penryn x86_64. (But take the numbers with some salt:
it's sensitive to code alignment (and was before the patch too).)
Doesn't touch avx; I don't know if the same strategy would help there.


I like this idea. Unfortunately, for AVX it doesn't help, since 
everything fits in the 8 bigger registers.



I modified the x86_32 version too, but it doesn't get any speedup. Mine
is more regular than the giant list of unstructured scalar math in
PASS6_AND_PERMUTE; if this method can be applied to avx (and thus remove
PASS6_AND_PERMUTE) then that's a simplification, but if it can't then
the extra version is a complication and should be reverted.


I'll give a look at it later (I don't think this should block mine or 
your first patch), but I'm afraid that the lack of lane-crossing 
permutes might make this more expensive in AVX.




From 701f40aef4de4c001f619db20fecddaf8d1348af Mon Sep 17 00:00:00 2001
From: Loren Merritt 
Date: Tue, 17 May 2011 08:51:10 +
Subject: [PATCH 1/2] s/xmm/m/


Squashed into my patch. I'm not really happy about the way I misuse the 
INIT_XMM macro, as it resets the permutations, suggestions are welcome.


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


Re: [libav-devel] [PATCH] Clean up header #includes in cmdutils.h.

2011-05-17 Thread Ronald S. Bultje
Hi,

On Tue, May 17, 2011 at 4:18 PM, Stefano Sabatini
 wrote:
> On date Tuesday 2011-05-17 20:31:53 +0200, Diego Biurrun encoded:
>> Do not #include avfilter.h conditionally, #include (just) required headers.
>> ---
>>  cmdutils.h |   10 --
>>  1 files changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/cmdutils.h b/cmdutils.h
>> index f97ea80..fef2774 100644
>> --- a/cmdutils.h
>> +++ b/cmdutils.h
>> @@ -22,8 +22,11 @@
>>  #ifndef LIBAV_CMDUTILS_H
>>  #define LIBAV_CMDUTILS_H
>>
>> -#include 
>> +#include 
>> +#include 
>> +
>>  #include "libavcodec/avcodec.h"
>> +#include "libavfilter/avfilter.h"
>>  #include "libavformat/avformat.h"
>>  #include "libswscale/swscale.h"
>>
>> @@ -278,9 +281,6 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, 
>> int64_t pts, int64_t dts);
>>  FILE *get_preset_file(char *filename, size_t filename_size,
>>                        const char *preset_name, int is_path, const char 
>> *codec_name);
>>
>> -#if CONFIG_AVFILTER
>> -#include "libavfilter/avfilter.h"
>> -
>>  typedef struct {
>>      enum PixelFormat pix_fmt;
>>  } FFSinkContext;
>> @@ -296,6 +296,4 @@ extern AVFilter ffsink;
>>  int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame,
>>                               AVFilterBufferRef **picref, AVRational 
>> *pts_tb);
>>
>> -#endif /* CONFIG_AVFILTER */
>> -
>
> If libavfilter is not enabled (which is still possible, and for some
> specific purposes even recommended) the declared functions are not
> compiled, so not having the symbols defined in the binary is safer.

Including a header has no effect on symbols, only if you use them.

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


Re: [libav-devel] [PATCH] Clean up header #includes in cmdutils.h.

2011-05-17 Thread Stefano Sabatini
On date Tuesday 2011-05-17 20:31:53 +0200, Diego Biurrun encoded:
> Do not #include avfilter.h conditionally, #include (just) required headers.
> ---
>  cmdutils.h |   10 --
>  1 files changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/cmdutils.h b/cmdutils.h
> index f97ea80..fef2774 100644
> --- a/cmdutils.h
> +++ b/cmdutils.h
> @@ -22,8 +22,11 @@
>  #ifndef LIBAV_CMDUTILS_H
>  #define LIBAV_CMDUTILS_H
>  
> -#include 
> +#include 
> +#include 
> +
>  #include "libavcodec/avcodec.h"
> +#include "libavfilter/avfilter.h"
>  #include "libavformat/avformat.h"
>  #include "libswscale/swscale.h"
>  
> @@ -278,9 +281,6 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, 
> int64_t pts, int64_t dts);
>  FILE *get_preset_file(char *filename, size_t filename_size,
>const char *preset_name, int is_path, const char 
> *codec_name);
>  
> -#if CONFIG_AVFILTER
> -#include "libavfilter/avfilter.h"
> -
>  typedef struct {
>  enum PixelFormat pix_fmt;
>  } FFSinkContext;
> @@ -296,6 +296,4 @@ extern AVFilter ffsink;
>  int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame,
>   AVFilterBufferRef **picref, AVRational *pts_tb);
>  
> -#endif /* CONFIG_AVFILTER */
> -

If libavfilter is not enabled (which is still possible, and for some
specific purposes even recommended) the declared functions are not
compiled, so not having the symbols defined in the binary is safer.
-- 
You don't sew with a fork, so I see no reason to eat with knitting needles.
-- Miss Piggy, on eating Chinese Food
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] flvdec: clenup debug code

2011-05-17 Thread Reinhard Tartler
On Tue, May 17, 2011 at 04:01:20PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Tue, May 17, 2011 at 3:49 PM, Alex Converse  
> wrote:
> > ---
> >  libavformat/flvdec.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> OK.

Queued.

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


Re: [libav-devel] [PATCH] flvdec: clenup debug code

2011-05-17 Thread Ronald S. Bultje
Hi,

On Tue, May 17, 2011 at 3:49 PM, Alex Converse  wrote:
> ---
>  libavformat/flvdec.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

OK.

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


Re: [libav-devel] GPL License Violation

2011-05-17 Thread The Informer
> > [~/LibAV]$ strings avcodec-52.dll |grep -i gpl
> > j--prefix=/ffmpeg/Binaries --disable-debug --disable-static
> --enable-shared
> > --enable-version3 --enable-avfilter --enable-memalign-hack
> --enable-avisynth
> > --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb
> > --enable-libvpx --target-os=mingw32 --extra-cflags=-I/extlib/
> > include --extra-ldflags=-L/extlib/lib --enable-libmp3lame
> --enable-libtheora
> > --enable-libvorbis --enable-gpl --enable-libx264 --enable-libxvid
> > --enable-libfaad --enable-nonfree --enable-libfaac
>
> Actually the nonfree option takes precedence. This binary is not
> re-distributable at all.
>

Aha. Should this be reported elsewhere, or what happens from here?
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] make asfdec fallback to binary search internally

2011-05-17 Thread Reinhard Tartler
On Thu, May 12, 2011 at 10:25:54AM +0200, Vladimir Pantelic wrote:
> Vladimir Pantelic wrote:
> 
> >atm the asf logic is:
> >
> >if( index_exists ) {
> > index = search_by_index()   
> > if( index<  0 ) {
> > return -1;
> > }
> > // index success
> >} else {
> > try binary search
> > ...
> >}
> >
> >maybe it should be:
> >
> >if( index_exists ) {
> > index = search_by_index()   
> > if( index>= 0 ) {
> > // index success
> > ...
> > return ...;
> > }
> >}
> >// no index or index search fail, try binary
> >try binary search
> >...
> 
> patch attached

> From 15f02f4decb7fa1a330bd322f001bcf744183064 Mon Sep 17 00:00:00 2001
> From: Vladimir Pantelic 
> Date: Thu, 12 May 2011 10:21:19 +0200
> Subject: [PATCH] make asfdec fallback to binary search internally
> 
> lavf will do that anyway in case seek by index fails
> ---
>  libavformat/asfdec.c |   15 ---
>  1 files changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index 77c8449..e2161fd 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -1269,21 +1269,22 @@ static int asf_read_seek(AVFormatContext *s, int 
> stream_index, int64_t pts, int
>  if (!asf->index_read)
>  asf_build_simple_index(s, stream_index);
>  
> -if(!(asf->index_read && st->index_entries)){
> -if(av_seek_frame_binary(s, stream_index, pts, flags)<0)
> -return -1;
> -}else{
> +if((asf->index_read && st->index_entries)){
>  index= av_index_search_timestamp(st, pts, flags);
> -if(index<0)
> -return -1;
> -
> +if(index >= 0) {
>  /* find the position */
>  pos = st->index_entries[index].pos;
>  
>  /* do the seek */
>  av_log(s, AV_LOG_DEBUG, "SEEKTO: %"PRId64"\n", pos);
>  avio_seek(s->pb, pos, SEEK_SET);
> +asf_reset_header(s);
> +return 0;
> +}
>  }
> +/* no index or seeking by index failed */
> +if(av_seek_frame_binary(s, stream_index, pts, flags)<0)
> +return -1;
>  asf_reset_header(s);
>  return 0;
>  }

Tested that testsuite and fate still pass.

Queued.

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


[libav-devel] [PATCH] flvdec: clenup debug code

2011-05-17 Thread Alex Converse
---
 libavformat/flvdec.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index e7ec0b1..6fdbf9b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -387,7 +387,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 size = avio_rb24(s->pb);
 dts = avio_rb24(s->pb);
 dts |= avio_r8(s->pb) << 24;
-//av_log(s, AV_LOG_DEBUG, "type:%d, size:%d, dts:%d\n", type, size, dts);
+av_dlog(s, "type:%d, size:%d, dts:%"PRId64"\n", type, size, dts);
 if (s->pb->eof_reached)
 return AVERROR_EOF;
 avio_skip(s->pb, 3); /* stream id, always 0 */
@@ -433,7 +433,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 st= create_stream(s, is_audio);
 s->ctx_flags &= ~AVFMTCTX_NOHEADER;
 }
-//av_log(s, AV_LOG_DEBUG, "%d %X %d \n", is_audio, flags, st->discard);
+av_dlog(s, "%d %X %d \n", is_audio, flags, st->discard);
 if(  (st->discard >= AVDISCARD_NONKEY && !((flags & 
FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_KEY || is_audio))
||(st->discard >= AVDISCARD_BIDIR  &&  ((flags & 
FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_DISP_INTER && !is_audio))
|| st->discard >= AVDISCARD_ALL
-- 
1.7.3.1

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


[libav-devel] [PATCH] mpegaudio: sanitise compute_antialias_* names

2011-05-17 Thread Mans Rullgard
This makes the compute_antialias functions use the same naming
convention as everything else.

Signed-off-by: Mans Rullgard 
---
 libavcodec/mpegaudiodec.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 77ecb44..4802a04 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -41,7 +41,6 @@
 
 #if CONFIG_FLOAT
 #   define SHR(a,b)   ((a)*(1.0f/(1<<(b
-#   define compute_antialias compute_antialias_float
 #   define FIXR_OLD(a)((int)((a) * FRAC_ONE + 0.5))
 #   define FIXR(x)((float)(x))
 #   define FIXHR(x)   ((float)(x))
@@ -51,7 +50,6 @@
 #   define OUT_FMT AV_SAMPLE_FMT_FLT
 #else
 #   define SHR(a,b)   ((a)>>(b))
-#   define compute_antialias compute_antialias_integer
 /* WARNING: only correct for posititive numbers */
 #   define FIXR_OLD(a)((int)((a) * FRAC_ONE + 0.5))
 #   define FIXR(a)((int)((a) * FRAC_ONE + 0.5))
@@ -69,7 +67,7 @@
 #include "mpegaudiodata.h"
 #include "mpegaudiodectab.h"
 
-static void compute_antialias(MPADecodeContext *s, GranuleDef *g);
+static void RENAME(compute_antialias)(MPADecodeContext *s, GranuleDef *g);
 static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
int *dither_state, OUT_INT *samples, int incr);
 
@@ -1480,8 +1478,7 @@ static void compute_stereo(MPADecodeContext *s,
 }
 
 #if !CONFIG_FLOAT
-static void compute_antialias_integer(MPADecodeContext *s,
-  GranuleDef *g)
+static void compute_antialias_fixed(MPADecodeContext *s, GranuleDef *g)
 {
 int32_t *ptr, *csa;
 int n, i;
@@ -1848,7 +1845,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
 g = &s->granules[ch][gr];
 
 reorder_block(s, g);
-compute_antialias(s, g);
+RENAME(compute_antialias)(s, g);
 compute_imdct(s, g, &s->sb_samples[ch][18 * gr][0], 
s->mdct_buf[ch]);
 }
 } /* gr */
-- 
1.7.4.5

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


Re: [libav-devel] [PATCH 2/2] h264: fix loopfilter with slice-threading enabled.

2011-05-17 Thread Reinhard Tartler
On Tue, May 17, 2011 at 04:44:30PM +0200, Kostya wrote:
> On Thu, May 12, 2011 at 10:13:57PM -0400, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Thu, May 12, 2011 at 8:39 PM, Ronald S. Bultje  
> > wrote:
> > > On Thu, May 12, 2011 at 5:53 PM, Ronald S. Bultje  
> > > wrote:
> > >> If deblock_mode==2, we should deblock slice edges also. This
> > >> can obviously only be done once all slices have finished
> > >> decoding.
> > >> ---
> > >>  libavcodec/h264.c |   23 +--
> > >>  1 files changed, 17 insertions(+), 6 deletions(-)
> > >
> > > Jason just told me I misread the code, so ignore this for now.
> > 
> > This patch works better, I think. Output for test sample at 16
> > slice-threads is now identical to JM and the code remains in-loop.
> > 
> > Ronald
> 
> > From e7b2c6ceab21f47316149e1fde6eecc9cb897d7c Mon Sep 17 00:00:00 2001
> > From: Ronald S. Bultje 
> > Date: Thu, 12 May 2011 21:46:56 -0400
> > Subject: [PATCH] h264: fix loopfilter with threading at slice boundaries.
> > 
> > ---
> >  libavcodec/h264.c |   20 +---
> >  1 files changed, 13 insertions(+), 7 deletions(-)
> 
> ok if tested

Unfortunately, this patch breaks makes my sandy sad:

TESTh264-conformance-hcmp1_hhi_a
--- 
/home/siretart/libav/libav/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a
2011-05-14 14:56:01.292294380 +0200
+++ tests/data/fate/h264-conformance-frext-pph10i4_panasonic_a  
2011-05-17 20:36:05.019580759 +0200
@@ -4,16 +4,16 @@
 0, 10800, 6220800, 0x7459a1cc
 0, 14400, 6220800, 0x02191aa9
 0, 18000, 6220800, 0x88dca590
-0, 21600, 6220800, 0x56dd150a
+0, 21600, 6220800, 0x138c750e
 0, 25200, 6220800, 0x5f56a56f
-0, 28800, 6220800, 0x67ada4b7
+0, 28800, 6220800, 0xe7facfa5
 0, 32400, 6220800, 0x88dca590
-0, 36000, 6220800, 0xd3b09fe5
+0, 36000, 6220800, 0xeacb35ea
 0, 39600, 6220800, 0x2223998c
-0, 43200, 6220800, 0x5e5b2da5
+0, 43200, 6220800, 0x299d5649
 0, 46800, 6220800, 0x88dca590
-0, 50400, 6220800, 0x5e5b2da5
+0, 50400, 6220800, 0x299d5649
 0, 54000, 6220800, 0x88dca590
-0, 57600, 6220800, 0x5e5b2da5
+0, 57600, 6220800, 0x299d5649
 0, 61200, 6220800, 0x88dca590
-0, 64800, 6220800, 0x26e1ec8b
+0, 64800, 6220800, 0xc9bd180d
make: *** [fate-h264-conformance-frext-pph10i4_panasonic_a] Fehler 1
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] asfdec: fix possible overread on broken files.

2011-05-17 Thread Reinhard Tartler
On Thu, May 12, 2011 at 10:20:27AM -0400, Ronald S. Bultje wrote:
> From: Uoti Urpala 
> 
> ---
>  libavformat/asfdec.c |5 -
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index 77c8449..3dc104e 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -852,7 +852,10 @@ static int asf_read_frame_header(AVFormatContext *s, 
> AVIOContext *pb){
>  }
>  if (asf->packet_flags & 0x01) {
>  DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 
> 0 is illegal
> -if(asf->packet_frag_size > asf->packet_size_left - rsize){
> +if (rsize > asf->packet_size_left) {
> +av_log(s, AV_LOG_ERROR, "packet_replic_size is invalid\n");
> +return -1;
> +} else if(asf->packet_frag_size > asf->packet_size_left - rsize){
>  if (asf->packet_frag_size > asf->packet_size_left - rsize + 
> asf->packet_padsize) {
>  av_log(s, AV_LOG_ERROR, "packet_frag_size is invalid 
> (%d-%d)\n", asf->packet_size_left, rsize);
>  return -1;

Tested that testsuite and fate still work

Queued locally

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


[libav-devel] [PATCH] Clean up header #includes in cmdutils.h.

2011-05-17 Thread Diego Biurrun
Do not #include avfilter.h conditionally, #include (just) required headers.
---
 cmdutils.h |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/cmdutils.h b/cmdutils.h
index f97ea80..fef2774 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -22,8 +22,11 @@
 #ifndef LIBAV_CMDUTILS_H
 #define LIBAV_CMDUTILS_H
 
-#include 
+#include 
+#include 
+
 #include "libavcodec/avcodec.h"
+#include "libavfilter/avfilter.h"
 #include "libavformat/avformat.h"
 #include "libswscale/swscale.h"
 
@@ -278,9 +281,6 @@ int64_t guess_correct_pts(PtsCorrectionContext *ctx, 
int64_t pts, int64_t dts);
 FILE *get_preset_file(char *filename, size_t filename_size,
   const char *preset_name, int is_path, const char 
*codec_name);
 
-#if CONFIG_AVFILTER
-#include "libavfilter/avfilter.h"
-
 typedef struct {
 enum PixelFormat pix_fmt;
 } FFSinkContext;
@@ -296,6 +296,4 @@ extern AVFilter ffsink;
 int get_filtered_video_frame(AVFilterContext *sink, AVFrame *frame,
  AVFilterBufferRef **picref, AVRational *pts_tb);
 
-#endif /* CONFIG_AVFILTER */
-
 #endif /* LIBAV_CMDUTILS_H */
-- 
1.7.1

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


Re: [libav-devel] [RFC] Fix asfdec "regression"

2011-05-17 Thread Reinhard Tartler
On Tue, May 17, 2011 at 05:30:05PM +0200, Vladimir Pantelic wrote:
> Uoti Urpala wrote:
> 
> >>  the other one introduces a new
> >> flag that prevents util.c from doing so.
> >
> >But it still calls av_seek_frame_generic(). Is that really any more
> >appropriate, even if it doesn't happen to trigger visible problems now?
> >
> >How many demuxers are there that define their own seek method but do
> >still rely on the general code executing the fallbacks?
> 
> new patch attached that prevents both fallback methods to be used.
> 

> From 3472d798dd62a871b6f82f5697450453b414e83e Mon Sep 17 00:00:00 2001
> From: Vladimir Pantelic 
> Date: Tue, 10 May 2011 14:54:21 +0200
> Subject: [PATCH] fix asf demuxer to not fall back to binary/generic search
> 
> asf_read_seek() inside the asf demuxer already does the
> right thing, it tries the index and if that fails it uses
> binary search. If binary search is called from outside of asfdec.c
> it will fail because the asf code cannot clean up after itself.
> Therefore introduce AVFMT_NOBINSEARCH that prevents the seek
> code to fallback to binary search and AVFMT_NOGENSEARCH that
> prevents the seek code to fallback to generic search.
> ---
>  libavformat/asfdec.c   |1 +
>  libavformat/avformat.h |2 ++
>  libavformat/utils.c|6 --
>  3 files changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
> index f0c746a..e9a3995 100644
> --- a/libavformat/asfdec.c
> +++ b/libavformat/asfdec.c
> @@ -1299,4 +1299,5 @@ AVInputFormat ff_asf_demuxer = {
>  asf_read_close,
>  asf_read_seek,
>  asf_read_pts,
> +.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH,
>  };
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index 7327562..aca246d 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -258,6 +258,8 @@ typedef struct AVFormatParameters {
>  #define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
>  #define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
>  #define AVFMT_NOSTREAMS 0x1000 /**< Format does not require any streams 
> */
> +#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fallback to 
> binary search via read_timestamp */
> +#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fallback to 
> generic search */
>  
>  typedef struct AVOutputFormat {
>  const char *name;
> diff --git a/libavformat/utils.c b/libavformat/utils.c
> index 67aa76a..ad22601 100644
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -1713,10 +1713,12 @@ int av_seek_frame(AVFormatContext *s, int 
> stream_index, int64_t timestamp, int f
>  return 0;
>  }
>  
> -if(s->iformat->read_timestamp)
> +if(s->iformat->read_timestamp && !(s->iformat->flags & 
> AVFMT_NOBINSEARCH))
>  return av_seek_frame_binary(s, stream_index, timestamp, flags);
> -else
> +else if (!(s->iformat->flags & AVFMT_NOGENSEARCH))
>  return av_seek_frame_generic(s, stream_index, timestamp, flags);
> +else
> +return -1;
>  }
>  
>  int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, 
> int64_t ts, int64_t max_ts, int flags)
> -- 

ensured that testsuite and fate still passes, and explanation makes
sense to me.

Queued locally

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


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Luca Barbato

On 5/17/11 7:49 PM, Måns Rullgård wrote:

Yes please, saves 7 characters ("struct ") every time you define/cast
a variable of this type. Imagine that we added "signed int" instead of
"int" every time we declared one.


I'm not buying that argument, and I'll gladly remove the typedef.  I put
it there mostly to please the consistency nazis.


I'm pleased that you helped keep things consistent and short

the patch looks nice btw =)

lu


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


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 01:59:43PM -0400, Ronald S. Bultje wrote:
> 
> On Tue, May 17, 2011 at 1:57 PM, Diego Biurrun  wrote:
> > On Tue, May 17, 2011 at 06:37:58PM +0100, Måns Rullgård wrote:
> >> Diego Biurrun  writes:
> >>
> >> >> --- /dev/null
> >> >> +++ b/libavcodec/mpadsp.h
> >> >> @@ -0,0 +1,63 @@
> >> >> +
> >> >> +#ifndef AVCODEC_MPADSP_H
> >> >> +#define AVCODEC_MPADSP_H
> >> >> +
> >> >> +#include 
> >> >> +
> >> >> +typedef struct MPADSPContext {
> >> >> +    void (*apply_window_float)(float *synth_buf, float *window,
> >> >> +                               int *dither_state, float *samples, int 
> >> >> incr);
> >> >> +    void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
> >> >> +                               int *dither_state, int16_t *samples, 
> >> >> int incr);
> >> >> +    void (*dct32_float)(float *dst, const float *src);
> >> >> +    void (*dct32_fixed)(int *dst, const int *src);
> >> >> +} MPADSPContext;
> >> >
> >> > unrelated comment: Will we keep typedeffing structs forever?
> >>
> >> Somehow I suspect you would have asked me to add the typedef (for
> >> consistency) had I left it out.
> >
> > No.  However, the API breakage season is drawing to a close, so there
> > is not much time left to discuss such questions.
> 
> This is not public API, is it?

The point I was trying to raise here is that some people (here) consider
typedeffing structs ugly.  Some typedeffed structs are part of the public
API.

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


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Måns Rullgård
"Ronald S. Bultje"  writes:

>>> >> +typedef struct MPADSPContext {
>>> >> +    void (*apply_window_float)(float *synth_buf, float *window,
>>> >> +                               int *dither_state, float *samples, int 
>>> >> incr);
>>> >> +    void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
>>> >> +                               int *dither_state, int16_t *samples, int 
>>> >> incr);
>>> >> +    void (*dct32_float)(float *dst, const float *src);
>>> >> +    void (*dct32_fixed)(int *dst, const int *src);
>>> >> +} MPADSPContext;
>>> >
>>> > unrelated comment: Will we keep typedeffing structs forever?
>>>
>>> Somehow I suspect you would have asked me to add the typedef (for
>>> consistency) had I left it out.
>>
>> No.  However, the API breakage season is drawing to a close, so there
>> is not much time left to discuss such questions.
>
> This is not public API, is it?

It is not.

-- 
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/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Ronald S. Bultje
Hi,

On Tue, May 17, 2011 at 1:57 PM, Diego Biurrun  wrote:
> On Tue, May 17, 2011 at 06:37:58PM +0100, Måns Rullgård wrote:
>> Diego Biurrun  writes:
>>
>> > On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
>> >> This separation allows these functions to be used in a cleaner
>> >> fashion from other codecs (e.g. qdm2) and simplifies creating
>> >> optimised versions of them.
>> >> ---
>> >>  17 files changed, 388 insertions(+), 255 deletions(-)
>> >>  create mode 100644 libavcodec/mpadsp.c
>> >>  create mode 100644 libavcodec/mpadsp.h
>> >>  create mode 100644 libavcodec/mpadsp_fixed.c
>> >>  create mode 100644 libavcodec/mpadsp_float.c
>> >>  create mode 100644 libavcodec/mpadsp_template.c
>> >
>> > I find the name mpadsp non-intuitive, I would suggest mpegaudiodsp
>> > instead.
>>
>> That's very long, especially as a base for function names etc.
>
> True.  Maybe I have seen too many "mp" prefixes for my own good in
> MPlayer.  I'm undecided here, but I don't intend to block your patch.
> The filename could use the long name though and fit into our family
> of mpegaudio filenames.
>
>> >> --- /dev/null
>> >> +++ b/libavcodec/mpadsp.h
>> >> @@ -0,0 +1,63 @@
>> >> +
>> >> +#ifndef AVCODEC_MPADSP_H
>> >> +#define AVCODEC_MPADSP_H
>> >> +
>> >> +#include 
>> >> +
>> >> +typedef struct MPADSPContext {
>> >> +    void (*apply_window_float)(float *synth_buf, float *window,
>> >> +                               int *dither_state, float *samples, int 
>> >> incr);
>> >> +    void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
>> >> +                               int *dither_state, int16_t *samples, int 
>> >> incr);
>> >> +    void (*dct32_float)(float *dst, const float *src);
>> >> +    void (*dct32_fixed)(int *dst, const int *src);
>> >> +} MPADSPContext;
>> >
>> > unrelated comment: Will we keep typedeffing structs forever?
>>
>> Somehow I suspect you would have asked me to add the typedef (for
>> consistency) had I left it out.
>
> No.  However, the API breakage season is drawing to a close, so there
> is not much time left to discuss such questions.

This is not public API, is it?

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


Re: [libav-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Alex Converse
2011/5/17 Aℓex Converse :
> On Mon, May 9, 2011 at 2:50 PM, Benjamin Larsson  wrote:
>> Hi, it's time to elect a new board for the FFmtech foundation. If you
>> want to candidate or participate in electing the new board then please
>> respond to this email. To be eligible for this you must fulfil the
>> following.
>>
>> "People who had svn accounts and were active in the last year are
>> allowed to vote, in case of contention the board can decide."
>>
>> (FFmpeg repository svn account. And last year since the meeting on March
>> 19th 2011)
>>
>>
>> The time line for this is 2 weeks for responding that you intend to
>> either candidate or partake in the voting. Then 5 days for the
>> candidates to present them self’s and then 2 days for the election
>> process. If all goes according to plan we will have a new board by the
>> end of May.
>>
>
> I wish to vote, and I nominate myself as a candidate for the board.

(resending from my personal email because my work email tends to get
flagged as spam)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 06:37:58PM +0100, Måns Rullgård wrote:
> Diego Biurrun  writes:
> 
> > On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
> >> This separation allows these functions to be used in a cleaner
> >> fashion from other codecs (e.g. qdm2) and simplifies creating
> >> optimised versions of them.
> >> ---
> >>  17 files changed, 388 insertions(+), 255 deletions(-)
> >>  create mode 100644 libavcodec/mpadsp.c
> >>  create mode 100644 libavcodec/mpadsp.h
> >>  create mode 100644 libavcodec/mpadsp_fixed.c
> >>  create mode 100644 libavcodec/mpadsp_float.c
> >>  create mode 100644 libavcodec/mpadsp_template.c
> >
> > I find the name mpadsp non-intuitive, I would suggest mpegaudiodsp
> > instead.
> 
> That's very long, especially as a base for function names etc.

True.  Maybe I have seen too many "mp" prefixes for my own good in
MPlayer.  I'm undecided here, but I don't intend to block your patch.
The filename could use the long name though and fit into our family
of mpegaudio filenames.

> >> --- /dev/null
> >> +++ b/libavcodec/mpadsp.h
> >> @@ -0,0 +1,63 @@
> >> +
> >> +#ifndef AVCODEC_MPADSP_H
> >> +#define AVCODEC_MPADSP_H
> >> +
> >> +#include 
> >> +
> >> +typedef struct MPADSPContext {
> >> +void (*apply_window_float)(float *synth_buf, float *window,
> >> +   int *dither_state, float *samples, int 
> >> incr);
> >> +void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
> >> +   int *dither_state, int16_t *samples, int 
> >> incr);
> >> +void (*dct32_float)(float *dst, const float *src);
> >> +void (*dct32_fixed)(int *dst, const int *src);
> >> +} MPADSPContext;
> >
> > unrelated comment: Will we keep typedeffing structs forever?
> 
> Somehow I suspect you would have asked me to add the typedef (for
> consistency) had I left it out.

No.  However, the API breakage season is drawing to a close, so there
is not much time left to discuss such questions.

Notice the "unrelated comment" moniker; I clearly labeled my remark as
outside the scope of your patch.

> >> +#endif
> >
> > Please add an #endif comment.
> 
> Why?

Just to do me a favor - thank you.

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


Re: [libav-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Aℓex Converse
On Mon, May 9, 2011 at 2:50 PM, Benjamin Larsson  wrote:
> Hi, it's time to elect a new board for the FFmtech foundation. If you
> want to candidate or participate in electing the new board then please
> respond to this email. To be eligible for this you must fulfil the
> following.
>
> "People who had svn accounts and were active in the last year are
> allowed to vote, in case of contention the board can decide."
>
> (FFmpeg repository svn account. And last year since the meeting on March
> 19th 2011)
>
>
> The time line for this is 2 weeks for responding that you intend to
> either candidate or partake in the voting. Then 5 days for the
> candidates to present them self’s and then 2 days for the election
> process. If all goes according to plan we will have a new board by the
> end of May.
>

I wish to vote, and I nominate myself as a candidate for the board.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Måns Rullgård
"Ronald S. Bultje"  writes:

> Hi,
>
> On Tue, May 17, 2011 at 1:29 PM, Diego Biurrun  wrote:
>> On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
>>> +typedef struct MPADSPContext {
>>> +    void (*apply_window_float)(float *synth_buf, float *window,
>>> +                               int *dither_state, float *samples, int 
>>> incr);
>>> +    void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
>>> +                               int *dither_state, int16_t *samples, int 
>>> incr);
>>> +    void (*dct32_float)(float *dst, const float *src);
>>> +    void (*dct32_fixed)(int *dst, const int *src);
>>> +} MPADSPContext;
>>
>> unrelated comment: Will we keep typedeffing structs forever?
>
> Yes please, saves 7 characters ("struct ") every time you define/cast
> a variable of this type. Imagine that we added "signed int" instead of
> "int" every time we declared one.

I'm not buying that argument, and I'll gladly remove the typedef.  I put
it there mostly to please the consistency nazis.

-- 
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/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Ronald S. Bultje
Hi,

On Tue, May 17, 2011 at 1:29 PM, Diego Biurrun  wrote:
> On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
>> +typedef struct MPADSPContext {
>> +    void (*apply_window_float)(float *synth_buf, float *window,
>> +                               int *dither_state, float *samples, int incr);
>> +    void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
>> +                               int *dither_state, int16_t *samples, int 
>> incr);
>> +    void (*dct32_float)(float *dst, const float *src);
>> +    void (*dct32_fixed)(int *dst, const int *src);
>> +} MPADSPContext;
>
> unrelated comment: Will we keep typedeffing structs forever?

Yes please, saves 7 characters ("struct ") every time you define/cast
a variable of this type. Imagine that we added "signed int" instead of
"int" every time we declared one.

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


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Ronald S. Bultje
Hi,

2011/5/17 Måns Rullgård :
> Diego Biurrun  writes:
>> On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
>>> This separation allows these functions to be used in a cleaner
>>> fashion from other codecs (e.g. qdm2) and simplifies creating
>>> optimised versions of them.
>>> ---
>>>  17 files changed, 388 insertions(+), 255 deletions(-)
>>>  create mode 100644 libavcodec/mpadsp.c
>>>  create mode 100644 libavcodec/mpadsp.h
>>>  create mode 100644 libavcodec/mpadsp_fixed.c
>>>  create mode 100644 libavcodec/mpadsp_float.c
>>>  create mode 100644 libavcodec/mpadsp_template.c
>>
>> I find the name mpadsp non-intuitive, I would suggest mpegaudiodsp
>> instead.
>
> That's very long, especially as a base for function names etc.

We could use mpegaudiodsp.c for filename but mpadsp_*() for
functions/structs. Not that I mind at all whichever way this goes,
just a random idea.

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


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Måns Rullgård
Diego Biurrun  writes:

> On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
>> This separation allows these functions to be used in a cleaner
>> fashion from other codecs (e.g. qdm2) and simplifies creating
>> optimised versions of them.
>> ---
>>  17 files changed, 388 insertions(+), 255 deletions(-)
>>  create mode 100644 libavcodec/mpadsp.c
>>  create mode 100644 libavcodec/mpadsp.h
>>  create mode 100644 libavcodec/mpadsp_fixed.c
>>  create mode 100644 libavcodec/mpadsp_float.c
>>  create mode 100644 libavcodec/mpadsp_template.c
>
> I find the name mpadsp non-intuitive, I would suggest mpegaudiodsp
> instead.

That's very long, especially as a base for function names etc.

> The general idea of the patch LGTM otherwise.
>
>> --- /dev/null
>> +++ b/libavcodec/mpadsp.h
>> @@ -0,0 +1,63 @@
>> +
>> +#ifndef AVCODEC_MPADSP_H
>> +#define AVCODEC_MPADSP_H
>> +
>> +#include 
>> +
>> +typedef struct MPADSPContext {
>> +void (*apply_window_float)(float *synth_buf, float *window,
>> +   int *dither_state, float *samples, int incr);
>> +void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
>> +   int *dither_state, int16_t *samples, int 
>> incr);
>> +void (*dct32_float)(float *dst, const float *src);
>> +void (*dct32_fixed)(int *dst, const int *src);
>> +} MPADSPContext;
>
> unrelated comment: Will we keep typedeffing structs forever?

Somehow I suspect you would have asked me to add the typedef (for
consistency) had I left it out.

>> +#endif
>
> Please add an #endif comment.

Why?

-- 
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/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
> This separation allows these functions to be used in a cleaner
> fashion from other codecs (e.g. qdm2) and simplifies creating
> optimised versions of them.
> ---
>  17 files changed, 388 insertions(+), 255 deletions(-)
>  create mode 100644 libavcodec/mpadsp.c
>  create mode 100644 libavcodec/mpadsp.h
>  create mode 100644 libavcodec/mpadsp_fixed.c
>  create mode 100644 libavcodec/mpadsp_float.c
>  create mode 100644 libavcodec/mpadsp_template.c

I find the name mpadsp non-intuitive, I would suggest mpegaudiodsp
instead.

The general idea of the patch LGTM otherwise.

> --- /dev/null
> +++ b/libavcodec/mpadsp.h
> @@ -0,0 +1,63 @@
> +
> +#ifndef AVCODEC_MPADSP_H
> +#define AVCODEC_MPADSP_H
> +
> +#include 
> +
> +typedef struct MPADSPContext {
> +void (*apply_window_float)(float *synth_buf, float *window,
> +   int *dither_state, float *samples, int incr);
> +void (*apply_window_fixed)(int32_t *synth_buf, int32_t *window,
> +   int *dither_state, int16_t *samples, int 
> incr);
> +void (*dct32_float)(float *dst, const float *src);
> +void (*dct32_fixed)(int *dst, const int *src);
> +} MPADSPContext;

unrelated comment: Will we keep typedeffing structs forever?

> +#endif

Please add an #endif comment.

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


Re: [libav-devel] [RFC] AVOptions

2011-05-17 Thread aviad rozenhek
On Sat, Apr 30, 2011 at 22:35,  wrote:

> Hi,
> there's a number of known problems with AVOptions:
> 1) Current design doesn't allow demuxer or decoder-specific options,
> because private data isn't allocated until
> avcodec_open/av_open_input_stream and after that it's already too late
> to set options.
> 2) Current API is pretty messy and unpleasant to use, have a look at
> cmdutils.c:opt_default() and set_context_defaults() for an example.
> 3) Default value is a double, so no string or binary defaults.
> 4) ???
>
> I've been working on solving that, as it stands in the way of moving
> private options where they belong (and I expect demuxer-private options
> to be useful for my gsoc project).
> Intermediate WIP results can be found in the opts branch in
> git://git.khirnov.net/git/libav
>
> I) As suggested by unused AVOption2, I've replaced default_val by a
> union, thus allowing arbitrary defaults (this breaks FATE for yet
> unknown reasons)
> II) I've introduced a new API, where the options are stored in a
> temporary storage until the open() call. Then they are recursively
> distributed where they belong. This enables using private options like
> this:
> avformat_alloc_context()
> avopt_set() on the above context
> av_open_input_stream() <- options are actually set here, private
> contexts are tried first
>
> Demuxer-private options are already written and appear to work.
>
> Decoder-private options pose a little problem -- options state in
> AVCodecContext is currently inited during avcodec_alloc_context() and
> freed in avcodec_close(). The problem is that e.g. av_find_stream_info()
> opens and closes the codec, so the option context is not there anymore
> when the options are processed and codec is openened again.
> Suggestions welcome.
>
> -strict is also broken atm, since ffmpeg expects to be able to read the
> options back immediately, which isn't possible now.
>
> Comments/tests/fixes very much welcome.
>
> --
> Anton Khirnov
>

I like the idea.
please consider that options are also useful for protocols, like buffer size
in UDP, live=1 in RTMP etc.
currently these options are encoded in the URL itself, which isn't optimal
IMHO.

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


Re: [libav-devel] [PATCH] mpegaudio: add _fixed suffix to some names

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 03:54:46PM +0100, Måns Rullgård wrote:
> Diego Biurrun  writes:
> 
> > On Tue, May 17, 2011 at 02:45:42PM +0100, Mans Rullgard wrote:
> >> This adds a _fixed suffix to the fixed-point versions of things
> >> with both float and fixed-point variants.  This makes it more
> >> consistent with other dual-implementation things, e.g. fft.
> >> 
> >> --- a/libavcodec/mpc.c
> >> +++ b/libavcodec/mpc.c
> >> @@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int 
> >> channels)
> >>  for(i = 0; i < SAMPLES_PER_BAND; i++) {
> >> -ff_mpa_synth_filter(c->synth_buf[ch], 
> >> &(c->synth_buf_offset[ch]),
> >> -ff_mpa_synth_window, &dither_state,
> >> +ff_mpa_synth_filter_fixed(c->synth_buf[ch], 
> >> &(c->synth_buf_offset[ch]),
> >> +ff_mpa_synth_window_fixed, &dither_state,
> >>  samples_ptr, channels,
> >>  c->sb_samples[ch][i]);
> >>  samples_ptr += 32 * channels;
> >> --- a/libavcodec/mpegaudio.h
> >> +++ b/libavcodec/mpegaudio.h
> >> @@ -158,9 +158,9 @@ typedef struct HuffTable {
> >>  
> >>  int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int 
> >> *sample_rate, int *channels, int *frame_size, int *bitrate);
> >> -extern MPA_INT ff_mpa_synth_window[];
> >> -void ff_mpa_synth_init(MPA_INT *window);
> >> -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
> >> +extern MPA_INT ff_mpa_synth_window_fixed[];
> >> +void ff_mpa_synth_init_fixed(MPA_INT *window);
> >> +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int 
> >> *synth_buf_offset,
> >>   MPA_INT *window, int *dither_state,
> >>   OUT_INT *samples, int incr,
> >>   INTFLOAT sb_samples[SBLIMIT]);
> >> --- a/libavcodec/mpegaudiodec.c
> >> +++ b/libavcodec/mpegaudiodec.c
> >> @@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, 
> >> MPA_INT *window,
> >>  #if !CONFIG_FLOAT
> >> -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
> >> +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int 
> >> *synth_buf_offset,
> >>   MPA_INT *window, int *dither_state,
> >>   OUT_INT *samples, int incr,
> >>   INTFLOAT sb_samples[SBLIMIT])
> >> --- a/libavcodec/qdm2.c
> >> +++ b/libavcodec/qdm2.c
> >> @@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, 
> >> int index)
> >>  
> >>  for (i = 0; i < 8; i++) {
> >> -ff_mpa_synth_filter(q->synth_buf[ch], 
> >> &(q->synth_buf_offset[ch]),
> >> -ff_mpa_synth_window, &dither_state,
> >> +ff_mpa_synth_filter_fixed(q->synth_buf[ch], 
> >> &(q->synth_buf_offset[ch]),
> >> +ff_mpa_synth_window_fixed, &dither_state,
> >>  samples_ptr, q->nb_channels,
> >>  q->sb_samples[ch][(8 * index) + i]);
> >>  samples_ptr += 32 * q->nb_channels;
> >
> > This leaves behind messed-up indentation.  I would suggest fixing it in
> > one go.
> 
> I'll be making more changes here shortly and didn't think it worthwhile
> to fix it up between each.  The indentation isn't really wrong, just a
> bit inconsistent.

OK in that case - I just don't want it to be forgotten and left in
this state.

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


Re: [libav-devel] [PATCH 3/3] dct32: Add AVX implementation of 32-point DCT

2011-05-17 Thread Reinhard Tartler
Vitor,

Is it just me? It seems that your latest AVX patches doesn't apply any
longer to current master. Can you please resend them? I'd be happy to
have another look at them!

Thanks

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


Re: [libav-devel] [RFC] AVOptions

2011-05-17 Thread Ronald S. Bultje
Hi,

On Sat, Apr 30, 2011 at 3:35 PM,   wrote:
> Decoder-private options pose a little problem -- options state in
> AVCodecContext is currently inited during avcodec_alloc_context() and
> freed in avcodec_close(). The problem is that e.g. av_find_stream_info()
> opens and closes the codec, so the option context is not there anymore
> when the options are processed and codec is openened again.
> Suggestions welcome.

Can we open the decoder earlier to work around this?

> -strict is also broken atm, since ffmpeg expects to be able to read the
> options back immediately, which isn't possible now.

I'm not quite sure if I understand the problem...

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


Re: [libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Kostya
On Tue, May 17, 2011 at 05:24:24PM +0100, Mans Rullgard wrote:
> This separation allows these functions to be used in a cleaner
> fashion from other codecs (e.g. qdm2) and simplifies creating
> optimised versions of them.
> ---
> This might need some more work before it's ready, but I'd like to get
> some comments before proceeding further.  It depends on some patches
> I've sent previously.
> ---
>  configure |   19 ++-
>  libavcodec/Makefile   |1 +
>  libavcodec/mpadsp.c   |   40 +++
>  libavcodec/mpadsp.h   |   63 ++
>  libavcodec/mpadsp_fixed.c |   20 +++
>  libavcodec/mpadsp_float.c |   20 +++
>  libavcodec/mpadsp_template.c  |  205 
> +
>  libavcodec/mpc.c  |4 +-
>  libavcodec/mpc.h  |1 +
>  libavcodec/mpc7.c |3 +-
>  libavcodec/mpc8.c |3 +-
>  libavcodec/mpegaudio.h|   24 +
>  libavcodec/mpegaudiodec.c |  197 +---
>  libavcodec/mpegaudiodec_float.c   |   19 ---
>  libavcodec/ppc/mpegaudiodec_altivec.c |9 +-
>  libavcodec/qdm2.c |6 +-
>  libavcodec/x86/mpegaudiodec_mmx.c |9 +-
>  17 files changed, 388 insertions(+), 255 deletions(-)
>  create mode 100644 libavcodec/mpadsp.c
>  create mode 100644 libavcodec/mpadsp.h
>  create mode 100644 libavcodec/mpadsp_fixed.c
>  create mode 100644 libavcodec/mpadsp_float.c
>  create mode 100644 libavcodec/mpadsp_template.c

looks ok to me
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [ffmpeg-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Stefano Sabatini
On date Monday 2011-05-09 23:50:49 +0200, Benjamin Larsson encoded:
> Hi, it's time to elect a new board for the FFmtech foundation. If you
> want to candidate or participate in electing the new board then please
> respond to this email. To be eligible for this you must fulfil the
> following.
> 
> "People who had svn accounts and were active in the last year are
> allowed to vote, in case of contention the board can decide."
> 
> (FFmpeg repository svn account. And last year since the meeting on March
> 19th 2011)
> 
> 
> The time line for this is 2 weeks for responding that you intend to
> either candidate or partake in the voting. Then 5 days for the
> candidates to present them self’s and then 2 days for the election
> process. If all goes according to plan we will have a new board by the
> end of May.

I express my will to vote, and I propose myself as candidate for the
board.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH/RFC] Move some mpegaudio functions to new mpadsp subsystem

2011-05-17 Thread Mans Rullgard
This separation allows these functions to be used in a cleaner
fashion from other codecs (e.g. qdm2) and simplifies creating
optimised versions of them.
---
This might need some more work before it's ready, but I'd like to get
some comments before proceeding further.  It depends on some patches
I've sent previously.
---
 configure |   19 ++-
 libavcodec/Makefile   |1 +
 libavcodec/mpadsp.c   |   40 +++
 libavcodec/mpadsp.h   |   63 ++
 libavcodec/mpadsp_fixed.c |   20 +++
 libavcodec/mpadsp_float.c |   20 +++
 libavcodec/mpadsp_template.c  |  205 +
 libavcodec/mpc.c  |4 +-
 libavcodec/mpc.h  |1 +
 libavcodec/mpc7.c |3 +-
 libavcodec/mpc8.c |3 +-
 libavcodec/mpegaudio.h|   24 +
 libavcodec/mpegaudiodec.c |  197 +---
 libavcodec/mpegaudiodec_float.c   |   19 ---
 libavcodec/ppc/mpegaudiodec_altivec.c |9 +-
 libavcodec/qdm2.c |6 +-
 libavcodec/x86/mpegaudiodec_mmx.c |9 +-
 17 files changed, 388 insertions(+), 255 deletions(-)
 create mode 100644 libavcodec/mpadsp.c
 create mode 100644 libavcodec/mpadsp.h
 create mode 100644 libavcodec/mpadsp_fixed.c
 create mode 100644 libavcodec/mpadsp_float.c
 create mode 100644 libavcodec/mpadsp_template.c

diff --git a/configure b/configure
index d6a5d69..3c7a25a 100755
--- a/configure
+++ b/configure
@@ -952,6 +952,7 @@ CONFIG_LIST="
 mdct
 memalign_hack
 mlib
+mpadsp
 network
 nonfree
 pic
@@ -1235,6 +1236,7 @@ symver_if_any="symver_asm_label symver_gnu_asm"
 dct_select="rdft"
 mdct_select="fft"
 rdft_select="fft"
+mpadsp_select="dct"
 
 # decoders / encoders / hardware accelerators
 aac_decoder_select="mdct sinewin"
@@ -1286,11 +1288,16 @@ ljpeg_encoder_select="aandct"
 loco_decoder_select="golomb"
 mjpeg_encoder_select="aandct"
 mlp_decoder_select="mlp_parser"
-mp1float_decoder_select="dct"
-mp2float_decoder_select="dct"
-mp3adufloat_decoder_select="dct"
-mp3float_decoder_select="dct"
-mp3on4float_decoder_select="dct"
+mp1_decoder_select="mpadsp"
+mp2_decoder_select="mpadsp"
+mp3adu_decoder_select="mpadsp"
+mp3_decoder_select="mpadsp"
+mp3on4_decoder_select="mpadsp"
+mp1float_decoder_select="mpadsp"
+mp2float_decoder_select="mpadsp"
+mp3adufloat_decoder_select="mpadsp"
+mp3float_decoder_select="mpadsp"
+mp3on4float_decoder_select="mpadsp"
 mpeg1video_encoder_select="aandct"
 mpeg2video_encoder_select="aandct"
 mpeg4_decoder_select="h263_decoder mpeg4video_parser"
@@ -1315,7 +1322,7 @@ nellymoser_encoder_select="mdct sinewin"
 png_decoder_select="zlib"
 png_encoder_select="zlib"
 qcelp_decoder_select="lsp"
-qdm2_decoder_select="mdct rdft"
+qdm2_decoder_select="mdct rdft mpadsp"
 ra_144_encoder_select="lpc"
 rv10_decoder_select="h263_decoder"
 rv10_encoder_select="h263_encoder"
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fa70216..57dceea 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -40,6 +40,7 @@ OBJS-$(CONFIG_HUFFMAN) += huffman.o
 OBJS-$(CONFIG_LPC) += lpc.o
 OBJS-$(CONFIG_LSP) += lsp.o
 OBJS-$(CONFIG_MDCT)+= mdct_fixed.o mdct_float.o
+OBJS-$(CONFIG_MPADSP)  += mpadsp.o mpadsp_fixed.o 
mpadsp_float.o
 RDFT-OBJS-$(CONFIG_HARDCODED_TABLES)   += sin_tables.o
 OBJS-$(CONFIG_RDFT)+= rdft.o $(RDFT-OBJS-yes)
 OBJS-$(CONFIG_SINEWIN) += sinewin.o
diff --git a/libavcodec/mpadsp.c b/libavcodec/mpadsp.c
new file mode 100644
index 000..849ff94
--- /dev/null
+++ b/libavcodec/mpadsp.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2011 Mans Rullgard
+ *
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "mpadsp.h"
+#include "dct.h"
+#include "dct32.h"
+
+void ff_mpadsp_init(MPADSPContext *s)
+{
+DCTContext dct;
+
+ff_dct_init(&dct, 5, DCT_II);
+
+s->apply_window_float = ff_mpadsp_apply_window_float;
+s->apply_window_fixed = ff_mpadsp_apply_window_fixed;
+
+s->dct32_float = dct.dct32;
+s->dct3

[libav-devel] Fwd: [FFmpeg-devel] [PATCH] provide an input parameter to specify 3d stereo format for mkv/webm 3d videos

2011-05-17 Thread Kirill Gavrilov
Maybe somebody in LibAV list interesting in adding stereoscopic flags
support / discussion?



-- Forwarded message --
From: Kirill Gavrilov 
Date: Sat, May 7, 2011 at 9:44 PM
Subject: Re: [FFmpeg-devel] [PATCH] provide an input parameter to specify 3d
stereo format for mkv/webm 3d videos
To: FFmpeg development discussions and patches 


Hi,

I prepare new patch based on Alok. It read and write stereo mode flag using
metadata tags.
Also it reads combined planes virtual streams and mark them like:
stereo_mode -> left_3
stereo_mode -> right_3

2011/4/26 Reimar Döffinger 

> I think it would be more user-friendly to allow an actual string instead
> of just numbers, also specifying a value that is not supported should at
> least print a warning or even fail.
>
In patch integers were replaced with strings. But the problem is
that names for stereoscopic formats are not standardized
and this is unclear how user should select them (but sure - magic integers
not better)...


if ((tag = av_metadata_get(st->metadata, "stereo_mode", NULL, 0)) ||
>(tag = av_metadata_get( s->metadata, "stereo_mode", NULL, 0)))
> ...
> Will prefer stream metadata but can also use global metadata.
> Of course the proper solution is to implement a way to specify
> per-stream metadata on the command-line.
>
This is ugly but while no way to setup metadata per stream from console -
may be useful.
I'll try to implement per stream metadata setup for ffmpeg but its options
logic is much complicated
and I fear to write something stupid...
---
Kirill Gavrilov,
Software designer.
diff --git a/libavformat/matroska.h b/libavformat/matroska.h
index 0d0d0bc..4895977 100644
--- a/libavformat/matroska.h
+++ b/libavformat/matroska.h
@@ -77,8 +77,13 @@
 #define MATROSKA_ID_TRACKNUMBER 0xD7
 #define MATROSKA_ID_TRACKUID   0x73C5
 #define MATROSKA_ID_TRACKTYPE  0x83
-#define MATROSKA_ID_TRACKAUDIO 0xE1
-#define MATROSKA_ID_TRACKVIDEO 0xE0
+#define MATROSKA_ID_TRACKVIDEO 0xE0
+#define MATROSKA_ID_TRACKAUDIO 0xE1
+#define MATROSKA_ID_TRACKOPERATION 0xE2
+#define MATROSKA_ID_TRACKCOMBINEPLANES 0xE3
+#define MATROSKA_ID_TRACKPLANE 0xE4
+#define MATROSKA_ID_TRACKPLANEUID  0xE5
+#define MATROSKA_ID_TRACKPLANETYPE 0xE6
 #define MATROSKA_ID_CODECID0x86
 #define MATROSKA_ID_CODECPRIVATE 0x63A2
 #define MATROSKA_ID_CODECNAME  0x258688
@@ -111,7 +116,7 @@
 #define MATROSKA_ID_VIDEOPIXELCROPR 0x54DD
 #define MATROSKA_ID_VIDEODISPLAYUNIT 0x54B2
 #define MATROSKA_ID_VIDEOFLAGINTERLACED 0x9A
-#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B9
+#define MATROSKA_ID_VIDEOSTEREOMODE 0x53B8
 #define MATROSKA_ID_VIDEOASPECTRATIO 0x54B3
 #define MATROSKA_ID_VIDEOCOLORSPACE 0x2EB524
 
@@ -218,6 +223,24 @@ typedef enum {
   MATROSKA_TRACK_ENCODING_COMP_HEADERSTRIP = 3,
 } MatroskaTrackEncodingCompAlgo;
 
+typedef enum {
+  MATROSKA_VIDEO_STEREOMODE_MONO   = 0,
+  MATROSKA_VIDEO_STEREOMODE_LEFT_RIGHT = 1,
+  MATROSKA_VIDEO_STEREOMODE_BOTTOM_TOP = 2,
+  MATROSKA_VIDEO_STEREOMODE_TOP_BOTTOM = 3,
+  MATROSKA_VIDEO_STEREOMODE_CHECKERBOARD_RL= 4,
+  MATROSKA_VIDEO_STEREOMODE_CHECKERBOARD_LR= 5,
+  MATROSKA_VIDEO_STEREOMODE_ROW_INTERLEAVED_RL = 6,
+  MATROSKA_VIDEO_STEREOMODE_ROW_INTERLEAVED_LR = 7,
+  MATROSKA_VIDEO_STEREOMODE_COL_INTERLEAVED_RL = 8,
+  MATROSKA_VIDEO_STEREOMODE_COL_INTERLEAVED_LR = 9,
+  MATROSKA_VIDEO_STEREOMODE_ANAGLYPH_CYAN_RED  = 10,
+  MATROSKA_VIDEO_STEREOMODE_RIGHT_LEFT = 11,
+  MATROSKA_VIDEO_STEREOMODE_ANAGLYPH_GREEN_MAG = 12,
+  MATROSKA_VIDEO_STEREOMODE_BOTH_EYES_BLOCK_LR = 13,
+  MATROSKA_VIDEO_STEREOMODE_BOTH_EYES_BLOCK_RL = 14,
+} MatroskaVideoStereoModeType;
+
 /*
  * Matroska Codec IDs, strings
  */
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 55f62b8..012151a 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -112,6 +112,7 @@ typedef struct {
 uint64_t pixel_width;
 uint64_t pixel_height;
 uint64_t fourcc;
+uint64_t stereoMode;
 } MatroskaTrackVideo;
 
 typedef struct {
@@ -132,6 +133,16 @@ typedef struct {
 } MatroskaTrackAudio;
 
 typedef struct {
+uint64_t uid;
+uint64_t type;
+} MatroskaTrackPlane;
+
+typedef struct {
+EbmlList combine_planes;
+/*EbmlList join_blocks;*/
+} MatroskaTrackOperation;
+
+typedef struct {
 uint64_t num;
 uint64_t uid;
 uint64_t type;
@@ -145,6 +156,7 @@ typedef struct {
 uint64_t flag_forced;
 MatroskaTrackVideo video;
 MatroskaTrackAudio audio;
+MatroskaTrackOperation operation;
 EbmlList encodings;
 
 AVStream *stream;
@@ -291,13 +303,13 @@ static EbmlSyntax matroska_track_video[] = {
 { MATROSKA_ID_VIDEOPIXELWIDTH,EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_width) },
 { MATROSKA_ID_VIDEOPIXELHEIGHT,   EBML_UINT, 0, offsetof(MatroskaTrackVideo,pixel_height) },
 { MATROSKA_ID_VIDEOCOLORSPACE,EBML_UINT, 0, offsetof(MatroskaTrackVideo,fourcc) },
+  

[libav-devel] [PATCH] ffserver: Fix a null pointer dereference as a result of the FF_API_MAX_STREAMS cleanup.

2011-05-17 Thread Mike Williams
Added fixes and tweaks suggested by Maksym Veremeyenko [ve...@m1stereo.tv]

Fixed another dereference in the RTSP code. Fixed a warning.

Signed-off-by: Mike Williams 
---
 ffmpeg.c   |5 ++---
 ffserver.c |   21 ++---
 2 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index c99c4de..8905fe8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -626,13 +626,12 @@ static int read_ffserver_streams(AVFormatContext *s, 
const char *filename)
 if (err < 0)
 return err;
 /* copy stream format */
-s->nb_streams = 0;
+s->nb_streams = ic->nb_streams;
+s->streams = av_mallocz(sizeof(AVStream *) * s->nb_streams);
 for(i=0;inb_streams;i++) {
 AVStream *st;
 AVCodec *codec;
 
-s->nb_streams++;
-
 // FIXME: a more elegant solution is needed
 st = av_mallocz(sizeof(AVStream));
 memcpy(st, ic->streams[i], sizeof(AVStream));
diff --git a/ffserver.c b/ffserver.c
index b4613af..b95a854 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2229,11 +2229,11 @@ static int http_prepare_data(HTTPContext *c)
 av_metadata_set2(&c->fmt_ctx.metadata, "copyright", 
c->stream->copyright, 0);
 av_metadata_set2(&c->fmt_ctx.metadata, "title", c->stream->title   
 , 0);
 
+c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * 
c->stream->nb_streams);
+
 for(i=0;istream->nb_streams;i++) {
-AVStream *st;
 AVStream *src;
-st = av_mallocz(sizeof(AVStream));
-c->fmt_ctx.streams[i] = st;
+c->fmt_ctx.streams[i] = av_mallocz(sizeof(AVStream));
 /* if file or feed, then just take streams from FFStream struct */
 if (!c->stream->feed ||
 c->stream->feed == c->stream)
@@ -2241,9 +2241,9 @@ static int http_prepare_data(HTTPContext *c)
 else
 src = c->stream->feed->streams[c->stream->feed_streams[i]];
 
-*st = *src;
-st->priv_data = 0;
-st->codec->frame_number = 0; /* XXX: should be done in
+*(c->fmt_ctx.streams[i]) = *src;
+c->fmt_ctx.streams[i]->priv_data = 0;
+c->fmt_ctx.streams[i]->codec->frame_number = 0; /* XXX: should be 
done in
AVStream, not in codec */
 }
 /* set output format parameters */
@@ -3385,6 +3385,9 @@ static int rtp_new_av_stream(HTTPContext *c,
 if (!st)
 goto fail;
 ctx->nb_streams = 1;
+ctx->streams = av_mallocz(sizeof(AVStream *) * ctx->nb_streams);
+if (!ctx->streams)
+  goto fail;
 ctx->streams[0] = st;
 
 if (!c->stream->feed ||
@@ -3765,11 +3768,7 @@ static void build_feed_streams(void)
 }
 s->oformat = feed->fmt;
 s->nb_streams = feed->nb_streams;
-for(i=0;inb_streams;i++) {
-AVStream *st;
-st = feed->streams[i];
-s->streams[i] = st;
-}
+s->streams = feed->streams;
 av_set_parameters(s, NULL);
 if (av_write_header(s) < 0) {
 http_log("Container doesn't supports the required 
parameters\n");
-- 
1.7.3.4

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


Re: [libav-devel] [PATCH] ffserver: Fix a null pointer dereference as a result of the FF_API_MAX_STREAMS cleanup.

2011-05-17 Thread Mike Williams
On Tue, May 17, 2011 at 11:37 AM, Clément Bœsch  wrote:
>
> On Tue, May 17, 2011 at 05:33:29PM +0200, Clément Bœsch wrote:
> > On Tue, May 17, 2011 at 10:10:15AM -0400, Mike Williams wrote:
> > > Added fixes and tweaks suggested by Maksym Veremeyenko [ve...@m1stereo.tv]
> > >
> > > Signed-off-by: Mike Williams 
> > > ---
> > >  ffmpeg.c   |    5 ++---
> > >  ffserver.c |   18 +++---
> > >  2 files changed, 9 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/ffmpeg.c b/ffmpeg.c
> > > index c99c4de..8905fe8 100644
> > > --- a/ffmpeg.c
> > > +++ b/ffmpeg.c
> > > @@ -626,13 +626,12 @@ static int read_ffserver_streams(AVFormatContext 
> > > *s, const char *filename)
> > >      if (err < 0)
> > >          return err;
> > >      /* copy stream format */
> > > -    s->nb_streams = 0;
> > > +    s->nb_streams = ic->nb_streams;
> > > +    s->streams = av_mallocz(sizeof(AVStream *) * s->nb_streams);
> > >      for(i=0;inb_streams;i++) {
> > >          AVStream *st;
> > >          AVCodec *codec;
> > >
> > > -        s->nb_streams++;
> > > -
> > >          // FIXME: a more elegant solution is needed
> > >          st = av_mallocz(sizeof(AVStream));
> > >          memcpy(st, ic->streams[i], sizeof(AVStream));
> >
> > How is this chunk related to the ffserver crash? Also, you preallocate all
> > the streams but you still keep a per-stream allocation, there is something
> > wrong imho.
> >
>
> Please ignore this non-sense. Still, this seems not enough to fix the crash.

Further testing revealed another null pointer dereference exposed by
the cleanup. I'll post the revised patch soon. Thanks for the input.

>
> --
> Clément B.
> ___
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ffserver: Fix a null pointer dereference as a result of the FF_API_MAX_STREAMS cleanup.

2011-05-17 Thread Clément Bœsch
On Tue, May 17, 2011 at 05:33:29PM +0200, Clément Bœsch wrote:
> On Tue, May 17, 2011 at 10:10:15AM -0400, Mike Williams wrote:
> > Added fixes and tweaks suggested by Maksym Veremeyenko [ve...@m1stereo.tv]
> > 
> > Signed-off-by: Mike Williams 
> > ---
> >  ffmpeg.c   |5 ++---
> >  ffserver.c |   18 +++---
> >  2 files changed, 9 insertions(+), 14 deletions(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index c99c4de..8905fe8 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -626,13 +626,12 @@ static int read_ffserver_streams(AVFormatContext *s, 
> > const char *filename)
> >  if (err < 0)
> >  return err;
> >  /* copy stream format */
> > -s->nb_streams = 0;
> > +s->nb_streams = ic->nb_streams;
> > +s->streams = av_mallocz(sizeof(AVStream *) * s->nb_streams);
> >  for(i=0;inb_streams;i++) {
> >  AVStream *st;
> >  AVCodec *codec;
> >  
> > -s->nb_streams++;
> > -
> >  // FIXME: a more elegant solution is needed
> >  st = av_mallocz(sizeof(AVStream));
> >  memcpy(st, ic->streams[i], sizeof(AVStream));
> 
> How is this chunk related to the ffserver crash? Also, you preallocate all
> the streams but you still keep a per-stream allocation, there is something
> wrong imho.
> 

Please ignore this non-sense. Still, this seems not enough to fix the crash.

-- 
Clément B.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] ffserver: Fix a null pointer dereference as a result of the FF_API_MAX_STREAMS cleanup.

2011-05-17 Thread Clément Bœsch
On Tue, May 17, 2011 at 10:10:15AM -0400, Mike Williams wrote:
> Added fixes and tweaks suggested by Maksym Veremeyenko [ve...@m1stereo.tv]
> 
> Signed-off-by: Mike Williams 
> ---
>  ffmpeg.c   |5 ++---
>  ffserver.c |   18 +++---
>  2 files changed, 9 insertions(+), 14 deletions(-)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index c99c4de..8905fe8 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -626,13 +626,12 @@ static int read_ffserver_streams(AVFormatContext *s, 
> const char *filename)
>  if (err < 0)
>  return err;
>  /* copy stream format */
> -s->nb_streams = 0;
> +s->nb_streams = ic->nb_streams;
> +s->streams = av_mallocz(sizeof(AVStream *) * s->nb_streams);
>  for(i=0;inb_streams;i++) {
>  AVStream *st;
>  AVCodec *codec;
>  
> -s->nb_streams++;
> -
>  // FIXME: a more elegant solution is needed
>  st = av_mallocz(sizeof(AVStream));
>  memcpy(st, ic->streams[i], sizeof(AVStream));

How is this chunk related to the ffserver crash? Also, you preallocate all
the streams but you still keep a per-stream allocation, there is something
wrong imho.

BTW, I'm tracking a crash in that scope of the code, I'm suspecting
something wrong in that place anyway.

About the rest of the patch, I confirm it fixes the ffserver crash in my
case.

Note: maybe sizeof *v insteand of sizeof type would be more appropriated?

-- 
Clément B.


pgp8cwb9Q3XuL.pgp
Description: PGP signature
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [RFC] Fix asfdec "regression"

2011-05-17 Thread Vladimir Pantelic

Uoti Urpala wrote:


  the other one introduces a new
 flag that prevents util.c from doing so.


But it still calls av_seek_frame_generic(). Is that really any more
appropriate, even if it doesn't happen to trigger visible problems now?

How many demuxers are there that define their own seek method but do
still rely on the general code executing the fallbacks?


new patch attached that prevents both fallback methods to be used.

>From 3472d798dd62a871b6f82f5697450453b414e83e Mon Sep 17 00:00:00 2001
From: Vladimir Pantelic 
Date: Tue, 10 May 2011 14:54:21 +0200
Subject: [PATCH] fix asf demuxer to not fall back to binary/generic search

asf_read_seek() inside the asf demuxer already does the
right thing, it tries the index and if that fails it uses
binary search. If binary search is called from outside of asfdec.c
it will fail because the asf code cannot clean up after itself.
Therefore introduce AVFMT_NOBINSEARCH that prevents the seek
code to fallback to binary search and AVFMT_NOGENSEARCH that
prevents the seek code to fallback to generic search.
---
 libavformat/asfdec.c   |1 +
 libavformat/avformat.h |2 ++
 libavformat/utils.c|6 --
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index f0c746a..e9a3995 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1299,4 +1299,5 @@ AVInputFormat ff_asf_demuxer = {
 asf_read_close,
 asf_read_seek,
 asf_read_pts,
+.flags = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH,
 };
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 7327562..aca246d 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -258,6 +258,8 @@ typedef struct AVFormatParameters {
 #define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
 #define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
 #define AVFMT_NOSTREAMS 0x1000 /**< Format does not require any streams */
+#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fallback to binary search via read_timestamp */
+#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fallback to generic search */
 
 typedef struct AVOutputFormat {
 const char *name;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 67aa76a..ad22601 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1713,10 +1713,12 @@ int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int f
 return 0;
 }
 
-if(s->iformat->read_timestamp)
+if(s->iformat->read_timestamp && !(s->iformat->flags & AVFMT_NOBINSEARCH))
 return av_seek_frame_binary(s, stream_index, timestamp, flags);
-else
+else if (!(s->iformat->flags & AVFMT_NOGENSEARCH))
 return av_seek_frame_generic(s, stream_index, timestamp, flags);
+else
+return -1;
 }
 
 int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
-- 
1.6.0.2

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


Re: [libav-devel] [PATCH] Rename some header files that are really templates to _template.c.

2011-05-17 Thread Måns Rullgård
Diego Biurrun  writes:

> This naming scheme is used elsewhere, so it's sensible to be consistent.
> Furthermore this prevents the 'checkheaders' target from getting tripped up.
> ---
>  Makefile|2 -
>  cmdutils_common_opts.h  |   31 ---
>  common_opts_template.c  |   31 +++

This one isn't really a template in the usual sense, so I'd suggest
dropping _template from the name.

>  ffmpeg.c|2 +-
>  ffplay.c|2 +-
>  ffprobe.c   |2 +-
>  ffserver.c  |2 +-
>  libavcodec/bit_depth_template.c |  106 
> +++
>  libavcodec/dsputil_template.c   |2 +-
>  libavcodec/h264dsp_template.c   |2 +-
>  libavcodec/h264idct_template.c  |2 +-
>  libavcodec/h264pred_template.c  |3 +-
>  libavcodec/high_bit_depth.h |  106 
> ---

The rest looks reasonable.

-- 
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] Rename some header files that are really templates to _template.c.

2011-05-17 Thread Diego Biurrun
This naming scheme is used elsewhere, so it's sensible to be consistent.
Furthermore this prevents the 'checkheaders' target from getting tripped up.
---
 Makefile|2 -
 cmdutils_common_opts.h  |   31 ---
 common_opts_template.c  |   31 +++
 ffmpeg.c|2 +-
 ffplay.c|2 +-
 ffprobe.c   |2 +-
 ffserver.c  |2 +-
 libavcodec/bit_depth_template.c |  106 +++
 libavcodec/dsputil_template.c   |2 +-
 libavcodec/h264dsp_template.c   |2 +-
 libavcodec/h264idct_template.c  |2 +-
 libavcodec/h264pred_template.c  |3 +-
 libavcodec/high_bit_depth.h |  106 ---
 13 files changed, 146 insertions(+), 147 deletions(-)
 delete mode 100644 cmdutils_common_opts.h
 create mode 100644 common_opts_template.c
 create mode 100644 libavcodec/bit_depth_template.c
 delete mode 100644 libavcodec/high_bit_depth.h

diff --git a/Makefile b/Makefile
index d69004b..46bf00e 100644
--- a/Makefile
+++ b/Makefile
@@ -33,8 +33,6 @@ FFLIBS := avutil
 
 DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset)
 
-SKIPHEADERS = cmdutils_common_opts.h
-
 include common.mak
 
 FF_LDFLAGS   := $(FFLDFLAGS)
diff --git a/cmdutils_common_opts.h b/cmdutils_common_opts.h
deleted file mode 100644
index 20ac0fa..000
--- a/cmdutils_common_opts.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
-{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
-{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
-{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
-{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
-{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
-{ "formats"  , OPT_EXIT, {(void*)show_formats  }, "show available formats" 
},
-{ "codecs"   , OPT_EXIT, {(void*)show_codecs   }, "show available codecs" 
},
-{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit 
stream filters" },
-{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available 
protocols" },
-{ "filters",   OPT_EXIT, {(void*)show_filters  }, "show available filters" 
},
-{ "pix_fmts" , OPT_EXIT, {(void*)show_pix_fmts }, "show available pixel 
formats" },
-{ "loglevel", HAS_ARG | OPT_FUNC2, {(void*)opt_loglevel}, "set libav* 
logging level", "loglevel" },
diff --git a/common_opts_template.c b/common_opts_template.c
new file mode 100644
index 000..20ac0fa
--- /dev/null
+++ b/common_opts_template.c
@@ -0,0 +1,31 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+{ "L", OPT_EXIT, {(void*)show_license}, "show license" },
+{ "h", OPT_EXIT, {(void*)show_help}, "show help" },
+{ "?", OPT_EXIT, {(void*)show_help}, "show help" },
+{ "help", OPT_EXIT, {(void*)show_help}, "show help" },
+{ "-help", OPT_EXIT, {(void*)show_help}, "show help" },
+{ "version", OPT_EXIT, {(void*)show_version}, "show version" },
+{ "formats"  , OPT_EXIT, {(void*)show_formats  }, "show available formats" 
},
+{ "codecs"   , OPT_EXIT, {(void*)show_codecs   }, "show available codecs" 
},
+{ "bsfs" , OPT_EXIT, {(void*)show_bsfs }, "show available bit 
stream filters" },
+{ "protocols", OPT_EXIT, {(void*)show_protocols}, "show available 
protocols" },
+{ "filters",   OPT_EXIT, {(void*)show_filters  }, "show available

Re: [libav-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Vladimir Pantelic

Benjamin Larsson wrote:

Hi, it's time to elect a new board for the FFmtech foundation. If you
want to candidate or participate in electing the new board then please
respond to this email. To be eligible for this you must fulfil the
following.


herewith I respond to this email.

Regards,

Vladimir




"People who had svn accounts and were active in the last year are
allowed to vote, in case of contention the board can decide."

(FFmpeg repository svn account. And last year since the meeting on March
19th 2011)


The time line for this is 2 weeks for responding that you intend to
either candidate or partake in the voting. Then 5 days for the
candidates to present them self’s and then 2 days for the election
process. If all goes according to plan we will have a new board by the
end of May.


MvH
Benjamin Larsson
Current president of the FFmtech foundation
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


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


[libav-devel] [PATCH] multiple inclusion guard cleanup

2011-05-17 Thread Diego Biurrun
Add missing multiple inclusion guards; clean up #endif comments;
add missing library prefixes; keep guard names consistent.
---
 cmdutils.h |6 +++---
 ffserver.h |7 ---
 libavcodec/aac_tablegen.h  |6 +++---
 libavcodec/aac_tablegen_decl.h |6 +++---
 libavcodec/amrwbdata.h |2 +-
 libavcodec/arm/asm-offsets.h   |2 +-
 libavcodec/arm/dsputil_arm.h   |2 +-
 libavcodec/arm/mpegvideo_arm.h |2 +-
 libavcodec/arm/vp56_arith.h|2 +-
 libavcodec/arm/vp8.h   |2 +-
 libavcodec/cavsdsp.h   |2 +-
 libavcodec/cbrt_tablegen.h |6 +++---
 libavcodec/cga_data.h  |2 +-
 libavcodec/dct.h   |2 +-
 libavcodec/dctref.h|2 +-
 libavcodec/dv_tablegen.h   |6 +++---
 libavcodec/flv.h   |3 +--
 libavcodec/gsmdec_data.h   |6 +++---
 libavcodec/h263.h  |3 ++-
 libavcodec/kbdwin.h|2 +-
 libavcodec/motionpixels_tablegen.h |6 +++---
 libavcodec/mpeg4video.h|2 +-
 libavcodec/mpegaudio_tablegen.h|6 +++---
 libavcodec/msgsmdec.h  |6 +++---
 libavcodec/nellymoser.h|2 +-
 libavcodec/opt.h   |2 +-
 libavcodec/pcm_tablegen.h  |6 +++---
 libavcodec/qdm2_tablegen.h |6 +++---
 libavcodec/rdft.h  |2 +-
 libavcodec/sh4/dsputil_sh4.h   |2 +-
 libavcodec/sinewin.h   |2 +-
 libavcodec/sinewin_tablegen.h  |5 +
 libavcodec/sparc/dsputil_vis.h |2 +-
 libavcodec/targa.h |5 +
 libavcodec/vp8.h   |2 +-
 libavcodec/vp8data.h   |2 +-
 libavcodec/x86/fft.h   |2 +-
 libavcodec/xvmc_internal.h |6 +++---
 libavfilter/avfilter.h |2 +-
 libavfilter/avfiltergraph.h|2 +-
 libavfilter/internal.h |2 +-
 libavfilter/vsrc_buffer.h  |4 
 libavformat/avio_internal.h|2 +-
 libavformat/ffmeta.h   |6 +++---
 libavformat/mms.h  |3 ++-
 libavformat/spdif.h|5 +
 libavformat/url.h  |2 +-
 libavformat/version.h  |2 +-
 libavutil/avassert.h   |2 +-
 libavutil/cpu.h|2 +-
 50 files changed, 96 insertions(+), 75 deletions(-)

diff --git a/cmdutils.h b/cmdutils.h
index bb8d779..f97ea80 100644
--- a/cmdutils.h
+++ b/cmdutils.h
@@ -19,8 +19,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef FFMPEG_CMDUTILS_H
-#define FFMPEG_CMDUTILS_H
+#ifndef LIBAV_CMDUTILS_H
+#define LIBAV_CMDUTILS_H
 
 #include 
 #include "libavcodec/avcodec.h"
@@ -298,4 +298,4 @@ int get_filtered_video_frame(AVFilterContext *sink, AVFrame 
*frame,
 
 #endif /* CONFIG_AVFILTER */
 
-#endif /* FFMPEG_CMDUTILS_H */
+#endif /* LIBAV_CMDUTILS_H */
diff --git a/ffserver.h b/ffserver.h
index 868b83b..43bc79c 100644
--- a/ffserver.h
+++ b/ffserver.h
@@ -18,11 +18,12 @@
  * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#ifndef FFMPEG_FFSERVER_H
-#define FFMPEG_FFSERVER_H
+
+#ifndef LIBAV_FFSERVER_H
+#define LIBAV_FFSERVER_H
 
 /* interface between ffserver and modules */
 
 void ffserver_module_init(void);
 
-#endif /* FFMPEG_FFSERVER_H */
+#endif /* LIBAV_FFSERVER_H */
diff --git a/libavcodec/aac_tablegen.h b/libavcodec/aac_tablegen.h
index 9889569..4486e1a 100644
--- a/libavcodec/aac_tablegen.h
+++ b/libavcodec/aac_tablegen.h
@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AAC_TABLEGEN_H
-#define AAC_TABLEGEN_H
+#ifndef AVCODEC_AAC_TABLEGEN_H
+#define AVCODEC_AAC_TABLEGEN_H
 
 #include "aac_tablegen_decl.h"
 
@@ -40,4 +40,4 @@ void ff_aac_tableinit(void)
 }
 #endif /* CONFIG_HARDCODED_TABLES */
 
-#endif /* AAC_TABLEGEN_H */
+#endif /* AVCODEC_AAC_TABLEGEN_H */
diff --git a/libavcodec/aac_tablegen_decl.h b/libavcodec/aac_tablegen_decl.h
index ce4ecb5..496ca0c 100644
--- a/libavcodec/aac_tablegen_decl.h
+++ b/libavcodec/aac_tablegen_decl.h
@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifndef AAC_TABLEGEN_DECL_H
-#define AAC_TABLEGEN_DECL_H
+#ifndef AVCODEC_AAC_TABLEGEN_DECL_H
+#define AVCODEC_AAC_TABLEGEN_DECL_H
 
 #if CONFIG_HARDCODED_TABLES
 #define ff_aac_tableinit()
@@ -31,4 +31,4 @@ void ff_aac_tableinit(void);
 extern   float ff_aac_pow2sf_tab[428];
 #endif /* CONFIG_HARDCODED_TABLES */
 
-#endif /* AAC_TABLEGEN_DECL_H */
+#endif /* AVCODEC_AAC_TABLEGEN_DECL_H */
diff --git a/libavcodec/amrwbdata.h b/libavcodec/amrwbdata.h
index f4db99e..5421c23 100644
--- a/libavcodec/amrwbdata

Re: [libav-devel] [PATCH] mpegaudio: add _fixed suffix to some names

2011-05-17 Thread Måns Rullgård
Diego Biurrun  writes:

> On Tue, May 17, 2011 at 02:45:42PM +0100, Mans Rullgard wrote:
>> This adds a _fixed suffix to the fixed-point versions of things
>> with both float and fixed-point variants.  This makes it more
>> consistent with other dual-implementation things, e.g. fft.
>> 
>> --- a/libavcodec/mpc.c
>> +++ b/libavcodec/mpc.c
>> @@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int 
>> channels)
>>  for(i = 0; i < SAMPLES_PER_BAND; i++) {
>> -ff_mpa_synth_filter(c->synth_buf[ch], 
>> &(c->synth_buf_offset[ch]),
>> -ff_mpa_synth_window, &dither_state,
>> +ff_mpa_synth_filter_fixed(c->synth_buf[ch], 
>> &(c->synth_buf_offset[ch]),
>> +ff_mpa_synth_window_fixed, &dither_state,
>>  samples_ptr, channels,
>>  c->sb_samples[ch][i]);
>>  samples_ptr += 32 * channels;
>> --- a/libavcodec/mpegaudio.h
>> +++ b/libavcodec/mpegaudio.h
>> @@ -158,9 +158,9 @@ typedef struct HuffTable {
>>  
>>  int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int 
>> *sample_rate, int *channels, int *frame_size, int *bitrate);
>> -extern MPA_INT ff_mpa_synth_window[];
>> -void ff_mpa_synth_init(MPA_INT *window);
>> -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
>> +extern MPA_INT ff_mpa_synth_window_fixed[];
>> +void ff_mpa_synth_init_fixed(MPA_INT *window);
>> +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int 
>> *synth_buf_offset,
>>   MPA_INT *window, int *dither_state,
>>   OUT_INT *samples, int incr,
>>   INTFLOAT sb_samples[SBLIMIT]);
>> --- a/libavcodec/mpegaudiodec.c
>> +++ b/libavcodec/mpegaudiodec.c
>> @@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, 
>> MPA_INT *window,
>>  #if !CONFIG_FLOAT
>> -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
>> +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int 
>> *synth_buf_offset,
>>   MPA_INT *window, int *dither_state,
>>   OUT_INT *samples, int incr,
>>   INTFLOAT sb_samples[SBLIMIT])
>> --- a/libavcodec/qdm2.c
>> +++ b/libavcodec/qdm2.c
>> @@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, int 
>> index)
>>  
>>  for (i = 0; i < 8; i++) {
>> -ff_mpa_synth_filter(q->synth_buf[ch], 
>> &(q->synth_buf_offset[ch]),
>> -ff_mpa_synth_window, &dither_state,
>> +ff_mpa_synth_filter_fixed(q->synth_buf[ch], 
>> &(q->synth_buf_offset[ch]),
>> +ff_mpa_synth_window_fixed, &dither_state,
>>  samples_ptr, q->nb_channels,
>>  q->sb_samples[ch][(8 * index) + i]);
>>  samples_ptr += 32 * q->nb_channels;
>
> This leaves behind messed-up indentation.  I would suggest fixing it in
> one go.

I'll be making more changes here shortly and didn't think it worthwhile
to fix it up between each.  The indentation isn't really wrong, just a
bit inconsistent.

-- 
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/2] h264: copy pixel_shift between slice threading contexts.

2011-05-17 Thread Kostya
On Tue, May 17, 2011 at 10:26:30AM -0400, Ronald S. Bultje wrote:
> Fixes "make THREADS=2 THREAD_TYPE=2
> fate-h264-conformance-frext-pph10i3_panasonic_a".
> ---
>  libavcodec/h264.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index 46fd93d..4613287 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -1965,6 +1965,7 @@ static int decode_slice_header(H264Context *h, 
> H264Context *h0){
>  c->h264dsp = h->h264dsp;
>  c->sps = h->sps;
>  c->pps = h->pps;
> +c->pixel_shift = h->pixel_shift;
>  init_scan_tables(c);
>  clone_tables(c, h, i);
>  }
> -- 

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


Re: [libav-devel] [PATCH 1/2] mpeg12: add slice-threading checks to slice-threading initializers.

2011-05-17 Thread Kostya
On Tue, May 17, 2011 at 10:26:29AM -0400, Ronald S. Bultje wrote:
> Fixes "make THREADS=2 THREAD_TYPE=1 fate-mpeg2-field-enc".
> ---
>  libavcodec/mpeg12.c |6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
> index ffe6b94..3cc1f60 100644
> --- a/libavcodec/mpeg12.c
> +++ b/libavcodec/mpeg12.c
> @@ -2262,7 +2262,7 @@ static int decode_chunks(AVCodecContext *avctx,
>  buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
>  if (start_code > 0x1ff){
>  if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= 
> AVDISCARD_DEFAULT){
> -if(avctx->thread_count > 1){
> +if(avctx->active_thread_type & FF_THREAD_SLICE && 
> avctx->thread_count > 1){

probably ok but please add parentheses for readability (it's too easy to
confuse & and && here)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 2/2] h264: fix loopfilter with slice-threading enabled.

2011-05-17 Thread Kostya
On Thu, May 12, 2011 at 10:13:57PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Thu, May 12, 2011 at 8:39 PM, Ronald S. Bultje  wrote:
> > On Thu, May 12, 2011 at 5:53 PM, Ronald S. Bultje  
> > wrote:
> >> If deblock_mode==2, we should deblock slice edges also. This
> >> can obviously only be done once all slices have finished
> >> decoding.
> >> ---
> >>  libavcodec/h264.c |   23 +--
> >>  1 files changed, 17 insertions(+), 6 deletions(-)
> >
> > Jason just told me I misread the code, so ignore this for now.
> 
> This patch works better, I think. Output for test sample at 16
> slice-threads is now identical to JM and the code remains in-loop.
> 
> Ronald

> From e7b2c6ceab21f47316149e1fde6eecc9cb897d7c Mon Sep 17 00:00:00 2001
> From: Ronald S. Bultje 
> Date: Thu, 12 May 2011 21:46:56 -0400
> Subject: [PATCH] h264: fix loopfilter with threading at slice boundaries.
> 
> ---
>  libavcodec/h264.c |   20 +---
>  1 files changed, 13 insertions(+), 7 deletions(-)

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


Re: [libav-devel] [PATCH 1/2] mdec.c: fix overread.

2011-05-17 Thread Kostya
On Tue, May 10, 2011 at 11:29:08AM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/mdec.c |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
> index 545b919..9b6e6b6 100644
> --- a/libavcodec/mdec.c
> +++ b/libavcodec/mdec.c
> @@ -125,7 +125,8 @@ static inline int decode_mb(MDECContext *a, DCTELEM 
> block[6][64]){
>  a->dsp.clear_blocks(block[0]);
>  
>  for(i=0; i<6; i++){
> -if( mdec_decode_block_intra(a, block[ block_index[i] ], 
> block_index[i]) < 0)
> +if( mdec_decode_block_intra(a, block[ block_index[i] ], 
> block_index[i]) < 0 ||
> +get_bits_left(&a->gb) < 0)
>  return -1;
>  }
>  return 0;
> -- 

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


[libav-devel] [PATCH 2/2] h264: copy pixel_shift between slice threading contexts.

2011-05-17 Thread Ronald S. Bultje
Fixes "make THREADS=2 THREAD_TYPE=2
fate-h264-conformance-frext-pph10i3_panasonic_a".
---
 libavcodec/h264.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 46fd93d..4613287 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1965,6 +1965,7 @@ static int decode_slice_header(H264Context *h, 
H264Context *h0){
 c->h264dsp = h->h264dsp;
 c->sps = h->sps;
 c->pps = h->pps;
+c->pixel_shift = h->pixel_shift;
 init_scan_tables(c);
 clone_tables(c, h, i);
 }
-- 
1.7.4.4

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


[libav-devel] [PATCH 1/2] mpeg12: add slice-threading checks to slice-threading initializers.

2011-05-17 Thread Ronald S. Bultje
Fixes "make THREADS=2 THREAD_TYPE=1 fate-mpeg2-field-enc".
---
 libavcodec/mpeg12.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index ffe6b94..3cc1f60 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2262,7 +2262,7 @@ static int decode_chunks(AVCodecContext *avctx,
 buf_ptr = ff_find_start_code(buf_ptr,buf_end, &start_code);
 if (start_code > 0x1ff){
 if(s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= 
AVDISCARD_DEFAULT){
-if(avctx->thread_count > 1){
+if(avctx->active_thread_type & FF_THREAD_SLICE && 
avctx->thread_count > 1){
 int i;
 
 avctx->execute(avctx, slice_decode_thread,  
&s2->thread_context[0], NULL, s->slice_count, sizeof(void*));
@@ -2430,7 +2430,7 @@ static int decode_chunks(AVCodecContext *avctx,
 break;
 }
 
-if(avctx->thread_count > 1){
+if(avctx->active_thread_type & FF_THREAD_SLICE && 
avctx->thread_count > 1){
 int threshold= (s2->mb_height*s->slice_count + 
avctx->thread_count/2) / avctx->thread_count;
 if(threshold <= mb_y){
 MpegEncContext *thread_context= 
s2->thread_context[s->slice_count];
@@ -2541,7 +2541,7 @@ AVCodec ff_mpegvideo_decoder = {
 
 #if CONFIG_MPEG_XVMC_DECODER
 static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){
-if( avctx->thread_count > 1)
+if( avctx->active_thread_type & FF_THREAD_SLICE && avctx->thread_count > 1)
 return -1;
 if( !(avctx->slice_flags & SLICE_FLAG_CODED_ORDER) )
 return -1;
-- 
1.7.4.4

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


[libav-devel] [PATCH] ffserver: Fix a null pointer dereference as a result of the FF_API_MAX_STREAMS cleanup.

2011-05-17 Thread Mike Williams
Added fixes and tweaks suggested by Maksym Veremeyenko [ve...@m1stereo.tv]

Signed-off-by: Mike Williams 
---
 ffmpeg.c   |5 ++---
 ffserver.c |   18 +++---
 2 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index c99c4de..8905fe8 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -626,13 +626,12 @@ static int read_ffserver_streams(AVFormatContext *s, 
const char *filename)
 if (err < 0)
 return err;
 /* copy stream format */
-s->nb_streams = 0;
+s->nb_streams = ic->nb_streams;
+s->streams = av_mallocz(sizeof(AVStream *) * s->nb_streams);
 for(i=0;inb_streams;i++) {
 AVStream *st;
 AVCodec *codec;
 
-s->nb_streams++;
-
 // FIXME: a more elegant solution is needed
 st = av_mallocz(sizeof(AVStream));
 memcpy(st, ic->streams[i], sizeof(AVStream));
diff --git a/ffserver.c b/ffserver.c
index b4613af..fd22f11 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2229,11 +2229,11 @@ static int http_prepare_data(HTTPContext *c)
 av_metadata_set2(&c->fmt_ctx.metadata, "copyright", 
c->stream->copyright, 0);
 av_metadata_set2(&c->fmt_ctx.metadata, "title", c->stream->title   
 , 0);
 
+c->fmt_ctx.streams = av_mallocz(sizeof(AVStream *) * 
c->stream->nb_streams);
+
 for(i=0;istream->nb_streams;i++) {
-AVStream *st;
+c->fmt_ctx.streams[i] = av_mallocz(sizeof(AVStream));
 AVStream *src;
-st = av_mallocz(sizeof(AVStream));
-c->fmt_ctx.streams[i] = st;
 /* if file or feed, then just take streams from FFStream struct */
 if (!c->stream->feed ||
 c->stream->feed == c->stream)
@@ -2241,9 +2241,9 @@ static int http_prepare_data(HTTPContext *c)
 else
 src = c->stream->feed->streams[c->stream->feed_streams[i]];
 
-*st = *src;
-st->priv_data = 0;
-st->codec->frame_number = 0; /* XXX: should be done in
+*(c->fmt_ctx.streams[i]) = *src;
+c->fmt_ctx.streams[i]->priv_data = 0;
+c->fmt_ctx.streams[i]->codec->frame_number = 0; /* XXX: should be 
done in
AVStream, not in codec */
 }
 /* set output format parameters */
@@ -3765,11 +3765,7 @@ static void build_feed_streams(void)
 }
 s->oformat = feed->fmt;
 s->nb_streams = feed->nb_streams;
-for(i=0;inb_streams;i++) {
-AVStream *st;
-st = feed->streams[i];
-s->streams[i] = st;
-}
+s->streams = feed->streams;
 av_set_parameters(s, NULL);
 if (av_write_header(s) < 0) {
 http_log("Container doesn't supports the required 
parameters\n");
-- 
1.7.3.4

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


Re: [libav-devel] [PATCH 2/2] mdec: enable frame-level multithreading.

2011-05-17 Thread Kostya
On Tue, May 10, 2011 at 11:29:09AM -0400, Ronald S. Bultje wrote:
> From: Alexander Strange 
> 
> Signed-off-by: Ronald S. Bultje 
> ---
>  libavcodec/mdec.c |   20 +---
>  1 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
> index 9b6e6b6..17671cf 100644
> --- a/libavcodec/mdec.c
> +++ b/libavcodec/mdec.c
> @@ -31,6 +31,7 @@
>  #include "dsputil.h"
>  #include "mpegvideo.h"
>  #include "mpeg12.h"
> +#include "thread.h"
>  
>  typedef struct MDECContext{
>  AVCodecContext *avctx;
> @@ -163,10 +164,10 @@ static int decode_frame(AVCodecContext *avctx,
>  int i;
>  
>  if(p->data[0])
> -avctx->release_buffer(avctx, p);
> +ff_thread_release_buffer(avctx, p);
>  
>  p->reference= 0;
> -if(avctx->get_buffer(avctx, p) < 0){
> +if(ff_thread_get_buffer(avctx, p) < 0){
>  av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
>  return -1;
>  }
> @@ -239,6 +240,18 @@ static av_cold int decode_init(AVCodecContext *avctx){
>  return 0;
>  }
>  
> +static av_cold int decode_init_thread_copy(AVCodecContext *avctx){
> +MDECContext * const a = avctx->priv_data;
> +AVFrame *p = (AVFrame*)&a->picture;
> +
> +avctx->coded_frame= p;
> +a->avctx= avctx;
> +
> +p->qscale_table= av_mallocz( a->mb_width);
> +
> +return 0;
> +}
> +
>  static av_cold int decode_end(AVCodecContext *avctx){
>  MDECContext * const a = avctx->priv_data;
>  
> @@ -260,7 +273,8 @@ AVCodec ff_mdec_decoder = {
>  NULL,
>  decode_end,
>  decode_frame,
> -CODEC_CAP_DR1,
> +CODEC_CAP_DR1 | CODEC_CAP_FRAME_THREADS,
>  .long_name= NULL_IF_CONFIG_SMALL("Sony PlayStation MDEC (Motion 
> DECoder)"),
> +.init_thread_copy= ONLY_IF_THREADS_ENABLED(decode_init_thread_copy)
>  };
>  
> -- 

looks ok except for idiotic "var= val;" assignment style (and yes, "I've
copied it from elsewhere" argument is too old that it stinks)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] mpegaudio: add _fixed suffix to some names

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 02:45:42PM +0100, Mans Rullgard wrote:
> This adds a _fixed suffix to the fixed-point versions of things
> with both float and fixed-point variants.  This makes it more
> consistent with other dual-implementation things, e.g. fft.
> 
> --- a/libavcodec/mpc.c
> +++ b/libavcodec/mpc.c
> @@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int 
> channels)
>  for(i = 0; i < SAMPLES_PER_BAND; i++) {
> -ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
> -ff_mpa_synth_window, &dither_state,
> +ff_mpa_synth_filter_fixed(c->synth_buf[ch], 
> &(c->synth_buf_offset[ch]),
> +ff_mpa_synth_window_fixed, &dither_state,
>  samples_ptr, channels,
>  c->sb_samples[ch][i]);
>  samples_ptr += 32 * channels;
> --- a/libavcodec/mpegaudio.h
> +++ b/libavcodec/mpegaudio.h
> @@ -158,9 +158,9 @@ typedef struct HuffTable {
>  
>  int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int 
> *sample_rate, int *channels, int *frame_size, int *bitrate);
> -extern MPA_INT ff_mpa_synth_window[];
> -void ff_mpa_synth_init(MPA_INT *window);
> -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
> +extern MPA_INT ff_mpa_synth_window_fixed[];
> +void ff_mpa_synth_init_fixed(MPA_INT *window);
> +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
>   MPA_INT *window, int *dither_state,
>   OUT_INT *samples, int incr,
>   INTFLOAT sb_samples[SBLIMIT]);
> --- a/libavcodec/mpegaudiodec.c
> +++ b/libavcodec/mpegaudiodec.c
> @@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, 
> MPA_INT *window,
>  #if !CONFIG_FLOAT
> -void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
> +void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
>   MPA_INT *window, int *dither_state,
>   OUT_INT *samples, int incr,
>   INTFLOAT sb_samples[SBLIMIT])
> --- a/libavcodec/qdm2.c
> +++ b/libavcodec/qdm2.c
> @@ -1616,8 +1616,8 @@ static void qdm2_synthesis_filter (QDM2Context *q, int 
> index)
>  
>  for (i = 0; i < 8; i++) {
> -ff_mpa_synth_filter(q->synth_buf[ch], &(q->synth_buf_offset[ch]),
> -ff_mpa_synth_window, &dither_state,
> +ff_mpa_synth_filter_fixed(q->synth_buf[ch], 
> &(q->synth_buf_offset[ch]),
> +ff_mpa_synth_window_fixed, &dither_state,
>  samples_ptr, q->nb_channels,
>  q->sb_samples[ch][(8 * index) + i]);
>  samples_ptr += 32 * q->nb_channels;

This leaves behind messed-up indentation.  I would suggest fixing it in
one go.

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


[libav-devel] [PATCH] mpegaudio: add _fixed suffix to some names

2011-05-17 Thread Mans Rullgard
This adds a _fixed suffix to the fixed-point versions of things
with both float and fixed-point variants.  This makes it more
consistent with other dual-implementation things, e.g. fft.

Signed-off-by: Mans Rullgard 
---
 libavcodec/mpc.c|6 +++---
 libavcodec/mpegaudio.h  |6 +++---
 libavcodec/mpegaudio_tablegen.c |4 ++--
 libavcodec/mpegaudio_tablegen.h |8 
 libavcodec/mpegaudiodec.c   |4 ++--
 libavcodec/qdm2.c   |6 +++---
 6 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c
index 36e0f04..15febef 100644
--- a/libavcodec/mpc.c
+++ b/libavcodec/mpc.c
@@ -36,7 +36,7 @@
 
 void ff_mpc_init(void)
 {
-ff_mpa_synth_init(ff_mpa_synth_window);
+ff_mpa_synth_init_fixed(ff_mpa_synth_window_fixed);
 }
 
 /**
@@ -51,8 +51,8 @@ static void mpc_synth(MPCContext *c, int16_t *out, int 
channels)
 for(ch = 0;  ch < channels; ch++){
 samples_ptr = samples + ch;
 for(i = 0; i < SAMPLES_PER_BAND; i++) {
-ff_mpa_synth_filter(c->synth_buf[ch], &(c->synth_buf_offset[ch]),
-ff_mpa_synth_window, &dither_state,
+ff_mpa_synth_filter_fixed(c->synth_buf[ch], 
&(c->synth_buf_offset[ch]),
+ff_mpa_synth_window_fixed, &dither_state,
 samples_ptr, channels,
 c->sb_samples[ch][i]);
 samples_ptr += 32 * channels;
diff --git a/libavcodec/mpegaudio.h b/libavcodec/mpegaudio.h
index 2c3f2ec..3422b6d 100644
--- a/libavcodec/mpegaudio.h
+++ b/libavcodec/mpegaudio.h
@@ -158,9 +158,9 @@ typedef struct HuffTable {
 
 int ff_mpa_l2_select_table(int bitrate, int nb_channels, int freq, int lsf);
 int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int 
*sample_rate, int *channels, int *frame_size, int *bitrate);
-extern MPA_INT ff_mpa_synth_window[];
-void ff_mpa_synth_init(MPA_INT *window);
-void ff_mpa_synth_filter(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
+extern MPA_INT ff_mpa_synth_window_fixed[];
+void ff_mpa_synth_init_fixed(MPA_INT *window);
+void ff_mpa_synth_filter_fixed(MPA_INT *synth_buf_ptr, int *synth_buf_offset,
  MPA_INT *window, int *dither_state,
  OUT_INT *samples, int incr,
  INTFLOAT sb_samples[SBLIMIT]);
diff --git a/libavcodec/mpegaudio_tablegen.c b/libavcodec/mpegaudio_tablegen.c
index 27da219..b4c240b 100644
--- a/libavcodec/mpegaudio_tablegen.c
+++ b/libavcodec/mpegaudio_tablegen.c
@@ -33,9 +33,9 @@ int main(void)
 
 WRITE_ARRAY("static const", int8_t, table_4_3_exp);
 WRITE_ARRAY("static const", uint32_t, table_4_3_value);
-WRITE_ARRAY("static const", uint32_t, exp_table);
+WRITE_ARRAY("static const", uint32_t, exp_table_fixed);
 WRITE_ARRAY("static const", float, exp_table_float);
-WRITE_2D_ARRAY("static const", uint32_t, expval_table);
+WRITE_2D_ARRAY("static const", uint32_t, expval_table_fixed);
 WRITE_2D_ARRAY("static const", float, expval_table_float);
 
 return 0;
diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h
index 6bde277..2264b73 100644
--- a/libavcodec/mpegaudio_tablegen.h
+++ b/libavcodec/mpegaudio_tablegen.h
@@ -33,8 +33,8 @@
 #else
 static int8_t   table_4_3_exp[TABLE_4_3_SIZE];
 static uint32_t table_4_3_value[TABLE_4_3_SIZE];
-static uint32_t exp_table[512];
-static uint32_t expval_table[512][16];
+static uint32_t exp_table_fixed[512];
+static uint32_t expval_table_fixed[512][16];
 static float exp_table_float[512];
 static float expval_table_float[512][16];
 
@@ -59,10 +59,10 @@ static void mpegaudio_tableinit(void)
 for (exponent = 0; exponent < 512; exponent++) {
 for (value = 0; value < 16; value++) {
 double f = (double)value * cbrtf(value) * pow(2, (exponent - 400) 
* 0.25 + FRAC_BITS + 5);
-expval_table[exponent][value] = llrint(f);
+expval_table_fixed[exponent][value] = llrint(f);
 expval_table_float[exponent][value] = f;
 }
-exp_table[exponent] = expval_table[exponent][1];
+exp_table_fixed[exponent] = expval_table_fixed[exponent][1];
 exp_table_float[exponent] = expval_table_float[exponent][1];
 }
 }
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 35e217e..77ecb44 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -58,7 +58,7 @@
 #   define FIXHR(a)   ((int)((a) * (1LL<<32) + 0.5))
 #   define MULH3(x, y, s) MULH((s)*(x), y)
 #   define MULLx(x, y, s) MULL(x,y,s)
-#   define RENAME(a)  a
+#   define RENAME(a)  a ## _fixed
 #   define OUT_FMT AV_SAMPLE_FMT_S16
 #endif
 
@@ -621,7 +621,7 @@ static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT 
*window,
32 samples. */
 /* XXX: optimize by avoiding ring buffer usage */
 #if !CONFIG_FLOAT
-void ff_mpa_synth_filter(MPA_INT *synth_buf

Re: [libav-devel] [PATCH] libavfilter: add black margin detect filter

2011-05-17 Thread Can Wu
On Tue, May 17, 2011 at 6:18 PM, Stefano Sabatini <
stefano.sabatini-l...@poste.it> wrote:

> On date Tuesday 2011-05-17 12:05:34 +0800, Can Wu encoded:
> > Hi:
> >
> > There are HDTV channel in the broadcast here, but since lack of HDTV
> > program, the provider will transcode SDTV program to HDTV program, the
> > result black margin around the original SDTV video content.
> > So this filter is used for detect it.
> >
> > For the patches:
> > Current ffplay had not put video key_frame and pict_type to refpic, so
> the
> > first one is to add this info, for the blackmargin filter will only check
> if
> > it's key frame;
> > The second patch is the filter itself.
> >
> > Best Regards!
> >
> > --
> > wucan
>
> > From 81281bc59003a779442c3eebc71bda44b3b9b0e2 Mon Sep 17 00:00:00 2001
> > From: Can Wu 
> > Date: Tue, 17 May 2011 11:30:19 +0800
> > Subject: ffplay: fillin more video props for filter
> >
> > Maybe our video filter will use it...
> > ---
> >  ffplay.c |4 
> >  1 files changed, 4 insertions(+), 0 deletions(-)
> >
> > diff --git a/ffplay.c b/ffplay.c
> > index a5dc358..d31d56a 100644
> > --- a/ffplay.c
> > +++ b/ffplay.c
> > @@ -1706,6 +1706,10 @@ static int input_request_frame(AVFilterLink *link)
> >  picref->pts = pts;
> >  picref->pos = pkt.pos;
> >  picref->video->pixel_aspect =
> priv->is->video_st->codec->sample_aspect_ratio;
> > +picref->video->interlaced = priv->frame->interlaced_frame;
> > +picref->video->top_field_first = priv->frame->top_field_first;
> > +picref->video->pict_type = priv->frame->pict_type;
> > +picref->video->key_frame = priv->frame->key_frame;
> >  avfilter_start_frame(link, picref);
> >  avfilter_draw_slice(link, 0, link->h, 1);
> >  avfilter_end_frame(link);
> > --
> > 1.7.3.2.168.gd6b63
> >
>
> > From 256eaff7d1df6cdd8a6df21ea836242e5ebc7194 Mon Sep 17 00:00:00 2001
> > From: Can Wu 
> > Date: Tue, 17 May 2011 11:38:25 +0800
> > Subject: libavfilter: add blackmargin filter
> >
> > Used to detect black margin around video content.
> [...]
> > +static void end_frame(AVFilterLink *inlink)
> > +{
> > +AVFilterContext *ctx = inlink->dst;
> > +BlackMarginContext *blackmargin = ctx->priv;
> > +AVFilterBufferRef *picref = inlink->cur_buf;
> > +int pblack;
> > +int x, y;
> > +uint8_t *p;
> > +unsigned int nblack;
> > +int margin_top, margin_bottom, margin_left, margin_right;
> > +
> > +/* only check on key frame */
> > +if (!picref->video->key_frame)
> > +return;
> > +
> > +/* up */
> > + p = picref->data[0];
> > +for (y = 0; y < (inlink->h >> 2); y++) {
> > +p += picref->linesize[0];
> > +nblack = 0;
> > +for (x = 0; x < inlink->w; x++) {
> > +nblack += p[x] < blackmargin->bthresh;
> > +}
> > +pblack = nblack * 100 / inlink->w;
> > +if (pblack < blackmargin->bamount) {
> > +break;
> > +}
> > +}
> > +margin_top = y;
> > +
> > +/* down */
> > + p = picref->data[0] + picref->linesize[0] * inlink->h;
> > +for (y = inlink->h; y > (inlink->h >> 2); y--) {
> > +p -= picref->linesize[0];
> > +nblack = 0;
> > +for (x = 0; x < inlink->w; x++) {
> > +nblack += p[x] < blackmargin->bthresh;
> > +}
> > +pblack = nblack * 100 / inlink->w;
> > +if (pblack < blackmargin->bamount) {
> > +break;
> > +}
> > +}
> > +margin_bottom = (inlink->h - y);
> > +
> > +if (margin_top + margin_bottom >= inlink->h) {
> > +margin_left = 0;
> > +margin_right = 0;
> > +av_log(ctx, AV_LOG_WARNING, "full black frame!\n");
> > +goto done;
> > +}
> > +
> > +/* left */
> > + p = picref->data[0] + picref->linesize[0] * margin_top;
> > +for (x = 0; x < (inlink->w >> 2); x++) {
> > +p++;
> > +nblack = 0;
> > +for (y = margin_top; y < (inlink->h - margin_bottom); y++) {
> > +nblack += p[x + y * picref->linesize[0]] <
> blackmargin->bthresh;
> > +}
> > +pblack = nblack * 100 / (inlink->h - margin_top -
> margin_bottom);
> > +if (pblack < blackmargin->bamount) {
> > +break;
> > +}
> > +}
> > +margin_left = x;
> > +
> > +/* right */
> > + p = picref->data[0] + picref->linesize[0] * margin_top;
> > +for (x = inlink->w; x > (inlink->w >> 2); x--) {
> > +p--;
> > +nblack = 0;
> > +for (y = margin_top; y < (inlink->h - margin_bottom); y++) {
> > +nblack += p[x + y * picref->linesize[0]] <
> blackmargin->bthresh;
> > +}
> > +pblack = nblack * 100 / (inlink->h - margin_top -
> margin_bottom);
> > +if (pblack < blackmargin->bamount) {
> > +break;
> > +}
> > +}
> > +margin_right = inlink->w - x;
>
> This code can be factorized by using a common routine, maybe the code
> could be shared with blackframe (and

Re: [libav-devel] [PATCH] libavfilter: add black margin detect filter

2011-05-17 Thread Can Wu
On Tue, May 17, 2011 at 5:37 PM, Diego Biurrun  wrote:

> On Tue, May 17, 2011 at 12:05:34PM +0800, Can Wu wrote:
> >
> > From 256eaff7d1df6cdd8a6df21ea836242e5ebc7194 Mon Sep 17 00:00:00 2001
> > From: Can Wu 
> > Date: Tue, 17 May 2011 11:38:25 +0800
> > Subject: libavfilter: add blackmargin filter
> >
> > Used to detect black margin around video content.
>
> a black margin
>
> fixed

> > --- /dev/null
> > +++ b/libavfilter/vf_blackmargin.c
> > @@ -0,0 +1,196 @@
> > +/*
> > + * Copyright (c) 2011 Can Wu
> > + * Copyright (c) 2010 Stefano Sabatini
> > + * Copyright (c) 2006 Ivo van Poorten
> > + * Copyright (c) 2006 Julian Hall
> > + * Copyright (c) 2002-2003 Brian J. Murrell
> > + *
> > + * This file is part of Libav.
> > + *
> > + * Libav is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
>
> I assume this is GPL because it is based on code originating in MPlayer?
>
> yes, it's GPL, as in blackframe filter.

> > +/**
> > + * @file
> > + * Search for black margin around video content
> > + * based on vf_blackframe.c
>
> Say "blackframe filter" or similar, filenames tend to be unstable.
> Also, end sentences in periods.
>
> fixed

> > +static av_cold int init(AVFilterContext *ctx, const char *args, void
> *opaque)
> > +{
> > +BlackMarginContext *blackmargin = ctx->priv;
> > +
> > +blackmargin->bamount = 98;
> > +blackmargin->bthresh = 32;
> > +blackmargin->frame = 0;
>
> nit: align the '='
>
fixed and all below.

>
> > +/* up */
> > + p = picref->data[0];
>
> Indentation is off, more instances below.
>
> > +for (y = 0; y < (inlink->h >> 2); y++) {
> > +p += picref->linesize[0];
> > +nblack = 0;
> > +for (x = 0; x < inlink->w; x++) {
> > +nblack += p[x] < blackmargin->bthresh;
> > +}
>
> nit: Please drop unnecessary {}, more below.
>
> > +if (margin_top + margin_bottom >= inlink->h) {
> > +margin_left = 0;
> > +margin_right = 0;
>
> nit: align the '='
>
> > +done:
> > +av_log(ctx, AV_LOG_INFO, "frame:%u pos:%"PRId64" pts:%"PRId64" t:%f"
> > +" %d %d %d %d\n",
> > +blackmargin->frame, picref->pos, picref->pts,
> > +picref->pts == AV_NOPTS_VALUE ?
> > +-1 : picref->pts * av_q2d(inlink->time_base),
> > +margin_top, margin_bottom, margin_left, margin_right);
>
> Indentation is off.
>
> > +blackmargin->margin_top = margin_top;
> > +blackmargin->margin_bottom = margin_bottom;
> > +blackmargin->margin_left = margin_left;
> > +blackmargin->margin_right = margin_right;
>
> nit: align the '='
>
>
> Don't you have to bump the library minor number if you add a filter?
>
> bumped.

Also  add annotate as Stefano suggested, the updated patch attached.

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



-- 
wucan
From 7a1b94edd663371ea85dff571f8782a26799a2ca Mon Sep 17 00:00:00 2001
From: Can Wu 
Date: Tue, 17 May 2011 11:38:25 +0800
Subject: libavfilter: add blackmargin filter

Used to detect a black margin around video content.
---
 Changelog|1 +
 libavfilter/Makefile |1 +
 libavfilter/allfilters.c |1 +
 libavfilter/avfilter.h   |2 +-
 libavfilter/vf_blackmargin.c |  188 ++
 5 files changed, 192 insertions(+), 1 deletions(-)
 create mode 100644 libavfilter/vf_blackmargin.c

diff --git a/Changelog b/Changelog
index f78150e..7e6f2ae 100644
--- a/Changelog
+++ b/Changelog
@@ -9,6 +9,7 @@ version :
 - DPX image encoder
 - SMPTE 302M AES3 audio decoder
 - Remove support for quitting ffmpeg with 'q', ctrl+c should be used.
+- blackmargin video filter added
 
 
 version 0.7_beta1:
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 2ed1f93..14da707 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -22,6 +22,7 @@ OBJS-$(CONFIG_ANULLSRC_FILTER)   += asrc_anullsrc.o
 OBJS-$(CONFIG_ANULLSINK_FILTER)  += asink_anullsink.o
 
 OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
+OBJS-$(CONFIG_BLACKMARGIN_FILTER)+= vf_blackmargin.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 e29b4f9..bdc3dba 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -41,6 +41,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER (ANULLSINK,   anullsink,   asink);
 
 REGISTER_FILTER (BLACKFRAME,  blackframe,  vf);
+REGISTER_FILTER (BLACKMARGIN, blackmargin, vf);
 REGISTER_FILTER (COPY,   

[libav-devel] [PATCH] g729: Merge g729.h into g729dec.c.

2011-05-17 Thread Diego Biurrun
The header contains just a single define that is only used in g729dec.c.
---
 libavcodec/g729.h|   29 -
 libavcodec/g729dec.c |7 ++-
 2 files changed, 6 insertions(+), 30 deletions(-)
 delete mode 100644 libavcodec/g729.h

diff --git a/libavcodec/g729.h b/libavcodec/g729.h
deleted file mode 100644
index 9cae471..000
--- a/libavcodec/g729.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * G.729 decoder
- * Copyright (c) 2008 Vladimir Voroshilov
- *
- * This file is part of Libav.
- *
- * Libav 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.
- *
- * Libav 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 Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVCODEC_G729_H
-#define AVCODEC_G729_H
-
-/**
- * subframe size
- */
-#define SUBFRAME_SIZE 40
-
-#endif // AVCODEC_G729_H
diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c
index 5763108..979b87f 100644
--- a/libavcodec/g729dec.c
+++ b/libavcodec/g729dec.c
@@ -30,7 +30,6 @@
 #include "libavutil/avutil.h"
 #include "get_bits.h"
 
-#include "g729.h"
 #include "lsp.h"
 #include "celp_math.h"
 #include "acelp_filters.h"
@@ -71,6 +70,12 @@
  */
 #define SHARP_MAX  13017
 
+/**
+ * subframe size
+ */
+#define SUBFRAME_SIZE  40
+
+
 typedef struct {
 uint8_t ac_index_bits[2];   ///< adaptive codebook index for second 
subframe (size in bits)
 uint8_t parity_bit; ///< parity bit for pitch delay
-- 
1.7.1

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


Re: [libav-devel] [PATCH] qdm2: include correct header for rdft

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 01:43:06PM +0100, Mans Rullgard wrote:
> Signed-off-by: Mans Rullgard 
> ---
>  libavcodec/qdm2.c |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

OK

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


Re: [libav-devel] [PATCH] dct: build dct32 as separate object files

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 01:36:50PM +0100, Måns Rullgård wrote:
> Diego Biurrun  writes:
> 
> > On Tue, May 17, 2011 at 11:48:38AM +0100, Mans Rullgard wrote:
> >> --- a/libavcodec/dct32.c
> >> +++ b/libavcodec/dct32.c
> >> @@ -19,10 +19,19 @@
> >>  
> >> -#ifdef DCT32_FLOAT
> >> +#include "dct32.h"
> >> +#include "mathops.h"
> >> +
> >> +#if DCT32_FLOAT
> >> +#   define dct32 ff_dct32_float
> >>  #   define FIXHR(x)   ((float)(x))
> >>  #   define MULH3(x, y, s) ((s)*(y)*(x))
> >>  #   define INTFLOAT float
> >> +#else
> >> +#   define dct32 ff_dct32_fixed
> >> +#   define FIXHR(a)   ((int)((a) * (1LL<<32) + 0.5))
> >> +#   define MULH3(x, y, s) MULH((s)*(x), y)
> >> +#   define INTFLOAT int
> >>  #endif
> >>  
> >> @@ -103,7 +112,7 @@
> >>  
> >>  /* DCT32 without 1/sqrt(2) coef zero scaling. */
> >> -static void dct32(INTFLOAT *out, const INTFLOAT *tab)
> >> +void dct32(INTFLOAT *out, const INTFLOAT *tab)
> >>  {
> >> --- /dev/null
> >> +++ b/libavcodec/dct32_fixed.c
> >> @@ -0,0 +1,2 @@
> >> +#define DCT32_FLOAT 0
> >> +#include "dct32.c"
> >> --- /dev/null
> >> +++ b/libavcodec/dct32_float.c
> >> @@ -0,0 +1,2 @@
> >> +#define DCT32_FLOAT 1
> >> +#include "dct32.c"
> >
> > I think it would be cleaner to move the defines to dct32_fixed.c /
> > dct32_float.c, that saves the #ifdeffery.
> 
> I disagree.  I think it's better to have the definitions in the same
> file that uses them.

Fine with me.

> > Also, the files are missing standard license headers.
> 
> Last time I did this you told me to skip them.  Which way do you want it?

Add them, we have the boilerplates everywhere else.

Also, patch OK.

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


[libav-devel] [PATCH] qdm2: include correct header for rdft

2011-05-17 Thread Mans Rullgard
Signed-off-by: Mans Rullgard 
---
 libavcodec/qdm2.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 6993756..0f4dd18 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -38,7 +38,7 @@
 #include "avcodec.h"
 #include "get_bits.h"
 #include "dsputil.h"
-#include "fft.h"
+#include "rdft.h"
 #include "mpegaudio.h"
 
 #include "qdm2data.h"
-- 
1.7.4.5

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


Re: [libav-devel] [PATCH] dct: build dct32 as separate object files

2011-05-17 Thread Måns Rullgård
Diego Biurrun  writes:

> On Tue, May 17, 2011 at 11:48:38AM +0100, Mans Rullgard wrote:
>> This builds the float and fixed-point versions of dct32 separately
>> instead of #including the file in dct.c and mpegaudiodec.c.
>
> neat idea
>
>> --- /dev/null
>> +++ b/libavcodec/dct32.h
>> @@ -0,0 +1,25 @@
>> +
>> +#ifndef AVCODEC_DCT32_H
>> +#define AVCODEC_DCT32_H
>> +
>> +void ff_dct32_float(float *dst, const float *src);
>> +void ff_dct32_fixed(int *dst, const int *src);
>> +
>> +#endif
>
> nit: Please add the standard #endif comment.
>
>> --- a/libavcodec/dct32.c
>> +++ b/libavcodec/dct32.c
>> @@ -19,10 +19,19 @@
>>  
>> -#ifdef DCT32_FLOAT
>> +#include "dct32.h"
>> +#include "mathops.h"
>> +
>> +#if DCT32_FLOAT
>> +#   define dct32 ff_dct32_float
>>  #   define FIXHR(x)   ((float)(x))
>>  #   define MULH3(x, y, s) ((s)*(y)*(x))
>>  #   define INTFLOAT float
>> +#else
>> +#   define dct32 ff_dct32_fixed
>> +#   define FIXHR(a)   ((int)((a) * (1LL<<32) + 0.5))
>> +#   define MULH3(x, y, s) MULH((s)*(x), y)
>> +#   define INTFLOAT int
>>  #endif
>>  
>> @@ -103,7 +112,7 @@
>>  
>>  /* DCT32 without 1/sqrt(2) coef zero scaling. */
>> -static void dct32(INTFLOAT *out, const INTFLOAT *tab)
>> +void dct32(INTFLOAT *out, const INTFLOAT *tab)
>>  {
>> --- /dev/null
>> +++ b/libavcodec/dct32_fixed.c
>> @@ -0,0 +1,2 @@
>> +#define DCT32_FLOAT 0
>> +#include "dct32.c"
>> --- /dev/null
>> +++ b/libavcodec/dct32_float.c
>> @@ -0,0 +1,2 @@
>> +#define DCT32_FLOAT 1
>> +#include "dct32.c"
>
> I think it would be cleaner to move the defines to dct32_fixed.c /
> dct32_float.c, that saves the #ifdeffery.

I disagree.  I think it's better to have the definitions in the same
file that uses them.

> Also, the files are missing standard license headers.

Last time I did this you told me to skip them.  Which way do you want it?

-- 
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] dct: build dct32 as separate object files

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 11:48:38AM +0100, Mans Rullgard wrote:
> This builds the float and fixed-point versions of dct32 separately
> instead of #including the file in dct.c and mpegaudiodec.c.

neat idea

> --- /dev/null
> +++ b/libavcodec/dct32.h
> @@ -0,0 +1,25 @@
> +
> +#ifndef AVCODEC_DCT32_H
> +#define AVCODEC_DCT32_H
> +
> +void ff_dct32_float(float *dst, const float *src);
> +void ff_dct32_fixed(int *dst, const int *src);
> +
> +#endif

nit: Please add the standard #endif comment.

> --- a/libavcodec/dct32.c
> +++ b/libavcodec/dct32.c
> @@ -19,10 +19,19 @@
>  
> -#ifdef DCT32_FLOAT
> +#include "dct32.h"
> +#include "mathops.h"
> +
> +#if DCT32_FLOAT
> +#   define dct32 ff_dct32_float
>  #   define FIXHR(x)   ((float)(x))
>  #   define MULH3(x, y, s) ((s)*(y)*(x))
>  #   define INTFLOAT float
> +#else
> +#   define dct32 ff_dct32_fixed
> +#   define FIXHR(a)   ((int)((a) * (1LL<<32) + 0.5))
> +#   define MULH3(x, y, s) MULH((s)*(x), y)
> +#   define INTFLOAT int
>  #endif
>  
> @@ -103,7 +112,7 @@
>  
>  /* DCT32 without 1/sqrt(2) coef zero scaling. */
> -static void dct32(INTFLOAT *out, const INTFLOAT *tab)
> +void dct32(INTFLOAT *out, const INTFLOAT *tab)
>  {
> --- /dev/null
> +++ b/libavcodec/dct32_fixed.c
> @@ -0,0 +1,2 @@
> +#define DCT32_FLOAT 0
> +#include "dct32.c"
> --- /dev/null
> +++ b/libavcodec/dct32_float.c
> @@ -0,0 +1,2 @@
> +#define DCT32_FLOAT 1
> +#include "dct32.c"

I think it would be cleaner to move the defines to dct32_fixed.c /
dct32_float.c, that saves the #ifdeffery.

Also, the files are missing standard license headers.

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


Re: [libav-devel] [Announcement] FFmtech board of directors election

2011-05-17 Thread Diego Elio Pettenò
Il giorno lun, 09/05/2011 alle 23.50 +0200, Benjamin Larsson ha scritto:
> 
> "People who had svn accounts and were active in the last year are
> allowed to vote, in case of contention the board can decide." 

I'd like to vote as well.

Thanks,
-- 
Diego Elio Pettenò — Flameeyes
http://blog.flameeyes.eu/

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


[libav-devel] [PATCH] dct: build dct32 as separate object files

2011-05-17 Thread Mans Rullgard
This builds the float and fixed-point versions of dct32 separately
instead of #including the file in dct.c and mpegaudiodec.c.

Signed-off-by: Mans Rullgard 
---
 libavcodec/Makefile   |2 +-
 libavcodec/dct.c  |6 ++
 libavcodec/dct32.c|   13 +++--
 libavcodec/dct32.h|   25 +
 libavcodec/dct32_fixed.c  |2 ++
 libavcodec/dct32_float.c  |2 ++
 libavcodec/mpegaudiodec.c |9 ++---
 7 files changed, 45 insertions(+), 14 deletions(-)
 create mode 100644 libavcodec/dct32.h
 create mode 100644 libavcodec/dct32_fixed.c
 create mode 100644 libavcodec/dct32_float.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index aaf9ceb..fa70216 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -27,7 +27,7 @@ OBJS = allcodecs.o
  \
 OBJS-$(CONFIG_AANDCT)  += aandcttab.o
 OBJS-$(CONFIG_AC3DSP)  += ac3dsp.o
 OBJS-$(CONFIG_ENCODERS)+= faandct.o jfdctfst.o jfdctint.o
-OBJS-$(CONFIG_DCT) += dct.o
+OBJS-$(CONFIG_DCT) += dct.o dct32_fixed.o dct32_float.o
 OBJS-$(CONFIG_DWT) += dwt.o
 OBJS-$(CONFIG_DXVA2)   += dxva2.o
 FFT-OBJS-$(CONFIG_HARDCODED_TABLES)+= cos_tables.o cos_fixed_tables.o
diff --git a/libavcodec/dct.c b/libavcodec/dct.c
index caa6bdb..5c63af3 100644
--- a/libavcodec/dct.c
+++ b/libavcodec/dct.c
@@ -30,9 +30,7 @@
 #include 
 #include "libavutil/mathematics.h"
 #include "dct.h"
-
-#define DCT32_FLOAT
-#include "dct32.c"
+#include "dct32.h"
 
 /* sin((M_PI * x / (2*n)) */
 #define SIN(s,n,x) (s->costab[(n) - (x)])
@@ -210,7 +208,7 @@ av_cold int ff_dct_init(DCTContext *s, int nbits, enum 
DCTTransformType inverse)
 }
 }
 
-s->dct32 = dct32;
+s->dct32 = ff_dct32_float;
 if (HAVE_MMX) ff_dct_init_mmx(s);
 
 return 0;
diff --git a/libavcodec/dct32.c b/libavcodec/dct32.c
index ae99d88..272e0db 100644
--- a/libavcodec/dct32.c
+++ b/libavcodec/dct32.c
@@ -19,10 +19,19 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#ifdef DCT32_FLOAT
+#include "dct32.h"
+#include "mathops.h"
+
+#if DCT32_FLOAT
+#   define dct32 ff_dct32_float
 #   define FIXHR(x)   ((float)(x))
 #   define MULH3(x, y, s) ((s)*(y)*(x))
 #   define INTFLOAT float
+#else
+#   define dct32 ff_dct32_fixed
+#   define FIXHR(a)   ((int)((a) * (1LL<<32) + 0.5))
+#   define MULH3(x, y, s) MULH((s)*(x), y)
+#   define INTFLOAT int
 #endif
 
 
@@ -103,7 +112,7 @@
 #define ADD(a, b) val##a += val##b
 
 /* DCT32 without 1/sqrt(2) coef zero scaling. */
-static void dct32(INTFLOAT *out, const INTFLOAT *tab)
+void dct32(INTFLOAT *out, const INTFLOAT *tab)
 {
 INTFLOAT tmp0, tmp1;
 
diff --git a/libavcodec/dct32.h b/libavcodec/dct32.h
new file mode 100644
index 000..110338d
--- /dev/null
+++ b/libavcodec/dct32.h
@@ -0,0 +1,25 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav 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.
+ *
+ * Libav 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 Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_DCT32_H
+#define AVCODEC_DCT32_H
+
+void ff_dct32_float(float *dst, const float *src);
+void ff_dct32_fixed(int *dst, const int *src);
+
+#endif
diff --git a/libavcodec/dct32_fixed.c b/libavcodec/dct32_fixed.c
new file mode 100644
index 000..49241e0
--- /dev/null
+++ b/libavcodec/dct32_fixed.c
@@ -0,0 +1,2 @@
+#define DCT32_FLOAT 0
+#include "dct32.c"
diff --git a/libavcodec/dct32_float.c b/libavcodec/dct32_float.c
new file mode 100644
index 000..31ef58c
--- /dev/null
+++ b/libavcodec/dct32_float.c
@@ -0,0 +1,2 @@
+#define DCT32_FLOAT 1
+#include "dct32.c"
diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c
index 8c42e09..35e217e 100644
--- a/libavcodec/mpegaudiodec.c
+++ b/libavcodec/mpegaudiodec.c
@@ -29,6 +29,7 @@
 #include "get_bits.h"
 #include "dsputil.h"
 #include "mathops.h"
+#include "dct32.h"
 
 /*
  * TODO:
@@ -68,12 +69,6 @@
 #include "mpegaudiodata.h"
 #include "mpegaudiodectab.h"
 
-#if CONFIG_FLOAT
-#include "fft.h"
-#else
-#include "dct32.c"
-#endif
-
 static void compute_antialias(MPADecodeContext *s, GranuleDef *g);
 static void apply_window_mp3_c(MPA_INT *synth_buf, MPA_INT *window,
int *dither_state, OUT_INT *samples, int 

Re: [libav-devel] [PATCH] libavfilter: add black margin detect filter

2011-05-17 Thread Stefano Sabatini
On date Tuesday 2011-05-17 12:05:34 +0800, Can Wu encoded:
> Hi:
> 
> There are HDTV channel in the broadcast here, but since lack of HDTV
> program, the provider will transcode SDTV program to HDTV program, the
> result black margin around the original SDTV video content.
> So this filter is used for detect it.
> 
> For the patches:
> Current ffplay had not put video key_frame and pict_type to refpic, so the
> first one is to add this info, for the blackmargin filter will only check if
> it's key frame;
> The second patch is the filter itself.
> 
> Best Regards!
> 
> -- 
> wucan

> From 81281bc59003a779442c3eebc71bda44b3b9b0e2 Mon Sep 17 00:00:00 2001
> From: Can Wu 
> Date: Tue, 17 May 2011 11:30:19 +0800
> Subject: ffplay: fillin more video props for filter
> 
> Maybe our video filter will use it...
> ---
>  ffplay.c |4 
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/ffplay.c b/ffplay.c
> index a5dc358..d31d56a 100644
> --- a/ffplay.c
> +++ b/ffplay.c
> @@ -1706,6 +1706,10 @@ static int input_request_frame(AVFilterLink *link)
>  picref->pts = pts;
>  picref->pos = pkt.pos;
>  picref->video->pixel_aspect = 
> priv->is->video_st->codec->sample_aspect_ratio;
> +picref->video->interlaced = priv->frame->interlaced_frame;
> +picref->video->top_field_first = priv->frame->top_field_first;
> +picref->video->pict_type = priv->frame->pict_type;
> +picref->video->key_frame = priv->frame->key_frame;
>  avfilter_start_frame(link, picref);
>  avfilter_draw_slice(link, 0, link->h, 1);
>  avfilter_end_frame(link);
> -- 
> 1.7.3.2.168.gd6b63
> 

> From 256eaff7d1df6cdd8a6df21ea836242e5ebc7194 Mon Sep 17 00:00:00 2001
> From: Can Wu 
> Date: Tue, 17 May 2011 11:38:25 +0800
> Subject: libavfilter: add blackmargin filter
> 
> Used to detect black margin around video content.
[...]
> +static void end_frame(AVFilterLink *inlink)
> +{
> +AVFilterContext *ctx = inlink->dst;
> +BlackMarginContext *blackmargin = ctx->priv;
> +AVFilterBufferRef *picref = inlink->cur_buf;
> +int pblack;
> +int x, y;
> +uint8_t *p;
> +unsigned int nblack;
> +int margin_top, margin_bottom, margin_left, margin_right;
> +
> +/* only check on key frame */
> +if (!picref->video->key_frame)
> +return;
> +
> +/* up */
> + p = picref->data[0];
> +for (y = 0; y < (inlink->h >> 2); y++) {
> +p += picref->linesize[0];
> +nblack = 0;
> +for (x = 0; x < inlink->w; x++) {
> +nblack += p[x] < blackmargin->bthresh;
> +}
> +pblack = nblack * 100 / inlink->w;
> +if (pblack < blackmargin->bamount) {
> +break;
> +}
> +}
> +margin_top = y;
> +
> +/* down */
> + p = picref->data[0] + picref->linesize[0] * inlink->h;
> +for (y = inlink->h; y > (inlink->h >> 2); y--) {
> +p -= picref->linesize[0];
> +nblack = 0;
> +for (x = 0; x < inlink->w; x++) {
> +nblack += p[x] < blackmargin->bthresh;
> +}
> +pblack = nblack * 100 / inlink->w;
> +if (pblack < blackmargin->bamount) {
> +break;
> +}
> +}
> +margin_bottom = (inlink->h - y);
> +
> +if (margin_top + margin_bottom >= inlink->h) {
> +margin_left = 0;
> +margin_right = 0;
> +av_log(ctx, AV_LOG_WARNING, "full black frame!\n");
> +goto done;
> +}
> +
> +/* left */
> + p = picref->data[0] + picref->linesize[0] * margin_top;
> +for (x = 0; x < (inlink->w >> 2); x++) {
> +p++;
> +nblack = 0;
> +for (y = margin_top; y < (inlink->h - margin_bottom); y++) {
> +nblack += p[x + y * picref->linesize[0]] < blackmargin->bthresh;
> +}
> +pblack = nblack * 100 / (inlink->h - margin_top - margin_bottom);
> +if (pblack < blackmargin->bamount) {
> +break;
> +}
> +}
> +margin_left = x;
> +
> +/* right */
> + p = picref->data[0] + picref->linesize[0] * margin_top;
> +for (x = inlink->w; x > (inlink->w >> 2); x--) {
> +p--;
> +nblack = 0;
> +for (y = margin_top; y < (inlink->h - margin_bottom); y++) {
> +nblack += p[x + y * picref->linesize[0]] < blackmargin->bthresh;
> +}
> +pblack = nblack * 100 / (inlink->h - margin_top - margin_bottom);
> +if (pblack < blackmargin->bamount) {
> +break;
> +}
> +}
> +margin_right = inlink->w - x;

This code can be factorized by using a common routine, maybe the code
could be shared with blackframe (and put it in the same file and save
some RAM).

> +
> +done:
> +av_log(ctx, AV_LOG_INFO, "frame:%u pos:%"PRId64" pts:%"PRId64" t:%f"
> +" %d %d %d %d\n",

uhm please annotate these values (e.g.: top:%d bottom:%d left:%d ...),
or the user will have to read docs every time.
-- 
Odd that we think definitions are definitive.   :-)
-- Larry Wall

Re: [libav-devel] [PATCH] libavfilter: add black margin detect filter

2011-05-17 Thread Diego Biurrun
On Tue, May 17, 2011 at 12:05:34PM +0800, Can Wu wrote:
> 
> From 256eaff7d1df6cdd8a6df21ea836242e5ebc7194 Mon Sep 17 00:00:00 2001
> From: Can Wu 
> Date: Tue, 17 May 2011 11:38:25 +0800
> Subject: libavfilter: add blackmargin filter
> 
> Used to detect black margin around video content.

a black margin

> --- /dev/null
> +++ b/libavfilter/vf_blackmargin.c
> @@ -0,0 +1,196 @@
> +/*
> + * Copyright (c) 2011 Can Wu
> + * Copyright (c) 2010 Stefano Sabatini
> + * Copyright (c) 2006 Ivo van Poorten
> + * Copyright (c) 2006 Julian Hall
> + * Copyright (c) 2002-2003 Brian J. Murrell
> + *
> + * This file is part of Libav.
> + *
> + * Libav is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.

I assume this is GPL because it is based on code originating in MPlayer?

> +/**
> + * @file
> + * Search for black margin around video content
> + * based on vf_blackframe.c

Say "blackframe filter" or similar, filenames tend to be unstable.
Also, end sentences in periods.

> +static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
> +{
> +BlackMarginContext *blackmargin = ctx->priv;
> +
> +blackmargin->bamount = 98;
> +blackmargin->bthresh = 32;
> +blackmargin->frame = 0;

nit: align the '='

> +/* up */
> + p = picref->data[0];

Indentation is off, more instances below.

> +for (y = 0; y < (inlink->h >> 2); y++) {
> +p += picref->linesize[0];
> +nblack = 0;
> +for (x = 0; x < inlink->w; x++) {
> +nblack += p[x] < blackmargin->bthresh;
> +}

nit: Please drop unnecessary {}, more below.

> +if (margin_top + margin_bottom >= inlink->h) {
> +margin_left = 0;
> +margin_right = 0;

nit: align the '='

> +done:
> +av_log(ctx, AV_LOG_INFO, "frame:%u pos:%"PRId64" pts:%"PRId64" t:%f"
> +" %d %d %d %d\n",
> +blackmargin->frame, picref->pos, picref->pts,
> +picref->pts == AV_NOPTS_VALUE ?
> +-1 : picref->pts * av_q2d(inlink->time_base),
> +margin_top, margin_bottom, margin_left, margin_right);

Indentation is off.

> +blackmargin->margin_top = margin_top;
> +blackmargin->margin_bottom = margin_bottom;
> +blackmargin->margin_left = margin_left;
> +blackmargin->margin_right = margin_right;

nit: align the '='


Don't you have to bump the library minor number if you add a filter?

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


Re: [libav-devel] [PATCH 3/3] dct32: Add AVX implementation of 32-point DCT

2011-05-17 Thread Loren Merritt

Use 16 xmmregs instead of spills, and transpose in pass5.
125->104 cycles on penryn x86_64. (But take the numbers with some salt: 
it's sensitive to code alignment (and was before the patch too).)

Doesn't touch avx; I don't know if the same strategy would help there.

I modified the x86_32 version too, but it doesn't get any speedup. Mine is 
more regular than the giant list of unstructured scalar math in 
PASS6_AND_PERMUTE; if this method can be applied to avx (and thus remove 
PASS6_AND_PERMUTE) then that's a simplification, but if it can't then the 
extra version is a complication and should be reverted.


--Loren MerrittFrom 701f40aef4de4c001f619db20fecddaf8d1348af Mon Sep 17 00:00:00 2001
From: Loren Merritt 
Date: Tue, 17 May 2011 08:51:10 +
Subject: [PATCH 1/2] s/xmm/m/

---
 libavcodec/x86/dct32_sse.asm |  151 +-
 1 files changed, 76 insertions(+), 75 deletions(-)

diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm
index 4df89fe..16a6dd5 100644
--- a/libavcodec/x86/dct32_sse.asm
+++ b/libavcodec/x86/dct32_sse.asm
@@ -264,6 +264,7 @@ cglobal dct32_float_avx, 2,3,8, out, in, tmp
 RET
 %endif
 
+INIT_XMM
 %define BUTTERFLY  BUTTERFLY_SSE
 %define BUTTERFLY0 BUTTERFLY0_SSE
 
@@ -271,116 +272,116 @@ cglobal dct32_float_avx, 2,3,8, out, in, tmp
 cglobal dct32_float_sse, 2,3,8, out, in, tmp
 ; pass 1
 
-movaps  xmm0, [inq+0]
-movaps  xmm1, [inq+112]
-shufps  xmm1, xmm1, 0x1b
-BUTTERFLY   xmm0, xmm1, [ps_cos_vec], xmm3
+movaps  m0, [inq+0]
+movaps  m1, [inq+112]
+shufps  m1, m1, 0x1b
+BUTTERFLY   m0, m1, [ps_cos_vec], m3
 
-movaps  xmm7, [inq+64]
-movaps  xmm4, [inq+48]
-shufps  xmm4, xmm4, 0x1b
-BUTTERFLY   xmm7, xmm4, [ps_cos_vec+32], xmm3
+movaps  m7, [inq+64]
+movaps  m4, [inq+48]
+shufps  m4, m4, 0x1b
+BUTTERFLY   m7, m4, [ps_cos_vec+32], m3
 
 ; pass 2
-movaps  xmm2, [ps_cos_vec+64]
-BUTTERFLY   xmm1, xmm4, xmm2, xmm3
-movaps  [outq+48], xmm1
-movaps  [outq+0], xmm4
+movaps  m2, [ps_cos_vec+64]
+BUTTERFLY   m1, m4, m2, m3
+movaps  [outq+48], m1
+movaps  [outq+0], m4
 
 ; pass 1
-movaps  xmm1, [inq+16]
-movaps  xmm6, [inq+96]
-shufps  xmm6, xmm6, 0x1b
-BUTTERFLY   xmm1, xmm6, [ps_cos_vec+16], xmm3
+movaps  m1, [inq+16]
+movaps  m6, [inq+96]
+shufps  m6, m6, 0x1b
+BUTTERFLY   m1, m6, [ps_cos_vec+16], m3
 
-movaps  xmm4, [inq+80]
-movaps  xmm5, [inq+32]
-shufps  xmm5, xmm5, 0x1b
-BUTTERFLY   xmm4, xmm5, [ps_cos_vec+48], xmm3
+movaps  m4, [inq+80]
+movaps  m5, [inq+32]
+shufps  m5, m5, 0x1b
+BUTTERFLY   m4, m5, [ps_cos_vec+48], m3
 
 ; pass 2
-BUTTERFLY   xmm0, xmm7, xmm2, xmm3
+BUTTERFLY   m0, m7, m2, m3
 
-movaps  xmm2, [ps_cos_vec+80]
-BUTTERFLY   xmm6, xmm5, xmm2, xmm3
+movaps  m2, [ps_cos_vec+80]
+BUTTERFLY   m6, m5, m2, m3
 
-BUTTERFLY   xmm1, xmm4, xmm2, xmm3
+BUTTERFLY   m1, m4, m2, m3
 
 ; pass 3
-movaps  xmm2, [ps_cos_vec+96]
-shufps  xmm1, xmm1, 0x1b
-BUTTERFLY   xmm0, xmm1, xmm2, xmm3
-movaps  [outq+112], xmm0
-movaps  [outq+96], xmm1
+movaps  m2, [ps_cos_vec+96]
+shufps  m1, m1, 0x1b
+BUTTERFLY   m0, m1, m2, m3
+movaps  [outq+112], m0
+movaps  [outq+96], m1
 
-movaps  xmm0, [outq+0]
-shufps  xmm5, xmm5, 0x1b
-BUTTERFLY   xmm0, xmm5, xmm2, xmm3
+movaps  m0, [outq+0]
+shufps  m5, m5, 0x1b
+BUTTERFLY   m0, m5, m2, m3
 
-movaps  xmm1, [outq+48]
-shufps  xmm6, xmm6, 0x1b
-BUTTERFLY   xmm1, xmm6, xmm2, xmm3
-movaps  [outq+48], xmm1
+movaps  m1, [outq+48]
+shufps  m6, m6, 0x1b
+BUTTERFLY   m1, m6, m2, m3
+movaps  [outq+48], m1
 
-shufps  xmm4, xmm4, 0x1b
-BUTTERFLY   xmm7, xmm4, xmm2, xmm3
+shufps  m4, m4, 0x1b
+BUTTERFLY   m7, m4, m2, m3
 
 ; pass 4
-movaps  xmm3, [ps_p1p1m1m1+0]
-movaps  xmm2, [ps_cos_vec+128]
+movaps  m3, [ps_p1p1m1m1+0]
+movaps  m2, [ps_cos_vec+128]
 
-BUTTERFLY2  xmm5, xmm3, xmm2, xmm1
+BUTTERFLY2  m5, m3, m2, m1
 
-BUTTERFLY2  xmm0, xmm3, xmm2, xmm1
-movaps  [outq+16], xmm0
+BUTTERFLY2  m0, m3, m2, m1
+movaps  [outq+16], m0
 
-BUTTERFLY2  xmm6, xmm3, xmm2, xmm1
-movaps  [outq+32], xmm6
+BUTTERFLY2  m6, m3, m2, m1
+movaps  [outq+32], m6
 
-movaps  xmm0, [outq+48]
-BUTTERFLY2  xmm0, xmm3, xmm2, xmm1
-movaps  [outq+48], xmm0
+movaps  m0, [outq+48]
+BUTTERFLY2  m0, m3, m2, m1
+movaps  [outq+48], m0
 
-BUTTERFLY2  xmm4, xmm3, xmm2, xmm1
+BUTTERFLY2  m4, m3, m2, m1
 
-BUTTERFLY2  xmm7, xmm3, xmm2, xmm1
+BUTTERFLY2  m7, m3, m2, m1
 
-movaps 

Re: [libav-devel] [PATCH 1/3] dct32: port SSE 32-point DCT to YASM

2011-05-17 Thread Loren Merritt

On Mon, 16 May 2011, Vitor Sessak wrote:


+;pass 6, no SIMD...
+movss   xmm3, [outq+56]
+mov tmpd, [outd+4]
+addss   xmm3, [outq+60]
+movss   xmm7, [outd+72]


outq

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


Re: [libav-devel] GPL License Violation

2011-05-17 Thread Rob
On 17 May 2011 09:57, The Informer  wrote:
> Ultimate Media Player violates the GPL license:
> http://www.ultimatemediaplayer.net

[...]

> The FFMpeg-License.txt file contains the LGPL license text, but the actually
> use a GPL version:
>
> [~/LibAV]$ strings avcodec-52.dll |grep -i gpl
> j--prefix=/ffmpeg/Binaries --disable-debug --disable-static --enable-shared
> --enable-version3 --enable-avfilter --enable-memalign-hack --enable-avisynth
> --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libvpx --target-os=mingw32 --extra-cflags=-I/extlib/
> include --extra-ldflags=-L/extlib/lib --enable-libmp3lame --enable-libtheora
> --enable-libvorbis --enable-gpl --enable-libx264 --enable-libxvid
> --enable-libfaad --enable-nonfree --enable-libfaac

Actually the nonfree option takes precedence. This binary is not
re-distributable at all.

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


[libav-devel] GPL License Violation

2011-05-17 Thread The Informer
Ultimate Media Player violates the GPL license:
http://www.ultimatemediaplayer.net


Content of their install:
 Directory of C:\Program Files (x86)\Ultimate Media Player

08-04-2011  09:39  .
08-04-2011  09:39  ..
08-04-2011  09:39  3rdParty
08-04-2011  09:39  LibAV
10-03-2011  18:13   107.834 UMP EULA.rtf
16-03-2011  19:58 2.150.912 UMPlayer.exe
08-04-2011  09:39 4.410 unins000.dat
08-04-2011  09:38   714.526 unins000.exe
   4 File(s)  2.977.682 bytes

 Directory of C:\Program Files (x86)\Ultimate Media Player\3rdParty

08-04-2011  09:39  .
08-04-2011  09:39  ..
29-01-2011  14:4927.032 FFMpeg-License.txt
29-01-2011  14:4925.284 LAME-License.txt
29-01-2011  14:49 1.450 LibGSM-License.txt
29-01-2011  14:49 1.466 LibOGG-License.txt
29-01-2011  14:4910.271 LibOpencoreAMR-License.txt
29-01-2011  14:4924.390 LibSDL-License.txt
29-01-2011  14:49 1.470 LibTheora-License.txt
29-01-2011  14:49 1.470 LibVorbis-License.txt
29-01-2011  14:49 1.496 LibVPX-License.txt
   9 File(s) 94.329 bytes

 Directory of C:\Program Files (x86)\Ultimate Media Player\LibAV

08-04-2011  09:39  .
08-04-2011  09:39  ..
29-01-2011  14:49 9.825.792 avcodec-52.dll
29-01-2011  14:4956.832 avcore-0.dll
29-01-2011  14:4916.384 avdevice-52.dll
29-01-2011  14:49   112.640 avfilter-1.dll
29-01-2011  14:49   920.064 avformat-52.dll
29-01-2011  14:49   121.344 avutil-50.dll
29-01-2011  14:49   321.536 SDL.dll
29-01-2011  14:49   222.720 swscale-0.dll
   8 File(s) 11.597.312 bytes


The FFMpeg-License.txt file contains the LGPL license text, but the actually
use a GPL version:

[~/LibAV]$ strings avcodec-52.dll |grep -i gpl
j--prefix=/ffmpeg/Binaries --disable-debug --disable-static --enable-shared
--enable-version3 --enable-avfilter --enable-memalign-hack --enable-avisynth
--enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb
--enable-libvpx --target-os=mingw32 --extra-cflags=-I/extlib/
include --extra-ldflags=-L/extlib/lib --enable-libmp3lame --enable-libtheora
--enable-libvorbis --enable-gpl --enable-libx264 --enable-libxvid
--enable-libfaad --enable-nonfree --enable-libfaac
This software is derived from the GNU GPL XviD codec (1.1.0).

Their web site has a page claiming to provide source code. It claims they
use the LGPL version (lie), and the linked archive only contains binaries,
not source code:
http://www.ultimatemediaplayer.net/source.html
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel