From 3da99d25248c090b4f28869093011486052d9c3d Mon Sep 17 00:00:00 2001 From: kostya Date: Tue, 19 May 2009 17:26:22 +0000 Subject: Make SwScaler recognize RGB48 BE/LE colourspaces (not support though). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29316 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 4 ++++ libswscale/swscale_internal.h | 3 +++ 2 files changed, 7 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 31e3b83cde..e3bf0c3c57 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -463,6 +463,10 @@ const char *sws_format_name(enum PixelFormat format) return "rgb4"; case PIX_FMT_RGB4_BYTE: return "rgb4 byte"; + case PIX_FMT_RGB48BE: + return "rgb48be"; + case PIX_FMT_RGB48LE: + return "rgb48le"; case PIX_FMT_NV12: return "nv12"; case PIX_FMT_NV21: diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index d9bbb6c1e2..effbae9843 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -376,6 +376,9 @@ const char *sws_format_name(int format); static inline int fmt_depth(int fmt) { switch(fmt) { + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: + return 48; case PIX_FMT_BGRA: case PIX_FMT_ABGR: case PIX_FMT_RGBA: -- cgit v1.2.3 From 5b29003e0c0ee684ae3bf00fae763448ddd9563a Mon Sep 17 00:00:00 2001 From: kostya Date: Tue, 19 May 2009 17:37:58 +0000 Subject: Let SwScaler know that RGB48 BE/LE is 16-bits per component format. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29317 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index effbae9843..18a79cac54 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -299,6 +299,8 @@ const char *sws_format_name(int format); #define is16BPS(x) ( \ (x)==PIX_FMT_GRAY16BE \ || (x)==PIX_FMT_GRAY16LE \ + || (x)==PIX_FMT_RGB48BE \ + || (x)==PIX_FMT_RGB48LE \ || (x)==PIX_FMT_YUV420PLE \ || (x)==PIX_FMT_YUV422PLE \ || (x)==PIX_FMT_YUV444PLE \ -- cgit v1.2.3 From f7d2053641987a76d8c73d93919d6e29cba36840 Mon Sep 17 00:00:00 2001 From: kostya Date: Mon, 25 May 2009 16:42:54 +0000 Subject: Move colorspace conversion functions implemented in pure C from template into swscale.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29320 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 115 ++++++++++++++++++++++++++++++ libswscale/swscale_template.c | 160 ++++++------------------------------------ 2 files changed, 138 insertions(+), 137 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index e3bf0c3c57..b9adc83e55 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1122,6 +1122,121 @@ static void fillPlane(uint8_t* plane, int stride, int width, int height, int y, } } +#define BGR2Y(type, name, shr, shg, shb, maskr, maskg, maskb, RY, GY, BY, S)\ +static inline void name(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)\ +{\ + int i;\ + for (i=0; i>shb)&maskb;\ + int g= (((const type*)src)[i]>>shg)&maskg;\ + int r= (((const type*)src)[i]>>shr)&maskr;\ +\ + dst[i]= (((RY)*r + (GY)*g + (BY)*b + (33<<((S)-1)))>>(S));\ + }\ +} + +BGR2Y(uint32_t, bgr32ToY,16, 0, 0, 0x00FF, 0xFF00, 0x00FF, RY<< 8, GY , BY<< 8, RGB2YUV_SHIFT+8) +BGR2Y(uint32_t, rgb32ToY, 0, 0,16, 0x00FF, 0xFF00, 0x00FF, RY<< 8, GY , BY<< 8, RGB2YUV_SHIFT+8) +BGR2Y(uint16_t, bgr16ToY, 0, 0, 0, 0x001F, 0x07E0, 0xF800, RY<<11, GY<<5, BY , RGB2YUV_SHIFT+8) +BGR2Y(uint16_t, bgr15ToY, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RY<<10, GY<<5, BY , RGB2YUV_SHIFT+7) +BGR2Y(uint16_t, rgb16ToY, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RY , GY<<5, BY<<11, RGB2YUV_SHIFT+8) +BGR2Y(uint16_t, rgb15ToY, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RY , GY<<5, BY<<10, RGB2YUV_SHIFT+7) + +static inline void abgrToA(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused){ + int i; + for (i=0; i>shb;\ + int g= (((const type*)src)[i]&maskg)>>shg;\ + int r= (((const type*)src)[i]&maskr)>>shr;\ +\ + dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<((S)-1)))>>(S);\ + dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\ + }\ +}\ +static inline void name ## _half(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, long width, uint32_t *unused)\ +{\ + int i;\ + for (i=0; i>shb;\ + int r= ((pix0+pix1-g)&(maskr|(2*maskr)))>>shr;\ + g&= maskg|(2*maskg);\ +\ + g>>=shg;\ +\ + dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<(S)))>>((S)+1);\ + dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<(S)))>>((S)+1);\ + }\ +} + +BGR2UV(uint32_t, bgr32ToUV,16, 0, 0, 0xFF000000, 0xFF0000, 0xFF00, 0x00FF, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) +BGR2UV(uint32_t, rgb32ToUV, 0, 0,16, 0xFF000000, 0x00FF, 0xFF00, 0xFF0000, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) +BGR2UV(uint16_t, bgr16ToUV, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, RU<<11, GU<<5, BU , RV<<11, GV<<5, BV , RGB2YUV_SHIFT+8) +BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<5, BU , RV<<10, GV<<5, BV , RGB2YUV_SHIFT+7) +BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8) +BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7) + +static inline void palToY(uint8_t *dst, const uint8_t *src, long width, uint32_t *pal) +{ + int i; + for (i=0; i>8; + dstV[i]= p>>16; + } +} + +static inline void monowhite2Y(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused) +{ + int i, j; + for (i=0; i>(7-j))&1)*255; + } +} + +static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused) +{ + int i, j; + for (i=0; i>(7-j))&1)*255; + } +} + + //Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one //Plain C versions #if !HAVE_MMX || CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index a605b9b663..1bb0e1dbb6 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -1799,74 +1799,6 @@ static inline void RENAME(BEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s #endif } -#define BGR2Y(type, name, shr, shg, shb, maskr, maskg, maskb, RY, GY, BY, S)\ -static inline void RENAME(name)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)\ -{\ - int i;\ - for (i=0; i>shb)&maskb;\ - int g= (((const type*)src)[i]>>shg)&maskg;\ - int r= (((const type*)src)[i]>>shr)&maskr;\ -\ - dst[i]= (((RY)*r + (GY)*g + (BY)*b + (33<<((S)-1)))>>(S));\ - }\ -} - -BGR2Y(uint32_t, bgr32ToY,16, 0, 0, 0x00FF, 0xFF00, 0x00FF, RY<< 8, GY , BY<< 8, RGB2YUV_SHIFT+8) -BGR2Y(uint32_t, rgb32ToY, 0, 0,16, 0x00FF, 0xFF00, 0x00FF, RY<< 8, GY , BY<< 8, RGB2YUV_SHIFT+8) -BGR2Y(uint16_t, bgr16ToY, 0, 0, 0, 0x001F, 0x07E0, 0xF800, RY<<11, GY<<5, BY , RGB2YUV_SHIFT+8) -BGR2Y(uint16_t, bgr15ToY, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RY<<10, GY<<5, BY , RGB2YUV_SHIFT+7) -BGR2Y(uint16_t, rgb16ToY, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RY , GY<<5, BY<<11, RGB2YUV_SHIFT+8) -BGR2Y(uint16_t, rgb15ToY, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RY , GY<<5, BY<<10, RGB2YUV_SHIFT+7) - -static inline void RENAME(abgrToA)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused){ - int i; - for (i=0; i>shb;\ - int g= (((const type*)src)[i]&maskg)>>shg;\ - int r= (((const type*)src)[i]&maskr)>>shr;\ -\ - dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<((S)-1)))>>(S);\ - dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<((S)-1)))>>(S);\ - }\ -}\ -static inline void RENAME(name ## _half)(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, const uint8_t *dummy, long width, uint32_t *unused)\ -{\ - int i;\ - for (i=0; i>shb;\ - int r= ((pix0+pix1-g)&(maskr|(2*maskr)))>>shr;\ - g&= maskg|(2*maskg);\ -\ - g>>=shg;\ -\ - dstU[i]= ((RU)*r + (GU)*g + (BU)*b + (257<<(S)))>>((S)+1);\ - dstV[i]= ((RV)*r + (GV)*g + (BV)*b + (257<<(S)))>>((S)+1);\ - }\ -} - -BGR2UV(uint32_t, bgr32ToUV,16, 0, 0, 0xFF000000, 0xFF0000, 0xFF00, 0x00FF, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) -BGR2UV(uint32_t, rgb32ToUV, 0, 0,16, 0xFF000000, 0x00FF, 0xFF00, 0xFF0000, RU<< 8, GU , BU<< 8, RV<< 8, GV , BV<< 8, RGB2YUV_SHIFT+8) -BGR2UV(uint16_t, bgr16ToUV, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, RU<<11, GU<<5, BU , RV<<11, GV<<5, BV , RGB2YUV_SHIFT+8) -BGR2UV(uint16_t, bgr15ToUV, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, RU<<10, GU<<5, BU , RV<<10, GV<<5, BV , RGB2YUV_SHIFT+7) -BGR2UV(uint16_t, rgb16ToUV, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, RU , GU<<5, BU<<11, RV , GV<<5, BV<<11, RGB2YUV_SHIFT+8) -BGR2UV(uint16_t, rgb15ToUV, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, RU , GU<<5, BU<<10, RV , GV<<5, BV<<10, RGB2YUV_SHIFT+7) - #if HAVE_MMX static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, long width, int srcFormat) { @@ -2084,52 +2016,6 @@ static inline void RENAME(rgb24ToUV_half)(uint8_t *dstU, uint8_t *dstV, const ui } -static inline void RENAME(palToY)(uint8_t *dst, const uint8_t *src, long width, uint32_t *pal) -{ - int i; - for (i=0; i>8; - dstV[i]= p>>16; - } -} - -static inline void RENAME(monowhite2Y)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused) -{ - int i, j; - for (i=0; i>(7-j))&1)*255; - } -} - -static inline void RENAME(monoblack2Y)(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused) -{ - int i, j; - for (i=0; i>(7-j))&1)*255; - } -} - // bilinear / bicubic scaling static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, int srcW, int xInc, const int16_t *filter, const int16_t *filterPos, long filterSize) @@ -3151,7 +3037,7 @@ static void RENAME(sws_init_swScale)(SwsContext *c) case PIX_FMT_BGR8 : case PIX_FMT_PAL8 : case PIX_FMT_BGR4_BYTE: - case PIX_FMT_RGB4_BYTE: c->hcscale_internal = RENAME(palToUV); break; + case PIX_FMT_RGB4_BYTE: c->hcscale_internal = palToUV; break; case PIX_FMT_YUV420PBE: case PIX_FMT_YUV422PBE: case PIX_FMT_YUV444PBE: c->hcscale_internal = RENAME(BEToUV); break; @@ -3162,28 +3048,28 @@ static void RENAME(sws_init_swScale)(SwsContext *c) if (c->chrSrcHSubSample) { switch(srcFormat) { case PIX_FMT_RGB32 : - case PIX_FMT_RGB32_1: c->hcscale_internal = RENAME(bgr32ToUV_half); break; + case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV_half; break; case PIX_FMT_BGR24 : c->hcscale_internal = RENAME(bgr24ToUV_half); break; - case PIX_FMT_BGR565 : c->hcscale_internal = RENAME(bgr16ToUV_half); break; - case PIX_FMT_BGR555 : c->hcscale_internal = RENAME(bgr15ToUV_half); break; + case PIX_FMT_BGR565 : c->hcscale_internal = bgr16ToUV_half; break; + case PIX_FMT_BGR555 : c->hcscale_internal = bgr15ToUV_half; break; case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hcscale_internal = RENAME(rgb32ToUV_half); break; + case PIX_FMT_BGR32_1: c->hcscale_internal = rgb32ToUV_half; break; case PIX_FMT_RGB24 : c->hcscale_internal = RENAME(rgb24ToUV_half); break; - case PIX_FMT_RGB565 : c->hcscale_internal = RENAME(rgb16ToUV_half); break; - case PIX_FMT_RGB555 : c->hcscale_internal = RENAME(rgb15ToUV_half); break; + case PIX_FMT_RGB565 : c->hcscale_internal = rgb16ToUV_half; break; + case PIX_FMT_RGB555 : c->hcscale_internal = rgb15ToUV_half; break; } } else { switch(srcFormat) { case PIX_FMT_RGB32 : - case PIX_FMT_RGB32_1: c->hcscale_internal = RENAME(bgr32ToUV); break; + case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV; break; case PIX_FMT_BGR24 : c->hcscale_internal = RENAME(bgr24ToUV); break; - case PIX_FMT_BGR565 : c->hcscale_internal = RENAME(bgr16ToUV); break; - case PIX_FMT_BGR555 : c->hcscale_internal = RENAME(bgr15ToUV); break; + case PIX_FMT_BGR565 : c->hcscale_internal = bgr16ToUV; break; + case PIX_FMT_BGR555 : c->hcscale_internal = bgr15ToUV; break; case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hcscale_internal = RENAME(rgb32ToUV); break; + case PIX_FMT_BGR32_1: c->hcscale_internal = rgb32ToUV; break; case PIX_FMT_RGB24 : c->hcscale_internal = RENAME(rgb24ToUV); break; - case PIX_FMT_RGB565 : c->hcscale_internal = RENAME(rgb16ToUV); break; - case PIX_FMT_RGB555 : c->hcscale_internal = RENAME(rgb15ToUV); break; + case PIX_FMT_RGB565 : c->hcscale_internal = rgb16ToUV; break; + case PIX_FMT_RGB555 : c->hcscale_internal = rgb15ToUV; break; } } @@ -3201,29 +3087,29 @@ static void RENAME(sws_init_swScale)(SwsContext *c) case PIX_FMT_YUV444PLE: case PIX_FMT_GRAY16LE : c->hyscale_internal = RENAME(uyvyToY); break; case PIX_FMT_BGR24 : c->hyscale_internal = RENAME(bgr24ToY); break; - case PIX_FMT_BGR565 : c->hyscale_internal = RENAME(bgr16ToY); break; - case PIX_FMT_BGR555 : c->hyscale_internal = RENAME(bgr15ToY); break; + case PIX_FMT_BGR565 : c->hyscale_internal = bgr16ToY; break; + case PIX_FMT_BGR555 : c->hyscale_internal = bgr15ToY; break; case PIX_FMT_RGB24 : c->hyscale_internal = RENAME(rgb24ToY); break; - case PIX_FMT_RGB565 : c->hyscale_internal = RENAME(rgb16ToY); break; - case PIX_FMT_RGB555 : c->hyscale_internal = RENAME(rgb15ToY); break; + case PIX_FMT_RGB565 : c->hyscale_internal = rgb16ToY; break; + case PIX_FMT_RGB555 : c->hyscale_internal = rgb15ToY; break; case PIX_FMT_RGB8 : case PIX_FMT_BGR8 : case PIX_FMT_PAL8 : case PIX_FMT_BGR4_BYTE: - case PIX_FMT_RGB4_BYTE: c->hyscale_internal = RENAME(palToY); break; - case PIX_FMT_MONOBLACK: c->hyscale_internal = RENAME(monoblack2Y); break; - case PIX_FMT_MONOWHITE: c->hyscale_internal = RENAME(monowhite2Y); break; + case PIX_FMT_RGB4_BYTE: c->hyscale_internal = palToY; break; + case PIX_FMT_MONOBLACK: c->hyscale_internal = monoblack2Y; break; + case PIX_FMT_MONOWHITE: c->hyscale_internal = monowhite2Y; break; case PIX_FMT_RGB32 : - case PIX_FMT_RGB32_1: c->hyscale_internal = RENAME(bgr32ToY); break; + case PIX_FMT_RGB32_1: c->hyscale_internal = bgr32ToY; break; case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hyscale_internal = RENAME(rgb32ToY); break; + case PIX_FMT_BGR32_1: c->hyscale_internal = rgb32ToY; break; } if (c->alpPixBuf) { switch (srcFormat) { case PIX_FMT_RGB32 : case PIX_FMT_RGB32_1: case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hascale_internal = RENAME(abgrToA); break; + case PIX_FMT_BGR32_1: c->hascale_internal = abgrToA; break; } } } -- cgit v1.2.3 From 071cdc07aa1c6bc309be70eb4d8f681ab00bc0d7 Mon Sep 17 00:00:00 2001 From: kostya Date: Tue, 2 Jun 2009 12:28:49 +0000 Subject: Partial (low bits ignored, no direct transcoding into other RGB formats) support for inputting RGB48BE/LE. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29341 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 44 +++++++++++++++++++++++++++++++++++++++++++ libswscale/swscale_internal.h | 4 +++- libswscale/swscale_template.c | 14 ++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index b9adc83e55..921eb2db3a 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -108,6 +108,8 @@ unsigned swscale_version(void) || (x)==PIX_FMT_YUVA420P \ || (x)==PIX_FMT_YUYV422 \ || (x)==PIX_FMT_UYVY422 \ + || (x)==PIX_FMT_RGB48BE \ + || (x)==PIX_FMT_RGB48LE \ || (x)==PIX_FMT_RGB32 \ || (x)==PIX_FMT_RGB32_1 \ || (x)==PIX_FMT_BGR24 \ @@ -1122,6 +1124,48 @@ static void fillPlane(uint8_t* plane, int stride, int width, int height, int y, } } +static inline void rgb48ToY(uint8_t *dst, const uint8_t *src, int width) +{ + int i; + for (i = 0; i < width; i++) { + int r = src[i*6+0]; + int g = src[i*6+2]; + int b = src[i*6+4]; + + dst[i] = (RY*r + GY*g + BY*b + (33<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + } +} + +static inline void rgb48ToUV(uint8_t *dstU, uint8_t *dstV, + uint8_t *src1, uint8_t *src2, int width) +{ + int i; + assert(src1==src2); + for (i = 0; i < width; i++) { + int r = src1[6*i + 0]; + int g = src1[6*i + 2]; + int b = src1[6*i + 4]; + + dstU[i] = (RU*r + GU*g + BU*b + (257<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + dstV[i] = (RV*r + GV*g + BV*b + (257<<(RGB2YUV_SHIFT-1))) >> RGB2YUV_SHIFT; + } +} + +static inline void rgb48ToUV_half(uint8_t *dstU, uint8_t *dstV, + uint8_t *src1, uint8_t *src2, int width) +{ + int i; + assert(src1==src2); + for (i = 0; i < width; i++) { + int r= src1[12*i + 0] + src1[12*i + 6]; + int g= src1[12*i + 2] + src1[12*i + 8]; + int b= src1[12*i + 4] + src1[12*i + 10]; + + dstU[i]= (RU*r + GU*g + BU*b + (257<> (RGB2YUV_SHIFT+1); + dstV[i]= (RV*r + GV*g + BV*b + (257<> (RGB2YUV_SHIFT+1); + } +} + #define BGR2Y(type, name, shr, shg, shb, maskr, maskg, maskb, RY, GY, BY, S)\ static inline void name(uint8_t *dst, const uint8_t *src, long width, uint32_t *unused)\ {\ diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 18a79cac54..8f47fc00c7 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -344,7 +344,9 @@ const char *sws_format_name(int format); || (x)==PIX_FMT_GRAY16LE \ ) #define isRGB(x) ( \ - (x)==PIX_FMT_RGB32 \ + (x)==PIX_FMT_RGB48BE \ + || (x)==PIX_FMT_RGB48LE \ + || (x)==PIX_FMT_RGB32 \ || (x)==PIX_FMT_RGB32_1 \ || (x)==PIX_FMT_RGB24 \ || (x)==PIX_FMT_RGB565 \ diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 1bb0e1dbb6..05d10590b0 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2235,6 +2235,9 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, src += ALT32_CORR; } + if (srcFormat == PIX_FMT_RGB48LE) + src++; + if (internal_func) { internal_func(formatConvBuffer, src, srcW, pal); src= formatConvBuffer; @@ -2424,6 +2427,11 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, src2 += ALT32_CORR; } + if (srcFormat==PIX_FMT_RGB48LE) { + src1++; + src2++; + } + if (c->hcscale_internal) { c->hcscale_internal(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal); src1= formatConvBuffer; @@ -3047,6 +3055,8 @@ static void RENAME(sws_init_swScale)(SwsContext *c) } if (c->chrSrcHSubSample) { switch(srcFormat) { + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: c->hcscale_internal = rgb48ToUV_half; break; case PIX_FMT_RGB32 : case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV_half; break; case PIX_FMT_BGR24 : c->hcscale_internal = RENAME(bgr24ToUV_half); break; @@ -3060,6 +3070,8 @@ static void RENAME(sws_init_swScale)(SwsContext *c) } } else { switch(srcFormat) { + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: c->hcscale_internal = rgb48ToUV; break; case PIX_FMT_RGB32 : case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV; break; case PIX_FMT_BGR24 : c->hcscale_internal = RENAME(bgr24ToUV); break; @@ -3103,6 +3115,8 @@ static void RENAME(sws_init_swScale)(SwsContext *c) case PIX_FMT_RGB32_1: c->hyscale_internal = bgr32ToY; break; case PIX_FMT_BGR32 : case PIX_FMT_BGR32_1: c->hyscale_internal = rgb32ToY; break; + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: c->hyscale_internal = rgb48ToY; break; } if (c->alpPixBuf) { switch (srcFormat) { -- cgit v1.2.3 From 615d3ead235409f6824606c1a7523738c328e2c4 Mon Sep 17 00:00:00 2001 From: kostya Date: Tue, 2 Jun 2009 12:30:11 +0000 Subject: YUV into RGB48 BE/LE conversion support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29342 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 18 ++++++++++++++++++ libswscale/yuv2rgb.c | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 921eb2db3a..b87698645e 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -853,6 +853,24 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc #define YSCALE_YUV_2_ANYRGB_C(func, func2, func_g16, func_monoblack)\ switch(c->dstFormat)\ {\ + case PIX_FMT_RGB48BE:\ + case PIX_FMT_RGB48LE:\ + func(uint8_t,0)\ + ((uint8_t*)dest)[ 0]= r[Y1];\ + ((uint8_t*)dest)[ 1]= r[Y1];\ + ((uint8_t*)dest)[ 2]= g[Y1];\ + ((uint8_t*)dest)[ 3]= g[Y1];\ + ((uint8_t*)dest)[ 4]= b[Y1];\ + ((uint8_t*)dest)[ 5]= b[Y1];\ + ((uint8_t*)dest)[ 6]= r[Y2];\ + ((uint8_t*)dest)[ 7]= r[Y2];\ + ((uint8_t*)dest)[ 8]= g[Y2];\ + ((uint8_t*)dest)[ 9]= g[Y2];\ + ((uint8_t*)dest)[10]= b[Y2];\ + ((uint8_t*)dest)[11]= b[Y2];\ + dest+=12;\ + }\ + break;\ case PIX_FMT_RGBA:\ case PIX_FMT_BGRA:\ if (CONFIG_SMALL){\ diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index d2389c71dd..753bd486fc 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -80,6 +80,16 @@ const int32_t ff_yuv2rgb_coeffs[8][4] = { Y = ysrc[2*i+1-o]; \ dst[2*i+1] = r[Y] + g[Y] + b[Y] + (asrc[2*i+1]<dstFormat) { + case PIX_FMT_RGB48BE: + case PIX_FMT_RGB48LE: return yuv2rgb_c_48; case PIX_FMT_ARGB: case PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P) return yuva2argb_c; case PIX_FMT_RGBA: @@ -664,6 +702,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fill_gv_table(c->table_gV, 2, cgv); break; case 24: + case 48: c->yuvTable = av_malloc(1024); y_table = c->yuvTable; yb = -(384<<16) - oy; -- cgit v1.2.3 From 570d0b83bd4fc93d262fc9483c2deac90c945639 Mon Sep 17 00:00:00 2001 From: kostya Date: Tue, 2 Jun 2009 15:35:58 +0000 Subject: Testing RGB48 variants requires bigger stride in swscale-example.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29343 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale-example.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 8d60332897..7db1ce4148 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -66,11 +66,15 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcFormat // avoid stride % bpp != 0 if (srcFormat==PIX_FMT_RGB24 || srcFormat==PIX_FMT_BGR24) srcStride[i]= srcW*3; + else if (srcFormat==PIX_FMT_RGB48BE || srcFormat==PIX_FMT_RGB48LE) + srcStride[i]= srcW*6; else srcStride[i]= srcW*4; if (dstFormat==PIX_FMT_RGB24 || dstFormat==PIX_FMT_BGR24) dstStride[i]= dstW*3; + else if (dstFormat==PIX_FMT_RGB48BE || dstFormat==PIX_FMT_RGB48LE) + dstStride[i]= dstW*6; else dstStride[i]= dstW*4; -- cgit v1.2.3 From b12a88e01dceef96e934c799911c2536f043b144 Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 4 Jun 2009 21:55:52 +0000 Subject: Use DECLARE_ALIGNED macro instead of gcc __attribute__. Patch by Pavel Pavlov git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29348 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 20 +++++++-------- libswscale/swscale_internal.h | 58 +++++++++++++++++++++---------------------- 2 files changed, 39 insertions(+), 39 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index b87698645e..91f788d394 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -283,17 +283,17 @@ static unsigned char clip_table[768]; static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b); -static const uint8_t __attribute__((aligned(8))) dither_2x2_4[2][8]={ +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, }, }; -static const uint8_t __attribute__((aligned(8))) dither_2x2_8[2][8]={ +DECLARE_ALIGNED(8, static const uint8_t, dither_2x2_8[2][8])={ { 6, 2, 6, 2, 6, 2, 6, 2, }, { 0, 4, 0, 4, 0, 4, 0, 4, }, }; -const uint8_t __attribute__((aligned(8))) dither_8x8_32[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_32[8][8])={ { 17, 9, 23, 15, 16, 8, 22, 14, }, { 5, 29, 3, 27, 4, 28, 2, 26, }, { 21, 13, 19, 11, 20, 12, 18, 10, }, @@ -305,7 +305,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_32[8][8]={ }; #if 0 -const uint8_t __attribute__((aligned(8))) dither_8x8_64[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_64[8][8])={ { 0, 48, 12, 60, 3, 51, 15, 63, }, { 32, 16, 44, 28, 35, 19, 47, 31, }, { 8, 56, 4, 52, 11, 59, 7, 55, }, @@ -317,7 +317,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_64[8][8]={ }; #endif -const uint8_t __attribute__((aligned(8))) dither_8x8_73[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_73[8][8])={ { 0, 55, 14, 68, 3, 58, 17, 72, }, { 37, 18, 50, 32, 40, 22, 54, 35, }, { 9, 64, 5, 59, 13, 67, 8, 63, }, @@ -329,7 +329,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_73[8][8]={ }; #if 0 -const uint8_t __attribute__((aligned(8))) dither_8x8_128[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_128[8][8])={ { 68, 36, 92, 60, 66, 34, 90, 58, }, { 20, 116, 12, 108, 18, 114, 10, 106, }, { 84, 52, 76, 44, 82, 50, 74, 42, }, @@ -342,7 +342,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_128[8][8]={ #endif #if 1 -const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220[8][8])={ {117, 62, 158, 103, 113, 58, 155, 100, }, { 34, 199, 21, 186, 31, 196, 17, 182, }, {144, 89, 131, 76, 141, 86, 127, 72, }, @@ -354,7 +354,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ }; #elif 1 // tries to correct a gamma of 1.5 -const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220[8][8])={ { 0, 143, 18, 200, 2, 156, 25, 215, }, { 78, 28, 125, 64, 89, 36, 138, 74, }, { 10, 180, 3, 161, 16, 195, 8, 175, }, @@ -366,7 +366,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ }; #elif 1 // tries to correct a gamma of 2.0 -const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220[8][8])={ { 0, 124, 8, 193, 0, 140, 12, 213, }, { 55, 14, 104, 42, 66, 19, 119, 52, }, { 3, 168, 1, 145, 6, 187, 3, 162, }, @@ -378,7 +378,7 @@ const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ }; #else // tries to correct a gamma of 2.5 -const uint8_t __attribute__((aligned(8))) dither_8x8_220[8][8]={ +DECLARE_ALIGNED(8, const uint8_t, dither_8x8_220[8][8])={ { 0, 107, 3, 187, 0, 125, 6, 212, }, { 39, 7, 86, 28, 49, 11, 102, 36, }, { 1, 158, 0, 131, 3, 180, 1, 151, }, diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 8f47fc00c7..83d47a2fe0 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -166,26 +166,26 @@ typedef struct SwsContext{ #define Y_TEMP "11*8+4*4*256*2+40" #define ALP_MMX_FILTER_OFFSET "11*8+4*4*256*2+48" - uint64_t redDither __attribute__((aligned(8))); - uint64_t greenDither __attribute__((aligned(8))); - uint64_t blueDither __attribute__((aligned(8))); - - uint64_t yCoeff __attribute__((aligned(8))); - uint64_t vrCoeff __attribute__((aligned(8))); - uint64_t ubCoeff __attribute__((aligned(8))); - uint64_t vgCoeff __attribute__((aligned(8))); - uint64_t ugCoeff __attribute__((aligned(8))); - uint64_t yOffset __attribute__((aligned(8))); - uint64_t uOffset __attribute__((aligned(8))); - uint64_t vOffset __attribute__((aligned(8))); + DECLARE_ALIGNED(8, uint64_t, redDither); + DECLARE_ALIGNED(8, uint64_t, greenDither); + DECLARE_ALIGNED(8, uint64_t, blueDither); + + DECLARE_ALIGNED(8, uint64_t, yCoeff); + DECLARE_ALIGNED(8, uint64_t, vrCoeff); + DECLARE_ALIGNED(8, uint64_t, ubCoeff); + DECLARE_ALIGNED(8, uint64_t, vgCoeff); + DECLARE_ALIGNED(8, uint64_t, ugCoeff); + DECLARE_ALIGNED(8, uint64_t, yOffset); + DECLARE_ALIGNED(8, uint64_t, uOffset); + DECLARE_ALIGNED(8, uint64_t, vOffset); int32_t lumMmxFilter[4*MAX_FILTER_SIZE]; int32_t chrMmxFilter[4*MAX_FILTER_SIZE]; int dstW; - uint64_t esp __attribute__((aligned(8))); - uint64_t vRounder __attribute__((aligned(8))); - uint64_t u_temp __attribute__((aligned(8))); - uint64_t v_temp __attribute__((aligned(8))); - uint64_t y_temp __attribute__((aligned(8))); + DECLARE_ALIGNED(8, uint64_t, esp); + DECLARE_ALIGNED(8, uint64_t, vRounder); + DECLARE_ALIGNED(8, uint64_t, u_temp); + DECLARE_ALIGNED(8, uint64_t, v_temp); + DECLARE_ALIGNED(8, uint64_t, y_temp); int32_t alpMmxFilter[4*MAX_FILTER_SIZE]; #if HAVE_ALTIVEC @@ -200,21 +200,21 @@ typedef struct SwsContext{ #endif #if ARCH_BFIN - uint32_t oy __attribute__((aligned(4))); - uint32_t oc __attribute__((aligned(4))); - uint32_t zero __attribute__((aligned(4))); - uint32_t cy __attribute__((aligned(4))); - uint32_t crv __attribute__((aligned(4))); - uint32_t rmask __attribute__((aligned(4))); - uint32_t cbu __attribute__((aligned(4))); - uint32_t bmask __attribute__((aligned(4))); - uint32_t cgu __attribute__((aligned(4))); - uint32_t cgv __attribute__((aligned(4))); - uint32_t gmask __attribute__((aligned(4))); + DECLARE_ALIGNED(4, uint32_t, oy); + DECLARE_ALIGNED(4, uint32_t, oc); + DECLARE_ALIGNED(4, uint32_t, zero); + DECLARE_ALIGNED(4, uint32_t, cy); + DECLARE_ALIGNED(4, uint32_t, crv); + DECLARE_ALIGNED(4, uint32_t, rmask); + DECLARE_ALIGNED(4, uint32_t, cbu); + DECLARE_ALIGNED(4, uint32_t, bmask); + DECLARE_ALIGNED(4, uint32_t, cgu); + DECLARE_ALIGNED(4, uint32_t, cgv); + DECLARE_ALIGNED(4, uint32_t, gmask); #endif #if HAVE_VIS - uint64_t sparc_coeffs[10] __attribute__((aligned(8))); + DECLARE_ALIGNED(8, uint64_t, sparc_coeffs[10]); #endif /* function pointers for swScale() */ -- cgit v1.2.3 From 0318aa32cf84938038af1ca8e31030d09194075b Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 4 Jun 2009 22:10:52 +0000 Subject: Replace more uses of __attribute__((aligned)) by DECLARE_ALIGNED. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29349 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 05d10590b0..bb6a840a59 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2258,7 +2258,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, #if HAVE_MMX2 int i; #if defined(PIC) - uint64_t ebxsave __attribute__((aligned(8))); + DECLARE_ALIGNED(8, uint64_t, ebxsave); #endif if (canMMX2BeUsed) { @@ -2454,7 +2454,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, #if HAVE_MMX2 int i; #if defined(PIC) - uint64_t ebxsave __attribute__((aligned(8))); + DECLARE_ALIGNED(8, uint64_t, ebxsave); #endif if (canMMX2BeUsed) { -- cgit v1.2.3 From 594de0a0dd709ce7e04209474734954592530572 Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 4 Jun 2009 22:50:38 +0000 Subject: Use DECLARE_ALIGNED macro instead of __attribute__((aligned)) for ppc code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29350 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/ppc/swscale_altivec_template.c | 8 ++++---- libswscale/ppc/yuv2rgb_altivec.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libswscale') diff --git a/libswscale/ppc/swscale_altivec_template.c b/libswscale/ppc/swscale_altivec_template.c index c24970464c..8919177bcc 100644 --- a/libswscale/ppc/swscale_altivec_template.c +++ b/libswscale/ppc/swscale_altivec_template.c @@ -92,7 +92,7 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, int16_t **lumSrc, int lumFilterS const vector signed int vini = {(1 << 18), (1 << 18), (1 << 18), (1 << 18)}; register int i, j; { - int __attribute__ ((aligned (16))) val[dstW]; + DECLARE_ALIGNED(16, int, val[dstW]); for (i = 0; i < (dstW -7); i+=4) { vec_st(vini, i << 2, val); @@ -140,8 +140,8 @@ yuv2yuvX_altivec_real(const int16_t *lumFilter, int16_t **lumSrc, int lumFilterS altivec_packIntArrayToCharArray(val, dest, dstW); } if (uDest != 0) { - int __attribute__ ((aligned (16))) u[chrDstW]; - int __attribute__ ((aligned (16))) v[chrDstW]; + DECLARE_ALIGNED(16, int, u[chrDstW]); + DECLARE_ALIGNED(16, int, v[chrDstW]); for (i = 0; i < (chrDstW -7); i+=4) { vec_st(vini, i << 2, u); @@ -214,7 +214,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, const int16_t *filterPos, int filterSize) { register int i; - int __attribute__ ((aligned (16))) tempo[4]; + DECLARE_ALIGNED(16, int, tempo[4]); if (filterSize % 4) { for (i=0; i Date: Sat, 6 Jun 2009 09:37:46 +0000 Subject: Remove '\p' doxygen markup, as it should improve plain text doxy readability. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29351 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale.h b/libswscale/swscale.h index f5856c381c..a151095858 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -133,8 +133,8 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat SwsFilter *dstFilter, const double *param); /** - * Scales the image slice in \p srcSlice and puts the resulting scaled - * slice in the image in \p dst. A slice is a sequence of consecutive + * Scales the image slice in srcSlice and puts the resulting scaled + * slice in the image in dst. A slice is a sequence of consecutive * rows in an image. * * @param context the scaling context previously created with @@ -188,8 +188,8 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, SwsVector *sws_getGaussianVec(double variance, double quality); /** - * Allocates and returns a vector with \p length coefficients, all - * with the same value \p c. + * Allocates and returns a vector with length coefficients, all + * with the same value c. */ SwsVector *sws_getConstVec(double c, int length); @@ -200,13 +200,12 @@ SwsVector *sws_getConstVec(double c, int length); SwsVector *sws_getIdentityVec(void); /** - * Scales all the coefficients of \p a by the \p scalar value. + * Scales all the coefficients of a by the scalar value. */ void sws_scaleVec(SwsVector *a, double scalar); /** - * Scales all the coefficients of \p a so that their sum equals \p - * height." + * Scales all the coefficients of a so that their sum equals height. */ void sws_normalizeVec(SwsVector *a, double height); void sws_convVec(SwsVector *a, SwsVector *b); @@ -215,8 +214,8 @@ void sws_subVec(SwsVector *a, SwsVector *b); void sws_shiftVec(SwsVector *a, int shift); /** - * Allocates and returns a clone of the vector \p a, that is a vector - * with the same coefficients as \p a. + * Allocates and returns a clone of the vector a, that is a vector + * with the same coefficients as a. */ SwsVector *sws_cloneVec(SwsVector *a); @@ -228,8 +227,8 @@ attribute_deprecated void sws_printVec(SwsVector *a); #endif /** - * Prints with av_log() a textual representation of the vector \p a - * if \p log_level <= av_log_level. + * Prints with av_log() a textual representation of the vector a + * if log_level <= av_log_level. */ void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); @@ -242,16 +241,16 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, void sws_freeFilter(SwsFilter *filter); /** - * Checks if \p context can be reused, otherwise reallocates a new + * Checks if context can be reused, otherwise reallocates a new * one. * - * If \p context is NULL, just calls sws_getContext() to get a new + * If context is NULL, just calls sws_getContext() to get a new * context. Otherwise, checks if the parameters are the ones already - * saved in \p context. If that is the case, returns the current - * context. Otherwise, frees \p context and gets a new context with + * saved in context. If that is the case, returns the current + * context. Otherwise, frees context and gets a new context with * the new parameters. * - * Be warned that \p srcFilter and \p dstFilter are not checked, they + * Be warned that srcFilter and dstFilter are not checked, they * are assumed to remain the same. */ struct SwsContext *sws_getCachedContext(struct SwsContext *context, -- cgit v1.2.3 From 0fa66fd7387549078a0b4d7c0c9c6ac216c8f1f8 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 11 Jun 2009 10:19:04 +0000 Subject: Add libavutil/internal.h #include, required for the DECLARE_ALIGNED macro. This fixes swscale-example compilation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29353 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libswscale') diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 83d47a2fe0..23ceec78bf 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -28,6 +28,7 @@ #endif #include "libavutil/avutil.h" +#include "libavutil/internal.h" #define STR(s) AV_TOSTRING(s) //AV_STRINGIFY is too long -- cgit v1.2.3 From 39710677648260370c32637779da79544cf3ea8b Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 11 Jun 2009 15:15:43 +0000 Subject: Fix compilation: #undef standard library functions that are forbidden within FFmpeg, but allowed in example code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29354 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale-example.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 7db1ce4148..c9916e5489 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -30,6 +30,12 @@ #include "swscale.h" #include "swscale_internal.h" +#undef fprintf +#undef free +#undef malloc +#undef perror +#undef printf + static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, int w, int h){ int x,y; uint64_t ssd=0; -- cgit v1.2.3 From 79cbf2cc3980e195a25091b165bf1ad1674871ab Mon Sep 17 00:00:00 2001 From: ramiro Date: Thu, 11 Jun 2009 17:10:54 +0000 Subject: Kill warnings of possibly unused variables by using av_unused. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29355 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index bb6a840a59..279cab034b 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2221,10 +2221,10 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, int srcFormat, uint8_t *formatConvBuffer, uint32_t *pal, int isAlpha) { - int32_t *mmx2FilterPos = c->lumMmx2FilterPos; - int16_t *mmx2Filter = c->lumMmx2Filter; - int canMMX2BeUsed = c->canMMX2BeUsed; - void *funnyYCode = c->funnyYCode; + int32_t av_unused *mmx2FilterPos = c->lumMmx2FilterPos; + int16_t av_unused *mmx2Filter = c->lumMmx2Filter; + int av_unused canMMX2BeUsed = c->canMMX2BeUsed; + void av_unused *funnyYCode = c->funnyYCode; void (*internal_func)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->hascale_internal : c->hyscale_internal; if (isAlpha) { @@ -2414,10 +2414,10 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, int srcFormat, uint8_t *formatConvBuffer, uint32_t *pal) { - int32_t *mmx2FilterPos = c->chrMmx2FilterPos; - int16_t *mmx2Filter = c->chrMmx2Filter; - int canMMX2BeUsed = c->canMMX2BeUsed; - void *funnyUVCode = c->funnyUVCode; + int32_t av_unused *mmx2FilterPos = c->chrMmx2FilterPos; + int16_t av_unused *mmx2Filter = c->chrMmx2Filter; + int av_unused canMMX2BeUsed = c->canMMX2BeUsed; + void av_unused *funnyUVCode = c->funnyUVCode; if (isGray(srcFormat) || srcFormat==PIX_FMT_MONOBLACK || srcFormat==PIX_FMT_MONOWHITE) return; -- cgit v1.2.3 From 990a1eb471f049f04eee31c72925c80e5a28d845 Mon Sep 17 00:00:00 2001 From: vitor Date: Wed, 17 Jun 2009 18:40:19 +0000 Subject: Do not call rgb2rgbWrapper() for rgb48*, there is no special converter yet for those formats git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29371 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 91f788d394..5030a6b623 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2732,6 +2732,8 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d && srcFormat != PIX_FMT_MONOWHITE && dstFormat != PIX_FMT_MONOWHITE && dstFormat != PIX_FMT_RGB32_1 && dstFormat != PIX_FMT_BGR32_1 + && srcFormat != PIX_FMT_RGB48LE && dstFormat != PIX_FMT_RGB48LE + && srcFormat != PIX_FMT_RGB48BE && dstFormat != PIX_FMT_RGB48BE && (!needsDither || (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)))) c->swScale= rgb2rgbWrapper; -- cgit v1.2.3 From 052fee1295d788eafd7b9a49ae7cf3c989668a18 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 25 Jun 2009 10:14:05 +0000 Subject: PPC: Make sure that COMPILE_C is not deactivated if RUNTIME_CPUDETECT is set. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29388 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 5030a6b623..33f47795ef 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1301,13 +1301,12 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin //Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one //Plain C versions -#if !HAVE_MMX || CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL +#if (!HAVE_MMX && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL #define COMPILE_C #endif #if ARCH_PPC #if (HAVE_ALTIVEC || CONFIG_RUNTIME_CPUDETECT) && CONFIG_GPL -#undef COMPILE_C #define COMPILE_ALTIVEC #endif #endif //ARCH_PPC -- cgit v1.2.3 From e4ac99c4dbf09216bc5b908c3fd724226f48f6c3 Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 25 Jun 2009 11:27:36 +0000 Subject: The AltiVec optimizations of libswscale are no longer under GPL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29389 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 33f47795ef..29fef32ffb 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1306,7 +1306,7 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin #endif #if ARCH_PPC -#if (HAVE_ALTIVEC || CONFIG_RUNTIME_CPUDETECT) && CONFIG_GPL +#if HAVE_ALTIVEC || CONFIG_RUNTIME_CPUDETECT #define COMPILE_ALTIVEC #endif #endif //ARCH_PPC -- cgit v1.2.3 From 114b73816fa0a3b5cdb7a156ebd92f91063e0c6d Mon Sep 17 00:00:00 2001 From: diego Date: Thu, 25 Jun 2009 20:06:03 +0000 Subject: AltiVec code and runtime cpudetect do not require CONFIG_GPL. Make sure the latter is only checked for x86 optimizations, which are GPL. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29390 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libswscale') diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 29fef32ffb..31cf36ae05 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1301,7 +1301,7 @@ static inline void monoblack2Y(uint8_t *dst, const uint8_t *src, long width, uin //Note: we have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one //Plain C versions -#if (!HAVE_MMX && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL +#if ((!HAVE_MMX || !CONFIG_GPL) && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT #define COMPILE_C #endif @@ -1972,10 +1972,10 @@ static void globalInit(void){ static SwsFunc getSwsFunc(SwsContext *c) { -#if CONFIG_RUNTIME_CPUDETECT && CONFIG_GPL +#if CONFIG_RUNTIME_CPUDETECT int flags = c->flags; -#if ARCH_X86 +#if ARCH_X86 && CONFIG_GPL // ordered per speed fastest first if (flags & SWS_CPU_CAPS_MMX2) { sws_init_swScale_MMX2(c); @@ -2003,7 +2003,7 @@ static SwsFunc getSwsFunc(SwsContext *c) #endif sws_init_swScale_C(c); return swScale_C; -#endif /* ARCH_X86 */ +#endif /* ARCH_X86 && CONFIG_GPL */ #else //CONFIG_RUNTIME_CPUDETECT #if HAVE_MMX2 sws_init_swScale_MMX2(c); @@ -2565,7 +2565,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d __asm__ volatile("emms\n\t"::: "memory"); #endif -#if !CONFIG_RUNTIME_CPUDETECT || !CONFIG_GPL //ensure that the flags match the compiled variant if cpudetect is off +#if !CONFIG_RUNTIME_CPUDETECT //ensure that the flags match the compiled variant if cpudetect is off flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN); #if HAVE_MMX2 flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2; -- cgit v1.2.3 From ea03c9b95aa8ef394b3d59d34c2a0bb543561a35 Mon Sep 17 00:00:00 2001 From: mru Date: Wed, 1 Jul 2009 12:40:28 +0000 Subject: Use enum PixelFormat in sws_format_name() prototype git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29409 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libswscale') diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 23ceec78bf..60a08a7849 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -294,7 +294,7 @@ void ff_yuv2packedX_altivec(SwsContext *c, const int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize, uint8_t *dest, int dstW, int dstY); -const char *sws_format_name(int format); +const char *sws_format_name(enum PixelFormat format); //FIXME replace this with something faster #define is16BPS(x) ( \ -- cgit v1.2.3 From cd6a9ea77a9535542ec4e979ba239b176ba7d258 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 5 Jul 2009 20:10:59 +0000 Subject: The AltiVec code in libswscale no longer is under GPL. Remove one erroneous preprocessor check for CONFIG_GPL in the AltiVec code. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29412 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/yuv2rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libswscale') diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 753bd486fc..96649296ff 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -511,7 +511,7 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) #if CONFIG_MLIB t = ff_yuv2rgb_init_mlib(c); #endif -#if HAVE_ALTIVEC && CONFIG_GPL +#if HAVE_ALTIVEC if (c->flags & SWS_CPU_CAPS_ALTIVEC) t = ff_yuv2rgb_init_altivec(c); #endif -- cgit v1.2.3