From 213707b9e4efb2c1c524b1541fe3e8843576438a Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 20:44:55 +0000 Subject: [PATCH 01/36] Enable running fragment programs with YUV_CONVERSION_NONE git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30069 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index f1da5cfaa7..bb79c6246d 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1408,6 +1408,8 @@ void glSetupYUVConversion(gl_conversion_params_t *params) { case YUV_CONVERSION_FRAGMENT_POW: glSetupYUVFragprog(params); break; + case YUV_CONVERSION_NONE: + break; default: mp_msg(MSGT_VO, MSGL_ERR, "[gl] unknown conversion type %i\n", YUV_CONVERSION(params->type)); } @@ -1420,7 +1422,6 @@ void glSetupYUVConversion(gl_conversion_params_t *params) { * \ingroup glconversion */ void glEnableYUVConversion(GLenum target, int type) { - if (type <= 0) return; switch (YUV_CONVERSION(type)) { case YUV_CONVERSION_COMBINERS: ActiveTexture(GL_TEXTURE1); @@ -1442,6 +1443,7 @@ void glEnableYUVConversion(GLenum target, int type) { case YUV_CONVERSION_FRAGMENT_LOOKUP: case YUV_CONVERSION_FRAGMENT_POW: case YUV_CONVERSION_FRAGMENT: + case YUV_CONVERSION_NONE: Enable(GL_FRAGMENT_PROGRAM); break; } @@ -1454,7 +1456,6 @@ void glEnableYUVConversion(GLenum target, int type) { * \ingroup glconversion */ void glDisableYUVConversion(GLenum target, int type) { - if (type <= 0) return; switch (YUV_CONVERSION(type)) { case YUV_CONVERSION_COMBINERS: ActiveTexture(GL_TEXTURE1); @@ -1476,6 +1477,7 @@ void glDisableYUVConversion(GLenum target, int type) { case YUV_CONVERSION_FRAGMENT_LOOKUP: case YUV_CONVERSION_FRAGMENT_POW: case YUV_CONVERSION_FRAGMENT: + case YUV_CONVERSION_NONE: Disable(GL_FRAGMENT_PROGRAM); break; } From 89a2a84868c32613ab81886956e15a5e23c85209 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 20:45:34 +0000 Subject: [PATCH 02/36] Fix a broken indentation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30070 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index bb79c6246d..e5f9303247 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1092,7 +1092,7 @@ static void create_conv_textures(gl_conversion_params_t *params, int *texu, char switch (conv) { case YUV_CONVERSION_FRAGMENT: case YUV_CONVERSION_FRAGMENT_POW: - break; + break; case YUV_CONVERSION_FRAGMENT_LOOKUP: texs[0] = (*texu)++; ActiveTexture(GL_TEXTURE0 + texs[0]); From 5dc258f4e8d31ba0989a811be0d82511026938d3 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 20:48:23 +0000 Subject: [PATCH 03/36] Make -vo gl:customprog also work with RGB input (obviously those need to be special RGB fragment programs). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30071 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 6ddb405f36..b85b637be1 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -90,6 +90,9 @@ static int osd_color; static int use_aspect; static int use_ycbcr; +#define MASK_ALL_YUV (~(1 << YUV_CONVERSION_NONE)) +#define MASK_NOT_COMBINERS (~((1 << YUV_CONVERSION_NONE) | (1 << YUV_CONVERSION_COMBINERS) | (1 << YUV_CONVERSION_COMBINERS_ATI))) +#define MASK_GAMMA_SUPPORT (MASK_NOT_COMBINERS & ~(1 << YUV_CONVERSION_FRAGMENT)) static int use_yuv; static int lscale; static int cscale; @@ -492,20 +495,19 @@ static int initGl(uint32_t d_width, uint32_t d_height) { ActiveTexture(GL_TEXTURE2); glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, texture_width / 2, texture_height / 2, 128); - switch (use_yuv) { - case YUV_CONVERSION_FRAGMENT_LOOKUP: - case YUV_CONVERSION_FRAGMENT_POW: - case YUV_CONVERSION_FRAGMENT: - if (!GenPrograms || !BindProgram) { - mp_msg(MSGT_VO, MSGL_ERR, "[gl] fragment program functions missing!\n"); - break; - } - GenPrograms(1, &fragprog); - BindProgram(GL_FRAGMENT_PROGRAM, fragprog); - break; - } ActiveTexture(GL_TEXTURE0); BindTexture(gl_target, 0); + } + if (image_format == IMGFMT_YV12 || custom_prog) + { + if ((MASK_NOT_COMBINERS & (1 << use_yuv)) || custom_prog) { + if (!GenPrograms || !BindProgram) { + mp_msg(MSGT_VO, MSGL_ERR, "[gl] fragment program functions missing!\n"); + } else { + GenPrograms(1, &fragprog); + BindProgram(GL_FRAGMENT_PROGRAM, fragprog); + } + } update_yuvconv(); } glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, @@ -670,14 +672,14 @@ static void do_render(void) { // BindTexture(GL_TEXTURE_2D, texture_id); Color3f(1,1,1); - if (image_format == IMGFMT_YV12) + if (image_format == IMGFMT_YV12 || custom_prog) glEnableYUVConversion(gl_target, yuvconvtype); glDrawTex(0, 0, image_width, image_height, 0, 0, image_width, image_height, texture_width, texture_height, use_rectangle == 1, image_format == IMGFMT_YV12, mpi_flipped ^ vo_flipped); - if (image_format == IMGFMT_YV12) + if (image_format == IMGFMT_YV12 || custom_prog) glDisableYUVConversion(gl_target, yuvconvtype); } @@ -1104,10 +1106,6 @@ static int preinit(const char *arg) return 0; } -#define MASK_ALL_YUV (~(1 << YUV_CONVERSION_NONE)) -#define MASK_NOT_COMBINERS (~((1 << YUV_CONVERSION_NONE) | (1 << YUV_CONVERSION_COMBINERS) | (1 << YUV_CONVERSION_COMBINERS_ATI))) -#define MASK_GAMMA_SUPPORT (MASK_NOT_COMBINERS & ~(1 << YUV_CONVERSION_FRAGMENT)) - static const struct { const char *name; int *value; From 300d40bed3c9e3b443c18c5c7ef95d067c690d2e Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 20:53:34 +0000 Subject: [PATCH 04/36] Add support for auto-generating mipmaps in vo_gl, should ease implementing anything that needs blur filters with large support. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30072 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index b85b637be1..95b182912e 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -127,6 +127,7 @@ static char *custom_prog; static char *custom_tex; static int custom_tlin; static int custom_trect; +static int mipmap_gen; static int int_pause; static int eq_bri = 0; @@ -465,6 +466,7 @@ static void autodetectGlExtensions(void) { * set global gl-related variables to their default values */ static int initGl(uint32_t d_width, uint32_t d_height) { + int scale_type = mipmap_gen ? GL_LINEAR_MIPMAP_NEAREST : GL_LINEAR; autodetectGlExtensions(); texSize(image_width, image_height, &texture_width, &texture_height); @@ -490,11 +492,15 @@ static int initGl(uint32_t d_width, uint32_t d_height) { BindTexture(GL_TEXTURE_3D, default_texs[i + 14]); } ActiveTexture(GL_TEXTURE1); - glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, + glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type, texture_width / 2, texture_height / 2, 128); + if (mipmap_gen) + TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE); ActiveTexture(GL_TEXTURE2); - glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, + glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type, texture_width / 2, texture_height / 2, 128); + if (mipmap_gen) + TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE); ActiveTexture(GL_TEXTURE0); BindTexture(gl_target, 0); } @@ -510,8 +516,10 @@ static int initGl(uint32_t d_width, uint32_t d_height) { } update_yuvconv(); } - glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, GL_LINEAR, + glCreateClearTex(gl_target, gl_texfmt, gl_format, gl_type, scale_type, texture_width, texture_height, 0); + if (mipmap_gen) + TexParameteri(gl_target, GL_GENERATE_MIPMAP, GL_TRUE); resize(d_width, d_height); @@ -996,6 +1004,7 @@ static const opt_t subopts[] = { {"customtex", OPT_ARG_MSTRZ,&custom_tex, NULL}, {"customtlin", OPT_ARG_BOOL, &custom_tlin, NULL}, {"customtrect", OPT_ARG_BOOL, &custom_trect, NULL}, + {"mipmapgen", OPT_ARG_BOOL, &mipmap_gen, NULL}, {"osdcolor", OPT_ARG_INT, &osd_color, NULL}, {NULL} }; @@ -1027,6 +1036,7 @@ static int preinit(const char *arg) custom_tex = NULL; custom_tlin = 1; custom_trect = 0; + mipmap_gen = 0; osd_color = 0xffffff; if (subopt_parse(arg, subopts) != 0) { mp_msg(MSGT_VO, MSGL_FATAL, @@ -1084,6 +1094,8 @@ static int preinit(const char *arg) " use GL_NEAREST scaling for customtex texture\n" " customtrect\n" " use texture_rectangle for customtex texture\n" + " mipmapgen\n" + " generate mipmaps for the video image (use with TXB in customprog)\n" " osdcolor=<0xAARRGGBB>\n" " use the given color for the OSD\n" " ycbcr\n" From 8b6dca72c6e0fa481bb2889ce5f765c438396549 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 20:59:58 +0000 Subject: [PATCH 05/36] Fix compilation with internal ASS when no ass header is installed system-wide. Patch by Erik Auerswald [auerswal unix-ag.uni-kl.de] git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30073 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libass/ass_mp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libass/ass_mp.h b/libass/ass_mp.h index 1c013c0db9..fb99386351 100644 --- a/libass/ass_mp.h +++ b/libass/ass_mp.h @@ -24,7 +24,7 @@ #define LIBASS_MP_H #include "subreader.h" -#ifdef CONFIG_LIBASS_INTERNAL +#ifdef CONFIG_ASS_INTERNAL #include "ass.h" #else #include From 763402d423c74007417f8e2514f8cb900cc7ddc6 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 21:07:42 +0000 Subject: [PATCH 06/36] Define GL_GENERATE_MIPMAP ourselves if necessary. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30074 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libvo/gl_common.h b/libvo/gl_common.h index 6fc68d34f5..58c4b0dcef 100644 --- a/libvo/gl_common.h +++ b/libvo/gl_common.h @@ -67,6 +67,9 @@ #ifndef GL_CLAMP_TO_EDGE #define GL_CLAMP_TO_EDGE 0x812F #endif +#ifndef GL_GENERATE_MIPMAP +#define GL_GENERATE_MIPMAP 0x8191 +#endif #ifndef GL_REGISTER_COMBINERS_NV #define GL_REGISTER_COMBINERS_NV 0x8522 #endif From 81783bceed260a17ccd353038327d168109c2a25 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 19 Dec 2009 21:08:14 +0000 Subject: [PATCH 07/36] Slightly improve vo_gl suboption documentation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30075 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/en/mplayer.1 | 13 ++++++++++--- libvo/vo_gl.c | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1 index 80f85a3069..f8bd228b8b 100644 --- a/DOCS/man/en/mplayer.1 +++ b/DOCS/man/en/mplayer.1 @@ -3839,6 +3839,9 @@ Values below 0 will leave it at the system default. This limits the framerate to (horizontal refresh rate / n). Requires GLX_SGI_swap_control support to work. With some (most/all?) implementations this only works in fullscreen mode. +.IPs ycbcr +Use the GL_MESA_ycbcr_texture extension to convert YUV to RGB. +In most cases this is probably slower than doing software conversion to RGB. .IPs yuv= Select the type of YUV to RGB conversion. .RSss @@ -3882,9 +3885,6 @@ Provides brightness, contrast, saturation, hue and gamma control. Gamma can also be set independently for red, green and blue. Speed depends more on GPU memory bandwidth than other methods. .RE -.IPs ycbcr -Use the GL_MESA_ycbcr_texture extension to convert YUV to RGB. -In most cases this is probably slower than doing software conversion to RGB. .IPs lscale= Select the scaling function to use for luminance scaling. Only valid for yuv modes 2, 3, 4 and 6. @@ -3922,6 +3922,13 @@ for customtex texture. .IPs (no)customtrect If enabled, use texture_rectangle for customtex texture. Default is disabled. +.IPs (no)mipmapgen +If enabled, mipmaps for the video are automatically generated. +This should be useful together with the customprog and the TXB +instruction to implement blur filters with a large radius. +For most OpenGL implementations this is very slow for any non-RGB +formats. +Default is disabled. .RE .sp 1 .RS diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 95b182912e..712c0439ec 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -1067,6 +1067,8 @@ static int preinit(const char *arg) " Interval in displayed frames between to buffer swaps.\n" " 1 is equivalent to enable VSYNC, 0 to disable VSYNC.\n" " Requires GLX_SGI_swap_control support to work.\n" + " ycbcr\n" + " also try to use the GL_MESA_ycbcr_texture extension\n" " yuv=\n" " 0: use software YUV to RGB conversion.\n" " 1: use register combiners (nVidia only, for older cards).\n" @@ -1098,8 +1100,6 @@ static int preinit(const char *arg) " generate mipmaps for the video image (use with TXB in customprog)\n" " osdcolor=<0xAARRGGBB>\n" " use the given color for the OSD\n" - " ycbcr\n" - " also try to use the GL_MESA_ycbcr_texture extension\n" "\n" ); return -1; } From af52185c9326a864d7b7a12005398a01d5d4e4a3 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Sun, 20 Dec 2009 13:25:08 +0000 Subject: [PATCH 08/36] VP6F has to be flipped for binary decoder. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30076 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/etc/codecs.conf b/etc/codecs.conf index 9c7751b909..2baa7311f6 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -2048,12 +2048,19 @@ videocodec vp6 info "On2 VP6 Personal Codec" status working fourcc VP60,VP61,VP62 - fourcc VP6F VP60 driver vfwex dll "vp6vfw.dll" out YUY2 out BGR32,BGR24 +videocodec vp6f + info "On2 VP6F Personal Codec" + status working + fourcc VP6F VP60 + driver vfwex + dll "vp6vfw.dll" + out YUY2,BGR32,BGR24 flip + videocodec vp7 info "On2 VP7 Personal Codec" status working From c3da36a9acd6836524f80fb8ca1851218001b7c2 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 14:14:56 +0000 Subject: [PATCH 09/36] Run vidix/pci_db2c.awk directly instead of passing it to awk. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30077 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0ff5d43ece..737403a2f0 100644 --- a/Makefile +++ b/Makefile @@ -899,7 +899,7 @@ VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_names.c \ vidix/pci_names.h vidix/pci_vendors.h $(VIDIX_PCI_FILES): vidix/pci_db2c.awk vidix/pci.db - awk -f $^ $(VIDIX_PCIDB) + $^ $(VIDIX_PCIDB) VIDIX_DEPS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.d)) VIDIX_OBJS = $(filter vidix/%,$(SRCS_MPLAYER:.c=.o)) From acd1630d1b212f7589fa67e1fc4bfc0c5053682c Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 20 Dec 2009 14:32:34 +0000 Subject: [PATCH 10/36] Change %f to %e in generated fragment programs to avoid losing precision unnecessarily. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30078 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/libvo/gl_common.c b/libvo/gl_common.c index e5f9303247..47bc727565 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -833,11 +833,11 @@ static const char *bilin_filt_template = "LRP yuv.%c, parmx.b, a.bbbb, a.aaaa;" static const char *bicub_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" + "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};" "TEX parmx, coord.x, texture[%c], 1D;" - "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" + "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};" "TEX parmy, coord.y, texture[%c], 1D;" - "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" + "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};" BICUB_FILT_MAIN("2D"); static const char *bicub_filt_template_RECT = @@ -859,12 +859,12 @@ static const char *bicub_filt_template_RECT = "SUB "t".y, "t".yyyy, "s";" static const char *bicub_notex_filt_template_2D = - "MAD coord.xy, fragment.texcoord[%c], {%f, %f}, {0.5, 0.5};" + "MAD coord.xy, fragment.texcoord[%c], {%e, %e}, {0.5, 0.5};" "FRC coord.xy, coord.xyxy;" CALCWEIGHTS("parmx", "coord.xxxx") - "MUL cdelta.xz, parmx.rrgg, {-%f, 0, %f, 0};" + "MUL cdelta.xz, parmx.rrgg, {-%e, 0, %e, 0};" CALCWEIGHTS("parmy", "coord.yyyy") - "MUL cdelta.yw, parmy.rrgg, {0, -%f, 0, %f};" + "MUL cdelta.yw, parmy.rrgg, {0, -%e, 0, %e};" BICUB_FILT_MAIN("2D"); static const char *bicub_notex_filt_template_RECT = @@ -885,9 +885,9 @@ static const char *bicub_notex_filt_template_RECT = "LRP yuv.%c, parmx.b, a.rrrr, b.rrrr;" static const char *bicub_x_filt_template_2D = - "MAD coord.x, fragment.texcoord[%c], {%f}, {0.5};" + "MAD coord.x, fragment.texcoord[%c], {%e}, {0.5};" "TEX parmx, coord, texture[%c], 1D;" - "MUL cdelta.xyz, parmx.rrgg, {-%f, 0, %f};" + "MUL cdelta.xyz, parmx.rrgg, {-%e, 0, %e};" BICUB_X_FILT_MAIN("2D"); static const char *bicub_x_filt_template_RECT = @@ -897,7 +897,7 @@ static const char *bicub_x_filt_template_RECT = BICUB_X_FILT_MAIN("RECT"); static const char *unsharp_filt_template = - "PARAM dcoord%c = {%f, %f, %f, %f};" + "PARAM dcoord%c = {%e, %e, %e, %e};" "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" @@ -908,11 +908,11 @@ static const char *unsharp_filt_template = "TEX b.g, coord2.zwzw, texture[%c], %s;" "DP3 b, b, {0.25, 0.25, 0.25};" "SUB b.r, a.r, b.r;" - "MAD yuv.%c, b.r, {%f}, a.r;"; + "MAD yuv.%c, b.r, {%e}, a.r;"; static const char *unsharp_filt_template2 = - "PARAM dcoord%c = {%f, %f, %f, %f};" - "PARAM dcoord2%c = {%f, 0, 0, %f};" + "PARAM dcoord%c = {%e, %e, %e, %e};" + "PARAM dcoord2%c = {%e, 0, 0, %e};" "ADD coord, fragment.texcoord[%c].xyxy, dcoord%c;" "SUB coord2, fragment.texcoord[%c].xyxy, dcoord%c;" "TEX a.r, fragment.texcoord[%c], texture[%c], %s;" @@ -932,13 +932,13 @@ static const char *unsharp_filt_template2 = "TEX b.g, coord2.zwzw, texture[%c], %s;" "DP4 b.r, b, {-0.1171875, -0.1171875, -0.1171875, -0.09765625};" "MAD b.r, a.r, {0.859375}, b.r;" - "MAD yuv.%c, b.r, {%f}, a.r;"; + "MAD yuv.%c, b.r, {%e}, a.r;"; static const char *yuv_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f};" - "PARAM ucoef = {%.4f, %.4f, %.4f};" - "PARAM vcoef = {%.4f, %.4f, %.4f};" - "PARAM offsets = {%.4f, %.4f, %.4f};" + "PARAM ycoef = {%e, %e, %e};" + "PARAM ucoef = {%e, %e, %e};" + "PARAM vcoef = {%e, %e, %e};" + "PARAM offsets = {%e, %e, %e};" "TEMP res;" "MAD res.rgb, yuv.rrrr, ycoef, offsets;" "MAD res.rgb, yuv.gggg, ucoef, res;" @@ -946,11 +946,11 @@ static const char *yuv_prog_template = "END"; static const char *yuv_pow_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f};" - "PARAM ucoef = {%.4f, %.4f, %.4f};" - "PARAM vcoef = {%.4f, %.4f, %.4f};" - "PARAM offsets = {%.4f, %.4f, %.4f};" - "PARAM gamma = {%.4f, %.4f, %.4f};" + "PARAM ycoef = {%e, %e, %e};" + "PARAM ucoef = {%e, %e, %e};" + "PARAM vcoef = {%e, %e, %e};" + "PARAM offsets = {%e, %e, %e};" + "PARAM gamma = {%e, %e, %e};" "TEMP res;" "MAD res.rgb, yuv.rrrr, ycoef, offsets;" "MAD res.rgb, yuv.gggg, ucoef, res;" @@ -961,10 +961,10 @@ static const char *yuv_pow_prog_template = "END"; static const char *yuv_lookup_prog_template = - "PARAM ycoef = {%.4f, %.4f, %.4f, 0};" - "PARAM ucoef = {%.4f, %.4f, %.4f, 0};" - "PARAM vcoef = {%.4f, %.4f, %.4f, 0};" - "PARAM offsets = {%.4f, %.4f, %.4f, 0.125};" + "PARAM ycoef = {%e, %e, %e, 0};" + "PARAM ucoef = {%e, %e, %e, 0};" + "PARAM vcoef = {%e, %e, %e, 0};" + "PARAM offsets = {%e, %e, %e, 0.125};" "TEMP res;" "MAD res, yuv.rrrr, ycoef, offsets;" "MAD res.rgb, yuv.gggg, ucoef, res;" From cccb6f6d7eed61be3e86c5f81cdc630453f92d30 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 14:43:50 +0000 Subject: [PATCH 11/36] cosmetics: Use a consistent formattting style; tabs to spaces. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30079 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 399 ++++++++++++++++++++++----------------------- 1 file changed, 196 insertions(+), 203 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 039bf0f55a..7e95b06746 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -25,266 +25,259 @@ BEGIN { - if(ARGC != 3) { -# check for arguments: - print "Usage ./pci_db2c.awk pci.db (and make sure pci.db file exists first)"; - exit(1); + if (ARGC != 3) { + # check for arguments: + print "Usage ./pci_db2c.awk pci.db (and make sure pci.db file exists first)"; + exit(1); } in_file = ARGV[1]; with_pci_db = ARGV[2]; - vendor_file = "vidix/pci_vendors.h"; - ids_file = "vidix/pci_ids.h" - name_file = "vidix/pci_names.c" - name_h_file = "vidix/pci_names.h" + vendor_file = "vidix/pci_vendors.h"; + ids_file = "vidix/pci_ids.h" + name_file = "vidix/pci_names.c" + name_h_file = "vidix/pci_names.h" dev_ids_file = "vidix/pci_dev_ids.c" - line=0; -# print out head lines + line = 0; + # print out head lines print_head(vendor_file); print_head(ids_file); print_head(name_file); print_head(name_h_file); print_head(dev_ids_file); print_includes(dev_ids_file); - print "#ifndef MPLAYER_PCI_VENDORS_H" >vendor_file - print "#define MPLAYER_PCI_VENDORS_H">vendor_file - print "" >vendor_file - print "#ifndef MPLAYER_PCI_IDS_H" >ids_file - print "#define MPLAYER_PCI_IDS_H">ids_file - print "" >ids_file - print "#include \"pci_vendors.h\"">ids_file - print "" >ids_file + print "#ifndef MPLAYER_PCI_VENDORS_H" > vendor_file + print "#define MPLAYER_PCI_VENDORS_H" > vendor_file + print "" > vendor_file + print "#ifndef MPLAYER_PCI_IDS_H" > ids_file + print "#define MPLAYER_PCI_IDS_H" > ids_file + print "" > ids_file + print "#include \"pci_vendors.h\"" > ids_file + print "" > ids_file - print "#ifndef MPLAYER_PCI_NAMES_H" >name_h_file - print "#define MPLAYER_PCI_NAMES_H">name_h_file - print "" >name_h_file + print "#ifndef MPLAYER_PCI_NAMES_H" > name_h_file + print "#define MPLAYER_PCI_NAMES_H" > name_h_file + print "" > name_h_file print_name_struct(name_h_file); - print "#include ">name_file - print "#include \"pci_names.h\"">name_file + print "#include " > name_file + print "#include \"pci_names.h\"" > name_file if (with_pci_db) { - print "#include \"pci_dev_ids.c\"">name_file - print "">name_file - print "static struct vendor_id_s vendor_ids[] = {">name_file + print "#include \"pci_dev_ids.c\"" > name_file + print "" > name_file + print "static struct vendor_id_s vendor_ids[] = {" > name_file } - first_pass=1; + first_pass = 1; init_name_db(); - while(getline 0 && field[4] == "0") - { - init_device_db() - svend_name = get_short_vendor_name(field[3]) - printf("#define VENDOR_%s\t", svend_name) >vendor_file; - if(length(svend_name) < 9) printf("\t") >vendor_file; - printf("0x%s /*%s*/\n",field[2], name_field) >vendor_file; - if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n",field[2], name_field, field[2]) >name_file; - printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file - if(first_pass == 1) { first_pass=0; } - else { print "{ 0xFFFF, NULL }\n};" >dev_ids_file; } - printf("static const struct device_id_s dev_lst_%s[]={\n", field[2])>dev_ids_file - } - if(field[1] == "d" && length(field[3])>0 && field[4] == "0") - { - sdev_name = get_short_device_name(field[3]) - full_name = sprintf("#define DEVICE_%s_%s", svend_name, sdev_name); - printf("%s\t", full_name) >ids_file - if(length(full_name) < 9) printf("\t") >ids_file; - if(length(full_name) < 17) printf("\t") >ids_file; - if(length(full_name) < 25) printf("\t") >ids_file; - if(length(full_name) < 32) printf("\t") >ids_file; - if(length(full_name) < 40) printf("\t") >ids_file; - if(length(full_name) < 48) printf("\t") >ids_file; - printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) >ids_file - printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) >dev_ids_file - } - if(field[1] == "s" && length(field[3])>0 && field[4] == "0") - { - subdev_name = get_short_subdevice_name(field[3]) - full_name = sprintf("#define SUBDEVICE_%s_%s", svend_name, subdev_name) - printf("\t%s\t", full_name) >ids_file - if(length(full_name) < 9) printf("\t") >ids_file; - if(length(full_name) < 17) printf("\t") >ids_file; - if(length(full_name) < 25) printf("\t") >ids_file; - if(length(full_name) < 32) printf("\t") >ids_file; - if(length(full_name) < 40) printf("\t") >ids_file; - printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) >ids_file - } + while (getline < in_file) { + # count up lines + line++; + n = split($0, field, "[\t]"); + name_field = kill_double_quoting(field[3]) + if (field[1] == "v" && length(field[3]) > 0 && field[4] == "0") { + init_device_db() + svend_name = get_short_vendor_name(field[3]) + printf("#define VENDOR_%s\t", svend_name) > vendor_file; + if (length(svend_name) < 9) printf("\t") > vendor_file; + printf("0x%s /*%s*/\n", field[2], name_field) > vendor_file; + if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n", field[2], name_field, field[2]) > name_file; + printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file + if (first_pass == 1) first_pass = 0; + else print "{ 0xFFFF, NULL }\n};" > dev_ids_file; + printf("static const struct device_id_s dev_lst_%s[] = {\n", field[2])> dev_ids_file + } + if (field[1] == "d" && length(field[3]) > 0 && field[4] == "0") { + sdev_name = get_short_device_name(field[3]) + full_name = sprintf("#define DEVICE_%s_%s", svend_name, sdev_name); + printf("%s\t", full_name) > ids_file + if (length(full_name) < 9) printf("\t") > ids_file; + if (length(full_name) < 17) printf("\t") > ids_file; + if (length(full_name) < 25) printf("\t") > ids_file; + if (length(full_name) < 32) printf("\t") > ids_file; + if (length(full_name) < 40) printf("\t") > ids_file; + if (length(full_name) < 48) printf("\t") > ids_file; + printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) > ids_file + printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) > dev_ids_file + } + if (field[1] == "s" && length(field[3]) > 0 && field[4] == "0") { + subdev_name = get_short_subdevice_name(field[3]) + full_name = sprintf("#define SUBDEVICE_%s_%s", svend_name, subdev_name) + printf("\t%s\t", full_name) > ids_file + if (length(full_name) < 9) printf("\t") > ids_file; + if (length(full_name) < 17) printf("\t") > ids_file; + if (length(full_name) < 25) printf("\t") > ids_file; + if (length(full_name) < 32) printf("\t") > ids_file; + if (length(full_name) < 40) printf("\t") > ids_file; + printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) > ids_file + } } #print "Total lines parsed:", line; - print "">vendor_file - print "#endif /* MPLAYER_PCI_VENDORS_H */">vendor_file - print "">ids_file - print "#endif /* MPLAYER_PCI_IDS_H */">ids_file - print "">name_h_file - print "#endif /* MPLAYER_PCI_NAMES_H */">name_h_file - if (with_pci_db) print "};">name_file - print "{ 0xFFFF, NULL }" >dev_ids_file; - print "};">dev_ids_file + print "" > vendor_file + print "#endif /* MPLAYER_PCI_VENDORS_H */" > vendor_file + print "" > ids_file + print "#endif /* MPLAYER_PCI_IDS_H */" > ids_file + print "" > name_h_file + print "#endif /* MPLAYER_PCI_NAMES_H */" > name_h_file + if (with_pci_db) print "};" > name_file + print "{ 0xFFFF, NULL }" > dev_ids_file; + print "};" > dev_ids_file print_func_bodies(name_file); } function print_includes(out_file) { - print "#include " >out_file; - print "#include \"pci_names.h\"" >out_file; + print "#include " > out_file; + print "#include \"pci_names.h\"" > out_file; return; } -function print_head( out_file) +function print_head(out_file) { - print "/*" >out_file; - printf(" * File: %s\n", out_file) >out_file; - printf(" * This file was generated automatically. Don't modify it.\n") >out_file; - print "*/" >out_file; + print "/*" > out_file; + printf(" * File: %s\n", out_file) > out_file; + printf(" * This file was generated automatically. Don't modify it.\n") > out_file; + print "*/" > out_file; return; } function print_name_struct(out_file) { - print "">out_file - print "struct device_id_s" >out_file - print "{" >out_file - print "\tunsigned short\tid;" >out_file - print "\tconst char *\tname;" >out_file - print "};" >out_file - print "">out_file - print "struct vendor_id_s" >out_file - print "{" >out_file - print "\tunsigned short\tid;" >out_file - print "\tconst char *\tname;" >out_file - print "\tconst struct device_id_s *\tdev_list;" >out_file - print "};" >out_file - print "const char *pci_vendor_name(unsigned short id);">out_file - print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);">out_file - print "">out_file - return + print "" > out_file + print "struct device_id_s" > out_file + print "{" > out_file + print "\tunsigned short\tid;" > out_file + print "\tconst char *\tname;" > out_file + print "};" > out_file + print "" > out_file + print "struct vendor_id_s" > out_file + print "{" > out_file + print "\tunsigned short\tid;" > out_file + print "\tconst char *\tname;" > out_file + print "\tconst struct device_id_s *\tdev_list;" > out_file + print "};" > out_file + print "const char *pci_vendor_name(unsigned short id);" > out_file + print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);" > out_file + print "" > out_file + return } function print_func_bodies(out_file) { - print "">out_file - print "const char *pci_vendor_name(unsigned short id)" >out_file - print "{" >out_file - if (with_pci_db) { - print " unsigned i;" >out_file - print " for(i=0;iout_file - print " {" >out_file - print "\tif(vendor_ids[i].id == id) return vendor_ids[i].name;" >out_file - print " }" >out_file - } - print " return NULL;" >out_file - print "}">out_file - print "" >out_file - print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" >out_file - print "{" >out_file - if (with_pci_db) { - print " unsigned i, j;" >out_file - print " for(i=0;iout_file - print " {" >out_file - print "\tif(vendor_ids[i].id == vendor_id)" >out_file - print "\t{" >out_file - print "\t j=0;" >out_file - print "\t while(vendor_ids[i].dev_list[j].id != 0xFFFF)" >out_file - print "\t {">out_file - print "\t\tif(vendor_ids[i].dev_list[j].id == device_id) return vendor_ids[i].dev_list[j].name;">out_file - print "\t\tj++;">out_file - print "\t };">out_file - print "\t break;" >out_file - print "\t}" >out_file - print " }" >out_file - } - print " return NULL;">out_file - print "}">out_file - return + print "" > out_file + print "const char *pci_vendor_name(unsigned short id)" > out_file + print "{" > out_file + if (with_pci_db) { + print " unsigned i;" > out_file + print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++)" > out_file + print " {" > out_file + print "\tif (vendor_ids[i].id == id) return vendor_ids[i].name;" > out_file + print " }" > out_file + } + print " return NULL;" > out_file + print "}" > out_file + print "" > out_file + print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" > out_file + print "{" > out_file + if (with_pci_db) { + print " unsigned i, j;" > out_file + print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++)" > out_file + print " {" > out_file + print "\tif (vendor_ids[i].id == vendor_id)" > out_file + print "\t{" > out_file + print "\t j = 0;" > out_file + print "\t while (vendor_ids[i].dev_list[j].id != 0xFFFF)" > out_file + print "\t {" > out_file + print "\t\tif (vendor_ids[i].dev_list[j].id == device_id) return vendor_ids[i].dev_list[j].name;" > out_file + print "\t\tj++;" > out_file + print "\t };" > out_file + print "\t break;" > out_file + print "\t}" > out_file + print " }" > out_file + } + print " return NULL;" > out_file + print "}" > out_file + return } function kill_double_quoting(fld) { - n=split(fld,phrases, "[\"]"); - new_fld = phrases[1] - for(i=2;i<=n;i++) new_fld = sprintf("%s\\\"%s", new_fld, phrases[i]) - return new_fld + n = split(fld, phrases, "[\"]"); + new_fld = phrases[1] + for (i = 2; i <= n; i++) new_fld = sprintf("%s\\\"%s", new_fld, phrases[i]) + return new_fld } function init_name_db() { - vendor_names[1]="" + vendor_names[1] = "" } function init_device_db() { -# delete device_names - for( i in device_names ) delete device_names[i]; - device_names[1]="" -# delete subdevice_names - for( i in subdevice_names ) delete subdevice_names[i]; - subdevice_names[1] = "" + # delete device_names + for (i in device_names) delete device_names[i]; + device_names[1] = "" + # delete subdevice_names + for (i in subdevice_names) delete subdevice_names[i]; + subdevice_names[1] = "" } function get_short_vendor_name(from) { - n=split(from, name, "[ ]"); - new_name = toupper(name[1]); - if(length(new_name)<3) new_name = sprintf("%s_%s", new_name, toupper(name[2])); - n=split(new_name, name, "[^0-9A-Za-z]"); - svendor = name[1]; - for(i=2;i<=n;i++) svendor=sprintf("%s%s%s", svendor, length(name[i])?"_":"", name[i]); - new_name = svendor; - vend_suffix = 2; -# check for unique - while(new_name in vendor_names) - { - new_name = sprintf("%s%u", svendor, vend_suffix) - vend_suffix = vend_suffix + 1; - } -# Add new name in array of vendor's names - vendor_names[new_name] = new_name - return new_name; + n = split(from, name, "[ ]"); + new_name = toupper(name[1]); + if (length(new_name) < 3) new_name = sprintf("%s_%s", new_name, toupper(name[2])); + n = split(new_name, name, "[^0-9A-Za-z]"); + svendor = name[1]; + for (i = 2; i <= n; i++) svendor = sprintf("%s%s%s", svendor, length(name[i]) ? "_" : "", name[i]); + new_name = svendor; + vend_suffix = 2; + # check for unique + while (new_name in vendor_names) { + new_name = sprintf("%s%u", svendor, vend_suffix) + vend_suffix = vend_suffix + 1; + } + # Add new name in array of vendor's names + vendor_names[new_name] = new_name + return new_name; } function get_short_device_name(from_name) { - n=split(from_name, name, "[ ]"); - new_name = toupper(name[1]); - if(length(name[2])) new_name = sprintf("%s_%s", new_name, toupper(name[2])); - if(length(name[3])) new_name = sprintf("%s_%s", new_name, toupper(name[3])); - n=split(new_name, name, "[^0-9A-Za-z]"); - sdevice = name[1]; - for(i=2;i<=n;i++) sdevice=sprintf("%s%s%s", sdevice, length(name[i])?"_":"", name[i]); - new_name = sdevice; - dev_suffix = 2; -# check for unique - while(new_name in device_names) - { - new_name = sprintf("%s%u", sdevice, dev_suffix) - dev_suffix = dev_suffix + 1; - } -# Add new name in array of device names - device_names[new_name] = new_name - return new_name; + n = split(from_name, name, "[ ]"); + new_name = toupper(name[1]); + if (length(name[2])) new_name = sprintf("%s_%s", new_name, toupper(name[2])); + if (length(name[3])) new_name = sprintf("%s_%s", new_name, toupper(name[3])); + n = split(new_name, name, "[^0-9A-Za-z]"); + sdevice = name[1]; + for (i = 2; i <= n; i++) sdevice = sprintf("%s%s%s", sdevice, length(name[i]) ? "_" : "", name[i]); + new_name = sdevice; + dev_suffix = 2; + # check for unique + while (new_name in device_names) { + new_name = sprintf("%s%u", sdevice, dev_suffix) + dev_suffix = dev_suffix + 1; + } + # Add new name in array of device names + device_names[new_name] = new_name + return new_name; } function get_short_subdevice_name(from_name) { - n=split(from_name, name, "[ ]"); - new_name = toupper(name[1]); - if(length(name[2])) new_name = sprintf("%s_%s", new_name, toupper(name[2])); - if(length(name[3])) new_name = sprintf("%s_%s", new_name, toupper(name[3])); - n=split(new_name, name, "[^0-9A-Za-z]"); - ssdevice = name[1]; - for(i=2;i<=n;i++) ssdevice=sprintf("%s%s%s", ssdevice, length(name[i])?"_":"", name[i]); - new_name = ssdevice; - sdev_suffix = 2; -# check for unique - while(new_name in subdevice_names) - { - new_name = sprintf("%s%u", ssdevice, sdev_suffix) - sdev_suffix = sdev_suffix + 1; - } -# Add new name in array of subdevice names - subdevice_names[new_name] = new_name - return new_name; + n = split(from_name, name, "[ ]"); + new_name = toupper(name[1]); + if (length(name[2])) new_name = sprintf("%s_%s", new_name, toupper(name[2])); + if (length(name[3])) new_name = sprintf("%s_%s", new_name, toupper(name[3])); + n = split(new_name, name, "[^0-9A-Za-z]"); + ssdevice = name[1]; + for (i = 2; i <= n; i++) ssdevice = sprintf("%s%s%s", ssdevice, length(name[i]) ? "_" : "", name[i]); + new_name = ssdevice; + sdev_suffix = 2; + # check for unique + while (new_name in subdevice_names) { + new_name = sprintf("%s%u", ssdevice, sdev_suffix) + sdev_suffix = sdev_suffix + 1; + } + # Add new name in array of subdevice names + subdevice_names[new_name] = new_name + return new_name; } From 884849df53cecf93115d094b95aa01fc2b76b558 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 15:16:34 +0000 Subject: [PATCH 12/36] cosmetics: Use more consistent formatting style for generated files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30080 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 65 +++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 7e95b06746..ccab1c6708 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -131,31 +131,26 @@ function print_includes(out_file) function print_head(out_file) { - print "/*" > out_file; - printf(" * File: %s\n", out_file) > out_file; - printf(" * This file was generated automatically. Don't modify it.\n") > out_file; - print "*/" > out_file; + printf("/* File: %s\n", out_file) > out_file; + printf(" * This file was generated automatically. Don't modify it. */\n") > out_file; + print "" > out_file return; } function print_name_struct(out_file) { - print "" > out_file - print "struct device_id_s" > out_file - print "{" > out_file - print "\tunsigned short\tid;" > out_file - print "\tconst char *\tname;" > out_file + print "struct device_id_s {" > out_file + print " unsigned short id;" > out_file + print " const char *name;" > out_file print "};" > out_file print "" > out_file - print "struct vendor_id_s" > out_file - print "{" > out_file - print "\tunsigned short\tid;" > out_file - print "\tconst char *\tname;" > out_file - print "\tconst struct device_id_s *\tdev_list;" > out_file + print "struct vendor_id_s {" > out_file + print " unsigned short id;" > out_file + print " const char *name;" > out_file + print " const struct device_id_s *dev_list;" > out_file print "};" > out_file print "const char *pci_vendor_name(unsigned short id);" > out_file print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);" > out_file - print "" > out_file return } @@ -165,34 +160,32 @@ function print_func_bodies(out_file) print "const char *pci_vendor_name(unsigned short id)" > out_file print "{" > out_file if (with_pci_db) { - print " unsigned i;" > out_file - print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++)" > out_file - print " {" > out_file - print "\tif (vendor_ids[i].id == id) return vendor_ids[i].name;" > out_file - print " }" > out_file + print " unsigned i;" > out_file + print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {" > out_file + print " if (vendor_ids[i].id == id)" > out_file + print " return vendor_ids[i].name;" > out_file + print " }" > out_file } - print " return NULL;" > out_file + print " return NULL;" > out_file print "}" > out_file print "" > out_file print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" > out_file print "{" > out_file if (with_pci_db) { - print " unsigned i, j;" > out_file - print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++)" > out_file - print " {" > out_file - print "\tif (vendor_ids[i].id == vendor_id)" > out_file - print "\t{" > out_file - print "\t j = 0;" > out_file - print "\t while (vendor_ids[i].dev_list[j].id != 0xFFFF)" > out_file - print "\t {" > out_file - print "\t\tif (vendor_ids[i].dev_list[j].id == device_id) return vendor_ids[i].dev_list[j].name;" > out_file - print "\t\tj++;" > out_file - print "\t };" > out_file - print "\t break;" > out_file - print "\t}" > out_file - print " }" > out_file + print " unsigned i, j;" > out_file + print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {" > out_file + print " if (vendor_ids[i].id == vendor_id) {" > out_file + print " j = 0;" > out_file + print " while (vendor_ids[i].dev_list[j].id != 0xFFFF) {" > out_file + print " if (vendor_ids[i].dev_list[j].id == device_id)" > out_file + print " return vendor_ids[i].dev_list[j].name;" > out_file + print " j++;" > out_file + print " };" > out_file + print " break;" > out_file + print " }" > out_file + print " }" > out_file } - print " return NULL;" > out_file + print " return NULL;" > out_file print "}" > out_file return } From 08f9e35211ec53e2ff44844e2a84459079e88779 Mon Sep 17 00:00:00 2001 From: ramiro Date: Sun, 20 Dec 2009 16:21:25 +0000 Subject: [PATCH 13/36] Set horizontal scaler's src offsets in context in sws_init_swScale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30081 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 4 ++++ libswscale/swscale_template.c | 39 ++++++++++++++++++----------------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index ec696e932d..9a125f72c2 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -273,6 +273,10 @@ typedef struct SwsContext { int xInc, const int16_t *filter, const int16_t *filterPos, long filterSize); + int lumSrcOffset; ///< Offset given to luma src pointers passed to horizontal input functions. + int chrSrcOffset; ///< Offset given to chroma src pointers passed to horizontal input functions. + int alpSrcOffset; ///< Offset given to alpha src pointers passed to horizontal input functions. + } SwsContext; //FIXME check init (where 0) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 675db6aa3f..0a024372af 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2254,16 +2254,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, void av_unused *mmx2FilterCode= c->lumMmx2FilterCode; void (*internal_func)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->hascale_internal : c->hyscale_internal; - if (isAlpha) { - if (srcFormat == PIX_FMT_RGB32 || srcFormat == PIX_FMT_BGR32 ) - src += 3; - } else { - if (srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1) - src += ALT32_CORR; - } - - if (srcFormat == PIX_FMT_RGB48LE) - src++; + src += isAlpha ? c->alpSrcOffset : c->lumSrcOffset; if (internal_func) { internal_func(formatConvBuffer, src, srcW, pal); @@ -2433,15 +2424,8 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, if (isGray(srcFormat) || srcFormat==PIX_FMT_MONOBLACK || srcFormat==PIX_FMT_MONOWHITE) return; - if (srcFormat==PIX_FMT_RGB32_1 || srcFormat==PIX_FMT_BGR32_1) { - src1 += ALT32_CORR; - src2 += ALT32_CORR; - } - - if (srcFormat==PIX_FMT_RGB48LE) { - src1++; - src2++; - } + src1 += c->chrSrcOffset; + src2 += c->chrSrcOffset; if (c->hcscale_internal) { c->hcscale_internal(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal); @@ -3049,4 +3033,21 @@ static void RENAME(sws_init_swScale)(SwsContext *c) case PIX_FMT_BGR32_1: c->hascale_internal = abgrToA; break; } } + + switch (srcFormat) { + case PIX_FMT_RGB32 : + case PIX_FMT_BGR32 : + c->alpSrcOffset = 3; + break; + case PIX_FMT_RGB32_1: + case PIX_FMT_BGR32_1: + c->lumSrcOffset = ALT32_CORR; + c->chrSrcOffset = ALT32_CORR; + break; + case PIX_FMT_RGB48LE: + c->lumSrcOffset = 1; + c->chrSrcOffset = 1; + c->alpSrcOffset = 1; + break; + } } From 2d4a819ef505973aa2ad58b37af65c7b11e7e6ae Mon Sep 17 00:00:00 2001 From: ramiro Date: Sun, 20 Dec 2009 16:32:58 +0000 Subject: [PATCH 14/36] Set horizontal scaler's range conversion in context in sws_init_swScale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30082 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 3 ++ libswscale/swscale_template.c | 75 ++++++++++++++++++++++------------- 2 files changed, 50 insertions(+), 28 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 9a125f72c2..af6dc1ef2e 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -273,6 +273,9 @@ typedef struct SwsContext { int xInc, const int16_t *filter, const int16_t *filterPos, long filterSize); + void (*lumConvertRange)(uint16_t *dst, int width); ///< Color range conversion function for luma plane if needed. + void (*chrConvertRange)(uint16_t *dst, int width); ///< Color range conversion function for chroma planes if needed. + int lumSrcOffset; ///< Offset given to luma src pointers passed to horizontal input functions. int chrSrcOffset; ///< Offset given to chroma src pointers passed to horizontal input functions. int alpSrcOffset; ///< Offset given to alpha src pointers passed to horizontal input functions. diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 0a024372af..bf944ee6bc 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2219,6 +2219,37 @@ static inline void RENAME(hScale)(int16_t *dst, int dstW, const uint8_t *src, in #endif /* COMPILE_MMX */ } +//FIXME all pal and rgb srcFormats could do this convertion as well +//FIXME all scalers more complex than bilinear could do half of this transform +static void RENAME(chrRangeToJpeg)(uint16_t *dst, int width) +{ + int i; + for (i = 0; i < width; i++) { + dst[i ] = (FFMIN(dst[i ],30775)*4663 - 9289992)>>12; //-264 + dst[i+VOFW] = (FFMIN(dst[i+VOFW],30775)*4663 - 9289992)>>12; //-264 + } +} +static void RENAME(chrRangeFromJpeg)(uint16_t *dst, int width) +{ + int i; + for (i = 0; i < width; i++) { + dst[i ] = (dst[i ]*1799 + 4081085)>>11; //1469 + dst[i+VOFW] = (dst[i+VOFW]*1799 + 4081085)>>11; //1469 + } +} +static void RENAME(lumRangeToJpeg)(uint16_t *dst, int width) +{ + int i; + for (i = 0; i < width; i++) + dst[i] = (FFMIN(dst[i],30189)*19077 - 39057361)>>14; +} +static void RENAME(lumRangeFromJpeg)(uint16_t *dst, int width) +{ + int i; + for (i = 0; i < width; i++) + dst[i] = (dst[i]*14071 + 33561947)>>14; +} + #define FAST_BILINEAR_X86 \ "subl %%edi, %%esi \n\t" /* src[xx+1] - src[xx] */ \ "imull %%ecx, %%esi \n\t" /* (src[xx+1] - src[xx])*xalpha */ \ @@ -2253,6 +2284,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, int av_unused canMMX2BeUsed = c->canMMX2BeUsed; void av_unused *mmx2FilterCode= c->lumMmx2FilterCode; void (*internal_func)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->hascale_internal : c->hyscale_internal; + void (*convertRange)(uint16_t *, int) = isAlpha ? NULL : c->lumConvertRange; src += isAlpha ? c->alpSrcOffset : c->lumSrcOffset; @@ -2377,18 +2409,8 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, #endif /* ARCH_X86 */ } - if(!isAlpha && c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))) { - int i; - //FIXME all pal and rgb srcFormats could do this convertion as well - //FIXME all scalers more complex than bilinear could do half of this transform - if(c->srcRange) { - for (i=0; i>14; - } else { - for (i=0; i>14; - } - } + if (convertRange) + convertRange(dst, dstWidth); } static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst, @@ -2543,22 +2565,9 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, c->hcscale_fast(c, dst, dstWidth, src1, src2, srcW, xInc); #endif /* ARCH_X86 */ } - if(c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))) { - int i; - //FIXME all pal and rgb srcFormats could do this convertion as well - //FIXME all scalers more complex than bilinear could do half of this transform - if(c->srcRange) { - for (i=0; i>11; //1469 - dst[i+VOFW]= (dst[i+VOFW]*1799 + 4081085)>>11; //1469 - } - } else { - for (i=0; i>12; //-264 - dst[i+VOFW]= (FFMIN(dst[i+VOFW],30775)*4663 - 9289992)>>12; //-264 - } - } - } + + if (c->chrConvertRange) + c->chrConvertRange(dst, dstWidth); } #define DEBUG_SWSCALE_BUFFERS 0 @@ -3050,4 +3059,14 @@ static void RENAME(sws_init_swScale)(SwsContext *c) c->alpSrcOffset = 1; break; } + + if (c->srcRange != c->dstRange && !(isRGB(c->dstFormat) || isBGR(c->dstFormat))) { + if (c->srcRange) { + c->lumConvertRange = RENAME(lumRangeFromJpeg); + c->chrConvertRange = RENAME(chrRangeFromJpeg); + } else { + c->lumConvertRange = RENAME(lumRangeToJpeg); + c->chrConvertRange = RENAME(chrRangeToJpeg); + } + } } From 7046f2cd1666418771f2af8693a4b2952379cf0e Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 17:01:47 +0000 Subject: [PATCH 15/36] Move code to write multiple inclusion guards to generated files into functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30083 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index ccab1c6708..0ca5f32cfd 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -45,18 +45,12 @@ BEGIN { print_head(name_h_file); print_head(dev_ids_file); print_includes(dev_ids_file); - print "#ifndef MPLAYER_PCI_VENDORS_H" > vendor_file - print "#define MPLAYER_PCI_VENDORS_H" > vendor_file - print "" > vendor_file - print "#ifndef MPLAYER_PCI_IDS_H" > ids_file - print "#define MPLAYER_PCI_IDS_H" > ids_file - print "" > ids_file + print_guards_start(vendor_file); + print_guards_start(name_h_file); + print_guards_start(ids_file); print "#include \"pci_vendors.h\"" > ids_file print "" > ids_file - print "#ifndef MPLAYER_PCI_NAMES_H" > name_h_file - print "#define MPLAYER_PCI_NAMES_H" > name_h_file - print "" > name_h_file print_name_struct(name_h_file); print "#include " > name_file print "#include \"pci_names.h\"" > name_file @@ -110,18 +104,37 @@ BEGIN { } } #print "Total lines parsed:", line; - print "" > vendor_file - print "#endif /* MPLAYER_PCI_VENDORS_H */" > vendor_file - print "" > ids_file - print "#endif /* MPLAYER_PCI_IDS_H */" > ids_file - print "" > name_h_file - print "#endif /* MPLAYER_PCI_NAMES_H */" > name_h_file + print_guards_end(vendor_file); + print_guards_end(name_h_file); + print_guards_end(ids_file); if (with_pci_db) print "};" > name_file print "{ 0xFFFF, NULL }" > dev_ids_file; print "};" > dev_ids_file print_func_bodies(name_file); } +function construct_guard_name(out_file) +{ + split(out_file, path_components, "/"); + sub(".h","_h", path_components[2]); + return "MPLAYER_" toupper(path_components[2]); +} + +function print_guards_start(out_file) +{ + guard_name = construct_guard_name(out_file); + printf("#ifndef %s\n", guard_name) > out_file + printf("#define %s\n", guard_name) > out_file + print "" > out_file +} + +function print_guards_end(out_file) +{ + guard_name = construct_guard_name(out_file); + print "" > out_file + printf("#endif /* %s */\n", guard_name) > out_file +} + function print_includes(out_file) { print "#include " > out_file; From b252972ab468cbe3a9d7ff33366561c40d0391ec Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 17:09:20 +0000 Subject: [PATCH 16/36] Remove pointless return statements from functions that return nothing. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30084 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 0ca5f32cfd..5c1ad8d27a 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -139,7 +139,6 @@ function print_includes(out_file) { print "#include " > out_file; print "#include \"pci_names.h\"" > out_file; - return; } function print_head(out_file) @@ -147,7 +146,6 @@ function print_head(out_file) printf("/* File: %s\n", out_file) > out_file; printf(" * This file was generated automatically. Don't modify it. */\n") > out_file; print "" > out_file - return; } function print_name_struct(out_file) @@ -164,7 +162,6 @@ function print_name_struct(out_file) print "};" > out_file print "const char *pci_vendor_name(unsigned short id);" > out_file print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);" > out_file - return } function print_func_bodies(out_file) @@ -200,7 +197,6 @@ function print_func_bodies(out_file) } print " return NULL;" > out_file print "}" > out_file - return } function kill_double_quoting(fld) From c082aa34adef2d8148ce601a8142b3ce036fc522 Mon Sep 17 00:00:00 2001 From: ramiro Date: Sun, 20 Dec 2009 17:09:46 +0000 Subject: [PATCH 17/36] Set fast_bilinear functions in sws_init_swScale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30085 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index bf944ee6bc..92786bea5b 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2293,12 +2293,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, src= formatConvBuffer; } -#if COMPILE_TEMPLATE_MMX - // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). - if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) -#else - if (!(flags&SWS_FAST_BILINEAR)) -#endif + if (!c->hyscale_fast) { c->hScale(dst, dstWidth, src, srcW, xInc, hLumFilter, hLumFilterPos, hLumFilterSize); } else { // fast bilinear upscale / crap downscale @@ -2455,12 +2450,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, src2= formatConvBuffer+VOFW; } -#if COMPILE_TEMPLATE_MMX - // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). - if (!(flags&SWS_FAST_BILINEAR) || (!canMMX2BeUsed)) -#else - if (!(flags&SWS_FAST_BILINEAR)) -#endif + if (!c->hcscale_fast) { c->hScale(dst , dstWidth, src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize); c->hScale(dst+VOFW, dstWidth, src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize); @@ -2948,8 +2938,16 @@ static void RENAME(sws_init_swScale)(SwsContext *c) c->hScale = RENAME(hScale ); +#if COMPILE_TEMPLATE_MMX + // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). + if (c->flags & SWS_FAST_BILINEAR && c->canMMX2BeUsed) +#else + if (c->flags & SWS_FAST_BILINEAR) +#endif + { c->hyscale_fast = RENAME(hyscale_fast); c->hcscale_fast = RENAME(hcscale_fast); + } c->hcscale_internal = NULL; switch(srcFormat) { From b8d5738c09e8ad2039d8c3ef34b2fea913038ec1 Mon Sep 17 00:00:00 2001 From: ramiro Date: Sun, 20 Dec 2009 17:15:01 +0000 Subject: [PATCH 18/36] Indent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30086 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 92786bea5b..9208a07498 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2945,8 +2945,8 @@ static void RENAME(sws_init_swScale)(SwsContext *c) if (c->flags & SWS_FAST_BILINEAR) #endif { - c->hyscale_fast = RENAME(hyscale_fast); - c->hcscale_fast = RENAME(hcscale_fast); + c->hyscale_fast = RENAME(hyscale_fast); + c->hcscale_fast = RENAME(hcscale_fast); } c->hcscale_internal = NULL; From 032a7778277dda380f6bea1e3d7e1b1aa7f15807 Mon Sep 17 00:00:00 2001 From: ramiro Date: Sun, 20 Dec 2009 17:42:35 +0000 Subject: [PATCH 19/36] Indentation. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30087 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale.c | 12 ++++++------ libswscale/swscale_internal.h | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 079ed31cd1..f46e2451fb 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2782,14 +2782,14 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d 1; if (initFilter(&c->vLumFilter, &c->vLumFilterPos, &c->vLumFilterSize, c->lumYInc, - srcH , dstH, filterAlign, (1<<12), - (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags, - srcFilter->lumV, dstFilter->lumV, c->param) < 0) + srcH , dstH, filterAlign, (1<<12), + (flags&SWS_BICUBLIN) ? (flags|SWS_BICUBIC) : flags, + srcFilter->lumV, dstFilter->lumV, c->param) < 0) goto fail; if (initFilter(&c->vChrFilter, &c->vChrFilterPos, &c->vChrFilterSize, c->chrYInc, - c->chrSrcH, c->chrDstH, filterAlign, (1<<12), - (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, - srcFilter->chrV, dstFilter->chrV, c->param) < 0) + c->chrSrcH, c->chrDstH, filterAlign, (1<<12), + (flags&SWS_BICUBLIN) ? (flags|SWS_BILINEAR) : flags, + srcFilter->chrV, dstFilter->chrV, c->param) < 0) goto fail; #ifdef COMPILE_ALTIVEC diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index af6dc1ef2e..00be973fc0 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -190,14 +190,14 @@ typedef struct SwsContext { int32_t alpMmxFilter[4*MAX_FILTER_SIZE]; #if HAVE_ALTIVEC - vector signed short CY; - vector signed short CRV; - vector signed short CBU; - vector signed short CGU; - vector signed short CGV; - vector signed short OY; - vector unsigned short CSHIFT; - vector signed short *vYCoeffsBank, *vCCoeffsBank; + vector signed short CY; + vector signed short CRV; + vector signed short CBU; + vector signed short CGU; + vector signed short CGV; + vector signed short OY; + vector unsigned short CSHIFT; + vector signed short *vYCoeffsBank, *vCCoeffsBank; #endif #if ARCH_BFIN From 48ed8799acb00009b73e6044a6305bf66ec6a780 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 17:49:07 +0000 Subject: [PATCH 20/36] Do not autogenerate vidix/pci_names.h. Its contents is always the same, so there is no point in generating it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30088 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 2 +- vidix/pci_db2c.awk | 21 --------------------- vidix/pci_names.h | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 22 deletions(-) create mode 100644 vidix/pci_names.h diff --git a/Makefile b/Makefile index 737403a2f0..5c84844efc 100644 --- a/Makefile +++ b/Makefile @@ -896,7 +896,7 @@ tremor/%: CFLAGS += $(CFLAGS_TREMOR_LOW) vidix/%: CFLAGS += $(CFLAGS_DHAHELPER) $(CFLAGS_SVGALIB_HELPER) VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_names.c \ - vidix/pci_names.h vidix/pci_vendors.h + vidix/pci_vendors.h $(VIDIX_PCI_FILES): vidix/pci_db2c.awk vidix/pci.db $^ $(VIDIX_PCIDB) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 5c1ad8d27a..f54a29fb35 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -35,23 +35,19 @@ BEGIN { vendor_file = "vidix/pci_vendors.h"; ids_file = "vidix/pci_ids.h" name_file = "vidix/pci_names.c" - name_h_file = "vidix/pci_names.h" dev_ids_file = "vidix/pci_dev_ids.c" line = 0; # print out head lines print_head(vendor_file); print_head(ids_file); print_head(name_file); - print_head(name_h_file); print_head(dev_ids_file); print_includes(dev_ids_file); print_guards_start(vendor_file); - print_guards_start(name_h_file); print_guards_start(ids_file); print "#include \"pci_vendors.h\"" > ids_file print "" > ids_file - print_name_struct(name_h_file); print "#include " > name_file print "#include \"pci_names.h\"" > name_file if (with_pci_db) { @@ -105,7 +101,6 @@ BEGIN { } #print "Total lines parsed:", line; print_guards_end(vendor_file); - print_guards_end(name_h_file); print_guards_end(ids_file); if (with_pci_db) print "};" > name_file print "{ 0xFFFF, NULL }" > dev_ids_file; @@ -148,22 +143,6 @@ function print_head(out_file) print "" > out_file } -function print_name_struct(out_file) -{ - print "struct device_id_s {" > out_file - print " unsigned short id;" > out_file - print " const char *name;" > out_file - print "};" > out_file - print "" > out_file - print "struct vendor_id_s {" > out_file - print " unsigned short id;" > out_file - print " const char *name;" > out_file - print " const struct device_id_s *dev_list;" > out_file - print "};" > out_file - print "const char *pci_vendor_name(unsigned short id);" > out_file - print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id);" > out_file -} - function print_func_bodies(out_file) { print "" > out_file diff --git a/vidix/pci_names.h b/vidix/pci_names.h new file mode 100644 index 0000000000..cc91fb5642 --- /dev/null +++ b/vidix/pci_names.h @@ -0,0 +1,38 @@ +/* + * VIDIX - VIDeo Interface for *niX. + * + * 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_PCI_NAMES_H +#define MPLAYER_PCI_NAMES_H + +struct device_id_s { + unsigned short id; + const char *name; +}; + +struct vendor_id_s { + unsigned short id; + const char *name; + const struct device_id_s *dev_list; +}; +const char *pci_vendor_name(unsigned short id); +const char *pci_device_name(unsigned short vendor_id, + unsigned short device_id); + +#endif /* MPLAYER_PCI_NAMES_H */ From 4e18fed06427e5e386a0291e8741e7462b792a5c Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 19:12:20 +0000 Subject: [PATCH 21/36] Use "mingw32" instead of "mingw32msvc" as system name for MinGW with --target. The former is the official name used by the MinGW project. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30089 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 05af22bf37..f88adb8856 100755 --- a/configure +++ b/configure @@ -1434,7 +1434,7 @@ else # if test -z "$_target" qnx) system_name=QNX ;; morphos) system_name=MorphOS ;; amigaos) system_name=AmigaOS ;; - mingw32msvc) system_name=MINGW32 ;; + mingw32) system_name=MINGW32 ;; esac # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=$(echo $_target | cut -d '-' -f 1) From 3a4525bfc2310ca90e0aa6c72e325b3bffe79b70 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 19:32:25 +0000 Subject: [PATCH 22/36] Eliminate completely pointless print_includes function. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30090 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index f54a29fb35..202eddfc8e 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -42,7 +42,9 @@ BEGIN { print_head(ids_file); print_head(name_file); print_head(dev_ids_file); - print_includes(dev_ids_file); + print "#include " > dev_ids_file; + print "#include \"pci_names.h\"" > dev_ids_file; + print_guards_start(vendor_file); print_guards_start(ids_file); print "#include \"pci_vendors.h\"" > ids_file @@ -130,12 +132,6 @@ function print_guards_end(out_file) printf("#endif /* %s */\n", guard_name) > out_file } -function print_includes(out_file) -{ - print "#include " > out_file; - print "#include \"pci_names.h\"" > out_file; -} - function print_head(out_file) { printf("/* File: %s\n", out_file) > out_file; From db1d7210dbe2ebbde37c8efe82b98690937bf051 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 19:36:30 +0000 Subject: [PATCH 23/36] Employ slightly better variable names for output files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30091 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 96 +++++++++++++++++++++++----------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 202eddfc8e..76eae6a658 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -32,30 +32,30 @@ BEGIN { } in_file = ARGV[1]; with_pci_db = ARGV[2]; - vendor_file = "vidix/pci_vendors.h"; - ids_file = "vidix/pci_ids.h" - name_file = "vidix/pci_names.c" - dev_ids_file = "vidix/pci_dev_ids.c" + dev_ids_c_file = "vidix/pci_dev_ids.c" + ids_h_file = "vidix/pci_ids.h" + names_c_file = "vidix/pci_names.c" + vendors_h_file = "vidix/pci_vendors.h"; line = 0; # print out head lines - print_head(vendor_file); - print_head(ids_file); - print_head(name_file); - print_head(dev_ids_file); - print "#include " > dev_ids_file; - print "#include \"pci_names.h\"" > dev_ids_file; + print_head(vendors_h_file); + print_head(ids_h_file); + print_head(names_c_file); + print_head(dev_ids_c_file); + print "#include " > dev_ids_c_file; + print "#include \"pci_names.h\"" > dev_ids_c_file; - print_guards_start(vendor_file); - print_guards_start(ids_file); - print "#include \"pci_vendors.h\"" > ids_file - print "" > ids_file + print_guards_start(vendors_h_file); + print_guards_start(ids_h_file); + print "#include \"pci_vendors.h\"" > ids_h_file + print "" > ids_h_file - print "#include " > name_file - print "#include \"pci_names.h\"" > name_file + print "#include " > names_c_file + print "#include \"pci_names.h\"" > names_c_file if (with_pci_db) { - print "#include \"pci_dev_ids.c\"" > name_file - print "" > name_file - print "static struct vendor_id_s vendor_ids[] = {" > name_file + print "#include \"pci_dev_ids.c\"" > names_c_file + print "" > names_c_file + print "static struct vendor_id_s vendor_ids[] = {" > names_c_file } first_pass = 1; init_name_db(); @@ -67,47 +67,47 @@ BEGIN { if (field[1] == "v" && length(field[3]) > 0 && field[4] == "0") { init_device_db() svend_name = get_short_vendor_name(field[3]) - printf("#define VENDOR_%s\t", svend_name) > vendor_file; - if (length(svend_name) < 9) printf("\t") > vendor_file; - printf("0x%s /*%s*/\n", field[2], name_field) > vendor_file; - if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n", field[2], name_field, field[2]) > name_file; - printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_file + printf("#define VENDOR_%s\t", svend_name) > vendors_h_file; + if (length(svend_name) < 9) printf("\t") > vendors_h_file; + printf("0x%s /*%s*/\n", field[2], name_field) > vendors_h_file; + if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n", field[2], name_field, field[2]) > names_c_file; + printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_h_file if (first_pass == 1) first_pass = 0; - else print "{ 0xFFFF, NULL }\n};" > dev_ids_file; - printf("static const struct device_id_s dev_lst_%s[] = {\n", field[2])> dev_ids_file + else print "{ 0xFFFF, NULL }\n};" > dev_ids_c_file; + printf("static const struct device_id_s dev_lst_%s[] = {\n", field[2])> dev_ids_c_file } if (field[1] == "d" && length(field[3]) > 0 && field[4] == "0") { sdev_name = get_short_device_name(field[3]) full_name = sprintf("#define DEVICE_%s_%s", svend_name, sdev_name); - printf("%s\t", full_name) > ids_file - if (length(full_name) < 9) printf("\t") > ids_file; - if (length(full_name) < 17) printf("\t") > ids_file; - if (length(full_name) < 25) printf("\t") > ids_file; - if (length(full_name) < 32) printf("\t") > ids_file; - if (length(full_name) < 40) printf("\t") > ids_file; - if (length(full_name) < 48) printf("\t") > ids_file; - printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) > ids_file - printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) > dev_ids_file + printf("%s\t", full_name) > ids_h_file + if (length(full_name) < 9) printf("\t") > ids_h_file; + if (length(full_name) < 17) printf("\t") > ids_h_file; + if (length(full_name) < 25) printf("\t") > ids_h_file; + if (length(full_name) < 32) printf("\t") > ids_h_file; + if (length(full_name) < 40) printf("\t") > ids_h_file; + if (length(full_name) < 48) printf("\t") > ids_h_file; + printf("0x%s /*%s*/\n", substr(field[2], 5), name_field) > ids_h_file + printf("{ 0x%s, \"%s\" },\n", substr(field[2], 5), name_field) > dev_ids_c_file } if (field[1] == "s" && length(field[3]) > 0 && field[4] == "0") { subdev_name = get_short_subdevice_name(field[3]) full_name = sprintf("#define SUBDEVICE_%s_%s", svend_name, subdev_name) - printf("\t%s\t", full_name) > ids_file - if (length(full_name) < 9) printf("\t") > ids_file; - if (length(full_name) < 17) printf("\t") > ids_file; - if (length(full_name) < 25) printf("\t") > ids_file; - if (length(full_name) < 32) printf("\t") > ids_file; - if (length(full_name) < 40) printf("\t") > ids_file; - printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) > ids_file + printf("\t%s\t", full_name) > ids_h_file + if (length(full_name) < 9) printf("\t") > ids_h_file; + if (length(full_name) < 17) printf("\t") > ids_h_file; + if (length(full_name) < 25) printf("\t") > ids_h_file; + if (length(full_name) < 32) printf("\t") > ids_h_file; + if (length(full_name) < 40) printf("\t") > ids_h_file; + printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) > ids_h_file } } #print "Total lines parsed:", line; - print_guards_end(vendor_file); - print_guards_end(ids_file); - if (with_pci_db) print "};" > name_file - print "{ 0xFFFF, NULL }" > dev_ids_file; - print "};" > dev_ids_file - print_func_bodies(name_file); + print_guards_end(vendors_h_file); + print_guards_end(ids_h_file); + if (with_pci_db) print "};" > names_c_file + print "{ 0xFFFF, NULL }" > dev_ids_c_file; + print "};" > dev_ids_c_file + print_func_bodies(names_c_file); } function construct_guard_name(out_file) From d9ea2f0d0e38488ad166eed05af5bfbd46faadab Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 19:56:18 +0000 Subject: [PATCH 24/36] Remove unused debugging output about total number of printed lines. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30092 b3059339-0415-0410-9bf9-f77b7e298cf2 --- vidix/pci_db2c.awk | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 76eae6a658..1d577202b3 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -36,7 +36,6 @@ BEGIN { ids_h_file = "vidix/pci_ids.h" names_c_file = "vidix/pci_names.c" vendors_h_file = "vidix/pci_vendors.h"; - line = 0; # print out head lines print_head(vendors_h_file); print_head(ids_h_file); @@ -60,8 +59,6 @@ BEGIN { first_pass = 1; init_name_db(); while (getline < in_file) { - # count up lines - line++; n = split($0, field, "[\t]"); name_field = kill_double_quoting(field[3]) if (field[1] == "v" && length(field[3]) > 0 && field[4] == "0") { @@ -101,7 +98,6 @@ BEGIN { printf("0x%s /*%s*/\n", substr(field[2], 9), name_field) > ids_h_file } } - #print "Total lines parsed:", line; print_guards_end(vendors_h_file); print_guards_end(ids_h_file); if (with_pci_db) print "};" > names_c_file From 7810431c0279fe59b1aaa7922389e0cc7bbd917a Mon Sep 17 00:00:00 2001 From: gpoirier Date: Sun, 20 Dec 2009 20:57:44 +0000 Subject: [PATCH 25/36] sync w/r29731 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30093 b3059339-0415-0410-9bf9-f77b7e298cf2 --- DOCS/man/fr/mplayer.1 | 54 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1 index bc37547e7c..d43b482a97 100644 --- a/DOCS/man/fr/mplayer.1 +++ b/DOCS/man/fr/mplayer.1 @@ -1,4 +1,4 @@ -.\" synced with r29244 +.\" synced with r29731 .\" Encoding: iso-8859-1 .\" MPlayer (C) 2000-2009 MPlayer Team .\" The English man page was/is done by Gabucino, Diego Biurrun, Jonas Jermann @@ -551,10 +551,17 @@ Vous pouvez Si vous souhaitez avoir un fichier de config pour un fichier nommé 'film.avi', créez un fichier nommé 'film.avi.conf' contenant les options spécifiques à ce fichier et placez-le dans ~/.mplayer/. -Vous pouvez aussi mettre le fichier de configuration dans le même répertoire -que le fichier à jouer, pour autant que vous spécifiez l'option -\-use\-filedir\-conf (soit depuis la ligne de commande, soit dans le fichier -de configuration global). + +Si un tel fichier de configuration se trouve dans le même répertoire, +aucun fichier de configuration spécifique ne sera lu depuis +~/.mplayer/. + +De plus, l'option \-use\-filedir\-conf permet de définir des fichiers +de configuration spécifiques à un répertoire. + +Pour ce faire, MPlayer essaye de charger un fichier mplayer.conf +depuis le même répertoire que celui du fichier joué, et essaye ensuite +de charger un fichier de configuration spécifique. .PP .I EXEMPLE DE FICHIER DE CONFIGURATION MPLAYER\ : @@ -2444,6 +2451,11 @@ Si vous n'arrivez pas DVD, essayez avec \-vobsubid. . .TP +.B \-nosub +Désactive la sélection automatique de sous-titres (c'est ce qui se +passe par défaut avec le démultiplexeur Matroska/mkv par exemple). +. +.TP .B \-slang (voir aussi l'option \-sid) Définit une liste de langues de sous-titres à afficher en priorité. Chaque format de conteneur utilise des codes de pays différents. @@ -3466,6 +3478,9 @@ uniquement) Dit à MPlayer de s'attacher à une fenêtre existante. Utile pour intégrer MPlayer dans un navigateur (avec l'extension plugger par exemple). +Cette option rempli complètement la fenêtre donnée, si bien que le +ratio d'aspect, panscan, etc. ne sont plus assurés par MPlayer et +doivent ainsi être assurés par l'application qui a créé la fenêtre. . .TP .B \-xineramascreen <\-2\-...> @@ -3800,7 +3815,8 @@ Force le mode WarpOverlay!. .IPs dive Force le mode DIVE. .IPs (no)t23 -Active le contournement pour les bugs de l'ordinateur portable T23. +Active le contournement pour les bugs de l'ordinateur portable T23 +(par défaut\ : désactivé). Essayez d'activer cette option si votre carte vidéo ne gère que l'agrandissement d'image (upscaling). .RE @@ -7721,6 +7737,28 @@ Pourcentage de pixels qui doivent Seuil en dessous duquel un pixel est considéré comme noir (par défaut: 32) .RE . +.TP +.B gradfun[=force[:rayon]] +Corrige les "effets de bande" (banding) qui se produisent parfois dans les +régions presque uniformes, dûes à la troncature de la profondeur des +couleur à 8bits. +Interpole le dégradé qui devraient se situer où les bandes sont, et +effectue un tramage. +.sp 1 +Ce filtre est destiné à être uniquement utilisé pour la lecture. +Ne l'utilisez pas avant une compression à perte, car la compression tend +à supprimer le tramage et de rétablir les bandes. +.RSs +.IPs +Le delta maximum permis pour la modification d'un pixel. +Est aussi le seuil pour détecter les régions presque uniformes (par +defaut\ : 1.2). +.IPs +Le voisinage avec lequel le dégradé doit être injecté. +Un rayon plus grand produit des dégradés plus doux, mais empêche le filtre +de modifier les pixels près des régions détaillées (par defaut\ : 16). +.RE +. . .SH "OPTIONS D'ENCODAGE GÉNÉRALES (MENCODER UNIQUEMENT)" . @@ -8275,10 +8313,6 @@ formats adaptatifs PCM \- voir la documentation HTML pour plus de details. Free Lossless Audio Codec (FLAC) .IPs "g726\ " G.726 ADPCM -.IPs libamr_nb -3GPP Adaptive Multi-Rate (AMR) narrow-band (bande étroite) -.IPs libamr_wb -3GPP Adaptive Multi-Rate (AMR) wide-band (large bande) .IPs libfaac Advanced Audio Coding (AAC) \- utilisant FAAC .IPs libmp3lame From 61f34a81016600fdcf2e7191e1e8345e5d83d465 Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 20 Dec 2009 21:11:39 +0000 Subject: [PATCH 26/36] Do not auto-generate the C code to handle PCI vendor and device names. This part of the code does not change so there is no point in generating it. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30094 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Makefile | 2 +- vidix/pci_db2c.awk | 54 ++++++++-------------------------------------- vidix/pci_names.c | 50 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 46 deletions(-) create mode 100644 vidix/pci_names.c diff --git a/Makefile b/Makefile index 5c84844efc..d0c780c7d9 100644 --- a/Makefile +++ b/Makefile @@ -895,7 +895,7 @@ tremor/%: CFLAGS += $(CFLAGS_TREMOR_LOW) vidix/%: CFLAGS += $(CFLAGS_DHAHELPER) $(CFLAGS_SVGALIB_HELPER) -VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_names.c \ +VIDIX_PCI_FILES = vidix/pci_dev_ids.c vidix/pci_ids.h vidix/pci_vendor_ids.h \ vidix/pci_vendors.h $(VIDIX_PCI_FILES): vidix/pci_db2c.awk vidix/pci.db diff --git a/vidix/pci_db2c.awk b/vidix/pci_db2c.awk index 1d577202b3..976dd76640 100755 --- a/vidix/pci_db2c.awk +++ b/vidix/pci_db2c.awk @@ -34,12 +34,12 @@ BEGIN { with_pci_db = ARGV[2]; dev_ids_c_file = "vidix/pci_dev_ids.c" ids_h_file = "vidix/pci_ids.h" - names_c_file = "vidix/pci_names.c" + vendor_ids_h_file = "vidix/pci_vendor_ids.h" vendors_h_file = "vidix/pci_vendors.h"; # print out head lines print_head(vendors_h_file); print_head(ids_h_file); - print_head(names_c_file); + print_head(vendor_ids_h_file); print_head(dev_ids_c_file); print "#include " > dev_ids_c_file; print "#include \"pci_names.h\"" > dev_ids_c_file; @@ -49,12 +49,12 @@ BEGIN { print "#include \"pci_vendors.h\"" > ids_h_file print "" > ids_h_file - print "#include " > names_c_file - print "#include \"pci_names.h\"" > names_c_file + print "#include " > vendor_ids_h_file + print "#include \"pci_names.h\"" > vendor_ids_h_file if (with_pci_db) { - print "#include \"pci_dev_ids.c\"" > names_c_file - print "" > names_c_file - print "static struct vendor_id_s vendor_ids[] = {" > names_c_file + print "#include \"pci_dev_ids.c\"" > vendor_ids_h_file + print "" > vendor_ids_h_file + print "static struct vendor_id_s vendor_ids[] = {" > vendor_ids_h_file } first_pass = 1; init_name_db(); @@ -67,7 +67,7 @@ BEGIN { printf("#define VENDOR_%s\t", svend_name) > vendors_h_file; if (length(svend_name) < 9) printf("\t") > vendors_h_file; printf("0x%s /*%s*/\n", field[2], name_field) > vendors_h_file; - if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n", field[2], name_field, field[2]) > names_c_file; + if (with_pci_db) printf("{ 0x%s, \"%s\", dev_lst_%s },\n", field[2], name_field, field[2]) > vendor_ids_h_file; printf("/* Vendor: %s: %s */\n", field[2], name_field) > ids_h_file if (first_pass == 1) first_pass = 0; else print "{ 0xFFFF, NULL }\n};" > dev_ids_c_file; @@ -100,10 +100,9 @@ BEGIN { } print_guards_end(vendors_h_file); print_guards_end(ids_h_file); - if (with_pci_db) print "};" > names_c_file + if (with_pci_db) print "};" > vendor_ids_h_file print "{ 0xFFFF, NULL }" > dev_ids_c_file; print "};" > dev_ids_c_file - print_func_bodies(names_c_file); } function construct_guard_name(out_file) @@ -135,41 +134,6 @@ function print_head(out_file) print "" > out_file } -function print_func_bodies(out_file) -{ - print "" > out_file - print "const char *pci_vendor_name(unsigned short id)" > out_file - print "{" > out_file - if (with_pci_db) { - print " unsigned i;" > out_file - print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {" > out_file - print " if (vendor_ids[i].id == id)" > out_file - print " return vendor_ids[i].name;" > out_file - print " }" > out_file - } - print " return NULL;" > out_file - print "}" > out_file - print "" > out_file - print "const char *pci_device_name(unsigned short vendor_id, unsigned short device_id)" > out_file - print "{" > out_file - if (with_pci_db) { - print " unsigned i, j;" > out_file - print " for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) {" > out_file - print " if (vendor_ids[i].id == vendor_id) {" > out_file - print " j = 0;" > out_file - print " while (vendor_ids[i].dev_list[j].id != 0xFFFF) {" > out_file - print " if (vendor_ids[i].dev_list[j].id == device_id)" > out_file - print " return vendor_ids[i].dev_list[j].name;" > out_file - print " j++;" > out_file - print " };" > out_file - print " break;" > out_file - print " }" > out_file - print " }" > out_file - } - print " return NULL;" > out_file - print "}" > out_file -} - function kill_double_quoting(fld) { n = split(fld, phrases, "[\"]"); diff --git a/vidix/pci_names.c b/vidix/pci_names.c new file mode 100644 index 0000000000..d7348446ac --- /dev/null +++ b/vidix/pci_names.c @@ -0,0 +1,50 @@ +/* + * VIDIX - VIDeo Interface for *niX. + * + * 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. + */ + +#include +#include "pci_names.h" +#include "pci_vendor_ids.h" + +const char *pci_vendor_name(unsigned short id) +{ + unsigned i; + for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) { + if (vendor_ids[i].id == id) + return vendor_ids[i].name; + } + return NULL; +} + +const char *pci_device_name(unsigned short vendor_id, unsigned short device_id) +{ + unsigned i, j; + for (i = 0; i < sizeof(vendor_ids) / sizeof(struct vendor_id_s); i++) { + if (vendor_ids[i].id == vendor_id) { + j = 0; + while (vendor_ids[i].dev_list[j].id != 0xFFFF) { + if (vendor_ids[i].dev_list[j].id == device_id) + return vendor_ids[i].dev_list[j].name; + j++; + }; + break; + } + } + return NULL; +} From 779c4a0df59fa842868f92a1e076fb87e25fcf5f Mon Sep 17 00:00:00 2001 From: ramiro Date: Mon, 21 Dec 2009 01:30:55 +0000 Subject: [PATCH 27/36] Remove unused fields from SwsContext. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30095 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 1 - 1 file changed, 1 deletion(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 00be973fc0..f60ffb0a11 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -80,7 +80,6 @@ typedef struct SwsContext { int lumXInc, chrXInc; int lumYInc, chrYInc; enum PixelFormat dstFormat, srcFormat; ///< format 4:2:0 type is always YV12 - int origDstFormat, origSrcFormat; ///< format int chrSrcHSubSample, chrSrcVSubSample; int chrDstHSubSample, chrDstVSubSample; int vChrDrop; From 342009a438caf531ba6d5ecd67ececf04910f8c4 Mon Sep 17 00:00:00 2001 From: ramiro Date: Mon, 21 Dec 2009 01:34:45 +0000 Subject: [PATCH 28/36] Check if chroma horizontal scaler is needed in sws_init_swScale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30096 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 2 ++ libswscale/swscale_template.c | 9 +++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index f60ffb0a11..eb73fa6dae 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -279,6 +279,8 @@ typedef struct SwsContext { int chrSrcOffset; ///< Offset given to chroma src pointers passed to horizontal input functions. int alpSrcOffset; ///< Offset given to alpha src pointers passed to horizontal input functions. + int needs_hcscale; ///< Set if there are chroma planes to be converted. + } SwsContext; //FIXME check init (where 0) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 9208a07498..3c6c8ebe8d 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2438,9 +2438,6 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, int av_unused canMMX2BeUsed = c->canMMX2BeUsed; void av_unused *mmx2FilterCode= c->chrMmx2FilterCode; - if (isGray(srcFormat) || srcFormat==PIX_FMT_MONOBLACK || srcFormat==PIX_FMT_MONOWHITE) - return; - src1 += c->chrSrcOffset; src2 += c->chrSrcOffset; @@ -2717,7 +2714,7 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s assert(lastInChrBuf + 1 - chrSrcSliceY >= 0); //FIXME replace parameters through context struct (some at least) - if (!(isGray(srcFormat) || isGray(dstFormat))) + if (c->needs_hcscale) RENAME(hcscale)(c, chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, chrSrcW, chrXInc, flags, hChrFilter, hChrFilterPos, hChrFilterSize, c->srcFormat, formatConvBuffer, @@ -3067,4 +3064,8 @@ static void RENAME(sws_init_swScale)(SwsContext *c) c->chrConvertRange = RENAME(chrRangeToJpeg); } } + + if (!(isGray(srcFormat) || isGray(c->dstFormat) || + srcFormat == PIX_FMT_MONOBLACK || srcFormat == PIX_FMT_MONOWHITE)) + c->needs_hcscale = 1; } From 0ebdb661a6ebc99315ca8a65ae6b3e670907162e Mon Sep 17 00:00:00 2001 From: ramiro Date: Mon, 21 Dec 2009 01:41:29 +0000 Subject: [PATCH 29/36] Rename function pointers used to convert from the input pixel format to the intermediate YV12 to a more descriptive name. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30097 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 14 ++--- libswscale/swscale_template.c | 96 +++++++++++++++++------------------ 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index eb73fa6dae..c597234b5e 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -253,13 +253,13 @@ typedef struct SwsContext { const int16_t **alpSrc, uint8_t *dest, long dstW, long dstY); - void (*hyscale_internal)(uint8_t *dst, const uint8_t *src, - long width, uint32_t *pal); - void (*hascale_internal)(uint8_t *dst, const uint8_t *src, - long width, uint32_t *pal); - void (*hcscale_internal)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, - long width, uint32_t *pal); + void (*lumToYV12)(uint8_t *dst, const uint8_t *src, + long width, uint32_t *pal); ///< Unscaled conversion of luma plane to YV12 for horizontal scaler. + void (*alpToYV12)(uint8_t *dst, const uint8_t *src, + long width, uint32_t *pal); ///< Unscaled conversion of alpha plane to YV12 for horizontal scaler. + void (*chrToYV12)(uint8_t *dstU, uint8_t *dstV, + const uint8_t *src1, const uint8_t *src2, + long width, uint32_t *pal); ///< Unscaled conversion of chroma planes to YV12 for horizontal scaler. void (*hyscale_fast)(struct SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc); diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index 3c6c8ebe8d..ea9185eb11 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2283,13 +2283,13 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, int16_t av_unused *mmx2Filter = c->lumMmx2Filter; int av_unused canMMX2BeUsed = c->canMMX2BeUsed; void av_unused *mmx2FilterCode= c->lumMmx2FilterCode; - void (*internal_func)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->hascale_internal : c->hyscale_internal; + void (*toYV12)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->alpToYV12 : c->lumToYV12; void (*convertRange)(uint16_t *, int) = isAlpha ? NULL : c->lumConvertRange; src += isAlpha ? c->alpSrcOffset : c->lumSrcOffset; - if (internal_func) { - internal_func(formatConvBuffer, src, srcW, pal); + if (toYV12) { + toYV12(formatConvBuffer, src, srcW, pal); src= formatConvBuffer; } @@ -2441,8 +2441,8 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, src1 += c->chrSrcOffset; src2 += c->chrSrcOffset; - if (c->hcscale_internal) { - c->hcscale_internal(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal); + if (c->chrToYV12) { + c->chrToYV12(formatConvBuffer, formatConvBuffer+VOFW, src1, src2, srcW, pal); src1= formatConvBuffer; src2= formatConvBuffer+VOFW; } @@ -2946,95 +2946,95 @@ static void RENAME(sws_init_swScale)(SwsContext *c) c->hcscale_fast = RENAME(hcscale_fast); } - c->hcscale_internal = NULL; + c->chrToYV12 = NULL; switch(srcFormat) { - case PIX_FMT_YUYV422 : c->hcscale_internal = RENAME(yuy2ToUV); break; - case PIX_FMT_UYVY422 : c->hcscale_internal = RENAME(uyvyToUV); break; - case PIX_FMT_NV12 : c->hcscale_internal = RENAME(nv12ToUV); break; - case PIX_FMT_NV21 : c->hcscale_internal = RENAME(nv21ToUV); break; + case PIX_FMT_YUYV422 : c->chrToYV12 = RENAME(yuy2ToUV); break; + case PIX_FMT_UYVY422 : c->chrToYV12 = RENAME(uyvyToUV); break; + case PIX_FMT_NV12 : c->chrToYV12 = RENAME(nv12ToUV); break; + case PIX_FMT_NV21 : c->chrToYV12 = RENAME(nv21ToUV); break; case PIX_FMT_RGB8 : case PIX_FMT_BGR8 : case PIX_FMT_PAL8 : case PIX_FMT_BGR4_BYTE: - case PIX_FMT_RGB4_BYTE: c->hcscale_internal = palToUV; break; + case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV; break; case PIX_FMT_YUV420P16BE: case PIX_FMT_YUV422P16BE: - case PIX_FMT_YUV444P16BE: c->hcscale_internal = RENAME(BEToUV); break; + case PIX_FMT_YUV444P16BE: c->chrToYV12 = RENAME(BEToUV); break; case PIX_FMT_YUV420P16LE: case PIX_FMT_YUV422P16LE: - case PIX_FMT_YUV444P16LE: c->hcscale_internal = RENAME(LEToUV); break; + case PIX_FMT_YUV444P16LE: c->chrToYV12 = RENAME(LEToUV); break; } if (c->chrSrcHSubSample) { switch(srcFormat) { case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: c->hcscale_internal = rgb48ToUV_half; break; + case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48ToUV_half; break; case PIX_FMT_RGB32 : - case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV_half; break; - case PIX_FMT_BGR24 : c->hcscale_internal = RENAME(bgr24ToUV_half); break; - case PIX_FMT_BGR565 : c->hcscale_internal = bgr16ToUV_half; break; - case PIX_FMT_BGR555 : c->hcscale_internal = bgr15ToUV_half; break; + case PIX_FMT_RGB32_1: c->chrToYV12 = bgr32ToUV_half; break; + case PIX_FMT_BGR24 : c->chrToYV12 = RENAME(bgr24ToUV_half); break; + case PIX_FMT_BGR565 : c->chrToYV12 = bgr16ToUV_half; break; + case PIX_FMT_BGR555 : c->chrToYV12 = bgr15ToUV_half; break; case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hcscale_internal = rgb32ToUV_half; break; - case PIX_FMT_RGB24 : c->hcscale_internal = RENAME(rgb24ToUV_half); break; - case PIX_FMT_RGB565 : c->hcscale_internal = rgb16ToUV_half; break; - case PIX_FMT_RGB555 : c->hcscale_internal = rgb15ToUV_half; break; + case PIX_FMT_BGR32_1: c->chrToYV12 = rgb32ToUV_half; break; + case PIX_FMT_RGB24 : c->chrToYV12 = RENAME(rgb24ToUV_half); break; + case PIX_FMT_RGB565 : c->chrToYV12 = rgb16ToUV_half; break; + case PIX_FMT_RGB555 : c->chrToYV12 = rgb15ToUV_half; break; } } else { switch(srcFormat) { case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: c->hcscale_internal = rgb48ToUV; break; + case PIX_FMT_RGB48LE: c->chrToYV12 = rgb48ToUV; break; case PIX_FMT_RGB32 : - case PIX_FMT_RGB32_1: c->hcscale_internal = bgr32ToUV; break; - case PIX_FMT_BGR24 : c->hcscale_internal = RENAME(bgr24ToUV); break; - case PIX_FMT_BGR565 : c->hcscale_internal = bgr16ToUV; break; - case PIX_FMT_BGR555 : c->hcscale_internal = bgr15ToUV; break; + case PIX_FMT_RGB32_1: c->chrToYV12 = bgr32ToUV; break; + case PIX_FMT_BGR24 : c->chrToYV12 = RENAME(bgr24ToUV); break; + case PIX_FMT_BGR565 : c->chrToYV12 = bgr16ToUV; break; + case PIX_FMT_BGR555 : c->chrToYV12 = bgr15ToUV; break; case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hcscale_internal = rgb32ToUV; break; - case PIX_FMT_RGB24 : c->hcscale_internal = RENAME(rgb24ToUV); break; - case PIX_FMT_RGB565 : c->hcscale_internal = rgb16ToUV; break; - case PIX_FMT_RGB555 : c->hcscale_internal = rgb15ToUV; break; + case PIX_FMT_BGR32_1: c->chrToYV12 = rgb32ToUV; break; + case PIX_FMT_RGB24 : c->chrToYV12 = RENAME(rgb24ToUV); break; + case PIX_FMT_RGB565 : c->chrToYV12 = rgb16ToUV; break; + case PIX_FMT_RGB555 : c->chrToYV12 = rgb15ToUV; break; } } - c->hyscale_internal = NULL; - c->hascale_internal = NULL; + c->lumToYV12 = NULL; + c->alpToYV12 = NULL; switch (srcFormat) { case PIX_FMT_YUYV422 : case PIX_FMT_YUV420P16BE: case PIX_FMT_YUV422P16BE: case PIX_FMT_YUV444P16BE: - case PIX_FMT_GRAY16BE : c->hyscale_internal = RENAME(yuy2ToY); break; + case PIX_FMT_GRAY16BE : c->lumToYV12 = RENAME(yuy2ToY); break; case PIX_FMT_UYVY422 : case PIX_FMT_YUV420P16LE: case PIX_FMT_YUV422P16LE: case PIX_FMT_YUV444P16LE: - case PIX_FMT_GRAY16LE : c->hyscale_internal = RENAME(uyvyToY); break; - case PIX_FMT_BGR24 : c->hyscale_internal = RENAME(bgr24ToY); break; - case PIX_FMT_BGR565 : c->hyscale_internal = bgr16ToY; break; - case PIX_FMT_BGR555 : c->hyscale_internal = bgr15ToY; break; - case PIX_FMT_RGB24 : c->hyscale_internal = RENAME(rgb24ToY); break; - case PIX_FMT_RGB565 : c->hyscale_internal = rgb16ToY; break; - case PIX_FMT_RGB555 : c->hyscale_internal = rgb15ToY; break; + case PIX_FMT_GRAY16LE : c->lumToYV12 = RENAME(uyvyToY); break; + case PIX_FMT_BGR24 : c->lumToYV12 = RENAME(bgr24ToY); break; + case PIX_FMT_BGR565 : c->lumToYV12 = bgr16ToY; break; + case PIX_FMT_BGR555 : c->lumToYV12 = bgr15ToY; break; + case PIX_FMT_RGB24 : c->lumToYV12 = RENAME(rgb24ToY); break; + case PIX_FMT_RGB565 : c->lumToYV12 = rgb16ToY; break; + case PIX_FMT_RGB555 : c->lumToYV12 = rgb15ToY; break; case PIX_FMT_RGB8 : case PIX_FMT_BGR8 : case PIX_FMT_PAL8 : case PIX_FMT_BGR4_BYTE: - case PIX_FMT_RGB4_BYTE: c->hyscale_internal = palToY; break; - case PIX_FMT_MONOBLACK: c->hyscale_internal = monoblack2Y; break; - case PIX_FMT_MONOWHITE: c->hyscale_internal = monowhite2Y; break; + case PIX_FMT_RGB4_BYTE: c->lumToYV12 = palToY; break; + case PIX_FMT_MONOBLACK: c->lumToYV12 = monoblack2Y; break; + case PIX_FMT_MONOWHITE: c->lumToYV12 = monowhite2Y; break; case PIX_FMT_RGB32 : - case PIX_FMT_RGB32_1: c->hyscale_internal = bgr32ToY; break; + case PIX_FMT_RGB32_1: c->lumToYV12 = bgr32ToY; break; case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hyscale_internal = rgb32ToY; break; + case PIX_FMT_BGR32_1: c->lumToYV12 = rgb32ToY; break; case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: c->hyscale_internal = rgb48ToY; break; + case PIX_FMT_RGB48LE: c->lumToYV12 = rgb48ToY; break; } if (c->alpPixBuf) { switch (srcFormat) { case PIX_FMT_RGB32 : case PIX_FMT_RGB32_1: case PIX_FMT_BGR32 : - case PIX_FMT_BGR32_1: c->hascale_internal = abgrToA; break; + case PIX_FMT_BGR32_1: c->alpToYV12 = abgrToA; break; } } From 767326f4842fbb4bc05beea5bc25072e98a57c8c Mon Sep 17 00:00:00 2001 From: ramiro Date: Mon, 21 Dec 2009 01:54:59 +0000 Subject: [PATCH 30/36] Move fast bilinear scaler code to the existing h[yc]scale_fast() functions. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30098 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_internal.h | 4 +- libswscale/swscale_template.c | 424 +++++++++++++++++----------------- 2 files changed, 214 insertions(+), 214 deletions(-) diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index c597234b5e..a4e695604d 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -261,10 +261,10 @@ typedef struct SwsContext { const uint8_t *src1, const uint8_t *src2, long width, uint32_t *pal); ///< Unscaled conversion of chroma planes to YV12 for horizontal scaler. void (*hyscale_fast)(struct SwsContext *c, - int16_t *dst, int dstWidth, + int16_t *dst, long dstWidth, const uint8_t *src, int srcW, int xInc); void (*hcscale_fast)(struct SwsContext *c, - int16_t *dst, int dstWidth, + int16_t *dst, long dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc); diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index ea9185eb11..c0a410bc52 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2259,9 +2259,116 @@ static void RENAME(lumRangeFromJpeg)(uint16_t *dst, int width) "shrl $9, %%esi \n\t" \ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, - int dstWidth, const uint8_t *src, int srcW, + long dstWidth, const uint8_t *src, int srcW, int xInc) { +#if ARCH_X86 && CONFIG_GPL +#if COMPILE_TEMPLATE_MMX2 + int32_t *mmx2FilterPos = c->lumMmx2FilterPos; + int16_t *mmx2Filter = c->lumMmx2Filter; + int canMMX2BeUsed = c->canMMX2BeUsed; + void *mmx2FilterCode= c->lumMmx2FilterCode; + int i; +#if defined(PIC) + DECLARE_ALIGNED(8, uint64_t, ebxsave); +#endif + if (canMMX2BeUsed) { + __asm__ volatile( +#if defined(PIC) + "mov %%"REG_b", %5 \n\t" +#endif + "pxor %%mm7, %%mm7 \n\t" + "mov %0, %%"REG_c" \n\t" + "mov %1, %%"REG_D" \n\t" + "mov %2, %%"REG_d" \n\t" + "mov %3, %%"REG_b" \n\t" + "xor %%"REG_a", %%"REG_a" \n\t" // i + PREFETCH" (%%"REG_c") \n\t" + PREFETCH" 32(%%"REG_c") \n\t" + PREFETCH" 64(%%"REG_c") \n\t" + +#if ARCH_X86_64 + +#define CALL_MMX2_FILTER_CODE \ + "movl (%%"REG_b"), %%esi \n\t"\ + "call *%4 \n\t"\ + "movl (%%"REG_b", %%"REG_a"), %%esi \n\t"\ + "add %%"REG_S", %%"REG_c" \n\t"\ + "add %%"REG_a", %%"REG_D" \n\t"\ + "xor %%"REG_a", %%"REG_a" \n\t"\ + +#else + +#define CALL_MMX2_FILTER_CODE \ + "movl (%%"REG_b"), %%esi \n\t"\ + "call *%4 \n\t"\ + "addl (%%"REG_b", %%"REG_a"), %%"REG_c" \n\t"\ + "add %%"REG_a", %%"REG_D" \n\t"\ + "xor %%"REG_a", %%"REG_a" \n\t"\ + +#endif /* ARCH_X86_64 */ + + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + +#if defined(PIC) + "mov %5, %%"REG_b" \n\t" +#endif + :: "m" (src), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), + "m" (mmx2FilterCode) +#if defined(PIC) + ,"m" (ebxsave) +#endif + : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D +#if !defined(PIC) + ,"%"REG_b +#endif + ); + for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) dst[i] = src[srcW-1]*128; + } else { +#endif /* COMPILE_TEMPLATE_MMX2 */ + x86_reg xInc_shr16 = xInc >> 16; + uint16_t xInc_mask = xInc & 0xffff; + //NO MMX just normal asm ... + __asm__ volatile( + "xor %%"REG_a", %%"REG_a" \n\t" // i + "xor %%"REG_d", %%"REG_d" \n\t" // xx + "xorl %%ecx, %%ecx \n\t" // xalpha + ASMALIGN(4) + "1: \n\t" + "movzbl (%0, %%"REG_d"), %%edi \n\t" //src[xx] + "movzbl 1(%0, %%"REG_d"), %%esi \n\t" //src[xx+1] + FAST_BILINEAR_X86 + "movw %%si, (%%"REG_D", %%"REG_a", 2) \n\t" + "addw %4, %%cx \n\t" //xalpha += xInc&0xFFFF + "adc %3, %%"REG_d" \n\t" //xx+= xInc>>16 + carry + + "movzbl (%0, %%"REG_d"), %%edi \n\t" //src[xx] + "movzbl 1(%0, %%"REG_d"), %%esi \n\t" //src[xx+1] + FAST_BILINEAR_X86 + "movw %%si, 2(%%"REG_D", %%"REG_a", 2) \n\t" + "addw %4, %%cx \n\t" //xalpha += xInc&0xFFFF + "adc %3, %%"REG_d" \n\t" //xx+= xInc>>16 + carry + + + "add $2, %%"REG_a" \n\t" + "cmp %2, %%"REG_a" \n\t" + " jb 1b \n\t" + + + :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask) + : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" + ); +#if COMPILE_TEMPLATE_MMX2 + } //if MMX2 can't be used +#endif +#else int i; unsigned int xpos=0; for (i=0;ilumMmx2FilterPos; - int16_t av_unused *mmx2Filter = c->lumMmx2Filter; - int av_unused canMMX2BeUsed = c->canMMX2BeUsed; - void av_unused *mmx2FilterCode= c->lumMmx2FilterCode; void (*toYV12)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->alpToYV12 : c->lumToYV12; void (*convertRange)(uint16_t *, int) = isAlpha ? NULL : c->lumConvertRange; @@ -2297,111 +2401,7 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, { c->hScale(dst, dstWidth, src, srcW, xInc, hLumFilter, hLumFilterPos, hLumFilterSize); } else { // fast bilinear upscale / crap downscale -#if ARCH_X86 && CONFIG_GPL -#if COMPILE_TEMPLATE_MMX2 - int i; -#if defined(PIC) - DECLARE_ALIGNED(8, uint64_t, ebxsave); -#endif - if (canMMX2BeUsed) { - __asm__ volatile( -#if defined(PIC) - "mov %%"REG_b", %5 \n\t" -#endif - "pxor %%mm7, %%mm7 \n\t" - "mov %0, %%"REG_c" \n\t" - "mov %1, %%"REG_D" \n\t" - "mov %2, %%"REG_d" \n\t" - "mov %3, %%"REG_b" \n\t" - "xor %%"REG_a", %%"REG_a" \n\t" // i - PREFETCH" (%%"REG_c") \n\t" - PREFETCH" 32(%%"REG_c") \n\t" - PREFETCH" 64(%%"REG_c") \n\t" - -#if ARCH_X86_64 - -#define CALL_MMX2_FILTER_CODE \ - "movl (%%"REG_b"), %%esi \n\t"\ - "call *%4 \n\t"\ - "movl (%%"REG_b", %%"REG_a"), %%esi \n\t"\ - "add %%"REG_S", %%"REG_c" \n\t"\ - "add %%"REG_a", %%"REG_D" \n\t"\ - "xor %%"REG_a", %%"REG_a" \n\t"\ - -#else - -#define CALL_MMX2_FILTER_CODE \ - "movl (%%"REG_b"), %%esi \n\t"\ - "call *%4 \n\t"\ - "addl (%%"REG_b", %%"REG_a"), %%"REG_c" \n\t"\ - "add %%"REG_a", %%"REG_D" \n\t"\ - "xor %%"REG_a", %%"REG_a" \n\t"\ - -#endif /* ARCH_X86_64 */ - - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - -#if defined(PIC) - "mov %5, %%"REG_b" \n\t" -#endif - :: "m" (src), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), - "m" (mmx2FilterCode) -#if defined(PIC) - ,"m" (ebxsave) -#endif - : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D -#if !defined(PIC) - ,"%"REG_b -#endif - ); - for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) dst[i] = src[srcW-1]*128; - } else { -#endif /* COMPILE_TEMPLATE_MMX2 */ - x86_reg xInc_shr16 = xInc >> 16; - uint16_t xInc_mask = xInc & 0xffff; - //NO MMX just normal asm ... - __asm__ volatile( - "xor %%"REG_a", %%"REG_a" \n\t" // i - "xor %%"REG_d", %%"REG_d" \n\t" // xx - "xorl %%ecx, %%ecx \n\t" // xalpha - ASMALIGN(4) - "1: \n\t" - "movzbl (%0, %%"REG_d"), %%edi \n\t" //src[xx] - "movzbl 1(%0, %%"REG_d"), %%esi \n\t" //src[xx+1] - FAST_BILINEAR_X86 - "movw %%si, (%%"REG_D", %%"REG_a", 2) \n\t" - "addw %4, %%cx \n\t" //xalpha += xInc&0xFFFF - "adc %3, %%"REG_d" \n\t" //xx+= xInc>>16 + carry - - "movzbl (%0, %%"REG_d"), %%edi \n\t" //src[xx] - "movzbl 1(%0, %%"REG_d"), %%esi \n\t" //src[xx+1] - FAST_BILINEAR_X86 - "movw %%si, 2(%%"REG_D", %%"REG_a", 2) \n\t" - "addw %4, %%cx \n\t" //xalpha += xInc&0xFFFF - "adc %3, %%"REG_d" \n\t" //xx+= xInc>>16 + carry - - - "add $2, %%"REG_a" \n\t" - "cmp %2, %%"REG_a" \n\t" - " jb 1b \n\t" - - - :: "r" (src), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask) - : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" - ); -#if COMPILE_TEMPLATE_MMX2 - } //if MMX2 can't be used -#endif -#else c->hyscale_fast(c, dst, dstWidth, src, srcW, xInc); -#endif /* ARCH_X86 */ } if (convertRange) @@ -2409,9 +2409,110 @@ static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, } static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst, - int dstWidth, const uint8_t *src1, + long dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc) { +#if ARCH_X86 && CONFIG_GPL +#if COMPILE_TEMPLATE_MMX2 + int32_t *mmx2FilterPos = c->chrMmx2FilterPos; + int16_t *mmx2Filter = c->chrMmx2Filter; + int canMMX2BeUsed = c->canMMX2BeUsed; + void *mmx2FilterCode= c->chrMmx2FilterCode; + int i; +#if defined(PIC) + DECLARE_ALIGNED(8, uint64_t, ebxsave); +#endif + if (canMMX2BeUsed) { + __asm__ volatile( +#if defined(PIC) + "mov %%"REG_b", %6 \n\t" +#endif + "pxor %%mm7, %%mm7 \n\t" + "mov %0, %%"REG_c" \n\t" + "mov %1, %%"REG_D" \n\t" + "mov %2, %%"REG_d" \n\t" + "mov %3, %%"REG_b" \n\t" + "xor %%"REG_a", %%"REG_a" \n\t" // i + PREFETCH" (%%"REG_c") \n\t" + PREFETCH" 32(%%"REG_c") \n\t" + PREFETCH" 64(%%"REG_c") \n\t" + + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + "xor %%"REG_a", %%"REG_a" \n\t" // i + "mov %5, %%"REG_c" \n\t" // src + "mov %1, %%"REG_D" \n\t" // buf1 + "add $"AV_STRINGIFY(VOF)", %%"REG_D" \n\t" + PREFETCH" (%%"REG_c") \n\t" + PREFETCH" 32(%%"REG_c") \n\t" + PREFETCH" 64(%%"REG_c") \n\t" + + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + CALL_MMX2_FILTER_CODE + +#if defined(PIC) + "mov %6, %%"REG_b" \n\t" +#endif + :: "m" (src1), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), + "m" (mmx2FilterCode), "m" (src2) +#if defined(PIC) + ,"m" (ebxsave) +#endif + : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D +#if !defined(PIC) + ,"%"REG_b +#endif + ); + for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) { + //printf("%d %d %d\n", dstWidth, i, srcW); + dst[i] = src1[srcW-1]*128; + dst[i+VOFW] = src2[srcW-1]*128; + } + } else { +#endif /* COMPILE_TEMPLATE_MMX2 */ + x86_reg xInc_shr16 = (x86_reg) (xInc >> 16); + uint16_t xInc_mask = xInc & 0xffff; + __asm__ volatile( + "xor %%"REG_a", %%"REG_a" \n\t" // i + "xor %%"REG_d", %%"REG_d" \n\t" // xx + "xorl %%ecx, %%ecx \n\t" // xalpha + ASMALIGN(4) + "1: \n\t" + "mov %0, %%"REG_S" \n\t" + "movzbl (%%"REG_S", %%"REG_d"), %%edi \n\t" //src[xx] + "movzbl 1(%%"REG_S", %%"REG_d"), %%esi \n\t" //src[xx+1] + FAST_BILINEAR_X86 + "movw %%si, (%%"REG_D", %%"REG_a", 2) \n\t" + + "movzbl (%5, %%"REG_d"), %%edi \n\t" //src[xx] + "movzbl 1(%5, %%"REG_d"), %%esi \n\t" //src[xx+1] + FAST_BILINEAR_X86 + "movw %%si, "AV_STRINGIFY(VOF)"(%%"REG_D", %%"REG_a", 2) \n\t" + + "addw %4, %%cx \n\t" //xalpha += xInc&0xFFFF + "adc %3, %%"REG_d" \n\t" //xx+= xInc>>16 + carry + "add $1, %%"REG_a" \n\t" + "cmp %2, %%"REG_a" \n\t" + " jb 1b \n\t" + +/* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here, +which is needed to support GCC 4.0. */ +#if ARCH_X86_64 && AV_GCC_VERSION_AT_LEAST(3,4) + :: "m" (src1), "m" (dst), "g" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask), +#else + :: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask), +#endif + "r" (src2) + : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" + ); +#if COMPILE_TEMPLATE_MMX2 + } //if MMX2 can't be used +#endif +#else int i; unsigned int xpos=0; for (i=0;ichrMmx2FilterPos; - int16_t av_unused *mmx2Filter = c->chrMmx2Filter; - int av_unused canMMX2BeUsed = c->canMMX2BeUsed; - void av_unused *mmx2FilterCode= c->chrMmx2FilterCode; src1 += c->chrSrcOffset; src2 += c->chrSrcOffset; @@ -2452,105 +2550,7 @@ inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, c->hScale(dst , dstWidth, src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize); c->hScale(dst+VOFW, dstWidth, src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize); } else { // fast bilinear upscale / crap downscale -#if ARCH_X86 && CONFIG_GPL -#if COMPILE_TEMPLATE_MMX2 - int i; -#if defined(PIC) - DECLARE_ALIGNED(8, uint64_t, ebxsave); -#endif - if (canMMX2BeUsed) { - __asm__ volatile( -#if defined(PIC) - "mov %%"REG_b", %6 \n\t" -#endif - "pxor %%mm7, %%mm7 \n\t" - "mov %0, %%"REG_c" \n\t" - "mov %1, %%"REG_D" \n\t" - "mov %2, %%"REG_d" \n\t" - "mov %3, %%"REG_b" \n\t" - "xor %%"REG_a", %%"REG_a" \n\t" // i - PREFETCH" (%%"REG_c") \n\t" - PREFETCH" 32(%%"REG_c") \n\t" - PREFETCH" 64(%%"REG_c") \n\t" - - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - "xor %%"REG_a", %%"REG_a" \n\t" // i - "mov %5, %%"REG_c" \n\t" // src - "mov %1, %%"REG_D" \n\t" // buf1 - "add $"AV_STRINGIFY(VOF)", %%"REG_D" \n\t" - PREFETCH" (%%"REG_c") \n\t" - PREFETCH" 32(%%"REG_c") \n\t" - PREFETCH" 64(%%"REG_c") \n\t" - - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - CALL_MMX2_FILTER_CODE - -#if defined(PIC) - "mov %6, %%"REG_b" \n\t" -#endif - :: "m" (src1), "m" (dst), "m" (mmx2Filter), "m" (mmx2FilterPos), - "m" (mmx2FilterCode), "m" (src2) -#if defined(PIC) - ,"m" (ebxsave) -#endif - : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S, "%"REG_D -#if !defined(PIC) - ,"%"REG_b -#endif - ); - for (i=dstWidth-1; (i*xInc)>>16 >=srcW-1; i--) { - //printf("%d %d %d\n", dstWidth, i, srcW); - dst[i] = src1[srcW-1]*128; - dst[i+VOFW] = src2[srcW-1]*128; - } - } else { -#endif /* COMPILE_TEMPLATE_MMX2 */ - x86_reg xInc_shr16 = (x86_reg) (xInc >> 16); - uint16_t xInc_mask = xInc & 0xffff; - __asm__ volatile( - "xor %%"REG_a", %%"REG_a" \n\t" // i - "xor %%"REG_d", %%"REG_d" \n\t" // xx - "xorl %%ecx, %%ecx \n\t" // xalpha - ASMALIGN(4) - "1: \n\t" - "mov %0, %%"REG_S" \n\t" - "movzbl (%%"REG_S", %%"REG_d"), %%edi \n\t" //src[xx] - "movzbl 1(%%"REG_S", %%"REG_d"), %%esi \n\t" //src[xx+1] - FAST_BILINEAR_X86 - "movw %%si, (%%"REG_D", %%"REG_a", 2) \n\t" - - "movzbl (%5, %%"REG_d"), %%edi \n\t" //src[xx] - "movzbl 1(%5, %%"REG_d"), %%esi \n\t" //src[xx+1] - FAST_BILINEAR_X86 - "movw %%si, "AV_STRINGIFY(VOF)"(%%"REG_D", %%"REG_a", 2) \n\t" - - "addw %4, %%cx \n\t" //xalpha += xInc&0xFFFF - "adc %3, %%"REG_d" \n\t" //xx+= xInc>>16 + carry - "add $1, %%"REG_a" \n\t" - "cmp %2, %%"REG_a" \n\t" - " jb 1b \n\t" - -/* GCC 3.3 makes MPlayer crash on IA-32 machines when using "g" operand here, - which is needed to support GCC 4.0. */ -#if ARCH_X86_64 && AV_GCC_VERSION_AT_LEAST(3,4) - :: "m" (src1), "m" (dst), "g" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask), -#else - :: "m" (src1), "m" (dst), "m" (dstWidth), "m" (xInc_shr16), "m" (xInc_mask), -#endif - "r" (src2) - : "%"REG_a, "%"REG_d, "%ecx", "%"REG_D, "%esi" - ); -#if COMPILE_TEMPLATE_MMX2 - } //if MMX2 can't be used -#endif -#else c->hcscale_fast(c, dst, dstWidth, src1, src2, srcW, xInc); -#endif /* ARCH_X86 */ } if (c->chrConvertRange) From 34fb57ce561c74df1f15ef8938fbd4c752fa9ebc Mon Sep 17 00:00:00 2001 From: ramiro Date: Mon, 21 Dec 2009 01:59:34 +0000 Subject: [PATCH 31/36] Remove parameters no longer used in h[yc]scale(). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30099 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libswscale/swscale_template.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index c0a410bc52..65beb5b8fc 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -2382,9 +2382,9 @@ static inline void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, // *** horizontal scale Y line to temp buffer static inline void RENAME(hyscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src, int srcW, int xInc, - int flags, const int16_t *hLumFilter, + const int16_t *hLumFilter, const int16_t *hLumFilterPos, int hLumFilterSize, - enum PixelFormat srcFormat, uint8_t *formatConvBuffer, + uint8_t *formatConvBuffer, uint32_t *pal, int isAlpha) { void (*toYV12)(uint8_t *, const uint8_t *, long, uint32_t *) = isAlpha ? c->alpToYV12 : c->lumToYV12; @@ -2530,9 +2530,9 @@ which is needed to support GCC 4.0. */ } inline static void RENAME(hcscale)(SwsContext *c, uint16_t *dst, long dstWidth, const uint8_t *src1, const uint8_t *src2, - int srcW, int xInc, int flags, const int16_t *hChrFilter, + int srcW, int xInc, const int16_t *hChrFilter, const int16_t *hChrFilterPos, int hChrFilterSize, - enum PixelFormat srcFormat, uint8_t *formatConvBuffer, + uint8_t *formatConvBuffer, uint32_t *pal) { @@ -2693,13 +2693,13 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s assert(lastInLumBuf + 1 - srcSliceY < srcSliceH); assert(lastInLumBuf + 1 - srcSliceY >= 0); RENAME(hyscale)(c, lumPixBuf[ lumBufIndex ], dstW, src1, srcW, lumXInc, - flags, hLumFilter, hLumFilterPos, hLumFilterSize, - c->srcFormat, formatConvBuffer, + hLumFilter, hLumFilterPos, hLumFilterSize, + formatConvBuffer, pal, 0); if (CONFIG_SWSCALE_ALPHA && alpPixBuf) RENAME(hyscale)(c, alpPixBuf[ lumBufIndex ], dstW, src2, srcW, lumXInc, - flags, hLumFilter, hLumFilterPos, hLumFilterSize, - c->srcFormat, formatConvBuffer, + hLumFilter, hLumFilterPos, hLumFilterSize, + formatConvBuffer, pal, 1); lastInLumBuf++; } @@ -2716,8 +2716,8 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s if (c->needs_hcscale) RENAME(hcscale)(c, chrPixBuf[ chrBufIndex ], chrDstW, src1, src2, chrSrcW, chrXInc, - flags, hChrFilter, hChrFilterPos, hChrFilterSize, - c->srcFormat, formatConvBuffer, + hChrFilter, hChrFilterPos, hChrFilterSize, + formatConvBuffer, pal); lastInChrBuf++; } From 468d5f2e0a408ec794219d9bcbef2b330ac5c155 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Tue, 22 Dec 2009 20:56:59 +0000 Subject: [PATCH 32/36] Do not use correct-pts by default for demuxer lavf, it breaks all PAFF files. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30100 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_lavf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libmpdemux/demux_lavf.c b/libmpdemux/demux_lavf.c index a3b73ce531..27fbe4fac5 100644 --- a/libmpdemux/demux_lavf.c +++ b/libmpdemux/demux_lavf.c @@ -612,8 +612,6 @@ static int demux_lavf_control(demuxer_t *demuxer, int cmd, void *arg) lavf_priv_t *priv = demuxer->priv; switch (cmd) { - case DEMUXER_CTRL_CORRECT_PTS: - return DEMUXER_CTRL_OK; case DEMUXER_CTRL_GET_TIME_LENGTH: if (priv->avfc->duration == 0 || priv->avfc->duration == AV_NOPTS_VALUE) return DEMUXER_CTRL_DONTKNOW; From dfe6cfd9670f520d6f09d124667fac0e22ae9761 Mon Sep 17 00:00:00 2001 From: diego Date: Wed, 23 Dec 2009 10:21:53 +0000 Subject: [PATCH 33/36] Allow passing variants of "mingw32" as system name to --target. This ensures backwards compatibility after switching from "mingw32msvc" to "mingw32". git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30101 b3059339-0415-0410-9bf9-f77b7e298cf2 --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index f88adb8856..79a3395021 100755 --- a/configure +++ b/configure @@ -1434,7 +1434,7 @@ else # if test -z "$_target" qnx) system_name=QNX ;; morphos) system_name=MorphOS ;; amigaos) system_name=AmigaOS ;; - mingw32) system_name=MINGW32 ;; + mingw32*) system_name=MINGW32 ;; esac # We need to convert underscores so that values like k6-2 and pentium-mmx can be passed host_arch=$(echo $_target | cut -d '-' -f 1) From 7055e3cd054ce9dc8a5f96f651f53536ec5f8a2c Mon Sep 17 00:00:00 2001 From: kostya Date: Wed, 23 Dec 2009 13:44:23 +0000 Subject: [PATCH 34/36] Register lavc Aura decoder git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30102 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 2baa7311f6..37a3203f82 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -520,6 +520,14 @@ videocodec ffcyuv dll "cyuv" out 411P +videocodec ffaura + info "Auravision Aura (libavcodec)" + status working + fourcc aura,AURA + driver ffmpeg + dll "aura" + out 411P + videocodec ffmsrle info "Microsoft RLE" status working From 8eaf81f67672d10fe7186901b1a0271796755f69 Mon Sep 17 00:00:00 2001 From: kostya Date: Wed, 23 Dec 2009 16:11:48 +0000 Subject: [PATCH 35/36] Register lavc Aura 2 decoder git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30103 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 37a3203f82..4194c79b08 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -528,6 +528,14 @@ videocodec ffaura dll "aura" out 411P +videocodec ffaura2 + info "Auravision Aura 2 (libavcodec)" + status working + fourcc aur2,AUR2 + driver ffmpeg + dll "aura2" + out 422P + videocodec ffmsrle info "Microsoft RLE" status working From a0601ed2566d132fec57dcf163372f9f341f3c13 Mon Sep 17 00:00:00 2001 From: compn Date: Thu, 24 Dec 2009 04:36:04 +0000 Subject: [PATCH 36/36] create CDGR fourcc in mp_taglist and add ffcdgraphics to codecs.conf git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30104 b3059339-0415-0410-9bf9-f77b7e298cf2 --- etc/codecs.conf | 8 ++++++++ libmpdemux/mp_taglists.c | 1 + 2 files changed, 9 insertions(+) diff --git a/etc/codecs.conf b/etc/codecs.conf index 4194c79b08..8f05bf9203 100644 --- a/etc/codecs.conf +++ b/etc/codecs.conf @@ -9,6 +9,14 @@ release 20090308 ; VIDEO CODECS ;============================================================================= +videocodec ffcdgraphics + info "FFmpeg CD-Graphics" + status working + fourcc CDGR ; internal MPlayer FourCC + driver ffmpeg + dll cdgraphics + out BGR8 + videocodec ffmvi1 info "FFmpeg Motion Pixels" status working diff --git a/libmpdemux/mp_taglists.c b/libmpdemux/mp_taglists.c index 27cbe0c21d..34423d1c9f 100644 --- a/libmpdemux/mp_taglists.c +++ b/libmpdemux/mp_taglists.c @@ -86,6 +86,7 @@ static const AVCodecTag mp_bmp_tags[] = { { CODEC_ID_BETHSOFTVID, MKTAG('B', 'E', 'T', 'H')}, { CODEC_ID_BFI, MKTAG('B', 'F', 'I', 'V')}, { CODEC_ID_C93, MKTAG('C', '9', '3', 'V')}, + { CODEC_ID_CDGRAPHICS, MKTAG('C', 'D', 'G', 'R')}, { CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n')}, { CODEC_ID_DSICINVIDEO, MKTAG('D', 'C', 'I', 'V')}, { CODEC_ID_DXA, MKTAG('D', 'X', 'A', '1')},