Re: [libav-devel] [PATCH 2/2] Provide isnan replacement for systems that do not have it.

2011-04-11 Thread Alex Converse
On Sun, Apr 10, 2011 at 10:40 PM, Konstantin Pavlov thr...@videolan.org wrote:
 ---
  configure        |    2 ++
  libavutil/libm.h |    8 
  2 files changed, 10 insertions(+), 0 deletions(-)

 diff --git a/configure b/configure
 index af48ae8..0b55509 100755
 --- a/configure
 +++ b/configure
 @@ -1065,6 +1065,7 @@ HAVE_LIST=
     inet_aton
     inline_asm
     isatty
 +    isnan
     kbhit
     ldbrx
     libdc1394_1
 @@ -2850,6 +2851,7 @@ disabled vaapi || check_lib va/va.h vaInitialize -lva

  check_mathfunc exp2
  check_mathfunc exp2f
 +check_mathfunc isnan
  check_mathfunc llrint
  check_mathfunc llrintf
  check_mathfunc log2
 diff --git a/libavutil/libm.h b/libavutil/libm.h
 index 704bcf9..fc2ef71 100644
 --- a/libavutil/libm.h
 +++ b/libavutil/libm.h
 @@ -38,6 +38,14 @@
  #define exp2f(x) ((float)exp2(x))
  #endif /* HAVE_EXP2F */

 +#if !HAVE_ISNAN
 +#undef isnan
 +#define isnan(x) \
 +   (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) 
 : \
 +   sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
 +__builtin_isnanf ((float)(x)))

why not (x) != (x)?
seems more portable.

 +#endif /* HAVE_ISNAN */
 +
  #if !HAVE_LLRINT
  #undef llrint
  #define llrint(x) ((long long)rint(x))
 --
 1.7.4.4


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


Re: [libav-devel] [PATCH] Allow custom stride in V210

2011-04-11 Thread Luca Barbato
On 04/10/2011 11:59 PM, Kieran Kunhya wrote:
 Blackmagic hardware SDI cards output V210 with a custom stride. 
 This patch allows libav to decode these streams.
 

How to test it? Not sure we need it as global avcodec parameter, as
avoption might be nicer.

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

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


Re: [libav-devel] [PATCH] g722: Return 8 bits per sample for g722 in av_get_bits_per_sample

2011-04-11 Thread Martin Storsjö
On Sun, 10 Apr 2011, Kostya wrote:

 On Sun, Apr 10, 2011 at 08:39:43PM +0300, Martin Storsjö wrote:
  This fixes a failing assert in ff_raw_read_header (in
  fate-g722dec-1), where bits_per_coded_sample is set using this
  function and is required to have a positive value.
  ---
 
 yes, that looks better

Thanks, pushed.

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


Re: [libav-devel] [PATCH 2/2] Provide isnan replacement for systems that do not have it.

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 09:40:32AM +0400, Konstantin Pavlov wrote:
 
 --- a/libavutil/libm.h
 +++ b/libavutil/libm.h
 @@ -38,6 +38,14 @@
  
 +#if !HAVE_ISNAN
 +#undef isnan
 +#define isnan(x) \
 +   (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) 
 : \
 +   sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
 +__builtin_isnanf ((float)(x)))
 +#endif /* HAVE_ISNAN */

OK, I know my opinion is not going to be very popular, but when is this
going to end?  I'd rather delete all those platform-specific workarounds,
if somebody needs them they can create a libposix or so that contains
them and fix more than just one application at a time...

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


Re: [libav-devel] [PATCH] Add unconditional return statement to yuva420_rgb32_MMX() / yuva420_bgr32_MMX().

2011-04-11 Thread Kostya
On Sun, Apr 10, 2011 at 09:44:51PM +0200, Diego Biurrun wrote:
 When HAVE_7REGS was not defined these functions had an empty body
 causing the following warnings during compilation.
 In file included from libswscale/x86/yuv2rgb_mmx.c:58:
 libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_rgb32_MMX’:
 libswscale/x86/yuv2rgb_template.c:412: warning: no return statement in 
 function returning non-void
 libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_bgr32_MMX’:
 libswscale/x86/yuv2rgb_template.c:457: warning: no return statement in 
 function returning non-void
 
 Signed-off-by: Diego Biurrun di...@biurrun.de
 ---

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


[libav-devel] [PATCH 01/14] Thin rgb2rgb a little part 1 of many

2011-04-11 Thread Luca Barbato
Move the function pointers in a separate file.
It will removed once the pointers will be factored in a more structured
form
---
 libswscale/Makefile|2 +-
 libswscale/rgb2rgb.c   |   66 ---
 libswscale/swscale_functions.c |   67 
 3 files changed, 68 insertions(+), 67 deletions(-)
 create mode 100644 libswscale/swscale_functions.c

diff --git a/libswscale/Makefile b/libswscale/Makefile
index 6976079..3ac60e5 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -5,7 +5,7 @@ FFLIBS = avutil
 
 HEADERS = swscale.h
 
-OBJS = options.o rgb2rgb.o swscale.o utils.o yuv2rgb.o
+OBJS = options.o rgb2rgb.o swscale.o swscale_functions.o utils.o yuv2rgb.o
 
 OBJS-$(ARCH_BFIN)  +=  bfin/internal_bfin.o \
bfin/swscale_bfin.o  \
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index bc0ed63..32cc00b 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -32,72 +32,6 @@
 
 #define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
 
-void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb32to16)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb32to15)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb15to32)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb16to15)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb16to32)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
-void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
-
-void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
-   long width, long height,
-   long lumStride, long chromStride, long dstStride);
-void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
-   long width, long height,
-   long lumStride, long chromStride, long dstStride);
-void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
-  long width, long height,
-  long lumStride, long chromStride, long dstStride);
-void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
-  long width, long height,
-  long lumStride, long chromStride, long dstStride);
-void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t 
*vdst,
-   long width, long height,
-   long lumStride, long chromStride, long srcStride);
-void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t 
*vdst,
-long width, long height,
-long lumStride, long chromStride, long srcStride);
-void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
- long srcStride, long dstStride);
-void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
-long width, long height, long src1Stride,
-long src2Stride, long dstStride);
-void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
-uint8_t *dst1, uint8_t *dst2,
-long width, long height,
-long srcStride1, long srcStride2,
-long dstStride1, long dstStride2);
-void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t 
*src3,
- uint8_t *dst,
- long width, long height,
- long srcStride1, long srcStride2,
- long srcStride3, long dstStride);
-void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const 
uint8_t *src,
- long width, long height,
- long lumStride, long chromStride, long srcStride);
-void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const 
uint8_t *src,
- long width, long height,
- long lumStride, long chromStride, long srcStride);
-void 

[libav-devel] [PATCH 02/14] Factorize FAST_BGR2YV12

2011-04-11 Thread Luca Barbato
It is used only for x86 so it will be moved once the code is moved in
the arch dir

Question: should we build an accurate BGR2YV12 variant?
---
 libswscale/rgb2rgb.c  |2 --
 libswscale/swscale.c  |2 --
 libswscale/swscale_internal.h |2 ++
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 32cc00b..9f9ae70 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -30,8 +30,6 @@
 #include swscale.h
 #include swscale_internal.h
 
-#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
-
 #if ARCH_X86
 DECLARE_ASM_CONST(8, uint64_t, mmx_ff)   = 0x00FFULL;
 DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0xULL;
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index ed6db72..565743a 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -76,8 +76,6 @@ untested special converters
 //#undef ARCH_X86
 #define DITHER1XBPP
 
-#define FAST_BGR2YV12 // use 7 bit coefficients instead of 15 bit
-
 #define isPacked(x) (   \
(x)==PIX_FMT_PAL8\
 || (x)==PIX_FMT_YUYV422 \
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 631f1e0..4c6ad2a 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -31,6 +31,8 @@
 
 #define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long
 
+#define FAST_BGR2YV12 //use 7-bit instead of 15-bit coefficients
+
 #define MAX_FILTER_SIZE 256
 
 #if ARCH_X86
-- 
1.7.4.1

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


[libav-devel] [PATCH 04/14] Untemplatize C code part 1

2011-04-11 Thread Luca Barbato
---
 libswscale/rgb2rgb.c  |9 +-
 libswscale/rgb2rgb_template.c |  174 
 2 files changed, 91 insertions(+), 92 deletions(-)

diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index dd34c9d..e6d7971 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -81,14 +81,13 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 
0x001f001fULL;
 
 //Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one.
 //plain C versions
+#include rgb2rgb_template.c
+
+#if ARCH_X86
 #define COMPILE_TEMPLATE_MMX 0
 #define COMPILE_TEMPLATE_MMX2 0
 #define COMPILE_TEMPLATE_AMD3DNOW 0
 #define COMPILE_TEMPLATE_SSE2 0
-#define RENAME(a) a ## _C
-#include rgb2rgb_template.c
-
-#if ARCH_X86
 
 //MMX versions
 #undef RENAME
@@ -145,7 +144,7 @@ void sws_rgb2rgb_init(int flags)
 rgb2rgb_init_MMX();
 else
 #endif /* HAVE_MMX2 || HAVE_AMD3DNOW || HAVE_MMX */
-rgb2rgb_init_C();
+rgb2rgb_init_c();
 }
 
 #if LIBSWSCALE_VERSION_MAJOR  1
diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 5435968..30c3ad2 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -26,7 +26,7 @@
 
 #include stddef.h
 
-static inline void RENAME(rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb24tobgr32_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
 uint8_t *dest = dst;
 const uint8_t *s = src;
@@ -50,7 +50,7 @@ static inline void RENAME(rgb24tobgr32)(const uint8_t *src, 
uint8_t *dst, long s
 }
 }
 
-static inline void RENAME(rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb32tobgr24_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
 uint8_t *dest = dst;
 const uint8_t *s = src;
@@ -81,7 +81,7 @@ static inline void RENAME(rgb32tobgr24)(const uint8_t *src, 
uint8_t *dst, long s
  MMX2, 3DNOW optimization by Nick Kurshev
  32-bit C version, and andadd trick by Michael Niedermayer
 */
-static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb15to16_c(const uint8_t *src, uint8_t *dst, long src_size)
 {
 register const uint8_t* s=src;
 register uint8_t* d=dst;
@@ -101,7 +101,7 @@ static inline void RENAME(rgb15to16)(const uint8_t *src, 
uint8_t *dst, long src_
 }
 }
 
-static inline void RENAME(rgb16to15)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb16to15_c(const uint8_t *src, uint8_t *dst, long src_size)
 {
 register const uint8_t* s=src;
 register uint8_t* d=dst;
@@ -122,7 +122,7 @@ static inline void RENAME(rgb16to15)(const uint8_t *src, 
uint8_t *dst, long src_
 }
 }
 
-static inline void RENAME(rgb32to16)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb32to16_c(const uint8_t *src, uint8_t *dst, long src_size)
 {
 const uint8_t *s = src;
 const uint8_t *end;
@@ -135,7 +135,7 @@ static inline void RENAME(rgb32to16)(const uint8_t *src, 
uint8_t *dst, long src_
 }
 }
 
-static inline void RENAME(rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb32tobgr16_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
 const uint8_t *s = src;
 const uint8_t *end;
@@ -147,7 +147,7 @@ static inline void RENAME(rgb32tobgr16)(const uint8_t *src, 
uint8_t *dst, long s
 }
 }
 
-static inline void RENAME(rgb32to15)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb32to15_c(const uint8_t *src, uint8_t *dst, long src_size)
 {
 const uint8_t *s = src;
 const uint8_t *end;
@@ -159,7 +159,7 @@ static inline void RENAME(rgb32to15)(const uint8_t *src, 
uint8_t *dst, long src_
 }
 }
 
-static inline void RENAME(rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb32tobgr15_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
 const uint8_t *s = src;
 const uint8_t *end;
@@ -171,7 +171,7 @@ static inline void RENAME(rgb32tobgr15)(const uint8_t *src, 
uint8_t *dst, long s
 }
 }
 
-static inline void RENAME(rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb24tobgr16_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
 const uint8_t *s = src;
 const uint8_t *end;
@@ -185,7 +185,7 @@ static inline void RENAME(rgb24tobgr16)(const uint8_t *src, 
uint8_t *dst, long s
 }
 }
 
-static inline void RENAME(rgb24to16)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb24to16_c(const uint8_t *src, uint8_t *dst, long src_size)
 {
 const uint8_t *s = src;
 const uint8_t *end;
@@ -199,7 +199,7 @@ static inline void RENAME(rgb24to16)(const uint8_t *src, 
uint8_t *dst, long src_
 }
 }
 
-static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long 
src_size)
+static inline void rgb24tobgr15_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
 const uint8_t 

[libav-devel] [PATCH 05/14] Switch x86_reg to int for the C code

2011-04-11 Thread Luca Barbato
---
 libswscale/rgb2rgb_template.c |   28 ++--
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c
index 30c3ad2..69f0683 100644
--- a/libswscale/rgb2rgb_template.c
+++ b/libswscale/rgb2rgb_template.c
@@ -345,7 +345,7 @@ static inline void rgb16to32_c(const uint8_t *src, uint8_t 
*dst, long src_size)
 
 static inline void shuffle_bytes_2103_c(const uint8_t *src, uint8_t *dst, long 
src_size)
 {
-x86_reg idx = 15 - src_size;
+int idx = 15 - src_size;
 const uint8_t *s = src-idx;
 uint8_t *d = dst-idx;
 for (; idx15; idx+=4) {
@@ -372,7 +372,7 @@ static inline void yuvPlanartoyuy2_c(const uint8_t *ysrc, 
const uint8_t *usrc, c
long lumStride, long chromStride, 
long dstStride, long vertLumPerChroma)
 {
 long y;
-const x86_reg chromWidth= width1;
+const int chromWidth= width1;
 for (y=0; yheight; y++) {
 #if HAVE_FAST_64BIT
 int i;
@@ -432,7 +432,7 @@ static inline void yuvPlanartouyvy_c(const uint8_t *ysrc, 
const uint8_t *usrc, c
long lumStride, long chromStride, 
long dstStride, long vertLumPerChroma)
 {
 long y;
-const x86_reg chromWidth= width1;
+const int chromWidth= width1;
 for (y=0; yheight; y++) {
 #if HAVE_FAST_64BIT
 int i;
@@ -516,7 +516,7 @@ static inline void yuy2toyv12_c(const uint8_t *src, uint8_t 
*ydst, uint8_t *udst
   long lumStride, long chromStride, long 
srcStride)
 {
 long y;
-const x86_reg chromWidth= width1;
+const int chromWidth= width1;
 for (y=0; yheight; y+=2) {
 long i;
 for (i=0; ichromWidth; i++) {
@@ -555,7 +555,7 @@ static inline void planar2x_c(const uint8_t *src, uint8_t 
*dst, long srcWidth, l
 dst+= dstStride;
 
 for (y=1; ysrcHeight; y++) {
-const x86_reg mmxSize=1;
+const int mmxSize=1;
 
 dst[0]= (3*src[0] +   src[srcStride])2;
 dst[dstStride]= (  src[0] + 3*src[srcStride])2;
@@ -601,7 +601,7 @@ static inline void uyvytoyv12_c(const uint8_t *src, uint8_t 
*ydst, uint8_t *udst
   long lumStride, long chromStride, long 
srcStride)
 {
 long y;
-const x86_reg chromWidth= width1;
+const int chromWidth= width1;
 for (y=0; yheight; y+=2) {
 long i;
 for (i=0; ichromWidth; i++) {
@@ -636,7 +636,7 @@ static inline void rgb24toyv12_c(const uint8_t *src, 
uint8_t *ydst, uint8_t *uds
long lumStride, long chromStride, long 
srcStride)
 {
 long y;
-const x86_reg chromWidth= width1;
+const int chromWidth= width1;
 y=0;
 for (; yheight; y+=2) {
 long i;
@@ -710,7 +710,7 @@ static inline void vu9_to_vu12_c(const uint8_t *src1, const 
uint8_t *src2,
long srcStride1, long srcStride2,
long dstStride1, long dstStride2)
 {
-x86_reg y;
+int y;
 long x,w,h;
 w=width/2; h=height/2;
 for (y=0;yh;y++) {
@@ -733,7 +733,7 @@ static inline void yvu9_to_yuy2_c(const uint8_t *src1, 
const uint8_t *src2, cons
 long srcStride1, long srcStride2,
 long srcStride3, long dstStride)
 {
-x86_reg x;
+int x;
 long y,w,h;
 w=width/2; h=height;
 for (y=0;yh;y++) {
@@ -756,7 +756,7 @@ static inline void yvu9_to_yuy2_c(const uint8_t *src1, 
const uint8_t *src2, cons
 }
 }
 
-static void extract_even_c(const uint8_t *src, uint8_t *dst, x86_reg count)
+static void extract_even_c(const uint8_t *src, uint8_t *dst, int count)
 {
 dst +=   count;
 src += 2*count;
@@ -768,7 +768,7 @@ static void extract_even_c(const uint8_t *src, uint8_t 
*dst, x86_reg count)
 }
 }
 
-static void extract_even2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, 
x86_reg count)
+static void extract_even2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, 
int count)
 {
 dst0+=   count;
 dst1+=   count;
@@ -781,7 +781,7 @@ static void extract_even2_c(const uint8_t *src, uint8_t 
*dst0, uint8_t *dst1, x8
 }
 }
 
-static void extract_even2avg_c(const uint8_t *src0, const uint8_t *src1, 
uint8_t *dst0, uint8_t *dst1, x86_reg count)
+static void extract_even2avg_c(const uint8_t *src0, const uint8_t *src1, 
uint8_t *dst0, uint8_t *dst1, int count)
 {
 dst0 +=   count;
 dst1 +=   count;
@@ -795,7 +795,7 @@ static void extract_even2avg_c(const uint8_t *src0, const 
uint8_t *src1, uint8_t
 }
 }
 
-static void extract_odd2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, 
x86_reg count)
+static void extract_odd2_c(const uint8_t *src, uint8_t *dst0, uint8_t *dst1, 
int count)
 {
 dst0+=   count;
 dst1+=   count;
@@ -809,7 +809,7 @@ static void extract_odd2_c(const uint8_t *src, uint8_t 
*dst0, uint8_t 

[libav-devel] [PATCH 06/14] Move away x86 specific code from rgb2rgb part 2

2011-04-11 Thread Luca Barbato
With this commit we should have all the arch specific code moved away.
Init pattern now:
- generic C init first
- arch specific init later overwriting

In future the arch specific init will overwrite just the generics for
which we have an optimization.
---
 libswscale/Makefile  |3 +-
 libswscale/rgb2rgb.c |   94 +
 libswscale/x86/rgb2rgb.c |  146 ++
 3 files changed, 152 insertions(+), 91 deletions(-)
 create mode 100644 libswscale/x86/rgb2rgb.c

diff --git a/libswscale/Makefile b/libswscale/Makefile
index 3ac60e5..b8f233f 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -12,7 +12,8 @@ OBJS-$(ARCH_BFIN)  +=  bfin/internal_bfin.o \
bfin/yuv2rgb_bfin.o
 OBJS-$(CONFIG_MLIB)+=  mlib/yuv2rgb_mlib.o
 OBJS-$(HAVE_ALTIVEC)   +=  ppc/yuv2rgb_altivec.o
-OBJS-$(HAVE_MMX)   +=  x86/yuv2rgb_mmx.o
+OBJS-$(HAVE_MMX)   +=  x86/rgb2rgb.o \
+   x86/yuv2rgb_mmx.o
 OBJS-$(HAVE_VIS)   +=  sparc/yuv2rgb_vis.o
 
 TESTPROGS = colorspace swscale
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index e6d7971..9e27e82 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -24,50 +24,11 @@
  */
 #include inttypes.h
 #include config.h
-#include libavutil/x86_cpu.h
 #include libavutil/bswap.h
 #include rgb2rgb.h
 #include swscale.h
 #include swscale_internal.h
 
-#if ARCH_X86
-DECLARE_ASM_CONST(8, uint64_t, mmx_ff)   = 0x00FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0xULL;
-DECLARE_ASM_CONST(8, uint64_t, mmx_one)  = 0xULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32b)  = 0x00FF00FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32g)  = 0xFF00FF00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32r)  = 0x00FF00FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32a)  = 0xFF00FF00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask32)   = 0x00FF00FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask3216br)   = 0x00F800F800F800F8ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask3216g)= 0xFC00FC00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask3215g)= 0xF800F800ULL;
-DECLARE_ASM_CONST(8, uint64_t, mul3216)  = 0x20042004ULL;
-DECLARE_ASM_CONST(8, uint64_t, mul3215)  = 0x20082008ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24b)  = 0x00FFFFFFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24g)  = 0xFFFFFF00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24r)  = 0xFFFFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24l)  = 0x00FFULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24h)  = 0xFF00ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24hh) = 0xULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24hhh)= 0xULL;
-DECLARE_ASM_CONST(8, uint64_t, mask24)   = 0xULL;
-DECLARE_ASM_CONST(8, uint64_t, mask15b)  = 0x001F001F001F001FULL; /* 
 0001  xxB */
-DECLARE_ASM_CONST(8, uint64_t, mask15rg) = 0x7FE07FE07FE07FE0ULL; /* 
0111 1110  RGx */
-DECLARE_ASM_CONST(8, uint64_t, mask15s)  = 0xFFE0FFE0FFE0FFE0ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask15g)  = 0x03E003E003E003E0ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask15r)  = 0x7C007C007C007C00ULL;
-#define mask16b mask15b
-DECLARE_ASM_CONST(8, uint64_t, mask16g)  = 0x07E007E007E007E0ULL;
-DECLARE_ASM_CONST(8, uint64_t, mask16r)  = 0xF800F800F800F800ULL;
-DECLARE_ASM_CONST(8, uint64_t, red_16mask)   = 0xf800f800ULL;
-DECLARE_ASM_CONST(8, uint64_t, green_16mask) = 0x07e007e0ULL;
-DECLARE_ASM_CONST(8, uint64_t, blue_16mask)  = 0x001f001fULL;
-DECLARE_ASM_CONST(8, uint64_t, red_15mask)   = 0x7c007c00ULL;
-DECLARE_ASM_CONST(8, uint64_t, green_15mask) = 0x03e003e0ULL;
-DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 0x001f001fULL;
-#endif /* ARCH_X86 */
-
 #define RGB2YUV_SHIFT 8
 #define BY ((int)( 0.098*(1RGB2YUV_SHIFT)+0.5))
 #define BV ((int)(-0.071*(1RGB2YUV_SHIFT)+0.5))
@@ -79,49 +40,9 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 
0x001f001fULL;
 #define RV ((int)( 0.439*(1RGB2YUV_SHIFT)+0.5))
 #define RU ((int)(-0.148*(1RGB2YUV_SHIFT)+0.5))
 
-//Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one.
 //plain C versions
 #include rgb2rgb_template.c
 
-#if ARCH_X86
-#define COMPILE_TEMPLATE_MMX 0
-#define COMPILE_TEMPLATE_MMX2 0
-#define COMPILE_TEMPLATE_AMD3DNOW 0
-#define COMPILE_TEMPLATE_SSE2 0
-
-//MMX versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMX
-#define COMPILE_TEMPLATE_MMX 1
-#define RENAME(a) a ## _MMX
-#include x86/rgb2rgb_template.c
-
-//MMX2 versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_MMX2
-#define COMPILE_TEMPLATE_MMX2 1
-#define RENAME(a) a ## _MMX2
-#include x86/rgb2rgb_template.c
-
-//SSE2 versions
-#undef RENAME
-#undef COMPILE_TEMPLATE_SSE2
-#define 

[libav-devel] [PATCH 09/14] Factorize init between C and x86

2011-04-11 Thread Luca Barbato
Always call first the C init and make the optional optimization
init follow.
The unaccelerated function pointer shouldn't be set again,
likewise the other common logic should be present only on the C
init.
---
 libswscale/swscale.c  |6 +--
 libswscale/x86/swscale_template.c |   73 +++--
 2 files changed, 7 insertions(+), 72 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 1fe9692..8d8c625 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1255,6 +1255,8 @@ static inline void monoblack2Y(uint8_t *dst, const 
uint8_t *src, long width, uin
 
 SwsFunc ff_getSwsFunc(SwsContext *c)
 {
+sws_init_swScale_C(c);
+
 #if CONFIG_RUNTIME_CPUDETECT
 int flags = c-flags;
 
@@ -1270,7 +1272,6 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 sws_init_swScale_MMX(c);
 return swScale_MMX;
 } else {
-sws_init_swScale_C(c);
 return swScale_C;
 }
 
@@ -1280,11 +1281,9 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 sws_init_swScale_altivec(c);
 return swScale_altivec;
 } else {
-sws_init_swScale_C(c);
 return swScale_C;
 }
 #endif
-sws_init_swScale_C(c);
 return swScale_C;
 #endif /* ARCH_X86 */
 #else //CONFIG_RUNTIME_CPUDETECT
@@ -1301,7 +1300,6 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 sws_init_swScale_altivec(c);
 return swScale_altivec;
 #else
-sws_init_swScale_C(c);
 return swScale_C;
 #endif
 #endif //!CONFIG_RUNTIME_CPUDETECT
diff --git a/libswscale/x86/swscale_template.c 
b/libswscale/x86/swscale_template.c
index e678696..3da9d3d 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -2918,58 +2918,33 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
 c-hcscale_fast = RENAME(hcscale_fast);
 }
 
-c-chrToYV12 = NULL;
 switch(srcFormat) {
 case PIX_FMT_YUYV422  : c-chrToYV12 = RENAME(yuy2ToUV); break;
 case PIX_FMT_UYVY422  : c-chrToYV12 = RENAME(uyvyToUV); break;
 case PIX_FMT_NV12 : c-chrToYV12 = RENAME(nv12ToUV); break;
 case PIX_FMT_NV21 : c-chrToYV12 = RENAME(nv21ToUV); break;
-case PIX_FMT_RGB8 :
-case PIX_FMT_BGR8 :
-case PIX_FMT_PAL8 :
-case PIX_FMT_BGR4_BYTE:
-case PIX_FMT_RGB4_BYTE: c-chrToYV12 = palToUV; break;
 case PIX_FMT_YUV420P16BE:
 case PIX_FMT_YUV422P16BE:
 case PIX_FMT_YUV444P16BE: c-chrToYV12 = RENAME(BEToUV); break;
 case PIX_FMT_YUV420P16LE:
 case PIX_FMT_YUV422P16LE:
 case PIX_FMT_YUV444P16LE: c-chrToYV12 = RENAME(LEToUV); break;
+default: break;
 }
 if (c-chrSrcHSubSample) {
 switch(srcFormat) {
-case PIX_FMT_RGB48BE:
-case PIX_FMT_RGB48LE: c-chrToYV12 = rgb48ToUV_half; break;
-case PIX_FMT_RGB32  : c-chrToYV12 = bgr32ToUV_half;  break;
-case PIX_FMT_RGB32_1: c-chrToYV12 = bgr321ToUV_half; break;
 case PIX_FMT_BGR24  : c-chrToYV12 = RENAME(bgr24ToUV_half); break;
-case PIX_FMT_BGR565 : c-chrToYV12 = bgr16ToUV_half; break;
-case PIX_FMT_BGR555 : c-chrToYV12 = bgr15ToUV_half; break;
-case PIX_FMT_BGR32  : c-chrToYV12 = rgb32ToUV_half;  break;
-case PIX_FMT_BGR32_1: c-chrToYV12 = rgb321ToUV_half; break;
 case PIX_FMT_RGB24  : c-chrToYV12 = RENAME(rgb24ToUV_half); break;
-case PIX_FMT_RGB565 : c-chrToYV12 = rgb16ToUV_half; break;
-case PIX_FMT_RGB555 : c-chrToYV12 = rgb15ToUV_half; break;
+default: break;
 }
 } else {
 switch(srcFormat) {
-case PIX_FMT_RGB48BE:
-case PIX_FMT_RGB48LE: c-chrToYV12 = rgb48ToUV; break;
-case PIX_FMT_RGB32  : c-chrToYV12 = bgr32ToUV;  break;
-case PIX_FMT_RGB32_1: c-chrToYV12 = bgr321ToUV; break;
 case PIX_FMT_BGR24  : c-chrToYV12 = RENAME(bgr24ToUV); break;
-case PIX_FMT_BGR565 : c-chrToYV12 = bgr16ToUV; break;
-case PIX_FMT_BGR555 : c-chrToYV12 = bgr15ToUV; break;
-case PIX_FMT_BGR32  : c-chrToYV12 = rgb32ToUV;  break;
-case PIX_FMT_BGR32_1: c-chrToYV12 = rgb321ToUV; break;
 case PIX_FMT_RGB24  : c-chrToYV12 = RENAME(rgb24ToUV); break;
-case PIX_FMT_RGB565 : c-chrToYV12 = rgb16ToUV; break;
-case PIX_FMT_RGB555 : c-chrToYV12 = rgb15ToUV; break;
+default: break;
 }
 }
 
-c-lumToYV12 = NULL;
-c-alpToYV12 = NULL;
 switch (srcFormat) {
 case PIX_FMT_YUYV422  :
 case PIX_FMT_YUV420P16BE:
@@ -2983,50 +2958,16 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
 case PIX_FMT_YUV444P16LE:
 case PIX_FMT_GRAY16LE : c-lumToYV12 = RENAME(uyvyToY); break;
 case PIX_FMT_BGR24: c-lumToYV12 = RENAME(bgr24ToY); break;
-case PIX_FMT_BGR565   : c-lumToYV12 = bgr16ToY; break;
-case PIX_FMT_BGR555   : c-lumToYV12 = bgr15ToY; break;
 case PIX_FMT_RGB24: c-lumToYV12 = RENAME(rgb24ToY); break;
-case 

[libav-devel] [PATCH 10/14] Fixup

2011-04-11 Thread Luca Barbato
---
 libswscale/swscale.c |   13 +
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 8d8c625..fe96141 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1197,10 +1197,7 @@ static inline void monoblack2Y(uint8_t *dst, const 
uint8_t *src, long width, uin
 #define COMPILE_TEMPLATE_AMD3DNOW 0
 #define COMPILE_TEMPLATE_ALTIVEC 0
 
-#if COMPILE_C
-#define RENAME(a) a ## _C
 #include swscale_template.c
-#endif
 
 #if COMPILE_ALTIVEC
 #undef RENAME
@@ -1255,7 +1252,7 @@ static inline void monoblack2Y(uint8_t *dst, const 
uint8_t *src, long width, uin
 
 SwsFunc ff_getSwsFunc(SwsContext *c)
 {
-sws_init_swScale_C(c);
+sws_init_swScale_c(c);
 
 #if CONFIG_RUNTIME_CPUDETECT
 int flags = c-flags;
@@ -1272,7 +1269,7 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 sws_init_swScale_MMX(c);
 return swScale_MMX;
 } else {
-return swScale_C;
+return swScale_c;
 }
 
 #else
@@ -1281,10 +1278,10 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 sws_init_swScale_altivec(c);
 return swScale_altivec;
 } else {
-return swScale_C;
+return swScale_c;
 }
 #endif
-return swScale_C;
+return swScale_c;
 #endif /* ARCH_X86 */
 #else //CONFIG_RUNTIME_CPUDETECT
 #if   COMPILE_TEMPLATE_MMX2
@@ -1300,7 +1297,7 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 sws_init_swScale_altivec(c);
 return swScale_altivec;
 #else
-return swScale_C;
+return swScale_c;
 #endif
 #endif //!CONFIG_RUNTIME_CPUDETECT
 }
-- 
1.7.4.1

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


[libav-devel] [PATCH 11/14] Move back the function pointers in rgb2rgb.c

2011-04-11 Thread Luca Barbato
This unbreak darwin.
---
 libswscale/Makefile|2 +-
 libswscale/rgb2rgb.c   |   65 ++
 libswscale/swscale_functions.c |   67 
 3 files changed, 66 insertions(+), 68 deletions(-)
 delete mode 100644 libswscale/swscale_functions.c

diff --git a/libswscale/Makefile b/libswscale/Makefile
index b8f233f..816f7a8 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -5,7 +5,7 @@ FFLIBS = avutil
 
 HEADERS = swscale.h
 
-OBJS = options.o rgb2rgb.o swscale.o swscale_functions.o utils.o yuv2rgb.o
+OBJS = options.o rgb2rgb.o swscale.o utils.o yuv2rgb.o
 
 OBJS-$(ARCH_BFIN)  +=  bfin/internal_bfin.o \
bfin/swscale_bfin.o  \
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index 9e27e82..cb78bf0 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -29,6 +29,71 @@
 #include swscale.h
 #include swscale_internal.h
 
+void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb32to16)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb32to15)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb15tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb15to32)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb16to15)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb16tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb16to32)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb24to15)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*shuffle_bytes_2103)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
+void (*rgb32tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
+
+void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
+   long width, long height,
+   long lumStride, long chromStride, long dstStride);
+void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
+   long width, long height,
+   long lumStride, long chromStride, long dstStride);
+void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
+  long width, long height,
+  long lumStride, long chromStride, long dstStride);
+void (*yuv422ptouyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t 
*vsrc, uint8_t *dst,
+  long width, long height,
+  long lumStride, long chromStride, long dstStride);
+void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t 
*vdst,
+   long width, long height,
+   long lumStride, long chromStride, long srcStride);
+void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t 
*vdst,
+long width, long height,
+long lumStride, long chromStride, long srcStride);
+void (*planar2x)(const uint8_t *src, uint8_t *dst, long width, long height,
+ long srcStride, long dstStride);
+void (*interleaveBytes)(const uint8_t *src1, const uint8_t *src2, uint8_t *dst,
+long width, long height, long src1Stride,
+long src2Stride, long dstStride);
+void (*vu9_to_vu12)(const uint8_t *src1, const uint8_t *src2,
+uint8_t *dst1, uint8_t *dst2,
+long width, long height,
+long srcStride1, long srcStride2,
+long dstStride1, long dstStride2);
+void (*yvu9_to_yuy2)(const uint8_t *src1, const uint8_t *src2, const uint8_t 
*src3,
+ uint8_t *dst,
+ long width, long height,
+ long srcStride1, long srcStride2,
+ long srcStride3, long dstStride);
+void (*uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const 
uint8_t *src,
+ long width, long height,
+ long lumStride, long chromStride, long srcStride);
+void (*uyvytoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const 
uint8_t *src,
+ long width, long height,
+ long lumStride, long chromStride, long srcStride);
+void (*yuyvtoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const 
uint8_t *src,
+ long width, long height,
+ 

[libav-devel] [PATCH 13/14] Move x86-specific constants out of swscale.c

2011-04-11 Thread Luca Barbato
From: Josh Allmann joshua.allm...@gmail.com

---
 libswscale/swscale.c  |   57 -
 libswscale/x86/swscale_template.c |   54 +++
 2 files changed, 54 insertions(+), 57 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index fe96141..e830bb6 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -121,63 +121,6 @@ add BGR4 output support
 write special BGR-BGR scaler
 */
 
-#if ARCH_X86
-DECLARE_ASM_CONST(8, uint64_t, bF8)=   0xF8F8F8F8F8F8F8F8LL;
-DECLARE_ASM_CONST(8, uint64_t, bFC)=   0xFCFCFCFCFCFCFCFCLL;
-DECLARE_ASM_CONST(8, uint64_t, w10)=   0x0010001000100010LL;
-DECLARE_ASM_CONST(8, uint64_t, w02)=   0x0002000200020002LL;
-DECLARE_ASM_CONST(8, uint64_t, bm)=0xLL;
-DECLARE_ASM_CONST(8, uint64_t, bm0111)=0x00FFLL;
-DECLARE_ASM_CONST(8, uint64_t, bm1000)=0xFF00LL;
-DECLARE_ASM_CONST(8, uint64_t, bm01010101)=0x00FF00FF00FF00FFLL;
-
-const DECLARE_ALIGNED(8, uint64_t, ff_dither4)[2] = {
-0x0103010301030103LL,
-0x0200020002000200LL,};
-
-const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = {
-0x0602060206020602LL,
-0x0004000400040004LL,};
-
-DECLARE_ASM_CONST(8, uint64_t, b16Mask)=   0x001F001F001F001FLL;
-DECLARE_ASM_CONST(8, uint64_t, g16Mask)=   0x07E007E007E007E0LL;
-DECLARE_ASM_CONST(8, uint64_t, r16Mask)=   0xF800F800F800F800LL;
-DECLARE_ASM_CONST(8, uint64_t, b15Mask)=   0x001F001F001F001FLL;
-DECLARE_ASM_CONST(8, uint64_t, g15Mask)=   0x03E003E003E003E0LL;
-DECLARE_ASM_CONST(8, uint64_t, r15Mask)=   0x7C007C007C007C00LL;
-
-DECLARE_ALIGNED(8, const uint64_t, ff_M24A) = 0x00FFFFFFLL;
-DECLARE_ALIGNED(8, const uint64_t, ff_M24B) = 0xFFFFFF00LL;
-DECLARE_ALIGNED(8, const uint64_t, ff_M24C) = 0xFFFFLL;
-
-#ifdef FAST_BGR2YV12
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff)   = 0x00210041000DULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff)   = 0xFFEEFFDC0038ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff)   = 0x0038FFD2FFF8ULL;
-#else
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff)   = 0x20E540830C8BULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff)   = 0xED0FDAC23831ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff)   = 0x3831D0E6F6EAULL;
-#endif /* FAST_BGR2YV12 */
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset)  = 0x1010101010101010ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
-DECLARE_ALIGNED(8, const uint64_t, ff_w)= 0x0001000100010001ULL;
-
-DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY1Coeff) = 0x0C8840870C88ULL;
-DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY2Coeff) = 0x20DE408720DEULL;
-DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY1Coeff) = 0x20DE408720DEULL;
-DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY2Coeff) = 0x0C8840870C88ULL;
-DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toYOffset) = 0x000840084000ULL;
-
-DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUV)[2][4] = {
-{0x3838DAC83838ULL, 0xECFFDAC8ECFFULL, 0xF6E4D0E3F6E4ULL, 
0x3838D0E33838ULL},
-{0xECFFDAC8ECFFULL, 0x3838DAC83838ULL, 0x3838D0E33838ULL, 
0xF6E4D0E3F6E4ULL},
-};
-
-DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x004040404000ULL;
-
-#endif /* ARCH_X86 */
-
 DECLARE_ALIGNED(8, static const uint8_t, dither_2x2_4)[2][8]={
 {  1,   3,   1,   3,   1,   3,   1,   3, },
 {  2,   0,   2,   0,   2,   0,   2,   0, },
diff --git a/libswscale/x86/swscale_template.c 
b/libswscale/x86/swscale_template.c
index a125dca..6c56af7 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -18,6 +18,60 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+DECLARE_ASM_CONST(8, uint64_t, bF8)=   0xF8F8F8F8F8F8F8F8LL;
+DECLARE_ASM_CONST(8, uint64_t, bFC)=   0xFCFCFCFCFCFCFCFCLL;
+DECLARE_ASM_CONST(8, uint64_t, w10)=   0x0010001000100010LL;
+DECLARE_ASM_CONST(8, uint64_t, w02)=   0x0002000200020002LL;
+DECLARE_ASM_CONST(8, uint64_t, bm)=0xLL;
+DECLARE_ASM_CONST(8, uint64_t, bm0111)=0x00FFLL;
+DECLARE_ASM_CONST(8, uint64_t, bm1000)=0xFF00LL;
+DECLARE_ASM_CONST(8, uint64_t, bm01010101)=0x00FF00FF00FF00FFLL;
+
+const DECLARE_ALIGNED(8, uint64_t, ff_dither4)[2] = {
+0x0103010301030103LL,
+0x0200020002000200LL,};
+
+const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = {
+0x0602060206020602LL,
+0x0004000400040004LL,};
+
+DECLARE_ASM_CONST(8, uint64_t, b16Mask)=   0x001F001F001F001FLL;
+DECLARE_ASM_CONST(8, uint64_t, g16Mask)=   0x07E007E007E007E0LL;
+DECLARE_ASM_CONST(8, uint64_t, r16Mask)=   0xF800F800F800F800LL;
+DECLARE_ASM_CONST(8, uint64_t, b15Mask)=   0x001F001F001F001FLL;
+DECLARE_ASM_CONST(8, uint64_t, g15Mask)=   0x03E003E003E003E0LL;
+DECLARE_ASM_CONST(8, uint64_t, 

Re: [libav-devel] [PATCH 01/14] Thin rgb2rgb a little part 1 of many

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:07:34AM +0200, Luca Barbato wrote:
 Move the function pointers in a separate file.
 It will removed once the pointers will be factored in a more structured
 form
 ---

probably ok (and having YUV-to-YUV conversion in rgb2rgb.c is somehow a bit
baffling)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/14] Factorize FAST_BGR2YV12

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:07:35AM +0200, Luca Barbato wrote:
 It is used only for x86 so it will be moved once the code is moved in
 the arch dir
 
 Question: should we build an accurate BGR2YV12 variant?

maybe when we have optimisations for it
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 02/14] Factorize FAST_BGR2YV12

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:13:29AM +0200, Kostya wrote:
 On Mon, Apr 11, 2011 at 11:07:35AM +0200, Luca Barbato wrote:
  It is used only for x86 so it will be moved once the code is moved in
  the arch dir
  
  Question: should we build an accurate BGR2YV12 variant?
 
 maybe when we have optimisations for it

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


Re: [libav-devel] [PATCH 04/14] Untemplatize C code part 1

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:07:37AM +0200, Luca Barbato wrote:
 ---
  libswscale/rgb2rgb.c  |9 +-
  libswscale/rgb2rgb_template.c |  174 
  2 files changed, 91 insertions(+), 92 deletions(-)

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


Re: [libav-devel] [PATCH 05/14] Switch x86_reg to int for the C code

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:07:38AM +0200, Luca Barbato wrote:
 ---
  libswscale/rgb2rgb_template.c |   28 ++--
  1 files changed, 14 insertions(+), 14 deletions(-)

Could you also deniedermayerize it? I find var= value style improper.
But in general ok.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 09/14] Factorize init between C and x86

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:07:42AM +0200, Luca Barbato wrote:
 Always call first the C init and make the optional optimization
 init follow.
 The unaccelerated function pointer shouldn't be set again,
 likewise the other common logic should be present only on the C
 init.

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


Re: [libav-devel] [PATCH 11/14] Move back the function pointers in rgb2rgb.c

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 11:07:44AM +0200, Luca Barbato wrote:
 This unbreak darwin.

unbreakS
Also maybe you should merge it with patch 1 then?
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 10/14] Fixup

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:07:43AM +0200, Luca Barbato wrote:
 ---
  libswscale/swscale.c |   13 +
  1 files changed, 5 insertions(+), 8 deletions(-)

Fixup what?  Please be more descriptive.

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


Re: [libav-devel] Swscale cleanup part I

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:07:33AM +0200, Luca Barbato wrote:
 Hi this patchset does still apply today.
 Even if not complete I'm considering to merge it since seems not
 introduce changes and already moves most of the x86 code in its
 directory.

A general remark: I find the log messages a bit short and many lack an
explanation why you are making changes as opposed to just describing
what the change consists of.

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


Re: [libav-devel] [PATCH 06/14] Move away x86 specific code from rgb2rgb part 2

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:07:39AM +0200, Luca Barbato wrote:
 With this commit we should have all the arch specific code moved away.
 Init pattern now:
 - generic C init first
 - arch specific init later overwriting
 
 --- a/libswscale/rgb2rgb.c
 +++ b/libswscale/rgb2rgb.c
 @@ -130,21 +51,14 @@ DECLARE_ASM_CONST(8, uint64_t, blue_15mask)  = 
 0x001f001fULL;
   32-bit C version, and andadd trick by Michael Niedermayer
  */
  
 +void rgb2rgb_init_x86();

Do we not have a suitable header for this forward declaration?

 --- /dev/null
 +++ b/libswscale/x86/rgb2rgb.c
 @@ -0,0 +1,146 @@
 +/*
 + * software RGB to RGB converter
 + * pluralize by software PAL8 to RGB converter
 + *  software YUV to YUV converter
 + *  software YUV to RGB converter
 + * Written by Nick Kurshev.
 + * palette  YUV  runtime CPU stuff by Michael (michae...@gmx.at)
 + *
 + * This file is part of FFmpeg.

U

 + * FFmpeg is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU Lesser General Public
 + * License as published by the Free Software Foundation; either
 + * version 2.1 of the License, or (at your option) any later version.
 + *
 + * FFmpeg is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 + * Lesser General Public License for more details.
 + *
 + * You should have received a copy of the GNU Lesser General Public
 + * License along with FFmpeg; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
 USA
 + */
 +#include inttypes.h
 +#include config.h
 +#include libavutil/x86_cpu.h
 +#include libavutil/bswap.h
 +#include libswscale/rgb2rgb.h
 +#include libswscale/swscale.h
 +#include libswscale/swscale_internal.h

nits: I suspect just stdint.h is enough; add empty lines before the
#includes and between system and local #includes.

 +#if ARCH_X86

This file is only compiled for x86, so this is unnecessary.

 +#if ARCH_X86

again

 +void rgb2rgb_init_x86(int flags);

Yeah, we need a header file, now the forward declaration is duplicated.

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


Re: [libav-devel] [PATCH 06/14] Move away x86 specific code from rgb2rgb part 2

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:26:16AM +0200, Kostya wrote:
 On Mon, Apr 11, 2011 at 11:07:39AM +0200, Luca Barbato wrote:
  With this commit we should have all the arch specific code moved away.
  Init pattern now:
  - generic C init first
  - arch specific init later overwriting
  
  --- /dev/null
  +++ b/libswscale/x86/rgb2rgb.c
  +void rgb2rgb_init_x86(int flags);
 
 is that requirement by modern GCC to declare function before its
 implementation in the same file?

It is a requirement of modern FFmpeg configure which adds
-Werror=implicit-declaration to CFLAGS.

The declaration should go in a header file instead.

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


Re: [libav-devel] [PATCH 08/14] Untemplatize swscale_template

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:07:41AM +0200, Luca Barbato wrote:
 move all the functions to the _c suffix

Please add the rationale for this change to the log message :)

 --- a/libswscale/swscale_template.c
 +++ b/libswscale/swscale_template.c
 @@ -18,7 +18,7 @@
  
 -static inline void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter, 
 const int16_t **lumSrc, int lumFilterSize,
 +static inline void yuv2yuvX_c(SwsContext *c, const int16_t *lumFilter, const 
 int16_t **lumSrc, int lumFilterSize,
  const int16_t *chrFilter, const int16_t 
 **chrSrc, int chrFilterSize, const int16_t **alpSrc,
  uint8_t *dest, uint8_t *uDest, uint8_t 
 *vDest, uint8_t *aDest, long dstW, long chrDstW)

IMO just fix the indentation right away, possibly taking care of long
lines in the process; more instances below.

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


Re: [libav-devel] [PATCH 09/14] Factorize init between C and x86

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:07:42AM +0200, Luca Barbato wrote:
 Always call first the C init and make the optional optimization
 init follow.
 The unaccelerated function pointer shouldn't be set again,
 likewise the other common logic should be present only on the C
 init.

  Factorize initialization between C and x86 code paths.

  Always call the C init first and make the optional optimized init follow.
  The unaccelerated function pointer will not be reset; the common logic
  will be present in the C init only.

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


Re: [libav-devel] Swscale cleanup part I

2011-04-11 Thread Luca Barbato
On 04/11/2011 12:16 PM, Diego Biurrun wrote:
 On Mon, Apr 11, 2011 at 11:07:33AM +0200, Luca Barbato wrote:
 Hi this patchset does still apply today.
 Even if not complete I'm considering to merge it since seems not
 introduce changes and already moves most of the x86 code in its
 directory.
 
 A general remark: I find the log messages a bit short and many lack an
 explanation why you are making changes as opposed to just describing
 what the change consists of.

I'm thinking about squashing them. The whole rationale is to move x86
specific code out the plain C code and then clean it up.

Do you think would make sense squashing everything in a single huge
patch or not?

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

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


Re: [libav-devel] [PATCH 2/2] Add support for AMR-WB encoding via libvo-amrwbenc

2011-04-11 Thread Martin Storsjö
On Mon, 11 Apr 2011, Luca Barbato wrote:

 On 04/08/2011 12:22 AM, Martin Storsjö wrote:
 
  The wrapper code is based on the libamr wrapper removed in SVN rev 19365.
  ---
   Changelog   |1 +
   configure   |6 ++
   doc/general.texi|3 +-
   libavcodec/Makefile |1 +
   libavcodec/allcodecs.c  |1 +
   libavcodec/libvo-amrwbenc.c |  127 
  +++
   libavcodec/version.h|2 +-
 
 
 Looks ok

Pushed

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


Re: [libav-devel] [PATCH 1/2] Add an AAC encoder by using the libvo-aacenc library

2011-04-11 Thread Martin Storsjö
On Mon, 11 Apr 2011, Luca Barbato wrote:

 On 04/08/2011 12:21 AM, Martin Storsjö wrote:
   Changelog |1 +
   configure |6 ++
   doc/general.texi  |2 +-
   libavcodec/Makefile   |1 +
   libavcodec/allcodecs.c|1 +
   libavcodec/libvo-aacenc.c |  128 
  +
   libavcodec/version.h  |2 +-
 
 Ok.

Pushed

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


Re: [libav-devel] Swscale cleanup part I

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 01:48:04PM +0200, Luca Barbato wrote:
 On 04/11/2011 12:16 PM, Diego Biurrun wrote:
  On Mon, Apr 11, 2011 at 11:07:33AM +0200, Luca Barbato wrote:
  Hi this patchset does still apply today.
  Even if not complete I'm considering to merge it since seems not
  introduce changes and already moves most of the x86 code in its
  directory.
  
  A general remark: I find the log messages a bit short and many lack an
  explanation why you are making changes as opposed to just describing
  what the change consists of.
 
 I'm thinking about squashing them. The whole rationale is to move x86
 specific code out the plain C code and then clean it up.
 
 Do you think would make sense squashing everything in a single huge
 patch or not?

Not exactly. I'd split it into 3-4 big patches - splitting x86-specific part,
factoring out initialisation stuff and other fixes.
But having the whole development history is certainly an overkill to me
(git log libavcodec/vorbis_enc.c should serve you an example of how not to do
it)
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


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

2011-04-11 Thread Diego Biurrun
On Sun, Apr 10, 2011 at 09:54:56PM +0200, Luca Barbato wrote:
 On 04/10/2011 09:46 PM, Diego Biurrun wrote:
  The printf function is forbidden in library code, but not in test programs,
  so #undefine the printf macro that disables the system printf function.
 
 ok

Pushed.

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


Re: [libav-devel] [PATCH] Add unconditional return statement to yuva420_rgb32_MMX() / yuva420_bgr32_MMX().

2011-04-11 Thread Diego Biurrun
On Mon, Apr 11, 2011 at 11:25:49AM +0200, Luca Barbato wrote:
 On 04/10/2011 09:44 PM, Diego Biurrun wrote:
  When HAVE_7REGS was not defined these functions had an empty body
  causing the following warnings during compilation.
  In file included from libswscale/x86/yuv2rgb_mmx.c:58:
  libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_rgb32_MMX’:
  libswscale/x86/yuv2rgb_template.c:412: warning: no return statement in 
  function returning non-void
  libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_bgr32_MMX’:
  libswscale/x86/yuv2rgb_template.c:457: warning: no return statement in 
  function returning non-void
 
 Probably there is a saner way, patch ok.

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


Re: [libav-devel] [PATCH] Add unconditional return statement to yuva420_rgb32_MMX() / yuva420_bgr32_MMX().

2011-04-11 Thread Luca Barbato
On 04/11/2011 03:44 PM, Ronald S. Bultje wrote:
 This isn't right. You're declaring empty functions for stuff that is
 supposed to do something. In x86/yuv2rgb_mmx.c, you'll see these
 functions are only called under if (HAVE_7REGS) anyway, so the proper
 fix is to not declare these functions at all, i.e. move the #if
 HAVE_7REGS outside the function declaration. Dead code elimination
 should take care of the rest.

The cleanup should take care of it.

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

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


Re: [libav-devel] [PATCH] Add unconditional return statement to yuva420_rgb32_MMX() / yuva420_bgr32_MMX().

2011-04-11 Thread Ronald S. Bultje
Hi,

On Mon, Apr 11, 2011 at 10:01 AM, Luca Barbato lu_z...@gentoo.org wrote:
 On 04/11/2011 03:44 PM, Ronald S. Bultje wrote:
 This isn't right. You're declaring empty functions for stuff that is
 supposed to do something. In x86/yuv2rgb_mmx.c, you'll see these
 functions are only called under if (HAVE_7REGS) anyway, so the proper
 fix is to not declare these functions at all, i.e. move the #if
 HAVE_7REGS outside the function declaration. Dead code elimination
 should take care of the rest.

 The cleanup should take care of it.

That's still no reason to apply a broken patch before that... But
anyway, let's not take this too far, let's get your cleanup in, that's
much more exciting, and then let's fix whatever's left after.

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


Re: [libav-devel] [PATCH] Add unconditional return statement to yuva420_rgb32_MMX() / yuva420_bgr32_MMX().

2011-04-11 Thread Kostya
On Mon, Apr 11, 2011 at 10:06:43AM -0400, Ronald S. Bultje wrote:
 Hi,
 
 On Mon, Apr 11, 2011 at 10:01 AM, Luca Barbato lu_z...@gentoo.org wrote:
  On 04/11/2011 03:44 PM, Ronald S. Bultje wrote:
  This isn't right. You're declaring empty functions for stuff that is
  supposed to do something. In x86/yuv2rgb_mmx.c, you'll see these
  functions are only called under if (HAVE_7REGS) anyway, so the proper
  fix is to not declare these functions at all, i.e. move the #if
  HAVE_7REGS outside the function declaration. Dead code elimination
  should take care of the rest.
 
  The cleanup should take care of it.
 
 That's still no reason to apply a broken patch before that... But
 anyway, let's not take this too far, let's get your cleanup in, that's
 much more exciting, and then let's fix whatever's left after.

It's not that broken since dead code elimination should work fine in that case
too regardless if it's totally empty function or with one return.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 05/14] Switch x86_reg to int for the C code

2011-04-11 Thread Aℓex Converse
On Mon, Apr 11, 2011 at 3:06 AM, Diego Biurrun di...@biurrun.de wrote:
 On Mon, Apr 11, 2011 at 11:07:38AM +0200, Luca Barbato wrote:
 ---
  libswscale/rgb2rgb_template.c |   28 ++--
  1 files changed, 14 insertions(+), 14 deletions(-)

 Why?  The log message is descriptive, but not explanatory...

I think descriptive is fine in this case. The explanation should be obvious.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 1/5] swscale: factorize FAST_BGR2YV12

2011-04-11 Thread Luca Barbato
It is used only for x86 so it will be moved once the code is moved in
the arch dir

Question: should we build an accurate BGR2YV12 variant?
---
 libswscale/rgb2rgb.c  |4 ++--
 libswscale/swscale.c  |2 --
 libswscale/swscale_internal.h |2 ++
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index bc0ed63..e5a6e71 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -30,8 +30,6 @@
 #include swscale.h
 #include swscale_internal.h
 
-#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
-
 void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
 void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
 void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
@@ -98,6 +96,8 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t 
*vdst, const uint8_t
  long lumStride, long chromStride, long srcStride);
 
 
+
+
 #if ARCH_X86
 DECLARE_ASM_CONST(8, uint64_t, mmx_ff)   = 0x00FFULL;
 DECLARE_ASM_CONST(8, uint64_t, mmx_null) = 0xULL;
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index ed6db72..565743a 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -76,8 +76,6 @@ untested special converters
 //#undef ARCH_X86
 #define DITHER1XBPP
 
-#define FAST_BGR2YV12 // use 7 bit coefficients instead of 15 bit
-
 #define isPacked(x) (   \
(x)==PIX_FMT_PAL8\
 || (x)==PIX_FMT_YUYV422 \
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index 631f1e0..4c6ad2a 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -31,6 +31,8 @@
 
 #define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long
 
+#define FAST_BGR2YV12 //use 7-bit instead of 15-bit coefficients
+
 #define MAX_FILTER_SIZE 256
 
 #if ARCH_X86
-- 
1.7.4.1

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


[libav-devel] [PATCH 5/5] swscale: simplify initialization code

2011-04-11 Thread Luca Barbato
From: Josh Allmann joshua.allm...@gmail.com

Simplify the fallthrough case when no accelerated functions
can be initialized.
---
 libswscale/swscale.c |9 ++---
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index e830bb6..277a0d3 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1211,8 +1211,6 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 } else if (flags  SWS_CPU_CAPS_MMX) {
 sws_init_swScale_MMX(c);
 return swScale_MMX;
-} else {
-return swScale_c;
 }
 
 #else
@@ -1220,11 +1218,8 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 if (flags  SWS_CPU_CAPS_ALTIVEC) {
 sws_init_swScale_altivec(c);
 return swScale_altivec;
-} else {
-return swScale_c;
 }
 #endif
-return swScale_c;
 #endif /* ARCH_X86 */
 #else //CONFIG_RUNTIME_CPUDETECT
 #if   COMPILE_TEMPLATE_MMX2
@@ -1239,10 +1234,10 @@ SwsFunc ff_getSwsFunc(SwsContext *c)
 #elif COMPILE_TEMPLATE_ALTIVEC
 sws_init_swScale_altivec(c);
 return swScale_altivec;
-#else
-return swScale_c;
 #endif
 #endif //!CONFIG_RUNTIME_CPUDETECT
+
+return swScale_c;
 }
 
 static void copyPlane(const uint8_t *src, int srcStride,
-- 
1.7.4.1

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


Re: [libav-devel] [PATCH 1/5] swscale: factorize FAST_BGR2YV12

2011-04-11 Thread Aℓex Converse
On Mon, Apr 11, 2011 at 1:01 PM, Luca Barbato lu_z...@gentoo.org wrote:
 It is used only for x86 so it will be moved once the code is moved in
 the arch dir

 Question: should we build an accurate BGR2YV12 variant?
 ---
  libswscale/rgb2rgb.c          |    4 ++--
  libswscale/swscale.c          |    2 --
  libswscale/swscale_internal.h |    2 ++
  3 files changed, 4 insertions(+), 4 deletions(-)

 diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
 index bc0ed63..e5a6e71 100644
 --- a/libswscale/rgb2rgb.c
 +++ b/libswscale/rgb2rgb.c
 @@ -30,8 +30,6 @@
  #include swscale.h
  #include swscale_internal.h

 -#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
 -
  void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
  void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
  void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
 @@ -98,6 +96,8 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t 
 *vdst, const uint8_t
                      long lumStride, long chromStride, long srcStride);


 +
 +

These new lines seem unnecessary

  #if ARCH_X86
  DECLARE_ASM_CONST(8, uint64_t, mmx_ff)       = 0x00FFULL;
  DECLARE_ASM_CONST(8, uint64_t, mmx_null)     = 0xULL;
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH 1/5] swscale: factorize FAST_BGR2YV12

2011-04-11 Thread Luca Barbato
On 04/11/2011 10:21 PM, Aℓex Converse wrote:
 On Mon, Apr 11, 2011 at 1:01 PM, Luca Barbato lu_z...@gentoo.org wrote:
 It is used only for x86 so it will be moved once the code is moved in
 the arch dir

 Question: should we build an accurate BGR2YV12 variant?
 ---
  libswscale/rgb2rgb.c  |4 ++--
  libswscale/swscale.c  |2 --
  libswscale/swscale_internal.h |2 ++
  3 files changed, 4 insertions(+), 4 deletions(-)

 diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
 index bc0ed63..e5a6e71 100644
 --- a/libswscale/rgb2rgb.c
 +++ b/libswscale/rgb2rgb.c
 @@ -30,8 +30,6 @@
  #include swscale.h
  #include swscale_internal.h

 -#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients
 -
  void (*rgb24tobgr32)(const uint8_t *src, uint8_t *dst, long src_size);
  void (*rgb24tobgr16)(const uint8_t *src, uint8_t *dst, long src_size);
  void (*rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long src_size);
 @@ -98,6 +96,8 @@ void (*yuyvtoyuv422)(uint8_t *ydst, uint8_t *udst, uint8_t 
 *vdst, const uint8_t
  long lumStride, long chromStride, long srcStride);


 +
 +
 
 These new lines seem unnecessary

Right, they are leftovers...

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

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


[libav-devel] [PATCH]AAC audio: Skip ADTS Header when copied from TS container to Non-TS containers

2011-04-11 Thread Manjunath Siddaiah
Hi,

When we do -acodec  copy if input is mpegts and output is non-mpegts ( MOV, 
MP4, 3GP, FLV, ISM) ADTS header also got copied. AAC audio do not need ADTS 
header in MOV, MP4, 3GP, FLV, ISM containers. This patch skips the ADTS header 
copying to non-mpegts formats.

-Manjunath H Siddaiah


Skip_ADTS_header_forAAC_CoipedFrom_mpegts_to_non-mpegts.patch
Description: Skip_ADTS_header_forAAC_CoipedFrom_mpegts_to_non-mpegts.patch
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH]AAC audio: Skip ADTS Header when copied from TS container to Non-TS containers

2011-04-11 Thread Luca Barbato
On 04/11/2011 11:14 PM, Manjunath Siddaiah wrote:
 Hi,
 
 When we do -acodec  copy if input is mpegts and output is non-mpegts
 ( MOV, MP4, 3GP, FLV, ISM) ADTS header also got copied.
 AAC audio do not need ADTS header in MOV, MP4, 3GP, FLV, ISM containers.
 This patch skips the ADTS header copying to non-mpegts formats.

Does forcing the global header solve it ? The proposed patch looks
wrong, the reported bug is real though.

lu

-- 

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

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


Re: [libav-devel] [PATCH 19/27] patch checklist:git format-patch Signed-off-by: Michael Niedermayer michae...@gmx.at

2011-04-11 Thread Michael Niedermayer
On Sat, Apr 09, 2011 at 05:10:35PM -0400, Ronald S. Bultje wrote:
[...]
  -@item
  -    Did you provide a suggestion for a clear commit log message?
 
 I don't think this is right. Git still doesn't write your log messages
 for you. You could reword it as did you provide a clear git commit
 log message?.

i agree, ill change it that way in ffmpeg with author ronald

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


signature.asc
Description: Digital signature
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [FFmpeg-devel] [PATCH 1/3] Add avio_check() function.

2011-04-11 Thread Michael Niedermayer
On Sun, Apr 10, 2011 at 12:52:57AM +0200, Stefano Sabatini wrote:
 [CC-ing ffmpeg-devel]
 
 On date Saturday 2011-04-09 12:35:58 +0200, Anton Khirnov wrote:
  On Sat, Apr 09, 2011 at 02:47:35AM +0200, Stefano Sabatini wrote:
   From b563c12cb285f1e6eb8dc19d1a18323cd9280ea1 Mon Sep 17 00:00:00 2001
   From: Stefano Sabatini stefano.sabatini-l...@poste.it
   Date: Fri, 8 Apr 2011 18:32:25 +0200
   Subject: [PATCH] avio: add avio_check()
   
   The new function is more flexible than url_exist(), as it allows to
   specify which access flags to check, and does not require an explicit
   open of the checked resource.
   ---
libavformat/avio.c |   19 +++
libavformat/avio.h |   15 +++
2 files changed, 34 insertions(+), 0 deletions(-)
   
   diff --git a/libavformat/avio.c b/libavformat/avio.c
   index 7b066e3..cc57529 100644
   --- a/libavformat/avio.c
   +++ b/libavformat/avio.c
   @@ -362,6 +362,25 @@ int url_exist(const char *filename)
return 1;
}

   +int avio_check(const char *url, int flags)
   +{
   +URLContext *h;
   +int ret = ffurl_alloc(h, url, flags);
   +if (ret)
   +return ret;
   +
   +if (h-prot-url_check) {
   +ret = h-prot-url_check(h, flags);
   +} else {
   +ret = ffurl_connect(h);
   +if (ret = 0)
  
  When is ret  0? A quick glance at ffurl_connect suggests that it
  returns 0 on success or an AVERROR  0 on error.
 
 The usual convenction is: = 0 in case of success,  0 in case of
 failure, even if the positive values are not used most of the times,
 so the check can't hurt.

yep, its also consistent throughout ffmpeg.
One immedeatly knows what a f()0 or f()=0 means even if one doesnt
know the API of f().
such consistent error handling thus makes teh code a (tiny) bit easier
to read

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

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


signature.asc
Description: Digital signature
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH]AAC audio: Skip ADTS Header when copied from TS container to Non-TS containers

2011-04-11 Thread Aℓex Converse
On Mon, Apr 11, 2011 at 2:24 PM, Luca Barbato lu_z...@gentoo.org wrote:
 On 04/11/2011 11:14 PM, Manjunath Siddaiah wrote:
 Hi,

 When we do -acodec  copy if input is mpegts and output is non-mpegts
 ( MOV, MP4, 3GP, FLV, ISM) ADTS header also got copied.
 AAC audio do not need ADTS header in MOV, MP4, 3GP, FLV, ISM containers.
 This patch skips the ADTS header copying to non-mpegts formats.

 Does forcing the global header solve it ? The proposed patch looks
 wrong, the reported bug is real though.


-absf aac_adtstoasc

Once upon a time there was a patch pending to automatically insert
BSFs when needed.
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


Re: [libav-devel] [PATCH] Convert some undefined 131 shifts into 1U31.

2011-04-11 Thread Alex Converse
On Sat, Apr 9, 2011 at 5:48 PM, Luca Barbato lu_z...@gentoo.org wrote:
 On 04/10/2011 02:41 AM, Alex Converse wrote:
 Passes make fate, altivec untested.

 Altivec should not have problems (the variable is already unsigned).

 lu

 --

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