[libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Vittorio Giovara
According to various literature, Lanczos and Sinc are better for downscaling, 
while Spline and Gaussian so they are set in case these condistions are found.

Inspired from a patch by wm4 nfx...@googlemail.com
---
 libswscale/utils.c |   13 +
 1 file changed, 13 insertions(+)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2781985..200cf55 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -914,6 +914,19 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
  SWS_SINC  |
  SWS_SPLINE|
  SWS_BICUBLIN);
+
+/* provide a default scaler if not set by caller.
+ * Bicubic performs better for upscaling, bilinear for
+ * downscaling and lanczos is ok for the general case.
+ */
+if (!i)
+if (srcW = dstW  srcH = dstH)
+i = SWS_BICUBIC;
+else if (srcW  dstW  srcH  dstH)
+i = SWS_BILINEAR;
+else
+i = SWS_LANCZOS;
+
 if (!i || (i  (i - 1))) {
 av_log(c, AV_LOG_ERROR,
Exactly one scaler algorithm must be chosen\n);
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Kostya Shishkov
On Tue, Oct 01, 2013 at 09:44:43AM +0200, Vittorio Giovara wrote:
 According to various literature, Lanczos and Sinc are better for downscaling, 
 while Spline and Gaussian so they are set in case these condistions are found.

1) too long line
2) Lanczos and Gaussian deserve capital letter because they come from names,
sinc and spline are ordinary nouns
3) part of missing and formulation is can be called quite ambiguous under
normal circumstances taking into account all of the above

Substitute Diego off. 

 Inspired from a patch by wm4 nfx...@googlemail.com
 ---
  libswscale/utils.c |   13 +
  1 file changed, 13 insertions(+)
 
 diff --git a/libswscale/utils.c b/libswscale/utils.c
 index 2781985..200cf55 100644
 --- a/libswscale/utils.c
 +++ b/libswscale/utils.c
 @@ -914,6 +914,19 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
 *srcFilter,
   SWS_SINC  |
   SWS_SPLINE|
   SWS_BICUBLIN);
 +
 +/* provide a default scaler if not set by caller.
  Provide  if it is not set by the caller.
 + * Bicubic performs better for upscaling, bilinear for
 + * downscaling and lanczos is ok for the general case.
 + */
 +if (!i)
 +if (srcW = dstW  srcH = dstH)
 +i = SWS_BICUBIC;
 +else if (srcW  dstW  srcH  dstH)
 +i = SWS_BILINEAR;
 +else
 +i = SWS_LANCZOS;
 +
  if (!i || (i  (i - 1))) {
  av_log(c, AV_LOG_ERROR,
 Exactly one scaler algorithm must be chosen\n);
 -- 
 1.7.9.5
 
 ___
 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] swscale: provide a default scaler if none is set

2013-10-01 Thread Vittorio Giovara
According to various literature, Lanczos and Sinc are better for downscaling, 
while Spline and Gaussian so they are set in case these condistions are found.

Inspired from a patch by wm4 nfx...@googlemail.com
---
Now without silliness, please disregard the previous version.
Vittorio

 libswscale/utils.c |   11 +++
 1 file changed, 11 insertions(+)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2781985..7d35f16 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -914,6 +914,17 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
  SWS_SINC  |
  SWS_SPLINE|
  SWS_BICUBLIN);
+
+/* provide a default scaler if not set by caller */
+if (!i)
+if (dstW  srcW  dstH  srcH)
+flags |= SWS_GAUSS;
+else if (dstW  srcW  dstH  srcH)
+flags |= SWS_SINC;
+else
+flags |= SWS_LANCZOS;
+c-flags = flags;
+
 if (!i || (i  (i - 1))) {
 av_log(c, AV_LOG_ERROR,
Exactly one scaler algorithm must be chosen\n);
-- 
1.7.9.5

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


[libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Vittorio Giovara
Lacnzos for general case, sinc for upscaling, Gaussian for
downscaling. According to various literature these scalers
should be the best (quality-wise) available for each case.

Inspired from a patch by wm4 nfx...@googlemail.com
---
 libswscale/utils.c |   12 
 1 file changed, 12 insertions(+)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2781985..a642710 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -914,6 +914,18 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
  SWS_SINC  |
  SWS_SPLINE|
  SWS_BICUBLIN);
+
+/* provide a default scaler if not set by caller */
+if (!i) {
+if (dstW  srcW  dstH  srcH)
+flags |= SWS_GAUSS;
+else if (dstW  srcW  dstH  srcH)
+flags |= SWS_SINC;
+else
+flags |= SWS_LANCZOS;
+c-flags = flags;
+}
+
 if (!i || (i  (i - 1))) {
 av_log(c, AV_LOG_ERROR,
Exactly one scaler algorithm must be chosen\n);
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] Generalize ATRAC3 gain compensation code

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 01:02:38AM +0200, Maxim Polijakowski wrote:
 @Derek  @Diego: Thank you for the review!
 
 From 085cfcbfeada7736c54406573e5fe2c56ab11016 Mon Sep 17 00:00:00 2001
 From: Maxim Poliakovski max_p...@gmx.de
 Date: Mon, 30 Sep 2013 23:14:51 +0200
 Subject: [PATCH 1/2] atrac cosmetics: move doxygen comments to the header
  file, break long lines, improve file description and
  update copyright messages.

The Linux kernel and Git have standardized on a certain format for log
messages that we and many other projects have adopted:

  tag: short title
  empty line
  An extended description of the commit that can go into any amount of
  detail and span several lines or even multiple paragraphs.

For this particular case I would suggest

  atrac: Move doxygen comments to the header

  Also update copyright info and file description.

 --- a/libavcodec/atrac.c
 +++ b/libavcodec/atrac.c
 @@ -66,20 +62,8 @@ void ff_atrac_generate_tables(void)
 -void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, 
 float *delayBuf, float *temp)
 +void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut,
 +float *delayBuf, float *temp)

slightly unrelated cosmetics

Also, KR does not leave a space between the function name and the opening (.

 --- a/libavcodec/atrac.h
 +++ b/libavcodec/atrac.h
 @@ -30,7 +30,22 @@
  
 -void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, 
 float *delayBuf, float *temp);
 +void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut,
 +float *delayBuf, float *temp);

same

 From aade9868608a65231a57dd36f203a647a9db906b Mon Sep 17 00:00:00 2001
 From: Maxim Poliakovski max_p...@gmx.de
 Date: Tue, 1 Oct 2013 00:58:41 +0200
 Subject: [PATCH 2/2] atrac3: Generalize gain compensation code Move it to
  atrac.c, so it can be reused within the upcoming
  ATRAC3+ decoder.

see above about log message formatting

 --- a/libavcodec/atrac.c
 +++ b/libavcodec/atrac.c
 @@ -62,6 +62,66 @@ void ff_atrac_generate_tables(void)
  
 +av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int 
 id2exp_offset,
 + int loc_scale)

Indentation is off.

 +gain_inc = gctx-gain_tab2[(i + 1  gc_now-num_points ?
 +gc_now-levcode[i + 1] : 
 gctx-id2exp_offset)
 +  - gc_now-levcode[i] + 15];

imo more readable:

   gain_inc = gctx-gain_tab2[(i + 1  gc_now-num_points
  ? gc_now-levcode[i + 1]
  : gctx-id2exp_offset)
  - gc_now-levcode[i] + 15];

 +/* copy the overlapping part into delay buffer */
 +memcpy(prev, in[num_samples], num_samples * sizeof(float));

into the delay buffer

 --- a/libavcodec/atrac.h
 +++ b/libavcodec/atrac.h
 @@ -28,6 +28,26 @@
 +typedef struct AtracGainInfo {
 +int   num_points; /// number of gain control points
 +int   levcode[7]; /// level at corresponding control point
 +int   loccode[7]; /// location of gain control points
 +} AtracGainInfo;

Why is there code in these names and not point or points?

 --- a/libavcodec/atrac3.c
 +++ b/libavcodec/atrac3.c
 @@ -417,90 +412,32 @@ static int decode_tonal_components(GetBitContext *gb,
  static int decode_gain_control(GetBitContext *gb, GainBlock *block,
 int num_bands)
  {
 -int i, cf, num_data;
 +int i, b;
  int *level, *loc;
  
 -for (i = 0; i = num_bands; i++) {
 -num_data  = get_bits(gb, 3);
 -gain[i].num_gain_data = num_data;
 -level = gain[i].lev_code;
 -loc   = gain[i].loc_code;
 +for (b = 0; b = num_bands; b++) {
 +gain[b].num_points = get_bits(gb, 3);
 +level  = gain[b].levcode;
 +loc= gain[b].loccode;
  
 -for (cf = 0; cf  gain[i].num_gain_data; cf++) {
 -level[cf] = get_bits(gb, 4);
 -loc  [cf] = get_bits(gb, 5);
 -if (cf  loc[cf] = loc[cf - 1])
 +for (i = 0; i  gain[b].num_points; i++) {
 +level[i] = get_bits(gb, 4);
 +loc  [i] = get_bits(gb, 5);
 +if (i  loc[i] = loc[i-1])
  return AVERROR_INVALIDDATA;
  }
  }
  
 -/* Clear the unused blocks. */
 -for (; i  4 ; i++)
 -gain[i].num_gain_data = 0;
 +/* Clear unused blocks. */
 +for (; b  4 ; b++)
 +gain[b].num_points = 0;


Is there a reason to rename the counter variables?  It seems rather
arbitrary and complicates the diff.

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


[libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Vittorio Giovara
Lacnzos for general case, sinc for upscaling, Gaussian for
downscaling. According to various literature these scalers
should be the best algirthms quality-wise for each case.

Inspired from a patch by wm4 nfx...@googlemail.com
---
 libswscale/utils.c |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2781985..2111fc2 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -914,7 +914,17 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
  SWS_SINC  |
  SWS_SPLINE|
  SWS_BICUBLIN);
-if (!i || (i  (i - 1))) {
+
+/* provide a default scaler if not set by caller */
+if (!i) {
+if (dstW  srcW  dstH  srcH)
+flags |= SWS_GAUSS;
+else if (dstW  srcW  dstH  srcH)
+flags |= SWS_SINC;
+else
+flags |= SWS_LANCZOS;
+c-flags = flags;
+} else if (i  (i - 1)) {
 av_log(c, AV_LOG_ERROR,
Exactly one scaler algorithm must be chosen\n);
 return AVERROR(EINVAL);
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] Generalize ATRAC3 gain compensation code

2013-10-01 Thread Maxim Polijakowski

[...]

--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -417,90 +412,32 @@ static int decode_tonal_components(GetBitContext *gb,
  static int decode_gain_control(GetBitContext *gb, GainBlock *block,
 int num_bands)
  {
-int i, cf, num_data;
+int i, b;
  int *level, *loc;
  
-for (i = 0; i = num_bands; i++) {

-num_data  = get_bits(gb, 3);
-gain[i].num_gain_data = num_data;
-level = gain[i].lev_code;
-loc   = gain[i].loc_code;
+for (b = 0; b = num_bands; b++) {
+gain[b].num_points = get_bits(gb, 3);
+level  = gain[b].levcode;
+loc= gain[b].loccode;
  
-for (cf = 0; cf  gain[i].num_gain_data; cf++) {

-level[cf] = get_bits(gb, 4);
-loc  [cf] = get_bits(gb, 5);
-if (cf  loc[cf] = loc[cf - 1])
+for (i = 0; i  gain[b].num_points; i++) {
+level[i] = get_bits(gb, 4);
+loc  [i] = get_bits(gb, 5);
+if (i  loc[i] = loc[i-1])
  return AVERROR_INVALIDDATA;
  }
  }
  
-/* Clear the unused blocks. */

-for (; i  4 ; i++)
-gain[i].num_gain_data = 0;
+/* Clear unused blocks. */
+for (; b  4 ; b++)
+gain[b].num_points = 0;


Is there a reason to rename the counter variables?  It seems rather
arbitrary and complicates the diff.


Yes, the reason for rename this variable is to make it look more 
standard and readable. What does that cf stand for? Core 
Foundation or close file?

i is unambiguous and clear, isn't it?

The above mentioned changes look rather trivial IMHO so I wonder if 
someone else could fix them all and push the patches. Taking in 
consideration the amount of work I'm currently doing in order to provide 
Libav with support for several other obscured and proprietary formats, 
fixing such things again and again wastes alot of my time and keep me 
away from doing perhaps more important stuff.


Thanks in advance!
Best regards
Maxim
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Luca Barbato
On 01/10/13 11:21, Vittorio Giovara wrote:
 Lacnzos for general case, sinc for upscaling, Gaussian for
 downscaling. According to various literature these scalers
 should be the best algirthms quality-wise for each case.
 
 Inspired from a patch by wm4 nfx...@googlemail.com
 ---
  libswscale/utils.c |   12 +++-
  1 file changed, 11 insertions(+), 1 deletion(-)
 

Ok.

lu

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


Re: [libav-devel] [PATCH] Generalize ATRAC3 gain compensation code

2013-10-01 Thread Luca Barbato
On 01/10/13 11:51, Maxim Polijakowski wrote:

 The above mentioned changes look rather trivial IMHO so I wonder if
 someone else could fix them all and push the patches. Taking in
 consideration the amount of work I'm currently doing in order to provide
 Libav with support for several other obscured and proprietary formats,
 fixing such things again and again wastes alot of my time and keep me
 away from doing perhaps more important stuff.
 

Hopefully whoever pushed it will do, for future reference is good anyway =)

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


Re: [libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Diego Biurrun
Note for committer:

On Tue, Oct 01, 2013 at 11:21:40AM +0200, Vittorio Giovara wrote:
 Lacnzos for general case, sinc for upscaling, Gaussian for

LaNCzos

 downscaling. According to various literature these scalers

s/various//

 should be the best algirthms quality-wise for each case.

algOrIthms

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


[libav-devel] [PATCH] mxfdec: add j2k codec to intra only codecs

2013-10-01 Thread Vittorio Giovara
From: Matthieu Bouron matthieu.bou...@gmail.com

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

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index d666b47..32f6c7d 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -928,6 +928,7 @@ static const MXFCodecUL 
mxf_intra_only_essence_container_uls[] = {
 /* intra-only PictureEssenceCoding ULs, where no corresponding EC UL exists */
 static const MXFCodecUL mxf_intra_only_picture_essence_coding_uls[] = {
 { { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x02,0x01,0x32,0x00,0x00 
}, 14,   AV_CODEC_ID_H264 }, /* H.264/MPEG-4 AVC Intra Profiles */
+{ { 
0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x07,0x04,0x01,0x02,0x02,0x03,0x01,0x01,0x00 
}, 14,   AV_CODEC_ID_JPEG2000 }, /* JPEG2000 Codestream */
 { { 
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 
},  0,   AV_CODEC_ID_NONE },
 };
 
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH 01/10] x86inc: activate REP_RET automatically

2013-10-01 Thread Loren Merritt
On Mon, 30 Sep 2013, Diego Biurrun wrote:

 On Mon, Sep 30, 2013 at 04:38:01PM +0100, Derek Buitenhuis wrote:
  On 9/30/2013 4:28 PM, Diego Biurrun wrote:
   Not sure what you are trying to achieve with the if, $(STRIP) should
   always be set ...
  
   If we bring back stripping, we'll need the rest of the portability
   parts from e0be794 as well.
 
  For now, I do not think this patch is necessary, no?

 Are you referring to 01/10 or the build system patch?

 If the latter, then I don't know what the side effect of keeping
 those labels around is ...

The effect of keeping those labels around is making debugging harder.
Because those labels are meaningless, and complicate the disassembly.
Also, gdb can't tell the difference between them and function entrypoints.

This new strip command is irrelevant to any usage of libav that would
have used the old fully stripped version, because the old one was for
non-debug use.

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


Re: [libav-devel] [PATCH 01/10] x86inc: activate REP_RET automatically

2013-10-01 Thread Luca Barbato
On 01/10/13 13:17, Loren Merritt wrote:
 On Mon, 30 Sep 2013, Diego Biurrun wrote:
 
 On Mon, Sep 30, 2013 at 04:38:01PM +0100, Derek Buitenhuis wrote:
 On 9/30/2013 4:28 PM, Diego Biurrun wrote:
 Not sure what you are trying to achieve with the if, $(STRIP) should
 always be set ...

 If we bring back stripping, we'll need the rest of the portability
 parts from e0be794 as well.

 For now, I do not think this patch is necessary, no?

 Are you referring to 01/10 or the build system patch?

 If the latter, then I don't know what the side effect of keeping
 those labels around is ...
 
 The effect of keeping those labels around is making debugging harder.
 Because those labels are meaningless, and complicate the disassembly.
 Also, gdb can't tell the difference between them and function entrypoints.
 
 This new strip command is irrelevant to any usage of libav that would
 have used the old fully stripped version, because the old one was for
 non-debug use.

Thanks for clear this point, makes sense then having it.

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


Re: [libav-devel] [PATCH] Generalize ATRAC3 gain compensation code

2013-10-01 Thread Maxim Polijakowski

[...]

--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -66,20 +62,8 @@ void ff_atrac_generate_tables(void)
-void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, 
float *delayBuf, float *temp)
+void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut,
+float *delayBuf, float *temp)

slightly unrelated cosmetics

Also, KR does not leave a space between the function name and the opening (.


It's not my code but I've fixed that anyway...


[...]


--- a/libavcodec/atrac.h
+++ b/libavcodec/atrac.h
@@ -28,6 +28,26 @@
+typedef struct AtracGainInfo {
+int   num_points; /// number of gain control points
+int   levcode[7]; /// level at corresponding control point
+int   loccode[7]; /// location of gain control points
+} AtracGainInfo;

Why is there code in these names and not point or points?


Because codes don't represent levels or locations directly and need to 
be scaled appropriately as follows:


location = loccode * 8;
level = pow(2, levcode - codec_specific_offset);

See attached patch...

Best regards
Maxim
From f82fde4838c6472a88dafc03a6522679c19df4e2 Mon Sep 17 00:00:00 2001
From: Maxim Poliakovski max_p...@gmx.de
Date: Mon, 30 Sep 2013 23:14:51 +0200
Subject: [PATCH 1/2] atrac: Move doxygen comments to the header

Also update copyright info and file description.
---
 libavcodec/atrac.c |   24 
 libavcodec/atrac.h |   23 +++
 2 files changed, 23 insertions(+), 24 deletions(-)

diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
index 6041a12..de2f131 100644
--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -1,6 +1,6 @@
 /*
- * ATRAC common functions
- * Copyright (c) 2006-2008 Maxim Poliakovski
+ * Common functions for the ATRAC family of decoders
+ * Copyright (c) 2006-2013 Maxim Poliakovski
  * Copyright (c) 2006-2008 Benjamin Larsson
  *
  * This file is part of Libav.
@@ -44,10 +44,6 @@ static const float qmf_48tap_half[24] = {
-0.043596379,   -0.099384367,   0.13207909,0.46424159
 };
 
-/**
- * Generate common tables
- */
-
 void ff_atrac_generate_tables(void)
 {
 int i;
@@ -66,20 +62,8 @@ void ff_atrac_generate_tables(void)
 }
 }
 
-
-/**
- * Quadrature mirror synthesis filter.
- *
- * @param inlo  lower part of spectrum
- * @param inhi  higher part of spectrum
- * @param nIn   size of spectrum buffer
- * @param pOut  out buffer
- * @param delayBuf  delayBuf buffer
- * @param temp  temp buffer
- */
-
-
-void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp)
+void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut,
+float *delayBuf, float *temp)
 {
 int   i, j;
 float   *p1, *p3;
diff --git a/libavcodec/atrac.h b/libavcodec/atrac.h
index 8e9ba59..6067f18 100644
--- a/libavcodec/atrac.h
+++ b/libavcodec/atrac.h
@@ -1,7 +1,7 @@
 /*
- * ATRAC common data
- * Copyright (c) 2009 Maxim Poliakovski
- * Copyright (c) 2009 Benjamin Larsson
+ * Common functions for the ATRAC family of decoders
+ * Copyright (c) 2009-2013 Maxim Poliakovski
+ * Copyright (c) 2009  Benjamin Larsson
  *
  * This file is part of Libav.
  *
@@ -30,7 +30,22 @@
 
 extern float ff_atrac_sf_table[64];
 
+/**
+ * Generate common tables.
+ */
 void ff_atrac_generate_tables(void);
-void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, float *delayBuf, float *temp);
+
+/**
+ * Quadrature mirror synthesis filter.
+ *
+ * @param inlo  lower part of spectrum
+ * @param inhi  higher part of spectrum
+ * @param nIn   size of spectrum buffer
+ * @param pOut  out buffer
+ * @param delayBuf  delayBuf buffer
+ * @param temp  temp buffer
+ */
+void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut,
+float *delayBuf, float *temp);
 
 #endif /* AVCODEC_ATRAC_H */
-- 
1.7.9.5

From f605b3261fef9ca886776ef6ef5c75d05273d46d Mon Sep 17 00:00:00 2001
From: Maxim Poliakovski max_p...@gmx.de
Date: Mon, 30 Sep 2013 23:14:51 +0200
Subject: [PATCH 2/2] atrac3: Generalize gain compensation code

Move it to atrac.c, so it can be reused within the upcoming ATRAC3+ decoder.
---
 libavcodec/atrac.c  |   65 +++-
 libavcodec/atrac.h  |   49 +++-
 libavcodec/atrac3.c |  103 ++-
 3 files changed, 130 insertions(+), 87 deletions(-)

diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
index de2f131..7469237 100644
--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -62,8 +62,69 @@ void ff_atrac_generate_tables(void)
 }
 }
 
-void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut,
-float *delayBuf, float *temp)
+av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset,
+ int loc_scale)
+{
+int i;
+
+

[libav-devel] [PATCH] mxf: Remove a typo

2013-10-01 Thread Luca Barbato
Introduced in 93370d1216
---
 libavformat/mxfdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index d666b47..5ca398e 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1533,7 +1533,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
 avpriv_set_pts_info(st, 64, descriptor-sample_rate.den, 
descriptor-sample_rate.num);
 } else {
 av_log(mxf-fc, AV_LOG_WARNING, invalid sample rate (%d/%d) 
-   found for stream #%, time base forced to 1/48000\n,
+   found for stream #%d, time base forced to 1/48000\n,
descriptor-sample_rate.num, 
descriptor-sample_rate.den,
st-index);
 avpriv_set_pts_info(st, 64, 1, 48000);
-- 
1.8.3.2

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


Re: [libav-devel] [PATCH] Generalize ATRAC3 gain compensation code

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 11:51:40AM +0200, Maxim Polijakowski wrote:
 [...]
 --- a/libavcodec/atrac3.c
 +++ b/libavcodec/atrac3.c
 @@ -417,90 +412,32 @@ static int decode_tonal_components(GetBitContext *gb,
   static int decode_gain_control(GetBitContext *gb, GainBlock *block,
  int num_bands)
   {
 -int i, cf, num_data;
 +int i, b;
   int *level, *loc;
 -for (i = 0; i = num_bands; i++) {
 -num_data  = get_bits(gb, 3);
 -gain[i].num_gain_data = num_data;
 -level = gain[i].lev_code;
 -loc   = gain[i].loc_code;
 +for (b = 0; b = num_bands; b++) {
 +gain[b].num_points = get_bits(gb, 3);
 +level  = gain[b].levcode;
 +loc= gain[b].loccode;
 -for (cf = 0; cf  gain[i].num_gain_data; cf++) {
 -level[cf] = get_bits(gb, 4);
 -loc  [cf] = get_bits(gb, 5);
 -if (cf  loc[cf] = loc[cf - 1])
 +for (i = 0; i  gain[b].num_points; i++) {
 +level[i] = get_bits(gb, 4);
 +loc  [i] = get_bits(gb, 5);
 +if (i  loc[i] = loc[i-1])
   return AVERROR_INVALIDDATA;
   }
   }
 -/* Clear the unused blocks. */
 -for (; i  4 ; i++)
 -gain[i].num_gain_data = 0;
 +/* Clear unused blocks. */
 +for (; b  4 ; b++)
 +gain[b].num_points = 0;
 
 Is there a reason to rename the counter variables?  It seems rather
 arbitrary and complicates the diff.
 
 Yes, the reason for rename this variable is to make it look more
 standard and readable. What does that cf stand for? Core
 Foundation or close file?
 i is unambiguous and clear, isn't it?

Yes, we usually use 'i' and 'j' as counter variables.

 The above mentioned changes look rather trivial IMHO so I wonder if
 someone else could fix them all and push the patches. Taking in
 consideration the amount of work I'm currently doing in order to
 provide Libav with support for several other obscured and
 proprietary formats, fixing such things again and again wastes alot
 of my time and keep me away from doing perhaps more important stuff.

And I'm helping you by doing all the postprocessing on ATRAC3+ :)

I could do all the work myself directly, but I choose to review your
patches so that in the future the postprocessing work is reduced while
you adapt a bit more to the modern libav style and workflow.  If we
get to that point, things will go much more smoothly.

I'll fix up and split/rebase this patchset later today.

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


Re: [libav-devel] [PATCH] Generalize ATRAC3 gain compensation code

2013-10-01 Thread Maxim Polijakowski

[...]


And I'm helping you by doing all the postprocessing on ATRAC3+ :)


Thank you for that once again!



I could do all the work myself directly, but I choose to review your
patches so that in the future the postprocessing work is reduced while
you adapt a bit more to the modern libav style and workflow.  If we
get to that point, things will go much more smoothly.


Alright.



I'll fix up and split/rebase this patchset later today.


The most things you pointed out in your last mail have just been fixed 
(see my previous mail).

Hopefully there is not much left to fix so you could push the patches soon.

Thanks in advance!
Best regards
Maxim
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] fate: add fieldorder filter test

2013-10-01 Thread Vittorio Giovara
---
 tests/fate/filter-video.mak  |4 +++
 tests/ref/fate/filter-fieldorder |   51 ++
 2 files changed, 55 insertions(+)
 create mode 100644 tests/ref/fate/filter-fieldorder

diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index 42b9356..e360e6d 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -21,6 +21,10 @@ fate-filter-drawbox: CMD = framecrc -c:v pgmyuv -i $(SRC) 
-vf drawbox=10:20:200:
 FATE_FILTER_VSYNTH-$(CONFIG_FADE_FILTER) += fate-filter-fade
 fate-filter-fade: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf 
fade=in:0:25,fade=out:25:25
 
+#this filter has to be tested against an interlaced video
+FATE_FILTER_VSYNTH-$(CONFIG_FIELDORDER_FILTER) += fate-filter-fieldorder
+fate-filter-fieldorder: CMD = framecrc -c:v dvvideo -i 
$(TARGET_PATH)/tests/data/fate/vsynth1-dv-50.dv -vf fieldorder=tff
+
 FATE_FILTER_VSYNTH-$(CONFIG_GRADFUN_FILTER) += fate-filter-gradfun
 fate-filter-gradfun: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf gradfun
 
diff --git a/tests/ref/fate/filter-fieldorder b/tests/ref/fate/filter-fieldorder
new file mode 100644
index 000..292d09b
--- /dev/null
+++ b/tests/ref/fate/filter-fieldorder
@@ -0,0 +1,51 @@
+#tb 0: 1/25
+0,  0,  0,1,   829440, 0x074e9a0d
+0,  1,  1,1,   829440, 0x470985c1
+0,  2,  2,1,   829440, 0xb400065f
+0,  3,  3,1,   829440, 0x3754df13
+0,  4,  4,1,   829440, 0x1f0368d2
+0,  5,  5,1,   829440, 0xd4cf2293
+0,  6,  6,1,   829440, 0xfc039763
+0,  7,  7,1,   829440, 0x3e065033
+0,  8,  8,1,   829440, 0x75a7552d
+0,  9,  9,1,   829440, 0xe05cfc31
+0, 10, 10,1,   829440, 0xc6448661
+0, 11, 11,1,   829440, 0xa52523c7
+0, 12, 12,1,   829440, 0x00bd6359
+0, 13, 13,1,   829440, 0xb4a62e32
+0, 14, 14,1,   829440, 0xb3097024
+0, 15, 15,1,   829440, 0x1e368012
+0, 16, 16,1,   829440, 0x58285c54
+0, 17, 17,1,   829440, 0xe7f3c0b9
+0, 18, 18,1,   829440, 0xa62df1be
+0, 19, 19,1,   829440, 0x49fe1a61
+0, 20, 20,1,   829440, 0xd6b3496b
+0, 21, 21,1,   829440, 0x95d4c6a7
+0, 22, 22,1,   829440, 0x55311a06
+0, 23, 23,1,   829440, 0xbdd884e6
+0, 24, 24,1,   829440, 0xcd9ebfeb
+0, 25, 25,1,   829440, 0x721abb21
+0, 26, 26,1,   829440, 0xef128df7
+0, 27, 27,1,   829440, 0x31b52465
+0, 28, 28,1,   829440, 0xcc1ea148
+0, 29, 29,1,   829440, 0x7a008cc6
+0, 30, 30,1,   829440, 0xd8e0c2fc
+0, 31, 31,1,   829440, 0x9af1877c
+0, 32, 32,1,   829440, 0x02a42cc2
+0, 33, 33,1,   829440, 0x45740521
+0, 34, 34,1,   829440, 0xe9faac6b
+0, 35, 35,1,   829440, 0x7545150b
+0, 36, 36,1,   829440, 0x4f702ba0
+0, 37, 37,1,   829440, 0x843219ba
+0, 38, 38,1,   829440, 0xdb94eab7
+0, 39, 39,1,   829440, 0x5c9ab8ab
+0, 40, 40,1,   829440, 0xd0421d6e
+0, 41, 41,1,   829440, 0x5cbe4616
+0, 42, 42,1,   829440, 0x4c9f45f0
+0, 43, 43,1,   829440, 0xc3ecd1a4
+0, 44, 44,1,   829440, 0x0b6ec947
+0, 45, 45,1,   829440, 0xac54fda1
+0, 46, 46,1,   829440, 0x80c3629c
+0, 47, 47,1,   829440, 0xcd5d6c59
+0, 48, 48,1,   829440, 0x6ea0a5f8
+0, 49, 49,1,   829440, 0xd4c54deb
-- 
1.7.9.5

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


[libav-devel] [PATCH] vf_interlace: do not process a n already interlaced frame

2013-10-01 Thread Vittorio Giovara
---
 libavfilter/vf_interlace.c |9 +
 1 file changed, 9 insertions(+)

diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
index d654739..2f4270c 100644
--- a/libavfilter/vf_interlace.c
+++ b/libavfilter/vf_interlace.c
@@ -181,6 +181,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 if (!s-cur || !s-next)
 return 0;
 
+if (s-cur-interlaced_frame) {
+av_log(ctx, AV_LOG_WARNING, video is already interlaced, adjusting 
framerate only\n);
+out = av_frame_clone(s-cur);
+out-pts /= 2;  // adjust pts to new framerate
+ret = ff_filter_frame(outlink, out);
+s-got_output = 1;
+return ret;
+}
+
 tff = (s-scan == MODE_TFF);
 out = ff_get_video_buffer(outlink, outlink-w, outlink-h);
 if (!out)
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] mxf: Remove a typo

2013-10-01 Thread Vittorio Giovara
On Tue, Oct 1, 2013 at 1:44 PM, Luca Barbato lu_z...@gentoo.org wrote:
 Introduced in 93370d1216
 ---
  libavformat/mxfdec.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

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


[libav-devel] [PATCH] rtmp: alias rtmp_listen to listen

2013-10-01 Thread Luca Barbato
Make it uniform with the other protocols.
---
 libavformat/rtmpproto.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 05b28a4..91f9b1c 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -2768,6 +2768,7 @@ static const AVOption rtmp_options[] = {
 {rtmp_swfverify, URL to player swf file, compute hash/size 
automatically., OFFSET(swfverify), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, 
DEC},
 {rtmp_tcurl, URL of the target stream. Defaults to 
proto://host[:port]/app., OFFSET(tcurl), AV_OPT_TYPE_STRING, {.str = NULL }, 
0, 0, DEC|ENC},
 {rtmp_listen, Listen for incoming rtmp connections, OFFSET(listen), 
AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, rtmp_listen },
+{listen,  Listen for incoming rtmp connections, OFFSET(listen), 
AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX, DEC, rtmp_listen },
 {timeout, Maximum timeout (in seconds) to wait for incoming 
connections. -1 is infinite. Implies -rtmp_listen 1,  OFFSET(listen_timeout), 
AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX, DEC, rtmp_listen },
 { NULL },
 };
-- 
1.8.3.2

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


[libav-devel] [PATCH] fate: add EXIF test

2013-10-01 Thread Vittorio Giovara
From: Thilo Borgmann thilo.borgm...@googlemail.com

---
This would require adding a few samples to FATE.
Double checking for this test is welcome ^^

Vittorio

 tests/Makefile |1 +
 tests/fate-run.sh  |4 +
 tests/fate/exif.mak|   14 ++
 tests/ref/fate/exif-image-embedded |  359 
 tests/ref/fate/exif-image-jpg  |   66 +++
 tests/ref/fate/exif-image-tiff |   25 +++
 6 files changed, 469 insertions(+)
 create mode 100644 tests/fate/exif.mak
 create mode 100644 tests/ref/fate/exif-image-embedded
 create mode 100644 tests/ref/fate/exif-image-jpg
 create mode 100644 tests/ref/fate/exif-image-tiff

diff --git a/tests/Makefile b/tests/Makefile
index 132a1a7..0d22b32 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -72,6 +72,7 @@ include $(SRC_PATH)/tests/fate/demux.mak
 include $(SRC_PATH)/tests/fate/dfa.mak
 include $(SRC_PATH)/tests/fate/dpcm.mak
 include $(SRC_PATH)/tests/fate/ea.mak
+include $(SRC_PATH)/tests/fate/exif.mak
 include $(SRC_PATH)/tests/fate/filter-audio.mak
 include $(SRC_PATH)/tests/fate/filter-video.mak
 include $(SRC_PATH)/tests/fate/flac.mak
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index b6c7384..903c95d 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -75,6 +75,10 @@ probefmt(){
 run avprobe -show_format_entry format_name -v 0 $@
 }
 
+probeframes(){
+run avprobe -show_frames -v 0 $@
+}
+
 avconv(){
 dec_opts=-threads $threads -thread_type $thread_type
 avconv_args=-nostats -cpuflags $cpuflags
diff --git a/tests/fate/exif.mak b/tests/fate/exif.mak
new file mode 100644
index 000..3953b62
--- /dev/null
+++ b/tests/fate/exif.mak
@@ -0,0 +1,14 @@
+# test exif metadata in TIFF images
+FATE_SAMPLES_EXIF-$(call DEMDEC, IMAGE2, TIFF) += fate-exif-image-tiff
+fate-exif-image-tiff: CMD = probeframes $(TARGET_SAMPLES)/exif/image_small.tiff
+
+# test exif metadata in JPG images
+FATE_SAMPLES_EXIF-$(call DEMDEC, IMAGE2, MJPEG) += fate-exif-image-jpg
+fate-exif-image-jpg: CMD = probeframes $(TARGET_SAMPLES)/exif/image_small.jpg
+
+# test exif metadata in MP3 with embedded JPEG images
+FATE_SAMPLES_EXIF-$(call ALLYES, MP3_DEMUXER IMAGE2_DEMUXER MJPEG_DECODER) += 
fate-exif-image-embedded
+fate-exif-image-embedded: CMD = probeframes 
$(TARGET_SAMPLES)/exif/embedded_small.mp3
+
+# add all -yes targets to the tested targets
+FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_EXIF-yes)
diff --git a/tests/ref/fate/exif-image-embedded 
b/tests/ref/fate/exif-image-embedded
new file mode 100644
index 000..39755a1
--- /dev/null
+++ b/tests/ref/fate/exif-image-embedded
@@ -0,0 +1,359 @@
+[FRAME]
+media_type=video
+key_frame=1
+pkt_pts=N/A
+pkt_pts_time=N/A
+pkt_dts=N/A
+pkt_dts_time=N/A
+pkt_duration=N/A
+pkt_duration_time=N/A
+pkt_pos=N/A
+pkt_size=15760
+width=263
+height=263
+pix_fmt=yuvj420p
+sample_aspect_ratio=1:1
+pict_type=I
+coded_picture_number=0
+display_picture_number=0
+interlaced_frame=0
+top_field_first=0
+repeat_pict=0
+TAG:UserComment=AppleMark
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=353600
+pkt_pts_time=0.025057
+pkt_dts=353600
+pkt_dts_time=0.025057
+pkt_duration=15040
+pkt_duration_time=0.001066
+pkt_pos=16292
+pkt_size=417
+sample_fmt=s16p
+nb_samples=47
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=368640
+pkt_pts_time=0.026122
+pkt_dts=368640
+pkt_dts_time=0.026122
+pkt_duration=368640
+pkt_duration_time=0.026122
+pkt_pos=16709
+pkt_size=418
+sample_fmt=s16p
+nb_samples=1152
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=737280
+pkt_pts_time=0.052245
+pkt_dts=737280
+pkt_dts_time=0.052245
+pkt_duration=368640
+pkt_duration_time=0.026122
+pkt_pos=17127
+pkt_size=418
+sample_fmt=s16p
+nb_samples=1152
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=1105920
+pkt_pts_time=0.078367
+pkt_dts=1105920
+pkt_dts_time=0.078367
+pkt_duration=368640
+pkt_duration_time=0.026122
+pkt_pos=17545
+pkt_size=418
+sample_fmt=s16p
+nb_samples=1152
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=1474560
+pkt_pts_time=0.104490
+pkt_dts=1474560
+pkt_dts_time=0.104490
+pkt_duration=368640
+pkt_duration_time=0.026122
+pkt_pos=17963
+pkt_size=418
+sample_fmt=s16p
+nb_samples=1152
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=1843200
+pkt_pts_time=0.130612
+pkt_dts=1843200
+pkt_dts_time=0.130612
+pkt_duration=368640
+pkt_duration_time=0.026122
+pkt_pos=18381
+pkt_size=418
+sample_fmt=s16p
+nb_samples=1152
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]
+media_type=audio
+key_frame=1
+pkt_pts=2211840
+pkt_pts_time=0.156735
+pkt_dts=2211840
+pkt_dts_time=0.156735
+pkt_duration=368640
+pkt_duration_time=0.026122
+pkt_pos=18799
+pkt_size=418
+sample_fmt=s16p
+nb_samples=1152
+channels=2
+channel_layout=stereo
+[/FRAME]
+[FRAME]

[libav-devel] [PATCH] fate: add vorbiscomment cover art test

2013-10-01 Thread Vittorio Giovara
From: James Almer jamr...@gmail.com

Signed-off-by: James Almer jamr...@gmail.com
Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 tests/fate/cover-art.mak |4 
 1 file changed, 4 insertions(+)

diff --git a/tests/fate/cover-art.mak b/tests/fate/cover-art.mak
index e09a50b..a2c8bdc 100644
--- a/tests/fate/cover-art.mak
+++ b/tests/fate/cover-art.mak
@@ -26,6 +26,10 @@ FATE_COVER_ART += fate-cover-art-wv
 fate-cover-art-wv: CMD = md5 -i 
$(TARGET_SAMPLES)/cover_art/luckynight_cover.wv -an -c:v copy -f rawvideo
 fate-cover-art-wv: REF = 45333c983c45af54449dff10af144317
 
+FATE_COVER_ART-$(CONFIG_OGG_DEMUXER) += fate-cover-art-ogg
+fate-cover-art-ogg: CMD = md5 -i 
$(TARGET_SAMPLES)/cover_art/ogg_vorbiscomment_cover.opus -map 0:v -c:v copy -f 
rawvideo
+fate-cover-art-ogg: REF = 7f117e073620eabb4ed02680cf70af41
+
 $(FATE_COVER_ART): CMP = oneline
 FATE_SAMPLES_AVCONV += $(FATE_COVER_ART)
 fate-cover-art: $(FATE_COVER_ART)
-- 
1.7.9.5

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


[libav-devel] [PATCH] fate: add ffv1.0 test

2013-10-01 Thread Vittorio Giovara
From: Michael Niedermayer michae...@gmx.at

Signed-off-by: Michael Niedermayer michae...@gmx.at
---
 tests/fate/vcodec.mak   |3 ++-
 tests/ref/vsynth/vsynth1-ffv1.0 |4 
 tests/ref/vsynth/vsynth2-ffv1.0 |4 
 3 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100644 tests/ref/vsynth/vsynth1-ffv1.0
 create mode 100644 tests/ref/vsynth/vsynth2-ffv1.0

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index ed9fa2e..6d247a6 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -52,8 +52,9 @@ fate-vsynth%-dv-50:  ENCOPTS = -dct int -s pal 
-pix_fmt yuv422p \
 fate-vsynth%-dv-50:  DECOPTS = -sws_flags neighbor
 fate-vsynth%-dv-50:  FMT = dv
 
-FATE_VCODEC-$(call ENCDEC, FFV1, AVI)   += ffv1
+FATE_VCODEC-$(call ENCDEC, FFV1, AVI)   += ffv1 ffv1.0
 fate-vsynth%-ffv1:   ENCOPTS = -slices 4 -strict -2
+fate-vsynth%-ffv1.0: CODEC   = ffv1
 
 FATE_VCODEC-$(call ENCDEC, FFVHUFF, AVI) += ffvhuff
 
diff --git a/tests/ref/vsynth/vsynth1-ffv1.0 b/tests/ref/vsynth/vsynth1-ffv1.0
new file mode 100644
index 000..2a4f41c
--- /dev/null
+++ b/tests/ref/vsynth/vsynth1-ffv1.0
@@ -0,0 +1,4 @@
+91c237f18bc19975077c85175daed734 *tests/data/fate/vsynth1-ffv1.0.avi
+2655364 tests/data/fate/vsynth1-ffv1.0.avi
+c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1.0.out.rawvideo
+stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-ffv1.0 b/tests/ref/vsynth/vsynth2-ffv1.0
new file mode 100644
index 000..962c17c
--- /dev/null
+++ b/tests/ref/vsynth/vsynth2-ffv1.0
@@ -0,0 +1,4 @@
+3a757276e299bf88c30e06dfb53f1c99 *tests/data/fate/vsynth2-ffv1.0.avi
+3525792 tests/data/fate/vsynth2-ffv1.0.avi
+dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-ffv1.0.out.rawvideo
+stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  7603200/  7603200
-- 
1.7.9.5

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


[libav-devel] [PATCH] fate: add a ProRes transparency test

2013-10-01 Thread Vittorio Giovara
From: Carl Eugen Hoyos ceho...@ag.or.at

---
 tests/fate/prores.mak  |2 ++
 tests/ref/fate/prores-transparency |5 +
 2 files changed, 7 insertions(+)
 create mode 100644 tests/ref/fate/prores-transparency

diff --git a/tests/fate/prores.mak b/tests/fate/prores.mak
index 8d4b6ac..3bc2fe1 100644
--- a/tests/fate/prores.mak
+++ b/tests/fate/prores.mak
@@ -3,6 +3,7 @@ FATE_PRORES = fate-prores-422   
\
   fate-prores-422_lt\
   fate-prores-422_proxy \
   fate-prores-alpha \
+  fate-prores-transparency  \
 
 FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PRORES) += $(FATE_PRORES)
 fate-prores: $(FATE_PRORES)
@@ -12,3 +13,4 @@ fate-prores-422_hq:CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-App
 fate-prores-422_lt:CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le
 fate-prores-422_proxy: CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt 
yuv422p10le
 fate-prores-alpha: CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt 
yuva444p10le
+fate-prores-transparency: CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/prores_with_transparency.mov -pix_fmt yuva444p10le
diff --git a/tests/ref/fate/prores-transparency 
b/tests/ref/fate/prores-transparency
new file mode 100644
index 000..3842970
--- /dev/null
+++ b/tests/ref/fate/prores-transparency
@@ -0,0 +1,5 @@
+#tb 0: 1/25
+#tb 1: 1/48000
+0,  0,  0,1, 16588800, 0x87f98f3c
+1,  0,  0, 1024, 4096, 0x
+1,   1024,   1024,  896, 3584, 0x
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] fate: add fieldorder filter test

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 02:46:50PM +0200, Vittorio Giovara wrote:
 --- a/tests/fate/filter-video.mak
 +++ b/tests/fate/filter-video.mak
 @@ -21,6 +21,10 @@ fate-filter-drawbox: CMD = framecrc -c:v pgmyuv -i $(SRC) 
 -vf drawbox=10:20:200:
  FATE_FILTER_VSYNTH-$(CONFIG_FADE_FILTER) += fate-filter-fade
  fate-filter-fade: CMD = framecrc -c:v pgmyuv -i $(SRC) -vf 
 fade=in:0:25,fade=out:25:25
  
 +#this filter has to be tested against an interlaced video
 +FATE_FILTER_VSYNTH-$(CONFIG_FIELDORDER_FILTER) += fate-filter-fieldorder
 +fate-filter-fieldorder: CMD = framecrc -c:v dvvideo -i 
 $(TARGET_PATH)/tests/data/fate/vsynth1-dv-50.dv -vf fieldorder=tff

This does not really fit in the VSYNTH group, it does not use SRC and I
don't think it depends on VREF.

It does depend on vsynth1-dv-50.dv and the DV video encoder though.

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


Re: [libav-devel] [PATCH] vf_interlace: do not process a n already interlaced frame

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 03:11:47PM +0200, Vittorio Giovara wrote:
 ---
  libavfilter/vf_interlace.c |9 +
  1 file changed, 9 insertions(+)

a n -- an

 --- a/libavfilter/vf_interlace.c
 +++ b/libavfilter/vf_interlace.c
 @@ -181,6 +181,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
 *buf)
  
 +if (s-cur-interlaced_frame) {
 +av_log(ctx, AV_LOG_WARNING, video is already interlaced, adjusting 
 framerate only\n);

nit: long line

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


Re: [libav-devel] [PATCH] fate: add EXIF test

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 03:51:43PM +0200, Vittorio Giovara wrote:
 --- /dev/null
 +++ b/tests/fate/exif.mak
 @@ -0,0 +1,14 @@
 +
 +# add all -yes targets to the tested targets
 +FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_EXIF-yes)

No such variable here; this patch appears untested.

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


Re: [libav-devel] [PATCH] fate: add vorbiscomment cover art test

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 04:21:04PM +0200, Vittorio Giovara wrote:
 --- a/tests/fate/cover-art.mak
 +++ b/tests/fate/cover-art.mak
 @@ -26,6 +26,10 @@ FATE_COVER_ART += fate-cover-art-wv
  fate-cover-art-wv: CMD = md5 -i 
 $(TARGET_SAMPLES)/cover_art/luckynight_cover.wv -an -c:v copy -f rawvideo
  fate-cover-art-wv: REF = 45333c983c45af54449dff10af144317
  
 +FATE_COVER_ART-$(CONFIG_OGG_DEMUXER) += fate-cover-art-ogg
 +fate-cover-art-ogg: CMD = md5 -i 
 $(TARGET_SAMPLES)/cover_art/ogg_vorbiscomment_cover.opus -map 0:v -c:v copy 
 -f rawvideo
 +fate-cover-art-ogg: REF = 7f117e073620eabb4ed02680cf70af41

This was previously in alphabetical order.

Does decoding/demuxing the opus file work?

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


Re: [libav-devel] [PATCH] fate: add a ProRes transparency test

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 04:41:53PM +0200, Vittorio Giovara wrote:
 From: Carl Eugen Hoyos ceho...@ag.or.at
 
 ---
  tests/fate/prores.mak  |2 ++
  tests/ref/fate/prores-transparency |5 +
  2 files changed, 7 insertions(+)
  create mode 100644 tests/ref/fate/prores-transparency

probably OK

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


Re: [libav-devel] [PATCH] fate: add EXIF test

2013-10-01 Thread Luca Barbato
On 01/10/13 15:51, Vittorio Giovara wrote:
 From: Thilo Borgmann thilo.borgm...@googlemail.com
 
 ---
 This would require adding a few samples to FATE.
 Double checking for this test is welcome ^^
 
 Vittorio
 
  tests/Makefile |1 +
  tests/fate-run.sh  |4 +
  tests/fate/exif.mak|   14 ++
  tests/ref/fate/exif-image-embedded |  359 
 
  tests/ref/fate/exif-image-jpg  |   66 +++
  tests/ref/fate/exif-image-tiff |   25 +++
  6 files changed, 469 insertions(+)
  create mode 100644 tests/fate/exif.mak
  create mode 100644 tests/ref/fate/exif-image-embedded
  create mode 100644 tests/ref/fate/exif-image-jpg
  create mode 100644 tests/ref/fate/exif-image-tiff
 
 diff --git a/tests/Makefile b/tests/Makefile
 index 132a1a7..0d22b32 100644
 --- a/tests/Makefile
 +++ b/tests/Makefile
 @@ -72,6 +72,7 @@ include $(SRC_PATH)/tests/fate/demux.mak
  include $(SRC_PATH)/tests/fate/dfa.mak
  include $(SRC_PATH)/tests/fate/dpcm.mak
  include $(SRC_PATH)/tests/fate/ea.mak
 +include $(SRC_PATH)/tests/fate/exif.mak
  include $(SRC_PATH)/tests/fate/filter-audio.mak
  include $(SRC_PATH)/tests/fate/filter-video.mak
  include $(SRC_PATH)/tests/fate/flac.mak
 diff --git a/tests/fate-run.sh b/tests/fate-run.sh
 index b6c7384..903c95d 100755
 --- a/tests/fate-run.sh
 +++ b/tests/fate-run.sh
 @@ -75,6 +75,10 @@ probefmt(){
  run avprobe -show_format_entry format_name -v 0 $@
  }
  
 +probeframes(){
 +run avprobe -show_frames -v 0 $@
 +}

Remind me to make fate-run.sh a fate-run.d we have too many applets.

You would need to implement show_frames btw.

  avconv(){
  dec_opts=-threads $threads -thread_type $thread_type
  avconv_args=-nostats -cpuflags $cpuflags
 diff --git a/tests/fate/exif.mak b/tests/fate/exif.mak
 new file mode 100644
 index 000..3953b62
 --- /dev/null
 +++ b/tests/fate/exif.mak

diegoAlphabetical order might be nice/diego

 @@ -0,0 +1,14 @@
 +# test exif metadata in TIFF images
 +FATE_SAMPLES_EXIF-$(call DEMDEC, IMAGE2, TIFF) += fate-exif-image-tiff
 +fate-exif-image-tiff: CMD = probeframes 
 $(TARGET_SAMPLES)/exif/image_small.tiff
 +
 +# test exif metadata in JPG images
 +FATE_SAMPLES_EXIF-$(call DEMDEC, IMAGE2, MJPEG) += fate-exif-image-jpg
 +fate-exif-image-jpg: CMD = probeframes $(TARGET_SAMPLES)/exif/image_small.jpg
 +
 +# test exif metadata in MP3 with embedded JPEG images
 +FATE_SAMPLES_EXIF-$(call ALLYES, MP3_DEMUXER IMAGE2_DEMUXER MJPEG_DECODER) 
 += fate-exif-image-embedded
 +fate-exif-image-embedded: CMD = probeframes 
 $(TARGET_SAMPLES)/exif/embedded_small.mp3
 +
 +# add all -yes targets to the tested targets
 +FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_EXIF-yes)

adding a fate-exif shorthand would be nice, exif can be embedded on videos?

 diff --git a/tests/ref/fate/exif-image-embedded 
 b/tests/ref/fate/exif-image-embedded
 new file mode 100644
 index 000..39755a1
 --- /dev/null

The references are bogus, by default we should use the ini markup now.

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


Re: [libav-devel] [PATCH] fate: add a ProRes transparency test

2013-10-01 Thread Luca Barbato
On 01/10/13 16:41, Vittorio Giovara wrote:
 From: Carl Eugen Hoyos ceho...@ag.or.at
 
 ---
  tests/fate/prores.mak  |2 ++
  tests/ref/fate/prores-transparency |5 +
  2 files changed, 7 insertions(+)
  create mode 100644 tests/ref/fate/prores-transparency
 
 diff --git a/tests/fate/prores.mak b/tests/fate/prores.mak
 index 8d4b6ac..3bc2fe1 100644
 --- a/tests/fate/prores.mak
 +++ b/tests/fate/prores.mak
 @@ -3,6 +3,7 @@ FATE_PRORES = fate-prores-422 
   \
fate-prores-422_lt\
fate-prores-422_proxy \
fate-prores-alpha \
 +  fate-prores-transparency  \
  
  FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PRORES) += $(FATE_PRORES)
  fate-prores: $(FATE_PRORES)
 @@ -12,3 +13,4 @@ fate-prores-422_hq:CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-App
  fate-prores-422_lt:CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt 
 yuv422p10le
  fate-prores-422_proxy: CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt 
 yuv422p10le
  fate-prores-alpha: CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt 
 yuva444p10le
 +fate-prores-transparency: CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/prores_with_transparency.mov -pix_fmt 
 yuva444p10le
 diff --git a/tests/ref/fate/prores-transparency 
 b/tests/ref/fate/prores-transparency
 new file mode 100644
 index 000..3842970
 --- /dev/null
 +++ b/tests/ref/fate/prores-transparency
 @@ -0,0 +1,5 @@
 +#tb 0: 1/25
 +#tb 1: 1/48000
 +0,  0,  0,1, 16588800, 0x87f98f3c

-an is due.


 +1,  0,  0, 1024, 4096, 0x
 +1,   1024,   1024,  896, 3584, 0x
 

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


[libav-devel] [PATCH] fate: add a ProRes transparency test

2013-10-01 Thread Vittorio Giovara
From: Carl Eugen Hoyos ceho...@ag.or.at

---
 tests/fate/prores.mak  |2 ++
 tests/ref/fate/prores-transparency |5 +
 2 files changed, 7 insertions(+)
 create mode 100644 tests/ref/fate/prores-transparency

diff --git a/tests/fate/prores.mak b/tests/fate/prores.mak
index 8d4b6ac..8341a68 100644
--- a/tests/fate/prores.mak
+++ b/tests/fate/prores.mak
@@ -3,6 +3,7 @@ FATE_PRORES = fate-prores-422   
\
   fate-prores-422_lt\
   fate-prores-422_proxy \
   fate-prores-alpha \
+  fate-prores-transparency  \
 
 FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PRORES) += $(FATE_PRORES)
 fate-prores: $(FATE_PRORES)
@@ -12,3 +13,4 @@ fate-prores-422_hq:CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-App
 fate-prores-422_lt:CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt yuv422p10le
 fate-prores-422_proxy: CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt 
yuv422p10le
 fate-prores-alpha: CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt 
yuva444p10le
+fate-prores-transparency: CMD = framecrc -i 
$(TARGET_SAMPLES)/prores/prores_with_transparency.mov -pix_fmt yuva444p10le 
-an
diff --git a/tests/ref/fate/prores-transparency 
b/tests/ref/fate/prores-transparency
new file mode 100644
index 000..3842970
--- /dev/null
+++ b/tests/ref/fate/prores-transparency
@@ -0,0 +1,5 @@
+#tb 0: 1/25
+#tb 1: 1/48000
+0,  0,  0,1, 16588800, 0x87f98f3c
+1,  0,  0, 1024, 4096, 0x
+1,   1024,   1024,  896, 3584, 0x
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] fate: add a ProRes transparency test

2013-10-01 Thread Luca Barbato
On 01/10/13 17:09, Vittorio Giovara wrote:
 From: Carl Eugen Hoyos ceho...@ag.or.at
 
 ---
  tests/fate/prores.mak  |2 ++
  tests/ref/fate/prores-transparency |5 +
  2 files changed, 7 insertions(+)
  create mode 100644 tests/ref/fate/prores-transparency
 
 diff --git a/tests/fate/prores.mak b/tests/fate/prores.mak
 index 8d4b6ac..8341a68 100644
 --- a/tests/fate/prores.mak
 +++ b/tests/fate/prores.mak
 @@ -3,6 +3,7 @@ FATE_PRORES = fate-prores-422 
   \
fate-prores-422_lt\
fate-prores-422_proxy \
fate-prores-alpha \
 +  fate-prores-transparency  \
  
  FATE_SAMPLES_AVCONV-$(call DEMDEC, MOV, PRORES) += $(FATE_PRORES)
  fate-prores: $(FATE_PRORES)
 @@ -12,3 +13,4 @@ fate-prores-422_hq:CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-App
  fate-prores-422_lt:CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_LT.mov -pix_fmt 
 yuv422p10le
  fate-prores-422_proxy: CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_422_Proxy.mov -pix_fmt 
 yuv422p10le
  fate-prores-alpha: CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/Sequence_1-Apple_ProRes_with_Alpha.mov -pix_fmt 
 yuva444p10le
 +fate-prores-transparency: CMD = framecrc -i 
 $(TARGET_SAMPLES)/prores/prores_with_transparency.mov -pix_fmt 
 yuva444p10le -an
 diff --git a/tests/ref/fate/prores-transparency 
 b/tests/ref/fate/prores-transparency
 new file mode 100644
 index 000..3842970
 --- /dev/null
 +++ b/tests/ref/fate/prores-transparency
 @@ -0,0 +1,5 @@
 +#tb 0: 1/25
 +#tb 1: 1/48000
 +0,  0,  0,1, 16588800, 0x87f98f3c
 +1,  0,  0, 1024, 4096, 0x
 +1,   1024,   1024,  896, 3584, 0x

redo the sample please and rename the test prores-444_alpha while at it

lu

 

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


Re: [libav-devel] [PATCH] fate: add EXIF test

2013-10-01 Thread Vittorio Giovara
On Tue, Oct 1, 2013 at 4:55 PM, Diego Biurrun di...@biurrun.de wrote:
 On Tue, Oct 01, 2013 at 03:51:43PM +0200, Vittorio Giovara wrote:
 --- /dev/null
 +++ b/tests/fate/exif.mak
 @@ -0,0 +1,14 @@
 +
 +# add all -yes targets to the tested targets
 +FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_EXIF-yes)

 No such variable here; this patch appears untested.

Badly backported actually, I'll patch this up (maybe with some help ^^)

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


Re: [libav-devel] [PATCH] fate: add EXIF test

2013-10-01 Thread Luca Barbato
On 01/10/13 18:04, Vittorio Giovara wrote:
 On Tue, Oct 1, 2013 at 4:55 PM, Diego Biurrun di...@biurrun.de wrote:
 On Tue, Oct 01, 2013 at 03:51:43PM +0200, Vittorio Giovara wrote:
 --- /dev/null
 +++ b/tests/fate/exif.mak
 @@ -0,0 +1,14 @@
 +
 +# add all -yes targets to the tested targets
 +FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_EXIF-yes)

 No such variable here; this patch appears untested.
 
 Badly backported actually, I'll patch this up (maybe with some help ^^)

Steps:

- make so avprobe outputs that data or use avconv to extract it
- write down the testcases accordingly
- do not spam loads of pointless audio since exif is supposed to be for
images.

lu

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


Re: [libav-devel] [PATCH] fate: add EXIF test

2013-10-01 Thread Justin Ruggles

On 10/01/2013 12:10 PM, Luca Barbato wrote:

On 01/10/13 18:04, Vittorio Giovara wrote:

On Tue, Oct 1, 2013 at 4:55 PM, Diego Biurrun di...@biurrun.de wrote:

On Tue, Oct 01, 2013 at 03:51:43PM +0200, Vittorio Giovara wrote:

--- /dev/null
+++ b/tests/fate/exif.mak
@@ -0,0 +1,14 @@
+
+# add all -yes targets to the tested targets
+FATE_SAMPLES_FFMPEG += $(FATE_SAMPLES_EXIF-yes)


No such variable here; this patch appears untested.


Badly backported actually, I'll patch this up (maybe with some help ^^)


Steps:

- make so avprobe outputs that data or use avconv to extract it
- write down the testcases accordingly
- do not spam loads of pointless audio since exif is supposed to be for
images.


you forgot:
- port the actual exif support

Justin

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


Re: [libav-devel] [PATCH] fate: add a ProRes transparency test

2013-10-01 Thread Vittorio Giovara
On Tue, Oct 1, 2013 at 5:38 PM, Luca Barbato lu_z...@gentoo.org wrote:
 On 01/10/13 17:09, Vittorio Giovara wrote:
 From: Carl Eugen Hoyos ceho...@ag.or.at

 redo the sample please and rename the test prores-444_alpha while at it

The fate-prores-alpha test already covers everything that
prores_with_transparency.mov offers, this patch should be dropped.
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH] vf_interlace: do not process an already interlaced frame

2013-10-01 Thread Vittorio Giovara
---
 libavfilter/vf_interlace.c |   10 ++
 1 file changed, 10 insertions(+)

diff --git a/libavfilter/vf_interlace.c b/libavfilter/vf_interlace.c
index d654739..139d5b0 100644
--- a/libavfilter/vf_interlace.c
+++ b/libavfilter/vf_interlace.c
@@ -181,6 +181,16 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 if (!s-cur || !s-next)
 return 0;
 
+if (s-cur-interlaced_frame) {
+av_log(ctx, AV_LOG_WARNING,
+   video is already interlaced, adjusting framerate only\n);
+out = av_frame_clone(s-cur);
+out-pts /= 2;  // adjust pts to new framerate
+ret = ff_filter_frame(outlink, out);
+s-got_output = 1;
+return ret;
+}
+
 tff = (s-scan == MODE_TFF);
 out = ff_get_video_buffer(outlink, outlink-w, outlink-h);
 if (!out)
-- 
1.7.9.5

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


[libav-devel] [PATCH] swscale: provide a default scaler if none is set

2013-10-01 Thread Vittorio Giovara
Lanczos for general case, sinc for upscaling, Gaussian for
downscaling. According to current literature these scalers
should be the best quality-wise algorithms for each case.

Inspired from a patch by wm4 nfx...@googlemail.com
---
Fixed commit message typos.
Vittorio

 libswscale/utils.c |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2781985..2111fc2 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -914,7 +914,17 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter 
*srcFilter,
  SWS_SINC  |
  SWS_SPLINE|
  SWS_BICUBLIN);
-if (!i || (i  (i - 1))) {
+
+/* provide a default scaler if not set by caller */
+if (!i) {
+if (dstW  srcW  dstH  srcH)
+flags |= SWS_GAUSS;
+else if (dstW  srcW  dstH  srcH)
+flags |= SWS_SINC;
+else
+flags |= SWS_LANCZOS;
+c-flags = flags;
+} else if (i  (i - 1)) {
 av_log(c, AV_LOG_ERROR,
Exactly one scaler algorithm must be chosen\n);
 return AVERROR(EINVAL);
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH] fate: add ffv1.0 test

2013-10-01 Thread Vittorio Giovara
On Tue, Oct 1, 2013 at 4:33 PM, Vittorio Giovara
vittorio.giov...@gmail.com wrote:
 From: Michael Niedermayer michae...@gmx.at

 Signed-off-by: Michael Niedermayer michae...@gmx.at
 ---
  tests/fate/vcodec.mak   |3 ++-
  tests/ref/vsynth/vsynth1-ffv1.0 |4 
  tests/ref/vsynth/vsynth2-ffv1.0 |4 
  3 files changed, 10 insertions(+), 1 deletion(-)
  create mode 100644 tests/ref/vsynth/vsynth1-ffv1.0
  create mode 100644 tests/ref/vsynth/vsynth2-ffv1.0

 diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
 index ed9fa2e..6d247a6 100644
 --- a/tests/fate/vcodec.mak
 +++ b/tests/fate/vcodec.mak
 @@ -52,8 +52,9 @@ fate-vsynth%-dv-50:  ENCOPTS = -dct int -s pal 
 -pix_fmt yuv422p \
  fate-vsynth%-dv-50:  DECOPTS = -sws_flags neighbor
  fate-vsynth%-dv-50:  FMT = dv

 -FATE_VCODEC-$(call ENCDEC, FFV1, AVI)   += ffv1
 +FATE_VCODEC-$(call ENCDEC, FFV1, AVI)   += ffv1 ffv1.0
  fate-vsynth%-ffv1:   ENCOPTS = -slices 4 -strict -2
 +fate-vsynth%-ffv1.0: CODEC   = ffv1

  FATE_VCODEC-$(call ENCDEC, FFVHUFF, AVI) += ffvhuff

 diff --git a/tests/ref/vsynth/vsynth1-ffv1.0 b/tests/ref/vsynth/vsynth1-ffv1.0
 new file mode 100644
 index 000..2a4f41c
 --- /dev/null
 +++ b/tests/ref/vsynth/vsynth1-ffv1.0
 @@ -0,0 +1,4 @@
 +91c237f18bc19975077c85175daed734 *tests/data/fate/vsynth1-ffv1.0.avi
 +2655364 tests/data/fate/vsynth1-ffv1.0.avi
 +c5ccac874dbf808e9088bc3107860042 *tests/data/fate/vsynth1-ffv1.0.out.rawvideo
 +stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  7603200/  7603200
 diff --git a/tests/ref/vsynth/vsynth2-ffv1.0 b/tests/ref/vsynth/vsynth2-ffv1.0
 new file mode 100644
 index 000..962c17c
 --- /dev/null
 +++ b/tests/ref/vsynth/vsynth2-ffv1.0
 @@ -0,0 +1,4 @@
 +3a757276e299bf88c30e06dfb53f1c99 *tests/data/fate/vsynth2-ffv1.0.avi
 +3525792 tests/data/fate/vsynth2-ffv1.0.avi
 +dde5895817ad9d219f79a52d0bdfb001 *tests/data/fate/vsynth2-ffv1.0.out.rawvideo
 +stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  7603200/  7603200

Unless anyone objects, I think that this is fine to drop as well, the
ffv1 test is enough.
Vittorio
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 6/8] x86: Initialize mmxext after amd3dnow optimizations

2013-10-01 Thread Diego Biurrun
The mmxext optimizations should be faster if available and should
thus override the amd3dnow optimizations, not the other way around.
---
 libavcodec/x86/cavsdsp.c|8 
 libavcodec/x86/dsputilenc_mmx.c |   14 +++---
 libavcodec/x86/hpeldsp_init.c   |6 +++---
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 9d2b950..bc9cbf7 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -547,12 +547,12 @@ av_cold void ff_cavsdsp_init_x86(CAVSDSPContext *c, 
AVCodecContext *avctx)
 if (INLINE_MMX(cpu_flags))
 cavsdsp_init_mmx(c, avctx);
 #endif /* HAVE_MMX_INLINE */
-#if HAVE_MMXEXT_INLINE
-if (INLINE_MMXEXT(cpu_flags))
-cavsdsp_init_mmxext(c, avctx);
-#endif /* HAVE_MMXEXT_INLINE */
 #if HAVE_AMD3DNOW_INLINE
 if (INLINE_AMD3DNOW(cpu_flags))
 cavsdsp_init_3dnow(c, avctx);
 #endif /* HAVE_AMD3DNOW_INLINE */
+#if HAVE_MMXEXT_INLINE
+if (INLINE_MMXEXT(cpu_flags))
+cavsdsp_init_mmxext(c, avctx);
+#endif /* HAVE_MMXEXT_INLINE */
 }
diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
index 33c8d51..a1f80af 100644
--- a/libavcodec/x86/dsputilenc_mmx.c
+++ b/libavcodec/x86/dsputilenc_mmx.c
@@ -991,6 +991,13 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, 
AVCodecContext *avctx)
 c-ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
 }
 
+if (INLINE_AMD3DNOW(cpu_flags)) {
+if (!(avctx-flags  CODEC_FLAG_BITEXACT)) {
+c-try_8x8basis = try_8x8basis_3dnow;
+}
+c-add_8x8basis = add_8x8basis_3dnow;
+}
+
 if (INLINE_MMXEXT(cpu_flags)) {
 if (avctx-bits_per_raw_sample = 8 
 (dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
@@ -1023,13 +1030,6 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, 
AVCodecContext *avctx)
 c-sum_abs_dctelem = sum_abs_dctelem_ssse3;
 }
 #endif
-
-if (INLINE_AMD3DNOW(cpu_flags)) {
-if (!(avctx-flags  CODEC_FLAG_BITEXACT)) {
-c-try_8x8basis = try_8x8basis_3dnow;
-}
-c-add_8x8basis = add_8x8basis_3dnow;
-}
 #endif /* HAVE_INLINE_ASM */
 
 if (EXTERNAL_MMX(cpu_flags)) {
diff --git a/libavcodec/x86/hpeldsp_init.c b/libavcodec/x86/hpeldsp_init.c
index 209781c..3bc5601 100644
--- a/libavcodec/x86/hpeldsp_init.c
+++ b/libavcodec/x86/hpeldsp_init.c
@@ -258,12 +258,12 @@ void ff_hpeldsp_init_x86(HpelDSPContext *c, int flags)
 if (INLINE_MMX(cpu_flags))
 hpeldsp_init_mmx(c, flags, cpu_flags);
 
-if (EXTERNAL_MMXEXT(cpu_flags))
-hpeldsp_init_mmxext(c, flags, cpu_flags);
-
 if (EXTERNAL_AMD3DNOW(cpu_flags))
 hpeldsp_init_3dnow(c, flags, cpu_flags);
 
+if (EXTERNAL_MMXEXT(cpu_flags))
+hpeldsp_init_mmxext(c, flags, cpu_flags);
+
 if (EXTERNAL_SSE2(cpu_flags))
 hpeldsp_init_sse2(c, flags, cpu_flags);
 }
-- 
1.7.9.5

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


[libav-devel] [PATCH 5/8] x86: fdct: Only build fdct code if encoders have been enabled

2013-10-01 Thread Diego Biurrun
fdct is only initialized if encoders are enabled.
---
 libavcodec/x86/Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 06c1cd3..684b4ee 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -8,6 +8,7 @@ OBJS-$(CONFIG_DCT) += x86/dct_init.o
 OBJS-$(CONFIG_DNXHD_ENCODER)   += x86/dnxhdenc.o
 OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_init.o
 OBJS-$(CONFIG_ENCODERS)+= x86/dsputilenc_mmx.o  \
+  x86/fdct.o\
   x86/motion_est.o
 OBJS-$(CONFIG_FFT) += x86/fft_init.o
 OBJS-$(CONFIG_H264CHROMA)  += x86/h264chroma_init.o
@@ -35,7 +36,6 @@ OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o
 OBJS-$(CONFIG_XMM_CLOBBER_TEST)+= x86/w64xmmtest.o
 
 MMX-OBJS-$(CONFIG_DSPUTIL) += x86/dsputil_mmx.o \
-  x86/fdct.o\
   x86/fpel_mmx.o\
   x86/idct_mmx_xvid.o   \
   x86/idct_sse2_xvid.o  \
-- 
1.7.9.5

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


[libav-devel] [PATCH 2/8] x86: xviddct: Employ more specific ifdefs

2013-10-01 Thread Diego Biurrun
This avoids building mmxext and sse2 code when disabled by configure.
---
 libavcodec/dct-test.c   |8 
 libavcodec/x86/idct_mmx_xvid.c  |   32 ++--
 libavcodec/x86/idct_sse2_xvid.c |4 ++--
 3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c
index 0f7f5c3..730a368 100644
--- a/libavcodec/dct-test.c
+++ b/libavcodec/dct-test.c
@@ -84,7 +84,11 @@ static const struct algo fdct_tab[] = {
 
 #if HAVE_MMX_INLINE
 { MMX,ff_fdct_mmx,   NO_PERM,   AV_CPU_FLAG_MMX 
},
+#endif
+#if HAVE_MMXEXT_INLINE
 { MMXEXT, ff_fdct_mmxext,NO_PERM,   AV_CPU_FLAG_MMXEXT  
},
+#endif
+#if HAVE_SSE2_INLINE
 { SSE2,   ff_fdct_sse2,  NO_PERM,   AV_CPU_FLAG_SSE2
},
 #endif
 
@@ -108,7 +112,11 @@ static const struct algo idct_tab[] = {
 #if HAVE_MMX_INLINE
 { SIMPLE-MMX, ff_simple_idct_mmx,  MMX_SIMPLE_PERM, AV_CPU_FLAG_MMX 
},
 { XVID-MMX,   ff_idct_xvid_mmx,  NO_PERM,   AV_CPU_FLAG_MMX,  1 
},
+#endif
+#if HAVE_MMXEXT_INLINE
 { XVID-MMXEXT,ff_idct_xvid_mmxext,   NO_PERM,   AV_CPU_FLAG_MMXEXT, 
1 },
+#endif
+#if HAVE_SSE2_INLINE
 { XVID-SSE2,  ff_idct_xvid_sse2, SSE2_PERM, AV_CPU_FLAG_SSE2, 1 
},
 #endif
 
diff --git a/libavcodec/x86/idct_mmx_xvid.c b/libavcodec/x86/idct_mmx_xvid.c
index 7c97b95..2772339 100644
--- a/libavcodec/x86/idct_mmx_xvid.c
+++ b/libavcodec/x86/idct_mmx_xvid.c
@@ -47,7 +47,7 @@
 #include dsputil_x86.h
 #include idct_xvid.h
 
-#if HAVE_INLINE_ASM
+#if HAVE_MMX_INLINE
 
 //=
 // Macros and other preprocessor constants
@@ -507,6 +507,22 @@ __asm__ volatile(
 :: r(block), r(rounder_0), r(tab_i_04_mmx), r(tg_1_16));
 }
 
+void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block)
+{
+ff_idct_xvid_mmx(block);
+ff_put_pixels_clamped_mmx(block, dest, line_size);
+}
+
+void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block)
+{
+ff_idct_xvid_mmx(block);
+ff_add_pixels_clamped_mmx(block, dest, line_size);
+}
+
+#endif /* HAVE_MMX_INLINE */
+
+#if HAVE_MMXEXT_INLINE
+
 //-
 // void idct_xmm(uint16_t block[64]);
 //-
@@ -531,18 +547,6 @@ __asm__ volatile(
 :: r(block), r(rounder_0), r(tab_i_04_xmm), r(tg_1_16));
 }
 
-void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block)
-{
-ff_idct_xvid_mmx(block);
-ff_put_pixels_clamped_mmx(block, dest, line_size);
-}
-
-void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block)
-{
-ff_idct_xvid_mmx(block);
-ff_add_pixels_clamped_mmx(block, dest, line_size);
-}
-
 void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block)
 {
 ff_idct_xvid_mmxext(block);
@@ -555,4 +559,4 @@ void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, 
int16_t *block)
 ff_add_pixels_clamped_mmx(block, dest, line_size);
 }
 
-#endif /* HAVE_INLINE_ASM */
+#endif /* HAVE_MMXEXT_INLINE */
diff --git a/libavcodec/x86/idct_sse2_xvid.c b/libavcodec/x86/idct_sse2_xvid.c
index da2c772..50655d6 100644
--- a/libavcodec/x86/idct_sse2_xvid.c
+++ b/libavcodec/x86/idct_sse2_xvid.c
@@ -44,7 +44,7 @@
 #include idct_xvid.h
 #include dsputil_x86.h
 
-#if HAVE_INLINE_ASM
+#if HAVE_SSE2_INLINE
 
 /**
  * @file
@@ -405,4 +405,4 @@ void ff_idct_xvid_sse2_add(uint8_t *dest, int line_size, 
short *block)
 ff_add_pixels_clamped_mmx(block, dest, line_size);
 }
 
-#endif /* HAVE_INLINE_ASM */
+#endif /* HAVE_SSE2_INLINE */
-- 
1.7.9.5

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


[libav-devel] [PATCH 4/8] x86: fdct: Initialize optimized fdct implementations in the standard way

2013-10-01 Thread Diego Biurrun
---
 libavcodec/x86/dsputilenc_mmx.c |   22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c
index a1852e6..33c8d51 100644
--- a/libavcodec/x86/dsputilenc_mmx.c
+++ b/libavcodec/x86/dsputilenc_mmx.c
@@ -946,6 +946,7 @@ hadamard_func(ssse3)
 av_cold void ff_dsputilenc_init_mmx(DSPContext *c, AVCodecContext *avctx)
 {
 int cpu_flags = av_get_cpu_flags();
+const int dct_algo = avctx-dct_algo;
 
 #if HAVE_YASM
 int bit_depth = avctx-bits_per_raw_sample;
@@ -965,18 +966,9 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, 
AVCodecContext *avctx)
 
 #if HAVE_INLINE_ASM
 if (INLINE_MMX(cpu_flags)) {
-const int dct_algo = avctx-dct_algo;
 if (avctx-bits_per_raw_sample = 8 
-(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX)) {
-if (cpu_flags  AV_CPU_FLAG_SSE2) {
-c-fdct = ff_fdct_sse2;
-} else if (cpu_flags  AV_CPU_FLAG_MMXEXT) {
-c-fdct = ff_fdct_mmxext;
-}else{
-c-fdct = ff_fdct_mmx;
-}
-}
-
+(dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
+c-fdct = ff_fdct_mmx;
 
 c-diff_bytes= diff_bytes_mmx;
 c-sum_abs_dctelem= sum_abs_dctelem_mmx;
@@ -1000,6 +992,10 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, 
AVCodecContext *avctx)
 }
 
 if (INLINE_MMXEXT(cpu_flags)) {
+if (avctx-bits_per_raw_sample = 8 
+(dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
+c-fdct = ff_fdct_mmxext;
+
 c-sum_abs_dctelem = sum_abs_dctelem_mmxext;
 c-vsad[4] = vsad_intra16_mmxext;
 
@@ -1011,6 +1007,10 @@ av_cold void ff_dsputilenc_init_mmx(DSPContext *c, 
AVCodecContext *avctx)
 }
 
 if (INLINE_SSE2(cpu_flags)) {
+if (avctx-bits_per_raw_sample = 8 
+(dct_algo == FF_DCT_AUTO || dct_algo == FF_DCT_MMX))
+c-fdct = ff_fdct_sse2;
+
 c-sum_abs_dctelem= sum_abs_dctelem_sse2;
 }
 
-- 
1.7.9.5

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


[libav-devel] [PATCH 8/8] x86: Skip compiling unused SIMD optimizations on x86_64

2013-10-01 Thread Diego Biurrun
x86_64 always has SSE2, so skip compiling in SIMD-optimized functions
that will always be overridden by variants of the same function done
with more advanced SIMD optimization types.
---
 libavcodec/x86/ac3dsp_init.c |4 
 libavcodec/x86/dct_init.c|2 ++
 libavcodec/x86/dsputil_init.c|   14 --
 libavcodec/x86/dsputilenc_mmx.c  |   19 ++-
 libavcodec/x86/fmtconvert_init.c |4 
 libavcodec/x86/h264_intrapred_init.c |   20 ++--
 libavcodec/x86/h264chroma_init.c |2 ++
 libavcodec/x86/h264dsp_init.c|   16 
 libavcodec/x86/hpeldsp_init.c|2 ++
 libavcodec/x86/motion_est.c  |8 
 libavcodec/x86/mpegaudiodsp.c|2 ++
 libavcodec/x86/mpegvideo.c   |2 ++
 libavcodec/x86/mpegvideoenc.c|4 +++-
 libavcodec/x86/rv34dsp_init.c|2 ++
 libavcodec/x86/rv40dsp_init.c|8 
 libavcodec/x86/vc1dsp_init.c |2 ++
 libavutil/x86/float_dsp_init.c   |2 ++
 libswscale/x86/rgb2rgb.c |2 ++
 18 files changed, 97 insertions(+), 18 deletions(-)

diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c
index ca10864..9d0a221 100644
--- a/libavcodec/x86/ac3dsp_init.c
+++ b/libavcodec/x86/ac3dsp_init.c
@@ -183,11 +183,14 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int 
bit_exact)
 int cpu_flags = av_get_cpu_flags();
 
 if (EXTERNAL_MMX(cpu_flags)) {
+#if ARCH_X86_32
 c-ac3_exponent_min = ff_ac3_exponent_min_mmx;
 c-ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_mmx;
+#endif /* ARCH_X86_32 */
 c-ac3_lshift_int16 = ff_ac3_lshift_int16_mmx;
 c-ac3_rshift_int32 = ff_ac3_rshift_int32_mmx;
 }
+#if ARCH_X86_32
 if (EXTERNAL_AMD3DNOW(cpu_flags)) {
 if (!bit_exact) {
 c-float_to_fixed24 = ff_float_to_fixed24_3dnow;
@@ -200,6 +203,7 @@ av_cold void ff_ac3dsp_init_x86(AC3DSPContext *c, int 
bit_exact)
 if (EXTERNAL_SSE(cpu_flags)) {
 c-float_to_fixed24 = ff_float_to_fixed24_sse;
 }
+#endif /* ARCH_X86_32 */
 if (EXTERNAL_SSE2(cpu_flags)) {
 c-ac3_exponent_min = ff_ac3_exponent_min_sse2;
 c-ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_sse2;
diff --git a/libavcodec/x86/dct_init.c b/libavcodec/x86/dct_init.c
index 7bda5e8..16050cd 100644
--- a/libavcodec/x86/dct_init.c
+++ b/libavcodec/x86/dct_init.c
@@ -30,8 +30,10 @@ av_cold void ff_dct_init_x86(DCTContext *s)
 {
 int cpu_flags = av_get_cpu_flags();
 
+#if ARCH_X86_32
 if (EXTERNAL_SSE(cpu_flags))
 s-dct32 = ff_dct32_float_sse;
+#endif /* ARCH_X86_32 */
 if (EXTERNAL_SSE2(cpu_flags))
 s-dct32 = ff_dct32_float_sse2;
 if (EXTERNAL_AVX(cpu_flags))
diff --git a/libavcodec/x86/dsputil_init.c b/libavcodec/x86/dsputil_init.c
index a38cf24..ff0def0 100644
--- a/libavcodec/x86/dsputil_init.c
+++ b/libavcodec/x86/dsputil_init.c
@@ -540,8 +540,10 @@ static av_cold void dsputil_init_mmx(DSPContext *c, 
AVCodecContext *avctx,
 c-add_pixels_clamped= ff_add_pixels_clamped_mmx;
 
 if (!high_bit_depth) {
+#if ARCH_X86_32
 c-clear_block  = ff_clear_block_mmx;
 c-clear_blocks = ff_clear_blocks_mmx;
+#endif /* ARCH_X86_32 */
 c-draw_edges   = ff_draw_edges_mmx;
 
 switch (avctx-idct_algo) {
@@ -552,11 +554,13 @@ static av_cold void dsputil_init_mmx(DSPContext *c, 
AVCodecContext *avctx,
 c-idct  = ff_simple_idct_mmx;
 c-idct_permutation_type = FF_SIMPLE_IDCT_PERM;
 break;
+#if ARCH_X86_32
 case FF_IDCT_XVIDMMX:
 c-idct_put  = ff_idct_xvid_mmx_put;
 c-idct_add  = ff_idct_xvid_mmx_add;
 c-idct  = ff_idct_xvid_mmx;
 break;
+#endif /* ARCH_X86_32 */
 }
 }
 
@@ -571,14 +575,16 @@ static av_cold void dsputil_init_mmx(DSPContext *c, 
AVCodecContext *avctx,
 c-h263_h_loop_filter = ff_h263_h_loop_filter_mmx;
 }
 
+#if ARCH_X86_32
 c-vector_clip_int32 = ff_vector_clip_int32_mmx;
+#endif /* ARCH_X86_32 */
 #endif /* HAVE_MMX_EXTERNAL */
 }
 
 static av_cold void dsputil_init_mmxext(DSPContext *c, AVCodecContext *avctx,
 int cpu_flags)
 {
-#if HAVE_MMXEXT_INLINE
+#if HAVE_MMXEXT_INLINE  ARCH_X86_32
 const int high_bit_depth = avctx-bits_per_raw_sample  8;
 
 if (!high_bit_depth  avctx-idct_algo == FF_IDCT_XVIDMMX) {
@@ -586,7 +592,7 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, 
AVCodecContext *avctx,
 c-idct_add = ff_idct_xvid_mmxext_add;
 c-idct = ff_idct_xvid_mmxext;
 }
-#endif /* HAVE_MMXEXT_INLINE */
+#endif /* HAVE_MMXEXT_INLINE  ARCH_X86_32 */
 
 #if HAVE_MMXEXT_EXTERNAL
 SET_QPEL_FUNCS(avg_qpel,0, 16, mmxext, );
@@ -601,11 +607,15 @@ static av_cold void dsputil_init_mmxext(DSPContext *c, 

[libav-devel] [PATCH 1/8] avformat/output-example: Declare link dependency on libswscale in the Makefile

2013-10-01 Thread Diego Biurrun
---
 common.mak   |3 ++-
 libavformat/Makefile |1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/common.mak b/common.mak
index a1d9d1e..41ef235 100644
--- a/common.mak
+++ b/common.mak
@@ -25,7 +25,8 @@ TOOLOBJS  := $(TOOLS:%=tools/%.o)
 TOOLS := $(TOOLS:%=tools/%$(EXESUF))
 HEADERS   += $(HEADERS-yes)
 
-DEP_LIBS := $(foreach 
NAME,$(FFLIBS),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
+PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
+DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
 
 SRC_DIR:= $(SRC_PATH)/lib$(NAME)
 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h 
$(SRC_DIR)/$(ARCH)/*.h))
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 231e127..f12b493 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -400,3 +400,4 @@ TOOLS = aviocat 
\
 probetest   \
 
 $(SUBDIR)output-example$(EXESUF): ELIBS = $(patsubst %,$(LD_LIB),swscale 
avutil)
+$(SUBDIR)output-example$(EXESUF): $(call PATH_LIBNAME,swscale)
-- 
1.7.9.5

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


[libav-devel] [PATCH 3/8] x86: fdct: Employ more specific ifdefs

2013-10-01 Thread Diego Biurrun
This avoids building mmxext and sse2 code when disabled by configure.
---
 libavcodec/x86/fdct.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavcodec/x86/fdct.c b/libavcodec/x86/fdct.c
index bd76648..6d595aa 100644
--- a/libavcodec/x86/fdct.c
+++ b/libavcodec/x86/fdct.c
@@ -34,7 +34,7 @@
 #include libavutil/x86/asm.h
 #include libavcodec/dct.h
 
-#if HAVE_INLINE_ASM
+#if HAVE_MMX_INLINE
 
 //
 //
@@ -556,6 +556,10 @@ void ff_fdct_mmx(int16_t *block)
 }
 }
 
+#endif /* HAVE_MMX_INLINE */
+
+#if HAVE_MMXEXT_INLINE
+
 void ff_fdct_mmxext(int16_t *block)
 {
 DECLARE_ALIGNED(8, int64_t, align_tmp)[16];
@@ -574,6 +578,10 @@ void ff_fdct_mmxext(int16_t *block)
 }
 }
 
+#endif /* HAVE_MMXEXT_INLINE */
+
+#if HAVE_SSE2_INLINE
+
 void ff_fdct_sse2(int16_t *block)
 {
 DECLARE_ALIGNED(16, int64_t, align_tmp)[16];
@@ -583,4 +591,4 @@ void ff_fdct_sse2(int16_t *block)
 fdct_row_sse2(block1, block);
 }
 
-#endif /* HAVE_INLINE_ASM */
+#endif /* HAVE_SSE2_INLINE */
-- 
1.7.9.5

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


[libav-devel] [PATCH 7/8] x86: cpu: Restore some explanatory comments removed in 7160bb7

2013-10-01 Thread Diego Biurrun
---
 libavutil/cpu.h |2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/cpu.h b/libavutil/cpu.h
index 8f2af28..3103131 100644
--- a/libavutil/cpu.h
+++ b/libavutil/cpu.h
@@ -35,9 +35,11 @@
 #define AV_CPU_FLAG_SSE  0x0008 /// SSE functions
 #define AV_CPU_FLAG_SSE2 0x0010 /// PIV SSE2 functions
 #define AV_CPU_FLAG_SSE2SLOW 0x4000 /// SSE2 supported, but usually not 
faster
+/// than regular MMX/SSE (e.g. Core1)
 #define AV_CPU_FLAG_3DNOWEXT 0x0020 /// AMD 3DNowExt
 #define AV_CPU_FLAG_SSE3 0x0040 /// Prescott SSE3 functions
 #define AV_CPU_FLAG_SSE3SLOW 0x2000 /// SSE3 supported, but usually not 
faster
+/// than regular MMX/SSE (e.g. Core1)
 #define AV_CPU_FLAG_SSSE30x0080 /// Conroe SSSE3 functions
 #define AV_CPU_FLAG_ATOM 0x1000 /// Atom processor, some SSSE3 
instructions are slower
 #define AV_CPU_FLAG_SSE4 0x0100 /// Penryn SSE4.1 functions
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH 1/8] avformat/output-example: Declare link dependency on libswscale in the Makefile

2013-10-01 Thread Vittorio Giovara
On Tuesday, October 1, 2013, Diego Biurrun wrote:

 ---
  common.mak   |3 ++-
  libavformat/Makefile |1 +
  2 files changed, 3 insertions(+), 1 deletion(-)


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


Re: [libav-devel] [PATCH 7/8] x86: cpu: Restore some explanatory comments removed in 7160bb7

2013-10-01 Thread Vittorio Giovara
On Tuesday, October 1, 2013, Diego Biurrun wrote:

 ---
  libavutil/cpu.h |2 ++
  1 file changed, 2 insertions(+)


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


Re: [libav-devel] [PATCH 6/8] x86: Initialize mmxext after amd3dnow optimizations

2013-10-01 Thread Justin Ruggles

On 10/01/2013 01:44 PM, Diego Biurrun wrote:

The mmxext optimizations should be faster if available and should
thus override the amd3dnow optimizations, not the other way around.


Should be faster? or are faster?

-Justin

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


Re: [libav-devel] [PATCH 8/8] x86: Skip compiling unused SIMD optimizations on x86_64

2013-10-01 Thread Justin Ruggles

On 10/01/2013 01:44 PM, Diego Biurrun wrote:

x86_64 always has SSE2, so skip compiling in SIMD-optimized functions
that will always be overridden by variants of the same function done
with more advanced SIMD optimization types.


I don't think this is a good idea. It's a lot of extra ifdeffery for 
next to zero practical gain.


-Justin

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


Re: [libav-devel] [PATCH 8/8] x86: Skip compiling unused SIMD optimizations on x86_64

2013-10-01 Thread Diego Biurrun
On Tue, Oct 01, 2013 at 02:52:10PM -0400, Justin Ruggles wrote:
 On 10/01/2013 01:44 PM, Diego Biurrun wrote:
 x86_64 always has SSE2, so skip compiling in SIMD-optimized functions
 that will always be overridden by variants of the same function done
 with more advanced SIMD optimization types.
 
 I don't think this is a good idea. It's a lot of extra ifdeffery for
 next to zero practical gain.

Binary size goes down on x86_64 and we already have a lot of it in place,
it's just not done in all places.  This patch completes the work.

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


Re: [libav-devel] [PATCH 8/8] x86: Skip compiling unused SIMD optimizations on x86_64

2013-10-01 Thread Luca Barbato
On 01/10/13 19:44, Diego Biurrun wrote:
 x86_64 always has SSE2, so skip compiling in SIMD-optimized functions
 that will always be overridden by variants of the same function done
 with more advanced SIMD optimization types.
 ---

Wouldn't be simpler just make those return 0 on the checks already in place?

lu

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


Re: [libav-devel] [PATCH 1/8] avformat/output-example: Declare link dependency on libswscale in the Makefile

2013-10-01 Thread Luca Barbato
On 01/10/13 19:44, Diego Biurrun wrote:
 ---
  common.mak   |3 ++-
  libavformat/Makefile |1 +
  2 files changed, 3 insertions(+), 1 deletion(-)
 

Given how mislead are people about this we should move all the examples
somewhere (in /doc would be good) and use a proper stand alone Makefile
for them.

lu

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


[libav-devel] [PATCH 3/3] atrac3: Generalize gain compensation code

2013-10-01 Thread Diego Biurrun
From: Maxim Poliakovski max_p...@gmx.de

Move it to the ATRAC common code, to reuse in the upcoming ATRAC3+ decoder.

Signed-off-by: Diego Biurrun di...@biurrun.de
---

Dropped some unnecessary cosmetic changes and split off 1/3.

 libavcodec/atrac.c  |   62 
 libavcodec/atrac.h  |   45 ++
 libavcodec/atrac3.c |   87 +++
 3 files changed, 119 insertions(+), 75 deletions(-)

diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
index b34bff3..d08a113 100644
--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -63,6 +63,68 @@ void ff_atrac_generate_tables(void)
 }
 }
 
+av_cold void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int 
id2exp_offset,
+ int loc_scale)
+{
+int i;
+
+gctx-loc_scale = loc_scale;
+gctx-loc_size  = 1  loc_scale;
+gctx-id2exp_offset = id2exp_offset;
+
+/* Generate gain level table. */
+for (i = 0; i  16; i++)
+gctx-gain_tab1[i] = powf(2.0, id2exp_offset - i);
+
+/* Generate gain interpolation table. */
+for (i = -15; i  16; i++)
+gctx-gain_tab2[i + 15] = powf(2.0, -1.0f / gctx-loc_size * i);
+}
+
+void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float *prev,
+AtracGainInfo *gc_now, AtracGainInfo *gc_next,
+int num_samples, float *out)
+{
+float lev, gc_scale, gain_inc;
+int i, pos, lastpos;
+
+gc_scale = gc_next-num_points ? gctx-gain_tab1[gc_next-lev_code[0]]
+   : 1.0f;
+
+if (!gc_now-num_points) {
+for (pos = 0; pos  num_samples; pos++)
+out[pos] = in[pos] * gc_scale + prev[pos];
+} else {
+pos = 0;
+
+for (i = 0; i  gc_now-num_points; i++) {
+lastpos = gc_now-loc_code[i]  gctx-loc_scale;
+
+lev = gctx-gain_tab1[gc_now-lev_code[i]];
+gain_inc = gctx-gain_tab2[(i + 1  gc_now-num_points
+   ? gc_now-lev_code[i + 1]
+   : gctx-id2exp_offset)
+   - gc_now-lev_code[i] + 15];
+
+/* apply constant gain level and overlap */
+for (; pos  lastpos; pos++)
+out[pos] = (in[pos] * gc_scale + prev[pos]) * lev;
+
+/* interpolate between two different gain levels */
+for (; pos  lastpos + gctx-loc_size; pos++) {
+out[pos] = (in[pos] * gc_scale + prev[pos]) * lev;
+lev *= gain_inc;
+}
+}
+
+for (; pos  num_samples; pos++)
+out[pos] = in[pos] * gc_scale + prev[pos];
+}
+
+/* copy the overlapping part into the delay buffer */
+memcpy(prev, in[num_samples], num_samples * sizeof(float));
+}
+
 void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, 
float *delayBuf, float *temp)
 {
 int   i, j;
diff --git a/libavcodec/atrac.h b/libavcodec/atrac.h
index 4923caa..994b9f4 100644
--- a/libavcodec/atrac.h
+++ b/libavcodec/atrac.h
@@ -29,6 +29,26 @@
 #ifndef AVCODEC_ATRAC_H
 #define AVCODEC_ATRAC_H
 
+/**
+ *  Gain control parameters for one subband.
+ */
+typedef struct AtracGainInfo {
+int   num_points;   /// number of gain control points
+int   lev_code[7];  /// level at corresponding control point
+int   loc_code[7];  /// location of gain control points
+} AtracGainInfo;
+
+/**
+ *  Gain compensation context structure.
+ */
+typedef struct AtracGCContext {
+float   gain_tab1[16];  /// gain compensation level table
+float   gain_tab2[31];  /// gain compensation interpolation table
+int id2exp_offset;  /// offset for converting level index into level 
exponent
+int loc_scale;  /// scale of location code = 2^loc_scale samples
+int loc_size;   /// size of location code in samples
+} AtracGCContext;
+
 extern float ff_atrac_sf_table[64];
 
 /**
@@ -37,6 +57,31 @@ extern float ff_atrac_sf_table[64];
 void ff_atrac_generate_tables(void);
 
 /**
+ *  Initialize gain compensation context.
+ *
+ * @param gctxpointer to gain compensation context to initialize
+ * @param id2exp_offset   offset for converting level index into level exponent
+ * @param loc_scale   location size factor
+ */
+void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int id2exp_offset,
+ int loc_scale);
+
+/*
+ * Apply gain compensation and perform the MDCT overlapping part.
+ *
+ * @param gctx pointer to gain compensation context
+ * @param in   input buffer
+ * @param prev previous buffer to perform overlap against
+ * @param gc_now   gain control information for current frame
+ * @param gc_next  gain control information for next frame
+ * @param num_samples  number of samples to process
+ * @param out  

[libav-devel] [PATCH 1/3] atrac3: Replace a silly counter variable name with plain 'j'

2013-10-01 Thread Diego Biurrun
---

Extracted from 3/3 to aid readability.

 libavcodec/atrac3.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
index 1cb7b2b..30bf010 100644
--- a/libavcodec/atrac3.c
+++ b/libavcodec/atrac3.c
@@ -417,7 +417,7 @@ static int decode_tonal_components(GetBitContext *gb,
 static int decode_gain_control(GetBitContext *gb, GainBlock *block,
int num_bands)
 {
-int i, cf, num_data;
+int i, j, num_data;
 int *level, *loc;
 
 GainInfo *gain = block-g_block;
@@ -428,10 +428,10 @@ static int decode_gain_control(GetBitContext *gb, 
GainBlock *block,
 level = gain[i].lev_code;
 loc   = gain[i].loc_code;
 
-for (cf = 0; cf  gain[i].num_gain_data; cf++) {
-level[cf] = get_bits(gb, 4);
-loc  [cf] = get_bits(gb, 5);
-if (cf  loc[cf] = loc[cf - 1])
+for (j = 0; j  gain[i].num_gain_data; j++) {
+level[j] = get_bits(gb, 4);
+loc  [j] = get_bits(gb, 5);
+if (j  loc[j] = loc[j - 1])
 return AVERROR_INVALIDDATA;
 }
 }
-- 
1.7.9.5

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


[libav-devel] [PATCH 2/3] atrac: Move doxygen comments to the header

2013-10-01 Thread Diego Biurrun
From: Maxim Poliakovski max_p...@gmx.de

Also update copyright info and file description.

Signed-off-by: Diego Biurrun di...@biurrun.de
---

Dropped some unnecessary cosmetic changes.

 libavcodec/atrac.c |   22 +++---
 libavcodec/atrac.h |   19 +--
 2 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
index 6041a12..b34bff3 100644
--- a/libavcodec/atrac.c
+++ b/libavcodec/atrac.c
@@ -1,6 +1,7 @@
 /*
- * ATRAC common functions
- * Copyright (c) 2006-2008 Maxim Poliakovski
+ * common functions for the ATRAC family of decoders
+ *
+ * Copyright (c) 2006-2013 Maxim Poliakovski
  * Copyright (c) 2006-2008 Benjamin Larsson
  *
  * This file is part of Libav.
@@ -44,10 +45,6 @@ static const float qmf_48tap_half[24] = {
-0.043596379,   -0.099384367,   0.13207909,0.46424159
 };
 
-/**
- * Generate common tables
- */
-
 void ff_atrac_generate_tables(void)
 {
 int i;
@@ -66,19 +63,6 @@ void ff_atrac_generate_tables(void)
 }
 }
 
-
-/**
- * Quadrature mirror synthesis filter.
- *
- * @param inlo  lower part of spectrum
- * @param inhi  higher part of spectrum
- * @param nIn   size of spectrum buffer
- * @param pOut  out buffer
- * @param delayBuf  delayBuf buffer
- * @param temp  temp buffer
- */
-
-
 void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, 
float *delayBuf, float *temp)
 {
 int   i, j;
diff --git a/libavcodec/atrac.h b/libavcodec/atrac.h
index 8e9ba59..4923caa 100644
--- a/libavcodec/atrac.h
+++ b/libavcodec/atrac.h
@@ -1,6 +1,7 @@
 /*
- * ATRAC common data
- * Copyright (c) 2009 Maxim Poliakovski
+ * common functions for the ATRAC family of decoders
+ *
+ * Copyright (c) 2009-2013 Maxim Poliakovski
  * Copyright (c) 2009 Benjamin Larsson
  *
  * This file is part of Libav.
@@ -30,7 +31,21 @@
 
 extern float ff_atrac_sf_table[64];
 
+/**
+ * Generate common tables.
+ */
 void ff_atrac_generate_tables(void);
+
+/**
+ * Quadrature mirror synthesis filter.
+ *
+ * @param inlo  lower part of spectrum
+ * @param inhi  higher part of spectrum
+ * @param nIn   size of spectrum buffer
+ * @param pOut  out buffer
+ * @param delayBuf  delayBuf buffer
+ * @param temp  temp buffer
+ */
 void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float *pOut, 
float *delayBuf, float *temp);
 
 #endif /* AVCODEC_ATRAC_H */
-- 
1.7.9.5

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


Re: [libav-devel] [PATCH 1/3] atrac3: Replace a silly counter variable name with plain 'j'

2013-10-01 Thread Luca Barbato
On 01/10/13 21:47, Diego Biurrun wrote:
 ---
 
 Extracted from 3/3 to aid readability.
 
Won't hurt.

lu

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


Re: [libav-devel] [PATCH 2/3] atrac: Move doxygen comments to the header

2013-10-01 Thread Luca Barbato
On 01/10/13 21:47, Diego Biurrun wrote:
 From: Maxim Poliakovski max_p...@gmx.de
 

Ok.

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


[libav-devel] [PATCH] wip: Prevent s-ref-tab_mvf[-1] reference

2013-10-01 Thread Luca Barbato
The EXTEND_LEFT_CIP calls should be reconsidered.

Tested-By: fate-hevc-conformance-PPS_A_qualcomm_7
---

Before I forget again, if somebody has better ideas please do tell.

 libavcodec/hevcpred_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c
index 6e3f08b..9de36cd 100644
--- a/libavcodec/hevcpred_template.c
+++ b/libavcodec/hevcpred_template.c
@@ -41,7 +41,7 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, 
int log2_size, int
 #define EXTEND_DOWN(ptr, start, length) EXTEND_RIGHT(ptr, start, length)
 #define EXTEND_LEFT_CIP(ptr, start, length) \
 for (i = (start); i  (start)-(length); i--)\
-if (!IS_INTRA(i-1, -1))   \
+if (i  0  !IS_INTRA(i-1, -1))   \
 ptr[i-1] = ptr[i]
 #define EXTEND_RIGHT_CIP(ptr, start, length)\
 for (i = (start); i  (start)+(length); i++)\
--
1.8.3.2

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


[libav-devel] [PATCH] wip: Prevent s-ref-tab_mvf[-1] and left_array[-1] reference

2013-10-01 Thread Luca Barbato
Tested-By: fate-hevc-conformance-PPS_A_qualcomm_7
---

This one covers all the problems and passes fate, still bogus though.

 libavcodec/hevcpred_template.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c
index 6e3f08b..c3649bc 100644
--- a/libavcodec/hevcpred_template.c
+++ b/libavcodec/hevcpred_template.c
@@ -185,7 +185,8 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int 
y0, int log2_size, int
 } else {
 j = 0;
 while(jsize_max_x  !IS_INTRA(j, -1)) j++;
-EXTEND_LEFT_CIP(top, j, j+1);
+if (j  0)
+EXTEND_LEFT_CIP(top, j, j+1);
 left[-1] = top[-1];
 j = 0;
 }
@@ -198,7 +199,7 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int 
y0, int log2_size, int
 if (!cand_bottom_left) {
 EXTEND_DOWN(left, size, size);
 }
-if (y0 != 0) {
+if (x0 != 0  y0 != 0) {
 EXTEND_UP_CIP(left, size_max_y-1, size_max_y);
 } else {
 EXTEND_UP_CIP(left, size_max_y-1, size_max_y-1);
--
1.8.3.2

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


Re: [libav-devel] [PATCH 3/3] atrac3: Generalize gain compensation code

2013-10-01 Thread Vittorio Giovara
On Tuesday, October 1, 2013, Diego Biurrun wrote:

 From: Maxim Poliakovski max_p...@gmx.de javascript:;

 Move it to the ATRAC common code, to reuse in the upcoming ATRAC3+ decoder.

 Signed-off-by: Diego Biurrun di...@biurrun.de javascript:;
 ---

 Dropped some unnecessary cosmetic changes and split off 1/3.

  libavcodec/atrac.c  |   62 
  libavcodec/atrac.h  |   45 ++
  libavcodec/atrac3.c |   87
 +++
  3 files changed, 119 insertions(+), 75 deletions(-)

 diff --git a/libavcodec/atrac.c b/libavcodec/atrac.c
 index b34bff3..d08a113 100644
 --- a/libavcodec/atrac.c
 +++ b/libavcodec/atrac.c
 @@ -63,6 +63,68 @@ void ff_atrac_generate_tables(void)
 +
 +gc_scale = gc_next-num_points ? gctx-gain_tab1[gc_next-lev_code[0]]
 +   : 1.0f;
 +
 +if (!gc_now-num_points) {
 +for (pos = 0; pos  num_samples; pos++)
 +out[pos] = in[pos] * gc_scale + prev[pos];
 +} else {
 +pos = 0;
 +
 +for (i = 0; i  gc_now-num_points; i++) {
 +lastpos = gc_now-loc_code[i]  gctx-loc_scale;
 +
 +lev = gctx-gain_tab1[gc_now-lev_code[i]];
 +gain_inc = gctx-gain_tab2[(i + 1  gc_now-num_points
 +   ? gc_now-lev_code[i + 1]
 +   : gctx-id2exp_offset)
 +   - gc_now-lev_code[i] + 15];


Nit: should ? : and - be on the right hand side?


 +
 +/* apply constant gain level and overlap */
 +for (; pos  lastpos; pos++)
 +out[pos] = (in[pos] * gc_scale + prev[pos]) * lev;
 +
 +/* interpolate between two different gain levels */
 +for (; pos  lastpos + gctx-loc_size; pos++) {
 +out[pos] = (in[pos] * gc_scale + prev[pos]) * lev;
 +lev *= gain_inc;
 +}
 +}
 +
 +for (; pos  num_samples; pos++)
 +out[pos] = in[pos] * gc_scale + prev[pos];
 +}
 +
 +/* copy the overlapping part into the delay buffer */
 +memcpy(prev, in[num_samples], num_samples * sizeof(float));
 +}
 +
  void ff_atrac_iqmf (float *inlo, float *inhi, unsigned int nIn, float
 *pOut, float *delayBuf, float *temp)
  {
  int   i, j;
 diff --git a/libavcodec/atrac.h b/libavcodec/atrac.h
 index 4923caa..994b9f4 100644
 --- a/libavcodec/atrac.h
 +++ b/libavcodec/atrac.h
 @@ -29,6 +29,26 @@
  /**
 + *  Initialize gain compensation context.
 + *
 + * @param gctxpointer to gain compensation context to
 initialize
 + * @param id2exp_offset   offset for converting level index into level
 exponent
 + * @param loc_scale   location size factor
 + */
 +void ff_atrac_init_gain_compensation(AtracGCContext *gctx, int
 id2exp_offset,
 + int loc_scale);
 +
 +/*
 + * Apply gain compensation and perform the MDCT overlapping part.
 + *
 + * @param gctx pointer to gain compensation context
 + * @param in   input buffer
 + * @param prev previous buffer to perform overlap against
 + * @param gc_now   gain control information for current frame
 + * @param gc_next  gain control information for next frame
 + * @param num_samples  number of samples to process
 + * @param out  output data goes here
 + */


Missing doxygen /**

+void ff_atrac_gain_compensation(AtracGCContext *gctx, float *in, float
 *prev,
 +AtracGainInfo *gc_now, AtracGainInfo
 *gc_next,
 +int num_samples, float *out);
 +
 +/**
   * Quadrature mirror synthesis filter.
   *
   * @param inlo  lower part of spectrum
 diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
 index 30bf010..91791ea 100644
 --- a/libavcodec/atrac3.c
 +++ b/libavcodec/atrac3.c
 @@ -54,14 +54,8 @@
  #define SAMPLES_PER_FRAME 1024
  #define MDCT_SIZE  512

 -typedef struct GainInfo {
 -int num_gain_data;
 -int lev_code[8];
 -int loc_code[8];
 -} GainInfo;
 -
  typedef struct GainBlock {
 -GainInfo g_block[4];
 +AtracGainInfo g_block[4];
  } GainBlock;

  typedef struct TonalComponent {
 @@ -111,6 +105,7 @@ typedef struct ATRAC3Context {
  int scrambled_stream;
  //@}

 +AtracGCContext  gainc_ctx;
  FFTContext mdct_ctx;
  FmtConvertContext fmt_conv;
  AVFloatDSPContext fdsp;
 @@ -417,18 +412,17 @@ static int decode_tonal_components(GetBitContext *gb,
  static int decode_gain_control(GetBitContext *gb, GainBlock *block,
 int num_bands)
  {
 -int i, j, num_data;
 +int i, j;
  int *level, *loc;

 -GainInfo *gain = block-g_block;
 +AtracGainInfo *gain = block-g_block;

  for (i = 0; i = num_bands; i++) {
 -num_data  = get_bits(gb, 3);
 -gain[i].num_gain_data = num_data;
 +gain[i].num_points= get_bits(gb, 3);

Re: [libav-devel] [PATCH 1/3] atrac3: Replace a silly counter variable name with plain 'j'

2013-10-01 Thread Vittorio Giovara
On Tuesday, October 1, 2013, Diego Biurrun wrote:

 ---

 Extracted from 3/3 to aid readability.

  libavcodec/atrac3.c |   10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

 diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c
 index 1cb7b2b..30bf010 100644
 --- a/libavcodec/atrac3.c
 +++ b/libavcodec/atrac3.c
 @@ -417,7 +417,7 @@ static int decode_tonal_components(GetBitContext *gb,
  static int decode_gain_control(GetBitContext *gb, GainBlock *block,
 int num_bands)
  {
 -int i, cf, num_data;
 +int i, j, num_data;
  int *level, *loc;

  GainInfo *gain = block-g_block;
 @@ -428,10 +428,10 @@ static int decode_gain_control(GetBitContext *gb,
 GainBlock *block,
  level = gain[i].lev_code;
  loc   = gain[i].loc_code;

 -for (cf = 0; cf  gain[i].num_gain_data; cf++) {
 -level[cf] = get_bits(gb, 4);
 -loc  [cf] = get_bits(gb, 5);
 -if (cf  loc[cf] = loc[cf - 1])
 +for (j = 0; j  gain[i].num_gain_data; j++) {
 +level[j] = get_bits(gb, 4);
 +loc  [j] = get_bits(gb, 5);
 +if (j  loc[j] = loc[j - 1])


Maybe you could align at = instead of at [ if you like.
Lgtm.

Vittorio

  return AVERROR_INVALIDDATA;
  }
  }
 --
 1.7.9.5

 ___
 libav-devel mailing list
 libav-devel@libav.org javascript:;
 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 1/5] avframe: add codec-independent stereoscopic metadata

2013-10-01 Thread Anton Khirnov

On Mon, 30 Sep 2013 15:14:39 +0200, Vittorio Giovara 
vittorio.giov...@gmail.com wrote:
 ---
  Changelog|1 +
  libavutil/Makefile   |1 +
  libavutil/frame.h|4 ++
  libavutil/stereo3d.h |  160 
 ++
  4 files changed, 166 insertions(+)
  create mode 100644 libavutil/stereo3d.h
 
 diff --git a/Changelog b/Changelog
 index b0ff897..9dee989 100644
 --- a/Changelog
 +++ b/Changelog
 @@ -37,6 +37,7 @@ version 10:
  - Error Resilient AAC syntax (ER AAC LC) decoding
  - Low Delay AAC (ER AAC LD) decoding
  - mux chapters in ASF files
 +- codec level stereoscopic metadata handling
  
  
  version 9:
 diff --git a/libavutil/Makefile b/libavutil/Makefile
 index 9381c77..44f7681 100644
 --- a/libavutil/Makefile
 +++ b/libavutil/Makefile
 @@ -41,6 +41,7 @@ HEADERS = adler32.h 
 \
rational.h\
samplefmt.h   \
sha.h \
 +  stereo3d.h \
time.h\
version.h \
xtea.h\
 diff --git a/libavutil/frame.h b/libavutil/frame.h
 index b0676e7..5217b60 100644
 --- a/libavutil/frame.h
 +++ b/libavutil/frame.h
 @@ -35,6 +35,10 @@ enum AVFrameSideDataType {
   * The data is the AVPanScan struct defined in libavcodec.
   */
  AV_FRAME_DATA_PANSCAN,
 +/**
 + * The data is the AVStereo3D struct defined in libavcodec.
^
not true anymore

 +
 +/* How views are packed within the frame or container*/
 +enum AVStereo3DType {
 +/**
 + * Video is not stereoscopic
 + */
 +AV_STEREO3D_NONE,
 +
 +/**
 + * Video is not stereoscopic but metadata has to be there
 + */
 +AV_STEREO3D_NOT_REALLY,

Can't say I like the name. Does this thing even have to exist? Can't we use
AV_STEREO3D_NONE for this?

 +
 +/**
 + * Views are colored funny
 + */
 +AV_STEREO3D_ANAGLYPH,
 +
 +/**
 + * Views are in two different streams
 + *  could be per container (like Matroska)
 + *  or per frame (like MVC Stereo profile)
 + */
 +AV_STEREO3D_MULTISTREAM,
 +
 +/**
 + * Views are alternated temporally
 + *
 + * frame0   frame1   frame2   ...
 + *  
 + *  
 + *  
 + *...  ...  ...
 + */
 +AV_STEREO3D_FRAMESEQUENCE,
 +
 +/**
 + * Views are packed in a checkerboard-like structure per pixel
 + *
 + *LRLRLRLR
 + *RLRLRLRL
 + *LRLRLRLR
 + *...
 + */
 +AV_STEREO3D_CHECKERS,
 +
 +/**
 + * Views are packed per line, as if interlaced
 + *
 + *
 + *
 + *
 + *...
 + */
 +AV_STEREO3D_LINES,
 +
 +/**
 + * Views are packed per column
 + *
 + *LRLRLRLR
 + *LRLRLRLR
 + *LRLRLRLR
 + *...
 + */
 +AV_STEREO3D_COLUMNS,
 +
 +/**
 + * Views are next to each other
 + *
 + *
 + *
 + *
 + *...
 + */
 +AV_STEREO3D_SIDEBYSIDE,
 +
 +/**
 + * Views are on top of each other
 + *
 + *
 + *
 + *
 + *
 + */
 +AV_STEREO3D_TOPBOTTOM,
 +};
 +
 +
 +enum AVStereo3DInfo {
 +/**
 + * Views are assumed to be at full resolution and is
 + * Left is Left mode, with no other fancy stuff
 + */
 +AV_STEREO3D_NORMAL= 0x,
 +
 +/**
 + * View are at half resolution
 + */
 +AV_STEREO3D_SIZE_HALF = 0x0001,
 +
 +/**
 + * Inverted views, L becomes R and R becomes L
 + */
 +AV_STEREO3D_ORDER_INVERT  = 0x0002,
 +
 +/**
 + * When upscaling apply a checkerboard pattern, like
 + *
 + *   L L L LR R R R
 + * = L L L L  R R R R
 + *   L L L LR R R R
 + *    L L L L  R R R R
 + *
 + * AV_STEREO3D_SIZE_HALF is implied
 + */
 +AV_STEREO3D_QUINCUNX  = 0x0004,
 +};
 +
 +/**
 + * Stereo 3D type.
 + * This specifies how a stereo pair is packed in a video.
 + * Normally you get this information either in the transport header
 + * or at every keyframe
 + */
 +typedef struct AVStereo3D {
 +/**
 + * type
 + * - encoding: Set by libavcodec.
 + * - decoding: Set by libavcodec.

It's really not. Just drop those two 

Re: [libav-devel] [PATCH 2/5] h264: parse frame packing arrangement SEI messages and save relevant stereo3d information

2013-10-01 Thread Anton Khirnov

On Mon, 30 Sep 2013 15:14:40 +0200, Vittorio Giovara 
vittorio.giov...@gmail.com wrote:
 ---
  libavcodec/h264.c |   54 
 +
  libavcodec/h264.h |   24 +-
  libavcodec/h264_sei.c |   40 
  3 files changed, 117 insertions(+), 1 deletion(-)
 
 diff --git a/libavcodec/h264.c b/libavcodec/h264.c
 index 5ff55ce..849f99a 100644
 --- a/libavcodec/h264.c
 +++ b/libavcodec/h264.c
 @@ -27,6 +27,7 @@
  
  #include libavutil/avassert.h
  #include libavutil/imgutils.h
 +#include libavutil/stereo3d.h
  #include internal.h
  #include cabac.h
  #include cabac_functions.h
 @@ -2011,6 +2012,59 @@ static void decode_postinit(H264Context *h, int 
 setup_finished)
  }
  }
  
 +if (h-sei_frame_packing_present) {
 +AVFrameSideData *side_data;
 +AVStereo3D stereo;
 +
 +switch (h-frame_packing_arrangement_type) {
 +case SEI_FPA_CHECKERBOARD:
 +stereo.type = AV_STEREO3D_CHECKERS;
 +break;
 +case SEI_FPA_LINE_INTERLEAVED:
 +stereo.type = AV_STEREO3D_LINES;
 +break;
 +case SEI_FPA_COLUMN_INTERLEAVED:
 +stereo.type = AV_STEREO3D_COLUMNS;
 +break;
 +case SEI_FPA_SIDE_BY_SIDE:
 +stereo.type = AV_STEREO3D_SIDEBYSIDE;
 +break;
 +case SEI_FPA_TOP_AND_BOTTOM:
 +stereo.type = AV_STEREO3D_TOPBOTTOM;
 +break;
 +case SEI_FPA_FRAME_ALTERNATE:
 +stereo.type = AV_STEREO3D_FRAMESEQUENCE;
 +break;
 +case SEI_FPA_2D:
 +stereo.type = AV_STEREO3D_NOT_REALLY;
 +break;
 +default:
 +stereo.type = AV_STEREO3D_NONE;
 +break;
 +}
 +
 +/* skip allocation if unknown type */
 +if (stereo.type != AV_STEREO3D_NONE) {
 +stereo.info = AV_STEREO3D_NORMAL;
 +if (h-content_interpretation_type == 2)
 +stereo.info |= AV_STEREO3D_ORDER_INVERT;
 +
 +if (h-quincunx_subsampling)
 +stereo.info |= AV_STEREO3D_QUINCUNX;
 +
 +if (stereo.type != AV_STEREO3D_FRAMESEQUENCE)
 +stereo.info |= AV_STEREO3D_SIZE_HALF;
 +
 +side_data = av_frame_new_side_data(cur-f,
 +   AV_FRAME_DATA_STEREO3D,
 +   sizeof(AVStereo3D));
 +if (!side_data)
 +return;
 +
 +memcpy(side_data-data, stereo, sizeof(AVStereo3D));
 +}
 +}
 +
  // FIXME do something with unavailable reference frames
  
  /* Sort B-frames into display order */
 diff --git a/libavcodec/h264.h b/libavcodec/h264.h
 index 3ef8420..9e0c6ba 100644
 --- a/libavcodec/h264.h
 +++ b/libavcodec/h264.h
 @@ -123,7 +123,8 @@ typedef enum {
  SEI_BUFFERING_PERIOD= 0,   /// buffering period (H.264, 
 D.1.1)
  SEI_TYPE_PIC_TIMING = 1,   /// picture timing
  SEI_TYPE_USER_DATA_UNREGISTERED = 5,   /// unregistered user data
 -SEI_TYPE_RECOVERY_POINT = 6/// recovery point (frame # to 
 decoder sync)
 +SEI_TYPE_RECOVERY_POINT = 6,   /// recovery point (frame # to 
 decoder sync)
 +SEI_TYPE_FRAME_PACKING  = 45,  /// frame packing arrangement
  } SEI_Type;
  
  /**
 @@ -142,6 +143,19 @@ typedef enum {
  } SEI_PicStructType;
  
  /**
 + * type in frame packing arrangement SEI message
 + */
 +typedef enum {
 +SEI_FPA_CHECKERBOARD = 0,  ///  0: quincux
   ^^^
really?

I'd just drop the comments, they don't add anything.

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