From f65ce5d163ea45a4c4734e060968b3b4f5f1f66a Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 16 Jan 2010 16:39:46 +0000 Subject: [PATCH 01/51] Manually add --nxcompat --no-seh --dynamicbase to linker flags if available, works around binutils' policy of making exploits as easy as possible by default. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30325 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure b/configure index 0f64bc62ac..97d4f9be63 100755 --- a/configure +++ b/configure @@ -8189,6 +8189,14 @@ else echores "no" fi +echocheck "linker support for --nxcompat --no-seh --dynamicbase" +if cc_check "-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase" ; then + extra_ldflags="-Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase $extra_ldflags" + echores "yes" +else + echores "no" +fi + # Dynamic linking flags # (FIXME: 'echocheck "dynamic linking"' above and modify here accordingly) From 5d8bd54019d182aafcaa69d6cd519af31bacbc20 Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 18:36:21 +0000 Subject: [PATCH 02/51] Factorize code which logs the source and destination formats in sws_getContext(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30326 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 71786b817a..9f1b9fd24c 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2839,12 +2839,10 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d else av_log(c, AV_LOG_INFO, "ehh flags invalid?! "); - if (dstFormat==PIX_FMT_BGR555 || dstFormat==PIX_FMT_BGR565) - av_log(c, AV_LOG_INFO, "from %s to%s %s ", - sws_format_name(srcFormat), dither, sws_format_name(dstFormat)); - else - av_log(c, AV_LOG_INFO, "from %s to %s ", - sws_format_name(srcFormat), sws_format_name(dstFormat)); + av_log(c, AV_LOG_INFO, "from %s to%s %s ", + sws_format_name(srcFormat), + dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? dither : "", + sws_format_name(dstFormat)); if (flags & SWS_CPU_CAPS_MMX2) av_log(c, AV_LOG_INFO, "using MMX2\n"); From 14fe9544f9949cfe41f1dfd92671c32c9de650ea Mon Sep 17 00:00:00 2001 From: ramiro Date: Sat, 16 Jan 2010 18:39:06 +0000 Subject: [PATCH 03/51] Reuse h{lum,chr}Filter{,Pos} variables for MMX2 fast_bilinear horizontal scaler. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30327 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 16 ++++++---------- libswscale/swscale_internal.h | 4 ---- libswscale/swscale_template.c | 12 ++++++------ 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 9f1b9fd24c..612b250c72 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2690,13 +2690,13 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d c->chrMmx2FilterCode = av_malloc(c->chrMmx2FilterCodeSize); #endif - FF_ALLOCZ_OR_GOTO(c, c->lumMmx2Filter , (dstW /8+8)*sizeof(int16_t), fail); - FF_ALLOCZ_OR_GOTO(c, c->chrMmx2Filter , (c->chrDstW /4+8)*sizeof(int16_t), fail); - FF_ALLOCZ_OR_GOTO(c, c->lumMmx2FilterPos, (dstW /2/8+8)*sizeof(int32_t), fail); - FF_ALLOCZ_OR_GOTO(c, c->chrMmx2FilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hLumFilter , (dstW /8+8)*sizeof(int16_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hChrFilter , (c->chrDstW /4+8)*sizeof(int16_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hLumFilterPos, (dstW /2/8+8)*sizeof(int32_t), fail); + FF_ALLOCZ_OR_GOTO(c, c->hChrFilterPos, (c->chrDstW/2/4+8)*sizeof(int32_t), fail); - initMMX2HScaler( dstW, c->lumXInc, c->lumMmx2FilterCode, c->lumMmx2Filter, c->lumMmx2FilterPos, 8); - initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->chrMmx2Filter, c->chrMmx2FilterPos, 4); + initMMX2HScaler( dstW, c->lumXInc, c->lumMmx2FilterCode, c->hLumFilter, c->hLumFilterPos, 8); + initMMX2HScaler(c->chrDstW, c->chrXInc, c->chrMmx2FilterCode, c->hChrFilter, c->hChrFilterPos, 4); #ifdef MAP_ANONYMOUS mprotect(c->lumMmx2FilterCode, c->lumMmx2FilterCodeSize, PROT_EXEC | PROT_READ); @@ -3423,10 +3423,6 @@ void sws_freeContext(SwsContext *c) c->chrMmx2FilterCode=NULL; #endif /* ARCH_X86 && CONFIG_GPL */ - av_freep(&c->lumMmx2Filter); - av_freep(&c->chrMmx2Filter); - av_freep(&c->lumMmx2FilterPos); - av_freep(&c->chrMmx2FilterPos); av_freep(&c->yuvTable); av_free(c); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 3db7a480c8..5efaee7e00 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -114,10 +114,6 @@ typedef struct SwsContext { int chrMmx2FilterCodeSize; uint8_t *lumMmx2FilterCode; uint8_t *chrMmx2FilterCode; - int32_t *lumMmx2FilterPos; - int32_t *chrMmx2FilterPos; - int16_t *lumMmx2Filter; - int16_t *chrMmx2Filter; int canMMX2BeUsed; diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 160596aebc..0aa60357e0 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2260,8 +2260,8 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, { #if ARCH_X86 && CONFIG_GPL #if COMPILE_TEMPLATE_MMX2 - int32_t *mmx2FilterPos = c->lumMmx2FilterPos; - int16_t *mmx2Filter = c->lumMmx2Filter; + int32_t *filterPos = c->hLumFilterPos; + int16_t *filter = c->hLumFilter; int canMMX2BeUsed = c->canMMX2BeUsed; void *mmx2FilterCode= c->lumMmx2FilterCode; int i; @@ -2316,7 +2316,7 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, #if defined(PIC) "mov %5, %%"REG_b" \n\t" #endif - :: "m" (src), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), + :: "m" (src), "m" (dst), "m" (filter), "m" (filterPos), "m" (mmx2FilterCode) #if defined(PIC) ,"m" (ebxsave) @@ -2409,8 +2409,8 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst, { #if ARCH_X86 && CONFIG_GPL #if COMPILE_TEMPLATE_MMX2 - int32_t *mmx2FilterPos = c->chrMmx2FilterPos; - int16_t *mmx2Filter = c->chrMmx2Filter; + int32_t *filterPos = c->hChrFilterPos; + int16_t *filter = c->hChrFilter; int canMMX2BeUsed = c->canMMX2BeUsed; void *mmx2FilterCode= c->chrMmx2FilterCode; int i; @@ -2452,7 +2452,7 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst, #if defined(PIC) "mov %6, %%"REG_b" \n\t" #endif - :: "m" (src1), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), + :: "m" (src1), "m" (dst), "m" (filter), "m" (filterPos), "m" (mmx2FilterCode), "m" (src2) #if defined(PIC) ,"m" (ebxsave) From 3c8de6d0064f53af517618654bc73660058dbe48 Mon Sep 17 00:00:00 2001 From: ramiro Date: Sat, 16 Jan 2010 19:04:55 +0000 Subject: [PATCH 04/51] Document some of SwsContext. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30328 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 5efaee7e00..5aae3b9c1e 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -75,16 +75,22 @@ typedef struct SwsContext { * sws_scale() wrapper so they can be freely modified here. */ SwsFunc swScale; - int srcW, srcH, dstH; - int chrSrcW, chrSrcH, chrDstW, chrDstH; + int srcW; ///< Width of source luma/alpha planes. + int srcH; ///< Height of source luma/alpha planes. + int dstH; ///< Height of destination luma/alpha planes. + int chrSrcW; ///< Width of source chroma planes. + int chrSrcH; ///< Height of source chroma planes. + int chrDstW; ///< Width of destination chroma planes. + int chrDstH; ///< Height of destination chroma planes. int lumXInc, chrXInc; int lumYInc, chrYInc; - enum PixelFormat dstFormat, srcFormat; ///< format 4:2:0 type is always YV12 + enum PixelFormat dstFormat; ///< Destination pixel format. + enum PixelFormat srcFormat; ///< Source pixel format. int chrSrcHSubSample, chrSrcVSubSample; int chrDstHSubSample, chrDstVSubSample; int vChrDrop; int sliceDir; - double param[2]; + double param[2]; ///< Input parameters for scaling algorithms that need them. uint32_t pal_yuv[256]; uint32_t pal_rgb[256]; @@ -110,10 +116,10 @@ typedef struct SwsContext { int vLumBufSize; int vChrBufSize; - int lumMmx2FilterCodeSize; - int chrMmx2FilterCodeSize; - uint8_t *lumMmx2FilterCode; - uint8_t *chrMmx2FilterCode; + int lumMmx2FilterCodeSize; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code size for luma/alpha planes. + int chrMmx2FilterCodeSize; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code size for chroma planes. + uint8_t *lumMmx2FilterCode; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code for luma/alpha planes. + uint8_t *chrMmx2FilterCode; ///< Runtime-generated MMX2 horizontal fast bilinear scaler code for chroma planes. int canMMX2BeUsed; @@ -121,8 +127,8 @@ typedef struct SwsContext { int lastInChrBuf; int lumBufIndex; int chrBufIndex; - int dstY; - int flags; + int dstY; ///< Last destination vertical line output from last slice. + int flags; ///< Flags passed by the user to select scaler algorithm, optimizations, subsampling, etc... void * yuvTable; // pointer to the yuv->rgb table start so it can be freed() uint8_t * table_rV[256]; uint8_t * table_gU[256]; @@ -133,7 +139,8 @@ typedef struct SwsContext { int contrast, brightness, saturation; // for sws_getColorspaceDetails int srcColorspaceTable[4]; int dstColorspaceTable[4]; - int srcRange, dstRange; + int srcRange; ///< 0 = MPG YUV range, 1 = JPG YUV range (source image). + int dstRange; ///< 0 = MPG YUV range, 1 = JPG YUV range (destination image). int yuv2rgb_y_offset; int yuv2rgb_y_coeff; int yuv2rgb_v2r_coeff; From d77dc477c51ebc5a59b417fab14e58b00f3e0de3 Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 19:11:03 +0000 Subject: [PATCH 05/51] Simplify code in sws_getContext() which logs if the destination format support dithering, remove the const char *dither variable and use a literal string instead. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30329 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 612b250c72..dc97389fd0 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2809,11 +2809,6 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d assert(c->chrDstH <= dstH); if (flags&SWS_PRINT_INFO) { -#ifdef DITHER1XBPP - const char *dither= " dithered"; -#else - const char *dither= ""; -#endif if (flags&SWS_FAST_BILINEAR) av_log(c, AV_LOG_INFO, "FAST_BILINEAR scaler, "); else if (flags&SWS_BILINEAR) @@ -2841,7 +2836,11 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d av_log(c, AV_LOG_INFO, "from %s to%s %s ", sws_format_name(srcFormat), - dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? dither : "", +#ifdef DITHER1XBPP + dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? " dithered" : "", +#else + "", +#endif sws_format_name(dstFormat)); if (flags & SWS_CPU_CAPS_MMX2) From 5ffab28a7cb64532b75f4aa93291d96bb0270c0a Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 19:14:29 +0000 Subject: [PATCH 06/51] Prefer "to %s%s" over "to%s %s", slightly more readable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30330 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index dc97389fd0..bb274e6f57 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2834,10 +2834,10 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d else av_log(c, AV_LOG_INFO, "ehh flags invalid?! "); - av_log(c, AV_LOG_INFO, "from %s to%s %s ", + av_log(c, AV_LOG_INFO, "from %s to %s%s ", sws_format_name(srcFormat), #ifdef DITHER1XBPP - dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? " dithered" : "", + dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ? "dithered " : "", #else "", #endif From 5cd08a9945dbd9f38fdec73266db320a8b0ba587 Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 19:19:54 +0000 Subject: [PATCH 07/51] Factorize the code which calls the non optimized C functions in getSwsFunc(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30331 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index bb274e6f57..3f01e003ba 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1863,23 +1863,14 @@ static SwsFunc getSwsFunc(SwsContext *c) } else if (flags & SWS_CPU_CAPS_MMX) { sws_init_swScale_MMX(c); return swScale_MMX; - } else { - sws_init_swScale_C(c); - return swScale_C; } - #else #if ARCH_PPC if (flags & SWS_CPU_CAPS_ALTIVEC) { 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 && CONFIG_GPL */ #else //CONFIG_RUNTIME_CPUDETECT #if COMPILE_TEMPLATE_MMX2 @@ -1894,11 +1885,11 @@ static SwsFunc getSwsFunc(SwsContext *c) #elif COMPILE_TEMPLATE_ALTIVEC sws_init_swScale_altivec(c); return swScale_altivec; -#else - sws_init_swScale_C(c); - return swScale_C; #endif #endif //!CONFIG_RUNTIME_CPUDETECT + + sws_init_swScale_C(c); + return swScale_C; } static int PlanarToNV12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, From ae2e7d7298f205182043d5aaccc02f8583dd6230 Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 19:22:30 +0000 Subject: [PATCH 08/51] =?UTF-8?q?Declare=20with=20av=5Funused=20the=20vari?= =?UTF-8?q?able=20alpMmxFilter,=20fix=20the=20gcc=20warning:=20swscale=5Ft?= =?UTF-8?q?emplate.c:=20In=20function=20=E2=80=98swScale=5FC=E2=80=99:=20s?= =?UTF-8?q?wscale=5Ftemplate.c:2580:=20warning:=20unused=20variable=20?= =?UTF-8?q?=E2=80=98alpMmxFilter=E2=80=99=20swscale=5Ftemplate.c:=20In=20f?= =?UTF-8?q?unction=20=E2=80=98sws=5Finit=5FswScale=5FC=E2=80=99:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30332 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 0aa60357e0..76297d6e59 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2577,7 +2577,7 @@ static int RENAME(swScale)(SwsContext *c, const uint8_t* src[], int srcStride[], int16_t *hChrFilter= c->hChrFilter; int32_t *lumMmxFilter= c->lumMmxFilter; int32_t *chrMmxFilter= c->chrMmxFilter; - int32_t *alpMmxFilter= c->alpMmxFilter; + int32_t av_unused *alpMmxFilter= c->alpMmxFilter; const int vLumFilterSize= c->vLumFilterSize; const int vChrFilterSize= c->vChrFilterSize; const int hLumFilterSize= c->hLumFilterSize; From e1a3ac7fb2af13f4cbe125ac4d4869160704d4bf Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 19:32:58 +0000 Subject: [PATCH 09/51] Prefer enum PixelFormat to int as the parameter type of fmt_depth(fmt). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30333 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 5aae3b9c1e..65174fdd45 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -389,7 +389,7 @@ const char *sws_format_name(enum PixelFormat format); || (x)==PIX_FMT_YUVA420P \ ) -static inline int fmt_depth(int fmt) +static inline int fmt_depth(enum PixelFormat fmt) { switch(fmt) { case PIX_FMT_RGB48BE: From 68544d15da70e99724f6e7df43ab2d74d4750b66 Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 19:51:26 +0000 Subject: [PATCH 10/51] Revert r30331, which broke compilation. swScale_C is not templated if any optimization is to be used and !runtime_cpudetect. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30334 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 3f01e003ba..bb274e6f57 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1863,14 +1863,23 @@ static SwsFunc getSwsFunc(SwsContext *c) } else if (flags & SWS_CPU_CAPS_MMX) { sws_init_swScale_MMX(c); return swScale_MMX; + } else { + sws_init_swScale_C(c); + return swScale_C; } + #else #if ARCH_PPC if (flags & SWS_CPU_CAPS_ALTIVEC) { 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 && CONFIG_GPL */ #else //CONFIG_RUNTIME_CPUDETECT #if COMPILE_TEMPLATE_MMX2 @@ -1885,11 +1894,11 @@ static SwsFunc getSwsFunc(SwsContext *c) #elif COMPILE_TEMPLATE_ALTIVEC sws_init_swScale_altivec(c); return swScale_altivec; -#endif -#endif //!CONFIG_RUNTIME_CPUDETECT - +#else sws_init_swScale_C(c); return swScale_C; +#endif +#endif //!CONFIG_RUNTIME_CPUDETECT } static int PlanarToNV12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, From cbd5caef0e8862dcafd40d80d28f4bca73882f97 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 16 Jan 2010 19:59:31 +0000 Subject: [PATCH 11/51] Add support for adjustable TV <-> PC level conversion. This could also be done by modifying contrast and brightness, but this seems a bit more flexible and easier to use. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30335 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/csputils.c | 11 +++++++++-- libvo/csputils.h | 8 ++++++++ libvo/vo_gl.c | 15 ++++++++++++++- libvo/vo_gl2.c | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/libvo/csputils.c b/libvo/csputils.c index e842592b1f..57362f6725 100644 --- a/libvo/csputils.c +++ b/libvo/csputils.c @@ -60,10 +60,15 @@ void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, float yuv2rgb[3][4]) { float uvcos = params->saturation * cos(params->hue); float uvsin = params->saturation * sin(params->hue); int format = params->format; + int levelconv = params->levelconv; int i; const float (*uv_coeffs)[3]; const float *level_adjust; - static const float yuv_pc_level_adjust[4] = {-16 / 255.0, -128 / 255.0, -128 / 255.0, 1.164}; + static const float yuv_level_adjust[MP_CSP_LEVELCONV_COUNT][4] = { + {-16 / 255.0, -128 / 255.0, -128 / 255.0, 1.164}, + { 16 / 255.0 * 1.164, -128 / 255.0, -128 / 255.0, 1.0/1.164}, + { 0, -128 / 255.0, -128 / 255.0, 1}, + }; static const float xyz_level_adjust[4] = {0, 0, 0, 0}; static const float uv_coeffs_table[MP_CSP_COUNT][3][3] = { [MP_CSP_DEFAULT] = { @@ -101,7 +106,9 @@ void mp_get_yuv2rgb_coeffs(struct mp_csp_params *params, float yuv2rgb[3][4]) { if (format < 0 || format >= MP_CSP_COUNT) format = MP_CSP_DEFAULT; uv_coeffs = uv_coeffs_table[format]; - level_adjust = yuv_pc_level_adjust; + if (levelconv < 0 || levelconv >= MP_CSP_LEVELCONV_COUNT) + levelconv = MP_CSP_LEVELCONV_TV_TO_PC; + level_adjust = yuv_level_adjust[levelconv]; if (format == MP_CSP_XYZ) level_adjust = xyz_level_adjust; diff --git a/libvo/csputils.h b/libvo/csputils.h index 4723c7006d..54c6926b96 100644 --- a/libvo/csputils.h +++ b/libvo/csputils.h @@ -31,8 +31,16 @@ enum mp_csp_standard { MP_CSP_COUNT }; +enum mp_csp_levelconv { + MP_CSP_LEVELCONV_TV_TO_PC, + MP_CSP_LEVELCONV_PC_TO_TV, + MP_CSP_LEVELCONV_NONE, + MP_CSP_LEVELCONV_COUNT +}; + struct mp_csp_params { enum mp_csp_standard format; + enum mp_csp_levelconv levelconv; float brightness; float contrast; float hue; diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index ab24a65494..16bb1b9328 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -94,6 +94,7 @@ static int use_ycbcr; #define MASK_GAMMA_SUPPORT (MASK_NOT_COMBINERS & ~(1 << YUV_CONVERSION_FRAGMENT)) static int use_yuv; static int colorspace; +static int levelconv; static int is_yuv; static int lscale; static int cscale; @@ -217,7 +218,7 @@ static void update_yuvconv(void) { float ggamma = exp(log(8.0) * eq_ggamma / 100.0); float bgamma = exp(log(8.0) * eq_bgamma / 100.0); gl_conversion_params_t params = {gl_target, yuvconvtype, - {colorspace, bri, cont, hue, sat, rgamma, ggamma, bgamma}, + {colorspace, levelconv, bri, cont, hue, sat, rgamma, ggamma, bgamma}, texture_width, texture_height, 0, 0, filter_strength}; mp_get_chroma_shift(image_format, &xs, &ys); params.chrom_texw = params.texw >> xs; @@ -1007,6 +1008,12 @@ static int valid_csp(void *p) return *csp >= -1 && *csp < MP_CSP_COUNT; } +static int valid_csp_lvl(void *p) +{ + int *lvl = p; + return *lvl >= -1 && *lvl < MP_CSP_LEVELCONV_COUNT; +} + static const opt_t subopts[] = { {"manyfmts", OPT_ARG_BOOL, &many_fmts, NULL}, {"osd", OPT_ARG_BOOL, &use_osd, NULL}, @@ -1017,6 +1024,7 @@ static const opt_t subopts[] = { {"rectangle", OPT_ARG_INT, &use_rectangle,int_non_neg}, {"yuv", OPT_ARG_INT, &use_yuv, int_non_neg}, {"colorspace", OPT_ARG_INT, &colorspace, valid_csp}, + {"levelconv", OPT_ARG_INT, &levelconv, valid_csp_lvl}, {"lscale", OPT_ARG_INT, &lscale, int_non_neg}, {"cscale", OPT_ARG_INT, &cscale, int_non_neg}, {"filter-strength", OPT_ARG_FLOAT, &filter_strength, NULL}, @@ -1048,6 +1056,7 @@ static int preinit(const char *arg) use_ycbcr = 0; use_yuv = 0; colorspace = -1; + levelconv = -1; lscale = 0; cscale = 0; filter_strength = 0.5; @@ -1110,6 +1119,10 @@ static int preinit(const char *arg) " 3: YUV to RGB according to SMPT-240M\n" " 4: YUV to RGB according to EBU\n" " 5: XYZ to RGB\n" + " levelconv=\n" + " 0: YUV to RGB converting TV to PC levels\n" + " 1: YUV to RGB converting PC to TV levels\n" + " 2: YUV to RGB without converting levels\n" " lscale=\n" " 0: use standard bilinear scaling for luma.\n" " 1: use improved bicubic scaling for luma.\n" diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index b65acf589c..9d1bd533d1 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -571,7 +571,7 @@ static int initGl(uint32_t d_width, uint32_t d_height) if (is_yuv) { int xs, ys; gl_conversion_params_t params = {GL_TEXTURE_2D, use_yuv, - {MP_CSP_DEFAULT, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0}, + {-1, -1, 0.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0}, texture_width, texture_height, 0, 0, 0}; switch (use_yuv) { case YUV_CONVERSION_FRAGMENT_LOOKUP: From d56815320465a6745eaa3d07bed5a01bd2a0fb30 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 16 Jan 2010 20:03:35 +0000 Subject: [PATCH 12/51] Document levelconv -vo gl suboption. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30336 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 1eace0810e..fcdaf15f7a 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3897,6 +3897,16 @@ Use ITU-R BT.709 color space. .IPs 3 Use SMPTE-240M color space. .RE +.IPs levelconv= +Select the brightness level conversion to use for the YUV to RGB conversion +.RSss +.IPs 0 +Convert TV to PC levels (default). +.IPs 1 +Convert PC to TV levels. +.IPs 2 +Do not do any conversion. +.RE .IPs lscale= Select the scaling function to use for luminance scaling. Only valid for yuv modes 2, 3, 4 and 6. From 35c0d80e2fd00fa1d98097d5b8c328c5184e9860 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 16 Jan 2010 20:04:34 +0000 Subject: [PATCH 13/51] Mention levelconv -vo gl suboption in Changelog. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30337 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 9636107a3c..4004679eaa 100644 --- a/Changelog +++ b/Changelog @@ -26,7 +26,7 @@ MPlayer (1.0) * Support for more formats in OpenGL vos (different YUV subsampling, 16 bit per component) * Selectable YUV to RGB conversion standard for -vo gl - (-vo gl:colorspace=...) + (-vo gl:colorspace=...:levelconv=...) * -vo matrixview finally added Other: From d11d2ab24257f8e0b1574d9cd23245fcef4d1272 Mon Sep 17 00:00:00 2001 From: stefano Date: Sat, 16 Jan 2010 22:49:00 +0000 Subject: [PATCH 14/51] Fix typo, "get rid off" -> "get rid of". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30338 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index bb274e6f57..d256f10615 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1552,7 +1552,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF int j; int64_t cutOff=0.0; - /* get rid off near zero elements on the left by shifting left */ + /* get rid of near zero elements on the left by shifting left */ for (j=0; j Date: Sat, 16 Jan 2010 23:22:43 +0000 Subject: [PATCH 15/51] Allow anything starting with "arm" to be used as --target for ARM CPUs git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30339 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 97d4f9be63..5eabaa127d 100755 --- a/configure +++ b/configure @@ -167,7 +167,7 @@ alpha() { arm() { case "$host_arch" in - arm) return 0;; + arm*) return 0;; *) return 1;; esac } @@ -2126,7 +2126,7 @@ EOF _optimizing="$proc" ;; - arm|armv4l|armv5tel) + arm*) _arch='ARM' _target_arch='ARCH_ARM = yes' iproc='arm' From 21a572c8de0341392b25da848164928e9575079b Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 00:21:50 +0000 Subject: [PATCH 16/51] =?UTF-8?q?Add=20a=20const=20qualifier=20in=20a=20ca?= =?UTF-8?q?st,=20fix=20the=20gcc=20warning:=20swscale.c:=20In=20function?= =?UTF-8?q?=20=E2=80=98planarCopy=E2=80=99:=20swscale.c:2256:=20warning:?= =?UTF-8?q?=20cast=20discards=20qualifiers=20from=20pointer=20target=20typ?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30340 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index d256f10615..0b12b5e20b 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2253,7 +2253,7 @@ static int planarCopy(SwsContext *c, const uint8_t* src[], int srcStride[], int for (i=0; i Date: Sun, 17 Jan 2010 00:26:29 +0000 Subject: [PATCH 17/51] =?UTF-8?q?Add=20a=20const=20qualifier=20in=20a=20ca?= =?UTF-8?q?st,=20fix=20the=20gcc=20warning:=20swscale.c:=20In=20function?= =?UTF-8?q?=20=E2=80=98sws=5Fscale=E2=80=99:=20swscale.c:2968:=20warning:?= =?UTF-8?q?=20cast=20discards=20qualifiers=20from=20pointer=20target=20typ?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30341 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 0b12b5e20b..d312837591 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2965,7 +2965,7 @@ int sws_scale(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSlice for (i=0; i<256; i++) { int p, r, g, b,y,u,v; if(c->srcFormat == PIX_FMT_PAL8) { - p=((uint32_t*)(src[1]))[i]; + p=((const uint32_t*)(src[1]))[i]; r= (p>>16)&0xFF; g= (p>> 8)&0xFF; b= p &0xFF; From abf7e21e7960b9040b70be98b99f9c52bf952d7b Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 11:41:54 +0000 Subject: [PATCH 18/51] Change GUID declarations in tvi_dshow so they are not exported and thus will not cause clashes. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30342 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_dshow.c | 114 ++++++++++++++++++++++++++++++--------------- 1 file changed, 76 insertions(+), 38 deletions(-) diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c index 46accd81ed..d5a0209280 100644 --- a/stream/tvi_dshow.c +++ b/stream/tvi_dshow.c @@ -375,85 +375,123 @@ static int tv_available_inputs_count = 0; *--------------------------------------------------------------------------------------- */ /// CLSID definitions (used for CoCreateInstance call) -DEFINE_GUID(CLSID_SampleGrabber, 0xC1F400A0, 0x3F08, 0x11d3, 0x9F, 0x0B, +#define CLSID_SampleGrabber MP_CLSID_SampleGrabber +static DEFINE_GUID(CLSID_SampleGrabber, 0xC1F400A0, 0x3F08, 0x11d3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37); -DEFINE_GUID(CLSID_NullRenderer, 0xC1F400A4, 0x3F08, 0x11d3, 0x9F, 0x0B, +#define CLSID_NullRenderer MP_CLSID_NullRenderer +static DEFINE_GUID(CLSID_NullRenderer, 0xC1F400A4, 0x3F08, 0x11d3, 0x9F, 0x0B, 0x00, 0x60, 0x08, 0x03, 0x9E, 0x37); -DEFINE_GUID(CLSID_SystemDeviceEnum, 0x62BE5D10, 0x60EB, 0x11d0, 0xBD, 0x3B, +#define CLSID_SystemDeviceEnum MP_CLSID_SystemDeviceEnum +static DEFINE_GUID(CLSID_SystemDeviceEnum, 0x62BE5D10, 0x60EB, 0x11d0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86); -DEFINE_GUID(CLSID_CaptureGraphBuilder2, 0xBF87B6E1, 0x8C27, 0x11d0, 0xB3, +#define CLSID_CaptureGraphBuilder2 MP_CLSID_CaptureGraphBuilder2 +static DEFINE_GUID(CLSID_CaptureGraphBuilder2, 0xBF87B6E1, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5); -DEFINE_GUID(CLSID_VideoInputDeviceCategory, 0x860BB310, 0x5D01, 0x11d0, +#define CLSID_VideoInputDeviceCategory MP_CLSID_VideoInputDeviceCategory +static DEFINE_GUID(CLSID_VideoInputDeviceCategory, 0x860BB310, 0x5D01, 0x11d0, 0xBD, 0x3B, 0x00, 0xA0, 0xC9, 0x11, 0xCE, 0x86); -DEFINE_GUID(CLSID_AudioInputDeviceCategory, 0x33d9a762, 0x90c8, 0x11d0, +#define CLSID_AudioInputDeviceCategory MP_CLSID_AudioInputDeviceCategory +static DEFINE_GUID(CLSID_AudioInputDeviceCategory, 0x33d9a762, 0x90c8, 0x11d0, 0xbd, 0x43, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86); -DEFINE_GUID(CLSID_FilterGraph, 0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, +#define CLSID_FilterGraph MP_CLSID_FilterGraph +static DEFINE_GUID(CLSID_FilterGraph, 0xe436ebb3, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(CLSID_SystemClock, 0xe436ebb1, 0x524f, 0x11ce, 0x9f, 0x53, +#define CLSID_SystemClock MP_CLSID_SystemClock +static DEFINE_GUID(CLSID_SystemClock, 0xe436ebb1, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); #ifdef NOT_USED -DEFINE_GUID(CLSID_CaptureGraphBuilder, 0xBF87B6E0, 0x8C27, 0x11d0, 0xB3, +#define CLSID_CaptureGraphBuilder MP_CLSID_CaptureGraphBuilder +static DEFINE_GUID(CLSID_CaptureGraphBuilder, 0xBF87B6E0, 0x8C27, 0x11d0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5); -DEFINE_GUID(CLSID_VideoPortManager, 0x6f26a6cd, 0x967b, 0x47fd, 0x87, 0x4a, +#define CLSID_VideoPortManager MP_CLSID_VideoPortManager +static DEFINE_GUID(CLSID_VideoPortManager, 0x6f26a6cd, 0x967b, 0x47fd, 0x87, 0x4a, 0x7a, 0xed, 0x2c, 0x9d, 0x25, 0xa2); -DEFINE_GUID(IID_IPin, 0x56a86891, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, +#define IID_IPin MP_IID_IPin +static DEFINE_GUID(IID_IPin, 0x56a86891, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(IID_ICaptureGraphBuilder, 0xbf87b6e0, 0x8c27, 0x11d0, 0xb3, +#define IID_ICaptureGraphBuilder MP_IID_ICaptureGraphBuilder +static DEFINE_GUID(IID_ICaptureGraphBuilder, 0xbf87b6e0, 0x8c27, 0x11d0, 0xb3, 0xf0, 0x00, 0xaa, 0x00, 0x37, 0x61, 0xc5); -DEFINE_GUID(IID_IFilterGraph, 0x56a8689f, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, +#define IID_IFilterGraph MP_IID_IFilterGraph +static DEFINE_GUID(IID_IFilterGraph, 0x56a8689f, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, +#define PIN_CATEGORY_PREVIEW MP_PIN_CATEGORY_PREVIEW +static DEFINE_GUID(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba); #endif /// IID definitions (used for QueryInterface call) -DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, +#define IID_IReferenceClock MP_IID_IReferenceClock +static DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(IID_IAMBufferNegotiation, 0x56ED71A0, 0xAF5F, 0x11D0, 0xB3, 0xF0, +#define IID_IAMBufferNegotiation MP_IID_IAMBufferNegotiation +static DEFINE_GUID(IID_IAMBufferNegotiation, 0x56ED71A0, 0xAF5F, 0x11D0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5); -DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, +#define IID_IKsPropertySet MP_IID_IKsPropertySet +static DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93); -DEFINE_GUID(IID_ISampleGrabber, 0x6B652FFF, 0x11FE, 0x4fce, 0x92, 0xAD, +#define IID_ISampleGrabber MP_IID_ISampleGrabber +static DEFINE_GUID(IID_ISampleGrabber, 0x6B652FFF, 0x11FE, 0x4fce, 0x92, 0xAD, 0x02, 0x66, 0xB5, 0xD7, 0xC7, 0x8F); -DEFINE_GUID(IID_ISampleGrabberCB, 0x0579154A, 0x2B53, 0x4994, 0xB0, 0xD0, +#define IID_ISampleGrabberCB MP_IID_ISampleGrabberCB +static DEFINE_GUID(IID_ISampleGrabberCB, 0x0579154A, 0x2B53, 0x4994, 0xB0, 0xD0, 0xE7, 0x73, 0x14, 0x8E, 0xFF, 0x85); -DEFINE_GUID(IID_ICaptureGraphBuilder2, 0x93e5a4e0, 0x2d50, 0x11d2, 0xab, +#define IID_ICaptureGraphBuilder2 MP_IID_ICaptureGraphBuilder2 +static DEFINE_GUID(IID_ICaptureGraphBuilder2, 0x93e5a4e0, 0x2d50, 0x11d2, 0xab, 0xfa, 0x00, 0xa0, 0xc9, 0xc6, 0xe3, 0x8d); -DEFINE_GUID(IID_ICreateDevEnum, 0x29840822, 0x5b84, 0x11d0, 0xbd, 0x3b, +#define IID_ICreateDevEnum MP_IID_ICreateDevEnum +static DEFINE_GUID(IID_ICreateDevEnum, 0x29840822, 0x5b84, 0x11d0, 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86); -DEFINE_GUID(IID_IGraphBuilder, 0x56a868a9, 0x0ad4, 0x11ce, 0xb0, 0x3a, +#define IID_IGraphBuilder MP_IID_IGraphBuilder +static DEFINE_GUID(IID_IGraphBuilder, 0x56a868a9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(IID_IAMVideoProcAmp, 0xC6E13360, 0x30AC, 0x11d0, 0xA1, 0x8C, +#define IID_IAMVideoProcAmp MP_IID_IAMVideoProcAmp +static DEFINE_GUID(IID_IAMVideoProcAmp, 0xC6E13360, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56); -DEFINE_GUID(IID_IVideoWindow, 0x56a868b4, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, +#define IID_IVideoWindow MP_IID_IVideoWindow +static DEFINE_GUID(IID_IVideoWindow, 0x56a868b4, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(IID_IMediaControl, 0x56a868b1, 0x0ad4, 0x11ce, 0xb0, 0x3a, +#define IID_IMediaControl MP_IID_IMediaControl +static DEFINE_GUID(IID_IMediaControl, 0x56a868b1, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); -DEFINE_GUID(IID_IAMTVTuner, 0x211A8766, 0x03AC, 0x11d1, 0x8D, 0x13, 0x00, +#define IID_IAMTVTuner MP_IID_IAMTVTuner +static DEFINE_GUID(IID_IAMTVTuner, 0x211A8766, 0x03AC, 0x11d1, 0x8D, 0x13, 0x00, 0xAA, 0x00, 0xBD, 0x83, 0x39); -DEFINE_GUID(IID_IAMCrossbar, 0xc6e13380, 0x30ac, 0x11d0, 0xa1, 0x8c, 0x00, +#define IID_IAMCrossbar MP_IID_IAMCrossbar +static DEFINE_GUID(IID_IAMCrossbar, 0xc6e13380, 0x30ac, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56); -DEFINE_GUID(IID_IAMStreamConfig, 0xc6e13340, 0x30ac, 0x11d0, 0xa1, 0x8c, +#define IID_IAMStreamConfig MP_IID_IAMStreamConfig +static DEFINE_GUID(IID_IAMStreamConfig, 0xc6e13340, 0x30ac, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56); -DEFINE_GUID(IID_IAMAudioInputMixer, 0x54C39221, 0x8380, 0x11d0, 0xB3, 0xF0, +#define IID_IAMAudioInputMixer MP_IID_IAMAudioInputMixer +static DEFINE_GUID(IID_IAMAudioInputMixer, 0x54C39221, 0x8380, 0x11d0, 0xB3, 0xF0, 0x00, 0xAA, 0x00, 0x37, 0x61, 0xC5); -DEFINE_GUID(IID_IAMTVAudio, 0x83EC1C30, 0x23D1, 0x11d1, 0x99, 0xE6, 0x00, +#define IID_IAMTVAudio MP_IID_IAMTVAudio +static DEFINE_GUID(IID_IAMTVAudio, 0x83EC1C30, 0x23D1, 0x11d1, 0x99, 0xE6, 0x00, 0xA0, 0xC9, 0x56, 0x02, 0x66); -DEFINE_GUID(IID_IAMAnalogVideoDecoder, 0xC6E13350, 0x30AC, 0x11d0, 0xA1, +#define IID_IAMAnalogVideoDecoder MP_IID_IAMAnalogVideoDecoder +static DEFINE_GUID(IID_IAMAnalogVideoDecoder, 0xC6E13350, 0x30AC, 0x11d0, 0xA1, 0x8C, 0x00, 0xA0, 0xC9, 0x11, 0x89, 0x56); -DEFINE_GUID(IID_IPropertyBag, 0x55272a00, 0x42cb, 0x11ce, 0x81, 0x35, 0x00, +#define IID_IPropertyBag MP_IID_IPropertyBag +static DEFINE_GUID(IID_IPropertyBag, 0x55272a00, 0x42cb, 0x11ce, 0x81, 0x35, 0x00, 0xaa, 0x00, 0x4b, 0xb8, 0x51); -DEFINE_GUID(PIN_CATEGORY_CAPTURE, 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, +#define PIN_CATEGORY_CAPTURE MP_PIN_CATEGORY_CAPTURE +static DEFINE_GUID(PIN_CATEGORY_CAPTURE, 0xfb6c4281, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba); -DEFINE_GUID(PIN_CATEGORY_VIDEOPORT, 0xfb6c4285, 0x0353, 0x11d1, 0x90, 0x5f, +#define PIN_CATEGORY_VIDEOPORT MP_PIN_CATEGORY_VIDEOPORT +static DEFINE_GUID(PIN_CATEGORY_VIDEOPORT, 0xfb6c4285, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba); -DEFINE_GUID(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, +#define PIN_CATEGORY_PREVIEW MP_PIN_CATEGORY_PREVIEW +static DEFINE_GUID(PIN_CATEGORY_PREVIEW, 0xfb6c4282, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba); -DEFINE_GUID(PIN_CATEGORY_VBI, 0xfb6c4284, 0x0353, 0x11d1, 0x90, 0x5f, +#define PIN_CATEGORY_VBI MP_PIN_CATEGORY_VBI +static DEFINE_GUID(PIN_CATEGORY_VBI, 0xfb6c4284, 0x0353, 0x11d1, 0x90, 0x5f, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba); -DEFINE_GUID(PROPSETID_TUNER, 0x6a2e0605, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, +#define PROPSETID_TUNER MP_PROPSETID_TUNER +static DEFINE_GUID(PROPSETID_TUNER, 0x6a2e0605, 0x28e4, 0x11d0, 0xa1, 0x8c, 0x00, 0xa0, 0xc9, 0x11, 0x89, 0x56); -DEFINE_GUID(MEDIATYPE_VBI, 0xf72a76e1, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, +#define MEDIATYPE_VBI MP_MEDIATYPE_VBI +static DEFINE_GUID(MEDIATYPE_VBI, 0xf72a76e1, 0xeb0a, 0x11d0, 0xac, 0xe4, 0x00, 0x00, 0xc0, 0xcc, 0x16, 0xba); #define INSTANCEDATA_OF_PROPERTY_PTR(x) (((KSPROPERTY*)(x)) + 1) From 8277134a67b0a374c6c9398d852ed681f9146145 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 11:43:55 +0000 Subject: [PATCH 19/51] Change GUID declarations in vo_directx to be static. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30343 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_directx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c index 9aa27de2cc..af4a090493 100644 --- a/libvo/vo_directx.c +++ b/libvo/vo_directx.c @@ -97,12 +97,14 @@ extern int vidmode; * Defining them here allows us to get rid of the dxguid library during * the linking stage. *****************************************************************************/ -const GUID IID_IDirectDraw7 = +#define IID_IDirectDraw7 MP_IID_IDirectDraw7 +static const GUID MP_IID_IDirectDraw7 = { 0x15e65ec0,0x3b9c,0x11d2,{0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b} }; -const GUID IID_IDirectDrawColorControl = +#define IID_IDirectDrawColorControl MP_IID_IDirectDrawColorControl +static const GUID MP_IID_IDirectDrawColorControl = { 0x4b9f0ee0,0x0d7e,0x11d0,{0x9b,0x06,0x00,0xa0,0xc9,0x03,0xa3,0xb8} }; From 28aa29222e6223002931506a365b007d66ed979b Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 11:49:33 +0000 Subject: [PATCH 20/51] Also try linking against dxguid for SDL test. Some broken SDL versions need it even though sdl-config does include it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30344 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 5eabaa127d..74959d1ee5 100755 --- a/configure +++ b/configure @@ -5342,7 +5342,7 @@ int main(int argc, char *argv[]) { } EOF _sdl=no - for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" ; do + for _ld_tmp in "-lSDL" "-lSDL -lpthread" "-lSDL -lwinmm -lgdi32" "-lSDL -lwinmm -lgdi32 -ldxguid" ; do if cc_check -DCONFIG_SDL_SDL_H $_inc_tmp $_ld_tmp ; then _sdl=yes def_sdl_sdl_h="#define CONFIG_SDL_SDL_H 1" From 535803c310e66ecb16223f7a853e15f566c49ae4 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 12:27:54 +0000 Subject: [PATCH 21/51] Set ASFLAGS and HAVE_VFP_ARGS needed to compile for ARM with VFP/NEON support. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30345 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index 74959d1ee5..c8e8cad0d7 100755 --- a/configure +++ b/configure @@ -8399,6 +8399,7 @@ RANLIB = $_ranlib WINDRES = $_windres CFLAGS = $CFLAGS $extra_cflags +ASFLAGS = $CFLAGS $extra_cflags OPTFLAGS = $CFLAGS $extra_cflags CXXFLAGS = $CXXFLAGS $extra_cflags $extra_cxxflags CFLAGS_DHAHELPER = $cflags_dhahelper @@ -9144,6 +9145,7 @@ $def_yasm #define HAVE_PPC4XX 0 #define HAVE_SETMODE 0 #define HAVE_SYS_SELECT_H 0 +#define HAVE_VFP_ARGS 1 #define HAVE_VIRTUALALLOC 0 /* Some FFmpeg codecs depend on these. Enable them unconditionally for now. */ From 33809543d8dded7045234066627443dc9f894be5 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 12:32:25 +0000 Subject: [PATCH 22/51] Mention systems that have received major build fixes recently in the Changelog. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30346 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Changelog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Changelog b/Changelog index 4004679eaa..4418beb246 100644 --- a/Changelog +++ b/Changelog @@ -45,6 +45,9 @@ MPlayer (1.0) --disable-ass-internal * better support for 16-bit-per-component formats and formats with alpha channel. + * better out-of-the-box support for compiling for ARM, IA64, + MinGW32 and MinGW-w64, MinGW has ASLR enabled with recent + enough binutils. MEncoder: * add -tsprog for demuxer lavf From 77af8d08592dbcb80ed87336b630507639a16d38 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 13:18:59 +0000 Subject: [PATCH 23/51] Add hack to fix tvi_dshow compilation with 64-bit MinGW git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30347 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/tvi_dshow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stream/tvi_dshow.c b/stream/tvi_dshow.c index d5a0209280..9aec47ed54 100644 --- a/stream/tvi_dshow.c +++ b/stream/tvi_dshow.c @@ -374,6 +374,9 @@ static int tv_available_inputs_count = 0; * *--------------------------------------------------------------------------------------- */ +// selectany can not be used with "static", fixes compilation with mingw-w64 +#undef DECLSPEC_SELECTANY +#define DECLSPEC_SELECTANY /// CLSID definitions (used for CoCreateInstance call) #define CLSID_SampleGrabber MP_CLSID_SampleGrabber static DEFINE_GUID(CLSID_SampleGrabber, 0xC1F400A0, 0x3F08, 0x11d3, 0x9F, 0x0B, From 8afef4e19ca476e4f7e5b56e65e7ab59409d285d Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 13:28:29 +0000 Subject: [PATCH 24/51] Hack to avoid a GUID_NULL clash on 64 bit MinGW. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30348 b3059339-0415-0410-9bf9-f77b7e298cf2 --- loader/dshow/guids.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loader/dshow/guids.h b/loader/dshow/guids.h index 5bf335f907..80686558b4 100644 --- a/loader/dshow/guids.h +++ b/loader/dshow/guids.h @@ -56,6 +56,8 @@ extern const GUID IID_IDivxFilterInterface; extern const GUID CLSID_IV50_Decoder; extern const GUID CLSID_MemoryAllocator; extern const GUID MEDIATYPE_Video; +// avoid a clash with MinGW-W64 libuuid +#define GUID_NULL MP_GUID_NULL extern const GUID GUID_NULL; extern const GUID FORMAT_VideoInfo; extern const GUID MEDIASUBTYPE_RGB1; From 9c1aafc17c8ba6441ca86fb46d5d9f584b179436 Mon Sep 17 00:00:00 2001 From: mru Date: Sun, 17 Jan 2010 14:25:17 +0000 Subject: [PATCH 25/51] Remove inline from initFilter() It makes no sense having that function inlined. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30349 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index d312837591..7ed9ce1547 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1349,7 +1349,7 @@ static double getSplineCoeff(double a, double b, double c, double d, double dist dist-1.0); } -static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSize, int xInc, +static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSize, int xInc, int srcW, int dstW, int filterAlign, int one, int flags, SwsVector *srcFilter, SwsVector *dstFilter, double param[2]) { From 1d08d54a97e806db664bf04da3cf6675ddf3bbb8 Mon Sep 17 00:00:00 2001 From: mru Date: Sun, 17 Jan 2010 14:25:19 +0000 Subject: [PATCH 26/51] Reindent git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30350 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 7ed9ce1547..832af8dc13 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1350,8 +1350,8 @@ static double getSplineCoeff(double a, double b, double c, double d, double dist } static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSize, int xInc, - int srcW, int dstW, int filterAlign, int one, int flags, - SwsVector *srcFilter, SwsVector *dstFilter, double param[2]) + int srcW, int dstW, int filterAlign, int one, int flags, + SwsVector *srcFilter, SwsVector *dstFilter, double param[2]) { int i; int filterSize; From 2f7f6fdb9d21648cb14ac0125d61c6215a11b263 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 14:40:44 +0000 Subject: [PATCH 27/51] More format support in fmt-conversion.c: split RGB32 and BGR32 into ARGB, BGRA, ABGR, RGBA. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30351 b3059339-0415-0410-9bf9-f77b7e298cf2 --- fmt-conversion.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fmt-conversion.c b/fmt-conversion.c index 9371ab1a11..de2f2c572d 100644 --- a/fmt-conversion.c +++ b/fmt-conversion.c @@ -25,7 +25,8 @@ static const struct { int fmt; enum PixelFormat pix_fmt; } conversion_map[] = { - {IMGFMT_BGR32, PIX_FMT_RGB32}, + {IMGFMT_ARGB, PIX_FMT_ARGB}, + {IMGFMT_BGRA, PIX_FMT_BGRA}, {IMGFMT_BGR24, PIX_FMT_BGR24}, {IMGFMT_BGR16, PIX_FMT_RGB565}, {IMGFMT_BGR15, PIX_FMT_RGB555}, @@ -37,7 +38,8 @@ static const struct { {IMGFMT_BG4B, PIX_FMT_RGB4_BYTE}, {IMGFMT_RGB48LE, PIX_FMT_RGB48LE}, {IMGFMT_RGB48BE, PIX_FMT_RGB48BE}, - {IMGFMT_RGB32, PIX_FMT_BGR32}, + {IMGFMT_ABGR, PIX_FMT_ABGR}, + {IMGFMT_RGBA, PIX_FMT_RGBA}, {IMGFMT_RGB24, PIX_FMT_RGB24}, {IMGFMT_RGB16, PIX_FMT_BGR565}, {IMGFMT_RGB15, PIX_FMT_BGR555}, From aedf40e334b1ae42ff588ddafff6c09f0f165526 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 14:53:12 +0000 Subject: [PATCH 28/51] Do not depend on PIX_FMT_RGB32 which is (currently?) not part of the public API. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30352 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gui/bitmap.c b/gui/bitmap.c index 148998865a..f0377959a5 100644 --- a/gui/bitmap.c +++ b/gui/bitmap.c @@ -59,7 +59,8 @@ static int pngRead( unsigned char * fname,txSample * bf ) case PIX_FMT_GRAY8: bf->BPP = 8; break; case PIX_FMT_GRAY16BE: bf->BPP = 16; break; case PIX_FMT_RGB24: bf->BPP = 24; break; - case PIX_FMT_RGB32: bf->BPP = 32; break; + case PIX_FMT_BGRA: + case PIX_FMT_ARGB: bf->BPP = 32; break; default: bf->BPP = 0; break; } if (decode_ok && bf->BPP) { From 89d8ae77a82461e82e7a78eb0e97a1b727675edc Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 14:54:38 +0000 Subject: [PATCH 29/51] Add big- and little-endian variants of the 15 and 16 bit RGB/BGR formats. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30353 b3059339-0415-0410-9bf9-f77b7e298cf2 --- fmt-conversion.c | 12 ++++++++---- libmpcodecs/img_format.h | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/fmt-conversion.c b/fmt-conversion.c index de2f2c572d..013e3fea55 100644 --- a/fmt-conversion.c +++ b/fmt-conversion.c @@ -28,8 +28,10 @@ static const struct { {IMGFMT_ARGB, PIX_FMT_ARGB}, {IMGFMT_BGRA, PIX_FMT_BGRA}, {IMGFMT_BGR24, PIX_FMT_BGR24}, - {IMGFMT_BGR16, PIX_FMT_RGB565}, - {IMGFMT_BGR15, PIX_FMT_RGB555}, + {IMGFMT_BGR16BE, PIX_FMT_RGB565BE}, + {IMGFMT_BGR16LE, PIX_FMT_RGB565LE}, + {IMGFMT_BGR15BE, PIX_FMT_RGB555BE}, + {IMGFMT_BGR15LE, PIX_FMT_RGB555LE}, {IMGFMT_BGR8, PIX_FMT_RGB8}, {IMGFMT_BGR4, PIX_FMT_RGB4}, {IMGFMT_BGR1, PIX_FMT_MONOBLACK}, @@ -41,8 +43,10 @@ static const struct { {IMGFMT_ABGR, PIX_FMT_ABGR}, {IMGFMT_RGBA, PIX_FMT_RGBA}, {IMGFMT_RGB24, PIX_FMT_RGB24}, - {IMGFMT_RGB16, PIX_FMT_BGR565}, - {IMGFMT_RGB15, PIX_FMT_BGR555}, + {IMGFMT_RGB16BE, PIX_FMT_BGR565BE}, + {IMGFMT_RGB16LE, PIX_FMT_BGR565LE}, + {IMGFMT_RGB15BE, PIX_FMT_BGR555BE}, + {IMGFMT_RGB15LE, PIX_FMT_BGR555LE}, {IMGFMT_RGB8, PIX_FMT_BGR8}, {IMGFMT_RGB4, PIX_FMT_BGR4}, {IMGFMT_BGR8, PIX_FMT_PAL8}, diff --git a/libmpcodecs/img_format.h b/libmpcodecs/img_format.h index 6bab56632d..2aa037e5b7 100644 --- a/libmpcodecs/img_format.h +++ b/libmpcodecs/img_format.h @@ -35,12 +35,28 @@ #define IMGFMT_ARGB IMGFMT_BGR32 #define IMGFMT_RGBA (IMGFMT_BGR32|64) #define IMGFMT_RGB48NE IMGFMT_RGB48BE +#define IMGFMT_RGB15BE IMGFMT_RGB15 +#define IMGFMT_RGB15LE (IMGFMT_RGB15|64) +#define IMGFMT_RGB16BE IMGFMT_RGB16 +#define IMGFMT_RGB16LE (IMGFMT_RGB16|64) +#define IMGFMT_BGR15BE IMGFMT_BGR15 +#define IMGFMT_BGR15LE (IMGFMT_BGR15|64) +#define IMGFMT_BGR16BE IMGFMT_BGR16 +#define IMGFMT_BGR16LE (IMGFMT_BGR16|64) #else #define IMGFMT_ABGR (IMGFMT_BGR32|64) #define IMGFMT_BGRA IMGFMT_BGR32 #define IMGFMT_ARGB (IMGFMT_RGB32|64) #define IMGFMT_RGBA IMGFMT_RGB32 #define IMGFMT_RGB48NE IMGFMT_RGB48LE +#define IMGFMT_RGB15BE (IMGFMT_RGB15|64) +#define IMGFMT_RGB15LE IMGFMT_RGB15 +#define IMGFMT_RGB16BE (IMGFMT_RGB16|64) +#define IMGFMT_RGB16LE IMGFMT_RGB16 +#define IMGFMT_BGR15BE (IMGFMT_BGR15|64) +#define IMGFMT_BGR15LE IMGFMT_BGR15 +#define IMGFMT_BGR16BE (IMGFMT_BGR16|64) +#define IMGFMT_BGR16LE IMGFMT_BGR16 #endif /* old names for compatibility */ From ed03545c3c0c5be509365e695f32e83a446c6cf8 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 14:58:44 +0000 Subject: [PATCH 30/51] Reuse the fmt-conversion code instead of duplicating the functionality. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30354 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_lavc.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index e2ad55d0e0..dc295f72a1 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -24,6 +24,7 @@ #include "libmpdemux/muxer.h" #include "img_format.h" +#include "fmt-conversion.h" #include "mp_image.h" #include "vf.h" @@ -593,30 +594,9 @@ static int config(struct vf_instance_s* vf, } mux_v->imgfmt = lavc_param_format; - switch(lavc_param_format) - { - case IMGFMT_YV12: - lavc_venc_context->pix_fmt = PIX_FMT_YUV420P; - break; - case IMGFMT_422P: - lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; - break; - case IMGFMT_444P: - lavc_venc_context->pix_fmt = PIX_FMT_YUV444P; - break; - case IMGFMT_411P: - lavc_venc_context->pix_fmt = PIX_FMT_YUV411P; - break; - case IMGFMT_YVU9: - lavc_venc_context->pix_fmt = PIX_FMT_YUV410P; - break; - case IMGFMT_BGR32: - lavc_venc_context->pix_fmt = PIX_FMT_RGB32; - break; - default: - mp_msg(MSGT_MENCODER,MSGL_ERR,"%s is not a supported format\n", vo_format_name(lavc_param_format)); - return 0; - } + lavc_venc_context->pix_fmt = imgfmt2pixfmt(lavc_param_format); + if (lavc_venc_context->pix_fmt == PIX_FMT_NONE) + return 0; if(!stats_file) { /* lavc internal 2pass bitrate control */ From 1a5841fbbb632323057d79e329d0736e349704eb Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 17 Jan 2010 15:08:31 +0000 Subject: [PATCH 31/51] Add a proper header for our strsep implementation so strsep will not be used without a declaration, causing issues on 64 bit systems. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30355 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libaf/af.c | 1 + libmpcodecs/ve_lavc.c | 1 + libmpdemux/mf.c | 1 + osdep/strsep.c | 1 + osdep/strsep.h | 30 ++++++++++++++++++++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 osdep/strsep.h diff --git a/libaf/af.c b/libaf/af.c index 86b00a3e09..1de8ee3154 100644 --- a/libaf/af.c +++ b/libaf/af.c @@ -20,6 +20,7 @@ #include #include #include +#include "osdep/strsep.h" #include "af.h" diff --git a/libmpcodecs/ve_lavc.c b/libmpcodecs/ve_lavc.c index dc295f72a1..4f7c4ef310 100644 --- a/libmpcodecs/ve_lavc.c +++ b/libmpcodecs/ve_lavc.c @@ -15,6 +15,7 @@ #include "mp_msg.h" #include "help_mp.h" #include "av_opts.h" +#include "osdep/strsep.h" #include "codec-cfg.h" #include "stream/stream.h" diff --git a/libmpdemux/mf.c b/libmpdemux/mf.c index 74778b628a..c4732206ae 100644 --- a/libmpdemux/mf.c +++ b/libmpdemux/mf.c @@ -33,6 +33,7 @@ #else #include "osdep/glob.h" #endif +#include "osdep/strsep.h" #include "mp_msg.h" #include "help_mp.h" diff --git a/osdep/strsep.c b/osdep/strsep.c index a5ffa7054d..e373141887 100644 --- a/osdep/strsep.c +++ b/osdep/strsep.c @@ -22,6 +22,7 @@ #include #include "config.h" +#include "strsep.h" char *strsep(char **stringp, const char *delim) { char *begin, *end; diff --git a/osdep/strsep.h b/osdep/strsep.h new file mode 100644 index 0000000000..fbd377f084 --- /dev/null +++ b/osdep/strsep.h @@ -0,0 +1,30 @@ +/* + * strsep implementation for systems that do not have it in libc + * + * This file is part of MPlayer. + * + * MPlayer is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * MPlayer 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifndef MPLAYER_STRSEP_H +#define MPLAYER_STRSEP_H + +#include +#include "config.h" + +#ifndef HAVE_STRSEP +char *strsep(char **stringp, const char *delim); +#endif + +#endif /* MPLAYER_STRSEP_H */ From acd1a4075d77c5d145fc2ee6453340c3f2352c12 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 15:11:25 +0000 Subject: [PATCH 32/51] Factorize error message logging in rgb2rgbWrapper(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30356 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 832af8dc13..9f18a41a51 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2085,8 +2085,6 @@ static int rgb2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], case 0x83: conv= rgb15to32; break; case 0x84: conv= rgb16to32; break; case 0x86: conv= rgb24to32; break; - default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", - sws_format_name(srcFormat), sws_format_name(dstFormat)); break; } } else if ( (isBGR(srcFormat) && isRGB(dstFormat)) || (isRGB(srcFormat) && isBGR(dstFormat))) { @@ -2107,15 +2105,13 @@ static int rgb2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], case 0x84: conv= rgb16tobgr32; break; case 0x86: conv= rgb24tobgr32; break; case 0x88: conv= rgb32tobgr32; break; - default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", - sws_format_name(srcFormat), sws_format_name(dstFormat)); break; } - } else { - av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", - sws_format_name(srcFormat), sws_format_name(dstFormat)); } - if(conv) { + if (!conv) { + av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", + sws_format_name(srcFormat), sws_format_name(dstFormat)); + } else { const uint8_t *srcPtr= src[0]; if(srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1) srcPtr += ALT32_CORR; From 1a8479b95e38e0db089c3eadee419c61562ad19c Mon Sep 17 00:00:00 2001 From: mru Date: Sun, 17 Jan 2010 19:26:35 +0000 Subject: [PATCH 33/51] Remove double const git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30357 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 9f18a41a51..6896d504ee 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2148,7 +2148,7 @@ static int bgr24toyv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride return srcSliceH; } -static int yvu9toyv12Wrapper(SwsContext *c, const const uint8_t* src[], int srcStride[], int srcSliceY, +static int yvu9toyv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { int i; From 3c54865aeab03d40ed311818a1dcf212171dd176 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 23:00:01 +0000 Subject: [PATCH 34/51] Make the pal2rgbWrapper set and use the converter in pal2rgbWrapper only if the input format is paletted. Fix potential crashes/weirdness if the input format is non-paletted. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30358 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 6896d504ee..0623d5dc99 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2035,7 +2035,7 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], if (!usePal(srcFormat)) av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", sws_format_name(srcFormat), sws_format_name(dstFormat)); - + else { switch(dstFormat) { case PIX_FMT_RGB32 : conv = palette8topacked32; break; case PIX_FMT_BGR32 : conv = palette8topacked32; break; @@ -2046,8 +2046,9 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", sws_format_name(srcFormat), sws_format_name(dstFormat)); break; } + } - + if (conv) for (i=0; isrcW, (uint8_t *) c->pal_rgb); srcPtr+= srcStride[0]; From 6db184bb8026dbc8c9772aa7e853301fbc67119b Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 23:02:20 +0000 Subject: [PATCH 35/51] Reindent after the last commit. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30359 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 0623d5dc99..39a4341445 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2036,24 +2036,24 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", sws_format_name(srcFormat), sws_format_name(dstFormat)); else { - switch(dstFormat) { - case PIX_FMT_RGB32 : conv = palette8topacked32; break; - case PIX_FMT_BGR32 : conv = palette8topacked32; break; - case PIX_FMT_BGR32_1: conv = palette8topacked32; break; - case PIX_FMT_RGB32_1: conv = palette8topacked32; break; - case PIX_FMT_RGB24 : conv = palette8topacked24; break; - case PIX_FMT_BGR24 : conv = palette8topacked24; break; - default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", - sws_format_name(srcFormat), sws_format_name(dstFormat)); break; - } + switch (dstFormat) { + case PIX_FMT_RGB32 : conv = palette8topacked32; break; + case PIX_FMT_BGR32 : conv = palette8topacked32; break; + case PIX_FMT_BGR32_1: conv = palette8topacked32; break; + case PIX_FMT_RGB32_1: conv = palette8topacked32; break; + case PIX_FMT_RGB24 : conv = palette8topacked24; break; + case PIX_FMT_BGR24 : conv = palette8topacked24; break; + default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", + sws_format_name(srcFormat), sws_format_name(dstFormat)); break; + } } if (conv) - for (i=0; isrcW, (uint8_t *) c->pal_rgb); - srcPtr+= srcStride[0]; - dstPtr+= dstStride[0]; - } + for (i=0; isrcW, (uint8_t *) c->pal_rgb); + srcPtr+= srcStride[0]; + dstPtr+= dstStride[0]; + } return srcSliceH; } From aadf8843d79c8e6eb41f66c49967e9c86a5e3ab6 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 23:07:37 +0000 Subject: [PATCH 36/51] Factorize error message logging, log it if the converter cannot be set. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30360 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 39a4341445..a2a8c83a7a 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2032,10 +2032,7 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], uint8_t *dstPtr= dst[0] + dstStride[0]*srcSliceY; const uint8_t *srcPtr= src[0]; - if (!usePal(srcFormat)) - av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", - sws_format_name(srcFormat), sws_format_name(dstFormat)); - else { + if (usePal(srcFormat)) { switch (dstFormat) { case PIX_FMT_RGB32 : conv = palette8topacked32; break; case PIX_FMT_BGR32 : conv = palette8topacked32; break; @@ -2043,17 +2040,19 @@ static int pal2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], case PIX_FMT_RGB32_1: conv = palette8topacked32; break; case PIX_FMT_RGB24 : conv = palette8topacked24; break; case PIX_FMT_BGR24 : conv = palette8topacked24; break; - default: av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", - sws_format_name(srcFormat), sws_format_name(dstFormat)); break; } } - if (conv) + if (!conv) + av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", + sws_format_name(srcFormat), sws_format_name(dstFormat)); + else { for (i=0; isrcW, (uint8_t *) c->pal_rgb); srcPtr+= srcStride[0]; dstPtr+= dstStride[0]; } + } return srcSliceH; } From c60f68724c96137e06afded2e3f5be028f7ac180 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 23:17:47 +0000 Subject: [PATCH 37/51] Remove duplicated or pointless newlines. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30361 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index a2a8c83a7a..893637be8a 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -771,7 +771,6 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc dest++;\ }\ - #define YSCALE_YUV_2_MONOX_C \ const uint8_t * const d128=dither_8x8_220[y&7];\ uint8_t *g= c->table_gU[128] + c->table_gV[128];\ @@ -801,7 +800,6 @@ 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:\ @@ -991,7 +989,6 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc break;\ }\ - static inline void yuv2packedXinC(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, int dstW, int y) @@ -1249,7 +1246,6 @@ 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_GPL) && !HAVE_ALTIVEC) || CONFIG_RUNTIME_CPUDETECT @@ -1624,7 +1620,6 @@ static int initFilter(int16_t **outFilter, int16_t **filterPos, int *outFilterSi } } - //FIXME try to align filterPos if possible //fix borders @@ -2135,7 +2130,6 @@ static int rgb2rgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], static int bgr24toyv12Wrapper(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { - rgb24toyv12( src[0], dst[0]+ srcSliceY *dstStride[0], @@ -2269,7 +2263,6 @@ static int planarCopy(SwsContext *c, const uint8_t* src[], int srcStride[], int return srcSliceH; } - static void getSubSampleFactors(int *h, int *v, enum PixelFormat format) { *h = av_pix_fmt_descriptors[format].log2_chroma_w; @@ -2719,8 +2712,6 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d } } // initialize horizontal stuff - - /* precalculate vertical scaler filter coefficients */ { const int filterAlign= @@ -2988,7 +2979,6 @@ int sws_scale(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSlice v= av_clip_uint8((RV*r + GV*g + BV*b + (257<<(RGB2YUV_SHIFT-1)))>>RGB2YUV_SHIFT); c->pal_yuv[i]= y + (u<<8) + (v<<16); - switch(c->dstFormat) { case PIX_FMT_BGR32: #if !HAVE_BIGENDIAN @@ -3172,7 +3162,6 @@ SwsVector *sws_getConstVec(double c, int length) return vec; } - SwsVector *sws_getIdentityVec(void) { return sws_getConstVec(1.0, 1); @@ -3365,7 +3354,6 @@ void sws_freeFilter(SwsFilter *filter) av_free(filter); } - void sws_freeContext(SwsContext *c) { int i; From 91e4519ed0058209c9bf9b0d0e28cf08e8bdf628 Mon Sep 17 00:00:00 2001 From: stefano Date: Sun, 17 Jan 2010 23:29:31 +0000 Subject: [PATCH 38/51] Remove stray '\' at the end of macro definitions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30362 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 893637be8a..057d7e19fb 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -588,7 +588,7 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc }\ A1>>=19;\ A2>>=19;\ - }\ + } #define YSCALE_YUV_2_PACKEDX_C(type,alpha) \ YSCALE_YUV_2_PACKEDX_NOCLIP_C(type,alpha)\ @@ -633,7 +633,7 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc A >>=19;\ if (A&256)\ A = av_clip_uint8(A);\ - }\ + } #define YSCALE_YUV_2_RGBX_FULL_C(rnd,alpha) \ YSCALE_YUV_2_PACKEDX_FULL_C(rnd>>3,alpha)\ @@ -650,8 +650,7 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc else if (G<0)G=0; \ if (B>=(256<<22)) B=(256<<22)-1; \ else if (B<0)B=0; \ - }\ - + } #define YSCALE_YUV_2_GRAY16_C \ for (i=0; i<(dstW>>1); i++) {\ @@ -680,7 +679,7 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc YSCALE_YUV_2_PACKEDX_C(type,alpha) /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/\ r = (type *)c->table_rV[V]; \ g = (type *)(c->table_gU[U] + c->table_gV[V]); \ - b = (type *)c->table_bU[U]; \ + b = (type *)c->table_bU[U]; #define YSCALE_YUV_2_PACKED2_C(type,alpha) \ for (i=0; i<(dstW>>1); i++) { \ @@ -694,19 +693,19 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc if (alpha) {\ A1= (abuf0[i2 ]*yalpha1+abuf1[i2 ]*yalpha)>>19; \ A2= (abuf0[i2+1]*yalpha1+abuf1[i2+1]*yalpha)>>19; \ - }\ + } #define YSCALE_YUV_2_GRAY16_2_C \ for (i=0; i<(dstW>>1); i++) { \ const int i2= 2*i; \ int Y1= (buf0[i2 ]*yalpha1+buf1[i2 ]*yalpha)>>11; \ - int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>11; \ + int Y2= (buf0[i2+1]*yalpha1+buf1[i2+1]*yalpha)>>11; #define YSCALE_YUV_2_RGB2_C(type,alpha) \ YSCALE_YUV_2_PACKED2_C(type,alpha)\ r = (type *)c->table_rV[V];\ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ - b = (type *)c->table_bU[U];\ + b = (type *)c->table_bU[U]; #define YSCALE_YUV_2_PACKED1_C(type,alpha) \ for (i=0; i<(dstW>>1); i++) {\ @@ -720,19 +719,19 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc if (alpha) {\ A1= abuf0[i2 ]>>7;\ A2= abuf0[i2+1]>>7;\ - }\ + } #define YSCALE_YUV_2_GRAY16_1_C \ for (i=0; i<(dstW>>1); i++) {\ const int i2= 2*i;\ int Y1= buf0[i2 ]<<1;\ - int Y2= buf0[i2+1]<<1;\ + int Y2= buf0[i2+1]<<1; #define YSCALE_YUV_2_RGB1_C(type,alpha) \ YSCALE_YUV_2_PACKED1_C(type,alpha)\ r = (type *)c->table_rV[V];\ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ - b = (type *)c->table_bU[U];\ + b = (type *)c->table_bU[U]; #define YSCALE_YUV_2_PACKED1B_C(type,alpha) \ for (i=0; i<(dstW>>1); i++) {\ @@ -746,13 +745,13 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc if (alpha) {\ A1= abuf0[i2 ]>>7;\ A2= abuf0[i2+1]>>7;\ - }\ + } #define YSCALE_YUV_2_RGB1B_C(type,alpha) \ YSCALE_YUV_2_PACKED1B_C(type,alpha)\ r = (type *)c->table_rV[V];\ g = (type *)(c->table_gU[U] + c->table_gV[V]);\ - b = (type *)c->table_bU[U];\ + b = (type *)c->table_bU[U]; #define YSCALE_YUV_2_MONO2_C \ const uint8_t * const d128=dither_8x8_220[y&7];\ @@ -769,7 +768,7 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc acc+= acc + g[((buf0[i+7]*yalpha1+buf1[i+7]*yalpha)>>19) + d128[7]];\ ((uint8_t*)dest)[0]= c->dstFormat == PIX_FMT_MONOBLACK ? acc : ~acc;\ dest++;\ - }\ + } #define YSCALE_YUV_2_MONOX_C \ const uint8_t * const d128=dither_8x8_220[y&7];\ @@ -987,7 +986,7 @@ static inline void yuv2nv12XinC(const int16_t *lumFilter, const int16_t **lumSrc ((uint8_t*)dest)[2*i2+3]= Y2>>8;\ } \ break;\ - }\ + } static inline void yuv2packedXinC(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrSrc, int chrFilterSize, From 3b949d7bdf5dd8806883be37345ead55fff1a030 Mon Sep 17 00:00:00 2001 From: zuxy Date: Mon, 18 Jan 2010 03:06:43 +0000 Subject: [PATCH 39/51] Support for detection of AMD Phenom. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30363 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/configure b/configure index c8e8cad0d7..35b8aa2b21 100755 --- a/configure +++ b/configure @@ -1818,7 +1818,7 @@ case "$host_arch" in proc=k8 ;; - *) proc=k8 iproc=686 ;; + *) proc=amdfam10 iproc=686 ;; esac ;; GenuineIntel) @@ -2028,7 +2028,11 @@ EOF if test "$_runtime_cpudetection" = no ; then case "$pvendor" in AuthenticAMD) - proc=k8;; + case "$pfamily" in + 15) proc=k8;; + *) proc=amdfam10;; + esac + ;; GenuineIntel) case "$pfamily" in 6) proc=core2;; From 9b08d26bfb471bef5076a54ca89d47c39ffc2a15 Mon Sep 17 00:00:00 2001 From: compn Date: Mon, 18 Jan 2010 03:55:16 +0000 Subject: [PATCH 40/51] add uldx and vspx fourcc to ffodivx in codecs.conf git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30364 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 152cd842b4..c542020b62 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -984,6 +984,7 @@ videocodec ffodivx fourcc DCOD,MVXM,EM4A,PM4V fourcc M4T3,DMK2,DIGI,INMC fourcc EPHV,SN40 + fourcc uldx,ULDX,VSPX driver ffmpeg dll mpeg4 ;opendivx out YV12,I420,IYUV @@ -1015,6 +1016,7 @@ videocodec ffodivxvdpau fourcc DCOD,MVXM,EM4A,PM4V fourcc M4T3,DMK2,DIGI,INMC fourcc EPHV,SN40 + fourcc uldx,ULDX,VSPX driver ffmpeg dll mpeg4_vdpau out VDPAU_MPEG4 @@ -1066,6 +1068,7 @@ videocodec xvid fourcc DCOD,MVXM,EM4A,PM4V fourcc M4T3,DMK2,DIGI,INMC fourcc EPHV,SN40 + fourcc uldx,ULDX,VSPX format 0x10000004 ; mpeg 4 es driver xvid out YV12 From 2257b14a19fbdde84379e9fc51fe85049c3f5a5e Mon Sep 17 00:00:00 2001 From: zuxy Date: Mon, 18 Jan 2010 08:42:04 +0000 Subject: [PATCH 41/51] Define out currently unused static functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30365 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/yuv2rgb.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 5e20dc843a..8e987a61f1 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -321,6 +321,7 @@ YUV2RGBFUNC(yuv2rgb_c_16, uint16_t, 0) PUTRGB(dst_1,py_1,3); CLOSEYUV2RGBFUNC(8) +#if 0 // Currently unused // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 YUV2RGBFUNC(yuv2rgb_c_8, uint8_t, 0) @@ -340,6 +341,7 @@ YUV2RGBFUNC(yuv2rgb_c_8, uint8_t, 0) PUTRGB(dst_2,py_2,3); PUTRGB(dst_1,py_1,3); CLOSEYUV2RGBFUNC(8) +#endif // r, g, b, dst_1, dst_2 YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) @@ -368,7 +370,7 @@ YUV2RGBFUNC(yuv2rgb_c_8_ordered_dither, uint8_t, 0) PUTRGB8(dst_1,py_1,3,6); CLOSEYUV2RGBFUNC(8) - +#if 0 // Currently unused // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 YUV2RGBFUNC(yuv2rgb_c_4, uint8_t, 0) @@ -396,6 +398,7 @@ YUV2RGBFUNC(yuv2rgb_c_4, uint8_t, 0) PUTRGB4(dst_2,py_2,3); PUTRGB4(dst_1,py_1,3); CLOSEYUV2RGBFUNC(4) +#endif YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) const uint8_t *d64 = dither_8x8_73[y&7]; @@ -426,6 +429,7 @@ YUV2RGBFUNC(yuv2rgb_c_4_ordered_dither, uint8_t, 0) PUTRGB4D(dst_1,py_1,3,6); CLOSEYUV2RGBFUNC(4) +#if 0 // Currently unused // This is exactly the same code as yuv2rgb_c_32 except for the types of // r, g, b, dst_1, dst_2 YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t, 0) @@ -445,6 +449,7 @@ YUV2RGBFUNC(yuv2rgb_c_4b, uint8_t, 0) PUTRGB(dst_2,py_2,3); PUTRGB(dst_1,py_1,3); CLOSEYUV2RGBFUNC(8) +#endif YUV2RGBFUNC(yuv2rgb_c_4b_ordered_dither, uint8_t, 0) const uint8_t *d64 = dither_8x8_73[y&7]; From 2ab8c5d481236951b8060827df31b64ef639feda Mon Sep 17 00:00:00 2001 From: ptt Date: Mon, 18 Jan 2010 10:44:30 +0000 Subject: [PATCH 42/51] synced with r30197 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30366 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/it/mplayer.1 | 101 +++++++++++++++++++++++++++++------------- 1 file changed, 70 insertions(+), 31 deletions(-) diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1 index 891240c0d8..a7eee23acc 100644 --- a/DOCS/man/it/mplayer.1 +++ b/DOCS/man/it/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r30043 +.\" synced with r30197 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" Questa pagina di manuale è stata fatta da Gabucino, Diego Biurrun, @@ -1292,14 +1292,14 @@ Permette ad un socket di essere riutilizzato da altri processi appena viene chiuso. . .TP -.B \-bandwidth (solo rete) +.B \-bandwidth (solo rete) Specifica la massima larghezza di banda (bandwidth) per lo streaming attraverso una rete (per quei server che sono capaci di inviare contenuti, normalmente filmati, a diversi bitrate). -Utile se vuoi guardare contenuti multimediali dal vivo con una connessione lenta. +Utile se vuoi guardare contenuti multimediali dal vivo su una connessione lenta. Con lo streaming RTSP Real, viene anche usata per impostare la massima larghezza di banda in uscita dal server, permettendo un riempimento della cache e un dump -di flusso più veloce. +del flusso più rapido. . .TP .B \-cache @@ -1347,15 +1347,15 @@ Usa il dispositivo SCSI generico specificato .IPs sector-size= Dimensione di una lettura atomica .IPs overlap= -Forza la ricerca di sovrapposizione minima (minimum overlap search) durante la verifica a settori +Forza la ricerca di sovrapposizione minima (minimum overlap search) durante la +verifica a settori. .IPs toc-bias Assume che lo scostamento iniziale della traccia 1 come riportato nella TOC sarà indirizzato come LBA 0. Alcuni lettori Toshiba hanno bisogno di questa opzione per ottenere la corretta delimitazione delle tracce. .IPs toc-offset= -Aggiunge settori ai valori riportati quando si indirizzano -le tracce. +Aggiunge settori ai valori riportati quando si indirizzano le tracce. Può essere negativo. .IPs (no)skip (Non) accetta una ricostruzione imperfetta dei dati. @@ -2672,7 +2672,7 @@ Attiva il raggio della sfocatura del font (default: 2). .TP .B \-subfont\-encoding (solo FreeType) Attiva la codifica del font. -Quando settato a 'unicode' tutti i glifi dal file del font verranno disegnati +Quando impostato a 'unicode' verranno disegnati tutti i glifi dal file del font e verrà usato l'unicode (default: unicode). . .TP @@ -3606,7 +3606,7 @@ Seleziona la sorgente da cui viene preso il colorkey (default: cur). .IPs cur Il default prende il colorkey correntemente configurato in Xv. .IPs use -Utilizza ma non setta il colorkey da MPlayer (utilizza l'opzione \-colorkey +Utilizza ma non imposta il colorkey da MPlayer (utilizza l'opzione \-colorkey per cambiarlo). .IPs set Uguale a use ma imposta anche il colorkey fornito. @@ -3668,7 +3668,7 @@ Pu del flusso A/V (default: noqueue). .IPs (no)sleep Utilizza la funzione sleep mentre aspetta che finisca la visualizzazione -(non raccomandato con Linux) (default: nosleep). +(non consigliato in Linux) (default: nosleep). .IPs ck=cur|use|set E' lo stesso che \-vo xv:ck (vedi \-vo xv). .IPs ck-method=man|bg|auto @@ -4024,6 +4024,10 @@ orizzontale / n). Richiede il supporto GLX_SGI_swap_control per funzionare. Con alcune (la maggior parte/tutte?) implementazioni funziona sono in modalità a schermo intero. +.IPs ycbcr +Usa l'estenzione GL_MESA_ycbcr_texture per convertire da YUV a RGB. +Nella maggior parte dei casi è probabilmente più lento di una conversione +software verso RGB. .IPs yuv= Seleziona il tipo di conversione da YUV a RGB. .RSss @@ -4069,10 +4073,18 @@ La gamma pu La velocità dipende più dall'ampiezza di memoria della GPU rispetto agli altri metodi. .RE -.IPs ycbcr -Usa l'estenzione GL_MESA_ycbcr_texture per convertire da YUV a RGB. -Nella maggior parte dei casi è probabilmente più lento di una conversione -software verso RGB. +.IPs colorspace +Seleziona lo spazio colore per la conversione da YUV a RGB. +.RSss +.IPs 0 +Utilizza la formula usata solitamente da MPlayer (default). +.IPs 1 +Usa uno spazio colore ITU-R BT.601. +.IPs 2 +Usa uno spazio colore ITU-R BT.709. +.IPs 3 +Usa uno spazio colore SMPTE-240M. +.RE .IPs lscale= Seleziona la funzione di ridimensionamento da usare per il ridimensionamento della luminanza. @@ -4113,6 +4125,13 @@ GL_NEAREST per la texture 'customtex'. .IPs (no)customtrect Se abilitata, usa texture_rectangle per la texture 'customtex'. Disabilitata di default. +.IPs (no)mipmapgen +Se abilitata, vengono generate automaticamente delle mipmap per il video. +Questo dovrebbe essere utile insieme con customprog e con l'istruzione TXB per +implementare filtri di sfocatura con un raggio ampio. +Per la maggior parte delle implementazioni OpenGL è molto lento per un +qualsiasi formato non RGB. +Disabilitata di default. .RE .sp 1 .RS @@ -4171,6 +4190,23 @@ A parte ci .REss . .TP +.B matrixview +Renderizzatore basato su OpenGL che crea un effetto di testo stile Matrix. +.PD 0 +.RSs +.IPs cols= +Numero delle colonne di testo da mostrare. +Valori molto bassi (< 16) probabilmente non funzioneranno a causa delle +limitazioni dello scalatore. +Allo stesso modo, valori non divisibili per 16 potrebbero causare problemi. +.IPs rows= +Numero delle righe di testo da mostrare. +Valori molto bassi (< 16) probabilmente non funzioneranno a causa delle +limitazioni dello scalatore. +Allo stesso modo, valori non divisibili per 16 potrebbero causare problemi. +.REss +. +.TP .B "null\ \ \ " Non produce nessuna uscita video. Utile per benchmarking (prove di velocità). @@ -4226,17 +4262,20 @@ Visualizza il video utilizzando la libreria DirectFB. .IPs (no)input Utilizza il codice della tastiera di DirectFB invece di quello standard di MPlayer. (default: abilitato) .IPs buffermode=single|double|triple -Il doppio ed il triplo buffering danno i migliori risultati se vuoi evitare problemi di tearing. -Il triplo buffering è più efficiente del doppio buffering perché non blocca MPlayer -mentre aspetta il tracciamento verticale. +Il doppio ed il triplo buffering danno i migliori risultati se vuoi evitare +problemi di tearing. +Il triplo buffering è più efficiente del doppio buffering perché non blocca +MPlayer mentre aspetta il tracciamento verticale. La bufferizzazione singola dovrebbe essere evitata (default: single). .IPs fieldparity=top|bottom -Controlla l'ordine di uscita dei fotogrammi interlacciati (default: disabilitato). -Valori validi sono top (prima il campo superiore) e bottom (prima il campo inferiore). -Questa opzione non ha alcun effetto su materiale progressivo, generalmente la maggior -parte dei film MPEG. -Devi abilitare questa opzione se hai effetti di tearing oppure movimenti non uniformi -guardando materiale interlacciato. +Controlla l'ordine di uscita dei fotogrammi interlacciati +(default: disabilitato). +Valori validi sono top (prima il campo superiore) e bottom (prima il campo +inferiore). +Questa opzione non ha alcun effetto su materiale progressivo, generalmente la +maggior parte dei film MPEG. +Devi abilitare questa opzione se hai effetti di tearing oppure movimenti non +uniformi guardando materiale interlacciato. .IPs layer=N Forza l'utilizzo del layer con ID N per la riproduzione (default: \-1 \- auto). .IPs dfbopts= @@ -8134,7 +8173,7 @@ lascia che sia LAME a scegliere il valore automaticamente. . .TP .B preset= -valore dei settaggi predefiniti (Preset) +valore delle impostazioni predefinite (Preset) .RSs .IPs "help\ " Stampa le opzioni aggiuntive ed informazioni sui preset. @@ -8145,7 +8184,7 @@ codifica VBR, alta qualit .IPs extreme codifica VBR, qualità molto alta, bitrate compreso tra 200\-240 kbps .IPs insane -codifica CBR, il settaggio di miglior qualità, bitrate di 320 kbps +codifica CBR, l'impostazione di miglior qualità, bitrate di 320 kbps .IPs <8\-320> codifica ABR al bitrate medio specificato .RE @@ -9944,12 +9983,12 @@ dai blocchi circostanti (default: attiva). . .TP .B vhq=<0\-4> -L'algoritmo di ricerca del movimento è basato su una ricerca nel dominio del colore -e cerca di trovare un vettore di movimento che minimizzi la differenza tra il fotogramma -di riferimento e quello codificato. -Con questo settaggio attivato Xvid userà anche il dominio delle frequenze (DCT) -per ricercare un vettore di movimento che minimizzi non solo la differenza spaziale, ma -anche la lunghezza codificata del blocco. +L'algoritmo di ricerca del movimento è basato su una ricerca nel dominio del +colore e cerca di trovare un vettore di movimento che minimizzi la differenza +tra il fotogramma di riferimento e quello codificato. +Con questa impostazione attivata, Xvid userà anche il dominio delle frequenze +(DCT) per ricercare un vettore di movimento che minimizzi non solo la +differenza spaziale, ma anche la lunghezza codificata del blocco. Dalla più rapida alla più lenta: .PD 0 .RSs From 18f9a9bebccfdf28ff4cab1e74cc910e26f3aac4 Mon Sep 17 00:00:00 2001 From: stefano Date: Mon, 18 Jan 2010 23:33:17 +0000 Subject: [PATCH 43/51] Convert int -> enum PixelFormat in doTest(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30367 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale-example.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 8637b9f7ff..5ce6e54547 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -70,7 +70,7 @@ static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, i // test by ref -> src -> dst -> out & compare out against ref // ref & out are YV12 -static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcFormat, int dstFormat, +static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, enum PixelFormat srcFormat, enum PixelFormat dstFormat, int srcW, int srcH, int dstW, int dstH, int flags) { uint8_t *src[4] = {0}; From d448df5addccc65cb0bbbd8d1a48f99aa7067b97 Mon Sep 17 00:00:00 2001 From: stefano Date: Mon, 18 Jan 2010 23:34:07 +0000 Subject: [PATCH 44/51] Split long line. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30368 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale-example.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 5ce6e54547..9bb661e27c 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -70,7 +70,8 @@ static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, i // test by ref -> src -> dst -> out & compare out against ref // ref & out are YV12 -static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, enum PixelFormat srcFormat, enum PixelFormat dstFormat, +static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, + enum PixelFormat srcFormat, enum PixelFormat dstFormat, int srcW, int srcH, int dstW, int dstH, int flags) { uint8_t *src[4] = {0}; From 51f1113b157dc394016b73e51ba1e0c8656ee36b Mon Sep 17 00:00:00 2001 From: mru Date: Tue, 19 Jan 2010 03:47:11 +0000 Subject: [PATCH 45/51] swscale-example: use av_malloc() Image buffers require 16-byte alignment, so av_malloc() should be used. Fixes crash on PPC. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30369 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale-example.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index 9bb661e27c..a53b64b659 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -25,6 +25,7 @@ #include #undef HAVE_AV_CONFIG_H +#include "libavutil/mem.h" #include "libavutil/avutil.h" #include "libavutil/lfg.h" #include "swscale.h" @@ -101,9 +102,9 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, else dstStride[i]= dstW*4; - src[i]= malloc(srcStride[i]*srcH); - dst[i]= malloc(dstStride[i]*dstH); - out[i]= malloc(refStride[i]*h); + src[i]= av_malloc(srcStride[i]*srcH); + dst[i]= av_malloc(dstStride[i]*dstH); + out[i]= av_malloc(refStride[i]*h); if (!src[i] || !dst[i] || !out[i]) { perror("Malloc"); res = -1; @@ -173,9 +174,9 @@ end: sws_freeContext(outContext); for (i=0; i<4; i++) { - free(src[i]); - free(dst[i]); - free(out[i]); + av_free(src[i]); + av_free(dst[i]); + av_free(out[i]); } return res; @@ -216,10 +217,10 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h) int main(int argc, char **argv) { - uint8_t *rgb_data = malloc (W*H*4); + uint8_t *rgb_data = av_malloc (W*H*4); uint8_t *rgb_src[3]= {rgb_data, NULL, NULL}; int rgb_stride[3]={4*W, 0, 0}; - uint8_t *data = malloc (4*W*H); + uint8_t *data = av_malloc (4*W*H); uint8_t *src[4]= {data, data+W*H, data+W*H*2, data+W*H*3}; int stride[4]={W, W, W, W}; int x, y; @@ -240,10 +241,10 @@ int main(int argc, char **argv) } sws_scale(sws, rgb_src, rgb_stride, 0, H, src, stride); sws_freeContext(sws); - free(rgb_data); + av_free(rgb_data); selfTest(src, stride, W, H); - free(data); + av_free(data); return 0; } From 4455af672061aa8ffa7ee303ba264a0c72c3b4eb Mon Sep 17 00:00:00 2001 From: zuxy Date: Tue, 19 Jan 2010 05:21:17 +0000 Subject: [PATCH 46/51] User friendly warning message that gives out names of source and target formats git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30370 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/yuv2rgb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 8e987a61f1..3f81d0f102 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -530,7 +530,7 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) if (t) return t; - av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found.\n"); + av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found from %s to %s.\n", sws_format_name(c->srcFormat), sws_format_name(c->dstFormat)); switch (c->dstFormat) { case PIX_FMT_RGB48BE: From d4e79342c107a0a4e3f3c2069e1162276c9b6bcd Mon Sep 17 00:00:00 2001 From: ramiro Date: Tue, 19 Jan 2010 11:35:04 +0000 Subject: [PATCH 47/51] Remove useless forward declaration. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30371 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 057d7e19fb..2cffc5d4e5 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -298,8 +298,6 @@ DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL; #endif /* ARCH_X86 && CONFIG_GPL */ -static SwsVector *sws_getConvVec(SwsVector *a, SwsVector *b); - 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, }, From 37fd4d44bda2519e718d7fa3cef62a644539529d Mon Sep 17 00:00:00 2001 From: zuxy Date: Tue, 19 Jan 2010 13:35:57 +0000 Subject: [PATCH 48/51] Set HAVE_FAST_CLZ according to CPU type. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30372 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 35b8aa2b21..1feed88be4 100755 --- a/configure +++ b/configure @@ -519,6 +519,7 @@ _sse2=auto _ssse3=auto _cmov=auto _fast_cmov=auto +_fast_clz=auto _armv5te=auto _armv6=auto _armv6t2=auto @@ -1333,6 +1334,8 @@ for ac_option do --disable-cmov) _cmov=no ;; --enable-fast-cmov) _fast_cmov=yes ;; --disable-fast-cmov) _fast_cmov=no ;; + --enable-fast-clz) _fast_clz=yes ;; + --disable-fast-clz) _fast_clz=no ;; --enable-altivec) _altivec=yes ;; --disable-altivec) _altivec=no ;; --enable-armv5te) _armv5te=yes ;; @@ -1818,7 +1821,9 @@ case "$host_arch" in proc=k8 ;; - *) proc=amdfam10 iproc=686 ;; + *) proc=amdfam10 iproc=686 + test $_fast_clz = "auto" && _fast_clz=yes + ;; esac ;; GenuineIntel) @@ -1844,6 +1849,7 @@ case "$host_arch" in else proc=i686 fi + test $_fast_clz = "auto" && _fast_clz=yes ;; 15) iproc=686 # A nocona in 32-bit mode has no more capabilities than a prescott. @@ -1851,6 +1857,7 @@ case "$host_arch" in proc=prescott else proc=pentium4 + test $_fast_clz = "auto" && _fast_clz=yes fi test $_fast_cmov = "auto" && _fast_cmov=no ;; @@ -1889,6 +1896,7 @@ case "$host_arch" in *) proc=i586 iproc=586 ;; esac + test $_fast_clz = "auto" && _fast_clz=no fi # test "$_runtime_cpudetection" = no @@ -2000,6 +2008,7 @@ EOF else _fast_cmov="no" fi + test $_fast_clz = "auto" && _fast_clz=yes echores "$proc" ;; @@ -2029,7 +2038,9 @@ EOF case "$pvendor" in AuthenticAMD) case "$pfamily" in - 15) proc=k8;; + 15) proc=k8 + test $_fast_clz = "auto" && _fast_clz=no + ;; *) proc=amdfam10;; esac ;; @@ -2041,6 +2052,7 @@ EOF # have the same capabilities as a nocona. proc=nocona test $_fast_cmov = "auto" && _fast_cmov=no + test $_fast_clz = "auto" && _fast_clz=no ;; esac ;; @@ -2098,6 +2110,7 @@ EOF _optimizing="$proc" test $_fast_cmov = "auto" && _fast_cmov=yes + test $_fast_clz = "auto" && _fast_clz=yes echores "$proc" ;; @@ -2141,6 +2154,7 @@ EOF _target_arch='ARCH_AVR32 = yes' def_fast_unaligned='#define HAVE_FAST_UNALIGNED 1' iproc='avr32' + test $_fast_clz = "auto" && _fast_clz=yes ;; sh|sh4) @@ -2261,6 +2275,8 @@ EOF echores "none" fi + test $_fast_clz = "auto" && _fast_clz=yes + ;; alpha*) @@ -2301,6 +2317,8 @@ EOF _mcpu="-mcpu=$proc" echores "$proc" + test $_fast_clz = "auto" && _fast_clz=yes + _optimizing="$proc" ;; @@ -2327,6 +2345,8 @@ EOF echores "$proc" fi + test $_fast_clz = "auto" && _fast_clz=yes + ;; hppa) @@ -2761,6 +2781,8 @@ EOF fi echores "$_armv5te" + test $_armv5te = "yes" && test $_fast_clz = "auto" && _fast_clz=yes + echocheck "ARMv6 (SIMD instructions)" if test $_armv6 = "auto" ; then cat > $TMPC << EOF @@ -2812,7 +2834,7 @@ EOF echores "$_iwmmxt" fi -_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' +_cpuexts_all='ALTIVEC MMX MMX2 AMD3DNOW AMD3DNOWEXT SSE SSE2 SSSE3 FAST_CMOV CMOV FAST_CLZ PLD ARMV5TE ARMV6 ARMV6T2 ARMVFP NEON IWMMXT MMI VIS MVI' test "$_altivec" = yes && _cpuexts="ALTIVEC $_cpuexts" test "$_mmx" = yes && _cpuexts="MMX $_cpuexts" test "$_mmxext" = yes && _cpuexts="MMX2 $_cpuexts" @@ -2823,6 +2845,7 @@ test "$_sse2" = yes && _cpuexts="SSE2 $_cpuexts" test "$_ssse3" = yes && _cpuexts="SSSE3 $_cpuexts" test "$_cmov" = yes && _cpuexts="CMOV $_cpuexts" test "$_fast_cmov" = yes && _cpuexts="FAST_CMOV $_cpuexts" +test "$_fast_clz" = yes && _cpuexts="FAST_CLZ $_cpuexts" test "$pld" = yes && _cpuexts="PLD $_cpuexts" test "$_armv5te" = yes && _cpuexts="ARMV5TE $_cpuexts" test "$_armv6" = yes && _cpuexts="ARMV6 $_cpuexts" @@ -9141,7 +9164,6 @@ $def_yasm #endif #define HAVE_ATTRIBUTE_PACKED 1 -#define HAVE_FAST_CLZ 0 #define HAVE_GETHRTIME 0 #define HAVE_INLINE_ASM 1 #define HAVE_LDBRX 0 From 4277621a410c701dca7f3ba837f7a108139ba144 Mon Sep 17 00:00:00 2001 From: ramiro Date: Tue, 19 Jan 2010 15:42:51 +0000 Subject: [PATCH 49/51] swscale-example: Add comment about the use of av_{malloc,free}. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30373 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale-example.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c index a53b64b659..7c43a39467 100644 --- a/libswscale/swscale-example.c +++ b/libswscale/swscale-example.c @@ -102,6 +102,10 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, else dstStride[i]= dstW*4; + /* Image buffers passed into libswscale can be allocated any way you + * prefer, as long as they're aligned enough for the architecture, and + * they're freed appropriately (such as using av_free for buffers + * allocated with av_malloc). */ src[i]= av_malloc(srcStride[i]*srcH); dst[i]= av_malloc(dstStride[i]*dstH); out[i]= av_malloc(refStride[i]*h); From de1ca7fb29a302de8802d2706c7c6bd9f7169b1a Mon Sep 17 00:00:00 2001 From: benoit Date: Tue, 19 Jan 2010 16:30:20 +0000 Subject: [PATCH 50/51] Make const prototypes for input sources of sws_scale_* stricter. Patch by Alexis Ballier gmailify($firstname, $familyname) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30374 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 4 ++-- libswscale/swscale.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 2cffc5d4e5..1f276cbf22 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2926,7 +2926,7 @@ static void reset_ptr(const uint8_t* src[], int format) * swscale wrapper, so we don't need to export the SwsContext. * Assumes planar YUV to be in YUV order instead of YVU. */ -int sws_scale(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, +int sws_scale(SwsContext *c, const uint8_t* const src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { int i; @@ -3046,7 +3046,7 @@ int sws_scale(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSlice } #if LIBSWSCALE_VERSION_MAJOR < 1 -int sws_scale_ordered(SwsContext *c, const uint8_t* src[], int srcStride[], int srcSliceY, +int sws_scale_ordered(SwsContext *c, const uint8_t* const src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) { return sws_scale(c, src, srcStride, srcSliceY, srcSliceH, dst, dstStride); diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 878962384c..4127454945 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -184,13 +184,13 @@ struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat * the destination image * @return the height of the output slice */ -int sws_scale(struct SwsContext *context, const uint8_t* srcSlice[], int srcStride[], +int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]); #if LIBSWSCALE_VERSION_MAJOR < 1 /** * @deprecated Use sws_scale() instead. */ -int sws_scale_ordered(struct SwsContext *context, const uint8_t* src[], +int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]) attribute_deprecated; #endif From c2ba58aefce038ce4ccf6ed23791f5de823aa041 Mon Sep 17 00:00:00 2001 From: ptt Date: Tue, 19 Jan 2010 18:02:44 +0000 Subject: [PATCH 51/51] synced with r30336 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30375 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/it/mplayer.1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1 index a7eee23acc..1cf1d734fb 100644 --- a/DOCS/man/it/mplayer.1 +++ b/DOCS/man/it/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r30197 +.\" synced with r30336 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" Questa pagina di manuale è stata fatta da Gabucino, Diego Biurrun, @@ -4085,6 +4085,16 @@ Usa uno spazio colore ITU-R BT.709. .IPs 3 Usa uno spazio colore SMPTE-240M. .RE +.IPs levelconv= +Seleziona il livello di luminosità da usare per la conversione da YUV a RGB. +.RSss +.IPs 0 +Converte da livelli TV a PC (default). +.IPs 1 +Converte da livelli PC a TV. +.IPs 2 +Non effettua alcuna conversione. +.RE .IPs lscale= Seleziona la funzione di ridimensionamento da usare per il ridimensionamento della luminanza.